@dropins/storefront-product-discovery 2.1.0 → 3.0.0-beta1

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,12 +1,12 @@
1
- Last Updated: 25 April 2025
1
+ Last Updated: 8 December 2025
2
2
 
3
- ADOBE COMMERCE DROP-IN LICENSE AGREEMENT
3
+ **ADOBE COMMERCE DROP-IN LICENSE AGREEMENT**
4
4
 
5
- applicable to Adobe Commerce Customers
5
+ applicable to Adobe Commerce as a Cloud Service and Adobe Commerce Optimizer Customers
6
6
 
7
7
  **Effective Date:** first date you download or use the Drop-in
8
8
 
9
- 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.
10
10
 
11
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.
12
12
 
@@ -14,7 +14,7 @@ By downloading, installing or making use of any portion of the Drop-in, you acce
14
14
 
15
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).
16
16
 
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.
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.
18
18
 
19
19
  **ADOBE COMMERCE DROP-IN LICENSE AGREEMENT**
20
20
 
@@ -22,21 +22,21 @@ applicable to Developers
22
22
 
23
23
  **Effective Date:** first date you download or use the Drop-in
24
24
 
25
- 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.
26
26
 
27
27
  **AGREED TERMS AND CONDITIONS**
28
28
 
29
29
  1. **DEFINITIONS**.
30
30
 
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**”).__
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**").
32
32
 
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.
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.
34
34
 
35
- 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.
36
36
 
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.
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.
38
38
 
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.
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.
40
40
 
41
41
  2. **LICENSES GRANTED TO YOU**.
42
42
 
@@ -50,23 +50,23 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
50
50
 
51
51
  3. **SCOPE OF LICENSE; LIMITATIONS AND RESTRICTIONS**
52
52
 
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 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.
54
54
 
55
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
56
56
 
57
57
  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.
58
58
 
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 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.
60
60
 
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 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.
62
62
 
63
63
  4. **VIRAL OPEN SOURCE SOFTWARE AND SERVICES**
64
64
 
65
- 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 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.
66
66
 
67
67
  5. **NON-BLOCKING OF ADOBE DEVELOPMENT**
68
68
 
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 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.
70
70
 
71
71
  6. **OWNERSHIP; INTELLECTUAL PROPERTY RIGHTS**
72
72
 
@@ -74,13 +74,13 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
74
74
 
75
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.
76
76
 
77
- 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_.
78
78
 
79
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.
80
80
 
81
81
  7. **CONFIDENTIAL INFORMATION**
82
82
 
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.
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.
84
84
 
85
85
  8. **TERM; TERMINATION**
86
86
 
@@ -90,13 +90,13 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
90
90
 
91
91
  You expressly understand and agree that, to the maximum extent permitted by applicable law:
92
92
 
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.**
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.**
94
94
 
95
- 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.**
96
96
 
97
97
  10. **INDEMNIFICATION**
98
98
 
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.
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.
100
100
 
101
101
  11. **DISPUTE RESOLUTION**
102
102
 
@@ -104,7 +104,7 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
104
104
 
105
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.
106
106
 
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.
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.
108
108
 
109
109
  12. **EXPORT RULES**
110
110
 
@@ -112,7 +112,7 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
112
112
 
113
113
  13. **NOTICE TO U.S. GOVERNMENT END USERS**
114
114
 
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.
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.
116
116
 
117
117
  14. **GENERAL PROVISIONS**
118
118
 
@@ -124,4 +124,4 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
124
124
 
125
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.
126
126
 
127
- Adobe Commerce Drop-in License Agreement_en_US-20250425_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
- const f="searchInputContext",C="searchResultsContext",w="livesearch-plp",N="livesearch-popover",_="search-product-click",I="search-request-sent",b="search-response-received",T="search-results-view",i="category-results-view",y="channelContext";function g(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function R(s){const t=g();return t.getState?t.getState(s):{}}function S(s,t){const n=g();n.push({[s]:null}),n.push({[s]:t})}function x(){return{_id:"https://ns.adobe.com/xdm/channels/web",_type:"https://ns.adobe.com/xdm/channel-types/web"}}function l(){S(y,x())}function h(s,t){g().push(c=>{const e=c.getState?c.getState():{};c.push({event:s,eventInfo:{...e,...t}})})}const v=s=>{l(),h(I,{searchUnitId:s})},P=s=>{l(),h(b,{searchUnitId:s})},A=s=>{h(i,{searchUnitId:s})},k=s=>{h(T,{searchUnitId:s})},H=(s,t)=>{h(_,{sku:s,searchUnitId:t})},O=(s,t,n,c,e,o,r)=>{if(!g)return;const a=R(f)||{};a!=null&&a.units||(a.units=[]);const u={searchUnitId:s,searchRequestId:t,queryTypes:["products","suggestions"],phrase:n,pageSize:e,currentPage:o,filter:c,sort:r},d=a.units.findIndex(E=>E.searchUnitId===s);d<0?a.units.push(u):a.units[d]=u,S(f,a)},V=(s,t,n)=>{var p,a;if(!g)return;const e=R(C)||{};e!=null&&e.units||(e.units=[]);const o=e.units.findIndex(u=>u.searchUnitId===s),r={searchUnitId:s,searchRequestId:t,products:L(n.items),categories:[],suggestions:D(n.suggestions),page:((p=n==null?void 0:n.pageInfo)==null?void 0:p.currentPage)||1,perPage:((a=n==null?void 0:n.pageInfo)==null?void 0:a.pageSize)||20,facets:U(n.facets)};o<0?e.units.push(r):e.units[o]=r,S(C,e)},L=s=>s?s.map((n,c)=>{var e,o,r,p,a,u,d,E;return{name:n==null?void 0:n.name,sku:n==null?void 0:n.sku,url:(n==null?void 0:n.url)??"",imageUrl:((e=n==null?void 0:n.images[0])==null?void 0:e.url)??"",price:((p=(r=(o=n==null?void 0:n.price)==null?void 0:o.final)==null?void 0:r.amount)==null?void 0:p.value)??((E=(d=(u=(a=n==null?void 0:n.priceRange)==null?void 0:a.minimum)==null?void 0:u.regular)==null?void 0:d.amount)==null?void 0:E.value),rank:c}}):[],D=s=>s?s.map((n,c)=>({suggestion:n,rank:c})):[],U=s=>s?s.map(n=>({attribute:n==null?void 0:n.attribute,title:n==null?void 0:n.title,type:(n==null?void 0:n.type)||"PINNED",buckets:n==null?void 0:n.buckets.map(c=>c)})):[];export{w as P,N as S,H as a,v as b,A as c,V as d,P as e,k as s,O as u};
3
+ const f="searchInputContext",C="searchResultsContext",w="livesearch-plp",N="livesearch-popover",_="search-product-click",I="search-request-sent",b="search-response-received",T="search-results-view",i="category-results-view",y="channelContext";function g(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function R(s){const t=g();return t.getState?t.getState(s):{}}function S(s,t){const n=g();n.push({[s]:null}),n.push({[s]:t})}function x(){return{_id:"https://ns.adobe.com/xdm/channels/web",_type:"https://ns.adobe.com/xdm/channel-types/web"}}function l(){S(y,x())}function h(s,t){g().push(c=>{const e=c.getState?c.getState():{};c.push({event:s,eventInfo:{...e,...t}})})}const v=s=>{l(),h(I,{searchUnitId:s})},P=s=>{l(),h(b,{searchUnitId:s})},A=s=>{h(i,{searchUnitId:s})},k=s=>{h(T,{searchUnitId:s})},H=(s,t)=>{h(_,{sku:s,searchUnitId:t})},O=(s,t,n,c,e,o,r)=>{if(!g)return;const a=R(f)||{};a!=null&&a.units||(a.units=[]);const u={searchUnitId:s,searchRequestId:t,queryTypes:["products","suggestions"],phrase:n,pageSize:e,currentPage:o,filter:c,sort:r},d=a.units.findIndex(E=>E.searchUnitId===s);d<0?a.units.push(u):a.units[d]=u,S(f,a)},V=(s,t,n)=>{var p,a;if(!g)return;const e=R(C)||{};e!=null&&e.units||(e.units=[]);const o=e.units.findIndex(u=>u.searchUnitId===s),r={searchUnitId:s,searchRequestId:t,products:L(n.items),categories:[],suggestions:D(n.suggestions),page:((p=n==null?void 0:n.pageInfo)==null?void 0:p.currentPage)||1,perPage:((a=n==null?void 0:n.pageInfo)==null?void 0:a.pageSize)||20,facets:U(n.facets)};o<0?e.units.push(r):e.units[o]=r,S(C,e)},L=s=>s?s.map((n,c)=>{var e,o,r,p,a,u,d,E;return{name:n==null?void 0:n.name,sku:n==null?void 0:n.sku,url:(n==null?void 0:n.url)??"",imageUrl:((e=n==null?void 0:n.images[0])==null?void 0:e.url)??"",price:((p=(r=(o=n==null?void 0:n.price)==null?void 0:o.final)==null?void 0:r.amount)==null?void 0:p.value)??((E=(d=(u=(a=n==null?void 0:n.priceRange)==null?void 0:a.minimum)==null?void 0:u.regular)==null?void 0:d.amount)==null?void 0:E.value),rank:c}}):[],D=s=>s?s.map((n,c)=>({suggestion:n,rank:c})):[],U=s=>s?s.map(n=>({attribute:n==null?void 0:n.attribute,title:n==null?void 0:n.title,type:(n==null?void 0:n.type)||"PINNED",buckets:n==null?void 0:n.buckets.map(c=>c)})):[];export{w as P,N as S,V as a,P as b,k as c,A as d,H as e,v as s,O as u};
4
4
  //# sourceMappingURL=acdlEvents.js.map
package/chunks/search.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{merge as ee}from"@dropins/tools/lib.js";import{c as re}from"./initialize.js";import{events as p}from"@dropins/tools/event-bus.js";import{ProductView as ne,Facet as ie}from"../fragments.js";import{S as oe,P as se,u as ue,b as le,d as te,e as ce}from"./acdlEvents.js";import{FetchGraphQL as me}from"@dropins/tools/fetch-graphql.js";const{setEndpoint:be,setFetchGraphQlHeader:Se,removeFetchGraphQlHeader:xe,setFetchGraphQlHeaders:$e,getFetchGraphQlHeader:ke,fetchGraphQl:pe,getConfig:Fe}=new me().getMethods(),ge=e=>{var r,o,n,s,t,l,u,g,f,c,h,m,_,P,v,I,w,C,b,S,x,$,k,F,D,T,z,A,Q,E,G,U,H,K,M,O,L,N,Y,j,B,J,W,X,Z,q,V,y,a;if(!e)return{id:"",name:"",sku:"",shortDescription:"",url:"",urlKey:"",metaTitle:"",metaKeywords:"",metaDescription:"",lowStock:!1,links:[],images:[],description:"",externalId:"",inputOptions:[],addToCartAllowed:!1,price:void 0,priceRange:void 0,inStock:!1,typename:""};const i={id:(e==null?void 0:e.id)||"",name:(e==null?void 0:e.name)||"",sku:(e==null?void 0:e.sku)||"",shortDescription:(e==null?void 0:e.shortDescription)||"",url:(e==null?void 0:e.url)||"",urlKey:(e==null?void 0:e.urlKey)||"",metaTitle:(e==null?void 0:e.metaTitle)||"",metaKeywords:(e==null?void 0:e.metaKeywords)||"",metaDescription:(e==null?void 0:e.metaDescription)||"",lowStock:(e==null?void 0:e.lowStock)||!1,links:(e==null?void 0:e.links)||[],images:((r=e==null?void 0:e.images)==null?void 0:r.map(R=>{var d;return{label:R.label||"",roles:R.roles||[],url:((d=R.url)==null?void 0:d.replace(/^https?:\/\//,"//"))||""}}))||[],description:(e==null?void 0:e.description)||"",externalId:(e==null?void 0:e.externalId)||"",inputOptions:(e==null?void 0:e.inputOptions)||[],addToCartAllowed:(e==null?void 0:e.addToCartAllowed)||!1,price:e.price?{final:{amount:{value:((s=(n=(o=e==null?void 0:e.price)==null?void 0:o.final)==null?void 0:n.amount)==null?void 0:s.value)||0,currency:((u=(l=(t=e==null?void 0:e.price)==null?void 0:t.final)==null?void 0:l.amount)==null?void 0:u.currency)||""}},regular:{amount:{value:((c=(f=(g=e==null?void 0:e.price)==null?void 0:g.regular)==null?void 0:f.amount)==null?void 0:c.value)||0,currency:((_=(m=(h=e==null?void 0:e.price)==null?void 0:h.regular)==null?void 0:m.amount)==null?void 0:_.currency)||""}},roles:((P=e==null?void 0:e.price)==null?void 0:P.roles)||[]}:void 0,priceRange:e!=null&&e.priceRange?{minimum:{final:{amount:{value:((C=(w=(I=(v=e==null?void 0:e.priceRange)==null?void 0:v.minimum)==null?void 0:I.final)==null?void 0:w.amount)==null?void 0:C.value)||0,currency:(($=(x=(S=(b=e==null?void 0:e.priceRange)==null?void 0:b.minimum)==null?void 0:S.final)==null?void 0:x.amount)==null?void 0:$.currency)||""}},regular:{amount:{value:((T=(D=(F=(k=e==null?void 0:e.priceRange)==null?void 0:k.minimum)==null?void 0:F.regular)==null?void 0:D.amount)==null?void 0:T.value)||0,currency:((E=(Q=(A=(z=e==null?void 0:e.priceRange)==null?void 0:z.minimum)==null?void 0:A.regular)==null?void 0:Q.amount)==null?void 0:E.currency)||""}}},maximum:{final:{amount:{value:((K=(H=(U=(G=e==null?void 0:e.priceRange)==null?void 0:G.maximum)==null?void 0:U.final)==null?void 0:H.amount)==null?void 0:K.value)||0,currency:((N=(L=(O=(M=e==null?void 0:e.priceRange)==null?void 0:M.maximum)==null?void 0:O.final)==null?void 0:L.amount)==null?void 0:N.currency)||""}},regular:{amount:{value:((J=(B=(j=(Y=e==null?void 0:e.priceRange)==null?void 0:Y.maximum)==null?void 0:j.regular)==null?void 0:B.amount)==null?void 0:J.value)||0,currency:((q=(Z=(X=(W=e==null?void 0:e.priceRange)==null?void 0:W.maximum)==null?void 0:X.regular)==null?void 0:Z.amount)==null?void 0:q.currency)||""}}}}:void 0,inStock:(e==null?void 0:e.inStock)||!1,typename:(e==null?void 0:e.__typename)||""};return ee(i,(a=(y=(V=re.getConfig().models)==null?void 0:V.Product)==null?void 0:y.transformer)==null?void 0:a.call(y,e))};function fe(e,i){var n,s,t,l,u,g,f,c,h;const r=e==null?void 0:e.productSearch,o={facets:ye((r==null?void 0:r.facets)||[],i),items:(r==null?void 0:r.items.map(m=>ge(m==null?void 0:m.productView)))||[],pageInfo:{currentPage:((n=r==null?void 0:r.page_info)==null?void 0:n.current_page)||1,totalPages:((s=r==null?void 0:r.page_info)==null?void 0:s.total_pages)||1,totalItems:((t=r==null?void 0:r.page_info)==null?void 0:t.total_items)||0,pageSize:((l=r==null?void 0:r.page_info)==null?void 0:l.page_size)||10},totalCount:(r==null?void 0:r.total_count)||0,metadata:{filterableAttributes:((u=e==null?void 0:e.attributeMetadata)==null?void 0:u.filterableInSearch)||[],sortableAttributes:he(((g=e==null?void 0:e.attributeMetadata)==null?void 0:g.sortable)||[],i)}};return ee(o,(h=(c=(f=re.getConfig().models)==null?void 0:f.ProductSearchResult)==null?void 0:c.transformer)==null?void 0:h.call(c,e))}function he(e=[],i){return!e||e.length===0?[]:e.filter(r=>{var o;return r.attribute==="position"?(o=i==null?void 0:i.filter)==null?void 0:o.some(s=>s.attribute==="categoryPath"):!0}).map(r=>({...r,bidirectional:r.attribute==="price"}))}function ye(e=[],i){var o;return!e||e.length===0?[]:((o=i==null?void 0:i.filter)==null?void 0:o.some(n=>n.attribute==="categoryPath"))?e.filter(n=>n.attribute!=="categories"):e}const Re=`
3
+ import{merge as ee}from"@dropins/tools/lib.js";import{c as re}from"./initialize.js";import{events as p}from"@dropins/tools/event-bus.js";import{ProductView as ne,Facet as ie}from"../fragments.js";import{S as oe,P as se,u as ue,s as le,a as te,b as ce}from"./acdlEvents.js";import{FetchGraphQL as me}from"@dropins/tools/fetch-graphql.js";const{setEndpoint:be,setFetchGraphQlHeader:Se,removeFetchGraphQlHeader:xe,setFetchGraphQlHeaders:$e,getFetchGraphQlHeader:ke,fetchGraphQl:pe,getConfig:Fe}=new me().getMethods(),ge=e=>{var r,o,n,s,t,l,u,g,f,c,h,m,_,P,v,I,w,C,b,S,x,$,k,F,D,T,z,A,Q,E,G,U,H,K,M,O,L,N,Y,j,B,J,W,X,Z,q,V,y,a;if(!e)return{id:"",name:"",sku:"",shortDescription:"",url:"",urlKey:"",metaTitle:"",metaKeywords:"",metaDescription:"",lowStock:!1,links:[],images:[],description:"",externalId:"",inputOptions:[],addToCartAllowed:!1,price:void 0,priceRange:void 0,inStock:!1,typename:""};const i={id:(e==null?void 0:e.id)||"",name:(e==null?void 0:e.name)||"",sku:(e==null?void 0:e.sku)||"",shortDescription:(e==null?void 0:e.shortDescription)||"",url:(e==null?void 0:e.url)||"",urlKey:(e==null?void 0:e.urlKey)||"",metaTitle:(e==null?void 0:e.metaTitle)||"",metaKeywords:(e==null?void 0:e.metaKeywords)||"",metaDescription:(e==null?void 0:e.metaDescription)||"",lowStock:(e==null?void 0:e.lowStock)||!1,links:(e==null?void 0:e.links)||[],images:((r=e==null?void 0:e.images)==null?void 0:r.map(R=>{var d;return{label:R.label||"",roles:R.roles||[],url:((d=R.url)==null?void 0:d.replace(/^https?:\/\//,"//"))||""}}))||[],description:(e==null?void 0:e.description)||"",externalId:(e==null?void 0:e.externalId)||"",inputOptions:(e==null?void 0:e.inputOptions)||[],addToCartAllowed:(e==null?void 0:e.addToCartAllowed)||!1,price:e.price?{final:{amount:{value:((s=(n=(o=e==null?void 0:e.price)==null?void 0:o.final)==null?void 0:n.amount)==null?void 0:s.value)||0,currency:((u=(l=(t=e==null?void 0:e.price)==null?void 0:t.final)==null?void 0:l.amount)==null?void 0:u.currency)||""}},regular:{amount:{value:((c=(f=(g=e==null?void 0:e.price)==null?void 0:g.regular)==null?void 0:f.amount)==null?void 0:c.value)||0,currency:((_=(m=(h=e==null?void 0:e.price)==null?void 0:h.regular)==null?void 0:m.amount)==null?void 0:_.currency)||""}},roles:((P=e==null?void 0:e.price)==null?void 0:P.roles)||[]}:void 0,priceRange:e!=null&&e.priceRange?{minimum:{final:{amount:{value:((C=(w=(I=(v=e==null?void 0:e.priceRange)==null?void 0:v.minimum)==null?void 0:I.final)==null?void 0:w.amount)==null?void 0:C.value)||0,currency:(($=(x=(S=(b=e==null?void 0:e.priceRange)==null?void 0:b.minimum)==null?void 0:S.final)==null?void 0:x.amount)==null?void 0:$.currency)||""}},regular:{amount:{value:((T=(D=(F=(k=e==null?void 0:e.priceRange)==null?void 0:k.minimum)==null?void 0:F.regular)==null?void 0:D.amount)==null?void 0:T.value)||0,currency:((E=(Q=(A=(z=e==null?void 0:e.priceRange)==null?void 0:z.minimum)==null?void 0:A.regular)==null?void 0:Q.amount)==null?void 0:E.currency)||""}}},maximum:{final:{amount:{value:((K=(H=(U=(G=e==null?void 0:e.priceRange)==null?void 0:G.maximum)==null?void 0:U.final)==null?void 0:H.amount)==null?void 0:K.value)||0,currency:((N=(L=(O=(M=e==null?void 0:e.priceRange)==null?void 0:M.maximum)==null?void 0:O.final)==null?void 0:L.amount)==null?void 0:N.currency)||""}},regular:{amount:{value:((J=(B=(j=(Y=e==null?void 0:e.priceRange)==null?void 0:Y.maximum)==null?void 0:j.regular)==null?void 0:B.amount)==null?void 0:J.value)||0,currency:((q=(Z=(X=(W=e==null?void 0:e.priceRange)==null?void 0:W.maximum)==null?void 0:X.regular)==null?void 0:Z.amount)==null?void 0:q.currency)||""}}}}:void 0,inStock:(e==null?void 0:e.inStock)||!1,typename:(e==null?void 0:e.__typename)||""};return ee(i,(a=(y=(V=re.getConfig().models)==null?void 0:V.Product)==null?void 0:y.transformer)==null?void 0:a.call(y,e))};function fe(e,i){var n,s,t,l,u,g,f,c,h;const r=e==null?void 0:e.productSearch,o={facets:ye((r==null?void 0:r.facets)||[],i),items:(r==null?void 0:r.items.map(m=>ge(m==null?void 0:m.productView)))||[],pageInfo:{currentPage:((n=r==null?void 0:r.page_info)==null?void 0:n.current_page)||1,totalPages:((s=r==null?void 0:r.page_info)==null?void 0:s.total_pages)||1,totalItems:((t=r==null?void 0:r.page_info)==null?void 0:t.total_items)||0,pageSize:((l=r==null?void 0:r.page_info)==null?void 0:l.page_size)||10},totalCount:(r==null?void 0:r.total_count)||0,metadata:{filterableAttributes:((u=e==null?void 0:e.attributeMetadata)==null?void 0:u.filterableInSearch)||[],sortableAttributes:he(((g=e==null?void 0:e.attributeMetadata)==null?void 0:g.sortable)||[],i)}};return ee(o,(h=(c=(f=re.getConfig().models)==null?void 0:f.ProductSearchResult)==null?void 0:c.transformer)==null?void 0:h.call(c,e))}function he(e=[],i){return!e||e.length===0?[]:e.filter(r=>{var o;return r.attribute==="position"?(o=i==null?void 0:i.filter)==null?void 0:o.some(s=>s.attribute==="categoryPath"):!0}).map(r=>({...r,bidirectional:r.attribute==="price"}))}function ye(e=[],i){var o;return!e||e.length===0?[]:((o=i==null?void 0:i.filter)==null?void 0:o.some(n=>n.attribute==="categoryPath"))?e.filter(n=>n.attribute!=="categories"):e}const Re=`
4
4
  query productSearch(
5
5
  $phrase: String!
6
6
  $pageSize: Int
@@ -0,0 +1,6 @@
1
+ import { Product } from '../../data/models/product';
2
+
3
+ export declare const ComplexProductPrice: ({ product }: {
4
+ product: Product;
5
+ }) => import("preact").JSX.Element;
6
+ //# sourceMappingURL=ComplexProductPrice.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { Product } from '../../data/models/product';
2
+
3
+ export declare const SimpleProductPrice: ({ product }: {
4
+ product: Product;
5
+ }) => import("preact").JSX.Element;
6
+ //# sourceMappingURL=SimpleProductPrice.d.ts.map
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{jsxs as Z,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import*as d from"@dropins/tools/preact-compat.js";import{useState as v,useEffect as q}from"@dropins/tools/preact-compat.js";import{VComponent as G,classes as J,Slot as h}from"@dropins/tools/lib.js";import{events as y}from"@dropins/tools/event-bus.js";import{InLineAlert as K,Icon as Q,ProductItemCard as k,PriceRange as R,Image as W}from"@dropins/tools/components.js";/* empty css */import{s as X,c as Y,a as $,S as ee,P as re}from"../chunks/acdlEvents.js";import{useText as ne}from"@dropins/tools/i18n.js";const S=a=>new DOMParser().parseFromString(a,"text/html").documentElement.textContent,C=({productList:a,header:s,footer:r,imageWidth:g,imageHeight:f})=>Z("div",{className:"product-discovery-product-list",style:{"--imageWidth":g,"--imageHeight":f},children:[s&&n("div",{className:"product-discovery-product-list__header",children:s}),n("div",{className:"product-discovery-product-list__grid",children:a&&n(G,{node:a})}),r&&n("div",{className:"product-discovery-product-list__footer",children:r})]}),te=a=>d.createElement("svg",{id:"Icon_Warning_Base",width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},d.createElement("g",{clipPath:"url(#clip0_841_1324)"},d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),d.createElement("defs",null,d.createElement("clipPath",{id:"clip0_841_1324"},d.createElement("rect",{width:24,height:21,fill:"white",transform:"translate(0 1.5)"})))),ae=({alertMessage:a=""})=>n("div",{className:J(["product-discovery-search-alert-message__wrapper"]),children:n("div",{className:"product-discovery-search-alert-message__content",children:n(K,{heading:a,type:"warning",icon:n(Q,{source:te,size:"24"}),onDismiss:void 0})})}),ge=({routeProduct:a,scope:s,slots:r,imageWidth:g=400,imageHeight:f=450,skeletonCount:E=8,onSearchResult:_})=>{const w=s==="popover"?ee:re,L=ne({noResults:"Search.PLP.noResults",searchError:"Search.PLP.searchError"}),[u,A]=v(null),[x,V]=v([]),[H,U]=v(!1),[P,I]=v(null);q(()=>{const e=y.on("search/loading",U,{eager:!0,scope:s}),t=y.on("search/error",()=>{I(L.searchError)},{eager:!0,scope:s}),c=y.on("search/result",i=>{var o,m,l;I(((o=i.result)==null?void 0:o.items.length)<1?L.noResults:null),A(i.request),V((m=i.result)==null?void 0:m.items),_==null||_((l=i.result)==null?void 0:l.items),i.request.phrase?X(w):Y(w)},{eager:!0,scope:s});return()=>{e==null||e.off(),t==null||t.off(),c==null||c.off()}},[]);const D=(e,t)=>{var m;const c=(m=e.target)==null?void 0:m.closest("a");if(!c||!a)return;const i=new URL(c.href),o=new URL(a(t),window.location.origin);i.pathname===o.pathname&&i.hostname===o.hostname&&$(t.sku,w)},M=(e,t)=>{var m,l,p,N;const c={loading:t<8?"eager":"lazy",src:((l=(m=e.images)==null?void 0:m[0])==null?void 0:l.url)||"",alt:((N=(p=e.images)==null?void 0:p[0])==null?void 0:N.label)||"",width:g,height:f,params:{width:g}},i=e.name!==null?S(e.name):e.sku,o=n(W,{class:"product-discovery-product-item__image",...c,"aria-label":i||""});return n(h,{name:"ProductImage",slot:r==null?void 0:r.ProductImage,context:{product:e,defaultImageProps:c,variables:u},children:a?n("a",{href:a(e),children:o}):o})},b=e=>{const t=e.name!==null?S(e.name):"";return n(h,{name:"ProductName",slot:r==null?void 0:r.ProductName,context:{product:e,variables:u},children:a?n("a",{href:a(e),children:t}):t})},j=e=>{var i,o,m,l,p;let t=e.typename==="ComplexProductView"?(i=e.priceRange)==null?void 0:i.minimum.regular.amount.currency:(o=e.price)==null?void 0:o.regular.amount.currency;Intl.supportedValuesOf("currency").indexOf(t||"")===-1&&(t="USD");const c=e.typename==="ComplexProductView"?n(R,{display:"from to",minimumAmount:(m=e.priceRange)==null?void 0:m.minimum.regular.amount.value,maximumAmount:(l=e.priceRange)==null?void 0:l.maximum.regular.amount.value,currency:t}):n(R,{amount:(p=e.price)==null?void 0:p.regular.amount.value,currency:t});return n(h,{name:"ProductPrice",slot:r==null?void 0:r.ProductPrice,context:{product:e,variables:u},children:a?n("a",{href:a(e),children:c}):c})},z=e=>n(h,{name:"ProductActions",slot:r==null?void 0:r.ProductActions,context:{product:e,variables:u}}),F=()=>n(h,{name:"NoResults",slot:r==null?void 0:r.NoResults,context:{error:P,variables:u},children:P&&n(ae,{alertMessage:P})}),B=()=>n(C,{imageWidth:g,imageHeight:f,productList:Array.from({length:E}).map((e,t)=>n(k,{initialized:!1},t))}),O=()=>n(h,{name:"Header",slot:r==null?void 0:r.Header,context:{products:x,variables:u}}),T=()=>n(h,{name:"Footer",slot:r==null?void 0:r.Footer,context:{products:x,variables:u}});return n("div",{children:H?B():P?F():n(C,{header:O(),footer:T(),imageWidth:g,imageHeight:f,productList:x.map((e,t)=>n(k,{image:M(e,t),titleNode:b(e),price:j(e),actionButton:r!=null&&r.ProductActions?z(e):void 0,onClick:c=>D(c,e),initialized:!0},e.id||e.sku||t))})})};export{ge as SearchResults,ge as default};
3
+ import{jsxs as U,jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import*as w from"@dropins/tools/preact-compat.js";import{useState as E,useEffect as q}from"@dropins/tools/preact-compat.js";import{VComponent as G,classes as J,Slot as y}from"@dropins/tools/lib.js";import{events as C}from"@dropins/tools/event-bus.js";import{PriceRange as R,InLineAlert as K,Icon as Q,ProductItemCard as H,Image as W}from"@dropins/tools/components.js";/* empty css */import{c as X,d as Y,e as $,S as ee,P as re}from"../chunks/acdlEvents.js";import{useText as ne}from"@dropins/tools/i18n.js";const F=t=>new DOMParser().parseFromString(t,"text/html").documentElement.textContent,M=({productList:t,header:a,footer:n,imageWidth:i,imageHeight:l})=>U("div",{className:"product-discovery-product-list",style:{"--imageWidth":i,"--imageHeight":l},children:[a&&e("div",{className:"product-discovery-product-list__header",children:a}),e("div",{className:"product-discovery-product-list__grid",children:t&&e(G,{node:t})}),n&&e("div",{className:"product-discovery-product-list__footer",children:n})]}),te=({product:t})=>{var h,v,u,p,o,P,d,x,_;let a=((u=(v=(h=t.price)==null?void 0:h.regular)==null?void 0:v.amount)==null?void 0:u.currency)??"USD";Intl.supportedValuesOf("currency").includes(a)||(a="USD");const n=(P=(o=(p=t.price)==null?void 0:p.final)==null?void 0:o.amount)==null?void 0:P.value,i=(_=(x=(d=t.price)==null?void 0:d.regular)==null?void 0:x.amount)==null?void 0:_.value;return n!==void 0&&i!==void 0&&n<i?U("div",{class:"product-price",children:[e("span",{class:"regular-price-normal",children:e(R,{amount:n,currency:a})}),e("span",{class:"special-price-crossed",children:e(R,{amount:i,currency:a})})]}):e(R,{amount:i,currency:a})},ae=({product:t})=>{var u,p,o,P,d,x,_,L,S,A,N,k;let a=((P=(o=(p=(u=t.priceRange)==null?void 0:u.minimum)==null?void 0:p.regular)==null?void 0:o.amount)==null?void 0:P.currency)??"USD";Intl.supportedValuesOf("currency").includes(a)||(a="USD");const n=(x=(d=t.priceRange)==null?void 0:d.minimum)==null?void 0:x.final.amount.value,i=(L=(_=t.priceRange)==null?void 0:_.minimum)==null?void 0:L.regular.amount.value,l=(A=(S=t.priceRange)==null?void 0:S.maximum)==null?void 0:A.final.amount.value,h=(k=(N=t.priceRange)==null?void 0:N.maximum)==null?void 0:k.regular.amount.value;return n<i||l<h?U("div",{class:"product-price",children:[e("span",{class:"regular-price-normal",children:e(R,{display:"from to",minimumAmount:n,maximumAmount:l,currency:a})}),e("span",{class:"special-price-crossed",children:e(R,{display:"from to",minimumAmount:i,maximumAmount:h,currency:a})})]}):e(R,{display:"from to",minimumAmount:i,maximumAmount:h,currency:a})},ce=t=>w.createElement("svg",{id:"Icon_Warning_Base",width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},w.createElement("g",{clipPath:"url(#clip0_841_1324)"},w.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),w.createElement("defs",null,w.createElement("clipPath",{id:"clip0_841_1324"},w.createElement("rect",{width:24,height:21,fill:"white",transform:"translate(0 1.5)"})))),ie=({alertMessage:t=""})=>e("div",{className:J(["product-discovery-search-alert-message__wrapper"]),children:e("div",{className:"product-discovery-search-alert-message__content",children:e(K,{heading:t,type:"warning",icon:e(Q,{source:ce,size:"24"}),onDismiss:void 0})})}),fe=({routeProduct:t,scope:a,slots:n,imageWidth:i=400,imageHeight:l=450,skeletonCount:h=8,onSearchResult:v})=>{const u=a==="popover"?ee:re,p=ne({noResults:"Search.PLP.noResults",searchError:"Search.PLP.searchError"}),[o,P]=E(null),[d,x]=E([]),[_,L]=E(!1),[S,A]=E(null);q(()=>{const r=C.on("search/loading",L,{eager:!0,scope:a}),c=C.on("search/error",()=>{A(p.searchError)},{eager:!0,scope:a}),s=C.on("search/result",m=>{var g,f,I;A(((g=m.result)==null?void 0:g.items.length)<1?p.noResults:null),P(m.request),x((f=m.result)==null?void 0:f.items),v==null||v((I=m.result)==null?void 0:I.items),m.request.phrase?X(u):Y(u)},{eager:!0,scope:a});return()=>{r==null||r.off(),c==null||c.off(),s==null||s.off()}},[]);const N=(r,c)=>{var f;const s=(f=r.target)==null?void 0:f.closest("a");if(!s||!t)return;const m=new URL(s.href),g=new URL(t(c),window.location.origin);m.pathname===g.pathname&&m.hostname===g.hostname&&$(c.sku,u)},k=(r,c)=>{var f,I,V,D;const s={loading:c<8?"eager":"lazy",src:((I=(f=r.images)==null?void 0:f[0])==null?void 0:I.url)||"",alt:((D=(V=r.images)==null?void 0:V[0])==null?void 0:D.label)||"",width:i,height:l,params:{width:i}},m=r.name!==null?F(r.name):r.sku,g=e(W,{class:"product-discovery-product-item__image",...s,"aria-label":m||""});return e(y,{name:"ProductImage",slot:n==null?void 0:n.ProductImage,context:{product:r,defaultImageProps:s,variables:o},children:t?e("a",{href:t(r),children:g}):g})},b=r=>{const c=r.name!==null?F(r.name):"";return e(y,{name:"ProductName",slot:n==null?void 0:n.ProductName,context:{product:r,variables:o},children:t?e("a",{href:t(r),children:c}):c})},j=r=>{const c=r.typename==="ComplexProductView"?e(ae,{product:r}):e(te,{product:r});return e(y,{name:"ProductPrice",slot:n==null?void 0:n.ProductPrice,context:{product:r,variables:o},children:t?e("a",{href:t(r),children:c}):c})},z=r=>e(y,{name:"ProductActions",slot:n==null?void 0:n.ProductActions,context:{product:r,variables:o}}),B=()=>e(y,{name:"NoResults",slot:n==null?void 0:n.NoResults,context:{error:S,variables:o},children:S&&e(ie,{alertMessage:S})}),O=()=>e(M,{imageWidth:i,imageHeight:l,productList:Array.from({length:h}).map((r,c)=>e(H,{initialized:!1},c))}),T=()=>e(y,{name:"Header",slot:n==null?void 0:n.Header,context:{products:d,variables:o}}),Z=()=>e(y,{name:"Footer",slot:n==null?void 0:n.Footer,context:{products:d,variables:o}});return e("div",{children:_?O():S?B():e(M,{header:T(),footer:Z(),imageWidth:i,imageHeight:l,productList:d.map((r,c)=>e(H,{image:k(r,c),titleNode:b(r),price:j(r),actionButton:n!=null&&n.ProductActions?z(r):void 0,onClick:s=>N(s,r),initialized:!0},r.id||r.sku||c))})})};export{fe as SearchResults,fe as default};
4
4
  //# sourceMappingURL=SearchResults.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchResults.js","sources":["/@dropins/storefront-product-discovery/src/utils/htmlStringDecode.ts","/@dropins/storefront-product-discovery/src/components/ProductList/ProductList.tsx","../../node_modules/@adobe-commerce/elsie/src/icons/Warning.svg","/@dropins/storefront-product-discovery/src/components/SearchAlertMessage/SearchAlertMessage.tsx","/@dropins/storefront-product-discovery/src/containers/SearchResults/SearchResults.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\nconst htmlStringDecode = (input: string): string | null => {\n const doc = new DOMParser().parseFromString(input, 'text/html');\n return doc.documentElement.textContent;\n};\n\nexport { htmlStringDecode };\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 { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/plp/components/ProductList/ProductList.css';\n\nexport interface ProductListProps extends HTMLAttributes<HTMLDivElement> {\n productList?: VNode[];\n header?: VNode;\n footer?: VNode;\n imageWidth?: number;\n imageHeight?: number;\n}\n\nexport const ProductList: FunctionComponent<ProductListProps> = ({ productList, header, footer, imageWidth, imageHeight }) => {\n return (\n <div className={'product-discovery-product-list'} style={{ '--imageWidth': imageWidth, '--imageHeight': imageHeight }}>\n {header && <div className=\"product-discovery-product-list__header\">{header}</div>}\n <div className=\"product-discovery-product-list__grid\">{productList && <VComponent node={productList} />}</div>\n {footer && <div className=\"product-discovery-product-list__footer\">{footer}</div>}\n </div>\n );\n};\n","import * as React from \"react\";\nconst SvgWarning = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Warning_Base\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { clipPath: \"url(#clip0_841_1324)\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeLinejoin: \"round\" })), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"clip0_841_1324\" }, /* @__PURE__ */ React.createElement(\"rect\", { width: 24, height: 21, fill: \"white\", transform: \"translate(0 1.5)\" }))));\nexport default SvgWarning;\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 { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport '@/plp/components/SearchAlertMessage/SearchAlertMessage.css';\nimport { Icon, InLineAlert } from '@adobe-commerce/elsie/components';\nimport { Warning } from '@adobe-commerce/elsie/icons';\n\nexport interface SearchAlertMessageProps extends HTMLAttributes<HTMLDivElement> {\n alertMessage?: string;\n}\n\nexport const SearchAlertMessage: FunctionComponent<SearchAlertMessageProps> = ({ alertMessage = '' }) => {\n return (\n <div className={classes(['product-discovery-search-alert-message__wrapper'])}>\n <div className=\"product-discovery-search-alert-message__content\">\n <InLineAlert\n heading={alertMessage}\n type={'warning'}\n icon={<Icon source={Warning} size=\"24\" />}\n onDismiss={undefined}\n />\n </div>\n </div>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { ImageProps, Image, ProductItemCard, PriceRange } from '@adobe-commerce/elsie/components';\nimport { htmlStringDecode } from '@/plp/utils/htmlStringDecode';\nimport { Scope, SearchVariables } from '@/plp/data/models';\nimport { Product } from '@/plp/data/models/product';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { ProductList, SearchAlertMessage } from '@/plp/components'\nimport {\n searchProductClick,\n searchResultsView,\n categoryResultsView,\n PLP_UNIT_ID,\n SEARCH_UNIT_ID\n} from '@/plp/utils/acdlEvents';\n\ntype SlotDefaultContext = {\n product: Product;\n variables: SearchVariables | null;\n}\n\nexport interface SearchResultsProps extends HTMLAttributes<HTMLDivElement> {\n routeProduct?: (product: Product) => string;\n scope?: Scope;\n imageWidth?: number;\n imageHeight?: number;\n skeletonCount?: number;\n onSearchResult?: (payload: Product[]) => void;\n slots?: {\n ProductActions?: SlotProps<SlotDefaultContext>;\n ProductPrice?: SlotProps<SlotDefaultContext>;\n ProductName?: SlotProps<SlotDefaultContext>;\n ProductImage?: SlotProps<SlotDefaultContext & { defaultImageProps: ImageProps }>;\n NoResults?: SlotProps<{ error: string | null; variables: SearchVariables | null }>;\n Header?: SlotProps<{ products: Product[]; variables: SearchVariables | null }>;\n Footer?: SlotProps<{ products: Product[]; variables: SearchVariables | null }>;\n },\n}\n\nexport const SearchResults: Container<SearchResultsProps> = ({\n routeProduct,\n scope,\n slots,\n imageWidth = 400,\n imageHeight = 450,\n skeletonCount = 8,\n onSearchResult,\n}) => {\n const acdlUnitId = scope === 'popover' ? SEARCH_UNIT_ID : PLP_UNIT_ID;\n\n const labels = useText({\n noResults: 'Search.PLP.noResults',\n searchError: 'Search.PLP.searchError',\n });\n\n const [variables, setVariables] = useState<SearchVariables | null>(null);\n const [items, setItems] = useState<any[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n const loadingEvent = events.on('search/loading', setLoading, { eager: true, scope });\n\n const errorEvent = events.on('search/error', () => {\n setError(labels.searchError!);\n }, { eager: true, scope });\n\n const searchEvent = events.on('search/result', (payload) => {\n setError(payload.result?.items.length < 1 ? labels.noResults! : null);\n\n setVariables(payload.request);\n setItems(payload.result?.items);\n onSearchResult?.(payload.result?.items);\n\n // Publish search results view event to ACDL\n if (payload.request.phrase) {\n searchResultsView(acdlUnitId);\n } else {\n categoryResultsView(acdlUnitId);\n }\n }, { eager: true, scope });\n\n return () => {\n loadingEvent?.off();\n errorEvent?.off();\n searchEvent?.off();\n };\n }, []);\n\n const handleProductClick = (event: MouseEvent, product: Product): void => {\n const anchor = (event.target as HTMLElement)?.closest('a');\n\n if (!anchor || !routeProduct) return;\n\n const anchorUrl = new URL(anchor.href);\n const routeUrl = new URL(routeProduct(product), window.location.origin);\n\n // Compare both pathname and hostname to ensure same path under same host\n if (anchorUrl.pathname === routeUrl.pathname && anchorUrl.hostname === routeUrl.hostname) { \n searchProductClick(product.sku, acdlUnitId);\n }\n };\n\n const renderProductImageSlot = (product: Product, index: number) => {\n const defaultImageProps: ImageProps = {\n loading: index < 8 ? 'eager' : 'lazy',\n src: product.images?.[0]?.url || '',\n alt: product.images?.[0]?.label || '',\n width: imageWidth,\n height: imageHeight,\n params: { width: imageWidth },\n };\n const productName = product.name !== null ? htmlStringDecode(product.name) : product.sku;\n const imageComponent = (\n <Image class=\"product-discovery-product-item__image\" {...defaultImageProps} aria-label={productName || ''} />\n );\n\n return (\n <Slot name=\"ProductImage\" slot={slots?.ProductImage} context={{ product, defaultImageProps, variables }}>\n {routeProduct ? (\n <a href={routeProduct(product)}>\n {imageComponent}\n </a>\n ) : (\n imageComponent\n )}\n </Slot>\n );\n };\n\n const renderProductNameSlot = (product: Product) => {\n const productName = product.name !== null ? htmlStringDecode(product.name) : '';\n return (\n <Slot name=\"ProductName\" slot={slots?.ProductName} context={{ product, variables }}>\n {routeProduct ? (\n <a href={routeProduct(product)}>\n {productName}\n </a>\n ) : (\n productName\n )}\n </Slot>\n );\n };\n\n const renderProductPriceSlot = (product: Product) => {\n let productCurrency =\n product.typename === 'ComplexProductView'\n ? product.priceRange?.minimum.regular.amount.currency\n : product.price?.regular.amount.currency;\n if (Intl.supportedValuesOf('currency').indexOf(productCurrency || '') === -1) {\n productCurrency = 'USD'; // Fallback to USD if the currency is not supported\n }\n const productPrice =\n product.typename === 'ComplexProductView' ? (\n <PriceRange\n display=\"from to\"\n minimumAmount={product.priceRange?.minimum.regular.amount.value}\n maximumAmount={product.priceRange?.maximum.regular.amount.value}\n currency={productCurrency}\n />\n ) : (\n <PriceRange amount={product.price?.regular.amount.value} currency={productCurrency} />\n );\n return (\n <Slot name=\"ProductPrice\" slot={slots?.ProductPrice} context={{ product, variables }}>\n {routeProduct ? (\n <a href={routeProduct(product)}>\n {productPrice}\n </a>\n ) : (\n productPrice\n )}\n </Slot>\n );\n };\n\n const renderActionsSlot = (product: Product) => {\n return <Slot name=\"ProductActions\" slot={slots?.ProductActions} context={{ product, variables }} />;\n };\n\n const renderAlertSlot = () => {\n return <Slot name=\"NoResults\" slot={slots?.NoResults} context={{ error, variables }}>\n {error && <SearchAlertMessage alertMessage={error} />}\n </Slot>;\n }\n\n const renderSkeleton = () => {\n return <ProductList\n imageWidth={imageWidth}\n imageHeight={imageHeight}\n productList={Array.from({ length: skeletonCount }).map((_, index) => (\n <ProductItemCard key={index} initialized={false} />\n ))}\n />\n }\n\n const renderHeader = () => {\n return <Slot name=\"Header\" slot={slots?.Header} context={{ products: items, variables }} />;\n }\n\n const renderFooter = () => {\n return <Slot name=\"Footer\" slot={slots?.Footer} context={{ products: items, variables }} />;\n }\n\n const renderResults = () => {\n if (error) return renderAlertSlot();\n\n return <ProductList\n header={renderHeader()}\n footer={renderFooter()}\n imageWidth={imageWidth}\n imageHeight={imageHeight}\n productList={items.map((product, index) => (\n <ProductItemCard key={product.id || product.sku || index}\n image={renderProductImageSlot(product, index)}\n titleNode={renderProductNameSlot(product)}\n price={renderProductPriceSlot(product)}\n actionButton={slots?.ProductActions ? renderActionsSlot(product) : undefined}\n onClick={(event) => handleProductClick(event, product)}\n initialized\n />\n ))}\n />\n }\n\n return (\n <div>\n {loading ? renderSkeleton() : renderResults()}\n </div>\n );\n};\n"],"names":["htmlStringDecode","input","ProductList","productList","header","footer","imageWidth","imageHeight","jsxs","jsx","VComponent","SvgWarning","props","React","SearchAlertMessage","alertMessage","classes","InLineAlert","Icon","Warning","SearchResults","routeProduct","scope","slots","skeletonCount","onSearchResult","acdlUnitId","SEARCH_UNIT_ID","PLP_UNIT_ID","labels","useText","variables","setVariables","useState","items","setItems","loading","setLoading","error","setError","useEffect","loadingEvent","events","errorEvent","searchEvent","payload","_a","_b","_c","searchResultsView","categoryResultsView","handleProductClick","event","product","anchor","anchorUrl","routeUrl","searchProductClick","renderProductImageSlot","index","defaultImageProps","_d","productName","imageComponent","Image","Slot","renderProductNameSlot","renderProductPriceSlot","productCurrency","productPrice","PriceRange","_e","renderActionsSlot","renderAl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AAY,KAAM1C,GAAA,YAAAA,EAAO,UAAW,QAAS,CAAE,MAAAe,EAAO,UAAAP,GACrE,SAAAO,KAAUxB,GAAA,CAAmB,aAAcwB,EAAO,EACrD,EAGIoC,EAAiB,IACdjE,EAACP,EAAA,CACN,WAAAI,EACA,YAAAC,EACA,YAAa,MAAM,KAAK,CAAE,OAAQiB,EAAe,EAAE,IAAI,CAACmD,EAAGhB,IACzDlD,EAACmE,GAA4B,YAAa,EAAA,EAApBjB,CAA2B,CAClD,CAAA,CAAA,EAICkB,EAAe,IACZpE,EAACwD,EAAA,CAAK,KAAK,SAAS,KAAM1C,GAAA,YAAAA,EAAO,OAAQ,QAAS,CAAE,SAAUW,EAAO,UAAAH,CAAA,CAAU,CAAG,EAGrF+C,EAAe,IACZrE,EAACwD,EAAA,CAAK,KAAK,SAAS,KAAM1C,GAAA,YAAAA,EAAO,OAAQ,QAAS,CAAE,SAAUW,EAAO,UAAAH,CAAA,CAAU,CAAG,EAwB3F,SACG,MAAA,CACE,SAAAK,EAAUsC,EAAA,EAtBTpC,EAAcmC,EAAA,EAEXhE,EAACP,EAAA,CACN,OAAQ2E,EAAA,EACR,OAAQC,EAAA,EACR,WAAAxE,EACA,YAAAC,EACA,YAAa2B,EAAM,IAAI,CAACmB,EAASM,IAC/BlD,EAACmE,EAAA,CACC,MAAOlB,EAAuBL,EAASM,CAAK,EAC5C,UAAWO,EAAsBb,CAAO,EACxC,MAAOc,EAAuBd,CAAO,EACrC,aAAc9B,GAAA,MAAAA,EAAO,eAAiBiD,EAAkBnB,CAAO,EAAI,OACnE,QAAUD,GAAUD,EAAmBC,EAAOC,CAAO,EACrD,YAAW,EAAA,EANSA,EAAQ,IAAMA,EAAQ,KAAOM,CAAA,CAQpD,CAAA,CAAA,EAOH,CAEJ","x_google_ignoreList":[2]}
1
+ {"version":3,"file":"SearchResults.js","sources":["/@dropins/storefront-product-discovery/src/utils/htmlStringDecode.ts","/@dropins/storefront-product-discovery/src/components/ProductList/ProductList.tsx","/@dropins/storefront-product-discovery/src/containers/SearchResults/SimpleProductPrice.tsx","/@dropins/storefront-product-discovery/src/containers/SearchResults/ComplexProductPrice.tsx","../../node_modules/@adobe-commerce/elsie/src/icons/Warning.svg","/@dropins/storefront-product-discovery/src/components/SearchAlertMessage/SearchAlertMessage.tsx","/@dropins/storefront-product-discovery/src/containers/SearchResults/SearchResults.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\nconst htmlStringDecode = (input: string): string | null => {\n const doc = new DOMParser().parseFromString(input, 'text/html');\n return doc.documentElement.textContent;\n};\n\nexport { htmlStringDecode };\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 { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/plp/components/ProductList/ProductList.css';\n\nexport interface ProductListProps extends HTMLAttributes<HTMLDivElement> {\n productList?: VNode[];\n header?: VNode;\n footer?: VNode;\n imageWidth?: number;\n imageHeight?: number;\n}\n\nexport const ProductList: FunctionComponent<ProductListProps> = ({ productList, header, footer, imageWidth, imageHeight }) => {\n return (\n <div className={'product-discovery-product-list'} style={{ '--imageWidth': imageWidth, '--imageHeight': imageHeight }}>\n {header && <div className=\"product-discovery-product-list__header\">{header}</div>}\n <div className=\"product-discovery-product-list__grid\">{productList && <VComponent node={productList} />}</div>\n {footer && <div className=\"product-discovery-product-list__footer\">{footer}</div>}\n </div>\n );\n};\n","import { PriceRange } from \"@adobe-commerce/elsie/components\";\nimport { Product } from \"@/plp/data/models/product\";\nimport '@/plp/components/ProductList/ProductList';\n\nexport const SimpleProductPrice = ({ product }: { product: Product }) => {\n let currency = product.price?.regular?.amount?.currency ?? \"USD\";\n\n if (!Intl.supportedValuesOf(\"currency\").includes(currency)) {\n currency = \"USD\";\n }\n\n\n const finalAmount = product.price?.final?.amount?.value;\n const regularAmount = product.price?.regular?.amount?.value;\n\n const hasSpecial =\n finalAmount !== undefined &&\n regularAmount !== undefined &&\n finalAmount < regularAmount;\n\n if (!hasSpecial) {\n return <PriceRange amount={regularAmount} currency={currency} />;\n }\n\n return (\n <div class=\"product-price\">\n <span class=\"regular-price-normal\">\n <PriceRange amount={finalAmount} currency={currency} />\n </span>\n <span class=\"special-price-crossed\">\n <PriceRange amount={regularAmount} currency={currency} />\n </span>\n </div>\n );\n};\n","import { PriceRange } from \"@adobe-commerce/elsie/components\";\nimport { Product } from \"@/plp/data/models/product\";\n\nexport const ComplexProductPrice = ({ product }: { product: Product }) => {\n let currency =\n product.priceRange?.minimum?.regular?.amount?.currency ?? \"USD\";\n\n if (!Intl.supportedValuesOf(\"currency\").includes(currency)) {\n currency = \"USD\";\n }\n\n const minFinal = product.priceRange?.minimum?.final.amount.value;\n const minRegular = product.priceRange?.minimum?.regular.amount.value;\n const maxFinal = product.priceRange?.maximum?.final.amount.value;\n const maxRegular = product.priceRange?.maximum?.regular.amount.value;\n\n const hasSpecial = minFinal < minRegular || maxFinal < maxRegular;\n\n if (!hasSpecial) {\n return (\n <PriceRange\n display=\"from to\"\n minimumAmount={minRegular}\n maximumAmount={maxRegular}\n currency={currency}\n />\n );\n }\n\n return (\n <div class=\"product-price\">\n <span class=\"regular-price-normal\">\n <PriceRange\n display=\"from to\"\n minimumAmount={minFinal}\n maximumAmount={maxFinal}\n currency={currency}\n />\n </span>\n\n <span class=\"special-price-crossed\">\n <PriceRange\n display=\"from to\"\n minimumAmount={minRegular}\n maximumAmount={maxRegular}\n currency={currency}\n />\n </span>\n </div>\n );\n};","import * as React from \"react\";\nconst SvgWarning = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Warning_Base\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { clipPath: \"url(#clip0_841_1324)\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeLinejoin: \"round\" })), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"clip0_841_1324\" }, /* @__PURE__ */ React.createElement(\"rect\", { width: 24, height: 21, fill: \"white\", transform: \"translate(0 1.5)\" }))));\nexport default SvgWarning;\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 { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport '@/plp/components/SearchAlertMessage/SearchAlertMessage.css';\nimport { Icon, InLineAlert } from '@adobe-commerce/elsie/components';\nimport { Warning } from '@adobe-commerce/elsie/icons';\n\nexport interface SearchAlertMessageProps extends HTMLAttributes<HTMLDivElement> {\n alertMessage?: string;\n}\n\nexport const SearchAlertMessage: FunctionComponent<SearchAlertMessageProps> = ({ alertMessage = '' }) => {\n return (\n <div className={classes(['product-discovery-search-alert-message__wrapper'])}>\n <div className=\"product-discovery-search-alert-message__content\">\n <InLineAlert\n heading={alertMessage}\n type={'warning'}\n icon={<Icon source={Warning} size=\"24\" />}\n onDismiss={undefined}\n />\n </div>\n </div>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { ImageProps, Image, ProductItemCard } from '@adobe-commerce/elsie/components';\nimport { htmlStringDecode } from '@/plp/utils/htmlStringDecode';\nimport { Scope, SearchVariables } from '@/plp/data/models';\nimport { Product } from '@/plp/data/models/product';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { SimpleProductPrice } from '@/plp/containers/SearchResults/SimpleProductPrice';\nimport { ComplexProductPrice } from \"@/plp/containers/SearchResults/ComplexProductPrice\";\nimport { ProductList, SearchAlertMessage } from '@/plp/components'\nimport {\n searchProductClick,\n searchResultsView,\n categoryResultsView,\n PLP_UNIT_ID,\n SEARCH_UNIT_ID\n} from '@/plp/utils/acdlEvents';\n\ntype SlotDefaultContext = {\n product: Product;\n variables: SearchVariables | null;\n}\n\nexport interface SearchResultsProps extends HTMLAttributes<HTMLDivElement> {\n routeProduct?: (product: Product) => string;\n scope?: Scope;\n imageWidth?: number;\n imageHeight?: number;\n skeletonCount?: number;\n onSearchResult?: (payload: Product[]) => void;\n slots?: {\n ProductActions?: SlotProps<SlotDefaultContext>;\n ProductPrice?: SlotProps<SlotDefaultContext>;\n ProductName?: SlotProps<SlotDefaultContext>;\n ProductImage?: SlotProps<SlotDefaultContext & { defaultImageProps: ImageProps }>;\n NoResults?: SlotProps<{ error: string | null; variables: SearchVariables | null }>;\n Header?: SlotProps<{ products: Product[]; variables: SearchVariables | null }>;\n Footer?: SlotProps<{ products: Product[]; variables: SearchVariables | null }>;\n },\n}\n\nexport const SearchResults: Container<SearchResultsProps> = ({\n routeProduct,\n scope,\n slots,\n imageWidth = 400,\n imageHeight = 450,\n skeletonCount = 8,\n onSearchResult,\n}) => {\n const acdlUnitId = scope === 'popover' ? SEARCH_UNIT_ID : PLP_UNIT_ID;\n\n const labels = useText({\n noResults: 'Search.PLP.noResults',\n searchError: 'Search.PLP.searchError',\n });\n\n const [variables, setVariables] = useState<SearchVariables | null>(null);\n const [items, setItems] = useState<any[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n const loadingEvent = events.on('search/loading', setLoading, { eager: true, scope });\n\n const errorEvent = events.on('search/error', () => {\n setError(labels.searchError!);\n }, { eager: true, scope });\n\n const searchEvent = events.on('search/result', (payload) => {\n setError(payload.result?.items.length < 1 ? labels.noResults! : null);\n\n setVariables(payload.request);\n setItems(payload.result?.items);\n onSearchResult?.(payload.result?.items);\n\n // Publish search results view event to ACDL\n if (payload.request.phrase) {\n searchResultsView(acdlUnitId);\n } else {\n categoryResultsView(acdlUnitId);\n }\n }, { eager: true, scope });\n\n return () => {\n loadingEvent?.off();\n errorEvent?.off();\n searchEvent?.off();\n };\n }, []);\n\n const handleProductClick = (event: MouseEvent, product: Product): void => {\n const anchor = (event.target as HTMLElement)?.closest('a');\n\n if (!anchor || !routeProduct) return;\n\n const anchorUrl = new URL(anchor.href);\n const routeUrl = new URL(routeProduct(product), window.location.origin);\n\n // Compare both pathname and hostname to ensure same path under same host\n if (anchorUrl.pathname === routeUrl.pathname && anchorUrl.hostname === routeUrl.hostname) { \n searchProductClick(product.sku, acdlUnitId);\n }\n };\n\n const renderProductImageSlot = (product: Product, index: number) => {\n const defaultImageProps: ImageProps = {\n loading: index < 8 ? 'eager' : 'lazy',\n src: product.images?.[0]?.url || '',\n alt: product.images?.[0]?.label || '',\n width: imageWidth,\n height: imageHeight,\n params: { width: imageWidth },\n };\n const productName = product.name !== null ? htmlStringDecode(product.name) : product.sku;\n const imageComponent = (\n <Image class=\"product-discovery-product-item__image\" {...defaultImageProps} aria-label={productName || ''} />\n );\n\n return (\n <Slot name=\"ProductImage\" slot={slots?.ProductImage} context={{ product, defaultImageProps, variables }}>\n {routeProduct ? (\n <a href={routeProduct(product)}>\n {imageComponent}\n </a>\n ) : (\n imageComponent\n )}\n </Slot>\n );\n };\n\n const renderProductNameSlot = (product: Product) => {\n const productName = product.name !== null ? htmlStringDecode(product.name) : '';\n return (\n <Slot name=\"ProductName\" slot={slots?.ProductName} context={{ product, variables }}>\n {routeProduct ? (\n <a href={routeProduct(product)}>\n {productName}\n </a>\n ) : (\n productName\n )}\n </Slot>\n );\n };\n\n const renderProductPriceSlot = (product: Product) => {\n const PriceNode =\n product.typename === \"ComplexProductView\" ? (\n <ComplexProductPrice product={product} />\n ) : (\n <SimpleProductPrice product={product} />\n );\n \n return (\n <Slot name=\"ProductPrice\" slot={slots?.ProductPrice} context={{ product, variables }}>\n {routeProduct ? (\n <a href={routeProduct(product)}>{PriceNode}</a>\n ) : (\n PriceNode\n )}\n </Slot>\n );\n }; \n \n const renderActionsSlot = (product: Product) => {\n return <Slot name=\"ProductActions\" slot={slots?.ProductActions} context={{ product, variables }} />;\n };\n\n const renderAlertSlot = () => {\n return <Slot name=\"NoResults\" slot={slots?.NoResults} context={{ error, variables }}>\n {error && <SearchAlertMessage alertMessage={error} />}\n </Slot>;\n }\n\n const renderSkeleton = () => {\n return <ProductList\n imageWidth={imageWidth}\n imageHeight={imageHeight}\n productList={Array.from({ length: skeletonCount }).map((_, index) => (\n <ProductItemCard key={index} initialized={false} />\n ))}\n />\n }\n\n const renderHeader = () => {\n return <Slot name=\"Header\" slot={slots?.Header} context={{ products: items, variables }} />;\n }\n\n const renderFooter = () => {\n return <Slot name=\"Footer\" slot={slots?.Footer} context={{ products: items, variables }} />;\n }\n\n const renderResults = () => {\n if (error) return renderAlertSlot();\n\n return <ProductList\n header={renderHeader()}\n footer={renderFooter()}\n imageWidth={imageWidth}\n imageHeight={imageHeight}\n productList={items.map((product, index) => (\n <ProductItemCard key={product.id || product.sku || index}\n image={renderProductImageSlot(product, index)}\n titleNode={renderProductNameSlot(product)}\n price={renderProductPriceSlot(product)}\n actionButton={slots?.ProductActions ? renderActionsSlot(product) : undefined}\n onClick={(event) => handleProductClick(event, product)}\n initialized\n />\n ))}\n />\n }\n\n return (\n <div>\n {loading ? renderSkeleton() : renderResults()}\n </div>\n );\n};\n"],"names":["htmlStringDecode","input","ProductList","productList","header","footer","imageWidth","imageHeight","jsxs","jsx","VComponent","SimpleProductPrice","product","currency","_c","_b","_a","finalAmount","_f","_e","_d","regularAmount","_i","_h","_g","PriceRange","ComplexProductPrice","minFinal","minRegular","maxFinal","_j","maxRegular","_l","_k","SvgWarning","props","React","SearchAlertMessage","alertMessage","classes","InLineAlert","Icon","Warning","SearchResults","routeProduct","scope","slots","skeletonCount","onSearchResult","acdlUnitId","SEARCH_UNIT_ID","PLP_UNIT_ID","labels","useText","variables","setVariables","useState","items","setItems","loading","setLoading","error","setError","useEffect","loadingEvent","events","errorEvent","searchEvent","payload","searchResultsView","categoryResultsView","handleProductClick","event","anchor","anchorUrl","routeUrl","searchProductClick","renderProductImageSlot","index","defaultImageProps","productName","imageComponent","Image","Slot","renderProductNameSlot","renderProductPriceSlot","PriceNode","renderActionsSlot","renderAlertSlot","renderSkeleton","_","ProductItemCard","renderHeader","renderFooter"],"mappings":"glBASA,MAAMA,EAAoBC,GACZ,IAAI,UAAA,EAAY,gBAAgBA,EAAO,WAAW,EACnD,gBAAgB,YCWhBC,EAAmD,CAAC,CAAE,YAAAC,EAAa,OAAAC,EAAQ,OAAAC,EAAQ,WAAAC,EAAY,YAAAC,KAExGC,EAAC,MAAA,CAAI,UAAW,iCAAkC,MAAO,CAAE,eAAgBF,EAAY,gBAAiBC,CAAA,EACrG,SAAA,CAAAH,GAAUK,EAAC,MAAA,CAAI,UAAU,yCAA0C,SAAAL,EAAO,EAC3EK,EAAC,OAAI,UAAU,uCAAwC,YAAeA,EAACC,EAAA,CAAW,KAAMP,CAAA,CAAa,CA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EAAe,EAAE,IAAI,CAAC2C,EAAGZ,IACzDrE,EAACkF,GAA4B,YAAa,EAAA,EAApBb,CAA2B,CAClD,CAAA,CAAA,EAICc,EAAe,IACZnF,EAAC0E,EAAA,CAAK,KAAK,SAAS,KAAMrC,GAAA,YAAAA,EAAO,OAAQ,QAAS,CAAE,SAAUW,EAAO,UAAAH,CAAA,CAAU,CAAG,EAGrFuC,EAAe,IACZpF,EAAC0E,EAAA,CAAK,KAAK,SAAS,KAAMrC,GAAA,YAAAA,EAAO,OAAQ,QAAS,CAAE,SAAUW,EAAO,UAAAH,CAAA,CAAU,CAAG,EAwB3F,SACG,MAAA,CACE,SAAAK,EAAU8B,EAAA,EAtBT5B,EAAc2B,EAAA,EAEX/E,EAACP,EAAA,CACN,OAAQ0F,EAAA,EACR,OAAQC,EAAA,EACR,WAAAvF,EACA,YAAAC,EACA,YAAakD,EAAM,IAAI,CAAC7C,EAASkE,IAC/BrE,EAACkF,EAAA,CACC,MAAOd,EAAuBjE,EAASkE,CAAK,EAC5C,UAAWM,EAAsBxE,CAAO,EACxC,MAAOyE,EAAuBzE,CAAO,EACrC,aAAckC,GAAA,MAAAA,EAAO,eAAiByC,EAAkB3E,CAAO,EAAI,OACnE,QAAU4D,GAAUD,EAAmBC,EAAO5D,CAAO,EACrD,YAAW,EAAA,EANSA,EAAQ,IAAMA,EAAQ,KAAOkE,CAAA,CAQpD,CAAA,CAAA,EAOH,CAEJ","x_google_ignoreList":[4]}
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@dropins/storefront-product-discovery", "version": "2.1.0", "@dropins/tools": "^1.4.0", "license": "SEE LICENSE IN LICENSE.md"}
1
+ {"name": "@dropins/storefront-product-discovery", "version": "3.0.0-beta1", "@dropins/tools": "^1.4.0", "license": "SEE LICENSE IN LICENSE.md"}
package/render.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- (function(d,r){try{if(typeof document<"u"){const t=document.createElement("style"),o=r.styleId;for(const e in r.attributes)t.setAttribute(e,r.attributes[e]);t.setAttribute("data-dropin",o),t.appendChild(document.createTextNode(d));const i=document.querySelector('style[data-dropin="sdk"]');if(i)i.after(t);else{const e=document.querySelector('link[rel="stylesheet"], style');e?e.before(t):document.head.append(t)}}}catch(t){console.error("dropin-styles (injectCodeFunction)",t)}})(".product-discovery-product-list{container-type:inline-size;display:flex;flex-direction:column;width:100%}.product-discovery-product-list__container{display:flex;flex-direction:column;width:100%}.product-discovery-product-list__grid{display:grid;grid-template-columns:1fr;gap:var(--spacing-small)}.product-discovery-product-list__grid .dropin-product-item-card{margin:unset;width:100%}.product-discovery-product-list__grid .dropin-product-item-card img,.product-discovery-product-list__grid .dropin-product-item-card__skeleton__image{aspect-ratio:var(--imageWidth) / var(--imageHeight);max-height:unset;height:unset}@container (min-width: 600px){.product-discovery-product-list__grid{grid-template-columns:repeat(2,1fr)}}@container (min-width: 900px){.product-discovery-product-list__grid{grid-template-columns:repeat(3,1fr)}}@container (min-width: 1200px){.product-discovery-product-list__grid{grid-template-columns:repeat(4,1fr)}}.product-discovery-search-alert-message__wrapper{display:flex;flex-direction:column;justify-content:center;width:100%;min-height:300px}.product-discovery-search-alert-message__content{display:flex;justify-content:center}.product-discovery-facet{padding-block:var(--spacing-small)}.product-discovery-facet:not(.product-discovery-facet--last){border-bottom:1px solid var(--color-neutral-400)}.product-discovery-facet__header{display:block;margin-block-end:var(--spacing-xsmall)}.product-discovery-facet__bucket .dropin-price-range .dropin-price--small.dropin-price--bold{font:var(--type-body-2-default-font)}.product-discovery-facet__bucket .dropin-radio-button__label:before{margin-right:var(--spacing-xsmall)}.product-discovery-facet-list{display:flex;flex-direction:column;width:100%}.product-discovery-facet-list__selected-filters{display:flex;flex-direction:row;flex-wrap:wrap;row-gap:var(--spacing-xxsmall);padding:0 0 var(--spacing-xxsmall) 0}.product-discovery-facet-list__selected-filters button{padding:0 var(--spacing-xxsmall);margin:0 var(--spacing-xxsmall);border-radius:var(--shape-border-radius-2)}.product-discovery-facet-list__selected-filters .dropin-price-range .dropin-price--small.dropin-price--bold{font:var(--type-button-2-font)}.product-discovery-facet-list__facet-options{text-align:left}.product-discovery-facet-list__facet-options button{padding:0}.product-discovery-facet-list__facet-options .dropin-radio-button{padding:var(--spacing-xxsmall) 0}.product-discovery-facet-list__facet-options--hidden{display:none}.product-discovery-facet-list .dropin-divider{margin:var(--spacing-xsmall) 0 var(--spacing-xsmall) 0}",{styleId:"storefront-product-discovery"});
3
+ (function(d,r){try{if(typeof document<"u"){const t=document.createElement("style"),o=r.styleId;for(const e in r.attributes)t.setAttribute(e,r.attributes[e]);t.setAttribute("data-dropin",o),t.appendChild(document.createTextNode(d));const i=document.querySelector('style[data-dropin="sdk"]');if(i)i.after(t);else{const e=document.querySelector('link[rel="stylesheet"], style');e?e.before(t):document.head.append(t)}}}catch(t){console.error("dropin-styles (injectCodeFunction)",t)}})(".product-discovery-product-list{container-type:inline-size;display:flex;flex-direction:column;width:100%}.product-discovery-product-list__container{display:flex;flex-direction:column;width:100%}.product-discovery-product-list__grid{display:grid;grid-template-columns:1fr;gap:var(--spacing-small)}.product-discovery-product-list__grid .dropin-product-item-card{margin:unset;width:100%}.product-discovery-product-list__grid .dropin-product-item-card img,.product-discovery-product-list__grid .dropin-product-item-card__skeleton__image{aspect-ratio:var(--imageWidth) / var(--imageHeight);max-height:unset;height:unset}.product-discovery-product-list .product-price{display:flex;gap:8px}.product-discovery-product-list .special-price-crossed{text-decoration:line-through;opacity:.5}@container (min-width: 600px){.product-discovery-product-list__grid{grid-template-columns:repeat(2,1fr)}}@container (min-width: 900px){.product-discovery-product-list__grid{grid-template-columns:repeat(3,1fr)}}@container (min-width: 1200px){.product-discovery-product-list__grid{grid-template-columns:repeat(4,1fr)}}.product-discovery-search-alert-message__wrapper{display:flex;flex-direction:column;justify-content:center;width:100%;min-height:300px}.product-discovery-search-alert-message__content{display:flex;justify-content:center}.product-discovery-facet{padding-block:var(--spacing-small)}.product-discovery-facet:not(.product-discovery-facet--last){border-bottom:1px solid var(--color-neutral-400)}.product-discovery-facet__header{display:block;margin-block-end:var(--spacing-xsmall)}.product-discovery-facet__bucket .dropin-price-range .dropin-price--small.dropin-price--bold{font:var(--type-body-2-default-font)}.product-discovery-facet__bucket .dropin-radio-button__label:before{margin-right:var(--spacing-xsmall)}.product-discovery-facet-list{display:flex;flex-direction:column;width:100%}.product-discovery-facet-list__selected-filters{display:flex;flex-direction:row;flex-wrap:wrap;row-gap:var(--spacing-xxsmall);padding:0 0 var(--spacing-xxsmall) 0}.product-discovery-facet-list__selected-filters button{padding:0 var(--spacing-xxsmall);margin:0 var(--spacing-xxsmall);border-radius:var(--shape-border-radius-2)}.product-discovery-facet-list__selected-filters .dropin-price-range .dropin-price--small.dropin-price--bold{font:var(--type-button-2-font)}.product-discovery-facet-list__facet-options{text-align:left}.product-discovery-facet-list__facet-options button{padding:0}.product-discovery-facet-list__facet-options .dropin-radio-button{padding:var(--spacing-xxsmall) 0}.product-discovery-facet-list__facet-options--hidden{display:none}.product-discovery-facet-list .dropin-divider{margin:var(--spacing-xsmall) 0 var(--spacing-xsmall) 0}",{styleId:"storefront-product-discovery"});
4
4
  import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{deepmerge as f,Render as l}from"@dropins/tools/lib.js";import{useState as g,useEffect as h}from"@dropins/tools/preact-hooks.js";import{UIProvider as m}from"@dropins/tools/components.js";import{events as u}from"@dropins/tools/event-bus.js";import{c as w}from"./chunks/initialize.js";const d={PLP:{noResults:"Your search returned no results.",searchError:"An error occurred while searching."},Facet:{showMore:"Show more",showLess:"Show less",clearAll:"Clear all"},SortBy:{title:"Sort by",lowToHigh:"Low to High",highToLow:"High to Low"}},S={Search:d},p={default:S},L=({children:n})=>{var e;const[t,s]=g("en_US"),i=(e=w.getConfig())==null?void 0:e.langDefinitions;h(()=>{const o=u.on("locale",a=>{s(a)},{eager:!0});return()=>{o==null||o.off()}},[]);const c=f(p,i??{});return r(m,{lang:t,langDefinitions:c,children:n})},y=new l(r(L,{}));export{y as render};
5
5
  //# sourceMappingURL=render.js.map