@beamimpact/web-sdk 1.45.2 → 1.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/dist/chunks/_share-dialog-dependencies--DwhY4w7.esm.js +2 -0
  2. package/dist/chunks/_share-dialog-dependencies--DwhY4w7.esm.js.map +1 -0
  3. package/dist/chunks/_share-dialog-dependencies-XEpMl5XM.esm.js +2 -0
  4. package/dist/chunks/_share-dialog-dependencies-XEpMl5XM.esm.js.map +1 -0
  5. package/dist/chunks/{cart-contents-HAPzwbeL.esm.d.ts → cart-contents-MrYQNVDx.esm.d.ts} +1 -1
  6. package/dist/chunks/{events-fqRWfo7p.esm.d.ts → events--Qgk7Mel.esm.d.ts} +1 -1
  7. package/dist/chunks/{index--JacA4R2.esm.js → index-2sMT9J8K.esm.js} +2 -2
  8. package/dist/chunks/{index--JacA4R2.esm.js.map → index-2sMT9J8K.esm.js.map} +1 -1
  9. package/dist/chunks/index-4kINfIHU.esm.js +2 -0
  10. package/dist/chunks/index-4kINfIHU.esm.js.map +1 -0
  11. package/dist/chunks/{index-MSoONvC5.esm.d.ts → index-8gDNc2to.esm.d.ts} +1 -1
  12. package/dist/chunks/index-COmf0U0P.esm.js +2 -0
  13. package/dist/chunks/index-COmf0U0P.esm.js.map +1 -0
  14. package/dist/chunks/{index-qs-xQCeM.esm.js → index-Fmt8u1QB.esm.js} +2 -2
  15. package/dist/chunks/{index-qs-xQCeM.esm.js.map → index-Fmt8u1QB.esm.js.map} +1 -1
  16. package/dist/chunks/index-H8fABpZF.esm.js +2 -0
  17. package/dist/chunks/index-H8fABpZF.esm.js.map +1 -0
  18. package/dist/chunks/index-HzqAV0Ls.esm.js +2 -0
  19. package/dist/chunks/index-HzqAV0Ls.esm.js.map +1 -0
  20. package/dist/chunks/{index-qt5iD9Ok.esm.d.ts → index-Ie9en2n6.esm.d.ts} +1 -1
  21. package/dist/chunks/{index-SExnliMs.esm.d.ts → index-S_lCvtkH.esm.d.ts} +1 -1
  22. package/dist/chunks/{index-JG4nmG9U.esm.d.ts → index-gQHtJWVP.esm.d.ts} +1 -1
  23. package/dist/chunks/{index-tdUx2WLc.esm.d.ts → index-ikzViFqS.esm.d.ts} +4 -4
  24. package/dist/chunks/{index-7mukhxz_.esm.d.ts → index-wqLh9Pnq.esm.d.ts} +1 -1
  25. package/dist/chunks/index-y4dGW0m2.esm.js +2 -0
  26. package/dist/chunks/index-y4dGW0m2.esm.js.map +1 -0
  27. package/dist/chunks/index-yhi0tTdC.esm.js +2 -0
  28. package/dist/chunks/index-yhi0tTdC.esm.js.map +1 -0
  29. package/dist/chunks/localize-m-_ESmpk.esm.js.map +1 -1
  30. package/dist/chunks/localize-o-cYvHQf.esm.js.map +1 -1
  31. package/dist/chunks/{openapi-spec-RlP2IT1i.esm.d.ts → openapi-spec--os_utEo.esm.d.ts} +55 -1
  32. package/dist/chunks/order-page--Xn2Rb6J.esm.js +2 -0
  33. package/dist/chunks/{order-page-KZ7xLkRW.esm.js.map → order-page--Xn2Rb6J.esm.js.map} +1 -1
  34. package/dist/chunks/{order-page-FLhpaZg2.esm.d.ts → order-page-GwRa273v.esm.d.ts} +3 -3
  35. package/dist/chunks/order-page-uEOo5EPy.esm.js +2 -0
  36. package/dist/chunks/{order-page-mlWRT5YL.esm.js.map → order-page-uEOo5EPy.esm.js.map} +1 -1
  37. package/dist/chunks/{promo-pill-label-58PJRvSl.esm.js → promo-pill-label-P1X4xeAx.esm.js} +4 -3
  38. package/dist/chunks/promo-pill-label-P1X4xeAx.esm.js.map +1 -0
  39. package/dist/chunks/{routes-FBB1GA4-.esm.js → routes-F1ZIumMP.esm.js} +2 -2
  40. package/dist/chunks/{routes-FBB1GA4-.esm.js.map → routes-F1ZIumMP.esm.js.map} +1 -1
  41. package/dist/chunks/{routes-NIuAzAOC.esm.d.ts → routes-iurI6dvR.esm.d.ts} +71 -1
  42. package/dist/chunks/{routes-jmFlXAbv.esm.js → routes-sQWfbAoi.esm.js} +2 -2
  43. package/dist/chunks/{routes-jmFlXAbv.esm.js.map → routes-sQWfbAoi.esm.js.map} +1 -1
  44. package/dist/chunks/{share-button-bQ8brpBZ.esm.js → share-button-2RaDSzSs.esm.js} +3 -4
  45. package/dist/chunks/{share-button-hLOsYlSA.esm.js.map → share-button-2RaDSzSs.esm.js.map} +1 -1
  46. package/dist/chunks/{share-button-hLOsYlSA.esm.js → share-button-_QWVlCcB.esm.js} +3 -4
  47. package/dist/chunks/{share-button-bQ8brpBZ.esm.js.map → share-button-_QWVlCcB.esm.js.map} +1 -1
  48. package/dist/chunks/{shoelace-components-leDI-Yop.esm.js → shoelace-components-9s7uTeO6.esm.js} +2 -2
  49. package/dist/chunks/{shoelace-components-leDI-Yop.esm.js.map → shoelace-components-9s7uTeO6.esm.js.map} +1 -1
  50. package/dist/chunks/{shoelace-components-qjNlvvPx.esm.js → shoelace-components-tjFhbEiI.esm.js} +2 -2
  51. package/dist/chunks/{shoelace-components-qjNlvvPx.esm.js.map → shoelace-components-tjFhbEiI.esm.js.map} +1 -1
  52. package/dist/chunks/{update-cart-Hebtxhto.esm.d.ts → update-cart-KjKc8Cls.esm.d.ts} +1 -1
  53. package/dist/chunks/{update-cart-aKQ3Cjc8.esm.js → update-cart-T7h4g2nt.esm.js} +2 -2
  54. package/dist/chunks/{update-cart-aKQ3Cjc8.esm.js.map → update-cart-T7h4g2nt.esm.js.map} +1 -1
  55. package/dist/chunks/{update-cart-j9LPS5By.esm.js → update-cart-WyIeEybK.esm.js} +2 -2
  56. package/dist/chunks/{update-cart-j9LPS5By.esm.js.map → update-cart-WyIeEybK.esm.js.map} +1 -1
  57. package/dist/components/community-impact.esm.js +1 -1
  58. package/dist/components/community-impact.js +1 -1
  59. package/dist/components/cumulative-impact.esm.js +1 -1
  60. package/dist/components/cumulative-impact.esm.js.map +1 -1
  61. package/dist/components/cumulative-impact.js +1 -1
  62. package/dist/components/cumulative-impact.js.map +1 -1
  63. package/dist/components/impact-overview.d.ts +5 -1
  64. package/dist/components/impact-overview.esm.js +31 -25
  65. package/dist/components/impact-overview.esm.js.map +1 -1
  66. package/dist/components/impact-overview.js +31 -25
  67. package/dist/components/impact-overview.js.map +1 -1
  68. package/dist/components/index.d.ts +3 -3
  69. package/dist/components/index.esm.js +1 -1
  70. package/dist/components/index.js +1 -1
  71. package/dist/components/post-purchase.d.ts +4 -2
  72. package/dist/components/post-purchase.esm.js +1 -1
  73. package/dist/components/post-purchase.js +1 -1
  74. package/dist/components/product-details-page.d.ts +6 -1
  75. package/dist/components/product-details-page.esm.js +106 -33
  76. package/dist/components/product-details-page.esm.js.map +1 -1
  77. package/dist/components/product-details-page.js +106 -33
  78. package/dist/components/product-details-page.js.map +1 -1
  79. package/dist/components/redeem-transaction.d.ts +2 -2
  80. package/dist/components/redeem-transaction.esm.js +2 -2
  81. package/dist/components/redeem-transaction.esm.js.map +1 -1
  82. package/dist/components/redeem-transaction.js +2 -2
  83. package/dist/components/redeem-transaction.js.map +1 -1
  84. package/dist/components/select-nonprofit.d.ts +2 -2
  85. package/dist/components/select-nonprofit.esm.js +4 -4
  86. package/dist/components/select-nonprofit.esm.js.map +1 -1
  87. package/dist/components/select-nonprofit.js +4 -4
  88. package/dist/components/select-nonprofit.js.map +1 -1
  89. package/dist/components/select-subscription-nonprofit.esm.js +6 -4
  90. package/dist/components/select-subscription-nonprofit.esm.js.map +1 -1
  91. package/dist/components/select-subscription-nonprofit.js +6 -4
  92. package/dist/components/select-subscription-nonprofit.js.map +1 -1
  93. package/dist/components/shopify.d.ts +6 -6
  94. package/dist/components/shopify.esm.js +1 -1
  95. package/dist/components/shopify.js +1 -1
  96. package/dist/components/social-share.esm.js +1 -1
  97. package/dist/components/social-share.js +1 -1
  98. package/dist/components/subscription-impact.d.ts +2 -0
  99. package/dist/components/subscription-impact.esm.js +1 -1
  100. package/dist/components/subscription-impact.js +1 -1
  101. package/dist/components/subscription-management.d.ts +6 -3
  102. package/dist/components/subscription-management.esm.js +10 -10
  103. package/dist/components/subscription-management.esm.js.map +1 -1
  104. package/dist/components/subscription-management.js +10 -10
  105. package/dist/components/subscription-management.js.map +1 -1
  106. package/dist/index.d.ts +12 -12
  107. package/dist/index.esm.js +1 -1
  108. package/dist/index.js +1 -1
  109. package/dist/integrations/beam.esm.js +1 -1
  110. package/dist/integrations/beam.js +1 -1
  111. package/dist/integrations/cart.d.ts +3 -3
  112. package/dist/integrations/cart.esm.js +1 -1
  113. package/dist/integrations/cart.js +1 -1
  114. package/dist/integrations/index.d.ts +10 -10
  115. package/dist/integrations/index.esm.js +1 -1
  116. package/dist/integrations/index.js +1 -1
  117. package/dist/integrations/logs.d.ts +2 -2
  118. package/dist/integrations/logs.esm.js +1 -1
  119. package/dist/integrations/logs.js +1 -1
  120. package/dist/integrations/shopify.d.ts +5 -5
  121. package/dist/integrations/shopify.esm.js +1 -1
  122. package/dist/integrations/shopify.js +1 -1
  123. package/dist/integrations/statsig.d.ts +3 -0
  124. package/dist/integrations/statsig.esm.js +3 -3
  125. package/dist/integrations/statsig.esm.js.map +1 -1
  126. package/dist/integrations/statsig.js +3 -3
  127. package/dist/integrations/statsig.js.map +1 -1
  128. package/dist/integrations/utils.d.ts +3 -3
  129. package/dist/react/community-impact.esm.js +1 -1
  130. package/dist/react/community-impact.js +1 -1
  131. package/dist/react/cumulative-impact.esm.js +1 -1
  132. package/dist/react/cumulative-impact.js +1 -1
  133. package/dist/react/impact-overview.esm.js +1 -1
  134. package/dist/react/impact-overview.js +1 -1
  135. package/dist/react/index.d.ts +4 -4
  136. package/dist/react/index.esm.js +1 -1
  137. package/dist/react/index.js +1 -1
  138. package/dist/react/post-purchase.d.ts +2 -2
  139. package/dist/react/post-purchase.esm.js +1 -1
  140. package/dist/react/post-purchase.js +1 -1
  141. package/dist/react/product-details-page.d.ts +2 -0
  142. package/dist/react/product-details-page.esm.js +1 -1
  143. package/dist/react/product-details-page.esm.js.map +1 -1
  144. package/dist/react/product-details-page.js +1 -1
  145. package/dist/react/product-details-page.js.map +1 -1
  146. package/dist/react/redeem-transaction.d.ts +3 -3
  147. package/dist/react/redeem-transaction.esm.js +1 -1
  148. package/dist/react/redeem-transaction.js +1 -1
  149. package/dist/react/select-nonprofit.d.ts +3 -3
  150. package/dist/react/select-nonprofit.esm.js +1 -1
  151. package/dist/react/select-nonprofit.js +1 -1
  152. package/dist/react/select-subscription-nonprofit.d.ts +3 -3
  153. package/dist/react/select-subscription-nonprofit.esm.js +1 -1
  154. package/dist/react/select-subscription-nonprofit.js +1 -1
  155. package/dist/react/social-share.esm.js +1 -1
  156. package/dist/react/social-share.js +1 -1
  157. package/dist/react/subscription-impact.esm.js +1 -1
  158. package/dist/react/subscription-impact.js +1 -1
  159. package/dist/react/subscription-management.d.ts +3 -3
  160. package/dist/react/subscription-management.esm.js +1 -1
  161. package/dist/react/subscription-management.js +1 -1
  162. package/dist/utils/events.d.ts +3 -3
  163. package/dist/utils/index.d.ts +3 -3
  164. package/dist/utils/local-storage.esm.js.map +1 -1
  165. package/dist/utils/local-storage.js.map +1 -1
  166. package/package.json +1 -1
  167. package/dist/chunks/_share-dialog-dependencies-R9RsuSGx.esm.js +0 -2
  168. package/dist/chunks/_share-dialog-dependencies-R9RsuSGx.esm.js.map +0 -1
  169. package/dist/chunks/_share-dialog-dependencies-o5GBtNTA.esm.js +0 -2
  170. package/dist/chunks/_share-dialog-dependencies-o5GBtNTA.esm.js.map +0 -1
  171. package/dist/chunks/index-1WxwWfcp.esm.js +0 -2
  172. package/dist/chunks/index-1WxwWfcp.esm.js.map +0 -1
  173. package/dist/chunks/index-4fdLArZg.esm.js +0 -2
  174. package/dist/chunks/index-4fdLArZg.esm.js.map +0 -1
  175. package/dist/chunks/index-Hd_2hpsA.esm.js +0 -2
  176. package/dist/chunks/index-Hd_2hpsA.esm.js.map +0 -1
  177. package/dist/chunks/index-MJNFm2RK.esm.js +0 -2
  178. package/dist/chunks/index-MJNFm2RK.esm.js.map +0 -1
  179. package/dist/chunks/index-gBAASIWa.esm.js +0 -2
  180. package/dist/chunks/index-gBAASIWa.esm.js.map +0 -1
  181. package/dist/chunks/index-lyf1T2wZ.esm.js +0 -2
  182. package/dist/chunks/index-lyf1T2wZ.esm.js.map +0 -1
  183. package/dist/chunks/order-page-KZ7xLkRW.esm.js +0 -2
  184. package/dist/chunks/order-page-mlWRT5YL.esm.js +0 -2
  185. package/dist/chunks/promo-pill-label-58PJRvSl.esm.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm.js";import{u as g,A as D,_ as f,i as u,d as p,a as v}from"../chunks/localize-o-cYvHQf.esm.js";import{D as y,k as x,W as k,S as C}from"../chunks/routes-jmFlXAbv.esm.js";import{makeApiKeyHeader as w}from"../utils/makeApiKeyHeader.esm.js";import{c as $,d as F,e as T}from"../chunks/enforce-config-ZAI7WYAd.esm.js";import{c as S}from"../chunks/responsive-2lC2Wrtg.esm.js";import"../chunks/vendor-GKiOHg2N.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";const G=(r="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=r.startsWith("--beam-")?r:`--beam-${r}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},I=(r="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=r.startsWith("--beam-")?r:`--beam-${r}`;return P(` border-radius: var(${a}-borderRadius, ${e});
2
- border-style: var(${a}-borderStyle, ${t});
3
- border-color: var(${a}-borderColor, ${o});
4
- border-width: var(${a}-borderWidth, ${i});
5
- `)},L=()=>s` <svg
1
+ import{j as v,y as i,f as y,g as n,h as x,k as C}from"../chunks/lit-iNN5L_Qk.esm.js";import{u as g,A as k,_ as w,i as f,d as u,a as $}from"../chunks/localize-o-cYvHQf.esm.js";import{D as S,l as T,W as I,S as F}from"../chunks/routes-sQWfbAoi.esm.js";import{makeApiKeyHeader as z}from"../utils/makeApiKeyHeader.esm.js";import{c as L,d as W,e as B}from"../chunks/enforce-config-ZAI7WYAd.esm.js";import{c as E}from"../chunks/responsive-2lC2Wrtg.esm.js";import"../chunks/vendor-GKiOHg2N.esm.js";import{p as G}from"../chunks/promo-pill-label-P1X4xeAx.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";const A=(s="",{borderRadius:e="0px",borderStyle:o="unset",borderColor:t="#000000",borderWidth:r="1px"}={})=>{const a=s.startsWith("--beam-")?s:`--beam-${s}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:o,[`${a}-borderColor`]:t,[`${a}-borderWidth`]:r}},M=(s="",{borderRadius:e="0px",borderStyle:o="unset",borderColor:t="#000000",borderWidth:r="1px"}={})=>{const a=s.startsWith("--beam-")?s:`--beam-${s}`;return v(` border-radius: var(${a}-borderRadius, ${e});
2
+ border-style: var(${a}-borderStyle, ${o});
3
+ border-color: var(${a}-borderColor, ${t});
4
+ border-width: var(${a}-borderWidth, ${r});
5
+ `)},j=()=>i` <svg
6
6
  xmlns="http://www.w3.org/2000/svg"
7
7
  width="24"
8
8
  height="24"
@@ -17,29 +17,50 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
17
17
  <circle cx="12" cy="12" r="10"></circle>
18
18
  <path d="M12 16v-4"></path>
19
19
  <path d="M12 8h.01"></path>
20
- </svg>`;var W=Object.defineProperty,A=Object.getOwnPropertyDescriptor,n=(r,e,t,o)=>{for(var i=o>1?void 0:o?A(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(o?c(e,t,i):c(i))||i);return o&&i&&W(e,t,i),i};const R="--beam-ProductDetailsPage-imageUrl";class l extends m{constructor(){super(...arguments),this.baseUrl=y,this.lang="en",this.draftConfig=!1,this.debug=!1,this.getProductDetailsPageData=async()=>(T(["apiKey","storeId"],this),await x({baseUrl:this.baseUrl,headers:w(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:k.product_details_page,draftConfig:this.draftConfig}})),this.productDetailsPageDataController=new D(this,this.getProductDetailsPageData)}get configLang(){return C[this.lang]||"en"}async updated(e){const t=["storeId","baseUrl","lang","apiKey"];for(const o of t)if(e.has(o)){await this.productDetailsPageDataController.exec();break}}renderWidgetIcon(){const e=this.cssVariables[R];return e?s`
21
- <span class="icon-container">
22
- <img src=${e} alt="Widget Icon"></img>
23
- </span>
24
- `:s``}render(){const{data:e,loading:t}=this.productDetailsPageDataController;return t?s``:e==null?this.debug?f({error:new Error("No data")}):"":s`
20
+ </svg>`,P={en:{ctaTitle:()=>"Choose your impact",ctaMessage:()=>"At no extra cost, 1% of every order is donated to a nonprofit you choose. Powered by Beam",inlineSeparator:()=>":"},fr:{ctaTitle:()=>"Choisissez l'impact de votre choix",ctaMessage:()=>"Sans frais suppl\xE9mentaires, 1% de chaque commande est revers\xE9 \xE0 l'organisation caritative de votre choix. D\xE9velopp\xE9 par Beam",inlineSeparator:()=>":"},es:{ctaTitle:()=>"Elige el impacto que deseas",ctaMessage:()=>"Sin coste adicional, el 1% de cada pedido se dona a la organizaci\xF3n sin \xE1nimo de lucro que t\xFA elijas. Desarrollado por Beam",inlineSeparator:()=>":"},de:{ctaTitle:()=>"W\xE4hlen Sie Ihren Einfluss",ctaMessage:()=>"Ohne zus\xE4tzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gew\xE4hlte gemeinn\xFCtzige Organisation gespendet. Von Beam unterst\xFCtzt",inlineSeparator:()=>":"},it:{ctaTitle:()=>"Scegliete chi sostenere",ctaMessage:()=>"L'1% di ogni vostro acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a libera scelta. Promosso da Beam",inlineSeparator:()=>":"},pl:{ctaTitle:()=>"Masz wp\u0142yw, dokonaj wyboru",ctaMessage:()=>"1% kwoty ka\u017Cdego zam\xF3wienia jest przekazywane na rzecz wybranej przez Ciebie organizacji non-profit \u2013 bez dodatkowych koszt\xF3w. Obs\u0142ugiwane przez Beam",inlineSeparator:()=>":"}};var H=Object.defineProperty,R=Object.getOwnPropertyDescriptor,c=(s,e,o,t)=>{for(var r=t>1?void 0:t?R(e,o):e,a=s.length-1,d;a>=0;a--)(d=s[a])&&(r=(t?d(e,o,r):d(r))||r);return t&&r&&H(e,o,r),r};const _="--beam-ProductDetailsPage-imageUrl";class l extends x{constructor(){super(...arguments),this.baseUrl=S,this.lang="en",this.draftConfig=!1,this.debug=!1,this.getProductDetailsPageData=async()=>(B(["apiKey","storeId"],this),await T({baseUrl:this.baseUrl,headers:z(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:I.product_details_page,draftConfig:this.draftConfig,remoteProductIdentifier:this.remoteProductIdentifier}})),this.productDetailsPageDataController=new k(this,this.getProductDetailsPageData)}get configLang(){return F[this.lang]||"en"}async updated(e){const o=["storeId","baseUrl","lang","apiKey"];for(const t of o)if(e.has(t)){await this.productDetailsPageDataController.exec();break}}render(){const{data:e,loading:o}=this.productDetailsPageDataController,t=this.cssVariables["--beam-ProductDetailsPage-image-placement"],r=b=>b!=="0px"&&b!=="0",a=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayPromoPill"]==="true",d=!!e?.config?.web?.promo,h=r(this.cssVariables["--beam-ProductDetailsPage-imageHeight"]),D=r(this.cssVariables["--beam-ProductDetailsPage-title-fontSize"]),p=a&&d&&h&&D,m=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayColon"]==="true";return o?i``:e==null?this.debug?w({error:new Error("No data")}):"":i`
25
21
  <style>
26
22
  :host {
27
23
  ${this.cssVariables.toCSS()}
28
24
  }
29
25
  </style>
30
- <div class="root">
31
- ${this.renderWidgetIcon()}
32
- <span class="info-container">
26
+ <div class="root ${t==="block-center"?"block-display":"inline-display"}">
27
+ ${t==="block-center"?i`
28
+ ${this.renderWidgetIcon(t)}
29
+ ${p?i`
30
+ <div class="promo-container">
31
+ <beam-promo-info-pill .promo=${e?.config?.web?.promo}></beam-promo-info-pill>
32
+ </div>
33
+ `:i``}
34
+ <div class="info-container">${this.renderContent(p,m,e)}</div>
35
+ `:i`
36
+ ${p?i`
37
+ <div class="promo-container">
38
+ <beam-promo-info-pill .promo=${e?.config?.web?.promo}></beam-promo-info-pill>
39
+ </div>
40
+ `:i``}
41
+ <div class="content-inline">
42
+ ${this.renderWidgetIcon(t)}
43
+ <div class="info-container">${this.renderContent(p,m,e)}</div>
44
+ </div>
45
+ `}
46
+ </div>
47
+ `}renderWidgetIcon(e){const o=this.cssVariables[_];return o?i`
48
+ <span class="icon-container" part="icon" ${e==="block-center"?'style="order:1"':""}>
49
+ <img src=${o} alt="Widget Icon" />
50
+ </span>
51
+ `:i``}renderContent(e,o,t){const r=f(this.configLang,t?.config?.web?.title)||P[this.configLang].ctaTitle(),a=f(this.configLang,t?.config?.web?.description)||P[this.configLang].ctaMessage();return e?i`
52
+ <div class="info-inline-promo">
53
+ <span class="title">${r+(o?P[this.configLang].inlineSeparator():"")}</span>
54
+ <span class="description"> ${a} ${this.renderDisclosureTooltip()} </span>
55
+ </div>
56
+ `:i`
33
57
  <div class="title-block">
34
- <h3 class="title">${u(this.configLang,e.config?.web?.title)}</h3>
58
+ <h3 class="title">${r}</h3>
35
59
  </div>
36
60
  <div class="description-block">
37
- <span class="description"> ${u(this.configLang,e.config?.web?.description)}</span
38
- >${this.renderDisclosureTooltip()}
61
+ <span class="description"> ${a} ${this.renderDisclosureTooltip()} </span>
39
62
  </div>
40
- </span>
41
- </div>
42
- `}renderCloseTooltipIcon(){return s`<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
63
+ `}renderCloseTooltipIcon(){return i`<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
43
64
  <path
44
65
  d="M5.40836 5.40811L1.48828 1.48804M5.40836 5.40811L9.32843 9.32819M5.40836 5.40811L9.32843 1.48804M5.40836 5.40811L1.48828 9.32819"
45
66
  stroke="white"
@@ -47,18 +68,25 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
47
68
  stroke-linecap="round"
48
69
  stroke-linejoin="round"
49
70
  />
50
- </svg> `}renderDisclosureTooltip(){const e=()=>{const o=this.renderRoot.querySelector(".ppgf-disclosure-tooltip");o.open=!1},t=this.productDetailsPageDataController.data?.ppgfDisclosure;return t?s`<sl-tooltip class="ppgf-disclosure-tooltip">
51
- <div class="ppgf-disclosure-tooltip-content" slot="content">
52
- <button class="ppgf-disclosure-close" aria-label="Close tooltip" @click="${e}">
71
+ </svg> `}renderDisclosureTooltip(){const e=()=>{const t=this.renderRoot.querySelector(".ppgf-disclosure-tooltip");t.open=!1},o=this.productDetailsPageDataController.data?.ppgfDisclosure;return o?i`<sl-tooltip class="ppgf-disclosure-tooltip" part="tooltip">
72
+ <div class="ppgf-disclosure-tooltip-content" slot="content" part="tooltip-content">
73
+ <button
74
+ class="ppgf-disclosure-close"
75
+ aria-label="Close tooltip"
76
+ part="tooltip-close-button"
77
+ @click="${e}"
78
+ >
53
79
  ${this.renderCloseTooltipIcon()}
54
80
  </button>
55
- <div class="ppgf-disclosure-tooltip-copy">${h(t.copy)}</div>
81
+ <div class="ppgf-disclosure-tooltip-copy" part="tooltip-disclosure-copy">
82
+ ${C(o.copy)}
83
+ </div>
56
84
  </div>
57
- <span class="ppgf-disclosure-tooltip-trigger">
85
+ <span class="ppgf-disclosure-tooltip-trigger" part="tooltip-disclosure-icon">
58
86
  <div class="ppgf-disclosure-tooltip-trigger-mask d-lg-none"></div>
59
- ${L()}
87
+ ${j()}
60
88
  </span>
61
- </sl-tooltip>`:s``}renderDisclosureTooltipHyperlink(){const e=this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;return e?s`<a class="ppgf-disclosure-hyperlink" href="${e.url}" target="_blank">${e.copy}</a>`:s``}get cssVariables(){const e={"--beam-ProductDetailsPage-imageWidth":"24px","--beam-ProductDetailsPage-imageHeight":"24px","--beam-ProductDetailsPage-maxWidth":"346px","--beam-ProductDetailsPage-paddingTop":"8px","--beam-ProductDetailsPage-paddingRight":"12px","--beam-ProductDetailsPage-paddingBottom":"8px","--beam-ProductDetailsPage-paddingLeft":"15px","--beam-ProductDetailsPage-InfoContainer-marginLeft":"8px","--beam-ProductDetailsPage-backgroundColor":"unset","--beam-ProductDetailsPage-TooltipIcon-width":"10px","--beam-ProductDetailsPage-TooltipIcon-color":"inherit","--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor":"#000000","--beam-ProductDetailsPage-PPGFDisclosure-paddingTop":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingRight":"8px","--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft":"8px","--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color":"#5CA3FF",...p("--beam-ProductDetailsPage-title",{fontSize:"12px",fontWeight:"bold"}),"--beam-ProductDetailsPage-title-textAlign":"left",...p("--beam-ProductDetailsPage-description",{marginTop:"4px",fontSize:"12px",lineHeight:"15px"}),"--beam-ProductDetailsPage-description-textAlign":"left",...p("--beam-ProductDetailsPage-PPGFDisclosureTooltipContent",{fontSize:"12px",lineHeight:"16px",color:"#FFFFFF"}),...G("--beam-ProductDetailsPage"),"--beam-ProductDetailsPage-close-display":"initial","--beam-ProductDetailsPage-close-padding":"0"},t=this.productDetailsPageDataController?.data?.config?.web?.theme||{},o={...e,...t};return Object.assign(Object.create({toCSS(){return v(this)}}),o)}}l.tagName="beam-product-details-page",l.styles=[$,S,b`
89
+ </sl-tooltip>`:i``}renderDisclosureTooltipHyperlink(){const e=this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;return e?i`<a class="ppgf-disclosure-hyperlink" href="${e.url}" target="_blank">${e.copy}</a>`:i``}get cssVariables(){const e={"--beam-ProductDetailsPage-imageWidth":"24px","--beam-ProductDetailsPage-imageHeight":"24px","--beam-ProductDetailsPage-maxWidth":"346px","--beam-ProductDetailsPage-paddingTop":"8px","--beam-ProductDetailsPage-paddingRight":"12px","--beam-ProductDetailsPage-paddingBottom":"8px","--beam-ProductDetailsPage-paddingLeft":"15px","--beam-ProductDetailsPage-InfoContainer-marginLeft":"8px","--beam-ProductDetailsPage-InfoContainer-textAlign":"inherit","--beam-ProductDetailsPage-InfoContainer-lineHeight":"15px","--beam-ProductDetailsPage-InfoContainer-marginTop":"4px","--beam-ProductDetailsPage-backgroundColor":"unset","--beam-ProductDetailsPage-TooltipIcon-width":"10px","--beam-ProductDetailsPage-TooltipIcon-color":"inherit","--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor":"#000000","--beam-ProductDetailsPage-PPGFDisclosure-paddingTop":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingRight":"8px","--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft":"8px","--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color":"#5CA3FF",...u("--beam-ProductDetailsPage-title",{fontSize:"12px",fontWeight:"bold"}),"--beam-ProductDetailsPage-title-textAlign":"left",...u("--beam-ProductDetailsPage-description",{marginTop:"0px",fontSize:"12px",lineHeight:"15px"}),"--beam-ProductDetailsPage-description-textAlign":"left",...u("--beam-ProductDetailsPage-PPGFDisclosureTooltipContent",{fontSize:"12px",lineHeight:"16px",color:"#FFFFFF"}),...A("--beam-ProductDetailsPage"),"--beam-ProductDetailsPage-close-display":"initial","--beam-ProductDetailsPage-close-padding":"0","--beam-ProductDetailsPage-image-placement":"inline-left","--beam-ProductDetailsPage-blockImage-alignSelf":"center","--beam-ProductDetailsPage-promoPill-marginTop":"4px","--beam-ProductDetailsPage-promoPill-alignSelf":"left","--beam-ProductDetailsPage-shouldDisplayColon":"true","--beam-ProductDetailsPage-shouldDisplayPromoPill":"true",...G},o=this.productDetailsPageDataController?.data?.config?.web?.theme||{},t={...e,...o};return Object.assign(Object.create({toCSS(){return $(this)}}),t)}}l.tagName="beam-product-details-page",l.styles=[L,E,y`
62
90
  :host {
63
91
  font-family: var(--beam-fontFamily);
64
92
  font-style: var(--beam-fontStyle);
@@ -70,19 +98,62 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
70
98
  display: block;
71
99
  }
72
100
  .root {
73
- display: flex;
74
- align-items: center;
75
101
  padding-top: var(--beam-ProductDetailsPage-paddingTop);
76
102
  padding-right: var(--beam-ProductDetailsPage-paddingRight);
77
103
  padding-bottom: var(--beam-ProductDetailsPage-paddingBottom);
78
104
  padding-left: var(--beam-ProductDetailsPage-paddingLeft);
79
105
  width: 100%;
80
106
  background-color: var(--beam-ProductDetailsPage-backgroundColor);
81
- ${I("--beam-ProductDetailsPage")}
107
+ display: flex;
108
+ flex-direction: column;
109
+ ${M("--beam-ProductDetailsPage")}
110
+ }
111
+ /* When iconDisplay is inline-center */
112
+ .inline-display {
113
+ display: flex;
114
+ }
115
+ /* When iconDisplay is block-center */
116
+ .block-display {
117
+ display: flex;
118
+ flex-direction: column;
119
+ align-items: center;
120
+ justify-content: center;
121
+ }
122
+ .promo-container {
123
+ order: 2;
124
+ display: flex;
125
+ margin-top: var(--beam-ProductDetailsPage-promoPill-marginTop);
126
+ align-self: var(--beam-ProductDetailsPage-promoPill-alignSelf);
127
+ }
128
+ .content-inline {
129
+ order: 3;
130
+ display: flex;
131
+ align-items: center;
132
+ }
133
+ /* Info block for both inline and block layout */
134
+ .info-container {
135
+ display: flex;
136
+ flex-direction: column;
137
+ justify-content: center;
138
+ text-align: var(--beam-ProductDetailsPage-InfoContainer-textAlign);
139
+ line-height: var(--beam-ProductDetailsPage-InfoContainer-lineHeight);
140
+ margin-top: var(--beam-ProductDetailsPage-InfoContainer-marginTop);
141
+ margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);
142
+ }
143
+ .block-display .info-container {
144
+ order: 3;
145
+ }
146
+ .root.inline-display .icon-container,
147
+ .root.inline-display .info-container {
148
+ display: inline-flex;
149
+ }
150
+ .root.inline-display {
151
+ flex-direction: column;
82
152
  }
83
153
  .icon-container {
84
154
  width: var(--beam-ProductDetailsPage-imageWidth);
85
155
  height: var(--beam-ProductDetailsPage-imageHeight);
156
+ align-self: var(--beam-ProductDetailsPage-blockImage-alignSelf);
86
157
  flex-shrink: 0;
87
158
  }
88
159
  .icon-container > img {
@@ -90,9 +161,6 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
90
161
  height: 100%;
91
162
  object-fit: contain;
92
163
  }
93
- .info-container {
94
- margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);
95
- }
96
164
  .title {
97
165
  ${g("--beam-ProductDetailsPage-title")}
98
166
  }
@@ -100,12 +168,16 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
100
168
  text-align: var(--beam-ProductDetailsPage-title-textAlign);
101
169
  line-height: var(--beam-ProductDetailsPage-title-lineHeight);
102
170
  }
171
+ .info-inline-promo {
172
+ margin-top: var(--beam-ProductDetailsPage-description-marginTop, 0px);
173
+ }
103
174
  .description {
104
175
  ${g("--beam-ProductDetailsPage-description")}
105
176
  }
106
177
  .description-block {
107
178
  text-align: var(--beam-ProductDetailsPage-description-textAlign);
108
179
  line-height: var(--beam-ProductDetailsPage-description-lineHeight);
180
+ ${g("--beam-ProductDetailsPage-description")}
109
181
  }
110
182
  .ppgf-disclosure-tooltip {
111
183
  --max-width: 268px;
@@ -143,6 +215,7 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
143
215
  }
144
216
  .ppgf-disclosure-tooltip-trigger {
145
217
  position: relative;
218
+ vertical-align: text-bottom;
146
219
  }
147
220
  .ppgf-disclosure-tooltip-trigger-mask {
148
221
  position: absolute;
@@ -158,5 +231,5 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
158
231
  height: auto;
159
232
  vertical-align: middle;
160
233
  }
161
- `],n([d({type:String,reflect:!0})],l.prototype,"baseUrl",2),n([d({type:String,reflect:!1})],l.prototype,"apiKey",2),n([d({type:Number})],l.prototype,"storeId",2),n([d({type:String})],l.prototype,"lang",2),n([d({type:Boolean})],l.prototype,"draftConfig",2),n([d({type:Boolean})],l.prototype,"debug",2),F(l);export{l as BeamProductDetailsPage};
234
+ `],c([n({type:String,reflect:!0})],l.prototype,"baseUrl",2),c([n({type:String,reflect:!1})],l.prototype,"apiKey",2),c([n({type:Number})],l.prototype,"storeId",2),c([n({type:String})],l.prototype,"lang",2),c([n({type:Boolean})],l.prototype,"draftConfig",2),c([n({type:Boolean})],l.prototype,"debug",2),c([n({type:String})],l.prototype,"remoteProductIdentifier",2),W(l);export{l as BeamProductDetailsPage};
162
235
  //# sourceMappingURL=product-details-page.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-details-page.esm.js","sources":["../../src/shared/fragments/custom-border.ts","../../src/shared/fragments/info.ts","../../src/components/product-details-page/index.ts"],"sourcesContent":["import { CSSResult, unsafeCSS } from \"lit\";\n\nexport const defineCustomBorder = (\n namespace = \"\",\n { borderRadius = \"0px\", borderStyle = \"unset\", borderColor = \"#000000\", borderWidth = \"1px\" } = {}\n): Record<string, string> => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return {\n [`${prefix}-borderRadius`]: borderRadius,\n [`${prefix}-borderStyle`]: borderStyle,\n [`${prefix}-borderColor`]: borderColor,\n [`${prefix}-borderWidth`]: borderWidth,\n };\n};\n\nexport const useCustomBorder = (\n namespace = \"\",\n { borderRadius = \"0px\", borderStyle = \"unset\", borderColor = \"#000000\", borderWidth = \"1px\" } = {}\n): CSSResult => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return unsafeCSS(`\\\n border-radius: var(${prefix}-borderRadius, ${borderRadius});\n border-style: var(${prefix}-borderStyle, ${borderStyle});\n border-color: var(${prefix}-borderColor, ${borderColor});\n border-width: var(${prefix}-borderWidth, ${borderWidth});\n `);\n};\n","import { html } from \"lit\";\n\nexport const _info = () => html` <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n part=\"svg\"\n>\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <path d=\"M12 16v-4\"></path>\n <path d=\"M12 8h.01\"></path>\n</svg>`;\n","import { LitElement, css, html } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { getProductDetailsPage } from \"../../api-sdk/v3/routes\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES, WIDGET_NAMES } from \"../../api-sdk/constants\";\nimport { LANGUAGES, TUrl } from \"../../api-sdk/types\";\nimport { makeApiKeyHeader } from \"../../utils/makeApiKeyHeader\";\nimport { MissingConfig } from \"../../utils/beam-errors\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { cssResponsiveUtils } from \"../../shared/responsive\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { defineCustomBorder, useCustomBorder } from \"../../shared/fragments/custom-border\";\n// shoelace html tag imports\nimport \"@shoelace-style/shoelace/dist/components/tooltip/tooltip.js\";\nimport { _info } from \"../../shared/fragments/info\";\n\ntype RequiredConfig = {\n apiKey: string;\n storeId: number;\n};\n\nconst IMAGE_URL_REMOTE_CONFIG_KEY = \"--beam-ProductDetailsPage-imageUrl\";\n\nexport class BeamProductDetailsPage extends LitElement {\n static tagName = \"beam-product-details-page\";\n\n @property({ type: String, reflect: true }) public baseUrl: TUrl = DEFAULT_BASE_URL;\n\n @property({ type: String, reflect: false }) apiKey?: RequiredConfig[\"apiKey\"];\n\n @property({ type: Number }) storeId?: number;\n\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n\n @property({ type: Boolean }) public draftConfig = false;\n\n @property({ type: Boolean }) public debug = false;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n getProductDetailsPageData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"storeId\"], this)) throw new MissingConfig();\n\n const res = await getProductDetailsPage({\n baseUrl: this.baseUrl,\n headers: makeApiKeyHeader(this.apiKey),\n queryParams: {\n version: \"1.0.0\",\n lang: this.configLang,\n storeId: this.storeId,\n widgetName: WIDGET_NAMES.product_details_page,\n draftConfig: this.draftConfig,\n },\n });\n return res;\n };\n\n private productDetailsPageDataController = new AsyncController<typeof this.getProductDetailsPageData>(\n this,\n this.getProductDetailsPageData\n );\n\n async updated(changedProperties: Map<string, unknown>) {\n const requireNewDataProps = [\"storeId\", \"baseUrl\", \"lang\", \"apiKey\"];\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n await this.productDetailsPageDataController.exec();\n break;\n }\n }\n }\n\n renderWidgetIcon() {\n const imageUrl = this.cssVariables[IMAGE_URL_REMOTE_CONFIG_KEY];\n\n return imageUrl\n ? html`\n <span class=\"icon-container\">\n <img src=${imageUrl} alt=\"Widget Icon\"></img>\n </span>\n `\n : html``;\n }\n\n render() {\n const { data, loading } = this.productDetailsPageDataController;\n if (loading) {\n return html``;\n }\n if (data == null) {\n if (this.debug) {\n return _errorMessage({ error: new Error(\"No data\") });\n }\n return \"\";\n }\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <div class=\"root\">\n ${this.renderWidgetIcon()}\n <span class=\"info-container\">\n <div class=\"title-block\">\n <h3 class=\"title\">${localizeUserString(this.configLang, data.config?.web?.title)}</h3>\n </div>\n <div class=\"description-block\">\n <span class=\"description\"> ${localizeUserString(this.configLang, data.config?.web?.description)}</span\n >${this.renderDisclosureTooltip()}\n </div>\n </span>\n </div>\n `;\n }\n\n renderCloseTooltipIcon() {\n return html`<svg width=\"11\" height=\"11\" viewBox=\"0 0 11 11\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M5.40836 5.40811L1.48828 1.48804M5.40836 5.40811L9.32843 9.32819M5.40836 5.40811L9.32843 1.48804M5.40836 5.40811L1.48828 9.32819\"\n stroke=\"white\"\n stroke-width=\"1.56803\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg> `;\n }\n\n /* PayPal Giving Fund Disclosure */\n renderDisclosureTooltip() {\n const onClickClose = () => {\n // due to being strictly html, we need to assume any when overriding shoelace properties\n const tooltip = this.renderRoot.querySelector(\".ppgf-disclosure-tooltip\") as any;\n tooltip.open = false;\n };\n const ppgfDisclosure = this.productDetailsPageDataController.data?.ppgfDisclosure;\n return ppgfDisclosure\n ? html`<sl-tooltip class=\"ppgf-disclosure-tooltip\">\n <div class=\"ppgf-disclosure-tooltip-content\" slot=\"content\">\n <button class=\"ppgf-disclosure-close\" aria-label=\"Close tooltip\" @click=\"${onClickClose}\">\n ${this.renderCloseTooltipIcon()}\n </button>\n <div class=\"ppgf-disclosure-tooltip-copy\">${unsafeHTML(ppgfDisclosure.copy)}</div>\n </div>\n <span class=\"ppgf-disclosure-tooltip-trigger\">\n <div class=\"ppgf-disclosure-tooltip-trigger-mask d-lg-none\"></div>\n ${_info()}\n </span>\n </sl-tooltip>`\n : html``;\n }\n\n renderDisclosureTooltipHyperlink() {\n const ppgfHyperlink = this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;\n return ppgfHyperlink\n ? html`<a class=\"ppgf-disclosure-hyperlink\" href=\"${ppgfHyperlink.url}\" target=\"_blank\">${ppgfHyperlink.copy}</a>`\n : html``;\n }\n /* End PayPal Giving Fund Disclosure */\n\n public get cssVariables() {\n const defaults = {\n \"--beam-ProductDetailsPage-imageWidth\": \"24px\",\n \"--beam-ProductDetailsPage-imageHeight\": \"24px\",\n \"--beam-ProductDetailsPage-maxWidth\": \"346px\",\n \"--beam-ProductDetailsPage-paddingTop\": \"8px\",\n \"--beam-ProductDetailsPage-paddingRight\": \"12px\",\n \"--beam-ProductDetailsPage-paddingBottom\": \"8px\",\n \"--beam-ProductDetailsPage-paddingLeft\": \"15px\",\n \"--beam-ProductDetailsPage-InfoContainer-marginLeft\": \"8px\",\n \"--beam-ProductDetailsPage-backgroundColor\": \"unset\",\n \"--beam-ProductDetailsPage-TooltipIcon-width\": \"10px\",\n \"--beam-ProductDetailsPage-TooltipIcon-color\": \"inherit\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor\": \"#000000\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingTop\": \"10px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingRight\": \"8px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom\": \"10px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft\": \"8px\",\n \"--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color\": \"#5CA3FF\",\n ...defineCustomText(\"--beam-ProductDetailsPage-title\", {\n fontSize: \"12px\",\n fontWeight: \"bold\",\n }),\n \"--beam-ProductDetailsPage-title-textAlign\": \"left\",\n ...defineCustomText(\"--beam-ProductDetailsPage-description\", {\n marginTop: \"4px\",\n fontSize: \"12px\",\n lineHeight: \"15px\",\n }),\n \"--beam-ProductDetailsPage-description-textAlign\": \"left\",\n ...defineCustomText(\"--beam-ProductDetailsPage-PPGFDisclosureTooltipContent\", {\n fontSize: \"12px\",\n lineHeight: \"16px\",\n color: \"#FFFFFF\",\n }),\n ...defineCustomBorder(\"--beam-ProductDetailsPage\"),\n \"--beam-ProductDetailsPage-close-display\": \"initial\",\n \"--beam-ProductDetailsPage-close-padding\": \"0\",\n };\n const remoteConfig = this.productDetailsPageDataController?.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n cssResponsiveUtils,\n css`\n :host {\n font-family: var(--beam-fontFamily);\n font-style: var(--beam-fontStyle);\n font-size: var(--beam-fontSize);\n background-color: var(--beam-backgroundColor);\n color: var(--beam-textColor);\n max-width: var(--beam-ProductDetailsPage-maxWidth);\n word-break: normal;\n display: block;\n }\n .root {\n display: flex;\n align-items: center;\n padding-top: var(--beam-ProductDetailsPage-paddingTop);\n padding-right: var(--beam-ProductDetailsPage-paddingRight);\n padding-bottom: var(--beam-ProductDetailsPage-paddingBottom);\n padding-left: var(--beam-ProductDetailsPage-paddingLeft);\n width: 100%;\n background-color: var(--beam-ProductDetailsPage-backgroundColor);\n ${useCustomBorder(\"--beam-ProductDetailsPage\")}\n }\n .icon-container {\n width: var(--beam-ProductDetailsPage-imageWidth);\n height: var(--beam-ProductDetailsPage-imageHeight);\n flex-shrink: 0;\n }\n .icon-container > img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .info-container {\n margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);\n }\n .title {\n ${useCustomText(\"--beam-ProductDetailsPage-title\")}\n }\n .title-block {\n text-align: var(--beam-ProductDetailsPage-title-textAlign);\n line-height: var(--beam-ProductDetailsPage-title-lineHeight);\n }\n .description {\n ${useCustomText(\"--beam-ProductDetailsPage-description\")}\n }\n .description-block {\n text-align: var(--beam-ProductDetailsPage-description-textAlign);\n line-height: var(--beam-ProductDetailsPage-description-lineHeight);\n }\n .ppgf-disclosure-tooltip {\n --max-width: 268px;\n }\n .ppgf-disclosure-tooltip::part(body) {\n background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);\n padding-top: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingTop);\n padding-right: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingRight);\n padding-bottom: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom);\n padding-left: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft);\n }\n .ppgf-disclosure-tooltip::part(base__arrow) {\n background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);\n }\n .ppgf-disclosure-tooltip-content {\n display: flex;\n flex-direction: column;\n ${useCustomText(\"--beam-ProductDetailsPage-PPGFDisclosureTooltipContent\")}\n }\n .ppgf-disclosure-tooltip-copy > a,\n .ppgf-disclosure-close {\n pointer-events: auto;\n color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);\n }\n .ppgf-disclosure-close {\n display: var(--beam-ProductDetailsPage-close-display);\n padding: var(--beam-ProductDetailsPage-close-padding);\n height: 12px;\n background: none;\n border: none;\n margin-left: auto;\n }\n .ppgf-disclosure-tooltip-copy > a:visited {\n color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);\n }\n .ppgf-disclosure-tooltip-trigger {\n position: relative;\n }\n .ppgf-disclosure-tooltip-trigger-mask {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: calc(var(--beam-ProductDetailsPage-TooltipIcon-width) + 20px);\n height: calc(var(--beam-ProductDetailsPage-TooltipIcon-width) + 20px);\n }\n .ppgf-disclosure-tooltip-trigger > svg {\n width: var(--beam-ProductDetailsPage-TooltipIcon-width);\n color: var(--beam-ProductDetailsPage-TooltipIcon-color);\n height: auto;\n vertical-align: middle;\n }\n `,\n ];\n}\n\ndefineCustomElement(BeamProductDetailsPage);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-product-details-page\": BeamProductDetailsPage;\n }\n}\n"],"names":["defineCustomBorder","namespace","borderRadius","borderStyle","borderColor","borderWidth","prefix","useCustomBorder","unsafeCSS","_info","html","IMAGE_URL_REMOTE_CONFIG_KEY","BeamProductDetailsPage","LitElement","DEFAULT_BASE_URL","enforceConfig","getProductDetailsPage","makeApiKeyHeader","WIDGET_NAMES","AsyncController","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","imageUrl","data","loading","_errorMessage","localizeUserString","onClickClose","tooltip","ppgfDisclosure","unsafeHTML","ppgfHyperlink","defaults","defineCustomText","remoteConfig","config","_cssVariableMap","cssReset","cssResponsiveUtils","css","useCustomText","__decorateClass","property","defineCustomElement"],"mappings":"ujBAEO,MAAMA,EAAqB,CAChCC,EAAY,GACZ,CAAE,aAAAC,EAAe,MAAO,YAAAC,EAAc,QAAS,YAAAC,EAAc,UAAW,YAAAC,EAAc,KAAM,EAAI,CAAA,IACrE,CAC3B,MAAMC,EAASL,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,MAAO,CACL,CAAC,GAAGK,CAAM,eAAe,EAAGJ,EAC5B,CAAC,GAAGI,CAAM,cAAc,EAAGH,EAC3B,CAAC,GAAGG,CAAM,cAAc,EAAGF,EAC3B,CAAC,GAAGE,CAAM,cAAc,EAAGD,CAC7B,CACF,EAEaE,EAAkB,CAC7BN,EAAY,GACZ,CAAE,aAAAC,EAAe,MAAO,YAAAC,EAAc,QAAS,YAAAC,EAAc,UAAW,YAAAC,EAAc,KAAM,EAAI,CAClF,IAAA,CACd,MAAMC,EAASL,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,OAAOO,EAAU,8BACUF,CAAM,kBAAkBJ,CAAY;AAAA,4BACrCI,CAAM,iBAAiBH,CAAW;AAAA,4BAClCG,CAAM,iBAAiBF,CAAW;AAAA,4BAClCE,CAAM,iBAAiBD,CAAW;AAAA,KACzD,CACL,ECxBaI,EAAQ,IAAMC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAA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GuC,uBAEN+B,EAAA,CAA3CC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAM,CAAC,CAL/B,EAAAhC,EAKiC,UAEhB+B,SAAAA,CAAAA,EAAAA,EAAA,CAA3BC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAPfhC,EAOiB,UAAA,UAAA,CAAA,EAEO+B,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EATfhC,EASwB,UAAA,OAAA,CAAA,EAEC+B,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAXhB,EAAAhC,EAWyB,UAEA+B,cAAAA,CAAAA,EAAAA,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAbhBhC,EAayB,UAAA,QAAA,CAAA,EA6RtCiC,EAAoBjC,CAAsB"}
1
+ {"version":3,"file":"product-details-page.esm.js","sources":["../../src/shared/fragments/custom-border.ts","../../src/shared/fragments/info.ts","../../src/components/product-details-page/strings.ts","../../src/components/product-details-page/index.ts"],"sourcesContent":["import { CSSResult, unsafeCSS } from \"lit\";\n\nexport const defineCustomBorder = (\n namespace = \"\",\n { borderRadius = \"0px\", borderStyle = \"unset\", borderColor = \"#000000\", borderWidth = \"1px\" } = {}\n): Record<string, string> => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return {\n [`${prefix}-borderRadius`]: borderRadius,\n [`${prefix}-borderStyle`]: borderStyle,\n [`${prefix}-borderColor`]: borderColor,\n [`${prefix}-borderWidth`]: borderWidth,\n };\n};\n\nexport const useCustomBorder = (\n namespace = \"\",\n { borderRadius = \"0px\", borderStyle = \"unset\", borderColor = \"#000000\", borderWidth = \"1px\" } = {}\n): CSSResult => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return unsafeCSS(`\\\n border-radius: var(${prefix}-borderRadius, ${borderRadius});\n border-style: var(${prefix}-borderStyle, ${borderStyle});\n border-color: var(${prefix}-borderColor, ${borderColor});\n border-width: var(${prefix}-borderWidth, ${borderWidth});\n `);\n};\n","import { html } from \"lit\";\n\nexport const _info = () => html` <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n part=\"svg\"\n>\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <path d=\"M12 16v-4\"></path>\n <path d=\"M12 8h.01\"></path>\n</svg>`;\n","export const strings = {\n en: {\n ctaTitle: () => `Choose your impact`,\n ctaMessage: () => `At no extra cost, 1% of every order is donated to a nonprofit you choose. Powered by Beam`,\n inlineSeparator: () => `:`,\n },\n fr: {\n ctaTitle: () => `Choisissez l'impact de votre choix`,\n ctaMessage: () =>\n `Sans frais supplémentaires, 1% de chaque commande est reversé à l'organisation caritative de votre choix. Développé par Beam`,\n inlineSeparator: () => `:`,\n },\n es: {\n ctaTitle: () => `Elige el impacto que deseas`,\n ctaMessage: () =>\n `Sin coste adicional, el 1% de cada pedido se dona a la organización sin ánimo de lucro que tú elijas. Desarrollado por Beam`,\n inlineSeparator: () => `:`,\n },\n de: {\n ctaTitle: () => `Wählen Sie Ihren Einfluss`,\n ctaMessage: () =>\n `Ohne zusätzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gewählte gemeinnützige Organisation gespendet. Von Beam unterstützt`,\n inlineSeparator: () => `:`,\n },\n it: {\n ctaTitle: () => `Scegliete chi sostenere`,\n ctaMessage: () =>\n `L'1% di ogni vostro acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a libera scelta. Promosso da Beam`,\n inlineSeparator: () => `:`,\n },\n pl: {\n ctaTitle: () => `Masz wpływ, dokonaj wyboru`,\n ctaMessage: () =>\n `1% kwoty każdego zamówienia jest przekazywane na rzecz wybranej przez Ciebie organizacji non-profit – bez dodatkowych kosztów. Obsługiwane przez Beam`,\n inlineSeparator: () => `:`,\n },\n};\n","import { LitElement, css, html } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { getProductDetailsPage } from \"../../api-sdk/v3/routes\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES, WIDGET_NAMES } from \"../../api-sdk/constants\";\nimport { LANGUAGES, TUrl } from \"../../api-sdk/types\";\nimport { makeApiKeyHeader } from \"../../utils/makeApiKeyHeader\";\nimport { MissingConfig } from \"../../utils/beam-errors\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { cssResponsiveUtils } from \"../../shared/responsive\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { defineCustomBorder, useCustomBorder } from \"../../shared/fragments/custom-border\";\n// shoelace html tag imports\nimport \"@shoelace-style/shoelace/dist/components/tooltip/tooltip.js\";\nimport { _info } from \"../../shared/fragments/info\";\nimport { promoPillLabelConfigDefaults } from \"../../shared/components/promo-pill-label\";\nimport { strings } from \"./strings\";\nimport \"../../shared/components/promo-pill-label\";\n\ntype RequiredConfig = {\n apiKey: string;\n storeId: number;\n};\ntype IAPIV3GetProductDetailsPage = Awaited<ReturnType<typeof getProductDetailsPage>>;\n\nconst IMAGE_URL_REMOTE_CONFIG_KEY = \"--beam-ProductDetailsPage-imageUrl\";\n\nexport class BeamProductDetailsPage extends LitElement {\n static tagName = \"beam-product-details-page\";\n\n @property({ type: String, reflect: true }) public baseUrl: TUrl = DEFAULT_BASE_URL;\n\n @property({ type: String, reflect: false }) apiKey?: RequiredConfig[\"apiKey\"];\n\n @property({ type: Number }) storeId?: number;\n\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n\n @property({ type: Boolean }) public draftConfig = false;\n\n @property({ type: Boolean }) public debug = false;\n\n @property({ type: String }) remoteProductIdentifier?: string;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n getProductDetailsPageData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"storeId\"], this)) throw new MissingConfig();\n\n const res = await getProductDetailsPage({\n baseUrl: this.baseUrl,\n headers: makeApiKeyHeader(this.apiKey),\n queryParams: {\n version: \"1.0.0\",\n lang: this.configLang,\n storeId: this.storeId,\n widgetName: WIDGET_NAMES.product_details_page,\n draftConfig: this.draftConfig,\n remoteProductIdentifier: this.remoteProductIdentifier,\n },\n });\n return res;\n };\n\n private productDetailsPageDataController = new AsyncController<typeof this.getProductDetailsPageData>(\n this,\n this.getProductDetailsPageData\n );\n\n async updated(changedProperties: Map<string, unknown>) {\n const requireNewDataProps = [\"storeId\", \"baseUrl\", \"lang\", \"apiKey\"];\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n await this.productDetailsPageDataController.exec();\n break;\n }\n }\n }\n\n render() {\n const { data, loading } = this.productDetailsPageDataController;\n const iconDisplay = this.cssVariables[\"--beam-ProductDetailsPage-image-placement\"];\n const isNonZero = (value: string) => value !== \"0px\" && value !== \"0\";\n const shouldDisplayPromoPill = this.cssVariables[\"--beam-ProductDetailsPage-shouldDisplayPromoPill\"] === \"true\";\n const isPromoActive = !!data?.config?.web?.promo;\n const hasValidImageHeight = isNonZero(this.cssVariables[\"--beam-ProductDetailsPage-imageHeight\"]);\n const hasValidTitleFontSize = isNonZero(this.cssVariables[\"--beam-ProductDetailsPage-title-fontSize\"]);\n const isPromoPillVisible =\n shouldDisplayPromoPill && // Determines if the promo pill is enabled for the marketing version of the PDP\n isPromoActive && // Is promo currently active\n hasValidImageHeight && // Ensures the promo pill is not displayed for the subtext version of the PDP\n hasValidTitleFontSize; // Ensures the promo pill is not displayed for the subtext version of the PDP\n const shouldShowPunctuation = this.cssVariables[\"--beam-ProductDetailsPage-shouldDisplayColon\"] === \"true\"; // Determines if a colon should be displayed in promo display\n if (loading) {\n return html``;\n }\n if (data == null) {\n if (this.debug) {\n return _errorMessage({ error: new Error(\"No data\") });\n }\n return \"\";\n }\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <div class=\"root ${iconDisplay === \"block-center\" ? \"block-display\" : \"inline-display\"}\">\n ${iconDisplay === \"block-center\"\n ? html`\n ${this.renderWidgetIcon(iconDisplay)}\n ${isPromoPillVisible\n ? html`\n <div class=\"promo-container\">\n <beam-promo-info-pill .promo=${data?.config?.web?.promo}></beam-promo-info-pill>\n </div>\n `\n : html``}\n <div class=\"info-container\">${this.renderContent(isPromoPillVisible, shouldShowPunctuation, data)}</div>\n `\n : html`\n ${isPromoPillVisible\n ? html`\n <div class=\"promo-container\">\n <beam-promo-info-pill .promo=${data?.config?.web?.promo}></beam-promo-info-pill>\n </div>\n `\n : html``}\n <div class=\"content-inline\">\n ${this.renderWidgetIcon(iconDisplay)}\n <div class=\"info-container\">${this.renderContent(isPromoPillVisible, shouldShowPunctuation, data)}</div>\n </div>\n `}\n </div>\n `;\n }\n\n renderWidgetIcon(iconDisplay: string) {\n const imageUrl = this.cssVariables[IMAGE_URL_REMOTE_CONFIG_KEY];\n\n if (!imageUrl) return html``;\n\n const isBlockDisplay = iconDisplay === \"block-center\";\n const containerStyle = isBlockDisplay ? 'style=\"order:1\"' : \"\";\n\n return html`\n <span class=\"icon-container\" part=\"icon\" ${containerStyle}>\n <img src=${imageUrl} alt=\"Widget Icon\" />\n </span>\n `;\n }\n\n renderContent(isPromoPillVisible: boolean, shouldDisplayColon: boolean, data: IAPIV3GetProductDetailsPage) {\n const title = localizeUserString(this.configLang, data?.config?.web?.title) || strings[this.configLang].ctaTitle();\n const description =\n localizeUserString(this.configLang, data?.config?.web?.description) || strings[this.configLang].ctaMessage();\n return isPromoPillVisible\n ? html`\n <div class=\"info-inline-promo\">\n <span class=\"title\">${title + (shouldDisplayColon ? strings[this.configLang].inlineSeparator() : \"\")}</span>\n <span class=\"description\"> ${description} ${this.renderDisclosureTooltip()} </span>\n </div>\n `\n : html`\n <div class=\"title-block\">\n <h3 class=\"title\">${title}</h3>\n </div>\n <div class=\"description-block\">\n <span class=\"description\"> ${description} ${this.renderDisclosureTooltip()} </span>\n </div>\n `;\n }\n\n renderCloseTooltipIcon() {\n return html`<svg width=\"11\" height=\"11\" viewBox=\"0 0 11 11\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M5.40836 5.40811L1.48828 1.48804M5.40836 5.40811L9.32843 9.32819M5.40836 5.40811L9.32843 1.48804M5.40836 5.40811L1.48828 9.32819\"\n stroke=\"white\"\n stroke-width=\"1.56803\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg> `;\n }\n\n /* PayPal Giving Fund Disclosure */\n renderDisclosureTooltip() {\n const onClickClose = () => {\n // due to being strictly html, we need to assume any when overriding shoelace properties\n const tooltip = this.renderRoot.querySelector(\".ppgf-disclosure-tooltip\") as any;\n tooltip.open = false;\n };\n const ppgfDisclosure = this.productDetailsPageDataController.data?.ppgfDisclosure;\n return ppgfDisclosure\n ? html`<sl-tooltip class=\"ppgf-disclosure-tooltip\" part=\"tooltip\">\n <div class=\"ppgf-disclosure-tooltip-content\" slot=\"content\" part=\"tooltip-content\">\n <button\n class=\"ppgf-disclosure-close\"\n aria-label=\"Close tooltip\"\n part=\"tooltip-close-button\"\n @click=\"${onClickClose}\"\n >\n ${this.renderCloseTooltipIcon()}\n </button>\n <div class=\"ppgf-disclosure-tooltip-copy\" part=\"tooltip-disclosure-copy\">\n ${unsafeHTML(ppgfDisclosure.copy)}\n </div>\n </div>\n <span class=\"ppgf-disclosure-tooltip-trigger\" part=\"tooltip-disclosure-icon\">\n <div class=\"ppgf-disclosure-tooltip-trigger-mask d-lg-none\"></div>\n ${_info()}\n </span>\n </sl-tooltip>`\n : html``;\n }\n\n renderDisclosureTooltipHyperlink() {\n const ppgfHyperlink = this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;\n return ppgfHyperlink\n ? html`<a class=\"ppgf-disclosure-hyperlink\" href=\"${ppgfHyperlink.url}\" target=\"_blank\">${ppgfHyperlink.copy}</a>`\n : html``;\n }\n /* End PayPal Giving Fund Disclosure */\n\n public get cssVariables() {\n const defaults = {\n \"--beam-ProductDetailsPage-imageWidth\": \"24px\",\n \"--beam-ProductDetailsPage-imageHeight\": \"24px\",\n \"--beam-ProductDetailsPage-maxWidth\": \"346px\",\n \"--beam-ProductDetailsPage-paddingTop\": \"8px\",\n \"--beam-ProductDetailsPage-paddingRight\": \"12px\",\n \"--beam-ProductDetailsPage-paddingBottom\": \"8px\",\n \"--beam-ProductDetailsPage-paddingLeft\": \"15px\",\n \"--beam-ProductDetailsPage-InfoContainer-marginLeft\": \"8px\",\n \"--beam-ProductDetailsPage-InfoContainer-textAlign\": \"inherit\",\n \"--beam-ProductDetailsPage-InfoContainer-lineHeight\": \"15px\",\n \"--beam-ProductDetailsPage-InfoContainer-marginTop\": \"4px\",\n \"--beam-ProductDetailsPage-backgroundColor\": \"unset\",\n \"--beam-ProductDetailsPage-TooltipIcon-width\": \"10px\",\n \"--beam-ProductDetailsPage-TooltipIcon-color\": \"inherit\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor\": \"#000000\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingTop\": \"10px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingRight\": \"8px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom\": \"10px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft\": \"8px\",\n \"--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color\": \"#5CA3FF\",\n ...defineCustomText(\"--beam-ProductDetailsPage-title\", {\n fontSize: \"12px\",\n fontWeight: \"bold\",\n }),\n \"--beam-ProductDetailsPage-title-textAlign\": \"left\",\n ...defineCustomText(\"--beam-ProductDetailsPage-description\", {\n marginTop: \"0px\",\n fontSize: \"12px\",\n lineHeight: \"15px\",\n }),\n \"--beam-ProductDetailsPage-description-textAlign\": \"left\",\n ...defineCustomText(\"--beam-ProductDetailsPage-PPGFDisclosureTooltipContent\", {\n fontSize: \"12px\",\n lineHeight: \"16px\",\n color: \"#FFFFFF\",\n }),\n ...defineCustomBorder(\"--beam-ProductDetailsPage\"),\n \"--beam-ProductDetailsPage-close-display\": \"initial\",\n \"--beam-ProductDetailsPage-close-padding\": \"0\",\n \"--beam-ProductDetailsPage-image-placement\": \"inline-left\", // options: \"inline-left\" || \"block-center\"\n \"--beam-ProductDetailsPage-blockImage-alignSelf\": \"center\",\n \"--beam-ProductDetailsPage-promoPill-marginTop\": \"4px\",\n \"--beam-ProductDetailsPage-promoPill-alignSelf\": \"left\",\n \"--beam-ProductDetailsPage-shouldDisplayColon\": \"true\",\n \"--beam-ProductDetailsPage-shouldDisplayPromoPill\": \"true\",\n ...promoPillLabelConfigDefaults,\n };\n const remoteConfig = this.productDetailsPageDataController?.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n cssResponsiveUtils,\n css`\n :host {\n font-family: var(--beam-fontFamily);\n font-style: var(--beam-fontStyle);\n font-size: var(--beam-fontSize);\n background-color: var(--beam-backgroundColor);\n color: var(--beam-textColor);\n max-width: var(--beam-ProductDetailsPage-maxWidth);\n word-break: normal;\n display: block;\n }\n .root {\n padding-top: var(--beam-ProductDetailsPage-paddingTop);\n padding-right: var(--beam-ProductDetailsPage-paddingRight);\n padding-bottom: var(--beam-ProductDetailsPage-paddingBottom);\n padding-left: var(--beam-ProductDetailsPage-paddingLeft);\n width: 100%;\n background-color: var(--beam-ProductDetailsPage-backgroundColor);\n display: flex;\n flex-direction: column;\n ${useCustomBorder(\"--beam-ProductDetailsPage\")}\n }\n /* When iconDisplay is inline-center */\n .inline-display {\n display: flex;\n }\n /* When iconDisplay is block-center */\n .block-display {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n .promo-container {\n order: 2;\n display: flex;\n margin-top: var(--beam-ProductDetailsPage-promoPill-marginTop);\n align-self: var(--beam-ProductDetailsPage-promoPill-alignSelf);\n }\n .content-inline {\n order: 3;\n display: flex;\n align-items: center;\n }\n /* Info block for both inline and block layout */\n .info-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n text-align: var(--beam-ProductDetailsPage-InfoContainer-textAlign);\n line-height: var(--beam-ProductDetailsPage-InfoContainer-lineHeight);\n margin-top: var(--beam-ProductDetailsPage-InfoContainer-marginTop);\n margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);\n }\n .block-display .info-container {\n order: 3;\n }\n .root.inline-display .icon-container,\n .root.inline-display .info-container {\n display: inline-flex;\n }\n .root.inline-display {\n flex-direction: column;\n }\n .icon-container {\n width: var(--beam-ProductDetailsPage-imageWidth);\n height: var(--beam-ProductDetailsPage-imageHeight);\n align-self: var(--beam-ProductDetailsPage-blockImage-alignSelf);\n flex-shrink: 0;\n }\n .icon-container > img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .title {\n ${useCustomText(\"--beam-ProductDetailsPage-title\")}\n }\n .title-block {\n text-align: var(--beam-ProductDetailsPage-title-textAlign);\n line-height: var(--beam-ProductDetailsPage-title-lineHeight);\n }\n .info-inline-promo {\n margin-top: var(--beam-ProductDetailsPage-description-marginTop, 0px);\n }\n .description {\n ${useCustomText(\"--beam-ProductDetailsPage-description\")}\n }\n .description-block {\n text-align: var(--beam-ProductDetailsPage-description-textAlign);\n line-height: var(--beam-ProductDetailsPage-description-lineHeight);\n ${useCustomText(\"--beam-ProductDetailsPage-description\")}\n }\n .ppgf-disclosure-tooltip {\n --max-width: 268px;\n }\n .ppgf-disclosure-tooltip::part(body) {\n background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);\n padding-top: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingTop);\n padding-right: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingRight);\n padding-bottom: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom);\n padding-left: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft);\n }\n .ppgf-disclosure-tooltip::part(base__arrow) {\n background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);\n }\n .ppgf-disclosure-tooltip-content {\n display: flex;\n flex-direction: column;\n ${useCustomText(\"--beam-ProductDetailsPage-PPGFDisclosureTooltipContent\")}\n }\n .ppgf-disclosure-tooltip-copy > a,\n .ppgf-disclosure-close {\n pointer-events: auto;\n color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);\n }\n .ppgf-disclosure-close {\n display: var(--beam-ProductDetailsPage-close-display);\n padding: var(--beam-ProductDetailsPage-close-padding);\n height: 12px;\n background: none;\n border: none;\n margin-left: auto;\n }\n .ppgf-disclosure-tooltip-copy > a:visited {\n color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);\n }\n .ppgf-disclosure-tooltip-trigger {\n position: relative;\n vertical-align: text-bottom;\n }\n .ppgf-disclosure-tooltip-trigger-mask {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: calc(var(--beam-ProductDetailsPage-TooltipIcon-width) + 20px);\n height: calc(var(--beam-ProductDetailsPage-TooltipIcon-width) + 20px);\n }\n .ppgf-disclosure-tooltip-trigger > svg {\n width: var(--beam-ProductDetailsPage-TooltipIcon-width);\n color: var(--beam-ProductDetailsPage-TooltipIcon-color);\n height: auto;\n vertical-align: middle;\n }\n `,\n ];\n}\n\ndefineCustomElement(BeamProductDetailsPage);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-product-details-page\": BeamProductDetailsPage;\n }\n}\n"],"names":["defineCustomBorder","namespace","borderRadius","borderStyle","borderColor","borderWidth","prefix","useCustomBorder","unsafeCSS","_info","html","strings","y","v","l","p","n","e","o","t","r","IMAGE_URL_REMOTE_CONFIG_KEY","BeamProductDetailsPage","LitElement","DEFAULT_BASE_URL","enforceConfig","getProductDetailsPage","makeApiKeyHeader","WIDGET_NAMES","AsyncController","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","data","loading","iconDisplay","isNonZero","value","shouldDisplayPromoPill","isPromoActive","hasValidImageHeight","hasValidTitleFontSize","isPromoPillVisible","shouldShowPunctuation","_errorMessage","imageUrl","shouldDisplayColon","title","localizeUserString","description","onClickClose","tooltip","ppgfDisclosure","unsafeHTML","ppgfHyperlink","defaults","defineCustomText","promoPillLabelConfigDefaults","remoteConfig","config","_cssVariableMap","cssReset","cssResponsiveUtils","css","useCustomText","__decorateClass","property","defineCustomElement"],"mappings":"snBAEO,MAAMA,EAAqB,CAChCC,EAAY,GACZ,CAAE,aAAAC,EAAe,MAAO,YAAAC,EAAc,QAAS,YAAAC,EAAc,UAAW,YAAAC,EAAc,KAAM,EAAI,CAAA,IACrE,CAC3B,MAAMC,EAASL,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,MAAO,CACL,CAAC,GAAGK,CAAM,eAAe,EAAGJ,EAC5B,CAAC,GAAGI,CAAM,cAAc,EAAGH,EAC3B,CAAC,GAAGG,CAAM,cAAc,EAAGF,EAC3B,CAAC,GAAGE,CAAM,cAAc,EAAGD,CAC7B,CACF,EAEaE,EAAkB,CAC7BN,EAAY,GACZ,CAAE,aAAAC,EAAe,MAAO,YAAAC,EAAc,QAAS,YAAAC,EAAc,UAAW,YAAAC,EAAc,KAAM,EAAI,CAClF,IAAA,CACd,MAAMC,EAASL,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,OAAOO,EAAU,8BACUF,CAAM,kBAAkBJ,CAAY;AAAA,4BACrCI,CAAM,iBAAi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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAqC/E,EAxZkDC,EAAA,CAAjDC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAH9B7C,EAGuC,UAAA,UAAA,CAAA,EAEN4C,EAAA,CAA3CC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAM,CAAC,CAAA,EAL/B7C,EAKiC,UAAA,SAAA,CAAA,EAEhB4C,EAAA,CAA3BC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAPf7C,EAOiB,UAAA,UAAA,CAAA,EAEO4C,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EATf7C,EASwB,UAAA,OAAA,CAAA,EAEC4C,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAXhB7C,EAWyB,UAAA,cAAA,CAAA,EAEA4C,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAbhB7C,EAayB,UAAA,QAAA,CAAA,EAER4C,EAAA,CAA3BC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAff7C,EAeiB,UAAA,0BAAA,CAAA,EA+Y9B8C,EAAoB9C,CAAsB"}
@@ -1,8 +1,8 @@
1
- import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm.js";import{u as g,A as D,_ as f,i as u,d as p,a as v}from"../chunks/localize-m-_ESmpk.esm.js";import{D as y,k as x,W as k,S as C}from"../chunks/routes-FBB1GA4-.esm.js";import{makeApiKeyHeader as w}from"../utils/makeApiKeyHeader.js";import{c as $,d as F,e as T}from"../chunks/enforce-config-ZyPq_4CF.esm.js";import{c as S}from"../chunks/responsive-2lC2Wrtg.esm.js";import"../chunks/vendor-GKiOHg2N.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";const G=(r="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=r.startsWith("--beam-")?r:`--beam-${r}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},I=(r="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=r.startsWith("--beam-")?r:`--beam-${r}`;return P(` border-radius: var(${a}-borderRadius, ${e});
2
- border-style: var(${a}-borderStyle, ${t});
3
- border-color: var(${a}-borderColor, ${o});
4
- border-width: var(${a}-borderWidth, ${i});
5
- `)},L=()=>s` <svg
1
+ import{j as v,y as i,f as y,g as n,h as x,k as C}from"../chunks/lit-iNN5L_Qk.esm.js";import{u as g,A as k,_ as w,i as f,d as u,a as $}from"../chunks/localize-m-_ESmpk.esm.js";import{D as S,l as T,W as I,S as F}from"../chunks/routes-F1ZIumMP.esm.js";import{makeApiKeyHeader as z}from"../utils/makeApiKeyHeader.js";import{c as L,d as W,e as B}from"../chunks/enforce-config-ZyPq_4CF.esm.js";import{c as E}from"../chunks/responsive-2lC2Wrtg.esm.js";import"../chunks/vendor-GKiOHg2N.esm.js";import{p as G}from"../chunks/promo-pill-label-P1X4xeAx.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";const A=(s="",{borderRadius:e="0px",borderStyle:o="unset",borderColor:t="#000000",borderWidth:r="1px"}={})=>{const a=s.startsWith("--beam-")?s:`--beam-${s}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:o,[`${a}-borderColor`]:t,[`${a}-borderWidth`]:r}},M=(s="",{borderRadius:e="0px",borderStyle:o="unset",borderColor:t="#000000",borderWidth:r="1px"}={})=>{const a=s.startsWith("--beam-")?s:`--beam-${s}`;return v(` border-radius: var(${a}-borderRadius, ${e});
2
+ border-style: var(${a}-borderStyle, ${o});
3
+ border-color: var(${a}-borderColor, ${t});
4
+ border-width: var(${a}-borderWidth, ${r});
5
+ `)},j=()=>i` <svg
6
6
  xmlns="http://www.w3.org/2000/svg"
7
7
  width="24"
8
8
  height="24"
@@ -17,29 +17,50 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
17
17
  <circle cx="12" cy="12" r="10"></circle>
18
18
  <path d="M12 16v-4"></path>
19
19
  <path d="M12 8h.01"></path>
20
- </svg>`;var W=Object.defineProperty,A=Object.getOwnPropertyDescriptor,n=(r,e,t,o)=>{for(var i=o>1?void 0:o?A(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(o?c(e,t,i):c(i))||i);return o&&i&&W(e,t,i),i};const R="--beam-ProductDetailsPage-imageUrl";class l extends m{constructor(){super(...arguments),this.baseUrl=y,this.lang="en",this.draftConfig=!1,this.debug=!1,this.getProductDetailsPageData=async()=>(T(["apiKey","storeId"],this),await x({baseUrl:this.baseUrl,headers:w(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:k.product_details_page,draftConfig:this.draftConfig}})),this.productDetailsPageDataController=new D(this,this.getProductDetailsPageData)}get configLang(){return C[this.lang]||"en"}async updated(e){const t=["storeId","baseUrl","lang","apiKey"];for(const o of t)if(e.has(o)){await this.productDetailsPageDataController.exec();break}}renderWidgetIcon(){const e=this.cssVariables[R];return e?s`
21
- <span class="icon-container">
22
- <img src=${e} alt="Widget Icon"></img>
23
- </span>
24
- `:s``}render(){const{data:e,loading:t}=this.productDetailsPageDataController;return t?s``:e==null?this.debug?f({error:new Error("No data")}):"":s`
20
+ </svg>`,P={en:{ctaTitle:()=>"Choose your impact",ctaMessage:()=>"At no extra cost, 1% of every order is donated to a nonprofit you choose. Powered by Beam",inlineSeparator:()=>":"},fr:{ctaTitle:()=>"Choisissez l'impact de votre choix",ctaMessage:()=>"Sans frais suppl\xE9mentaires, 1% de chaque commande est revers\xE9 \xE0 l'organisation caritative de votre choix. D\xE9velopp\xE9 par Beam",inlineSeparator:()=>":"},es:{ctaTitle:()=>"Elige el impacto que deseas",ctaMessage:()=>"Sin coste adicional, el 1% de cada pedido se dona a la organizaci\xF3n sin \xE1nimo de lucro que t\xFA elijas. Desarrollado por Beam",inlineSeparator:()=>":"},de:{ctaTitle:()=>"W\xE4hlen Sie Ihren Einfluss",ctaMessage:()=>"Ohne zus\xE4tzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gew\xE4hlte gemeinn\xFCtzige Organisation gespendet. Von Beam unterst\xFCtzt",inlineSeparator:()=>":"},it:{ctaTitle:()=>"Scegliete chi sostenere",ctaMessage:()=>"L'1% di ogni vostro acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a libera scelta. Promosso da Beam",inlineSeparator:()=>":"},pl:{ctaTitle:()=>"Masz wp\u0142yw, dokonaj wyboru",ctaMessage:()=>"1% kwoty ka\u017Cdego zam\xF3wienia jest przekazywane na rzecz wybranej przez Ciebie organizacji non-profit \u2013 bez dodatkowych koszt\xF3w. Obs\u0142ugiwane przez Beam",inlineSeparator:()=>":"}};var H=Object.defineProperty,R=Object.getOwnPropertyDescriptor,c=(s,e,o,t)=>{for(var r=t>1?void 0:t?R(e,o):e,a=s.length-1,d;a>=0;a--)(d=s[a])&&(r=(t?d(e,o,r):d(r))||r);return t&&r&&H(e,o,r),r};const _="--beam-ProductDetailsPage-imageUrl";class l extends x{constructor(){super(...arguments),this.baseUrl=S,this.lang="en",this.draftConfig=!1,this.debug=!1,this.getProductDetailsPageData=async()=>(B(["apiKey","storeId"],this),await T({baseUrl:this.baseUrl,headers:z(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:I.product_details_page,draftConfig:this.draftConfig,remoteProductIdentifier:this.remoteProductIdentifier}})),this.productDetailsPageDataController=new k(this,this.getProductDetailsPageData)}get configLang(){return F[this.lang]||"en"}async updated(e){const o=["storeId","baseUrl","lang","apiKey"];for(const t of o)if(e.has(t)){await this.productDetailsPageDataController.exec();break}}render(){const{data:e,loading:o}=this.productDetailsPageDataController,t=this.cssVariables["--beam-ProductDetailsPage-image-placement"],r=b=>b!=="0px"&&b!=="0",a=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayPromoPill"]==="true",d=!!e?.config?.web?.promo,h=r(this.cssVariables["--beam-ProductDetailsPage-imageHeight"]),D=r(this.cssVariables["--beam-ProductDetailsPage-title-fontSize"]),p=a&&d&&h&&D,m=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayColon"]==="true";return o?i``:e==null?this.debug?w({error:new Error("No data")}):"":i`
25
21
  <style>
26
22
  :host {
27
23
  ${this.cssVariables.toCSS()}
28
24
  }
29
25
  </style>
30
- <div class="root">
31
- ${this.renderWidgetIcon()}
32
- <span class="info-container">
26
+ <div class="root ${t==="block-center"?"block-display":"inline-display"}">
27
+ ${t==="block-center"?i`
28
+ ${this.renderWidgetIcon(t)}
29
+ ${p?i`
30
+ <div class="promo-container">
31
+ <beam-promo-info-pill .promo=${e?.config?.web?.promo}></beam-promo-info-pill>
32
+ </div>
33
+ `:i``}
34
+ <div class="info-container">${this.renderContent(p,m,e)}</div>
35
+ `:i`
36
+ ${p?i`
37
+ <div class="promo-container">
38
+ <beam-promo-info-pill .promo=${e?.config?.web?.promo}></beam-promo-info-pill>
39
+ </div>
40
+ `:i``}
41
+ <div class="content-inline">
42
+ ${this.renderWidgetIcon(t)}
43
+ <div class="info-container">${this.renderContent(p,m,e)}</div>
44
+ </div>
45
+ `}
46
+ </div>
47
+ `}renderWidgetIcon(e){const o=this.cssVariables[_];return o?i`
48
+ <span class="icon-container" part="icon" ${e==="block-center"?'style="order:1"':""}>
49
+ <img src=${o} alt="Widget Icon" />
50
+ </span>
51
+ `:i``}renderContent(e,o,t){const r=f(this.configLang,t?.config?.web?.title)||P[this.configLang].ctaTitle(),a=f(this.configLang,t?.config?.web?.description)||P[this.configLang].ctaMessage();return e?i`
52
+ <div class="info-inline-promo">
53
+ <span class="title">${r+(o?P[this.configLang].inlineSeparator():"")}</span>
54
+ <span class="description"> ${a} ${this.renderDisclosureTooltip()} </span>
55
+ </div>
56
+ `:i`
33
57
  <div class="title-block">
34
- <h3 class="title">${u(this.configLang,e.config?.web?.title)}</h3>
58
+ <h3 class="title">${r}</h3>
35
59
  </div>
36
60
  <div class="description-block">
37
- <span class="description"> ${u(this.configLang,e.config?.web?.description)}</span
38
- >${this.renderDisclosureTooltip()}
61
+ <span class="description"> ${a} ${this.renderDisclosureTooltip()} </span>
39
62
  </div>
40
- </span>
41
- </div>
42
- `}renderCloseTooltipIcon(){return s`<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
63
+ `}renderCloseTooltipIcon(){return i`<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
43
64
  <path
44
65
  d="M5.40836 5.40811L1.48828 1.48804M5.40836 5.40811L9.32843 9.32819M5.40836 5.40811L9.32843 1.48804M5.40836 5.40811L1.48828 9.32819"
45
66
  stroke="white"
@@ -47,18 +68,25 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
47
68
  stroke-linecap="round"
48
69
  stroke-linejoin="round"
49
70
  />
50
- </svg> `}renderDisclosureTooltip(){const e=()=>{const o=this.renderRoot.querySelector(".ppgf-disclosure-tooltip");o.open=!1},t=this.productDetailsPageDataController.data?.ppgfDisclosure;return t?s`<sl-tooltip class="ppgf-disclosure-tooltip">
51
- <div class="ppgf-disclosure-tooltip-content" slot="content">
52
- <button class="ppgf-disclosure-close" aria-label="Close tooltip" @click="${e}">
71
+ </svg> `}renderDisclosureTooltip(){const e=()=>{const t=this.renderRoot.querySelector(".ppgf-disclosure-tooltip");t.open=!1},o=this.productDetailsPageDataController.data?.ppgfDisclosure;return o?i`<sl-tooltip class="ppgf-disclosure-tooltip" part="tooltip">
72
+ <div class="ppgf-disclosure-tooltip-content" slot="content" part="tooltip-content">
73
+ <button
74
+ class="ppgf-disclosure-close"
75
+ aria-label="Close tooltip"
76
+ part="tooltip-close-button"
77
+ @click="${e}"
78
+ >
53
79
  ${this.renderCloseTooltipIcon()}
54
80
  </button>
55
- <div class="ppgf-disclosure-tooltip-copy">${h(t.copy)}</div>
81
+ <div class="ppgf-disclosure-tooltip-copy" part="tooltip-disclosure-copy">
82
+ ${C(o.copy)}
83
+ </div>
56
84
  </div>
57
- <span class="ppgf-disclosure-tooltip-trigger">
85
+ <span class="ppgf-disclosure-tooltip-trigger" part="tooltip-disclosure-icon">
58
86
  <div class="ppgf-disclosure-tooltip-trigger-mask d-lg-none"></div>
59
- ${L()}
87
+ ${j()}
60
88
  </span>
61
- </sl-tooltip>`:s``}renderDisclosureTooltipHyperlink(){const e=this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;return e?s`<a class="ppgf-disclosure-hyperlink" href="${e.url}" target="_blank">${e.copy}</a>`:s``}get cssVariables(){const e={"--beam-ProductDetailsPage-imageWidth":"24px","--beam-ProductDetailsPage-imageHeight":"24px","--beam-ProductDetailsPage-maxWidth":"346px","--beam-ProductDetailsPage-paddingTop":"8px","--beam-ProductDetailsPage-paddingRight":"12px","--beam-ProductDetailsPage-paddingBottom":"8px","--beam-ProductDetailsPage-paddingLeft":"15px","--beam-ProductDetailsPage-InfoContainer-marginLeft":"8px","--beam-ProductDetailsPage-backgroundColor":"unset","--beam-ProductDetailsPage-TooltipIcon-width":"10px","--beam-ProductDetailsPage-TooltipIcon-color":"inherit","--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor":"#000000","--beam-ProductDetailsPage-PPGFDisclosure-paddingTop":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingRight":"8px","--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft":"8px","--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color":"#5CA3FF",...p("--beam-ProductDetailsPage-title",{fontSize:"12px",fontWeight:"bold"}),"--beam-ProductDetailsPage-title-textAlign":"left",...p("--beam-ProductDetailsPage-description",{marginTop:"4px",fontSize:"12px",lineHeight:"15px"}),"--beam-ProductDetailsPage-description-textAlign":"left",...p("--beam-ProductDetailsPage-PPGFDisclosureTooltipContent",{fontSize:"12px",lineHeight:"16px",color:"#FFFFFF"}),...G("--beam-ProductDetailsPage"),"--beam-ProductDetailsPage-close-display":"initial","--beam-ProductDetailsPage-close-padding":"0"},t=this.productDetailsPageDataController?.data?.config?.web?.theme||{},o={...e,...t};return Object.assign(Object.create({toCSS(){return v(this)}}),o)}}l.tagName="beam-product-details-page",l.styles=[$,S,b`
89
+ </sl-tooltip>`:i``}renderDisclosureTooltipHyperlink(){const e=this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;return e?i`<a class="ppgf-disclosure-hyperlink" href="${e.url}" target="_blank">${e.copy}</a>`:i``}get cssVariables(){const e={"--beam-ProductDetailsPage-imageWidth":"24px","--beam-ProductDetailsPage-imageHeight":"24px","--beam-ProductDetailsPage-maxWidth":"346px","--beam-ProductDetailsPage-paddingTop":"8px","--beam-ProductDetailsPage-paddingRight":"12px","--beam-ProductDetailsPage-paddingBottom":"8px","--beam-ProductDetailsPage-paddingLeft":"15px","--beam-ProductDetailsPage-InfoContainer-marginLeft":"8px","--beam-ProductDetailsPage-InfoContainer-textAlign":"inherit","--beam-ProductDetailsPage-InfoContainer-lineHeight":"15px","--beam-ProductDetailsPage-InfoContainer-marginTop":"4px","--beam-ProductDetailsPage-backgroundColor":"unset","--beam-ProductDetailsPage-TooltipIcon-width":"10px","--beam-ProductDetailsPage-TooltipIcon-color":"inherit","--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor":"#000000","--beam-ProductDetailsPage-PPGFDisclosure-paddingTop":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingRight":"8px","--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft":"8px","--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color":"#5CA3FF",...u("--beam-ProductDetailsPage-title",{fontSize:"12px",fontWeight:"bold"}),"--beam-ProductDetailsPage-title-textAlign":"left",...u("--beam-ProductDetailsPage-description",{marginTop:"0px",fontSize:"12px",lineHeight:"15px"}),"--beam-ProductDetailsPage-description-textAlign":"left",...u("--beam-ProductDetailsPage-PPGFDisclosureTooltipContent",{fontSize:"12px",lineHeight:"16px",color:"#FFFFFF"}),...A("--beam-ProductDetailsPage"),"--beam-ProductDetailsPage-close-display":"initial","--beam-ProductDetailsPage-close-padding":"0","--beam-ProductDetailsPage-image-placement":"inline-left","--beam-ProductDetailsPage-blockImage-alignSelf":"center","--beam-ProductDetailsPage-promoPill-marginTop":"4px","--beam-ProductDetailsPage-promoPill-alignSelf":"left","--beam-ProductDetailsPage-shouldDisplayColon":"true","--beam-ProductDetailsPage-shouldDisplayPromoPill":"true",...G},o=this.productDetailsPageDataController?.data?.config?.web?.theme||{},t={...e,...o};return Object.assign(Object.create({toCSS(){return $(this)}}),t)}}l.tagName="beam-product-details-page",l.styles=[L,E,y`
62
90
  :host {
63
91
  font-family: var(--beam-fontFamily);
64
92
  font-style: var(--beam-fontStyle);
@@ -70,19 +98,62 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
70
98
  display: block;
71
99
  }
72
100
  .root {
73
- display: flex;
74
- align-items: center;
75
101
  padding-top: var(--beam-ProductDetailsPage-paddingTop);
76
102
  padding-right: var(--beam-ProductDetailsPage-paddingRight);
77
103
  padding-bottom: var(--beam-ProductDetailsPage-paddingBottom);
78
104
  padding-left: var(--beam-ProductDetailsPage-paddingLeft);
79
105
  width: 100%;
80
106
  background-color: var(--beam-ProductDetailsPage-backgroundColor);
81
- ${I("--beam-ProductDetailsPage")}
107
+ display: flex;
108
+ flex-direction: column;
109
+ ${M("--beam-ProductDetailsPage")}
110
+ }
111
+ /* When iconDisplay is inline-center */
112
+ .inline-display {
113
+ display: flex;
114
+ }
115
+ /* When iconDisplay is block-center */
116
+ .block-display {
117
+ display: flex;
118
+ flex-direction: column;
119
+ align-items: center;
120
+ justify-content: center;
121
+ }
122
+ .promo-container {
123
+ order: 2;
124
+ display: flex;
125
+ margin-top: var(--beam-ProductDetailsPage-promoPill-marginTop);
126
+ align-self: var(--beam-ProductDetailsPage-promoPill-alignSelf);
127
+ }
128
+ .content-inline {
129
+ order: 3;
130
+ display: flex;
131
+ align-items: center;
132
+ }
133
+ /* Info block for both inline and block layout */
134
+ .info-container {
135
+ display: flex;
136
+ flex-direction: column;
137
+ justify-content: center;
138
+ text-align: var(--beam-ProductDetailsPage-InfoContainer-textAlign);
139
+ line-height: var(--beam-ProductDetailsPage-InfoContainer-lineHeight);
140
+ margin-top: var(--beam-ProductDetailsPage-InfoContainer-marginTop);
141
+ margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);
142
+ }
143
+ .block-display .info-container {
144
+ order: 3;
145
+ }
146
+ .root.inline-display .icon-container,
147
+ .root.inline-display .info-container {
148
+ display: inline-flex;
149
+ }
150
+ .root.inline-display {
151
+ flex-direction: column;
82
152
  }
83
153
  .icon-container {
84
154
  width: var(--beam-ProductDetailsPage-imageWidth);
85
155
  height: var(--beam-ProductDetailsPage-imageHeight);
156
+ align-self: var(--beam-ProductDetailsPage-blockImage-alignSelf);
86
157
  flex-shrink: 0;
87
158
  }
88
159
  .icon-container > img {
@@ -90,9 +161,6 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
90
161
  height: 100%;
91
162
  object-fit: contain;
92
163
  }
93
- .info-container {
94
- margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);
95
- }
96
164
  .title {
97
165
  ${g("--beam-ProductDetailsPage-title")}
98
166
  }
@@ -100,12 +168,16 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
100
168
  text-align: var(--beam-ProductDetailsPage-title-textAlign);
101
169
  line-height: var(--beam-ProductDetailsPage-title-lineHeight);
102
170
  }
171
+ .info-inline-promo {
172
+ margin-top: var(--beam-ProductDetailsPage-description-marginTop, 0px);
173
+ }
103
174
  .description {
104
175
  ${g("--beam-ProductDetailsPage-description")}
105
176
  }
106
177
  .description-block {
107
178
  text-align: var(--beam-ProductDetailsPage-description-textAlign);
108
179
  line-height: var(--beam-ProductDetailsPage-description-lineHeight);
180
+ ${g("--beam-ProductDetailsPage-description")}
109
181
  }
110
182
  .ppgf-disclosure-tooltip {
111
183
  --max-width: 268px;
@@ -143,6 +215,7 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
143
215
  }
144
216
  .ppgf-disclosure-tooltip-trigger {
145
217
  position: relative;
218
+ vertical-align: text-bottom;
146
219
  }
147
220
  .ppgf-disclosure-tooltip-trigger-mask {
148
221
  position: absolute;
@@ -158,5 +231,5 @@ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-iNN5L_Qk.esm
158
231
  height: auto;
159
232
  vertical-align: middle;
160
233
  }
161
- `],n([d({type:String,reflect:!0})],l.prototype,"baseUrl",2),n([d({type:String,reflect:!1})],l.prototype,"apiKey",2),n([d({type:Number})],l.prototype,"storeId",2),n([d({type:String})],l.prototype,"lang",2),n([d({type:Boolean})],l.prototype,"draftConfig",2),n([d({type:Boolean})],l.prototype,"debug",2),F(l);export{l as BeamProductDetailsPage};
234
+ `],c([n({type:String,reflect:!0})],l.prototype,"baseUrl",2),c([n({type:String,reflect:!1})],l.prototype,"apiKey",2),c([n({type:Number})],l.prototype,"storeId",2),c([n({type:String})],l.prototype,"lang",2),c([n({type:Boolean})],l.prototype,"draftConfig",2),c([n({type:Boolean})],l.prototype,"debug",2),c([n({type:String})],l.prototype,"remoteProductIdentifier",2),W(l);export{l as BeamProductDetailsPage};
162
235
  //# sourceMappingURL=product-details-page.js.map