@foxy.io/elements 1.45.0-beta.2 → 1.45.0-beta.4

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 (207) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-admin-subscription-card.js +1 -1
  5. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  6. package/dist/cdn/foxy-api-browser.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  8. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  9. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-card.js +1 -1
  11. package/dist/cdn/foxy-attribute-form.js +1 -1
  12. package/dist/cdn/foxy-billing-address-card.js +1 -1
  13. package/dist/cdn/foxy-cancellation-form.js +1 -1
  14. package/dist/cdn/foxy-cart-card.js +1 -1
  15. package/dist/cdn/foxy-cart-form.js +1 -1
  16. package/dist/cdn/foxy-client-card.js +1 -1
  17. package/dist/cdn/foxy-client-form.js +1 -1
  18. package/dist/cdn/foxy-collection-page.js +1 -1
  19. package/dist/cdn/foxy-collection-pages.js +1 -1
  20. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  21. package/dist/cdn/foxy-coupon-card.js +1 -1
  22. package/dist/cdn/foxy-coupon-code-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  24. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  25. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  26. package/dist/cdn/foxy-coupon-form.js +1 -1
  27. package/dist/cdn/foxy-custom-field-card.js +1 -1
  28. package/dist/cdn/foxy-custom-field-form.js +1 -1
  29. package/dist/cdn/foxy-customer-card.js +1 -1
  30. package/dist/cdn/foxy-customer-form.js +1 -1
  31. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  32. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  33. package/dist/cdn/foxy-customer-portal.js +1 -1
  34. package/dist/cdn/foxy-customer.js +1 -1
  35. package/dist/cdn/foxy-customers-table.js +1 -1
  36. package/dist/cdn/foxy-discount-builder.js +1 -1
  37. package/dist/cdn/foxy-discount-card.js +1 -1
  38. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  39. package/dist/cdn/foxy-donation.js +1 -1
  40. package/dist/cdn/foxy-downloadable-card.js +1 -1
  41. package/dist/cdn/foxy-downloadable-form.js +1 -1
  42. package/dist/cdn/foxy-email-template-card.js +1 -1
  43. package/dist/cdn/foxy-email-template-form.js +1 -1
  44. package/dist/cdn/foxy-error-entry-card.js +1 -1
  45. package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
  46. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  47. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  48. package/dist/cdn/foxy-form-dialog.js +1 -1
  49. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  50. package/dist/cdn/foxy-gift-card-card.js +1 -1
  51. package/dist/cdn/foxy-gift-card-code-card.js +1 -1
  52. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  53. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  54. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  55. package/dist/cdn/foxy-gift-card-form.js +1 -1
  56. package/dist/cdn/foxy-i18n-editor.js +1 -1
  57. package/dist/cdn/foxy-i18n.js +1 -1
  58. package/dist/cdn/foxy-integration-card.js +1 -1
  59. package/dist/cdn/foxy-integration-form.js +1 -1
  60. package/dist/cdn/foxy-item-card.js +1 -1
  61. package/dist/cdn/foxy-item-category-card.js +1 -1
  62. package/dist/cdn/foxy-item-category-form.js +1 -1
  63. package/dist/cdn/foxy-item-form.js +1 -1
  64. package/dist/cdn/foxy-item-option-card.js +1 -1
  65. package/dist/cdn/foxy-item-option-form.js +1 -1
  66. package/dist/cdn/foxy-items-form.js +1 -1
  67. package/dist/cdn/foxy-native-integration-card.js +1 -1
  68. package/dist/cdn/foxy-native-integration-form.js +1 -1
  69. package/dist/cdn/foxy-pagination.js +1 -1
  70. package/dist/cdn/foxy-passkey-card.js +1 -1
  71. package/dist/cdn/foxy-passkey-form.js +1 -1
  72. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  73. package/dist/cdn/foxy-payment-card.js +1 -1
  74. package/dist/cdn/foxy-payment-method-card.js +1 -1
  75. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  76. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  77. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  78. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  80. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  81. package/dist/cdn/foxy-query-builder.js +1 -1
  82. package/dist/cdn/foxy-report-form.js +1 -1
  83. package/dist/cdn/foxy-reports-table.js +1 -1
  84. package/dist/cdn/foxy-shipment-card.js +1 -1
  85. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  86. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  88. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  89. package/dist/cdn/foxy-sign-in-form.js +1 -1
  90. package/dist/cdn/foxy-spinner.js +1 -1
  91. package/dist/cdn/foxy-store-card.js +1 -1
  92. package/dist/cdn/foxy-store-form.js +1 -1
  93. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  94. package/dist/cdn/foxy-subscription-card.js +1 -1
  95. package/dist/cdn/foxy-subscription-form.js +1 -1
  96. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  97. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  98. package/dist/cdn/foxy-table.js +1 -1
  99. package/dist/cdn/foxy-tax-card.js +1 -1
  100. package/dist/cdn/foxy-tax-form.js +1 -1
  101. package/dist/cdn/foxy-template-config-form.js +1 -1
  102. package/dist/cdn/foxy-template-form.js +1 -1
  103. package/dist/cdn/foxy-template-set-card.js +1 -1
  104. package/dist/cdn/foxy-template-set-form.js +1 -1
  105. package/dist/cdn/foxy-transaction-card.js +1 -1
  106. package/dist/cdn/foxy-transaction.js +1 -1
  107. package/dist/cdn/foxy-transactions-table.js +1 -1
  108. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  109. package/dist/cdn/foxy-user-card.js +1 -1
  110. package/dist/cdn/foxy-user-form.js +1 -1
  111. package/dist/cdn/foxy-user-invitation-card.js +1 -1
  112. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  113. package/dist/cdn/foxy-users-table.js +1 -1
  114. package/dist/cdn/foxy-webhook-card.js +1 -1
  115. package/dist/cdn/foxy-webhook-form.js +1 -1
  116. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  117. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  118. package/dist/cdn/{shared-1d6ed748.js → shared-005168e0.js} +1 -1
  119. package/dist/cdn/{shared-4e279e77.js → shared-0fb0732a.js} +1 -1
  120. package/dist/cdn/{shared-5574ea83.js → shared-1091aa45.js} +1 -1
  121. package/dist/cdn/{shared-64210e53.js → shared-10da9bf0.js} +1 -1
  122. package/dist/cdn/{shared-b7401886.js → shared-138959d7.js} +1 -1
  123. package/dist/cdn/{shared-0b3dbac6.js → shared-1ae16c80.js} +1 -1
  124. package/dist/cdn/{shared-92c211bd.js → shared-1e14a3fe.js} +1 -1
  125. package/dist/cdn/{shared-8ba28691.js → shared-21a945fd.js} +5 -5
  126. package/dist/cdn/{shared-dc357e9d.js → shared-278b8790.js} +1 -1
  127. package/dist/cdn/{shared-7a818ad5.js → shared-2d1b1ab2.js} +1 -1
  128. package/dist/cdn/{shared-302f3391.js → shared-3615b419.js} +1 -1
  129. package/dist/cdn/{shared-d674d2ce.js → shared-3c94ab84.js} +1 -1
  130. package/dist/cdn/{shared-3bc9eaf7.js → shared-433eea12.js} +1 -1
  131. package/dist/cdn/{shared-ba0d1f31.js → shared-4b24accb.js} +1 -1
  132. package/dist/cdn/{shared-b148b310.js → shared-4cc42648.js} +1 -1
  133. package/dist/cdn/{shared-ada2d315.js → shared-4e1bff30.js} +1 -1
  134. package/dist/cdn/{shared-1d03ea56.js → shared-50f8f2bd.js} +1 -1
  135. package/dist/cdn/{shared-050780e9.js → shared-51376cac.js} +1 -1
  136. package/dist/cdn/{shared-ac44a3a5.js → shared-529a82a3.js} +1 -1
  137. package/dist/cdn/{shared-adfed461.js → shared-5380e27d.js} +1 -1
  138. package/dist/cdn/{shared-24998349.js → shared-5963a49e.js} +1 -1
  139. package/dist/cdn/{shared-c84bb30e.js → shared-597193f7.js} +1 -1
  140. package/dist/cdn/{shared-a1cfe9d5.js → shared-5b0c206b.js} +1 -1
  141. package/dist/cdn/{shared-3db3f3c3.js → shared-5bcf861e.js} +1 -1
  142. package/dist/cdn/{shared-0abec247.js → shared-636d6e33.js} +1 -1
  143. package/dist/cdn/{shared-46efbc40.js → shared-64e243c4.js} +1 -1
  144. package/dist/cdn/{shared-dda75cab.js → shared-6c25eb72.js} +1 -1
  145. package/dist/cdn/{shared-4e4766ee.js → shared-77829fbb.js} +1 -1
  146. package/dist/cdn/{shared-df92d411.js → shared-788173f2.js} +1 -1
  147. package/dist/cdn/{shared-387d7254.js → shared-7a87cd33.js} +2 -2
  148. package/dist/cdn/{shared-caac6517.js → shared-7d15992f.js} +1 -1
  149. package/dist/cdn/{shared-d35ed355.js → shared-809d503c.js} +1 -1
  150. package/dist/cdn/{shared-f58068b0.js → shared-8340f3ab.js} +1 -1
  151. package/dist/cdn/{shared-4dba0d50.js → shared-85668fe8.js} +1 -1
  152. package/dist/cdn/{shared-ab9dfa48.js → shared-85ed835a.js} +1 -1
  153. package/dist/cdn/{shared-0d01cd66.js → shared-85feff39.js} +1 -1
  154. package/dist/cdn/{shared-ed24a3f9.js → shared-937e58bf.js} +1 -1
  155. package/dist/cdn/{shared-6783fe5e.js → shared-946a7af6.js} +1 -1
  156. package/dist/cdn/{shared-2d6478b0.js → shared-95d34ae8.js} +1 -1
  157. package/dist/cdn/shared-96e4f603.js +1 -0
  158. package/dist/cdn/{shared-c1b71162.js → shared-9e8344bf.js} +1 -1
  159. package/dist/cdn/{shared-8bda01cf.js → shared-a1297ca4.js} +1 -1
  160. package/dist/cdn/{shared-db758d3b.js → shared-a268320e.js} +1 -1
  161. package/dist/cdn/shared-a6e889a8.js +1 -0
  162. package/dist/cdn/{shared-e275989e.js → shared-a704aaa4.js} +1 -1
  163. package/dist/cdn/{shared-a6cf5b1f.js → shared-b5a0d106.js} +1 -1
  164. package/dist/cdn/{shared-4f36f302.js → shared-bea6e6a7.js} +1 -1
  165. package/dist/cdn/{shared-297155d9.js → shared-c5c123c5.js} +1 -1
  166. package/dist/cdn/{shared-47269bb6.js → shared-c66ca1f5.js} +1 -1
  167. package/dist/cdn/{shared-a5580ef6.js → shared-c6b1b119.js} +1 -1
  168. package/dist/cdn/{shared-25a9d87d.js → shared-c929504f.js} +1 -1
  169. package/dist/cdn/{shared-7f4e3256.js → shared-cb4ac1d2.js} +1 -1
  170. package/dist/cdn/{shared-51919259.js → shared-cc0d9412.js} +1 -1
  171. package/dist/cdn/{shared-52053d0d.js → shared-d3414cf0.js} +1 -1
  172. package/dist/cdn/{shared-1abfcf87.js → shared-df7d368c.js} +1 -1
  173. package/dist/cdn/{shared-1b04321a.js → shared-e4792d4a.js} +1 -1
  174. package/dist/cdn/{shared-bc89d3fb.js → shared-e502a7be.js} +1 -1
  175. package/dist/cdn/{shared-c3d1d247.js → shared-e54135f0.js} +3 -3
  176. package/dist/cdn/{shared-7fa24559.js → shared-e7a2b31d.js} +1 -1
  177. package/dist/cdn/{shared-e6d5f375.js → shared-f1e48b0e.js} +1 -1
  178. package/dist/cdn/{shared-7933d898.js → shared-f8519b17.js} +1 -1
  179. package/dist/cdn/{shared-05e997ae.js → shared-f9d1baff.js} +1 -1
  180. package/dist/cdn/{shared-8ba4b5bf.js → shared-fc784ca0.js} +1 -1
  181. package/dist/cdn/{shared-0eef6fb7.js → shared-fd5ff448.js} +1 -1
  182. package/dist/cdn/translations/admin-subscription-form/en.json +2 -2
  183. package/dist/cdn/translations/cart-form/en.json +2 -2
  184. package/dist/cdn/translations/coupon-card/en.json +8 -8
  185. package/dist/cdn/translations/coupon-form/en.json +10 -10
  186. package/dist/cdn/translations/discount-builder/en.json +2 -2
  187. package/dist/cdn/translations/experimental-add-to-cart-builder/en.json +3 -3
  188. package/dist/cdn/translations/item-category-form/en.json +2 -2
  189. package/dist/cdn/translations/item-form/en.json +2 -2
  190. package/dist/cdn/translations/template-config-form/en.json +50 -0
  191. package/dist/cdn/translations/transaction/en.json +2 -2
  192. package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.js +36 -33
  193. package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.js.map +1 -1
  194. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.d.ts +6 -0
  195. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +183 -5
  196. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -1
  197. package/dist/elements/public/TemplateConfigForm/defaults.js +1 -0
  198. package/dist/elements/public/TemplateConfigForm/defaults.js.map +1 -1
  199. package/dist/elements/public/TemplateConfigForm/types.d.ts +12 -0
  200. package/dist/elements/public/TemplateConfigForm/types.js.map +1 -1
  201. package/dist/mixins/themeable.js +4 -0
  202. package/dist/mixins/themeable.js.map +1 -1
  203. package/dist/utils/get-subscription-status.js +1 -1
  204. package/dist/utils/get-subscription-status.js.map +1 -1
  205. package/package.json +1 -1
  206. package/dist/cdn/shared-9585cf5b.js +0 -1
  207. package/dist/cdn/shared-ada5e9f5.js +0 -1
@@ -1,4 +1,4 @@
1
- import{t as e}from"./shared-387d7254.js";import{d as t}from"./shared-3db3f3c3.js";
1
+ import{t as e}from"./shared-7a87cd33.js";import{d as t}from"./shared-5bcf861e.js";
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -12,7 +12,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
12
12
  @license
13
13
  Copyright (c) 2017 Vaadin Ltd.
14
14
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
15
- */const d=e=>class extends e{static get properties(){return{_hasVaadinItemMixin:{value:!0},disabled:{type:Boolean,value:!1,observer:"_disabledChanged",reflectToAttribute:!0},selected:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_selectedChanged"},_value:String}}get value(){return void 0!==this._value?this._value:this.textContent.trim()}set value(e){this._value=e}ready(){super.ready();const e=this.getAttribute("value");null!==e&&(this.value=e),this.addEventListener("focus",(e=>this._setFocused(!0)),!0),this.addEventListener("blur",(e=>this._setFocused(!1)),!0),this.addEventListener("mousedown",(e=>{this._setActive(this._mousedown=!0);const t=()=>{this._setActive(this._mousedown=!1),document.removeEventListener("mouseup",t)};document.addEventListener("mouseup",t)})),this.addEventListener("keydown",(e=>this._onKeydown(e))),this.addEventListener("keyup",(e=>this._onKeyup(e)))}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("active")&&this._setFocused(!1)}_selectedChanged(e){this.setAttribute("aria-selected",e)}_disabledChanged(e){e?(this.selected=!1,this.setAttribute("aria-disabled","true"),this.blur()):this.removeAttribute("aria-disabled")}_setFocused(e){e?(this.setAttribute("focused",""),this._mousedown||this.setAttribute("focus-ring","")):(this.removeAttribute("focused"),this.removeAttribute("focus-ring"),this._setActive(!1))}_setActive(e){e?this.setAttribute("active",""):this.removeAttribute("active")}_onKeydown(e){/^( |SpaceBar|Enter)$/.test(e.key)&&!e.defaultPrevented&&(e.preventDefault(),this._setActive(!0))}_onKeyup(e){this.hasAttribute("active")&&(this._setActive(!1),this.click())}}
15
+ */const h=e=>class extends e{static get properties(){return{_hasVaadinItemMixin:{value:!0},disabled:{type:Boolean,value:!1,observer:"_disabledChanged",reflectToAttribute:!0},selected:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_selectedChanged"},_value:String}}get value(){return void 0!==this._value?this._value:this.textContent.trim()}set value(e){this._value=e}ready(){super.ready();const e=this.getAttribute("value");null!==e&&(this.value=e),this.addEventListener("focus",(e=>this._setFocused(!0)),!0),this.addEventListener("blur",(e=>this._setFocused(!1)),!0),this.addEventListener("mousedown",(e=>{this._setActive(this._mousedown=!0);const t=()=>{this._setActive(this._mousedown=!1),document.removeEventListener("mouseup",t)};document.addEventListener("mouseup",t)})),this.addEventListener("keydown",(e=>this._onKeydown(e))),this.addEventListener("keyup",(e=>this._onKeyup(e)))}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("active")&&this._setFocused(!1)}_selectedChanged(e){this.setAttribute("aria-selected",e)}_disabledChanged(e){e?(this.selected=!1,this.setAttribute("aria-disabled","true"),this.blur()):this.removeAttribute("aria-disabled")}_setFocused(e){e?(this.setAttribute("focused",""),this._mousedown||this.setAttribute("focus-ring","")):(this.removeAttribute("focused"),this.removeAttribute("focus-ring"),this._setActive(!1))}_setActive(e){e?this.setAttribute("active",""):this.removeAttribute("active")}_onKeydown(e){/^( |SpaceBar|Enter)$/.test(e.key)&&!e.defaultPrevented&&(e.preventDefault(),this._setActive(!0))}_onKeyup(e){this.hasAttribute("active")&&(this._setActive(!1),this.click())}}
16
16
  /**
17
17
  @license
18
18
  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
@@ -22,4 +22,4 @@ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
22
22
  found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
23
23
  part of the polymer project is also subject to an additional IP rights grant
24
24
  found at http://polymer.github.io/PATENTS.txt
25
- */;var h=new Set;const u={properties:{_parentResizable:{type:Object,observer:"_parentResizableChanged"},_notifyingDescendant:{type:Boolean,value:!1}},listeners:{"iron-request-resize-notifications":"_onIronRequestResizeNotifications"},created:function(){this._interestedResizables=[],this._boundNotifyResize=this.notifyResize.bind(this),this._boundOnDescendantIronResize=this._onDescendantIronResize.bind(this)},attached:function(){this._requestResizeNotifications()},detached:function(){this._parentResizable?this._parentResizable.stopResizeNotificationsFor(this):(h.delete(this),window.removeEventListener("resize",this._boundNotifyResize)),this._parentResizable=null},notifyResize:function(){this.isAttached&&(this._interestedResizables.forEach((function(e){this.resizerShouldNotify(e)&&this._notifyDescendant(e)}),this),this._fireResize())},assignParentResizable:function(e){this._parentResizable&&this._parentResizable.stopResizeNotificationsFor(this),this._parentResizable=e,e&&-1===e._interestedResizables.indexOf(this)&&(e._interestedResizables.push(this),e._subscribeIronResize(this))},stopResizeNotificationsFor:function(e){var t=this._interestedResizables.indexOf(e);t>-1&&(this._interestedResizables.splice(t,1),this._unsubscribeIronResize(e))},_subscribeIronResize:function(e){e.addEventListener("iron-resize",this._boundOnDescendantIronResize)},_unsubscribeIronResize:function(e){e.removeEventListener("iron-resize",this._boundOnDescendantIronResize)},resizerShouldNotify:function(e){return!0},_onDescendantIronResize:function(t){this._notifyingDescendant?t.stopPropagation():e||this._fireResize()},_fireResize:function(){this.fire("iron-resize",null,{node:this,bubbles:!1})},_onIronRequestResizeNotifications:function(e){var i=t(e).rootTarget;i!==this&&(i.assignParentResizable(this),this._notifyDescendant(i),e.stopPropagation())},_parentResizableChanged:function(e){e&&window.removeEventListener("resize",this._boundNotifyResize)},_notifyDescendant:function(e){this.isAttached&&(this._notifyingDescendant=!0,e.notifyResize(),this._notifyingDescendant=!1)},_requestResizeNotifications:function(){if(this.isAttached)if("loading"===document.readyState){var e=this._requestResizeNotifications.bind(this);document.addEventListener("readystatechange",(function t(){document.removeEventListener("readystatechange",t),e()}))}else this._findParent(),this._parentResizable?this._parentResizable._interestedResizables.forEach((function(e){e!==this&&e._findParent()}),this):(h.forEach((function(e){e!==this&&e._findParent()}),this),window.addEventListener("resize",this._boundNotifyResize),this.notifyResize())},_findParent:function(){this.assignParentResizable(null),this.fire("iron-request-resize-notifications",null,{node:this,bubbles:!0,cancelable:!0}),this._parentResizable?h.delete(this):h.add(this)}};export{d as I,a,u as b};
25
+ */;var d=new Set;const u={properties:{_parentResizable:{type:Object,observer:"_parentResizableChanged"},_notifyingDescendant:{type:Boolean,value:!1}},listeners:{"iron-request-resize-notifications":"_onIronRequestResizeNotifications"},created:function(){this._interestedResizables=[],this._boundNotifyResize=this.notifyResize.bind(this),this._boundOnDescendantIronResize=this._onDescendantIronResize.bind(this)},attached:function(){this._requestResizeNotifications()},detached:function(){this._parentResizable?this._parentResizable.stopResizeNotificationsFor(this):(d.delete(this),window.removeEventListener("resize",this._boundNotifyResize)),this._parentResizable=null},notifyResize:function(){this.isAttached&&(this._interestedResizables.forEach((function(e){this.resizerShouldNotify(e)&&this._notifyDescendant(e)}),this),this._fireResize())},assignParentResizable:function(e){this._parentResizable&&this._parentResizable.stopResizeNotificationsFor(this),this._parentResizable=e,e&&-1===e._interestedResizables.indexOf(this)&&(e._interestedResizables.push(this),e._subscribeIronResize(this))},stopResizeNotificationsFor:function(e){var t=this._interestedResizables.indexOf(e);t>-1&&(this._interestedResizables.splice(t,1),this._unsubscribeIronResize(e))},_subscribeIronResize:function(e){e.addEventListener("iron-resize",this._boundOnDescendantIronResize)},_unsubscribeIronResize:function(e){e.removeEventListener("iron-resize",this._boundOnDescendantIronResize)},resizerShouldNotify:function(e){return!0},_onDescendantIronResize:function(t){this._notifyingDescendant?t.stopPropagation():e||this._fireResize()},_fireResize:function(){this.fire("iron-resize",null,{node:this,bubbles:!1})},_onIronRequestResizeNotifications:function(e){var i=t(e).rootTarget;i!==this&&(i.assignParentResizable(this),this._notifyDescendant(i),e.stopPropagation())},_parentResizableChanged:function(e){e&&window.removeEventListener("resize",this._boundNotifyResize)},_notifyDescendant:function(e){this.isAttached&&(this._notifyingDescendant=!0,e.notifyResize(),this._notifyingDescendant=!1)},_requestResizeNotifications:function(){if(this.isAttached)if("loading"===document.readyState){var e=this._requestResizeNotifications.bind(this);document.addEventListener("readystatechange",(function t(){document.removeEventListener("readystatechange",t),e()}))}else this._findParent(),this._parentResizable?this._parentResizable._interestedResizables.forEach((function(e){e!==this&&e._findParent()}),this):(d.forEach((function(e){e!==this&&e._findParent()}),this),window.addEventListener("resize",this._boundNotifyResize),this.notifyResize())},_findParent:function(){this.assignParentResizable(null),this.fire("iron-request-resize-notifications",null,{node:this,bubbles:!0,cancelable:!0}),this._parentResizable?d.delete(this):d.add(this)}};export{h as I,a,u as b};
@@ -1,4 +1,4 @@
1
- import{P as e}from"./shared-3db3f3c3.js";
1
+ import{P as e}from"./shared-5bcf861e.js";
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
@@ -1,4 +1,4 @@
1
- import{aq as e,ar as t,as as s,at as a,au as i,av as n,aw as r,ax as l,o,ay as d,az as A,aA as u,aB as h,aC as c,aD as m,aE as p,m as v,_ as g,aF as y}from"./shared-7fec42f2.js";import"./shared-c1b71162.js";import"./shared-a6cf5b1f.js";import"./shared-ed24a3f9.js";import"./shared-5574ea83.js";import{T as b}from"./shared-ac44a3a5.js";import"./shared-caac6517.js";import"./shared-dda75cab.js";import{d as _,P as f,A as x,c as w,h as E,L as k}from"./shared-ba5c42c7.js";import"./shared-0d01cd66.js";import{O as C}from"./shared-1abfcf87.js";import{p as S}from"./shared-64210e53.js";import{a as $,y as I,x as T,z as B}from"./shared-387d7254.js";import{I as M}from"./shared-0ea750af.js";import{s as V}from"./shared-53e476fd.js";import{i as D}from"./shared-e1e4d8f5.js";import"./shared-db758d3b.js";import"./shared-d35ed355.js";import"./shared-ab9dfa48.js";import{h as j,P as L}from"./shared-3bc9eaf7.js";import{E as Q,T as P}from"./shared-46efbc40.js";import{L as R}from"./shared-302f3391.js";import{C as O}from"./shared-24998349.js";import{b as q}from"./shared-c3d1d247.js";import"./shared-7fa24559.js";import{a as F,F as N}from"./shared-3db3f3c3.js";var U={raise:e,send:t,sendParent:s,sendUpdate:a,log:i,cancel:n,start:r,stop:l,assign:o,after:d,done:A,respond:u,forwardTo:h,escalate:c,choose:m,pure:p};const G=_((e=>t=>{const{element:s,name:a,strings:i}=t.committer;if(2!==i.length||""!==i[0]||""!==i[1])throw new Error("live directive bindings must not contain any static values");if(t.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(t instanceof f)s[a]!==e&&t.setValue(e);else{if(!(t instanceof x))throw new Error("live directive can only be used on attributes or properties");s.getAttribute(a)!==e&&t.setValue(e)}}));class W extends CustomEvent{constructor(e){super("change",{detail:e})}}class H extends CustomEvent{constructor(e){super("change",{detail:e})}}class Y extends CustomEvent{constructor(e){super("change",{detail:e})}}class K extends Y{}class J extends H{}let z,Z,X=e=>e;class ee extends($(M(k))){constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:s}=S(e);return[t.toString(),s]}},this.__getItems=v((e=>{const t=S(e).count;return[{value:"d",label:this.t("day",{count:t})},{value:"w",label:this.t("week",{count:t})},{value:"m",label:this.t("month",{count:t})},{value:"y",label:this.t("year",{count:t})}]}))}static get properties(){return g(g({},super.properties),{},{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String}})}static get styles(){return w(z||(z=X`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}render(){return E(Z||(Z=X` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,G(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}checkValidity(){return!0}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new J(this.value))}}const te=y({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"number",cond:"showsNumberField"},{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}},number:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsNumberField:e=>"number"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:U.assign({defaultCustomValue:(e,t)=>t.data}),setValue:U.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:U.assign({custom:(e,t)=>t.data}),setItems:U.assign({items:(e,t)=>t.data}),setType:U.assign({type:(e,t)=>t.data}),setMin:U.assign({min:(e,t)=>t.data}),setMax:U.assign({max:(e,t)=>t.data})}});let se,ae,ie,ne,re,le,oe,de,Ae,ue,he,ce,me,pe,ve=e=>e;const ge=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class ye extends I{constructor(){super(...arguments),this.getText=e=>e,this.__service=D(te).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-number-field":customElements.get("vaadin-number-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":ee,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,w(ie||(ie=ve`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return g(g({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,ge]:this.items,t=Array.isArray(this.value),s=this.__service.state.matches("extension.present.selected"),a=E(ne||(ne=ve` ${0} `),e.map(((e,a,i)=>{var n;const r=this.custom&&a===i.length-1,l=r?s:t?!!(null===(n=this.value)||void 0===n?void 0:n.includes(e)):e===String(this.value),o=this.disabled||!this._isI18nReady,d=V({value:r?ge:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":o,"@change":t=>{if(this.readonly)return t.preventDefault();const s=t.target.checked,a=e===ge?this.defaultCustomValue:e,i=this.value;Array.isArray(i)?this.value=e===ge?s?[...i,a]:i.slice(0,i.length-1):s?[a,...i]:i.filter((e=>e!==a)):this.value=s?a:null,this.dispatchEvent(new W(this.value))}}),A=E(re||(re=ve` <div> ${0} </div> `),e===ge?this._t("choice.other").toString():E(le||(le=ve`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return E(oe||(oe=ve` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),a?"":"hidden",t?function(e,t,s,a,i){const n="transition ease-in-out duration-200",r=`${n} transform ${s?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return E(ae||(ae=ve` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?s?"bg-primary-50":"bg-contrast-10":s?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,s,a,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,o,l,d,A):function(e,t,s,a,i){const n="transition ease-in-out duration-200",r=`${n} ${t||e?"":"shadow-xs"} transform ${s?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return E(se||(se=ve` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?s?"bg-primary-50":"bg-contrast-10":s?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,s,a,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,o,l,d,A),e===ge&&s?this.__field:"",e!==ge?E(de||(de=ve`<slot name="${0}"></slot>`),e):"")})));return E(Ae||(Ae=ve`<form>${0}</form> `),a)}get __field(){const e=V({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,ns:this.ns,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new W(this.value))}});return"frequency"===this.type?E(ue||(ue=ve`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?E(he||(he=ve`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"number"===this.type?E(ce||(ce=ve`<vaadin-number-field ...="${0}" has-controls></vaadin-number-field>`),e):"textarea"===this.type?E(me||(me=ve`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):E(pe||(pe=ve`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}const be=j`<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
1
+ import{aq as e,ar as t,as as s,at as a,au as i,av as n,aw as r,ax as l,o,ay as d,az as A,aA as u,aB as h,aC as c,aD as m,aE as p,m as v,_ as g,aF as y}from"./shared-7fec42f2.js";import"./shared-9e8344bf.js";import"./shared-b5a0d106.js";import"./shared-937e58bf.js";import"./shared-1091aa45.js";import{T as b}from"./shared-529a82a3.js";import"./shared-7d15992f.js";import"./shared-6c25eb72.js";import{d as _,P as f,A as x,c as w,h as E,L as k}from"./shared-ba5c42c7.js";import"./shared-85feff39.js";import{O as C}from"./shared-df7d368c.js";import{p as S}from"./shared-10da9bf0.js";import{a as $,y as I,x as T,z as B}from"./shared-7a87cd33.js";import{I as M}from"./shared-0ea750af.js";import{s as V}from"./shared-53e476fd.js";import{i as D}from"./shared-e1e4d8f5.js";import"./shared-a268320e.js";import"./shared-809d503c.js";import"./shared-85ed835a.js";import{h as j,P as L}from"./shared-433eea12.js";import{E as Q,T as P}from"./shared-64e243c4.js";import{L as R}from"./shared-3615b419.js";import{C as O}from"./shared-5963a49e.js";import{b as q}from"./shared-e54135f0.js";import"./shared-e7a2b31d.js";import{a as F,F as N}from"./shared-5bcf861e.js";var U={raise:e,send:t,sendParent:s,sendUpdate:a,log:i,cancel:n,start:r,stop:l,assign:o,after:d,done:A,respond:u,forwardTo:h,escalate:c,choose:m,pure:p};const G=_((e=>t=>{const{element:s,name:a,strings:i}=t.committer;if(2!==i.length||""!==i[0]||""!==i[1])throw new Error("live directive bindings must not contain any static values");if(t.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(t instanceof f)s[a]!==e&&t.setValue(e);else{if(!(t instanceof x))throw new Error("live directive can only be used on attributes or properties");s.getAttribute(a)!==e&&t.setValue(e)}}));class W extends CustomEvent{constructor(e){super("change",{detail:e})}}class H extends CustomEvent{constructor(e){super("change",{detail:e})}}class Y extends CustomEvent{constructor(e){super("change",{detail:e})}}class K extends Y{}class J extends H{}let z,Z,X=e=>e;class ee extends($(M(k))){constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:s}=S(e);return[t.toString(),s]}},this.__getItems=v((e=>{const t=S(e).count;return[{value:"d",label:this.t("day",{count:t})},{value:"w",label:this.t("week",{count:t})},{value:"m",label:this.t("month",{count:t})},{value:"y",label:this.t("year",{count:t})}]}))}static get properties(){return g(g({},super.properties),{},{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String}})}static get styles(){return w(z||(z=X`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}render(){return E(Z||(Z=X` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,G(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}checkValidity(){return!0}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new J(this.value))}}const te=y({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"number",cond:"showsNumberField"},{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}},number:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsNumberField:e=>"number"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:U.assign({defaultCustomValue:(e,t)=>t.data}),setValue:U.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:U.assign({custom:(e,t)=>t.data}),setItems:U.assign({items:(e,t)=>t.data}),setType:U.assign({type:(e,t)=>t.data}),setMin:U.assign({min:(e,t)=>t.data}),setMax:U.assign({max:(e,t)=>t.data})}});let se,ae,ie,ne,re,le,oe,de,Ae,ue,he,ce,me,pe,ve=e=>e;const ge=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class ye extends I{constructor(){super(...arguments),this.getText=e=>e,this.__service=D(te).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-number-field":customElements.get("vaadin-number-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":ee,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,w(ie||(ie=ve`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return g(g({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,ge]:this.items,t=Array.isArray(this.value),s=this.__service.state.matches("extension.present.selected"),a=E(ne||(ne=ve` ${0} `),e.map(((e,a,i)=>{var n;const r=this.custom&&a===i.length-1,l=r?s:t?!!(null===(n=this.value)||void 0===n?void 0:n.includes(e)):e===String(this.value),o=this.disabled||!this._isI18nReady,d=V({value:r?ge:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":o,"@change":t=>{if(this.readonly)return t.preventDefault();const s=t.target.checked,a=e===ge?this.defaultCustomValue:e,i=this.value;Array.isArray(i)?this.value=e===ge?s?[...i,a]:i.slice(0,i.length-1):s?[a,...i]:i.filter((e=>e!==a)):this.value=s?a:null,this.dispatchEvent(new W(this.value))}}),A=E(re||(re=ve` <div> ${0} </div> `),e===ge?this._t("choice.other").toString():E(le||(le=ve`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return E(oe||(oe=ve` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),a?"":"hidden",t?function(e,t,s,a,i){const n="transition ease-in-out duration-200",r=`${n} transform ${s?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return E(ae||(ae=ve` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?s?"bg-primary-50":"bg-contrast-10":s?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,s,a,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,o,l,d,A):function(e,t,s,a,i){const n="transition ease-in-out duration-200",r=`${n} ${t||e?"":"shadow-xs"} transform ${s?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return E(se||(se=ve` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?s?"bg-primary-50":"bg-contrast-10":s?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,s,a,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,o,l,d,A),e===ge&&s?this.__field:"",e!==ge?E(de||(de=ve`<slot name="${0}"></slot>`),e):"")})));return E(Ae||(Ae=ve`<form>${0}</form> `),a)}get __field(){const e=V({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,ns:this.ns,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new W(this.value))}});return"frequency"===this.type?E(ue||(ue=ve`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?E(he||(he=ve`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"number"===this.type?E(ce||(ce=ve`<vaadin-number-field ...="${0}" has-controls></vaadin-number-field>`),e):"textarea"===this.type?E(me||(me=ve`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):E(pe||(pe=ve`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}const be=j`<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
2
2
  <template>
3
3
  <style>
4
4
  :host {
@@ -1,2 +1,2 @@
1
- import{I as e}from"./shared-92c211bd.js";import{_ as r}from"./shared-7fec42f2.js";import{c as t,h as s}from"./shared-ba5c42c7.js";import{r as a}from"./shared-5fd5805c.js";let o,i,d,l,n,c=e=>e;customElements.define("foxy-internal-source-control",class extends e{constructor(){super(...arguments),this.__isErrorVisible=!1,this.__hovered=!1,this.__focused=!1}static get properties(){return r(r({},super.properties),{},{__isErrorVisible:{attribute:!1},__hovered:{attribute:!1},__focused:{attribute:!1}})}static get styles(){return[...super.styles,t(o||(o=c`.monospace{font-family:monospace}.resize-none{resize:none}.max-h-16em{max-height:16em}textarea::selection{background:var(--lumo-contrast-10pct)}`))]}renderControl(){var e;let r,t,o;return this.disabled?(r="bg-contrast-5 text-disabled",o="text-disabled",this.readonly?(r+=" border-dashed border-contrast-20",t="border-dashed border-contrast-30"):(r+=" border-transparent",t="border-contrast-10")):this.readonly?(r="border-dashed border-contrast-30 bg-transparent text-secondary",t="border-dashed border-contrast-30",o="text-secondary",this.__focused&&(t+=" ring-2 ring-primary-50")):this.__focused?(r="border-transparent bg-contrast-10 text-tertiary",t="border-primary-50 ring-1 ring-primary-50",o="text-body"):this.__hovered?(r="border-transparent bg-contrast-20 text-tertiary",t="border-contrast-20",o="text-body"):(r="border-transparent bg-contrast-10 text-tertiary",t="border-contrast-10",o="text-body"),s(i||(i=c` <label class="block h-full" @mouseenter="${0}" @mouseleave="${0}"> <div class="mb-s leading-s" ?hidden="${0}"> <div class="transition-colors text-l font-medium" part="label">${0}</div> <div class="transition-colors text-s text-secondary" part="helper-text"> ${0} </div> </div> <div class="max-h-16em h-full transition-colors flex-1 flex bg-base rounded overflow-auto border ${0}" part="editor"> <div class="h-full transition-colors monospace leading-s text-s text-right border-r ${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <textarea placeholder="${0}" class="bg-base whitespace-pre leading-s text-s focus-outline-none monospace resize-none block w-full select-text transition-colors ${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" rows="1" .value="${0}" ?disabled="${0}" ?readonly="${0}" @focus="${0}" @blur="${0}" @input="${0}">
1
+ import{I as e}from"./shared-1e14a3fe.js";import{_ as r}from"./shared-7fec42f2.js";import{c as t,h as s}from"./shared-ba5c42c7.js";import{r as a}from"./shared-5fd5805c.js";let o,i,d,l,n,c=e=>e;customElements.define("foxy-internal-source-control",class extends e{constructor(){super(...arguments),this.__isErrorVisible=!1,this.__hovered=!1,this.__focused=!1}static get properties(){return r(r({},super.properties),{},{__isErrorVisible:{attribute:!1},__hovered:{attribute:!1},__focused:{attribute:!1}})}static get styles(){return[...super.styles,t(o||(o=c`.monospace{font-family:monospace}.resize-none{resize:none}.max-h-16em{max-height:16em}textarea::selection{background:var(--lumo-contrast-10pct)}`))]}renderControl(){var e;let r,t,o;return this.disabled?(r="bg-contrast-5 text-disabled",o="text-disabled",this.readonly?(r+=" border-dashed border-contrast-20",t="border-dashed border-contrast-30"):(r+=" border-transparent",t="border-contrast-10")):this.readonly?(r="border-dashed border-contrast-30 bg-transparent text-secondary",t="border-dashed border-contrast-30",o="text-secondary",this.__focused&&(t+=" ring-2 ring-primary-50")):this.__focused?(r="border-transparent bg-contrast-10 text-tertiary",t="border-primary-50 ring-1 ring-primary-50",o="text-body"):this.__hovered?(r="border-transparent bg-contrast-20 text-tertiary",t="border-contrast-20",o="text-body"):(r="border-transparent bg-contrast-10 text-tertiary",t="border-contrast-10",o="text-body"),s(i||(i=c` <label class="block h-full" @mouseenter="${0}" @mouseleave="${0}"> <div class="mb-s leading-s" ?hidden="${0}"> <div class="transition-colors text-l font-medium" part="label">${0}</div> <div class="transition-colors text-s text-secondary" part="helper-text"> ${0} </div> </div> <div class="max-h-16em h-full transition-colors flex-1 flex bg-base rounded overflow-auto border ${0}" part="editor"> <div class="h-full transition-colors monospace leading-s text-s text-right border-r ${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <textarea placeholder="${0}" class="bg-base whitespace-pre leading-s text-s focus-outline-none monospace resize-none block w-full select-text transition-colors ${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" rows="1" .value="${0}" ?disabled="${0}" ?readonly="${0}" @focus="${0}" @blur="${0}" @input="${0}">
2
2
  </textarea> </div> <div class="mt-s text-s leading-xs text-error" ?hidden="${0}"> ${0} </div> </label> `),(()=>this.__hovered=!0),(()=>this.__hovered=!1),!this.label&&!this.helperText,this.label,this.helperText,t,r,a(null!==(e=this._value.split("\n"))&&void 0!==e?e:[],((e,r)=>String(r)),((e,r)=>s(d||(d=c`<div>${0}${0}<span>${0}<span></span></span></div>`),r<9?s(l||(l=c`<span class="opacity-0">0</span>`)):"",r<99?s(n||(n=c`<span class="opacity-0">0</span>`)):"",r+1))),this.placeholder,o,this._value,this.disabled,this.readonly,(()=>this.__focused=!0),(()=>{this.__focused=!1,this.__isErrorVisible=!0}),(e=>{const r=e.currentTarget;this._value=r.value}),!this.__isErrorVisible||!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}updated(e){super.updated(e),this.renderRoot.querySelectorAll("textarea").forEach((e=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`,e.style.overflowY="hidden"}))}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}});
@@ -1,4 +1,4 @@
1
- import"./shared-a6cf5b1f.js";import{h as e,G as t,P as r}from"./shared-3bc9eaf7.js";import{E as o,T as i,D as s}from"./shared-46efbc40.js";import{C as a}from"./shared-24998349.js";import"./shared-dc357e9d.js";import{F as l}from"./shared-3db3f3c3.js";import{I as n}from"./shared-92c211bd.js";import"./shared-64210e53.js";import{_ as d}from"./shared-7fec42f2.js";import{i as h}from"./shared-53e42a77.js";import{c,h as u}from"./shared-ba5c42c7.js";import{c as p}from"./shared-4e709717.js";import{x as b}from"./shared-387d7254.js";const m=e`<dom-module id="lumo-radio-button" theme-for="vaadin-radio-button">
1
+ import"./shared-b5a0d106.js";import{h as e,G as t,P as r}from"./shared-433eea12.js";import{E as o,T as i,D as s}from"./shared-64e243c4.js";import{C as a}from"./shared-5963a49e.js";import"./shared-278b8790.js";import{F as l}from"./shared-5bcf861e.js";import{I as n}from"./shared-1e14a3fe.js";import"./shared-10da9bf0.js";import{_ as d}from"./shared-7fec42f2.js";import{i as h}from"./shared-53e42a77.js";import{c,h as u}from"./shared-ba5c42c7.js";import{c as p}from"./shared-4e709717.js";import{x as b}from"./shared-7a87cd33.js";const m=e`<dom-module id="lumo-radio-button" theme-for="vaadin-radio-button">
2
2
  <template>
3
3
  <style>
4
4
  :host {
@@ -1 +1 @@
1
- import"./shared-ac44a3a5.js";import{I as e}from"./shared-92c211bd.js";import{_ as t}from"./shared-7fec42f2.js";import{c as s,h as i,s as r}from"./shared-ba5c42c7.js";import{i as a}from"./shared-53e42a77.js";import{c as l}from"./shared-4e709717.js";import{l as o}from"./shared-d0aed1c1.js";let d,n,u,h,p,c,f,m,v=e=>e;customElements.define("foxy-internal-text-control",class extends e{constructor(){super(...arguments),this.layout=null,this.prefix=null,this.suffix=null,this.__isErrorVisible=!1}static get properties(){return t(t({},super.properties),{},{layout:{},prefix:{},suffix:{},__isErrorVisible:{attribute:!1}})}static get styles(){return[super.styles,s(d||(d=v`input::-webkit-contacts-auto-fill-button{visibility:hidden;display:none!important;pointer-events:none;position:absolute;right:0}`))]}reportValidity(){this.__isErrorVisible=!0,super.reportValidity()}renderControl(){return"summary-item"===this.layout?this.__renderSummaryItemLayout():i(n||(n=v` <vaadin-text-field error-message="${0}" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" ?clear-button-visible="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @input="${0}"> ${0} ${0} </vaadin-text-field> `),a(this._errorMessage),this.helperText,this.placeholder,this.label,!this.suffix,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{const t=e.currentTarget;this._value=t.value}),this.prefix?i(u||(u=v`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?i(h||(h=v`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}__renderSummaryItemLayout(){return i(p||(p=v` <div class="leading-xs"> <div class="flex items-center gap-xs"> <label class="text-m text-body flex-1 whitespace-nowrap" for="input">${0}</label> ${0} <input placeholder="${0}" class="${0}" type="text" id="input" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @blur="${0}" @input="${0}"> ${0} <button aria-label="${0}" class="${0}" style="width:1em;height:1em" ?disabled="${0}" ?hidden="${0}" @click="${0}"> ${0} </button> </div> <div style="max-width:32rem"> <p class="text-xs text-secondary">${0}</p> <p class="text-xs text-error" ?hidden="${0}"> ${0} </p> </div> </div> `),this.label,this.prefix?i(c||(c=v`<div>${0}</div>`),this.prefix):"",this.placeholder,l({"w-full appearance-none text-right bg-transparent transition-colors":!0,"text-m rounded-s focus-outline-none":!0,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),o(this._value),this.disabled,this.readonly,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(()=>this.__isErrorVisible=!0),(e=>{e.stopPropagation(),this._value=e.target.value}),this.suffix?i(f||(f=v`<div class="font-medium text-secondary">${0}</div>`),this.suffix):"",this.t("clear"),l({"flex-shrink-0 rounded-full transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer text-tertiary hover-text-body":!this.disabled,"cursor-default text-disabled":this.disabled}),this.disabled,this.readonly||!this._value,(()=>{this._value="",this.dispatchEvent(new CustomEvent("clear"))}),r(m||(m=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em"><path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" /></svg>`)),this.helperText,!this.__isErrorVisible||this.disabled||this.readonly,this._errorMessage)}});
1
+ import"./shared-529a82a3.js";import{I as e}from"./shared-1e14a3fe.js";import{_ as t}from"./shared-7fec42f2.js";import{c as s,h as i,s as r}from"./shared-ba5c42c7.js";import{i as a}from"./shared-53e42a77.js";import{c as l}from"./shared-4e709717.js";import{l as o}from"./shared-d0aed1c1.js";let d,n,u,h,p,c,f,m,v=e=>e;customElements.define("foxy-internal-text-control",class extends e{constructor(){super(...arguments),this.layout=null,this.prefix=null,this.suffix=null,this.__isErrorVisible=!1}static get properties(){return t(t({},super.properties),{},{layout:{},prefix:{},suffix:{},__isErrorVisible:{attribute:!1}})}static get styles(){return[super.styles,s(d||(d=v`input::-webkit-contacts-auto-fill-button{visibility:hidden;display:none!important;pointer-events:none;position:absolute;right:0}`))]}reportValidity(){this.__isErrorVisible=!0,super.reportValidity()}renderControl(){return"summary-item"===this.layout?this.__renderSummaryItemLayout():i(n||(n=v` <vaadin-text-field error-message="${0}" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" ?clear-button-visible="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @input="${0}"> ${0} ${0} </vaadin-text-field> `),a(this._errorMessage),this.helperText,this.placeholder,this.label,!this.suffix,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{const t=e.currentTarget;this._value=t.value}),this.prefix?i(u||(u=v`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?i(h||(h=v`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}__renderSummaryItemLayout(){return i(p||(p=v` <div class="leading-xs"> <div class="flex items-center gap-xs"> <label class="text-m text-body flex-1 whitespace-nowrap" for="input">${0}</label> ${0} <input placeholder="${0}" class="${0}" type="text" id="input" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @blur="${0}" @input="${0}"> ${0} <button aria-label="${0}" class="${0}" style="width:1em;height:1em" ?disabled="${0}" ?hidden="${0}" @click="${0}"> ${0} </button> </div> <div style="max-width:32rem"> <p class="text-xs text-secondary">${0}</p> <p class="text-xs text-error" ?hidden="${0}"> ${0} </p> </div> </div> `),this.label,this.prefix?i(c||(c=v`<div>${0}</div>`),this.prefix):"",this.placeholder,l({"w-full appearance-none text-right bg-transparent transition-colors":!0,"text-m rounded-s focus-outline-none":!0,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),o(this._value),this.disabled,this.readonly,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(()=>this.__isErrorVisible=!0),(e=>{e.stopPropagation(),this._value=e.target.value}),this.suffix?i(f||(f=v`<div class="font-medium text-secondary">${0}</div>`),this.suffix):"",this.t("clear"),l({"flex-shrink-0 rounded-full transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer text-tertiary hover-text-body":!this.disabled,"cursor-default text-disabled":this.disabled}),this.disabled,this.readonly||!this._value,(()=>{this._value="",this.dispatchEvent(new CustomEvent("clear"))}),r(m||(m=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em"><path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" /></svg>`)),this.helperText,!this.__isErrorVisible||this.disabled||this.readonly,this._errorMessage)}});
@@ -1 +1 @@
1
- import{_ as e}from"./shared-7fec42f2.js";import{L as s,h as t}from"./shared-ba5c42c7.js";import{z as r}from"./shared-387d7254.js";let a,o=e=>e;class i extends s{constructor(){super(...arguments),this.frame=!1}static get properties(){return e(e({},super.properties),{},{frame:{type:Boolean}})}static get styles(){return r.styles}render(){return t(a||(a=o` <section class="space-y-s font-lumo antialiased"> <h3 class="${0}"> <slot name="header"></slot> </h3> <div class="rounded ${0}"> <slot></slot> </div> </section> `),"text-l font-medium text-body leading-none "+(this.frame?"":"pl-m"),this.frame?"bg-contrast-5 overflow-hidden":"")}}export{i as G};
1
+ import{_ as e}from"./shared-7fec42f2.js";import{L as s,h as t}from"./shared-ba5c42c7.js";import{z as r}from"./shared-7a87cd33.js";let a,o=e=>e;class i extends s{constructor(){super(...arguments),this.frame=!1}static get properties(){return e(e({},super.properties),{},{frame:{type:Boolean}})}static get styles(){return r.styles}render(){return t(a||(a=o` <section class="space-y-s font-lumo antialiased"> <h3 class="${0}"> <slot name="header"></slot> </h3> <div class="rounded ${0}"> <slot></slot> </div> </section> `),"text-l font-medium text-body leading-none "+(this.frame?"":"pl-m"),this.frame?"bg-contrast-5 overflow-hidden":"")}}export{i as G};
@@ -664,8 +664,8 @@
664
664
  "tier_repeat": "price of next item",
665
665
  "tier_single": "order total",
666
666
  "tier_then": "then",
667
- "units_amount": "currency",
668
- "units_percentage": "percent",
667
+ "units_amount": "¤ amount",
668
+ "units_percentage": "% percentage",
669
669
  "quantity": "quantity",
670
670
  "total": "total",
671
671
  "reduce": "reduce",
@@ -815,8 +815,8 @@
815
815
  "tier_repeat": "price of next item",
816
816
  "tier_single": "order total",
817
817
  "tier_then": "then",
818
- "units_amount": "currency",
819
- "units_percentage": "percent",
818
+ "units_amount": "¤ amount",
819
+ "units_percentage": "% percentage",
820
820
  "quantity": "quantity",
821
821
  "total": "total",
822
822
  "reduce": "reduce",
@@ -1,16 +1,16 @@
1
1
  {
2
- "allunits_price_amount_discount_summary": "{{adjustment}}[currency] each after {{from}}",
2
+ "allunits_price_amount_discount_summary": "{{adjustment}}¤ amount each after {{from}}",
3
3
  "allunits_price_percentage_discount_summary": "{{adjustment, percent}} after {{from}}",
4
- "allunits_quantity_amount_discount_summary": "{{adjustment}}[currency] each on orders of {{from}}+",
4
+ "allunits_quantity_amount_discount_summary": "{{adjustment}}¤ amount each on orders of {{from}}+",
5
5
  "allunits_quantity_percentage_discount_summary": "{{adjustment, percent}} on orders of {{from}}+",
6
6
  "date_range_any": "Ongoing",
7
7
  "date_range_complete": "{{start, date}} – {{end, date}}",
8
8
  "date_range_from": "From {{start, date}}",
9
9
  "date_range_until": "Until {{end, date}}",
10
10
  "discount_summary": "{{params, discount}}",
11
- "incremental_price_amount_discount_summary": "{{adjustment}}[currency] each on orders of {{from}}+",
11
+ "incremental_price_amount_discount_summary": "{{adjustment}}¤ amount each on orders of {{from}}+",
12
12
  "incremental_price_percentage_discount_summary": "{{adjustment, percent}} on orders of {{from}}+",
13
- "incremental_quantity_amount_discount_summary": "{{adjustment}}[currency] each on items {{from}}+",
13
+ "incremental_quantity_amount_discount_summary": "{{adjustment}}¤ amount each on items {{from}}+",
14
14
  "incremental_quantity_percentage_discount_summary": "{{adjustment, percent}} on items {{from}}+",
15
15
  "ordinal_few": "rd",
16
16
  "ordinal_many": "th",
@@ -18,13 +18,13 @@
18
18
  "ordinal_other": "th",
19
19
  "ordinal_two": "nd",
20
20
  "ordinal_zero": "th",
21
- "repeat_price_amount_discount_summary": "for each {{from}}, {{adjustment}}[currency] on the next item",
21
+ "repeat_price_amount_discount_summary": "for each {{from}}, {{adjustment}}¤ amount on the next item",
22
22
  "repeat_price_percentage_discount_summary": "for each {{from}}, {{adjustment, percent}} on the next item",
23
- "repeat_quantity_amount_discount_summary": "{{adjustment}}[currency] on each {{from, ordinal}} item",
23
+ "repeat_quantity_amount_discount_summary": "{{adjustment}}¤ amount on each {{from, ordinal}} item",
24
24
  "repeat_quantity_percentage_discount_summary": "{{adjustment, percent}} on each {{from, ordinal}} item",
25
- "single_price_amount_discount_summary": "{{adjustment}}[currency] after {{from}}",
25
+ "single_price_amount_discount_summary": "{{adjustment}}¤ amount after {{from}}",
26
26
  "single_price_percentage_discount_summary": "{{adjustment, percent}} after {{from}}",
27
- "single_quantity_amount_discount_summary": "{{adjustment}}[currency] after {{from}} item(s)",
27
+ "single_quantity_amount_discount_summary": "{{adjustment}}¤ amount after {{from}} item(s)",
28
28
  "single_quantity_percentage_discount_summary": "{{adjustment, percent}} after {{from}} item(s)",
29
29
  "uses_count": "{{count}} uses",
30
30
  "uses_to_total_count": "{{count}}/{{total}} uses",
@@ -145,27 +145,27 @@
145
145
  "tier_repeat": "price of next item",
146
146
  "tier_single": "order total",
147
147
  "tier_then": "then",
148
- "units_amount": "currency",
149
- "units_percentage": "percent",
148
+ "units_amount": "¤ amount",
149
+ "units_percentage": "% percentage",
150
150
  "quantity": "quantity",
151
151
  "total": "total",
152
152
  "reduce": "reduce",
153
153
  "increase": "increase"
154
154
  },
155
- "allunits_price_amount_discount_summary": "{{adjustment}}[currency] each after {{from}}",
155
+ "allunits_price_amount_discount_summary": "{{adjustment}}¤ amount each after {{from}}",
156
156
  "allunits_price_percentage_discount_summary": "{{adjustment, percent}} after {{from}}",
157
- "allunits_quantity_amount_discount_summary": "{{adjustment}}[currency] each on orders of {{from}}+",
157
+ "allunits_quantity_amount_discount_summary": "{{adjustment}}¤ amount each on orders of {{from}}+",
158
158
  "allunits_quantity_percentage_discount_summary": "{{adjustment, percent}} on orders of {{from}}+",
159
- "incremental_price_amount_discount_summary": "{{adjustment}}[currency] each on orders of {{from}}+",
159
+ "incremental_price_amount_discount_summary": "{{adjustment}}¤ amount each on orders of {{from}}+",
160
160
  "incremental_price_percentage_discount_summary": "{{adjustment, percent}} on orders of {{from}}+",
161
- "incremental_quantity_amount_discount_summary": "{{adjustment}}[currency] each on items {{from}}+",
161
+ "incremental_quantity_amount_discount_summary": "{{adjustment}}¤ amount each on items {{from}}+",
162
162
  "incremental_quantity_percentage_discount_summary": "{{adjustment, percent}} on items {{from}}+",
163
- "repeat_price_amount_discount_summary": "for each {{from}}, {{adjustment}}[currency] on the next item",
163
+ "repeat_price_amount_discount_summary": "for each {{from}}, {{adjustment}}¤ amount on the next item",
164
164
  "repeat_price_percentage_discount_summary": "for each {{from}}, {{adjustment, percent}} on the next item",
165
- "repeat_quantity_amount_discount_summary": "{{adjustment}}[currency] on each {{from, ordinal}} item",
166
- "single_price_amount_discount_summary": "{{adjustment}}[currency] after {{from}}",
165
+ "repeat_quantity_amount_discount_summary": "{{adjustment}}¤ amount on each {{from, ordinal}} item",
166
+ "single_price_amount_discount_summary": "{{adjustment}}¤ amount after {{from}}",
167
167
  "single_price_percentage_discount_summary": "{{adjustment, percent}} after {{from}}",
168
- "single_quantity_amount_discount_summary": "{{adjustment}}[currency] after {{from}} items",
168
+ "single_quantity_amount_discount_summary": "{{adjustment}}¤ amount after {{from}} items",
169
169
  "single_quantity_percentage_discount_summary": "{{adjustment, percent}} after {{from}} items",
170
170
  "repeat_quantity_percentage_discount_summary": "{{adjustment, percent}} on each {{from, ordinal}} item",
171
171
  "discount_summary": "Applied discount: {{params, discount}}.",
@@ -7,8 +7,8 @@
7
7
  "tier_repeat": "price of next item",
8
8
  "tier_single": "order total",
9
9
  "tier_then": "then",
10
- "units_amount": "currency",
11
- "units_percentage": "percent",
10
+ "units_amount": "¤ amount",
11
+ "units_percentage": "% percentage",
12
12
  "quantity": "quantity",
13
13
  "total": "total",
14
14
  "reduce": "reduce",
@@ -230,8 +230,8 @@
230
230
  "tier_repeat": "price of next item",
231
231
  "tier_single": "order total",
232
232
  "tier_then": "then",
233
- "units_amount": "currency",
234
- "units_percentage": "percent",
233
+ "units_amount": "¤ amount",
234
+ "units_percentage": "% percentage",
235
235
  "quantity": "quantity",
236
236
  "total": "total",
237
237
  "reduce": "reduce",
@@ -544,7 +544,7 @@
544
544
  "empty": "Modify the item parameters to see the add-to-cart link.",
545
545
  "unavailable": {
546
546
  "loading_extra_data_needed": "Creating direct link...",
547
- "error_special_characters_present": "At the moment we don't support signed direct links with item parameters that contain the following characters: #, &, %, =.",
547
+ "error_special_characters_present": "At the moment we don't support signed direct links with custom option names that contain the following characters: #, &, %, =.",
548
548
  "error_price_configurable": "Direct link is not available when one or more items have configurable price.",
549
549
  "error_duplicate_custom_option_names": "Direct link is not available when one or more items have configurable custom options.",
550
550
  "paused_code_required": "Direct link will be available once you provide an SKU for each item.",
@@ -186,8 +186,8 @@
186
186
  "tier_repeat": "price of next item",
187
187
  "tier_single": "order total",
188
188
  "tier_then": "then",
189
- "units_amount": "currency",
190
- "units_percentage": "percent",
189
+ "units_amount": "¤ amount",
190
+ "units_percentage": "% percentage",
191
191
  "quantity": "quantity",
192
192
  "total": "total",
193
193
  "reduce": "reduce",
@@ -198,8 +198,8 @@
198
198
  "tier_repeat": "price of next item",
199
199
  "tier_single": "order total",
200
200
  "tier_then": "then",
201
- "units_amount": "currency",
202
- "units_percentage": "percent",
201
+ "units_amount": "¤ amount",
202
+ "units_percentage": "% percentage",
203
203
  "quantity": "quantity",
204
204
  "total": "total",
205
205
  "reduce": "reduce",
@@ -411,6 +411,56 @@
411
411
  "option_hidden": "Hidden"
412
412
  }
413
413
  },
414
+ "csp": {
415
+ "label": "Checkout security",
416
+ "helper_text": "",
417
+ "csp-group-one": {
418
+ "label": "",
419
+ "helper_text": "",
420
+ "warning": "This is security-related functionality that, when enabled, can stop custom scripts from loading on your checkout. Ensure you include any domains as custom script sources above, and review the documentation for this functionality:",
421
+ "csp-enable-csp": {
422
+ "label": "Enable Content Security Policy",
423
+ "helper_text": "Protects your checkout page by blocking remote content that isn’t explicitly allowed. Scripts and assets loaded by Foxy (including payment gateways and analytics) are always allowed, regardless of the settings below.",
424
+ "checked": "Yes",
425
+ "unchecked": "No"
426
+ },
427
+ "csp-policy-enforce-script-src": {
428
+ "label": "Custom script sources",
429
+ "placeholder": "example.com, *.example.com",
430
+ "helper_text": "",
431
+ "v8n_too_long": "Domain names must not exceed 1000 characters."
432
+ },
433
+ "csp-policy-enforce-reporting-endpoint": {
434
+ "label": "Reporting URL",
435
+ "helper_text": "",
436
+ "placeholder": "Optional",
437
+ "v8n_too_long": "This field must not exceed 1000 characters."
438
+ }
439
+ },
440
+ "csp-group-two": {
441
+ "label": "",
442
+ "helper_text": "",
443
+ "warning": "Please review the documentation for this functionality to ensure you understand potential impacts:",
444
+ "csp-enable-ro-csp": {
445
+ "label": "Enable Report-Only Content Security Policy",
446
+ "helper_text": "Test your policy without blocking content. This mode logs violations of the rules below, but still allows the content to load. As with enforced mode, Foxy-managed content (e.g., gateways, analytics) is always allowed and excluded from reporting.",
447
+ "checked": "Yes",
448
+ "unchecked": "No"
449
+ },
450
+ "csp-policy-report-script-src": {
451
+ "label": "Custom script sources",
452
+ "placeholder": "example.com, *.example.com",
453
+ "helper_text": "",
454
+ "v8n_too_long": "Domain names must not exceed 1000 characters."
455
+ },
456
+ "csp-policy-report-reporting-endpoint": {
457
+ "label": "Reporting URL",
458
+ "helper_text": "",
459
+ "placeholder": "Optional",
460
+ "v8n_too_long": "This field must not exceed 1000 characters."
461
+ }
462
+ }
463
+ },
414
464
  "analytics-config": {
415
465
  "label": "3rd-party analytics",
416
466
  "helper_text": "",
@@ -301,8 +301,8 @@
301
301
  "tier_repeat": "price of next item",
302
302
  "tier_single": "order total",
303
303
  "tier_then": "then",
304
- "units_amount": "currency",
305
- "units_percentage": "percent",
304
+ "units_amount": "¤ amount",
305
+ "units_percentage": "% percentage",
306
306
  "quantity": "quantity",
307
307
  "total": "total",
308
308
  "reduce": "reduce",
@@ -14,16 +14,23 @@ import hljs from 'highlight.js/lib/core.js';
14
14
  const NS = 'experimental-add-to-cart-builder';
15
15
  const Base = ResponsiveMixin(TranslatableMixin(InternalForm, NS));
16
16
  hljs.registerLanguage('xml', hljsxml);
17
- // TODO use proper encoding when encoding API supports HTML entities
18
- const weakEncode = (value, checkHmacCompatibility) => {
19
- if (checkHmacCompatibility) {
17
+ // Notes about encoding for HMAC signing:
18
+ //
19
+ // API does not support HTML entities in attribute values. Good thing is that
20
+ // encoding is optional for HTML attributes, except for the quote character.
21
+ // Since we use double quotes for attributes, they can't appear in the attribute values.
22
+ //
23
+ // API supports % encoding for URLs, but only in the query parameter values. Query parameter
24
+ // names must never be encoded. This is why we limit the allowed characters in the custom field names.
25
+ function encodeAttributeValue(value, isCartSigningOn) {
26
+ if (isCartSigningOn) {
20
27
  if (decode(value) !== value)
21
28
  throw new Error('error_html_entities_present');
22
29
  if (value.includes('"'))
23
30
  throw new Error('error_double_quotes_present');
24
31
  }
25
32
  return value.replace(/"/g, '&quot;');
26
- };
33
+ }
27
34
  /**
28
35
  * WARNING: this element is marked as experimental and is subject to change in future releases.
29
36
  * We will not be maintaining backwards compatibility for elements in the experimental namespace.
@@ -513,13 +520,14 @@ export class ExperimentalAddToCartBuilder extends Base {
513
520
  throw new Error('loading_extra_data_needed');
514
521
  }
515
522
  const isHmacOn = store.use_cart_validation;
523
+ const encodedAction = encodeAttributeValue(cartUrl, isHmacOn);
516
524
  let hasAtLeastOneFieldset = false;
517
- let output = `<form action="${weakEncode(cartUrl, isHmacOn)}" method="post" target="_blank">`;
525
+ let output = `<form action="${encodedAction}" method="post" target="_blank">`;
518
526
  let level = 1;
519
527
  const newline = () => `\n${' '.repeat(level * 2)}`;
520
528
  const addHiddenInput = (name, value) => {
521
- const encodedValue = weakEncode(value, isHmacOn);
522
- const encodedName = weakEncode(name, isHmacOn);
529
+ const encodedValue = encodeAttributeValue(value, isHmacOn);
530
+ const encodedName = encodeAttributeValue(name, isHmacOn);
523
531
  output += `${newline()}<input type="hidden" name="${encodedName}" value="${encodedValue}">`;
524
532
  };
525
533
  if (templateSet.code !== 'DEFAULT')
@@ -559,7 +567,7 @@ export class ExperimentalAddToCartBuilder extends Base {
559
567
  addHiddenInput(`${prefix}name`, resolvedName);
560
568
  const price = `${product.price}${currencyCode}`;
561
569
  if (product.price_configurable) {
562
- const encodedNoCurrencyPrice = weakEncode(product.price.toFixed(2), isHmacOn);
570
+ const encodedNoCurrencyPrice = encodeAttributeValue(product.price.toFixed(2), isHmacOn);
563
571
  output += `${newline()}<label>`;
564
572
  level++;
565
573
  output += `${newline()}<span>${encode(this.t('preview.price_label'))}</span>`;
@@ -635,17 +643,17 @@ export class ExperimentalAddToCartBuilder extends Base {
635
643
  output += `${newline()}<label>`;
636
644
  level++;
637
645
  output += `${newline()}<span>${encode(this.t('preview.quantity_label'))}</span>`;
638
- const encodedName = weakEncode(`${prefix}quantity`, isHmacOn);
646
+ const encodedName = encodeAttributeValue(`${prefix}quantity`, isHmacOn);
639
647
  output += `${newline()}<input type="number" name="${encodedName}"`;
640
- output += ` min="${weakEncode(String(resolvedMinQty), isHmacOn)}"`;
648
+ output += ` min="${encodeAttributeValue(String(resolvedMinQty), isHmacOn)}"`;
641
649
  if (resolvedMaxQty !== Infinity)
642
- output += ` max="${weakEncode(String(resolvedMaxQty), isHmacOn)}"`;
650
+ output += ` max="${encodeAttributeValue(String(resolvedMaxQty), isHmacOn)}"`;
643
651
  if (store.use_cart_validation) {
644
- const encodedQuantity = weakEncode(String((_e = product.quantity) !== null && _e !== void 0 ? _e : 1), isHmacOn);
652
+ const encodedQuantity = encodeAttributeValue(String((_e = product.quantity) !== null && _e !== void 0 ? _e : 1), isHmacOn);
645
653
  output += ` value="--OPEN--" data-replace="${encodedQuantity}">`;
646
654
  }
647
655
  else {
648
- output += ` value="${weakEncode(String((_f = product.quantity) !== null && _f !== void 0 ? _f : 1), isHmacOn)}">`;
656
+ output += ` value="${encodeAttributeValue(String((_f = product.quantity) !== null && _f !== void 0 ? _f : 1), isHmacOn)}">`;
649
657
  }
650
658
  level--;
651
659
  output += `${newline()}</label>`;
@@ -700,12 +708,12 @@ export class ExperimentalAddToCartBuilder extends Base {
700
708
  output += `${newline()}<label>`;
701
709
  level++;
702
710
  output += `${newline()}<span>${encode(optionName)}:</span>`;
703
- output += `${newline()}<input name="${weakEncode(name, isHmacOn)}" `;
711
+ output += `${newline()}<input name="${encodeAttributeValue(name, isHmacOn)}" `;
704
712
  if (store.use_cart_validation) {
705
- output += `value="--OPEN--" data-replace="${weakEncode(value, isHmacOn)}">`;
713
+ output += `value="--OPEN--" data-replace="${encodeAttributeValue(value, isHmacOn)}">`;
706
714
  }
707
715
  else {
708
- output += `value="${weakEncode(value, isHmacOn)}">`;
716
+ output += `value="${encodeAttributeValue(value, isHmacOn)}">`;
709
717
  }
710
718
  level--;
711
719
  output += `${newline()}</label>`;
@@ -725,7 +733,7 @@ export class ExperimentalAddToCartBuilder extends Base {
725
733
  const optionIndex = product.custom_options.indexOf(option);
726
734
  const itemCategory = (_a = this.__getItemCategoryLoader(productIndex, optionIndex)) === null || _a === void 0 ? void 0 : _a.data;
727
735
  const modifiers = this.__getOptionModifiers(option, itemCategory !== null && itemCategory !== void 0 ? itemCategory : null, currencyCode);
728
- const encodedValue = weakEncode(`${option.value}${modifiers}`, isHmacOn);
736
+ const encodedValue = encodeAttributeValue(`${option.value}${modifiers}`, isHmacOn);
729
737
  const encodedCaption = encode((_b = option.value) !== null && _b !== void 0 ? _b : '');
730
738
  output += `${newline()}<option value="${encodedValue}">${encodedCaption}</option>`;
731
739
  });
@@ -756,21 +764,18 @@ export class ExperimentalAddToCartBuilder extends Base {
756
764
  if (!this.defaultDomain || !templateSet || !store || !currencyCode || !cartUrl) {
757
765
  throw new Error('loading_extra_data_needed');
758
766
  }
759
- const signedUrlParams = new Map();
760
- const unsignedUrlParams = new URLSearchParams();
767
+ const query = new Map();
761
768
  const setOrThrow = (name, value) => {
762
769
  if (store.use_cart_validation) {
763
- if (name.includes('&') ||
764
- value.includes('&') ||
765
- name.includes('%') ||
766
- value.includes('%') ||
767
- name.includes('=') ||
768
- value.includes('='))
770
+ if (['&', '%', '=', '#'].some(c => name.includes(c))) {
769
771
  throw new Error('error_special_characters_present');
770
- signedUrlParams.set(name, value);
772
+ }
773
+ else {
774
+ query.set(name, encodeURIComponent(value));
775
+ }
771
776
  }
772
777
  else {
773
- unsignedUrlParams.set(name, value);
778
+ query.set(encodeURIComponent(name), encodeURIComponent(value));
774
779
  }
775
780
  };
776
781
  if (templateSet.code !== 'DEFAULT')
@@ -883,11 +888,9 @@ export class ExperimentalAddToCartBuilder extends Base {
883
888
  setOrThrow(`${prefix}${option.name}`, `${(_h = option.value) !== null && _h !== void 0 ? _h : ''}${modifiers}`);
884
889
  }
885
890
  }
886
- return store.use_cart_validation
887
- ? `${cartUrl}?${Array.from(signedUrlParams.entries())
888
- .map(([key, value]) => `${key}=${value}`)
889
- .join('&')}`
890
- : `${cartUrl}?${unsignedUrlParams.toString()}`;
891
+ return `${cartUrl}?${Array.from(query.entries())
892
+ .map(([key, value]) => `${key}=${value}`)
893
+ .join('&')}`;
891
894
  }
892
895
  __getAddToCartCode() {
893
896
  var _a;
@@ -915,7 +918,7 @@ export class ExperimentalAddToCartBuilder extends Base {
915
918
  try {
916
919
  linkHref = this.__getAddToCartLinkHref();
917
920
  if (linkHref) {
918
- const linkHTML = `<a href="${weakEncode(linkHref, checkEquality)}">Add to cart</a>`;
921
+ const linkHTML = `<a href="${encodeAttributeValue(linkHref, checkEquality)}">Add to cart</a>`;
919
922
  unsignedCode = `${formHTML}${this.__signingSeparator}${linkHTML}`;
920
923
  }
921
924
  }