@dropins/storefront-quote-management 1.0.0-beta5 → 1.0.0-beta6

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/LICENSE.md CHANGED
@@ -1,13 +1,12 @@
1
-
2
- Last Updated: 28 October 2024
1
+ Last Updated: 8 December 2025
3
2
 
4
- ADOBE COMMERCE DROP-IN LICENSE AGREEMENT
3
+ **ADOBE COMMERCE DROP-IN LICENSE AGREEMENT**
5
4
 
6
- applicable to Adobe Commerce Customers
5
+ applicable to Adobe Commerce as a Cloud Service and Adobe Commerce Optimizer Customers
7
6
 
8
7
  **Effective Date:** first date you download or use the Drop-in
9
8
 
10
- NOTICE TO USER: The Adobe Commerce Drop-in (Drop-in) is licensed to you subject to the terms and conditions below which form a binding agreement between you and Adobe. **By downloading, installing, or making use of any portion of the Drop-in, you are agreeing to the following terms and conditions. If you do not agree to the terms and conditions below, do not use the Drop-in**. If you agree to be bound by this agreement on behalf of your employer or other entity, you must have the legal authority to do so. If you are not authorized to so bind your employer or such entity, do not download and do not use the Drop-in.
9
+ NOTICE TO USER: The Adobe Commerce Drop-ins are licensed only for use with Adobe Commerce as a Cloud Service and Adobe Commerce Optimizer. The Adobe Commerce Drop-in ("Drop-in") is licensed to you subject to the terms and conditions below which form a binding agreement between you and Adobe. **By downloading, installing, or making use of any portion of the Drop-in, you are agreeing to the following terms and conditions. If you do not agree to the terms and conditions below, do not use the Drop-in**. If you agree to be bound by this agreement on behalf of your employer or other entity, you must have the legal authority to do so. If you are not authorized to so bind your employer or such entity, do not download and do not use the Drop-in.
11
10
 
12
11
  Your access to and use of the Drop-in is governed by the Adobe Enterprise Licensing Terms previously agreed to by you and Adobe or an authorized Adobe Reseller in a separate agreement. If you have not previously agreed to licensing terms then your installation and use of the Drop-in is subject to the current applicable Adobe Enterprise Licensing Terms available at <http://www.adobe.com/legal/terms/enterprise-licensing.html>. You agree that this agreement will have the same effect as any written negotiated agreement signed by you.
13
12
 
@@ -15,7 +14,7 @@ By downloading, installing or making use of any portion of the Drop-in, you acce
15
14
 
16
15
  This agreement is enforceable against any person or entity that installs and uses the Drop-in and any person or entity (e.g., system integrator, consultant or contractor) that installs or uses the drop-in on another person's or entity's behalf (e.g., Adobe Customer).
17
16
 
18
- Notice to U.S. Government End Users: Products and services are Commercial Product(s),” and Commercial Service(s) as those terms are defined at 48 C.F.R. section 2.101, consisting of Commercial Computer Software and Commercial Computer Software Documentation,” as the terms are used in 48 C.F.R. section 12.212 or 48 C.F.R. section 227.7202, as applicable. Customer agrees, consistent with 48 C.F.R. section 12.212 or 48 C.F.R. sections 227.7202-1 through 227.72024, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (A) only as Commercial Products and Services; and (B) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished rights are reserved under the copyright laws of the United States.
17
+ Notice to U.S. Government End Users: Products and services are "Commercial Product(s)," and "Commercial Service(s)" as those terms are defined at 48 C.F.R. section 2.101, consisting of "Commercial Computer Software" and "Commercial Computer Software Documentation," as the terms are used in 48 C.F.R. section 12.212 or 48 C.F.R. section 227.7202, as applicable. Customer agrees, consistent with 48 C.F.R. section 12.212 or 48 C.F.R. sections 227.7202-1 through 227.72024, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (A) only as Commercial Products and Services; and (B) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished rights are reserved under the copyright laws of the United States.
19
18
 
20
19
  **ADOBE COMMERCE DROP-IN LICENSE AGREEMENT**
21
20
 
@@ -23,21 +22,21 @@ applicable to Developers
23
22
 
24
23
  **Effective Date:** first date you download or use the Drop-in
25
24
 
26
- The Adobe Commerce Drop-in (Drop-in) is licensed to you subject to the terms and conditions below which form a binding agreement between you and Adobe. **By downloading, installing, or making use of any portion of the Drop-in, you are agreeing to the following terms and conditions. If you do not agree to the terms and conditions below, do not use the Drop-in**. If you agree to be bound by this agreement on behalf of your employer or other entity, you must have the legal authority to do so. If you are not authorized to so bind your employer or such entity, do not download and do not use the Drop-in.
25
+ The Adobe Commerce Drop-ins are licensed only for use with Adobe Commerce as a Cloud Service and Adobe Commerce Optimizer. The Adobe Commerce Drop-in ("Drop-in") is licensed to you subject to the terms and conditions below which form a binding agreement between you and Adobe. **By downloading, installing, or making use of any portion of the Drop-in, you are agreeing to the following terms and conditions. If you do not agree to the terms and conditions below, do not use the Drop-in**. If you agree to be bound by this agreement on behalf of your employer or other entity, you must have the legal authority to do so. If you are not authorized to so bind your employer or such entity, do not download and do not use the Drop-in.
27
26
 
28
27
  **AGREED TERMS AND CONDITIONS**
29
28
 
30
29
  1. **DEFINITIONS**.
31
30
 
32
- 1.1 “**Adobe**” means collectively, Adobe Inc., a company incorporated in Delaware, U.S.A., having a place of business at 345 Park Avenue, San Jose, California USA 95110-2704, U.S.A. (“**Adobe US**”) and Adobe Systems Software Ireland, company incorporated in Ireland, having a place of business 4-6 Riverwalk, City West Business Campus, Saggart, Dublin 24, Ireland (“**Adobe Ireland**”).__
31
+ 1.1 "**Adobe**" means collectively, Adobe Inc., a company incorporated in Delaware, U.S.A., having a place of business at 345 Park Avenue, San Jose, California USA 95110-2704, U.S.A. ("**Adobe US**") and Adobe Systems Software Ireland, company incorporated in Ireland, having a place of business 4-6 Riverwalk, City West Business Campus, Saggart, Dublin 24, Ireland ("**Adobe Ireland**").
33
32
 
34
- 1.2 “**Adobe Product(s)**” means software applications, programs and other technologies not included in or with the Drop-in which are or may be made available by Adobe for licensing to the general public. This agreement does not govern use of Adobe Products. See the end user license agreement accompanying an Adobe Product for terms governing its use.
33
+ 1.2 "**Adobe Product(s)**" means software applications, programs and other technologies not included in or with the Drop-in which are or may be made available by Adobe for licensing to the general public. This agreement does not govern use of Adobe Products. See the end user license agreement accompanying an Adobe Product for terms governing its use.
35
34
 
36
- 1.3 “**Developer Product(s)**” means any software application(s), program(s) and other teconolog(y/ies) you develop with use of the Drop-in to function or interoperate with Adobe Products.
35
+ 1.3 "**Developer Product(s)**" means any software application(s), program(s) and other technolog(y/ies) you develop with use of the Drop-in to function or interoperate with Adobe Products.
37
36
 
38
- 1.4 “**Intellectual Property Rights**” means copyright, moral rights, trademark, trade dress, patent, trade secret, unfair competition, and any other intellectual and proprietary rights.
37
+ 1.4 "**Intellectual Property Rights**" means copyright, moral rights, trademark, trade dress, patent, trade secret, unfair competition, and any other intellectual and proprietary rights.
39
38
 
40
- 1.5 “**Adobe Commerce Drop-in**” or Drop-in means all items comprising the application and all associated materials licensed to you by Adobe as part of the Drop-in, including all Drop-in system files, tools, programs and utilities, as well as any plug-ins or other application programming interfaces, header or JAR files (“**API**”), sample images, sounds, or similar assets (“**Content** **Files**”), software code samples, runtimes and libraries, including any portion(s) that is modified by you, or merged or incorporated with your Developer Products (“**Sample Code**”), and any related documentation, technical specifications, notes and explanatory materials, as well any modifications, updates, upgrades, or copies of, any of the foregoing items, that may be made available by Adobe, whether online or recorded on media, or manually downloaded by you.
39
+ 1.5 "**Adobe Commerce Drop-in**" or "Drop-in" means all items comprising the application and all associated materials licensed to you by Adobe as part of the Drop-in, including all Drop-in system files, tools, programs and utilities, as well as any plug-ins or other application programming interfaces, header or JAR files ("**API**"), sample images, sounds, or similar assets ("**Content** **Files**"), software code samples, runtimes and libraries, including any portion(s) that is modified by you, or merged or incorporated with your Developer Products ("**Sample Code**"), and any related documentation, technical specifications, notes and explanatory materials, as well any modifications, updates, upgrades, or copies of, any of the foregoing items, that may be made available by Adobe, whether online or recorded on media, or manually downloaded by you.
41
40
 
42
41
  2. **LICENSES GRANTED TO YOU**.
43
42
 
@@ -51,23 +50,23 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
51
50
 
52
51
  3. **SCOPE OF LICENSE; LIMITATIONS AND RESTRICTIONS**
53
52
 
54
- 3.1 You may not distribute the Drop-ins or any of its component parts to interoperate with or to run on a platform other than the Adobe-approved platform.
53
+ 3.1 You may not distribute the Drop-ins or any of its component parts to interoperate with or to run on a platform other than Adobe Commerce as a Cloud Service and Adobe Commerce Optimizer.
55
54
 
56
55
  3.2 Third-Party Software. The Drop-ins may contain third-party software, subject to additional terms and conditions, available at <http://www.adobe.com/go/thirdparty>; and
57
56
 
58
- 3.3 You may not modify, port, adapt, creative derivate works, redistribute, or translate any portion of this Drop-in; or add or delete any Drop-in program files that would in any way result in modifying the functionality or appearance of any element of the Adobe Products.
57
+ 3.3 You may not modify, port, adapt, create derivate works, redistribute, or translate any portion of this Drop-in; or add or delete any Drop-in program files that would in any way result in modifying the functionality or appearance of any element of the Adobe Products.
59
58
 
60
- 3.4 You may not reverse engineer, decompile, disassemble, or otherwise attempt to discover the source code of, any portion of the Drop-in, except and only to the extent that applicable laws of the jurisdiction where you are located grant you the right to decompile the Drop-in in order to obtain information necessary to render the Drop-in interoperable with other software; in which case you must first request the information from Adobe in writing and Adobe may, in its discretion, either provide such information to you or impose reasonable conditions, including reasonable fees, on your use of the Drop-in to ensure that Adobes and its licensors Intellectual Proprietary Rights in the Drop-in are protected.
59
+ 3.4 You may not reverse engineer, decompile, disassemble, or otherwise attempt to discover the source code of, any portion of the Drop-in, except and only to the extent that applicable laws of the jurisdiction where you are located grant you the right to decompile the Drop-in in order to obtain information necessary to render the Drop-in interoperable with other software; in which case you must first request the information from Adobe in writing and Adobe may, in its discretion, either provide such information to you or impose reasonable conditions, including reasonable fees, on your use of the Drop-in to ensure that Adobe's and its licensors' Intellectual Proprietary Rights in the Drop-in are protected.
61
60
 
62
- 3.5 You may not unbundle, repackage, distribute, rent, lease, offer, sell, resale, sublicense, assign or transfer all, or any component parts of the Drop-in, or any of your rights in the Drop-in, nor authorize any portion of the Drop-in to be copied onto anothers device, computer or platform, including on a service bureau basis to other providers (i.e., volume printing, banking, payroll service providers, etc) who provide you free or fee-based business services.
61
+ 3.5 You may not unbundle, repackage, distribute, rent, lease, offer, sell, resale, sublicense, assign or transfer all, or any component parts of the Drop-in, or any of your rights in the Drop-in, nor authorize any portion of the Drop-in to be copied onto another's device, computer or platform, including on a service bureau basis to other providers (i.e., volume printing, banking, payroll service providers, etc) who provide you free or fee-based business services.
63
62
 
64
63
  4. **VIRAL OPEN SOURCE SOFTWARE AND SERVICES**
65
64
 
66
- You are not license to (and you agree that you will not) merge, integrate or use the Drop-in with any Viral Open Source Software or Viral Service, or otherwise take any action that could require disclosure, distribution, or licensing of all or any part of the Drop-in in source code form for any purpose whatsoever. For purposes of this Section, “**Viral Open Source Software**” means software licensed under the GNU General Public License, the GNU Affero General Public License (AGPL), the GNU Lesser General Public License (LGPL), or any other license terms that would require, or condition your use, modification, or distribution of such licensed software on the disclosure, distribution, or licensing of any other software in source code form, for the purpose of making derivative works, or at no charge, and “**Viral Service**” means any service that contains any viruses, Trojan horses, worms, time bombs, cancelbots or other computer programming routines that are intended to damage, detrimentally interfere with, surreptitiously intercept, expropriate or deprive owners possession of any system, data or personal information, or that in any way violates any law, statute, ordinance, regulation or rights (including any law, regulations or rights respecting intellectual property, computer spyware, privacy, export control, unfair competition, antidiscrimination or false advertising), or otherwise interferes with the operability of Adobe Products or third-party programs or software.
65
+ You are not licensed to (and you agree that you will not) merge, integrate or use the Drop-in with any Viral Open Source Software or Viral Service, or otherwise take any action that could require disclosure, distribution, or licensing of all or any part of the Drop-in in source code form for any purpose whatsoever. For purposes of this Section, "**Viral Open Source Software**" means software licensed under the GNU General Public License, the GNU Affero General Public License (AGPL), the GNU Lesser General Public License (LGPL), or any other license terms that would require, or condition your use, modification, or distribution of such licensed software on the disclosure, distribution, or licensing of any other software in source code form, for the purpose of making derivative works, or at no charge, and "**Viral Service**" means any service that contains any viruses, Trojan horses, worms, time bombs, cancelbots or other computer programming routines that are intended to damage, detrimentally interfere with, surreptitiously intercept, expropriate or deprive owners' possession of any system, data or personal information, or that in any way violates any law, statute, ordinance, regulation or rights (including any law, regulations or rights respecting intellectual property, computer spyware, privacy, export control, unfair competition, antidiscrimination or false advertising), or otherwise interferes with the operability of Adobe Products or third-party programs or software.
67
66
 
68
67
  5. **NON-BLOCKING OF ADOBE DEVELOPMENT**
69
68
 
70
- You acknowledge that Adobe is currently developing or may develop technologies and Adobe Products in the future that have, or may have, design or functionality similar to Developer Products that you may develop based on the license granted to you in this agreement. Nothing in this agreement will impair, limit or curtail Adobes right to continue with its development, maintenance or distribution of Adobe Products. You agree that you will not assert in any way any patent owned by you arising out of or in connection with your use of the Drop-in, or any Drop-in modifications made by you, against Adobe, its customers, subsidiaries or affiliates, or any of their customers, direct or indirect, agents and contractors for the manufacture, use, import, license, offer for sale, or sale of any Adobe Products.
69
+ You acknowledge that Adobe is currently developing or may develop technologies and Adobe Products in the future that have, or may have, design or functionality similar to Developer Products that you may develop based on the license granted to you in this agreement. Nothing in this agreement will impair, limit or curtail Adobe's right to continue with its development, maintenance or distribution of Adobe Products. You agree that you will not assert in any way any patent owned by you arising out of or in connection with your use of the Drop-in, or any Drop-in modifications made by you, against Adobe, its customers, subsidiaries or affiliates, or any of their customers, direct or indirect, agents and contractors for the manufacture, use, import, license, offer for sale, or sale of any Adobe Products.
71
70
 
72
71
  6. **OWNERSHIP; INTELLECTUAL PROPERTY RIGHTS**
73
72
 
@@ -75,13 +74,13 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
75
74
 
76
75
  6.2 The Drop-in, or any of its component parts, may be supplied to you with certain accompanying proprietary notices, including patent, copyright and trademark notices. You agree to protect all copyright and other ownership interests of Adobe and its licensors in the Drop-in supplied to you under this agreement; to preserve exactly (and not remove or alter) all proprietary notices displayed in or on the Drop-in; to reproduce the same proprietary notices in all copies you make of any portion of the Drop-in.
77
76
 
78
- 6.3 You agree to include in your Developer Products Adobes copyright notices, wherever such notices are customarily posted, in substantially the following form: _Portions of software used to develop this product copyrighted by Adobe and its licensors. All Rights Reserved_.
77
+ 6.3 You agree to include in your Developer Products Adobe's copyright notices, wherever such notices are customarily posted, in substantially the following form: _Portions of software used to develop this product copyrighted by Adobe and its licensors. All Rights Reserved_.
79
78
 
80
79
  6.4 Nothing in this agreement gives you a right to use the name, logo or trademarks of Adobe or its licensors to market your Developer Products.
81
80
 
82
81
  7. **CONFIDENTIAL INFORMATION**
83
82
 
84
- With respect to the API, and any portion, included in the Drop-in (for purposes of this Section, “**Adobe Confidential Information**”), you will treat the Adobe Confidential Information, and exercise the same degree of care to protect it, as you afford to your own confidential information. Your obligations under this Section will terminate when you can document that (a) the Adobe Confidential Information was in the public domain at or subsequent to the time Adobe communicated or provided it to you with no fault of your own; (b) your employees or agents developed independently without reference to any Adobe Confidential Information Adobe communicated or provided to you; or (c) your communication of Adobe Confidential Information was in response to a valid order by a court or other governmental body, was otherwise required by law, or was necessary to establish the rights of a party under this agreement.
83
+ With respect to the API, and any portion, included in the Drop-in (for purposes of this Section, "**Adobe Confidential Information**"), you will treat the Adobe Confidential Information, and exercise the same degree of care to protect it, as you afford to your own confidential information. Your obligations under this Section will terminate when you can document that (a) the Adobe Confidential Information was in the public domain at or subsequent to the time Adobe communicated or provided it to you with no fault of your own; (b) your employees or agents developed independently without reference to any Adobe Confidential Information Adobe communicated or provided to you; or (c) your communication of Adobe Confidential Information was in response to a valid order by a court or other governmental body, was otherwise required by law, or was necessary to establish the rights of a party under this agreement.
85
84
 
86
85
  8. **TERM; TERMINATION**
87
86
 
@@ -91,13 +90,13 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
91
90
 
92
91
  You expressly understand and agree that, to the maximum extent permitted by applicable law:
93
92
 
94
- 9.1 **Use OF THE DROP-IN is entirely at your own risk. The Drop-in is provided by Adobe AS-IS and with all faults. Adobe and its licensors are not liable to you or anyone else for any special, incidental, indirect, consequential, or punitive damages whatsoever (even if Adobe has been advised of the possibility of such damages), including (a) damages resulting from loss of use, data, or profits, whether or not foreseeable, (b) damages based on any theory of liability, including breach of contract or warranty, negligence or other tortious action, or (c) damages arising from any other claim arising out of or in connection with your use of the Drop-in.**
93
+ 9.1 **Use of the DROP-IN is entirely at your own risk. The Drop-in is provided by Adobe "AS-IS" and with all faults. Adobe and its licensors are not liable to you or anyone else for any special, incidental, indirect, consequential, or punitive damages whatsoever (even if Adobe has been advised of the possibility of such damages), including (a) damages resulting from loss of use, data, or profits, whether or not foreseeable, (b) damages based on any theory of liability, including breach of contract or warranty, negligence or other tortious action, or (c) damages arising from any other claim arising out of or in connection with your use of the Drop-in.**
95
94
 
96
- 9.2 **Adobes total liability in any matter arising out of or related to these terms is limited to US $100. This limitation will apply even if Adobe has been advised of the possibility of such damages and regardless of any failure of the essential purpose of any limited remedy.**
95
+ 9.2 **Adobe's total liability in any matter arising out of or related to these terms is limited to US $100. This limitation will apply even if Adobe has been advised of the possibility of such damages and regardless of any failure of the essential purpose of any limited remedy.**
97
96
 
98
97
  10. **INDEMNIFICATION**
99
98
 
100
- To the maximum extent permitted by law, you agree to indemnify Adobe, its subsidiaries, affiliates, officers, agents, employees, partners, licensors, or suppliers from any claim or demand, including reasonable attorneys fees, that arise from the use and distribution of your Developer Products that contain or are based upon any portion of the Drop-in, or from your violation of the terms of this agreement.
99
+ To the maximum extent permitted by law, you agree to indemnify Adobe, its subsidiaries, affiliates, officers, agents, employees, partners, licensors, or suppliers from any claim or demand, including reasonable attorneys' fees, that arise from the use and distribution of your Developer Products that contain or are based upon any portion of the Drop-in, or from your violation of the terms of this agreement.
101
100
 
102
101
  11. **DISPUTE RESOLUTION**
103
102
 
@@ -105,7 +104,7 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
105
104
 
106
105
  11.2 **Venue.** You agree that any claim or dispute you may have against Adobe must be resolved by a court located in Santa Clara County, California, United States of America. You agree to submit to the personal jurisdiction of the courts located in Santa Clara County, California, United States of America when the laws of California apply, and the courts of Dublin, Ireland, when the laws of Ireland applies, for the purpose of litigating such claims or disputes. The parties specifically disclaim the U.N. Convention on Contracts for the International Sale of Goods.
107
106
 
108
- 11.3 **Injunctive Relief.** Notwithstanding the foregoing, in the event of your or others unauthorized access to or use of the Drop-in in violation of this Agreement, you agree that Adobe is entitled to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
107
+ 11.3 **Injunctive Relief.** Notwithstanding the foregoing, in the event of your or others' unauthorized access to or use of the Drop-in in violation of this Agreement, you agree that Adobe is entitled to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
109
108
 
110
109
  12. **EXPORT RULES**
111
110
 
@@ -113,7 +112,7 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
113
112
 
114
113
  13. **NOTICE TO U.S. GOVERNMENT END USERS**
115
114
 
116
- Products and services are Commercial Product(s),” and Commercial Service(s) as those terms are defined at 48 C.F.R. section 2.101, consisting of Commercial Computer Software and Commercial Computer Software Documentation,” as the terms are used in 48 C.F.R. section 12.212 or 48 C.F.R. section 227.7202, as applicable. Customer agrees, consistent with 48 C.F.R. section 12.212 or 48 C.F.R. sections 227.7202-1 through 227.72024, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (A) only as Commercial Products and Services; and (B) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished rights are reserved under the copyright laws of the United States.
115
+ Products and services are "Commercial Product(s)," and "Commercial Service(s)" as those terms are defined at 48 C.F.R. section 2.101, consisting of "Commercial Computer Software" and "Commercial Computer Software Documentation," as the terms are used in 48 C.F.R. section 12.212 or 48 C.F.R. section 227.7202, as applicable. Customer agrees, consistent with 48 C.F.R. section 12.212 or 48 C.F.R. sections 227.7202-1 through 227.72024, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (A) only as Commercial Products and Services; and (B) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished rights are reserved under the copyright laws of the United States.
117
116
 
118
117
  14. **GENERAL PROVISIONS**
119
118
 
@@ -125,4 +124,4 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
125
124
 
126
125
  14.4 **Entire Agreement.** This Agreement is the entire agreement, superseding any prior written or oral agreements, between you and Adobe relating to the Drop-in.
127
126
 
128
- Adobe Commerce Drop-in License Agreement_en_US-20241028_v1
127
+ Adobe Commerce Drop-in License Agreement_en_US-20251208_v1
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{FetchGraphQL as x}from"@dropins/tools/fetch-graphql.js";import{s as p}from"./state.js";var _=(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))(_||{});const{setEndpoint:F,setFetchGraphQlHeader:L,removeFetchGraphQlHeader:M,setFetchGraphQlHeaders:B,fetchGraphQl:G,getConfig:z}=new x().getMethods();function b(e){var a,n,c,i,u,l,s;return{uid:e.uid,createdAt:e.created_at,author:{firstname:e.author.firstname,lastname:e.author.lastname},changeType:e.change_type,changes:{commentAdded:((a=e.changes)==null?void 0:a.comment_added)&&{comment:e.changes.comment_added.comment},customChanges:((n=e.changes)==null?void 0:n.custom_changes)&&{new_value:e.changes.custom_changes.new_value,old_value:e.changes.custom_changes.old_value,title:e.changes.custom_changes.title},expiration:((c=e.changes)==null?void 0:c.expiration)&&{newExpiration:e.changes.expiration.new_expiration,oldExpiration:e.changes.expiration.old_expiration},productsRemoved:((i=e.changes)==null?void 0:i.products_removed)&&{productsRemovedFromCatalog:e.changes.products_removed.products_removed_from_catalog||[],productsRemovedFromQuote:e.changes.products_removed.products_removed_from_quote||[]},statuses:((u=e.changes)==null?void 0:u.statuses)&&{changes:((l=e.changes.statuses.changes)==null?void 0:l.map(r=>({newStatus:r==null?void 0:r.new_status,oldStatus:r==null?void 0:r.old_status})))||[]},total:((s=e.changes)==null?void 0:s.total)&&e.changes.total.new_price&&e.changes.total.old_price&&{newPrice:{value:e.changes.total.new_price.value,currency:e.changes.total.new_price.currency},oldPrice:{value:e.changes.total.old_price.value,currency:e.changes.total.old_price.currency}}}}}function h(e){if(e)return e.map(b)}function m(e,a){return e!=null&&e.length&&[...e].sort((c,i)=>i.quantity-c.quantity).find(c=>a>=c.quantity)||null}function y(e){var n,c,i,u;const a=p.config;return{src:a!=null&&a.useConfigurableParentThumbnail?e.product.thumbnail.url:((c=(n=e.configured_variant)==null?void 0:n.thumbnail)==null?void 0:c.url)||e.product.thumbnail.url,alt:a!=null&&a.useConfigurableParentThumbnail?e.product.thumbnail.label:((u=(i=e.configured_variant)==null?void 0:i.thumbnail)==null?void 0:u.label)||e.product.thumbnail.label}}function T(e){var a;return((a=e.links)==null?void 0:a.length)>0?{count:e.links.length,result:e.links.map(n=>n.title).join(", ")}:null}function I(e){var l,s,r,t;const a=e.quantity,n=e.__typename==="ConfigurableCartItem",c=n?(l=e.configured_variant)==null?void 0:l.price_tiers:e.product.price_tiers,i=n?(s=e.configured_variant)==null?void 0:s.price_range:e.product.price_range,u=m(c,a);return u?u.discount.amount_off>0:(((t=(r=i==null?void 0:i.maximum_price)==null?void 0:r.discount)==null?void 0:t.amount_off)??0)>0}function D(e){var i,u,l,s,r,t,o,d;const a=e.quantity,n=m(e.product.price_tiers,a);if(n)return Math.round(n.discount.percent_off);let c;if(e.__typename==="ConfigurableCartItem")c=(s=(l=(u=(i=e==null?void 0:e.configured_variant)==null?void 0:i.price_range)==null?void 0:u.maximum_price)==null?void 0:l.discount)==null?void 0:s.percent_off;else{if(e.__typename==="BundleCartItem")return;c=(d=(o=(t=(r=e==null?void 0:e.product)==null?void 0:r.price_range)==null?void 0:t.maximum_price)==null?void 0:o.discount)==null?void 0:d.percent_off}if(c!==0)return Math.round(c)}function E(e){var a,n,c,i;return e.__typename==="ConfigurableCartItem"?{value:(n=(a=e.configured_variant)==null?void 0:a.price_range)==null?void 0:n.maximum_price.regular_price.value,currency:(i=(c=e.configured_variant)==null?void 0:c.price_range)==null?void 0:i.maximum_price.regular_price.currency}:{value:e.prices.original_item_price.value,currency:e.prices.original_item_price.currency}}function P(e){var c,i,u,l,s,r;let a,n;if(a=((i=(c=e==null?void 0:e.prices)==null?void 0:c.original_row_total)==null?void 0:i.value)-((l=(u=e==null?void 0:e.prices)==null?void 0:u.row_total)==null?void 0:l.value),n=(r=(s=e==null?void 0:e.prices)==null?void 0:s.row_total)==null?void 0:r.currency,a!==0)return{value:a,currency:n}}function w(e){var a,n,c,i,u,l,s,r;return{itemType:e.__typename,uid:e.uid,product:{uid:e.product.uid,sku:e.product.sku,name:e.product.name,priceRange:{maximumPrice:{regularPrice:{value:e.product.price_range.maximum_price.regular_price.value,currency:e.product.price_range.maximum_price.regular_price.currency}}}},image:y(e),links:T(e),discounted:I(e),discountedTotal:{value:e.prices.row_total.value,currency:e.prices.row_total.currency},catalogDiscount:{amountOff:e.prices.catalog_discount.amount_off,percentOff:e.prices.catalog_discount.percent_off},discounts:((n=(a=e.prices)==null?void 0:a.discounts)==null?void 0:n.map(t=>({label:t.label,value:t.value,amount:{value:t.amount.value,currency:t.amount.currency}})))??[],discountPercentage:D(e),insufficientQuantity:(e.__typename==="ConfigurableCartItem"?((c=e.configured_variant)==null?void 0:c.stock_status)??e.product.stock_status:e.product.stock_status)==="IN_STOCK"&&!e.is_available,outOfStock:e.product.stock_status==="OUT_OF_STOCK",stockStatus:e.product.stock_status,quantity:e.quantity,prices:{regularPrice:E(e),priceIncludingTax:{value:e.prices.price_including_tax.value,currency:e.prices.price_including_tax.currency},originalItemPrice:{value:e.prices.original_item_price.value,currency:e.prices.original_item_price.currency},originalRowTotal:{value:e.prices.original_row_total.value,currency:e.prices.original_row_total.currency},rowTotal:{value:e.prices.row_total.value,currency:e.prices.row_total.currency},rowTotalIncludingTax:{value:e.prices.row_total_including_tax.value,currency:e.prices.row_total_including_tax.currency}},savingsAmount:P(e),noteFromBuyer:(i=e.note_from_buyer)==null?void 0:i.map(t=>({createdAt:t.created_at,creatorId:t.creator_id,creatorType:t.creator_type,negotiableQuoteItemUid:t.negotiable_quote_item_uid,note:t.note,noteUid:t.note_uid})),noteFromSeller:(u=e.note_from_seller)==null?void 0:u.map(t=>({createdAt:t.created_at,creatorId:t.creator_id,creatorType:t.creator_type,negotiableQuoteItemUid:t.negotiable_quote_item_uid,note:t.note,noteUid:t.note_uid})),configurableOptions:(l=e.configurable_options)==null?void 0:l.map(t=>({optionLabel:t.option_label,valueLabel:t.value_label})),bundleOptions:(s=e.bundle_options)==null?void 0:s.map(t=>({label:t.label,values:t.values.map(o=>({label:o.label,quantity:o.quantity,originalPrice:{value:o.original_price.value,currency:o.original_price.currency},price:{value:o.priceV2.value,currency:o.priceV2.currency}}))})),customizableOptions:(r=e.customizable_options)==null?void 0:r.map(t=>({type:t.type,label:t.label,values:t.values.map(o=>({label:o.label,value:o.value}))}))}}function C(e){return e?e.map(w):[]}const g=["DRAFT","UPDATED","DECLINED","EXPIRED","NEW","OPEN"];function A(e){if(!e.items)return 0;const a=p.config;return(a==null?void 0:a.quoteSummaryDisplayTotal)===0?e.items.length:(a==null?void 0:a.quoteSummaryDisplayTotal)===1?e.total_quantity:e.items.length}function O(e){return e.every(a=>!a.outOfStock&&!a.insufficientQuantity)}function R(e){var c,i,u,l,s;const a=v(e),n=C(e.items);return{uid:e.uid,name:e.name,createdAt:e.created_at,updatedAt:e.updated_at,expirationDate:e.expiration_date,status:a?_.NEW:e.status,isVirtual:!!e.is_virtual,salesRepName:e.sales_rep_name,buyer:{firstname:e.buyer.firstname,lastname:e.buyer.lastname},templateName:e.template_name,totalQuantity:A(e),comments:(c=e.comments)==null?void 0:c.map(r=>{const t={uid:r.uid,createdAt:r.created_at,author:{firstname:r.author.firstname,lastname:r.author.lastname},text:r.text};return Array.isArray(r.attachments)&&r.attachments.length>0&&(t.attachments=r.attachments.map(o=>({name:o.name,url:o.url}))),t}),prices:e.prices&&{appliedDiscounts:(i=e.prices.discounts)==null?void 0:i.map(r=>({amount:{value:r.amount.value,currency:r.amount.currency},label:r.label,coupon:r.coupon})),appliedTaxes:(u=e.prices.applied_taxes)==null?void 0:u.map(r=>({amount:{value:r.amount.value,currency:r.amount.currency},label:r.label})),discount:e.prices.discounts&&e.prices.grand_total&&f(e.prices.discounts,e.prices.grand_total.currency),grandTotal:e.prices.grand_total&&{value:e.prices.grand_total.value,currency:e.prices.grand_total.currency},grandTotalExcludingTax:e.prices.grand_total_excluding_tax&&{value:e.prices.grand_total_excluding_tax.value,currency:e.prices.grand_total_excluding_tax.currency},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},...k(e),totalTax:e.prices.applied_taxes&&e.prices.grand_total&&f(e.prices.applied_taxes,e.prices.grand_total.currency)},history:h(e.history),items:n,shippingAddresses:(l=e.shipping_addresses)==null?void 0:l.map(r=>{const t={uid:r.uid,firstname:r.firstname,lastname:r.lastname,company:r.company,street:r.street,city:r.city,postcode:r.postcode,country:{code:r.country.code,label:r.country.label},telephone:r.telephone};return r.region&&(t.region={code:r.region.code,label:r.region.label,regionId:r.region.region_id}),t}),canCheckout:["UPDATED","DECLINED"].includes(e.status)&&p.permissions.checkoutQuote&&((s=e.shipping_addresses)==null?void 0:s.length)>0&&O(n),canSendForReview:(a||g.includes(e.status))&&p.permissions.editQuote,canUpdateQuote:(a||g.includes(e.status))&&p.permissions.editQuote,canDelete:!["PENDING","SUBMITTED","ORDERED"].includes(e.status)&&p.permissions.deleteQuote,canClose:e.status?!["DRAFT","CLOSED","ORDERED","OPEN"].includes(e.status):!1,readOnly:!a&&["ORDERED","SUBMITTED","CLOSED","PENDING"].includes(e.status)||!p.permissions.editQuote}}function H(e){return e?R(e):null}function v(e){return e.status==="SUBMITTED"&&!(e.history??[]).some(a=>{var n,c;return a.change_type==="UPDATED"&&(((c=(n=a.changes)==null?void 0:n.statuses)==null?void 0:c.changes)??[]).length>0})}function S(e){const a=v(e);return{uid:e.uid,name:e.name,createdAt:e.created_at,updatedAt:e.updated_at,status:a?_.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 W(e){var c;if(!e)return null;const a={items:((c=e.items)==null?void 0:c.filter(i=>i==null?void 0:i.uid).map(S))||[],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},n=N(a);return{...a,paginationInfo:n||void 0}}function N(e){if(!(e!=null&&e.pageInfo)||!e.totalCount)return null;const{currentPage:a,pageSize:n,totalPages:c}=e.pageInfo,{totalCount:i}=e,u=i>0?(a-1)*n+1:0,l=Math.min(a*n,i);return{currentPage:a,totalCount:i,pageSize:n,startItem:u,endItem:l,totalPages:c,pageSizeOptions:[20,30,50,100,200]}}const V=()=>[20,30,50,100,200];function f(e,a){return e!=null&&e.length?e.reduce((n,c)=>({value:n.value+c.amount.value,currency:c.amount.currency}),{value:0,currency:a}):{value:0,currency:a}}function k(e){var c;if(!e||!((c=e.shipping_addresses)!=null&&c.length))return{};const n=e.shipping_addresses[0].selected_shipping_method;return n?{shippingIncludingTax:n.price_incl_tax&&{value:n.price_incl_tax.value,currency:n.price_incl_tax.currency},shippingExcludingTax:n.price_excl_tax&&{value:n.price_excl_tax.value,currency:n.price_excl_tax.currency}}:{}}export{C as a,h as b,N as c,W as d,L as e,G as f,V as g,B as h,z as i,M as r,F as s,H as t};
3
+ import{FetchGraphQL as b}from"@dropins/tools/fetch-graphql.js";import{s as _}from"./state.js";var d=(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))(d||{});const{setEndpoint:L,setFetchGraphQlHeader:M,removeFetchGraphQlHeader:B,setFetchGraphQlHeaders:G,fetchGraphQl:z,getConfig:H}=new b().getMethods();function h(e){var a,r,c,i,u,s,o;return{uid:e.uid,createdAt:e.created_at,author:{firstname:e.author.firstname,lastname:e.author.lastname},changeType:e.change_type,changes:{commentAdded:((a=e.changes)==null?void 0:a.comment_added)&&{comment:e.changes.comment_added.comment},customChanges:((r=e.changes)==null?void 0:r.custom_changes)&&{new_value:e.changes.custom_changes.new_value,old_value:e.changes.custom_changes.old_value,title:e.changes.custom_changes.title},expiration:((c=e.changes)==null?void 0:c.expiration)&&{newExpiration:e.changes.expiration.new_expiration,oldExpiration:e.changes.expiration.old_expiration},productsRemoved:((i=e.changes)==null?void 0:i.products_removed)&&{productsRemovedFromCatalog:e.changes.products_removed.products_removed_from_catalog||[],productsRemovedFromQuote:e.changes.products_removed.products_removed_from_quote||[]},statuses:((u=e.changes)==null?void 0:u.statuses)&&{changes:((s=e.changes.statuses.changes)==null?void 0:s.map(l=>({newStatus:l==null?void 0:l.new_status,oldStatus:l==null?void 0:l.old_status})))||[]},total:((o=e.changes)==null?void 0:o.total)&&e.changes.total.new_price&&e.changes.total.old_price&&{newPrice:{value:e.changes.total.new_price.value,currency:e.changes.total.new_price.currency},oldPrice:{value:e.changes.total.old_price.value,currency:e.changes.total.old_price.currency}}}}}function y(e){if(e)return e.map(h)}function v(e,a){return e!=null&&e.length&&[...e].sort((c,i)=>i.quantity-c.quantity).find(c=>a>=c.quantity)||null}function T(e){var r,c,i,u;const a=_.config;return{src:a!=null&&a.useConfigurableParentThumbnail?e.product.thumbnail.url:((c=(r=e.configured_variant)==null?void 0:r.thumbnail)==null?void 0:c.url)||e.product.thumbnail.url,alt:a!=null&&a.useConfigurableParentThumbnail?e.product.thumbnail.label:((u=(i=e.configured_variant)==null?void 0:i.thumbnail)==null?void 0:u.label)||e.product.thumbnail.label}}function I(e){var a;return((a=e.links)==null?void 0:a.length)>0?{count:e.links.length,result:e.links.map(r=>r.title).join(", ")}:null}function D(e){var s,o,l,t;const a=e.quantity,r=e.__typename==="ConfigurableCartItem",c=r?(s=e.configured_variant)==null?void 0:s.price_tiers:e.product.price_tiers,i=r?(o=e.configured_variant)==null?void 0:o.price_range:e.product.price_range,u=v(c,a);return u?u.discount.amount_off>0:(((t=(l=i==null?void 0:i.maximum_price)==null?void 0:l.discount)==null?void 0:t.amount_off)??0)>0}function E(e){var i,u,s,o,l,t,n,p;const a=e.quantity,r=v(e.product.price_tiers,a);if(r)return Math.round(r.discount.percent_off);let c;if(e.__typename==="ConfigurableCartItem")c=(o=(s=(u=(i=e==null?void 0:e.configured_variant)==null?void 0:i.price_range)==null?void 0:u.maximum_price)==null?void 0:s.discount)==null?void 0:o.percent_off;else{if(e.__typename==="BundleCartItem")return;c=(p=(n=(t=(l=e==null?void 0:e.product)==null?void 0:l.price_range)==null?void 0:t.maximum_price)==null?void 0:n.discount)==null?void 0:p.percent_off}if(c!==0)return Math.round(c)}function P(e){var a,r,c,i;return e.__typename==="ConfigurableCartItem"?{value:(r=(a=e.configured_variant)==null?void 0:a.price_range)==null?void 0:r.maximum_price.regular_price.value,currency:(i=(c=e.configured_variant)==null?void 0:c.price_range)==null?void 0:i.maximum_price.regular_price.currency}:{value:e.prices.original_item_price.value,currency:e.prices.original_item_price.currency}}function w(e){var c,i,u,s,o,l;let a,r;if(a=((i=(c=e==null?void 0:e.prices)==null?void 0:c.original_row_total)==null?void 0:i.value)-((s=(u=e==null?void 0:e.prices)==null?void 0:u.row_total)==null?void 0:s.value),r=(l=(o=e==null?void 0:e.prices)==null?void 0:o.row_total)==null?void 0:l.currency,a!==0)return{value:a,currency:r}}function C(e){var a,r,c,i,u,s,o,l;return{itemType:e.__typename,uid:e.uid,product:{uid:e.product.uid,sku:e.product.sku,name:e.product.name,priceRange:{maximumPrice:{regularPrice:{value:e.product.price_range.maximum_price.regular_price.value,currency:e.product.price_range.maximum_price.regular_price.currency}}}},image:T(e),links:I(e),discounted:D(e),discountedTotal:{value:e.prices.row_total.value,currency:e.prices.row_total.currency},catalogDiscount:{amountOff:e.prices.catalog_discount.amount_off,percentOff:e.prices.catalog_discount.percent_off},discounts:((r=(a=e.prices)==null?void 0:a.discounts)==null?void 0:r.map(t=>({label:t.label,value:t.value,amount:{value:t.amount.value,currency:t.amount.currency}})))??[],discountPercentage:E(e),insufficientQuantity:(e.__typename==="ConfigurableCartItem"?((c=e.configured_variant)==null?void 0:c.stock_status)??e.product.stock_status:e.product.stock_status)==="IN_STOCK"&&!e.is_available,outOfStock:e.product.stock_status==="OUT_OF_STOCK",stockStatus:e.product.stock_status,quantity:e.quantity,prices:{regularPrice:P(e),priceIncludingTax:{value:e.prices.price_including_tax.value,currency:e.prices.price_including_tax.currency},originalItemPrice:{value:e.prices.original_item_price.value,currency:e.prices.original_item_price.currency},originalRowTotal:{value:e.prices.original_row_total.value,currency:e.prices.original_row_total.currency},rowTotal:{value:e.prices.row_total.value,currency:e.prices.row_total.currency},rowTotalIncludingTax:{value:e.prices.row_total_including_tax.value,currency:e.prices.row_total_including_tax.currency}},savingsAmount:w(e),noteFromBuyer:(i=e.note_from_buyer)==null?void 0:i.map(t=>({createdAt:t.created_at,creatorId:t.creator_id,creatorType:t.creator_type,negotiableQuoteItemUid:t.negotiable_quote_item_uid,note:t.note,noteUid:t.note_uid})),noteFromSeller:(u=e.note_from_seller)==null?void 0:u.map(t=>({createdAt:t.created_at,creatorId:t.creator_id,creatorType:t.creator_type,negotiableQuoteItemUid:t.negotiable_quote_item_uid,note:t.note,noteUid:t.note_uid})),configurableOptions:(s=e.configurable_options)==null?void 0:s.map(t=>({optionLabel:t.option_label,valueLabel:t.value_label})),bundleOptions:(o=e.bundle_options)==null?void 0:o.map(t=>({label:t.label,values:t.values.map(n=>({label:n.label,quantity:n.quantity,originalPrice:{value:n.original_price.value,currency:n.original_price.currency},price:{value:n.priceV2.value,currency:n.priceV2.currency}}))})),customizableOptions:(l=e.customizable_options)==null?void 0:l.map(t=>({type:t.type,label:t.label,values:t.values.map(n=>({label:n.label,value:n.value}))}))}}function A(e){return e?e.map(C):[]}const f=["DRAFT","UPDATED","DECLINED","EXPIRED","NEW","OPEN"];function O(e){if(!e.items)return 0;const a=_.config;return(a==null?void 0:a.quoteSummaryDisplayTotal)===0?e.items.length:(a==null?void 0:a.quoteSummaryDisplayTotal)===1?e.total_quantity:e.items.length}function R(e){return e.every(a=>!a.outOfStock&&!a.insufficientQuantity)}function S(e){var i,u,s,o,l,t;const a=x(e),r=!!((i=e.template_name)!=null&&i.trim()),c=A(e.items);return{uid:e.uid,name:e.name,createdAt:e.created_at,updatedAt:e.updated_at,expirationDate:e.expiration_date,status:a?d.NEW:e.status,isVirtual:!!e.is_virtual,salesRepName:e.sales_rep_name,buyer:{firstname:e.buyer.firstname,lastname:e.buyer.lastname},templateName:e.template_name,totalQuantity:O(e),comments:(u=e.comments)==null?void 0:u.map(n=>{const p={uid:n.uid,createdAt:n.created_at,author:{firstname:n.author.firstname,lastname:n.author.lastname},text:n.text};return Array.isArray(n.attachments)&&n.attachments.length>0&&(p.attachments=n.attachments.map(g=>({name:g.name,url:g.url}))),p}),prices:e.prices&&{appliedDiscounts:(s=e.prices.discounts)==null?void 0:s.map(n=>({amount:{value:n.amount.value,currency:n.amount.currency},label:n.label,coupon:n.coupon})),appliedTaxes:(o=e.prices.applied_taxes)==null?void 0:o.map(n=>({amount:{value:n.amount.value,currency:n.amount.currency},label:n.label})),discount:e.prices.discounts&&e.prices.grand_total&&m(e.prices.discounts,e.prices.grand_total.currency),grandTotal:e.prices.grand_total&&{value:e.prices.grand_total.value,currency:e.prices.grand_total.currency},grandTotalExcludingTax:e.prices.grand_total_excluding_tax&&{value:e.prices.grand_total_excluding_tax.value,currency:e.prices.grand_total_excluding_tax.currency},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},...Q(e),totalTax:e.prices.applied_taxes&&e.prices.grand_total&&m(e.prices.applied_taxes,e.prices.grand_total.currency)},history:y(e.history),items:c,shippingAddresses:(l=e.shipping_addresses)==null?void 0:l.map(n=>{const p={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&&(p.region={code:n.region.code,label:n.region.label,regionId:n.region.region_id}),p}),canCheckout:["UPDATED","DECLINED"].includes(e.status)&&_.permissions.checkoutQuote&&((t=e.shipping_addresses)==null?void 0:t.length)>0&&R(c),canSendForReview:!r&&(a||f.includes(e.status))&&_.permissions.editQuote,canUpdateQuote:!r&&(a||f.includes(e.status))&&_.permissions.editQuote,canDelete:!r&&!["PENDING","SUBMITTED","ORDERED"].includes(e.status)&&_.permissions.deleteQuote,canClose:e.status?!r&&!["DRAFT","CLOSED","ORDERED","OPEN"].includes(e.status):!1,readOnly:r||!a&&["ORDERED","SUBMITTED","CLOSED","PENDING"].includes(e.status)||!_.permissions.editQuote}}function W(e){return e?S(e):null}function x(e){return e.status==="SUBMITTED"&&!(e.history??[]).some(a=>{var r,c;return a.change_type==="UPDATED"&&(((c=(r=a.changes)==null?void 0:r.statuses)==null?void 0:c.changes)??[]).length>0})}function N(e){const a=x(e);return{uid:e.uid,name:e.name,createdAt:e.created_at,updatedAt:e.updated_at,status:a?d.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 V(e){var c;if(!e)return null;const a={items:((c=e.items)==null?void 0:c.filter(i=>i==null?void 0:i.uid).map(N))||[],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=k(a);return{...a,paginationInfo:r||void 0}}function k(e){if(!(e!=null&&e.pageInfo)||!e.totalCount)return null;const{currentPage:a,pageSize:r,totalPages:c}=e.pageInfo,{totalCount:i}=e,u=i>0?(a-1)*r+1:0,s=Math.min(a*r,i);return{currentPage:a,totalCount:i,pageSize:r,startItem:u,endItem:s,totalPages:c,pageSizeOptions:[20,30,50,100,200]}}const X=()=>[20,30,50,100,200];function m(e,a){return e!=null&&e.length?e.reduce((r,c)=>({value:r.value+c.amount.value,currency:c.amount.currency}),{value:0,currency:a}):{value:0,currency:a}}function Q(e){var c;if(!e||!((c=e.shipping_addresses)!=null&&c.length))return{};const r=e.shipping_addresses[0].selected_shipping_method;return r?{shippingIncludingTax:r.price_incl_tax&&{value:r.price_incl_tax.value,currency:r.price_incl_tax.currency},shippingExcludingTax:r.price_excl_tax&&{value:r.price_excl_tax.value,currency:r.price_excl_tax.currency}}:{}}export{A as a,y as b,k as c,V as d,M as e,z as f,X as g,G as h,H as i,B as r,L as s,W as t};
4
4
  //# sourceMappingURL=transform-quote.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transform-quote.js","sources":["/@dropins/storefront-quote-management/src/data/models/negotiable-quote-model.ts","/@dropins/storefront-quote-management/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-history.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-quote-items.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\nexport 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 isVirtual: boolean;\n buyer: {\n firstname: string;\n lastname: string;\n };\n templateName?: string;\n totalQuantity: number;\n comments?: {\n uid: string;\n createdAt: string;\n author: {\n firstname: string;\n lastname: string;\n };\n text: string;\n attachments?: {\n name: string;\n url: string;\n }[];\n }[];\n history?: NegotiableQuoteHistoryEntry[];\n prices: {\n appliedDiscounts?: Discount[];\n appliedTaxes?: Tax[];\n discount?: Currency;\n grandTotal?: Currency;\n grandTotalExcludingTax?: Currency;\n shippingExcludingTax?: Currency;\n shippingIncludingTax?: Currency;\n subtotalExcludingTax?: Currency;\n subtotalIncludingTax?: Currency;\n subtotalWithDiscountExcludingTax?: Currency;\n totalTax?: Currency;\n };\n items: CartItemModel[];\n shippingAddresses?: ShippingAddress[];\n canCheckout: boolean;\n canSendForReview: boolean;\n lockedForEditing?: boolean;\n canDelete: boolean;\n canClose: boolean;\n canUpdateQuote: boolean;\n readOnly: boolean;\n}\n\nexport interface ConfigurableOption {\n optionLabel: string;\n valueLabel: string;\n}\n\nexport interface BundleOption {\n label: string;\n values: {\n label: string;\n quantity: number;\n originalPrice: Currency;\n price: Currency;\n }[];\n}\n\nexport interface CustomizableOption {\n type: string;\n label: string;\n values: {\n label: string;\n value: string;\n }[];\n}\n\nexport interface CartItemModel {\n itemType: string;\n uid: string;\n product: {\n uid: string;\n sku: string;\n name: string;\n templateId?: string;\n templateName?: string;\n priceRange: {\n maximumPrice: {\n regularPrice: Currency;\n };\n };\n };\n image: ItemImage;\n links?: ItemLinks;\n discounted: boolean;\n discountedTotal: Currency;\n catalogDiscount: {\n amountOff: number;\n percentOff: number;\n };\n discounts: {\n label: string;\n value: string;\n amount: Currency;\n }[];\n discountPercentage?: number;\n insufficientQuantity?: boolean;\n outOfStock?: boolean;\n stockStatus: string;\n quantity: number;\n prices: {\n regularPrice: Currency;\n priceIncludingTax: Currency;\n originalItemPrice: Currency;\n originalRowTotal: Currency;\n rowTotal: Currency;\n rowTotalIncludingTax: Currency;\n };\n savingsAmount?: Currency;\n configurableOptions?: ConfigurableOption[];\n bundleOptions?: BundleOption[];\n customizableOptions?: CustomizableOption[];\n noteFromBuyer?: ItemNote[];\n noteFromSeller?: ItemNote[];\n}\n\ninterface ItemImage {\n src: string;\n alt: string;\n}\n\ninterface ItemLinks {\n count: number;\n result: string;\n}\n\nexport interface ItemNote {\n createdAt: string;\n creatorId: number;\n creatorType: number;\n negotiableQuoteItemUid: string;\n note: string;\n noteUid: string;\n}\n\nexport interface Currency {\n value: number;\n currency: string;\n}\n\nexport interface Tax {\n amount: Currency;\n label: string;\n}\n\nexport interface Discount {\n amount: Currency;\n label: string;\n coupon?: Coupon;\n}\n\nexport interface Coupon {\n code: 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\nexport interface NegotiableQuoteHistoryEntry {\n author: {\n firstname: string;\n lastname: string;\n };\n changeType: NegotiableQuoteHistoryEntryChangeType;\n changes: {\n commentAdded?: {\n comment: string;\n };\n customChanges?: {\n new_value: string;\n old_value: string;\n title: string;\n };\n expiration?: {\n newExpiration: string;\n oldExpiration: string;\n };\n productsRemoved?: {\n productsRemovedFromCatalog: string[];\n productsRemovedFromQuote?: {\n uid: string;\n name: string;\n sku: string;\n quantity: number;\n }[];\n };\n statuses?: {\n changes: {\n newStatus: string;\n oldStatus: string;\n }[];\n };\n total?: {\n newPrice: Currency;\n oldPrice: Currency;\n };\n };\n createdAt: string;\n uid: string;\n}\n\nexport enum NegotiableQuoteHistoryEntryChangeType {\n CREATED = 'CREATED',\n UPDATED = 'UPDATED',\n CLOSED = 'CLOSED',\n UPDATED_BY_SYSTEM = 'UPDATED_BY_SYSTEM',\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","import { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\n","/********************************************************************\n * 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 { NegotiableQuoteHistoryEntry, NegotiableQuoteHistoryEntryChangeType } from '../models/negotiable-quote-model';\n\n/**\n * Transforms a history entry from the API format to the model format\n * @param historyEntry - Raw history entry from API\n * @returns Transformed history entry\n */\nexport function transformHistoryEntry(\n historyEntry: any\n): NegotiableQuoteHistoryEntry {\n return {\n uid: historyEntry.uid,\n createdAt: historyEntry.created_at,\n author: {\n firstname: historyEntry.author.firstname,\n lastname: historyEntry.author.lastname,\n },\n changeType: historyEntry.change_type as NegotiableQuoteHistoryEntryChangeType,\n changes: {\n commentAdded: historyEntry.changes?.comment_added && {\n comment: historyEntry.changes.comment_added.comment,\n },\n customChanges: historyEntry.changes?.custom_changes && {\n new_value: historyEntry.changes.custom_changes.new_value,\n old_value: historyEntry.changes.custom_changes.old_value,\n title: historyEntry.changes.custom_changes.title,\n },\n expiration: historyEntry.changes?.expiration && {\n newExpiration: historyEntry.changes.expiration.new_expiration,\n oldExpiration: historyEntry.changes.expiration.old_expiration,\n },\n productsRemoved: historyEntry.changes?.products_removed && {\n productsRemovedFromCatalog:\n historyEntry.changes.products_removed.products_removed_from_catalog ||\n [],\n productsRemovedFromQuote:\n historyEntry.changes.products_removed.products_removed_from_quote ||\n [],\n },\n statuses: historyEntry.changes?.statuses && {\n changes:\n historyEntry.changes.statuses.changes?.map((change: any) => ({\n newStatus: change?.new_status,\n oldStatus: change?.old_status,\n })) || [],\n },\n total:\n historyEntry.changes?.total &&\n historyEntry.changes.total.new_price &&\n historyEntry.changes.total.old_price && {\n newPrice: {\n value: historyEntry.changes.total.new_price.value,\n currency: historyEntry.changes.total.new_price.currency,\n },\n oldPrice: {\n value: historyEntry.changes.total.old_price.value,\n currency: historyEntry.changes.total.old_price.currency,\n },\n },\n },\n };\n}\n\n/**\n * Transforms an array of history entries from the API format to the model format\n * @param historyEntries - Array of raw history entries from API\n * @returns Array of transformed history entries\n */\nexport function transformHistory(\n historyEntries: any[] | null | undefined\n): NegotiableQuoteHistoryEntry[] | undefined {\n if (!historyEntries) {\n return undefined;\n }\n\n return historyEntries.map(transformHistoryEntry);\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 { CartItemModel } from '../models/negotiable-quote-model';\nimport { state } from '@/quote-management/lib/state';\n\n/**\n * Finds the most applicable price tier for a given quantity\n * @param priceTiers - Array of price tier objects\n * @param quantity - Current item quantity\n * @returns The applicable tier or null if none found\n */\nfunction findApplicablePriceTier(priceTiers: any[], quantity: number) {\n if (!priceTiers?.length) return null;\n\n // Sort price tiers by quantity in descending order to find the highest applicable tier\n const sortedTiers = [...priceTiers].sort(\n (a: any, b: any) => b.quantity - a.quantity\n );\n\n // Find the highest tier where the current quantity meets or exceeds the tier's minimum quantity\n return sortedTiers.find((tier: any) => quantity >= tier.quantity) || null;\n}\n\n/**\n * Helper function to get the image for a cart item component\n * @param item - Cart item from API\n * @returns Image object with src and alt\n */\nfunction getImage(item: any) {\n const config = state.config;\n\n return {\n // Use parent thumbnail if configured, otherwise use own variant. Use the parent thumbnail as a fallback\n src: config?.useConfigurableParentThumbnail\n ? item.product.thumbnail.url\n : item.configured_variant?.thumbnail?.url || item.product.thumbnail.url,\n alt: config?.useConfigurableParentThumbnail\n ? item.product.thumbnail.label\n : item.configured_variant?.thumbnail?.label ||\n item.product.thumbnail.label,\n };\n}\n\n/**\n * Helper function to get downloadable links for a cart item component\n * @param item - Cart item from API\n * @returns Links object with count and result, or null if no links\n */\nfunction getLinks(item: any) {\n return item.links?.length > 0\n ? {\n count: item.links.length,\n result: item.links.map((link: any) => link.title).join(', '),\n }\n : null;\n}\n\n/**\n * Helper function to check if an item is discounted\n * @param item - Cart item from API\n * @returns True if the item has a discount\n */\nfunction getDiscounted(item: any) {\n const quantity = item.quantity;\n const isConfigurable = item.__typename === 'ConfigurableCartItem';\n\n // Get price tiers and price range based on item type\n const priceTiers = isConfigurable\n ? item.configured_variant?.price_tiers\n : item.product.price_tiers;\n const priceRange = isConfigurable\n ? item.configured_variant?.price_range\n : item.product.price_range;\n\n // Check price tiers first for discount eligibility\n const applicableTier = findApplicablePriceTier(priceTiers, quantity);\n if (applicableTier) {\n return applicableTier.discount.amount_off > 0;\n }\n\n // Fallback to regular price range discount\n return (priceRange?.maximum_price?.discount?.amount_off ?? 0) > 0;\n}\n\n/**\n * Helper function to get the discount percentage of an item\n * @param item - Cart item from API\n * @returns Discount percentage rounded to nearest integer, or undefined if no discount\n */\nfunction getDiscountPercentage(item: any) {\n const quantity = item.quantity;\n\n // Check price tiers first for discount percentage\n const applicableTier = findApplicablePriceTier(\n item.product.price_tiers,\n quantity\n );\n\n if (applicableTier) {\n return Math.round(applicableTier.discount.percent_off);\n }\n\n // Fallback to product-specific discount percentage\n let percent_off;\n\n if (item.__typename === 'ConfigurableCartItem') {\n percent_off =\n item?.configured_variant?.price_range?.maximum_price?.discount\n ?.percent_off;\n } else if (item.__typename === 'BundleCartItem') {\n return undefined;\n } else {\n percent_off =\n item?.product?.price_range?.maximum_price?.discount?.percent_off;\n }\n\n if (percent_off === 0) {\n return undefined;\n }\n\n return Math.round(percent_off);\n}\n\n/**\n * Helper function to get the regular price of an item\n * @param item - Cart item from API\n * @returns Regular price object with value and currency\n */\nfunction getRegularPrice(item: any) {\n if (item.__typename === 'ConfigurableCartItem') {\n return {\n value:\n item.configured_variant?.price_range?.maximum_price.regular_price.value,\n currency:\n item.configured_variant?.price_range?.maximum_price.regular_price\n .currency,\n };\n }\n return {\n value: item.prices.original_item_price.value,\n currency: item.prices.original_item_price.currency,\n };\n}\n\n/**\n * Helper function to get the savings amount of an item\n * @param item - Cart item from API\n * @returns Savings amount object with value and currency, or undefined if no savings\n */\nfunction getSavingsAmount(item: any) {\n let amount_off;\n let currency;\n\n amount_off =\n item?.prices?.original_row_total?.value - item?.prices?.row_total?.value;\n currency = item?.prices?.row_total?.currency;\n\n if (amount_off === 0) {\n return undefined;\n }\n return {\n value: amount_off,\n currency,\n };\n}\n\n/**\n * Transforms a single quote item from the API format to the model format\n * @param item - Raw quote item from API\n * @returns Transformed quote item\n */\nexport function transformQuoteItem(item: any): CartItemModel {\n return {\n itemType: item.__typename,\n uid: item.uid,\n product: {\n uid: item.product.uid,\n sku: item.product.sku,\n name: item.product.name,\n priceRange: {\n maximumPrice: {\n regularPrice: {\n value:\n item.product.price_range.maximum_price.regular_price.value,\n currency:\n item.product.price_range.maximum_price.regular_price.currency,\n },\n },\n },\n },\n image: getImage(item),\n links: getLinks(item),\n discounted: getDiscounted(item),\n discountedTotal: {\n value: item.prices.row_total.value,\n currency: item.prices.row_total.currency,\n },\n catalogDiscount: {\n amountOff: item.prices.catalog_discount.amount_off,\n percentOff: item.prices.catalog_discount.percent_off,\n },\n discounts:\n item.prices?.discounts?.map((discount: any) => ({\n label: discount.label,\n value: discount.value,\n amount: {\n value: discount.amount.value,\n currency: discount.amount.currency,\n },\n })) ?? [],\n discountPercentage: getDiscountPercentage(item),\n insufficientQuantity:\n (item.__typename === 'ConfigurableCartItem'\n ? item.configured_variant?.stock_status ?? item.product.stock_status\n : item.product.stock_status\n ) === 'IN_STOCK' && !item.is_available,\n outOfStock: item.product.stock_status === 'OUT_OF_STOCK',\n stockStatus: item.product.stock_status,\n quantity: item.quantity,\n prices: {\n regularPrice: getRegularPrice(item),\n priceIncludingTax: {\n value: item.prices.price_including_tax.value,\n currency: item.prices.price_including_tax.currency,\n },\n originalItemPrice: {\n value: item.prices.original_item_price.value,\n currency: item.prices.original_item_price.currency,\n },\n originalRowTotal: {\n value: item.prices.original_row_total.value,\n currency: item.prices.original_row_total.currency,\n },\n rowTotal: {\n value: item.prices.row_total.value,\n currency: item.prices.row_total.currency,\n },\n rowTotalIncludingTax: {\n value: item.prices.row_total_including_tax.value,\n currency: item.prices.row_total_including_tax.currency,\n },\n },\n savingsAmount: getSavingsAmount(item),\n noteFromBuyer: item.note_from_buyer?.map((note: any) => ({\n createdAt: note.created_at,\n creatorId: note.creator_id,\n creatorType: note.creator_type,\n negotiableQuoteItemUid: note.negotiable_quote_item_uid,\n note: note.note,\n noteUid: note.note_uid,\n })),\n noteFromSeller: item.note_from_seller?.map((note: any) => ({\n createdAt: note.created_at,\n creatorId: note.creator_id,\n creatorType: note.creator_type,\n negotiableQuoteItemUid: note.negotiable_quote_item_uid,\n note: note.note,\n noteUid: note.note_uid,\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 customizableOptions: item.customizable_options?.map((option: any) => ({\n type: option.type,\n label: option.label,\n values: option.values.map((value: any) => ({\n label: value.label,\n value: value.value,\n })),\n })),\n };\n}\n\n/**\n * Transforms an array of quote items from the API format to the model format\n * @param items - Array of raw quote items from API\n * @returns Array of transformed quote items\n */\nexport function transformQuoteItems(\n items: any[] | null | undefined\n): CartItemModel[] {\n if (!items) {\n return [];\n }\n\n return items.map(transformQuoteItem);\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 {\n CartItemModel,\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';\nimport { transformHistory } from './transform-history';\nimport { transformQuoteItems } from './transform-quote-items';\n\n// Quote statuses that allow editing/sending for review\nconst EDITABLE_QUOTE_STATUSES = [\n 'DRAFT',\n 'UPDATED',\n 'DECLINED',\n 'EXPIRED',\n 'NEW',\n 'OPEN',\n] as const;\n\n// Helper function to get the total quantity of a quote (number of quote line items or total quantity)\nfunction getTotalQuantity(quote: any) {\n if (!quote.items) return 0;\n\n const config = state.config;\n\n if (config?.quoteSummaryDisplayTotal === 0) return quote.items.length;\n if (config?.quoteSummaryDisplayTotal === 1) return quote.total_quantity;\n // Default to items count if unexpected config value or error returned\n return quote.items.length;\n}\n\nfunction checkAllItemsHaveStock(items: CartItemModel[]): boolean {\n return items.every((item) => !item.outOfStock && !item.insufficientQuantity);\n}\n\n// Base helper that transforms a single quote object directly\nfunction transformSingleQuote(quote: any): NegotiableQuoteModel {\n const isQuoteNew = isNewQuote(quote);\n const quoteItems = transformQuoteItems(quote.items);\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 isVirtual: Boolean(quote.is_virtual),\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 totalQuantity: getTotalQuantity(quote),\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 text: comment.text,\n };\n\n if (\n Array.isArray(comment.attachments) &&\n comment.attachments.length > 0\n ) {\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 appliedDiscounts: quote.prices.discounts?.map((discount: any) => ({\n amount: {\n value: discount.amount.value,\n currency: discount.amount.currency,\n },\n label: discount.label,\n coupon: discount.coupon,\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 discount:\n quote.prices.discounts &&\n quote.prices.grand_total &&\n calculateTotal(\n quote.prices.discounts,\n quote.prices.grand_total.currency\n ),\n grandTotal: quote.prices.grand_total && {\n value: quote.prices.grand_total.value,\n currency: quote.prices.grand_total.currency,\n },\n grandTotalExcludingTax: quote.prices.grand_total_excluding_tax && {\n value: quote.prices.grand_total_excluding_tax.value,\n currency: quote.prices.grand_total_excluding_tax.currency,\n },\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 ...transformShippingPrices(quote),\n totalTax:\n quote.prices.applied_taxes &&\n quote.prices.grand_total &&\n calculateTotal(\n quote.prices.applied_taxes,\n quote.prices.grand_total.currency\n ),\n },\n history: transformHistory(quote.history),\n items: quoteItems,\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:\n ['UPDATED', 'DECLINED'].includes(quote.status) &&\n state.permissions.checkoutQuote &&\n quote.shipping_addresses?.length > 0 &&\n checkAllItemsHaveStock(quoteItems),\n canSendForReview:\n (isQuoteNew || EDITABLE_QUOTE_STATUSES.includes(quote.status)) &&\n state.permissions.editQuote,\n canUpdateQuote:\n (isQuoteNew || EDITABLE_QUOTE_STATUSES.includes(quote.status)) &&\n state.permissions.editQuote,\n canDelete:\n !['PENDING', 'SUBMITTED', 'ORDERED'].includes(quote.status) &&\n state.permissions.deleteQuote,\n canClose: quote.status\n ? !['DRAFT', 'CLOSED', 'ORDERED', 'OPEN'].includes(quote.status)\n : false,\n readOnly:\n (!isQuoteNew &&\n ['ORDERED', 'SUBMITTED', 'CLOSED', 'PENDING'].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 (\n quote.status === 'SUBMITTED' &&\n !(quote.history ?? []).some(\n (history: any) =>\n history.change_type === 'UPDATED' &&\n (history.changes?.statuses?.changes ?? []).length > 0\n )\n );\n}\n\nfunction transformNegotiableQuoteListEntry(\n quote: any\n): 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\nexport function calculateTotal(data: any[], currency: string) {\n if (!data?.length)\n return {\n value: 0,\n currency,\n };\n\n return data.reduce(\n (acc: any, item: any) => {\n return {\n value: acc.value + item.amount.value,\n currency: item.amount.currency,\n };\n },\n { value: 0, currency }\n );\n}\n\nexport function transformShippingPrices(quote: any) {\n if (!quote || !quote.shipping_addresses?.length) {\n return {};\n }\n\n const shippingAddress = quote.shipping_addresses[0];\n const selectedShippingMethod = shippingAddress.selected_shipping_method;\n\n if (!selectedShippingMethod) {\n return {};\n }\n\n return {\n shippingIncludingTax: selectedShippingMethod.price_incl_tax && {\n value: selectedShippingMethod.price_incl_tax.value,\n currency: selectedShippingMethod.price_incl_tax.currency,\n },\n shippingExcludingTax: selectedShippingMethod.price_excl_tax && {\n value: selectedShippingMethod.price_excl_tax.value,\n currency: selectedShippingMethod.price_excl_tax.currency,\n },\n };\n}\n"],"names":["NegotiableQuoteStatus","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","fetchGraphQl","getConfig","FetchGraphQL","transformHistoryEntry","historyEntry","_a","_b","_c","_d","_e","_f","change","_g","transformHistory","historyEntries","findApplicablePriceTier","priceTiers","quantity","a","b","tier","getImage","item","config","state","getLinks","link","getDiscounted","isConfigurable","priceRange","applicableTier","getDiscountPercentage","percent_off","_h","getRegularPrice","getSavingsAmount","amount_off","currency","transformQuoteItem","discount","note","option","value","transformQuoteItems","items","EDITABLE_QUOTE_STATUSES","getTotalQuantity","quote","checkAllItemsHaveStock","transformSingleQuote","isQuoteNew","isNewQuote","quoteItems","comment","baseComment","tax","calculateTotal","transformShippingPrices","address","shippingAddress","transformQuote","quoteData","history","transformNegotiableQuoteListEntry","transformNegotiableQuotesList","quotesData","transformedModel","paginationInfo","transformPaginationInfo","currentPage","pageSize","totalPages","totalCount","startItem","endItem","getDefaultPageSizeOptions","data","acc","selectedShippingMethod"],"mappings":"8FAyRO,IAAKA,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,ECvRL,KAAM,CACX,YAAAC,EACA,sBAAAC,EACA,yBAAAC,EACA,uBAAAC,EACA,aAAAC,EACA,UAAAC,CACF,EAAI,IAAIC,EAAA,EAAe,WAAA,ECOhB,SAASC,EACdC,EAC6B,mBAC7B,MAAO,CACL,IAAKA,EAAa,IAClB,UAAWA,EAAa,WACxB,OAAQ,CACN,UAAWA,EAAa,OAAO,UAC/B,SAAUA,EAAa,OAAO,QAAA,EAEhC,WAAYA,EAAa,YACzB,QAAS,CACP,eAAcC,EAAAD,EAAa,UAAb,YAAAC,EAAsB,gBAAiB,CACnD,QAASD,EAAa,QAAQ,cAAc,OAAA,EAE9C,gBAAeE,EAAAF,EAAa,UAAb,YAAAE,EAAsB,iBAAkB,CACrD,UAAWF,EAAa,QAAQ,eAAe,UAC/C,UAAWA,EAAa,QAAQ,eAAe,UAC/C,MAAOA,EAAa,QAAQ,eAAe,KAAA,EAE7C,aAAYG,EAAAH,EAAa,UAAb,YAAAG,EAAsB,aAAc,CAC9C,cAA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AG,CAS3C,CAEJ,CAGO,MAAMI,EAA4B,IAAM,CAAC,GAAI,GAAI,GAAI,IAAK,GAAG,EAE7D,SAASnB,EAAeoB,EAAavC,EAAkB,CAC5D,OAAKuC,GAAA,MAAAA,EAAM,OAMJA,EAAK,OACV,CAACC,EAAUvD,KACF,CACL,MAAOuD,EAAI,MAAQvD,EAAK,OAAO,MAC/B,SAAUA,EAAK,OAAO,QAAA,GAG1B,CAAE,MAAO,EAAG,SAAAe,CAAA,CAAS,EAZd,CACL,MAAO,EACP,SAAAA,CAAA,CAYN,CAEO,SAASoB,EAAwBV,EAAY,OAClD,GAAI,CAACA,GAAS,GAAC1C,EAAA0C,EAAM,qBAAN,MAAA1C,EAA0B,QACvC,MAAO,CAAA,EAIT,MAAMyE,EADkB/B,EAAM,mBAAmB,CAAC,EACH,yBAE/C,OAAK+B,EAIE,CACL,qBAAsBA,EAAuB,gBAAkB,CAC7D,MAAOA,EAAuB,eAAe,MAC7C,SAAUA,EAAuB,eAAe,QAAA,EAElD,qBAAsBA,EAAuB,gBAAkB,CAC7D,MAAOA,EAAuB,eAAe,MAC7C,SAAUA,EAAuB,eAAe,QAAA,CAClD,EAXO,CAAA,CAaX"}
1
+ {"version":3,"file":"transform-quote.js","sources":["/@dropins/storefront-quote-management/src/data/models/negotiable-quote-model.ts","/@dropins/storefront-quote-management/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-history.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-quote-items.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\nexport 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 isVirtual: boolean;\n buyer: {\n firstname: string;\n lastname: string;\n };\n templateName?: string;\n totalQuantity: number;\n comments?: {\n uid: string;\n createdAt: string;\n author: {\n firstname: string;\n lastname: string;\n };\n text: string;\n attachments?: {\n name: string;\n url: string;\n }[];\n }[];\n history?: NegotiableQuoteHistoryEntry[];\n prices: {\n appliedDiscounts?: Discount[];\n appliedTaxes?: Tax[];\n discount?: Currency;\n grandTotal?: Currency;\n grandTotalExcludingTax?: Currency;\n shippingExcludingTax?: Currency;\n shippingIncludingTax?: Currency;\n subtotalExcludingTax?: Currency;\n subtotalIncludingTax?: Currency;\n subtotalWithDiscountExcludingTax?: Currency;\n totalTax?: Currency;\n };\n items: CartItemModel[];\n shippingAddresses?: ShippingAddress[];\n canCheckout: boolean;\n canSendForReview: boolean;\n lockedForEditing?: boolean;\n canDelete: boolean;\n canClose: boolean;\n canUpdateQuote: boolean;\n readOnly: boolean;\n}\n\nexport interface ConfigurableOption {\n optionLabel: string;\n valueLabel: string;\n}\n\nexport interface BundleOption {\n label: string;\n values: {\n label: string;\n quantity: number;\n originalPrice: Currency;\n price: Currency;\n }[];\n}\n\nexport interface CustomizableOption {\n type: string;\n label: string;\n values: {\n label: string;\n value: string;\n }[];\n}\n\nexport interface CartItemModel {\n itemType: string;\n uid: string;\n product: {\n uid: string;\n sku: string;\n name: string;\n templateId?: string;\n templateName?: string;\n priceRange: {\n maximumPrice: {\n regularPrice: Currency;\n };\n };\n };\n image: ItemImage;\n links?: ItemLinks;\n discounted: boolean;\n discountedTotal: Currency;\n catalogDiscount: {\n amountOff: number;\n percentOff: number;\n };\n discounts: {\n label: string;\n value: string;\n amount: Currency;\n }[];\n discountPercentage?: number;\n insufficientQuantity?: boolean;\n outOfStock?: boolean;\n stockStatus: string;\n quantity: number;\n prices: {\n regularPrice: Currency;\n priceIncludingTax: Currency;\n originalItemPrice: Currency;\n originalRowTotal: Currency;\n rowTotal: Currency;\n rowTotalIncludingTax: Currency;\n };\n savingsAmount?: Currency;\n configurableOptions?: ConfigurableOption[];\n bundleOptions?: BundleOption[];\n customizableOptions?: CustomizableOption[];\n noteFromBuyer?: ItemNote[];\n noteFromSeller?: ItemNote[];\n}\n\ninterface ItemImage {\n src: string;\n alt: string;\n}\n\ninterface ItemLinks {\n count: number;\n result: string;\n}\n\nexport interface ItemNote {\n createdAt: string;\n creatorId: number;\n creatorType: number;\n negotiableQuoteItemUid: string;\n note: string;\n noteUid: string;\n}\n\nexport interface Currency {\n value: number;\n currency: string;\n}\n\nexport interface Tax {\n amount: Currency;\n label: string;\n}\n\nexport interface Discount {\n amount: Currency;\n label: string;\n coupon?: Coupon;\n}\n\nexport interface Coupon {\n code: 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\nexport interface NegotiableQuoteHistoryEntry {\n author: {\n firstname: string;\n lastname: string;\n };\n changeType: NegotiableQuoteHistoryEntryChangeType;\n changes: {\n commentAdded?: {\n comment: string;\n };\n customChanges?: {\n new_value: string;\n old_value: string;\n title: string;\n };\n expiration?: {\n newExpiration: string;\n oldExpiration: string;\n };\n productsRemoved?: {\n productsRemovedFromCatalog: string[];\n productsRemovedFromQuote?: {\n uid: string;\n name: string;\n sku: string;\n quantity: number;\n }[];\n };\n statuses?: {\n changes: {\n newStatus: string;\n oldStatus: string;\n }[];\n };\n total?: {\n newPrice: Currency;\n oldPrice: Currency;\n };\n };\n createdAt: string;\n uid: string;\n}\n\nexport enum NegotiableQuoteHistoryEntryChangeType {\n CREATED = 'CREATED',\n UPDATED = 'UPDATED',\n CLOSED = 'CLOSED',\n UPDATED_BY_SYSTEM = 'UPDATED_BY_SYSTEM',\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","import { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\n","/********************************************************************\n * 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 { NegotiableQuoteHistoryEntry, NegotiableQuoteHistoryEntryChangeType } from '../models/negotiable-quote-model';\n\n/**\n * Transforms a history entry from the API format to the model format\n * @param historyEntry - Raw history entry from API\n * @returns Transformed history entry\n */\nexport function transformHistoryEntry(\n historyEntry: any\n): NegotiableQuoteHistoryEntry {\n return {\n uid: historyEntry.uid,\n createdAt: historyEntry.created_at,\n author: {\n firstname: historyEntry.author.firstname,\n lastname: historyEntry.author.lastname,\n },\n changeType: historyEntry.change_type as NegotiableQuoteHistoryEntryChangeType,\n changes: {\n commentAdded: historyEntry.changes?.comment_added && {\n comment: historyEntry.changes.comment_added.comment,\n },\n customChanges: historyEntry.changes?.custom_changes && {\n new_value: historyEntry.changes.custom_changes.new_value,\n old_value: historyEntry.changes.custom_changes.old_value,\n title: historyEntry.changes.custom_changes.title,\n },\n expiration: historyEntry.changes?.expiration && {\n newExpiration: historyEntry.changes.expiration.new_expiration,\n oldExpiration: historyEntry.changes.expiration.old_expiration,\n },\n productsRemoved: historyEntry.changes?.products_removed && {\n productsRemovedFromCatalog:\n historyEntry.changes.products_removed.products_removed_from_catalog ||\n [],\n productsRemovedFromQuote:\n historyEntry.changes.products_removed.products_removed_from_quote ||\n [],\n },\n statuses: historyEntry.changes?.statuses && {\n changes:\n historyEntry.changes.statuses.changes?.map((change: any) => ({\n newStatus: change?.new_status,\n oldStatus: change?.old_status,\n })) || [],\n },\n total:\n historyEntry.changes?.total &&\n historyEntry.changes.total.new_price &&\n historyEntry.changes.total.old_price && {\n newPrice: {\n value: historyEntry.changes.total.new_price.value,\n currency: historyEntry.changes.total.new_price.currency,\n },\n oldPrice: {\n value: historyEntry.changes.total.old_price.value,\n currency: historyEntry.changes.total.old_price.currency,\n },\n },\n },\n };\n}\n\n/**\n * Transforms an array of history entries from the API format to the model format\n * @param historyEntries - Array of raw history entries from API\n * @returns Array of transformed history entries\n */\nexport function transformHistory(\n historyEntries: any[] | null | undefined\n): NegotiableQuoteHistoryEntry[] | undefined {\n if (!historyEntries) {\n return undefined;\n }\n\n return historyEntries.map(transformHistoryEntry);\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 { CartItemModel } from '../models/negotiable-quote-model';\nimport { state } from '@/quote-management/lib/state';\n\n/**\n * Finds the most applicable price tier for a given quantity\n * @param priceTiers - Array of price tier objects\n * @param quantity - Current item quantity\n * @returns The applicable tier or null if none found\n */\nfunction findApplicablePriceTier(priceTiers: any[], quantity: number) {\n if (!priceTiers?.length) return null;\n\n // Sort price tiers by quantity in descending order to find the highest applicable tier\n const sortedTiers = [...priceTiers].sort(\n (a: any, b: any) => b.quantity - a.quantity\n );\n\n // Find the highest tier where the current quantity meets or exceeds the tier's minimum quantity\n return sortedTiers.find((tier: any) => quantity >= tier.quantity) || null;\n}\n\n/**\n * Helper function to get the image for a cart item component\n * @param item - Cart item from API\n * @returns Image object with src and alt\n */\nfunction getImage(item: any) {\n const config = state.config;\n\n return {\n // Use parent thumbnail if configured, otherwise use own variant. Use the parent thumbnail as a fallback\n src: config?.useConfigurableParentThumbnail\n ? item.product.thumbnail.url\n : item.configured_variant?.thumbnail?.url || item.product.thumbnail.url,\n alt: config?.useConfigurableParentThumbnail\n ? item.product.thumbnail.label\n : item.configured_variant?.thumbnail?.label ||\n item.product.thumbnail.label,\n };\n}\n\n/**\n * Helper function to get downloadable links for a cart item component\n * @param item - Cart item from API\n * @returns Links object with count and result, or null if no links\n */\nfunction getLinks(item: any) {\n return item.links?.length > 0\n ? {\n count: item.links.length,\n result: item.links.map((link: any) => link.title).join(', '),\n }\n : null;\n}\n\n/**\n * Helper function to check if an item is discounted\n * @param item - Cart item from API\n * @returns True if the item has a discount\n */\nfunction getDiscounted(item: any) {\n const quantity = item.quantity;\n const isConfigurable = item.__typename === 'ConfigurableCartItem';\n\n // Get price tiers and price range based on item type\n const priceTiers = isConfigurable\n ? item.configured_variant?.price_tiers\n : item.product.price_tiers;\n const priceRange = isConfigurable\n ? item.configured_variant?.price_range\n : item.product.price_range;\n\n // Check price tiers first for discount eligibility\n const applicableTier = findApplicablePriceTier(priceTiers, quantity);\n if (applicableTier) {\n return applicableTier.discount.amount_off > 0;\n }\n\n // Fallback to regular price range discount\n return (priceRange?.maximum_price?.discount?.amount_off ?? 0) > 0;\n}\n\n/**\n * Helper function to get the discount percentage of an item\n * @param item - Cart item from API\n * @returns Discount percentage rounded to nearest integer, or undefined if no discount\n */\nfunction getDiscountPercentage(item: any) {\n const quantity = item.quantity;\n\n // Check price tiers first for discount percentage\n const applicableTier = findApplicablePriceTier(\n item.product.price_tiers,\n quantity\n );\n\n if (applicableTier) {\n return Math.round(applicableTier.discount.percent_off);\n }\n\n // Fallback to product-specific discount percentage\n let percent_off;\n\n if (item.__typename === 'ConfigurableCartItem') {\n percent_off =\n item?.configured_variant?.price_range?.maximum_price?.discount\n ?.percent_off;\n } else if (item.__typename === 'BundleCartItem') {\n return undefined;\n } else {\n percent_off =\n item?.product?.price_range?.maximum_price?.discount?.percent_off;\n }\n\n if (percent_off === 0) {\n return undefined;\n }\n\n return Math.round(percent_off);\n}\n\n/**\n * Helper function to get the regular price of an item\n * @param item - Cart item from API\n * @returns Regular price object with value and currency\n */\nfunction getRegularPrice(item: any) {\n if (item.__typename === 'ConfigurableCartItem') {\n return {\n value:\n item.configured_variant?.price_range?.maximum_price.regular_price.value,\n currency:\n item.configured_variant?.price_range?.maximum_price.regular_price\n .currency,\n };\n }\n return {\n value: item.prices.original_item_price.value,\n currency: item.prices.original_item_price.currency,\n };\n}\n\n/**\n * Helper function to get the savings amount of an item\n * @param item - Cart item from API\n * @returns Savings amount object with value and currency, or undefined if no savings\n */\nfunction getSavingsAmount(item: any) {\n let amount_off;\n let currency;\n\n amount_off =\n item?.prices?.original_row_total?.value - item?.prices?.row_total?.value;\n currency = item?.prices?.row_total?.currency;\n\n if (amount_off === 0) {\n return undefined;\n }\n return {\n value: amount_off,\n currency,\n };\n}\n\n/**\n * Transforms a single quote item from the API format to the model format\n * @param item - Raw quote item from API\n * @returns Transformed quote item\n */\nexport function transformQuoteItem(item: any): CartItemModel {\n return {\n itemType: item.__typename,\n uid: item.uid,\n product: {\n uid: item.product.uid,\n sku: item.product.sku,\n name: item.product.name,\n priceRange: {\n maximumPrice: {\n regularPrice: {\n value:\n item.product.price_range.maximum_price.regular_price.value,\n currency:\n item.product.price_range.maximum_price.regular_price.currency,\n },\n },\n },\n },\n image: getImage(item),\n links: getLinks(item),\n discounted: getDiscounted(item),\n discountedTotal: {\n value: item.prices.row_total.value,\n currency: item.prices.row_total.currency,\n },\n catalogDiscount: {\n amountOff: item.prices.catalog_discount.amount_off,\n percentOff: item.prices.catalog_discount.percent_off,\n },\n discounts:\n item.prices?.discounts?.map((discount: any) => ({\n label: discount.label,\n value: discount.value,\n amount: {\n value: discount.amount.value,\n currency: discount.amount.currency,\n },\n })) ?? [],\n discountPercentage: getDiscountPercentage(item),\n insufficientQuantity:\n (item.__typename === 'ConfigurableCartItem'\n ? item.configured_variant?.stock_status ?? item.product.stock_status\n : item.product.stock_status\n ) === 'IN_STOCK' && !item.is_available,\n outOfStock: item.product.stock_status === 'OUT_OF_STOCK',\n stockStatus: item.product.stock_status,\n quantity: item.quantity,\n prices: {\n regularPrice: getRegularPrice(item),\n priceIncludingTax: {\n value: item.prices.price_including_tax.value,\n currency: item.prices.price_including_tax.currency,\n },\n originalItemPrice: {\n value: item.prices.original_item_price.value,\n currency: item.prices.original_item_price.currency,\n },\n originalRowTotal: {\n value: item.prices.original_row_total.value,\n currency: item.prices.original_row_total.currency,\n },\n rowTotal: {\n value: item.prices.row_total.value,\n currency: item.prices.row_total.currency,\n },\n rowTotalIncludingTax: {\n value: item.prices.row_total_including_tax.value,\n currency: item.prices.row_total_including_tax.currency,\n },\n },\n savingsAmount: getSavingsAmount(item),\n noteFromBuyer: item.note_from_buyer?.map((note: any) => ({\n createdAt: note.created_at,\n creatorId: note.creator_id,\n creatorType: note.creator_type,\n negotiableQuoteItemUid: note.negotiable_quote_item_uid,\n note: note.note,\n noteUid: note.note_uid,\n })),\n noteFromSeller: item.note_from_seller?.map((note: any) => ({\n createdAt: note.created_at,\n creatorId: note.creator_id,\n creatorType: note.creator_type,\n negotiableQuoteItemUid: note.negotiable_quote_item_uid,\n note: note.note,\n noteUid: note.note_uid,\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 customizableOptions: item.customizable_options?.map((option: any) => ({\n type: option.type,\n label: option.label,\n values: option.values.map((value: any) => ({\n label: value.label,\n value: value.value,\n })),\n })),\n };\n}\n\n/**\n * Transforms an array of quote items from the API format to the model format\n * @param items - Array of raw quote items from API\n * @returns Array of transformed quote items\n */\nexport function transformQuoteItems(\n items: any[] | null | undefined\n): CartItemModel[] {\n if (!items) {\n return [];\n }\n\n return items.map(transformQuoteItem);\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 {\n CartItemModel,\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';\nimport { transformHistory } from './transform-history';\nimport { transformQuoteItems } from './transform-quote-items';\n\n// Quote statuses that allow editing/sending for review\nconst EDITABLE_QUOTE_STATUSES = [\n 'DRAFT',\n 'UPDATED',\n 'DECLINED',\n 'EXPIRED',\n 'NEW',\n 'OPEN',\n] as const;\n\n// Helper function to get the total quantity of a quote (number of quote line items or total quantity)\nfunction getTotalQuantity(quote: any) {\n if (!quote.items) return 0;\n\n const config = state.config;\n\n if (config?.quoteSummaryDisplayTotal === 0) return quote.items.length;\n if (config?.quoteSummaryDisplayTotal === 1) return quote.total_quantity;\n // Default to items count if unexpected config value or error returned\n return quote.items.length;\n}\n\nfunction checkAllItemsHaveStock(items: CartItemModel[]): boolean {\n return items.every((item) => !item.outOfStock && !item.insufficientQuantity);\n}\n\n// Base helper that transforms a single quote object directly\nfunction transformSingleQuote(quote: any): NegotiableQuoteModel {\n const isQuoteNew = isNewQuote(quote);\n const isGeneratedFromTemplate = Boolean(quote.template_name?.trim());\n const quoteItems = transformQuoteItems(quote.items);\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 isVirtual: Boolean(quote.is_virtual),\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 totalQuantity: getTotalQuantity(quote),\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 text: comment.text,\n };\n\n if (\n Array.isArray(comment.attachments) &&\n comment.attachments.length > 0\n ) {\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 appliedDiscounts: quote.prices.discounts?.map((discount: any) => ({\n amount: {\n value: discount.amount.value,\n currency: discount.amount.currency,\n },\n label: discount.label,\n coupon: discount.coupon,\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 discount:\n quote.prices.discounts &&\n quote.prices.grand_total &&\n calculateTotal(\n quote.prices.discounts,\n quote.prices.grand_total.currency\n ),\n grandTotal: quote.prices.grand_total && {\n value: quote.prices.grand_total.value,\n currency: quote.prices.grand_total.currency,\n },\n grandTotalExcludingTax: quote.prices.grand_total_excluding_tax && {\n value: quote.prices.grand_total_excluding_tax.value,\n currency: quote.prices.grand_total_excluding_tax.currency,\n },\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 ...transformShippingPrices(quote),\n totalTax:\n quote.prices.applied_taxes &&\n quote.prices.grand_total &&\n calculateTotal(\n quote.prices.applied_taxes,\n quote.prices.grand_total.currency\n ),\n },\n history: transformHistory(quote.history),\n items: quoteItems,\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:\n ['UPDATED', 'DECLINED'].includes(quote.status) &&\n state.permissions.checkoutQuote &&\n quote.shipping_addresses?.length > 0 &&\n checkAllItemsHaveStock(quoteItems),\n canSendForReview:\n !isGeneratedFromTemplate &&\n (isQuoteNew || EDITABLE_QUOTE_STATUSES.includes(quote.status)) &&\n state.permissions.editQuote,\n canUpdateQuote:\n !isGeneratedFromTemplate &&\n (isQuoteNew || EDITABLE_QUOTE_STATUSES.includes(quote.status)) &&\n state.permissions.editQuote,\n canDelete:\n !isGeneratedFromTemplate &&\n !['PENDING', 'SUBMITTED', 'ORDERED'].includes(quote.status) &&\n state.permissions.deleteQuote,\n canClose: quote.status\n ? !isGeneratedFromTemplate &&\n !['DRAFT', 'CLOSED', 'ORDERED', 'OPEN'].includes(quote.status)\n : false,\n readOnly:\n isGeneratedFromTemplate ||\n (!isQuoteNew &&\n ['ORDERED', 'SUBMITTED', 'CLOSED', 'PENDING'].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 (\n quote.status === 'SUBMITTED' &&\n !(quote.history ?? []).some(\n (history: any) =>\n history.change_type === 'UPDATED' &&\n (history.changes?.statuses?.changes ?? []).length > 0\n )\n );\n}\n\nfunction transformNegotiableQuoteListEntry(\n quote: any\n): 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\nexport function calculateTotal(data: any[], currency: string) {\n if (!data?.length)\n return {\n value: 0,\n currency,\n };\n\n return data.reduce(\n (acc: any, item: any) => {\n return {\n value: acc.value + item.amount.value,\n currency: item.amount.currency,\n };\n },\n { value: 0, currency }\n );\n}\n\nexport function transformShippingPrices(quote: any) {\n if (!quote || !quote.shipping_addresses?.length) {\n return {};\n }\n\n const shippingAddress = quote.shipping_addresses[0];\n const selectedShippingMethod = shippingAddress.selected_shipping_method;\n\n if (!selectedShippingMethod) {\n return {};\n }\n\n return {\n shippingIncludingTax: selectedShippingMethod.price_incl_tax && {\n value: selectedShippingMethod.price_incl_tax.value,\n currency: selectedShippingMethod.price_incl_tax.currency,\n },\n shippingExcludingTax: selectedShippingMethod.price_excl_tax && {\n value: selectedShippingMethod.price_excl_tax.value,\n currency: selectedShippingMethod.price_excl_tax.currency,\n },\n };\n}\n"],"names":["NegotiableQuoteStatus","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","fetchGraphQl","getConfig","FetchGraphQL","transformHistoryEntry","historyEntry","_a","_b","_c","_d","_e","_f","change","_g","transformHistory","historyEntries","findApplicablePriceTier","priceTiers","quantity","a","b","tier","getImage","item","config","state","getLinks","link","getDiscounted","isConfigurable","priceRange","applicableTier","getDiscountPercentage","percent_off","_h","getRegularPrice","getSavingsAmount","amount_off","currency","transformQuoteItem","discount","note","option","value","transformQuoteItems","items","EDITABLE_QUOTE_STATUSES","getTotalQuantity","quote","checkAllItemsHaveStock","transformSingleQuote","isQuoteNew","isNewQuote","isGeneratedFromTemplate","quoteItems","comment","baseComment","tax","calculateTotal","transformShippingPrices","address","shippingAddress","transformQuote","quoteData","history","transformNegotiableQuoteListEntry","transformNegotiableQuotesList","quotesData","transformedModel","paginationInfo","transformPaginationInfo","currentPage","pageSize","totalPages","totalCount","startItem","endItem","getDefaultPageSizeOptions","data","acc","selectedShippingMethod"],"mappings":"8FAyRO,IAAKA,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,ECvRL,KAAM,CACX,YAAAC,EACA,sBAAAC,EACA,yBAAAC,EACA,uBAAAC,EACA,aAAAC,EACA,UAAAC,CACF,EAAI,IAAIC,EAAA,EAAe,WAAA,ECOhB,SAASC,EACdC,EAC6B,mBAC7B,MAAO,CACL,IAAKA,EAAa,IAClB,UAAWA,EAAa,WACxB,OAAQ,CACN,UAAWA,EAAa,OAAO,UAC/B,SAAUA,EAAa,OAAO,QAAA,EAEhC,WAAYA,EAAa,YACzB,QAAS,CACP,eAAcC,EAAAD,EAAa,UAAb,YAAAC,EAAsB,gBAAiB,CACnD,QAASD,EAAa,QAAQ,cAAc,OAAA,EAE9C,gBAAeE,EAAAF,EAAa,UAAb,YAAAE,EAAsB,iBAAkB,CACrD,UAAWF,EAAa,QAAQ,eAAe,UAC/C,UAAWA,EAAa,QAAQ,eAAe,UAC/C,MAAOA,EAAa,QAAQ,eAAe,KAAA,EAE7C,aAAYG,EAAAH,EAAa,UAAb,YAAAG,EAAsB,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AU,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,EAE7D,SAASnB,EAAeoB,EAAaxC,EAAkB,CAC5D,OAAKwC,GAAA,MAAAA,EAAM,OAMJA,EAAK,OACV,CAACC,EAAUxD,KACF,CACL,MAAOwD,EAAI,MAAQxD,EAAK,OAAO,MAC/B,SAAUA,EAAK,OAAO,QAAA,GAG1B,CAAE,MAAO,EAAG,SAAAe,CAAA,CAAS,EAZd,CACL,MAAO,EACP,SAAAA,CAAA,CAYN,CAEO,SAASqB,EAAwBX,EAAY,OAClD,GAAI,CAACA,GAAS,GAAC1C,EAAA0C,EAAM,qBAAN,MAAA1C,EAA0B,QACvC,MAAO,CAAA,EAIT,MAAM0E,EADkBhC,EAAM,mBAAmB,CAAC,EACH,yBAE/C,OAAKgC,EAIE,CACL,qBAAsBA,EAAuB,gBAAkB,CAC7D,MAAOA,EAAuB,eAAe,MAC7C,SAAUA,EAAuB,eAAe,QAAA,EAElD,qBAAsBA,EAAuB,gBAAkB,CAC7D,MAAOA,EAAuB,eAAe,MAC7C,SAAUA,EAAuB,eAAe,QAAA,CAClD,EAXO,CAAA,CAaX"}
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as n,jsxs as p,Fragment as la}from"@dropins/tools/preact-jsx-runtime.js";import{useState as l,useRef as _e,useEffect as v,useCallback as c,useMemo as f,createPortal as W}from"@dropins/tools/preact-compat.js";import{classes as u,VComponent as M,Slot as g}from"@dropins/tools/lib.js";import{f as ca}from"../chunks/dateUtils.js";/* empty css */import{Skeleton as ja,SkeletonRow as z,InLineAlert as h,Button as sa,TextArea as Ga,InputFile as Ka}from"@dropins/tools/components.js";import{events as C}from"@dropins/tools/event-bus.js";import{S as Xa,A as Ja,T as Ya,R as Za}from"../chunks/RenameQuoteModal.js";import{v as Aa,f as et,a as at,S as tt,A as nt}from"../chunks/AttachedFilesList.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{C as X}from"../chunks/ConfirmationModal.js";/* empty css *//* empty css */import{S as ot}from"../chunks/ShippingAddressDisplay.js";import{Q as it}from"../chunks/QuoteHistoryLog3.js";import{g as rt,r as lt,c as ct,a as st,s as mt,d as dt,b as ut}from"../chunks/duplicateNegotiableQuote.js";import"../chunks/state.js";import{u as gt}from"../chunks/uploadFile.js";import{I as ft}from"../chunks/ItemsQuoted.js";import{Q as pt}from"../chunks/QuoteCommentsList3.js";import{S as w}from"../chunks/WarningFilled.js";import{S as J}from"../chunks/CheckWithCircle.js";import{useText as Mt}from"@dropins/tools/i18n.js";import"../chunks/QuoteHistoryLog.js";import"../chunks/transform-quote.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/NegotiableQuoteFragment.js";import"../chunks/transform-quote-template.js";import"../chunks/NegotiableQuoteTemplateFragment.js";import"../chunks/LineItemNoteModal.js";import"../chunks/setLineItemNote.js";import"../chunks/QuoteCommentsList.js";const bt=({className:x,loading:t,quoteName:m,quoteStatus:R,banner:y,details:_,actionBar:N,quoteContent:L,shippingInformationTitle:Y,shippingInformation:e,quoteCommentsTitle:S,quoteComments:E,attachFilesField:k,attachedFilesList:P,footer:Z,...A})=>t?n(ht,{}):p("div",{...A,className:u(["quote-management-manage-negotiable-quote",x]),children:[p("div",{className:u(["quote-management-manage-negotiable-quote__header"]),children:[m&&n(M,{node:m,className:u(["quote-management-manage-negotiable-quote__quote-name"])}),R&&n(M,{node:R,className:u(["quote-management-manage-negotiable-quote__quote-status"])})]}),y&&n(M,{node:y,className:u(["quote-management-manage-negotiable-quote__banner"])}),_&&n(M,{node:_,className:u(["quote-management-manage-negotiable-quote__details"])}),N&&n(M,{node:N,className:u(["quote-management-manage-negotiable-quote__action-bar"])}),L&&n(M,{node:L,className:u(["quote-management-manage-negotiable-quote__quote-content"])}),p("div",{"data-testid":"quote-shipping-information-container",className:u(["quote-management-manage-negotiable-quote__shipping-information-container"]),children:[Y&&n(M,{node:Y,className:u(["quote-management-manage-negotiable-quote__shipping-information-title"])}),e&&n(M,{node:e,className:u(["quote-management-manage-negotiable-quote__shipping-information"])})]}),p("div",{"data-testid":"quote-comments-container",className:u(["quote-management-manage-negotiable-quote__quote-comments-container"]),children:[S&&n(M,{node:S,className:u(["quote-management-manage-negotiable-quote__quote-comments-title"])}),E&&n(M,{node:E,className:u(["quote-management-manage-negotiable-quote__quote-comments"])}),k&&n(M,{node:k,className:u(["quote-management-manage-negotiable-quote__attach-files-field"])}),P&&n(M,{node:P,className:u(["quote-management-manage-negotiable-quote__attached-files-list"])})]}),n(M,{node:Z,className:u(["quote-management-manage-negotiable-quote__footer"])})]}),ht=()=>p(ja,{"data-testid":"manage-negotiable-quote-skeleton",children:[n(z,{variant:"heading",fullWidth:!0,size:"large"}),n(z,{variant:"row",fullWidth:!1,size:"small"}),n(z,{variant:"row",fullWidth:!1,size:"small"}),n(z,{variant:"row",fullWidth:!0}),n(z,{variant:"row",fullWidth:!0,size:"xlarge",lines:2}),n(z,{variant:"row",fullWidth:!1,size:"small"})]}),an=({onActionsDropdownChange:x,slots:t,onActionsButtonClick:m,onSendForReview:R,maxFiles:y,maxFileSize:_,acceptedFileTypes:N,onDuplicateQuote:L,...Y})=>{const[e,S]=l(void 0),[E,k]=l(!0),[P,Z]=l(!1),[A,$]=l(null),[ma,ee]=l(!1),[Ee,se]=l(!1),[De,D]=l(null),[da,H]=l(!1),[Fe,Ie]=l(!1),[F,we]=l(""),[Q,me]=l(!1),[xe,de]=l(!1),[Re,ue]=l(!1),[Le,O]=l(""),[ke,V]=l(""),[He,ge]=l(!1),[Oe,Ue]=l(!1),[Be,j]=l(""),[We,ae]=l(""),[ze,fe]=l(!1),[te,ne]=l(""),[pe,oe]=l(""),[Me,G]=l(""),[ua,U]=l(""),[be,ie]=l(""),[b,K]=l([]),[re,le]=l(void 0),[he,Pe]=l(new Set),$e=_e(he),Ne=_e(null),[B,Se]=l(""),ce=_e(B),[Ve,je]=l(!1);v(()=>{$e.current=he},[he]),v(()=>{ce.current=B},[B]);const o=Mt({createdLabel:"NegotiableQuote.Manage.createdLabel",salesRepLabel:"NegotiableQuote.Manage.salesRepLabel",expiresLabel:"NegotiableQuote.Manage.expiresLabel",actionsLabel:"NegotiableQuote.Manage.actionsLabel",remove:"NegotiableQuote.Manage.actions.remove",close:"NegotiableQuote.Manage.actionButtons.close",delete:"NegotiableQuote.Manage.actionButtons.delete",print:"NegotiableQuote.Manage.actionButtons.print",createTemplate:"NegotiableQuote.Manage.actionButtons.createTemplate",createCopy:"NegotiableQuote.Manage.actionButtons.createCopy",shippingInformationTitle:"NegotiableQuote.Manage.shippingInformation.title",quoteCommentsTitle:"NegotiableQuote.Manage.quoteComments.title",quoteCommentsPlaceholder:"NegotiableQuote.Manage.quoteComments.placeholder",sendForReview:"NegotiableQuote.Manage.actionButtons.sendForReview",bannerTitle:"NegotiableQuote.Manage.bannerTitle",statusSubmitted:"NegotiableQuote.Manage.bannerStatusMessages.submitted",statusPending:"NegotiableQuote.Manage.bannerStatusMessages.pending",statusExpired:"NegotiableQuote.Manage.bannerStatusMessages.expired",errorFallback:"NegotiableQuote.Manage.confirmationModal.delete.errorFallback",closeSuccessMessage:"NegotiableQuote.Manage.confirmationModal.close.successDescription",closeModalTitle:"NegotiableQuote.Manage.actionButtons.close",closeModalMessage:"NegotiableQuote.Manage.confirmationModal.close.message",closeModalCancel:"NegotiableQuote.Manage.confirmationModal.cancel",closeModalConfirm:"NegotiableQuote.Manage.confirmationModal.close.confirm",closeModalConfirmLoading:"NegotiableQuote.Manage.confirmationModal.close.confirmLoading",closeModalSuccessHeading:"NegotiableQuote.Manage.confirmationModal.close.successHeading",createTemplateModalTitle:"NegotiableQuote.Manage.actionButtons.createTemplate",createTemplateModalMessage:"NegotiableQuote.Manage.confirmationModal.createTemplate.message",createTemplateModalCancel:"NegotiableQuote.Manage.confirmationModal.cancel",createTemplateModalConfirm:"NegotiableQuote.Manage.confirmationModal.createTemplate.confirm",createTemplateModalConfirmLoading:"NegotiableQuote.Manage.confirmationModal.createTemplate.confirmLoading",createTemplateModalSuccessHeading:"NegotiableQuote.Manage.confirmationModal.createTemplate.successHeading",createTemplateSuccessMessage:"NegotiableQuote.Manage.confirmationModal.createTemplate.successDescription",createTemplateModalErrorHeading:"NegotiableQuote.Manage.confirmationModal.createTemplate.errorHeading",createTemplateErrorFallback:"NegotiableQuote.Manage.confirmationModal.createTemplate.errorFallback",renameErrorHeading:"NegotiableQuote.Manage.rename.errorHeading",renameQuoteNameRequired:"NegotiableQuote.Manage.rename.quoteNameRequired",renameErrorDefault:"NegotiableQuote.Manage.rename.errorDefault",renameSuccessHeading:"NegotiableQuote.Manage.rename.successHeading",renameSuccessMessage:"NegotiableQuote.Manage.rename.successMessage",confirmationModalCancel:"NegotiableQuote.Manage.confirmationModal.cancel",confirmationModalDeleteTitle:"NegotiableQuote.Manage.confirmationModal.delete.title",confirmationModalDeleteMessage:"NegotiableQuote.Manage.confirmationModal.delete.message",confirmationModalDeleteConfirm:"NegotiableQuote.Manage.confirmationModal.delete.confirm",confirmationModalDeleteErrorHeading:"NegotiableQuote.Manage.confirmationModal.delete.errorHeading",confirmationModalDeleteErrorFallback:"NegotiableQuote.Manage.confirmationModal.delete.errorFallback",confirmationModalDeleteSuccessHeading:"NegotiableQuote.Manage.confirmationModal.delete.successHeading",confirmationModalDeleteSuccessDescription:"NegotiableQuote.Manage.confirmationModal.delete.successDescription",confirmationModalDuplicateTitle:"NegotiableQuote.Manage.confirmationModal.duplicate.title",confirmationModalDuplicateMessage:"NegotiableQuote.Manage.confirmationModal.duplicate.message",confirmationModalDuplicateConfirm:"NegotiableQuote.Manage.confirmationModal.duplicate.confirm",confirmationModalDuplicateErrorHeading:"NegotiableQuote.Manage.confirmationModal.duplicate.errorHeading",confirmationModalDuplicateErrorFallback:"NegotiableQuote.Manage.confirmationModal.duplicate.errorFallback",confirmationModalDuplicateSuccessHeading:"NegotiableQuote.Manage.confirmationModal.duplicate.successHeading",confirmationModalDuplicateSuccessDescription:"NegotiableQuote.Manage.confirmationModal.duplicate.successDescription",duplicateOutOfStockWarningHeading:"NegotiableQuote.Manage.confirmationModal.duplicate.outOfStockWarningHeading",duplicateOutOfStockWarningMessage:"NegotiableQuote.Manage.confirmationModal.duplicate.outOfStockWarningMessage",noItemsSelectedModalTitle:"NegotiableQuote.Manage.confirmationModal.noItemsSelected.title",noItemsSelectedModalMessage:"NegotiableQuote.Manage.confirmationModal.noItemsSelected.message",noItemsSelectedModalConfirm:"NegotiableQuote.Manage.confirmationModal.noItemsSelected.confirm",attachFiles:"NegotiableQuote.Manage.attachFiles",fileUploadError:"NegotiableQuote.Manage.fileUploadError",maxFilesExceeded:"NegotiableQuote.Manage.maxFilesExceeded",maxFileSizeExceeded:"NegotiableQuote.Manage.maxFileSizeExceeded",invalidFileType:"NegotiableQuote.Manage.invalidFileType"});v(()=>{const a=C.on("quote-management/quote-data",i=>{const{quote:r}=i;if(r){S(r),k(!1);const s=`duplicate-outOfStock-warning-${r.uid}`;sessionStorage.getItem(s)==="true"&&(Ie(!0),sessionStorage.removeItem(s))}},{eager:!0});return()=>a==null?void 0:a.off()},[]),v(()=>{const a=C.on("quote-management/shipping-address-set",i=>{const{quote:r}=i;r&&S(r)},{eager:!0});return()=>a==null?void 0:a.off()},[]),v(()=>{const a=C.on("quote-management/quote-sent-for-review",i=>{const{quote:r}=i;S(r),we(""),K([]),me(!1)},{eager:!0});return()=>a==null?void 0:a.off()},[]),v(()=>{const a=C.on("quote-management/quote-items-removed",i=>{const{quote:r,removedItemUids:s}=i;r&&S(r),s&&Pe(d=>{const q=new Set(d);return s.forEach(I=>q.delete(I)),q})},{eager:!0});return()=>a==null?void 0:a.off()},[]);const Ge=c((a,i)=>{Pe(r=>{const s=new Set(r);return i?s.add(a.uid):s.delete(a.uid),s})},[]),Ke=c(a=>{const i=a.target.value,r=$e.current;if(i==="remove"){if(Se(i),ce.current=i,r.size===0)je(!0);else if(e&&Ne.current){const s=e.items.filter(d=>r.has(d.uid));Ne.current(s)}}x==null||x(a)},[x,e]),Xe=c(()=>{je(!1),Se(""),ce.current=""},[]);v(()=>{const a=C.on("quote-management/negotiable-quote-closed",async i=>{ue(!1),V(""),O(o.closeSuccessMessage),S(r=>{var s;return r!=null&&r.uid&&((s=i.closedQuoteUids)!=null&&s.includes(r.uid))&&rt(r.uid).then(d=>{S(d)}).catch(d=>{console.warn("Failed to refresh quote data after closure:",d)}),r}),setTimeout(()=>{de(!1),O("")},2e3)},{eager:!0});return()=>a==null?void 0:a.off()},[o.closeSuccessMessage]),v(()=>{const a=C.on("quote-management/negotiable-quote-close-error",i=>{console.log("Close error event received:",i),ue(!1),O("");const r=i.error.message||o.errorFallback;V(r)},{eager:!0});return()=>a==null?void 0:a.off()},[o.errorFallback]),v(()=>{const a=C.on("quote-management/quote-renamed",i=>{const{quote:r}=i;S(r),G(""),U(""),ie(o.renameSuccessMessage),setTimeout(()=>{fe(!1),ne(""),oe(""),ie("")},2e3)},{eager:!0});return()=>a==null?void 0:a.off()},[o.renameSuccessMessage]),v(()=>{const a=C.on("quote-management/quote-duplicated",i=>{const{quote:r}=i;e&&L&&L({quoteData:e,newQuote:r}),H(!0),D(null),setTimeout(()=>{se(!1),H(!1),D(null)},2e3)},{eager:!0});return()=>a==null?void 0:a.off()},[e,L]);const Qe=c(async a=>{if(y&&b.length+a.length>y){le(o.maxFilesExceeded.replace("{maxFiles}",String(y)));return}for(const r of a){if(_&&!Aa(r.size,_)){le(o.maxFileSizeExceeded.replace("{maxSize}",et(_)));return}if(N&&!at(r.type,N)){le(o.invalidFileType);return}}le(void 0);const i=a.map(r=>({key:`temp-${Date.now()}-${Math.random()}-${r.name}`,name:r.name,size:r.size,status:"uploading"}));K(r=>[...r,...i]);for(let r=0;r<a.length;r++){const s=a[r],d=i[r].key;try{const q=await gt(s);K(I=>I.map(T=>T.key===d?{...T,key:q.key,status:"success"}:T))}catch(q){K(I=>I.map(T=>T.key===d?{...T,status:"error",error:q.message}:T))}}},[y,_,N,b,o]),qe=c(a=>{K(i=>i.filter(r=>r.key!==a))},[]),Je=c(()=>{ne((e==null?void 0:e.name)||""),oe(""),G(""),U(""),ie(""),fe(!0)},[e]),ga=c(()=>{fe(!1),ne(""),oe(""),G(""),U(""),ie("")},[]),fa=c(a=>{ne(a),a.trim()&&U("")},[]),Ye=c(()=>{se(!0),D(null),H(!1)},[]),pa=c(async()=>{if(!te.trim()){U(o.renameQuoteNameRequired);return}try{G(""),U(""),await lt({quoteUid:e.uid,quoteName:te,quoteComment:pe.trim()||void 0})}catch(a){G(a.message||o.renameErrorDefault)}},[e,te,pe,o.renameQuoteNameRequired,o.renameErrorDefault]),Ma=f(()=>{const a=e&&(e.lockedForEditing===!0||e.lockedForEditing===void 0&&(e.status==="SUBMITTED"||e.status==="PENDING"||e.status==="ORDERED"||e.status==="CLOSED"));return n(g,{name:"QuoteName",slot:t==null?void 0:t.QuoteName,context:{quoteName:e==null?void 0:e.name,quoteData:e},children:p("div",{className:"quote-management-manage-negotiable-quote__quote-name-wrapper",children:[n("h1",{"data-testid":"quote-name",className:"quote-management-manage-negotiable-quote__quote-name-title",children:e==null?void 0:e.name}),n("button",{onClick:Je,disabled:a,"data-testid":"rename-quote-button",className:"quote-management-manage-negotiable-quote__rename-button","aria-label":"Rename quote",children:n(Xa,{})})]})})},[t==null?void 0:t.QuoteName,e,Je]),ba=f(()=>n(g,{name:"QuoteStatus",slot:t==null?void 0:t.QuoteStatus,context:{quoteStatus:e==null?void 0:e.status,quoteData:e},children:n("div",{"data-testid":"quote-status",children:e==null?void 0:e.status})}),[t==null?void 0:t.QuoteStatus,e]),Ze=c(a=>{switch(a){case"SUBMITTED":return o.statusSubmitted;case"PENDING":return o.statusPending;case"EXPIRED":return o.statusExpired;default:return null}},[o])(e==null?void 0:e.status),Ae=Ze&&n(h,{type:"warning",variant:"secondary",icon:n(w,{}),heading:o.bannerTitle,description:Ze}),ea=Ae&&n(g,{name:"Banner","data-testid":"banner",slot:t==null?void 0:t.Banner,context:{quoteData:e},children:Ae}),ha=c(()=>{Ie(!1)},[]),aa=Fe&&n(g,{name:"DuplicateQuoteWarningBanner","data-testid":"duplicate-outOfStock-warning-banner",slot:t==null?void 0:t.DuplicateQuoteWarningBanner,context:{outOfStockWarning:Fe},children:n(h,{type:"warning",variant:"primary",icon:n(w,{}),heading:o.duplicateOutOfStockWarningHeading,description:o.duplicateOutOfStockWarningMessage,onDismiss:ha,"data-testid":"duplicate-outOfStock-warning-alert"})}),Na=f(()=>{if(!e)return;const a=e.expirationDate?ca(e.expirationDate,"short"):void 0;return p(g,{name:"Details",slot:t==null?void 0:t.Details,context:{quoteData:e},children:[p("div",{className:"quote-management-manage-negotiable-quote__detail",children:[n("span",{className:"quote-management-manage-negotiable-quote__detail-title","data-testid":"created-label",children:o.createdLabel}),p("span",{className:"quote-management-manage-negotiable-quote__detail-content","data-testid":"created-value",children:[ca(e.createdAt,"short")," (",e.buyer.firstname," ",e.buyer.lastname,")"]})]}),p("div",{className:"quote-management-manage-negotiable-quote__detail",children:[n("span",{className:"quote-management-manage-negotiable-quote__detail-title","data-testid":"sales-rep-label",children:o.salesRepLabel}),n("span",{className:"quote-management-manage-negotiable-quote__detail-content","data-testid":"sales-rep-value",children:e.salesRepName})]}),p("div",{className:"quote-management-manage-negotiable-quote__detail",children:[n("span",{className:"quote-management-manage-negotiable-quote__detail-title","data-testid":"expires-label",children:o.expiresLabel}),n("span",{className:"quote-management-manage-negotiable-quote__detail-content","data-testid":"expires-value",children:a})]})]})},[t==null?void 0:t.Details,o,e]),ta=f(()=>[{label:o.close,value:"close",disabled:!(e!=null&&e.canClose)},{label:o.delete,value:"delete",disabled:!(e!=null&&e.canDelete)},{label:o.print,value:"print"},{label:o.createTemplate,value:"createTemplate"},{label:o.createCopy,value:"createCopy"}],[o,e==null?void 0:e.canDelete,e==null?void 0:e.canClose]),Sa=f(()=>{const a=i=>{switch(i){case"close":de(!0),V(""),O(""),m==null||m(i);break;case"delete":Z(!0),m==null||m(i);break;case"print":m==null||m(i);break;case"createTemplate":ge(!0),ae(""),j(""),m==null||m(i);break;case"createCopy":Ye(),m==null||m(i);break}};return n(g,{name:"ActionBar",slot:t==null?void 0:t.ActionBar,context:{quoteData:e,actionsBarDropdownValue:B},children:n(Ja,{dropdownPlaceholder:o.actionsLabel,dropdownOptions:[{label:o.remove,value:"remove"}],dropdownValue:B,handleDropdownChange:Ke,buttons:ta.map(i=>n(sa,{variant:"tertiary",onClick:()=>a(i.value),"data-testid":`actions-bar-${i.value}-button`,"data-action":i.value,disabled:i.disabled,children:i.label},i.value))})})},[ta,o,t==null?void 0:t.ActionBar,e,Ke,m,Ye,B]),Qa=f(()=>n(g,{name:"QuoteContent",slot:t==null?void 0:t.QuoteContent,context:{quoteData:e},children:n(Ya,{tabs:new Map([["items-quoted","Items Quoted"],["comments","Comments"],["history-log","History Log"]]),tabsContent:new Map([["items-quoted",n(g,{name:"ItemsQuotedTab",slot:t==null?void 0:t.ItemsQuotedTab,context:{quoteData:e},children:n(ft,{quoteData:e,onItemCheckboxChange:Ge,onRemoveItemsRef:a=>{Ne.current=a},onRemoveModalStateChange:a=>{!a&&ce.current==="remove"&&Se("")}})},"items-quoted")],["comments",n(g,{name:"CommentsTab",slot:t==null?void 0:t.CommentsTab,context:{quoteData:e},children:n(pt,{quoteData:e})},"comments")],["history-log",n(g,{name:"HistoryLogTab",slot:t==null?void 0:t.HistoryLogTab,context:{quoteData:e},children:n(it,{quoteData:e})},"history-log")]])})}),[t==null?void 0:t.QuoteContent,t==null?void 0:t.HistoryLogTab,t==null?void 0:t.CommentsTab,t==null?void 0:t.ItemsQuotedTab,e,Ge]),qa=f(()=>n(g,{name:"ShippingInformationTitle",slot:t==null?void 0:t.ShippingInformationTitle,context:{quoteData:e},children:n("h2",{children:o.shippingInformationTitle})}),[t==null?void 0:t.ShippingInformationTitle,e,o]),va=f(()=>{var a;return n(g,{name:"ShippingInformation",slot:t==null?void 0:t.ShippingInformation,context:{quoteData:e,loading:E,setLoading:k},children:n(ot,{shippingAddress:(a=e==null?void 0:e.shippingAddresses)==null?void 0:a[0],loading:E,"data-testid":"manage-quote-shipping-address"})})},[t==null?void 0:t.ShippingInformation,e,E,k]),Ta=f(()=>n(g,{name:"QuoteCommentsTitle",slot:t==null?void 0:t.QuoteCommentsTitle,context:{quoteData:e},children:n("h2",{children:o.quoteCommentsTitle})}),[t==null?void 0:t.QuoteCommentsTitle,o,e]),Ca=f(()=>n(g,{name:"QuoteComments",slot:t==null?void 0:t.QuoteComments,context:{quoteData:e},children:n(Ga,{name:"quoteComments",placeholder:o.quoteCommentsPlaceholder,rows:3,value:F,onInput:a=>{we(a.target.value)},disabled:!(e!=null&&e.canSendForReview)||Q})}),[t==null?void 0:t.QuoteComments,o,e,F,Q]),na=f(()=>!(e!=null&&e.canSendForReview),[e]),ya=f(()=>{const a=Q||na;return n(g,{name:"AttachFilesField",slot:t==null?void 0:t.AttachFilesField,context:{onFileChange:Qe,attachedFiles:b,fileUploadError:re,disabled:a},children:p("div",{className:"quote-management-manage-negotiable-quote__attach-files",...a?{"data-disabled":!0}:{},"aria-disabled":a,children:[n(Ka,{id:"manage-quote-attach-files",multiple:!0,onChange:i=>{const r=i.target,s=r==null?void 0:r.files,d=s?Array.from(s):[];d.length>0&&Qe(d)},icon:n(tt,{}),disabled:a,"data-testid":"manage-quote-attach-files",accept:N==null?void 0:N.join(","),children:o.attachFiles}),re&&n("div",{className:"quote-management-manage-negotiable-quote__file-error","data-testid":"file-upload-error",children:re})]})})},[t==null?void 0:t.AttachFilesField,Qe,Q,na,N,re,o,b]),_a=f(()=>{if(b.length)return n(g,{name:"AttachedFilesList",slot:t==null?void 0:t.AttachedFilesList,context:{files:b,onRemove:qe,disabled:Q},children:n(nt,{files:b,onRemove:qe,disabled:Q})})},[b,qe,Q,t==null?void 0:t.AttachedFilesList]),Ea=c(async()=>{if(e!=null&&e.uid){ue(!0),V(""),O("");try{await ct({quoteUids:[e.uid]})}catch(a){console.error("Failed to close quote:",a)}}},[e]),Da=c(()=>{de(!1),V(""),O("")},[]),Fa=c(async()=>{if(e!=null&&e.uid){Ue(!0),ae(""),j("");try{await st(e.uid),j(o.createTemplateSuccessMessage),setTimeout(()=>{ge(!1),j("")},2e3)}catch(a){console.error("Failed to create quote template:",a);const i=a instanceof Error?a.message:o.createTemplateErrorFallback;ae(i)}finally{Ue(!1)}}},[e,o.createTemplateSuccessMessage,o.createTemplateErrorFallback]),Ia=c(()=>{ge(!1),ae(""),j("")},[]),ve=c(async()=>{const a=b.filter(i=>i.status==="success");if(R){R({quoteData:e,comment:F.trim()||void 0,attachments:a.length?a:void 0});return}me(!0);try{await mt({quoteUid:e.uid,comment:F.trim()||void 0,attachments:a.length?a.map(i=>({key:i.key})):void 0})}catch(i){console.error("Failed to send quote for review:",i),me(!1)}},[e,R,F,b]),wa=f(()=>n(g,{name:"Footer",slot:t==null?void 0:t.Footer,context:{quoteData:e,comment:F,isSubmitting:Q,attachments:b,handleSendForReview:ve},children:n(sa,{variant:"primary",onClick:ve,"data-testid":"send-for-review-button",disabled:!(e!=null&&e.canSendForReview)||Q,children:o.sendForReview})}),[t==null?void 0:t.Footer,o,e,F,Q,b,ve]),xa=f(()=>Me?n(h,{type:"error",variant:"primary",icon:n(w,{color:"var(--color-error)"}),heading:o.renameErrorHeading,description:Me}):void 0,[Me,o.renameErrorHeading]),Ra=f(()=>be?n(h,{type:"success",variant:"primary",icon:n(J,{}),heading:o.renameSuccessHeading,description:be}):void 0,[be,o.renameSuccessHeading]),Te=c(a=>a.errors&&Array.isArray(a.errors)&&a.errors.length>0?a.errors[0].message||o.confirmationModalDeleteErrorFallback:(a==null?void 0:a.message)||o.confirmationModalDeleteErrorFallback,[o.confirmationModalDeleteErrorFallback]),La=c(()=>{Z(!1),$(null),ee(!1)},[]),ka=c(async()=>{if(e!=null&&e.uid){$(null),ee(!1);try{const{operationResults:a}=await dt(e.uid),i=a.find(r=>r.__typename==="DeleteNegotiableQuoteOperationFailure");if(i){const r=Te(i);$(r);return}ee(!0)}catch(a){const i=Te(a);$(i)}}},[e,Te]),Ha=c(()=>{$(null)},[]),Oa=c(()=>{ee(!1)},[]),oa=c(a=>(a==null?void 0:a.message)||o.confirmationModalDuplicateErrorFallback,[o.confirmationModalDuplicateErrorFallback]),Ua=c(()=>{se(!1),D(null),H(!1)},[]),Ba=c(async()=>{var a;if(e!=null&&e.uid){D(null),H(!1);try{const i=((a=e.items)==null?void 0:a.filter(q=>q.outOfStock))||[],s=(q=>{const I=q.slice(0,-8),T=crypto.randomUUID().slice(0,8);return I+T})(e.uid),d=i.length>0;d&&sessionStorage.setItem(`duplicate-outOfStock-warning-${s}`,"true"),await ut({quoteUid:e.uid,duplicatedQuoteUid:s,hasOutOfStockItems:d})}catch(i){const r=oa(i);D(r)}}},[e,oa]),Wa=c(()=>{D(null)},[]),za=c(()=>{H(!1)},[]),Pa=A?n(h,{type:"error",variant:"primary",icon:n(w,{}),heading:o.confirmationModalDeleteErrorHeading,description:A,onDismiss:Ha,"data-testid":"confirmation-modal-error-banner"}):null,ia=(ma?n(h,{type:"success",variant:"primary",icon:n(J,{}),heading:o.confirmationModalDeleteSuccessHeading,description:o.confirmationModalDeleteSuccessDescription,onDismiss:Oa,"data-testid":"confirmation-modal-success-banner"}):null)||Pa,$a=De?n(h,{type:"error",variant:"primary",icon:n(w,{}),heading:o.confirmationModalDuplicateErrorHeading,description:De,onDismiss:Wa,"data-testid":"confirmation-modal-duplicate-error-banner"}):null,ra=(da?n(h,{type:"success",variant:"primary",icon:n(J,{}),heading:o.confirmationModalDuplicateSuccessHeading,description:o.confirmationModalDuplicateSuccessDescription,onDismiss:za,"data-testid":"confirmation-modal-duplicate-success-banner"}):null)||$a,Va={...Y,loading:E,quoteName:Ma,quoteStatus:ba,banner:aa||ea?p(la,{children:[aa,ea]}):void 0,details:Na,actionBar:Sa,quoteContent:Qa,shippingInformationTitle:qa,shippingInformation:va,quoteCommentsTitle:Ta,quoteComments:Ca,attachFilesField:ya,attachedFilesList:_a,footer:wa};let Ce=null;Le?Ce=n(h,{type:"success",variant:"primary",icon:n(J,{}),heading:o.closeModalSuccessHeading,description:Le,"data-testid":"close-quote-success-banner"}):ke&&(Ce=n(h,{type:"error",variant:"primary",icon:n(w,{}),heading:o.confirmationModalDeleteErrorHeading,description:ke,"data-testid":"close-quote-error-banner"}));let ye=null;return Be?ye=n(h,{type:"success",variant:"primary",icon:n(J,{}),heading:o.createTemplateModalSuccessHeading,description:Be,"data-testid":"create-template-success-banner"}):We&&(ye=n(h,{type:"error",variant:"primary",icon:n(w,{}),heading:o.createTemplateModalErrorHeading,description:We,"data-testid":"create-template-error-banner"})),p(la,{children:[n(bt,{...Va}),ze&&W(n(Za,{open:ze,quoteName:te,renameReason:pe,quoteNameError:ua,errorBanner:xa,successBanner:Ra,onQuoteNameChange:fa,onRenameReasonChange:oe,onSave:pa,onClose:ga}),document.body),P&&W(n(X,{open:P,title:o.confirmationModalDeleteTitle,message:o.confirmationModalDeleteMessage,cancelLabel:o.confirmationModalCancel,confirmLabel:o.confirmationModalDeleteConfirm,onCancel:La,onConfirm:ka,showCloseButton:!ia,confirmationBanner:ia}),document.body),Ee&&W(n(X,{open:Ee,title:o.confirmationModalDuplicateTitle,message:o.confirmationModalDuplicateMessage,cancelLabel:o.confirmationModalCancel,confirmLabel:o.confirmationModalDuplicateConfirm,onCancel:Ua,onConfirm:Ba,showCloseButton:!ra,confirmationBanner:ra}),document.body),xe&&W(n(X,{open:xe,title:o.closeModalTitle,message:o.closeModalMessage,cancelLabel:o.closeModalCancel,confirmLabel:Re?o.closeModalConfirmLoading:o.closeModalConfirm,onCancel:Da,onConfirm:Re?void 0:Ea,showCloseButton:!0,confirmationBanner:Ce,"data-testid":"close-quote-confirmation-modal"}),document.body),He&&W(n(X,{open:He,title:o.createTemplateModalTitle,message:o.createTemplateModalMessage,cancelLabel:o.createTemplateModalCancel,confirmLabel:Oe?o.createTemplateModalConfirmLoading:o.createTemplateModalConfirm,onCancel:Ia,onConfirm:Oe?void 0:Fa,showCloseButton:!0,confirmationBanner:ye,"data-testid":"create-template-confirmation-modal"}),document.body),Ve&&W(n(X,{open:Ve,title:o.noItemsSelectedModalTitle,message:o.noItemsSelectedModalMessage,confirmLabel:o.noItemsSelectedModalConfirm,onConfirm:Xe,onClose:Xe,showCloseButton:!0,"data-testid":"no-items-selected-modal"}),document.body)]})};export{an as ManageNegotiableQuote,an as default};
3
+ import{jsx as n,jsxs as p,Fragment as la}from"@dropins/tools/preact-jsx-runtime.js";import{useState as l,useRef as _e,useEffect as q,useCallback as c,useMemo as f,createPortal as W}from"@dropins/tools/preact-compat.js";import{classes as u,VComponent as M,Slot as g}from"@dropins/tools/lib.js";import{f as ca}from"../chunks/dateUtils.js";/* empty css */import{Skeleton as ja,SkeletonRow as z,InLineAlert as h,Button as sa,TextArea as Ga,InputFile as Ka}from"@dropins/tools/components.js";import{events as C}from"@dropins/tools/event-bus.js";import{S as Xa,A as Ja,T as Ya,R as Za}from"../chunks/RenameQuoteModal.js";import{v as Aa,f as et,a as at,S as tt,A as nt}from"../chunks/AttachedFilesList.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{C as X}from"../chunks/ConfirmationModal.js";/* empty css *//* empty css */import{S as ot}from"../chunks/ShippingAddressDisplay.js";import{Q as it}from"../chunks/QuoteHistoryLog3.js";import{g as rt,r as lt,c as ct,a as st,s as mt,d as dt,b as ut}from"../chunks/duplicateNegotiableQuote.js";import"../chunks/state.js";import{u as gt}from"../chunks/uploadFile.js";import{I as ft}from"../chunks/ItemsQuoted.js";import{Q as pt}from"../chunks/QuoteCommentsList3.js";import{S as D}from"../chunks/WarningFilled.js";import{S as J}from"../chunks/CheckWithCircle.js";import{useText as Mt}from"@dropins/tools/i18n.js";import"../chunks/QuoteHistoryLog.js";import"../chunks/transform-quote.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/NegotiableQuoteFragment.js";import"../chunks/transform-quote-template.js";import"../chunks/NegotiableQuoteTemplateFragment.js";import"../chunks/LineItemNoteModal.js";import"../chunks/setLineItemNote.js";import"../chunks/QuoteCommentsList.js";const bt=({className:x,loading:t,quoteName:m,quoteStatus:R,banner:y,details:_,actionBar:N,quoteContent:L,shippingInformationTitle:Y,shippingInformation:e,quoteCommentsTitle:S,quoteComments:E,attachFilesField:k,attachedFilesList:P,footer:Z,...A})=>t?n(ht,{}):p("div",{...A,className:u(["quote-management-manage-negotiable-quote",x]),children:[p("div",{className:u(["quote-management-manage-negotiable-quote__header"]),children:[m&&n(M,{node:m,className:u(["quote-management-manage-negotiable-quote__quote-name"])}),R&&n(M,{node:R,className:u(["quote-management-manage-negotiable-quote__quote-status"])})]}),y&&n(M,{node:y,className:u(["quote-management-manage-negotiable-quote__banner"])}),_&&n(M,{node:_,className:u(["quote-management-manage-negotiable-quote__details"])}),N&&n(M,{node:N,className:u(["quote-management-manage-negotiable-quote__action-bar"])}),L&&n(M,{node:L,className:u(["quote-management-manage-negotiable-quote__quote-content"])}),p("div",{"data-testid":"quote-shipping-information-container",className:u(["quote-management-manage-negotiable-quote__shipping-information-container"]),children:[Y&&n(M,{node:Y,className:u(["quote-management-manage-negotiable-quote__shipping-information-title"])}),e&&n(M,{node:e,className:u(["quote-management-manage-negotiable-quote__shipping-information"])})]}),p("div",{"data-testid":"quote-comments-container",className:u(["quote-management-manage-negotiable-quote__quote-comments-container"]),children:[S&&n(M,{node:S,className:u(["quote-management-manage-negotiable-quote__quote-comments-title"])}),E&&n(M,{node:E,className:u(["quote-management-manage-negotiable-quote__quote-comments"])}),k&&n(M,{node:k,className:u(["quote-management-manage-negotiable-quote__attach-files-field"])}),P&&n(M,{node:P,className:u(["quote-management-manage-negotiable-quote__attached-files-list"])})]}),n(M,{node:Z,className:u(["quote-management-manage-negotiable-quote__footer"])})]}),ht=()=>p(ja,{"data-testid":"manage-negotiable-quote-skeleton",children:[n(z,{variant:"heading",fullWidth:!0,size:"large"}),n(z,{variant:"row",fullWidth:!1,size:"small"}),n(z,{variant:"row",fullWidth:!1,size:"small"}),n(z,{variant:"row",fullWidth:!0}),n(z,{variant:"row",fullWidth:!0,size:"xlarge",lines:2}),n(z,{variant:"row",fullWidth:!1,size:"small"})]}),an=({onActionsDropdownChange:x,slots:t,onActionsButtonClick:m,onSendForReview:R,maxFiles:y,maxFileSize:_,acceptedFileTypes:N,onDuplicateQuote:L,...Y})=>{const[e,S]=l(void 0),[E,k]=l(!0),[P,Z]=l(!1),[A,$]=l(null),[ma,ee]=l(!1),[Ee,se]=l(!1),[Fe,F]=l(null),[da,H]=l(!1),[Ie,we]=l(!1),[I,De]=l(""),[Q,me]=l(!1),[xe,de]=l(!1),[Re,ue]=l(!1),[Le,O]=l(""),[ke,V]=l(""),[He,ge]=l(!1),[Oe,Be]=l(!1),[Ue,j]=l(""),[We,ae]=l(""),[ze,fe]=l(!1),[te,ne]=l(""),[pe,oe]=l(""),[Me,G]=l(""),[ua,B]=l(""),[be,ie]=l(""),[b,K]=l([]),[re,le]=l(void 0),[he,Pe]=l(new Set),$e=_e(he),Ne=_e(null),[U,Se]=l(""),ce=_e(U),[Ve,je]=l(!1);q(()=>{$e.current=he},[he]),q(()=>{ce.current=U},[U]);const o=Mt({createdLabel:"NegotiableQuote.Manage.createdLabel",salesRepLabel:"NegotiableQuote.Manage.salesRepLabel",expiresLabel:"NegotiableQuote.Manage.expiresLabel",actionsLabel:"NegotiableQuote.Manage.actionsLabel",remove:"NegotiableQuote.Manage.actions.remove",close:"NegotiableQuote.Manage.actionButtons.close",delete:"NegotiableQuote.Manage.actionButtons.delete",print:"NegotiableQuote.Manage.actionButtons.print",createTemplate:"NegotiableQuote.Manage.actionButtons.createTemplate",createCopy:"NegotiableQuote.Manage.actionButtons.createCopy",shippingInformationTitle:"NegotiableQuote.Manage.shippingInformation.title",quoteCommentsTitle:"NegotiableQuote.Manage.quoteComments.title",quoteCommentsPlaceholder:"NegotiableQuote.Manage.quoteComments.placeholder",sendForReview:"NegotiableQuote.Manage.actionButtons.sendForReview",bannerTitle:"NegotiableQuote.Manage.bannerTitle",statusSubmitted:"NegotiableQuote.Manage.bannerStatusMessages.submitted",statusPending:"NegotiableQuote.Manage.bannerStatusMessages.pending",statusExpired:"NegotiableQuote.Manage.bannerStatusMessages.expired",errorFallback:"NegotiableQuote.Manage.confirmationModal.delete.errorFallback",closeSuccessMessage:"NegotiableQuote.Manage.confirmationModal.close.successDescription",closeModalTitle:"NegotiableQuote.Manage.actionButtons.close",closeModalMessage:"NegotiableQuote.Manage.confirmationModal.close.message",closeModalCancel:"NegotiableQuote.Manage.confirmationModal.cancel",closeModalConfirm:"NegotiableQuote.Manage.confirmationModal.close.confirm",closeModalConfirmLoading:"NegotiableQuote.Manage.confirmationModal.close.confirmLoading",closeModalSuccessHeading:"NegotiableQuote.Manage.confirmationModal.close.successHeading",createTemplateModalTitle:"NegotiableQuote.Manage.actionButtons.createTemplate",createTemplateModalMessage:"NegotiableQuote.Manage.confirmationModal.createTemplate.message",createTemplateModalCancel:"NegotiableQuote.Manage.confirmationModal.cancel",createTemplateModalConfirm:"NegotiableQuote.Manage.confirmationModal.createTemplate.confirm",createTemplateModalConfirmLoading:"NegotiableQuote.Manage.confirmationModal.createTemplate.confirmLoading",createTemplateModalSuccessHeading:"NegotiableQuote.Manage.confirmationModal.createTemplate.successHeading",createTemplateSuccessMessage:"NegotiableQuote.Manage.confirmationModal.createTemplate.successDescription",createTemplateModalErrorHeading:"NegotiableQuote.Manage.confirmationModal.createTemplate.errorHeading",createTemplateErrorFallback:"NegotiableQuote.Manage.confirmationModal.createTemplate.errorFallback",renameErrorHeading:"NegotiableQuote.Manage.rename.errorHeading",renameQuoteNameRequired:"NegotiableQuote.Manage.rename.quoteNameRequired",renameErrorDefault:"NegotiableQuote.Manage.rename.errorDefault",renameSuccessHeading:"NegotiableQuote.Manage.rename.successHeading",renameSuccessMessage:"NegotiableQuote.Manage.rename.successMessage",confirmationModalCancel:"NegotiableQuote.Manage.confirmationModal.cancel",confirmationModalDeleteTitle:"NegotiableQuote.Manage.confirmationModal.delete.title",confirmationModalDeleteMessage:"NegotiableQuote.Manage.confirmationModal.delete.message",confirmationModalDeleteConfirm:"NegotiableQuote.Manage.confirmationModal.delete.confirm",confirmationModalDeleteErrorHeading:"NegotiableQuote.Manage.confirmationModal.delete.errorHeading",confirmationModalDeleteErrorFallback:"NegotiableQuote.Manage.confirmationModal.delete.errorFallback",confirmationModalDeleteSuccessHeading:"NegotiableQuote.Manage.confirmationModal.delete.successHeading",confirmationModalDeleteSuccessDescription:"NegotiableQuote.Manage.confirmationModal.delete.successDescription",confirmationModalDuplicateTitle:"NegotiableQuote.Manage.confirmationModal.duplicate.title",confirmationModalDuplicateMessage:"NegotiableQuote.Manage.confirmationModal.duplicate.message",confirmationModalDuplicateConfirm:"NegotiableQuote.Manage.confirmationModal.duplicate.confirm",confirmationModalDuplicateErrorHeading:"NegotiableQuote.Manage.confirmationModal.duplicate.errorHeading",confirmationModalDuplicateErrorFallback:"NegotiableQuote.Manage.confirmationModal.duplicate.errorFallback",confirmationModalDuplicateSuccessHeading:"NegotiableQuote.Manage.confirmationModal.duplicate.successHeading",confirmationModalDuplicateSuccessDescription:"NegotiableQuote.Manage.confirmationModal.duplicate.successDescription",duplicateOutOfStockWarningHeading:"NegotiableQuote.Manage.confirmationModal.duplicate.outOfStockWarningHeading",duplicateOutOfStockWarningMessage:"NegotiableQuote.Manage.confirmationModal.duplicate.outOfStockWarningMessage",noItemsSelectedModalTitle:"NegotiableQuote.Manage.confirmationModal.noItemsSelected.title",noItemsSelectedModalMessage:"NegotiableQuote.Manage.confirmationModal.noItemsSelected.message",noItemsSelectedModalConfirm:"NegotiableQuote.Manage.confirmationModal.noItemsSelected.confirm",attachFiles:"NegotiableQuote.Manage.attachFiles",fileUploadError:"NegotiableQuote.Manage.fileUploadError",maxFilesExceeded:"NegotiableQuote.Manage.maxFilesExceeded",maxFileSizeExceeded:"NegotiableQuote.Manage.maxFileSizeExceeded",invalidFileType:"NegotiableQuote.Manage.invalidFileType"});q(()=>{const a=C.on("quote-management/quote-data",i=>{const{quote:r}=i;if(r){S(r),k(!1);const s=`duplicate-outOfStock-warning-${r.uid}`;sessionStorage.getItem(s)==="true"&&(we(!0),sessionStorage.removeItem(s))}},{eager:!0});return()=>a==null?void 0:a.off()},[]),q(()=>{const a=C.on("quote-management/shipping-address-set",i=>{const{quote:r}=i;r&&S(r)},{eager:!0});return()=>a==null?void 0:a.off()},[]),q(()=>{const a=C.on("quote-management/quote-sent-for-review",i=>{const{quote:r}=i;S(r),De(""),K([]),me(!1)},{eager:!0});return()=>a==null?void 0:a.off()},[]),q(()=>{const a=C.on("quote-management/quote-items-removed",i=>{const{quote:r,removedItemUids:s}=i;r&&S(r),s&&Pe(d=>{const v=new Set(d);return s.forEach(w=>v.delete(w)),v})},{eager:!0});return()=>a==null?void 0:a.off()},[]);const Ge=c((a,i)=>{Pe(r=>{const s=new Set(r);return i?s.add(a.uid):s.delete(a.uid),s})},[]),Ke=c(a=>{const i=a.target.value,r=$e.current;if(i==="remove"){if(Se(i),ce.current=i,r.size===0)je(!0);else if(e&&Ne.current){const s=e.items.filter(d=>r.has(d.uid));Ne.current(s)}}x==null||x(a)},[x,e]),Xe=c(()=>{je(!1),Se(""),ce.current=""},[]);q(()=>{const a=C.on("quote-management/negotiable-quote-closed",async i=>{ue(!1),V(""),O(o.closeSuccessMessage),S(r=>{var s;return r!=null&&r.uid&&((s=i.closedQuoteUids)!=null&&s.includes(r.uid))&&rt(r.uid).then(d=>{S(d)}).catch(d=>{console.warn("Failed to refresh quote data after closure:",d)}),r}),setTimeout(()=>{de(!1),O("")},2e3)},{eager:!0});return()=>a==null?void 0:a.off()},[o.closeSuccessMessage]),q(()=>{const a=C.on("quote-management/negotiable-quote-close-error",i=>{console.log("Close error event received:",i),ue(!1),O("");const r=i.error.message||o.errorFallback;V(r)},{eager:!0});return()=>a==null?void 0:a.off()},[o.errorFallback]),q(()=>{const a=C.on("quote-management/quote-renamed",i=>{const{quote:r}=i;S(r),G(""),B(""),ie(o.renameSuccessMessage),setTimeout(()=>{fe(!1),ne(""),oe(""),ie("")},2e3)},{eager:!0});return()=>a==null?void 0:a.off()},[o.renameSuccessMessage]),q(()=>{const a=C.on("quote-management/quote-duplicated",i=>{const{quote:r}=i;e&&L&&L({quoteData:e,newQuote:r}),H(!0),F(null),setTimeout(()=>{se(!1),H(!1),F(null)},2e3)},{eager:!0});return()=>a==null?void 0:a.off()},[e,L]);const Qe=c(async a=>{if(y&&b.length+a.length>y){le(o.maxFilesExceeded.replace("{maxFiles}",String(y)));return}for(const r of a){if(_&&!Aa(r.size,_)){le(o.maxFileSizeExceeded.replace("{maxSize}",et(_)));return}if(N&&!at(r.type,N)){le(o.invalidFileType);return}}le(void 0);const i=a.map(r=>({key:`temp-${Date.now()}-${Math.random()}-${r.name}`,name:r.name,size:r.size,status:"uploading"}));K(r=>[...r,...i]);for(let r=0;r<a.length;r++){const s=a[r],d=i[r].key;try{const v=await gt(s);K(w=>w.map(T=>T.key===d?{...T,key:v.key,status:"success"}:T))}catch(v){K(w=>w.map(T=>T.key===d?{...T,status:"error",error:v.message}:T))}}},[y,_,N,b,o]),ve=c(a=>{K(i=>i.filter(r=>r.key!==a))},[]),Je=c(()=>{ne((e==null?void 0:e.name)||""),oe(""),G(""),B(""),ie(""),fe(!0)},[e]),ga=c(()=>{fe(!1),ne(""),oe(""),G(""),B(""),ie("")},[]),fa=c(a=>{ne(a),a.trim()&&B("")},[]),Ye=c(()=>{se(!0),F(null),H(!1)},[]),pa=c(async()=>{if(!te.trim()){B(o.renameQuoteNameRequired);return}try{G(""),B(""),await lt({quoteUid:e.uid,quoteName:te,quoteComment:pe.trim()||void 0})}catch(a){G(a.message||o.renameErrorDefault)}},[e,te,pe,o.renameQuoteNameRequired,o.renameErrorDefault]),Ma=f(()=>{const a=e&&(e.lockedForEditing===!0||e.lockedForEditing===void 0&&(e.status==="SUBMITTED"||e.status==="PENDING"||e.status==="ORDERED"||e.status==="CLOSED"));return n(g,{name:"QuoteName",slot:t==null?void 0:t.QuoteName,context:{quoteName:e==null?void 0:e.name,quoteData:e},children:p("div",{className:"quote-management-manage-negotiable-quote__quote-name-wrapper",children:[n("h1",{"data-testid":"quote-name",className:"quote-management-manage-negotiable-quote__quote-name-title",children:e==null?void 0:e.name}),n("button",{onClick:Je,disabled:a,"data-testid":"rename-quote-button",className:"quote-management-manage-negotiable-quote__rename-button","aria-label":"Rename quote",children:n(Xa,{})})]})})},[t==null?void 0:t.QuoteName,e,Je]),ba=f(()=>n(g,{name:"QuoteStatus",slot:t==null?void 0:t.QuoteStatus,context:{quoteStatus:e==null?void 0:e.status,quoteData:e},children:n("div",{"data-testid":"quote-status",children:e==null?void 0:e.status})}),[t==null?void 0:t.QuoteStatus,e]),Ze=c(a=>{switch(a){case"SUBMITTED":return o.statusSubmitted;case"PENDING":return o.statusPending;case"EXPIRED":return o.statusExpired;default:return null}},[o])(e==null?void 0:e.status),Ae=Ze&&n(h,{type:"warning",variant:"secondary",icon:n(D,{}),heading:o.bannerTitle,description:Ze}),ea=Ae&&n(g,{name:"Banner","data-testid":"banner",slot:t==null?void 0:t.Banner,context:{quoteData:e},children:Ae}),ha=c(()=>{we(!1)},[]),aa=Ie&&n(g,{name:"DuplicateQuoteWarningBanner","data-testid":"duplicate-outOfStock-warning-banner",slot:t==null?void 0:t.DuplicateQuoteWarningBanner,context:{outOfStockWarning:Ie},children:n(h,{type:"warning",variant:"primary",icon:n(D,{}),heading:o.duplicateOutOfStockWarningHeading,description:o.duplicateOutOfStockWarningMessage,onDismiss:ha,"data-testid":"duplicate-outOfStock-warning-alert"})}),Na=f(()=>{if(!e)return;const a=e.expirationDate?ca(e.expirationDate,"short"):void 0;return p(g,{name:"Details",slot:t==null?void 0:t.Details,context:{quoteData:e},children:[p("div",{className:"quote-management-manage-negotiable-quote__detail",children:[n("span",{className:"quote-management-manage-negotiable-quote__detail-title","data-testid":"created-label",children:o.createdLabel}),p("span",{className:"quote-management-manage-negotiable-quote__detail-content","data-testid":"created-value",children:[ca(e.createdAt,"short")," (",e.buyer.firstname," ",e.buyer.lastname,")"]})]}),p("div",{className:"quote-management-manage-negotiable-quote__detail",children:[n("span",{className:"quote-management-manage-negotiable-quote__detail-title","data-testid":"sales-rep-label",children:o.salesRepLabel}),n("span",{className:"quote-management-manage-negotiable-quote__detail-content","data-testid":"sales-rep-value",children:e.salesRepName})]}),p("div",{className:"quote-management-manage-negotiable-quote__detail",children:[n("span",{className:"quote-management-manage-negotiable-quote__detail-title","data-testid":"expires-label",children:o.expiresLabel}),n("span",{className:"quote-management-manage-negotiable-quote__detail-content","data-testid":"expires-value",children:a})]})]})},[t==null?void 0:t.Details,o,e]),ta=f(()=>[{label:o.close,value:"close",disabled:!(e!=null&&e.canClose)},{label:o.delete,value:"delete",disabled:!(e!=null&&e.canDelete)},{label:o.print,value:"print"},{label:o.createTemplate,value:"createTemplate",disabled:!!(e!=null&&e.templateName)},{label:o.createCopy,value:"createCopy",disabled:!!(e!=null&&e.templateName)}],[o,e==null?void 0:e.canDelete,e==null?void 0:e.canClose,e==null?void 0:e.templateName]),Sa=f(()=>{const a=i=>{switch(i){case"close":de(!0),V(""),O(""),m==null||m(i);break;case"delete":Z(!0),m==null||m(i);break;case"print":m==null||m(i);break;case"createTemplate":ge(!0),ae(""),j(""),m==null||m(i);break;case"createCopy":Ye(),m==null||m(i);break}};return n(g,{name:"ActionBar",slot:t==null?void 0:t.ActionBar,context:{quoteData:e,actionsBarDropdownValue:U},children:n(Ja,{dropdownPlaceholder:o.actionsLabel,dropdownOptions:[{label:o.remove,value:"remove"}],dropdownValue:U,handleDropdownChange:Ke,buttons:ta.map(i=>n(sa,{variant:"tertiary",onClick:()=>a(i.value),"data-testid":`actions-bar-${i.value}-button`,"data-action":i.value,disabled:i.disabled,children:i.label},i.value))})})},[ta,o,t==null?void 0:t.ActionBar,e,Ke,m,Ye,U]),Qa=f(()=>n(g,{name:"QuoteContent",slot:t==null?void 0:t.QuoteContent,context:{quoteData:e},children:n(Ya,{tabs:new Map([["items-quoted","Items Quoted"],["comments","Comments"],["history-log","History Log"]]),tabsContent:new Map([["items-quoted",n(g,{name:"ItemsQuotedTab",slot:t==null?void 0:t.ItemsQuotedTab,context:{quoteData:e},children:n(ft,{quoteData:e,onItemCheckboxChange:Ge,onRemoveItemsRef:a=>{Ne.current=a},onRemoveModalStateChange:a=>{!a&&ce.current==="remove"&&Se("")}})},"items-quoted")],["comments",n(g,{name:"CommentsTab",slot:t==null?void 0:t.CommentsTab,context:{quoteData:e},children:n(pt,{quoteData:e})},"comments")],["history-log",n(g,{name:"HistoryLogTab",slot:t==null?void 0:t.HistoryLogTab,context:{quoteData:e},children:n(it,{quoteData:e})},"history-log")]])})}),[t==null?void 0:t.QuoteContent,t==null?void 0:t.HistoryLogTab,t==null?void 0:t.CommentsTab,t==null?void 0:t.ItemsQuotedTab,e,Ge]),va=f(()=>n(g,{name:"ShippingInformationTitle",slot:t==null?void 0:t.ShippingInformationTitle,context:{quoteData:e},children:n("h2",{children:o.shippingInformationTitle})}),[t==null?void 0:t.ShippingInformationTitle,e,o]),qa=f(()=>{var a;return n(g,{name:"ShippingInformation",slot:t==null?void 0:t.ShippingInformation,context:{quoteData:e,loading:E,setLoading:k},children:n(ot,{shippingAddress:(a=e==null?void 0:e.shippingAddresses)==null?void 0:a[0],loading:E,"data-testid":"manage-quote-shipping-address"})})},[t==null?void 0:t.ShippingInformation,e,E,k]),Ta=f(()=>n(g,{name:"QuoteCommentsTitle",slot:t==null?void 0:t.QuoteCommentsTitle,context:{quoteData:e},children:n("h2",{children:o.quoteCommentsTitle})}),[t==null?void 0:t.QuoteCommentsTitle,o,e]),Ca=f(()=>n(g,{name:"QuoteComments",slot:t==null?void 0:t.QuoteComments,context:{quoteData:e},children:n(Ga,{name:"quoteComments",placeholder:o.quoteCommentsPlaceholder,rows:3,value:I,onInput:a=>{De(a.target.value)},disabled:!(e!=null&&e.canSendForReview)||Q})}),[t==null?void 0:t.QuoteComments,o,e,I,Q]),na=f(()=>!(e!=null&&e.canSendForReview),[e]),ya=f(()=>{const a=Q||na;return n(g,{name:"AttachFilesField",slot:t==null?void 0:t.AttachFilesField,context:{onFileChange:Qe,attachedFiles:b,fileUploadError:re,disabled:a},children:p("div",{className:"quote-management-manage-negotiable-quote__attach-files",...a?{"data-disabled":!0}:{},"aria-disabled":a,children:[n(Ka,{id:"manage-quote-attach-files",multiple:!0,onChange:i=>{const r=i.target,s=r==null?void 0:r.files,d=s?Array.from(s):[];d.length>0&&Qe(d)},icon:n(tt,{}),disabled:a,"data-testid":"manage-quote-attach-files",accept:N==null?void 0:N.join(","),children:o.attachFiles}),re&&n("div",{className:"quote-management-manage-negotiable-quote__file-error","data-testid":"file-upload-error",children:re})]})})},[t==null?void 0:t.AttachFilesField,Qe,Q,na,N,re,o,b]),_a=f(()=>{if(b.length)return n(g,{name:"AttachedFilesList",slot:t==null?void 0:t.AttachedFilesList,context:{files:b,onRemove:ve,disabled:Q},children:n(nt,{files:b,onRemove:ve,disabled:Q})})},[b,ve,Q,t==null?void 0:t.AttachedFilesList]),Ea=c(async()=>{if(e!=null&&e.uid){ue(!0),V(""),O("");try{await ct({quoteUids:[e.uid]})}catch(a){console.error("Failed to close quote:",a)}}},[e]),Fa=c(()=>{de(!1),V(""),O("")},[]),Ia=c(async()=>{if(e!=null&&e.uid){Be(!0),ae(""),j("");try{await st(e.uid),j(o.createTemplateSuccessMessage),setTimeout(()=>{ge(!1),j("")},2e3)}catch(a){console.error("Failed to create quote template:",a);const i=a instanceof Error?a.message:o.createTemplateErrorFallback;ae(i)}finally{Be(!1)}}},[e,o.createTemplateSuccessMessage,o.createTemplateErrorFallback]),wa=c(()=>{ge(!1),ae(""),j("")},[]),qe=c(async()=>{const a=b.filter(i=>i.status==="success");if(R){R({quoteData:e,comment:I.trim()||void 0,attachments:a.length?a:void 0});return}me(!0);try{await mt({quoteUid:e.uid,comment:I.trim()||void 0,attachments:a.length?a.map(i=>({key:i.key})):void 0})}catch(i){console.error("Failed to send quote for review:",i),me(!1)}},[e,R,I,b]),Da=f(()=>n(g,{name:"Footer",slot:t==null?void 0:t.Footer,context:{quoteData:e,comment:I,isSubmitting:Q,attachments:b,handleSendForReview:qe},children:n(sa,{variant:"primary",onClick:qe,"data-testid":"send-for-review-button",disabled:!(e!=null&&e.canSendForReview)||Q,children:o.sendForReview})}),[t==null?void 0:t.Footer,o,e,I,Q,b,qe]),xa=f(()=>Me?n(h,{type:"error",variant:"primary",icon:n(D,{color:"var(--color-error)"}),heading:o.renameErrorHeading,description:Me}):void 0,[Me,o.renameErrorHeading]),Ra=f(()=>be?n(h,{type:"success",variant:"primary",icon:n(J,{}),heading:o.renameSuccessHeading,description:be}):void 0,[be,o.renameSuccessHeading]),Te=c(a=>a.errors&&Array.isArray(a.errors)&&a.errors.length>0?a.errors[0].message||o.confirmationModalDeleteErrorFallback:(a==null?void 0:a.message)||o.confirmationModalDeleteErrorFallback,[o.confirmationModalDeleteErrorFallback]),La=c(()=>{Z(!1),$(null),ee(!1)},[]),ka=c(async()=>{if(e!=null&&e.uid){$(null),ee(!1);try{const{operationResults:a}=await dt(e.uid),i=a.find(r=>r.__typename==="DeleteNegotiableQuoteOperationFailure");if(i){const r=Te(i);$(r);return}ee(!0)}catch(a){const i=Te(a);$(i)}}},[e,Te]),Ha=c(()=>{$(null)},[]),Oa=c(()=>{ee(!1)},[]),oa=c(a=>(a==null?void 0:a.message)||o.confirmationModalDuplicateErrorFallback,[o.confirmationModalDuplicateErrorFallback]),Ba=c(()=>{se(!1),F(null),H(!1)},[]),Ua=c(async()=>{var a;if(e!=null&&e.uid){F(null),H(!1);try{const i=((a=e.items)==null?void 0:a.filter(v=>v.outOfStock))||[],s=(v=>{const w=v.slice(0,-8),T=crypto.randomUUID().slice(0,8);return w+T})(e.uid),d=i.length>0;d&&sessionStorage.setItem(`duplicate-outOfStock-warning-${s}`,"true"),await ut({quoteUid:e.uid,duplicatedQuoteUid:s,hasOutOfStockItems:d})}catch(i){const r=oa(i);F(r)}}},[e,oa]),Wa=c(()=>{F(null)},[]),za=c(()=>{H(!1)},[]),Pa=A?n(h,{type:"error",variant:"primary",icon:n(D,{}),heading:o.confirmationModalDeleteErrorHeading,description:A,onDismiss:Ha,"data-testid":"confirmation-modal-error-banner"}):null,ia=(ma?n(h,{type:"success",variant:"primary",icon:n(J,{}),heading:o.confirmationModalDeleteSuccessHeading,description:o.confirmationModalDeleteSuccessDescription,onDismiss:Oa,"data-testid":"confirmation-modal-success-banner"}):null)||Pa,$a=Fe?n(h,{type:"error",variant:"primary",icon:n(D,{}),heading:o.confirmationModalDuplicateErrorHeading,description:Fe,onDismiss:Wa,"data-testid":"confirmation-modal-duplicate-error-banner"}):null,ra=(da?n(h,{type:"success",variant:"primary",icon:n(J,{}),heading:o.confirmationModalDuplicateSuccessHeading,description:o.confirmationModalDuplicateSuccessDescription,onDismiss:za,"data-testid":"confirmation-modal-duplicate-success-banner"}):null)||$a,Va={...Y,loading:E,quoteName:Ma,quoteStatus:ba,banner:aa||ea?p(la,{children:[aa,ea]}):void 0,details:Na,actionBar:Sa,quoteContent:Qa,shippingInformationTitle:va,shippingInformation:qa,quoteCommentsTitle:Ta,quoteComments:Ca,attachFilesField:ya,attachedFilesList:_a,footer:Da};let Ce=null;Le?Ce=n(h,{type:"success",variant:"primary",icon:n(J,{}),heading:o.closeModalSuccessHeading,description:Le,"data-testid":"close-quote-success-banner"}):ke&&(Ce=n(h,{type:"error",variant:"primary",icon:n(D,{}),heading:o.confirmationModalDeleteErrorHeading,description:ke,"data-testid":"close-quote-error-banner"}));let ye=null;return Ue?ye=n(h,{type:"success",variant:"primary",icon:n(J,{}),heading:o.createTemplateModalSuccessHeading,description:Ue,"data-testid":"create-template-success-banner"}):We&&(ye=n(h,{type:"error",variant:"primary",icon:n(D,{}),heading:o.createTemplateModalErrorHeading,description:We,"data-testid":"create-template-error-banner"})),p(la,{children:[n(bt,{...Va}),ze&&W(n(Za,{open:ze,quoteName:te,renameReason:pe,quoteNameError:ua,errorBanner:xa,successBanner:Ra,onQuoteNameChange:fa,onRenameReasonChange:oe,onSave:pa,onClose:ga}),document.body),P&&W(n(X,{open:P,title:o.confirmationModalDeleteTitle,message:o.confirmationModalDeleteMessage,cancelLabel:o.confirmationModalCancel,confirmLabel:o.confirmationModalDeleteConfirm,onCancel:La,onConfirm:ka,showCloseButton:!ia,confirmationBanner:ia}),document.body),Ee&&W(n(X,{open:Ee,title:o.confirmationModalDuplicateTitle,message:o.confirmationModalDuplicateMessage,cancelLabel:o.confirmationModalCancel,confirmLabel:o.confirmationModalDuplicateConfirm,onCancel:Ba,onConfirm:Ua,showCloseButton:!ra,confirmationBanner:ra}),document.body),xe&&W(n(X,{open:xe,title:o.closeModalTitle,message:o.closeModalMessage,cancelLabel:o.closeModalCancel,confirmLabel:Re?o.closeModalConfirmLoading:o.closeModalConfirm,onCancel:Fa,onConfirm:Re?void 0:Ea,showCloseButton:!0,confirmationBanner:Ce,"data-testid":"close-quote-confirmation-modal"}),document.body),He&&W(n(X,{open:He,title:o.createTemplateModalTitle,message:o.createTemplateModalMessage,cancelLabel:o.createTemplateModalCancel,confirmLabel:Oe?o.createTemplateModalConfirmLoading:o.createTemplateModalConfirm,onCancel:wa,onConfirm:Oe?void 0:Ia,showCloseButton:!0,confirmationBanner:ye,"data-testid":"create-template-confirmation-modal"}),document.body),Ve&&W(n(X,{open:Ve,title:o.noItemsSelectedModalTitle,message:o.noItemsSelectedModalMessage,confirmLabel:o.noItemsSelectedModalConfirm,onConfirm:Xe,onClose:Xe,showCloseButton:!0,"data-testid":"no-items-selected-modal"}),document.body)]})};export{an as ManageNegotiableQuote,an as default};
4
4
  //# sourceMappingURL=ManageNegotiableQuote.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ManageNegotiableQuote.js","sources":["/@dropins/storefront-quote-management/src/components/ManageNegotiableQuote/ManageNegotiableQuote.tsx","/@dropins/storefront-quote-management/src/containers/ManageNegotiableQuote/ManageNegotiableQuote.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, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/ManageNegotiableQuote/ManageNegotiableQuote.css';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\n\nexport interface ManageNegotiableQuoteProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n loading?: boolean;\n quoteName: VNode;\n quoteStatus: VNode;\n banner?: VNode;\n details?: VNode;\n actionBar?: VNode;\n quoteContent: VNode;\n shippingInformationTitle: VNode;\n shippingInformation: VNode;\n quoteCommentsTitle: VNode;\n quoteComments: VNode;\n attachFilesField?: VNode;\n attachedFilesList?: VNode;\n footer: VNode;\n}\n\nexport const ManageNegotiableQuote: FunctionComponent<ManageNegotiableQuoteProps> = ({\n className,\n loading,\n quoteName,\n quoteStatus,\n banner,\n details,\n actionBar,\n quoteContent,\n shippingInformationTitle,\n shippingInformation,\n quoteCommentsTitle,\n quoteComments,\n attachFilesField,\n attachedFilesList,\n footer,\n ...props\n}) => {\n if (loading) {\n return <ManageNegotiableQuoteSkeleton />;\n }\n\n return (\n <div {...props} className={classes(['quote-management-manage-negotiable-quote', className])}>\n <div className={classes(['quote-management-manage-negotiable-quote__header'])}>\n {quoteName &&\n <VComponent\n node={quoteName}\n className={classes(['quote-management-manage-negotiable-quote__quote-name'])}\n />\n }\n {quoteStatus &&\n <VComponent\n node={quoteStatus}\n className={classes(['quote-management-manage-negotiable-quote__quote-status'])}\n />\n }\n </div>\n {banner &&\n <VComponent\n node={banner}\n className={classes(['quote-management-manage-negotiable-quote__banner'])}\n />\n }\n {details &&\n <VComponent\n node={details}\n className={classes(['quote-management-manage-negotiable-quote__details'])}\n />\n }\n {actionBar &&\n <VComponent\n node={actionBar}\n className={classes(['quote-management-manage-negotiable-quote__action-bar'])}\n />\n }\n {quoteContent &&\n <VComponent\n node={quoteContent}\n className={classes(['quote-management-manage-negotiable-quote__quote-content'])}\n />\n }\n <div data-testid=\"quote-shipping-information-container\" className={classes(['quote-management-manage-negotiable-quote__shipping-information-container'])}>\n {shippingInformationTitle &&\n <VComponent\n node={shippingInformationTitle}\n className={classes(['quote-management-manage-negotiable-quote__shipping-information-title'])}\n />\n }\n {shippingInformation &&\n <VComponent\n node={shippingInformation}\n className={classes(['quote-management-manage-negotiable-quote__shipping-information'])}\n />\n }\n </div>\n <div data-testid=\"quote-comments-container\" className={classes(['quote-management-manage-negotiable-quote__quote-comments-container'])}>\n {quoteCommentsTitle &&\n <VComponent\n node={quoteCommentsTitle}\n className={classes(['quote-management-manage-negotiable-quote__quote-comments-title'])}\n />\n }\n {quoteComments &&\n <VComponent\n node={quoteComments}\n className={classes(['quote-management-manage-negotiable-quote__quote-comments'])}\n />\n }\n {attachFilesField &&\n <VComponent\n node={attachFilesField}\n className={classes(['quote-management-manage-negotiable-quote__attach-files-field'])}\n />\n }\n {attachedFilesList &&\n <VComponent\n node={attachedFilesList}\n className={classes(['quote-management-manage-negotiable-quote__attached-files-list'])}\n />\n }\n </div>\n <VComponent\n node={footer}\n className={classes(['quote-management-manage-negotiable-quote__footer'])}\n />\n </div>\n );\n};\n\nexport const ManageNegotiableQuoteSkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"manage-negotiable-quote-skeleton\">\n <SkeletonRow variant=\"heading\" fullWidth={true} size=\"large\" />\n <SkeletonRow variant=\"row\" fullWidth={false} size=\"small\" />\n <SkeletonRow variant=\"row\" fullWidth={false} size=\"small\" />\n <SkeletonRow variant=\"row\" fullWidth={true} />\n <SkeletonRow variant=\"row\" fullWidth={true} size=\"xlarge\" lines={2} />\n <SkeletonRow variant=\"row\" fullWidth={false} size=\"small\" />\n </Skeleton>\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 {\n HTMLAttributes,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n createPortal,\n} from 'preact/compat';\nimport {\n Container,\n Slot,\n SlotProps,\n} from '@adobe-commerce/elsie/lib';\nimport { formattedDate } from '@/quote-management/utils/dateUtils';\nimport {\n NegotiableQuoteModel,\n CartItemModel,\n} from '@/quote-management/data/models/negotiable-quote-model';\nimport {\n ManageNegotiableQuote as ManageNegotiableQuoteComponent,\n ManageNegotiableQuoteProps as ManageNegotiableQuoteComponentProps,\n} from '@/quote-management/components/ManageNegotiableQuote';\nimport { events } from '@adobe-commerce/event-bus';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n ActionsBar,\n TabbedContent,\n ConfirmationModal,\n AttachedFilesList,\n AttachedFile,\n} from '@/quote-management/components';\nimport { ShippingAddressDisplay } from '@/quote-management/containers/ShippingAddressDisplay';\nimport { QuoteHistoryLog } from '@/quote-management/containers/QuoteHistoryLog';\nimport { ItemsQuoted, QuoteCommentsList } from '@/quote-management/containers';\nimport {\n Button,\n InLineAlert,\n TextArea,\n InputFile,\n} from '@adobe-commerce/elsie/components';\nimport {\n WarningFilled,\n Edit,\n CheckWithCircle,\n Add,\n} from '@adobe-commerce/elsie/icons';\nimport {\n deleteQuote,\n sendForReview,\n renameNegotiableQuote,\n closeNegotiableQuote,\n getQuoteData,\n uploadFile,\n duplicateQuote,\n createQuoteTemplate,\n} from '@/quote-management/api';\nimport {\n formatFileSize,\n validateFileType,\n validateFileSize,\n} from '@/quote-management/utils/fileUtils';\nimport { RenameQuoteModal } from '@/quote-management/components/RenameQuoteModal';\n\nexport interface ManageNegotiableQuoteProps\n extends HTMLAttributes<HTMLDivElement> {\n onActionsDropdownChange?: (event: Event) => void;\n onActionsButtonClick?: (action: string) => void;\n onSendForReview?: (params: {\n quoteData: NegotiableQuoteModel;\n comment?: string;\n attachments?: AttachedFile[];\n }) => void;\n maxFiles?: number;\n maxFileSize?: number;\n acceptedFileTypes?: string[];\n onDuplicateQuote?: (params: {\n quoteData: NegotiableQuoteModel;\n newQuote: NegotiableQuoteModel;\n }) => void;\n slots?: {\n QuoteName?: SlotProps<{\n quoteName?: string;\n quoteData?: NegotiableQuoteModel;\n }>;\n QuoteStatus?: SlotProps<{\n quoteStatus?: string;\n quoteData?: NegotiableQuoteModel;\n }>;\n Banner?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n DuplicateQuoteWarningBanner?: SlotProps<{\n outOfStockWarning?: boolean;\n }>;\n Details?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n ActionBar?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n actionsBarDropdownValue?: string;\n }>;\n QuoteContent?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n ItemsQuotedTab?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n CommentsTab?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n HistoryLogTab?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n ShippingInformationTitle?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n ShippingInformation?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n loading?: boolean;\n setLoading?: (loading: boolean) => void;\n }>;\n QuoteCommentsTitle?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n QuoteComments?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n AttachFilesField?: SlotProps<{\n onFileChange: (files: File[]) => void;\n attachedFiles: AttachedFile[];\n fileUploadError: string | undefined;\n disabled?: boolean;\n }>;\n AttachedFilesList?: SlotProps<{\n files: AttachedFile[];\n onRemove: (key: string) => void;\n disabled?: boolean;\n }>;\n Footer?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n comment?: string;\n isSubmitting?: boolean;\n attachments?: AttachedFile[];\n handleSendForReview: () => void;\n }>;\n };\n}\n\nexport const ManageNegotiableQuote: Container<ManageNegotiableQuoteProps> = ({\n onActionsDropdownChange,\n slots,\n onActionsButtonClick,\n onSendForReview,\n maxFiles,\n maxFileSize,\n acceptedFileTypes,\n onDuplicateQuote,\n ...props\n}) => {\n const [quoteData, setQuoteData] = useState<NegotiableQuoteModel | undefined>(\n undefined\n );\n const [loading, setLoading] = useState<boolean>(true);\n const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState<boolean>(false);\n const [deleteError, setDeleteError] = useState<string | null>(null);\n const [deleteSuccess, setDeleteSuccess] = useState<boolean>(false);\n const [isDuplicateDialogOpen, setIsDuplicateDialogOpen] = useState<boolean>(false);\n const [duplicateError, setDuplicateError] = useState<string | null>(null);\n const [duplicateSuccess, setDuplicateSuccess] = useState<boolean>(false);\n const [duplicateOutOfStockWarning, setDuplicateOutOfStockWarning] = useState<boolean>(false);\n const [comment, setComment] = useState<string>('');\n const [isSubmitting, setIsSubmitting] = useState<boolean>(false);\n const [showCloseModal, setShowCloseModal] = useState<boolean>(false);\n const [isClosing, setIsClosing] = useState<boolean>(false);\n const [modalSuccessMessage, setModalSuccessMessage] = useState<string>('');\n const [modalErrorMessage, setModalErrorMessage] = useState<string>('');\n const [showCreateTemplateModal, setShowCreateTemplateModal] = useState<boolean>(false);\n const [isCreatingTemplate, setIsCreatingTemplate] = useState<boolean>(false);\n const [createTemplateSuccessMessage, setCreateTemplateSuccessMessage] = useState<string>('');\n const [createTemplateErrorMessage, setCreateTemplateErrorMessage] = useState<string>('');\n const [isRenameModalOpen, setIsRenameModalOpen] = useState<boolean>(false);\n const [renameQuoteName, setRenameQuoteName] = useState<string>('');\n const [renameReason, setRenameReason] = useState<string>('');\n const [renameError, setRenameError] = useState<string>('');\n const [renameQuoteNameError, setRenameQuoteNameError] = useState<string>('');\n const [renameSuccess, setRenameSuccess] = useState<string>('');\n const [attachedFiles, setAttachedFiles] = useState<AttachedFile[]>([]);\n const [fileUploadError, setFileUploadError] = useState<string | undefined>(undefined);\n const [selectedItemUids, setSelectedItemUids] = useState<Set<string>>(\n new Set()\n );\n const selectedItemUidsRef = useRef<Set<string>>(selectedItemUids);\n const removeItemsHandlerRef = useRef<\n ((items: CartItemModel[]) => void) | null\n >(null);\n const [actionsBarDropdownValue, setActionsBarDropdownValue] =\n useState<string>('');\n const actionsBarDropdownValueRef = useRef<string>(actionsBarDropdownValue);\n const [isNoItemsSelectedModalOpen, setIsNoItemsSelectedModalOpen] =\n useState<boolean>(false);\n\n // Keep refs in sync with state\n useEffect(() => {\n selectedItemUidsRef.current = selectedItemUids;\n }, [selectedItemUids]);\n\n useEffect(() => {\n actionsBarDropdownValueRef.current = actionsBarDropdownValue;\n }, [actionsBarDropdownValue]);\n\n const dictionary = useText({\n createdLabel: 'NegotiableQuote.Manage.createdLabel',\n salesRepLabel: 'NegotiableQuote.Manage.salesRepLabel',\n expiresLabel: 'NegotiableQuote.Manage.expiresLabel',\n actionsLabel: 'NegotiableQuote.Manage.actionsLabel',\n remove: 'NegotiableQuote.Manage.actions.remove',\n close: 'NegotiableQuote.Manage.actionButtons.close',\n delete: 'NegotiableQuote.Manage.actionButtons.delete',\n print: 'NegotiableQuote.Manage.actionButtons.print',\n createTemplate: 'NegotiableQuote.Manage.actionButtons.createTemplate',\n createCopy: 'NegotiableQuote.Manage.actionButtons.createCopy',\n shippingInformationTitle:\n 'NegotiableQuote.Manage.shippingInformation.title',\n quoteCommentsTitle: 'NegotiableQuote.Manage.quoteComments.title',\n quoteCommentsPlaceholder:\n 'NegotiableQuote.Manage.quoteComments.placeholder',\n sendForReview: 'NegotiableQuote.Manage.actionButtons.sendForReview',\n bannerTitle: 'NegotiableQuote.Manage.bannerTitle',\n statusSubmitted: 'NegotiableQuote.Manage.bannerStatusMessages.submitted',\n statusPending: 'NegotiableQuote.Manage.bannerStatusMessages.pending',\n statusExpired: 'NegotiableQuote.Manage.bannerStatusMessages.expired',\n errorFallback:\n 'NegotiableQuote.Manage.confirmationModal.delete.errorFallback',\n closeSuccessMessage:\n 'NegotiableQuote.Manage.confirmationModal.close.successDescription',\n closeModalTitle: 'NegotiableQuote.Manage.actionButtons.close',\n closeModalMessage: 'NegotiableQuote.Manage.confirmationModal.close.message',\n closeModalCancel: 'NegotiableQuote.Manage.confirmationModal.cancel',\n closeModalConfirm: 'NegotiableQuote.Manage.confirmationModal.close.confirm',\n closeModalConfirmLoading:\n 'NegotiableQuote.Manage.confirmationModal.close.confirmLoading',\n closeModalSuccessHeading:\n 'NegotiableQuote.Manage.confirmationModal.close.successHeading',\n createTemplateModalTitle: 'NegotiableQuote.Manage.actionButtons.createTemplate',\n createTemplateModalMessage: 'NegotiableQuote.Manage.confirmationModal.createTemplate.message',\n createTemplateModalCancel: 'NegotiableQuote.Manage.confirmationModal.cancel',\n createTemplateModalConfirm: 'NegotiableQuote.Manage.confirmationModal.createTemplate.confirm',\n createTemplateModalConfirmLoading:\n 'NegotiableQuote.Manage.confirmationModal.createTemplate.confirmLoading',\n createTemplateModalSuccessHeading:\n 'NegotiableQuote.Manage.confirmationModal.createTemplate.successHeading',\n createTemplateSuccessMessage:\n 'NegotiableQuote.Manage.confirmationModal.createTemplate.successDescription',\n createTemplateModalErrorHeading:\n 'NegotiableQuote.Manage.confirmationModal.createTemplate.errorHeading',\n createTemplateErrorFallback:\n 'NegotiableQuote.Manage.confirmationModal.createTemplate.errorFallback',\n renameErrorHeading: 'NegotiableQuote.Manage.rename.errorHeading',\n renameQuoteNameRequired: 'NegotiableQuote.Manage.rename.quoteNameRequired',\n renameErrorDefault: 'NegotiableQuote.Manage.rename.errorDefault',\n renameSuccessHeading: 'NegotiableQuote.Manage.rename.successHeading',\n renameSuccessMessage: 'NegotiableQuote.Manage.rename.successMessage',\n confirmationModalCancel: 'NegotiableQuote.Manage.confirmationModal.cancel',\n confirmationModalDeleteTitle: 'NegotiableQuote.Manage.confirmationModal.delete.title',\n confirmationModalDeleteMessage: 'NegotiableQuote.Manage.confirmationModal.delete.message',\n confirmationModalDeleteConfirm: 'NegotiableQuote.Manage.confirmationModal.delete.confirm',\n confirmationModalDeleteErrorHeading: 'NegotiableQuote.Manage.confirmationModal.delete.errorHeading',\n confirmationModalDeleteErrorFallback: 'NegotiableQuote.Manage.confirmationModal.delete.errorFallback',\n confirmationModalDeleteSuccessHeading: 'NegotiableQuote.Manage.confirmationModal.delete.successHeading',\n confirmationModalDeleteSuccessDescription: 'NegotiableQuote.Manage.confirmationModal.delete.successDescription',\n confirmationModalDuplicateTitle: 'NegotiableQuote.Manage.confirmationModal.duplicate.title',\n confirmationModalDuplicateMessage: 'NegotiableQuote.Manage.confirmationModal.duplicate.message',\n confirmationModalDuplicateConfirm: 'NegotiableQuote.Manage.confirmationModal.duplicate.confirm',\n confirmationModalDuplicateErrorHeading: 'NegotiableQuote.Manage.confirmationModal.duplicate.errorHeading',\n confirmationModalDuplicateErrorFallback: 'NegotiableQuote.Manage.confirmationModal.duplicate.errorFallback',\n confirmationModalDuplicateSuccessHeading: 'NegotiableQuote.Manage.confirmationModal.duplicate.successHeading',\n confirmationModalDuplicateSuccessDescription: 'NegotiableQuote.Manage.confirmationModal.duplicate.successDescription',\n duplicateOutOfStockWarningHeading: 'NegotiableQuote.Manage.confirmationModal.duplicate.outOfStockWarningHeading',\n duplicateOutOfStockWarningMessage: 'NegotiableQuote.Manage.confirmationModal.duplicate.outOfStockWarningMessage',\n noItemsSelectedModalTitle: 'NegotiableQuote.Manage.confirmationModal.noItemsSelected.title',\n noItemsSelectedModalMessage: 'NegotiableQuote.Manage.confirmationModal.noItemsSelected.message',\n noItemsSelectedModalConfirm: 'NegotiableQuote.Manage.confirmationModal.noItemsSelected.confirm',\n attachFiles: 'NegotiableQuote.Manage.attachFiles',\n fileUploadError: 'NegotiableQuote.Manage.fileUploadError',\n maxFilesExceeded: 'NegotiableQuote.Manage.maxFilesExceeded',\n maxFileSizeExceeded: 'NegotiableQuote.Manage.maxFileSizeExceeded',\n invalidFileType: 'NegotiableQuote.Manage.invalidFileType',\n });\n /* Event listeners */\n useEffect(() => {\n const quoteDataEvent = events.on(\n 'quote-management/quote-data',\n (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n if (quote) {\n setQuoteData(quote);\n setLoading(false);\n\n // Check for pending out of stock warning from duplication\n const pendingWarningKey = `duplicate-outOfStock-warning-${quote.uid}`;\n const pendingWarning = sessionStorage.getItem(pendingWarningKey);\n if (pendingWarning === 'true') {\n setDuplicateOutOfStockWarning(true);\n sessionStorage.removeItem(pendingWarningKey);\n }\n }\n },\n {\n eager: true,\n }\n );\n return () => quoteDataEvent?.off();\n }, []);\n\n // Listen for shipping address set event\n useEffect(() => {\n const shippingAddressSetEvent = events.on(\n 'quote-management/shipping-address-set',\n (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n if (quote) {\n setQuoteData(quote);\n }\n },\n {\n eager: true,\n }\n );\n return () => shippingAddressSetEvent?.off();\n }, []);\n\n // Listen for quote sent for review event\n useEffect(() => {\n const quoteSentForReviewEvent = events.on(\n 'quote-management/quote-sent-for-review',\n (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n setQuoteData(quote);\n setComment(''); // Reset comment after successful submission\n setAttachedFiles([]); // Clear attachments after successful submission\n setIsSubmitting(false);\n },\n {\n eager: true,\n }\n );\n return () => quoteSentForReviewEvent?.off();\n }, []);\n\n // Listen for quote items removed event\n useEffect(() => {\n const quoteItemsRemovedEvent = events.on(\n 'quote-management/quote-items-removed',\n (data: { quote: NegotiableQuoteModel; removedItemUids: string[] }) => {\n const { quote, removedItemUids } = data;\n /* istanbul ignore else */ // Always has quote in real usage; covered in integration tests\n if (quote) {\n setQuoteData(quote);\n }\n // Clear selected items that were removed\n /* istanbul ignore else */ // Always has removedItemUids in real usage; covered in integration tests\n if (removedItemUids) {\n setSelectedItemUids((prev) => {\n const next = new Set(prev);\n removedItemUids.forEach((uid) => next.delete(uid));\n return next;\n });\n }\n },\n {\n eager: true,\n }\n );\n return () => quoteItemsRemovedEvent?.off();\n }, []);\n\n /**\n * Handlers\n */\n const handleItemCheckboxChange = useCallback(\n (item: CartItemModel, isSelected: boolean) => {\n setSelectedItemUids((prev) => {\n const next = new Set(prev);\n if (isSelected) {\n next.add(item.uid);\n } else {\n next.delete(item.uid);\n }\n return next;\n });\n },\n []\n );\n\n const handleActionsDropdownChange = useCallback(\n (event: Event) => {\n const action = (event.target as HTMLSelectElement).value;\n const currentSelectedUids = selectedItemUidsRef.current;\n /* istanbul ignore else */ if (action === 'remove') {\n setActionsBarDropdownValue(action);\n actionsBarDropdownValueRef.current = action; // Update ref immediately\n /* istanbul ignore next */ if (currentSelectedUids.size === 0) {\n // No items selected - show warning modal\n setIsNoItemsSelectedModalOpen(true);\n } else if (quoteData && removeItemsHandlerRef.current) {\n // Items selected - proceed with removal\n const itemsToRemove = quoteData.items.filter((item) =>\n currentSelectedUids.has(item.uid)\n );\n /* istanbul ignore next */ removeItemsHandlerRef.current(\n itemsToRemove\n );\n }\n }\n onActionsDropdownChange?.(event);\n },\n [onActionsDropdownChange, quoteData]\n );\n\n /* istanbul ignore next */ const handleCloseNoItemsSelectedModal =\n useCallback(() => {\n setIsNoItemsSelectedModalOpen(false);\n setActionsBarDropdownValue('');\n actionsBarDropdownValueRef.current = '';\n }, []);\n\n // Listen for quote closed event\n useEffect(() => {\n const quoteClosedEvent = events.on(\n 'quote-management/negotiable-quote-closed',\n async (data: { closedQuoteUids: string[] }) => {\n setIsClosing(false);\n setModalErrorMessage('');\n // Show success message in modal\n setModalSuccessMessage(dictionary.closeSuccessMessage);\n\n // Refresh quote data if the current quote was closed\n // Use a function to get the current quoteData to avoid stale closure\n setQuoteData((currentQuoteData) => {\n if (\n currentQuoteData?.uid &&\n data.closedQuoteUids?.includes(currentQuoteData.uid)\n ) {\n // Trigger async refresh\n getQuoteData(currentQuoteData.uid)\n .then((updatedQuoteData) => {\n setQuoteData(updatedQuoteData);\n })\n .catch((error) => {\n console.warn(\n 'Failed to refresh quote data after closure:',\n error\n );\n });\n }\n return currentQuoteData; // Return current data unchanged for this setter call\n });\n\n // Close modal and redirect after a delay to show success message\n setTimeout(() => {\n setShowCloseModal(false);\n setModalSuccessMessage('');\n }, 2000);\n },\n {\n eager: true,\n }\n );\n return () => quoteClosedEvent?.off();\n }, [dictionary.closeSuccessMessage]);\n\n // Listen for quote close error event\n useEffect(() => {\n const quoteCloseErrorEvent = events.on(\n 'quote-management/negotiable-quote-close-error',\n (data: { error: Error; attemptedQuoteUids: string[] }) => {\n console.log('Close error event received:', data);\n setIsClosing(false);\n setModalSuccessMessage('');\n const errorMsg = data.error.message || dictionary.errorFallback;\n setModalErrorMessage(errorMsg);\n },\n {\n eager: true,\n }\n );\n return () => quoteCloseErrorEvent?.off();\n }, [dictionary.errorFallback]);\n\n // Listen for quote renamed event\n useEffect(() => {\n const quoteRenamedEvent = events.on(\n 'quote-management/quote-renamed',\n (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n setQuoteData(quote);\n setRenameError('');\n setRenameQuoteNameError('');\n setRenameSuccess(dictionary.renameSuccessMessage);\n\n // Wait 2 seconds before closing the modal\n setTimeout(() => {\n setIsRenameModalOpen(false);\n setRenameQuoteName('');\n setRenameReason('');\n setRenameSuccess('');\n }, 2000);\n },\n {\n eager: true,\n }\n );\n return () => quoteRenamedEvent?.off();\n }, [dictionary.renameSuccessMessage]);\n\n // Listen for quote duplicated event\n useEffect(() => {\n const quoteDuplicatedEvent = events.on(\n 'quote-management/quote-duplicated',\n (data: {\n quote: NegotiableQuoteModel;\n input: { quoteUid: string; duplicatedQuoteUid: string };\n }) => {\n const { quote: newQuote } = data;\n\n // Call parent callback if provided\n if (quoteData && onDuplicateQuote) {\n onDuplicateQuote({ quoteData, newQuote });\n }\n\n // Show success in modal\n setDuplicateSuccess(true);\n setDuplicateError(null);\n\n // Close modal after showing success message\n // Navigation is handled by the application layer listening to quote-duplicated event\n setTimeout(() => {\n setIsDuplicateDialogOpen(false);\n setDuplicateSuccess(false);\n setDuplicateError(null);\n }, 2000);\n },\n {\n eager: true,\n }\n );\n return () => quoteDuplicatedEvent?.off();\n }, [quoteData, onDuplicateQuote]);\n\n /**\n * File upload handlers\n */\n\n const handleAttachFiles = useCallback(async (files: File[]) => {\n // Check maxFiles limit\n if (maxFiles && attachedFiles.length + files.length > maxFiles) {\n setFileUploadError(dictionary.maxFilesExceeded.replace('{maxFiles}', String(maxFiles)));\n return;\n }\n\n // Validate file types and sizes before uploading\n for (const file of files) {\n if (maxFileSize && !validateFileSize(file.size, maxFileSize)) {\n setFileUploadError(\n dictionary.maxFileSizeExceeded.replace('{maxSize}', formatFileSize(maxFileSize))\n );\n return;\n }\n\n if (acceptedFileTypes && !validateFileType(file.type, acceptedFileTypes)) {\n setFileUploadError(dictionary.invalidFileType);\n return;\n }\n }\n\n setFileUploadError(undefined);\n\n // Add files with 'uploading' status\n const newFiles: AttachedFile[] = files.map(file => ({\n key: `temp-${Date.now()}-${Math.random()}-${file.name}`,\n name: file.name,\n size: file.size,\n status: 'uploading',\n }));\n\n setAttachedFiles(prev => [...prev, ...newFiles]);\n\n // Upload each file and update its status\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const tempKey = newFiles[i].key;\n\n try {\n const result = await uploadFile(file);\n setAttachedFiles(prev => prev.map(f =>\n f.key === tempKey\n ? { ...f, key: result.key, status: 'success' }\n : f\n ));\n } catch (error) {\n setAttachedFiles(prev => prev.map(f =>\n f.key === tempKey\n ? { ...f, status: 'error', error: (error as Error).message }\n : f\n ));\n }\n }\n }, [maxFiles, maxFileSize, acceptedFileTypes, attachedFiles, dictionary]);\n\n const handleRemoveFile = useCallback((key: string) => {\n setAttachedFiles(prev => prev.filter(f => f.key !== key));\n }, []);\n\n /**\n * VNodes for the ManageNegotiableQuote component\n */\n\n // Rename handlers\n const handleRenameClick = useCallback(() => {\n setRenameQuoteName(quoteData?.name || '');\n setRenameReason('');\n setRenameError('');\n setRenameQuoteNameError('');\n setRenameSuccess('');\n setIsRenameModalOpen(true);\n }, [quoteData]);\n\n const handleRenameClose = useCallback(() => {\n setIsRenameModalOpen(false);\n setRenameQuoteName('');\n setRenameReason('');\n setRenameError('');\n setRenameQuoteNameError('');\n setRenameSuccess('');\n }, []);\n\n const handleRenameQuoteNameChange = useCallback((value: string) => {\n setRenameQuoteName(value);\n if (value.trim()) {\n setRenameQuoteNameError('');\n }\n }, []);\n\n const handleDuplicateQuote = useCallback(() => {\n // Show confirmation modal\n setIsDuplicateDialogOpen(true);\n setDuplicateError(null);\n setDuplicateSuccess(false);\n }, []);\n\n const handleRenameSave = useCallback(async () => {\n // Validate quote name\n if (!renameQuoteName.trim()) {\n setRenameQuoteNameError(dictionary.renameQuoteNameRequired);\n return;\n }\n\n try {\n setRenameError('');\n setRenameQuoteNameError('');\n await renameNegotiableQuote({\n quoteUid: quoteData!.uid,\n quoteName: renameQuoteName,\n quoteComment: renameReason.trim() || undefined,\n });\n // The quote-renamed event will handle closing the modal and updating state\n } catch (error) {\n setRenameError((error as Error).message || dictionary.renameErrorDefault);\n }\n }, [\n quoteData,\n renameQuoteName,\n renameReason,\n dictionary.renameQuoteNameRequired,\n dictionary.renameErrorDefault,\n ]);\n\n // Quote name with rename icon\n const quoteName = useMemo(() => {\n // Priority 1: Check lockedForEditing if explicitly set\n // Priority 2: Fall back to status check\n const isLocked =\n quoteData &&\n // If lockedForEditing is explicitly set, use it\n (quoteData.lockedForEditing === true ||\n // Otherwise, lock based on status\n (quoteData.lockedForEditing === undefined &&\n (quoteData.status === 'SUBMITTED' ||\n quoteData.status === 'PENDING' ||\n quoteData.status === 'ORDERED' ||\n quoteData.status === 'CLOSED')));\n\n return (\n <Slot\n name=\"QuoteName\"\n slot={slots?.QuoteName}\n context={{ quoteName: quoteData?.name, quoteData }}\n >\n <div className=\"quote-management-manage-negotiable-quote__quote-name-wrapper\">\n <h1\n data-testid=\"quote-name\"\n className=\"quote-management-manage-negotiable-quote__quote-name-title\"\n >\n {quoteData?.name}\n </h1>\n <button\n onClick={handleRenameClick}\n disabled={isLocked}\n data-testid=\"rename-quote-button\"\n className=\"quote-management-manage-negotiable-quote__rename-button\"\n aria-label=\"Rename quote\"\n >\n <Edit />\n </button>\n </div>\n </Slot>\n );\n }, [slots?.QuoteName, quoteData, handleRenameClick]);\n\n // Quote status\n const quoteStatus = useMemo(() => {\n return (\n <Slot\n name=\"QuoteStatus\"\n slot={slots?.QuoteStatus}\n context={{ quoteStatus: quoteData?.status, quoteData }}\n >\n <div data-testid=\"quote-status\">{quoteData?.status}</div>\n </Slot>\n );\n }, [slots?.QuoteStatus, quoteData]);\n\n // Banner\n const getBannerStatusMessage = useCallback(\n (status: string | undefined) => {\n switch (status) {\n case 'SUBMITTED':\n return dictionary.statusSubmitted;\n case 'PENDING':\n return dictionary.statusPending;\n case 'EXPIRED':\n return dictionary.statusExpired;\n default:\n return null;\n }\n },\n [dictionary]\n );\n\n const bannerMessage = getBannerStatusMessage(quoteData?.status);\n\n const bannerContent = bannerMessage && (\n <InLineAlert\n type=\"warning\"\n variant=\"secondary\"\n icon={<WarningFilled />}\n heading={dictionary.bannerTitle}\n description={bannerMessage}\n />\n );\n\n const banner = bannerContent && (\n <Slot\n name=\"Banner\"\n data-testid=\"banner\"\n slot={slots?.Banner}\n context={{ quoteData }}\n >\n {bannerContent}\n </Slot>\n );\n\n // Handler for dismissing out of stock warning\n const handleDismissOutOfStockWarning = useCallback(() => {\n setDuplicateOutOfStockWarning(false);\n }, []);\n\n // Out of stock warning banner for duplicated quotes\n const outOfStockWarningBanner = duplicateOutOfStockWarning && (\n <Slot\n name=\"DuplicateQuoteWarningBanner\"\n data-testid=\"duplicate-outOfStock-warning-banner\"\n slot={slots?.DuplicateQuoteWarningBanner}\n context={{ outOfStockWarning: duplicateOutOfStockWarning }}\n >\n <InLineAlert\n type=\"warning\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.duplicateOutOfStockWarningHeading}\n description={dictionary.duplicateOutOfStockWarningMessage}\n onDismiss={handleDismissOutOfStockWarning}\n data-testid=\"duplicate-outOfStock-warning-alert\"\n />\n </Slot>\n );\n\n // Details\n const details = useMemo(() => {\n if (!quoteData) {\n return;\n }\n\n // Some quotes, such as draft quotes, don't have a date formatted expiration date\n const expirationDate = quoteData.expirationDate ? formattedDate(quoteData.expirationDate, 'short') : undefined;\n\n return (\n <Slot name=\"Details\" slot={slots?.Details} context={{ quoteData }}>\n <div className=\"quote-management-manage-negotiable-quote__detail\">\n <span\n className=\"quote-management-manage-negotiable-quote__detail-title\"\n data-testid=\"created-label\"\n >\n {dictionary.createdLabel}\n </span>\n <span\n className=\"quote-management-manage-negotiable-quote__detail-content\"\n data-testid=\"created-value\"\n >\n {formattedDate(quoteData!.createdAt, 'short')} (\n {quoteData!.buyer.firstname} {quoteData!.buyer.lastname})\n </span>\n </div>\n <div className=\"quote-management-manage-negotiable-quote__detail\">\n <span\n className=\"quote-management-manage-negotiable-quote__detail-title\"\n data-testid=\"sales-rep-label\"\n >\n {dictionary.salesRepLabel}\n </span>\n <span\n className=\"quote-management-manage-negotiable-quote__detail-content\"\n data-testid=\"sales-rep-value\"\n >\n {quoteData!.salesRepName}\n </span>\n </div>\n <div className=\"quote-management-manage-negotiable-quote__detail\">\n <span\n className=\"quote-management-manage-negotiable-quote__detail-title\"\n data-testid=\"expires-label\"\n >\n {dictionary.expiresLabel}\n </span>\n <span\n className=\"quote-management-manage-negotiable-quote__detail-content\"\n data-testid=\"expires-value\"\n >\n {expirationDate}\n </span>\n </div>\n </Slot>\n );\n }, [slots?.Details, dictionary, quoteData]);\n\n // Action bar\n const buttons: { label: string; value: string; disabled?: boolean }[] =\n useMemo(() => {\n return [\n {\n label: dictionary.close,\n value: 'close',\n disabled: !quoteData?.canClose,\n },\n {\n label: dictionary.delete,\n value: 'delete',\n disabled: !quoteData?.canDelete,\n },\n {\n label: dictionary.print,\n value: 'print',\n },\n {\n label: dictionary.createTemplate,\n value: 'createTemplate',\n },\n {\n label: dictionary.createCopy,\n value: 'createCopy',\n },\n ];\n }, [dictionary, quoteData?.canDelete, quoteData?.canClose]);\n const actionBar = useMemo(() => {\n const handleActionsButtonClick = (action: string) => {\n switch (action) {\n case 'close':\n setShowCloseModal(true);\n setModalErrorMessage(''); // Clear modal errors\n setModalSuccessMessage(''); // Clear modal success messages\n onActionsButtonClick?.(action);\n break;\n case 'delete':\n setIsDeleteDialogOpen(true);\n onActionsButtonClick?.(action);\n break;\n case 'print':\n onActionsButtonClick?.(action);\n break;\n case 'createTemplate':\n setShowCreateTemplateModal(true);\n setCreateTemplateErrorMessage(''); // Clear modal errors\n setCreateTemplateSuccessMessage(''); // Clear modal success messages\n onActionsButtonClick?.(action);\n break;\n case 'createCopy':\n handleDuplicateQuote();\n onActionsButtonClick?.(action);\n break;\n }\n };\n return (\n <Slot\n name=\"ActionBar\"\n slot={slots?.ActionBar}\n context={{ quoteData, actionsBarDropdownValue }}\n >\n <ActionsBar\n dropdownPlaceholder={dictionary.actionsLabel}\n dropdownOptions={[\n {\n label: dictionary.remove,\n value: 'remove',\n },\n ]}\n dropdownValue={actionsBarDropdownValue}\n handleDropdownChange={handleActionsDropdownChange}\n buttons={buttons.map((button) => (\n <Button\n key={button.value}\n variant=\"tertiary\"\n onClick={() => handleActionsButtonClick(button.value)}\n data-testid={`actions-bar-${button.value}-button`}\n data-action={button.value}\n disabled={button.disabled}\n >\n {button.label}\n </Button>\n ))}\n />\n </Slot>\n );\n }, [\n buttons,\n dictionary,\n slots?.ActionBar,\n quoteData,\n handleActionsDropdownChange,\n onActionsButtonClick,\n handleDuplicateQuote,\n actionsBarDropdownValue,\n ]);\n\n // Quote content\n const quoteContent = useMemo(() => {\n return (\n <Slot\n name=\"QuoteContent\"\n slot={slots?.QuoteContent}\n context={{ quoteData }}\n >\n <TabbedContent\n tabs={\n new Map([\n ['items-quoted', 'Items Quoted'],\n ['comments', 'Comments'],\n ['history-log', 'History Log'],\n ])\n }\n tabsContent={\n new Map([\n [\n 'items-quoted',\n <Slot\n key=\"items-quoted\"\n name=\"ItemsQuotedTab\"\n slot={slots?.ItemsQuotedTab}\n context={{ quoteData }}\n >\n <ItemsQuoted\n quoteData={quoteData}\n onItemCheckboxChange={handleItemCheckboxChange}\n onRemoveItemsRef={(handler) => {\n removeItemsHandlerRef.current = handler;\n }}\n onRemoveModalStateChange={\n /* istanbul ignore next */ (isOpen) => {\n if (\n !isOpen &&\n actionsBarDropdownValueRef.current === 'remove'\n ) {\n setActionsBarDropdownValue('');\n }\n }\n }\n />\n </Slot>,\n ],\n [\n 'comments',\n <Slot\n key=\"comments\"\n name=\"CommentsTab\"\n slot={slots?.CommentsTab}\n context={{ quoteData }}\n >\n <QuoteCommentsList quoteData={quoteData} />\n </Slot>,\n ],\n [\n 'history-log',\n <Slot\n key=\"history-log\"\n name=\"HistoryLogTab\"\n slot={slots?.HistoryLogTab}\n context={{ quoteData }}\n >\n <QuoteHistoryLog quoteData={quoteData} />\n </Slot>,\n ],\n ])\n }\n />\n </Slot>\n );\n }, [\n slots?.QuoteContent,\n slots?.HistoryLogTab,\n slots?.CommentsTab,\n slots?.ItemsQuotedTab,\n quoteData,\n handleItemCheckboxChange,\n ]);\n\n // Shipping information title\n const shippingInformationTitle = useMemo(() => {\n return (\n <Slot\n name=\"ShippingInformationTitle\"\n slot={slots?.ShippingInformationTitle}\n context={{ quoteData }}\n >\n <h2>{dictionary.shippingInformationTitle}</h2>\n </Slot>\n );\n }, [slots?.ShippingInformationTitle, quoteData, dictionary]);\n\n // Shipping information\n const shippingInformation = useMemo(() => {\n return (\n <Slot\n name=\"ShippingInformation\"\n slot={slots?.ShippingInformation}\n context={{ quoteData, loading, setLoading }}\n >\n <ShippingAddressDisplay\n shippingAddress={quoteData?.shippingAddresses?.[0]}\n loading={loading}\n data-testid=\"manage-quote-shipping-address\"\n />\n </Slot>\n );\n }, [slots?.ShippingInformation, quoteData, loading, setLoading]);\n\n // Quote comments title\n const quoteCommentsTitle = useMemo(() => {\n return (\n <Slot\n name=\"QuoteCommentsTitle\"\n slot={slots?.QuoteCommentsTitle}\n context={{ quoteData }}\n >\n <h2>{dictionary.quoteCommentsTitle}</h2>\n </Slot>\n );\n }, [slots?.QuoteCommentsTitle, dictionary, quoteData]);\n\n // Quote comments\n const quoteComments = useMemo(() => {\n return (\n <Slot\n name=\"QuoteComments\"\n slot={slots?.QuoteComments}\n context={{ quoteData }}\n >\n <TextArea\n name=\"quoteComments\"\n placeholder={dictionary.quoteCommentsPlaceholder}\n rows={3}\n value={comment}\n onInput={(e) => {\n setComment((e.target as HTMLTextAreaElement).value);\n }}\n disabled={!quoteData?.canSendForReview || isSubmitting}\n />\n </Slot>\n );\n }, [slots?.QuoteComments, dictionary, quoteData, comment, isSubmitting]);\n\n // File upload should be disabled when quote cannot be sent for review\n // (which already includes the status and permission checks from the transformer)\n const isFileUploadDisabled = useMemo(() => {\n return !quoteData?.canSendForReview;\n }, [quoteData]);\n\n // File upload input\n const attachFilesField = useMemo(() => {\n // Check if button should be visually disabled\n const isDisabled = isSubmitting || isFileUploadDisabled;\n\n return (\n <Slot\n name=\"AttachFilesField\"\n slot={slots?.AttachFilesField}\n context={{ onFileChange: handleAttachFiles, attachedFiles, fileUploadError, disabled: isDisabled }}\n >\n <div \n className=\"quote-management-manage-negotiable-quote__attach-files\"\n {...(isDisabled ? { 'data-disabled': true } : {})}\n aria-disabled={isDisabled}\n >\n <InputFile\n id=\"manage-quote-attach-files\"\n multiple\n onChange={(e: Event) => {\n const target = e.target as HTMLInputElement;\n const fileList = target?.files;\n const files = fileList ? Array.from(fileList) : [];\n if (files.length > 0) {\n void handleAttachFiles(files);\n }\n }}\n icon={<Add />}\n disabled={isDisabled}\n data-testid=\"manage-quote-attach-files\"\n accept={acceptedFileTypes?.join(',')}\n >\n {dictionary.attachFiles}\n </InputFile>\n {fileUploadError && (\n <div\n className=\"quote-management-manage-negotiable-quote__file-error\"\n data-testid=\"file-upload-error\"\n >\n {fileUploadError}\n </div>\n )}\n </div>\n </Slot>\n );\n }, [\n slots?.AttachFilesField,\n handleAttachFiles,\n isSubmitting,\n isFileUploadDisabled,\n acceptedFileTypes,\n fileUploadError,\n dictionary,\n attachedFiles,\n ]);\n\n // Attached files list\n const attachedFilesList = useMemo(() => {\n if (!attachedFiles.length) return undefined;\n\n return (\n <Slot\n name=\"AttachedFilesList\"\n slot={slots?.AttachedFilesList}\n context={{ files: attachedFiles, onRemove: handleRemoveFile, disabled: isSubmitting }}\n >\n <AttachedFilesList\n files={attachedFiles}\n onRemove={handleRemoveFile}\n disabled={isSubmitting}\n />\n </Slot>\n );\n }, [attachedFiles, handleRemoveFile, isSubmitting, slots?.AttachedFilesList]);\n\n // Close quote handler - only called when quoteData exists\n const handleCloseQuote = useCallback(async () => {\n if (!quoteData?.uid) {\n return;\n }\n setIsClosing(true);\n setModalErrorMessage('');\n setModalSuccessMessage('');\n try {\n await closeNegotiableQuote({\n quoteUids: [quoteData!.uid],\n });\n } catch (error) {\n console.error('Failed to close quote:', error);\n }\n }, [quoteData]);\n\n const handleCloseModalCancel = useCallback(() => {\n setShowCloseModal(false);\n setModalErrorMessage('');\n setModalSuccessMessage('');\n }, []);\n\n // Create template handler\n const handleCreateTemplate = useCallback(async () => {\n if (!quoteData?.uid) {\n return;\n }\n setIsCreatingTemplate(true);\n setCreateTemplateErrorMessage('');\n setCreateTemplateSuccessMessage('');\n try {\n await createQuoteTemplate(quoteData.uid);\n // Show success message\n setCreateTemplateSuccessMessage(dictionary.createTemplateSuccessMessage);\n // Close modal after a delay to show success message\n setTimeout(() => {\n setShowCreateTemplateModal(false);\n setCreateTemplateSuccessMessage('');\n }, 2000);\n } catch (error) {\n console.error('Failed to create quote template:', error);\n const errorMessage =\n error instanceof Error ? error.message : dictionary.createTemplateErrorFallback;\n setCreateTemplateErrorMessage(errorMessage);\n } finally {\n setIsCreatingTemplate(false);\n }\n }, [quoteData, dictionary.createTemplateSuccessMessage, dictionary.createTemplateErrorFallback]);\n\n const handleCreateTemplateModalCancel = useCallback(() => {\n setShowCreateTemplateModal(false);\n setCreateTemplateErrorMessage('');\n setCreateTemplateSuccessMessage('');\n }, []);\n\n // Footer\n const handleSendForReview = useCallback(async () => {\n const successfulAttachments = attachedFiles.filter(f => f.status === 'success');\n\n // If override prop is provided, use it instead of the API\n if (onSendForReview) {\n onSendForReview({\n quoteData: quoteData!,\n comment: comment.trim() || undefined,\n attachments: successfulAttachments.length ?\n successfulAttachments :\n undefined,\n });\n return;\n }\n\n // Otherwise, use the sendForReview API\n setIsSubmitting(true);\n try {\n await sendForReview({\n quoteUid: quoteData!.uid,\n comment: comment.trim() || undefined,\n attachments: successfulAttachments.length\n ? successfulAttachments.map(f => ({ key: f.key }))\n : undefined,\n });\n // The quote-sent-for-review event will handle updating state\n } catch (error) {\n console.error('Failed to send quote for review:', error);\n setIsSubmitting(false);\n // TODO: Show error notification to user\n }\n }, [quoteData, onSendForReview, comment, attachedFiles]);\n\n const footer = useMemo(() => {\n return (\n <Slot\n name=\"Footer\"\n slot={slots?.Footer}\n context={{ quoteData, comment, isSubmitting, attachments: attachedFiles, handleSendForReview }}\n >\n <Button\n variant=\"primary\"\n onClick={handleSendForReview}\n data-testid=\"send-for-review-button\"\n disabled={!quoteData?.canSendForReview || isSubmitting}\n >\n {dictionary.sendForReview}\n </Button>\n </Slot>\n );\n }, [\n slots?.Footer,\n dictionary,\n quoteData,\n comment,\n isSubmitting,\n attachedFiles,\n handleSendForReview,\n ]);\n\n // Rename modal error banner\n const renameErrorBanner = useMemo(\n () =>\n renameError ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled color=\"var(--color-error)\" />}\n heading={dictionary.renameErrorHeading}\n description={renameError}\n />\n ) : undefined,\n [renameError, dictionary.renameErrorHeading]\n );\n\n // Rename modal success banner\n const renameSuccessBanner = useMemo(\n () =>\n renameSuccess ? (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.renameSuccessHeading}\n description={renameSuccess}\n />\n ) : undefined,\n [renameSuccess, dictionary.renameSuccessHeading]\n );\n\n // Delete quote functionality\n const getDeleteErrorMessage = useCallback(\n (error: any): string => {\n // If it's an operation failure with errors array, get the first error message\n if (\n error.errors &&\n Array.isArray(error.errors) &&\n error.errors.length > 0\n ) {\n return (\n error.errors[0].message ||\n dictionary.confirmationModalDeleteErrorFallback\n );\n }\n // Otherwise use the error message or fallback\n return error?.message || dictionary.confirmationModalDeleteErrorFallback;\n },\n [dictionary.confirmationModalDeleteErrorFallback]\n );\n\n const handleDeleteCancel = useCallback(() => {\n setIsDeleteDialogOpen(false);\n setDeleteError(null);\n setDeleteSuccess(false);\n }, []);\n\n const handleDeleteConfirm = useCallback(async () => {\n if (!quoteData?.uid) {\n return;\n }\n\n setDeleteError(null);\n setDeleteSuccess(false);\n\n try {\n const { operationResults } = await deleteQuote(quoteData.uid);\n\n const failure = operationResults.find(\n (res: any) => res.__typename === 'DeleteNegotiableQuoteOperationFailure'\n ) as any;\n if (failure) {\n const errorMessage = getDeleteErrorMessage(failure);\n setDeleteError(errorMessage);\n return;\n }\n\n setDeleteSuccess(true);\n } catch (error: any) {\n const errorMessage = getDeleteErrorMessage(error);\n setDeleteError(errorMessage);\n }\n }, [quoteData, getDeleteErrorMessage]);\n\n const handleDismissError = useCallback(() => {\n setDeleteError(null);\n }, []);\n\n const handleDismissSuccess = useCallback(() => {\n setDeleteSuccess(false);\n }, []);\n\n // Duplicate quote functionality\n const getDuplicateErrorMessage = useCallback((error: any): string => {\n return error?.message || dictionary.confirmationModalDuplicateErrorFallback;\n }, [dictionary.confirmationModalDuplicateErrorFallback]);\n\n const handleDuplicateCancel = useCallback(() => {\n setIsDuplicateDialogOpen(false);\n setDuplicateError(null);\n setDuplicateSuccess(false);\n }, []);\n\n const handleDuplicateConfirm = useCallback(async () => {\n if (!quoteData?.uid) {\n return;\n }\n\n setDuplicateError(null);\n setDuplicateSuccess(false);\n\n try {\n // Check for out of stock items before duplication\n /* istanbul ignore next */\n const outOfStockItems = quoteData.items?.filter((item) => item.outOfStock) || [];\n\n // Generate a unique duplicated quote UID by replacing the last 8 characters\n const generateUniqueUid = (originalUid: string): string => {\n const baseUid = originalUid.slice(0, -8); // Remove last 8 characters\n const randomSuffix = crypto.randomUUID().slice(0, 8);\n return baseUid + randomSuffix;\n };\n \n const duplicatedQuoteUid = generateUniqueUid(quoteData.uid);\n\n // Store out of stock warning for the new quote if any items are out of stock\n const hasOutOfStockItems = outOfStockItems.length > 0;\n if (hasOutOfStockItems) {\n sessionStorage.setItem(`duplicate-outOfStock-warning-${duplicatedQuoteUid}`, 'true');\n }\n\n await duplicateQuote({ \n quoteUid: quoteData.uid, \n duplicatedQuoteUid,\n hasOutOfStockItems \n });\n // Success handling is done in the event listener\n } catch (error: any) {\n const errorMessage = getDuplicateErrorMessage(error);\n setDuplicateError(errorMessage);\n }\n }, [quoteData, getDuplicateErrorMessage]);\n\n const handleDismissDuplicateError = useCallback(() => {\n setDuplicateError(null);\n }, []);\n\n const handleDismissDuplicateSuccess = useCallback(() => {\n setDuplicateSuccess(false);\n }, []);\n\n const deleteErrorBanner = deleteError ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.confirmationModalDeleteErrorHeading}\n description={deleteError}\n onDismiss={handleDismissError}\n data-testid=\"confirmation-modal-error-banner\"\n />\n ) : null;\n\n const deleteSuccessBanner = deleteSuccess ? (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.confirmationModalDeleteSuccessHeading}\n description={dictionary.confirmationModalDeleteSuccessDescription}\n onDismiss={handleDismissSuccess}\n data-testid=\"confirmation-modal-success-banner\"\n />\n ) : null;\n\n const deleteBanner = deleteSuccessBanner || deleteErrorBanner;\n\n const duplicateErrorBanner = duplicateError ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.confirmationModalDuplicateErrorHeading}\n description={duplicateError}\n onDismiss={handleDismissDuplicateError}\n data-testid=\"confirmation-modal-duplicate-error-banner\"\n />\n ) : null;\n\n const duplicateSuccessBanner = duplicateSuccess ? (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.confirmationModalDuplicateSuccessHeading}\n description={dictionary.confirmationModalDuplicateSuccessDescription}\n onDismiss={handleDismissDuplicateSuccess}\n data-testid=\"confirmation-modal-duplicate-success-banner\"\n />\n ) : null;\n\n const duplicateBanner = duplicateSuccessBanner || duplicateErrorBanner;\n\n const manageNegotiableQuoteProps: ManageNegotiableQuoteComponentProps = {\n ...props,\n loading,\n quoteName,\n quoteStatus,\n banner: (outOfStockWarningBanner || banner) ? (<>{outOfStockWarningBanner}{banner}</>) : undefined,\n details,\n actionBar,\n quoteContent,\n shippingInformationTitle,\n shippingInformation,\n quoteCommentsTitle,\n quoteComments,\n attachFilesField,\n attachedFilesList,\n footer,\n };\n\n // Create banner for close modal based on success/error state\n let closeModalBanner = null;\n if (modalSuccessMessage) {\n closeModalBanner = (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.closeModalSuccessHeading}\n description={modalSuccessMessage}\n data-testid=\"close-quote-success-banner\"\n />\n );\n } else if (modalErrorMessage) {\n closeModalBanner = (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.confirmationModalDeleteErrorHeading}\n description={modalErrorMessage}\n data-testid=\"close-quote-error-banner\"\n />\n );\n }\n\n // Create banner for create template modal based on success/error state\n let createTemplateModalBanner = null;\n if (createTemplateSuccessMessage) {\n createTemplateModalBanner = (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.createTemplateModalSuccessHeading}\n description={createTemplateSuccessMessage}\n data-testid=\"create-template-success-banner\"\n />\n );\n } else if (createTemplateErrorMessage) {\n createTemplateModalBanner = (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.createTemplateModalErrorHeading}\n description={createTemplateErrorMessage}\n data-testid=\"create-template-error-banner\"\n />\n );\n }\n\n return (\n <>\n <ManageNegotiableQuoteComponent {...manageNegotiableQuoteProps} />\n {isRenameModalOpen &&\n createPortal(\n <RenameQuoteModal\n open={isRenameModalOpen}\n quoteName={renameQuoteName}\n renameReason={renameReason}\n quoteNameError={renameQuoteNameError}\n errorBanner={renameErrorBanner}\n successBanner={renameSuccessBanner}\n onQuoteNameChange={handleRenameQuoteNameChange}\n onRenameReasonChange={setRenameReason}\n onSave={handleRenameSave}\n onClose={handleRenameClose}\n />,\n document.body\n )}\n {isDeleteDialogOpen &&\n createPortal(\n <ConfirmationModal\n open={isDeleteDialogOpen}\n title={dictionary.confirmationModalDeleteTitle}\n message={dictionary.confirmationModalDeleteMessage}\n cancelLabel={dictionary.confirmationModalCancel}\n confirmLabel={dictionary.confirmationModalDeleteConfirm}\n onCancel={handleDeleteCancel}\n onConfirm={handleDeleteConfirm}\n showCloseButton={!deleteBanner}\n confirmationBanner={deleteBanner}\n />,\n document.body\n )}\n {isDuplicateDialogOpen &&\n createPortal(\n <ConfirmationModal\n open={isDuplicateDialogOpen}\n title={dictionary.confirmationModalDuplicateTitle}\n message={dictionary.confirmationModalDuplicateMessage}\n cancelLabel={dictionary.confirmationModalCancel}\n confirmLabel={dictionary.confirmationModalDuplicateConfirm}\n onCancel={handleDuplicateCancel}\n onConfirm={handleDuplicateConfirm}\n showCloseButton={!duplicateBanner}\n confirmationBanner={duplicateBanner}\n />,\n document.body\n )}\n {showCloseModal &&\n createPortal(\n <ConfirmationModal\n open={showCloseModal}\n title={dictionary.closeModalTitle}\n message={dictionary.closeModalMessage}\n cancelLabel={dictionary.closeModalCancel}\n confirmLabel={\n isClosing\n ? dictionary.closeModalConfirmLoading\n : dictionary.closeModalConfirm\n }\n onCancel={handleCloseModalCancel}\n onConfirm={isClosing ? undefined : handleCloseQuote}\n showCloseButton={true}\n confirmationBanner={closeModalBanner}\n data-testid=\"close-quote-confirmation-modal\"\n />,\n document.body\n )}\n {showCreateTemplateModal &&\n createPortal(\n <ConfirmationModal\n open={showCreateTemplateModal}\n title={dictionary.createTemplateModalTitle}\n message={dictionary.createTemplateModalMessage}\n cancelLabel={dictionary.createTemplateModalCancel}\n confirmLabel={\n isCreatingTemplate\n ? dictionary.createTemplateModalConfirmLoading\n : dictionary.createTemplateModalConfirm\n }\n onCancel={handleCreateTemplateModalCancel}\n onConfirm={isCreatingTemplate ? undefined : handleCreateTemplate}\n showCloseButton={true}\n confirmationBanner={createTemplateModalBanner}\n data-testid=\"create-template-confirmation-modal\"\n />,\n document.body\n )}\n {isNoItemsSelectedModalOpen &&\n createPortal(\n <ConfirmationModal\n open={isNoItemsSelectedModalOpen}\n title={dictionary.noItemsSelectedModalTitle}\n message={dictionary.noItemsSelectedModalMessage}\n confirmLabel={dictionary.noItemsSelectedModalConfirm}\n onConfirm={handleCloseNoItemsSelectedModal}\n onClose={handleCloseNoItemsSelectedModal}\n showCloseButton={true}\n data-testid=\"no-items-selected-modal\"\n />,\n document.body\n )}\n </>\n );\n};\n"],"names":["ManageNegotiableQuote","className","loading","quoteName","quoteStatus","banner","details","actionBar","quoteContent","shippingInformationTitle","shippingInformation","quoteCommentsTitle","quoteComments","attachFilesField","attachedFilesList","footer","props","ManageNegotiableQuoteSkeleton","jsxs","classes","jsx","VComponent","Skeleton","SkeletonRow","onActionsDropdownChange","slots","onActionsButtonClick","onSendForReview","maxFiles","maxFileSize","acceptedFileTypes","onDuplicateQuote","quoteData","setQuoteData","useState","setLoading","isDeleteDialogOpen","setIsDeleteDialogOpen","deleteError","setDeleteError","deleteSuccess","setDeleteSuccess","isDuplicateDialogOpen","setIsDuplicateDialogOpen","duplicateError","setDuplicateError","duplicateSuccess","setDuplicateSuccess","duplicateOutOfStockWarning","setDuplicateOutOfStockWarning","comment","setComment","isSubmitting","setIsSubmitting","showCloseModal","setShowCloseModal","isClosing","setIsClosing","modalSuccessMessage","setModalSuccessMessage","modalErrorMessage","setModalErrorMessage","showCreateTemplateModal","setShowCreateTemplateModal","isCreatingTemplate","setIsCreatingTemplate","createTemplateSuccessMessage","setCreateTemplateSuccessMessage","createTemplateErrorMessage","setCreateTemplateErrorMessage","isRenameModalOpen","setIsRenameModalOpen","renameQuoteName","setRenameQuoteName","renameReason","setRenameReason","renameError","setRenameError","renameQuoteNameError","setRenameQuoteNameError","renameSuccess","setRenameSuccess","attachedFiles","setAttachedFiles","fileUploadError","setFileUploadError","selectedItemUids","setSelectedItemUids","selectedItemUidsRef","useRef","removeItemsHandlerRef","actionsBarDropdownValue","setActionsBarDropdownValue","actionsBarDropdownValueRef","isNoItemsSelectedModalOpen","setIsNoItemsSelectedModalOpen","useEffect","dictionary","useText","quoteDataEvent","events","data","quote","pendingWarningKey","shippingAddressSetEvent","quoteSentForReviewEvent","quoteItemsRemovedEvent","removedItemUids","prev","next","uid","handleItemCheckboxChange","useCallback","item","isSelected","handleActionsDropdownChange","event","action","currentSelectedUids","itemsToRemove","handleCloseNoItemsSelectedModal","quoteClosedEvent","currentQuoteData","_a","getQuoteData","updatedQuoteData","error","quoteCloseErrorEvent","errorMsg","quoteRenamedEvent","quoteDuplicatedEvent","newQuote","handleAttachFiles","files","file","validateFileSize","formatFileSize","validateFileType","newFiles","i","tempKey","result","uploadFile","f","handleRemoveFile","key","handleRenameClick","handleRenameClose","handleRenameQuoteNameChange","value","handleDuplicateQuote","handleRenameSave","renameNegotiableQuote","useMemo","isLocked","Slot","Edit","bannerMessage","status","bannerContent","InLineAlert","WarningFilled","handleDismissOutOfStockWarning","outOfStockWarningBanner","expirationDate","formattedDate","buttons","handleActionsButtonClick","ActionsBar","button","Button","TabbedContent","ItemsQuoted","handler","isOpen","QuoteCommentsList","QuoteHistoryLog","ShippingAddressDisplay","TextArea","e","isFileUploadDisabled","isDisabled","InputFile","target","fileList","Add","AttachedFilesList","handleCloseQuote","closeNegotiableQuote","handleCloseModalCancel","handleCreateTemplate","createQuoteTemplate","errorMessage","handleCreateTemplateModalCancel","handleSendForReview","successfulAttachments","sendForReview","renameErrorBanner","renameSuccessBanner","CheckWithCircle","getDeleteErrorMessage","handleDeleteCancel","handleDeleteConfirm","operationResults","deleteQuote","failure","res","handleDismissError","handleDismissSuccess","getDuplicateErrorMessage","handleDuplicateCancel","handleDuplicateConfirm","outOfStockItems","duplicatedQuoteUid","originalUid","baseUid","randomSuffix","hasOutOfStockItems","duplicateQuote","handleDismissDuplicateError","handleDismissDuplicateSuccess","deleteErrorBanner","deleteBanner","duplicateErrorBanner","duplicateBanner","manageNegotiableQuoteProps","Fragment","closeModalBanner","createTemplateModalBanner","ManageNegotiableQuoteComponent","createPortal","RenameQuoteModal","ConfirmationModal"],"mappings":"0yDAgCO,MAAMA,GAAuE,CAAC,CACnF,UAAAC,EACA,QAAAC,EACA,UAAAC,EACA,YAAAC,EACA,OAAAC,EACA,QAAAC,EACA,UAAAC,EACA,aAAAC,EACA,yBAAAC,EACA,oBAAAC,EACA,mBAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,kBAAAC,EACA,OAAAC,EACA,GAAGC,CACL,IACMd,IACMe,GAAA,EAA8B,EAItCC,EAAC,MAAA,CAAK,GAAGF,EAAO,UAAWG,EAAQ,CAAC,2CAA4ClB,CAAS,CAAC,EACxF,SAAA,CAAAiB,EAAC,OAAI,UAAWC,EAAQ,CAAC,kDAAkD,CAAC,EACzE,SAAA,CAAAhB,GACCiB,EAACC,EAAA,CACC,KAAMlB,EACN,UAAWgB,EAAQ,CAAC,sDAAsD,CAAC,CAAA,CAAA,EAG9Ef,GACCgB,EAACC,EAAA,CACC,KAAMjB,EACN,UAAWe,EAAQ,CAAC,wDAAwD,CAAC,CAAA,CAAA,CAC/E,EAEJ,EACCd,GAC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AMlL,GACN,MAAO2C,EAAW,gBAClB,QAASA,EAAW,kBACpB,YAAaA,EAAW,iBACxB,aACEzC,GACIyC,EAAW,yBACXA,EAAW,kBAEjB,SAAU4F,GACV,UAAWrI,GAAY,OAAYmI,GACnC,gBAAiB,GACjB,mBAAoBwC,GACpB,cAAY,gCAAA,CAAA,EAEd,SAAS,IAAA,EAEZrK,IACCwK,EACElN,EAACoN,EAAA,CACC,KAAM1K,GACN,MAAOmC,EAAW,yBAClB,QAASA,EAAW,2BACpB,YAAaA,EAAW,0BACxB,aACEjC,GACIiC,EAAW,kCACXA,EAAW,2BAEjB,SAAUgG,GACV,UAAWjI,GAAqB,OAAY8H,GAC5C,gBAAiB,GACjB,mBAAoBsC,GACpB,cAAY,oCAAA,CAAA,EAEd,SAAS,IAAA,EAEZtI,IACCwI,EACElN,EAACoN,EAAA,CACC,KAAM1I,GACN,MAAOG,EAAW,0BAClB,QAASA,EAAW,4BACpB,aAAcA,EAAW,4BACzB,UAAWuB,GACX,QAASA,GACT,gBAAiB,GACjB,cAAY,yBAAA,CAAA,EAEd,SAAS,IAAA,CACX,EACJ,CAEJ"}
1
+ {"version":3,"file":"ManageNegotiableQuote.js","sources":["/@dropins/storefront-quote-management/src/components/ManageNegotiableQuote/ManageNegotiableQuote.tsx","/@dropins/storefront-quote-management/src/containers/ManageNegotiableQuote/ManageNegotiableQuote.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, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/ManageNegotiableQuote/ManageNegotiableQuote.css';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\n\nexport interface ManageNegotiableQuoteProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n loading?: boolean;\n quoteName: VNode;\n quoteStatus: VNode;\n banner?: VNode;\n details?: VNode;\n actionBar?: VNode;\n quoteContent: VNode;\n shippingInformationTitle: VNode;\n shippingInformation: VNode;\n quoteCommentsTitle: VNode;\n quoteComments: VNode;\n attachFilesField?: VNode;\n attachedFilesList?: VNode;\n footer: VNode;\n}\n\nexport const ManageNegotiableQuote: FunctionComponent<ManageNegotiableQuoteProps> = ({\n className,\n loading,\n quoteName,\n quoteStatus,\n banner,\n details,\n actionBar,\n quoteContent,\n shippingInformationTitle,\n shippingInformation,\n quoteCommentsTitle,\n quoteComments,\n attachFilesField,\n attachedFilesList,\n footer,\n ...props\n}) => {\n if (loading) {\n return <ManageNegotiableQuoteSkeleton />;\n }\n\n return (\n <div {...props} className={classes(['quote-management-manage-negotiable-quote', className])}>\n <div className={classes(['quote-management-manage-negotiable-quote__header'])}>\n {quoteName &&\n <VComponent\n node={quoteName}\n className={classes(['quote-management-manage-negotiable-quote__quote-name'])}\n />\n }\n {quoteStatus &&\n <VComponent\n node={quoteStatus}\n className={classes(['quote-management-manage-negotiable-quote__quote-status'])}\n />\n }\n </div>\n {banner &&\n <VComponent\n node={banner}\n className={classes(['quote-management-manage-negotiable-quote__banner'])}\n />\n }\n {details &&\n <VComponent\n node={details}\n className={classes(['quote-management-manage-negotiable-quote__details'])}\n />\n }\n {actionBar &&\n <VComponent\n node={actionBar}\n className={classes(['quote-management-manage-negotiable-quote__action-bar'])}\n />\n }\n {quoteContent &&\n <VComponent\n node={quoteContent}\n className={classes(['quote-management-manage-negotiable-quote__quote-content'])}\n />\n }\n <div data-testid=\"quote-shipping-information-container\" className={classes(['quote-management-manage-negotiable-quote__shipping-information-container'])}>\n {shippingInformationTitle &&\n <VComponent\n node={shippingInformationTitle}\n className={classes(['quote-management-manage-negotiable-quote__shipping-information-title'])}\n />\n }\n {shippingInformation &&\n <VComponent\n node={shippingInformation}\n className={classes(['quote-management-manage-negotiable-quote__shipping-information'])}\n />\n }\n </div>\n <div data-testid=\"quote-comments-container\" className={classes(['quote-management-manage-negotiable-quote__quote-comments-container'])}>\n {quoteCommentsTitle &&\n <VComponent\n node={quoteCommentsTitle}\n className={classes(['quote-management-manage-negotiable-quote__quote-comments-title'])}\n />\n }\n {quoteComments &&\n <VComponent\n node={quoteComments}\n className={classes(['quote-management-manage-negotiable-quote__quote-comments'])}\n />\n }\n {attachFilesField &&\n <VComponent\n node={attachFilesField}\n className={classes(['quote-management-manage-negotiable-quote__attach-files-field'])}\n />\n }\n {attachedFilesList &&\n <VComponent\n node={attachedFilesList}\n className={classes(['quote-management-manage-negotiable-quote__attached-files-list'])}\n />\n }\n </div>\n <VComponent\n node={footer}\n className={classes(['quote-management-manage-negotiable-quote__footer'])}\n />\n </div>\n );\n};\n\nexport const ManageNegotiableQuoteSkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"manage-negotiable-quote-skeleton\">\n <SkeletonRow variant=\"heading\" fullWidth={true} size=\"large\" />\n <SkeletonRow variant=\"row\" fullWidth={false} size=\"small\" />\n <SkeletonRow variant=\"row\" fullWidth={false} size=\"small\" />\n <SkeletonRow variant=\"row\" fullWidth={true} />\n <SkeletonRow variant=\"row\" fullWidth={true} size=\"xlarge\" lines={2} />\n <SkeletonRow variant=\"row\" fullWidth={false} size=\"small\" />\n </Skeleton>\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 {\n HTMLAttributes,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n createPortal,\n} from 'preact/compat';\nimport {\n Container,\n Slot,\n SlotProps,\n} from '@adobe-commerce/elsie/lib';\nimport { formattedDate } from '@/quote-management/utils/dateUtils';\nimport {\n NegotiableQuoteModel,\n CartItemModel,\n} from '@/quote-management/data/models/negotiable-quote-model';\nimport {\n ManageNegotiableQuote as ManageNegotiableQuoteComponent,\n ManageNegotiableQuoteProps as ManageNegotiableQuoteComponentProps,\n} from '@/quote-management/components/ManageNegotiableQuote';\nimport { events } from '@adobe-commerce/event-bus';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n ActionsBar,\n TabbedContent,\n ConfirmationModal,\n AttachedFilesList,\n AttachedFile,\n} from '@/quote-management/components';\nimport { ShippingAddressDisplay } from '@/quote-management/containers/ShippingAddressDisplay';\nimport { QuoteHistoryLog } from '@/quote-management/containers/QuoteHistoryLog';\nimport { ItemsQuoted, QuoteCommentsList } from '@/quote-management/containers';\nimport {\n Button,\n InLineAlert,\n TextArea,\n InputFile,\n} from '@adobe-commerce/elsie/components';\nimport {\n WarningFilled,\n Edit,\n CheckWithCircle,\n Add,\n} from '@adobe-commerce/elsie/icons';\nimport {\n deleteQuote,\n sendForReview,\n renameNegotiableQuote,\n closeNegotiableQuote,\n getQuoteData,\n uploadFile,\n duplicateQuote,\n createQuoteTemplate,\n} from '@/quote-management/api';\nimport {\n formatFileSize,\n validateFileType,\n validateFileSize,\n} from '@/quote-management/utils/fileUtils';\nimport { RenameQuoteModal } from '@/quote-management/components/RenameQuoteModal';\n\nexport interface ManageNegotiableQuoteProps\n extends HTMLAttributes<HTMLDivElement> {\n onActionsDropdownChange?: (event: Event) => void;\n onActionsButtonClick?: (action: string) => void;\n onSendForReview?: (params: {\n quoteData: NegotiableQuoteModel;\n comment?: string;\n attachments?: AttachedFile[];\n }) => void;\n maxFiles?: number;\n maxFileSize?: number;\n acceptedFileTypes?: string[];\n onDuplicateQuote?: (params: {\n quoteData: NegotiableQuoteModel;\n newQuote: NegotiableQuoteModel;\n }) => void;\n slots?: {\n QuoteName?: SlotProps<{\n quoteName?: string;\n quoteData?: NegotiableQuoteModel;\n }>;\n QuoteStatus?: SlotProps<{\n quoteStatus?: string;\n quoteData?: NegotiableQuoteModel;\n }>;\n Banner?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n DuplicateQuoteWarningBanner?: SlotProps<{\n outOfStockWarning?: boolean;\n }>;\n Details?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n ActionBar?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n actionsBarDropdownValue?: string;\n }>;\n QuoteContent?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n ItemsQuotedTab?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n CommentsTab?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n HistoryLogTab?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n ShippingInformationTitle?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n ShippingInformation?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n loading?: boolean;\n setLoading?: (loading: boolean) => void;\n }>;\n QuoteCommentsTitle?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n QuoteComments?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n AttachFilesField?: SlotProps<{\n onFileChange: (files: File[]) => void;\n attachedFiles: AttachedFile[];\n fileUploadError: string | undefined;\n disabled?: boolean;\n }>;\n AttachedFilesList?: SlotProps<{\n files: AttachedFile[];\n onRemove: (key: string) => void;\n disabled?: boolean;\n }>;\n Footer?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n comment?: string;\n isSubmitting?: boolean;\n attachments?: AttachedFile[];\n handleSendForReview: () => void;\n }>;\n };\n}\n\nexport const ManageNegotiableQuote: Container<ManageNegotiableQuoteProps> = ({\n onActionsDropdownChange,\n slots,\n onActionsButtonClick,\n onSendForReview,\n maxFiles,\n maxFileSize,\n acceptedFileTypes,\n onDuplicateQuote,\n ...props\n}) => {\n const [quoteData, setQuoteData] = useState<NegotiableQuoteModel | undefined>(\n undefined\n );\n const [loading, setLoading] = useState<boolean>(true);\n const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState<boolean>(false);\n const [deleteError, setDeleteError] = useState<string | null>(null);\n const [deleteSuccess, setDeleteSuccess] = useState<boolean>(false);\n const [isDuplicateDialogOpen, setIsDuplicateDialogOpen] = useState<boolean>(false);\n const [duplicateError, setDuplicateError] = useState<string | null>(null);\n const [duplicateSuccess, setDuplicateSuccess] = useState<boolean>(false);\n const [duplicateOutOfStockWarning, setDuplicateOutOfStockWarning] = useState<boolean>(false);\n const [comment, setComment] = useState<string>('');\n const [isSubmitting, setIsSubmitting] = useState<boolean>(false);\n const [showCloseModal, setShowCloseModal] = useState<boolean>(false);\n const [isClosing, setIsClosing] = useState<boolean>(false);\n const [modalSuccessMessage, setModalSuccessMessage] = useState<string>('');\n const [modalErrorMessage, setModalErrorMessage] = useState<string>('');\n const [showCreateTemplateModal, setShowCreateTemplateModal] = useState<boolean>(false);\n const [isCreatingTemplate, setIsCreatingTemplate] = useState<boolean>(false);\n const [createTemplateSuccessMessage, setCreateTemplateSuccessMessage] = useState<string>('');\n const [createTemplateErrorMessage, setCreateTemplateErrorMessage] = useState<string>('');\n const [isRenameModalOpen, setIsRenameModalOpen] = useState<boolean>(false);\n const [renameQuoteName, setRenameQuoteName] = useState<string>('');\n const [renameReason, setRenameReason] = useState<string>('');\n const [renameError, setRenameError] = useState<string>('');\n const [renameQuoteNameError, setRenameQuoteNameError] = useState<string>('');\n const [renameSuccess, setRenameSuccess] = useState<string>('');\n const [attachedFiles, setAttachedFiles] = useState<AttachedFile[]>([]);\n const [fileUploadError, setFileUploadError] = useState<string | undefined>(undefined);\n const [selectedItemUids, setSelectedItemUids] = useState<Set<string>>(\n new Set()\n );\n const selectedItemUidsRef = useRef<Set<string>>(selectedItemUids);\n const removeItemsHandlerRef = useRef<\n ((items: CartItemModel[]) => void) | null\n >(null);\n const [actionsBarDropdownValue, setActionsBarDropdownValue] =\n useState<string>('');\n const actionsBarDropdownValueRef = useRef<string>(actionsBarDropdownValue);\n const [isNoItemsSelectedModalOpen, setIsNoItemsSelectedModalOpen] =\n useState<boolean>(false);\n\n // Keep refs in sync with state\n useEffect(() => {\n selectedItemUidsRef.current = selectedItemUids;\n }, [selectedItemUids]);\n\n useEffect(() => {\n actionsBarDropdownValueRef.current = actionsBarDropdownValue;\n }, [actionsBarDropdownValue]);\n\n const dictionary = useText({\n createdLabel: 'NegotiableQuote.Manage.createdLabel',\n salesRepLabel: 'NegotiableQuote.Manage.salesRepLabel',\n expiresLabel: 'NegotiableQuote.Manage.expiresLabel',\n actionsLabel: 'NegotiableQuote.Manage.actionsLabel',\n remove: 'NegotiableQuote.Manage.actions.remove',\n close: 'NegotiableQuote.Manage.actionButtons.close',\n delete: 'NegotiableQuote.Manage.actionButtons.delete',\n print: 'NegotiableQuote.Manage.actionButtons.print',\n createTemplate: 'NegotiableQuote.Manage.actionButtons.createTemplate',\n createCopy: 'NegotiableQuote.Manage.actionButtons.createCopy',\n shippingInformationTitle:\n 'NegotiableQuote.Manage.shippingInformation.title',\n quoteCommentsTitle: 'NegotiableQuote.Manage.quoteComments.title',\n quoteCommentsPlaceholder:\n 'NegotiableQuote.Manage.quoteComments.placeholder',\n sendForReview: 'NegotiableQuote.Manage.actionButtons.sendForReview',\n bannerTitle: 'NegotiableQuote.Manage.bannerTitle',\n statusSubmitted: 'NegotiableQuote.Manage.bannerStatusMessages.submitted',\n statusPending: 'NegotiableQuote.Manage.bannerStatusMessages.pending',\n statusExpired: 'NegotiableQuote.Manage.bannerStatusMessages.expired',\n errorFallback:\n 'NegotiableQuote.Manage.confirmationModal.delete.errorFallback',\n closeSuccessMessage:\n 'NegotiableQuote.Manage.confirmationModal.close.successDescription',\n closeModalTitle: 'NegotiableQuote.Manage.actionButtons.close',\n closeModalMessage: 'NegotiableQuote.Manage.confirmationModal.close.message',\n closeModalCancel: 'NegotiableQuote.Manage.confirmationModal.cancel',\n closeModalConfirm: 'NegotiableQuote.Manage.confirmationModal.close.confirm',\n closeModalConfirmLoading:\n 'NegotiableQuote.Manage.confirmationModal.close.confirmLoading',\n closeModalSuccessHeading:\n 'NegotiableQuote.Manage.confirmationModal.close.successHeading',\n createTemplateModalTitle: 'NegotiableQuote.Manage.actionButtons.createTemplate',\n createTemplateModalMessage: 'NegotiableQuote.Manage.confirmationModal.createTemplate.message',\n createTemplateModalCancel: 'NegotiableQuote.Manage.confirmationModal.cancel',\n createTemplateModalConfirm: 'NegotiableQuote.Manage.confirmationModal.createTemplate.confirm',\n createTemplateModalConfirmLoading:\n 'NegotiableQuote.Manage.confirmationModal.createTemplate.confirmLoading',\n createTemplateModalSuccessHeading:\n 'NegotiableQuote.Manage.confirmationModal.createTemplate.successHeading',\n createTemplateSuccessMessage:\n 'NegotiableQuote.Manage.confirmationModal.createTemplate.successDescription',\n createTemplateModalErrorHeading:\n 'NegotiableQuote.Manage.confirmationModal.createTemplate.errorHeading',\n createTemplateErrorFallback:\n 'NegotiableQuote.Manage.confirmationModal.createTemplate.errorFallback',\n renameErrorHeading: 'NegotiableQuote.Manage.rename.errorHeading',\n renameQuoteNameRequired: 'NegotiableQuote.Manage.rename.quoteNameRequired',\n renameErrorDefault: 'NegotiableQuote.Manage.rename.errorDefault',\n renameSuccessHeading: 'NegotiableQuote.Manage.rename.successHeading',\n renameSuccessMessage: 'NegotiableQuote.Manage.rename.successMessage',\n confirmationModalCancel: 'NegotiableQuote.Manage.confirmationModal.cancel',\n confirmationModalDeleteTitle: 'NegotiableQuote.Manage.confirmationModal.delete.title',\n confirmationModalDeleteMessage: 'NegotiableQuote.Manage.confirmationModal.delete.message',\n confirmationModalDeleteConfirm: 'NegotiableQuote.Manage.confirmationModal.delete.confirm',\n confirmationModalDeleteErrorHeading: 'NegotiableQuote.Manage.confirmationModal.delete.errorHeading',\n confirmationModalDeleteErrorFallback: 'NegotiableQuote.Manage.confirmationModal.delete.errorFallback',\n confirmationModalDeleteSuccessHeading: 'NegotiableQuote.Manage.confirmationModal.delete.successHeading',\n confirmationModalDeleteSuccessDescription: 'NegotiableQuote.Manage.confirmationModal.delete.successDescription',\n confirmationModalDuplicateTitle: 'NegotiableQuote.Manage.confirmationModal.duplicate.title',\n confirmationModalDuplicateMessage: 'NegotiableQuote.Manage.confirmationModal.duplicate.message',\n confirmationModalDuplicateConfirm: 'NegotiableQuote.Manage.confirmationModal.duplicate.confirm',\n confirmationModalDuplicateErrorHeading: 'NegotiableQuote.Manage.confirmationModal.duplicate.errorHeading',\n confirmationModalDuplicateErrorFallback: 'NegotiableQuote.Manage.confirmationModal.duplicate.errorFallback',\n confirmationModalDuplicateSuccessHeading: 'NegotiableQuote.Manage.confirmationModal.duplicate.successHeading',\n confirmationModalDuplicateSuccessDescription: 'NegotiableQuote.Manage.confirmationModal.duplicate.successDescription',\n duplicateOutOfStockWarningHeading: 'NegotiableQuote.Manage.confirmationModal.duplicate.outOfStockWarningHeading',\n duplicateOutOfStockWarningMessage: 'NegotiableQuote.Manage.confirmationModal.duplicate.outOfStockWarningMessage',\n noItemsSelectedModalTitle: 'NegotiableQuote.Manage.confirmationModal.noItemsSelected.title',\n noItemsSelectedModalMessage: 'NegotiableQuote.Manage.confirmationModal.noItemsSelected.message',\n noItemsSelectedModalConfirm: 'NegotiableQuote.Manage.confirmationModal.noItemsSelected.confirm',\n attachFiles: 'NegotiableQuote.Manage.attachFiles',\n fileUploadError: 'NegotiableQuote.Manage.fileUploadError',\n maxFilesExceeded: 'NegotiableQuote.Manage.maxFilesExceeded',\n maxFileSizeExceeded: 'NegotiableQuote.Manage.maxFileSizeExceeded',\n invalidFileType: 'NegotiableQuote.Manage.invalidFileType',\n });\n /* Event listeners */\n useEffect(() => {\n const quoteDataEvent = events.on(\n 'quote-management/quote-data',\n (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n if (quote) {\n setQuoteData(quote);\n setLoading(false);\n\n // Check for pending out of stock warning from duplication\n const pendingWarningKey = `duplicate-outOfStock-warning-${quote.uid}`;\n const pendingWarning = sessionStorage.getItem(pendingWarningKey);\n if (pendingWarning === 'true') {\n setDuplicateOutOfStockWarning(true);\n sessionStorage.removeItem(pendingWarningKey);\n }\n }\n },\n {\n eager: true,\n }\n );\n return () => quoteDataEvent?.off();\n }, []);\n\n // Listen for shipping address set event\n useEffect(() => {\n const shippingAddressSetEvent = events.on(\n 'quote-management/shipping-address-set',\n (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n if (quote) {\n setQuoteData(quote);\n }\n },\n {\n eager: true,\n }\n );\n return () => shippingAddressSetEvent?.off();\n }, []);\n\n // Listen for quote sent for review event\n useEffect(() => {\n const quoteSentForReviewEvent = events.on(\n 'quote-management/quote-sent-for-review',\n (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n setQuoteData(quote);\n setComment(''); // Reset comment after successful submission\n setAttachedFiles([]); // Clear attachments after successful submission\n setIsSubmitting(false);\n },\n {\n eager: true,\n }\n );\n return () => quoteSentForReviewEvent?.off();\n }, []);\n\n // Listen for quote items removed event\n useEffect(() => {\n const quoteItemsRemovedEvent = events.on(\n 'quote-management/quote-items-removed',\n (data: { quote: NegotiableQuoteModel; removedItemUids: string[] }) => {\n const { quote, removedItemUids } = data;\n /* istanbul ignore else */ // Always has quote in real usage; covered in integration tests\n if (quote) {\n setQuoteData(quote);\n }\n // Clear selected items that were removed\n /* istanbul ignore else */ // Always has removedItemUids in real usage; covered in integration tests\n if (removedItemUids) {\n setSelectedItemUids((prev) => {\n const next = new Set(prev);\n removedItemUids.forEach((uid) => next.delete(uid));\n return next;\n });\n }\n },\n {\n eager: true,\n }\n );\n return () => quoteItemsRemovedEvent?.off();\n }, []);\n\n /**\n * Handlers\n */\n const handleItemCheckboxChange = useCallback(\n (item: CartItemModel, isSelected: boolean) => {\n setSelectedItemUids((prev) => {\n const next = new Set(prev);\n if (isSelected) {\n next.add(item.uid);\n } else {\n next.delete(item.uid);\n }\n return next;\n });\n },\n []\n );\n\n const handleActionsDropdownChange = useCallback(\n (event: Event) => {\n const action = (event.target as HTMLSelectElement).value;\n const currentSelectedUids = selectedItemUidsRef.current;\n /* istanbul ignore else */ if (action === 'remove') {\n setActionsBarDropdownValue(action);\n actionsBarDropdownValueRef.current = action; // Update ref immediately\n /* istanbul ignore next */ if (currentSelectedUids.size === 0) {\n // No items selected - show warning modal\n setIsNoItemsSelectedModalOpen(true);\n } else if (quoteData && removeItemsHandlerRef.current) {\n // Items selected - proceed with removal\n const itemsToRemove = quoteData.items.filter((item) =>\n currentSelectedUids.has(item.uid)\n );\n /* istanbul ignore next */ removeItemsHandlerRef.current(\n itemsToRemove\n );\n }\n }\n onActionsDropdownChange?.(event);\n },\n [onActionsDropdownChange, quoteData]\n );\n\n /* istanbul ignore next */ const handleCloseNoItemsSelectedModal =\n useCallback(() => {\n setIsNoItemsSelectedModalOpen(false);\n setActionsBarDropdownValue('');\n actionsBarDropdownValueRef.current = '';\n }, []);\n\n // Listen for quote closed event\n useEffect(() => {\n const quoteClosedEvent = events.on(\n 'quote-management/negotiable-quote-closed',\n async (data: { closedQuoteUids: string[] }) => {\n setIsClosing(false);\n setModalErrorMessage('');\n // Show success message in modal\n setModalSuccessMessage(dictionary.closeSuccessMessage);\n\n // Refresh quote data if the current quote was closed\n // Use a function to get the current quoteData to avoid stale closure\n setQuoteData((currentQuoteData) => {\n if (\n currentQuoteData?.uid &&\n data.closedQuoteUids?.includes(currentQuoteData.uid)\n ) {\n // Trigger async refresh\n getQuoteData(currentQuoteData.uid)\n .then((updatedQuoteData) => {\n setQuoteData(updatedQuoteData);\n })\n .catch((error) => {\n console.warn(\n 'Failed to refresh quote data after closure:',\n error\n );\n });\n }\n return currentQuoteData; // Return current data unchanged for this setter call\n });\n\n // Close modal and redirect after a delay to show success message\n setTimeout(() => {\n setShowCloseModal(false);\n setModalSuccessMessage('');\n }, 2000);\n },\n {\n eager: true,\n }\n );\n return () => quoteClosedEvent?.off();\n }, [dictionary.closeSuccessMessage]);\n\n // Listen for quote close error event\n useEffect(() => {\n const quoteCloseErrorEvent = events.on(\n 'quote-management/negotiable-quote-close-error',\n (data: { error: Error; attemptedQuoteUids: string[] }) => {\n console.log('Close error event received:', data);\n setIsClosing(false);\n setModalSuccessMessage('');\n const errorMsg = data.error.message || dictionary.errorFallback;\n setModalErrorMessage(errorMsg);\n },\n {\n eager: true,\n }\n );\n return () => quoteCloseErrorEvent?.off();\n }, [dictionary.errorFallback]);\n\n // Listen for quote renamed event\n useEffect(() => {\n const quoteRenamedEvent = events.on(\n 'quote-management/quote-renamed',\n (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n setQuoteData(quote);\n setRenameError('');\n setRenameQuoteNameError('');\n setRenameSuccess(dictionary.renameSuccessMessage);\n\n // Wait 2 seconds before closing the modal\n setTimeout(() => {\n setIsRenameModalOpen(false);\n setRenameQuoteName('');\n setRenameReason('');\n setRenameSuccess('');\n }, 2000);\n },\n {\n eager: true,\n }\n );\n return () => quoteRenamedEvent?.off();\n }, [dictionary.renameSuccessMessage]);\n\n // Listen for quote duplicated event\n useEffect(() => {\n const quoteDuplicatedEvent = events.on(\n 'quote-management/quote-duplicated',\n (data: {\n quote: NegotiableQuoteModel;\n input: { quoteUid: string; duplicatedQuoteUid: string };\n }) => {\n const { quote: newQuote } = data;\n\n // Call parent callback if provided\n if (quoteData && onDuplicateQuote) {\n onDuplicateQuote({ quoteData, newQuote });\n }\n\n // Show success in modal\n setDuplicateSuccess(true);\n setDuplicateError(null);\n\n // Close modal after showing success message\n // Navigation is handled by the application layer listening to quote-duplicated event\n setTimeout(() => {\n setIsDuplicateDialogOpen(false);\n setDuplicateSuccess(false);\n setDuplicateError(null);\n }, 2000);\n },\n {\n eager: true,\n }\n );\n return () => quoteDuplicatedEvent?.off();\n }, [quoteData, onDuplicateQuote]);\n\n /**\n * File upload handlers\n */\n\n const handleAttachFiles = useCallback(async (files: File[]) => {\n // Check maxFiles limit\n if (maxFiles && attachedFiles.length + files.length > maxFiles) {\n setFileUploadError(dictionary.maxFilesExceeded.replace('{maxFiles}', String(maxFiles)));\n return;\n }\n\n // Validate file types and sizes before uploading\n for (const file of files) {\n if (maxFileSize && !validateFileSize(file.size, maxFileSize)) {\n setFileUploadError(\n dictionary.maxFileSizeExceeded.replace('{maxSize}', formatFileSize(maxFileSize))\n );\n return;\n }\n\n if (acceptedFileTypes && !validateFileType(file.type, acceptedFileTypes)) {\n setFileUploadError(dictionary.invalidFileType);\n return;\n }\n }\n\n setFileUploadError(undefined);\n\n // Add files with 'uploading' status\n const newFiles: AttachedFile[] = files.map(file => ({\n key: `temp-${Date.now()}-${Math.random()}-${file.name}`,\n name: file.name,\n size: file.size,\n status: 'uploading',\n }));\n\n setAttachedFiles(prev => [...prev, ...newFiles]);\n\n // Upload each file and update its status\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const tempKey = newFiles[i].key;\n\n try {\n const result = await uploadFile(file);\n setAttachedFiles(prev => prev.map(f =>\n f.key === tempKey\n ? { ...f, key: result.key, status: 'success' }\n : f\n ));\n } catch (error) {\n setAttachedFiles(prev => prev.map(f =>\n f.key === tempKey\n ? { ...f, status: 'error', error: (error as Error).message }\n : f\n ));\n }\n }\n }, [maxFiles, maxFileSize, acceptedFileTypes, attachedFiles, dictionary]);\n\n const handleRemoveFile = useCallback((key: string) => {\n setAttachedFiles(prev => prev.filter(f => f.key !== key));\n }, []);\n\n /**\n * VNodes for the ManageNegotiableQuote component\n */\n\n // Rename handlers\n const handleRenameClick = useCallback(() => {\n setRenameQuoteName(quoteData?.name || '');\n setRenameReason('');\n setRenameError('');\n setRenameQuoteNameError('');\n setRenameSuccess('');\n setIsRenameModalOpen(true);\n }, [quoteData]);\n\n const handleRenameClose = useCallback(() => {\n setIsRenameModalOpen(false);\n setRenameQuoteName('');\n setRenameReason('');\n setRenameError('');\n setRenameQuoteNameError('');\n setRenameSuccess('');\n }, []);\n\n const handleRenameQuoteNameChange = useCallback((value: string) => {\n setRenameQuoteName(value);\n if (value.trim()) {\n setRenameQuoteNameError('');\n }\n }, []);\n\n const handleDuplicateQuote = useCallback(() => {\n // Show confirmation modal\n setIsDuplicateDialogOpen(true);\n setDuplicateError(null);\n setDuplicateSuccess(false);\n }, []);\n\n const handleRenameSave = useCallback(async () => {\n // Validate quote name\n if (!renameQuoteName.trim()) {\n setRenameQuoteNameError(dictionary.renameQuoteNameRequired);\n return;\n }\n\n try {\n setRenameError('');\n setRenameQuoteNameError('');\n await renameNegotiableQuote({\n quoteUid: quoteData!.uid,\n quoteName: renameQuoteName,\n quoteComment: renameReason.trim() || undefined,\n });\n // The quote-renamed event will handle closing the modal and updating state\n } catch (error) {\n setRenameError((error as Error).message || dictionary.renameErrorDefault);\n }\n }, [\n quoteData,\n renameQuoteName,\n renameReason,\n dictionary.renameQuoteNameRequired,\n dictionary.renameErrorDefault,\n ]);\n\n // Quote name with rename icon\n const quoteName = useMemo(() => {\n // Priority 1: Check lockedForEditing if explicitly set\n // Priority 2: Fall back to status check\n const isLocked =\n quoteData &&\n // If lockedForEditing is explicitly set, use it\n (quoteData.lockedForEditing === true ||\n // Otherwise, lock based on status\n (quoteData.lockedForEditing === undefined &&\n (quoteData.status === 'SUBMITTED' ||\n quoteData.status === 'PENDING' ||\n quoteData.status === 'ORDERED' ||\n quoteData.status === 'CLOSED')));\n\n return (\n <Slot\n name=\"QuoteName\"\n slot={slots?.QuoteName}\n context={{ quoteName: quoteData?.name, quoteData }}\n >\n <div className=\"quote-management-manage-negotiable-quote__quote-name-wrapper\">\n <h1\n data-testid=\"quote-name\"\n className=\"quote-management-manage-negotiable-quote__quote-name-title\"\n >\n {quoteData?.name}\n </h1>\n <button\n onClick={handleRenameClick}\n disabled={isLocked}\n data-testid=\"rename-quote-button\"\n className=\"quote-management-manage-negotiable-quote__rename-button\"\n aria-label=\"Rename quote\"\n >\n <Edit />\n </button>\n </div>\n </Slot>\n );\n }, [slots?.QuoteName, quoteData, handleRenameClick]);\n\n // Quote status\n const quoteStatus = useMemo(() => {\n return (\n <Slot\n name=\"QuoteStatus\"\n slot={slots?.QuoteStatus}\n context={{ quoteStatus: quoteData?.status, quoteData }}\n >\n <div data-testid=\"quote-status\">{quoteData?.status}</div>\n </Slot>\n );\n }, [slots?.QuoteStatus, quoteData]);\n\n // Banner\n const getBannerStatusMessage = useCallback(\n (status: string | undefined) => {\n switch (status) {\n case 'SUBMITTED':\n return dictionary.statusSubmitted;\n case 'PENDING':\n return dictionary.statusPending;\n case 'EXPIRED':\n return dictionary.statusExpired;\n default:\n return null;\n }\n },\n [dictionary]\n );\n\n const bannerMessage = getBannerStatusMessage(quoteData?.status);\n\n const bannerContent = bannerMessage && (\n <InLineAlert\n type=\"warning\"\n variant=\"secondary\"\n icon={<WarningFilled />}\n heading={dictionary.bannerTitle}\n description={bannerMessage}\n />\n );\n\n const banner = bannerContent && (\n <Slot\n name=\"Banner\"\n data-testid=\"banner\"\n slot={slots?.Banner}\n context={{ quoteData }}\n >\n {bannerContent}\n </Slot>\n );\n\n // Handler for dismissing out of stock warning\n const handleDismissOutOfStockWarning = useCallback(() => {\n setDuplicateOutOfStockWarning(false);\n }, []);\n\n // Out of stock warning banner for duplicated quotes\n const outOfStockWarningBanner = duplicateOutOfStockWarning && (\n <Slot\n name=\"DuplicateQuoteWarningBanner\"\n data-testid=\"duplicate-outOfStock-warning-banner\"\n slot={slots?.DuplicateQuoteWarningBanner}\n context={{ outOfStockWarning: duplicateOutOfStockWarning }}\n >\n <InLineAlert\n type=\"warning\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.duplicateOutOfStockWarningHeading}\n description={dictionary.duplicateOutOfStockWarningMessage}\n onDismiss={handleDismissOutOfStockWarning}\n data-testid=\"duplicate-outOfStock-warning-alert\"\n />\n </Slot>\n );\n\n // Details\n const details = useMemo(() => {\n if (!quoteData) {\n return;\n }\n\n // Some quotes, such as draft quotes, don't have a date formatted expiration date\n const expirationDate = quoteData.expirationDate ? formattedDate(quoteData.expirationDate, 'short') : undefined;\n\n return (\n <Slot name=\"Details\" slot={slots?.Details} context={{ quoteData }}>\n <div className=\"quote-management-manage-negotiable-quote__detail\">\n <span\n className=\"quote-management-manage-negotiable-quote__detail-title\"\n data-testid=\"created-label\"\n >\n {dictionary.createdLabel}\n </span>\n <span\n className=\"quote-management-manage-negotiable-quote__detail-content\"\n data-testid=\"created-value\"\n >\n {formattedDate(quoteData!.createdAt, 'short')} (\n {quoteData!.buyer.firstname} {quoteData!.buyer.lastname})\n </span>\n </div>\n <div className=\"quote-management-manage-negotiable-quote__detail\">\n <span\n className=\"quote-management-manage-negotiable-quote__detail-title\"\n data-testid=\"sales-rep-label\"\n >\n {dictionary.salesRepLabel}\n </span>\n <span\n className=\"quote-management-manage-negotiable-quote__detail-content\"\n data-testid=\"sales-rep-value\"\n >\n {quoteData!.salesRepName}\n </span>\n </div>\n <div className=\"quote-management-manage-negotiable-quote__detail\">\n <span\n className=\"quote-management-manage-negotiable-quote__detail-title\"\n data-testid=\"expires-label\"\n >\n {dictionary.expiresLabel}\n </span>\n <span\n className=\"quote-management-manage-negotiable-quote__detail-content\"\n data-testid=\"expires-value\"\n >\n {expirationDate}\n </span>\n </div>\n </Slot>\n );\n }, [slots?.Details, dictionary, quoteData]);\n\n // Action bar\n const buttons: { label: string; value: string; disabled?: boolean }[] =\n useMemo(() => {\n return [\n {\n label: dictionary.close,\n value: 'close',\n disabled: !quoteData?.canClose,\n },\n {\n label: dictionary.delete,\n value: 'delete',\n disabled: !quoteData?.canDelete,\n },\n {\n label: dictionary.print,\n value: 'print',\n },\n {\n label: dictionary.createTemplate,\n value: 'createTemplate',\n disabled: Boolean(quoteData?.templateName),\n },\n {\n label: dictionary.createCopy,\n value: 'createCopy',\n disabled: Boolean(quoteData?.templateName),\n },\n ];\n }, [dictionary, quoteData?.canDelete, quoteData?.canClose, quoteData?.templateName]);\n const actionBar = useMemo(() => {\n const handleActionsButtonClick = (action: string) => {\n switch (action) {\n case 'close':\n setShowCloseModal(true);\n setModalErrorMessage(''); // Clear modal errors\n setModalSuccessMessage(''); // Clear modal success messages\n onActionsButtonClick?.(action);\n break;\n case 'delete':\n setIsDeleteDialogOpen(true);\n onActionsButtonClick?.(action);\n break;\n case 'print':\n onActionsButtonClick?.(action);\n break;\n case 'createTemplate':\n setShowCreateTemplateModal(true);\n setCreateTemplateErrorMessage(''); // Clear modal errors\n setCreateTemplateSuccessMessage(''); // Clear modal success messages\n onActionsButtonClick?.(action);\n break;\n case 'createCopy':\n handleDuplicateQuote();\n onActionsButtonClick?.(action);\n break;\n }\n };\n return (\n <Slot\n name=\"ActionBar\"\n slot={slots?.ActionBar}\n context={{ quoteData, actionsBarDropdownValue }}\n >\n <ActionsBar\n dropdownPlaceholder={dictionary.actionsLabel}\n dropdownOptions={[\n {\n label: dictionary.remove,\n value: 'remove',\n },\n ]}\n dropdownValue={actionsBarDropdownValue}\n handleDropdownChange={handleActionsDropdownChange}\n buttons={buttons.map((button) => (\n <Button\n key={button.value}\n variant=\"tertiary\"\n onClick={() => handleActionsButtonClick(button.value)}\n data-testid={`actions-bar-${button.value}-button`}\n data-action={button.value}\n disabled={button.disabled}\n >\n {button.label}\n </Button>\n ))}\n />\n </Slot>\n );\n }, [\n buttons,\n dictionary,\n slots?.ActionBar,\n quoteData,\n handleActionsDropdownChange,\n onActionsButtonClick,\n handleDuplicateQuote,\n actionsBarDropdownValue,\n ]);\n\n // Quote content\n const quoteContent = useMemo(() => {\n return (\n <Slot\n name=\"QuoteContent\"\n slot={slots?.QuoteContent}\n context={{ quoteData }}\n >\n <TabbedContent\n tabs={\n new Map([\n ['items-quoted', 'Items Quoted'],\n ['comments', 'Comments'],\n ['history-log', 'History Log'],\n ])\n }\n tabsContent={\n new Map([\n [\n 'items-quoted',\n <Slot\n key=\"items-quoted\"\n name=\"ItemsQuotedTab\"\n slot={slots?.ItemsQuotedTab}\n context={{ quoteData }}\n >\n <ItemsQuoted\n quoteData={quoteData}\n onItemCheckboxChange={handleItemCheckboxChange}\n onRemoveItemsRef={(handler) => {\n removeItemsHandlerRef.current = handler;\n }}\n onRemoveModalStateChange={\n /* istanbul ignore next */ (isOpen) => {\n if (\n !isOpen &&\n actionsBarDropdownValueRef.current === 'remove'\n ) {\n setActionsBarDropdownValue('');\n }\n }\n }\n />\n </Slot>,\n ],\n [\n 'comments',\n <Slot\n key=\"comments\"\n name=\"CommentsTab\"\n slot={slots?.CommentsTab}\n context={{ quoteData }}\n >\n <QuoteCommentsList quoteData={quoteData} />\n </Slot>,\n ],\n [\n 'history-log',\n <Slot\n key=\"history-log\"\n name=\"HistoryLogTab\"\n slot={slots?.HistoryLogTab}\n context={{ quoteData }}\n >\n <QuoteHistoryLog quoteData={quoteData} />\n </Slot>,\n ],\n ])\n }\n />\n </Slot>\n );\n }, [\n slots?.QuoteContent,\n slots?.HistoryLogTab,\n slots?.CommentsTab,\n slots?.ItemsQuotedTab,\n quoteData,\n handleItemCheckboxChange,\n ]);\n\n // Shipping information title\n const shippingInformationTitle = useMemo(() => {\n return (\n <Slot\n name=\"ShippingInformationTitle\"\n slot={slots?.ShippingInformationTitle}\n context={{ quoteData }}\n >\n <h2>{dictionary.shippingInformationTitle}</h2>\n </Slot>\n );\n }, [slots?.ShippingInformationTitle, quoteData, dictionary]);\n\n // Shipping information\n const shippingInformation = useMemo(() => {\n return (\n <Slot\n name=\"ShippingInformation\"\n slot={slots?.ShippingInformation}\n context={{ quoteData, loading, setLoading }}\n >\n <ShippingAddressDisplay\n shippingAddress={quoteData?.shippingAddresses?.[0]}\n loading={loading}\n data-testid=\"manage-quote-shipping-address\"\n />\n </Slot>\n );\n }, [slots?.ShippingInformation, quoteData, loading, setLoading]);\n\n // Quote comments title\n const quoteCommentsTitle = useMemo(() => {\n return (\n <Slot\n name=\"QuoteCommentsTitle\"\n slot={slots?.QuoteCommentsTitle}\n context={{ quoteData }}\n >\n <h2>{dictionary.quoteCommentsTitle}</h2>\n </Slot>\n );\n }, [slots?.QuoteCommentsTitle, dictionary, quoteData]);\n\n // Quote comments\n const quoteComments = useMemo(() => {\n return (\n <Slot\n name=\"QuoteComments\"\n slot={slots?.QuoteComments}\n context={{ quoteData }}\n >\n <TextArea\n name=\"quoteComments\"\n placeholder={dictionary.quoteCommentsPlaceholder}\n rows={3}\n value={comment}\n onInput={(e) => {\n setComment((e.target as HTMLTextAreaElement).value);\n }}\n disabled={!quoteData?.canSendForReview || isSubmitting}\n />\n </Slot>\n );\n }, [slots?.QuoteComments, dictionary, quoteData, comment, isSubmitting]);\n\n // File upload should be disabled when quote cannot be sent for review\n // (which already includes the status and permission checks from the transformer)\n const isFileUploadDisabled = useMemo(() => {\n return !quoteData?.canSendForReview;\n }, [quoteData]);\n\n // File upload input\n const attachFilesField = useMemo(() => {\n // Check if button should be visually disabled\n const isDisabled = isSubmitting || isFileUploadDisabled;\n\n return (\n <Slot\n name=\"AttachFilesField\"\n slot={slots?.AttachFilesField}\n context={{ onFileChange: handleAttachFiles, attachedFiles, fileUploadError, disabled: isDisabled }}\n >\n <div \n className=\"quote-management-manage-negotiable-quote__attach-files\"\n {...(isDisabled ? { 'data-disabled': true } : {})}\n aria-disabled={isDisabled}\n >\n <InputFile\n id=\"manage-quote-attach-files\"\n multiple\n onChange={(e: Event) => {\n const target = e.target as HTMLInputElement;\n const fileList = target?.files;\n const files = fileList ? Array.from(fileList) : [];\n if (files.length > 0) {\n void handleAttachFiles(files);\n }\n }}\n icon={<Add />}\n disabled={isDisabled}\n data-testid=\"manage-quote-attach-files\"\n accept={acceptedFileTypes?.join(',')}\n >\n {dictionary.attachFiles}\n </InputFile>\n {fileUploadError && (\n <div\n className=\"quote-management-manage-negotiable-quote__file-error\"\n data-testid=\"file-upload-error\"\n >\n {fileUploadError}\n </div>\n )}\n </div>\n </Slot>\n );\n }, [\n slots?.AttachFilesField,\n handleAttachFiles,\n isSubmitting,\n isFileUploadDisabled,\n acceptedFileTypes,\n fileUploadError,\n dictionary,\n attachedFiles,\n ]);\n\n // Attached files list\n const attachedFilesList = useMemo(() => {\n if (!attachedFiles.length) return undefined;\n\n return (\n <Slot\n name=\"AttachedFilesList\"\n slot={slots?.AttachedFilesList}\n context={{ files: attachedFiles, onRemove: handleRemoveFile, disabled: isSubmitting }}\n >\n <AttachedFilesList\n files={attachedFiles}\n onRemove={handleRemoveFile}\n disabled={isSubmitting}\n />\n </Slot>\n );\n }, [attachedFiles, handleRemoveFile, isSubmitting, slots?.AttachedFilesList]);\n\n // Close quote handler - only called when quoteData exists\n const handleCloseQuote = useCallback(async () => {\n if (!quoteData?.uid) {\n return;\n }\n setIsClosing(true);\n setModalErrorMessage('');\n setModalSuccessMessage('');\n try {\n await closeNegotiableQuote({\n quoteUids: [quoteData!.uid],\n });\n } catch (error) {\n console.error('Failed to close quote:', error);\n }\n }, [quoteData]);\n\n const handleCloseModalCancel = useCallback(() => {\n setShowCloseModal(false);\n setModalErrorMessage('');\n setModalSuccessMessage('');\n }, []);\n\n // Create template handler\n const handleCreateTemplate = useCallback(async () => {\n if (!quoteData?.uid) {\n return;\n }\n setIsCreatingTemplate(true);\n setCreateTemplateErrorMessage('');\n setCreateTemplateSuccessMessage('');\n try {\n await createQuoteTemplate(quoteData.uid);\n // Show success message\n setCreateTemplateSuccessMessage(dictionary.createTemplateSuccessMessage);\n // Close modal after a delay to show success message\n setTimeout(() => {\n setShowCreateTemplateModal(false);\n setCreateTemplateSuccessMessage('');\n }, 2000);\n } catch (error) {\n console.error('Failed to create quote template:', error);\n const errorMessage =\n error instanceof Error ? error.message : dictionary.createTemplateErrorFallback;\n setCreateTemplateErrorMessage(errorMessage);\n } finally {\n setIsCreatingTemplate(false);\n }\n }, [quoteData, dictionary.createTemplateSuccessMessage, dictionary.createTemplateErrorFallback]);\n\n const handleCreateTemplateModalCancel = useCallback(() => {\n setShowCreateTemplateModal(false);\n setCreateTemplateErrorMessage('');\n setCreateTemplateSuccessMessage('');\n }, []);\n\n // Footer\n const handleSendForReview = useCallback(async () => {\n const successfulAttachments = attachedFiles.filter(f => f.status === 'success');\n\n // If override prop is provided, use it instead of the API\n if (onSendForReview) {\n onSendForReview({\n quoteData: quoteData!,\n comment: comment.trim() || undefined,\n attachments: successfulAttachments.length ?\n successfulAttachments :\n undefined,\n });\n return;\n }\n\n // Otherwise, use the sendForReview API\n setIsSubmitting(true);\n try {\n await sendForReview({\n quoteUid: quoteData!.uid,\n comment: comment.trim() || undefined,\n attachments: successfulAttachments.length\n ? successfulAttachments.map(f => ({ key: f.key }))\n : undefined,\n });\n // The quote-sent-for-review event will handle updating state\n } catch (error) {\n console.error('Failed to send quote for review:', error);\n setIsSubmitting(false);\n // TODO: Show error notification to user\n }\n }, [quoteData, onSendForReview, comment, attachedFiles]);\n\n const footer = useMemo(() => {\n return (\n <Slot\n name=\"Footer\"\n slot={slots?.Footer}\n context={{ quoteData, comment, isSubmitting, attachments: attachedFiles, handleSendForReview }}\n >\n <Button\n variant=\"primary\"\n onClick={handleSendForReview}\n data-testid=\"send-for-review-button\"\n disabled={!quoteData?.canSendForReview || isSubmitting}\n >\n {dictionary.sendForReview}\n </Button>\n </Slot>\n );\n }, [\n slots?.Footer,\n dictionary,\n quoteData,\n comment,\n isSubmitting,\n attachedFiles,\n handleSendForReview,\n ]);\n\n // Rename modal error banner\n const renameErrorBanner = useMemo(\n () =>\n renameError ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled color=\"var(--color-error)\" />}\n heading={dictionary.renameErrorHeading}\n description={renameError}\n />\n ) : undefined,\n [renameError, dictionary.renameErrorHeading]\n );\n\n // Rename modal success banner\n const renameSuccessBanner = useMemo(\n () =>\n renameSuccess ? (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.renameSuccessHeading}\n description={renameSuccess}\n />\n ) : undefined,\n [renameSuccess, dictionary.renameSuccessHeading]\n );\n\n // Delete quote functionality\n const getDeleteErrorMessage = useCallback(\n (error: any): string => {\n // If it's an operation failure with errors array, get the first error message\n if (\n error.errors &&\n Array.isArray(error.errors) &&\n error.errors.length > 0\n ) {\n return (\n error.errors[0].message ||\n dictionary.confirmationModalDeleteErrorFallback\n );\n }\n // Otherwise use the error message or fallback\n return error?.message || dictionary.confirmationModalDeleteErrorFallback;\n },\n [dictionary.confirmationModalDeleteErrorFallback]\n );\n\n const handleDeleteCancel = useCallback(() => {\n setIsDeleteDialogOpen(false);\n setDeleteError(null);\n setDeleteSuccess(false);\n }, []);\n\n const handleDeleteConfirm = useCallback(async () => {\n if (!quoteData?.uid) {\n return;\n }\n\n setDeleteError(null);\n setDeleteSuccess(false);\n\n try {\n const { operationResults } = await deleteQuote(quoteData.uid);\n\n const failure = operationResults.find(\n (res: any) => res.__typename === 'DeleteNegotiableQuoteOperationFailure'\n ) as any;\n if (failure) {\n const errorMessage = getDeleteErrorMessage(failure);\n setDeleteError(errorMessage);\n return;\n }\n\n setDeleteSuccess(true);\n } catch (error: any) {\n const errorMessage = getDeleteErrorMessage(error);\n setDeleteError(errorMessage);\n }\n }, [quoteData, getDeleteErrorMessage]);\n\n const handleDismissError = useCallback(() => {\n setDeleteError(null);\n }, []);\n\n const handleDismissSuccess = useCallback(() => {\n setDeleteSuccess(false);\n }, []);\n\n // Duplicate quote functionality\n const getDuplicateErrorMessage = useCallback((error: any): string => {\n return error?.message || dictionary.confirmationModalDuplicateErrorFallback;\n }, [dictionary.confirmationModalDuplicateErrorFallback]);\n\n const handleDuplicateCancel = useCallback(() => {\n setIsDuplicateDialogOpen(false);\n setDuplicateError(null);\n setDuplicateSuccess(false);\n }, []);\n\n const handleDuplicateConfirm = useCallback(async () => {\n if (!quoteData?.uid) {\n return;\n }\n\n setDuplicateError(null);\n setDuplicateSuccess(false);\n\n try {\n // Check for out of stock items before duplication\n /* istanbul ignore next */\n const outOfStockItems = quoteData.items?.filter((item) => item.outOfStock) || [];\n\n // Generate a unique duplicated quote UID by replacing the last 8 characters\n const generateUniqueUid = (originalUid: string): string => {\n const baseUid = originalUid.slice(0, -8); // Remove last 8 characters\n const randomSuffix = crypto.randomUUID().slice(0, 8);\n return baseUid + randomSuffix;\n };\n \n const duplicatedQuoteUid = generateUniqueUid(quoteData.uid);\n\n // Store out of stock warning for the new quote if any items are out of stock\n const hasOutOfStockItems = outOfStockItems.length > 0;\n if (hasOutOfStockItems) {\n sessionStorage.setItem(`duplicate-outOfStock-warning-${duplicatedQuoteUid}`, 'true');\n }\n\n await duplicateQuote({ \n quoteUid: quoteData.uid, \n duplicatedQuoteUid,\n hasOutOfStockItems \n });\n // Success handling is done in the event listener\n } catch (error: any) {\n const errorMessage = getDuplicateErrorMessage(error);\n setDuplicateError(errorMessage);\n }\n }, [quoteData, getDuplicateErrorMessage]);\n\n const handleDismissDuplicateError = useCallback(() => {\n setDuplicateError(null);\n }, []);\n\n const handleDismissDuplicateSuccess = useCallback(() => {\n setDuplicateSuccess(false);\n }, []);\n\n const deleteErrorBanner = deleteError ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.confirmationModalDeleteErrorHeading}\n description={deleteError}\n onDismiss={handleDismissError}\n data-testid=\"confirmation-modal-error-banner\"\n />\n ) : null;\n\n const deleteSuccessBanner = deleteSuccess ? (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.confirmationModalDeleteSuccessHeading}\n description={dictionary.confirmationModalDeleteSuccessDescription}\n onDismiss={handleDismissSuccess}\n data-testid=\"confirmation-modal-success-banner\"\n />\n ) : null;\n\n const deleteBanner = deleteSuccessBanner || deleteErrorBanner;\n\n const duplicateErrorBanner = duplicateError ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.confirmationModalDuplicateErrorHeading}\n description={duplicateError}\n onDismiss={handleDismissDuplicateError}\n data-testid=\"confirmation-modal-duplicate-error-banner\"\n />\n ) : null;\n\n const duplicateSuccessBanner = duplicateSuccess ? (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.confirmationModalDuplicateSuccessHeading}\n description={dictionary.confirmationModalDuplicateSuccessDescription}\n onDismiss={handleDismissDuplicateSuccess}\n data-testid=\"confirmation-modal-duplicate-success-banner\"\n />\n ) : null;\n\n const duplicateBanner = duplicateSuccessBanner || duplicateErrorBanner;\n\n const manageNegotiableQuoteProps: ManageNegotiableQuoteComponentProps = {\n ...props,\n loading,\n quoteName,\n quoteStatus,\n banner: (outOfStockWarningBanner || banner) ? (<>{outOfStockWarningBanner}{banner}</>) : undefined,\n details,\n actionBar,\n quoteContent,\n shippingInformationTitle,\n shippingInformation,\n quoteCommentsTitle,\n quoteComments,\n attachFilesField,\n attachedFilesList,\n footer,\n };\n\n // Create banner for close modal based on success/error state\n let closeModalBanner = null;\n if (modalSuccessMessage) {\n closeModalBanner = (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.closeModalSuccessHeading}\n description={modalSuccessMessage}\n data-testid=\"close-quote-success-banner\"\n />\n );\n } else if (modalErrorMessage) {\n closeModalBanner = (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.confirmationModalDeleteErrorHeading}\n description={modalErrorMessage}\n data-testid=\"close-quote-error-banner\"\n />\n );\n }\n\n // Create banner for create template modal based on success/error state\n let createTemplateModalBanner = null;\n if (createTemplateSuccessMessage) {\n createTemplateModalBanner = (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.createTemplateModalSuccessHeading}\n description={createTemplateSuccessMessage}\n data-testid=\"create-template-success-banner\"\n />\n );\n } else if (createTemplateErrorMessage) {\n createTemplateModalBanner = (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.createTemplateModalErrorHeading}\n description={createTemplateErrorMessage}\n data-testid=\"create-template-error-banner\"\n />\n );\n }\n\n return (\n <>\n <ManageNegotiableQuoteComponent {...manageNegotiableQuoteProps} />\n {isRenameModalOpen &&\n createPortal(\n <RenameQuoteModal\n open={isRenameModalOpen}\n quoteName={renameQuoteName}\n renameReason={renameReason}\n quoteNameError={renameQuoteNameError}\n errorBanner={renameErrorBanner}\n successBanner={renameSuccessBanner}\n onQuoteNameChange={handleRenameQuoteNameChange}\n onRenameReasonChange={setRenameReason}\n onSave={handleRenameSave}\n onClose={handleRenameClose}\n />,\n document.body\n )}\n {isDeleteDialogOpen &&\n createPortal(\n <ConfirmationModal\n open={isDeleteDialogOpen}\n title={dictionary.confirmationModalDeleteTitle}\n message={dictionary.confirmationModalDeleteMessage}\n cancelLabel={dictionary.confirmationModalCancel}\n confirmLabel={dictionary.confirmationModalDeleteConfirm}\n onCancel={handleDeleteCancel}\n onConfirm={handleDeleteConfirm}\n showCloseButton={!deleteBanner}\n confirmationBanner={deleteBanner}\n />,\n document.body\n )}\n {isDuplicateDialogOpen &&\n createPortal(\n <ConfirmationModal\n open={isDuplicateDialogOpen}\n title={dictionary.confirmationModalDuplicateTitle}\n message={dictionary.confirmationModalDuplicateMessage}\n cancelLabel={dictionary.confirmationModalCancel}\n confirmLabel={dictionary.confirmationModalDuplicateConfirm}\n onCancel={handleDuplicateCancel}\n onConfirm={handleDuplicateConfirm}\n showCloseButton={!duplicateBanner}\n confirmationBanner={duplicateBanner}\n />,\n document.body\n )}\n {showCloseModal &&\n createPortal(\n <ConfirmationModal\n open={showCloseModal}\n title={dictionary.closeModalTitle}\n message={dictionary.closeModalMessage}\n cancelLabel={dictionary.closeModalCancel}\n confirmLabel={\n isClosing\n ? dictionary.closeModalConfirmLoading\n : dictionary.closeModalConfirm\n }\n onCancel={handleCloseModalCancel}\n onConfirm={isClosing ? undefined : handleCloseQuote}\n showCloseButton={true}\n confirmationBanner={closeModalBanner}\n data-testid=\"close-quote-confirmation-modal\"\n />,\n document.body\n )}\n {showCreateTemplateModal &&\n createPortal(\n <ConfirmationModal\n open={showCreateTemplateModal}\n title={dictionary.createTemplateModalTitle}\n message={dictionary.createTemplateModalMessage}\n cancelLabel={dictionary.createTemplateModalCancel}\n confirmLabel={\n isCreatingTemplate\n ? dictionary.createTemplateModalConfirmLoading\n : dictionary.createTemplateModalConfirm\n }\n onCancel={handleCreateTemplateModalCancel}\n onConfirm={isCreatingTemplate ? undefined : handleCreateTemplate}\n showCloseButton={true}\n confirmationBanner={createTemplateModalBanner}\n data-testid=\"create-template-confirmation-modal\"\n />,\n document.body\n )}\n {isNoItemsSelectedModalOpen &&\n createPortal(\n <ConfirmationModal\n open={isNoItemsSelectedModalOpen}\n title={dictionary.noItemsSelectedModalTitle}\n message={dictionary.noItemsSelectedModalMessage}\n confirmLabel={dictionary.noItemsSelectedModalConfirm}\n onConfirm={handleCloseNoItemsSelectedModal}\n onClose={handleCloseNoItemsSelectedModal}\n showCloseButton={true}\n data-testid=\"no-items-selected-modal\"\n />,\n document.body\n )}\n </>\n );\n};\n"],"names":["ManageNegotiableQuote","className","loading","quoteName","quoteStatus","banner","details","actionBar","quoteContent","shippingInformationTitle","shippingInformation","quoteCommentsTitle","quoteComments","attachFilesField","attachedFilesList","footer","props","ManageNegotiableQuoteSkeleton","jsxs","classes","jsx","VComponent","Skeleton","SkeletonRow","onActionsDropdownChange","slots","onActionsButtonClick","onSendForReview","maxFiles","maxFileSize","acceptedFileTypes","onDuplicateQuote","quoteData","setQuoteData","useState","setLoading","isDeleteDialogOpen","setIsDeleteDialogOpen","deleteError","setDeleteError","deleteSuccess","setDeleteSuccess","isDuplicateDialogOpen","setIsDuplicateDialogOpen","duplicateError","setDuplicateError","duplicateSuccess","setDuplicateSuccess","duplicateOutOfStockWarning","setDuplicateOutOfStockWarning","comment","setComment","isSubmitting","setIsSubmitting","showCloseModal","setShowCloseModal","isClosing","setIsClosing","modalSuccessMessage","setModalSuccessMessage","modalErrorMessage","setModalErrorMessage","showCreateTemplateModal","setShowCreateTemplateModal","isCreatingTemplate","setIsCreatingTemplate","createTemplateSuccessMessage","setCreateTemplateSuccessMessage","createTemplateErrorMessage","setCreateTemplateErrorMessage","isRenameModalOpen","setIsRenameModalOpen","renameQuoteName","setRenameQuoteName","renameReason","setRenameReason","renameError","setRenameError","renameQuoteNameError","setRenameQuoteNameError","renameSuccess","setRenameSuccess","attachedFiles","setAttachedFiles","fileUploadError","setFileUploadError","selectedItemUids","setSelectedItemUids","selectedItemUidsRef","useRef","removeItemsHandlerRef","actionsBarDropdownValue","setActionsBarDropdownValue","actionsBarDropdownValueRef","isNoItemsSelectedModalOpen","setIsNoItemsSelectedModalOpen","useEffect","dictionary","useText","quoteDataEvent","events","data","quote","pendingWarningKey","shippingAddressSetEvent","quoteSentForReviewEvent","quoteItemsRemovedEvent","removedItemUids","prev","next","uid","handleItemCheckboxChange","useCallback","item","isSelected","handleActionsDropdownChange","event","action","currentSelectedUids","itemsToRemove","handleCloseNoItemsSelectedModal","quoteClosedEvent","currentQuoteData","_a","getQuoteData","updatedQuoteData","error","quoteCloseErrorEvent","errorMsg","quoteRenamedEvent","quoteDuplicatedEvent","newQuote","handleAttachFiles","files","file","validateFileSize","formatFileSize","validateFileType","newFiles","i","tempKey","result","uploadFile","f","handleRemoveFile","key","handleRenameClick","handleRenameClose","handleRenameQuoteNameChange","value","handleDuplicateQuote","handleRenameSave","renameNegotiableQuote","useMemo","isLocked","Slot","Edit","bannerMessage","status","bannerContent","InLineAlert","WarningFilled","handleDismissOutOfStockWarning","outOfStockWarningBanner","expirationDate","formattedDate","buttons","handleActionsButtonClick","ActionsBar","button","Button","TabbedContent","ItemsQuoted","handler","isOpen","QuoteCommentsList","QuoteHistoryLog","ShippingAddressDisplay","TextArea","e","isFileUploadDisabled","isDisabled","InputFile","target","fileList","Add","AttachedFilesList","handleCloseQuote","closeNegotiableQuote","handleCloseModalCancel","handleCreateTemplate","createQuoteTemplate","errorMessage","handleCreateTemplateModalCancel","handleSendForReview","successfulAttachments","sendForReview","renameErrorBanner","renameSuccessBanner","CheckWithCircle","getDeleteErrorMessage","handleDeleteCancel","handleDeleteConfirm","operationResults","deleteQuote","failure","res","handleDismissError","handleDismissSuccess","getDuplicateErrorMessage","handleDuplicateCancel","handleDuplicateConfirm","outOfStockItems","duplicatedQuoteUid","originalUid","baseUid","randomSuffix","hasOutOfStockItems","duplicateQuote","handleDismissDuplicateError","handleDismissDuplicateSuccess","deleteErrorBanner","deleteBanner","duplicateErrorBanner","duplicateBanner","manageNegotiableQuoteProps","Fragment","closeModalBanner","createTemplateModalBanner","ManageNegotiableQuoteComponent","createPortal","RenameQuoteModal","ConfirmationModal"],"mappings":"0yDAgCO,MAAMA,GAAuE,CAAC,CACnF,UAAAC,EACA,QAAAC,EACA,UAAAC,EACA,YAAAC,EACA,OAAAC,EACA,QAAAC,EACA,UAAAC,EACA,aAAAC,EACA,yBAAAC,EACA,oBAAAC,EACA,mBAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,kBAAAC,EACA,OAAAC,EACA,GAAGC,CACL,IACMd,IACMe,GAAA,EAA8B,EAItCC,EAAC,MAAA,CAAK,GAAGF,EAAO,UAAWG,EAAQ,CAAC,2CAA4ClB,CAAS,CAAC,EACxF,SAAA,CAAAiB,EAAC,OAAI,UAAWC,EAAQ,CAAC,kDAAkD,CAAC,EACzE,SAAA,CAAAhB,GACCiB,EAACC,EAAA,CACC,KAAMlB,EACN,UAAWgB,EAAQ,CAAC,sDAAsD,CAAC,CAAA,CAAA,EAG9Ef,GACCgB,EAACC,EAAA,CACC,KAAMjB,EACN,UAAWe,EAAQ,CAAC,wDAAwD,CAAC,CAAA,CAAA,CAC/E,EAEJ,EACCd,GACCe,EAACC,EAAA,CACC,KAAMhB,EACN,UAAWc,EAAQ,CAAC,kDAAkD,CAAC,CAAA,CAAA,EAG1Eb,GACCc,EAACC,EAAA,CACC,KAAMf,EACN,UAAWa,EAAQ,CAAC,mDAAmD,CAAC,CAAA,CAAA,EAG3EZ,GACCa,EAACC,EAAA,CACC,KAAMd,EACN,UAAWY,EAAQ,CAAC,sDAAsD,CAAC,CAAA,CAAA,EAG9EX,GACCY,EAACC,EAAA,CACC,KAAMb,EACN,UAAWW,EAAQ,CAAC,yDAAyD,CAAC,CAAA,CAAA,EAGlFD,EAAC,OAAI,cAAY,uCAAuC,UAAWC,EAAQ,CAAC,0EAA0E,CAAC,EACpJ,SAA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A,EAAW,0BACxB,aACEjC,GACIiC,EAAW,kCACXA,EAAW,2BAEjB,SAAUgG,GACV,UAAWjI,GAAqB,OAAY8H,GAC5C,gBAAiB,GACjB,mBAAoBsC,GACpB,cAAY,oCAAA,CAAA,EAEd,SAAS,IAAA,EAEZtI,IACCwI,EACElN,EAACoN,EAAA,CACC,KAAM1I,GACN,MAAOG,EAAW,0BAClB,QAASA,EAAW,4BACpB,aAAcA,EAAW,4BACzB,UAAWuB,GACX,QAASA,GACT,gBAAiB,GACjB,cAAY,yBAAA,CAAA,EAEd,SAAS,IAAA,CACX,EACJ,CAEJ"}
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@dropins/storefront-quote-management", "version": "1.0.0-beta5", "@dropins/tools": "1.6.0-beta3", "license": "SEE LICENSE IN LICENSE.md"}
1
+ {"name": "@dropins/storefront-quote-management", "version": "1.0.0-beta6", "@dropins/tools": "1.6.0-beta3", "license": "SEE LICENSE IN LICENSE.md"}