@foxy.io/elements 1.55.0 → 1.56.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 (164) 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-admin-transaction-card.js +1 -1
  7. package/dist/cdn/foxy-api-browser.js +1 -1
  8. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  9. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  10. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  11. package/dist/cdn/foxy-attribute-card.js +1 -1
  12. package/dist/cdn/foxy-attribute-form.js +1 -1
  13. package/dist/cdn/foxy-billing-address-card.js +1 -1
  14. package/dist/cdn/foxy-cancellation-form.js +1 -1
  15. package/dist/cdn/foxy-cart-card.js +1 -1
  16. package/dist/cdn/foxy-cart-form.js +1 -1
  17. package/dist/cdn/foxy-client-card.js +1 -1
  18. package/dist/cdn/foxy-client-form.js +1 -1
  19. package/dist/cdn/foxy-collection-page.js +1 -1
  20. package/dist/cdn/foxy-collection-pages.js +1 -1
  21. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  22. package/dist/cdn/foxy-coupon-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-code-card.js +1 -1
  24. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  25. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  26. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  27. package/dist/cdn/foxy-coupon-form.js +1 -1
  28. package/dist/cdn/foxy-custom-field-card.js +1 -1
  29. package/dist/cdn/foxy-custom-field-form.js +1 -1
  30. package/dist/cdn/foxy-customer-card.js +1 -1
  31. package/dist/cdn/foxy-customer-form.js +1 -1
  32. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  33. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  34. package/dist/cdn/foxy-customer-portal.js +11 -11
  35. package/dist/cdn/foxy-customer.js +1 -1
  36. package/dist/cdn/foxy-customers-table.js +1 -1
  37. package/dist/cdn/foxy-discount-builder.js +1 -1
  38. package/dist/cdn/foxy-discount-card.js +1 -1
  39. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  40. package/dist/cdn/foxy-donation.js +1 -1
  41. package/dist/cdn/foxy-downloadable-card.js +1 -1
  42. package/dist/cdn/foxy-downloadable-form.js +1 -1
  43. package/dist/cdn/foxy-email-template-card.js +1 -1
  44. package/dist/cdn/foxy-email-template-form.js +1 -1
  45. package/dist/cdn/foxy-error-entry-card.js +1 -1
  46. package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
  47. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  48. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  49. package/dist/cdn/foxy-form-dialog.js +1 -1
  50. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  51. package/dist/cdn/foxy-gift-card-card.js +1 -1
  52. package/dist/cdn/foxy-gift-card-code-card.js +1 -1
  53. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  54. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  55. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  56. package/dist/cdn/foxy-gift-card-form.js +1 -1
  57. package/dist/cdn/foxy-i18n-editor.js +1 -1
  58. package/dist/cdn/foxy-i18n.js +1 -1
  59. package/dist/cdn/foxy-integration-card.js +1 -1
  60. package/dist/cdn/foxy-integration-form.js +1 -1
  61. package/dist/cdn/foxy-item-card.js +1 -1
  62. package/dist/cdn/foxy-item-category-card.js +1 -1
  63. package/dist/cdn/foxy-item-category-form.js +1 -1
  64. package/dist/cdn/foxy-item-form.js +1 -1
  65. package/dist/cdn/foxy-item-option-card.js +1 -1
  66. package/dist/cdn/foxy-item-option-form.js +1 -1
  67. package/dist/cdn/foxy-items-form.js +1 -1
  68. package/dist/cdn/foxy-native-integration-card.js +1 -1
  69. package/dist/cdn/foxy-native-integration-form.js +1 -1
  70. package/dist/cdn/foxy-nucleon-element.js +1 -1
  71. package/dist/cdn/foxy-pagination.js +1 -1
  72. package/dist/cdn/foxy-passkey-card.js +1 -1
  73. package/dist/cdn/foxy-passkey-form.js +1 -1
  74. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  75. package/dist/cdn/foxy-payment-card.js +1 -1
  76. package/dist/cdn/foxy-payment-method-card.js +1 -1
  77. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  78. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  80. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  81. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  82. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  83. package/dist/cdn/foxy-query-builder.js +1 -1
  84. package/dist/cdn/foxy-report-form.js +1 -1
  85. package/dist/cdn/foxy-reports-table.js +1 -1
  86. package/dist/cdn/foxy-shipment-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  88. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  89. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  90. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  91. package/dist/cdn/foxy-sign-in-form.js +1 -1
  92. package/dist/cdn/foxy-spinner.js +1 -1
  93. package/dist/cdn/foxy-store-card.js +1 -1
  94. package/dist/cdn/foxy-store-form.js +1 -1
  95. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  96. package/dist/cdn/foxy-store-transaction-folder-card.js +1 -1
  97. package/dist/cdn/foxy-store-transaction-folder-form.js +1 -1
  98. package/dist/cdn/foxy-subscription-card.js +1 -1
  99. package/dist/cdn/foxy-subscription-form.js +1 -1
  100. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  101. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  102. package/dist/cdn/foxy-table.js +1 -1
  103. package/dist/cdn/foxy-tax-card.js +1 -1
  104. package/dist/cdn/foxy-tax-form.js +1 -1
  105. package/dist/cdn/foxy-template-config-form.js +1 -1
  106. package/dist/cdn/foxy-template-form.js +1 -1
  107. package/dist/cdn/foxy-template-set-card.js +1 -1
  108. package/dist/cdn/foxy-template-set-form.js +1 -1
  109. package/dist/cdn/foxy-transaction-card.js +1 -1
  110. package/dist/cdn/foxy-transaction.js +1 -1
  111. package/dist/cdn/foxy-transactions-table.js +1 -1
  112. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  113. package/dist/cdn/foxy-user-card.js +1 -1
  114. package/dist/cdn/foxy-user-form.js +1 -1
  115. package/dist/cdn/foxy-user-invitation-card.js +1 -1
  116. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  117. package/dist/cdn/foxy-users-table.js +1 -1
  118. package/dist/cdn/foxy-webhook-card.js +1 -1
  119. package/dist/cdn/foxy-webhook-form.js +1 -1
  120. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  121. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  122. package/dist/cdn/{shared-1d6a5e81.js → shared-0cf593c8.js} +1 -1
  123. package/dist/cdn/{shared-4314488c.js → shared-1d5baaf5.js} +4 -4
  124. package/dist/cdn/{shared-7995d26e.js → shared-23baaa34.js} +1 -1
  125. package/dist/cdn/{shared-2b39e4d4.js → shared-276618b9.js} +1 -1
  126. package/dist/cdn/{shared-13fed57b.js → shared-2a678cc8.js} +1 -1
  127. package/dist/cdn/{shared-540adfea.js → shared-2cab5d23.js} +1 -1
  128. package/dist/cdn/{shared-b2f675d4.js → shared-2e56ae76.js} +1 -1
  129. package/dist/cdn/{shared-fa05c80d.js → shared-305a1f88.js} +1 -1
  130. package/dist/cdn/{shared-02c0b25a.js → shared-37a12ea3.js} +5 -5
  131. package/dist/cdn/shared-37fe7ec4.js +1 -0
  132. package/dist/cdn/{shared-609c9693.js → shared-3a91efdc.js} +1 -1
  133. package/dist/cdn/{shared-9ed0a201.js → shared-3b5a845e.js} +1 -1
  134. package/dist/cdn/{shared-2bb1f0f4.js → shared-486d4db3.js} +1 -1
  135. package/dist/cdn/shared-49e95410.js +1 -0
  136. package/dist/cdn/{shared-9d4fecb9.js → shared-4b3bdf49.js} +1 -1
  137. package/dist/cdn/{shared-6418bbb8.js → shared-5d7439e3.js} +1 -1
  138. package/dist/cdn/{shared-ee48a1ed.js → shared-6c167083.js} +1 -1
  139. package/dist/cdn/{shared-bbd07437.js → shared-73b1e51b.js} +1 -1
  140. package/dist/cdn/{shared-01cd4e3c.js → shared-772990cd.js} +1 -1
  141. package/dist/cdn/{shared-f3ec0559.js → shared-8ff47d1a.js} +1 -1
  142. package/dist/cdn/{shared-f6c6ce5f.js → shared-9154f04d.js} +1 -1
  143. package/dist/cdn/{shared-f9a22b7a.js → shared-9c1f1c3b.js} +1 -1
  144. package/dist/cdn/shared-a95d3946.js +1 -0
  145. package/dist/cdn/{shared-d1de4d75.js → shared-adfa4b7a.js} +1 -1
  146. package/dist/cdn/{shared-db8913cf.js → shared-b4816a44.js} +1 -1
  147. package/dist/cdn/{shared-e77c5c90.js → shared-b4b6bd8b.js} +1 -1
  148. package/dist/cdn/{shared-28c5d636.js → shared-b8f09caa.js} +1 -1
  149. package/dist/cdn/{shared-4332bafc.js → shared-c6c81c1b.js} +1 -1
  150. package/dist/cdn/{shared-f892683b.js → shared-d81149d8.js} +1 -1
  151. package/dist/cdn/{shared-8449b585.js → shared-e2e5d7d0.js} +1 -1
  152. package/dist/cdn/{shared-909b8221.js → shared-efe0bfd2.js} +1 -1
  153. package/dist/cdn/{shared-a339f79c.js → shared-f6416c66.js} +1 -1
  154. package/dist/cdn/translations/payments-api-payment-method-form/en.json +4 -0
  155. package/dist/elements/public/I18n/format/percent.d.ts +1 -0
  156. package/dist/elements/public/I18n/format/percent.js +6 -1
  157. package/dist/elements/public/I18n/format/percent.js.map +1 -1
  158. package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.d.ts +10 -0
  159. package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js +77 -8
  160. package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js.map +1 -1
  161. package/package.json +1 -1
  162. package/dist/cdn/shared-3426159a.js +0 -1
  163. package/dist/cdn/shared-9b35fe34.js +0 -1
  164. package/dist/cdn/shared-b1fa9899.js +0 -1
@@ -1 +1 @@
1
- import"./shared-515003f6.js";import{a as r}from"./shared-2bb1f0f4.js";import"./foxy-form-dialog.js";import"./shared-9b35fe34.js";import{_ as e}from"./shared-8f9014ff.js";import{i as t}from"./shared-53e42a77.js";import{h as o}from"./shared-ba5c42c7.js";let a,i=r=>r;customElements.define("foxy-internal-bulk-add-action-control",class extends r{constructor(){super(...arguments),this.related=[],this.parent=null,this.form=null}static get properties(){return e(e({},super.properties),{},{related:{type:Array},parent:{},form:{}})}renderControl(){var r,e;return o(a||(a=i` <foxy-form-dialog header="header" parent="${0}" infer="dialog" form="${0}" alert .related="${0}"> </foxy-form-dialog> <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_text"></foxy-i18n> </vaadin-button> `),t(null!==(r=this.parent)&&void 0!==r?r:void 0),t(null!==(e=this.form)&&void 0!==e?e:void 0),this.related,this.disabled,(r=>{const e=this.renderRoot.querySelector("foxy-form-dialog"),t=r.target;e&&(e.href="",e.show(t))}))}});
1
+ import"./shared-515003f6.js";import{a as r}from"./shared-486d4db3.js";import"./foxy-form-dialog.js";import"./shared-a95d3946.js";import{_ as e}from"./shared-8f9014ff.js";import{i as t}from"./shared-53e42a77.js";import{h as o}from"./shared-ba5c42c7.js";let a,i=r=>r;customElements.define("foxy-internal-bulk-add-action-control",class extends r{constructor(){super(...arguments),this.related=[],this.parent=null,this.form=null}static get properties(){return e(e({},super.properties),{},{related:{type:Array},parent:{},form:{}})}renderControl(){var r,e;return o(a||(a=i` <foxy-form-dialog header="header" parent="${0}" infer="dialog" form="${0}" alert .related="${0}"> </foxy-form-dialog> <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_text"></foxy-i18n> </vaadin-button> `),t(null!==(r=this.parent)&&void 0!==r?r:void 0),t(null!==(e=this.form)&&void 0!==e?e:void 0),this.related,this.disabled,(r=>{const e=this.renderRoot.querySelector("foxy-form-dialog"),t=r.target;e&&(e.href="",e.show(t))}))}});
@@ -1 +1 @@
1
- import"./shared-515003f6.js";import{a as t}from"./shared-2bb1f0f4.js";import"./foxy-spinner.js";import"./shared-9b35fe34.js";import{_ as e,B as s}from"./shared-8f9014ff.js";import{h as i,s as o}from"./shared-ba5c42c7.js";import{D as r}from"./shared-058530fc.js";import{A as n}from"./shared-69c98b7b.js";import{i as a}from"./shared-53e42a77.js";let l,d,h,c,f,u,m,p=t=>t;let v,y=t=>t;customElements.define("foxy-internal-post-action-control",class extends t{constructor(){super(...arguments),this.messageOptions={},this.theme=null,this.href=null}static get properties(){return e(e({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},theme:{},href:{}})}renderControl(){var t,e;return i(v||(v=y` <foxy-internal-post-action-control-dialog message-options="${0}" infer="" href="${0}" @hide="${0}"> </foxy-internal-post-action-control-dialog> <vaadin-button theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button"></foxy-i18n> </vaadin-button> `),JSON.stringify(this.messageOptions),a(null!==(t=this.href)&&void 0!==t?t:void 0),(t=>{t.detail.cancelled||this.dispatchEvent(new CustomEvent("success"))}),a(null!==(e=this.theme)&&void 0!==e?e:void 0),this.disabled||this.readonly,(t=>{const e=t.currentTarget,s=this.renderRoot.querySelector("foxy-internal-post-action-control-dialog");null==s||s.show(e)}))}}),customElements.define("foxy-internal-post-action-control-dialog",class extends r{constructor(){super(...arguments),this.messageOptions={},this.closable=!0,this.header="header",this.alert=!0,this.href=null,this.__api=new n(this),this.__state="idle"}static get properties(){return e(e({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},href:{},__state:{attribute:!1}})}get hiddenSelector(){const t=["close-button",super.hiddenSelector.toString()];return new s(t.join(" ").trim())}render(){var t=this;return super.render((()=>i(l||(l=p` <div class="relative"> <div class="mb-m mt-xs flex justify-center"> ${0} </div> <foxy-i18n class="block font-lumo text-m text-body text-center mb-l" infer="" key="message_${0}" .options="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> ${0} </div> ${0} </div> `),"done"===this.__state?o(d||(d=p`<svg class="text-success" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)):"fail"===this.__state?o(h||(h=p`<svg class="text-error" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z" /></svg>`)):o(c||(c=p`<svg class="text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" /></svg>`)),"busy"===this.__state?"idle":this.__state,this.messageOptions,"done"===this.__state||"fail"===this.__state?i(f||(f=p` <vaadin-button class="col-span-2" theme="contrast" @click="${0}"> <foxy-i18n infer="" key="button_close"></foxy-i18n> </vaadin-button> `),(()=>this.hide())):i(u||(u=p` <vaadin-button ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_cancel"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_confirm"></foxy-i18n> </vaadin-button> `),this.disabled||this.readonly,(()=>this.hide()),this.disabled||this.readonly,(async function(){if(t.href&&"idle"===t.__state){t.__state="busy",t.closable=!1;const e=await t.__api.fetch(t.href,{method:"POST"});t.__state=e.ok?"done":"fail",t.closable=!0}})),"busy"===this.__state?i(m||(m=p` <div class="bg-base absolute inset-0 flex items-center justify-center"> <foxy-spinner layout="vertical" infer=""></foxy-spinner> </div> `)):"")))}async hide(){await super.hide("done"!==this.__state),this.__state="idle"}});
1
+ import"./shared-515003f6.js";import{a as t}from"./shared-486d4db3.js";import"./foxy-spinner.js";import"./shared-a95d3946.js";import{_ as e,B as s}from"./shared-8f9014ff.js";import{h as i,s as o}from"./shared-ba5c42c7.js";import{D as r}from"./shared-058530fc.js";import{A as n}from"./shared-69c98b7b.js";import{i as a}from"./shared-53e42a77.js";let l,d,h,c,f,u,m,p=t=>t;let v,y=t=>t;customElements.define("foxy-internal-post-action-control",class extends t{constructor(){super(...arguments),this.messageOptions={},this.theme=null,this.href=null}static get properties(){return e(e({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},theme:{},href:{}})}renderControl(){var t,e;return i(v||(v=y` <foxy-internal-post-action-control-dialog message-options="${0}" infer="" href="${0}" @hide="${0}"> </foxy-internal-post-action-control-dialog> <vaadin-button theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button"></foxy-i18n> </vaadin-button> `),JSON.stringify(this.messageOptions),a(null!==(t=this.href)&&void 0!==t?t:void 0),(t=>{t.detail.cancelled||this.dispatchEvent(new CustomEvent("success"))}),a(null!==(e=this.theme)&&void 0!==e?e:void 0),this.disabled||this.readonly,(t=>{const e=t.currentTarget,s=this.renderRoot.querySelector("foxy-internal-post-action-control-dialog");null==s||s.show(e)}))}}),customElements.define("foxy-internal-post-action-control-dialog",class extends r{constructor(){super(...arguments),this.messageOptions={},this.closable=!0,this.header="header",this.alert=!0,this.href=null,this.__api=new n(this),this.__state="idle"}static get properties(){return e(e({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},href:{},__state:{attribute:!1}})}get hiddenSelector(){const t=["close-button",super.hiddenSelector.toString()];return new s(t.join(" ").trim())}render(){var t=this;return super.render((()=>i(l||(l=p` <div class="relative"> <div class="mb-m mt-xs flex justify-center"> ${0} </div> <foxy-i18n class="block font-lumo text-m text-body text-center mb-l" infer="" key="message_${0}" .options="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> ${0} </div> ${0} </div> `),"done"===this.__state?o(d||(d=p`<svg class="text-success" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)):"fail"===this.__state?o(h||(h=p`<svg class="text-error" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z" /></svg>`)):o(c||(c=p`<svg class="text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" /></svg>`)),"busy"===this.__state?"idle":this.__state,this.messageOptions,"done"===this.__state||"fail"===this.__state?i(f||(f=p` <vaadin-button class="col-span-2" theme="contrast" @click="${0}"> <foxy-i18n infer="" key="button_close"></foxy-i18n> </vaadin-button> `),(()=>this.hide())):i(u||(u=p` <vaadin-button ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_cancel"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_confirm"></foxy-i18n> </vaadin-button> `),this.disabled||this.readonly,(()=>this.hide()),this.disabled||this.readonly,(async function(){if(t.href&&"idle"===t.__state){t.__state="busy",t.closable=!1;const e=await t.__api.fetch(t.href,{method:"POST"});t.__state=e.ok?"done":"fail",t.closable=!0}})),"busy"===this.__state?i(m||(m=p` <div class="bg-base absolute inset-0 flex items-center justify-center"> <foxy-spinner layout="vertical" infer=""></foxy-spinner> </div> `)):"")))}async hide(){await super.hide("done"!==this.__state),this.__state="idle"}});
@@ -1,4 +1,4 @@
1
- import{I as e}from"./shared-2bb1f0f4.js";import"./shared-9b35fe34.js";import{_ as t}from"./shared-8f9014ff.js";import{d as s,N as r,i as o,c as a,h as i,s as n}from"./shared-ba5c42c7.js";
1
+ import{I as e}from"./shared-486d4db3.js";import"./shared-a95d3946.js";import{_ as t}from"./shared-8f9014ff.js";import{d as s,N as r,i as o,c as a,h as i,s as n}from"./shared-ba5c42c7.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -1,4 +1,4 @@
1
- import"./shared-99c53365.js";import{h as e,G as t,P as r}from"./shared-0fd68dc0.js";import{E as o,T as i,D as s}from"./shared-8d8975d5.js";import{C as a}from"./shared-515003f6.js";import"./shared-f8e360e6.js";import{F as l}from"./shared-6cdfb858.js";import{I as n}from"./shared-2bb1f0f4.js";import"./shared-9b35fe34.js";import{_ as d}from"./shared-8f9014ff.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-887ac0b0.js";const m=e`<dom-module id="lumo-radio-button" theme-for="vaadin-radio-button">
1
+ import"./shared-99c53365.js";import{h as e,G as t,P as r}from"./shared-0fd68dc0.js";import{E as o,T as i,D as s}from"./shared-8d8975d5.js";import{C as a}from"./shared-515003f6.js";import"./shared-f8e360e6.js";import{F as l}from"./shared-6cdfb858.js";import{I as n}from"./shared-486d4db3.js";import"./shared-a95d3946.js";import{_ as d}from"./shared-8f9014ff.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-887ac0b0.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-8df8e77c.js";import"./shared-a0baefff.js";import"./shared-a0309d5f.js";import"./shared-a20ef119.js";import{I as e}from"./shared-2bb1f0f4.js";import{_ as t}from"./shared-8f9014ff.js";import{c as i,h as a,s}from"./shared-ba5c42c7.js";import{i as l}from"./shared-53e42a77.js";import{c as o}from"./shared-4e709717.js";let n,r,d,h,u,c,p=e=>e;customElements.define("foxy-internal-frequency-control",class extends e{constructor(){super(...arguments),this.allowTwiceAMonth=!1,this.options=[{value:"d",label:"day"},{value:"w",label:"week"},{value:"m",label:"month"},{value:"y",label:"year"}],this.layout=null,this.max=999,this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{var t;const i=e.startsWith(".")?`0${e}`:e,a=parseFloat(e.substring(0,Math.max(i.length-1,0))),s=null!==(t=i[i.length-1])&&void 0!==t?t:"";return isNaN(a)?["0",""]:[a.toString(),s]}}}static get properties(){return t(t({},super.properties),{},{allowTwiceAMonth:{type:Boolean,attribute:"allow-twice-a-month"},options:{attribute:!1},layout:{},max:{type:Number}})}static get styles(){return[super.styles,i(n||(n=p`: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}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input{-moz-appearance:textfield}`))]}renderControl(){var e,t;if("summary-item"===this.layout)return this.__renderSummaryItemLayout();const i=null!==(e=this._value)&&void 0!==e?e:"",s=parseFloat(this.__i18n.parseValue(i)[0]),o=this.options.map((({value:e,label:t})=>({label:this.t(t,{count:s}),value:e})));return a(r||(r=p` <vaadin-custom-field ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .errorMessage="${0}" .helperText="${0}" .label="${0}" .value="${0}" .i18n="${0}" @change="${0}"> <vaadin-integer-field max="${0}" min="1" prevent-invalid-input has-controls ?disabled="${0}" ?readonly="${0}" ?invalid="${0}" @keydown="${0}"> </vaadin-integer-field> <vaadin-combo-box item-value-path="value" item-label-path="label" ?disabled="${0}" ?readonly="${0}" ?invalid="${0}" .items="${0}" @keydown="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.disabled,this.readonly,this._checkValidity,null!==(t=this._errorMessage)&&void 0!==t?t:"",this.helperText,this.label,i,this.__i18n,(e=>{const t=e.currentTarget;this._value=t.value}),l(this.max||void 0),this.disabled,this.readonly,!this._checkValidity(),(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),this.disabled,this.readonly,!this._checkValidity(),o,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}))}updated(e){var t;super.updated(e);const i=this.renderRoot.querySelector("vaadin-custom-field");i&&i.value!==this._value&&(i.value=null!==(t=this._value)&&void 0!==t?t:"")}_handleHostClick(e){var t;if("summary-item"!==this.layout)return;const i=e.composedPath(),a=new Set(["INPUT","LABEL","SELECT"]);i.some((e=>a.has(e.tagName)))||(null===(t=this.renderRoot.querySelector("input"))||void 0===t||t.focus(),super._handleHostClick(e))}__renderSummaryItemLayout(){var e,t;const i=null!==(e=this._value)&&void 0!==e?e:"",[n,r]=this.__i18n.parseValue(i),m=parseFloat(n),v=".5m"!==this._value||this.allowTwiceAMonth?this.options.find((e=>e.value===r)):void 0;return a(d||(d=p` <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> <input placeholder="${0}" inputmode="numeric" style="min-width:10ch" class="${0}" type="number" step="1" min="1" max="${0}" id="input" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <div class="${0}"> <div class="flex items-center gap-xs"> <div class="whitespace-nowrap"> ${0} </div> ${0} </div> <select class="${0}" id="select" ?disabled="${0}" ?hidden="${0}" @change="${0}"> <option value="" ?selected="${0}" disabled="disabled" hidden>${0}</option> ${0} ${0} </select> </div> </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.placeholder,o({"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}),l(null!==(t=this.max)&&void 0!==t?t:void 0),".5m"===i?this.allowTwiceAMonth?2:"":m,this.disabled,this.readonly,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{e.stopPropagation();const t=e.currentTarget,i=r||this.options[0].value;this._value=this.__i18n.formatValue([t.value,i])}),o({"relative rounded-s transition-colors transition-opacity":!0,"focus-within-ring-2 focus-within-ring-primary-50":!this.disabled&&!this.readonly,"text-body hover-opacity-80 cursor-pointer":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),".5m"===i?this.t("times_a_month"):v?this.t(v.label,{count:m}):this.t("select"),this.readonly?"":s(h||(h=p`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25)"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),o({"absolute inset-0 opacity-0":!0,"cursor-pointer":!this.disabled&&!this.readonly}),this.disabled,this.readonly,(e=>{e.stopPropagation();const t=e.currentTarget.value;this._value="times_a_month"===t?".5m":this.__i18n.formatValue([m||1,t])}),!v,this.t("select"),!this.allowTwiceAMonth||2!==m&&".5m"!==i?"":a(u||(u=p` <option value="times_a_month" ?selected="${0}"> ${0} </option> `),".5m"===i,this.t("times_a_month")),this.options.map((e=>a(c||(c=p` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.value,".5m"!==i&&e.value===(null==v?void 0:v.value),this.t(e.label,{count:m})))),this.helperText,this.disabled||this.readonly,this._errorMessage)}});
1
+ import"./shared-8df8e77c.js";import"./shared-a0baefff.js";import"./shared-a0309d5f.js";import"./shared-a20ef119.js";import{I as e}from"./shared-486d4db3.js";import{_ as t}from"./shared-8f9014ff.js";import{c as i,h as a,s}from"./shared-ba5c42c7.js";import{i as l}from"./shared-53e42a77.js";import{c as o}from"./shared-4e709717.js";let n,r,d,h,u,c,p=e=>e;customElements.define("foxy-internal-frequency-control",class extends e{constructor(){super(...arguments),this.allowTwiceAMonth=!1,this.options=[{value:"d",label:"day"},{value:"w",label:"week"},{value:"m",label:"month"},{value:"y",label:"year"}],this.layout=null,this.max=999,this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{var t;const i=e.startsWith(".")?`0${e}`:e,a=parseFloat(e.substring(0,Math.max(i.length-1,0))),s=null!==(t=i[i.length-1])&&void 0!==t?t:"";return isNaN(a)?["0",""]:[a.toString(),s]}}}static get properties(){return t(t({},super.properties),{},{allowTwiceAMonth:{type:Boolean,attribute:"allow-twice-a-month"},options:{attribute:!1},layout:{},max:{type:Number}})}static get styles(){return[super.styles,i(n||(n=p`: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}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input{-moz-appearance:textfield}`))]}renderControl(){var e,t;if("summary-item"===this.layout)return this.__renderSummaryItemLayout();const i=null!==(e=this._value)&&void 0!==e?e:"",s=parseFloat(this.__i18n.parseValue(i)[0]),o=this.options.map((({value:e,label:t})=>({label:this.t(t,{count:s}),value:e})));return a(r||(r=p` <vaadin-custom-field ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .errorMessage="${0}" .helperText="${0}" .label="${0}" .value="${0}" .i18n="${0}" @change="${0}"> <vaadin-integer-field max="${0}" min="1" prevent-invalid-input has-controls ?disabled="${0}" ?readonly="${0}" ?invalid="${0}" @keydown="${0}"> </vaadin-integer-field> <vaadin-combo-box item-value-path="value" item-label-path="label" ?disabled="${0}" ?readonly="${0}" ?invalid="${0}" .items="${0}" @keydown="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.disabled,this.readonly,this._checkValidity,null!==(t=this._errorMessage)&&void 0!==t?t:"",this.helperText,this.label,i,this.__i18n,(e=>{const t=e.currentTarget;this._value=t.value}),l(this.max||void 0),this.disabled,this.readonly,!this._checkValidity(),(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),this.disabled,this.readonly,!this._checkValidity(),o,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}))}updated(e){var t;super.updated(e);const i=this.renderRoot.querySelector("vaadin-custom-field");i&&i.value!==this._value&&(i.value=null!==(t=this._value)&&void 0!==t?t:"")}_handleHostClick(e){var t;if("summary-item"!==this.layout)return;const i=e.composedPath(),a=new Set(["INPUT","LABEL","SELECT"]);i.some((e=>a.has(e.tagName)))||(null===(t=this.renderRoot.querySelector("input"))||void 0===t||t.focus(),super._handleHostClick(e))}__renderSummaryItemLayout(){var e,t;const i=null!==(e=this._value)&&void 0!==e?e:"",[n,r]=this.__i18n.parseValue(i),m=parseFloat(n),v=".5m"!==this._value||this.allowTwiceAMonth?this.options.find((e=>e.value===r)):void 0;return a(d||(d=p` <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> <input placeholder="${0}" inputmode="numeric" style="min-width:10ch" class="${0}" type="number" step="1" min="1" max="${0}" id="input" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <div class="${0}"> <div class="flex items-center gap-xs"> <div class="whitespace-nowrap"> ${0} </div> ${0} </div> <select class="${0}" id="select" ?disabled="${0}" ?hidden="${0}" @change="${0}"> <option value="" ?selected="${0}" disabled="disabled" hidden>${0}</option> ${0} ${0} </select> </div> </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.placeholder,o({"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}),l(null!==(t=this.max)&&void 0!==t?t:void 0),".5m"===i?this.allowTwiceAMonth?2:"":m,this.disabled,this.readonly,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{e.stopPropagation();const t=e.currentTarget,i=r||this.options[0].value;this._value=this.__i18n.formatValue([t.value,i])}),o({"relative rounded-s transition-colors transition-opacity":!0,"focus-within-ring-2 focus-within-ring-primary-50":!this.disabled&&!this.readonly,"text-body hover-opacity-80 cursor-pointer":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),".5m"===i?this.t("times_a_month"):v?this.t(v.label,{count:m}):this.t("select"),this.readonly?"":s(h||(h=p`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25)"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),o({"absolute inset-0 opacity-0":!0,"cursor-pointer":!this.disabled&&!this.readonly}),this.disabled,this.readonly,(e=>{e.stopPropagation();const t=e.currentTarget.value;this._value="times_a_month"===t?".5m":this.__i18n.formatValue([m||1,t])}),!v,this.t("select"),!this.allowTwiceAMonth||2!==m&&".5m"!==i?"":a(u||(u=p` <option value="times_a_month" ?selected="${0}"> ${0} </option> `),".5m"===i,this.t("times_a_month")),this.options.map((e=>a(c||(c=p` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.value,".5m"!==i&&e.value===(null==v?void 0:v.value),this.t(e.label,{count:m})))),this.helperText,this.disabled||this.readonly,this._errorMessage)}});
@@ -1 +1 @@
1
- import"./shared-a0baefff.js";import{I as e}from"./shared-2bb1f0f4.js";import{_ as t}from"./shared-8f9014ff.js";import{c as s,h as i,s as r}from"./shared-ba5c42c7.js";import{i as l}from"./shared-53e42a77.js";import{c as a}from"./shared-4e709717.js";import{l as o}from"./shared-d0aed1c1.js";let n,d,u,h,c,p,f,m,v,x=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(n||(n=x`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():"pill"===this.layout?this.__renderPillLayout():i(d||(d=x` <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> `),l(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=x`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?i(h||(h=x`<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}_handleHostClick(e){var t;if("summary-item"!==this.layout)return;const s=e.composedPath(),i=new Set(["INPUT","LABEL","BUTTON"]);s.some((e=>i.has(e.tagName)))||(null===(t=this.renderRoot.querySelector("input"))||void 0===t||t.focus(),super._handleHostClick(e))}__renderSummaryItemLayout(){return i(c||(c=x` <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(p||(p=x`<div>${0}</div>`),this.prefix):"",this.placeholder,a({"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=x`<div class="font-medium text-secondary">${0}</div>`),this.suffix):"",this.t("clear"),a({"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=x`<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)}__renderPillLayout(){var e;const t=this._value||this.placeholder;return i(v||(v=x` <div class="text-center flex items-center gap-s relative" style="min-width:6rem"> <span class="${0}">${0}</span> <input placeholder="${0}" aria-label="${0}" class="${0}" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </div> `),"relative block whitespace-pre text-center text-xl font-medium px-s py-xs -my-xs opacity-0",t,this.placeholder,this.label,a({"text-center appearance-none transition-all text-xl font-medium rounded":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"px-s py-xs -my-xs absolute inset-0":!0,"hover-bg-contrast-10":!this.disabled&&!this.readonly,"bg-transparent":this.readonly,"bg-contrast-5":!this.readonly,"text-disabled":this.disabled&&!this.readonly}),this.disabled,this.readonly,null!==(e=this._value)&&void 0!==e?e:"",(e=>{var t;"Enter"===e.key&&(e.preventDefault(),null===(t=this.nucleon)||void 0===t||t.submit())}),(e=>{const t=e.currentTarget;this._value=t.value}))}});
1
+ import"./shared-a0baefff.js";import{I as e}from"./shared-486d4db3.js";import{_ as t}from"./shared-8f9014ff.js";import{c as s,h as i,s as r}from"./shared-ba5c42c7.js";import{i as l}from"./shared-53e42a77.js";import{c as a}from"./shared-4e709717.js";import{l as o}from"./shared-d0aed1c1.js";let n,d,u,h,c,p,f,m,v,x=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(n||(n=x`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():"pill"===this.layout?this.__renderPillLayout():i(d||(d=x` <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> `),l(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=x`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?i(h||(h=x`<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}_handleHostClick(e){var t;if("summary-item"!==this.layout)return;const s=e.composedPath(),i=new Set(["INPUT","LABEL","BUTTON"]);s.some((e=>i.has(e.tagName)))||(null===(t=this.renderRoot.querySelector("input"))||void 0===t||t.focus(),super._handleHostClick(e))}__renderSummaryItemLayout(){return i(c||(c=x` <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(p||(p=x`<div>${0}</div>`),this.prefix):"",this.placeholder,a({"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=x`<div class="font-medium text-secondary">${0}</div>`),this.suffix):"",this.t("clear"),a({"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=x`<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)}__renderPillLayout(){var e;const t=this._value||this.placeholder;return i(v||(v=x` <div class="text-center flex items-center gap-s relative" style="min-width:6rem"> <span class="${0}">${0}</span> <input placeholder="${0}" aria-label="${0}" class="${0}" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </div> `),"relative block whitespace-pre text-center text-xl font-medium px-s py-xs -my-xs opacity-0",t,this.placeholder,this.label,a({"text-center appearance-none transition-all text-xl font-medium rounded":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"px-s py-xs -my-xs absolute inset-0":!0,"hover-bg-contrast-10":!this.disabled&&!this.readonly,"bg-transparent":this.readonly,"bg-contrast-5":!this.readonly,"text-disabled":this.disabled&&!this.readonly}),this.disabled,this.readonly,null!==(e=this._value)&&void 0!==e?e:"",(e=>{var t;"Enter"===e.key&&(e.preventDefault(),null===(t=this.nucleon)||void 0===t||t.submit())}),(e=>{const t=e.currentTarget;this._value=t.value}))}});
@@ -36,6 +36,10 @@
36
36
  "label_inactive": "Test setup (inactive)",
37
37
  "helper_text": "",
38
38
  "helper_text_inactive": "To use this setup, turn off the \"Use live credentials\" option in the payment method set.",
39
+ "default-credentials": {
40
+ "label": "Use default test credentials",
41
+ "helper_text": "Uses Foxy's shared test credentials for this gateway. Turn off to enter your own."
42
+ },
39
43
  "test-card-verification": {
40
44
  "label": "Card verification",
41
45
  "placeholder": "Select",
@@ -1,6 +1,7 @@
1
1
  import { FormatFunction } from 'i18next';
2
2
  /**
3
3
  * i18next formatter that presents a fraction as percentage.
4
+ * Keeps up to 4 decimal places (e.g. 0.08875 -> 8.875%) unless overridden in options.
4
5
  * @see https://www.i18next.com/translation-function/formatting
5
6
  */
6
7
  export declare const percent: FormatFunction;
@@ -1,12 +1,17 @@
1
1
  /**
2
2
  * i18next formatter that presents a fraction as percentage.
3
+ * Keeps up to 4 decimal places (e.g. 0.08875 -> 8.875%) unless overridden in options.
3
4
  * @see https://www.i18next.com/translation-function/formatting
4
5
  */
5
6
  export const percent = (value, format, lang, options) => {
6
7
  let result = null;
7
8
  try {
8
9
  if (typeof value === 'number') {
9
- result = value.toLocaleString(lang, { ...options, style: 'percent' });
10
+ result = value.toLocaleString(lang, {
11
+ maximumFractionDigits: 4,
12
+ ...options,
13
+ style: 'percent',
14
+ });
10
15
  }
11
16
  }
12
17
  catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"percent.js","sourceRoot":"","sources":["../../../../../src/elements/public/I18n/format/percent.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAU,EAAE;IAC9E,IAAI,MAAM,GAAkB,IAAI,CAAC;IAEjC,IAAI;QACF,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SACvE;KACF;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,IAAI,CAAC,4BAA4B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;KACzD;IAED,OAAO,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC,CAAC","sourcesContent":["import { FormatFunction } from 'i18next';\n\n/**\n * i18next formatter that presents a fraction as percentage.\n * @see https://www.i18next.com/translation-function/formatting\n */\nexport const percent: FormatFunction = (value, format, lang, options): string => {\n let result: string | null = null;\n\n try {\n if (typeof value === 'number') {\n result = value.toLocaleString(lang, { ...options, style: 'percent' });\n }\n } catch (err) {\n console.warn(`i18next formatter error: ${err.message}`);\n }\n\n return result || String(value);\n};\n"]}
1
+ {"version":3,"file":"percent.js","sourceRoot":"","sources":["../../../../../src/elements/public/I18n/format/percent.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAU,EAAE;IAC9E,IAAI,MAAM,GAAkB,IAAI,CAAC;IAEjC,IAAI;QACF,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE;gBAClC,qBAAqB,EAAE,CAAC;gBACxB,GAAG,OAAO;gBACV,KAAK,EAAE,SAAS;aACjB,CAAC,CAAC;SACJ;KACF;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,IAAI,CAAC,4BAA4B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;KACzD;IAED,OAAO,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC,CAAC","sourcesContent":["import { FormatFunction } from 'i18next';\n\n/**\n * i18next formatter that presents a fraction as percentage.\n * Keeps up to 4 decimal places (e.g. 0.08875 -> 8.875%) unless overridden in options.\n * @see https://www.i18next.com/translation-function/formatting\n */\nexport const percent: FormatFunction = (value, format, lang, options): string => {\n let result: string | null = null;\n\n try {\n if (typeof value === 'number') {\n result = value.toLocaleString(lang, {\n maximumFractionDigits: 4,\n ...options,\n style: 'percent',\n });\n }\n } catch (err) {\n console.warn(`i18next formatter error: ${err.message}`);\n }\n\n return result || String(value);\n};\n"]}
@@ -43,6 +43,10 @@ export declare class PaymentsApiPaymentMethodForm extends Base<Data> {
43
43
  private readonly __threeDSecureToggleSetValue;
44
44
  private readonly __threeDSecureToggleOptions;
45
45
  private readonly __cardVerificationOptions;
46
+ /** On when every test credential with a default is set to that default. */
47
+ private readonly __defaultTestCredentialsGetValue;
48
+ /** Fills in the defaults when turned on. Clears the same fields when turned off. */
49
+ private readonly __defaultTestCredentialsSetValue;
46
50
  private __search;
47
51
  private __connectState;
48
52
  /** Key of the connect choice whose connection URL is being fetched. */
@@ -60,6 +64,12 @@ export declare class PaymentsApiPaymentMethodForm extends Base<Data> {
60
64
  private get __storeLoader();
61
65
  private get __liveBlocks();
62
66
  private get __testBlocks();
67
+ /** Top-level test credentials with a non-empty default for the selected gateway. */
68
+ private get __defaultTestCredentials();
69
+ /** Visible test additional fields with a non-empty default for the selected gateway. */
70
+ private get __defaultTestFields();
71
+ private get __hasDefaultTestCredentials();
72
+ private get __additionalFieldsConfig();
63
73
  private __renderPaymentMethodSelector;
64
74
  private __redirect;
65
75
  private __getConnectChoices;
@@ -8,6 +8,7 @@ import Fuse from 'fuse.js';
8
8
  import has from 'lodash-es/has';
9
9
  import get from 'lodash-es/get';
10
10
  import set from 'lodash-es/set';
11
+ import unset from 'lodash-es/unset';
11
12
  /** OAuth gateways that connect through fx:connect_gateway. Other OAuth gateways show a notice. */
12
13
  const connectableGateways = ['paypal_platform'];
13
14
  const NS = 'payments-api-payment-method-form';
@@ -82,6 +83,28 @@ export class PaymentsApiPaymentMethodForm extends Base {
82
83
  { label: 'option_enabled_automatically', value: 'enabled_automatically' },
83
84
  { label: 'option_enabled_override', value: 'enabled_override' },
84
85
  ];
86
+ /** On when every test credential with a default is set to that default. */
87
+ this.__defaultTestCredentialsGetValue = () => {
88
+ const config = this.__additionalFieldsConfig;
89
+ return (this.__hasDefaultTestCredentials &&
90
+ this.__defaultTestCredentials.every(([key, value]) => this.form[key] === value) &&
91
+ this.__defaultTestFields.every(field => get(config, field.id) === field.default_value));
92
+ };
93
+ /** Fills in the defaults when turned on. Clears the same fields when turned off. */
94
+ this.__defaultTestCredentialsSetValue = (newValue) => {
95
+ const config = this.__additionalFieldsConfig;
96
+ const edit = {};
97
+ this.__defaultTestCredentials.forEach(([key, value]) => (edit[key] = newValue ? value : ''));
98
+ this.__defaultTestFields.forEach(field => {
99
+ if (newValue)
100
+ set(config, field.id, field.default_value);
101
+ else
102
+ unset(config, field.id);
103
+ });
104
+ if (this.__defaultTestFields.length)
105
+ edit.additional_fields = JSON.stringify(config);
106
+ this.edit(edit);
107
+ };
85
108
  this.__search = '';
86
109
  this.__connectState = 'idle';
87
110
  /** Key of the connect choice whose connection URL is being fetched. */
@@ -266,6 +289,35 @@ export class PaymentsApiPaymentMethodForm extends Base {
266
289
  var _a, _b, _c;
267
290
  return (_c = (_b = (_a = this.form.helper) === null || _a === void 0 ? void 0 : _a.additional_fields) === null || _b === void 0 ? void 0 : _b.blocks.filter(block => !block.is_live)) !== null && _c !== void 0 ? _c : [];
268
291
  }
292
+ /** Top-level test credentials with a non-empty default for the selected gateway. */
293
+ get __defaultTestCredentials() {
294
+ const helper = this.form.helper;
295
+ const credentials = [
296
+ ['test_account_id', helper === null || helper === void 0 ? void 0 : helper.test_id],
297
+ ['test_account_key', helper === null || helper === void 0 ? void 0 : helper.test_key],
298
+ ['test_third_party_key', helper === null || helper === void 0 ? void 0 : helper.test_third_party_key],
299
+ ];
300
+ return credentials.filter((entry) => !!entry[1]);
301
+ }
302
+ /** Visible test additional fields with a non-empty default for the selected gateway. */
303
+ get __defaultTestFields() {
304
+ return this.__testBlocks
305
+ .flatMap(block => block.fields)
306
+ .filter(field => field.type !== 'hidden' && typeof field.default_value === 'string')
307
+ .filter(field => field.default_value !== '');
308
+ }
309
+ get __hasDefaultTestCredentials() {
310
+ return this.__defaultTestCredentials.length > 0 || this.__defaultTestFields.length > 0;
311
+ }
312
+ get __additionalFieldsConfig() {
313
+ var _a, _b;
314
+ try {
315
+ return (_b = JSON.parse((_a = this.form.additional_fields) !== null && _a !== void 0 ? _a : '')) !== null && _b !== void 0 ? _b : {};
316
+ }
317
+ catch (_c) {
318
+ return {};
319
+ }
320
+ }
269
321
  __renderPaymentMethodSelector() {
270
322
  const loader = this.__availablePaymentMethodsLoader;
271
323
  if (!(loader === null || loader === void 0 ? void 0 : loader.data)) {
@@ -509,6 +561,7 @@ export class PaymentsApiPaymentMethodForm extends Base {
509
561
  const inferPrefix = index === 0 ? '' : `${type}-`;
510
562
  const blocks = index === 0 ? this.__liveBlocks : this.__testBlocks;
511
563
  const scope = `${type}-group`;
564
+ const useDefaults = type === 'test' && this.__defaultTestCredentialsGetValue();
512
565
  if (type === 'live' && !((_a = this.__storeLoader) === null || _a === void 0 ? void 0 : _a.data))
513
566
  return html ``;
514
567
  if (type === 'live' && !((_c = (_b = this.__storeLoader) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.is_active)) {
@@ -535,7 +588,19 @@ export class PaymentsApiPaymentMethodForm extends Base {
535
588
  infer=${scope}
536
589
  >
537
590
  <foxy-internal-summary-control infer="" label="" helper-text="">
538
- ${((_k = this.form.helper) === null || _k === void 0 ? void 0 : _k.id_description) ? html `
591
+ ${type === 'test' && this.__hasDefaultTestCredentials
592
+ ? html `
593
+ <foxy-internal-switch-control
594
+ infer="default-credentials"
595
+ helper-text-as-tooltip
596
+ .getValue=${this.__defaultTestCredentialsGetValue}
597
+ .setValue=${this.__defaultTestCredentialsSetValue}
598
+ >
599
+ </foxy-internal-switch-control>
600
+ `
601
+ : ''}
602
+ ${((_k = this.form.helper) === null || _k === void 0 ? void 0 : _k.id_description) && !(useDefaults && this.form.helper.test_id)
603
+ ? html `
539
604
  <foxy-internal-text-control
540
605
  placeholder=${this.t('default_additional_field_placeholder')}
541
606
  helper-text=""
@@ -546,7 +611,9 @@ export class PaymentsApiPaymentMethodForm extends Base {
546
611
  </foxy-internal-text-control>
547
612
  `
548
613
  : ''}
549
- ${((_l = this.form.helper) === null || _l === void 0 ? void 0 : _l.third_party_key_description) ? html `
614
+ ${((_l = this.form.helper) === null || _l === void 0 ? void 0 : _l.third_party_key_description) &&
615
+ !(useDefaults && this.form.helper.test_third_party_key)
616
+ ? html `
550
617
  <foxy-internal-password-control
551
618
  placeholder=${this.t('default_additional_field_placeholder')}
552
619
  helper-text=""
@@ -557,7 +624,8 @@ export class PaymentsApiPaymentMethodForm extends Base {
557
624
  </foxy-internal-password-control>
558
625
  `
559
626
  : ''}
560
- ${((_m = this.form.helper) === null || _m === void 0 ? void 0 : _m.key_description) ? html `
627
+ ${((_m = this.form.helper) === null || _m === void 0 ? void 0 : _m.key_description) && !(useDefaults && this.form.helper.test_key)
628
+ ? html `
561
629
  <foxy-internal-password-control
562
630
  placeholder=${this.t('default_additional_field_placeholder')}
563
631
  layout="summary-item"
@@ -568,7 +636,7 @@ export class PaymentsApiPaymentMethodForm extends Base {
568
636
  </foxy-internal-password-control>
569
637
  `
570
638
  : ''}
571
- ${blocks.map(block => this.__renderBlock(block))}
639
+ ${blocks.map(block => this.__renderBlock(block, useDefaults ? this.__defaultTestFields : []))}
572
640
  ${((_o = this.form.helper) === null || _o === void 0 ? void 0 : _o.supports_card_verification) ? html `
573
641
  <foxy-internal-select-control
574
642
  helper-text=${this.t(`${scope}.${inferPrefix}card-verification.helper_text_${this.form[`${propertyPrefix}card_verification`] || 'disabled'}`)}
@@ -689,10 +757,10 @@ export class PaymentsApiPaymentMethodForm extends Base {
689
757
  </button>
690
758
  `;
691
759
  }
692
- __renderBlock(block) {
760
+ __renderBlock(block, hiddenFields = []) {
693
761
  return html `${block.fields.map(field => {
694
762
  var _a, _b, _c;
695
- if (field.type === 'hidden')
763
+ if (field.type === 'hidden' || hiddenFields.includes(field))
696
764
  return;
697
765
  const scope = ['additional-fields', field.id].join('-').replace(/_/g, '-');
698
766
  const getValue = () => {
@@ -702,7 +770,8 @@ export class PaymentsApiPaymentMethodForm extends Base {
702
770
  return (_b = get(config, field.id)) !== null && _b !== void 0 ? _b : config.default_value;
703
771
  }
704
772
  catch (_c) {
705
- return field.default_value;
773
+ // Test defaults are filled in explicitly with the default credentials switch.
774
+ return block.is_live ? field.default_value : undefined;
706
775
  }
707
776
  };
708
777
  const setValue = (newValue) => {
@@ -747,7 +816,7 @@ export class PaymentsApiPaymentMethodForm extends Base {
747
816
  : html `
748
817
  <foxy-internal-text-control
749
818
  helper-text=${(_c = field.description) !== null && _c !== void 0 ? _c : ''}
750
- placeholder=${field.default_value || this.t('default_additional_field_placeholder')}
819
+ placeholder=${this.t('default_additional_field_placeholder')}
751
820
  layout="summary-item"
752
821
  label=${field.name}
753
822
  infer=${scope}