@dropins/storefront-quote-management 0.0.1-alpha30 → 0.0.1-alpha31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/duplicateNegotiableQuote/duplicateNegotiableQuote.d.ts +1 -0
- package/api/getQuoteTemplates/graphql/getQuoteTemplates.d.ts +1 -1
- package/api/graphql/NegotiableQuoteTemplateFragment.d.ts +1 -1
- package/api.js +1 -1
- package/chunks/AttachedFilesList.js +1 -1
- package/chunks/AttachedFilesList.js.map +1 -1
- package/chunks/CheckWithCircle.js +4 -0
- package/chunks/CheckWithCircle.js.map +1 -0
- package/chunks/ItemsQuoted.js +1 -1
- package/chunks/ItemsQuoted.js.map +1 -1
- package/chunks/ItemsQuotedTemplate.js +1 -1
- package/chunks/ItemsQuotedTemplate.js.map +1 -1
- package/chunks/LineItemNoteModal.js +1 -1
- package/chunks/LineItemNoteModal.js.map +1 -1
- package/chunks/NegotiableQuoteTemplateFragment.js +148 -6
- package/chunks/NegotiableQuoteTemplateFragment.js.map +1 -1
- package/chunks/ShippingAddressDisplay.js +1 -1
- package/chunks/ShippingAddressDisplay.js.map +1 -1
- package/chunks/WarningFilled.js +1 -1
- package/chunks/WarningFilled.js.map +1 -1
- package/chunks/addQuoteTemplateLineItemNote.js +1 -1
- package/chunks/addQuoteTemplateLineItemNote.js.map +1 -1
- package/chunks/duplicateNegotiableQuote.js +8 -8
- package/chunks/duplicateNegotiableQuote.js.map +1 -1
- package/chunks/getQuoteTemplates.js +13 -11
- package/chunks/getQuoteTemplates.js.map +1 -1
- package/chunks/negotiableQuotes.js +1 -1
- package/chunks/transform-quote-template.js +1 -1
- package/chunks/transform-quote-template.js.map +1 -1
- package/chunks/transform-quote.js +1 -1
- package/chunks/transform-quote.js.map +1 -1
- package/components/LineItemNoteModal/LineItemNoteModal.d.ts +2 -2
- package/components/ProductListTable/ProductListTable.d.ts +5 -49
- package/containers/ItemsQuoted/ItemsQuoted.d.ts +7 -7
- package/containers/ItemsQuoted.js +1 -1
- package/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.d.ts +3 -3
- package/containers/ItemsQuotedTemplate.js +1 -1
- package/containers/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +3 -4
- package/containers/ManageNegotiableQuote.js +1 -1
- package/containers/ManageNegotiableQuote.js.map +1 -1
- package/containers/ManageNegotiableQuoteTemplate.js +2 -2
- package/containers/ManageNegotiableQuoteTemplate.js.map +1 -1
- package/containers/QuoteSummaryList/QuoteSummaryList.d.ts +1 -1
- package/containers/QuoteSummaryList.js +1 -1
- package/containers/QuoteSummaryList.js.map +1 -1
- package/containers/QuoteTemplatesListTable.js +1 -1
- package/containers/QuoteTemplatesListTable.js.map +1 -1
- package/containers/QuotesListTable.js +1 -1
- package/containers/QuotesListTable.js.map +1 -1
- package/containers/RequestNegotiableQuoteForm.js +1 -1
- package/containers/RequestNegotiableQuoteForm.js.map +1 -1
- package/containers/ShippingAddressDisplay.js +1 -1
- package/data/models/__fixtures__/negotiableQuoteModel.d.ts +5 -5
- package/data/models/negotiable-quote-model.d.ts +2 -2
- package/data/models/negotiable-quote-template-model.d.ts +3 -39
- package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +5 -0
- package/data/transforms/__fixtures__/negotiableQuoteTemplateData.d.ts +561 -75
- package/data/transforms/transform-history.d.ts +15 -0
- package/data/transforms/transform-quote-items.d.ts +15 -0
- package/hooks/useItemsQuotedTemplate.d.ts +3 -4
- package/hooks/useRemoveTemplateItems.d.ts +3 -3
- package/hooks/useUpdateTemplateQuantities.d.ts +2 -2
- package/i18n/en_US.json.d.ts +24 -5
- package/lib/itemFormatters.d.ts +1 -1
- package/lib/priceCalculators.d.ts +1 -1
- package/package.json +1 -1
- package/render.js +2 -2
- package/render.js.map +1 -1
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
const e=`
|
|
4
4
|
fragment NegotiableQuoteTemplateFragment on NegotiableQuoteTemplate {
|
|
5
|
-
|
|
5
|
+
uid
|
|
6
6
|
template_id
|
|
7
7
|
name
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
created_at
|
|
9
|
+
updated_at
|
|
10
10
|
status
|
|
11
|
-
|
|
11
|
+
sales_rep_name
|
|
12
12
|
expiration_date
|
|
13
13
|
buyer {
|
|
14
14
|
firstname
|
|
@@ -28,26 +28,84 @@ const e=`
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
items {
|
|
31
|
+
__typename
|
|
31
32
|
uid
|
|
32
33
|
product {
|
|
33
34
|
name
|
|
34
35
|
sku
|
|
35
36
|
uid
|
|
36
37
|
stock_status
|
|
38
|
+
quantity
|
|
39
|
+
thumbnail {
|
|
40
|
+
label
|
|
41
|
+
url
|
|
42
|
+
}
|
|
43
|
+
price_range {
|
|
44
|
+
minimum_price {
|
|
45
|
+
regular_price {
|
|
46
|
+
value
|
|
47
|
+
currency
|
|
48
|
+
}
|
|
49
|
+
final_price {
|
|
50
|
+
value
|
|
51
|
+
currency
|
|
52
|
+
}
|
|
53
|
+
discount {
|
|
54
|
+
percent_off
|
|
55
|
+
amount_off
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
maximum_price {
|
|
59
|
+
regular_price {
|
|
60
|
+
value
|
|
61
|
+
currency
|
|
62
|
+
}
|
|
63
|
+
final_price {
|
|
64
|
+
value
|
|
65
|
+
currency
|
|
66
|
+
}
|
|
67
|
+
discount {
|
|
68
|
+
percent_off
|
|
69
|
+
amount_off
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
price_tiers {
|
|
74
|
+
quantity
|
|
75
|
+
final_price {
|
|
76
|
+
value
|
|
77
|
+
}
|
|
78
|
+
discount {
|
|
79
|
+
amount_off
|
|
80
|
+
percent_off
|
|
81
|
+
}
|
|
82
|
+
}
|
|
37
83
|
}
|
|
38
84
|
prices {
|
|
39
85
|
price {
|
|
40
86
|
currency
|
|
41
87
|
value
|
|
42
88
|
}
|
|
89
|
+
price_including_tax {
|
|
90
|
+
value
|
|
91
|
+
currency
|
|
92
|
+
}
|
|
43
93
|
original_item_price {
|
|
44
94
|
currency
|
|
45
95
|
value
|
|
46
96
|
}
|
|
97
|
+
original_row_total {
|
|
98
|
+
currency
|
|
99
|
+
value
|
|
100
|
+
}
|
|
47
101
|
row_total {
|
|
48
102
|
currency
|
|
49
103
|
value
|
|
50
104
|
}
|
|
105
|
+
row_total_including_tax {
|
|
106
|
+
value
|
|
107
|
+
currency
|
|
108
|
+
}
|
|
51
109
|
catalog_discount {
|
|
52
110
|
amount_off
|
|
53
111
|
percent_off
|
|
@@ -62,27 +120,97 @@ const e=`
|
|
|
62
120
|
}
|
|
63
121
|
}
|
|
64
122
|
quantity
|
|
123
|
+
is_available
|
|
65
124
|
note_from_buyer {
|
|
66
125
|
created_at
|
|
67
126
|
creator_id
|
|
68
127
|
creator_type
|
|
69
|
-
|
|
128
|
+
negotiable_quote_item_uid
|
|
70
129
|
note
|
|
71
130
|
note_uid
|
|
131
|
+
__typename
|
|
72
132
|
}
|
|
73
133
|
note_from_seller {
|
|
74
134
|
created_at
|
|
75
135
|
creator_id
|
|
76
136
|
creator_type
|
|
77
|
-
|
|
137
|
+
negotiable_quote_item_uid
|
|
78
138
|
note
|
|
79
139
|
note_uid
|
|
140
|
+
__typename
|
|
141
|
+
}
|
|
142
|
+
... on SimpleCartItem {
|
|
143
|
+
customizable_options {
|
|
144
|
+
type
|
|
145
|
+
label
|
|
146
|
+
values {
|
|
147
|
+
label
|
|
148
|
+
value
|
|
149
|
+
}
|
|
150
|
+
}
|
|
80
151
|
}
|
|
81
152
|
... on ConfigurableCartItem {
|
|
82
153
|
configurable_options {
|
|
83
154
|
option_label
|
|
84
155
|
value_label
|
|
85
156
|
}
|
|
157
|
+
configured_variant {
|
|
158
|
+
uid
|
|
159
|
+
sku
|
|
160
|
+
stock_status
|
|
161
|
+
thumbnail {
|
|
162
|
+
label
|
|
163
|
+
url
|
|
164
|
+
}
|
|
165
|
+
price_range {
|
|
166
|
+
minimum_price {
|
|
167
|
+
regular_price {
|
|
168
|
+
value
|
|
169
|
+
currency
|
|
170
|
+
}
|
|
171
|
+
final_price {
|
|
172
|
+
value
|
|
173
|
+
currency
|
|
174
|
+
}
|
|
175
|
+
discount {
|
|
176
|
+
percent_off
|
|
177
|
+
amount_off
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
maximum_price {
|
|
181
|
+
regular_price {
|
|
182
|
+
value
|
|
183
|
+
currency
|
|
184
|
+
}
|
|
185
|
+
final_price {
|
|
186
|
+
value
|
|
187
|
+
currency
|
|
188
|
+
}
|
|
189
|
+
discount {
|
|
190
|
+
percent_off
|
|
191
|
+
amount_off
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
price_tiers {
|
|
196
|
+
quantity
|
|
197
|
+
final_price {
|
|
198
|
+
value
|
|
199
|
+
}
|
|
200
|
+
discount {
|
|
201
|
+
amount_off
|
|
202
|
+
percent_off
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
customizable_options {
|
|
207
|
+
type
|
|
208
|
+
label
|
|
209
|
+
values {
|
|
210
|
+
label
|
|
211
|
+
value
|
|
212
|
+
}
|
|
213
|
+
}
|
|
86
214
|
}
|
|
87
215
|
... on BundleCartItem {
|
|
88
216
|
bundle_options {
|
|
@@ -101,6 +229,20 @@ const e=`
|
|
|
101
229
|
}
|
|
102
230
|
}
|
|
103
231
|
}
|
|
232
|
+
... on DownloadableCartItem {
|
|
233
|
+
links {
|
|
234
|
+
sort_order
|
|
235
|
+
title
|
|
236
|
+
}
|
|
237
|
+
customizable_options {
|
|
238
|
+
type
|
|
239
|
+
label
|
|
240
|
+
values {
|
|
241
|
+
label
|
|
242
|
+
value
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
104
246
|
}
|
|
105
247
|
history {
|
|
106
248
|
uid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NegotiableQuoteTemplateFragment.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteTemplateFragment.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_TEMPLATE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteTemplateFragment on NegotiableQuoteTemplate {\n
|
|
1
|
+
{"version":3,"file":"NegotiableQuoteTemplateFragment.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteTemplateFragment.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_TEMPLATE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteTemplateFragment on NegotiableQuoteTemplate {\n uid\n template_id\n name\n created_at\n updated_at\n status\n sales_rep_name\n expiration_date\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n text\n attachments {\n name\n url\n }\n }\n items {\n __typename\n uid\n product {\n name\n sku\n uid\n stock_status\n quantity\n thumbnail {\n label\n url\n }\n price_range {\n minimum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n }\n price_tiers {\n quantity\n final_price {\n value\n }\n discount {\n amount_off\n percent_off\n }\n }\n }\n prices {\n price {\n currency\n value\n }\n price_including_tax {\n value\n currency\n }\n original_item_price {\n currency\n value\n }\n original_row_total {\n currency\n value\n }\n row_total {\n currency\n value\n }\n row_total_including_tax {\n value\n currency\n }\n catalog_discount {\n amount_off\n percent_off\n }\n discounts {\n label\n value\n amount {\n currency\n value\n }\n }\n }\n quantity\n is_available\n note_from_buyer {\n created_at\n creator_id\n creator_type\n negotiable_quote_item_uid\n note\n note_uid\n __typename\n }\n note_from_seller {\n created_at\n creator_id\n creator_type\n negotiable_quote_item_uid\n note\n note_uid\n __typename\n }\n ... on SimpleCartItem {\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n value_label\n }\n configured_variant {\n uid\n sku\n stock_status\n thumbnail {\n label\n url\n }\n price_range {\n minimum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n }\n price_tiers {\n quantity\n final_price {\n value\n }\n discount {\n amount_off\n percent_off\n }\n }\n }\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n ... on BundleCartItem {\n bundle_options {\n label\n values {\n label\n quantity\n original_price {\n currency\n value\n }\n priceV2 {\n currency\n value\n }\n }\n }\n }\n ... on DownloadableCartItem {\n links {\n sort_order\n title\n }\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n }\n history {\n uid\n created_at\n author {\n firstname\n lastname\n }\n change_type\n changes {\n comment_added {\n comment\n }\n custom_changes {\n new_value\n old_value\n title\n }\n statuses {\n changes {\n new_status\n old_status\n }\n }\n expiration {\n new_expiration\n old_expiration\n }\n total {\n new_price {\n currency\n value\n }\n old_price {\n currency\n value\n }\n }\n }\n }\n prices {\n subtotal_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n }\n shipping_addresses {\n uid\n firstname\n lastname\n company\n street\n city\n region {\n code\n label\n region_id\n }\n postcode\n country {\n code\n label\n }\n telephone\n }\n reference_document_links {\n link_id\n document_name\n document_identifier\n reference_document_url\n }\n }\n`;\n"],"names":["NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT"],"mappings":"AASO,MAAMA,EAAmD;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;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;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;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;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;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;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as a,jsxs as c}from"@dropins/tools/preact-jsx-runtime.js";import{useState as y,useEffect as l}from"@dropins/tools/preact-compat.js";import{classes as
|
|
3
|
+
import{jsx as a,jsxs as c}from"@dropins/tools/preact-jsx-runtime.js";import{useState as y,useEffect as l}from"@dropins/tools/preact-compat.js";import{classes as u}from"@dropins/tools/lib.js";import{InLineAlert as f,Skeleton as h,SkeletonRow as q}from"@dropins/tools/components.js";import{S as _}from"./WarningFilled.js";import{useText as v}from"@dropins/tools/i18n.js";import{events as g}from"@dropins/tools/event-bus.js";const N=({className:i,shippingAddress:e,loading:m,noAddressMessage:p,...r})=>{const s=v({noAddressHeading:"NegotiableQuote.Manage.shippingAddress.noAddressHeading",noAddressDescription:"NegotiableQuote.Manage.shippingAddress.noAddressDescription"});return m?a(S,{}):e?c("div",{className:u(["quote-management-shipping-address-display",i]),"data-testid":"shipping-address-display",...r,children:[a("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-name",children:c("span",{className:"quote-management-shipping-address-display__name",children:[e.firstname," ",e.lastname]})}),e.company&&a("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-company",children:e.company}),e.street.map((o,t)=>a("div",{className:"quote-management-shipping-address-display__field","data-testid":`address-street-${t}`,children:o},t)),c("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-city-region",children:[e.city,e.region&&`, ${e.region.label}`," ",e.postcode]}),a("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-country",children:e.country.label}),a("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-telephone",children:e.telephone})]}):a("div",{className:u(["quote-management-shipping-address-display","quote-management-shipping-address-display--empty",i]),"data-testid":"shipping-address-display-empty",...r,children:a(f,{type:"warning",variant:"primary","data-testid":"shipping-address-display-empty-alert",icon:a(_,{}),heading:s.noAddressHeading,description:p||s.noAddressDescription})})},S=()=>a(h,{"data-testid":"shipping-address-display-skeleton",children:a(q,{variant:"row",fullWidth:!0,size:"small",lines:5,multilineGap:"xsmall"})}),$=({shippingAddress:i,loading:e,...m})=>{const[p,r]=y(i);return l(()=>{i!==void 0&&r(i)},[i]),l(()=>{const s=g.on("quote-management/quote-data",o=>{var d,n;const t=(n=(d=o.quote)==null?void 0:d.shippingAddresses)==null?void 0:n[0];r(t)},{eager:!0});return()=>s==null?void 0:s.off()},[]),l(()=>{const s=g.on("quote-management/shipping-address-set",o=>{var d,n;const t=(n=(d=o.quote)==null?void 0:d.shippingAddresses)==null?void 0:n[0];r(t)},{eager:!0});return()=>s==null?void 0:s.off()},[]),l(()=>{const s=g.on("quote-management/quote-template-data",o=>{var d,n;const t=(n=(d=o.quoteTemplate)==null?void 0:d.shippingAddresses)==null?void 0:n[0];r(t)},{eager:!0});return()=>s==null?void 0:s.off()},[]),a(N,{shippingAddress:p,loading:e,...m})};export{$ as S};
|
|
4
4
|
//# sourceMappingURL=ShippingAddressDisplay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShippingAddressDisplay.js","sources":["/@dropins/storefront-quote-management/src/components/ShippingAddressDisplay/ShippingAddressDisplay.tsx","/@dropins/storefront-quote-management/src/containers/ShippingAddressDisplay/ShippingAddressDisplay.tsx"],"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 { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\nimport { ShippingAddress } from '@/quote-management/data/models/negotiable-quote-model';\nimport '@/quote-management/components/ShippingAddressDisplay/ShippingAddressDisplay.css';\n\nexport interface ShippingAddressDisplayProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n shippingAddress?: ShippingAddress;\n loading?: boolean;\n noAddressMessage?: string;\n}\n\nexport const ShippingAddressDisplay: FunctionComponent<ShippingAddressDisplayProps> = ({\n className,\n shippingAddress,\n loading,\n noAddressMessage,\n ...props\n}) => {\n const dictionary = useText({\n
|
|
1
|
+
{"version":3,"file":"ShippingAddressDisplay.js","sources":["/@dropins/storefront-quote-management/src/components/ShippingAddressDisplay/ShippingAddressDisplay.tsx","/@dropins/storefront-quote-management/src/containers/ShippingAddressDisplay/ShippingAddressDisplay.tsx"],"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 { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { InLineAlert, Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\nimport { ShippingAddress } from '@/quote-management/data/models/negotiable-quote-model';\nimport '@/quote-management/components/ShippingAddressDisplay/ShippingAddressDisplay.css';\nimport { WarningFilled } from '@adobe-commerce/elsie/icons';\n\nexport interface ShippingAddressDisplayProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n shippingAddress?: ShippingAddress;\n loading?: boolean;\n noAddressMessage?: string;\n}\n\nexport const ShippingAddressDisplay: FunctionComponent<ShippingAddressDisplayProps> = ({\n className,\n shippingAddress,\n loading,\n noAddressMessage,\n ...props\n}) => {\n const dictionary = useText({\n noAddressHeading: 'NegotiableQuote.Manage.shippingAddress.noAddressHeading',\n noAddressDescription: 'NegotiableQuote.Manage.shippingAddress.noAddressDescription',\n });\n\n if (loading) {\n return <ShippingAddressDisplaySkeleton />;\n }\n\n if (!shippingAddress) {\n return (\n <div \n className={classes(['quote-management-shipping-address-display', 'quote-management-shipping-address-display--empty', className])}\n data-testid=\"shipping-address-display-empty\"\n {...props}\n >\n <InLineAlert\n type=\"warning\"\n variant=\"primary\"\n data-testid=\"shipping-address-display-empty-alert\"\n icon={<WarningFilled />}\n heading={dictionary.noAddressHeading}\n description={noAddressMessage || dictionary.noAddressDescription}\n />\n </div>\n );\n }\n\n return (\n <div \n className={classes(['quote-management-shipping-address-display', className])}\n data-testid=\"shipping-address-display\"\n {...props}\n >\n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-name\">\n <span className=\"quote-management-shipping-address-display__name\">\n {shippingAddress.firstname} {shippingAddress.lastname}\n </span>\n </div>\n \n {shippingAddress.company && (\n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-company\">\n {shippingAddress.company}\n </div>\n )}\n \n {shippingAddress.street.map((line, index) => (\n <div \n key={index} \n className=\"quote-management-shipping-address-display__field\" \n data-testid={`address-street-${index}`}\n >\n {line}\n </div>\n ))}\n \n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-city-region\">\n {shippingAddress.city}\n {shippingAddress.region && `, ${shippingAddress.region.label}`}\n {' '}\n {shippingAddress.postcode}\n </div>\n \n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-country\">\n {shippingAddress.country.label}\n </div>\n \n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-telephone\">\n {shippingAddress.telephone}\n </div>\n </div>\n );\n};\n\nexport const ShippingAddressDisplaySkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"shipping-address-display-skeleton\">\n <SkeletonRow variant=\"row\" fullWidth={true} size=\"small\" lines={5} multilineGap='xsmall' />\n </Skeleton>\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 { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { ShippingAddress } from '@/quote-management/data/models/negotiable-quote-model';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\nimport { ShippingAddressDisplay as ShippingAddressDisplayComponent } from '@/quote-management/components/ShippingAddressDisplay';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface ShippingAddressDisplayProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n shippingAddress?: ShippingAddress;\n loading?: boolean;\n}\n\nexport const ShippingAddressDisplay: Container<ShippingAddressDisplayProps> = ({\n shippingAddress: initialShippingAddress,\n loading,\n ...props\n}) => {\n const [shippingAddress, setShippingAddress] = useState<ShippingAddress | undefined>(initialShippingAddress);\n\n // Sync prop changes to internal state\n useEffect(() => {\n if (initialShippingAddress !== undefined) {\n setShippingAddress(initialShippingAddress);\n }\n }, [initialShippingAddress]);\n\n // Listen for quote-data events\n useEffect(() => {\n const quoteDataEvent = events.on('quote-management/quote-data', (data: { quote?: { shippingAddresses?: ShippingAddress[] } | null }) => {\n const address = data.quote?.shippingAddresses?.[0];\n setShippingAddress(address);\n }, {\n eager: true,\n });\n return () => quoteDataEvent?.off();\n }, []);\n\n // Listen for shipping-address-set events\n useEffect(() => {\n const shippingAddressSetEvent = events.on('quote-management/shipping-address-set', (data: { quote?: { shippingAddresses?: ShippingAddress[] } | null }) => {\n const address = data.quote?.shippingAddresses?.[0];\n setShippingAddress(address);\n }, {\n eager: true,\n });\n return () => shippingAddressSetEvent?.off();\n }, []);\n\n // Listen for quote-template-data events\n useEffect(() => {\n const quoteTemplateDataEvent = events.on('quote-management/quote-template-data', (data: { quoteTemplate?: NegotiableQuoteTemplateModel | null }) => {\n const address = data.quoteTemplate?.shippingAddresses?.[0];\n setShippingAddress(address);\n }, {\n eager: true,\n });\n return () => quoteTemplateDataEvent?.off();\n }, []);\n\n return (\n <ShippingAddressDisplayComponent\n shippingAddress={shippingAddress}\n loading={loading}\n {...props}\n />\n );\n};\n\n"],"names":["ShippingAddressDisplay","className","shippingAddress","loading","noAddressMessage","props","dictionary","useText","ShippingAddressDisplaySkeleton","jsxs","classes","jsx","line","index","InLineAlert","WarningFilled","Skeleton","SkeletonRow","initialShippingAddress","setShippingAddress","useState","useEffect","quoteDataEvent","events","data","address","_b","_a","shippingAddressSetEvent","quoteTemplateDataEvent","ShippingAddressDisplayComponent"],"mappings":"saAwBO,MAAMA,EAAyE,CAAC,CACrF,UAAAC,EACA,gB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AA,CACC,gBAAA5B,EACA,QAAAC,EACC,GAAGE,CAAA,CAAA,CAGV"}
|
package/chunks/WarningFilled.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import*as e from"@dropins/tools/preact-compat.js";const
|
|
3
|
+
import*as e from"@dropins/tools/preact-compat.js";const l=t=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{vectorEffect:"non-scaling-stroke",fillRule:"evenodd",clipRule:"evenodd",d:"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z",fill:"currentColor"}));export{l as S};
|
|
4
4
|
//# sourceMappingURL=WarningFilled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarningFilled.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/
|
|
1
|
+
{"version":3,"file":"WarningFilled.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/WarningFilled.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgWarningFilled = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z\", fill: \"currentColor\" }));\nexport default SvgWarningFilled;\n"],"names":["SvgWarningFilled","props","React"],"mappings":"kDACK,MAACA,EAAoBC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,SAAU,UAAW,SAAU,UAAW,EAAG,yJAA0J,KAAM,eAAgB,CAAC","x_google_ignoreList":[0]}
|
|
@@ -29,5 +29,5 @@ import{events as n}from"@dropins/tools/event-bus.js";import{a as u}from"./transf
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
${T}
|
|
32
|
-
`,f=async e=>{var o;if(!e.templateId)throw new Error("Template ID is required");if(!e.itemId)throw new Error("Item ID is required");if(!r.authenticated)throw new Error("Unauthorized");try{const t=await p(d,{variables:{input:{templateId:e.templateId,
|
|
32
|
+
`,f=async e=>{var o;if(!e.templateId)throw new Error("Template ID is required");if(!e.itemId)throw new Error("Item ID is required");if(!r.authenticated)throw new Error("Unauthorized");try{const t=await p(d,{variables:{input:{templateId:e.templateId,item_uid:e.itemId,note:e.note}}});if(!((o=t==null?void 0:t.data)!=null&&o.setQuoteTemplateLineItemNote))throw new Error("No quote template data received");const a=u(t.data.setQuoteTemplateLineItemNote);if(!a)throw new Error("Failed to transform quote template data");return n.emit("quote-management/quote-template-data",{quoteTemplate:a,permissions:r.permissions}),a}catch(t){return Promise.reject(t)}};export{f as a,c as r,w as u};
|
|
33
33
|
//# sourceMappingURL=addQuoteTemplateLineItemNote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addQuoteTemplateLineItemNote.js","sources":["/@dropins/storefront-quote-management/src/api/updateQuoteTemplateItemQuantities/graphql/updateNegotiableQuoteTemplateQuantities.ts","/@dropins/storefront-quote-management/src/api/updateQuoteTemplateItemQuantities/updateQuoteTemplateItemQuantities.ts","/@dropins/storefront-quote-management/src/api/removeQuoteTemplateItems/graphql/removeNegotiableQuoteTemplateItems.ts","/@dropins/storefront-quote-management/src/api/removeQuoteTemplateItems/removeQuoteTemplateItems.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateLineItemNote/graphql/setQuoteTemplateLineItemNote.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateLineItemNote/addQuoteTemplateLineItemNote.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 { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION = /* GraphQL */ `\n mutation UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION(\n $input: UpdateNegotiableQuoteTemplateQuantitiesInput!\n ) {\n updateNegotiableQuoteTemplateQuantities(input: $input) {\n quote_template {\n ...NegotiableQuoteTemplateFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_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 '@/quote-management/api';\nimport { UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION } from './graphql/updateNegotiableQuoteTemplateQuantities';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface NegotiableQuoteTemplateItemQuantityInput {\n itemId: string;\n quantity: number;\n minQty?: number;\n maxQty?: number;\n}\n\nexport interface UpdateQuoteTemplateItemQuantitiesParams {\n templateId: string;\n items: NegotiableQuoteTemplateItemQuantityInput[];\n}\n\nexport const updateQuoteTemplateItemQuantities = async (\n params: UpdateQuoteTemplateItemQuantitiesParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.items || params.items.length === 0) {\n throw new Error('Items array is required and must not be empty');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION,\n {\n variables: {\n input: {\n template_id: params.templateId,\n items: params.items.map((item) => ({\n item_id: item.itemId,\n quantity: item.quantity,\n min_qty: item.minQty,\n max_qty: item.maxQty,\n })),\n },\n },\n }\n );\n\n if (\n !results?.data?.updateNegotiableQuoteTemplateQuantities?.quote_template\n ) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.updateNegotiableQuoteTemplateQuantities.quote_template\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\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_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION = /* GraphQL */ `\n mutation REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION(\n $input: RemoveNegotiableQuoteTemplateItemsInput!\n ) {\n removeNegotiableQuoteTemplateItems(input: $input) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_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 '@/quote-management/api';\nimport { REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION } from './graphql/removeNegotiableQuoteTemplateItems';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface RemoveQuoteTemplateItemsParams {\n templateId: string;\n itemUids: string[];\n}\n\nexport const removeQuoteTemplateItems = async (\n params: RemoveQuoteTemplateItemsParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.itemUids || params.itemUids.length === 0) {\n throw new Error('Item UIDs array is required and must not be empty');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION,\n {\n variables: {\n input: {\n template_id: params.templateId,\n item_uids: params.itemUids,\n },\n },\n }\n );\n\n if (!results?.data?.removeNegotiableQuoteTemplateItems) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.removeNegotiableQuoteTemplateItems\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\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_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION = /* GraphQL */ `\n mutation SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION(\n $input: QuoteTemplateLineItemNoteInput!\n ) {\n setQuoteTemplateLineItemNote(input: $input) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_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 '@/quote-management/api';\nimport { SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION } from './graphql/setQuoteTemplateLineItemNote';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface AddQuoteTemplateLineItemNoteParams {\n templateId: string;\n itemId: string;\n note?: string;\n}\n\nexport const addQuoteTemplateLineItemNote = async (\n params: AddQuoteTemplateLineItemNoteParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.itemId) {\n throw new Error('Item ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION,\n {\n variables: {\n input: {\n templateId: params.templateId,\n item_id: params.itemId,\n note: params.note,\n },\n },\n }\n );\n\n if (!results?.data?.setQuoteTemplateLineItemNote) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.setQuoteTemplateLineItemNote\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n"],"names":["UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION","NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT","updateQuoteTemplateItemQuantities","params","state","results","fetchGraphQl","item","_b","_a","transformedData","transformQuoteTemplate","events","error","REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION","removeQuoteTemplateItems","SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION","addQuoteTemplateLineItemNote"],"mappings":"wOAWO,MAAMA,EAAqE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAU9EC,CAAkC;AAAA,ECMzBC,EAAoC,MAC/CC,GACG,SACH,GAAI,CAACA,EAAO,WACV,MAAM,IAAI,MAAM,yBAAyB,EAG3C,GAAI,CAACA,EAAO,OAASA,EAAO,MAAM,SAAW,EAC3C,MAAM,IAAI,MAAM,+CAA+C,EAGjE,GAAI,CAACC,EAAM,cACT,MAAM,IAAI,MAAM,cAAc,EAGhC,GAAI,CACF,MAAMC,EAAe,MAAMC,EACzBN,EACA,CACE,UAAW,CACT,MAAO,CACL,YAAaG,EAAO,WACpB,MAAOA,EAAO,MAAM,IAAKI,IAAU,CACjC,QAASA,EAAK,OACd,SAAUA,EAAK,SACf,QAASA,EAAK,OACd,QAASA,EAAK,MAAA,EACd,CAAA,CACJ,CACF,CACF,EAGF,GACE,GAACC,GAAAC,EAAAJ,GAAA,YAAAA,EAAS,OAAT,YAAAI,EAAe,0CAAf,MAAAD,EAAwD,gBAEzD,MAAM,IAAI,MAAM,iCAAiC,EAGnD,MAAME,EAAkBC,EACtBN,EAAQ,KAAK,wCAAwC,cAAA,EAGvD,GAAI,CAACK,EACH,MAAM,IAAI,MAAM,yCAAyC,EAG3D,OAAAE,EAAO,KAAK,uCAAwC,CAClD,cAAeF,EACf,YAAaN,EAAM,WAAA,CACpB,EAEMM,CACT,OAASG,EAAO,CACd,OAAO,QAAQ,OAAOA,CAAK,CAC7B,CACF,ECxEaC,EAAgE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQzEb,CAAkC;AAAA,ECCzBc,EA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kBC,EACtBN,EAAQ,KAAK,4BAAA,EAGf,GAAI,CAACK,EACH,MAAM,IAAI,MAAM,yCAAyC,EAG3D,OAAAE,EAAO,KAAK,uCAAwC,CAClD,cAAeF,EACf,YAAaN,EAAM,WAAA,CACpB,EAEMM,CACT,OAASG,EAAO,CACd,OAAO,QAAQ,OAAOA,CAAK,CAC7B,CACF"}
|
|
1
|
+
{"version":3,"file":"addQuoteTemplateLineItemNote.js","sources":["/@dropins/storefront-quote-management/src/api/updateQuoteTemplateItemQuantities/graphql/updateNegotiableQuoteTemplateQuantities.ts","/@dropins/storefront-quote-management/src/api/updateQuoteTemplateItemQuantities/updateQuoteTemplateItemQuantities.ts","/@dropins/storefront-quote-management/src/api/removeQuoteTemplateItems/graphql/removeNegotiableQuoteTemplateItems.ts","/@dropins/storefront-quote-management/src/api/removeQuoteTemplateItems/removeQuoteTemplateItems.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateLineItemNote/graphql/setQuoteTemplateLineItemNote.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateLineItemNote/addQuoteTemplateLineItemNote.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 { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION = /* GraphQL */ `\n mutation UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION(\n $input: UpdateNegotiableQuoteTemplateQuantitiesInput!\n ) {\n updateNegotiableQuoteTemplateQuantities(input: $input) {\n quote_template {\n ...NegotiableQuoteTemplateFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_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 '@/quote-management/api';\nimport { UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION } from './graphql/updateNegotiableQuoteTemplateQuantities';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface NegotiableQuoteTemplateItemQuantityInput {\n itemId: string;\n quantity: number;\n minQty?: number;\n maxQty?: number;\n}\n\nexport interface UpdateQuoteTemplateItemQuantitiesParams {\n templateId: string;\n items: NegotiableQuoteTemplateItemQuantityInput[];\n}\n\nexport const updateQuoteTemplateItemQuantities = async (\n params: UpdateQuoteTemplateItemQuantitiesParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.items || params.items.length === 0) {\n throw new Error('Items array is required and must not be empty');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION,\n {\n variables: {\n input: {\n template_id: params.templateId,\n items: params.items.map((item) => ({\n item_id: item.itemId,\n quantity: item.quantity,\n min_qty: item.minQty,\n max_qty: item.maxQty,\n })),\n },\n },\n }\n );\n\n if (\n !results?.data?.updateNegotiableQuoteTemplateQuantities?.quote_template\n ) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.updateNegotiableQuoteTemplateQuantities.quote_template\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\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_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION = /* GraphQL */ `\n mutation REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION(\n $input: RemoveNegotiableQuoteTemplateItemsInput!\n ) {\n removeNegotiableQuoteTemplateItems(input: $input) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_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 '@/quote-management/api';\nimport { REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION } from './graphql/removeNegotiableQuoteTemplateItems';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface RemoveQuoteTemplateItemsParams {\n templateId: string;\n itemUids: string[];\n}\n\nexport const removeQuoteTemplateItems = async (\n params: RemoveQuoteTemplateItemsParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.itemUids || params.itemUids.length === 0) {\n throw new Error('Item UIDs array is required and must not be empty');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION,\n {\n variables: {\n input: {\n template_id: params.templateId,\n item_uids: params.itemUids,\n },\n },\n }\n );\n\n if (!results?.data?.removeNegotiableQuoteTemplateItems) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.removeNegotiableQuoteTemplateItems\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\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_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION = /* GraphQL */ `\n mutation SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION(\n $input: QuoteTemplateLineItemNoteInput!\n ) {\n setQuoteTemplateLineItemNote(input: $input) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_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 '@/quote-management/api';\nimport { SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION } from './graphql/setQuoteTemplateLineItemNote';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface AddQuoteTemplateLineItemNoteParams {\n templateId: string;\n itemId: string;\n note?: string;\n}\n\nexport const addQuoteTemplateLineItemNote = async (\n params: AddQuoteTemplateLineItemNoteParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.itemId) {\n throw new Error('Item ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION,\n {\n variables: {\n input: {\n templateId: params.templateId,\n item_uid: params.itemId,\n note: params.note,\n },\n },\n }\n );\n\n if (!results?.data?.setQuoteTemplateLineItemNote) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.setQuoteTemplateLineItemNote\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n"],"names":["UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION","NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT","updateQuoteTemplateItemQuantities","params","state","results","fetchGraphQl","item","_b","_a","transformedData","transformQuoteTemplate","events","error","REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION","removeQuoteTemplateItems","SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION","addQuoteTemplateLineItemNote"],"mappings":"wOAWO,MAAMA,EAAqE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAU9EC,CAAkC;AAAA,ECMzBC,EAAoC,MAC/CC,GACG,SACH,GAAI,CAACA,EAAO,WACV,MAAM,IAAI,MAAM,yBAAyB,EAG3C,GAAI,CAACA,EAAO,OAASA,EAAO,MAAM,SAAW,EAC3C,MAAM,IAAI,MAAM,+CAA+C,EAGjE,GAAI,CAACC,EAAM,cACT,MAAM,IAAI,MAAM,cAAc,EAGhC,GAAI,CACF,MAAMC,EAAe,MAAMC,EACzBN,EACA,CACE,UAAW,CACT,MAAO,CACL,YAAaG,EAAO,WACpB,MAAOA,EAAO,MAAM,IAAKI,IAAU,CACjC,QAASA,EAAK,OACd,S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7B,CACF,EC1DaG,EAA2D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQpEf,CAAkC;AAAA,ECEzBgB,EAA+B,MAC1Cd,GACG,OACH,GAAI,CAACA,EAAO,WACV,MAAM,IAAI,MAAM,yBAAyB,EAG3C,GAAI,CAACA,EAAO,OACV,MAAM,IAAI,MAAM,qBAAqB,EAGvC,GAAI,CAACC,EAAM,cACT,MAAM,IAAI,MAAM,cAAc,EAGhC,GAAI,CACF,MAAMC,EAAe,MAAMC,EACzBU,EACA,CACE,UAAW,CACT,MAAO,CACL,WAAYb,EAAO,WACnB,SAAUA,EAAO,OACjB,KAAMA,EAAO,IAAA,CACf,CACF,CACF,EAGF,GAAI,GAACM,EAAAJ,GAAA,YAAAA,EAAS,OAAT,MAAAI,EAAe,8BAClB,MAAM,IAAI,MAAM,iCAAiC,EAGnD,MAAMC,EAAkBC,EACtBN,EAAQ,KAAK,4BAAA,EAGf,GAAI,CAACK,EACH,MAAM,IAAI,MAAM,yCAAyC,EAG3D,OAAAE,EAAO,KAAK,uCAAwC,CAClD,cAAeF,EACf,YAAaN,EAAM,WAAA,CACpB,EAEMM,CACT,OAASG,EAAO,CACd,OAAO,QAAQ,OAAOA,CAAK,CAC7B,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from"./transform-quote.js";import{N as g}from"./NegotiableQuoteFragment.js";import{s as _}from"./state.js";import{a as Q}from"./transform-quote-template.js";import{N as U}from"./NegotiableQuoteTemplateFragment.js";const
|
|
3
|
+
import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from"./transform-quote.js";import{N as g}from"./NegotiableQuoteFragment.js";import{s as _}from"./state.js";import{a as Q}from"./transform-quote-template.js";import{N as U}from"./NegotiableQuoteTemplateFragment.js";const N=`
|
|
4
4
|
query QUOTE_DATA_QUERY(
|
|
5
5
|
$quoteId: ID!
|
|
6
6
|
) {
|
|
@@ -12,7 +12,7 @@ import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from".
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
${g}
|
|
15
|
-
`,S=async
|
|
15
|
+
`,S=async s=>{var a;if(!_.authenticated)return Promise.reject(new Error("Unauthorized"));if(!_.permissions.editQuote)return Promise.reject(new Error("Unauthorized"));try{const o=await E(N,{variables:{quoteId:s}}),e=q((a=o==null?void 0:o.data)==null?void 0:a.negotiableQuote);if(!e)throw new Error("Failed to transform quote data");return p.emit("quote-management/quote-data",{quote:e,permissions:_.permissions}),e}catch(o){return Promise.reject(o)}},T=`
|
|
16
16
|
mutation DELETE_QUOTE_MUTATION($quoteUids: [ID!]!) {
|
|
17
17
|
deleteNegotiableQuotes(
|
|
18
18
|
input: {
|
|
@@ -44,7 +44,7 @@ import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from".
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
`,M=async
|
|
47
|
+
`,M=async s=>{var o;if(!_.authenticated)return Promise.reject(new Error("Unauthorized"));const a=Array.isArray(s)?s:[s];try{const e=await E(T,{variables:{quoteUids:a}}),{errors:c}=e||{};if(c&&c.length){const r=c.map(t=>t==null?void 0:t.message).filter(Boolean).join("; ");throw new Error(r||"Failed to delete negotiable quotes")}const m=(o=e==null?void 0:e.data)==null?void 0:o.deleteNegotiableQuotes;if(!m)throw new Error("No delete result returned");const i={resultStatus:m.result_status,operationResults:(m.operation_results||[]).map(r=>(r==null?void 0:r.__typename)==="NegotiableQuoteUidOperationSuccess"?{__typename:"NegotiableQuoteUidOperationSuccess",quoteUid:r==null?void 0:r.quote_uid}:{__typename:"DeleteNegotiableQuoteOperationFailure",quoteUid:r==null?void 0:r.quote_uid,errors:((r==null?void 0:r.errors)||[]).map(u=>({__typename:u==null?void 0:u.__typename,message:u==null?void 0:u.message,uid:u==null?void 0:u.uid}))})},d=i.operationResults.filter(r=>r.__typename==="NegotiableQuoteUidOperationSuccess").map(r=>r.quoteUid);return d.length>0&&p.emit("quote-management/negotiable-quote-deleted",{deletedQuoteUids:d,resultStatus:i.resultStatus}),i}catch(e){return p.emit("quote-management/negotiable-quote-delete-error",{error:e instanceof Error?e:new Error(String(e)),attemptedQuoteUids:a}),Promise.reject(e)}},f=`
|
|
48
48
|
mutation SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION(
|
|
49
49
|
$quoteUid: ID!
|
|
50
50
|
$comment: NegotiableQuoteCommentInput
|
|
@@ -61,7 +61,7 @@ import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from".
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
${g}
|
|
64
|
-
`,R=async
|
|
64
|
+
`,R=async s=>{const{quoteUid:a,comment:o,attachments:e}=s;if(!a)throw new Error("Quote UID is required");const c=e!=null&&e.length?{comment:o||"",attachments:e}:o?{comment:o}:null;return E(f,{variables:{quoteUid:a,comment:c}}).then(m=>{var r,t;const{errors:i}=m;if(i){const n=i.map(u=>u.message).join("; ");throw new Error(`Failed to send quote for review: ${n}`)}const d=q((t=(r=m.data)==null?void 0:r.sendNegotiableQuoteForReview)==null?void 0:t.quote);if(!d)throw new Error("Failed to transform quote data: Invalid response structure");return p.emit("quote-management/quote-sent-for-review",{quote:d,input:{quoteUid:a,comment:o,attachments:e}}),d})},w=`
|
|
65
65
|
mutation CLOSE_NEGOTIABLE_QUOTE_MUTATION(
|
|
66
66
|
$quoteUids: [ID!]!
|
|
67
67
|
) {
|
|
@@ -91,7 +91,7 @@ import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from".
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
`,v=async
|
|
94
|
+
`,v=async s=>{var o;if(!_.authenticated)return Promise.reject(new Error("Unauthorized"));const{quoteUids:a}=s;if(!a||a.length===0)throw new Error("Quote UIDs are required");try{const e=await E(w,{variables:{quoteUids:a}}),{errors:c}=e||{};if(c&&c.length){const t=c.map(n=>n==null?void 0:n.message).filter(Boolean).join("; ");throw new Error(t||"Failed to close negotiable quotes")}const m=(o=e==null?void 0:e.data)==null?void 0:o.closeNegotiableQuotes;if(!m)throw new Error("No close result returned");const i={resultStatus:m.result_status,operationResults:(m.operation_results||[]).map(t=>(t==null?void 0:t.__typename)==="NegotiableQuoteUidOperationSuccess"?{__typename:"NegotiableQuoteUidOperationSuccess",quoteUid:t==null?void 0:t.quote_uid}:{__typename:"CloseNegotiableQuoteOperationFailure",quoteUid:t==null?void 0:t.quote_uid,errors:((t==null?void 0:t.errors)||[]).map(l=>({__typename:l==null?void 0:l.__typename,message:l==null?void 0:l.message,uid:l==null?void 0:l.uid}))})},d=i.operationResults.filter(t=>t.__typename==="CloseNegotiableQuoteOperationFailure").map(t=>t);if(d.length>0){const t=d.map(n=>n.errors&&n.errors.length>0?n.errors.map(u=>u.message||`Failed to close quote ${n.quoteUid}`).join(", "):`Failed to close quote ${n.quoteUid}`).join("; ");throw new Error(t)}const r=i.operationResults.filter(t=>t.__typename==="NegotiableQuoteUidOperationSuccess").map(t=>t.quoteUid);return r.length>0&&p.emit("quote-management/negotiable-quote-closed",{closedQuoteUids:r,resultStatus:i.resultStatus}),i}catch(e){return p.emit("quote-management/negotiable-quote-close-error",{error:e instanceof Error?e:new Error(String(e)),attemptedQuoteUids:a}),Promise.reject(e)}},b=`
|
|
95
95
|
mutation CREATE_QUOTE_TEMPLATE_MUTATION($cartId: ID!) {
|
|
96
96
|
requestNegotiableQuoteTemplateFromQuote(input: { cart_id: $cartId }) {
|
|
97
97
|
...NegotiableQuoteTemplateFragment
|
|
@@ -99,7 +99,7 @@ import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from".
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
${U}
|
|
102
|
-
`,L=async
|
|
102
|
+
`,L=async s=>{var a;if(!_.authenticated)throw new Error("Unauthorized");if(!s)throw new Error("Cart ID is required");try{const o=await E(b,{variables:{cartId:s}});if(!((a=o==null?void 0:o.data)!=null&&a.requestNegotiableQuoteTemplateFromQuote))throw new Error("Failed to create quote template");const e=Q(o.data.requestNegotiableQuoteTemplateFromQuote);if(!e)throw new Error("Failed to transform quote template data");return p.emit("quote-management/quote-template-data",{quoteTemplate:e,permissions:_.permissions}),e}catch(o){return Promise.reject(o)}},I=`
|
|
103
103
|
mutation renameNegotiableQuote($input: RenameNegotiableQuoteInput!) {
|
|
104
104
|
renameNegotiableQuote(input: $input) {
|
|
105
105
|
quote {
|
|
@@ -108,7 +108,7 @@ import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from".
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
${g}
|
|
111
|
-
`,j=async
|
|
111
|
+
`,j=async s=>{const{quoteUid:a,quoteName:o,quoteComment:e}=s;if(!a)throw new Error("Quote UID is required");if(!o)throw new Error("Quote name is required");return E(I,{variables:{input:{quote_uid:a,quote_name:o,quote_comment:e||""}}}).then(m=>{var r,t;const{errors:i}=m;if(i){const n=i.map(u=>u.message).join("; ");throw new Error(`Failed to rename quote: ${n}`)}const d=q((t=(r=m.data)==null?void 0:r.renameNegotiableQuote)==null?void 0:t.quote);if(!d)throw new Error("Failed to transform quote data: Invalid response structure");return p.emit("quote-management/quote-renamed",{quote:d,input:{quoteUid:a,quoteName:o,quoteComment:e}}),d})},O=`
|
|
112
112
|
mutation DUPLICATE_NEGOTIABLE_QUOTE_MUTATION($quoteUid: ID!, $duplicatedQuoteUid: ID!) {
|
|
113
113
|
duplicateNegotiableQuote(input: { quote_uid: $quoteUid, duplicated_quote_uid: $duplicatedQuoteUid }) {
|
|
114
114
|
quote {
|
|
@@ -117,5 +117,5 @@ import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from".
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
${g}
|
|
120
|
-
`,P=async
|
|
120
|
+
`,P=async s=>{if(!_.authenticated)throw new Error("Unauthorized");const{quoteUid:a,duplicatedQuoteUid:o,hasOutOfStockItems:e}=s;if(!a||!a.trim())throw new Error("Quote UID is required");if(!o||!o.trim())throw new Error("Duplicated Quote UID is required");return E(O,{variables:{quoteUid:a,duplicatedQuoteUid:o}}).then(c=>{var d,r;const{errors:m}=c;if(m){const t=m.map(n=>n.message).join("; ");throw new Error(`Failed to duplicate quote: ${t}`)}const i=q((r=(d=c.data)==null?void 0:d.duplicateNegotiableQuote)==null?void 0:r.quote);if(!i)throw new Error("Failed to transform quote data: Invalid response structure");return p.emit("quote-management/quote-duplicated",{quote:i,input:{quoteUid:a,duplicatedQuoteUid:o},hasOutOfStockItems:e}),i})};export{L as a,P as b,v as c,M as d,S as g,j as r,R as s};
|
|
121
121
|
//# sourceMappingURL=duplicateNegotiableQuote.js.map
|