@dropins/storefront-account 1.0.9 → 1.2.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.
Files changed (32) hide show
  1. package/api/getCustomerAddress/graphql/getCustomerAddress.graphql.d.ts +1 -1
  2. package/chunks/AddressValidation.js +4 -0
  3. package/chunks/AddressValidation.js.map +1 -0
  4. package/chunks/getOrderHistoryList.js +4 -4
  5. package/chunks/getOrderHistoryList.js.map +1 -1
  6. package/chunks/removeCustomerAddress.js +3 -2
  7. package/chunks/removeCustomerAddress.js.map +1 -1
  8. package/components/AddressValidation/AddressValidation.d.ts +14 -0
  9. package/components/AddressValidation/index.d.ts +19 -0
  10. package/components/index.d.ts +1 -0
  11. package/containers/AddressForm.js +1 -1
  12. package/containers/AddressValidation/AddressValidation.d.ts +14 -0
  13. package/containers/AddressValidation/index.d.ts +19 -0
  14. package/containers/AddressValidation.d.ts +3 -0
  15. package/containers/AddressValidation.js +4 -0
  16. package/containers/AddressValidation.js.map +1 -0
  17. package/containers/Addresses.js +1 -1
  18. package/containers/Addresses.js.map +1 -1
  19. package/containers/CustomerInformation.js +1 -1
  20. package/containers/CustomerInformation.js.map +1 -1
  21. package/containers/OrdersList.js +1 -1
  22. package/containers/OrdersList.js.map +1 -1
  23. package/data/models/customer-address.d.ts +1 -0
  24. package/i18n/en_US.json.d.ts +6 -0
  25. package/package.json +1 -1
  26. package/render.js +2 -2
  27. package/render.js.map +1 -1
  28. package/types/addressForm.types.d.ts +1 -1
  29. package/types/addresses.types.d.ts +1 -1
  30. package/types/api/getCustomerAddress.type.d.ts +1 -0
  31. package/chunks/CustomerInformationCard.js +0 -4
  32. package/chunks/CustomerInformationCard.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"getOrderHistoryList.js","sources":["/@dropins/storefront-account/src/lib/formatDateToLocale.ts","/@dropins/storefront-account/src/data/transforms/transform-order-history-list.ts","/@dropins/storefront-account/src/api/getOrderHistoryList/graphql/getOrderHistoryList.graphql.ts","/@dropins/storefront-account/src/api/getOrderHistoryList/getOrderHistoryList.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 * Formats a date string according to a specified locale and options.\n * Returns \"Invalid Date\" if the input date string is invalid.\n *\n * @param {string} date - The date string to be formatted.\n * @param {string} [locale='en-US'] - The locale to use for formatting. Defaults to 'en-US'.\n * @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options to customize the output.\n * @returns {string} The formatted date string, or \"Invalid Date\" if the input is invalid.\n *\n * @example\n * // Default formatting (en-US locale, MM/DD/YYYY)\n * console.log(formatDateToLocale('2023-08-29'));\n * // Output: \"08/29/2023\"\n *\n * @example\n * // Formatting with a specified locale (e.g., en-GB for DD/MM/YYYY)\n * console.log(formatDateToLocale('2023-08-29', 'en-GB'));\n * // Output: \"29/08/2023\"\n *\n * @example\n * // Formatting with a specified locale and custom options (e.g., de-DE with long month format)\n * console.log(formatDateToLocale('2023-08-29', 'de-DE', { month: 'long', year: 'numeric' }));\n * // Output: \"29. August 2023\"\n *\n * @example\n * // Handling an invalid date string\n * console.log(formatDateToLocale('invalid-date'));\n * // Output: \"Invalid Date\"\n */\nexport const formatDateToLocale = (\n date: string,\n locale: string = 'en-US',\n options: Intl.DateTimeFormatOptions = {}\n): string => {\n const defaultOptions: Intl.DateTimeFormatOptions = {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n };\n const formatOptions: Intl.DateTimeFormatOptions = {\n ...defaultOptions,\n ...options,\n };\n\n const dateObj = new Date(date);\n\n if (isNaN(dateObj.getTime())) {\n return 'Invalid Date';\n }\n\n const formatter = new Intl.DateTimeFormat(locale, formatOptions);\n return formatter.format(dateObj);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 {\n OrderHistoryListResponse,\n OrderProps,\n ReturnProps,\n} from '@/account/types';\nimport { OrderHistoryModel } from '@/account/data/models';\nimport { transformSingleAddress } from '@/account/data/transforms/transform-customer-address';\nimport { formatDateToLocale } from '@/account/lib/formatDateToLocale';\nimport { config } from '@/account/api';\nimport { merge } from '@adobe-commerce/elsie/lib';\n\nconst initialMoneyProps = {\n value: 0,\n currency: 'USD',\n};\n\nconst transformOrderHistoryTotal = (item: any) => {\n return {\n subtotal: item?.total?.subtotal ?? initialMoneyProps,\n grandTotal: item?.total?.grand_total ?? initialMoneyProps,\n grandTotalExclTax: item?.total?.grand_total_excl_tax ?? initialMoneyProps,\n totalGiftcard: item?.total?.total_giftcard ?? initialMoneyProps,\n subtotalExclTax: item?.total?.subtotal_excl_tax ?? initialMoneyProps,\n subtotalInclTax: item?.total?.subtotal_incl_tax ?? initialMoneyProps,\n taxes: item?.total?.taxes ?? [],\n totalTax: item?.total?.total_tax ?? initialMoneyProps,\n totalShipping: item?.total?.total_shipping ?? initialMoneyProps,\n discounts: item?.total?.discounts ?? [],\n };\n};\n\nexport const transformOrderHistoryList = (\n response: OrderHistoryListResponse\n): OrderHistoryModel | null => {\n if (!response.data?.customer?.orders) return null;\n\n const returns = response?.data?.customer?.returns ?? [];\n const items = response?.data?.customer?.orders?.items ?? [];\n\n const model = {\n items: items.map((item: OrderProps) => {\n const transformedItem = {\n items: item?.items.map((element) => ({\n status: element?.status ?? '',\n productName: element?.product_name ?? '',\n id: element?.id,\n quantityOrdered: element?.quantity_ordered ?? 0,\n quantityShipped: element?.quantity_shipped ?? 0,\n quantityInvoiced: element?.quantity_invoiced ?? 0,\n product: {\n sku: element?.product?.sku ?? '',\n urlKey: element?.product?.url_key ?? '',\n smallImage: {\n url: element?.product?.small_image?.url ?? '',\n },\n },\n })),\n token: item?.token,\n email: item?.email,\n shippingMethod: item?.shipping_method,\n paymentMethods: item?.payment_methods ?? [],\n shipments: item?.shipments ?? [],\n id: item?.id,\n carrier: item?.carrier,\n status: item?.status,\n number: item?.number,\n returns: returns?.items?.filter(\n (returnItem: ReturnProps) => returnItem.order.id === item.id\n ),\n orderDate: formatDateToLocale(item.order_date),\n shippingAddress: transformSingleAddress(item.shipping_address),\n billingAddress: transformSingleAddress(item.billing_address),\n total: transformOrderHistoryTotal(item),\n };\n\n return transformedItem;\n }),\n pageInfo: {\n pageSize: response?.data?.customer?.orders?.page_info?.page_size ?? 10,\n totalPages: response?.data?.customer?.orders?.page_info?.total_pages ?? 1,\n currentPage:\n response?.data?.customer?.orders?.page_info?.current_page ?? 1,\n },\n totalCount: response?.data?.customer?.orders?.total_count ?? 0,\n dateOfFirstOrder:\n response?.data?.customer?.orders?.date_of_first_order ?? '',\n };\n\n return merge(\n model, // default transformer\n config?.getConfig()?.models?.OrderHistoryModel?.transformer?.(response.data) // custom transformer\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 {\n ADDRESS_FRAGMENT,\n ORDER_SUMMARY_FRAGMENT,\n} from '@/account/api/fragments';\n\nexport const GET_CUSTOMER_ORDERS_LIST = /* GraphQL */ `\n query GET_CUSTOMER_ORDERS_LIST(\n $currentPage: Int\n $pageSize: Int\n $filter: CustomerOrdersFilterInput\n $sort: CustomerOrderSortInput\n ) {\n customer {\n returns {\n items {\n uid\n number\n order {\n id\n }\n }\n }\n orders(\n currentPage: $currentPage\n pageSize: $pageSize\n filter: $filter\n sort: $sort\n ) {\n page_info {\n page_size\n total_pages\n current_page\n }\n date_of_first_order\n total_count\n items {\n token\n email\n shipping_method\n payment_methods {\n name\n type\n }\n shipping_address {\n ...ADDRESS_FRAGMENT\n }\n billing_address {\n ...ADDRESS_FRAGMENT\n }\n shipments {\n id\n number\n tracking {\n title\n number\n carrier\n }\n }\n number\n id\n order_date\n carrier\n status\n items {\n status\n product_name\n id\n quantity_ordered\n quantity_shipped\n quantity_invoiced\n product {\n sku\n url_key\n small_image {\n url\n }\n }\n }\n total {\n ...ORDER_SUMMARY_FRAGMENT\n }\n }\n }\n }\n }\n ${ADDRESS_FRAGMENT}\n ${ORDER_SUMMARY_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 '@/account/api';\nimport { handleNetworkError } from '@/account/lib/network-error';\nimport { GET_CUSTOMER_ORDERS_LIST } from './graphql/getOrderHistoryList.graphql';\nimport { OrderHistoryListResponse } from '@/account/types';\nimport { transformOrderHistoryList } from '@/account/data/transforms';\nimport { OrderHistoryModel } from '@/account/data/models';\n\nconst SORT_DIRECTION = { sort_direction: 'DESC', sort_field: 'CREATED_AT' };\n\nexport const getOrderHistoryList = async (\n pageSize: number,\n selectOrdersDate: string,\n currentPage: number\n): Promise<OrderHistoryModel | null> => {\n const filterOrderDate = !selectOrdersDate.includes('viewAll')\n ? {\n order_date: JSON.parse(selectOrdersDate),\n }\n : {};\n\n return await fetchGraphQl(GET_CUSTOMER_ORDERS_LIST, {\n method: 'GET',\n cache: 'no-cache',\n variables: {\n pageSize,\n currentPage,\n filter: filterOrderDate,\n sort: SORT_DIRECTION,\n },\n })\n .then((response: OrderHistoryListResponse) => {\n return transformOrderHistoryList(response);\n })\n .catch(handleNetworkError);\n};\n"],"names":["formatDateToLocale","date","locale","options","formatOptions","dateObj","initialMoneyProps","transformOrderHistoryTotal","item","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","transformOrderHistoryList","response","returns","model","element","returnItem","transformSingleAddress","_k","_o","_n","_m","_l","_s","_r","_q","_p","_v","_u","_t","_y","_x","_w","merge","_D","_C","_B","_A","_z","config","GET_CUSTOMER_ORDERS_LIST","ADDRESS_FRAGMENT","ORDER_SUMMARY_FRAGMENT","SORT_DIRECTION","getOrderHistoryList","pageSize","selectOrdersDate","currentPage","filterOrderDate","fetchGraphQl","handleNetworkError"],"mappings":"sQA8CO,MAAMA,EAAqB,CAChCC,EACAC,EAAiB,QACjBC,EAAsC,CAAA,IAC3B,CAMX,MAAMC,EAA4C,CAChD,GANiD,CACjD,IAAK,UACL,MAAO,UACP,KAAM,SACR,EAGE,GAAGD,CACL,EAEME,EAAU,IAAI,KAAKJ,CAAI,EAE7B,OAAI,MAAMI,EAAQ,QAAQ,CAAC,EAClB,eAGS,IAAI,KAAK,eAAeH,EAAQE,CAAa,EAC9C,OAAOC,CAAO,CACjC,ECzCMC,EAAoB,CACxB,MAAO,EACP,SAAU,KACZ,EAEMC,EAA8BC,GAAc,yBACzC,MAAA,CACL,WAAUC,EAAAD,GAAA,YAAAA,EAAM,QAAN,YAAAC,EAAa,WAAYH,EACnC,aAAYI,EAAAF,GAAA,YAA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WAAY,YAAa,EAE7DC,GAAsB,MACjCC,EACAC,EACAC,IACsC,CACtC,MAAMC,EAAmBF,EAAiB,SAAS,SAAS,EAIxD,CAAC,EAHD,CACE,WAAY,KAAK,MAAMA,CAAgB,CAAA,EAItC,OAAA,MAAMG,EAAaT,EAA0B,CAClD,OAAQ,MACR,MAAO,WACP,UAAW,CACT,SAAAK,EACA,YAAAE,EACA,OAAQC,EACR,KAAML,CAAA,CACR,CACD,EACE,KAAM/B,GACED,EAA0BC,CAAQ,CAC1C,EACA,MAAMsC,CAAkB,CAC7B"}
1
+ {"version":3,"file":"getOrderHistoryList.js","sources":["/@dropins/storefront-account/src/lib/formatDateToLocale.ts","/@dropins/storefront-account/src/data/transforms/transform-order-history-list.ts","/@dropins/storefront-account/src/api/getOrderHistoryList/graphql/getOrderHistoryList.graphql.ts","/@dropins/storefront-account/src/api/getOrderHistoryList/getOrderHistoryList.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 * Formats a date string according to a specified locale and options.\n * Returns \"Invalid Date\" if the input date string is invalid.\n *\n * @param {string} date - The date string to be formatted.\n * @param {string} [locale='en-US'] - The locale to use for formatting. Defaults to 'en-US'.\n * @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options to customize the output.\n * @returns {string} The formatted date string, or \"Invalid Date\" if the input is invalid.\n *\n * @example\n * // Default formatting (en-US locale, MM/DD/YYYY)\n * console.log(formatDateToLocale('2023-08-29'));\n * // Output: \"08/29/2023\"\n *\n * @example\n * // Formatting with a specified locale (e.g., en-GB for DD/MM/YYYY)\n * console.log(formatDateToLocale('2023-08-29', 'en-GB'));\n * // Output: \"29/08/2023\"\n *\n * @example\n * // Formatting with a specified locale and custom options (e.g., de-DE with long month format)\n * console.log(formatDateToLocale('2023-08-29', 'de-DE', { month: 'long', year: 'numeric' }));\n * // Output: \"29. August 2023\"\n *\n * @example\n * // Handling an invalid date string\n * console.log(formatDateToLocale('invalid-date'));\n * // Output: \"Invalid Date\"\n */\nexport const formatDateToLocale = (\n date: string,\n locale: string = 'en-US',\n options: Intl.DateTimeFormatOptions = {}\n): string => {\n const defaultOptions: Intl.DateTimeFormatOptions = {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n };\n const formatOptions: Intl.DateTimeFormatOptions = {\n ...defaultOptions,\n ...options,\n };\n\n const dateObj = new Date(date);\n\n if (isNaN(dateObj.getTime())) {\n return 'Invalid Date';\n }\n\n const formatter = new Intl.DateTimeFormat(locale, formatOptions);\n return formatter.format(dateObj);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 {\n OrderHistoryListResponse, OrderItemProps,\n OrderProps,\n ReturnProps,\n} from '@/account/types';\nimport { OrderHistoryModel } from '@/account/data/models';\nimport { transformSingleAddress } from '@/account/data/transforms/transform-customer-address';\nimport { formatDateToLocale } from '@/account/lib/formatDateToLocale';\nimport { config } from '@/account/api';\nimport { merge } from '@adobe-commerce/elsie/lib';\n\nconst initialMoneyProps = {\n value: 0,\n currency: 'USD',\n};\n\nconst transformOrderHistoryTotal = (item: any) => {\n return {\n subtotal: item?.total?.subtotal ?? initialMoneyProps,\n grandTotal: item?.total?.grand_total ?? initialMoneyProps,\n grandTotalExclTax: item?.total?.grand_total_excl_tax ?? initialMoneyProps,\n totalGiftcard: item?.total?.total_giftcard ?? initialMoneyProps,\n subtotalExclTax: item?.total?.subtotal_excl_tax ?? initialMoneyProps,\n subtotalInclTax: item?.total?.subtotal_incl_tax ?? initialMoneyProps,\n taxes: item?.total?.taxes ?? [],\n totalTax: item?.total?.total_tax ?? initialMoneyProps,\n totalShipping: item?.total?.total_shipping ?? initialMoneyProps,\n discounts: item?.total?.discounts ?? [],\n };\n};\n\nexport const transformOrderHistoryList = (\n response: OrderHistoryListResponse\n): OrderHistoryModel | null => {\n if (!response.data?.customer?.orders) return null;\n\n const returns = response?.data?.customer?.returns ?? [];\n const items = response?.data?.customer?.orders?.items ?? [];\n\n const model = {\n items: items.map((item: OrderProps) => {\n return {\n items: item?.items.map((element: OrderItemProps) => ({\n status: element?.status ?? '',\n productName: element?.product_name ?? '',\n id: element?.id,\n quantityOrdered: element?.quantity_ordered ?? 0,\n quantityShipped: element?.quantity_shipped ?? 0,\n quantityInvoiced: element?.quantity_invoiced ?? 0,\n sku: element?.sku ?? '',\n urlKey: element?.url_key ?? '',\n product: {\n smallImage: {\n url: element?.product?.small_image?.url ?? '',\n },\n },\n })),\n token: item?.token,\n email: item?.email,\n shippingMethod: item?.shipping_method,\n paymentMethods: item?.payment_methods ?? [],\n shipments: item?.shipments ?? [],\n id: item?.id,\n carrier: item?.carrier,\n status: item?.status,\n number: item?.number,\n returns: returns?.items?.filter(\n (returnItem: ReturnProps) => returnItem.order.id === item.id\n ),\n orderDate: formatDateToLocale(item.order_date),\n shippingAddress: transformSingleAddress(item.shipping_address),\n billingAddress: transformSingleAddress(item.billing_address),\n total: transformOrderHistoryTotal(item),\n };\n }),\n pageInfo: {\n pageSize: response?.data?.customer?.orders?.page_info?.page_size ?? 10,\n totalPages: response?.data?.customer?.orders?.page_info?.total_pages ?? 1,\n currentPage:\n response?.data?.customer?.orders?.page_info?.current_page ?? 1,\n },\n totalCount: response?.data?.customer?.orders?.total_count ?? 0,\n dateOfFirstOrder:\n response?.data?.customer?.orders?.date_of_first_order ?? '',\n };\n\n return merge(\n model, // default transformer\n config?.getConfig()?.models?.OrderHistoryModel?.transformer?.(response.data) // custom transformer\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 {\n ADDRESS_FRAGMENT,\n ORDER_SUMMARY_FRAGMENT,\n} from '@/account/api/fragments';\n\nexport const GET_CUSTOMER_ORDERS_LIST = /* GraphQL */ `\n query GET_CUSTOMER_ORDERS_LIST(\n $currentPage: Int\n $pageSize: Int\n $filter: CustomerOrdersFilterInput\n $sort: CustomerOrderSortInput\n ) {\n customer {\n returns {\n items {\n uid\n number\n order {\n id\n }\n }\n }\n orders(\n currentPage: $currentPage\n pageSize: $pageSize\n filter: $filter\n sort: $sort\n ) {\n page_info {\n page_size\n total_pages\n current_page\n }\n date_of_first_order\n total_count\n items {\n token\n email\n shipping_method\n payment_methods {\n name\n type\n }\n shipping_address {\n ...ADDRESS_FRAGMENT\n }\n billing_address {\n ...ADDRESS_FRAGMENT\n }\n shipments {\n id\n number\n tracking {\n title\n number\n carrier\n }\n }\n number\n id\n order_date\n carrier\n status\n items {\n status\n product_name\n id\n quantity_ordered\n quantity_shipped\n quantity_invoiced\n product {\n sku\n url_key\n small_image {\n url\n }\n }\n }\n total {\n ...ORDER_SUMMARY_FRAGMENT\n }\n }\n }\n }\n }\n ${ADDRESS_FRAGMENT}\n ${ORDER_SUMMARY_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 '@/account/api';\nimport { handleNetworkError } from '@/account/lib/network-error';\nimport { GET_CUSTOMER_ORDERS_LIST } from './graphql/getOrderHistoryList.graphql';\nimport { OrderHistoryListResponse } from '@/account/types';\nimport { transformOrderHistoryList } from '@/account/data/transforms';\nimport { OrderHistoryModel } from '@/account/data/models';\n\nconst SORT_DIRECTION = { sort_direction: 'DESC', sort_field: 'CREATED_AT' };\n\nexport const getOrderHistoryList = async (\n pageSize: number,\n selectOrdersDate: string,\n currentPage: number\n): Promise<OrderHistoryModel | null> => {\n const filterOrderDate = !selectOrdersDate.includes('viewAll')\n ? {\n order_date: JSON.parse(selectOrdersDate),\n }\n : {};\n\n return await fetchGraphQl(GET_CUSTOMER_ORDERS_LIST, {\n method: 'GET',\n cache: 'no-cache',\n variables: {\n pageSize,\n currentPage,\n filter: filterOrderDate,\n sort: SORT_DIRECTION,\n },\n })\n .then((response: OrderHistoryListResponse) => {\n return transformOrderHistoryList(response);\n })\n .catch(handleNetworkError);\n};\n"],"names":["formatDateToLocale","date","locale","options","formatOptions","dateObj","initialMoneyProps","transformOrderHistoryTotal","item","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","transformOrderHistoryList","response","returns","model","element","returnItem","transformSingleAddress","_k","_o","_n","_m","_l","_s","_r","_q","_p","_v","_u","_t","_y","_x","_w","merge","_D","_C","_B","_A","_z","config","GET_CUSTOMER_ORDERS_LIST","ADDRESS_FRAGMENT","ORDER_SUMMARY_FRAGMENT","SORT_DIRECTION","getOrderHistoryList","pageSize","selectOrdersDate","currentPage","filterOrderDate","fetchGraphQl","handleN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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgFlDC,CAAgB;AAAA,IAChBC,CAAsB;AAAA,EC/EpBC,EAAiB,CAAE,eAAgB,OAAQ,WAAY,YAAa,EAE7DC,GAAsB,MACjCC,EACAC,EACAC,IACsC,CACtC,MAAMC,EAAmBF,EAAiB,SAAS,SAAS,EAIxD,CAAC,EAHD,CACE,WAAY,KAAK,MAAMA,CAAgB,CAAA,EAItC,OAAA,MAAMG,EAAaT,EAA0B,CAClD,OAAQ,MACR,MAAO,WACP,UAAW,CACT,SAAAK,EACA,YAAAE,EACA,OAAQC,EACR,KAAML,CAAA,CACR,CACD,EACE,KAAM/B,GACED,EAA0BC,CAAQ,CAC1C,EACA,MAAMsC,CAAkB,CAC7B"}
@@ -46,7 +46,7 @@ import{events as E}from"@dropins/tools/event-bus.js";import{FetchGraphQL as C}fr
46
46
  }
47
47
  }
48
48
  }
49
- `,_=t=>{throw t instanceof DOMException&&t.name==="AbortError"||E.emit("error",{source:"auth",type:"network",error:t}),t},f=t=>{const r=t.map(n=>n.message).join(" ");throw Error(r)},y=t=>{let r=[];for(const n of t)if(!(n.frontend_input!=="MULTILINE"||n.multiline_count<2))for(let o=2;o<=n.multiline_count;o++){const u={...n,is_required:!1,name:`${n.code}_multiline_${o}`,code:`${n.code}_multiline_${o}`,id:`${n.code}_multiline_${o}`};r.push(u)}return r},R=t=>{switch(t){case"middlename":return"middleName";case"firstname":return"firstName";case"lastname":return"lastName";default:return b(t)}},v=t=>{var r;return t!=null&&t.options?(r=t==null?void 0:t.options)==null?void 0:r.map(n=>({isDefault:(n==null?void 0:n.is_default)??!1,text:(n==null?void 0:n.label)??"",value:(n==null?void 0:n.value)??""})):[]},N=t=>{var i,c,a;const r=((c=(i=t==null?void 0:t.data)==null?void 0:i.attributesForm)==null?void 0:c.items)||[];if(!r.length)return[];const n=(a=r.filter(e=>{var l;return!((l=e.frontend_input)!=null&&l.includes("HIDDEN"))}))==null?void 0:a.map(({code:e,...l})=>{const h=e!=="country_id"?e:"country_code";return{...l,name:h,id:h,code:h}}),o=y(n);return n.concat(o).map(e=>({code:e==null?void 0:e.code,name:e==null?void 0:e.name,id:e==null?void 0:e.id,label:(e==null?void 0:e.label)??"",entityType:e==null?void 0:e.entity_type,className:(e==null?void 0:e.frontend_class)??"",defaultValue:(e==null?void 0:e.default_value)??"",fieldType:e==null?void 0:e.frontend_input,multilineCount:(e==null?void 0:e.multiline_count)??0,orderNumber:Number(e==null?void 0:e.sort_order)||0,isHidden:!1,isUnique:(e==null?void 0:e.is_unique)??!1,required:(e==null?void 0:e.is_required)??!1,validateRules:(e==null?void 0:e.validate_rules)??[],options:v(e),customUpperCode:R(e==null?void 0:e.code)})).sort((e,l)=>Number(e.orderNumber)-Number(l.orderNumber))},O=t=>{const r={};for(const n in t){const o=t[n];!Array.isArray(o)||o.length===0||(n==="custom_attributesV2"?o.forEach(u=>{typeof u=="object"&&"value"in u&&(r[u==null?void 0:u.code]=u==null?void 0:u.value)}):o.length>1?o.forEach((u,i)=>{i===0?r[n]=u:r[`${n}_multiline_${i+1}`]=u}):r[n]=o[0])}return r},I=t=>({prefix:(t==null?void 0:t.prefix)??"",suffix:(t==null?void 0:t.suffix)??"",firstname:(t==null?void 0:t.firstname)??"",lastname:(t==null?void 0:t.lastname)??"",middlename:(t==null?void 0:t.middlename)??""}),U=t=>({id:(t==null?void 0:t.id)??"",vat_id:(t==null?void 0:t.vat_id)??"",postcode:(t==null?void 0:t.postcode)??"",country_code:(t==null?void 0:t.country_code)??""}),M=t=>({company:(t==null?void 0:t.company)??"",telephone:(t==null?void 0:t.telephone)??"",fax:(t==null?void 0:t.fax)??""}),$=t=>{var n,o,u;return g({...I(t),...U(t),...M(t),city:(t==null?void 0:t.city)??"",region:{region:((n=t==null?void 0:t.region)==null?void 0:n.region)??"",region_code:((o=t==null?void 0:t.region)==null?void 0:o.region_code)??"",region_id:((u=t==null?void 0:t.region)==null?void 0:u.region_id)??""},default_shipping:(t==null?void 0:t.default_shipping)||!1,default_billing:(t==null?void 0:t.default_billing)||!1,...O(t)},"camelCase",{})},w=t=>{var o,u;const r=((u=(o=t==null?void 0:t.data)==null?void 0:o.customer)==null?void 0:u.addresses)||[];return r.length?r.map($).sort((i,c)=>(Number(c.defaultBilling)||Number(c.defaultShipping))-(Number(i.defaultBilling)||Number(i.defaultShipping))):[]},q=t=>{var c,a;if(!((a=(c=t==null?void 0:t.data)==null?void 0:c.countries)!=null&&a.length))return{availableCountries:[],countriesWithRequiredRegion:[],optionalZipCountries:[]};const{countries:r,storeConfig:n}=t.data,o=n==null?void 0:n.countries_with_required_region.split(","),u=n==null?void 0:n.optional_zip_countries.split(",");return{availableCountries:r.filter(({two_letter_abbreviation:e,full_name_locale:l})=>!!(e&&l)).map(e=>{const{two_letter_abbreviation:l,full_name_locale:h,available_regions:m}=e,p=Array.isArray(m)&&m.length>0;return{value:l,text:h,availableRegions:p?m:void 0}}).sort((e,l)=>e.text.localeCompare(l.text)),countriesWithRequiredRegion:o,optionalZipCountries:u}},K=async t=>{const r=`_account_attributesForm_${t}`,n=sessionStorage.getItem(r);return n?JSON.parse(n):await s(t!=="shortRequest"?A:T,{method:"GET",cache:"force-cache",variables:{formCode:t}}).then(o=>{var i;if((i=o.errors)!=null&&i.length)return f(o.errors);const u=N(o);return sessionStorage.setItem(r,JSON.stringify(u)),u}).catch(_)},x=`
49
+ `,_=t=>{throw t instanceof DOMException&&t.name==="AbortError"||E.emit("error",{source:"auth",type:"network",error:t}),t},f=t=>{const r=t.map(n=>n.message).join(" ");throw Error(r)},y=t=>{let r=[];for(const n of t)if(!(n.frontend_input!=="MULTILINE"||n.multiline_count<2))for(let o=2;o<=n.multiline_count;o++){const u={...n,is_required:!1,name:`${n.code}_multiline_${o}`,code:`${n.code}_multiline_${o}`,id:`${n.code}_multiline_${o}`};r.push(u)}return r},R=t=>{switch(t){case"middlename":return"middleName";case"firstname":return"firstName";case"lastname":return"lastName";default:return b(t)}},v=t=>{var r;return t!=null&&t.options?(r=t==null?void 0:t.options)==null?void 0:r.map(n=>({isDefault:(n==null?void 0:n.is_default)??!1,text:(n==null?void 0:n.label)??"",value:(n==null?void 0:n.value)??""})):[]},N=t=>{var i,c,a;const r=((c=(i=t==null?void 0:t.data)==null?void 0:i.attributesForm)==null?void 0:c.items)||[];if(!r.length)return[];const n=(a=r.filter(e=>{var l;return!((l=e.frontend_input)!=null&&l.includes("HIDDEN"))}))==null?void 0:a.map(({code:e,...l})=>{const h=e!=="country_id"?e:"country_code";return{...l,name:h,id:h,code:h}}),o=y(n);return n.concat(o).map(e=>({code:e==null?void 0:e.code,name:e==null?void 0:e.name,id:e==null?void 0:e.id,label:(e==null?void 0:e.label)??"",entityType:e==null?void 0:e.entity_type,className:(e==null?void 0:e.frontend_class)??"",defaultValue:(e==null?void 0:e.default_value)??"",fieldType:e==null?void 0:e.frontend_input,multilineCount:(e==null?void 0:e.multiline_count)??0,orderNumber:Number(e==null?void 0:e.sort_order)||0,isHidden:!1,isUnique:(e==null?void 0:e.is_unique)??!1,required:(e==null?void 0:e.is_required)??!1,validateRules:(e==null?void 0:e.validate_rules)??[],options:v(e),customUpperCode:R(e==null?void 0:e.code)})).sort((e,l)=>Number(e.orderNumber)-Number(l.orderNumber))},O=t=>{const r={};for(const n in t){const o=t[n];!Array.isArray(o)||o.length===0||(n==="custom_attributesV2"?o.forEach(u=>{typeof u=="object"&&"value"in u&&(r[u==null?void 0:u.code]=u==null?void 0:u.value)}):o.length>1?o.forEach((u,i)=>{i===0?r[n]=u:r[`${n}_multiline_${i+1}`]=u}):r[n]=o[0])}return r},I=t=>({prefix:(t==null?void 0:t.prefix)??"",suffix:(t==null?void 0:t.suffix)??"",firstname:(t==null?void 0:t.firstname)??"",lastname:(t==null?void 0:t.lastname)??"",middlename:(t==null?void 0:t.middlename)??""}),U=t=>({id:(t==null?void 0:t.id)??"",vat_id:(t==null?void 0:t.vat_id)??"",postcode:(t==null?void 0:t.postcode)??"",country_code:(t==null?void 0:t.country_code)??"",uid:(t==null?void 0:t.uid)??""}),M=t=>({company:(t==null?void 0:t.company)??"",telephone:(t==null?void 0:t.telephone)??"",fax:(t==null?void 0:t.fax)??""}),$=t=>{var n,o,u;return g({...I(t),...U(t),...M(t),city:(t==null?void 0:t.city)??"",region:{region:((n=t==null?void 0:t.region)==null?void 0:n.region)??"",region_code:((o=t==null?void 0:t.region)==null?void 0:o.region_code)??"",region_id:((u=t==null?void 0:t.region)==null?void 0:u.region_id)??""},default_shipping:(t==null?void 0:t.default_shipping)||!1,default_billing:(t==null?void 0:t.default_billing)||!1,...O(t)},"camelCase",{})},w=t=>{var o,u;const r=((u=(o=t==null?void 0:t.data)==null?void 0:o.customer)==null?void 0:u.addresses)||[];return r.length?r.map($).sort((i,c)=>(Number(c.defaultBilling)||Number(c.defaultShipping))-(Number(i.defaultBilling)||Number(i.defaultShipping))):[]},q=t=>{var c,a;if(!((a=(c=t==null?void 0:t.data)==null?void 0:c.countries)!=null&&a.length))return{availableCountries:[],countriesWithRequiredRegion:[],optionalZipCountries:[]};const{countries:r,storeConfig:n}=t.data,o=n==null?void 0:n.countries_with_required_region.split(","),u=n==null?void 0:n.optional_zip_countries.split(",");return{availableCountries:r.filter(({two_letter_abbreviation:e,full_name_locale:l})=>!!(e&&l)).map(e=>{const{two_letter_abbreviation:l,full_name_locale:h,available_regions:m}=e,p=Array.isArray(m)&&m.length>0;return{value:l,text:h,availableRegions:p?m:void 0}}).sort((e,l)=>e.text.localeCompare(l.text)),countriesWithRequiredRegion:o,optionalZipCountries:u}},K=async t=>{const r=`_account_attributesForm_${t}`,n=sessionStorage.getItem(r);return n?JSON.parse(n):await s(t!=="shortRequest"?A:T,{method:"GET",cache:"force-cache",variables:{formCode:t}}).then(o=>{var i;if((i=o.errors)!=null&&i.length)return f(o.errors);const u=N(o);return sessionStorage.setItem(r,JSON.stringify(u)),u}).catch(_)},x=`
50
50
  mutation CREATE_CUSTOMER_ADDRESS($input: CustomerAddressInput!) {
51
51
  createCustomerAddress(input: $input) {
52
52
  firstname
@@ -83,6 +83,7 @@ import{events as E}from"@dropins/tools/event-bus.js";import{FetchGraphQL as C}fr
83
83
  street
84
84
  default_shipping
85
85
  default_billing
86
+ uid
86
87
  }
87
88
  }
88
89
  }
@@ -112,5 +113,5 @@ import{events as E}from"@dropins/tools/event-bus.js";import{FetchGraphQL as C}fr
112
113
  mutation REMOVE_CUSTOMER_ADDRESS($id: Int!) {
113
114
  deleteCustomerAddress(id: $id)
114
115
  }
115
- `,d=async t=>await s(B,{method:"POST",variables:{id:t}}).then(r=>{var n;return(n=r.errors)!=null&&n.length?f(r.errors):r.data.deleteCustomerAddress}).catch(_);export{_ as a,k as b,P as c,K as d,z as e,s as f,J as g,f as h,Z as i,W as j,d as k,b as l,g as m,S as n,L as r,j as s,$ as t,Y as u};
116
+ `,X=async t=>await s(B,{method:"POST",variables:{id:t}}).then(r=>{var n;return(n=r.errors)!=null&&n.length?f(r.errors):r.data.deleteCustomerAddress}).catch(_);export{_ as a,k as b,P as c,K as d,z as e,s as f,J as g,f as h,Z as i,W as j,X as k,b as l,g as m,S as n,L as r,j as s,$ as t,Y as u};
116
117
  //# sourceMappingURL=removeCustomerAddress.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"removeCustomerAddress.js","sources":["/@dropins/storefront-account/src/lib/convertCase.ts","/@dropins/storefront-account/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-account/src/api/getAttributesForm/graphql/getAttributesForm.graphql.ts","/@dropins/storefront-account/src/lib/network-error.ts","/@dropins/storefront-account/src/lib/fetch-error.ts","/@dropins/storefront-account/src/data/transforms/transform-attributes-form.ts","/@dropins/storefront-account/src/data/transforms/transform-customer-address.ts","/@dropins/storefront-account/src/data/transforms/transform-countries.ts","/@dropins/storefront-account/src/api/getAttributesForm/getAttributesForm.ts","/@dropins/storefront-account/src/api/createCustomerAddress/graphql/createCustomerAddress.graphql.ts","/@dropins/storefront-account/src/api/createCustomerAddress/createCustomerAddress.ts","/@dropins/storefront-account/src/api/getCustomerAddress/graphql/getCustomerAddress.graphql.ts","/@dropins/storefront-account/src/api/getCustomerAddress/getCustomerAddress.ts","/@dropins/storefront-account/src/api/getCountries/graphql/getCountries.graphql.ts","/@dropins/storefront-account/src/api/getCountries/getCountries.ts","/@dropins/storefront-account/src/api/updateCustomerAddress/graphql/updateCustomerAddress.graphql.ts","/@dropins/storefront-account/src/api/updateCustomerAddress/updateCustomerAddress.ts","/@dropins/storefront-account/src/api/removeCustomerAddress/graphql/removeCustomerAddress.graphql.ts","/@dropins/storefront-account/src/api/removeCustomerAddress/removeCustomerAddress.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 convertToCamelCase = (key: string): string => {\n return key.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());\n};\n\nexport const convertToSnakeCase = (key: string): string => {\n return key.replace(/([A-Z])/g, (letter) => `_${letter.toLowerCase()}`);\n};\n\nexport const convertKeysCase = (\n data: any,\n type: 'snakeCase' | 'camelCase',\n dictionary?: Record<string, string>\n): any => {\n const typeList = ['string', 'boolean', 'number'];\n const callback =\n type === 'camelCase' ? convertToCamelCase : convertToSnakeCase;\n\n if (Array.isArray(data)) {\n return data.map((element) => {\n if (typeList.includes(typeof element) || element === null) return element;\n\n if (typeof element === 'object') {\n return convertKeysCase(element, type, dictionary);\n }\n return element;\n });\n }\n\n if (data !== null && typeof data === 'object') {\n return Object.entries(data).reduce((acc, [key, value]) => {\n const newKey =\n dictionary && dictionary[key] ? dictionary[key] : callback(key);\n acc[newKey] =\n typeList.includes(typeof value) || value === null\n ? value\n : convertKeysCase(value, type, dictionary);\n return acc;\n }, {} as Record<string, unknown>);\n }\n\n return data;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 2024 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_ATTRIBUTES_FORM = /* GraphQL */ `\n query GET_ATTRIBUTES_FORM($formCode: String!) {\n attributesForm(formCode: $formCode) {\n items {\n code\n default_value\n entity_type\n frontend_class\n frontend_input\n is_required\n is_unique\n label\n options {\n is_default\n label\n value\n }\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n validate_rules {\n name\n value\n }\n }\n }\n errors {\n type\n message\n }\n }\n }\n`;\n\nexport const GET_ATTRIBUTES_FORM_SHORT = /* GraphQL */ `\n query GET_ATTRIBUTES_FORM_SHORT {\n attributesForm(formCode: \"customer_register_address\") {\n items {\n frontend_input\n label\n code\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { events } from '@adobe-commerce/event-bus';\n\n/**\n * A function which can be attached to fetchGraphQL to handle thrown errors in\n * a generic way.\n */\nexport const handleNetworkError = (error: Error) => {\n const isAbortError =\n error instanceof DOMException && error.name === 'AbortError';\n\n if (!isAbortError) {\n // @ts-ignore\n events.emit('error', {\n source: 'auth',\n type: 'network',\n error,\n });\n }\n throw error;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 2024 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 {\n GetAttributesFormResponse,\n ResponseAttributesFormItemsProps,\n} from '@/account/types';\nimport { AttributesFormModel, FieldEnumList } from '../models';\nimport { convertToCamelCase } from '@/account/lib/convertCase';\n\nexport const cloneArrayIfExists = (\n fields: ResponseAttributesFormItemsProps[]\n) => {\n let multilineItems: any = [];\n\n for (const element of fields) {\n if (element.frontend_input !== 'MULTILINE' || element.multiline_count < 2) {\n continue;\n }\n\n for (let i = 2; i <= element.multiline_count; i++) {\n const newItem = {\n ...element,\n is_required: false,\n name: `${element.code}_multiline_${i}`,\n code: `${element.code}_multiline_${i}`,\n id: `${element.code}_multiline_${i}`,\n };\n\n multilineItems.push(newItem);\n }\n }\n\n return multilineItems;\n};\n\nconst transformCustomUpperCode = (code: string) => {\n switch (code) {\n case 'middlename':\n return 'middleName';\n case 'firstname':\n return 'firstName';\n case 'lastname':\n return 'lastName';\n default:\n return convertToCamelCase(code);\n }\n};\n\nconst transformOptions = (item: any) => {\n if (!item?.options) return [];\n\n return item?.options?.map((el: any) => {\n return {\n isDefault: el?.is_default ?? false,\n text: el?.label ?? '',\n value: el?.value ?? '',\n };\n });\n};\n\nexport const transformAttributesForm = (\n response: GetAttributesFormResponse\n): AttributesFormModel[] => {\n const items = response?.data?.attributesForm?.items || [];\n\n if (!items.length) return [];\n\n const fields = items\n .filter((el) => !el.frontend_input?.includes('HIDDEN'))\n ?.map(({ code, ...other }) => {\n const isDefaultCode = code !== 'country_id' ? code : 'country_code';\n\n return {\n ...other,\n name: isDefaultCode,\n id: isDefaultCode,\n code: isDefaultCode,\n };\n });\n\n const multilineItems = cloneArrayIfExists(fields as any);\n\n const attributesConfig = fields\n .concat(multilineItems)\n .map((item) => {\n return {\n code: item?.code,\n name: item?.name,\n id: item?.id,\n label: item?.label ?? '',\n entityType: item?.entity_type,\n className: item?.frontend_class ?? '',\n defaultValue: item?.default_value ?? '',\n fieldType: item?.frontend_input as FieldEnumList,\n multilineCount: item?.multiline_count ?? 0,\n orderNumber: Number(item?.sort_order) || 0,\n isHidden: false,\n isUnique: item?.is_unique ?? false,\n required: item?.is_required ?? false,\n validateRules: item?.validate_rules ?? [],\n options: transformOptions(item),\n customUpperCode: transformCustomUpperCode(item?.code),\n };\n })\n .sort((a, b) => Number(a.orderNumber) - Number(b.orderNumber));\n\n return attributesConfig;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { CustomerAddressesModel } from '../models';\nimport { AddressResponse, UserAddressesProps } from '@/account/types';\nimport { convertKeysCase } from '@/account/lib/convertCase';\n\nconst expandArraysInObject = (inputObject: UserAddressesProps) => {\n const flattenedAttributes: Record<string, unknown> = {};\n\n for (const key in inputObject) {\n const element = inputObject[key as keyof UserAddressesProps];\n\n if (!Array.isArray(element) || element.length === 0) continue;\n\n if (key === 'custom_attributesV2') {\n element.forEach((item) => {\n if (typeof item === 'object' && 'value' in item) {\n flattenedAttributes[item?.code] = item?.value;\n }\n });\n } else if (element.length > 1) {\n element.forEach((value: unknown, index: number) => {\n index === 0\n ? (flattenedAttributes[key] = value)\n : (flattenedAttributes[`${key}_multiline_${index + 1}`] = value);\n });\n } else {\n flattenedAttributes[key] = element[0] as Record<string, string>;\n }\n }\n\n return flattenedAttributes;\n};\nconst transformFullName = (address: UserAddressesProps) => {\n return {\n prefix: address?.prefix ?? '',\n suffix: address?.suffix ?? '',\n firstname: address?.firstname ?? '',\n lastname: address?.lastname ?? '',\n middlename: address?.middlename ?? '',\n };\n};\n\nconst transformIds = (address: UserAddressesProps) => {\n return {\n id: address?.id ?? '',\n vat_id: address?.vat_id ?? '',\n postcode: address?.postcode ?? '',\n country_code: address?.country_code ?? '',\n };\n};\n\nconst transformContacts = (address: UserAddressesProps) => {\n return {\n company: address?.company ?? '',\n telephone: address?.telephone ?? '',\n fax: address?.fax ?? '',\n };\n};\n\n// Function to transform a single address\nexport const transformSingleAddress = (\n addressData: UserAddressesProps\n): CustomerAddressesModel => {\n const result = convertKeysCase(\n {\n ...transformFullName(addressData),\n ...transformIds(addressData),\n ...transformContacts(addressData),\n city: addressData?.city ?? '',\n region: {\n region: addressData?.region?.region ?? '',\n region_code: addressData?.region?.region_code ?? '',\n region_id: addressData?.region?.region_id ?? '',\n },\n default_shipping: addressData?.default_shipping || false,\n default_billing: addressData?.default_billing || false,\n ...expandArraysInObject(addressData),\n },\n 'camelCase',\n {}\n );\n\n return result;\n};\n\n// Function to transform multiple addresses from a response\nexport const transformMultipleAddresses = (\n response: AddressResponse\n): CustomerAddressesModel[] | [] => {\n const addresses: UserAddressesProps[] =\n response?.data?.customer?.addresses || [];\n\n if (!addresses.length) return [];\n\n const result = addresses\n .map(transformSingleAddress)\n .sort(\n (a, b) =>\n (Number(b.defaultBilling) || Number(b.defaultShipping)) -\n (Number(a.defaultBilling) || Number(a.defaultShipping))\n );\n\n return result;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { CountriesFormResponse } from '@/account/types';\nimport { Country } from '../models';\n\nexport const transformCountries = (\n response: CountriesFormResponse\n): {\n availableCountries: Country[] | [];\n countriesWithRequiredRegion: string[];\n optionalZipCountries: string[];\n} => {\n if (!response?.data?.countries?.length) {\n return {\n availableCountries: [],\n countriesWithRequiredRegion: [],\n optionalZipCountries: [],\n };\n }\n\n const { countries, storeConfig } = response.data;\n\n const countriesWithRequiredRegion =\n storeConfig?.countries_with_required_region.split(',');\n const optionalZipCountries = storeConfig?.optional_zip_countries.split(',');\n\n const availableCountries = countries\n .filter(({ two_letter_abbreviation, full_name_locale }) =>\n Boolean(two_letter_abbreviation && full_name_locale)\n )\n .map((country) => {\n const { two_letter_abbreviation, full_name_locale, available_regions } = country;\n\n const hasRegions = Array.isArray(available_regions) && available_regions.length > 0;\n return {\n value: two_letter_abbreviation,\n text: full_name_locale,\n availableRegions: hasRegions ? available_regions : undefined,\n };\n })\n .sort((a, b) => a.text.localeCompare(b.text));\n\n return {\n availableCountries,\n countriesWithRequiredRegion,\n optionalZipCountries,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 '../fetch-graphql';\nimport {\n GET_ATTRIBUTES_FORM,\n GET_ATTRIBUTES_FORM_SHORT,\n} from './graphql/getAttributesForm.graphql';\nimport { handleNetworkError } from '@/account/lib/network-error';\nimport { handleFetchError } from '@/account/lib/fetch-error';\nimport { transformAttributesForm } from '@/account/data/transforms';\nimport { AttributesFormModel } from '@/account/data/models';\nimport { GetAttributesFormResponse } from '@/account/types';\n\nexport const getAttributesForm = async (\n formCode: string\n): Promise<AttributesFormModel[]> => {\n const sessionStorageKey = `_account_attributesForm_${formCode}`;\n\n const sessionStorageCache = sessionStorage.getItem(sessionStorageKey);\n\n if (sessionStorageCache) {\n return JSON.parse(sessionStorageCache);\n }\n\n return await fetchGraphQl(\n formCode !== 'shortRequest'\n ? GET_ATTRIBUTES_FORM\n : GET_ATTRIBUTES_FORM_SHORT,\n {\n method: 'GET',\n cache: 'force-cache',\n variables: { formCode },\n }\n )\n .then((response: GetAttributesFormResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n const transformedData = transformAttributesForm(response);\n\n sessionStorage.setItem(\n sessionStorageKey,\n JSON.stringify(transformedData)\n );\n\n return transformedData;\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 CREATE_CUSTOMER_ADDRESS = /* GraphQL */ `\n mutation CREATE_CUSTOMER_ADDRESS($input: CustomerAddressInput!) {\n createCustomerAddress(input: $input) {\n firstname\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { CreateCustomerAddressResponse } from '@/account/types';\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { CREATE_CUSTOMER_ADDRESS } from './graphql/createCustomerAddress.graphql';\nimport { handleNetworkError } from '@/account/lib/network-error';\nimport { handleFetchError } from '@/account/lib/fetch-error';\nimport { convertKeysCase } from '@/account/lib/convertCase';\nimport { CustomerAddressesModel } from '@/account/data/models';\n\nexport const createCustomerAddress = async (\n address: CustomerAddressesModel\n): Promise<string> => {\n return await fetchGraphQl(CREATE_CUSTOMER_ADDRESS, {\n method: 'POST',\n variables: {\n input: convertKeysCase(address, 'snakeCase', {\n custom_attributesV2: 'custom_attributesV2',\n firstName: 'firstname',\n lastName: 'lastname',\n middleName: 'middlename',\n }),\n },\n })\n .then((response: CreateCustomerAddressResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n return response?.data?.createCustomerAddress?.firstname || '';\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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_CUSTOMER_ADDRESS = /* GraphQL */ `\n query GET_CUSTOMER_ADDRESS {\n customer {\n addresses {\n firstname\n lastname\n middlename\n fax\n prefix\n suffix\n city\n company\n country_code\n region {\n region\n region_code\n region_id\n }\n custom_attributesV2 {\n ... on AttributeValue {\n code\n value\n }\n }\n telephone\n id\n vat_id\n postcode\n street\n default_shipping\n default_billing\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { handleNetworkError } from '@/account/lib/network-error';\nimport { fetchGraphQl } from '@/account/api/fetch-graphql';\nimport { GET_CUSTOMER_ADDRESS } from './graphql/getCustomerAddress.graphql';\nimport { transformMultipleAddresses } from '@/account/data/transforms';\nimport { CustomerAddressesModel } from '@/account/data/models/customer-address';\nimport { AddressResponse } from '@/account/types';\nimport { handleFetchError } from '@/account/lib/fetch-error';\n\nexport const getCustomerAddress = async (): Promise<\n CustomerAddressesModel[]\n> => {\n return await fetchGraphQl(GET_CUSTOMER_ADDRESS, {\n method: 'GET',\n cache: 'no-cache',\n })\n .then((response: AddressResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n return transformMultipleAddresses(response);\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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_COUNTRIES_QUERY = /* GraphQL */ `\n query GET_COUNTRIES_QUERY {\n countries {\n two_letter_abbreviation\n full_name_locale\n available_regions {\n id\n code\n name\n }\n }\n storeConfig {\n countries_with_required_region\n optional_zip_countries\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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_COUNTRIES_QUERY } from './graphql/getCountries.graphql';\nimport { fetchGraphQl } from '@/account/api/fetch-graphql';\nimport { handleNetworkError } from '@/account/lib/network-error';\nimport { handleFetchError } from '@/account/lib/fetch-error';\nimport { transformCountries } from '@/account/data/transforms';\nimport { CountriesFormResponse } from '@/account/types';\nimport { Country } from '@/account/data/models';\n\nexport const getCountries = async (): Promise<{\n availableCountries: Country[] | [];\n countriesWithRequiredRegion: string[];\n optionalZipCountries: string[];\n}> => {\n const sessionStorageKey = '_account_countries';\n\n const sessionStorageCache = sessionStorage.getItem(sessionStorageKey);\n\n if (sessionStorageCache) {\n return JSON.parse(sessionStorageCache);\n }\n\n return await fetchGraphQl(GET_COUNTRIES_QUERY, {\n method: 'GET',\n cache: 'no-cache',\n })\n .then((response: CountriesFormResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n const transformedData = transformCountries(response);\n\n sessionStorage.setItem(\n sessionStorageKey,\n JSON.stringify(transformedData)\n );\n\n return transformedData;\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 UPDATE_CUSTOMER_ADDRESS = /* GraphQL */ `\n mutation UPDATE_CUSTOMER_ADDRESS($id: Int!, $input: CustomerAddressInput) {\n updateCustomerAddress(id: $id, input: $input) {\n firstname\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 '../fetch-graphql';\nimport { UPDATE_CUSTOMER_ADDRESS } from './graphql/updateCustomerAddress.graphql';\nimport { handleNetworkError } from '@/account/lib/network-error';\nimport { handleFetchError } from '@/account/lib/fetch-error';\nimport { UpdateCustomerAddressResponse } from '@/account/types';\nimport { CustomerAddressesModel } from '@/account/data/models';\nimport { convertKeysCase } from '@/account/lib/convertCase';\n\ntype ExtendedAddressFormProps = CustomerAddressesModel & {\n addressId: number;\n};\n\nexport const updateCustomerAddress = async (\n forms: ExtendedAddressFormProps\n): Promise<string> => {\n const { addressId, ...address } = forms;\n\n if (!addressId) return '';\n\n return await fetchGraphQl(UPDATE_CUSTOMER_ADDRESS, {\n method: 'POST',\n variables: {\n id: Number(addressId),\n input: convertKeysCase(address, 'snakeCase', {\n custom_attributesV2: 'custom_attributesV2',\n firstName: 'firstname',\n lastName: 'lastname',\n middleName: 'middlename',\n }),\n },\n })\n .then((response: UpdateCustomerAddressResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n return response?.data?.updateCustomerAddress?.firstname || '';\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 REMOVE_CUSTOMER_ADDRESS = /* GraphQL */ `\n mutation REMOVE_CUSTOMER_ADDRESS($id: Int!) {\n deleteCustomerAddress(id: $id)\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { handleNetworkError } from '@/account/lib/network-error';\nimport { fetchGraphQl } from '@/account/api/fetch-graphql';\nimport { REMOVE_CUSTOMER_ADDRESS } from './graphql/removeCustomerAddress.graphql';\nimport { handleFetchError } from '@/account/lib/fetch-error';\nimport { RemoveCustomerAddressResponse } from '@/account/types';\n\nexport const removeCustomerAddress = async (\n addressId: number\n): Promise<boolean> => {\n return await fetchGraphQl(REMOVE_CUSTOMER_ADDRESS, {\n method: 'POST',\n variables: { id: addressId },\n })\n .then((response: RemoveCustomerAddressResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n return response.data.deleteCustomerAddress;\n })\n .catch(handleNetworkError);\n};\n"],"names":["convertToCamelCase","key","_","letter","convertToSnakeCase","convertKeysCase","data","type","dictionary","typeList","callback","element","acc","value","newKey","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","fetchGraphQl","getConfig","FetchGraphQL","GET_ATTRIBUTES_FORM","GET_ATTRIBUTES_FORM_SHORT","handleNetworkError","error","events","handleFetchError","errors","errorMessage","e","cloneArrayIfExists","fields","multilineItems","i","newItem","transformCustomUpperCode","code","transformOptions","item","_a","el","transformAttributesForm","response","items","_b","_c","other","isDefaultCode","a","b","expandArraysInObject","inputObject","flattenedAttributes","index","transformFullName","address","transformIds","transformContacts","transformSingleAddress","addressData","transformMultipleAddresses","addresses","transformCountries","countries","storeConfig","countriesWithRequiredRegion","optionalZipCountries","two_letter_abbreviation","full_name_locale","country","available_regions","hasRegions","getAttributesForm","formCode","sessionStorageKey","sessionStorageCache","transformedData","CREATE_CUSTOMER_ADDRESS","createCustomerAddress","GET_CUSTOMER_ADDRESS","getCustomerAddress","GET_COUNTRIES_QUERY","getCountries","UPDATE_CUSTOMER_ADDRESS","updateCustomerAddress","forms","addressId","REMOVE_CUSTOMER_ADDRESS","removeCustomerAddress"],"mappings":"oHAiBa,MAAAA,EAAsBC,GAC1BA,EAAI,QAAQ,YAAa,CAACC,EAAGC,IAAWA,EAAO,aAAa,EAGxDC,EAAsBH,GAC1BA,EAAI,QAAQ,WAAaE,GAAW,IAAIA,EAAO,YAAa,CAAA,EAAE,EAG1DE,EAAkB,CAC7BC,EACAC,EACAC,IACQ,CACR,MAAMC,EAAW,CAAC,SAAU,UAAW,QAAQ,EACzCC,EACJH,IAAS,YAAcP,EAAqBI,EAE1C,OAAA,MAAM,QAAQE,CAAI,EACbA,EAAK,IAAKK,GACXF,EAAS,SAAS,OAAOE,CAAO,GAAKA,IAAY,KAAaA,EAE9D,OAAOA,GAAY,SACdN,EAAgBM,EAASJ,EAAMC,CAAU,EAE3CG,CACR,EAGCL,IAAS,MAAQ,OAAOA,GAAS,SAC5B,OAAO,QAAQA,CAAI,EAAE,OAAO,CAACM,EAAK,CAACX,EAAKY,CAAK,IAAM,CAClD,MAAAC,EACJN,GAAcA,EAAWP,CAAG,EAAIO,EAAWP,CAAG,EAAIS,EAAST,CAAG,EAChE,OAAAW,EAAIE,CAAM,EACRL,EAAS,SAAS,OAAOI,CAAK,GAAKA,IAAU,KACzCA,EACAR,EAAgBQ,EAAON,EAAMC,CAAU,EACtCI,CACT,EAAG,EAA6B,EAG3BN,CACT,ECvCa,CACX,YAAAS,EACA,sBAAAC,EACA,yBAAAC,EACA,uBAAAC,EACA,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BAAA,QACbgC,EACA,KAAK,UAAUE,CAAe,CAChC,EAEOA,CAAA,CACR,EACA,MAAMrD,CAAkB,CAC7B,ECtCa4D,EAAwC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECYxCC,EAAwB,MACnCC,GACoB,CACpB,KAAM,CAAE,UAAAC,EAAW,GAAG/B,CAAA,EAAY8B,EAE9B,OAACC,EAEE,MAAMpE,EAAaiE,EAAyB,CACjD,OAAQ,OACR,UAAW,CACT,GAAI,OAAOG,CAAS,EACpB,MAAOlF,EAAgBmD,EAAS,YAAa,CAC3C,oBAAqB,sBACrB,UAAW,YACX,SAAU,WACV,WAAY,YACb,CAAA,CAAA,CACH,CACD,EACE,KAAMb,GAA4C,WACjD,OAAIH,EAAAG,EAAS,SAAT,MAAAH,EAAiB,OAAeb,EAAiBgB,EAAS,MAAM,IAE7DG,GAAAD,EAAAF,GAAA,YAAAA,EAAU,OAAV,YAAAE,EAAgB,wBAAhB,YAAAC,EAAuC,YAAa,EAAA,CAC5D,EACA,MAAMtB,CAAkB,EAnBJ,EAoBzB,ECrCagE,EAAwC;AAAA;AAAA;AAAA;AAAA,ECMxCC,EAAwB,MACnCF,GAEO,MAAMpE,EAAaqE,EAAyB,CACjD,OAAQ,OACR,UAAW,CAAE,GAAID,CAAU,CAAA,CAC5B,EACE,KAAM5C,GAA4C,OACjD,OAAIH,EAAAG,EAAS,SAAT,MAAAH,EAAiB,OAAeb,EAAiBgB,EAAS,MAAM,EAE7DA,EAAS,KAAK,qBAAA,CACtB,EACA,MAAMnB,CAAkB"}
1
+ {"version":3,"file":"removeCustomerAddress.js","sources":["/@dropins/storefront-account/src/lib/convertCase.ts","/@dropins/storefront-account/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-account/src/api/getAttributesForm/graphql/getAttributesForm.graphql.ts","/@dropins/storefront-account/src/lib/network-error.ts","/@dropins/storefront-account/src/lib/fetch-error.ts","/@dropins/storefront-account/src/data/transforms/transform-attributes-form.ts","/@dropins/storefront-account/src/data/transforms/transform-customer-address.ts","/@dropins/storefront-account/src/data/transforms/transform-countries.ts","/@dropins/storefront-account/src/api/getAttributesForm/getAttributesForm.ts","/@dropins/storefront-account/src/api/createCustomerAddress/graphql/createCustomerAddress.graphql.ts","/@dropins/storefront-account/src/api/createCustomerAddress/createCustomerAddress.ts","/@dropins/storefront-account/src/api/getCustomerAddress/graphql/getCustomerAddress.graphql.ts","/@dropins/storefront-account/src/api/getCustomerAddress/getCustomerAddress.ts","/@dropins/storefront-account/src/api/getCountries/graphql/getCountries.graphql.ts","/@dropins/storefront-account/src/api/getCountries/getCountries.ts","/@dropins/storefront-account/src/api/updateCustomerAddress/graphql/updateCustomerAddress.graphql.ts","/@dropins/storefront-account/src/api/updateCustomerAddress/updateCustomerAddress.ts","/@dropins/storefront-account/src/api/removeCustomerAddress/graphql/removeCustomerAddress.graphql.ts","/@dropins/storefront-account/src/api/removeCustomerAddress/removeCustomerAddress.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 convertToCamelCase = (key: string): string => {\n return key.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());\n};\n\nexport const convertToSnakeCase = (key: string): string => {\n return key.replace(/([A-Z])/g, (letter) => `_${letter.toLowerCase()}`);\n};\n\nexport const convertKeysCase = (\n data: any,\n type: 'snakeCase' | 'camelCase',\n dictionary?: Record<string, string>\n): any => {\n const typeList = ['string', 'boolean', 'number'];\n const callback =\n type === 'camelCase' ? convertToCamelCase : convertToSnakeCase;\n\n if (Array.isArray(data)) {\n return data.map((element) => {\n if (typeList.includes(typeof element) || element === null) return element;\n\n if (typeof element === 'object') {\n return convertKeysCase(element, type, dictionary);\n }\n return element;\n });\n }\n\n if (data !== null && typeof data === 'object') {\n return Object.entries(data).reduce((acc, [key, value]) => {\n const newKey =\n dictionary && dictionary[key] ? dictionary[key] : callback(key);\n acc[newKey] =\n typeList.includes(typeof value) || value === null\n ? value\n : convertKeysCase(value, type, dictionary);\n return acc;\n }, {} as Record<string, unknown>);\n }\n\n return data;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 2024 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_ATTRIBUTES_FORM = /* GraphQL */ `\n query GET_ATTRIBUTES_FORM($formCode: String!) {\n attributesForm(formCode: $formCode) {\n items {\n code\n default_value\n entity_type\n frontend_class\n frontend_input\n is_required\n is_unique\n label\n options {\n is_default\n label\n value\n }\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n validate_rules {\n name\n value\n }\n }\n }\n errors {\n type\n message\n }\n }\n }\n`;\n\nexport const GET_ATTRIBUTES_FORM_SHORT = /* GraphQL */ `\n query GET_ATTRIBUTES_FORM_SHORT {\n attributesForm(formCode: \"customer_register_address\") {\n items {\n frontend_input\n label\n code\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { events } from '@adobe-commerce/event-bus';\n\n/**\n * A function which can be attached to fetchGraphQL to handle thrown errors in\n * a generic way.\n */\nexport const handleNetworkError = (error: Error) => {\n const isAbortError =\n error instanceof DOMException && error.name === 'AbortError';\n\n if (!isAbortError) {\n // @ts-ignore\n events.emit('error', {\n source: 'auth',\n type: 'network',\n error,\n });\n }\n throw error;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 2024 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 {\n GetAttributesFormResponse,\n ResponseAttributesFormItemsProps,\n} from '@/account/types';\nimport { AttributesFormModel, FieldEnumList } from '../models';\nimport { convertToCamelCase } from '@/account/lib/convertCase';\n\nexport const cloneArrayIfExists = (\n fields: ResponseAttributesFormItemsProps[]\n) => {\n let multilineItems: any = [];\n\n for (const element of fields) {\n if (element.frontend_input !== 'MULTILINE' || element.multiline_count < 2) {\n continue;\n }\n\n for (let i = 2; i <= element.multiline_count; i++) {\n const newItem = {\n ...element,\n is_required: false,\n name: `${element.code}_multiline_${i}`,\n code: `${element.code}_multiline_${i}`,\n id: `${element.code}_multiline_${i}`,\n };\n\n multilineItems.push(newItem);\n }\n }\n\n return multilineItems;\n};\n\nconst transformCustomUpperCode = (code: string) => {\n switch (code) {\n case 'middlename':\n return 'middleName';\n case 'firstname':\n return 'firstName';\n case 'lastname':\n return 'lastName';\n default:\n return convertToCamelCase(code);\n }\n};\n\nconst transformOptions = (item: any) => {\n if (!item?.options) return [];\n\n return item?.options?.map((el: any) => {\n return {\n isDefault: el?.is_default ?? false,\n text: el?.label ?? '',\n value: el?.value ?? '',\n };\n });\n};\n\nexport const transformAttributesForm = (\n response: GetAttributesFormResponse\n): AttributesFormModel[] => {\n const items = response?.data?.attributesForm?.items || [];\n\n if (!items.length) return [];\n\n const fields = items\n .filter((el) => !el.frontend_input?.includes('HIDDEN'))\n ?.map(({ code, ...other }) => {\n const isDefaultCode = code !== 'country_id' ? code : 'country_code';\n\n return {\n ...other,\n name: isDefaultCode,\n id: isDefaultCode,\n code: isDefaultCode,\n };\n });\n\n const multilineItems = cloneArrayIfExists(fields as any);\n\n const attributesConfig = fields\n .concat(multilineItems)\n .map((item) => {\n return {\n code: item?.code,\n name: item?.name,\n id: item?.id,\n label: item?.label ?? '',\n entityType: item?.entity_type,\n className: item?.frontend_class ?? '',\n defaultValue: item?.default_value ?? '',\n fieldType: item?.frontend_input as FieldEnumList,\n multilineCount: item?.multiline_count ?? 0,\n orderNumber: Number(item?.sort_order) || 0,\n isHidden: false,\n isUnique: item?.is_unique ?? false,\n required: item?.is_required ?? false,\n validateRules: item?.validate_rules ?? [],\n options: transformOptions(item),\n customUpperCode: transformCustomUpperCode(item?.code),\n };\n })\n .sort((a, b) => Number(a.orderNumber) - Number(b.orderNumber));\n\n return attributesConfig;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { CustomerAddressesModel } from '../models';\nimport { AddressResponse, UserAddressesProps } from '@/account/types';\nimport { convertKeysCase } from '@/account/lib/convertCase';\n\nconst expandArraysInObject = (inputObject: UserAddressesProps) => {\n const flattenedAttributes: Record<string, unknown> = {};\n\n for (const key in inputObject) {\n const element = inputObject[key as keyof UserAddressesProps];\n\n if (!Array.isArray(element) || element.length === 0) continue;\n\n if (key === 'custom_attributesV2') {\n element.forEach((item) => {\n if (typeof item === 'object' && 'value' in item) {\n flattenedAttributes[item?.code] = item?.value;\n }\n });\n } else if (element.length > 1) {\n element.forEach((value: unknown, index: number) => {\n index === 0\n ? (flattenedAttributes[key] = value)\n : (flattenedAttributes[`${key}_multiline_${index + 1}`] = value);\n });\n } else {\n flattenedAttributes[key] = element[0] as Record<string, string>;\n }\n }\n\n return flattenedAttributes;\n};\nconst transformFullName = (address: UserAddressesProps) => {\n return {\n prefix: address?.prefix ?? '',\n suffix: address?.suffix ?? '',\n firstname: address?.firstname ?? '',\n lastname: address?.lastname ?? '',\n middlename: address?.middlename ?? '',\n };\n};\n\nconst transformIds = (address: UserAddressesProps) => {\n return {\n id: address?.id ?? '',\n vat_id: address?.vat_id ?? '',\n postcode: address?.postcode ?? '',\n country_code: address?.country_code ?? '',\n uid: address?.uid ?? '',\n };\n};\n\nconst transformContacts = (address: UserAddressesProps) => {\n return {\n company: address?.company ?? '',\n telephone: address?.telephone ?? '',\n fax: address?.fax ?? '',\n };\n};\n\n// Function to transform a single address\nexport const transformSingleAddress = (\n addressData: UserAddressesProps\n): CustomerAddressesModel => {\n const result = convertKeysCase(\n {\n ...transformFullName(addressData),\n ...transformIds(addressData),\n ...transformContacts(addressData),\n city: addressData?.city ?? '',\n region: {\n region: addressData?.region?.region ?? '',\n region_code: addressData?.region?.region_code ?? '',\n region_id: addressData?.region?.region_id ?? '',\n },\n default_shipping: addressData?.default_shipping || false,\n default_billing: addressData?.default_billing || false,\n ...expandArraysInObject(addressData),\n },\n 'camelCase',\n {}\n );\n\n return result;\n};\n\n// Function to transform multiple addresses from a response\nexport const transformMultipleAddresses = (\n response: AddressResponse\n): CustomerAddressesModel[] | [] => {\n const addresses: UserAddressesProps[] =\n response?.data?.customer?.addresses || [];\n\n if (!addresses.length) return [];\n\n const result = addresses\n .map(transformSingleAddress)\n .sort(\n (a, b) =>\n (Number(b.defaultBilling) || Number(b.defaultShipping)) -\n (Number(a.defaultBilling) || Number(a.defaultShipping))\n );\n\n return result;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { CountriesFormResponse } from '@/account/types';\nimport { Country } from '../models';\n\nexport const transformCountries = (\n response: CountriesFormResponse\n): {\n availableCountries: Country[] | [];\n countriesWithRequiredRegion: string[];\n optionalZipCountries: string[];\n} => {\n if (!response?.data?.countries?.length) {\n return {\n availableCountries: [],\n countriesWithRequiredRegion: [],\n optionalZipCountries: [],\n };\n }\n\n const { countries, storeConfig } = response.data;\n\n const countriesWithRequiredRegion =\n storeConfig?.countries_with_required_region.split(',');\n const optionalZipCountries = storeConfig?.optional_zip_countries.split(',');\n\n const availableCountries = countries\n .filter(({ two_letter_abbreviation, full_name_locale }) =>\n Boolean(two_letter_abbreviation && full_name_locale)\n )\n .map((country) => {\n const { two_letter_abbreviation, full_name_locale, available_regions } = country;\n\n const hasRegions = Array.isArray(available_regions) && available_regions.length > 0;\n return {\n value: two_letter_abbreviation,\n text: full_name_locale,\n availableRegions: hasRegions ? available_regions : undefined,\n };\n })\n .sort((a, b) => a.text.localeCompare(b.text));\n\n return {\n availableCountries,\n countriesWithRequiredRegion,\n optionalZipCountries,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 '../fetch-graphql';\nimport {\n GET_ATTRIBUTES_FORM,\n GET_ATTRIBUTES_FORM_SHORT,\n} from './graphql/getAttributesForm.graphql';\nimport { handleNetworkError } from '@/account/lib/network-error';\nimport { handleFetchError } from '@/account/lib/fetch-error';\nimport { transformAttributesForm } from '@/account/data/transforms';\nimport { AttributesFormModel } from '@/account/data/models';\nimport { GetAttributesFormResponse } from '@/account/types';\n\nexport const getAttributesForm = async (\n formCode: string\n): Promise<AttributesFormModel[]> => {\n const sessionStorageKey = `_account_attributesForm_${formCode}`;\n\n const sessionStorageCache = sessionStorage.getItem(sessionStorageKey);\n\n if (sessionStorageCache) {\n return JSON.parse(sessionStorageCache);\n }\n\n return await fetchGraphQl(\n formCode !== 'shortRequest'\n ? GET_ATTRIBUTES_FORM\n : GET_ATTRIBUTES_FORM_SHORT,\n {\n method: 'GET',\n cache: 'force-cache',\n variables: { formCode },\n }\n )\n .then((response: GetAttributesFormResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n const transformedData = transformAttributesForm(response);\n\n sessionStorage.setItem(\n sessionStorageKey,\n JSON.stringify(transformedData)\n );\n\n return transformedData;\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 CREATE_CUSTOMER_ADDRESS = /* GraphQL */ `\n mutation CREATE_CUSTOMER_ADDRESS($input: CustomerAddressInput!) {\n createCustomerAddress(input: $input) {\n firstname\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { CreateCustomerAddressResponse } from '@/account/types';\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { CREATE_CUSTOMER_ADDRESS } from './graphql/createCustomerAddress.graphql';\nimport { handleNetworkError } from '@/account/lib/network-error';\nimport { handleFetchError } from '@/account/lib/fetch-error';\nimport { convertKeysCase } from '@/account/lib/convertCase';\nimport { CustomerAddressesModel } from '@/account/data/models';\n\nexport const createCustomerAddress = async (\n address: CustomerAddressesModel\n): Promise<string> => {\n return await fetchGraphQl(CREATE_CUSTOMER_ADDRESS, {\n method: 'POST',\n variables: {\n input: convertKeysCase(address, 'snakeCase', {\n custom_attributesV2: 'custom_attributesV2',\n firstName: 'firstname',\n lastName: 'lastname',\n middleName: 'middlename',\n }),\n },\n })\n .then((response: CreateCustomerAddressResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n return response?.data?.createCustomerAddress?.firstname || '';\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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_CUSTOMER_ADDRESS = /* GraphQL */ `\n query GET_CUSTOMER_ADDRESS {\n customer {\n addresses {\n firstname\n lastname\n middlename\n fax\n prefix\n suffix\n city\n company\n country_code\n region {\n region\n region_code\n region_id\n }\n custom_attributesV2 {\n ... on AttributeValue {\n code\n value\n }\n }\n telephone\n id\n vat_id\n postcode\n street\n default_shipping\n default_billing\n uid\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { handleNetworkError } from '@/account/lib/network-error';\nimport { fetchGraphQl } from '@/account/api/fetch-graphql';\nimport { GET_CUSTOMER_ADDRESS } from './graphql/getCustomerAddress.graphql';\nimport { transformMultipleAddresses } from '@/account/data/transforms';\nimport { CustomerAddressesModel } from '@/account/data/models/customer-address';\nimport { AddressResponse } from '@/account/types';\nimport { handleFetchError } from '@/account/lib/fetch-error';\n\nexport const getCustomerAddress = async (): Promise<\n CustomerAddressesModel[]\n> => {\n return await fetchGraphQl(GET_CUSTOMER_ADDRESS, {\n method: 'GET',\n cache: 'no-cache',\n })\n .then((response: AddressResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n return transformMultipleAddresses(response);\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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_COUNTRIES_QUERY = /* GraphQL */ `\n query GET_COUNTRIES_QUERY {\n countries {\n two_letter_abbreviation\n full_name_locale\n available_regions {\n id\n code\n name\n }\n }\n storeConfig {\n countries_with_required_region\n optional_zip_countries\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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_COUNTRIES_QUERY } from './graphql/getCountries.graphql';\nimport { fetchGraphQl } from '@/account/api/fetch-graphql';\nimport { handleNetworkError } from '@/account/lib/network-error';\nimport { handleFetchError } from '@/account/lib/fetch-error';\nimport { transformCountries } from '@/account/data/transforms';\nimport { CountriesFormResponse } from '@/account/types';\nimport { Country } from '@/account/data/models';\n\nexport const getCountries = async (): Promise<{\n availableCountries: Country[] | [];\n countriesWithRequiredRegion: string[];\n optionalZipCountries: string[];\n}> => {\n const sessionStorageKey = '_account_countries';\n\n const sessionStorageCache = sessionStorage.getItem(sessionStorageKey);\n\n if (sessionStorageCache) {\n return JSON.parse(sessionStorageCache);\n }\n\n return await fetchGraphQl(GET_COUNTRIES_QUERY, {\n method: 'GET',\n cache: 'no-cache',\n })\n .then((response: CountriesFormResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n const transformedData = transformCountries(response);\n\n sessionStorage.setItem(\n sessionStorageKey,\n JSON.stringify(transformedData)\n );\n\n return transformedData;\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 UPDATE_CUSTOMER_ADDRESS = /* GraphQL */ `\n mutation UPDATE_CUSTOMER_ADDRESS($id: Int!, $input: CustomerAddressInput) {\n updateCustomerAddress(id: $id, input: $input) {\n firstname\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 '../fetch-graphql';\nimport { UPDATE_CUSTOMER_ADDRESS } from './graphql/updateCustomerAddress.graphql';\nimport { handleNetworkError } from '@/account/lib/network-error';\nimport { handleFetchError } from '@/account/lib/fetch-error';\nimport { UpdateCustomerAddressResponse } from '@/account/types';\nimport { CustomerAddressesModel } from '@/account/data/models';\nimport { convertKeysCase } from '@/account/lib/convertCase';\n\ntype ExtendedAddressFormProps = CustomerAddressesModel & {\n addressId: number;\n};\n\nexport const updateCustomerAddress = async (\n forms: ExtendedAddressFormProps\n): Promise<string> => {\n const { addressId, ...address } = forms;\n\n if (!addressId) return '';\n\n return await fetchGraphQl(UPDATE_CUSTOMER_ADDRESS, {\n method: 'POST',\n variables: {\n id: Number(addressId),\n input: convertKeysCase(address, 'snakeCase', {\n custom_attributesV2: 'custom_attributesV2',\n firstName: 'firstname',\n lastName: 'lastname',\n middleName: 'middlename',\n }),\n },\n })\n .then((response: UpdateCustomerAddressResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n return response?.data?.updateCustomerAddress?.firstname || '';\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 REMOVE_CUSTOMER_ADDRESS = /* GraphQL */ `\n mutation REMOVE_CUSTOMER_ADDRESS($id: Int!) {\n deleteCustomerAddress(id: $id)\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { handleNetworkError } from '@/account/lib/network-error';\nimport { fetchGraphQl } from '@/account/api/fetch-graphql';\nimport { REMOVE_CUSTOMER_ADDRESS } from './graphql/removeCustomerAddress.graphql';\nimport { handleFetchError } from '@/account/lib/fetch-error';\nimport { RemoveCustomerAddressResponse } from '@/account/types';\n\nexport const removeCustomerAddress = async (\n addressId: number\n): Promise<boolean> => {\n return await fetchGraphQl(REMOVE_CUSTOMER_ADDRESS, {\n method: 'POST',\n variables: { id: addressId },\n })\n .then((response: RemoveCustomerAddressResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n return response.data.deleteCustomerAddress;\n })\n .catch(handleNetworkError);\n};\n"],"names":["convertToCamelCase","key","_","letter","convertToSnakeCase","convertKeysCase","data","type","dictionary","typeList","callback","element","acc","value","newKey","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","fetchGraphQl","getConfig","FetchGraphQL","GET_ATTRIBUTES_FORM","GET_ATTRIBUTES_FORM_SHORT","handleNetworkError","error","events","handleFetchError","errors","errorMessage","e","cloneArrayIfExists","fields","multilineItems","i","newItem","transformCustomUpperCode","code","transformOptions","item","_a","el","transformAttributesForm","response","items","_b","_c","other","isDefaultCode","a","b","expandArraysInObject","inputObject","flattenedAttributes","index","transformFullName","address","transformIds","transformContacts","transformSingleAddress","addressData","transformMultipleAddresses","addresses","transformCountries","countries","storeConfig","countriesWithRequiredRegion","optionalZipCountries","two_letter_abbreviation","full_name_locale","country","available_regions","hasRegions","getAttributesForm","formCode","sessionStorageKey","sessionStorageCache","transformedData","CREATE_CUSTOMER_ADDRESS","createCustomerAddress","GET_CUSTOMER_ADDRESS","getCustomerAddress","GET_COUNTRIES_QUERY","getCountries","UPDATE_CUSTOMER_ADDRESS","updateCustomerAddress","forms","addressId","REMOVE_CUSTOMER_ADDRESS","removeCustomerAddress"],"mappings":"oHAiBa,MAAAA,EAAsBC,GAC1BA,EAAI,QAAQ,YAAa,CAACC,EAAGC,IAAWA,EAAO,aAAa,EAGxDC,EAAsBH,GAC1BA,EAAI,QAAQ,WAAaE,GAAW,IAAIA,EAAO,YAAa,CAAA,EAAE,EAG1DE,EAAkB,CAC7BC,EACAC,EACAC,IACQ,CACR,MAAMC,EAAW,CAAC,SAAU,UAAW,QAAQ,EACzCC,EACJH,IAAS,YAAcP,EAAqBI,EAE1C,OAAA,MAAM,QAAQE,CAAI,EACbA,EAAK,IAAKK,GACXF,EAAS,SAAS,OAAOE,CAAO,GAAKA,IAAY,KAAaA,EAE9D,OAAOA,GAAY,SACdN,EAAgBM,EAASJ,EAAMC,CAAU,EAE3CG,CACR,EAGCL,IAAS,MAAQ,OAAOA,GAAS,SAC5B,OAAO,QAAQA,CAAI,EAAE,OAAO,CAACM,EAAK,CAACX,EAAKY,CAAK,IAAM,CAClD,MAAAC,EACJN,GAAcA,EAAWP,CAAG,EAAIO,EAAWP,CAAG,EAAIS,EAAST,CAAG,EAChE,OAAAW,EAAIE,CAAM,EACRL,EAAS,SAAS,OAAOI,CAAK,GAAKA,IAAU,KACzCA,EACAR,EAAgBQ,EAAON,EAAMC,CAAU,EACtCI,CACT,EAAG,EAA6B,EAG3BN,CACT,ECvCa,CACX,YAAAS,EACA,sBAAAC,EACA,yBAAAC,EACA,uBAAAC,EACA,aAAAC,EACA,UAAAC,CACF,EAAI,IAAIC,EAAa,EAAE,WAAW,ECTrBC,EAAoC;AA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E,CAAe,CAChC,EAEOA,CAAA,CACR,EACA,MAAMrD,CAAkB,CAC7B,ECtCa4D,EAAwC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECYxCC,EAAwB,MACnCC,GACoB,CACpB,KAAM,CAAE,UAAAC,EAAW,GAAG/B,CAAA,EAAY8B,EAE9B,OAACC,EAEE,MAAMpE,EAAaiE,EAAyB,CACjD,OAAQ,OACR,UAAW,CACT,GAAI,OAAOG,CAAS,EACpB,MAAOlF,EAAgBmD,EAAS,YAAa,CAC3C,oBAAqB,sBACrB,UAAW,YACX,SAAU,WACV,WAAY,YACb,CAAA,CAAA,CACH,CACD,EACE,KAAMb,GAA4C,WACjD,OAAIH,EAAAG,EAAS,SAAT,MAAAH,EAAiB,OAAeb,EAAiBgB,EAAS,MAAM,IAE7DG,GAAAD,EAAAF,GAAA,YAAAA,EAAU,OAAV,YAAAE,EAAgB,wBAAhB,YAAAC,EAAuC,YAAa,EAAA,CAC5D,EACA,MAAMtB,CAAkB,EAnBJ,EAoBzB,ECrCagE,EAAwC;AAAA;AAAA;AAAA;AAAA,ECMxCC,EAAwB,MACnCF,GAEO,MAAMpE,EAAaqE,EAAyB,CACjD,OAAQ,OACR,UAAW,CAAE,GAAID,CAAU,CAAA,CAC5B,EACE,KAAM5C,GAA4C,OACjD,OAAIH,EAAAG,EAAS,SAAT,MAAAH,EAAiB,OAAeb,EAAiBgB,EAAS,MAAM,EAE7DA,EAAS,KAAK,qBAAA,CACtB,EACA,MAAMnB,CAAkB"}
@@ -0,0 +1,14 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+ import { CustomerAddressesModel } from '../../data/models';
4
+
5
+ export interface AddressValidationProps extends HTMLAttributes<HTMLDivElement> {
6
+ busy?: boolean;
7
+ originalAddress: CustomerAddressesModel | null;
8
+ selection: 'suggested' | 'original' | null;
9
+ suggestedAddress: CustomerAddressesModel | null;
10
+ onSelectionChange: (selection: 'suggested' | 'original') => void;
11
+ }
12
+ export declare function formatAddressLine(address: CustomerAddressesModel | null | undefined): string[];
13
+ export declare const AddressValidation: FunctionComponent<AddressValidationProps>;
14
+ //# sourceMappingURL=AddressValidation.d.ts.map
@@ -0,0 +1,19 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2025 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export * from './AddressValidation';
18
+ export { AddressValidation as default } from './AddressValidation';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -29,4 +29,5 @@ export * from './AddressFormWrapper';
29
29
  export * from './ChangePassword';
30
30
  export * from './EditCustomerInformation';
31
31
  export * from './CustomerInformationCard';
32
+ export * from './AddressValidation';
32
33
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{A as l,A as u}from"../chunks/CustomerInformationCard.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";import"@dropins/tools/preact-hooks.js";import"../chunks/removeCustomerAddress.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";export{l as AddressForm,u as default};
3
+ import{A as l,A as u}from"../chunks/AddressValidation.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";import"../chunks/removeCustomerAddress.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";export{l as AddressForm,u as default};
4
4
  //# sourceMappingURL=AddressForm.js.map
@@ -0,0 +1,14 @@
1
+ import { Container } from '@dropins/tools/types/elsie/src/lib';
2
+ import { CustomerAddressesModel } from '../../data/models';
3
+
4
+ export interface AddressValidationProps {
5
+ selectedAddress?: 'suggested' | 'original' | null;
6
+ suggestedAddress: Partial<CustomerAddressesModel> | null;
7
+ originalAddress: CustomerAddressesModel | null;
8
+ handleSelectedAddress?: (payload: {
9
+ selection: 'suggested' | 'original';
10
+ address: CustomerAddressesModel | null | undefined;
11
+ }) => void;
12
+ }
13
+ export declare const AddressValidation: Container<AddressValidationProps>;
14
+ //# sourceMappingURL=AddressValidation.d.ts.map
@@ -0,0 +1,19 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export * from './AddressValidation';
18
+ export { AddressValidation as default } from './AddressValidation';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './AddressValidation/index'
2
+ import _default from './AddressValidation/index'
3
+ export default _default
@@ -0,0 +1,4 @@
1
+ /*! Copyright 2025 Adobe
2
+ All Rights Reserved. */
3
+ import{jsxs as m,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{useState as f,useMemo as _,useCallback as h,useEffect as y}from"@dropins/tools/preact-hooks.js";import{classes as v}from"@dropins/tools/lib.js";import"../chunks/AddressValidation.js";import"@dropins/tools/preact-compat.js";import{Header as N,ToggleButton as $}from"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import{useText as b}from"@dropins/tools/i18n.js";import"../chunks/removeCustomerAddress.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/preact.js";function A(i){if(!i)return[];const l=`${i.firstName} ${i.lastName}`.trim(),o=i.street??"",s=i.city??"",t=i.region||void 0,a=i.postcode??"",c=i.countryCode??"";let e="";s&&t?e=`${s}, ${(t==null?void 0:t.regionCode)??""}`.trim():s?e=s:t&&(e=(t==null?void 0:t.regionCode)??"");let r=e;a&&(r=e?`${e} ${a}`:a);let d=r;return c&&(d=r?`${r}, ${c}`:c),[l,o,d]}const g=({title:i,address:l,selected:o,busy:s,onChange:t})=>{const[a,c,e]=A(l);return n("div",{className:"account-address-validation__option",children:n($,{busy:s,className:"account-address-validation__radio",label:m("div",{children:[n("div",{className:"account-address-validation__option-title",children:n("strong",{children:i})}),a&&n("div",{children:a}),c&&n("div",{children:c}),e&&n("div",{children:e})]}),name:"address-validation-choice",selected:o,value:i,onChange:t})})},C=({busy:i=!1,className:l,originalAddress:o,onSelectionChange:s,selection:t,suggestedAddress:a})=>{const c=!!a,e=b({title:"Account.AddressValidation.title",subtitle:"Account.AddressValidation.subtitle",suggestedAddress:"Account.AddressValidation.suggestedAddress",originalAddress:"Account.AddressValidation.originalAddress"});return m("div",{className:v(["account-address-validation",l]),children:[n(N,{className:"account-address-validation__title",divider:!1,title:e.title}),n("div",{className:"account-address-validation__subtitle",children:e.subtitle}),m("div",{className:v(["account-address-validation__options",i&&"account-address-validation__options--busy"]),children:[c&&n(g,{address:a,busy:i,selected:t==="suggested",title:e.suggestedAddress,onChange:()=>s("suggested")}),n(g,{address:o,busy:i,selected:t==="original",title:e.originalAddress,onChange:()=>s("original")})]})]})},M=({selectedAddress:i=null,suggestedAddress:l,originalAddress:o,handleSelectedAddress:s})=>{const[t,a]=f(i),[c,e]=f(!1),r=_(()=>!l||!o?null:{...o,...l},[o,l]),d=h(async u=>{a(u);const p=u==="suggested"?r:o;e(!0);try{await(s==null?void 0:s({selection:u,address:p}))}finally{e(!1)}},[r,o,s]);return y(()=>{t&&d(t)},[t,d]),n(C,{busy:c,originalAddress:o,selection:t,suggestedAddress:r,onSelectionChange:d})};export{M as AddressValidation,M as default};
4
+ //# sourceMappingURL=AddressValidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddressValidation.js","sources":["/@dropins/storefront-account/src/components/AddressValidation/AddressValidation.tsx","/@dropins/storefront-account/src/containers/AddressValidation/AddressValidation.tsx"],"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 '@/account/components/AddressValidation/AddressValidation.css';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { Header, ToggleButton } from '@adobe-commerce/elsie/components';\nimport { CustomerAddressesModel } from '@/account/data/models';\n\nexport interface AddressValidationProps extends HTMLAttributes<HTMLDivElement> {\n busy?: boolean;\n originalAddress: CustomerAddressesModel | null;\n selection: 'suggested' | 'original' | null;\n suggestedAddress: CustomerAddressesModel | null;\n onSelectionChange: (selection: 'suggested' | 'original') => void;\n}\n\nexport function formatAddressLine(\n address: CustomerAddressesModel | null | undefined\n): string[] {\n if (!address) return [];\n const name = `${address.firstName} ${address.lastName}`.trim();\n const street = address.street ?? '';\n const city = address.city ?? '';\n const region = address.region || undefined;\n const post = address.postcode ?? '';\n const country = address.countryCode ?? '';\n\n let cityRegion = '';\n if (city && region) {\n cityRegion = `${city}, ${region?.regionCode ?? ''}`.trim();\n } else if (city) {\n cityRegion = city;\n } else if (region) {\n cityRegion = region?.regionCode ?? '';\n }\n\n let cityRegionPost = cityRegion;\n if (post) {\n cityRegionPost = cityRegion ? `${cityRegion} ${post}` : post;\n }\n\n let line3 = cityRegionPost;\n if (country) {\n line3 = cityRegionPost ? `${cityRegionPost}, ${country}` : country;\n }\n\n return [name, street, line3];\n}\n\nconst AddressBlock: FunctionComponent<{\n title: string;\n address: CustomerAddressesModel | null | undefined;\n selected: boolean;\n busy?: boolean;\n onChange: () => void;\n}> = ({ title, address, selected, busy, onChange }) => {\n const [line1, line2, line3] = formatAddressLine(address);\n const label = (\n <div>\n <div className=\"account-address-validation__option-title\">\n <strong>{title}</strong>\n </div>\n {line1 && <div>{line1}</div>}\n {line2 && <div>{line2}</div>}\n {line3 && <div>{line3}</div>}\n </div>\n );\n return (\n <div className=\"account-address-validation__option\">\n <ToggleButton\n busy={busy}\n className=\"account-address-validation__radio\"\n label={label}\n name=\"address-validation-choice\"\n selected={selected}\n value={title}\n onChange={onChange}\n />\n </div>\n );\n};\n\nexport const AddressValidation: FunctionComponent<AddressValidationProps> = ({\n busy = false,\n className,\n originalAddress,\n onSelectionChange,\n selection,\n suggestedAddress,\n}) => {\n const hasSuggestion = !!suggestedAddress;\n const translations = useText({\n title: 'Account.AddressValidation.title',\n subtitle: 'Account.AddressValidation.subtitle',\n suggestedAddress: 'Account.AddressValidation.suggestedAddress',\n originalAddress: 'Account.AddressValidation.originalAddress',\n });\n\n return (\n <div className={classes(['account-address-validation', className])}>\n <Header\n className=\"account-address-validation__title\"\n divider={false}\n title={translations.title}\n />\n <div className=\"account-address-validation__subtitle\">\n {translations.subtitle}\n </div>\n\n <div\n className={classes([\n 'account-address-validation__options',\n busy && 'account-address-validation__options--busy',\n ])}\n >\n {hasSuggestion && (\n <AddressBlock\n address={suggestedAddress}\n busy={busy}\n selected={selection === 'suggested'}\n title={translations.suggestedAddress}\n onChange={() => onSelectionChange('suggested')}\n />\n )}\n\n <AddressBlock\n address={originalAddress}\n busy={busy}\n selected={selection === 'original'}\n title={translations.originalAddress}\n onChange={() => onSelectionChange('original')}\n />\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { Container } from '@adobe-commerce/elsie/lib';\nimport { useCallback, useEffect, useMemo, useState } from 'preact/hooks';\nimport { AddressValidation as AddressValidationComponent } from '@/account/components';\nimport { CustomerAddressesModel } from '@/account/data/models';\n\nexport interface AddressValidationProps {\n selectedAddress?: 'suggested' | 'original' | null;\n suggestedAddress: Partial<CustomerAddressesModel> | null;\n originalAddress: CustomerAddressesModel | null;\n handleSelectedAddress?: (payload: {\n selection: 'suggested' | 'original';\n address: CustomerAddressesModel | null | undefined;\n }) => void;\n}\n\nexport const AddressValidation: Container<AddressValidationProps> = ({\n selectedAddress = null,\n suggestedAddress,\n originalAddress,\n handleSelectedAddress,\n}) => {\n const [selection, setSelection] = useState<'suggested' | 'original' | null>(\n selectedAddress\n );\n const [busy, setBusy] = useState(false);\n\n const mergedSuggestedAddress = useMemo<CustomerAddressesModel | null>(() => {\n if (!suggestedAddress || !originalAddress) return null;\n return { ...originalAddress, ...suggestedAddress };\n }, [originalAddress, suggestedAddress]);\n\n const onSelectionChange = useCallback(\n async (sel: 'suggested' | 'original') => {\n setSelection(sel);\n const chosen =\n sel === 'suggested' ? mergedSuggestedAddress : originalAddress;\n setBusy(true);\n try {\n await handleSelectedAddress?.({ selection: sel, address: chosen });\n } finally {\n setBusy(false);\n }\n },\n [mergedSuggestedAddress, originalAddress, handleSelectedAddress]\n );\n\n useEffect(() => {\n if (!selection) return;\n onSelectionChange(selection);\n }, [selection, onSelectionChange]);\n\n return (\n <AddressValidationComponent\n busy={busy}\n originalAddress={originalAddress}\n selection={selection}\n suggestedAddress={mergedSuggestedAddress}\n onSelectionChange={onSelectionChange}\n />\n );\n};\n"],"names":["formatAddressLine","address","name","street","city","region","post","country","cityRegion","cityRegionPost","line3","AddressBlock","title","selected","busy","onChange","line1","line2","jsx","ToggleButton","AddressValidation","className","originalAddress","onSelectionChange","selection","suggestedAddress","hasSuggestion","translations","useText","jsxs","classes","Header","selectedAddress","handleSelectedAddress","setSelection","useState","setBusy","mergedSuggestedAddress","useMemo","useCallback","sel","chosen","useEffect","AddressValidationComponent"],"mappings":"4jBAiCO,SAASA,EACdC,EACU,CACN,GAAA,CAACA,EAAS,MAAO,CAAC,EAChB,MAAAC,EAAO,GAAGD,EAAQ,SAAS,IAAIA,EAAQ,QAAQ,GAAG,KAAK,EACvDE,EAASF,EAAQ,QAAU,GAC3BG,EAAOH,EAAQ,MAAQ,GACvBI,EAASJ,EAAQ,QAAU,OAC3BK,EAAOL,EAAQ,UAAY,GAC3BM,EAAUN,EAAQ,aAAe,GAEvC,IAAIO,EAAa,GACbJ,GAAQC,EACVG,EAAa,GAAGJ,CAAI,MAAKC,GAAA,YAAAA,EAAQ,aAAc,EAAE,GAAG,KAAK,EAChDD,EACII,EAAAJ,EACJC,IACTG,GAAaH,GAAA,YAAAA,EAAQ,aAAc,IAGrC,IAAII,EAAiBD,EACjBF,IACFG,EAAiBD,EAAa,GAAGA,CAAU,IAAIF,CAAI,GAAKA,GAG1D,IAAII,EAAQD,EACZ,OAAIF,IACFG,EAAQD,EAAiB,GAAGA,CAAc,KAAKF,CAAO,GAAKA,GAGtD,CAACL,EAAMC,EAAQO,CAAK,CAC7B,CAEA,MAAMC,EAMD,CAAC,CAAE,MAAAC,EAAO,QAAAX,EAAS,SAAAY,EAAU,KAAAC,EAAM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,MAAOG,EAAa,gBACpB,SAAU,IAAMJ,EAAkB,UAAU,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,EACF,CAEJ,ECxHaH,EAAuD,CAAC,CACnE,gBAAAY,EAAkB,KAClB,iBAAAP,EACA,gBAAAH,EACA,sBAAAW,CACF,IAAM,CACE,KAAA,CAACT,EAAWU,CAAY,EAAIC,EAChCH,CACF,EACM,CAAClB,EAAMsB,CAAO,EAAID,EAAS,EAAK,EAEhCE,EAAyBC,EAAuC,IAChE,CAACb,GAAoB,CAACH,EAAwB,KAC3C,CAAE,GAAGA,EAAiB,GAAGG,CAAiB,EAChD,CAACH,EAAiBG,CAAgB,CAAC,EAEhCF,EAAoBgB,EACxB,MAAOC,GAAkC,CACvCN,EAAaM,CAAG,EACV,MAAAC,EACJD,IAAQ,YAAcH,EAAyBf,EACjDc,EAAQ,EAAI,EACR,GAAA,CACF,MAAMH,GAAA,YAAAA,EAAwB,CAAE,UAAWO,EAAK,QAASC,IAAQ,QACjE,CACAL,EAAQ,EAAK,CAAA,CAEjB,EACA,CAACC,EAAwBf,EAAiBW,CAAqB,CACjE,EAEA,OAAAS,EAAU,IAAM,CACTlB,GACLD,EAAkBC,CAAS,CAAA,EAC1B,CAACA,EAAWD,CAAiB,CAAC,EAG/BL,EAACyB,EAAA,CACC,KAAA7B,EACA,gBAAAQ,EACA,UAAAE,EACA,iBAAkBa,EAClB,kBAAAd,CAAA,CACF,CAEJ"}
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as o}from"@dropins/tools/preact-jsx-runtime.js";import{classes as k}from"@dropins/tools/lib.js";import{a as q}from"../chunks/CustomerInformationCard.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/components.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import"../chunks/removeCustomerAddress.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact.js";const C=(e,r)=>e&&r?"selectedAddress":e?"selectedShippingAddress":r?"selectedBillingAddress":"default",S=({hideActionFormButtons:e,formName:r,slots:m,title:a,addressFormTitle:p,defaultSelectAddressId:f,showFormLoader:n,forwardFormRef:u,showSaveCheckBox:c,saveCheckBoxValue:l,selectShipping:s,selectBilling:t,selectable:A,className:d,withHeader:w,minifiedView:i,withActionsInMinifiedView:x,withActionsInFullSizeView:N,inputsDefaultValueSet:V,showShippingCheckBox:j,showBillingCheckBox:v,shippingCheckBoxValue:y,billingCheckBoxValue:z,onAddressData:D,routeAddressesPage:F,onSuccess:K,onError:W})=>{const b=i?"minifiedView":"fullSizeView",h=r??C(s,t);return o("div",{className:k(["account-addresses",d]),"data-testid":"addressesid",children:o(q,{inputName:h,minifiedViewKey:b,hideActionFormButtons:e,slots:m,title:a,addressFormTitle:p,defaultSelectAddressId:f,showFormLoader:n,onAddressData:D,forwardFormRef:u,selectShipping:s,selectBilling:t,showSaveCheckBox:c,saveCheckBoxValue:l,selectable:A,className:d,withHeader:w,minifiedView:i,withActionsInMinifiedView:x,withActionsInFullSizeView:N,inputsDefaultValueSet:V,billingCheckBoxValue:z,shippingCheckBoxValue:y,showBillingCheckBox:v,showShippingCheckBox:j,routeAddressesPage:F,onSuccess:K,onError:W})})};export{S as Addresses,S as default};
3
+ import{jsx as o}from"@dropins/tools/preact-jsx-runtime.js";import{classes as q}from"@dropins/tools/lib.js";import{a as C}from"../chunks/AddressValidation.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/components.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import"../chunks/removeCustomerAddress.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact.js";const E=(e,r)=>e&&r?"selectedAddress":e?"selectedShippingAddress":r?"selectedBillingAddress":"default",T=({hideActionFormButtons:e,formName:r,slots:m,title:a,addressFormTitle:p,defaultSelectAddressId:f,showFormLoader:n,forwardFormRef:u,showSaveCheckBox:c,saveCheckBoxValue:l,selectShipping:s,selectBilling:t,selectable:A,className:d,withHeader:w,minifiedView:i,withActionsInMinifiedView:x,withActionsInFullSizeView:N,inputsDefaultValueSet:V,showShippingCheckBox:j,showBillingCheckBox:v,shippingCheckBoxValue:y,billingCheckBoxValue:z,onAddressData:D,routeAddressesPage:F,onSubmit:K,onSuccess:W,onError:b})=>{const h=i?"minifiedView":"fullSizeView",k=r??E(s,t);return o("div",{className:q(["account-addresses",d]),"data-testid":"addressesid",children:o(C,{inputName:k,minifiedViewKey:h,hideActionFormButtons:e,slots:m,title:a,addressFormTitle:p,defaultSelectAddressId:f,showFormLoader:n,onAddressData:D,forwardFormRef:u,selectShipping:s,selectBilling:t,showSaveCheckBox:c,saveCheckBoxValue:l,selectable:A,className:d,withHeader:w,minifiedView:i,withActionsInMinifiedView:x,withActionsInFullSizeView:N,inputsDefaultValueSet:V,billingCheckBoxValue:z,shippingCheckBoxValue:y,showBillingCheckBox:v,showShippingCheckBox:j,routeAddressesPage:F,onSubmit:K,onSuccess:W,onError:b})})};export{T as Addresses,T as default};
4
4
  //# sourceMappingURL=Addresses.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Addresses.js","sources":["/@dropins/storefront-account/src/containers/Addresses/Addresses.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { classes, Container } from '@adobe-commerce/elsie/lib';\nimport { AddressesProps } from '@/account/types';\nimport { AddressesWrapper } from '@/account/components';\n\nconst getDefaultFormName = (\n selectShipping: boolean,\n selectBilling: boolean\n): string => {\n if (selectShipping && selectBilling) {\n return 'selectedAddress';\n } else if (selectShipping) {\n return 'selectedShippingAddress';\n } else if (selectBilling) {\n return 'selectedBillingAddress';\n }\n\n return 'default';\n};\n\nexport const Addresses: Container<AddressesProps> = ({\n hideActionFormButtons,\n formName,\n slots,\n title,\n addressFormTitle,\n defaultSelectAddressId,\n showFormLoader,\n forwardFormRef,\n showSaveCheckBox,\n saveCheckBoxValue,\n selectShipping,\n selectBilling,\n selectable,\n className,\n withHeader,\n minifiedView,\n withActionsInMinifiedView,\n withActionsInFullSizeView,\n inputsDefaultValueSet,\n showShippingCheckBox,\n showBillingCheckBox,\n shippingCheckBoxValue,\n billingCheckBoxValue,\n onAddressData,\n routeAddressesPage,\n onSuccess,\n onError,\n}) => {\n const minifiedViewKey = minifiedView ? 'minifiedView' : 'fullSizeView';\n const inputName =\n formName ?? getDefaultFormName(selectShipping!, selectBilling!);\n\n return (\n <div\n className={classes(['account-addresses', className])}\n data-testid=\"addressesid\"\n >\n <AddressesWrapper\n inputName={inputName}\n minifiedViewKey={minifiedViewKey}\n hideActionFormButtons={hideActionFormButtons}\n slots={slots}\n title={title}\n addressFormTitle={addressFormTitle}\n defaultSelectAddressId={defaultSelectAddressId}\n showFormLoader={showFormLoader}\n onAddressData={onAddressData}\n forwardFormRef={forwardFormRef}\n selectShipping={selectShipping}\n selectBilling={selectBilling}\n showSaveCheckBox={showSaveCheckBox}\n saveCheckBoxValue={saveCheckBoxValue}\n selectable={selectable}\n className={className}\n withHeader={withHeader}\n minifiedView={minifiedView}\n withActionsInMinifiedView={withActionsInMinifiedView}\n withActionsInFullSizeView={withActionsInFullSizeView}\n inputsDefaultValueSet={inputsDefaultValueSet}\n billingCheckBoxValue={billingCheckBoxValue}\n shippingCheckBoxValue={shippingCheckBoxValue}\n showBillingCheckBox={showBillingCheckBox}\n showShippingCheckBox={showShippingCheckBox}\n routeAddressesPage={routeAddressesPage}\n onSuccess={onSuccess}\n onError={onError}\n />\n </div>\n );\n};\n"],"names":["getDefaultFormName","selectShipping","selectBilling","Addresses","hideActionFormButtons","formName","slots","title","addressFormTitle","defaultSelectAddressId","showFormLoader","forwardFormRef","showSaveCheckBox","saveCheckBoxValue","selectable","className","withHeader","minifiedView","withActionsInMinifiedView","withActionsInFullSizeView","inputsDefaultValueSet","showShippingCheckBox","showBillingCheckBox","shippingCheckBoxValue","billingCheckBoxValue","onAddressData","routeAddressesPage","onSuccess","onError","minifiedViewKey","inputName","jsx","classes","AddressesWrapper"],"mappings":"+cAqBA,MAAMA,EAAqB,CACzBC,EACAC,IAEID,GAAkBC,EACb,kBACED,EACF,0BACEC,EACF,yBAGF,UAGIC,EAAuC,CAAC,CACnD,sBAAAC,EACA,SAAAC,EACA,MAAAC,EACA,MAAAC,EACA,iBAAAC,EACA,uBAAAC,EACA,eAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,kBAAAC,EACA,eAAAZ,EACA,cAAAC,EACA,WAAAY,EACA,UAAAC,EACA,WAAAC,EACA,aAAAC,EACA,0BAAAC,EACA,0BAAAC,EACA,sBAAAC,EACA,qBAAAC,EACA,oBAAAC,EACA,sBAAAC,EACA,qBAAAC,EACA,cAAAC,EACA,mBAAAC,EACA,UAAAC,EACA,QAAAC,CACF,IAAM,CACE,MAAAC,EAAkBZ,EAAe,eAAiB,eAClDa,EACJzB,GAAYL,EAAmBC,EAAiBC,CAAc,EAG9D,OAAA6B,EAAC,MAAA,CACC,UAAWC,EAAQ,CAAC,oBAAqBjB,CAAS,CAAC,EACnD,cAAY,cAEZ,SAAAgB,EAACE,EAAA,CACC,UAAAH,EACA,gBAAAD,EACA,sBAAAzB,EACA,MAAAE,EACA,MAAAC,EACA,iBAAAC,EACA,uBAAAC,EACA,eAAAC,EACA,cAAAe,EACA,eAAAd,EACA,eAAAV,EACA,cAAAC,EACA,iBAAAU,EACA,kBAAAC,EACA,WAAAC,EACA,UAAAC,EACA,WAAAC,EACA,aAAAC,EACA,0BAAAC,EACA,0BAAAC,EACA,sBAAAC,EACA,qBAAAI,EACA,sBAAAD,EACA,oBAAAD,EACA,qBAAAD,EACA,mBAAAK,EACA,UAAAC,EACA,QAAAC,CAAA,CAAA,CACF,CACF,CAEJ"}
1
+ {"version":3,"file":"Addresses.js","sources":["/@dropins/storefront-account/src/containers/Addresses/Addresses.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 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 { classes, Container } from '@adobe-commerce/elsie/lib';\nimport { AddressesProps } from '@/account/types';\nimport { AddressesWrapper } from '@/account/components';\n\nconst getDefaultFormName = (\n selectShipping: boolean,\n selectBilling: boolean\n): string => {\n if (selectShipping && selectBilling) {\n return 'selectedAddress';\n } else if (selectShipping) {\n return 'selectedShippingAddress';\n } else if (selectBilling) {\n return 'selectedBillingAddress';\n }\n\n return 'default';\n};\n\nexport const Addresses: Container<AddressesProps> = ({\n hideActionFormButtons,\n formName,\n slots,\n title,\n addressFormTitle,\n defaultSelectAddressId,\n showFormLoader,\n forwardFormRef,\n showSaveCheckBox,\n saveCheckBoxValue,\n selectShipping,\n selectBilling,\n selectable,\n className,\n withHeader,\n minifiedView,\n withActionsInMinifiedView,\n withActionsInFullSizeView,\n inputsDefaultValueSet,\n showShippingCheckBox,\n showBillingCheckBox,\n shippingCheckBoxValue,\n billingCheckBoxValue,\n onAddressData,\n routeAddressesPage,\n onSubmit,\n onSuccess,\n onError,\n}) => {\n const minifiedViewKey = minifiedView ? 'minifiedView' : 'fullSizeView';\n const inputName =\n formName ?? getDefaultFormName(selectShipping!, selectBilling!);\n\n return (\n <div\n className={classes(['account-addresses', className])}\n data-testid=\"addressesid\"\n >\n <AddressesWrapper\n inputName={inputName}\n minifiedViewKey={minifiedViewKey}\n hideActionFormButtons={hideActionFormButtons}\n slots={slots}\n title={title}\n addressFormTitle={addressFormTitle}\n defaultSelectAddressId={defaultSelectAddressId}\n showFormLoader={showFormLoader}\n onAddressData={onAddressData}\n forwardFormRef={forwardFormRef}\n selectShipping={selectShipping}\n selectBilling={selectBilling}\n showSaveCheckBox={showSaveCheckBox}\n saveCheckBoxValue={saveCheckBoxValue}\n selectable={selectable}\n className={className}\n withHeader={withHeader}\n minifiedView={minifiedView}\n withActionsInMinifiedView={withActionsInMinifiedView}\n withActionsInFullSizeView={withActionsInFullSizeView}\n inputsDefaultValueSet={inputsDefaultValueSet}\n billingCheckBoxValue={billingCheckBoxValue}\n shippingCheckBoxValue={shippingCheckBoxValue}\n showBillingCheckBox={showBillingCheckBox}\n showShippingCheckBox={showShippingCheckBox}\n routeAddressesPage={routeAddressesPage}\n onSubmit={onSubmit}\n onSuccess={onSuccess}\n onError={onError}\n />\n </div>\n );\n};\n"],"names":["getDefaultFormName","selectShipping","selectBilling","Addresses","hideActionFormButtons","formName","slots","title","addressFormTitle","defaultSelectAddressId","showFormLoader","forwardFormRef","showSaveCheckBox","saveCheckBoxValue","selectable","className","withHeader","minifiedView","withActionsInMinifiedView","withActionsInFullSizeView","inputsDefaultValueSet","showShippingCheckBox","showBillingCheckBox","shippingCheckBoxValue","billingCheckBoxValue","onAddressData","routeAddressesPage","onSubmit","onSuccess","onError","minifiedViewKey","inputName","jsx","classes","AddressesWrapper"],"mappings":"ycAqBA,MAAMA,EAAqB,CACzBC,EACAC,IAEID,GAAkBC,EACb,kBACED,EACF,0BACEC,EACF,yBAGF,UAGIC,EAAuC,CAAC,CACnD,sBAAAC,EACA,SAAAC,EACA,MAAAC,EACA,MAAAC,EACA,iBAAAC,EACA,uBAAAC,EACA,eAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,kBAAAC,EACA,eAAAZ,EACA,cAAAC,EACA,WAAAY,EACA,UAAAC,EACA,WAAAC,EACA,aAAAC,EACA,0BAAAC,EACA,0BAAAC,EACA,sBAAAC,EACA,qBAAAC,EACA,oBAAAC,EACA,sBAAAC,EACA,qBAAAC,EACA,cAAAC,EACA,mBAAAC,EACA,SAAAC,EACA,UAAAC,EACA,QAAAC,CACF,IAAM,CACE,MAAAC,EAAkBb,EAAe,eAAiB,eAClDc,EACJ1B,GAAYL,EAAmBC,EAAiBC,CAAc,EAG9D,OAAA8B,EAAC,MAAA,CACC,UAAWC,EAAQ,CAAC,oBAAqBlB,CAAS,CAAC,EACnD,cAAY,cAEZ,SAAAiB,EAACE,EAAA,CACC,UAAAH,EACA,gBAAAD,EACA,sBAAA1B,EACA,MAAAE,EACA,MAAAC,EACA,iBAAAC,EACA,uBAAAC,EACA,eAAAC,EACA,cAAAe,EACA,eAAAd,EACA,eAAAV,EACA,cAAAC,EACA,iBAAAU,EACA,kBAAAC,EACA,WAAAC,EACA,UAAAC,EACA,WAAAC,EACA,aAAAC,EACA,0BAAAC,EACA,0BAAAC,EACA,sBAAAC,EACA,qBAAAI,EACA,sBAAAD,EACA,oBAAAD,EACA,qBAAAD,EACA,mBAAAK,EACA,SAAAC,EACA,UAAAC,EACA,QAAAC,CAAA,CAAA,CACF,CACF,CAEJ"}