@dropins/storefront-quote-management 0.0.1-alpha12 → 0.0.1-alpha14

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 (76) hide show
  1. package/api/getQuoteData/getQuoteData.d.ts +10 -0
  2. package/api/getQuoteData/graphql/QuoteDataQuery.d.ts +2 -0
  3. package/api/getQuoteData/index.d.ts +10 -0
  4. package/api/graphql/NegotiableQuoteFragment.d.ts +1 -1
  5. package/api/graphql/NegotiableQuoteListFragment.d.ts +1 -1
  6. package/api/index.d.ts +3 -0
  7. package/api/initialize/initialize.d.ts +1 -0
  8. package/api/requestNegotiableQuote/requestNegotiableQuote.d.ts +0 -6
  9. package/api/sendForReview/graphql/SendNegotiableQuoteForReviewMutation.d.ts +18 -0
  10. package/api/sendForReview/index.d.ts +10 -0
  11. package/api/sendForReview/sendForReview.d.ts +8 -0
  12. package/api/setShippingAddress/graphql/SetNegotiableQuoteShippingAddressMutation.d.ts +18 -0
  13. package/api/setShippingAddress/index.d.ts +2 -0
  14. package/api/setShippingAddress/setShippingAddress.d.ts +110 -0
  15. package/api.js +37 -4
  16. package/api.js.map +1 -1
  17. package/chunks/NegotiableQuoteFragment.js +167 -0
  18. package/chunks/NegotiableQuoteFragment.js.map +1 -0
  19. package/chunks/WarningFilled.js +4 -0
  20. package/chunks/WarningFilled.js.map +1 -0
  21. package/chunks/negotiableQuotes.js +12 -1
  22. package/chunks/negotiableQuotes.js.map +1 -1
  23. package/chunks/requestNegotiableQuote.js +3 -83
  24. package/chunks/requestNegotiableQuote.js.map +1 -1
  25. package/chunks/sendForReview.js +21 -0
  26. package/chunks/sendForReview.js.map +1 -0
  27. package/chunks/transform-quote.js +1 -1
  28. package/chunks/transform-quote.js.map +1 -1
  29. package/components/ActionsBar/ActionsBar.d.ts +14 -0
  30. package/components/ActionsBar/index.d.ts +11 -0
  31. package/components/ItemsQuoted/ItemsQuoted.d.ts +11 -0
  32. package/components/ItemsQuoted/index.d.ts +11 -0
  33. package/components/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +20 -0
  34. package/components/ManageNegotiableQuote/__fixtures__/ManageNegotiableQuoteProps.d.ts +4 -0
  35. package/components/ManageNegotiableQuote/index.d.ts +11 -0
  36. package/components/OrderSummary/OrderSummary.d.ts +67 -0
  37. package/components/OrderSummary/index.d.ts +11 -0
  38. package/components/OrderSummaryLine/OrderSummaryLine.d.ts +13 -0
  39. package/components/OrderSummaryLine/index.d.ts +11 -0
  40. package/components/ProductListTable/ProductListTable.d.ts +13 -0
  41. package/components/ProductListTable/index.d.ts +11 -0
  42. package/components/QuotePricesSummary/QuotePricesSummary.d.ts +16 -0
  43. package/components/QuotePricesSummary/index.d.ts +11 -0
  44. package/components/QuoteSummaryList/QuoteSummaryList.d.ts +13 -0
  45. package/components/QuoteSummaryList/index.d.ts +11 -0
  46. package/components/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +12 -0
  47. package/components/ShippingAddressDisplay/index.d.ts +11 -0
  48. package/components/TabbedContent/TabbedContent.d.ts +10 -0
  49. package/components/TabbedContent/index.d.ts +11 -0
  50. package/components/index.d.ts +19 -1
  51. package/containers/ItemsQuoted/ItemsQuoted.d.ts +25 -0
  52. package/containers/ItemsQuoted/index.d.ts +11 -0
  53. package/containers/ItemsQuoted.d.ts +3 -0
  54. package/containers/ItemsQuoted.js +4 -0
  55. package/containers/ItemsQuoted.js.map +1 -0
  56. package/containers/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +56 -0
  57. package/containers/ManageNegotiableQuote/index.d.ts +11 -0
  58. package/containers/ManageNegotiableQuote.d.ts +3 -0
  59. package/containers/ManageNegotiableQuote.js +4 -0
  60. package/containers/ManageNegotiableQuote.js.map +1 -0
  61. package/containers/QuotesListTable/QuotesListTable.d.ts +9 -9
  62. package/containers/QuotesListTable.js +1 -1
  63. package/containers/QuotesListTable.js.map +1 -1
  64. package/containers/RequestNegotiableQuoteForm.js +1 -1
  65. package/containers/RequestNegotiableQuoteForm.js.map +1 -1
  66. package/containers/index.d.ts +2 -0
  67. package/data/models/__fixtures__/negotiableQuoteModel.d.ts +7 -0
  68. package/data/models/customer-model.d.ts +1 -0
  69. package/data/models/negotiable-quote-model.d.ts +100 -34
  70. package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +248 -2
  71. package/i18n/en_US.json.d.ts +94 -0
  72. package/lib/state.d.ts +1 -0
  73. package/package.json +1 -1
  74. package/render.js +5 -3
  75. package/render.js.map +1 -1
  76. package/types/state.types.d.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"negotiableQuotes.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteListFragment.ts","/@dropins/storefront-quote-management/src/api/graphql/SearchResultPageInfoFragment.ts","/@dropins/storefront-quote-management/src/api/graphql/SortFieldsFragment.ts","/@dropins/storefront-quote-management/src/api/negotiableQuotes/graphql/NegotiableQuotesQuery.ts","/@dropins/storefront-quote-management/src/api/negotiableQuotes/negotiableQuotes.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const NEGOTIABLE_QUOTE_LIST_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteListFragment on NegotiableQuote {\n uid\n name\n created_at\n updated_at\n status\n buyer {\n firstname\n lastname\n }\n template_name\n prices {\n grand_total {\n value\n currency\n }\n }\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const SEARCH_RESULT_PAGE_INFO_FRAGMENT = /* GraphQL */ `\n fragment SearchResultPageInfoFragment on SearchResultPageInfo {\n current_page\n page_size\n total_pages\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const SORT_FIELDS_FRAGMENT = /* GraphQL */ `\n fragment SortFieldsFragment on SortFields {\n default\n options {\n label\n value\n }\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_LIST_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteListFragment';\nimport { SEARCH_RESULT_PAGE_INFO_FRAGMENT } from '@/quote-management/api/graphql/SearchResultPageInfoFragment';\nimport { SORT_FIELDS_FRAGMENT } from '@/quote-management/api/graphql/SortFieldsFragment';\n\nexport const NEGOTIABLE_QUOTES_QUERY = /* GraphQL */ `\n query negotiableQuotes(\n $filter: NegotiableQuoteFilterInput\n $pageSize: Int\n $currentPage: Int\n $sort: NegotiableQuoteSortInput\n ) {\n negotiableQuotes(\n filter: $filter\n pageSize: $pageSize\n currentPage: $currentPage\n sort: $sort\n ) {\n items {\n ...NegotiableQuoteListFragment\n }\n page_info {\n ...SearchResultPageInfoFragment\n }\n sort_fields {\n ...SortFieldsFragment\n }\n total_count\n }\n }\n\n ${NEGOTIABLE_QUOTE_LIST_FRAGMENT}\n ${SEARCH_RESULT_PAGE_INFO_FRAGMENT}\n ${SORT_FIELDS_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@adobe-commerce/fetch-graphql';\nimport { NEGOTIABLE_QUOTES_QUERY } from './graphql/NegotiableQuotesQuery';\nimport { transformNegotiableQuotesList } from '@/quote-management/data/transforms';\nimport { NegotiableQuotesListModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { state } from '@/quote-management/lib/state';\n\nexport enum FilterMatchTypeEnum {\n FULL = 'FULL',\n PARTIAL = 'PARTIAL',\n}\n\nexport interface FilterEqualTypeInput {\n eq?: string;\n in?: string[];\n}\n\nexport interface FilterMatchTypeInput {\n match?: string;\n match_type?: FilterMatchTypeEnum;\n}\n\nexport interface NegotiableQuoteFilterInput {\n ids?: FilterEqualTypeInput;\n name?: FilterMatchTypeInput;\n}\n\nexport enum SortEnum {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\nexport enum NegotiableQuoteSortableField {\n QUOTE_NAME = 'QUOTE_NAME',\n CREATED_AT = 'CREATED_AT',\n UPDATED_AT = 'UPDATED_AT',\n}\n\nexport interface NegotiableQuoteSortInput {\n sort_direction: SortEnum;\n sort_field: NegotiableQuoteSortableField;\n}\n\nexport interface NegotiableQuotesParams {\n filter?: NegotiableQuoteFilterInput;\n pageSize?: number;\n currentPage?: number;\n sort?: NegotiableQuoteSortInput;\n}\n\nexport const negotiableQuotes = async (\n params: NegotiableQuotesParams = {}\n): Promise<NegotiableQuotesListModel> => {\n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n const variables = {\n filter: params.filter || null,\n pageSize: params.pageSize || 20,\n currentPage: params.currentPage || 1,\n sort: params.sort || null,\n };\n\n try {\n const results: any = await fetchGraphQl(NEGOTIABLE_QUOTES_QUERY, {\n variables,\n });\n\n if (!results?.data?.negotiableQuotes) {\n throw new Error('No quotes data received');\n }\n\n const transformedData = transformNegotiableQuotesList(\n results.data.negotiableQuotes\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quotes data');\n }\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n"],"names":["NEGOTIABLE_QUOTE_LIST_FRAGMENT","SEARCH_RESULT_PAGE_INFO_FRAGMENT","SORT_FIELDS_FRAGMENT","NEGOTIABLE_QUOTES_QUERY","FilterMatchTypeEnum","SortEnum","NegotiableQuoteSortableField","negotiableQuotes","params","state","variables","results","fetchGraphQl","_a","transformedData","transformNegotiableQuotesList","error"],"mappings":"0GASO,MAAMA,EAA+C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECA/CC,EAAiD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECAjDC,EAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECIrCC,EAAwC;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,IA0BjDH,CAA8B;AAAA,IAC9BC,CAAgC;AAAA,IAChCC,CAAoB;AAAA,EC1BjB,IAAKE,GAAAA,IACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UAFAA,IAAAA,GAAA,CAAA,CAAA,EAoBAC,GAAAA,IACVA,EAAA,IAAM,MACNA,EAAA,KAAO,OAFGA,IAAAA,GAAA,CAAA,CAAA,EAKAC,GAAAA,IACVA,EAAA,WAAa,aACbA,EAAA,WAAa,aACbA,EAAA,WAAa,aAHHA,IAAAA,GAAA,CAAA,CAAA,EAkBL,MAAMC,EAAmB,MAC9BC,EAAiC,KACM,OACvC,GAAI,CAACC,EAAM,cACT,OAAO,QAAQ,OAAO,IAAI,MAAM,cAAc,CAAC,EAGjD,MAAMC,EAAY,CAChB,OAAQF,EAAO,QAAU,KACzB,SAAUA,EAAO,UAAY,GAC7B,YAAaA,EAAO,aAAe,EACnC,KAAMA,EAAO,MAAQ,IAAA,EAGvB,GAAI,CACF,MAAMG,EAAe,MAAMC,EAAaT,EAAyB,CAC/D,UAAAO,CAAA,CACD,EAED,GAAI,GAACG,EAAAF,GAAA,YAAAA,EAAS,OAAT,MAAAE,EAAe,kBAClB,MAAM,IAAI,MAAM,yBAAyB,EAG3C,MAAMC,EAAkBC,EACtBJ,EAAQ,KAAK,gBAAA,EAGf,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,iCAAiC,EAGnD,OAAOA,CACT,OAASE,EAAO,CACd,OAAO,QAAQ,OAAOA,CAAK,CAC7B,CACF"}
1
+ {"version":3,"file":"negotiableQuotes.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteListFragment.ts","/@dropins/storefront-quote-management/src/api/graphql/SearchResultPageInfoFragment.ts","/@dropins/storefront-quote-management/src/api/graphql/SortFieldsFragment.ts","/@dropins/storefront-quote-management/src/api/negotiableQuotes/graphql/NegotiableQuotesQuery.ts","/@dropins/storefront-quote-management/src/api/negotiableQuotes/negotiableQuotes.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const NEGOTIABLE_QUOTE_LIST_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteListFragment on NegotiableQuote {\n uid\n name\n created_at\n updated_at\n status\n buyer {\n firstname\n lastname\n }\n template_name\n prices {\n grand_total {\n value\n currency\n }\n }\n history {\n change_type\n changes {\n statuses {\n changes {\n new_status\n old_status\n }\n }\n }\n }\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const SEARCH_RESULT_PAGE_INFO_FRAGMENT = /* GraphQL */ `\n fragment SearchResultPageInfoFragment on SearchResultPageInfo {\n current_page\n page_size\n total_pages\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const SORT_FIELDS_FRAGMENT = /* GraphQL */ `\n fragment SortFieldsFragment on SortFields {\n default\n options {\n label\n value\n }\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_LIST_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteListFragment';\nimport { SEARCH_RESULT_PAGE_INFO_FRAGMENT } from '@/quote-management/api/graphql/SearchResultPageInfoFragment';\nimport { SORT_FIELDS_FRAGMENT } from '@/quote-management/api/graphql/SortFieldsFragment';\n\nexport const NEGOTIABLE_QUOTES_QUERY = /* GraphQL */ `\n query negotiableQuotes(\n $filter: NegotiableQuoteFilterInput\n $pageSize: Int\n $currentPage: Int\n $sort: NegotiableQuoteSortInput\n ) {\n negotiableQuotes(\n filter: $filter\n pageSize: $pageSize\n currentPage: $currentPage\n sort: $sort\n ) {\n items {\n ...NegotiableQuoteListFragment\n }\n page_info {\n ...SearchResultPageInfoFragment\n }\n sort_fields {\n ...SortFieldsFragment\n }\n total_count\n }\n }\n\n ${NEGOTIABLE_QUOTE_LIST_FRAGMENT}\n ${SEARCH_RESULT_PAGE_INFO_FRAGMENT}\n ${SORT_FIELDS_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@adobe-commerce/fetch-graphql';\nimport { NEGOTIABLE_QUOTES_QUERY } from './graphql/NegotiableQuotesQuery';\nimport { transformNegotiableQuotesList } from '@/quote-management/data/transforms';\nimport { NegotiableQuotesListModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { state } from '@/quote-management/lib/state';\n\nexport enum FilterMatchTypeEnum {\n FULL = 'FULL',\n PARTIAL = 'PARTIAL',\n}\n\nexport interface FilterEqualTypeInput {\n eq?: string;\n in?: string[];\n}\n\nexport interface FilterMatchTypeInput {\n match?: string;\n match_type?: FilterMatchTypeEnum;\n}\n\nexport interface NegotiableQuoteFilterInput {\n ids?: FilterEqualTypeInput;\n name?: FilterMatchTypeInput;\n}\n\nexport enum SortEnum {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\nexport enum NegotiableQuoteSortableField {\n QUOTE_NAME = 'QUOTE_NAME',\n CREATED_AT = 'CREATED_AT',\n UPDATED_AT = 'UPDATED_AT',\n}\n\nexport interface NegotiableQuoteSortInput {\n sort_direction: SortEnum;\n sort_field: NegotiableQuoteSortableField;\n}\n\nexport interface NegotiableQuotesParams {\n filter?: NegotiableQuoteFilterInput;\n pageSize?: number;\n currentPage?: number;\n sort?: NegotiableQuoteSortInput;\n}\n\nexport const negotiableQuotes = async (\n params: NegotiableQuotesParams = {}\n): Promise<NegotiableQuotesListModel> => {\n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n const variables = {\n filter: params.filter || null,\n pageSize: params.pageSize || 20,\n currentPage: params.currentPage || 1,\n sort: params.sort || null,\n };\n\n try {\n const results: any = await fetchGraphQl(NEGOTIABLE_QUOTES_QUERY, {\n variables,\n });\n\n if (!results?.data?.negotiableQuotes) {\n throw new Error('No quotes data received');\n }\n\n const transformedData = transformNegotiableQuotesList(\n results.data.negotiableQuotes\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quotes data');\n }\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n"],"names":["NEGOTIABLE_QUOTE_LIST_FRAGMENT","SEARCH_RESULT_PAGE_INFO_FRAGMENT","SORT_FIELDS_FRAGMENT","NEGOTIABLE_QUOTES_QUERY","FilterMatchTypeEnum","SortEnum","NegotiableQuoteSortableField","negotiableQuotes","params","state","variables","results","fetchGraphQl","_a","transformedData","transformNegotiableQuotesList","error"],"mappings":"0GASO,MAAMA,EA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,EAG3C,MAAMC,EAAkBC,EACtBJ,EAAQ,KAAK,gBAAA,EAGf,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,iCAAiC,EAGnD,OAAOA,CACT,OAASE,EAAO,CACd,OAAO,QAAQ,OAAOA,CAAK,CAC7B,CACF"}
@@ -1,62 +1,6 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{fetchGraphQl as _}from"@dropins/tools/fetch-graphql.js";import{events as I}from"@dropins/tools/event-bus.js";import{t as N}from"./transform-quote.js";const U=`
4
- fragment NegotiableQuoteFragment on NegotiableQuote {
5
- uid
6
- name
7
- created_at
8
- updated_at
9
- status
10
- buyer {
11
- firstname
12
- lastname
13
- }
14
- comments {
15
- uid
16
- created_at
17
- author {
18
- firstname
19
- lastname
20
- }
21
- attachments {
22
- name
23
- url
24
- }
25
- }
26
- template_id
27
- template_name
28
- items {
29
- product {
30
- uid
31
- sku
32
- name
33
- price_range {
34
- maximum_price {
35
- regular_price {
36
- value
37
- }
38
- }
39
- }
40
- }
41
- quantity
42
- }
43
- prices {
44
- subtotal_excluding_tax {
45
- value
46
- }
47
- subtotal_including_tax {
48
- value
49
- }
50
- subtotal_with_discount_excluding_tax {
51
- value
52
- }
53
- grand_total {
54
- value
55
- currency
56
- }
57
- }
58
- }
59
- `,q=`
3
+ import{fetchGraphQl as c}from"@dropins/tools/fetch-graphql.js";import{events as f}from"@dropins/tools/event-bus.js";import{N}from"./NegotiableQuoteFragment.js";import{t as d}from"./transform-quote.js";const l=`
60
4
  mutation REQUEST_NEGOTIABLE_QUOTE_MUTATION(
61
5
  $cartId: ID!
62
6
  $quoteName: String!
@@ -76,30 +20,6 @@ import{fetchGraphQl as _}from"@dropins/tools/fetch-graphql.js";import{events as
76
20
  }
77
21
  }
78
22
  }
79
- ${U}
80
- `,y=async e=>{const{cartId:n,quoteName:i,comment:s,attachments:r,isDraft:a}=e;if(!n)throw new Error("Cart ID is required");if(!i)throw new Error("Quote name is required");if(!s)throw new Error("Comment is required");return _(q,{variables:{cartId:n,quoteName:i,comment:r!=null&&r.length?{comment:s,attachments:r}:{comment:s},isDraft:a}}).then(u=>{const{errors:t}=u;if(t){const m=t.map(l=>l.message).join("; ");throw new Error(`Failed to request negotiable quote: ${m}`)}const o=N(u);if(!o)throw new Error("Failed to transform quote data: Invalid response structure");return I.emit("quote-management/negotiable-quote-requested",{quote:o,input:{cartId:n,quoteName:i,comment:s,attachments:r,isDraft:a}}),o})},Q=async e=>{var a,u;const n=e==null?void 0:e.name;if(!e||!n)throw new Error("Invalid file");const i="NEGOTIABLE_QUOTE_ATTACHMENT",s=`
81
- mutation INITIATE_UPLOAD_MUTATION(
82
- $input: initiateUploadInput!
83
- ){
84
- initiateUpload(
85
- input: $input
86
- ){
87
- upload_url
88
- key
89
- expires_at
90
- }
91
- }
92
- `,r=`
93
- mutation FINISH_UPLOAD_MUTATION(
94
- $input: finishUploadInput!
95
- ){
96
- finishUpload(
97
- input: $input
98
- ){
99
- success
100
- key
101
- message
102
- }
103
- }
104
- `;try{const t=f=>f.map(w=>w.message).join("; "),{data:o,errors:m}=await _(s,{variables:{input:{key:n,media_resource_type:i}}});if(m&&m.length)throw new Error(t(m));const{upload_url:l,key:E}=(o==null?void 0:o.initiateUpload)||{};if(!l||!E)throw new Error("Failed to initiate upload");const c=await fetch(l,{method:"PUT",body:e});if(!c.ok)throw new Error(`Upload failed: ${c.status} ${c.statusText}`);const{data:d,errors:p}=await _(r,{variables:{input:{key:E,media_resource_type:i}}});if(p&&p.length)throw new Error(t(p));const{success:g,key:T,message:h}=(d==null?void 0:d.finishUpload)||{};if(!g||!T)throw new Error(h||"Failed to finish upload");return{key:T}}catch(t){try{(u=(a=I)==null?void 0:a.emit)==null||u.call(a,"quote-management/file-upload-error",{error:(t==null?void 0:t.message)||"File upload failed",fileName:e==null?void 0:e.name})}catch{}throw t instanceof Error?t:new Error("File upload failed")}};export{y as r,Q as u};
23
+ ${N}
24
+ `,_=async s=>{const{cartId:e,quoteName:t,comment:r,isDraft:a}=s;if(!e)throw new Error("Cart ID is required");if(!t)throw new Error("Quote name is required");if(!r)throw new Error("Comment is required");return c(l,{variables:{cartId:e,quoteName:t,comment:{comment:r},isDraft:a}}).then(n=>{var m,u;const{errors:i}=n;if(i){const q=i.map(E=>E.message).join("; ");throw new Error(`Failed to request negotiable quote: ${q}`)}const o=d((u=(m=n.data)==null?void 0:m.requestNegotiableQuote)==null?void 0:u.quote);if(!o)throw new Error("Failed to transform quote data: Invalid response structure");return f.emit("quote-management/negotiable-quote-requested",{quote:o,input:{cartId:e,quoteName:t,comment:r,isDraft:a}}),o})};export{_ as r};
105
25
  //# sourceMappingURL=requestNegotiableQuote.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"requestNegotiableQuote.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteFragment.ts","/@dropins/storefront-quote-management/src/api/requestNegotiableQuote/graphql/RequestNegotiableQuoteMutation.ts","/@dropins/storefront-quote-management/src/api/requestNegotiableQuote/requestNegotiableQuote.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 NEGOTIABLE_QUOTE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteFragment on NegotiableQuote {\n uid\n name\n created_at\n updated_at\n status\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n attachments {\n name\n url\n }\n }\n template_id\n template_name\n items {\n product {\n uid\n sku\n name\n price_range {\n maximum_price {\n regular_price {\n value\n }\n }\n }\n }\n quantity\n }\n prices {\n subtotal_excluding_tax {\n value\n }\n subtotal_including_tax {\n value\n }\n subtotal_with_discount_excluding_tax {\n value\n }\n grand_total {\n value\n currency\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 { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const REQUEST_NEGOTIABLE_QUOTE_MUTATION = `\n mutation REQUEST_NEGOTIABLE_QUOTE_MUTATION(\n $cartId: ID!\n $quoteName: String!\n $comment: NegotiableQuoteCommentInput!\n $isDraft: Boolean\n ) {\n requestNegotiableQuote(\n input: {\n cart_id: $cartId\n quote_name: $quoteName\n comment: $comment\n is_draft: $isDraft\n }\n ) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@adobe-commerce/fetch-graphql';\nimport { events } from '@adobe-commerce/event-bus';\nimport { REQUEST_NEGOTIABLE_QUOTE_MUTATION } from './graphql/RequestNegotiableQuoteMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface RequestNegotiableQuoteInput {\n cartId: string;\n quoteName: string;\n comment: string;\n isDraft?: boolean;\n attachments?: { key: string }[];\n}\n\nexport const requestNegotiableQuote = async (\n input: RequestNegotiableQuoteInput\n): Promise<NegotiableQuoteModel | null> => {\n const { cartId, quoteName, comment, attachments, isDraft } = input;\n\n if (!cartId) {\n throw new Error('Cart ID is required');\n }\n\n if (!quoteName) {\n throw new Error('Quote name is required');\n }\n\n if (!comment) {\n throw new Error('Comment is required');\n }\n\n return fetchGraphQl(REQUEST_NEGOTIABLE_QUOTE_MUTATION, {\n variables: {\n cartId,\n quoteName,\n comment: attachments?.length ? { comment, attachments } : { comment },\n isDraft,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to request negotiable quote: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(response);\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/negotiable-quote-requested', {\n quote: quoteData,\n input: { cartId, quoteName, comment, attachments, isDraft },\n });\n\n return quoteData;\n });\n};\n\nexport const uploadFile = async (file: File): Promise<{ key: string }> => {\n const filename = file?.name;\n if (!file || !filename) throw new Error('Invalid file');\n\n const media_resource_type = 'NEGOTIABLE_QUOTE_ATTACHMENT';\n\n const INITIATE_UPLOAD_MUTATION = `\n mutation INITIATE_UPLOAD_MUTATION(\n $input: initiateUploadInput!\n ){\n initiateUpload(\n input: $input\n ){\n upload_url\n key\n expires_at\n }\n }\n `;\n\n const FINISH_UPLOAD_MUTATION = `\n mutation FINISH_UPLOAD_MUTATION(\n $input: finishUploadInput!\n ){\n finishUpload(\n input: $input\n ){\n success\n key\n message\n }\n }\n `;\n\n try {\n interface GraphQLError { message: string }\n interface InitiateUploadData {\n initiateUpload?: {\n upload_url: string;\n key: string;\n expires_at: string;\n };\n }\n interface FinishUploadData {\n finishUpload?: {\n success: boolean;\n key: string;\n message?: string;\n };\n }\n interface GraphQLResponse<T> {\n data?: T;\n errors?: GraphQLError[];\n }\n\n const formatGraphQLErrors = (errors: GraphQLError[]): string =>\n errors.map((e) => e.message).join('; ');\n\n const { data: initialData, errors: initialErrors } = (await fetchGraphQl(\n INITIATE_UPLOAD_MUTATION,\n {\n variables: { input: { key: filename, media_resource_type } },\n }\n )) as GraphQLResponse<InitiateUploadData>;\n if (initialErrors && initialErrors.length) throw new Error(formatGraphQLErrors(initialErrors));\n\n const { upload_url, key } = initialData?.initiateUpload || {};\n if (!upload_url || !key) throw new Error('Failed to initiate upload');\n\n const put = await fetch(upload_url, { method: 'PUT', body: file });\n if (!put.ok) throw new Error(`Upload failed: ${put.status} ${put.statusText}`);\n\n const { data: finishData, errors: finishErrors } = (await fetchGraphQl(\n FINISH_UPLOAD_MUTATION,\n {\n variables: { input: { key, media_resource_type } },\n }\n )) as GraphQLResponse<FinishUploadData>;\n if (finishErrors && finishErrors.length) throw new Error(formatGraphQLErrors(finishErrors));\n\n const { success, key: finalizedKey, message } = finishData?.finishUpload || {};\n if (!success || !finalizedKey) throw new Error(message || 'Failed to finish upload');\n\n return { key: finalizedKey };\n } catch (err: any) {\n try {\n (events as any)?.emit?.('quote-management/file-upload-error', {\n error: err?.message || 'File upload failed',\n fileName: file?.name,\n });\n } catch {}\n throw err instanceof Error ? err : new Error('File upload failed');\n }\n};\n"],"names":["NEGOTIABLE_QUOTE_FRAGMENT","REQUEST_NEGOTIABLE_QUOTE_MUTATION","requestNegotiableQuote","input","cartId","quoteName","comment","attachments","isDraft","fetchGraphQl","response","errors","errorMessages","error","quoteData","transformQuote","events","uploadFile","file","filename","media_resource_type","INITIATE_UPLOAD_MUTATION","FINISH_UPLOAD_MUTATION","formatGraphQLErrors","e","initialData","initialErrors","upload_url","key","put","finishData","finishErrors","success","finalizedKey","message","err","_b","_a"],"mappings":"6JAiBO,MAAMA,EAA0C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAAC,EAAS,IAAKC,EAAc,QAAAC,IAAYJ,GAAA,YAAAA,EAAY,eAAgB,CAAA,EAC5E,GAAI,CAACE,GAAW,CAACC,QAAoB,IAAI,MAAMC,GAAW,yBAAyB,EAEnF,MAAO,CAAE,IAAKD,CAAA,CAChB,OAASE,EAAU,CACjB,GAAI,EACDC,GAAAC,EAAArB,IAAA,YAAAqB,EAAgB,OAAhB,MAAAD,EAAA,KAAAC,EAAuB,qCAAsC,CAC5D,OAAOF,GAAA,YAAAA,EAAK,UAAW,qBACvB,SAAUjB,GAAA,YAAAA,EAAM,IAAA,EAEpB,MAAQ,CAAC,CACT,MAAMiB,aAAe,MAAQA,EAAM,IAAI,MAAM,oBAAoB,CACnE,CACF"}
1
+ {"version":3,"file":"requestNegotiableQuote.js","sources":["/@dropins/storefront-quote-management/src/api/requestNegotiableQuote/graphql/RequestNegotiableQuoteMutation.ts","/@dropins/storefront-quote-management/src/api/requestNegotiableQuote/requestNegotiableQuote.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\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const REQUEST_NEGOTIABLE_QUOTE_MUTATION = `\n mutation REQUEST_NEGOTIABLE_QUOTE_MUTATION(\n $cartId: ID!\n $quoteName: String!\n $comment: NegotiableQuoteCommentInput!\n $isDraft: Boolean\n ) {\n requestNegotiableQuote(\n input: {\n cart_id: $cartId\n quote_name: $quoteName\n comment: $comment\n is_draft: $isDraft\n }\n ) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@adobe-commerce/fetch-graphql';\nimport { events } from '@adobe-commerce/event-bus';\nimport { REQUEST_NEGOTIABLE_QUOTE_MUTATION } from './graphql/RequestNegotiableQuoteMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface RequestNegotiableQuoteInput {\n cartId: string;\n quoteName: string;\n comment: string;\n isDraft?: boolean;\n}\n\nexport const requestNegotiableQuote = async (\n input: RequestNegotiableQuoteInput\n): Promise<NegotiableQuoteModel | null> => {\n const { cartId, quoteName, comment, isDraft } = input;\n\n if (!cartId) {\n throw new Error('Cart ID is required');\n }\n\n if (!quoteName) {\n throw new Error('Quote name is required');\n }\n\n if (!comment) {\n throw new Error('Comment is required');\n }\n\n return fetchGraphQl(REQUEST_NEGOTIABLE_QUOTE_MUTATION, {\n variables: {\n cartId,\n quoteName,\n comment: {\n comment\n },\n isDraft,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to request negotiable quote: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(response.data?.requestNegotiableQuote?.quote);\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/negotiable-quote-requested', {\n quote: quoteData,\n input: { cartId, quoteName, comment, isDraft },\n });\n\n return quoteData;\n });\n};\n"],"names":["REQUEST_NEGOTIABLE_QUOTE_MUTATION","NEGOTIABLE_QUOTE_FRAGMENT","requestNegotiableQuote","input","cartId","quoteName","comment","isDraft","fetchGraphQl","response","errors","errorMessages","error","quoteData","transformQuote","_b","_a","events"],"mappings":"yMAmBO,MAAMA,EAAoC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAoB7CC,CAAyB;AAAA,ECjBhBC,EAAyB,MACpCC,GACyC,CACzC,KAAM,CAAE,OAAAC,EAAQ,UAAAC,EAAW,QAAAC,EAAS,QAAAC,GAAYJ,EAEhD,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,qBAAqB,EAGvC,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,wBAAwB,EAG1C,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,qBAAqB,EAGvC,OAAOE,EAAaR,EAAmC,CACrD,UAAW,CACT,OAAAI,EACA,UAAAC,EACA,QAAS,CACP,QAAAC,CAAA,EAEF,QAAAC,CAAA,CACF,CACD,EAAE,KAAME,GAAa,SACpB,KAAM,CAAE,OAAAC,GAAWD,EAEnB,GAAIC,EAAQ,CAEV,MAAMC,EAAgBD,EAAO,IAAKE,GAAUA,EAAM,OAAO,EAAE,KAAK,IAAI,EACpE,MAAM,IAAI,MAAM,uCAAuCD,CAAa,EAAE,CACxE,CAGA,MAAME,EAAYC,GAAeC,GAAAC,EAAAP,EAAS,OAAT,YAAAO,EAAe,yBAAf,YAAAD,EAAuC,KAAK,EAE7E,GAAI,CAACF,EACH,MAAM,IAAI,MACR,4DAAA,EAKJ,OAAAI,EAAO,KAAK,8CAA+C,CACzD,MAAOJ,EACP,MAAO,CAAE,OAAAT,EAAQ,UAAAC,EAAW,QAAAC,EAAS,QAAAC,CAAA,CAAQ,CAC9C,EAEMM,CACT,CAAC,CACH"}
@@ -0,0 +1,21 @@
1
+ /*! Copyright 2025 Adobe
2
+ All Rights Reserved. */
3
+ import{fetchGraphQl as E}from"@dropins/tools/fetch-graphql.js";import{events as c}from"@dropins/tools/event-bus.js";import{N as d}from"./NegotiableQuoteFragment.js";import{t as q}from"./transform-quote.js";const I=`
4
+ mutation SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION(
5
+ $quoteUid: ID!
6
+ $comment: NegotiableQuoteCommentInput
7
+ ) {
8
+ sendNegotiableQuoteForReview(
9
+ input: {
10
+ quote_uid: $quoteUid
11
+ comment: $comment
12
+ }
13
+ ) {
14
+ quote {
15
+ ...NegotiableQuoteFragment
16
+ }
17
+ }
18
+ }
19
+ ${d}
20
+ `,w=async u=>{const{quoteUid:e,comment:t}=u;if(!e)throw new Error("Quote UID is required");return E(I,{variables:{quoteUid:e,comment:t?{comment:t}:null}}).then(r=>{var m,i;const{errors:n}=r;if(n){const a=n.map(s=>s.message).join("; ");throw new Error(`Failed to send quote for review: ${a}`)}const o=q((i=(m=r.data)==null?void 0:m.sendNegotiableQuoteForReview)==null?void 0:i.quote);if(!o)throw new Error("Failed to transform quote data: Invalid response structure");return c.emit("quote-management/quote-sent-for-review",{quote:o,input:{quoteUid:e,comment:t}}),o})};export{w as s};
21
+ //# sourceMappingURL=sendForReview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendForReview.js","sources":["/@dropins/storefront-quote-management/src/api/sendForReview/graphql/SendNegotiableQuoteForReviewMutation.ts","/@dropins/storefront-quote-management/src/api/sendForReview/sendForReview.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\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION = `\n mutation SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION(\n $quoteUid: ID!\n $comment: NegotiableQuoteCommentInput\n ) {\n sendNegotiableQuoteForReview(\n input: {\n quote_uid: $quoteUid\n comment: $comment\n }\n ) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@adobe-commerce/fetch-graphql';\nimport { events } from '@adobe-commerce/event-bus';\nimport { SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION } from './graphql/SendNegotiableQuoteForReviewMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface SendForReviewInput {\n quoteUid: string;\n comment?: string;\n}\n\nexport const sendForReview = async (\n input: SendForReviewInput\n): Promise<NegotiableQuoteModel | null> => {\n const { quoteUid, comment } = input;\n\n if (!quoteUid) {\n throw new Error('Quote UID is required');\n }\n\n // Build the comment object only if a comment is provided\n const commentInput = comment ? { comment } : null;\n\n return fetchGraphQl(SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION, {\n variables: {\n quoteUid,\n comment: commentInput,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to send quote for review: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(\n response.data?.sendNegotiableQuoteForReview?.quote\n );\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/quote-sent-for-review', {\n quote: quoteData,\n input: { quoteUid, comment },\n });\n\n return quoteData;\n });\n};\n\n"],"names":["SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION","NEGOTIABLE_QUOTE_FRAGMENT","sendForReview","input","quoteUid","comment","fetchGraphQl","response","errors","errorMessages","error","quoteData","transformQuote","_b","_a","events"],"mappings":"8MAmBO,MAAMA,EAA4C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBrDC,CAAyB;AAAA,ECfhBC,EAAgB,MAC3BC,GACyC,CACzC,KAAM,CAAE,SAAAC,EAAU,QAAAC,CAAA,EAAYF,EAE9B,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,uBAAuB,EAMzC,OAAOE,EAAaN,EAA2C,CAC7D,UAAW,CACT,SAAAI,EACA,QALiBC,EAAU,CAAE,QAAAA,CAAA,EAAY,IAKhC,CACX,CACD,EAAE,KAAME,GAAa,SACpB,KAAM,CAAE,OAAAC,GAAWD,EAEnB,GAAIC,EAAQ,CAEV,MAAMC,EAAgBD,EAAO,IAAKE,GAAUA,EAAM,OAAO,EAAE,KAAK,IAAI,EACpE,MAAM,IAAI,MAAM,oCAAoCD,CAAa,EAAE,CACrE,CAGA,MAAME,EAAYC,GAChBC,GAAAC,EAAAP,EAAS,OAAT,YAAAO,EAAe,+BAAf,YAAAD,EAA6C,KAAA,EAG/C,GAAI,CAACF,EACH,MAAM,IAAI,MACR,4DAAA,EAKJ,OAAAI,EAAO,KAAK,yCAA0C,CACpD,MAAOJ,EACP,MAAO,CAAE,SAAAP,EAAU,QAAAC,CAAA,CAAQ,CAC5B,EAEMM,CACT,CAAC,CACH"}
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- const u={requestQuote:!1,editQuote:!1,deleteQuote:!1},c={authenticated:!1,permissions:u},p=new Proxy(c,{get:(t,a)=>t[a],set:(t,a,n)=>(t[a]=n,!0)});function s(t){var a,n;return{uid:t.uid,name:t.name,createdAt:t.created_at,updatedAt:t.updated_at,status:t.status,buyer:{firstname:t.buyer.firstname,lastname:t.buyer.lastname},templateName:t.template_name,comments:(a=t.comments)==null?void 0:a.map(e=>{const r={uid:e.uid,createdAt:e.created_at,author:{firstname:e.author.firstname,lastname:e.author.lastname}};return Array.isArray(e.attachments)&&e.attachments.length>0&&(r.attachments=e.attachments.map(i=>({name:i.name,url:i.url}))),r}),prices:t.prices&&{subtotalExcludingTax:t.prices.subtotal_excluding_tax&&{value:t.prices.subtotal_excluding_tax.value},subtotalIncludingTax:t.prices.subtotal_including_tax&&{value:t.prices.subtotal_including_tax.value},subtotalWithDiscountExcludingTax:t.prices.subtotal_with_discount_excluding_tax&&{value:t.prices.subtotal_with_discount_excluding_tax.value},grandTotal:t.prices.grand_total&&{value:t.prices.grand_total.value,currency:t.prices.grand_total.currency}},items:(n=t.items)==null?void 0:n.map(e=>({product:{uid:e.product.uid,sku:e.product.sku,name:e.product.name,templateId:e.product.template_id,templateName:e.product.template_name,priceRange:{maximumPrice:{regularPrice:{value:e.product.price_range.maximum_price.regular_price.value}}}},quantity:e.quantity}))}}function g(t){if(!t||!t.data||!t.data.requestNegotiableQuote)return null;const a=t.data.requestNegotiableQuote.quote;return s(a)}function _(t){var e;if(!t)return null;const a={items:((e=t.items)==null?void 0:e.filter(r=>r==null?void 0:r.uid).map(s))||[],pageInfo:{currentPage:t.page_info.current_page,pageSize:t.page_info.page_size,totalPages:t.page_info.total_pages},totalCount:t.total_count,sortFields:t.sort_fields?{default:t.sort_fields.default,options:t.sort_fields.options}:void 0},n=o(a);return{...a,paginationInfo:n||void 0}}function o(t){if(!(t!=null&&t.pageInfo)||!t.totalCount)return null;const{currentPage:a,pageSize:n,totalPages:e}=t.pageInfo,{totalCount:r}=t,i=r>0?(a-1)*n+1:0,l=Math.min(a*n,r);return{currentPage:a,totalCount:r,pageSize:n,startItem:i,endItem:l,totalPages:e,pageSizeOptions:[20,30,50,100,200]}}const m=()=>[20,30,50,100,200];export{u as D,_ as a,m as g,p as s,g as t};
3
+ const f={requestQuote:!1,editQuote:!1,deleteQuote:!1,checkoutQuote:!1},y={authenticated:!1,permissions:f},g=new Proxy(y,{get:(e,a)=>e[a],set:(e,a,r)=>(e[a]=r,!0)});var p=(e=>(e.NEW="NEW",e.SUBMITTED="SUBMITTED",e.PENDING="PENDING",e.UPDATED="UPDATED",e.OPEN="OPEN",e.ORDERED="ORDERED",e.CLOSED="CLOSED",e.DECLINED="DECLINED",e.EXPIRED="EXPIRED",e.DRAFT="DRAFT",e))(p||{});function E(e){var r,t,c,u;const a=m(e);return{uid:e.uid,name:e.name,createdAt:e.created_at,updatedAt:e.updated_at,expirationDate:e.expiration_date,status:a?p.NEW:e.status,salesRepName:e.sales_rep_name,buyer:{firstname:e.buyer.firstname,lastname:e.buyer.lastname},templateName:e.template_name,comments:(r=e.comments)==null?void 0:r.map(n=>({uid:n.uid,createdAt:n.created_at,author:{firstname:n.author.firstname,lastname:n.author.lastname}})),prices:e.prices&&{subtotalExcludingTax:e.prices.subtotal_excluding_tax&&{value:e.prices.subtotal_excluding_tax.value,currency:e.prices.subtotal_excluding_tax.currency},subtotalIncludingTax:e.prices.subtotal_including_tax&&{value:e.prices.subtotal_including_tax.value,currency:e.prices.subtotal_including_tax.currency},subtotalWithDiscountExcludingTax:e.prices.subtotal_with_discount_excluding_tax&&{value:e.prices.subtotal_with_discount_excluding_tax.value,currency:e.prices.subtotal_with_discount_excluding_tax.currency},appliedTaxes:(t=e.prices.applied_taxes)==null?void 0:t.map(n=>({amount:{value:n.amount.value,currency:n.amount.currency},label:n.label})),grandTotal:e.prices.grand_total&&{value:e.prices.grand_total.value,currency:e.prices.grand_total.currency}},items:((c=e.items)==null?void 0:c.map(n=>{var l,o,_,d;return{product:{uid:n.product.uid,sku:n.product.sku,name:n.product.name},catalogDiscount:{amountOff:n.prices.catalog_discount.amount_off,percentOff:n.prices.catalog_discount.percent_off},discounts:((o=(l=n.prices)==null?void 0:l.discounts)==null?void 0:o.map(i=>({label:i.label,value:i.value,amount:{value:i.amount.value,currency:i.amount.currency}})))??[],stockStatus:n.product.stock_status,quantity:n.quantity,prices:{originalItemPrice:{value:n.prices.original_item_price.value,currency:n.prices.original_item_price.currency},rowTotal:{value:n.prices.row_total.value,currency:n.prices.row_total.currency}},configurableOptions:(_=n.configurable_options)==null?void 0:_.map(i=>({optionLabel:i.option_label,valueLabel:i.value_label})),bundleOptions:(d=n.bundle_options)==null?void 0:d.map(i=>({label:i.label,values:i.values.map(s=>({label:s.label,quantity:s.quantity,originalPrice:{value:s.original_price.value,currency:s.original_price.currency},price:{value:s.priceV2.value,currency:s.priceV2.currency}}))}))}}))||[],shippingAddresses:(u=e.shipping_addresses)==null?void 0:u.map(n=>{const l={uid:n.uid,firstname:n.firstname,lastname:n.lastname,company:n.company,street:n.street,city:n.city,postcode:n.postcode,country:{code:n.country.code,label:n.country.label},telephone:n.telephone};return n.region&&(l.region={code:n.region.code,label:n.region.label,regionId:n.region.region_id}),l}),canCheckout:["UPDATED","DECLINED"].includes(e.status)&&g.permissions.checkoutQuote,canSendForReview:(a||["DRAFT","UPDATED","DECLINED","EXPIRED","OPEN"].includes(e.status))&&g.permissions.editQuote}}function D(e){return e?E(e):null}function m(e){return e.status==="SUBMITTED"&&!(e.history??[]).some(a=>{var r,t;return a.change_type==="UPDATED"&&(((t=(r=a.changes)==null?void 0:r.statuses)==null?void 0:t.changes)??[]).length>0})}function b(e){const a=m(e);return{uid:e.uid,name:e.name,createdAt:e.created_at,updatedAt:e.updated_at,status:a?p.NEW:e.status,buyer:{firstname:e.buyer.firstname,lastname:e.buyer.lastname},templateName:e.template_name,prices:{grandTotal:{value:e.prices.grand_total.value,currency:e.prices.grand_total.currency}}}}function I(e){var t;if(!e)return null;const a={items:((t=e.items)==null?void 0:t.filter(c=>c==null?void 0:c.uid).map(b))||[],pageInfo:{currentPage:e.page_info.current_page,pageSize:e.page_info.page_size,totalPages:e.page_info.total_pages},totalCount:e.total_count,sortFields:e.sort_fields?{default:e.sort_fields.default,options:e.sort_fields.options}:void 0},r=v(a);return{...a,paginationInfo:r||void 0}}function v(e){if(!(e!=null&&e.pageInfo)||!e.totalCount)return null;const{currentPage:a,pageSize:r,totalPages:t}=e.pageInfo,{totalCount:c}=e,u=c>0?(a-1)*r+1:0,n=Math.min(a*r,c);return{currentPage:a,totalCount:c,pageSize:r,startItem:u,endItem:n,totalPages:t,pageSizeOptions:[20,30,50,100,200]}}const x=()=>[20,30,50,100,200];export{f as D,I as a,x as g,g as s,D as t};
4
4
  //# sourceMappingURL=transform-quote.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transform-quote.js","sources":["/@dropins/storefront-quote-management/src/lib/state.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-quote.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { State } from '../types/state.types';\n\nexport const DEFAULT_PERMISSIONS = {\n requestQuote: false,\n editQuote: false,\n deleteQuote: false,\n};\n\nconst _state: State = {\n authenticated: false,\n permissions: DEFAULT_PERMISSIONS,\n}\n\n// Proxy state to make it reactive\nexport const state = new Proxy(_state, {\n get: (target, key) => {\n return target[key as keyof State];\n },\n set: (target, key, value) => {\n target[key as keyof State] = value;\n return true;\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 *******************************************************************/\nimport {\n NegotiableQuoteModel,\n NegotiableQuotesListModel,\n PaginationInfo,\n} from '@/quote-management/data/models/negotiable-quote-model';\n\n// Base helper that transforms a single quote object directly\nfunction transformSingleQuote(quote: any): NegotiableQuoteModel {\n return {\n uid: quote.uid,\n name: quote.name,\n createdAt: quote.created_at,\n updatedAt: quote.updated_at,\n status: quote.status,\n buyer: {\n firstname: quote.buyer.firstname,\n lastname: quote.buyer.lastname,\n },\n templateName: quote.template_name,\n comments: quote.comments?.map((comment: any) => {\n const baseComment: any = {\n uid: comment.uid,\n createdAt: comment.created_at,\n author: {\n firstname: comment.author.firstname,\n lastname: comment.author.lastname,\n },\n };\n\n if (Array.isArray(comment.attachments) && comment.attachments.length > 0) {\n baseComment.attachments = comment.attachments.map((a: any) => ({\n name: a.name,\n url: a.url,\n }));\n }\n\n return baseComment;\n }),\n prices: quote.prices && {\n subtotalExcludingTax: quote.prices.subtotal_excluding_tax && {\n value: quote.prices.subtotal_excluding_tax.value,\n },\n subtotalIncludingTax: quote.prices.subtotal_including_tax && {\n value: quote.prices.subtotal_including_tax.value,\n },\n subtotalWithDiscountExcludingTax: quote.prices\n .subtotal_with_discount_excluding_tax && {\n value: quote.prices.subtotal_with_discount_excluding_tax.value,\n },\n grandTotal: quote.prices.grand_total && {\n value: quote.prices.grand_total.value,\n currency: quote.prices.grand_total.currency,\n },\n },\n items: quote.items?.map((item: any) => ({\n product: {\n uid: item.product.uid,\n sku: item.product.sku,\n name: item.product.name,\n templateId: item.product.template_id,\n templateName: item.product.template_name,\n priceRange: {\n maximumPrice: {\n regularPrice: {\n value: item.product.price_range.maximum_price.regular_price.value,\n },\n },\n },\n },\n quantity: item.quantity,\n })),\n };\n}\n\nexport function transformQuote(quoteData: any): NegotiableQuoteModel | null {\n if (!quoteData || !quoteData.data || !quoteData.data.requestNegotiableQuote) {\n return null;\n }\n\n const quote = quoteData.data.requestNegotiableQuote.quote;\n return transformSingleQuote(quote);\n}\n\nexport function transformNegotiableQuotesList(\n quotesData: any\n): NegotiableQuotesListModel | null {\n if (!quotesData) {\n return null;\n }\n\n const transformedModel = {\n items:\n quotesData.items\n ?.filter((quote: any) => quote?.uid)\n .map(transformSingleQuote) || [],\n pageInfo: {\n currentPage: quotesData.page_info.current_page,\n pageSize: quotesData.page_info.page_size,\n totalPages: quotesData.page_info.total_pages,\n },\n totalCount: quotesData.total_count,\n sortFields: quotesData.sort_fields\n ? {\n default: quotesData.sort_fields.default,\n options: quotesData.sort_fields.options,\n }\n : undefined,\n };\n\n // Calculate pagination info\n const paginationInfo = transformPaginationInfo(transformedModel);\n\n return {\n ...transformedModel,\n paginationInfo: paginationInfo || undefined,\n };\n}\n\nexport function transformPaginationInfo(\n quotesData: NegotiableQuotesListModel | null\n): PaginationInfo | null {\n if (!quotesData?.pageInfo || !quotesData.totalCount) {\n return null;\n }\n\n const { currentPage, pageSize, totalPages } = quotesData.pageInfo;\n const { totalCount } = quotesData;\n\n const startItem = totalCount > 0 ? (currentPage - 1) * pageSize + 1 : 0;\n const endItem = Math.min(currentPage * pageSize, totalCount);\n\n const pageSizeOptions = [20, 30, 50, 100, 200]; // Default page size options\n\n return {\n currentPage,\n totalCount,\n pageSize,\n startItem,\n endItem,\n totalPages,\n pageSizeOptions,\n };\n}\n\n// TODO: Check if admin has this configuration\nexport const getDefaultPageSizeOptions = () => [20, 30, 50, 100, 200];\n"],"names":["DEFAULT_PERMISSIONS","_state","state","target","key","value","transformSingleQuote","quote","_a","_b","comment","baseComment","a","item","transformQuote","quoteData","transformNegotiableQuotesList","quotesData","transformedModel","paginationInfo","transformPaginationInfo","currentPage","pageSize","totalPages","totalCount","startItem","endItem","getDefaultPageSizeOptions"],"mappings":"AAWO,MAAMA,EAAsB,CAC/B,aAAc,GACd,UAAW,GACX,YAAa,EACjB,EAEMC,EAAgB,CAClB,cAAe,GACf,YAAaD,CACjB,EAGaE,EAAQ,IAAI,MAAMD,EAAQ,CACnC,IAAK,CAACE,EAAQC,IACHD,EAAOC,CAAkB,EAEpC,IAAK,CAACD,EAAQC,EAAKC,KACfF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EJ,CAGO,MAAMI,EAA4B,IAAM,CAAC,GAAI,GAAI,GAAI,IAAK,GAAG"}
1
+ {"version":3,"file":"transform-quote.js","sources":["/@dropins/storefront-quote-management/src/lib/state.ts","/@dropins/storefront-quote-management/src/data/models/negotiable-quote-model.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-quote.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { State } from '../types/state.types';\n\nexport const DEFAULT_PERMISSIONS = {\n requestQuote: false,\n editQuote: false,\n deleteQuote: false,\n checkoutQuote: false,\n};\n\nconst _state: State = {\n authenticated: false,\n permissions: DEFAULT_PERMISSIONS,\n}\n\n// Proxy state to make it reactive\nexport const state = new Proxy(_state, {\n get: (target, key) => {\n return target[key as keyof State];\n },\n set: (target, key, value) => {\n target[key as keyof State] = value;\n return true;\n }\n})","export interface ShippingAddress {\n /**\n * The unique string identifier of the address\n */\n uid?: string;\n firstname: string;\n lastname: string;\n company?: string;\n street: string[];\n city: string;\n region?: {\n code: string;\n label: string;\n regionId: number;\n };\n postcode: string;\n country: {\n code: string;\n label: string;\n };\n telephone: string;\n}\n\nexport interface NegotiableQuoteModel {\n uid: string;\n name: string;\n createdAt: string;\n salesRepName: string;\n expirationDate: string;\n updatedAt: string;\n status: NegotiableQuoteStatus;\n buyer: {\n firstname: string;\n lastname: string;\n };\n templateName?: string;\n comments?: {\n uid: string;\n createdAt: string;\n author: {\n firstname: string;\n lastname: string;\n };\n }[];\n prices: {\n subtotalExcludingTax?: Currency;\n subtotalIncludingTax?: Currency;\n subtotalWithDiscountExcludingTax?: Currency;\n grandTotal?: Currency;\n appliedTaxes?: {\n amount: Currency;\n label: string;\n }[];\n };\n items: NegotiableQuoteCartItem[];\n shippingAddresses?: ShippingAddress[];\n canCheckout: boolean;\n canSendForReview: boolean;\n}\n\nexport interface NegotiableQuoteCartItem {\n product: {\n uid: string;\n sku: string;\n name: string;\n templateId?: string;\n templateName?: string;\n priceRange: {\n maximumPrice: {\n regularPrice: {\n value: number;\n };\n };\n };\n };\n catalogDiscount: {\n amountOff: number;\n percentOff: number;\n };\n discounts: {\n label: string;\n value: string;\n amount: Currency;\n }[];\n stockStatus: string;\n quantity: number;\n prices: {\n originalItemPrice: Currency;\n rowTotal: Currency;\n };\n configurableOptions?: {\n optionLabel: string;\n valueLabel: string;\n }[];\n bundleOptions?: {\n label: string;\n values: {\n label: string;\n quantity: number;\n originalPrice: Currency;\n price: Currency;\n }[];\n }[];\n};\n\n\nexport interface Currency {\n value: number;\n currency: string;\n}\n\nexport interface NegotiableQuoteListEntry {\n uid: string;\n name: string;\n createdAt: string;\n updatedAt: string;\n status: NegotiableQuoteStatus;\n buyer: {\n firstname: string;\n lastname: string;\n };\n templateName: string;\n prices: {\n grandTotal: Currency;\n };\n}\nexport interface NegotiableQuotesListModel {\n items: NegotiableQuoteListEntry[];\n pageInfo: {\n currentPage: number;\n pageSize: number;\n totalPages: number;\n };\n totalCount: number;\n paginationInfo?: PaginationInfo;\n sortFields?: {\n default: string;\n options: Array<{\n label: string;\n value: string;\n }>;\n };\n}\n\n// See: https://experienceleague.adobe.com/en/docs/commerce-admin/b2b/quotes/quotes#quote-status\nexport enum NegotiableQuoteStatus {\n NEW = 'NEW', // Currently not returned by the API, but is used to indicate a new quote\n SUBMITTED = 'SUBMITTED',\n PENDING = 'PENDING',\n UPDATED = 'UPDATED',\n OPEN = 'OPEN',\n ORDERED = 'ORDERED',\n CLOSED = 'CLOSED',\n DECLINED = 'DECLINED',\n EXPIRED = 'EXPIRED',\n DRAFT = 'DRAFT',\n}\n\nexport interface PaginationInfo {\n currentPage: number;\n totalCount: number;\n pageSize: number;\n startItem: number;\n endItem: number;\n totalPages: number;\n pageSizeOptions?: number[];\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 *******************************************************************/\nimport {\n NegotiableQuoteListEntry,\n NegotiableQuoteModel,\n NegotiableQuotesListModel,\n NegotiableQuoteStatus,\n PaginationInfo,\n ShippingAddress,\n} from '@/quote-management/data/models/negotiable-quote-model';\nimport { state } from '@/quote-management/lib/state';\n\n// Base helper that transforms a single quote object directly\nfunction transformSingleQuote(quote: any): NegotiableQuoteModel {\n const isQuoteNew = isNewQuote(quote);\n return {\n uid: quote.uid,\n name: quote.name,\n createdAt: quote.created_at,\n updatedAt: quote.updated_at,\n expirationDate: quote.expiration_date,\n status: isQuoteNew ? NegotiableQuoteStatus.NEW : quote.status,\n salesRepName: quote.sales_rep_name,\n buyer: {\n firstname: quote.buyer.firstname,\n lastname: quote.buyer.lastname,\n },\n templateName: quote.template_name,\n comments: quote.comments?.map((comment: any) => ({\n uid: comment.uid,\n createdAt: comment.created_at,\n author: {\n firstname: comment.author.firstname,\n lastname: comment.author.lastname,\n },\n })),\n prices: quote.prices && {\n subtotalExcludingTax: quote.prices.subtotal_excluding_tax && {\n value: quote.prices.subtotal_excluding_tax.value,\n currency: quote.prices.subtotal_excluding_tax.currency,\n },\n subtotalIncludingTax: quote.prices.subtotal_including_tax && {\n value: quote.prices.subtotal_including_tax.value,\n currency: quote.prices.subtotal_including_tax.currency,\n },\n subtotalWithDiscountExcludingTax: quote.prices\n .subtotal_with_discount_excluding_tax && {\n value: quote.prices.subtotal_with_discount_excluding_tax.value,\n currency: quote.prices.subtotal_with_discount_excluding_tax.currency,\n },\n appliedTaxes: quote.prices.applied_taxes?.map((tax: any) => ({\n amount: { value: tax.amount.value, currency: tax.amount.currency },\n label: tax.label,\n })),\n grandTotal: quote.prices.grand_total && {\n value: quote.prices.grand_total.value,\n currency: quote.prices.grand_total.currency,\n },\n },\n items: quote.items?.map((item: any) => ({\n product: {\n uid: item.product.uid,\n sku: item.product.sku,\n name: item.product.name,\n },\n catalogDiscount: {\n amountOff: item.prices.catalog_discount.amount_off,\n percentOff: item.prices.catalog_discount.percent_off,\n },\n discounts: item.prices?.discounts?.map((discount: any) => ({\n label: discount.label,\n value: discount.value,\n amount: { value: discount.amount.value, currency: discount.amount.currency },\n })) ?? [],\n stockStatus: item.product.stock_status,\n quantity: item.quantity,\n prices: {\n originalItemPrice: {\n value: item.prices.original_item_price.value,\n currency: item.prices.original_item_price.currency,\n },\n rowTotal: {\n value: item.prices.row_total.value,\n currency: item.prices.row_total.currency,\n },\n },\n configurableOptions: item.configurable_options?.map((option: any) => ({\n optionLabel: option.option_label,\n valueLabel: option.value_label,\n })),\n bundleOptions: item.bundle_options?.map((option: any) => ({\n label: option.label,\n values: option.values.map((value: any) => ({\n label: value.label,\n quantity: value.quantity,\n originalPrice: {\n value: value.original_price.value,\n currency: value.original_price.currency,\n },\n price: {\n value: value.priceV2.value,\n currency: value.priceV2.currency,\n },\n })),\n })),\n })) || [],\n shippingAddresses: quote.shipping_addresses?.map((address: any) => {\n const shippingAddress: ShippingAddress = {\n uid: address.uid,\n firstname: address.firstname,\n lastname: address.lastname,\n company: address.company,\n street: address.street,\n city: address.city,\n postcode: address.postcode,\n country: {\n code: address.country.code,\n label: address.country.label,\n },\n telephone: address.telephone,\n };\n \n if (address.region) {\n shippingAddress.region = {\n code: address.region.code,\n label: address.region.label,\n regionId: address.region.region_id,\n };\n }\n \n return shippingAddress;\n }),\n canCheckout: ['UPDATED', 'DECLINED'].includes(quote.status) && state.permissions.checkoutQuote,\n canSendForReview: \n ( isQuoteNew || ['DRAFT', 'UPDATED', 'DECLINED', 'EXPIRED', 'OPEN'].includes(quote.status) ) && \n state.permissions.editQuote,\n };\n}\n\nexport function transformQuote(quoteData: any): NegotiableQuoteModel | null {\n if (!quoteData) {\n return null;\n }\n\n return transformSingleQuote(quoteData);\n}\n\n// quote is new if it has a status of SUBMITTED and there is no history entry that\n// has a change_type of UPDATED with a non-empty array of status changes\nfunction isNewQuote(quote: any): boolean {\n return quote.status === 'SUBMITTED' &&\n !((quote.history ?? []).some((history: any) =>\n history.change_type === 'UPDATED' &&\n ((history.changes?.statuses?.changes ?? []).length > 0)\n ));\n}\n\nfunction transformNegotiableQuoteListEntry(quote: any): NegotiableQuoteListEntry {\n const isQuoteNew = isNewQuote(quote);\n return {\n uid: quote.uid,\n name: quote.name,\n createdAt: quote.created_at,\n updatedAt: quote.updated_at,\n status: isQuoteNew ? NegotiableQuoteStatus.NEW : quote.status,\n buyer: {\n firstname: quote.buyer.firstname,\n lastname: quote.buyer.lastname,\n },\n templateName: quote.template_name,\n prices: {\n grandTotal: {\n value: quote.prices.grand_total.value,\n currency: quote.prices.grand_total.currency,\n },\n },\n };\n}\n\nexport function transformNegotiableQuotesList(\n quotesData: any\n): NegotiableQuotesListModel | null {\n if (!quotesData) {\n return null;\n }\n\n const transformedModel = {\n items:\n quotesData.items\n ?.filter((quote: any) => quote?.uid)\n .map(transformNegotiableQuoteListEntry) || [],\n pageInfo: {\n currentPage: quotesData.page_info.current_page,\n pageSize: quotesData.page_info.page_size,\n totalPages: quotesData.page_info.total_pages,\n },\n totalCount: quotesData.total_count,\n sortFields: quotesData.sort_fields\n ? {\n default: quotesData.sort_fields.default,\n options: quotesData.sort_fields.options,\n }\n : undefined,\n };\n\n // Calculate pagination info\n const paginationInfo = transformPaginationInfo(transformedModel);\n\n return {\n ...transformedModel,\n paginationInfo: paginationInfo || undefined,\n };\n}\n\nexport function transformPaginationInfo(\n quotesData: NegotiableQuotesListModel | null\n): PaginationInfo | null {\n if (!quotesData?.pageInfo || !quotesData.totalCount) {\n return null;\n }\n\n const { currentPage, pageSize, totalPages } = quotesData.pageInfo;\n const { totalCount } = quotesData;\n\n const startItem = totalCount > 0 ? (currentPage - 1) * pageSize + 1 : 0;\n const endItem = Math.min(currentPage * pageSize, totalCount);\n\n const pageSizeOptions = [20, 30, 50, 100, 200]; // Default page size options\n\n return {\n currentPage,\n totalCount,\n pageSize,\n startItem,\n endItem,\n totalPages,\n pageSizeOptions,\n };\n}\n\n// TODO: Check if admin has this configuration\nexport const getDefaultPageSizeOptions = () => [20, 30, 50, 100, 200];\n"],"names":["DEFAULT_PERMISSIONS","_state","state","target","key","value","NegotiableQuoteStatus","transformSingleQuote","quote","_a","_b","_c","_d","isQuoteNew","isNewQuote","comment","tax","item","discount","option","address","shippingAddress","transformQuote","quoteData","history","transformNegotiableQuoteListEntry","transformNegotiableQuotesList","quotesData","transformedModel","paginationInfo","transformPaginationInfo","currentPage","pageSize","totalPages","totalCount","startItem","endItem","getDefaultPageSizeOptions"],"mappings":"AAWO,MAAMA,EAAsB,CAC/B,aAAc,GACd,UAAW,GACX,YAAa,GACb,cAAe,EACnB,EAEMC,EAAgB,CAClB,cAAe,GACf,YAAaD,CACjB,EAGaE,EAAQ,IAAI,MAAMD,EAAQ,CACnC,IAAK,CAACE,EAAQC,IACHD,EAAOC,CAAkB,EAEpC,IAAK,CAACD,EAAQC,EAAKC,KACfF,EAAOC,CAAkB,EAAIC,EACtB,GAEf,CAAC,ECiHM,IAAKC,GAAAA,IACVA,EAAA,IAAM,MACNA,EAAA,UAAY,YACZA,EAAA,QAAU,UACVA,EAAA,QAAU,UACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,MAAQ,QAVEA,IAAAA,GAAA,CAAA,CAAA,ECtHZ,SAASC,EAAqBC,EAAkC,CFhBzD,IAAAC,EAAAC,EAAAC,EAAAC,EEiBL,MAAMC,EAAaC,EAAWN,CAAK,EACnC,MAAO,CACL,IAAKA,EAAM,IACX,KAAMA,EAAM,KACZ,UAAWA,EAAM,WACjB,UAAWA,EAAM,WACjB,eAAgBA,EAAM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B,IAAIiB,KAAsC,CAAA,EAC/C,SAAU,CACR,YAAaE,EAAW,UAAU,aAClC,SAAUA,EAAW,UAAU,UAC/B,WAAYA,EAAW,UAAU,WAAA,EAEnC,WAAYA,EAAW,YACvB,WAAYA,EAAW,YACnB,CACE,QAASA,EAAW,YAAY,QAChC,QAASA,EAAW,YAAY,OAAA,EAElC,MAAA,EAIAE,EAAiBC,EAAwBF,CAAgB,EAE/D,MAAO,CACL,GAAGA,EACH,eAAgBC,GAAkB,MAAA,CAEtC,CAEO,SAASC,EACdH,EACuB,CACvB,GAAI,EAACA,GAAA,MAAAA,EAAY,WAAY,CAACA,EAAW,WACvC,OAAO,KAGT,KAAM,CAAE,YAAAI,EAAa,SAAAC,EAAU,WAAAC,CAAA,EAAeN,EAAW,SACnD,CAAE,WAAAO,GAAeP,EAEjBQ,EAAYD,EAAa,GAAKH,EAAc,GAAKC,EAAW,EAAI,EAChEI,EAAU,KAAK,IAAIL,EAAcC,EAAUE,CAAU,EAI3D,MAAO,CACL,YAAAH,EACA,WAAAG,EACA,SAAAF,EACA,UAAAG,EACA,QAAAC,EACA,WAAAH,EACA,gBATsB,CAAC,GAAI,GAAI,GAAI,IAAK,GAAG,CAS3C,CAEJ,CAGO,MAAMI,EAA4B,IAAM,CAAC,GAAI,GAAI,GAAI,IAAK,GAAG"}
@@ -0,0 +1,14 @@
1
+ import { FunctionComponent, VNode } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ export interface ActionsBarProps extends HTMLAttributes<HTMLDivElement> {
5
+ dropdownPlaceholder?: string;
6
+ dropdownOptions?: {
7
+ label: string;
8
+ value: string;
9
+ }[];
10
+ handleDropdownChange?: (event: Event) => void;
11
+ buttons?: VNode[];
12
+ }
13
+ export declare const ActionsBar: FunctionComponent<ActionsBarProps>;
14
+ //# sourceMappingURL=ActionsBar.d.ts.map
@@ -0,0 +1,11 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
9
+ export * from './ActionsBar';
10
+ export { ActionsBar as default } from './ActionsBar';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { FunctionComponent, VNode } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ export interface ItemsQuotedProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
5
+ loading?: boolean;
6
+ table?: VNode;
7
+ pricesSummary?: VNode;
8
+ }
9
+ export declare const ItemsQuoted: FunctionComponent<ItemsQuotedProps>;
10
+ export declare const ItemsQuotedSkeleton: FunctionComponent;
11
+ //# sourceMappingURL=ItemsQuoted.d.ts.map
@@ -0,0 +1,11 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
9
+ export * from './ItemsQuoted';
10
+ export { ItemsQuoted as default } from './ItemsQuoted';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,20 @@
1
+ import { FunctionComponent, VNode } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ export interface ManageNegotiableQuoteProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
5
+ loading?: boolean;
6
+ quoteName: VNode;
7
+ quoteStatus: VNode;
8
+ banner?: VNode;
9
+ details: VNode;
10
+ actionBar?: VNode;
11
+ quoteContent: VNode;
12
+ shippingInformationTitle: VNode;
13
+ shippingInformation: VNode;
14
+ quoteCommentsTitle: VNode;
15
+ quoteComments: VNode;
16
+ footer: VNode;
17
+ }
18
+ export declare const ManageNegotiableQuote: FunctionComponent<ManageNegotiableQuoteProps>;
19
+ export declare const ManageNegotiableQuoteSkeleton: FunctionComponent;
20
+ //# sourceMappingURL=ManageNegotiableQuote.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { ManageNegotiableQuoteProps } from '../ManageNegotiableQuote';
2
+
3
+ export declare const baseProps: ManageNegotiableQuoteProps;
4
+ //# sourceMappingURL=ManageNegotiableQuoteProps.d.ts.map
@@ -0,0 +1,11 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
9
+ export * from './ManageNegotiableQuote';
10
+ export { ManageNegotiableQuote as default } from './ManageNegotiableQuote';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,67 @@
1
+ import { FunctionComponent, VNode } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+ import { JSXInternal } from 'preact/src/jsx';
4
+
5
+ export interface OrderSummaryLineItem {
6
+ key: string;
7
+ title?: string;
8
+ className?: string;
9
+ sortOrder: number;
10
+ content: string | JSXInternal.Element | VNode<HTMLAttributes<HTMLDivElement>> | OrderSummaryLineItem[] | undefined;
11
+ }
12
+ export interface OrderSummaryProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
13
+ variant?: 'primary' | 'secondary';
14
+ heading?: VNode<HTMLAttributes<HTMLDivElement>>;
15
+ loading?: boolean;
16
+ subTotal?: {
17
+ price: VNode<HTMLAttributes<HTMLSpanElement>>;
18
+ priceExcludingTax?: VNode<HTMLAttributes<HTMLSpanElement>>;
19
+ taxIncluded?: boolean;
20
+ taxExcluded?: boolean;
21
+ zeroTaxSubtotal?: boolean;
22
+ };
23
+ shipping?: VNode<HTMLAttributes<HTMLDivElement>>;
24
+ discounts?: {
25
+ label: string;
26
+ price: VNode<HTMLAttributes<HTMLSpanElement>>;
27
+ caption?: VNode<HTMLAttributes<HTMLDivElement>>;
28
+ coupon?: VNode<HTMLAttributes<HTMLSpanElement>>;
29
+ }[];
30
+ taxTotal?: {
31
+ price: VNode<HTMLAttributes<HTMLSpanElement>>;
32
+ };
33
+ taxesApplied?: {
34
+ label: string;
35
+ price: VNode<HTMLAttributes<HTMLSpanElement>>;
36
+ }[];
37
+ total?: {
38
+ price: VNode<HTMLAttributes<HTMLSpanElement>>;
39
+ priceWithoutTax?: VNode<HTMLAttributes<HTMLSpanElement>>;
40
+ };
41
+ printedCard?: {
42
+ renderContent: boolean;
43
+ taxIncluded: boolean;
44
+ taxInclAndExcl: boolean;
45
+ priceExclTax: VNode<HTMLAttributes<HTMLSpanElement>>;
46
+ priceInclTax: VNode<HTMLAttributes<HTMLSpanElement>>;
47
+ };
48
+ itemsGiftWrapping?: {
49
+ renderContent: boolean;
50
+ taxIncluded: boolean;
51
+ taxInclAndExcl: boolean;
52
+ priceExclTax: VNode<HTMLAttributes<HTMLSpanElement>>;
53
+ priceInclTax: VNode<HTMLAttributes<HTMLSpanElement>>;
54
+ };
55
+ orderGiftWrapping?: {
56
+ renderContent: boolean;
57
+ taxIncluded: boolean;
58
+ taxInclAndExcl: boolean;
59
+ priceExclTax: VNode<HTMLAttributes<HTMLSpanElement>>;
60
+ priceInclTax: VNode<HTMLAttributes<HTMLSpanElement>>;
61
+ };
62
+ primaryAction?: VNode<HTMLAttributes<HTMLButtonElement>>;
63
+ totalSaved?: VNode<HTMLAttributes<HTMLSpanElement>>;
64
+ updateLineItems?: (lineItems: Array<OrderSummaryLineItem>) => Array<OrderSummaryLineItem>;
65
+ }
66
+ export declare const OrderSummary: FunctionComponent<OrderSummaryProps>;
67
+ //# sourceMappingURL=OrderSummary.d.ts.map
@@ -0,0 +1,11 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
9
+ export * from './OrderSummary';
10
+ export { OrderSummary as default } from './OrderSummary';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { FunctionComponent, VNode } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ export interface OrderSummaryLineComponentProps extends Omit<HTMLAttributes<HTMLDivElement>, 'label'> {
5
+ label: VNode | string;
6
+ price: VNode<HTMLAttributes<HTMLSpanElement>>;
7
+ classSuffixes?: Array<string>;
8
+ labelClassSuffix?: string;
9
+ testId?: string;
10
+ children?: any;
11
+ }
12
+ export declare const OrderSummaryLine: FunctionComponent<OrderSummaryLineComponentProps>;
13
+ //# sourceMappingURL=OrderSummaryLine.d.ts.map
@@ -0,0 +1,11 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
9
+ export * from './OrderSummaryLine';
10
+ export { OrderSummaryLine as default } from './OrderSummaryLine';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+ import { NegotiableQuoteCartItem } from '../../data/models/negotiable-quote-model';
4
+
5
+ export interface ProductListTableProps extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {
6
+ items: NegotiableQuoteCartItem[];
7
+ canEdit: boolean;
8
+ onItemCheckboxChange?: (item: NegotiableQuoteCartItem, isSelected: boolean) => void;
9
+ onItemDropdownChange?: (item: NegotiableQuoteCartItem, action: string) => void;
10
+ onUpdate?: (e: SubmitEvent) => void;
11
+ }
12
+ export declare const ProductListTable: FunctionComponent<ProductListTableProps>;
13
+ //# sourceMappingURL=ProductListTable.d.ts.map
@@ -0,0 +1,11 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
9
+ export * from './ProductListTable';
10
+ export { ProductListTable as default } from './ProductListTable';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { FunctionComponent, VNode } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ interface Entry {
5
+ label: string;
6
+ id: string;
7
+ value: VNode;
8
+ strong?: boolean;
9
+ children?: Entry[];
10
+ }
11
+ export interface QuotePricesSummaryProps extends HTMLAttributes<HTMLDivElement> {
12
+ entries?: Entry[];
13
+ }
14
+ export declare const QuotePricesSummary: FunctionComponent<QuotePricesSummaryProps>;
15
+ export {};
16
+ //# sourceMappingURL=QuotePricesSummary.d.ts.map
@@ -0,0 +1,11 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
9
+ export * from './QuotePricesSummary';
10
+ export { QuotePricesSummary as default } from './QuotePricesSummary';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { FunctionComponent, VNode } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ export interface QuoteSummaryListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
5
+ heading?: VNode | null;
6
+ footer?: VNode | null;
7
+ products?: VNode | null;
8
+ outOfStockMessage?: VNode | null;
9
+ loading?: boolean;
10
+ variant?: 'primary' | 'secondary';
11
+ }
12
+ export declare const QuoteSummaryList: FunctionComponent<QuoteSummaryListProps>;
13
+ //# sourceMappingURL=QuoteSummaryList.d.ts.map
@@ -0,0 +1,11 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
9
+ export * from './QuoteSummaryList';
10
+ export { QuoteSummaryList as default } from './QuoteSummaryList';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+ import { ShippingAddress } from '../../data/models/negotiable-quote-model';
4
+
5
+ export interface ShippingAddressDisplayProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
6
+ shippingAddress?: ShippingAddress;
7
+ loading?: boolean;
8
+ noAddressMessage?: string;
9
+ }
10
+ export declare const ShippingAddressDisplay: FunctionComponent<ShippingAddressDisplayProps>;
11
+ export declare const ShippingAddressDisplaySkeleton: FunctionComponent;
12
+ //# sourceMappingURL=ShippingAddressDisplay.d.ts.map