@dropins/storefront-requisition-list 2.0.0 → 2.0.1-beta.0
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.
- package/CHANGELOG.md +7 -0
- package/LICENSE.md +296 -70
- package/api/initialize/initialize.d.ts +2 -2
- package/api.js.map +1 -1
- package/containers/RequisitionListForm/RequisitionListForm.d.ts +1 -1
- package/containers/RequisitionListForm.js +1 -1
- package/containers/RequisitionListGrid/RequisitionListGrid.d.ts +1 -1
- package/containers/RequisitionListGrid.js +1 -1
- package/containers/RequisitionListHeader/RequisitionListHeader.d.ts +1 -1
- package/containers/RequisitionListHeader.js +1 -1
- package/containers/RequisitionListSelector/RequisitionListSelector.d.ts +1 -1
- package/containers/RequisitionListSelector.js +1 -1
- package/containers/RequisitionListView/RequisitionListView.d.ts +1 -1
- package/containers/RequisitionListView.js +1 -1
- package/containers/ShareRequisitionListContent/ShareRequisitionListContent.d.ts +1 -1
- package/containers/ShareRequisitionListContent.js +1 -1
- package/containers/SharedRequisitionList/SharedRequisitionList.d.ts +1 -1
- package/containers/SharedRequisitionList.js +1 -1
- package/containers/SharedRequisitionList.js.map +1 -1
- package/package.json +1 -1
- package/render/render.d.ts +1 -1
- package/render.js +1 -1
- package/render.js.map +1 -1
package/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sources":["/@dropins/storefront-requisition-list/src/lib/state.ts","/@dropins/storefront-requisition-list/src/api/getStoreConfig/graphql/storeConfigQuery.ts","/@dropins/storefront-requisition-list/src/data/transforms/transform-requisition-list.ts","/@dropins/storefront-requisition-list/src/data/transforms/transform-store-config.ts","/@dropins/storefront-requisition-list/src/api/getStoreConfig/getStoreConfig.ts","/@dropins/storefront-requisition-list/src/api/initialize/initialize.ts","/@dropins/storefront-requisition-list/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-requisition-list/src/api/enrichConfigurableProducts/graphql/ConfigurableOptionsQuery.graphql.ts","/@dropins/storefront-requisition-list/src/api/enrichConfigurableProducts/graphql/RefineConfigurableVariantQuery.graphql.ts","/@dropins/storefront-requisition-list/src/api/enrichConfigurableProducts/enrichConfigurableProducts.ts","/@dropins/storefront-requisition-list/src/api/fragments/RequisitionListFragment.graphql.ts","/@dropins/storefront-requisition-list/src/api/fragments/RequisitionListItemsFragment.graphql.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/graphql/getRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionLists/graphql/getRequisitionLists.ts","/@dropins/storefront-requisition-list/src/lib/fetch-error.ts","/@dropins/storefront-requisition-list/src/lib/validate-uid.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionLists/getRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/getRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionList/graphql/updateRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionList/updateRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionList/graphql/deleteRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionList/deleteRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionListItems/graphql/updateRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionListItems/updateRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionListItems/graphql/deleteRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionListItems/deleteRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/addRequisitionListItemsToCart/graphql/addRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/addRequisitionListItemsToCart/addRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/moveItemsBetweenRequisitionLists/graphql/moveItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/moveItemsBetweenRequisitionLists/moveItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/copyItemsBetweenRequisitionLists/graphql/copyItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/copyItemsBetweenRequisitionLists/copyItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/getCompanyUsers/graphql/getCompanyUsers.ts","/@dropins/storefront-requisition-list/src/api/getCompanyUsers/getCompanyUsers.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByEmail/graphql/shareRequisitionListByEmail.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByEmail/shareRequisitionListByEmail.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByToken/graphql/shareRequisitionListByToken.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByToken/shareRequisitionListByToken.ts","/@dropins/storefront-requisition-list/src/api/getSharedRequisitionList/graphql/getSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getSharedRequisitionList/getSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/importSharedRequisitionList/graphql/importSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/importSharedRequisitionList/importSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getPublicRequisitionList/graphql/getPublicRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getPublicRequisitionList/getPublicRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/addPublicRequisitionListItemsToCart/graphql/addPublicRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/addPublicRequisitionListItemsToCart/addPublicRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/sharePublicRequisitionList/graphql/sharePublicRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/sharePublicRequisitionList/sharePublicRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getPublicRequisitionListToken/graphql/getPublicRequisitionListToken.ts","/@dropins/storefront-requisition-list/src/api/getPublicRequisitionListToken/getPublicRequisitionListToken.ts","/@dropins/storefront-requisition-list/src/api/createRequisitionList/graphql/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/createRequisitionList/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/addProductsToRequisitionList/graphql/addProductsToRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/addProductsToRequisitionList/addProductsToRequisitionList.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\nexport type StoreConfig = {\n is_requisition_list_active?: string;\n company_enabled?: boolean;\n requisition_list_sharing_enabled?: boolean;\n requisition_list_share_max_recipients?: number | null;\n requisition_list_share_storefront_path?: string | null;\n configurable_thumbnail_source?: string | null;\n requisition_list_public_sharing_enabled?: boolean;\n requisition_list_public_share_link_validity_days?: number | null;\n requisition_list_public_share_max_recipients?: number | null;\n requisition_list_public_share_storefront_path?: string | null;\n [key: string]: any; // Allow additional config properties\n};\n\nexport const isSharingEnabled = (config?: StoreConfig): boolean =>\n config?.requisition_list_sharing_enabled === true;\n\nexport const isPublicSharingEnabled = (config?: StoreConfig): boolean =>\n config?.requisition_list_public_sharing_enabled === true;\n\ntype State = {\n authenticated: boolean;\n config: StoreConfig | undefined;\n isCompanyUser: boolean;\n requisitionLists: RequisitionList[];\n requisitionListsLoading: boolean;\n requisitionListsVersion: number;\n};\n\nconst _state: State = (() => {\n return {\n authenticated: false,\n config: undefined,\n isCompanyUser: false,\n requisitionLists: [],\n requisitionListsLoading: false,\n requisitionListsVersion: 0,\n };\n})();\n\n// Proxy state to allow reactivity\nexport const state = new Proxy(_state, {\n set(target, key, value) {\n return Reflect.set(target, key, value);\n },\n get(target, key) {\n return target[key as keyof State];\n },\n});\n\n// Helper functions for managing requisition lists\nexport const setRequisitionLists = (lists: RequisitionList[]) => {\n state.requisitionLists = lists;\n state.requisitionListsVersion++;\n};\n\nexport const addRequisitionList = (list: RequisitionList) => {\n state.requisitionLists = [...state.requisitionLists, list];\n state.requisitionListsVersion++;\n};\n\nexport const updateRequisitionList = (list: RequisitionList) => {\n const exists = state.requisitionLists.some(\n (l: RequisitionList) => l.uid === list.uid,\n );\n\n if (exists) {\n state.requisitionLists = state.requisitionLists.map((l: RequisitionList) =>\n l.uid === list.uid ? list : l,\n );\n } else {\n state.requisitionLists = [...state.requisitionLists, list];\n }\n state.requisitionListsVersion++;\n};\n\nexport const getRequisitionListsFromState = () => {\n return state.requisitionLists;\n};\n\nexport const setRequisitionListsLoading = (loading: boolean) => {\n state.requisitionListsLoading = loading;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const STORE_CONFIG_QUERY = `\nquery STORE_CONFIG_QUERY {\n storeConfig {\n is_requisition_list_active\n company_enabled\n requisition_list_sharing_enabled\n requisition_list_share_max_recipients\n requisition_list_share_storefront_path\n configurable_thumbnail_source\n requisition_list_public_sharing_enabled\n requisition_list_public_share_link_validity_days\n requisition_list_public_share_max_recipients\n requisition_list_public_share_storefront_path\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { RequisitionList } from '../models/requisitionList';\nimport {\n Item,\n ConfiguredProduct,\n Link,\n Sample,\n BundleOption,\n ConfigurableOption,\n RawCustomizableOption,\n GiftCardOption,\n} from '@/requisitionList/data/models/item';\n\n// Interface for raw API response data for a requisition list\nexport interface RawRequisitionListData {\n name: string;\n description: string;\n uid: string;\n updated_at: string;\n items_count: number;\n is_public?: boolean;\n items: {\n items: RawItemData[];\n page_info: {\n total_pages: number;\n current_page: number;\n page_size: number;\n };\n };\n}\n\nexport function transformRequisitionList(\n data: RawRequisitionListData\n): RequisitionList | null {\n if (!data) {\n return null;\n }\n\n return {\n uid: data.uid,\n name: data.name,\n description: data.description,\n updated_at: data.updated_at,\n items_count: data.items_count,\n items: transformItems(data.items?.items),\n page_info: data.items?.page_info,\n is_public: data.is_public ?? false,\n };\n}\n\n// Interface for raw item data\ninterface RawItemData {\n uid: string;\n product: {\n sku: string;\n name?: string;\n small_image?: Item['image'];\n url_key?: string;\n stock_status?: string;\n only_x_left_in_stock?: number | null;\n };\n quantity: number;\n customizable_options?: RawCustomizableOption[];\n bundle_options?: BundleOption[];\n configurable_options?: ConfigurableOption[];\n configured_product?: ConfiguredProduct;\n links?: Link[];\n samples?: Sample[];\n gift_card_options?: GiftCardOption;\n}\n\nfunction transformItems(items: RawItemData[]): Item[] {\n if (!items?.length) return [];\n\n return items.map((item: RawItemData) => {\n const transformedItem = {\n uid: item.uid,\n sku: item.product?.sku,\n name: item.product?.name,\n image: item.product?.small_image,\n urlKey: item.product?.url_key,\n quantity: item.quantity,\n stock_status: (item.product?.stock_status || 'IN_STOCK') as\n | 'IN_STOCK'\n | 'OUT_OF_STOCK',\n only_x_left_in_stock: item.product?.only_x_left_in_stock ?? null,\n customizable_options: item.customizable_options\n ? item.customizable_options.map((option) => ({\n uid: option.customizable_option_uid,\n is_required: option.is_required,\n label: option.label,\n sort_order: option.sort_order,\n type: option.type,\n values: option.values.map(\n (value: RawCustomizableOption['values'][number]) => ({\n uid: value.customizable_option_value_uid,\n label: value.label,\n price: value.price,\n value: value.value,\n })\n ),\n }))\n : [],\n bundle_options: item.bundle_options || [],\n configurable_options: item.configurable_options\n ? item.configurable_options.map((option) => ({\n option_uid: option.configurable_product_option_uid,\n option_label: option.option_label,\n value_uid: option.configurable_product_option_value_uid,\n value_label: option.value_label,\n }))\n : [],\n samples: item.samples\n ? item.samples.map((sample) => ({\n url: sample.sample_url,\n sort_order: sample.sort_order,\n title: sample.title,\n }))\n : [],\n gift_card_options: item.gift_card_options || {},\n };\n\n if (item.configured_product?.name) {\n return {\n ...transformedItem,\n configured_product: item.configured_product,\n };\n }\n return transformedItem;\n });\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { StoreConfig } from '@/requisitionList/lib/state';\n\n// Some config scalars are legacy Magento values that may arrive as \"0\"/\"1\"\n// strings rather than real booleans; cast once here so the rest of the app\n// only ever deals with a plain boolean/number.\nexport function transformStoreConfig(data: any): StoreConfig {\n return {\n ...data,\n requisition_list_sharing_enabled: Boolean(\n +data?.requisition_list_sharing_enabled,\n ),\n requisition_list_share_max_recipients:\n data?.requisition_list_share_max_recipients != null\n ? +data.requisition_list_share_max_recipients\n : null,\n requisition_list_public_sharing_enabled: Boolean(\n +data?.requisition_list_public_sharing_enabled,\n ),\n requisition_list_public_share_link_validity_days:\n data?.requisition_list_public_share_link_validity_days != null\n ? +data.requisition_list_public_share_link_validity_days\n : null,\n requisition_list_public_share_max_recipients:\n data?.requisition_list_public_share_max_recipients != null\n ? +data.requisition_list_public_share_max_recipients\n : null,\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\n\nimport { STORE_CONFIG_QUERY } from './graphql/storeConfigQuery';\nimport { StoreConfig } from '@/requisitionList/lib/state';\nimport { transformStoreConfig } from '@/requisitionList/data/transforms';\n\nconst DEFAULT_STORE_CONFIG: StoreConfig = {\n is_requisition_list_active: '0',\n company_enabled: false,\n requisition_list_sharing_enabled: false,\n requisition_list_share_max_recipients: null,\n requisition_list_share_storefront_path: null,\n configurable_thumbnail_source: null,\n requisition_list_public_sharing_enabled: false,\n requisition_list_public_share_link_validity_days: null,\n requisition_list_public_share_max_recipients: null,\n requisition_list_public_share_storefront_path: null,\n};\n\nexport const getStoreConfig = async (): Promise<any> => {\n try {\n const { errors, data } = await fetchGraphQl(STORE_CONFIG_QUERY, {\n cache: 'force-cache',\n });\n\n const missingCoreField = errors?.some(\n (error) =>\n error.message?.includes(\n 'Cannot query field \"is_requisition_list_active\"',\n ) || error.message?.includes('Cannot query field \"company_enabled\"'),\n );\n if (missingCoreField) {\n return false;\n }\n\n if (errors?.length || !data?.storeConfig) {\n return DEFAULT_STORE_CONFIG;\n }\n\n return transformStoreConfig(data.storeConfig);\n } catch {\n return DEFAULT_STORE_CONFIG;\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/requisitionList/lib/state';\nimport { getStoreConfig } from '@/requisitionList/api/getStoreConfig';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n // set config\n if (!state.config) {\n state.config = await getStoreConfig();\n // Emit event to notify listeners that requisition list has been initialized\n events.emit('requisitionList/initialized', state.config);\n }\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [\n events.on('authenticated', (authenticated) => {\n state.authenticated = authenticated;\n if (!authenticated) {\n state.isCompanyUser = false;\n }\n }),\n\n events.on(\n 'auth/permissions',\n (payload) => {\n // Company users have admin: true (company admin) or at least one\n // Magento_Company::* key. Checking these specifically avoids false\n // positives from B2C-only permissions (e.g. Magento_Sales::place_order).\n state.isCompanyUser =\n payload != null &&\n typeof payload === 'object' &&\n Object.entries(payload).some(\n ([key, value]) =>\n value === true &&\n (key === 'admin' || key.startsWith('Magento_Company::'))\n );\n },\n { eager: true }\n ),\n ],\n});\n\nexport const config = initialize.config;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const CONFIGURABLE_OPTIONS_QUERY = `\nquery CONFIGURABLE_OPTIONS_QUERY($skus: [String]) {\n products(skus: $skus) {\n sku\n ... on ComplexProductView {\n options {\n title\n values {\n id\n title\n }\n }\n }\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REFINE_CONFIGURABLE_VARIANT_QUERY = `\nquery REFINE_CONFIGURABLE_VARIANT_QUERY($sku: String!, $optionIds: [String!]!) {\n refineProduct(sku: $sku, optionIds: $optionIds) {\n ...PRODUCT_VARIANT_FRAGMENT\n }\n}\n\nfragment PRODUCT_VARIANT_FRAGMENT on ProductView {\n sku\n name\n images(roles: []) {\n url\n }\n ... on SimpleProductView {\n price {\n regular {\n amount {\n value\n currency\n }\n }\n final {\n amount {\n value\n currency\n }\n }\n }\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { Item, ConfiguredProduct } from '@/requisitionList/data/models/item';\nimport { CONFIGURABLE_OPTIONS_QUERY } from './graphql/ConfigurableOptionsQuery.graphql';\nimport { REFINE_CONFIGURABLE_VARIANT_QUERY } from './graphql/RefineConfigurableVariantQuery.graphql';\n\ninterface RawOptionValue {\n id: string;\n title: string;\n}\n\ninterface RawOption {\n title: string;\n values: RawOptionValue[];\n}\n\ninterface RawComplexProduct {\n sku: string;\n options?: RawOption[];\n}\n\ninterface RawVariantProduct {\n sku: string;\n name: string;\n images?: { url: string }[];\n price?: {\n regular?: { amount: { value: number; currency: string } };\n final?: { amount: { value: number; currency: string } };\n };\n}\n\n// Requisition list items only carry the human-readable option/value labels\n// (`option_label`/`value_label`), not usable IDs: the UID Commerce encodes\n// for them is a core-Commerce-only identifier that doesn't correspond to\n// Catalog Service's opaque option value IDs. Resolving the selected variant\n// therefore means looking up the parent's Catalog Service options by title\n// and matching the same labels, rather than decoding/reusing any UID.\nconst resolveOptionIds = (item: Item, options: RawOption[]): string[] | null => {\n const optionIds: string[] = [];\n\n for (const selected of item.configurable_options!) {\n const option = options.find((o) => o.title === selected.option_label);\n const value = option?.values.find((v) => v.title === selected.value_label);\n\n if (!value) {\n return null;\n }\n\n optionIds.push(value.id);\n }\n\n return optionIds;\n};\n\nconst toConfiguredProduct = (product: RawVariantProduct): ConfiguredProduct => ({\n name: product.name,\n sku: product.sku,\n images: product.images?.length ? [{ url: product.images[0].url }] : undefined,\n price: {\n regular: product.price?.regular\n ? {\n amount: {\n value: product.price.regular.amount.value,\n currency: product.price.regular.amount.currency,\n },\n }\n : undefined,\n final: {\n amount: {\n value: product.price?.final?.amount.value || 0,\n currency: product.price?.final?.amount.currency || '',\n },\n },\n },\n});\n\n/**\n * Default variant resolver for configurable requisition list items.\n *\n * Requisition list items only carry the parent (configurable) SKU and the\n * selected option labels, not the child/variant product. This resolves the\n * matching simple product variant via Catalog Service's `refineProduct`\n * (the same mechanism the PDP dropin uses for swatch selection) so SKU,\n * price and thumbnail can reflect the selected variant, consistent with\n * the cart.\n */\nexport const enrichConfigurableProducts = async (\n items: Item[]\n): Promise<Item[]> => {\n const configurableItems = items.filter(\n (item) => item.sku && item.configurable_options?.length\n );\n\n if (!configurableItems.length) {\n return items;\n }\n\n const parentSkus = Array.from(\n new Set(configurableItems.map((item) => item.sku))\n );\n\n let optionsBySku: Record<string, RawOption[]>;\n try {\n const { errors, data } = await fetchGraphQl(CONFIGURABLE_OPTIONS_QUERY, {\n variables: { skus: parentSkus },\n });\n\n if (errors || !data?.products) {\n return items;\n }\n\n optionsBySku = (data.products as RawComplexProduct[]).reduce(\n (acc: Record<string, RawOption[]>, product) => {\n if (product) {\n acc[product.sku] = product.options || [];\n }\n return acc;\n },\n {}\n );\n } catch {\n return items;\n }\n\n const refinements = new Map<Item, string[]>();\n for (const item of configurableItems) {\n const options = optionsBySku[item.sku!];\n if (!options?.length) {\n continue;\n }\n\n const optionIds = resolveOptionIds(item, options);\n if (optionIds) {\n refinements.set(item, optionIds);\n }\n }\n\n if (!refinements.size) {\n return items;\n }\n\n const refinedProducts = await Promise.all(\n Array.from(refinements.entries()).map(async ([item, optionIds]) => {\n try {\n const { errors, data } = await fetchGraphQl(\n REFINE_CONFIGURABLE_VARIANT_QUERY,\n { variables: { sku: item.sku, optionIds } }\n );\n\n if (errors || !data?.refineProduct) {\n return null;\n }\n\n return { item, product: data.refineProduct as RawVariantProduct };\n } catch {\n return null;\n }\n })\n );\n\n const configuredProductByItem = new Map<Item, ConfiguredProduct>();\n refinedProducts.forEach((refined) => {\n if (refined) {\n configuredProductByItem.set(refined.item, toConfiguredProduct(refined.product));\n }\n });\n\n if (!configuredProductByItem.size) {\n return items;\n }\n\n return items.map((item) => {\n const configuredProduct = configuredProductByItem.get(item);\n return configuredProduct ? { ...item, configured_product: configuredProduct } : item;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REQUISITION_LIST_FRAGMENT = `\nfragment REQUISITION_LIST_FRAGMENT on RequisitionList {\n uid\n name\n description\n items_count\n updated_at\n is_public\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REQUISITION_LIST_ITEMS_FRAGMENT = `\nfragment REQUISITION_LIST_ITEMS_FRAGMENT on RequistionListItems {\n items {\n uid\n quantity\n product {\n sku\n stock_status\n only_x_left_in_stock\n }\n customizable_options {\n customizable_option_uid\n is_required\n label\n sort_order\n type\n values {\n customizable_option_value_uid\n label\n value\n price {\n type\n units\n value\n }\n }\n }\n ... on ConfigurableRequisitionListItem {\n configurable_options {\n configurable_product_option_uid\n configurable_product_option_value_uid\n option_label\n value_label\n }\n }\n ... on DownloadableRequisitionListItem {\n links {\n price\n sample_url\n sort_order\n title\n uid\n }\n samples {\n sample_url\n sort_order\n title\n }\n }\n ... on BundleRequisitionListItem {\n bundle_options {\n uid\n type\n label\n values {\n uid\n label\n quantity\n priceV2 {\n value\n currency\n }\n original_price {\n value\n currency\n }\n }\n }\n }\n ... on GiftCardRequisitionListItem {\n gift_card_options {\n amount {\n currency\n value\n }\n custom_giftcard_amount {\n currency\n value\n }\n message\n recipient_email\n recipient_name\n sender_name\n sender_email\n }\n }\n }\n page_info {\n page_size\n current_page\n total_pages\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const GET_REQUISITION_LIST_QUERY = `\n query GET_REQUISITION_LIST_QUERY(\n $requisitionListUid: String,\n $currentPage: Int = 1,\n $pageSize: Int = 10,\n ) {\n customer {\n requisition_lists (\n filter: {\n uids: {\n eq: $requisitionListUid\n }\n }\n ){\n items {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\n/**\n * Nested list line items use pagination. Default listItemsPageSize is 100 per page;\n * getRequisitionLists fetches further pages per list when page_info.total_pages > 1\n * so PDP \"active\" / membership checks are not limited to the first page only.\n */\nexport const GET_REQUISITION_LISTS_QUERY = `\n query GET_REQUISITION_LISTS_QUERY(\n $currentPage: Int = 1\n $pageSize: Int = 10,\n $listItemsPageSize: Int = 100,\n $listItemsCurrentPage: Int = 1,\n ) {\n customer {\n requisition_lists(pageSize: $pageSize, currentPage: $currentPage) {\n items {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $listItemsPageSize, currentPage: $listItemsCurrentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n page_info {\n page_size\n current_page\n total_pages\n }\n total_count\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/** Actions */\nexport const handleFetchError = (errors: Array<{ message: string }>) => {\n const errorMessage = errors.map((e: any) => e.message).join(' ');\n\n throw Error(errorMessage);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Validates if a string is a valid base64-encoded UID\n * Adobe Commerce/Magento UIDs are base64 encoded\n *\n * @param uid - The UID to validate\n * @returns true if the UID appears to be valid base64 encoding\n */\nexport function isValidBase64Uid(uid: string | undefined | null): boolean {\n if (!uid || typeof uid !== 'string' || uid.length < 2) {\n return false;\n }\n\n // Base64 pattern: alphanumeric, +, /\n // Valid base64 can end with 0, 1, or 2 '=' padding characters\n // But the length must be a multiple of 4 when padded\n const base64Pattern = /^[A-Za-z0-9+/]+(==|=)?$/;\n\n if (!base64Pattern.test(uid)) {\n return false;\n }\n\n // Check that the total length is a multiple of 4 (valid base64 requirement)\n return uid.length % 4 === 0;\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getRequisitionList/graphql/getRequisitionList';\nimport { GET_REQUISITION_LISTS_QUERY } from '@/requisitionList/api/getRequisitionLists/graphql/getRequisitionLists';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { events } from '@adobe-commerce/event-bus';\n\nasync function mergeRemainingListItemPages(\n list: RequisitionList,\n listItemsPageSize: number\n): Promise<RequisitionList> {\n const pi = list.page_info;\n if (!pi || pi.total_pages <= 1 || pi.current_page >= pi.total_pages) {\n return list;\n }\n\n const uid = String(list.uid);\n if (!isValidBase64Uid(uid)) {\n return list;\n }\n\n const mergedItems: Item[] = [...(list.items ?? [])];\n\n for (let page = pi.current_page + 1; page <= pi.total_pages; page += 1) {\n const { errors, data } = await fetchGraphQl(GET_REQUISITION_LIST_QUERY, {\n variables: {\n requisitionListUid: uid,\n currentPage: page,\n pageSize: listItemsPageSize,\n },\n });\n\n if (errors) {\n handleFetchError(errors);\n }\n\n const raw = data?.customer?.requisition_lists?.items?.[0];\n if (!raw) {\n break;\n }\n\n const chunk = transformRequisitionList(raw);\n if (chunk?.items?.length) {\n mergedItems.push(...chunk.items);\n }\n }\n\n return {\n ...list,\n items: mergedItems,\n page_info: {\n current_page: 1,\n total_pages: 1,\n page_size: mergedItems.length,\n },\n };\n}\n\nexport const getRequisitionLists = async (\n currentPage?: number,\n pageSize?: number,\n listItemsPageSize: number = 100\n): Promise<RequisitionList[] | null> => {\n const { errors, data } = await fetchGraphQl(GET_REQUISITION_LISTS_QUERY, {\n variables: {\n currentPage,\n pageSize,\n listItemsPageSize,\n listItemsCurrentPage: 1,\n },\n });\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.requisition_lists) {\n return null;\n }\n\n let reqLists = data.customer.requisition_lists.items.map(\n (requisitionList: any) => transformRequisitionList(requisitionList)\n );\n\n reqLists = await Promise.all(\n reqLists.map((list) =>\n list == null\n ? Promise.resolve(list)\n : mergeRemainingListItemPages(list, listItemsPageSize)\n )\n );\n\n events.emit('requisitionLists/data', reqLists);\n\n return {\n items: reqLists,\n page_info: data.customer?.requisition_lists?.page_info,\n total_count: data.customer?.requisition_lists?.total_count,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getRequisitionList/graphql/getRequisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { enrichConfigurableProducts as defaultEnrichConfigurableProducts } from '@/requisitionList/api/enrichConfigurableProducts';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const getRequisitionList = async (\n requisitionListID: string,\n currentPage?: number,\n pageSize?: number,\n enrichConfigurableProducts: (\n items: Item[]\n ) => Promise<Item[]> = defaultEnrichConfigurableProducts\n): Promise<RequisitionList | null> => {\n // Validate UID format before making API call\n if (!isValidBase64Uid(requisitionListID)) {\n console.error('Invalid requisition list UID format:', requisitionListID);\n return null;\n }\n\n const { errors, data } = await fetchGraphQl(GET_REQUISITION_LIST_QUERY, {\n variables: {\n requisitionListUid: requisitionListID,\n currentPage,\n pageSize,\n },\n });\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.requisition_lists?.items?.[0]) {\n return null;\n }\n\n const rawList = data.customer.requisition_lists.items[0];\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const UPDATE_REQUISITION_LIST_MUTATION = `\n mutation UPDATE_REQUISITION_LIST_MUTATION(\n $requisitionListUid: ID!,\n $name: String!,\n $description: String,\n $isPublic: Boolean,\n $pageSize: Int,\n $currentPage: Int\n ) {\n updateRequisitionList(\n requisitionListUid: $requisitionListUid\n input: {\n name: $name\n description: $description\n is_public: $isPublic\n }\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { enrichConfigurableProducts as defaultEnrichConfigurableProducts } from '@/requisitionList/api/enrichConfigurableProducts';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { UPDATE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/updateRequisitionList/graphql/updateRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const updateRequisitionList = async (\n requisitionListUid: string,\n name: string,\n description?: string,\n pageSize?: number,\n currentPage?: number,\n enrichConfigurableProducts: (\n items: Item[]\n ) => Promise<Item[]> = defaultEnrichConfigurableProducts,\n isPublic?: boolean\n): Promise<RequisitionList | null> => {\n const { errors, data } = await fetchGraphQl(UPDATE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListUid,\n name,\n description,\n isPublic,\n pageSize,\n currentPage,\n },\n });\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.updateRequisitionList?.requisition_list) {\n return null;\n }\n\n const rawList = data.updateRequisitionList.requisition_list;\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const DELETE_REQUISITION_LIST_MUTATION = `\n mutation DELETE_REQUISITION_LIST_MUTATION(\n $requisitionListUid: ID!,\n ) {\n deleteRequisitionList(\n requisitionListUid: $requisitionListUid\n ) {\n status\n requisition_lists {\n items {\n ...REQUISITION_LIST_FRAGMENT\n }\n page_info {\n page_size\n current_page\n total_pages\n }\n total_count\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { DELETE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/deleteRequisitionList/graphql/deleteRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const deleteRequisitionList = async (\n requisitionListUid: string\n): Promise<{\n items: RequisitionList[];\n page_info: any;\n status: any;\n} | null> => {\n return fetchGraphQl(DELETE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListUid,\n },\n }).then(({ errors, data }) => {\n if (!requisitionListUid) return null;\n if (errors) return handleFetchError(errors);\n\n if (!data?.deleteRequisitionList?.requisition_lists) {\n return null;\n }\n\n const reqLists =\n data.deleteRequisitionList.requisition_lists?.items?.map(\n (requisitionList: any) => transformRequisitionList(requisitionList)\n ) || [];\n\n events.emit('requisitionLists/data', reqLists);\n\n return {\n items: reqLists,\n page_info: data.deleteRequisitionList?.requisition_lists?.page_info,\n status: data.deleteRequisitionList?.status,\n };\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const UPDATE_REQUISITION_LIST_ITEMS_MUTATION = `\n mutation UPDATE_REQUISITION_LIST_ITEMS_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItems: [UpdateRequisitionListItemsInput!]!,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n updateRequisitionListItems(\n requisitionListUid: $requisitionListUid\n requisitionListItems: $requisitionListItems\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { enrichConfigurableProducts as defaultEnrichConfigurableProducts } from '@/requisitionList/api/enrichConfigurableProducts';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { UPDATE_REQUISITION_LIST_ITEMS_MUTATION } from '@/requisitionList/api/updateRequisitionListItems/graphql/updateRequisitionListItems';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const updateRequisitionListItems = async (\n requisitionListUid: string,\n requisitionListItems: Array<UpdateRequisitionListItemsInput>,\n pageSize: number,\n currentPage: number,\n enrichConfigurableProducts: (\n items: Item[]\n ) => Promise<Item[]> = defaultEnrichConfigurableProducts\n): Promise<RequisitionList | null> => {\n const { errors, data } = await fetchGraphQl(\n UPDATE_REQUISITION_LIST_ITEMS_MUTATION,\n {\n variables: {\n requisitionListUid,\n requisitionListItems,\n pageSize,\n currentPage,\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.updateRequisitionListItems?.requisition_list) {\n return null;\n }\n\n const rawList = data.updateRequisitionListItems.requisition_list;\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n\ntype UpdateRequisitionListItemsInput = {\n item_id: string;\n quantity?: number;\n entered_options?: Array<{ uid: string; value: string }>;\n selected_options?: Array<string>;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const DELETE_REQUISITION_LIST_ITEMS_MUTATION = `\n mutation DELETE_REQUISITION_LIST_ITEMS_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItemUids: [ID!]!,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n deleteRequisitionListItems(\n requisitionListUid: $requisitionListUid\n requisitionListItemUids: $requisitionListItemUids\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { enrichConfigurableProducts as defaultEnrichConfigurableProducts } from '@/requisitionList/api/enrichConfigurableProducts';\nimport { DELETE_REQUISITION_LIST_ITEMS_MUTATION } from '@/requisitionList/api/deleteRequisitionListItems/graphql/deleteRequisitionListItems';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const deleteRequisitionListItems = async (\n requisitionListUid: string,\n items: Array<string>,\n pageSize: number,\n currentPage: number,\n enrichConfigurableProducts: (\n items: Item[]\n ) => Promise<Item[]> = defaultEnrichConfigurableProducts\n): Promise<RequisitionList | null> => {\n const { errors, data } = await fetchGraphQl(\n DELETE_REQUISITION_LIST_ITEMS_MUTATION,\n {\n variables: {\n requisitionListUid,\n requisitionListItemUids: items,\n pageSize,\n currentPage,\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.deleteRequisitionListItems?.requisition_list) {\n return null;\n }\n\n const rawList = data.deleteRequisitionListItems.requisition_list;\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION = `\n mutation ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItemUids: [ID!]!\n ) {\n addRequisitionListItemsToCart(\n requisitionListUid: $requisitionListUid\n requisitionListItemUids: $requisitionListItemUids\n ) {\n status\n add_requisition_list_items_to_cart_user_errors {\n message\n type\n }\n cart {\n id\n itemsV2 {\n items {\n uid\n quantity\n is_available\n }\n total_count\n }\n email\n total_quantity\n is_virtual\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION } from '@/requisitionList/api/addRequisitionListItemsToCart/graphql/addRequisitionListItemsToCart';\n\nexport interface AddToCartError {\n type: string;\n message: string;\n}\n\nexport const addRequisitionListItemsToCart = async (\n requisitionListUid: string,\n requisitionListItemUids: Array<string>\n): Promise<Array<AddToCartError> | null> => {\n return fetchGraphQl(ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION, {\n variables: {\n requisitionListUid,\n requisitionListItemUids,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (\n data.addRequisitionListItemsToCart\n .add_requisition_list_items_to_cart_user_errors?.length\n ) {\n return data.addRequisitionListItemsToCart.add_requisition_list_items_to_cart_user_errors.map(\n (e: any) => ({\n type: e.type,\n message: e.message || '',\n })\n );\n }\n return null;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION = `\n mutation MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION(\n $sourceRequisitionListUid: ID!,\n $destinationRequisitionListUid: ID!,\n $requisitionListItem: MoveItemsBetweenRequisitionListsInput,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n moveItemsBetweenRequisitionLists(\n sourceRequisitionListUid: $sourceRequisitionListUid\n destinationRequisitionListUid: $destinationRequisitionListUid\n requisitionListItem: $requisitionListItem\n ) {\n source_requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n destination_requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION } from '@/requisitionList/api/moveItemsBetweenRequisitionLists/graphql/moveItemsBetweenRequisitionLists';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface MoveItemsResult {\n sourceList: RequisitionList | null;\n destinationList: RequisitionList | null;\n}\n\nexport const moveItemsBetweenRequisitionLists = async (\n sourceRequisitionListUid: string,\n destinationRequisitionListUid: string,\n requisitionListItemUids: string[],\n pageSize: number,\n currentPage: number\n): Promise<MoveItemsResult | null> => {\n const { errors, data } = await fetchGraphQl(\n MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION,\n {\n variables: {\n sourceRequisitionListUid,\n destinationRequisitionListUid,\n requisitionListItem: {\n requisitionListItemUids,\n },\n pageSize,\n currentPage,\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.moveItemsBetweenRequisitionLists) {\n return null;\n }\n\n const { source_requisition_list, destination_requisition_list } =\n data.moveItemsBetweenRequisitionLists;\n\n const sourceList = source_requisition_list\n ? transformRequisitionList(source_requisition_list)\n : null;\n\n const destinationList = destination_requisition_list\n ? transformRequisitionList(destination_requisition_list)\n : null;\n\n if (sourceList) {\n events.emit('requisitionList/data', sourceList);\n }\n\n return { sourceList, destinationList };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION = `\n mutation COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION(\n $sourceRequisitionListUid: ID!,\n $destinationRequisitionListUid: ID!,\n $requisitionListItem: CopyItemsBetweenRequisitionListsInput\n ) {\n copyItemsBetweenRequisitionLists(\n sourceRequisitionListUid: $sourceRequisitionListUid\n destinationRequisitionListUid: $destinationRequisitionListUid\n requisitionListItem: $requisitionListItem\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION } from '@/requisitionList/api/copyItemsBetweenRequisitionLists/graphql/copyItemsBetweenRequisitionLists';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\n\nexport interface CopyItemsResult {\n destinationList: RequisitionList | null;\n}\n\nexport const copyItemsBetweenRequisitionLists = async (\n sourceRequisitionListUid: string,\n destinationRequisitionListUid: string,\n requisitionListItemUids: string[]\n): Promise<CopyItemsResult | null> => {\n const { errors, data } = await fetchGraphQl(\n COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION,\n {\n variables: {\n sourceRequisitionListUid,\n destinationRequisitionListUid,\n requisitionListItem: {\n requisitionListItemUids,\n },\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.copyItemsBetweenRequisitionLists?.requisition_list) {\n return null;\n }\n\n const destinationList = transformRequisitionList(\n data.copyItemsBetweenRequisitionLists.requisition_list\n );\n\n return { destinationList };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_COMPANY_USERS_QUERY = `\n query GET_COMPANY_USERS_QUERY(\n $pageSize: Int = 100\n $currentPage: Int = 1\n ) {\n company {\n users(\n filter: { status: ACTIVE }\n pageSize: $pageSize\n currentPage: $currentPage\n ) {\n items {\n id\n firstname\n lastname\n email\n }\n page_info {\n total_pages\n current_page\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { GET_COMPANY_USERS_QUERY } from '@/requisitionList/api/getCompanyUsers/graphql/getCompanyUsers';\n\nexport interface CompanyUser {\n id: string;\n firstname: string;\n lastname: string;\n email: string;\n}\n\nconst PAGE_SIZE = 100;\n\nconst fetchPage = async (\n currentPage: number\n): Promise<{ items: CompanyUser[]; totalPages: number } | null> => {\n const { errors, data } = await fetchGraphQl(GET_COMPANY_USERS_QUERY, {\n variables: { pageSize: PAGE_SIZE, currentPage },\n });\n if (errors) return null;\n const users = data?.company?.users;\n if (!users?.items?.length) return null;\n return {\n items: users.items,\n totalPages: users.page_info?.total_pages ?? 1,\n };\n};\n\nexport const getCompanyUsers = async (): Promise<CompanyUser[]> => {\n const firstPage = await fetchPage(1);\n if (!firstPage) return [];\n\n const { items, totalPages } = firstPage;\n if (totalPages <= 1) return items;\n\n const remainingPages = await Promise.all(\n Array.from({ length: totalPages - 1 }, (_, i) => fetchPage(i + 2))\n );\n\n return [\n ...items,\n ...remainingPages.flatMap((page) => page?.items ?? []),\n ];\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION = `\n mutation SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION(\n $requisitionListUid: ID!\n $customerUids: [ID!]!\n ) {\n shareRequisitionListByEmail(\n input: {\n requisitionListUid: $requisitionListUid\n customerUids: $customerUids\n }\n ) {\n sent_count\n user_errors {\n message\n code\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION } from '@/requisitionList/api/shareRequisitionListByEmail/graphql/shareRequisitionListByEmail';\n\nexport interface ShareRequisitionListByEmailError {\n message: string;\n code: string;\n}\n\nexport const shareRequisitionListByEmail = async (\n requisitionListUid: string,\n customerUids: string[]\n): Promise<Array<ShareRequisitionListByEmailError> | null> => {\n return fetchGraphQl(SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION, {\n variables: { requisitionListUid, customerUids },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n const shareResult = data?.shareRequisitionListByEmail;\n\n if ((shareResult?.sent_count ?? 0) > 0) {\n return null;\n }\n\n if (shareResult?.user_errors?.length) {\n return shareResult.user_errors.map((e: ShareRequisitionListByEmailError) => ({\n message: e.message,\n code: e.code,\n }));\n }\n return [\n { code: 'SHARE_FAILED', message: 'Unable to share requisition list.' },\n ];\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION = `\n mutation SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION(\n $requisitionListUid: ID!\n ) {\n shareRequisitionListByToken(\n requisitionListUid: $requisitionListUid\n ) {\n token\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION } from '@/requisitionList/api/shareRequisitionListByToken/graphql/shareRequisitionListByToken';\n\nexport interface ShareRequisitionListByTokenResult {\n token: string | null;\n errorMessage: string | null;\n}\n\nexport const shareRequisitionListByToken = async (\n requisitionListUid: string\n): Promise<ShareRequisitionListByTokenResult> => {\n try {\n const { errors, data } = await fetchGraphQl(\n SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION,\n { variables: { requisitionListUid } }\n );\n\n if (errors?.length) {\n return {\n token: null,\n errorMessage: errors[0]?.message ?? null,\n };\n }\n\n return {\n token: data?.shareRequisitionListByToken?.token ?? null,\n errorMessage: null,\n };\n } catch (error) {\n return {\n token: null,\n errorMessage:\n error instanceof Error\n ? error.message\n : 'Unable to generate share link.',\n };\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const GET_SHARED_REQUISITION_LIST_QUERY = `\n query GET_SHARED_REQUISITION_LIST_QUERY(\n $token: String!\n $currentPage: Int = 1\n $pageSize: Int = 10\n ) {\n sharedRequisitionList(token: $token) {\n sender_name\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { enrichConfigurableProducts as defaultEnrichConfigurableProducts } from '@/requisitionList/api/enrichConfigurableProducts';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { GET_SHARED_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getSharedRequisitionList/graphql/getSharedRequisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\n\nexport interface SharedRequisitionListResult {\n senderName: string;\n requisitionList: RequisitionList;\n}\n\nexport const getSharedRequisitionList = async (\n token: string,\n currentPage?: number,\n pageSize?: number,\n enrichConfigurableProducts: (\n items: Item[]\n ) => Promise<Item[]> = defaultEnrichConfigurableProducts\n): Promise<SharedRequisitionListResult | null> => {\n const { errors, data } = await fetchGraphQl(GET_SHARED_REQUISITION_LIST_QUERY, {\n variables: { token, currentPage, pageSize },\n });\n\n if (errors) return handleFetchError(errors);\n\n const raw = data?.sharedRequisitionList;\n if (!raw?.requisition_list) {\n return null;\n }\n\n let requisitionList = transformRequisitionList(raw.requisition_list);\n if (!requisitionList) {\n return null;\n }\n\n if (requisitionList.items?.length && enrichConfigurableProducts) {\n requisitionList = {\n ...requisitionList,\n items: await enrichConfigurableProducts(requisitionList.items),\n };\n }\n\n return {\n senderName: raw.sender_name,\n requisitionList,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const IMPORT_SHARED_REQUISITION_LIST_MUTATION = `\n mutation IMPORT_SHARED_REQUISITION_LIST_MUTATION($token: String!) {\n importSharedRequisitionList(token: $token) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n user_errors {\n message\n code\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { IMPORT_SHARED_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/importSharedRequisitionList/graphql/importSharedRequisitionList';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\n\nexport interface ImportSharedRequisitionListUserError {\n message: string;\n code: string;\n}\n\nexport interface ImportSharedRequisitionListResult {\n requisitionList: RequisitionList | null;\n userErrors: ImportSharedRequisitionListUserError[];\n}\n\nexport const importSharedRequisitionList = async (\n token: string\n): Promise<ImportSharedRequisitionListResult> => {\n const { errors, data } = await fetchGraphQl(\n IMPORT_SHARED_REQUISITION_LIST_MUTATION,\n { variables: { token } }\n );\n\n if (errors) return handleFetchError(errors);\n\n const result = data?.importSharedRequisitionList;\n\n return {\n requisitionList: result?.requisition_list\n ? (transformRequisitionList(result.requisition_list) ?? null)\n : null,\n userErrors: (result?.user_errors ?? []).map((e: ImportSharedRequisitionListUserError) => ({\n message: e.message,\n code: e.code,\n })),\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const GET_PUBLIC_REQUISITION_LIST_QUERY = `\n query GET_PUBLIC_REQUISITION_LIST_QUERY(\n $token: ID!\n $currentPage: Int = 1\n $pageSize: Int = 10\n ) {\n publicRequisitionList(token: $token) {\n sender_name\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n items {\n uid\n product { name small_image { url label } url_key }\n }\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { GET_PUBLIC_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getPublicRequisitionList/graphql/getPublicRequisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { enrichConfigurableProducts as defaultEnrichConfigurableProducts } from '@/requisitionList/api/enrichConfigurableProducts';\nimport { SharedRequisitionListResult } from '@/requisitionList/api/getSharedRequisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\n\nexport const getPublicRequisitionList = async (\n token: string,\n currentPage?: number,\n pageSize?: number,\n enrichConfigurableProducts: (\n items: Item[],\n ) => Promise<Item[]> = defaultEnrichConfigurableProducts,\n): Promise<SharedRequisitionListResult | null> => {\n const { errors, data } = await fetchGraphQl(\n GET_PUBLIC_REQUISITION_LIST_QUERY,\n {\n variables: { token, currentPage, pageSize },\n },\n );\n if (errors) return handleFetchError(errors);\n const raw = data?.publicRequisitionList;\n const requisitionList = raw?.requisition_list\n ? transformRequisitionList(raw.requisition_list)\n : null;\n if (!requisitionList) return null;\n if (requisitionList.items?.length) {\n requisitionList.items = await enrichConfigurableProducts(\n requisitionList.items,\n );\n }\n return {\n senderName: raw.sender_name,\n requisitionList,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const ADD_PUBLIC_REQUISITION_LIST_ITEMS_TO_CART_MUTATION = `\n mutation ADD_PUBLIC_REQUISITION_LIST_ITEMS_TO_CART_MUTATION(\n $input: AddPublicRequisitionListItemsToCartInput!\n ) {\n addPublicRequisitionListItemsToCart(input: $input) {\n cart { id }\n user_errors { code message }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { ADD_PUBLIC_REQUISITION_LIST_ITEMS_TO_CART_MUTATION } from '@/requisitionList/api/addPublicRequisitionListItemsToCart/graphql/addPublicRequisitionListItemsToCart';\n\nexport interface PublicRequisitionListUserError {\n code: string;\n message: string;\n}\n\nexport interface AddPublicRequisitionListItemsToCartResult {\n cart: { id: string } | null;\n userErrors: PublicRequisitionListUserError[];\n}\n\nexport const addPublicRequisitionListItemsToCart = async (\n token: string,\n cartId: string,\n itemUids?: string[],\n): Promise<AddPublicRequisitionListItemsToCartResult> => {\n const { errors, data } = await fetchGraphQl(\n ADD_PUBLIC_REQUISITION_LIST_ITEMS_TO_CART_MUTATION,\n { variables: { input: { token, cart_id: cartId, item_uids: itemUids } } },\n );\n if (errors) return handleFetchError(errors);\n\n const result = data?.addPublicRequisitionListItemsToCart;\n\n if (!result) {\n return {\n cart: null,\n userErrors: [\n { code: 'UNKNOWN_ERROR', message: 'Unable to add items to cart.' },\n ],\n };\n }\n\n return { cart: result.cart, userErrors: result.user_errors ?? [] };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const SHARE_PUBLIC_REQUISITION_LIST_MUTATION = `\n mutation SHARE_PUBLIC_REQUISITION_LIST_MUTATION($input: SharePublicRequisitionListInput!) {\n sharePublicRequisitionList(input: $input) {\n sent_count\n user_errors { code message }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { SHARE_PUBLIC_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/sharePublicRequisitionList/graphql/sharePublicRequisitionList';\nimport { PublicRequisitionListUserError } from '@/requisitionList/api/addPublicRequisitionListItemsToCart';\n\nexport const sharePublicRequisitionList = async (\n requisitionListUid: string,\n emails: string[],\n): Promise<PublicRequisitionListUserError[] | null> => {\n const { errors, data } = await fetchGraphQl(\n SHARE_PUBLIC_REQUISITION_LIST_MUTATION,\n {\n variables: {\n input: { requisition_list_uid: requisitionListUid, emails },\n },\n },\n );\n if (errors) return handleFetchError(errors);\n\n const result = data?.sharePublicRequisitionList;\n\n if (result?.user_errors?.length) {\n return result.user_errors;\n }\n\n if ((result?.sent_count ?? 0) > 0) {\n return null;\n }\n\n return [\n { code: 'UNKNOWN_ERROR', message: 'Unable to share requisition list.' },\n ];\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_PUBLIC_REQUISITION_LIST_TOKEN_QUERY = `\n query GET_PUBLIC_REQUISITION_LIST_TOKEN_QUERY($requisitionListUid: String!) {\n customer {\n requisition_lists(filter: { uids: { eq: $requisitionListUid } }) {\n items { token }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { GET_PUBLIC_REQUISITION_LIST_TOKEN_QUERY } from '@/requisitionList/api/getPublicRequisitionListToken/graphql/getPublicRequisitionListToken';\n\nexport interface GetPublicRequisitionListTokenResult {\n token: string | null;\n errorMessage: string | null;\n}\n\nexport const getPublicRequisitionListToken = async (\n requisitionListUid: string,\n): Promise<GetPublicRequisitionListTokenResult> => {\n try {\n const { errors, data } = await fetchGraphQl(\n GET_PUBLIC_REQUISITION_LIST_TOKEN_QUERY,\n { variables: { requisitionListUid } },\n );\n\n if (errors?.length) {\n return {\n token: null,\n errorMessage: errors[0]?.message ?? null,\n };\n }\n\n return {\n token: data?.customer?.requisition_lists?.items?.[0]?.token ?? null,\n errorMessage: null,\n };\n } catch (error) {\n return {\n token: null,\n errorMessage:\n error instanceof Error\n ? error.message\n : 'Unable to retrieve the public share link.',\n };\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const CREATE_REQUISITION_LIST_MUTATION = `\n mutation CREATE_REQUISITION_LIST_MUTATION(\n $requisitionListName: String!,\n $requisitionListDescription: String,\n $isPublic: Boolean\n ) {\n createRequisitionList(\n input: {\n name: $requisitionListName\n description: $requisitionListDescription\n is_public: $isPublic\n }\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { CREATE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/createRequisitionList/graphql/createRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const createRequisitionList = async (\n name: string,\n description?: string,\n isPublic?: boolean\n): Promise<RequisitionList | null> => {\n return fetchGraphQl(CREATE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListName: name,\n requisitionListDescription: description,\n isPublic,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.createRequisitionList?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.createRequisitionList.requisition_list\n );\n events.emit('requisitionList/data', payload);\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION = `\n mutation ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItems: [RequisitionListItemsInput!]!\n ) {\n addProductsToRequisitionList(\n requisitionListUid: $requisitionListUid\n requisitionListItems: $requisitionListItems\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/addProductsToRequisitionList/graphql/addProductsToRequisitionList';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\n// Correct type for GraphQL RequisitionListItemsInput\nexport type RequisitionListItemsInput = {\n sku: string;\n quantity: number;\n parent_sku?: string;\n selected_options?: string[];\n entered_options?: Array<{ uid: string; value: string }>;\n};\n\nexport const addProductsToRequisitionList = async (\n requisitionListUid: string,\n requisitionListItems: Array<RequisitionListItemsInput>\n): Promise<RequisitionList | null> => {\n // Clean items before performing the mutation - remove empty fields\n const cleanedItems = requisitionListItems.map((item) => {\n const cleaned: any = {\n sku: item.sku,\n quantity: item.quantity,\n };\n\n if (item.parent_sku) cleaned.parent_sku = item.parent_sku;\n if (item.selected_options && item.selected_options.length > 0) {\n cleaned.selected_options = item.selected_options;\n }\n if (item.entered_options && item.entered_options.length > 0) {\n cleaned.entered_options = item.entered_options;\n }\n\n return cleaned;\n });\n\n const { errors, data } = await fetchGraphQl(\n ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION,\n {\n variables: {\n requisitionListUid,\n requisitionListItems: cleanedItems,\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.addProductsToRequisitionList?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.addProductsToRequisitionList.requisition_list\n );\n events.emit('requisitionList/data', payload);\n return payload;\n};\n"],"names":["isSharingEnabled","config","isPublicSharingEnabled","_state","state","target","key","value","setRequisitionLists","lists","updateRequisitionList","list","l","getRequisitionListsFromState","setRequisitionListsLoading","loading","STORE_CONFIG_QUERY","transformRequisitionList","data","transformItems","_a","_b","items","item","transformedItem","_c","_d","_e","_f","option","sample","_g","transformStoreConfig","DEFAULT_STORE_CONFIG","getStoreConfig","errors","fetchGraphQl","error","initialize","Initializer","defaultConfig","events","authenticated","payload","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","getConfig","FetchGraphQL","CONFIGURABLE_OPTIONS_QUERY","REFINE_CONFIGURABLE_VARIANT_QUERY","resolveOptionIds","options","optionIds","selected","o","v","toConfiguredProduct","product","enrichConfigurableProducts","configurableItems","parentSkus","optionsBySku","acc","refinements","refinedProducts","configuredProductByItem","refined","configuredProduct","REQUISITION_LIST_FRAGMENT","REQUISITION_LIST_ITEMS_FRAGMENT","GET_REQUISITION_LIST_QUERY","GET_REQUISITION_LISTS_QUERY","handleFetchError","errorMessage","e","isValidBase64Uid","uid","mergeRemainingListItemPages","listItemsPageSize","pi","mergedItems","page","raw","chunk","getRequisitionLists","currentPage","pageSize","reqLists","requisitionList","getRequisitionList","requisitionListID","defaultEnrichConfigurableProducts","rawList","UPDATE_REQUISITION_LIST_MUTATION","requisitionListUid","name","description","isPublic","DELETE_REQUISITION_LIST_MUTATION","deleteRequisitionList","UPDATE_REQUISITION_LIST_ITEMS_MUTATION","updateRequisitionListItems","requisitionListItems","DELETE_REQUISITION_LIST_ITEMS_MUTATION","deleteRequisitionListItems","ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION","addRequisitionListItemsToCart","requisitionListItemUids","MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION","moveItemsBetweenRequisitionLists","sourceRequisitionListUid","destinationRequisitionListUid","source_requisition_list","destination_requisition_list","sourceList","destinationList","COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION","copyItemsBetweenRequisitionLists","GET_COMPANY_USERS_QUERY","PAGE_SIZE","fetchPage","users","getCompanyUsers","firstPage","totalPages","remainingPages","_","i","SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION","shareRequisitionListByEmail","customerUids","shareResult","SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION","shareRequisitionListByToken","GET_SHARED_REQUISITION_LIST_QUERY","getSharedRequisitionList","token","IMPORT_SHARED_REQUISITION_LIST_MUTATION","importSharedRequisitionList","result","GET_PUBLIC_REQUISITION_LIST_QUERY","getPublicRequisitionList","ADD_PUBLIC_REQUISITION_LIST_ITEMS_TO_CART_MUTATION","addPublicRequisitionListItemsToCart","cartId","itemUids","SHARE_PUBLIC_REQUISITION_LIST_MUTATION","sharePublicRequisitionList","emails","GET_PUBLIC_REQUISITION_LIST_TOKEN_QUERY","getPublicRequisitionListToken","CREATE_REQUISITION_LIST_MUTATION","createRequisitionList","ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION","addProductsToRequisitionList","cleanedItems","cleaned"],"mappings":"wKAiCO,MAAMA,GAAoBC,IAC/BA,GAAA,YAAAA,EAAQ,oCAAqC,GAElCC,GAA0BD,IACrCA,GAAA,YAAAA,EAAQ,2CAA4C,GAWhDE,EACG,CACL,cAAe,GACf,OAAQ,OACR,cAAe,GACf,iBAAkB,CAAC,EACnB,wBAAyB,GACzB,wBAAyB,CAC3B,EAIWC,EAAQ,IAAI,MAAMD,EAAQ,CACrC,IAAIE,EAAQC,EAAKC,EAAO,CACtB,OAAO,QAAQ,IAAIF,EAAQC,EAAKC,CAAK,CACvC,EACA,IAAIF,EAAQC,EAAK,CACf,OAAOD,EAAOC,CAAkB,CAAA,CAEpC,CAAC,EAGYE,GAAuBC,GAA6B,CAC/DL,EAAM,iBAAmBK,EACnBL,EAAA,yBACR,EAOaM,GAAyBC,GAA0B,CAC/CP,EAAM,iBAAiB,KACnCQ,GAAuBA,EAAE,MAAQD,EAAK,GACzC,EAGQP,EAAA,iBAAmBA,EAAM,iBAAiB,IAAKQ,GACnDA,EAAE,MAAQD,EAAK,IAAMA,EAAOC,CAC9B,EAEAR,EAAM,iBAAmB,CAAC,GAAGA,EAAM,iBAAkBO,CAAI,EAErDP,EAAA,yBACR,EAEaS,GAA+B,IACnCT,EAAM,iBAGFU,GAA8BC,GAAqB,CAC9DX,EAAM,wBAA0BW,CAClC,ECpFaC,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EC6B3B,SAASC,E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,GACA,CACE,UAAW,CACT,mBAAA3D,EACA,qBAAsB6D,CAAA,CACxB,CAEJ,EAEI,GAAA1H,EAAe,OAAAuC,EAAiBvC,CAAM,EAEtC,GAAA,GAACf,EAAAF,GAAA,YAAAA,EAAM,+BAAN,MAAAE,EAAoC,kBAChC,OAAA,KAGT,MAAMuB,EAAU1B,EACdC,EAAK,6BAA6B,gBACpC,EACO,OAAAuB,EAAA,KAAK,uBAAwBE,CAAO,EACpCA,CACT"}
|
|
1
|
+
{"version":3,"file":"api.js","sources":["/@dropins/storefront-requisition-list/src/lib/state.ts","/@dropins/storefront-requisition-list/src/api/getStoreConfig/graphql/storeConfigQuery.ts","/@dropins/storefront-requisition-list/src/data/transforms/transform-requisition-list.ts","/@dropins/storefront-requisition-list/src/data/transforms/transform-store-config.ts","/@dropins/storefront-requisition-list/src/api/getStoreConfig/getStoreConfig.ts","/@dropins/storefront-requisition-list/src/api/initialize/initialize.ts","/@dropins/storefront-requisition-list/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-requisition-list/src/api/enrichConfigurableProducts/graphql/ConfigurableOptionsQuery.graphql.ts","/@dropins/storefront-requisition-list/src/api/enrichConfigurableProducts/graphql/RefineConfigurableVariantQuery.graphql.ts","/@dropins/storefront-requisition-list/src/api/enrichConfigurableProducts/enrichConfigurableProducts.ts","/@dropins/storefront-requisition-list/src/api/fragments/RequisitionListFragment.graphql.ts","/@dropins/storefront-requisition-list/src/api/fragments/RequisitionListItemsFragment.graphql.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/graphql/getRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionLists/graphql/getRequisitionLists.ts","/@dropins/storefront-requisition-list/src/lib/fetch-error.ts","/@dropins/storefront-requisition-list/src/lib/validate-uid.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionLists/getRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/getRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionList/graphql/updateRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionList/updateRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionList/graphql/deleteRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionList/deleteRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionListItems/graphql/updateRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionListItems/updateRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionListItems/graphql/deleteRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionListItems/deleteRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/addRequisitionListItemsToCart/graphql/addRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/addRequisitionListItemsToCart/addRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/moveItemsBetweenRequisitionLists/graphql/moveItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/moveItemsBetweenRequisitionLists/moveItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/copyItemsBetweenRequisitionLists/graphql/copyItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/copyItemsBetweenRequisitionLists/copyItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/getCompanyUsers/graphql/getCompanyUsers.ts","/@dropins/storefront-requisition-list/src/api/getCompanyUsers/getCompanyUsers.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByEmail/graphql/shareRequisitionListByEmail.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByEmail/shareRequisitionListByEmail.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByToken/graphql/shareRequisitionListByToken.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByToken/shareRequisitionListByToken.ts","/@dropins/storefront-requisition-list/src/api/getSharedRequisitionList/graphql/getSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getSharedRequisitionList/getSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/importSharedRequisitionList/graphql/importSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/importSharedRequisitionList/importSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getPublicRequisitionList/graphql/getPublicRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getPublicRequisitionList/getPublicRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/addPublicRequisitionListItemsToCart/graphql/addPublicRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/addPublicRequisitionListItemsToCart/addPublicRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/sharePublicRequisitionList/graphql/sharePublicRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/sharePublicRequisitionList/sharePublicRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getPublicRequisitionListToken/graphql/getPublicRequisitionListToken.ts","/@dropins/storefront-requisition-list/src/api/getPublicRequisitionListToken/getPublicRequisitionListToken.ts","/@dropins/storefront-requisition-list/src/api/createRequisitionList/graphql/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/createRequisitionList/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/addProductsToRequisitionList/graphql/addProductsToRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/addProductsToRequisitionList/addProductsToRequisitionList.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\nexport type StoreConfig = {\n is_requisition_list_active?: string;\n company_enabled?: boolean;\n requisition_list_sharing_enabled?: boolean;\n requisition_list_share_max_recipients?: number | null;\n requisition_list_share_storefront_path?: string | null;\n configurable_thumbnail_source?: string | null;\n requisition_list_public_sharing_enabled?: boolean;\n requisition_list_public_share_link_validity_days?: number | null;\n requisition_list_public_share_max_recipients?: number | null;\n requisition_list_public_share_storefront_path?: string | null;\n [key: string]: any; // Allow additional config properties\n};\n\nexport const isSharingEnabled = (config?: StoreConfig): boolean =>\n config?.requisition_list_sharing_enabled === true;\n\nexport const isPublicSharingEnabled = (config?: StoreConfig): boolean =>\n config?.requisition_list_public_sharing_enabled === true;\n\ntype State = {\n authenticated: boolean;\n config: StoreConfig | undefined;\n isCompanyUser: boolean;\n requisitionLists: RequisitionList[];\n requisitionListsLoading: boolean;\n requisitionListsVersion: number;\n};\n\nconst _state: State = (() => {\n return {\n authenticated: false,\n config: undefined,\n isCompanyUser: false,\n requisitionLists: [],\n requisitionListsLoading: false,\n requisitionListsVersion: 0,\n };\n})();\n\n// Proxy state to allow reactivity\nexport const state = new Proxy(_state, {\n set(target, key, value) {\n return Reflect.set(target, key, value);\n },\n get(target, key) {\n return target[key as keyof State];\n },\n});\n\n// Helper functions for managing requisition lists\nexport const setRequisitionLists = (lists: RequisitionList[]) => {\n state.requisitionLists = lists;\n state.requisitionListsVersion++;\n};\n\nexport const addRequisitionList = (list: RequisitionList) => {\n state.requisitionLists = [...state.requisitionLists, list];\n state.requisitionListsVersion++;\n};\n\nexport const updateRequisitionList = (list: RequisitionList) => {\n const exists = state.requisitionLists.some(\n (l: RequisitionList) => l.uid === list.uid,\n );\n\n if (exists) {\n state.requisitionLists = state.requisitionLists.map((l: RequisitionList) =>\n l.uid === list.uid ? list : l,\n );\n } else {\n state.requisitionLists = [...state.requisitionLists, list];\n }\n state.requisitionListsVersion++;\n};\n\nexport const getRequisitionListsFromState = () => {\n return state.requisitionLists;\n};\n\nexport const setRequisitionListsLoading = (loading: boolean) => {\n state.requisitionListsLoading = loading;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const STORE_CONFIG_QUERY = `\nquery STORE_CONFIG_QUERY {\n storeConfig {\n is_requisition_list_active\n company_enabled\n requisition_list_sharing_enabled\n requisition_list_share_max_recipients\n requisition_list_share_storefront_path\n configurable_thumbnail_source\n requisition_list_public_sharing_enabled\n requisition_list_public_share_link_validity_days\n requisition_list_public_share_max_recipients\n requisition_list_public_share_storefront_path\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { RequisitionList } from '../models/requisitionList';\nimport {\n Item,\n ConfiguredProduct,\n Link,\n Sample,\n BundleOption,\n ConfigurableOption,\n RawCustomizableOption,\n GiftCardOption,\n} from '@/requisitionList/data/models/item';\n\n// Interface for raw API response data for a requisition list\nexport interface RawRequisitionListData {\n name: string;\n description: string;\n uid: string;\n updated_at: string;\n items_count: number;\n is_public?: boolean;\n items: {\n items: RawItemData[];\n page_info: {\n total_pages: number;\n current_page: number;\n page_size: number;\n };\n };\n}\n\nexport function transformRequisitionList(\n data: RawRequisitionListData,\n): RequisitionList | null {\n if (!data) {\n return null;\n }\n\n return {\n uid: data.uid,\n name: data.name,\n description: data.description,\n updated_at: data.updated_at,\n items_count: data.items_count,\n items: transformItems(data.items?.items),\n page_info: data.items?.page_info,\n is_public: data.is_public ?? false,\n };\n}\n\n// Interface for raw item data\ninterface RawItemData {\n uid: string;\n product: {\n sku: string;\n name?: string;\n small_image?: Item['image'];\n url_key?: string;\n stock_status?: string;\n only_x_left_in_stock?: number | null;\n };\n quantity: number;\n customizable_options?: RawCustomizableOption[];\n bundle_options?: BundleOption[];\n configurable_options?: ConfigurableOption[];\n configured_product?: ConfiguredProduct;\n links?: Link[];\n samples?: Sample[];\n gift_card_options?: GiftCardOption;\n}\n\nfunction transformItems(items: RawItemData[]): Item[] {\n if (!items?.length) return [];\n\n return items.map((item: RawItemData) => {\n const transformedItem = {\n uid: item.uid,\n sku: item.product?.sku,\n name: item.product?.name,\n image: item.product?.small_image,\n urlKey: item.product?.url_key,\n quantity: item.quantity,\n stock_status: (item.product?.stock_status || 'IN_STOCK') as\n 'IN_STOCK' | 'OUT_OF_STOCK',\n only_x_left_in_stock: item.product?.only_x_left_in_stock ?? null,\n customizable_options: item.customizable_options\n ? item.customizable_options.map((option) => ({\n uid: option.customizable_option_uid,\n is_required: option.is_required,\n label: option.label,\n sort_order: option.sort_order,\n type: option.type,\n values: option.values.map(\n (value: RawCustomizableOption['values'][number]) => ({\n uid: value.customizable_option_value_uid,\n label: value.label,\n price: value.price,\n value: value.value,\n }),\n ),\n }))\n : [],\n bundle_options: item.bundle_options || [],\n configurable_options: item.configurable_options\n ? item.configurable_options.map((option) => ({\n option_uid: option.configurable_product_option_uid,\n option_label: option.option_label,\n value_uid: option.configurable_product_option_value_uid,\n value_label: option.value_label,\n }))\n : [],\n samples: item.samples\n ? item.samples.map((sample) => ({\n url: sample.sample_url,\n sort_order: sample.sort_order,\n title: sample.title,\n }))\n : [],\n gift_card_options: item.gift_card_options || {},\n };\n\n if (item.configured_product?.name) {\n return {\n ...transformedItem,\n configured_product: item.configured_product,\n };\n }\n return transformedItem;\n });\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { StoreConfig } from '@/requisitionList/lib/state';\n\n// Some config scalars are legacy Magento values that may arrive as \"0\"/\"1\"\n// strings rather than real booleans; cast once here so the rest of the app\n// only ever deals with a plain boolean/number.\nexport function transformStoreConfig(data: any): StoreConfig {\n return {\n ...data,\n requisition_list_sharing_enabled: Boolean(\n +data?.requisition_list_sharing_enabled,\n ),\n requisition_list_share_max_recipients:\n data?.requisition_list_share_max_recipients != null\n ? +data.requisition_list_share_max_recipients\n : null,\n requisition_list_public_sharing_enabled: Boolean(\n +data?.requisition_list_public_sharing_enabled,\n ),\n requisition_list_public_share_link_validity_days:\n data?.requisition_list_public_share_link_validity_days != null\n ? +data.requisition_list_public_share_link_validity_days\n : null,\n requisition_list_public_share_max_recipients:\n data?.requisition_list_public_share_max_recipients != null\n ? +data.requisition_list_public_share_max_recipients\n : null,\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\n\nimport { STORE_CONFIG_QUERY } from './graphql/storeConfigQuery';\nimport { StoreConfig } from '@/requisitionList/lib/state';\nimport { transformStoreConfig } from '@/requisitionList/data/transforms';\n\nconst DEFAULT_STORE_CONFIG: StoreConfig = {\n is_requisition_list_active: '0',\n company_enabled: false,\n requisition_list_sharing_enabled: false,\n requisition_list_share_max_recipients: null,\n requisition_list_share_storefront_path: null,\n configurable_thumbnail_source: null,\n requisition_list_public_sharing_enabled: false,\n requisition_list_public_share_link_validity_days: null,\n requisition_list_public_share_max_recipients: null,\n requisition_list_public_share_storefront_path: null,\n};\n\nexport const getStoreConfig = async (): Promise<any> => {\n try {\n const { errors, data } = await fetchGraphQl(STORE_CONFIG_QUERY, {\n cache: 'force-cache',\n });\n\n const missingCoreField = errors?.some(\n (error) =>\n error.message?.includes(\n 'Cannot query field \"is_requisition_list_active\"',\n ) || error.message?.includes('Cannot query field \"company_enabled\"'),\n );\n if (missingCoreField) {\n return false;\n }\n\n if (errors?.length || !data?.storeConfig) {\n return DEFAULT_STORE_CONFIG;\n }\n\n return transformStoreConfig(data.storeConfig);\n } catch {\n return DEFAULT_STORE_CONFIG;\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/requisitionList/lib/state';\nimport { getStoreConfig } from '@/requisitionList/api/getStoreConfig';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n // set config\n if (!state.config) {\n state.config = await getStoreConfig();\n // Emit event to notify listeners that requisition list has been initialized\n events.emit('requisitionList/initialized', state.config);\n }\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [\n events.on('authenticated', (authenticated) => {\n state.authenticated = authenticated;\n if (!authenticated) {\n state.isCompanyUser = false;\n }\n }),\n\n events.on(\n 'auth/permissions',\n (payload) => {\n // Company users have admin: true (company admin) or at least one\n // Magento_Company::* key. Checking these specifically avoids false\n // positives from B2C-only permissions (e.g. Magento_Sales::place_order).\n state.isCompanyUser =\n payload != null &&\n typeof payload === 'object' &&\n Object.entries(payload).some(\n ([key, value]) =>\n value === true &&\n (key === 'admin' || key.startsWith('Magento_Company::')),\n );\n },\n { eager: true },\n ),\n ],\n});\n\nexport const config = initialize.config;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const CONFIGURABLE_OPTIONS_QUERY = `\nquery CONFIGURABLE_OPTIONS_QUERY($skus: [String]) {\n products(skus: $skus) {\n sku\n ... on ComplexProductView {\n options {\n title\n values {\n id\n title\n }\n }\n }\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REFINE_CONFIGURABLE_VARIANT_QUERY = `\nquery REFINE_CONFIGURABLE_VARIANT_QUERY($sku: String!, $optionIds: [String!]!) {\n refineProduct(sku: $sku, optionIds: $optionIds) {\n ...PRODUCT_VARIANT_FRAGMENT\n }\n}\n\nfragment PRODUCT_VARIANT_FRAGMENT on ProductView {\n sku\n name\n images(roles: []) {\n url\n }\n ... on SimpleProductView {\n price {\n regular {\n amount {\n value\n currency\n }\n }\n final {\n amount {\n value\n currency\n }\n }\n }\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { Item, ConfiguredProduct } from '@/requisitionList/data/models/item';\nimport { CONFIGURABLE_OPTIONS_QUERY } from './graphql/ConfigurableOptionsQuery.graphql';\nimport { REFINE_CONFIGURABLE_VARIANT_QUERY } from './graphql/RefineConfigurableVariantQuery.graphql';\n\ninterface RawOptionValue {\n id: string;\n title: string;\n}\n\ninterface RawOption {\n title: string;\n values: RawOptionValue[];\n}\n\ninterface RawComplexProduct {\n sku: string;\n options?: RawOption[];\n}\n\ninterface RawVariantProduct {\n sku: string;\n name: string;\n images?: { url: string }[];\n price?: {\n regular?: { amount: { value: number; currency: string } };\n final?: { amount: { value: number; currency: string } };\n };\n}\n\n// Requisition list items only carry the human-readable option/value labels\n// (`option_label`/`value_label`), not usable IDs: the UID Commerce encodes\n// for them is a core-Commerce-only identifier that doesn't correspond to\n// Catalog Service's opaque option value IDs. Resolving the selected variant\n// therefore means looking up the parent's Catalog Service options by title\n// and matching the same labels, rather than decoding/reusing any UID.\nconst resolveOptionIds = (\n item: Item,\n options: RawOption[],\n): string[] | null => {\n const optionIds: string[] = [];\n\n for (const selected of item.configurable_options!) {\n const option = options.find((o) => o.title === selected.option_label);\n const value = option?.values.find((v) => v.title === selected.value_label);\n\n if (!value) {\n return null;\n }\n\n optionIds.push(value.id);\n }\n\n return optionIds;\n};\n\nconst toConfiguredProduct = (\n product: RawVariantProduct,\n): ConfiguredProduct => ({\n name: product.name,\n sku: product.sku,\n images: product.images?.length ? [{ url: product.images[0].url }] : undefined,\n price: {\n regular: product.price?.regular\n ? {\n amount: {\n value: product.price.regular.amount.value,\n currency: product.price.regular.amount.currency,\n },\n }\n : undefined,\n final: {\n amount: {\n value: product.price?.final?.amount.value || 0,\n currency: product.price?.final?.amount.currency || '',\n },\n },\n },\n});\n\n/**\n * Default variant resolver for configurable requisition list items.\n *\n * Requisition list items only carry the parent (configurable) SKU and the\n * selected option labels, not the child/variant product. This resolves the\n * matching simple product variant via Catalog Service's `refineProduct`\n * (the same mechanism the PDP dropin uses for swatch selection) so SKU,\n * price and thumbnail can reflect the selected variant, consistent with\n * the cart.\n */\nexport const enrichConfigurableProducts = async (\n items: Item[],\n): Promise<Item[]> => {\n const configurableItems = items.filter(\n (item) => item.sku && item.configurable_options?.length,\n );\n\n if (!configurableItems.length) {\n return items;\n }\n\n const parentSkus = Array.from(\n new Set(configurableItems.map((item) => item.sku)),\n );\n\n let optionsBySku: Record<string, RawOption[]>;\n try {\n const { errors, data } = await fetchGraphQl(CONFIGURABLE_OPTIONS_QUERY, {\n variables: { skus: parentSkus },\n });\n\n if (errors || !data?.products) {\n return items;\n }\n\n optionsBySku = (data.products as RawComplexProduct[]).reduce(\n (acc: Record<string, RawOption[]>, product) => {\n if (product) {\n acc[product.sku] = product.options || [];\n }\n return acc;\n },\n {},\n );\n } catch {\n return items;\n }\n\n const refinements = new Map<Item, string[]>();\n for (const item of configurableItems) {\n const options = optionsBySku[item.sku!];\n if (!options?.length) {\n continue;\n }\n\n const optionIds = resolveOptionIds(item, options);\n if (optionIds) {\n refinements.set(item, optionIds);\n }\n }\n\n if (!refinements.size) {\n return items;\n }\n\n const refinedProducts = await Promise.all(\n Array.from(refinements.entries()).map(async ([item, optionIds]) => {\n try {\n const { errors, data } = await fetchGraphQl(\n REFINE_CONFIGURABLE_VARIANT_QUERY,\n { variables: { sku: item.sku, optionIds } },\n );\n\n if (errors || !data?.refineProduct) {\n return null;\n }\n\n return { item, product: data.refineProduct as RawVariantProduct };\n } catch {\n return null;\n }\n }),\n );\n\n const configuredProductByItem = new Map<Item, ConfiguredProduct>();\n refinedProducts.forEach((refined) => {\n if (refined) {\n configuredProductByItem.set(\n refined.item,\n toConfiguredProduct(refined.product),\n );\n }\n });\n\n if (!configuredProductByItem.size) {\n return items;\n }\n\n return items.map((item) => {\n const configuredProduct = configuredProductByItem.get(item);\n return configuredProduct\n ? { ...item, configured_product: configuredProduct }\n : item;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REQUISITION_LIST_FRAGMENT = `\nfragment REQUISITION_LIST_FRAGMENT on RequisitionList {\n uid\n name\n description\n items_count\n updated_at\n is_public\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REQUISITION_LIST_ITEMS_FRAGMENT = `\nfragment REQUISITION_LIST_ITEMS_FRAGMENT on RequistionListItems {\n items {\n uid\n quantity\n product {\n sku\n stock_status\n only_x_left_in_stock\n }\n customizable_options {\n customizable_option_uid\n is_required\n label\n sort_order\n type\n values {\n customizable_option_value_uid\n label\n value\n price {\n type\n units\n value\n }\n }\n }\n ... on ConfigurableRequisitionListItem {\n configurable_options {\n configurable_product_option_uid\n configurable_product_option_value_uid\n option_label\n value_label\n }\n }\n ... on DownloadableRequisitionListItem {\n links {\n price\n sample_url\n sort_order\n title\n uid\n }\n samples {\n sample_url\n sort_order\n title\n }\n }\n ... on BundleRequisitionListItem {\n bundle_options {\n uid\n type\n label\n values {\n uid\n label\n quantity\n priceV2 {\n value\n currency\n }\n original_price {\n value\n currency\n }\n }\n }\n }\n ... on GiftCardRequisitionListItem {\n gift_card_options {\n amount {\n currency\n value\n }\n custom_giftcard_amount {\n currency\n value\n }\n message\n recipient_email\n recipient_name\n sender_name\n sender_email\n }\n }\n }\n page_info {\n page_size\n current_page\n total_pages\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const GET_REQUISITION_LIST_QUERY = `\n query GET_REQUISITION_LIST_QUERY(\n $requisitionListUid: String,\n $currentPage: Int = 1,\n $pageSize: Int = 10,\n ) {\n customer {\n requisition_lists (\n filter: {\n uids: {\n eq: $requisitionListUid\n }\n }\n ){\n items {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\n/**\n * Nested list line items use pagination. Default listItemsPageSize is 100 per page;\n * getRequisitionLists fetches further pages per list when page_info.total_pages > 1\n * so PDP \"active\" / membership checks are not limited to the first page only.\n */\nexport const GET_REQUISITION_LISTS_QUERY = `\n query GET_REQUISITION_LISTS_QUERY(\n $currentPage: Int = 1\n $pageSize: Int = 10,\n $listItemsPageSize: Int = 100,\n $listItemsCurrentPage: Int = 1,\n ) {\n customer {\n requisition_lists(pageSize: $pageSize, currentPage: $currentPage) {\n items {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $listItemsPageSize, currentPage: $listItemsCurrentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n page_info {\n page_size\n current_page\n total_pages\n }\n total_count\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/** Actions */\nexport const handleFetchError = (errors: Array<{ message: string }>) => {\n const errorMessage = errors.map((e: any) => e.message).join(' ');\n\n throw Error(errorMessage);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Validates if a string is a valid base64-encoded UID\n * Adobe Commerce/Magento UIDs are base64 encoded\n *\n * @param uid - The UID to validate\n * @returns true if the UID appears to be valid base64 encoding\n */\nexport function isValidBase64Uid(uid: string | undefined | null): boolean {\n if (!uid || typeof uid !== 'string' || uid.length < 2) {\n return false;\n }\n\n // Base64 pattern: alphanumeric, +, /\n // Valid base64 can end with 0, 1, or 2 '=' padding characters\n // But the length must be a multiple of 4 when padded\n const base64Pattern = /^[A-Za-z0-9+/]+(==|=)?$/;\n\n if (!base64Pattern.test(uid)) {\n return false;\n }\n\n // Check that the total length is a multiple of 4 (valid base64 requirement)\n return uid.length % 4 === 0;\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getRequisitionList/graphql/getRequisitionList';\nimport { GET_REQUISITION_LISTS_QUERY } from '@/requisitionList/api/getRequisitionLists/graphql/getRequisitionLists';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { events } from '@adobe-commerce/event-bus';\n\nasync function mergeRemainingListItemPages(\n list: RequisitionList,\n listItemsPageSize: number,\n): Promise<RequisitionList> {\n const pi = list.page_info;\n if (!pi || pi.total_pages <= 1 || pi.current_page >= pi.total_pages) {\n return list;\n }\n\n const uid = String(list.uid);\n if (!isValidBase64Uid(uid)) {\n return list;\n }\n\n const mergedItems: Item[] = [...(list.items ?? [])];\n\n for (let page = pi.current_page + 1; page <= pi.total_pages; page += 1) {\n const { errors, data } = await fetchGraphQl(GET_REQUISITION_LIST_QUERY, {\n variables: {\n requisitionListUid: uid,\n currentPage: page,\n pageSize: listItemsPageSize,\n },\n });\n\n if (errors) {\n handleFetchError(errors);\n }\n\n const raw = data?.customer?.requisition_lists?.items?.[0];\n if (!raw) {\n break;\n }\n\n const chunk = transformRequisitionList(raw);\n if (chunk?.items?.length) {\n mergedItems.push(...chunk.items);\n }\n }\n\n return {\n ...list,\n items: mergedItems,\n page_info: {\n current_page: 1,\n total_pages: 1,\n page_size: mergedItems.length,\n },\n };\n}\n\nexport const getRequisitionLists = async (\n currentPage?: number,\n pageSize?: number,\n listItemsPageSize: number = 100,\n): Promise<RequisitionList[] | null> => {\n const { errors, data } = await fetchGraphQl(GET_REQUISITION_LISTS_QUERY, {\n variables: {\n currentPage,\n pageSize,\n listItemsPageSize,\n listItemsCurrentPage: 1,\n },\n });\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.requisition_lists) {\n return null;\n }\n\n let reqLists = data.customer.requisition_lists.items.map(\n (requisitionList: any) => transformRequisitionList(requisitionList),\n );\n\n reqLists = await Promise.all(\n reqLists.map((list) =>\n list == null\n ? Promise.resolve(list)\n : mergeRemainingListItemPages(list, listItemsPageSize),\n ),\n );\n\n events.emit('requisitionLists/data', reqLists);\n\n return {\n items: reqLists,\n page_info: data.customer?.requisition_lists?.page_info,\n total_count: data.customer?.requisition_lists?.total_count,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getRequisitionList/graphql/getRequisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { enrichConfigurableProducts as defaultEnrichConfigurableProducts } from '@/requisitionList/api/enrichConfigurableProducts';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const getRequisitionList = async (\n requisitionListID: string,\n currentPage?: number,\n pageSize?: number,\n enrichConfigurableProducts: (\n items: Item[],\n ) => Promise<Item[]> = defaultEnrichConfigurableProducts,\n): Promise<RequisitionList | null> => {\n // Validate UID format before making API call\n if (!isValidBase64Uid(requisitionListID)) {\n console.error('Invalid requisition list UID format:', requisitionListID);\n return null;\n }\n\n const { errors, data } = await fetchGraphQl(GET_REQUISITION_LIST_QUERY, {\n variables: {\n requisitionListUid: requisitionListID,\n currentPage,\n pageSize,\n },\n });\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.requisition_lists?.items?.[0]) {\n return null;\n }\n\n const rawList = data.customer.requisition_lists.items[0];\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const UPDATE_REQUISITION_LIST_MUTATION = `\n mutation UPDATE_REQUISITION_LIST_MUTATION(\n $requisitionListUid: ID!,\n $name: String!,\n $description: String,\n $isPublic: Boolean,\n $pageSize: Int,\n $currentPage: Int\n ) {\n updateRequisitionList(\n requisitionListUid: $requisitionListUid\n input: {\n name: $name\n description: $description\n is_public: $isPublic\n }\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { enrichConfigurableProducts as defaultEnrichConfigurableProducts } from '@/requisitionList/api/enrichConfigurableProducts';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { UPDATE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/updateRequisitionList/graphql/updateRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const updateRequisitionList = async (\n requisitionListUid: string,\n name: string,\n description?: string,\n pageSize?: number,\n currentPage?: number,\n enrichConfigurableProducts: (\n items: Item[],\n ) => Promise<Item[]> = defaultEnrichConfigurableProducts,\n isPublic?: boolean,\n): Promise<RequisitionList | null> => {\n const { errors, data } = await fetchGraphQl(\n UPDATE_REQUISITION_LIST_MUTATION,\n {\n variables: {\n requisitionListUid,\n name,\n description,\n isPublic,\n pageSize,\n currentPage,\n },\n },\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.updateRequisitionList?.requisition_list) {\n return null;\n }\n\n const rawList = data.updateRequisitionList.requisition_list;\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const DELETE_REQUISITION_LIST_MUTATION = `\n mutation DELETE_REQUISITION_LIST_MUTATION(\n $requisitionListUid: ID!,\n ) {\n deleteRequisitionList(\n requisitionListUid: $requisitionListUid\n ) {\n status\n requisition_lists {\n items {\n ...REQUISITION_LIST_FRAGMENT\n }\n page_info {\n page_size\n current_page\n total_pages\n }\n total_count\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { DELETE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/deleteRequisitionList/graphql/deleteRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const deleteRequisitionList = async (\n requisitionListUid: string,\n): Promise<{\n items: RequisitionList[];\n page_info: any;\n status: any;\n} | null> => {\n return fetchGraphQl(DELETE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListUid,\n },\n }).then(({ errors, data }) => {\n if (!requisitionListUid) return null;\n if (errors) return handleFetchError(errors);\n\n if (!data?.deleteRequisitionList?.requisition_lists) {\n return null;\n }\n\n const reqLists =\n data.deleteRequisitionList.requisition_lists?.items?.map(\n (requisitionList: any) => transformRequisitionList(requisitionList),\n ) || [];\n\n events.emit('requisitionLists/data', reqLists);\n\n return {\n items: reqLists,\n page_info: data.deleteRequisitionList?.requisition_lists?.page_info,\n status: data.deleteRequisitionList?.status,\n };\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const UPDATE_REQUISITION_LIST_ITEMS_MUTATION = `\n mutation UPDATE_REQUISITION_LIST_ITEMS_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItems: [UpdateRequisitionListItemsInput!]!,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n updateRequisitionListItems(\n requisitionListUid: $requisitionListUid\n requisitionListItems: $requisitionListItems\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { enrichConfigurableProducts as defaultEnrichConfigurableProducts } from '@/requisitionList/api/enrichConfigurableProducts';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { UPDATE_REQUISITION_LIST_ITEMS_MUTATION } from '@/requisitionList/api/updateRequisitionListItems/graphql/updateRequisitionListItems';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const updateRequisitionListItems = async (\n requisitionListUid: string,\n requisitionListItems: Array<UpdateRequisitionListItemsInput>,\n pageSize: number,\n currentPage: number,\n enrichConfigurableProducts: (\n items: Item[],\n ) => Promise<Item[]> = defaultEnrichConfigurableProducts,\n): Promise<RequisitionList | null> => {\n const { errors, data } = await fetchGraphQl(\n UPDATE_REQUISITION_LIST_ITEMS_MUTATION,\n {\n variables: {\n requisitionListUid,\n requisitionListItems,\n pageSize,\n currentPage,\n },\n },\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.updateRequisitionListItems?.requisition_list) {\n return null;\n }\n\n const rawList = data.updateRequisitionListItems.requisition_list;\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n\ntype UpdateRequisitionListItemsInput = {\n item_id: string;\n quantity?: number;\n entered_options?: Array<{ uid: string; value: string }>;\n selected_options?: Array<string>;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const DELETE_REQUISITION_LIST_ITEMS_MUTATION = `\n mutation DELETE_REQUISITION_LIST_ITEMS_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItemUids: [ID!]!,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n deleteRequisitionListItems(\n requisitionListUid: $requisitionListUid\n requisitionListItemUids: $requisitionListItemUids\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { enrichConfigurableProducts as defaultEnrichConfigurableProducts } from '@/requisitionList/api/enrichConfigurableProducts';\nimport { DELETE_REQUISITION_LIST_ITEMS_MUTATION } from '@/requisitionList/api/deleteRequisitionListItems/graphql/deleteRequisitionListItems';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const deleteRequisitionListItems = async (\n requisitionListUid: string,\n items: Array<string>,\n pageSize: number,\n currentPage: number,\n enrichConfigurableProducts: (\n items: Item[],\n ) => Promise<Item[]> = defaultEnrichConfigurableProducts,\n): Promise<RequisitionList | null> => {\n const { errors, data } = await fetchGraphQl(\n DELETE_REQUISITION_LIST_ITEMS_MUTATION,\n {\n variables: {\n requisitionListUid,\n requisitionListItemUids: items,\n pageSize,\n currentPage,\n },\n },\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.deleteRequisitionListItems?.requisition_list) {\n return null;\n }\n\n const rawList = data.deleteRequisitionListItems.requisition_list;\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION = `\n mutation ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItemUids: [ID!]!\n ) {\n addRequisitionListItemsToCart(\n requisitionListUid: $requisitionListUid\n requisitionListItemUids: $requisitionListItemUids\n ) {\n status\n add_requisition_list_items_to_cart_user_errors {\n message\n type\n }\n cart {\n id\n itemsV2 {\n items {\n uid\n quantity\n is_available\n }\n total_count\n }\n email\n total_quantity\n is_virtual\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION } from '@/requisitionList/api/addRequisitionListItemsToCart/graphql/addRequisitionListItemsToCart';\n\nexport interface AddToCartError {\n type: string;\n message: string;\n}\n\nexport const addRequisitionListItemsToCart = async (\n requisitionListUid: string,\n requisitionListItemUids: Array<string>,\n): Promise<Array<AddToCartError> | null> => {\n return fetchGraphQl(ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION, {\n variables: {\n requisitionListUid,\n requisitionListItemUids,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (\n data.addRequisitionListItemsToCart\n .add_requisition_list_items_to_cart_user_errors?.length\n ) {\n return data.addRequisitionListItemsToCart.add_requisition_list_items_to_cart_user_errors.map(\n (e: any) => ({\n type: e.type,\n message: e.message || '',\n }),\n );\n }\n return null;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION = `\n mutation MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION(\n $sourceRequisitionListUid: ID!,\n $destinationRequisitionListUid: ID!,\n $requisitionListItem: MoveItemsBetweenRequisitionListsInput,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n moveItemsBetweenRequisitionLists(\n sourceRequisitionListUid: $sourceRequisitionListUid\n destinationRequisitionListUid: $destinationRequisitionListUid\n requisitionListItem: $requisitionListItem\n ) {\n source_requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n destination_requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION } from '@/requisitionList/api/moveItemsBetweenRequisitionLists/graphql/moveItemsBetweenRequisitionLists';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface MoveItemsResult {\n sourceList: RequisitionList | null;\n destinationList: RequisitionList | null;\n}\n\nexport const moveItemsBetweenRequisitionLists = async (\n sourceRequisitionListUid: string,\n destinationRequisitionListUid: string,\n requisitionListItemUids: string[],\n pageSize: number,\n currentPage: number,\n): Promise<MoveItemsResult | null> => {\n const { errors, data } = await fetchGraphQl(\n MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION,\n {\n variables: {\n sourceRequisitionListUid,\n destinationRequisitionListUid,\n requisitionListItem: {\n requisitionListItemUids,\n },\n pageSize,\n currentPage,\n },\n },\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.moveItemsBetweenRequisitionLists) {\n return null;\n }\n\n const { source_requisition_list, destination_requisition_list } =\n data.moveItemsBetweenRequisitionLists;\n\n const sourceList = source_requisition_list\n ? transformRequisitionList(source_requisition_list)\n : null;\n\n const destinationList = destination_requisition_list\n ? transformRequisitionList(destination_requisition_list)\n : null;\n\n if (sourceList) {\n events.emit('requisitionList/data', sourceList);\n }\n\n return { sourceList, destinationList };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION = `\n mutation COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION(\n $sourceRequisitionListUid: ID!,\n $destinationRequisitionListUid: ID!,\n $requisitionListItem: CopyItemsBetweenRequisitionListsInput\n ) {\n copyItemsBetweenRequisitionLists(\n sourceRequisitionListUid: $sourceRequisitionListUid\n destinationRequisitionListUid: $destinationRequisitionListUid\n requisitionListItem: $requisitionListItem\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION } from '@/requisitionList/api/copyItemsBetweenRequisitionLists/graphql/copyItemsBetweenRequisitionLists';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\n\nexport interface CopyItemsResult {\n destinationList: RequisitionList | null;\n}\n\nexport const copyItemsBetweenRequisitionLists = async (\n sourceRequisitionListUid: string,\n destinationRequisitionListUid: string,\n requisitionListItemUids: string[],\n): Promise<CopyItemsResult | null> => {\n const { errors, data } = await fetchGraphQl(\n COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION,\n {\n variables: {\n sourceRequisitionListUid,\n destinationRequisitionListUid,\n requisitionListItem: {\n requisitionListItemUids,\n },\n },\n },\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.copyItemsBetweenRequisitionLists?.requisition_list) {\n return null;\n }\n\n const destinationList = transformRequisitionList(\n data.copyItemsBetweenRequisitionLists.requisition_list,\n );\n\n return { destinationList };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_COMPANY_USERS_QUERY = `\n query GET_COMPANY_USERS_QUERY(\n $pageSize: Int = 100\n $currentPage: Int = 1\n ) {\n company {\n users(\n filter: { status: ACTIVE }\n pageSize: $pageSize\n currentPage: $currentPage\n ) {\n items {\n id\n firstname\n lastname\n email\n }\n page_info {\n total_pages\n current_page\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { GET_COMPANY_USERS_QUERY } from '@/requisitionList/api/getCompanyUsers/graphql/getCompanyUsers';\n\nexport interface CompanyUser {\n id: string;\n firstname: string;\n lastname: string;\n email: string;\n}\n\nconst PAGE_SIZE = 100;\n\nconst fetchPage = async (\n currentPage: number,\n): Promise<{ items: CompanyUser[]; totalPages: number } | null> => {\n const { errors, data } = await fetchGraphQl(GET_COMPANY_USERS_QUERY, {\n variables: { pageSize: PAGE_SIZE, currentPage },\n });\n if (errors) return null;\n const users = data?.company?.users;\n if (!users?.items?.length) return null;\n return {\n items: users.items,\n totalPages: users.page_info?.total_pages ?? 1,\n };\n};\n\nexport const getCompanyUsers = async (): Promise<CompanyUser[]> => {\n const firstPage = await fetchPage(1);\n if (!firstPage) return [];\n\n const { items, totalPages } = firstPage;\n if (totalPages <= 1) return items;\n\n const remainingPages = await Promise.all(\n Array.from({ length: totalPages - 1 }, (_, i) => fetchPage(i + 2)),\n );\n\n return [...items, ...remainingPages.flatMap((page) => page?.items ?? [])];\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION = `\n mutation SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION(\n $requisitionListUid: ID!\n $customerUids: [ID!]!\n ) {\n shareRequisitionListByEmail(\n input: {\n requisitionListUid: $requisitionListUid\n customerUids: $customerUids\n }\n ) {\n sent_count\n user_errors {\n message\n code\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION } from '@/requisitionList/api/shareRequisitionListByEmail/graphql/shareRequisitionListByEmail';\n\nexport interface ShareRequisitionListByEmailError {\n message: string;\n code: string;\n}\n\nexport const shareRequisitionListByEmail = async (\n requisitionListUid: string,\n customerUids: string[],\n): Promise<Array<ShareRequisitionListByEmailError> | null> => {\n return fetchGraphQl(SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION, {\n variables: { requisitionListUid, customerUids },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n const shareResult = data?.shareRequisitionListByEmail;\n\n if ((shareResult?.sent_count ?? 0) > 0) {\n return null;\n }\n\n if (shareResult?.user_errors?.length) {\n return shareResult.user_errors.map(\n (e: ShareRequisitionListByEmailError) => ({\n message: e.message,\n code: e.code,\n }),\n );\n }\n return [\n { code: 'SHARE_FAILED', message: 'Unable to share requisition list.' },\n ];\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION = `\n mutation SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION(\n $requisitionListUid: ID!\n ) {\n shareRequisitionListByToken(\n requisitionListUid: $requisitionListUid\n ) {\n token\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION } from '@/requisitionList/api/shareRequisitionListByToken/graphql/shareRequisitionListByToken';\n\nexport interface ShareRequisitionListByTokenResult {\n token: string | null;\n errorMessage: string | null;\n}\n\nexport const shareRequisitionListByToken = async (\n requisitionListUid: string,\n): Promise<ShareRequisitionListByTokenResult> => {\n try {\n const { errors, data } = await fetchGraphQl(\n SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION,\n { variables: { requisitionListUid } },\n );\n\n if (errors?.length) {\n return {\n token: null,\n errorMessage: errors[0]?.message ?? null,\n };\n }\n\n return {\n token: data?.shareRequisitionListByToken?.token ?? null,\n errorMessage: null,\n };\n } catch (error) {\n return {\n token: null,\n errorMessage:\n error instanceof Error\n ? error.message\n : 'Unable to generate share link.',\n };\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const GET_SHARED_REQUISITION_LIST_QUERY = `\n query GET_SHARED_REQUISITION_LIST_QUERY(\n $token: String!\n $currentPage: Int = 1\n $pageSize: Int = 10\n ) {\n sharedRequisitionList(token: $token) {\n sender_name\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { enrichConfigurableProducts as defaultEnrichConfigurableProducts } from '@/requisitionList/api/enrichConfigurableProducts';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { GET_SHARED_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getSharedRequisitionList/graphql/getSharedRequisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\n\nexport interface SharedRequisitionListResult {\n senderName: string;\n requisitionList: RequisitionList;\n}\n\nexport const getSharedRequisitionList = async (\n token: string,\n currentPage?: number,\n pageSize?: number,\n enrichConfigurableProducts: (\n items: Item[],\n ) => Promise<Item[]> = defaultEnrichConfigurableProducts,\n): Promise<SharedRequisitionListResult | null> => {\n const { errors, data } = await fetchGraphQl(\n GET_SHARED_REQUISITION_LIST_QUERY,\n {\n variables: { token, currentPage, pageSize },\n },\n );\n\n if (errors) return handleFetchError(errors);\n\n const raw = data?.sharedRequisitionList;\n if (!raw?.requisition_list) {\n return null;\n }\n\n let requisitionList = transformRequisitionList(raw.requisition_list);\n if (!requisitionList) {\n return null;\n }\n\n if (requisitionList.items?.length && enrichConfigurableProducts) {\n requisitionList = {\n ...requisitionList,\n items: await enrichConfigurableProducts(requisitionList.items),\n };\n }\n\n return {\n senderName: raw.sender_name,\n requisitionList,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const IMPORT_SHARED_REQUISITION_LIST_MUTATION = `\n mutation IMPORT_SHARED_REQUISITION_LIST_MUTATION($token: String!) {\n importSharedRequisitionList(token: $token) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n user_errors {\n message\n code\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { IMPORT_SHARED_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/importSharedRequisitionList/graphql/importSharedRequisitionList';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\n\nexport interface ImportSharedRequisitionListUserError {\n message: string;\n code: string;\n}\n\nexport interface ImportSharedRequisitionListResult {\n requisitionList: RequisitionList | null;\n userErrors: ImportSharedRequisitionListUserError[];\n}\n\nexport const importSharedRequisitionList = async (\n token: string,\n): Promise<ImportSharedRequisitionListResult> => {\n const { errors, data } = await fetchGraphQl(\n IMPORT_SHARED_REQUISITION_LIST_MUTATION,\n { variables: { token } },\n );\n\n if (errors) return handleFetchError(errors);\n\n const result = data?.importSharedRequisitionList;\n\n return {\n requisitionList: result?.requisition_list\n ? (transformRequisitionList(result.requisition_list) ?? null)\n : null,\n userErrors: (result?.user_errors ?? []).map(\n (e: ImportSharedRequisitionListUserError) => ({\n message: e.message,\n code: e.code,\n }),\n ),\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const GET_PUBLIC_REQUISITION_LIST_QUERY = `\n query GET_PUBLIC_REQUISITION_LIST_QUERY(\n $token: ID!\n $currentPage: Int = 1\n $pageSize: Int = 10\n ) {\n publicRequisitionList(token: $token) {\n sender_name\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n items {\n uid\n product { name small_image { url label } url_key }\n }\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { GET_PUBLIC_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getPublicRequisitionList/graphql/getPublicRequisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { enrichConfigurableProducts as defaultEnrichConfigurableProducts } from '@/requisitionList/api/enrichConfigurableProducts';\nimport { SharedRequisitionListResult } from '@/requisitionList/api/getSharedRequisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\n\nexport const getPublicRequisitionList = async (\n token: string,\n currentPage?: number,\n pageSize?: number,\n enrichConfigurableProducts: (\n items: Item[],\n ) => Promise<Item[]> = defaultEnrichConfigurableProducts,\n): Promise<SharedRequisitionListResult | null> => {\n const { errors, data } = await fetchGraphQl(\n GET_PUBLIC_REQUISITION_LIST_QUERY,\n {\n variables: { token, currentPage, pageSize },\n },\n );\n if (errors) return handleFetchError(errors);\n const raw = data?.publicRequisitionList;\n const requisitionList = raw?.requisition_list\n ? transformRequisitionList(raw.requisition_list)\n : null;\n if (!requisitionList) return null;\n if (requisitionList.items?.length) {\n requisitionList.items = await enrichConfigurableProducts(\n requisitionList.items,\n );\n }\n return {\n senderName: raw.sender_name,\n requisitionList,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const ADD_PUBLIC_REQUISITION_LIST_ITEMS_TO_CART_MUTATION = `\n mutation ADD_PUBLIC_REQUISITION_LIST_ITEMS_TO_CART_MUTATION(\n $input: AddPublicRequisitionListItemsToCartInput!\n ) {\n addPublicRequisitionListItemsToCart(input: $input) {\n cart { id }\n user_errors { code message }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { ADD_PUBLIC_REQUISITION_LIST_ITEMS_TO_CART_MUTATION } from '@/requisitionList/api/addPublicRequisitionListItemsToCart/graphql/addPublicRequisitionListItemsToCart';\n\nexport interface PublicRequisitionListUserError {\n code: string;\n message: string;\n}\n\nexport interface AddPublicRequisitionListItemsToCartResult {\n cart: { id: string } | null;\n userErrors: PublicRequisitionListUserError[];\n}\n\nexport const addPublicRequisitionListItemsToCart = async (\n token: string,\n cartId: string,\n itemUids?: string[],\n): Promise<AddPublicRequisitionListItemsToCartResult> => {\n const { errors, data } = await fetchGraphQl(\n ADD_PUBLIC_REQUISITION_LIST_ITEMS_TO_CART_MUTATION,\n { variables: { input: { token, cart_id: cartId, item_uids: itemUids } } },\n );\n if (errors) return handleFetchError(errors);\n\n const result = data?.addPublicRequisitionListItemsToCart;\n\n if (!result) {\n return {\n cart: null,\n userErrors: [\n { code: 'UNKNOWN_ERROR', message: 'Unable to add items to cart.' },\n ],\n };\n }\n\n return { cart: result.cart, userErrors: result.user_errors ?? [] };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const SHARE_PUBLIC_REQUISITION_LIST_MUTATION = `\n mutation SHARE_PUBLIC_REQUISITION_LIST_MUTATION($input: SharePublicRequisitionListInput!) {\n sharePublicRequisitionList(input: $input) {\n sent_count\n user_errors { code message }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { SHARE_PUBLIC_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/sharePublicRequisitionList/graphql/sharePublicRequisitionList';\nimport { PublicRequisitionListUserError } from '@/requisitionList/api/addPublicRequisitionListItemsToCart';\n\nexport const sharePublicRequisitionList = async (\n requisitionListUid: string,\n emails: string[],\n): Promise<PublicRequisitionListUserError[] | null> => {\n const { errors, data } = await fetchGraphQl(\n SHARE_PUBLIC_REQUISITION_LIST_MUTATION,\n {\n variables: {\n input: { requisition_list_uid: requisitionListUid, emails },\n },\n },\n );\n if (errors) return handleFetchError(errors);\n\n const result = data?.sharePublicRequisitionList;\n\n if (result?.user_errors?.length) {\n return result.user_errors;\n }\n\n if ((result?.sent_count ?? 0) > 0) {\n return null;\n }\n\n return [\n { code: 'UNKNOWN_ERROR', message: 'Unable to share requisition list.' },\n ];\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_PUBLIC_REQUISITION_LIST_TOKEN_QUERY = `\n query GET_PUBLIC_REQUISITION_LIST_TOKEN_QUERY($requisitionListUid: String!) {\n customer {\n requisition_lists(filter: { uids: { eq: $requisitionListUid } }) {\n items { token }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { GET_PUBLIC_REQUISITION_LIST_TOKEN_QUERY } from '@/requisitionList/api/getPublicRequisitionListToken/graphql/getPublicRequisitionListToken';\n\nexport interface GetPublicRequisitionListTokenResult {\n token: string | null;\n errorMessage: string | null;\n}\n\nexport const getPublicRequisitionListToken = async (\n requisitionListUid: string,\n): Promise<GetPublicRequisitionListTokenResult> => {\n try {\n const { errors, data } = await fetchGraphQl(\n GET_PUBLIC_REQUISITION_LIST_TOKEN_QUERY,\n { variables: { requisitionListUid } },\n );\n\n if (errors?.length) {\n return {\n token: null,\n errorMessage: errors[0]?.message ?? null,\n };\n }\n\n return {\n token: data?.customer?.requisition_lists?.items?.[0]?.token ?? null,\n errorMessage: null,\n };\n } catch (error) {\n return {\n token: null,\n errorMessage:\n error instanceof Error\n ? error.message\n : 'Unable to retrieve the public share link.',\n };\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const CREATE_REQUISITION_LIST_MUTATION = `\n mutation CREATE_REQUISITION_LIST_MUTATION(\n $requisitionListName: String!,\n $requisitionListDescription: String,\n $isPublic: Boolean\n ) {\n createRequisitionList(\n input: {\n name: $requisitionListName\n description: $requisitionListDescription\n is_public: $isPublic\n }\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { CREATE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/createRequisitionList/graphql/createRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const createRequisitionList = async (\n name: string,\n description?: string,\n isPublic?: boolean,\n): Promise<RequisitionList | null> => {\n return fetchGraphQl(CREATE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListName: name,\n requisitionListDescription: description,\n isPublic,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.createRequisitionList?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.createRequisitionList.requisition_list,\n );\n events.emit('requisitionList/data', payload);\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION = `\n mutation ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItems: [RequisitionListItemsInput!]!\n ) {\n addProductsToRequisitionList(\n requisitionListUid: $requisitionListUid\n requisitionListItems: $requisitionListItems\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/addProductsToRequisitionList/graphql/addProductsToRequisitionList';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\n// Correct type for GraphQL RequisitionListItemsInput\nexport type RequisitionListItemsInput = {\n sku: string;\n quantity: number;\n parent_sku?: string;\n selected_options?: string[];\n entered_options?: Array<{ uid: string; value: string }>;\n};\n\nexport const addProductsToRequisitionList = async (\n requisitionListUid: string,\n requisitionListItems: Array<RequisitionListItemsInput>,\n): Promise<RequisitionList | null> => {\n // Clean items before performing the mutation - remove empty fields\n const cleanedItems = requisitionListItems.map((item) => {\n const cleaned: any = {\n sku: item.sku,\n quantity: item.quantity,\n };\n\n if (item.parent_sku) cleaned.parent_sku = item.parent_sku;\n if (item.selected_options && item.selected_options.length > 0) {\n cleaned.selected_options = item.selected_options;\n }\n if (item.entered_options && item.entered_options.length > 0) {\n cleaned.entered_options = item.entered_options;\n }\n\n return cleaned;\n });\n\n const { errors, data } = await fetchGraphQl(\n ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION,\n {\n variables: {\n requisitionListUid,\n requisitionListItems: cleanedItems,\n },\n },\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.addProductsToRequisitionList?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.addProductsToRequisitionList.requisition_list,\n );\n events.emit('requisitionList/data', payload);\n return payload;\n};\n"],"names":["isSharingEnabled","config","isPublicSharingEnabled","_state","state","target","key","value","setRequisitionLists","lists","updateRequisitionList","list","l","getRequisitionListsFromState","setRequisitionListsLoading","loading","STORE_CONFIG_QUERY","transformRequisitionList","data","transformItems","_a","_b","items","item","transformedItem","_c","_d","_e","_f","option","sample","_g","transformStoreConfig","DEFAULT_STORE_CONFIG","getStoreConfig","errors","fetchGraphQl","error","initialize","Initializer","defaultConfig","events","authenticated","payload","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","getConfig","FetchGraphQL","CONFIGURABLE_OPTIONS_QUERY","REFINE_CONFIGURABLE_VARIANT_QUERY","resolveOptionIds","options","optionIds","selected","o","v","toConfiguredProduct","product","enrichConfigurableProducts","configurableItems","parentSkus","optionsBySku","acc","refinements","refinedProducts","configuredProductByItem","refined","configuredProduct","REQUISITION_LIST_FRAGMENT","REQUISITION_LIST_ITEMS_FRAGMENT","GET_REQUISITION_LIST_QUERY","GET_REQUISITION_LISTS_QUERY","handleFetchError","errorMessage","e","isValidBase64Uid","uid","mergeRemainingListItemPages","listItemsPageSize","pi","mergedItems","page","raw","chunk","getRequisitionLists","currentPage","pageSize","reqLists","requisitionList","getRequisitionList","requisitionListID","defaultEnrichConfigurableProducts","rawList","UPDATE_REQUISITION_LIST_MUTATION","requisitionListUid","name","description","isPublic","DELETE_REQUISITION_LIST_MUTATION","deleteRequisitionList","UPDATE_REQUISITION_LIST_ITEMS_MUTATION","updateRequisitionListItems","requisitionListItems","DELETE_REQUISITION_LIST_ITEMS_MUTATION","deleteRequisitionListItems","ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION","addRequisitionListItemsToCart","requisitionListItemUids","MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION","moveItemsBetweenRequisitionLists","sourceRequisitionListUid","destinationRequisitionListUid","source_requisition_list","destination_requisition_list","sourceList","destinationList","COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION","copyItemsBetweenRequisitionLists","GET_COMPANY_USERS_QUERY","PAGE_SIZE","fetchPage","users","getCompanyUsers","firstPage","totalPages","remainingPages","_","i","SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION","shareRequisitionListByEmail","customerUids","shareResult","SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION","shareRequisitionListByToken","GET_SHARED_REQUISITION_LIST_QUERY","getSharedRequisitionList","token","IMPORT_SHARED_REQUISITION_LIST_MUTATION","importSharedRequisitionList","result","GET_PUBLIC_REQUISITION_LIST_QUERY","getPublicRequisitionList","ADD_PUBLIC_REQUISITION_LIST_ITEMS_TO_CART_MUTATION","addPublicRequisitionListItemsToCart","cartId","itemUids","SHARE_PUBLIC_REQUISITION_LIST_MUTATION","sharePublicRequisitionList","emails","GET_PUBLIC_REQUISITION_LIST_TOKEN_QUERY","getPublicRequisitionListToken","CREATE_REQUISITION_LIST_MUTATION","createRequisitionList","ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION","addProductsToRequisitionList","cleanedItems","cleaned"],"mappings":"wKAiCO,MAAMA,GAAoBC,IAC/BA,GAAA,YAAAA,EAAQ,oCAAqC,GAElCC,GAA0BD,IACrCA,GAAA,YAAAA,EAAQ,2CAA4C,GAWhDE,EACG,CACL,cAAe,GACf,OAAQ,OACR,cAAe,GACf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