@foxy.io/elements 1.37.0-beta.2 → 1.37.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 (61) hide show
  1. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  2. package/dist/cdn/foxy-cart-form.js +2 -2
  3. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  4. package/dist/cdn/foxy-coupon-form.js +1 -1
  5. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  6. package/dist/cdn/foxy-customer-portal.js +1 -1
  7. package/dist/cdn/foxy-customer.js +1 -1
  8. package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
  9. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  10. package/dist/cdn/foxy-gift-card-form.js +1 -1
  11. package/dist/cdn/foxy-item-category-form.js +1 -1
  12. package/dist/cdn/foxy-item-form.js +1 -1
  13. package/dist/cdn/foxy-payment-method-card.js +1 -1
  14. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  15. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  16. package/dist/cdn/foxy-subscription-form.js +1 -1
  17. package/dist/cdn/foxy-tax-form.js +1 -1
  18. package/dist/cdn/foxy-template-set-form.js +1 -1
  19. package/dist/cdn/foxy-transaction.js +1 -1
  20. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  21. package/dist/cdn/foxy-webhook-form.js +1 -1
  22. package/dist/cdn/{shared-0782fee5.js → shared-2edce408.js} +1 -1
  23. package/dist/cdn/shared-79f84a95.js +1 -0
  24. package/dist/cdn/{shared-fda02728.js → shared-a42e4325.js} +1 -1
  25. package/dist/cdn/translations/admin-subscription-form/en.json +1 -1
  26. package/dist/cdn/translations/cart-form/en.json +5 -5
  27. package/dist/cdn/translations/customer/en.json +1 -1
  28. package/dist/cdn/translations/experimental-add-to-cart-builder/en.json +3 -3
  29. package/dist/cdn/translations/gift-card-code-form/en.json +2 -1
  30. package/dist/cdn/translations/gift-card-form/en.json +3 -2
  31. package/dist/cdn/translations/item-category-form/en.json +2 -2
  32. package/dist/cdn/translations/item-form/en.json +1 -1
  33. package/dist/cdn/translations/payment-method-card/en.json +2 -2
  34. package/dist/cdn/translations/transaction/en.json +1 -1
  35. package/dist/cdn/translations/update-payment-method-form/en.json +1 -1
  36. package/dist/cdn/translations/webhook-form/en.json +12 -12
  37. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.d.ts +1 -1
  38. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +9 -7
  39. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
  40. package/dist/elements/internal/InternalDateControl/InternalDateControl.js +3 -3
  41. package/dist/elements/internal/InternalDateControl/InternalDateControl.js.map +1 -1
  42. package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.d.ts +2 -1
  43. package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js +18 -5
  44. package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js.map +1 -1
  45. package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.d.ts +4 -1
  46. package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +17 -0
  47. package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
  48. package/dist/elements/public/GiftCardCodeForm/types.d.ts +1 -0
  49. package/dist/elements/public/GiftCardCodeForm/types.js.map +1 -1
  50. package/dist/elements/public/GiftCardForm/GiftCardForm.d.ts +5 -0
  51. package/dist/elements/public/GiftCardForm/GiftCardForm.js +18 -8
  52. package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
  53. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js +1 -1
  54. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js.map +1 -1
  55. package/dist/elements/public/WebhookForm/WebhookForm.js +5 -3
  56. package/dist/elements/public/WebhookForm/WebhookForm.js.map +1 -1
  57. package/dist/elements/public/WebhookForm/index.d.ts +0 -1
  58. package/dist/elements/public/WebhookForm/index.js +0 -1
  59. package/dist/elements/public/WebhookForm/index.js.map +1 -1
  60. package/package.json +1 -1
  61. package/dist/cdn/shared-a72df5aa.js +0 -1
@@ -1 +1 @@
1
- import"./shared-0782fee5.js";import"./shared-e1b97b27.js";import"./shared-6aa8f7ee.js";import"./shared-fda02728.js";import{b as r,I as o}from"./shared-edb68eb7.js";import"./foxy-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-transaction.js";import"./shared-bb43f0ad.js";import{_ as t,B as e}from"./shared-d1195c27.js";import{i as s}from"./shared-53e42a77.js";import{h as a,s as i}from"./shared-ba5c42c7.js";import{a as n}from"./shared-fefaece7.js";import"./shared-256fe764.js";import"./shared-944dc1e2.js";import"./shared-00b50480.js";import"./shared-00cd0e86.js";import"./shared-5cea7ef0.js";import"./shared-f0afd1ee.js";import"./shared-188a9c2e.js";import"./shared-421b13a8.js";import"./shared-15ded782.js";import"./shared-0564def4.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-b7889b37.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-eeb2bd18.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-a208ae8c.js";import"./shared-e14bc410.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-a63c89a1.js";import"./shared-4215bff2.js";import"./shared-355ef444.js";import"./shared-a3f1420c.js";import"./shared-c3fd2e9c.js";import"./shared-cf8e2611.js";import"./shared-cb2a2e33.js";import"./shared-b4b9735c.js";import"./shared-6524d421.js";import"./shared-651c44fa.js";import"./shared-c2ca5bee.js";import"./shared-75908858.js";import"./shared-05ed8288.js";import"./shared-df76d498.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-56f7db6f.js";import"./shared-4558cdb4.js";import"./shared-bab2ea2c.js";import"./shared-47962c3f.js";import"./shared-0c61b5ce.js";import"./shared-1c6a1571.js";import"./shared-b15d45b1.js";import"./foxy-billing-address-card.js";import"./foxy-custom-field-form.js";import"./shared-31b98ac2.js";import"./foxy-custom-field-card.js";import"./shared-e4159eb9.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./shared-641786b2.js";import"./foxy-payment-card.js";import"./shared-cf613436.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./shared-7ab454fb.js";import"./shared-82614ac9.js";import"./shared-c5fa5c92.js";import"./shared-b293a928.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-address-form.js";import"./foxy-item-card.js";import"./shared-6042ee79.js";import"./foxy-item-form.js";import"./shared-a72df5aa.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./shared-70bd1896.js";import"./foxy-customer-card.js";let d,m=r=>r;customElements.define("foxy-internal-admin-subscription-form-load-in-cart-action",class extends r{constructor(){super(...arguments),this.action=null}static get properties(){return t(t({},super.properties),{},{action:{}})}renderControl(){var r,o;const t=this.nucleon;let e;try{const s=new URL(null!==(o=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r._links["fx:sub_token_url"].href)&&void 0!==o?o:"");"cancel"===this.action&&s.searchParams.set("sub_cancel","true"),e=s.toString()}catch(r){e=void 0}return a(d||(d=m` <a target="_blank" class="rounded font-medium text-primary group focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="caption"> </foxy-i18n> </a> `),s(e))}});let c,f,l=r=>r;customElements.define("foxy-internal-admin-subscription-form-error",class extends r{renderControl(){var r,o;return a(c||(c=l` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),i(f||(f=l`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),null===(o=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===o?void 0:o.error_message)}});let p,h,u=r=>r;const j=n(o,"admin-subscription-form");class y extends j{get hiddenSelector(){var r,o;const t=["delete",super.hiddenSelector.toString()];return(null===(r=this.data)||void 0===r?void 0:r.error_message)||t.unshift("error-message"),(null===(o=this.data)||void 0===o?void 0:o.is_active)||t.unshift("view-action","cancel-action"),new e(t.join(" ").trim())}get headerSubtitleOptions(){var r;return{context:(null===(r=this.data)||void 0===r?void 0:r.is_active)?"active":"inactive"}}renderHeaderActions(r){return a(p||(p=u` <foxy-internal-admin-subscription-form-load-in-cart-action infer="view-action"> </foxy-internal-admin-subscription-form-load-in-cart-action> <foxy-internal-admin-subscription-form-load-in-cart-action action="cancel" infer="cancel-action"> </foxy-internal-admin-subscription-form-load-in-cart-action> `))}renderBody(){var r,o,t,e,i;let n;try{const t=new URL(null!==(o=null===(r=this.data)||void 0===r?void 0:r._links["fx:transactions"].href)&&void 0!==o?o:"");t.searchParams.set("zoom","items"),n=t.toString()}catch(r){n=void 0}return a(h||(h=u` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> ${0} <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),s(null===(t=this.data)||void 0===t?void 0:t._embedded["fx:transaction_template"].currency_code),this.renderTemplateOrSlot(),s(null===(i=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===i?void 0:i["fx:attributes"].href),s(n),super.renderBody())}}customElements.define("foxy-admin-subscription-form",y);export{y as AdminSubscriptionForm};
1
+ import"./shared-2edce408.js";import"./shared-e1b97b27.js";import"./shared-6aa8f7ee.js";import"./shared-a42e4325.js";import{b as r,I as o}from"./shared-edb68eb7.js";import"./foxy-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-transaction.js";import"./shared-bb43f0ad.js";import{_ as t,B as e}from"./shared-d1195c27.js";import{i as s}from"./shared-53e42a77.js";import{h as a,s as i}from"./shared-ba5c42c7.js";import{a as n}from"./shared-fefaece7.js";import"./shared-256fe764.js";import"./shared-944dc1e2.js";import"./shared-00b50480.js";import"./shared-00cd0e86.js";import"./shared-5cea7ef0.js";import"./shared-f0afd1ee.js";import"./shared-188a9c2e.js";import"./shared-421b13a8.js";import"./shared-15ded782.js";import"./shared-0564def4.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-b7889b37.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-eeb2bd18.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-a208ae8c.js";import"./shared-e14bc410.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-a63c89a1.js";import"./shared-4215bff2.js";import"./shared-355ef444.js";import"./shared-a3f1420c.js";import"./shared-c3fd2e9c.js";import"./shared-cf8e2611.js";import"./shared-cb2a2e33.js";import"./shared-b4b9735c.js";import"./shared-6524d421.js";import"./shared-651c44fa.js";import"./shared-c2ca5bee.js";import"./shared-75908858.js";import"./shared-05ed8288.js";import"./shared-df76d498.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-56f7db6f.js";import"./shared-4558cdb4.js";import"./shared-bab2ea2c.js";import"./shared-47962c3f.js";import"./shared-0c61b5ce.js";import"./shared-1c6a1571.js";import"./shared-b15d45b1.js";import"./foxy-billing-address-card.js";import"./foxy-custom-field-form.js";import"./shared-31b98ac2.js";import"./foxy-custom-field-card.js";import"./shared-e4159eb9.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./shared-641786b2.js";import"./foxy-payment-card.js";import"./shared-cf613436.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./shared-7ab454fb.js";import"./shared-82614ac9.js";import"./shared-c5fa5c92.js";import"./shared-b293a928.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-address-form.js";import"./foxy-item-card.js";import"./shared-6042ee79.js";import"./foxy-item-form.js";import"./shared-79f84a95.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./shared-70bd1896.js";import"./foxy-customer-card.js";let d,m=r=>r;customElements.define("foxy-internal-admin-subscription-form-load-in-cart-action",class extends r{constructor(){super(...arguments),this.action=null}static get properties(){return t(t({},super.properties),{},{action:{}})}renderControl(){var r,o;const t=this.nucleon;let e;try{const s=new URL(null!==(o=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r._links["fx:sub_token_url"].href)&&void 0!==o?o:"");"cancel"===this.action&&s.searchParams.set("sub_cancel","true"),e=s.toString()}catch(r){e=void 0}return a(d||(d=m` <a target="_blank" class="rounded font-medium text-primary group focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="caption"> </foxy-i18n> </a> `),s(e))}});let c,f,l=r=>r;customElements.define("foxy-internal-admin-subscription-form-error",class extends r{renderControl(){var r,o;return a(c||(c=l` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),i(f||(f=l`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),null===(o=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===o?void 0:o.error_message)}});let p,h,u=r=>r;const j=n(o,"admin-subscription-form");class y extends j{get hiddenSelector(){var r,o;const t=["delete",super.hiddenSelector.toString()];return(null===(r=this.data)||void 0===r?void 0:r.error_message)||t.unshift("error-message"),(null===(o=this.data)||void 0===o?void 0:o.is_active)||t.unshift("view-action","cancel-action"),new e(t.join(" ").trim())}get headerSubtitleOptions(){var r;return{context:(null===(r=this.data)||void 0===r?void 0:r.is_active)?"active":"inactive"}}renderHeaderActions(r){return a(p||(p=u` <foxy-internal-admin-subscription-form-load-in-cart-action infer="view-action"> </foxy-internal-admin-subscription-form-load-in-cart-action> <foxy-internal-admin-subscription-form-load-in-cart-action action="cancel" infer="cancel-action"> </foxy-internal-admin-subscription-form-load-in-cart-action> `))}renderBody(){var r,o,t,e,i;let n;try{const t=new URL(null!==(o=null===(r=this.data)||void 0===r?void 0:r._links["fx:transactions"].href)&&void 0!==o?o:"");t.searchParams.set("zoom","items"),n=t.toString()}catch(r){n=void 0}return a(h||(h=u` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> ${0} <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),s(null===(t=this.data)||void 0===t?void 0:t._embedded["fx:transaction_template"].currency_code),this.renderTemplateOrSlot(),s(null===(i=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===i?void 0:i["fx:attributes"].href),s(n),super.renderBody())}}customElements.define("foxy-admin-subscription-form",y);export{y as AdminSubscriptionForm};
@@ -1,4 +1,4 @@
1
- import"./shared-a72df5aa.js";import"./shared-0782fee5.js";import"./shared-0564def4.js";import"./shared-70bd1896.js";import"./shared-c5fa5c92.js";import"./shared-b293a928.js";import{b as e,a as t,I as r}from"./shared-edb68eb7.js";import"./foxy-applied-coupon-code-card.js";import"./foxy-applied-coupon-code-form.js";import"./foxy-custom-field-card.js";import"./foxy-custom-field-form.js";import"./foxy-template-set-card.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-bb43f0ad.js";import{_ as i,B as o}from"./shared-d1195c27.js";import{c as s}from"./shared-4e709717.js";import{h as n,c as a}from"./shared-ba5c42c7.js";import"./shared-f0afd1ee.js";import{R as l,a as d}from"./shared-fefaece7.js";import{i as c}from"./shared-53e42a77.js";import"./foxy-update-payment-method-form.js";import{U as u}from"./shared-cd96ff03.js";import{s as m}from"./shared-53e476fd.js";import"./shared-47962c3f.js";import{g as p}from"./shared-bab2ea2c.js";import{T as _}from"./shared-e4159eb9.js";import{T as f}from"./shared-8874ec69.js";import"./foxy-copy-to-clipboard.js";import"./shared-56f7db6f.js";import"./shared-944dc1e2.js";import"./shared-00cd0e86.js";import"./shared-256fe764.js";import"./shared-00b50480.js";import"./shared-4558cdb4.js";import"./shared-b7889b37.js";import"./shared-eeb2bd18.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./foxy-form-dialog.js";import"./shared-a208ae8c.js";import"./shared-e14bc410.js";import"./shared-7e9fdf64.js";import"./shared-d1dfac4d.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-5cea7ef0.js";import"./shared-188a9c2e.js";import"./shared-421b13a8.js";import"./shared-15ded782.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5fd5805c.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-b4b9735c.js";import"./shared-6524d421.js";import"./shared-4215bff2.js";import"./shared-651c44fa.js";import"./shared-355ef444.js";import"./shared-a3f1420c.js";import"./shared-c3fd2e9c.js";import"./shared-c2ca5bee.js";import"./shared-75908858.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-0c61b5ce.js";import"./shared-31b98ac2.js";import"./shared-b15d45b1.js";import"./shared-1c6a1571.js";import"./shared-6042ee79.js";import"./shared-641786b2.js";import"./shared-e1b97b27.js";import"./shared-a63c89a1.js";import"./shared-cf8e2611.js";import"./shared-cb2a2e33.js";import"./shared-6aa8f7ee.js";import"./shared-fda02728.js";import"./shared-05ed8288.js";import"./shared-df76d498.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-payment-card-embed.js";import"./shared-0d757c1c.js";import"./shared-9ca85d1e.js";import"./shared-c2efc54e.js";let h,y,v=e=>e;customElements.define("foxy-internal-cart-form-create-session-action",class extends e{constructor(){super(...arguments),this.__loader=null}static get properties(){return i(i({},super.properties),{},{__loader:{attribute:!1}})}renderControl(){var e,t;const r=null===(e=this.__loader)||void 0===e?void 0:e.state,i=null===(t=this.__loader)||void 0===t?void 0:t.result;return i?n(h||(h=v` <a target="_blank" class="rounded font-medium transition-colors text-body focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="state_idle"></foxy-i18n> </a> `),i):n(y||(y=v` <div class="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </div> `),s({"transition-colors font-medium rounded":!0,"text-tertiary":"fail"!==r,"text-error":"fail"===r}),"fail"===r?"state_fail":"state_busy")}updated(e){var t;super.updated(e);const r=this.nucleon,i=null==r?void 0:r.data,o=null!==(t=null==i?void 0:i._links["fx:create_session"].href)&&void 0!==t?t:null;this.__reloadSessionHref(o)}async __reloadSessionHref(e){var t;if((null===(t=this.__loader)||void 0===t?void 0:t.href)===e)return;const r=this.nucleon;if(r)if(e){const t={result:null,state:"busy",href:e},i=new r.constructor.API(this);this.__loader=t;try{const r=await i.fetch(e,{method:"POST"});if(!r.ok)throw new Error;t.result=(await r.json()).cart_link,t.state="idle"}catch(e){t.state="fail"}finally{this.requestUpdate()}}else this.__loader=null}});let g;const x=a(g||(g=(e=>e)`
1
+ import"./shared-79f84a95.js";import"./shared-2edce408.js";import"./shared-0564def4.js";import"./shared-70bd1896.js";import"./shared-c5fa5c92.js";import"./shared-b293a928.js";import{b as e,a as t,I as r}from"./shared-edb68eb7.js";import"./foxy-applied-coupon-code-card.js";import"./foxy-applied-coupon-code-form.js";import"./foxy-custom-field-card.js";import"./foxy-custom-field-form.js";import"./foxy-template-set-card.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-bb43f0ad.js";import{_ as i,B as o}from"./shared-d1195c27.js";import{c as s}from"./shared-4e709717.js";import{h as n,c as a}from"./shared-ba5c42c7.js";import"./shared-f0afd1ee.js";import{R as l,a as d}from"./shared-fefaece7.js";import{i as c}from"./shared-53e42a77.js";import"./foxy-update-payment-method-form.js";import{U as u}from"./shared-cd96ff03.js";import{s as m}from"./shared-53e476fd.js";import"./shared-47962c3f.js";import{g as p}from"./shared-bab2ea2c.js";import{T as _}from"./shared-e4159eb9.js";import{T as h}from"./shared-8874ec69.js";import"./foxy-copy-to-clipboard.js";import"./shared-56f7db6f.js";import"./shared-944dc1e2.js";import"./shared-00cd0e86.js";import"./shared-256fe764.js";import"./shared-00b50480.js";import"./shared-4558cdb4.js";import"./shared-b7889b37.js";import"./shared-eeb2bd18.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./foxy-form-dialog.js";import"./shared-a208ae8c.js";import"./shared-e14bc410.js";import"./shared-7e9fdf64.js";import"./shared-d1dfac4d.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-5cea7ef0.js";import"./shared-188a9c2e.js";import"./shared-421b13a8.js";import"./shared-15ded782.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5fd5805c.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-b4b9735c.js";import"./shared-6524d421.js";import"./shared-4215bff2.js";import"./shared-651c44fa.js";import"./shared-355ef444.js";import"./shared-a3f1420c.js";import"./shared-c3fd2e9c.js";import"./shared-c2ca5bee.js";import"./shared-75908858.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-0c61b5ce.js";import"./shared-31b98ac2.js";import"./shared-b15d45b1.js";import"./shared-1c6a1571.js";import"./shared-6042ee79.js";import"./shared-641786b2.js";import"./shared-e1b97b27.js";import"./shared-a63c89a1.js";import"./shared-cf8e2611.js";import"./shared-cb2a2e33.js";import"./shared-6aa8f7ee.js";import"./shared-a42e4325.js";import"./shared-05ed8288.js";import"./shared-df76d498.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-payment-card-embed.js";import"./shared-0d757c1c.js";import"./shared-9ca85d1e.js";import"./shared-c2efc54e.js";let f,y,v=e=>e;customElements.define("foxy-internal-cart-form-create-session-action",class extends e{constructor(){super(...arguments),this.__loader=null}static get properties(){return i(i({},super.properties),{},{__loader:{attribute:!1}})}renderControl(){var e,t;const r=null===(e=this.__loader)||void 0===e?void 0:e.state,i=null===(t=this.__loader)||void 0===t?void 0:t.result;return i?n(f||(f=v` <a target="_blank" class="rounded font-medium transition-colors text-body focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="state_idle"></foxy-i18n> </a> `),i):n(y||(y=v` <div class="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </div> `),s({"transition-colors font-medium rounded":!0,"text-tertiary":"fail"!==r,"text-error":"fail"===r}),"fail"===r?"state_fail":"state_busy")}updated(e){var t;super.updated(e);const r=this.nucleon,i=null==r?void 0:r.data,o=null!==(t=null==i?void 0:i._links["fx:create_session"].href)&&void 0!==t?t:null;this.__reloadSessionHref(o)}async __reloadSessionHref(e){var t;if((null===(t=this.__loader)||void 0===t?void 0:t.href)===e)return;const r=this.nucleon;if(r)if(e){const t={result:null,state:"busy",href:e},i=new r.constructor.API(this);this.__loader=t;try{const r=await i.fetch(e,{method:"POST"});if(!r.ok)throw new Error;t.result=(await r.json()).cart_link,t.state="idle"}catch(e){t.state="fail"}finally{this.requestUpdate()}}else this.__loader=null}});let g;const x=a(g||(g=(e=>e)`
2
2
  #dialog{
3
3
  width:100dvw;
4
4
  max-height:calc(100dvh - var(--lumo-space-m));
@@ -54,4 +54,4 @@ import"./shared-a72df5aa.js";import"./shared-0782fee5.js";import"./shared-0564de
54
54
  }
55
55
  }
56
56
  }
57
- `));let b,$,j,k,w,P,U=e=>e;class S extends(l(t)){constructor(){super(...arguments),this.countries=null,this.customer=null,this.regions=null,this.type=null}static get properties(){return i(i({},super.properties),{},{countries:{},customer:{type:Object},regions:{},type:{}})}static get styles(){return[...super.styles,x]}get disabledSelector(){var e;const t=[super.disabledSelector.toString()];return(null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||t.unshift("address:state"),new o(t.join(" ").toString())}renderControl(){var e,t;const r=this.__regionOptions,i=null!==(e=this.type)&&void 0!==e?e:"billing",o=this.__mergedAddress;return n(b||(b=U` <div class="flex flex-col gap-m sm-flex-row items-start leading-xs"> <div class="flex-1"> <p class="text-m text-body">${0}</p> <p class="text-xs text-secondary">${0}</p> <p class="text-xs text-error" ?hidden="${0}"> ${0} </p> </div> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> <dialog id="dialog" class="p-m bg-base shadow-xxl space-y-m"> <h2 class="text-xl font-medium"> <foxy-i18n infer="" key="label"></foxy-i18n> </h2> <foxy-internal-summary-control infer="name"> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="address"> ${0} ${0} ${0} <foxy-internal-select-control placeholder="${0}" property="${0}_country" layout="summary-item" infer="country" .options="${0}"> </foxy-internal-select-control> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="extra"> ${0} ${0} </foxy-internal-summary-control> <p class="text-xs text-secondary"> <foxy-i18n infer="" key="form_helper_text"></foxy-i18n> </p> <div class="flex justify-between gap-m"> <vaadin-button theme="error" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <foxy-i18n infer="" key="reset"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="done"></foxy-i18n> </vaadin-button> </div> </dialog> <foxy-nucleon class="hidden" infer="" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="regionsLoader" @update="${0}"> </foxy-nucleon> `),this.label,this.helperText,this.disabled||this.readonly,this._errorMessage,this.t("edit"),s({"text-left sm-text-right transition-colors transition-opacity":!0,"text-body cursor-pointer hover-opacity-80":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),this.disabled||this.readonly,(()=>{var e;return null===(e=this.__dialog)||void 0===e?void 0:e.showModal()}),this.__isAddressEmpty?n($||($=U`<foxy-i18n infer="" key="not_set"></foxy-i18n>`)):n(j||(j=U` <div> ${0} ${0} </div> <div>${0}</div> <div>${0}</div> <div> ${0} ${0} ${0} ${0} ${0} ${0} </div> `),this.__renderAddressPart(o.first_name),this.__renderAddressPart(o.last_name),this.__renderAddressPart(o.company),this.__renderAddressPart(o.phone),this.__renderAddressPart(o.address1),this.__renderAddressPart(o.address2),this.__renderAddressPart(o.city),this.__renderAddressPart(o.state),this.__renderAddressPart(o.postal_code),this.__renderAddressPart(o.country)),this.__renderTextField(o.first_name),this.__renderTextField(o.last_name),this.__renderTextField(o.address1),this.__renderTextField(o.address2),this.__renderTextField(o.city),c(this.__getPlaceholder(o.country)),i,this.__countryOptions,r.length>0?n(k||(k=U` <foxy-internal-select-control placeholder="${0}" property="${0}_state" layout="summary-item" infer="state" .options="${0}"> </foxy-internal-select-control> `),c(this.__getPlaceholder(o.state)),i,r):this.__renderTextField(o.state),this.__renderTextField(o.postal_code),this.__renderTextField(o.company),this.__renderTextField(o.phone),this.disabled,this.readonly,(()=>{var e;null===(e=this.nucleon)||void 0===e||e.edit({[`${i}_first_name`]:null,[`${i}_last_name`]:null,[`${i}_company`]:null,[`${i}_address1`]:null,[`${i}_address2`]:null,[`${i}_city`]:null,[`${i}_state`]:null,[`${i}_postal_code`]:null,[`${i}_country`]:null,[`${i}_phone`]:null})}),this.disabled,(()=>{var e;return null===(e=this.__dialog)||void 0===e?void 0:e.close()}),c(null!==(t=this.countries)&&void 0!==t?t:void 0),(()=>this.requestUpdate()),c(this.__regionsUrl),(()=>this.requestUpdate()))}__renderAddressPart(e){const t=this.__getDisplayText(e);return n(w||(w=U` <span class="${0}"> ${0} </span> `),s({"text-success bg-success-10":e.modified&&!this.disabled,"bg-contrast-5":e.modified&&this.disabled,"inline-block":!!t,"rounded-s":!0,hidden:!t}),t)}__renderTextField(e){var t;return n(P||(P=U` <foxy-internal-text-control placeholder="${0}" property="${0}_${0}" layout="summary-item" infer="${0}" @clear="${0}"> </foxy-internal-text-control> `),c(this.__getPlaceholder(e)),null!==(t=this.type)&&void 0!==t?t:"billing",e.field,e.field.replace(/_/g,"-").replace("1","-one").replace("2","-two"),(()=>{var t,r;return null===(t=this.nucleon)||void 0===t?void 0:t.edit({[`${null!==(r=this.type)&&void 0!==r?r:"billing"}_${e.field}`]:null})}))}__getDisplayText(e){return e.value||(e.modified?"--":"")}__getPlaceholder(e){return e.modified?this.t("empty_modified_placeholder"):e.originalValue||void 0}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get __countryOptions(){var e,t,r;return Object.values(null!==(r=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.cc2})))}get __isAddressEmpty(){return Object.values(this.__mergedAddress).every((e=>""===this.__getDisplayText(e)))}get __regionOptions(){var e,t,r;return Object.values(null!==(r=null===(t=null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.code})))}get __regionsLoader(){return this.renderRoot.querySelector("#regionsLoader")}get __mergedAddress(){var e,t,r;const i=null===(e=this.nucleon)||void 0===e?void 0:e.form,o="shipping"===this.type?"shipping":"billing",s=null!==(r=null===(t=this.customer)||void 0===t?void 0:t._embedded[`fx:default_${o}_address`])&&void 0!==r?r:{},n=["first_name","last_name","company","address1","address2","city","state","postal_code","country","phone"].reduce(((e,t)=>{var r;const n=null==i?void 0:i[`${o}_${t}`],a=null==s?void 0:s["state"===t?"region":t];return e[t]={originalValue:String(null!=a?a:""),modified:null!==n,value:String(null!==(r=null!=n?n:a)&&void 0!==r?r:""),field:t},e}),{});return n}get __regionsUrl(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),r=this.__mergedAddress.country.value;return r&&t.searchParams.set("country_code",r),t.toString()}catch(e){}}get __dialog(){return this.renderRoot.querySelector("#dialog")}}customElements.define("foxy-internal-cart-form-address-summary-item",S);let L,C=e=>e;customElements.define("foxy-internal-cart-form-payment-method-form",class extends r{constructor(){super(...arguments),this.defaultPaymentMethod=null,this.paymentCardEmbedUrl=null,this.selectionProps={}}static get properties(){return i(i({},super.properties),{},{defaultPaymentMethod:{attribute:"default-payment-method"},paymentCardEmbedUrl:{attribute:"payment-card-embed-url"},selectionProps:{attribute:!1}})}renderBody(){var e,t;return n(L||(L=C` <foxy-update-payment-method-form embed-url="${0}" infer="default-payment-method" href="${0}" @update="${0}"> </foxy-update-payment-method-form> <div class="flex items-center gap-m"> <div class="border-t border-contrast-10 flex-1"></div> <foxy-i18n class="text-tertiary" infer="" key="or"></foxy-i18n> <div class="border-t border-contrast-10 flex-1"></div> </div> <h2 class="text-xl font-medium"> <foxy-i18n infer="" key="select_previous"></foxy-i18n> </h2> <foxy-internal-async-list-control infer="selection" limit="5" form="foxy-null" hide-delete-button hide-create-button @itemclick="${0}" ...="${0}"> </foxy-internal-async-list-control> `),c(null!==(e=this.paymentCardEmbedUrl)&&void 0!==e?e:void 0),c(null!==(t=this.defaultPaymentMethod)&&void 0!==t?t:void 0),(e=>{var t;(null===(t=e.detail)||void 0===t?void 0:t.result)===u.UpdateResult.ResourceUpdated&&(this.edit({selection:""}),this.submit())}),(e=>{e.preventDefault(),this.edit({selection:e.detail}),this.submit()}),m(this.selectionProps))}});let A,E,O=e=>e;customElements.define("foxy-internal-cart-form-payment-method-card",class extends _{renderBody(){return super.renderBody({title:e=>{var t,r,i,o,s;const a=null===(r=null===(t=e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0],l=null!==(i=null==a?void 0:a.cc_type)&&void 0!==i?i:"",d=null===(o=null==a?void 0:a.cc_exp_year)||void 0===o?void 0:o.substring(2),c=null==a?void 0:a.cc_exp_month,u=null===(s=null==a?void 0:a.cc_number_masked)||void 0===s?void 0:s.replace(/x/gi,"");return n(A||(A=O`<foxy-i18n infer="" key="title" .options="${0}"></foxy-i18n>`),{last4Digits:u,context:l&&d&&c&&u?"valid":"invalid",month:c,type:l,year:d})},subtitle:e=>{var t,r,i;const o=null===(r=null===(t=e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0],s={id:p(e._links.self.href),date:null!==(i=null==o?void 0:o.date_created)&&void 0!==i?i:e.transaction_date};return n(E||(E=O`<foxy-i18n infer="" key="subtitle" .options="${0}"></foxy-i18n>`),s)}})}});let T,R,M,q,F,I=e=>e;customElements.define("foxy-internal-cart-form-totals-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,r,i,o;const s=null===(e=this.nucleon)||void 0===e?void 0:e.data;return s?n(R||(R=I` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>&colon;</span> <span>${0}</span> <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>&colon;</span> <span>${0} </span> <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>&colon;</span> <span>${0}</span> ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> <span></span> <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>&colon; ${0} </span> </span> </p> `),c(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(s.total_item_price),this.__renderPrice(s.total_shipping,!0),this.__renderPrice(s.total_tax,!0),null===(r=null===(t=null==s?void 0:s._embedded)||void 0===t?void 0:t["fx:applied_gift_card_codes"])||void 0===r?void 0:r.map((e=>{var t;return n(M||(M=I` <span>${0}&colon;</span> <span>${0}</span> `),e._embedded["fx:gift_card"].name,this.__renderPrice(null!==(t=e.balance_adjustment)&&void 0!==t?t:0,!0))})),null===(o=null===(i=null==s?void 0:s._embedded)||void 0===i?void 0:i["fx:discounts"])||void 0===o?void 0:o.map((e=>n(q||(q=I` <span data-testclass="discount">${0}&colon;</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),this.__renderPrice(s.total_order)):n(T||(T=I``))}get __storeHref(){var e,t,r;return null===(r=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===r?void 0:r.href}get __store(){var e,t;const r=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderPrice(e,t=!1){var r,i,o;const s=(null===(r=this.__store)||void 0===r?void 0:r.use_international_currency_symbol)?"code":"symbol",a=null===(o=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===o?void 0:o.currency_code;return n(F||(F=I` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),t&&0!==e?e>0?"text-success":"text-error":"",{currencyDisplay:s,signDisplay:t?"exceptZero":"auto",amount:`${e} ${a}`})}});let V,D,H=e=>e;const z=l(d(r,"cart-form"));class B extends z{constructor(){super(...arguments),this.paymentCardEmbedUrl=null,this.getCustomerPageUrl=null,this.itemCategories=null,this.templateSets=null,this.localeCodes=null,this.languages=null,this.customers=null,this.countries=null,this.regions=null,this.coupons=null,this.__languagesLoaderId="languagesLoader",this.__customerLoaderId="customerLoader",this.__paymentMethodUriGetDisplayValueOptions=e=>{var t,r,i,o;const s=null!==(i=null===(r=null===(t=null==e?void 0:e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0])&&void 0!==i?i:null,n=null==s?void 0:s.cc_exp_month,a=null==s?void 0:s.cc_exp_year,l=null===(o=null==s?void 0:s.cc_number_masked)||void 0===o?void 0:o.replace(/x/g,""),d=null==s?void 0:s.cc_type;return{cc_exp_month:null!=n?n:"",cc_exp_year:null!=a?a:"",cc_last4:null!=l?l:"",cc_type:null!=d?d:"",context:l&&n&&a&&d?"":"empty"}},this.__paymentMethodUriSetValue=e=>{try{const t=new URL(e);t.search="",t.pathname+="/payments",this.edit({payment_method_uri:t.toString()})}catch(e){this.edit({payment_method_uri:""})}},this.__paymentMethodUriFilters=[{label:"filter_type",type:f.String,path:"payments:type",list:[{label:"filter_type_value_purchase_order",value:"purchase_order"},{label:"filter_type_value_amazon_mws",value:"amazon_mws"},{label:"filter_type_value_paypal_ec",value:"paypal_ec"},{label:"filter_type_value_paypal",value:"paypal"},{label:"filter_type_value_hosted",value:"hosted"},{label:"filter_type_value_ogone",value:"ogone"}]},{label:"filter_cc_type",type:f.String,path:"payments:cc_type",list:[{label:"filter_cc_type_value_mastercard",value:"mastercard"},{label:"filter_cc_type_value_discover",value:"discover"},{label:"filter_cc_type_value_unionpay",value:"unionpay"},{label:"filter_cc_type_value_maestro",value:"maestro"},{label:"filter_cc_type_value_diners",value:"diners"},{label:"filter_cc_type_value_visa",value:"visa"},{label:"filter_cc_type_value_amex",value:"amex"},{label:"filter_cc_type_value_jcb",value:"jcb"}]},{label:"filter_cc_number_masked",type:f.String,path:"payments:cc_number_masked"}],this.__customerUriSetValue=e=>{this.edit({customer_uri:e,customer_email:""})},this.__customerUriOptions=[{label:"filter_email",path:"email",type:f.String},{label:"filter_is_anonymous",path:"is_anonymous",type:f.String,list:[{value:"false",label:"filter_is_anonymous_value_false"},{value:"true",label:"filter_is_anonymous_value_true"}]}]}static get properties(){return i(i({},super.properties),{},{paymentCardEmbedUrl:{attribute:"payment-card-embed-url"},getCustomerPageUrl:{attribute:!1},itemCategories:{attribute:"item-categories"},templateSets:{attribute:"template-sets"},localeCodes:{attribute:"locale-codes"},languages:{},customers:{},countries:{},regions:{},coupons:{}})}static get v8n(){return[({billing_first_name:e})=>!e||e.length<=50||"billing-first-name:v8n_too_long",({billing_last_name:e})=>!e||e.length<=50||"billing-last-name:v8n_too_long",({billing_state:e})=>!e||e.length<=50||"billing-state:v8n_too_long",({billing_city:e})=>!e||e.length<=50||"billing-city:v8n_too_long",({billing_phone:e})=>!e||e.length<=50||"billing-phone:v8n_too_long",({billing_company:e})=>!e||e.length<=50||"billing-company:v8n_too_long",({billing_address2:e})=>!e||e.length<=100||"billing-address-two:v8n_too_long",({billing_address1:e})=>!e||e.length<=100||"billing-address-one:v8n_too_long",({billing_postal_code:e})=>!e||e.length<=50||"billing-postal-code:v8n_too_long",({shipping_first_name:e})=>!e||e.length<=50||"shipping-first-name:v8n_too_long",({shipping_last_name:e})=>!e||e.length<=50||"shipping-last-name:v8n_too_long",({shipping_state:e})=>!e||e.length<=50||"shipping-state:v8n_too_long",({shipping_city:e})=>!e||e.length<=50||"shipping-city:v8n_too_long",({shipping_phone:e})=>!e||e.length<=50||"shipping-phone:v8n_too_long",({shipping_company:e})=>!e||e.length<=50||"shipping-company:v8n_too_long",({shipping_address2:e})=>!e||e.length<=100||"shipping-address-two:v8n_too_long",({shipping_address1:e})=>!e||e.length<=100||"shipping-address-one:v8n_too_long",({shipping_postal_code:e})=>!e||e.length<=50||"shipping-postal-code:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.form.customer_uri?e.unshift("general:customer-email"):e.unshift("billing:payment-method-uri"),this.data?this.form.use_customer_shipping_address||e.unshift("shipping:shipping-address"):e.unshift("applied-coupon-codes","custom-fields","attributes","shipping","billing","totals","items"),new o(e.join(" ").trim())}renderHeaderActions(){return n(V||(V=H` <foxy-internal-cart-form-create-session-action infer="view-as-customer"> </foxy-internal-cart-form-create-session-action> `))}renderBody(){var e,t,r,i,o,s,a,l,d,u,m;const p=null===(e=this.data)||void 0===e?void 0:e._links,_=this.__customer;return n(D||(D=H` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="template-set-uri" item="foxy-template-set-card"> </foxy-internal-resource-picker-control> <foxy-internal-select-control layout="summary-item" infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control layout="summary-item" infer="customer-email"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" alert wide item="foxy-item-card" form="foxy-item-form" .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-cart-form-totals-control class="min-w-0" infer="totals"> </foxy-internal-cart-form-totals-control> <foxy-internal-async-list-control infer="applied-coupon-codes" class="min-w-0" first="${0}" item="foxy-applied-coupon-code-card" form="foxy-applied-coupon-code-form" alert .related="${0}"> </foxy-internal-async-list-control> <foxy-internal-resource-picker-control first="${0}" infer="customer-uri" item="foxy-customer-card" show-copy-id-button .getItemUrl="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-summary-control infer="billing"> <foxy-internal-resource-picker-control placeholder="${0}" layout="summary-item" first="${0}" infer="payment-method-uri" item="foxy-internal-cart-form-payment-method-card" form="foxy-internal-cart-form-payment-method-form" .getDisplayValueOptions="${0}" .formProps="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-cart-form-address-summary-item countries="${0}" regions="${0}" infer="billing-address" type="billing" .customer="${0}"> </foxy-internal-cart-form-address-summary-item> </foxy-internal-summary-control> <foxy-internal-summary-control infer="shipping"> <foxy-internal-switch-control infer="use-customer-shipping-address" invert> </foxy-internal-switch-control> <foxy-internal-cart-form-address-summary-item countries="${0}" regions="${0}" infer="shipping-address" type="shipping" .customer="${0}"> </foxy-internal-cart-form-address-summary-item> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" item="foxy-custom-field-card" form="foxy-custom-field-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),c(null!==(t=this.templateSets)&&void 0!==t?t:void 0),this.__languageOptions,c(this.__itemsHref),this.href?[this.href]:[],{"locale-codes":this.localeCodes},{"item-categories":this.itemCategories,"locale-codes":this.localeCodes,store:null===(r=this.data)||void 0===r?void 0:r._links["fx:store"].href},c(null==p?void 0:p["fx:applied_coupon_codes"].href),this.href?[this.href]:[],c(null!==(i=this.customers)&&void 0!==i?i:void 0),this.getCustomerPageUrl,this.__customerUriSetValue,this.__customerUriOptions,this.__paymentMethodUriPlaceholder,c(this.__transactionsWithPaymentsUrl),this.__paymentMethodUriGetDisplayValueOptions,{"default-payment-method":null!==(o=null==_?void 0:_._links["fx:default_payment_method"].href)&&void 0!==o?o:"","payment-card-embed-url":null!==(s=this.__pickerPaymentCardEmbedUrl)&&void 0!==s?s:""},this.__paymentMethodUriSetValue,this.__paymentMethodUriFilters,c(null!==(a=this.countries)&&void 0!==a?a:void 0),c(null!==(l=this.regions)&&void 0!==l?l:void 0),_,c(null!==(d=this.countries)&&void 0!==d?d:void 0),c(null!==(u=this.regions)&&void 0!==u?u:void 0),_,c(null==p?void 0:p["fx:custom_fields"].href),c(null==p?void 0:p["fx:attributes"].href),super.renderBody(),c(null!==(m=this.languages)&&void 0!==m?m:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),c(this.__customerHref),this.__customerLoaderId,(()=>this.requestUpdate()))}get __paymentMethodUriPlaceholder(){var e,t,r,i,o,s;const n=null===(e=this.__customer)||void 0===e?void 0:e._embedded["fx:default_payment_method"],a=null!==(t=null==n?void 0:n.cc_exp_month)&&void 0!==t?t:null,l=null!==(r=null==n?void 0:n.cc_exp_year)&&void 0!==r?r:null,d=null!==(o=null===(i=null==n?void 0:n.cc_number_masked)||void 0===i?void 0:i.replace(/x/g,""))&&void 0!==o?o:null,c=null!==(s=null==n?void 0:n.cc_type)&&void 0!==s?s:null;return this.t("billing.payment-method-uri.value",{cc_exp_month:null!=a?a:"",cc_exp_year:null!=l?l:"",cc_last4:null!=d?d:"",cc_type:null!=c?c:"",context:d&&a&&l&&c?"":"empty"})}get __transactionsWithPaymentsUrl(){var e,t;try{const r=new URL(null!==(t=null===(e=this.__customer)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");return r.searchParams.set("zoom","payments"),r.toString()}catch(e){}}get __pickerPaymentCardEmbedUrl(){var e,t;try{const r=new URL(null!==(e=this.paymentCardEmbedUrl)&&void 0!==e?e:""),i=p(null!==(t=this.form.template_set_uri)&&void 0!==t?t:"");if(null!==i)return r.searchParams.set("template_set_id",String(i)),r.toString()}catch(e){}}get __customerHref(){var e;try{const t=new URL(null!==(e=this.form.customer_uri)&&void 0!==e?e:"");return t.searchParams.set("zoom","default_payment_method,default_billing_address,default_shipping_address"),t.toString()}catch(e){}}get __itemsHref(){var e,t;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:items"].href)&&void 0!==t?t:"");return r.searchParams.set("zoom","item_options"),r.toString()}catch(e){}}get __languageOptions(){var e,t;const r=this.renderRoot.querySelector(`#${this.__languagesLoaderId}`);return Object.entries(null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((([e,t])=>({rawLabel:t,value:e})))}get __customer(){var e;return null===(e=this.renderRoot.querySelector(`#${this.__customerLoaderId}`))||void 0===e?void 0:e.data}}customElements.define("foxy-cart-form",B);export{B as CartForm};
57
+ `));let b,$,j,k,w,P,U=e=>e;class S extends(l(t)){constructor(){super(...arguments),this.countries=null,this.customer=null,this.regions=null,this.type=null}static get properties(){return i(i({},super.properties),{},{countries:{},customer:{type:Object},regions:{},type:{}})}static get styles(){return[...super.styles,x]}get disabledSelector(){var e;const t=[super.disabledSelector.toString()];return(null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||t.unshift("address:state"),new o(t.join(" ").toString())}renderControl(){var e,t;const r=this.__regionOptions,i=null!==(e=this.type)&&void 0!==e?e:"billing",o=this.__mergedAddress;return n(b||(b=U` <div class="flex flex-col gap-m sm-flex-row items-start leading-xs"> <div class="flex-1"> <p class="text-m text-body">${0}</p> <p class="text-xs text-secondary">${0}</p> <p class="text-xs text-error" ?hidden="${0}"> ${0} </p> </div> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> <dialog id="dialog" class="p-m bg-base shadow-xxl space-y-m"> <h2 class="text-xl font-medium"> <foxy-i18n infer="" key="label"></foxy-i18n> </h2> <foxy-internal-summary-control infer="name"> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="address"> ${0} ${0} ${0} <foxy-internal-select-control placeholder="${0}" property="${0}_country" layout="summary-item" infer="country" .options="${0}"> </foxy-internal-select-control> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="extra"> ${0} ${0} </foxy-internal-summary-control> <p class="text-xs text-secondary"> <foxy-i18n infer="" key="form_helper_text"></foxy-i18n> </p> <div class="flex justify-between gap-m"> <vaadin-button theme="error" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <foxy-i18n infer="" key="reset"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="done"></foxy-i18n> </vaadin-button> </div> </dialog> <foxy-nucleon class="hidden" infer="" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="regionsLoader" @update="${0}"> </foxy-nucleon> `),this.label,this.helperText,this.disabled||this.readonly,this._errorMessage,this.t("edit"),s({"text-left sm-text-right transition-colors transition-opacity":!0,"text-body cursor-pointer hover-opacity-80":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),this.disabled||this.readonly,(()=>{var e;return null===(e=this.__dialog)||void 0===e?void 0:e.showModal()}),this.__isAddressEmpty?n($||($=U`<foxy-i18n infer="" key="not_set"></foxy-i18n>`)):n(j||(j=U` <div> ${0} ${0} </div> <div>${0}</div> <div>${0}</div> <div> ${0} ${0} ${0} ${0} ${0} ${0} </div> `),this.__renderAddressPart(o.first_name),this.__renderAddressPart(o.last_name),this.__renderAddressPart(o.company),this.__renderAddressPart(o.phone),this.__renderAddressPart(o.address1),this.__renderAddressPart(o.address2),this.__renderAddressPart(o.city),this.__renderAddressPart(o.state),this.__renderAddressPart(o.postal_code),this.__renderAddressPart(o.country)),this.__renderTextField(o.first_name),this.__renderTextField(o.last_name),this.__renderTextField(o.address1),this.__renderTextField(o.address2),this.__renderTextField(o.city),c(this.__getPlaceholder(o.country)),i,this.__countryOptions,r.length>0?n(k||(k=U` <foxy-internal-select-control placeholder="${0}" property="${0}_state" layout="summary-item" infer="state" .options="${0}"> </foxy-internal-select-control> `),c(this.__getPlaceholder(o.state)),i,r):this.__renderTextField(o.state),this.__renderTextField(o.postal_code),this.__renderTextField(o.company),this.__renderTextField(o.phone),this.disabled,this.readonly,(()=>{var e;null===(e=this.nucleon)||void 0===e||e.edit({[`${i}_first_name`]:null,[`${i}_last_name`]:null,[`${i}_company`]:null,[`${i}_address1`]:null,[`${i}_address2`]:null,[`${i}_city`]:null,[`${i}_state`]:null,[`${i}_postal_code`]:null,[`${i}_country`]:null,[`${i}_phone`]:null})}),this.disabled,(()=>{var e;return null===(e=this.__dialog)||void 0===e?void 0:e.close()}),c(null!==(t=this.countries)&&void 0!==t?t:void 0),(()=>this.requestUpdate()),c(this.__regionsUrl),(()=>this.requestUpdate()))}__renderAddressPart(e){const t=this.__getDisplayText(e);return n(w||(w=U` <span class="${0}"> ${0} </span> `),s({"text-success bg-success-10":e.modified&&!this.disabled,"bg-contrast-5":e.modified&&this.disabled,"inline-block":!!t,"rounded-s":!0,hidden:!t}),t)}__renderTextField(e){var t;return n(P||(P=U` <foxy-internal-text-control placeholder="${0}" property="${0}_${0}" layout="summary-item" infer="${0}" @clear="${0}"> </foxy-internal-text-control> `),c(this.__getPlaceholder(e)),null!==(t=this.type)&&void 0!==t?t:"billing",e.field,e.field.replace(/_/g,"-").replace("1","-one").replace("2","-two"),(()=>{var t,r;return null===(t=this.nucleon)||void 0===t?void 0:t.edit({[`${null!==(r=this.type)&&void 0!==r?r:"billing"}_${e.field}`]:null})}))}__getDisplayText(e){return e.value||(e.modified?"--":"")}__getPlaceholder(e){return e.modified?this.t("empty_modified_placeholder"):e.originalValue||void 0}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get __countryOptions(){var e,t,r;return Object.values(null!==(r=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.cc2})))}get __isAddressEmpty(){return Object.values(this.__mergedAddress).every((e=>""===this.__getDisplayText(e)))}get __regionOptions(){var e,t,r;return Object.values(null!==(r=null===(t=null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.code})))}get __regionsLoader(){return this.renderRoot.querySelector("#regionsLoader")}get __mergedAddress(){var e,t,r;const i=null===(e=this.nucleon)||void 0===e?void 0:e.form,o="shipping"===this.type?"shipping":"billing",s=null!==(r=null===(t=this.customer)||void 0===t?void 0:t._embedded[`fx:default_${o}_address`])&&void 0!==r?r:{},n=["first_name","last_name","company","address1","address2","city","state","postal_code","country","phone"].reduce(((e,t)=>{var r;const n=null==i?void 0:i[`${o}_${t}`],a=null==s?void 0:s["state"===t?"region":t];return e[t]={originalValue:String(null!=a?a:""),modified:null!==n,value:String(null!==(r=null!=n?n:a)&&void 0!==r?r:""),field:t},e}),{});return n}get __regionsUrl(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),r=this.__mergedAddress.country.value;return r&&t.searchParams.set("country_code",r),t.toString()}catch(e){}}get __dialog(){return this.renderRoot.querySelector("#dialog")}}customElements.define("foxy-internal-cart-form-address-summary-item",S);let L,C=e=>e;customElements.define("foxy-internal-cart-form-payment-method-form",class extends r{constructor(){super(...arguments),this.defaultPaymentMethod=null,this.paymentCardEmbedUrl=null,this.selectionProps={}}static get properties(){return i(i({},super.properties),{},{defaultPaymentMethod:{attribute:"default-payment-method"},paymentCardEmbedUrl:{attribute:"payment-card-embed-url"},selectionProps:{attribute:!1}})}renderBody(){var e,t;return n(L||(L=C` <foxy-update-payment-method-form embed-url="${0}" infer="default-payment-method" href="${0}" @update="${0}"> </foxy-update-payment-method-form> <div class="flex items-center gap-m"> <div class="border-t border-contrast-10 flex-1"></div> <foxy-i18n class="text-tertiary" infer="" key="or"></foxy-i18n> <div class="border-t border-contrast-10 flex-1"></div> </div> <h2 class="text-xl font-medium"> <foxy-i18n infer="" key="select_previous"></foxy-i18n> </h2> <foxy-internal-async-list-control infer="selection" limit="5" form="foxy-null" hide-delete-button hide-create-button @itemclick="${0}" ...="${0}"> </foxy-internal-async-list-control> `),c(null!==(e=this.paymentCardEmbedUrl)&&void 0!==e?e:void 0),c(null!==(t=this.defaultPaymentMethod)&&void 0!==t?t:void 0),(e=>{var t;(null===(t=e.detail)||void 0===t?void 0:t.result)===u.UpdateResult.ResourceUpdated&&(this.edit({selection:""}),this.submit())}),(e=>{e.preventDefault(),this.edit({selection:e.detail}),this.submit()}),m(this.selectionProps))}});let A,E,O=e=>e;customElements.define("foxy-internal-cart-form-payment-method-card",class extends _{renderBody(){return super.renderBody({title:e=>{var t,r,i,o,s;const a=null===(r=null===(t=e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0],l=null!==(i=null==a?void 0:a.cc_type)&&void 0!==i?i:"",d=null===(o=null==a?void 0:a.cc_exp_year)||void 0===o?void 0:o.substring(2),c=null==a?void 0:a.cc_exp_month,u=null===(s=null==a?void 0:a.cc_number_masked)||void 0===s?void 0:s.replace(/x/gi,"");return n(A||(A=O`<foxy-i18n infer="" key="title" .options="${0}"></foxy-i18n>`),{last4Digits:u,context:l&&d&&c&&u?"valid":"invalid",month:c,type:l,year:d})},subtitle:e=>{var t,r,i;const o=null===(r=null===(t=e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0],s={id:p(e._links.self.href),date:null!==(i=null==o?void 0:o.date_created)&&void 0!==i?i:e.transaction_date};return n(E||(E=O`<foxy-i18n infer="" key="subtitle" .options="${0}"></foxy-i18n>`),s)}})}});let T,R,M,q,F,I=e=>e;customElements.define("foxy-internal-cart-form-totals-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,r,i,o;const s=null===(e=this.nucleon)||void 0===e?void 0:e.data;return s?n(R||(R=I` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>&colon;</span> <span>${0}</span> <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>&colon;</span> <span>${0} </span> <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>&colon;</span> <span>${0}</span> ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> <span></span> <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>&colon; ${0} </span> </span> </p> `),c(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(s.total_item_price),this.__renderPrice(s.total_shipping,!0),this.__renderPrice(s.total_tax,!0),null===(r=null===(t=null==s?void 0:s._embedded)||void 0===t?void 0:t["fx:applied_gift_card_codes"])||void 0===r?void 0:r.map((e=>{var t;return n(M||(M=I` <span>${0}&colon;</span> <span>${0}</span> `),e._embedded["fx:gift_card"].name,this.__renderPrice(null!==(t=e.balance_adjustment)&&void 0!==t?t:0,!0))})),null===(o=null===(i=null==s?void 0:s._embedded)||void 0===i?void 0:i["fx:discounts"])||void 0===o?void 0:o.map((e=>n(q||(q=I` <span data-testclass="discount">${0}&colon;</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),this.__renderPrice(s.total_order)):n(T||(T=I``))}get __storeHref(){var e,t,r;return null===(r=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===r?void 0:r.href}get __store(){var e,t;const r=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderPrice(e,t=!1){var r,i,o;const s=(null===(r=this.__store)||void 0===r?void 0:r.use_international_currency_symbol)?"code":"symbol",a=null===(o=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===o?void 0:o.currency_code;return n(F||(F=I` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),t&&0!==e?e>0?"text-success":"text-error":"",{currencyDisplay:s,signDisplay:t?"exceptZero":"auto",amount:`${e} ${a}`})}});let V,D,H=e=>e;const z=l(d(r,"cart-form"));class B extends z{constructor(){super(...arguments),this.paymentCardEmbedUrl=null,this.getCustomerPageUrl=null,this.itemCategories=null,this.templateSets=null,this.localeCodes=null,this.languages=null,this.customers=null,this.countries=null,this.regions=null,this.coupons=null,this.__languagesLoaderId="languagesLoader",this.__customerLoaderId="customerLoader",this.__paymentMethodUriGetDisplayValueOptions=e=>{var t,r,i,o;const s=null!==(i=null===(r=null===(t=null==e?void 0:e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0])&&void 0!==i?i:null,n=null==s?void 0:s.cc_exp_month,a=null==s?void 0:s.cc_exp_year,l=null===(o=null==s?void 0:s.cc_number_masked)||void 0===o?void 0:o.replace(/x/g,""),d=null==s?void 0:s.cc_type;return{cc_exp_month:null!=n?n:"",cc_exp_year:null!=a?a:"",cc_last4:null!=l?l:"",cc_type:null!=d?d:"",context:l&&n&&a&&d?"":"empty"}},this.__paymentMethodUriSetValue=e=>{try{const t=new URL(e);t.search="",t.pathname+="/payments",this.edit({payment_method_uri:t.toString()})}catch(e){this.edit({payment_method_uri:""})}},this.__paymentMethodUriFilters=[{label:"filter_type",type:h.String,path:"payments:type",list:[{label:"filter_type_value_purchase_order",value:"purchase_order"},{label:"filter_type_value_amazon_mws",value:"amazon_mws"},{label:"filter_type_value_paypal_ec",value:"paypal_ec"},{label:"filter_type_value_paypal",value:"paypal"},{label:"filter_type_value_hosted",value:"hosted"},{label:"filter_type_value_ogone",value:"ogone"}]},{label:"filter_cc_type",type:h.String,path:"payments:cc_type",list:[{label:"filter_cc_type_value_mastercard",value:"mastercard"},{label:"filter_cc_type_value_discover",value:"discover"},{label:"filter_cc_type_value_unionpay",value:"unionpay"},{label:"filter_cc_type_value_maestro",value:"maestro"},{label:"filter_cc_type_value_diners",value:"diners"},{label:"filter_cc_type_value_visa",value:"visa"},{label:"filter_cc_type_value_amex",value:"amex"},{label:"filter_cc_type_value_jcb",value:"jcb"}]},{label:"filter_cc_number_masked",type:h.String,path:"payments:cc_number_masked"}],this.__customerUriSetValue=e=>{this.edit({customer_uri:e,customer_email:""})},this.__customerUriOptions=[{label:"filter_email",path:"email",type:h.String},{label:"filter_is_anonymous",path:"is_anonymous",type:h.String,list:[{value:"false",label:"filter_is_anonymous_value_false"},{value:"true",label:"filter_is_anonymous_value_true"}]}]}static get properties(){return i(i({},super.properties),{},{paymentCardEmbedUrl:{attribute:"payment-card-embed-url"},getCustomerPageUrl:{attribute:!1},itemCategories:{attribute:"item-categories"},templateSets:{attribute:"template-sets"},localeCodes:{attribute:"locale-codes"},languages:{},customers:{},countries:{},regions:{},coupons:{}})}static get v8n(){return[({billing_first_name:e})=>!e||e.length<=50||"billing-first-name:v8n_too_long",({billing_last_name:e})=>!e||e.length<=50||"billing-last-name:v8n_too_long",({billing_state:e})=>!e||e.length<=50||"billing-state:v8n_too_long",({billing_city:e})=>!e||e.length<=50||"billing-city:v8n_too_long",({billing_phone:e})=>!e||e.length<=50||"billing-phone:v8n_too_long",({billing_company:e})=>!e||e.length<=50||"billing-company:v8n_too_long",({billing_address2:e})=>!e||e.length<=100||"billing-address-two:v8n_too_long",({billing_address1:e})=>!e||e.length<=100||"billing-address-one:v8n_too_long",({billing_postal_code:e})=>!e||e.length<=50||"billing-postal-code:v8n_too_long",({shipping_first_name:e})=>!e||e.length<=50||"shipping-first-name:v8n_too_long",({shipping_last_name:e})=>!e||e.length<=50||"shipping-last-name:v8n_too_long",({shipping_state:e})=>!e||e.length<=50||"shipping-state:v8n_too_long",({shipping_city:e})=>!e||e.length<=50||"shipping-city:v8n_too_long",({shipping_phone:e})=>!e||e.length<=50||"shipping-phone:v8n_too_long",({shipping_company:e})=>!e||e.length<=50||"shipping-company:v8n_too_long",({shipping_address2:e})=>!e||e.length<=100||"shipping-address-two:v8n_too_long",({shipping_address1:e})=>!e||e.length<=100||"shipping-address-one:v8n_too_long",({shipping_postal_code:e})=>!e||e.length<=50||"shipping-postal-code:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.form.customer_uri?e.unshift("general:customer-email"):e.unshift("billing:payment-method-uri"),this.data?this.form.use_customer_shipping_address||e.unshift("shipping:shipping-address"):e.unshift("applied-coupon-codes","custom-fields","attributes","shipping","billing","totals","items"),new o(e.join(" ").trim())}renderHeaderActions(){return n(V||(V=H` <foxy-internal-cart-form-create-session-action infer="view-as-customer"> </foxy-internal-cart-form-create-session-action> `))}renderBody(){var e,t,r,i,o,s,a,l,d,u,m;const p=null===(e=this.data)||void 0===e?void 0:e._links,_=this.__customer;return n(D||(D=H` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="template-set-uri" item="foxy-template-set-card"> </foxy-internal-resource-picker-control> <foxy-internal-select-control layout="summary-item" infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control layout="summary-item" infer="customer-email"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" alert wide item="foxy-item-card" form="foxy-item-form" .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-cart-form-totals-control class="min-w-0" infer="totals"> </foxy-internal-cart-form-totals-control> <foxy-internal-async-list-control infer="applied-coupon-codes" class="min-w-0" first="${0}" item="foxy-applied-coupon-code-card" form="foxy-applied-coupon-code-form" alert .related="${0}"> </foxy-internal-async-list-control> <foxy-internal-resource-picker-control first="${0}" infer="customer-uri" item="foxy-customer-card" show-copy-id-button .getItemUrl="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-summary-control infer="billing"> <foxy-internal-resource-picker-control placeholder="${0}" layout="summary-item" first="${0}" infer="payment-method-uri" item="foxy-internal-cart-form-payment-method-card" form="foxy-internal-cart-form-payment-method-form" .getDisplayValueOptions="${0}" .formProps="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-cart-form-address-summary-item countries="${0}" regions="${0}" infer="billing-address" type="billing" .customer="${0}"> </foxy-internal-cart-form-address-summary-item> </foxy-internal-summary-control> <foxy-internal-summary-control infer="shipping"> <foxy-internal-switch-control infer="use-customer-shipping-address" invert> </foxy-internal-switch-control> <foxy-internal-cart-form-address-summary-item countries="${0}" regions="${0}" infer="shipping-address" type="shipping" .customer="${0}"> </foxy-internal-cart-form-address-summary-item> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" item="foxy-custom-field-card" form="foxy-custom-field-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),c(null!==(t=this.templateSets)&&void 0!==t?t:void 0),this.__languageOptions,c(this.__itemsHref),this.href?[this.href]:[],{"locale-codes":this.localeCodes},{"item-categories":this.itemCategories,"locale-codes":this.localeCodes,store:null===(r=this.data)||void 0===r?void 0:r._links["fx:store"].href},c(null==p?void 0:p["fx:applied_coupon_codes"].href),this.href?[this.href]:[],c(null!==(i=this.customers)&&void 0!==i?i:void 0),this.getCustomerPageUrl,this.__customerUriSetValue,this.__customerUriOptions,this.__paymentMethodUriPlaceholder,c(this.__transactionsWithPaymentsUrl),this.__paymentMethodUriGetDisplayValueOptions,{"default-payment-method":null!==(o=null==_?void 0:_._links["fx:default_payment_method"].href)&&void 0!==o?o:"","payment-card-embed-url":null!==(s=this.__pickerPaymentCardEmbedUrl)&&void 0!==s?s:""},this.__paymentMethodUriSetValue,this.__paymentMethodUriFilters,c(null!==(a=this.countries)&&void 0!==a?a:void 0),c(null!==(l=this.regions)&&void 0!==l?l:void 0),_,c(null!==(d=this.countries)&&void 0!==d?d:void 0),c(null!==(u=this.regions)&&void 0!==u?u:void 0),_,c(null==p?void 0:p["fx:custom_fields"].href),c(null==p?void 0:p["fx:attributes"].href),super.renderBody(),c(null!==(m=this.languages)&&void 0!==m?m:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),c(this.__customerHref),this.__customerLoaderId,(()=>this.requestUpdate()))}get __paymentMethodUriPlaceholder(){var e,t,r,i,o,s;const n=null===(e=this.__customer)||void 0===e?void 0:e._embedded["fx:default_payment_method"],a=null!==(t=null==n?void 0:n.cc_exp_month)&&void 0!==t?t:null,l=null!==(r=null==n?void 0:n.cc_exp_year)&&void 0!==r?r:null,d=null!==(o=null===(i=null==n?void 0:n.cc_number_masked)||void 0===i?void 0:i.replace(/x/g,""))&&void 0!==o?o:null,c=null!==(s=null==n?void 0:n.cc_type)&&void 0!==s?s:null;return this.t("billing.payment-method-uri.value",{cc_exp_month:null!=a?a:"",cc_exp_year:null!=l?l:"",cc_last4:null!=d?d:"",cc_type:null!=c?c:"",context:d&&a&&l&&c?"":"empty"})}get __transactionsWithPaymentsUrl(){var e,t;try{const r=new URL(null!==(t=null===(e=this.__customer)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");return r.searchParams.set("zoom","payments"),r.toString()}catch(e){}}get __pickerPaymentCardEmbedUrl(){var e,t;try{const r=new URL(null!==(e=this.paymentCardEmbedUrl)&&void 0!==e?e:""),i=p(null!==(t=this.form.template_set_uri)&&void 0!==t?t:"");if(null!==i)return r.searchParams.set("template_set_id",String(i)),r.toString()}catch(e){}}get __customerHref(){var e;try{const t=new URL(null!==(e=this.form.customer_uri)&&void 0!==e?e:"");return t.searchParams.set("zoom","default_payment_method,default_billing_address,default_shipping_address"),t.toString()}catch(e){}}get __itemsHref(){var e,t;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:items"].href)&&void 0!==t?t:"");return r.searchParams.set("zoom","item_options"),r.toString()}catch(e){}}get __languageOptions(){var e,t;const r=this.renderRoot.querySelector(`#${this.__languagesLoaderId}`);return Object.entries(null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((([e,t])=>({rawLabel:t,value:e})))}get __customer(){var e;return null===(e=this.renderRoot.querySelector(`#${this.__customerLoaderId}`))||void 0===e?void 0:e.data}}customElements.define("foxy-cart-form",B);export{B as CartForm};
@@ -1 +1 @@
1
- import"./shared-0782fee5.js";import"./shared-0564def4.js";import"./shared-b293a928.js";import{I as r}from"./shared-edb68eb7.js";import"./foxy-transaction-card.js";import{_ as e,B as s}from"./shared-d1195c27.js";import{a as o}from"./shared-fefaece7.js";import{i as t}from"./shared-53e42a77.js";import{h as a}from"./shared-ba5c42c7.js";import"./shared-256fe764.js";import"./shared-944dc1e2.js";import"./shared-00b50480.js";import"./shared-00cd0e86.js";import"./shared-5cea7ef0.js";import"./shared-f0afd1ee.js";import"./shared-188a9c2e.js";import"./shared-421b13a8.js";import"./shared-15ded782.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-b7889b37.js";import"./shared-bb43f0ad.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-eeb2bd18.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-a208ae8c.js";import"./shared-e14bc410.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-a3f1420c.js";import"./shared-c3fd2e9c.js";import"./shared-4215bff2.js";import"./shared-355ef444.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-56f7db6f.js";import"./shared-4558cdb4.js";import"./shared-bab2ea2c.js";import"./shared-47962c3f.js";import"./shared-0c61b5ce.js";let i,d=r=>r;const n=o(r,"coupon-code-form");class c extends n{constructor(){super(...arguments),this.getTransactionPageHref=null}static get properties(){return e(e({},super.properties),{},{getTransactionPageHref:{attribute:!1}})}static get v8n(){return[({code:r})=>!!r||"code:v8n_required",({code:r})=>!r||r.length<=50||"code:v8n_too_long",({code:r})=>!(null==r?void 0:r.includes(" "))||"code:v8n_has_spaces"]}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.href||r.unshift("transactions"),new s(r.join(" ").trim())}renderBody(){var r,e;let s;try{const o=new URL(null!==(e=null===(r=this.data)||void 0===r?void 0:r._links["fx:coupon_code_transactions"].href)&&void 0!==e?e:"");o.searchParams.set("zoom","items"),s=o.toString()}catch(r){s=void 0}return a(i||(i=d` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="code"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" infer="transactions" limit="5" item="foxy-transaction-card" .getPageHref="${0}" hide-delete-button> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),t(s),this.getTransactionPageHref,super.renderBody())}}customElements.define("foxy-coupon-code-form",c);export{c as CouponCodeForm};
1
+ import"./shared-2edce408.js";import"./shared-0564def4.js";import"./shared-b293a928.js";import{I as r}from"./shared-edb68eb7.js";import"./foxy-transaction-card.js";import{_ as e,B as s}from"./shared-d1195c27.js";import{a as o}from"./shared-fefaece7.js";import{i as t}from"./shared-53e42a77.js";import{h as a}from"./shared-ba5c42c7.js";import"./shared-256fe764.js";import"./shared-944dc1e2.js";import"./shared-00b50480.js";import"./shared-00cd0e86.js";import"./shared-5cea7ef0.js";import"./shared-f0afd1ee.js";import"./shared-188a9c2e.js";import"./shared-421b13a8.js";import"./shared-15ded782.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-b7889b37.js";import"./shared-bb43f0ad.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-eeb2bd18.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-a208ae8c.js";import"./shared-e14bc410.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-a3f1420c.js";import"./shared-c3fd2e9c.js";import"./shared-4215bff2.js";import"./shared-355ef444.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-56f7db6f.js";import"./shared-4558cdb4.js";import"./shared-bab2ea2c.js";import"./shared-47962c3f.js";import"./shared-0c61b5ce.js";let i,d=r=>r;const n=o(r,"coupon-code-form");class c extends n{constructor(){super(...arguments),this.getTransactionPageHref=null}static get properties(){return e(e({},super.properties),{},{getTransactionPageHref:{attribute:!1}})}static get v8n(){return[({code:r})=>!!r||"code:v8n_required",({code:r})=>!r||r.length<=50||"code:v8n_too_long",({code:r})=>!(null==r?void 0:r.includes(" "))||"code:v8n_has_spaces"]}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.href||r.unshift("transactions"),new s(r.join(" ").trim())}renderBody(){var r,e;let s;try{const o=new URL(null!==(e=null===(r=this.data)||void 0===r?void 0:r._links["fx:coupon_code_transactions"].href)&&void 0!==e?e:"");o.searchParams.set("zoom","items"),s=o.toString()}catch(r){s=void 0}return a(i||(i=d` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="code"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" infer="transactions" limit="5" item="foxy-transaction-card" .getPageHref="${0}" hide-delete-button> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),t(s),this.getTransactionPageHref,super.renderBody())}}customElements.define("foxy-coupon-code-form",c);export{c as CouponCodeForm};
@@ -1 +1 @@
1
- import"./shared-6660c6df.js";import"./shared-8f6400d9.js";import"./shared-1fcf3749.js";import{a as e,I as t}from"./shared-edb68eb7.js";import{p as r,s}from"./shared-c05984d1.js";import{_ as o,B as i}from"./shared-d1195c27.js";import{O as n,T as a}from"./shared-8874ec69.js";import{h as l,c as d,s as c}from"./shared-ba5c42c7.js";import"./shared-bb43f0ad.js";import{R as u,a as m}from"./shared-fefaece7.js";import{c as p}from"./shared-4e709717.js";import{r as f}from"./shared-5fd5805c.js";import"./shared-0564def4.js";import"./shared-70bd1896.js";import"./shared-6aa8f7ee.js";import"./shared-b293a928.js";import"./shared-fda02728.js";import"./foxy-generate-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-coupon-codes-form.js";import"./foxy-coupon-code-card.js";import"./foxy-coupon-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-form.js";import"./foxy-attribute-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-discount-builder.js";import{i as h}from"./shared-53e42a77.js";import"./shared-5cea7ef0.js";import"./shared-256fe764.js";import"./shared-944dc1e2.js";import"./shared-00cd0e86.js";import"./shared-f0afd1ee.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-00b50480.js";import"./shared-b7889b37.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-eeb2bd18.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-53e476fd.js";import"./foxy-pagination.js";import"./foxy-form-dialog.js";import"./shared-a208ae8c.js";import"./shared-e14bc410.js";import"./shared-56f7db6f.js";import"./shared-4558cdb4.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-bab2ea2c.js";import"./shared-63c32024.js";import"./shared-79d0699c.js";import"./shared-a63c89a1.js";import"./shared-4215bff2.js";import"./shared-355ef444.js";import"./shared-a3f1420c.js";import"./shared-c3fd2e9c.js";import"./shared-05ed8288.js";import"./shared-6524d421.js";import"./shared-421b13a8.js";import"./shared-df76d498.js";import"./shared-188a9c2e.js";import"./shared-15ded782.js";import"./shared-c2ca5bee.js";import"./shared-75908858.js";import"./shared-43e2c3f6.js";import"./shared-cf8e2611.js";import"./shared-b15d45b1.js";import"./shared-e4159eb9.js";import"./shared-0c61b5ce.js";import"./shared-47962c3f.js";import"./shared-0782fee5.js";import"./foxy-swipe-actions.js";import"./foxy-transaction-card.js";import"./shared-1c6a1571.js";let y,_,b,x,v=e=>e;customElements.define("foxy-internal-query-builder-control",class extends e{constructor(){super(...arguments),this.disableZoom=!1,this.disableOr=!1,this.operators=Object.values(n)}static get properties(){return o(o({},super.properties),{},{disableZoom:{type:Boolean,attribute:"disable-zoom"},disableOr:{type:Boolean,attribute:"disable-or"},operators:{type:Array}})}renderControl(){const{label:e,helperText:t,_errorMessage:r}=this,s=r&&!this.disabled&&!this.readonly;return l(y||(y=v` <section class="grid gap-s leading-xs"> <div ?hidden="${0}"> ${0} ${0} </div> <div class="bg-contrast-5 rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-query-builder infer="query-builder" style="--lumo-border-radius:var(--lumo-border-radius-s);--lumo-border-radius-l:var(--lumo-border-radius-s)" .operators="${0}" .value="${0}" ?disable-zoom="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> </div> ${0} </section> `),!e&&!t,e?l(_||(_=v`<p class="text-l font-medium">${0}</p>`),e):"",t?l(b||(b=v`<p class="text-s text-secondary">${0}</p>`),t):"",this.operators,this._value,this.disableZoom,this.disableOr,(e=>{var t;const r=e.currentTarget;this._value=null!==(t=r.value)&&void 0!==t?t:""}),s?l(x||(x=v`<p class="text-s text-error">${0}</p>`),r):"")}});let g,j,$,w,C,k,A,V,R,S,q=e=>e;class O extends(u(e)){static get styles(){return[super.styles,d(g||(g=q`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`))]}renderControl(){const e=l(j||(j=q` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-20"> <foxy-i18n infer="" key="or"></foxy-i18n> </div> <div class="flex-1 border-t border-contrast-10"></div> <div class="w-m ml-s flex-shrink-0"></div> </div> `));return l($||($=q` <div class="mb-s" ?hidden="${0}"> <p class="font-medium text-body text-l" ?hidden="${0}">${0}</p> <p class="text-s text-secondary" ?hidden="${0}">${0}</p> </div> <div class="rounded bg-contrast-5" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <p class="text-s text-error mt-s" ?hidden="${0}"> ${0} </p> `),!this.label&&!this.helperText,!this.label,this.label,!this.helperText,this.helperText,f([...Object.entries(this._value||{}),null],((e,t)=>String(t)),((t,r)=>null===t?[r>0?e:"",this.__renderRule({onChange:({key:e,items:t})=>{var r;this._value=o(o({},this._value),{},{[e]:[...null!==(r=this._value[e])&&void 0!==r?r:[],...t]})}})]:[r>0?e:"",this.__renderRule({rule:{key:t[0],items:t[1]},onChange:e=>{var r,s;const o={},i=Object.keys(this._value);for(let n=0;n<i.length;n++){const a=i[n];if(a===t[0])if(e.key===a)o[a]=e.items;else{const t=null!==(r=this._value[e.key])&&void 0!==r?r:[];n>i.indexOf(e.key)?o[e.key]=[...t,...e.items]:(o[e.key]=[...e.items,...t],i.splice(i.indexOf(e.key),1))}else o[a]=null!==(s=this._value[a])&&void 0!==s?s:[]}this._value=o},onDelete:()=>{const e=o({},this._value);delete e[t[0]],this._value=e}})])),!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:{}}set _value(e){super._value=e}__renderRule({rule:e,onDelete:t,onChange:r}){var s,o;const i=null!==(s=null==e?void 0:e.items)&&void 0!==s?s:[];return l(w||(w=q` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="flex-1 bg-base rounded-s overflow-hidden border border-contrast-10"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base"> <div aria-hidden="true" class="${0}"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base"> <div class="${0}"> <div aria-hidden="true"> ${0} </div> </div> </div> <div class="bg-base"> <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> </div> </div> </div> </div> <div class="flex -mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center border-t border-b border-transparent divide-y divide-transparent" ?hidden="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> </div> `),this.t("rule"),p({"text-tertiary":!this.readonly&&!this.disabled,"text-disabled":this.readonly||this.disabled,"w-m h-m":!0}),c(C||(C=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 8C12.48 8 8 12.48 8 18C8 23.52 12.48 28 18 28C23.52 28 28 23.52 28 18C28 12.48 23.52 8 18 8ZM18 26C13.59 26 10 22.41 10 18C10 13.59 13.59 10 18 10C22.41 10 26 13.59 26 18C26 22.41 22.41 26 18 26Z" class="fill-current"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.49 17.38C19.92 16.16 19.66 14.74 18.68 13.76C17.57 12.65 15.89 12.46 14.58 13.17L16.93 15.52L15.52 16.93L13.17 14.58C12.46 15.9 12.65 17.57 13.76 18.68C14.74 19.66 16.16 19.92 17.38 19.49L20.79 22.9C20.99 23.1 21.3 23.1 21.5 22.9L22.9 21.5C23.1 21.3 23.1 20.99 22.9 20.79L19.49 17.38Z" class="fill-current"/></svg>`)),this.__renderInput({value:null!==(o=null==e?void 0:e.key)&&void 0!==o?o:"",label:this.t("option_name"),onChange:e=>{void 0===e?null==t||t():r({key:e,items:i})}}),p({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"cursor-default text-tertiary":!(this.disabled||this.readonly),"text-disabled cursor-default":this.disabled||this.readonly}),c(k||(k=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 9.8C11.0088 9.8 9.8 11.0088 9.8 12.5V23.5C9.8 24.9912 11.0088 26.2 12.5 26.2H14C14.6627 26.2 15.2 25.6627 15.2 25C15.2 24.3373 14.6627 23.8 14 23.8H13.5C12.782 23.8 12.2 23.218 12.2 22.5V13.5C12.2 12.782 12.782 12.2 13.5 12.2H14C14.6627 12.2 15.2 11.6627 15.2 11C15.2 10.3373 14.6627 9.8 14 9.8H12.5Z" class="fill-current"/><path d="M22 9.8C21.3373 9.8 20.8 10.3373 20.8 11C20.8 11.6627 21.3373 12.2 22 12.2H22.5C23.218 12.2 23.8 12.782 23.8 13.5V22.5C23.8 23.218 23.218 23.8 22.5 23.8H22C21.3373 23.8 20.8 24.3373 20.8 25C20.8 25.6627 21.3373 26.2 22 26.2H23.5C24.9912 26.2 26.2 24.9912 26.2 23.5V12.5C26.2 11.0088 24.9912 9.8 23.5 9.8H22Z" class="fill-current"/></svg>`)),f(this.readonly?i:[...i,null],((e,t)=>t),((t,s)=>l(A||(A=q` <div class="bg-base"> ${0} </div> `),this.__renderInput({value:null!=t?t:"",label:t?String(s+1):this.t("add_value"),onChange:o=>{const n=[...i];o?null===t?n.push(o):n[s]=o:n.splice(s,1),e&&r({key:e.key,items:n})}})))),this.readonly||0===Object.keys(this._value).length,this.t("delete"),p({"box-content flex items-center justify-center":!0,"w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!this.disabled,"cursor-default text-disabled":this.disabled,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0 pointer-events-none":!e}),this.disabled||this.readonly||!e,(()=>null==t?void 0:t()),c(V||(V=q`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="text-l" style="width: 1.25em; height: 1.25em"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)))}__renderInput(e){return l(R||(R=q` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> <input placeholder="${0}" class="${0}" .value="${0}" ?disabled="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} </label> `),e.label,p({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0}),e.value,this.disabled||this.readonly,(t=>{const r=t.currentTarget;"Backspace"!==t.key||r.value||e.onChange()}),(t=>{t.currentTarget.value||e.onChange()}),(t=>{const r=t.currentTarget;e.onChange(r.value)}),p({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!e.value,"sr-only":!e.value,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly}),this.t(e.label),this.disabled||this.readonly?"":l(S||(S=q` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}}customElements.define("foxy-internal-array-map-control",O);let T,H,L,M,I,B=e=>e;customElements.define("foxy-internal-coupon-form-rules-control",class extends e{renderControl(){var e,t;const r=this.nucleon,s=null!==(e=null==r?void 0:r.form.coupon_discount_details)&&void 0!==e?e:"",o=null!==(t=null==r?void 0:r.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",i=this.helperText,n=this.__renderRulesDescription(),a=this._errorMessage;return l(T||(T=B` <section> <div class="mb-s" ?hidden="${0}"> <p class="flex items-center justify-between space-x-m"> <span class="font-medium flex-1 text-l">${0}</span> <span class="min-w-0">${0}</span> </p> <p class="text-s text-secondary">${0}</p> </div> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),!this.label&&!i&&!n,this.label,this.__renderPreset(),i,{details:s,type:o,name:"Rules"},(e=>{const t=e.currentTarget.parsedValue,r=this.nucleon;null==r||r.edit({coupon_discount_details:t.details,coupon_discount_type:t.type})}),n?l(H||(H=B`<p class="text-s text-secondary mt-s">${0}</p>`),n):"",!a||this.disabled||this.readonly?"":l(L||(L=B`<p class="mt-s text-s leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var e,t;const r=this.nucleon,s=null!==(e=null==r?void 0:r.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",o=null!==(t=null==r?void 0:r.form.coupon_discount_details)&&void 0!==t?t:"";return o?this.t("discount_summary",{params:{details:o,type:s,ns:this.ns}}):null}__renderPreset(){const e=this.nucleon,t=null==e?void 0:e.form.coupon_discount_details,r=null==e?void 0:e.form.coupon_discount_type,s=[{type:"quantity_amount",details:"allunits|2-2"},{type:"quantity_percentage",details:"allunits|5-10|10-20"},{type:"quantity_amount",details:"incremental|3-5"},{type:"quantity_percentage",details:"incremental|11-10|51-15|101-20"},{type:"quantity_percentage",details:"repeat|2-100"},{type:"quantity_percentage",details:"repeat|4-50"},{type:"quantity_amount",details:"single|5-10"},{type:"price_percentage",details:"single|99.99-10"}],i=s.find((e=>e.details===t&&e.type===r));return l(M||(M=B` <label data-testid="rules:preset" class="${0}"> <foxy-i18n class="sr-only" infer="" key="preset"></foxy-i18n> <span class="relative font-medium flex items-center"> <span class="truncate"> ${0} </span> <iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" data-testid="rules:preset:select" class="opacity-0 absolute inset-0 focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} <option value="custom" ?selected="${0}"> ${0} </option> </select> </span> </label> `),p({"whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors":!0,"text-body hover-text-primary focus-within-ring-2":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled}),i?this.t("discount_summary",{params:o(o({},i),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(e=>{var t,r;const o=e.currentTarget,i=s[o.selectedIndex],n=this.nucleon;null==n||n.edit({coupon_discount_details:null!==(t=null==i?void 0:i.details)&&void 0!==t?t:"",coupon_discount_type:null!==(r=null==i?void 0:i.type)&&void 0!==r?r:"quantity_amount"})}),s.map((e=>l(I||(I=B` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.details,e===i,this.t("discount_summary",{params:o(o({},e),{},{ns:this.ns})})))),!i&&!!t&&!!r,this.t("custom_discount"))}});let Z,z,P=e=>e;const D=u(m(t,"coupon-form"));class G extends D{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,this.__customerAttributeRestrictionsOperators=[n.Not,n.In],this.__customerAttributeRestrictionsGetValue=()=>{var e;const t=r(null!==(e=this.form.customer_attribute_restrictions)&&void 0!==e?e:"").filter((e=>Array.isArray(e)||"string"==typeof e.name)).map((e=>{if(Array.isArray(e))return e.filter((({name:e})=>"string"==typeof e)).map((({name:e,operator:t,value:r})=>({path:e,operator:t,value:r})));return{operator:e.operator,value:e.value,path:e.name}}));return s(t,!0)},this.__customerAttributeRestrictionsSetValue=e=>{const t=r(e).map((e=>{if(Array.isArray(e))return e.map((({path:e,operator:t,value:r})=>({name:e,path:"attributes",operator:t,value:r})));return{operator:e.operator,value:e.value,path:"attributes",name:e.path}}));this.edit({customer_attribute_restrictions:s(t,!0)})},this.__customerSubscriptionRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.customer_subscription_restrictions)||void 0===e?void 0:e.split(",").map((e=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).map((e=>({value:e})));return null!=t?t:[]},this.__customerSubscriptionRestrictionsSetValue=e=>{this.edit({customer_subscription_restrictions:e.map((({value:e})=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join()}),this.edit({customer_auto_apply:!!this.form.customer_subscription_restrictions||!!this.form.customer_attribute_restrictions})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:a.String},{label:"used_codes",path:"number_of_uses_to_date",type:a.Number},{label:"date_created",path:"date_created",type:a.Date},{label:"date_modified",path:"date_modified",type:a.Date}],this.__couponCodesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__couponCodesActions[0].state="busy",e.__couponCodesActions=[...e.__couponCodesActions];try{await navigator.clipboard.writeText(t.code),e.__couponCodesActions[0].state="end"}catch(t){e.__couponCodesActions[0].state="error"}finally{e.__couponCodesActions=[...e.__couponCodesActions],setTimeout((()=>{e.__couponCodesActions[0].state="idle",e.__couponCodesActions=[...e.__couponCodesActions]}),1e3)}}}]}static get properties(){return o(o({},super.properties),{},{getTransactionPageHref:{attribute:!1},__couponCodesActions:{type:Array}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",({inclusive_tax_rate:e})=>!e||e>=0||"inclusive-tax-rate:v8n_too_small",({inclusive_tax_rate:e})=>!e||e<=1||"inclusive-tax-rate:v8n_too_big",({number_of_uses_allowed:e})=>!e||e>=0||"number-of-uses-allowed:v8n_too_small",({coupon_discount_details:e})=>!!e||"rules:v8n_required",({coupon_discount_details:e})=>!e||e.length<=200||"rules:v8n_too_long",({item_option_restrictions:e})=>!e||JSON.stringify(e).length<=6e3||"item-option-restrictions:v8n_too_long",({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long",({customer_attribute_restrictions:e})=>!e||e.length<=2e3||"customer-attribute-restrictions:v8n_too_long",({number_of_uses_allowed_per_code:e})=>!e||e>=0||"number-of-uses-allowed-per-code:v8n_too_small",({customer_subscription_restrictions:e})=>!e||e.length<=200||"customer-subscription-restrictions:v8n_too_long",({number_of_uses_allowed_per_customer:e})=>!e||e>=0||"number-of-uses-allowed-per-customer:v8n_too_small"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.push("coupon-codes","category-restrictions","attributes"),new i(e.join(" ").trim())}get headerSubtitleOptions(){return o(o({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}renderHeaderActions(e){return l(Z||(Z=P` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-coupon-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:coupon_codes"].href],e._links["fx:coupon_codes"].href,[e._links["fx:coupon_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,s,o,i,n,a;let d;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:coupon_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),d=r.toString()}catch(e){d=void 0}return l(z||(z=P` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="coupon-codes" item="foxy-coupon-code-card" form="foxy-coupon-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-array-map-control infer="item-option-restrictions"> </foxy-internal-array-map-control> <foxy-internal-query-builder-control infer="customer-attribute-restrictions" disable-zoom disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-summary-control infer="auto-apply"> <foxy-internal-switch-control infer="customer-auto-apply"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="coupon_uri" own-uri="${0}" embed-key="fx:coupon_item_categories" options-href="${0}" links-href="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-summary-control infer="uses"> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-customer" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-code" step="1" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="timeframe"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="taxes"> <foxy-internal-number-control layout="summary-item" infer="inclusive-tax-rate" min="0" max="1"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="options"> <foxy-internal-switch-control infer="multiple-codes-allowed"></foxy-internal-switch-control> <foxy-internal-switch-control infer="combinable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-category-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-line-item-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="is-taxable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="shared-codes-allowed"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),d,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],this.__customerAttributeRestrictionsOperators,this.__customerAttributeRestrictionsGetValue,this.__customerAttributeRestrictionsSetValue,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,h(null===(r=this.data)||void 0===r?void 0:r._links.self.href),h(null===(o=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===o?void 0:o._links["fx:item_categories"].href),h(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),h(null===(n=this.data)||void 0===n?void 0:n._links["fx:attributes"].href),super.renderBody(),h(null===(a=this.data)||void 0===a?void 0:a._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-coupon-form",G);export{G as CouponForm};
1
+ import"./shared-6660c6df.js";import"./shared-8f6400d9.js";import"./shared-1fcf3749.js";import{a as e,I as t}from"./shared-edb68eb7.js";import{p as r,s}from"./shared-c05984d1.js";import{_ as o,B as i}from"./shared-d1195c27.js";import{O as n,T as a}from"./shared-8874ec69.js";import{h as l,c as d,s as c}from"./shared-ba5c42c7.js";import"./shared-bb43f0ad.js";import{R as u,a as m}from"./shared-fefaece7.js";import{c as p}from"./shared-4e709717.js";import{r as f}from"./shared-5fd5805c.js";import"./shared-0564def4.js";import"./shared-70bd1896.js";import"./shared-6aa8f7ee.js";import"./shared-b293a928.js";import"./shared-a42e4325.js";import"./foxy-generate-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-coupon-codes-form.js";import"./foxy-coupon-code-card.js";import"./foxy-coupon-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-form.js";import"./foxy-attribute-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-discount-builder.js";import{i as h}from"./shared-53e42a77.js";import"./shared-5cea7ef0.js";import"./shared-256fe764.js";import"./shared-944dc1e2.js";import"./shared-00cd0e86.js";import"./shared-f0afd1ee.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-00b50480.js";import"./shared-b7889b37.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-eeb2bd18.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-53e476fd.js";import"./foxy-pagination.js";import"./foxy-form-dialog.js";import"./shared-a208ae8c.js";import"./shared-e14bc410.js";import"./shared-56f7db6f.js";import"./shared-4558cdb4.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-bab2ea2c.js";import"./shared-63c32024.js";import"./shared-79d0699c.js";import"./shared-a63c89a1.js";import"./shared-4215bff2.js";import"./shared-355ef444.js";import"./shared-a3f1420c.js";import"./shared-c3fd2e9c.js";import"./shared-05ed8288.js";import"./shared-6524d421.js";import"./shared-421b13a8.js";import"./shared-df76d498.js";import"./shared-188a9c2e.js";import"./shared-15ded782.js";import"./shared-c2ca5bee.js";import"./shared-75908858.js";import"./shared-43e2c3f6.js";import"./shared-cf8e2611.js";import"./shared-b15d45b1.js";import"./shared-e4159eb9.js";import"./shared-0c61b5ce.js";import"./shared-47962c3f.js";import"./shared-2edce408.js";import"./foxy-swipe-actions.js";import"./foxy-transaction-card.js";import"./shared-1c6a1571.js";let y,_,b,x,v=e=>e;customElements.define("foxy-internal-query-builder-control",class extends e{constructor(){super(...arguments),this.disableZoom=!1,this.disableOr=!1,this.operators=Object.values(n)}static get properties(){return o(o({},super.properties),{},{disableZoom:{type:Boolean,attribute:"disable-zoom"},disableOr:{type:Boolean,attribute:"disable-or"},operators:{type:Array}})}renderControl(){const{label:e,helperText:t,_errorMessage:r}=this,s=r&&!this.disabled&&!this.readonly;return l(y||(y=v` <section class="grid gap-s leading-xs"> <div ?hidden="${0}"> ${0} ${0} </div> <div class="bg-contrast-5 rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-query-builder infer="query-builder" style="--lumo-border-radius:var(--lumo-border-radius-s);--lumo-border-radius-l:var(--lumo-border-radius-s)" .operators="${0}" .value="${0}" ?disable-zoom="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> </div> ${0} </section> `),!e&&!t,e?l(_||(_=v`<p class="text-l font-medium">${0}</p>`),e):"",t?l(b||(b=v`<p class="text-s text-secondary">${0}</p>`),t):"",this.operators,this._value,this.disableZoom,this.disableOr,(e=>{var t;const r=e.currentTarget;this._value=null!==(t=r.value)&&void 0!==t?t:""}),s?l(x||(x=v`<p class="text-s text-error">${0}</p>`),r):"")}});let g,j,$,w,C,k,A,V,R,S,q=e=>e;class O extends(u(e)){static get styles(){return[super.styles,d(g||(g=q`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`))]}renderControl(){const e=l(j||(j=q` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-20"> <foxy-i18n infer="" key="or"></foxy-i18n> </div> <div class="flex-1 border-t border-contrast-10"></div> <div class="w-m ml-s flex-shrink-0"></div> </div> `));return l($||($=q` <div class="mb-s" ?hidden="${0}"> <p class="font-medium text-body text-l" ?hidden="${0}">${0}</p> <p class="text-s text-secondary" ?hidden="${0}">${0}</p> </div> <div class="rounded bg-contrast-5" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <p class="text-s text-error mt-s" ?hidden="${0}"> ${0} </p> `),!this.label&&!this.helperText,!this.label,this.label,!this.helperText,this.helperText,f([...Object.entries(this._value||{}),null],((e,t)=>String(t)),((t,r)=>null===t?[r>0?e:"",this.__renderRule({onChange:({key:e,items:t})=>{var r;this._value=o(o({},this._value),{},{[e]:[...null!==(r=this._value[e])&&void 0!==r?r:[],...t]})}})]:[r>0?e:"",this.__renderRule({rule:{key:t[0],items:t[1]},onChange:e=>{var r,s;const o={},i=Object.keys(this._value);for(let n=0;n<i.length;n++){const a=i[n];if(a===t[0])if(e.key===a)o[a]=e.items;else{const t=null!==(r=this._value[e.key])&&void 0!==r?r:[];n>i.indexOf(e.key)?o[e.key]=[...t,...e.items]:(o[e.key]=[...e.items,...t],i.splice(i.indexOf(e.key),1))}else o[a]=null!==(s=this._value[a])&&void 0!==s?s:[]}this._value=o},onDelete:()=>{const e=o({},this._value);delete e[t[0]],this._value=e}})])),!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:{}}set _value(e){super._value=e}__renderRule({rule:e,onDelete:t,onChange:r}){var s,o;const i=null!==(s=null==e?void 0:e.items)&&void 0!==s?s:[];return l(w||(w=q` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="flex-1 bg-base rounded-s overflow-hidden border border-contrast-10"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base"> <div aria-hidden="true" class="${0}"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base"> <div class="${0}"> <div aria-hidden="true"> ${0} </div> </div> </div> <div class="bg-base"> <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> </div> </div> </div> </div> <div class="flex -mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center border-t border-b border-transparent divide-y divide-transparent" ?hidden="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> </div> `),this.t("rule"),p({"text-tertiary":!this.readonly&&!this.disabled,"text-disabled":this.readonly||this.disabled,"w-m h-m":!0}),c(C||(C=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 8C12.48 8 8 12.48 8 18C8 23.52 12.48 28 18 28C23.52 28 28 23.52 28 18C28 12.48 23.52 8 18 8ZM18 26C13.59 26 10 22.41 10 18C10 13.59 13.59 10 18 10C22.41 10 26 13.59 26 18C26 22.41 22.41 26 18 26Z" class="fill-current"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.49 17.38C19.92 16.16 19.66 14.74 18.68 13.76C17.57 12.65 15.89 12.46 14.58 13.17L16.93 15.52L15.52 16.93L13.17 14.58C12.46 15.9 12.65 17.57 13.76 18.68C14.74 19.66 16.16 19.92 17.38 19.49L20.79 22.9C20.99 23.1 21.3 23.1 21.5 22.9L22.9 21.5C23.1 21.3 23.1 20.99 22.9 20.79L19.49 17.38Z" class="fill-current"/></svg>`)),this.__renderInput({value:null!==(o=null==e?void 0:e.key)&&void 0!==o?o:"",label:this.t("option_name"),onChange:e=>{void 0===e?null==t||t():r({key:e,items:i})}}),p({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"cursor-default text-tertiary":!(this.disabled||this.readonly),"text-disabled cursor-default":this.disabled||this.readonly}),c(k||(k=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 9.8C11.0088 9.8 9.8 11.0088 9.8 12.5V23.5C9.8 24.9912 11.0088 26.2 12.5 26.2H14C14.6627 26.2 15.2 25.6627 15.2 25C15.2 24.3373 14.6627 23.8 14 23.8H13.5C12.782 23.8 12.2 23.218 12.2 22.5V13.5C12.2 12.782 12.782 12.2 13.5 12.2H14C14.6627 12.2 15.2 11.6627 15.2 11C15.2 10.3373 14.6627 9.8 14 9.8H12.5Z" class="fill-current"/><path d="M22 9.8C21.3373 9.8 20.8 10.3373 20.8 11C20.8 11.6627 21.3373 12.2 22 12.2H22.5C23.218 12.2 23.8 12.782 23.8 13.5V22.5C23.8 23.218 23.218 23.8 22.5 23.8H22C21.3373 23.8 20.8 24.3373 20.8 25C20.8 25.6627 21.3373 26.2 22 26.2H23.5C24.9912 26.2 26.2 24.9912 26.2 23.5V12.5C26.2 11.0088 24.9912 9.8 23.5 9.8H22Z" class="fill-current"/></svg>`)),f(this.readonly?i:[...i,null],((e,t)=>t),((t,s)=>l(A||(A=q` <div class="bg-base"> ${0} </div> `),this.__renderInput({value:null!=t?t:"",label:t?String(s+1):this.t("add_value"),onChange:o=>{const n=[...i];o?null===t?n.push(o):n[s]=o:n.splice(s,1),e&&r({key:e.key,items:n})}})))),this.readonly||0===Object.keys(this._value).length,this.t("delete"),p({"box-content flex items-center justify-center":!0,"w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!this.disabled,"cursor-default text-disabled":this.disabled,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0 pointer-events-none":!e}),this.disabled||this.readonly||!e,(()=>null==t?void 0:t()),c(V||(V=q`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="text-l" style="width: 1.25em; height: 1.25em"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)))}__renderInput(e){return l(R||(R=q` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> <input placeholder="${0}" class="${0}" .value="${0}" ?disabled="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} </label> `),e.label,p({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0}),e.value,this.disabled||this.readonly,(t=>{const r=t.currentTarget;"Backspace"!==t.key||r.value||e.onChange()}),(t=>{t.currentTarget.value||e.onChange()}),(t=>{const r=t.currentTarget;e.onChange(r.value)}),p({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!e.value,"sr-only":!e.value,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly}),this.t(e.label),this.disabled||this.readonly?"":l(S||(S=q` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}}customElements.define("foxy-internal-array-map-control",O);let T,H,L,M,I,B=e=>e;customElements.define("foxy-internal-coupon-form-rules-control",class extends e{renderControl(){var e,t;const r=this.nucleon,s=null!==(e=null==r?void 0:r.form.coupon_discount_details)&&void 0!==e?e:"",o=null!==(t=null==r?void 0:r.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",i=this.helperText,n=this.__renderRulesDescription(),a=this._errorMessage;return l(T||(T=B` <section> <div class="mb-s" ?hidden="${0}"> <p class="flex items-center justify-between space-x-m"> <span class="font-medium flex-1 text-l">${0}</span> <span class="min-w-0">${0}</span> </p> <p class="text-s text-secondary">${0}</p> </div> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),!this.label&&!i&&!n,this.label,this.__renderPreset(),i,{details:s,type:o,name:"Rules"},(e=>{const t=e.currentTarget.parsedValue,r=this.nucleon;null==r||r.edit({coupon_discount_details:t.details,coupon_discount_type:t.type})}),n?l(H||(H=B`<p class="text-s text-secondary mt-s">${0}</p>`),n):"",!a||this.disabled||this.readonly?"":l(L||(L=B`<p class="mt-s text-s leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var e,t;const r=this.nucleon,s=null!==(e=null==r?void 0:r.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",o=null!==(t=null==r?void 0:r.form.coupon_discount_details)&&void 0!==t?t:"";return o?this.t("discount_summary",{params:{details:o,type:s,ns:this.ns}}):null}__renderPreset(){const e=this.nucleon,t=null==e?void 0:e.form.coupon_discount_details,r=null==e?void 0:e.form.coupon_discount_type,s=[{type:"quantity_amount",details:"allunits|2-2"},{type:"quantity_percentage",details:"allunits|5-10|10-20"},{type:"quantity_amount",details:"incremental|3-5"},{type:"quantity_percentage",details:"incremental|11-10|51-15|101-20"},{type:"quantity_percentage",details:"repeat|2-100"},{type:"quantity_percentage",details:"repeat|4-50"},{type:"quantity_amount",details:"single|5-10"},{type:"price_percentage",details:"single|99.99-10"}],i=s.find((e=>e.details===t&&e.type===r));return l(M||(M=B` <label data-testid="rules:preset" class="${0}"> <foxy-i18n class="sr-only" infer="" key="preset"></foxy-i18n> <span class="relative font-medium flex items-center"> <span class="truncate"> ${0} </span> <iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" data-testid="rules:preset:select" class="opacity-0 absolute inset-0 focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} <option value="custom" ?selected="${0}"> ${0} </option> </select> </span> </label> `),p({"whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors":!0,"text-body hover-text-primary focus-within-ring-2":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled}),i?this.t("discount_summary",{params:o(o({},i),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(e=>{var t,r;const o=e.currentTarget,i=s[o.selectedIndex],n=this.nucleon;null==n||n.edit({coupon_discount_details:null!==(t=null==i?void 0:i.details)&&void 0!==t?t:"",coupon_discount_type:null!==(r=null==i?void 0:i.type)&&void 0!==r?r:"quantity_amount"})}),s.map((e=>l(I||(I=B` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.details,e===i,this.t("discount_summary",{params:o(o({},e),{},{ns:this.ns})})))),!i&&!!t&&!!r,this.t("custom_discount"))}});let Z,z,P=e=>e;const D=u(m(t,"coupon-form"));class G extends D{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,this.__customerAttributeRestrictionsOperators=[n.Not,n.In],this.__customerAttributeRestrictionsGetValue=()=>{var e;const t=r(null!==(e=this.form.customer_attribute_restrictions)&&void 0!==e?e:"").filter((e=>Array.isArray(e)||"string"==typeof e.name)).map((e=>{if(Array.isArray(e))return e.filter((({name:e})=>"string"==typeof e)).map((({name:e,operator:t,value:r})=>({path:e,operator:t,value:r})));return{operator:e.operator,value:e.value,path:e.name}}));return s(t,!0)},this.__customerAttributeRestrictionsSetValue=e=>{const t=r(e).map((e=>{if(Array.isArray(e))return e.map((({path:e,operator:t,value:r})=>({name:e,path:"attributes",operator:t,value:r})));return{operator:e.operator,value:e.value,path:"attributes",name:e.path}}));this.edit({customer_attribute_restrictions:s(t,!0)})},this.__customerSubscriptionRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.customer_subscription_restrictions)||void 0===e?void 0:e.split(",").map((e=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).map((e=>({value:e})));return null!=t?t:[]},this.__customerSubscriptionRestrictionsSetValue=e=>{this.edit({customer_subscription_restrictions:e.map((({value:e})=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join()}),this.edit({customer_auto_apply:!!this.form.customer_subscription_restrictions||!!this.form.customer_attribute_restrictions})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:a.String},{label:"used_codes",path:"number_of_uses_to_date",type:a.Number},{label:"date_created",path:"date_created",type:a.Date},{label:"date_modified",path:"date_modified",type:a.Date}],this.__couponCodesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__couponCodesActions[0].state="busy",e.__couponCodesActions=[...e.__couponCodesActions];try{await navigator.clipboard.writeText(t.code),e.__couponCodesActions[0].state="end"}catch(t){e.__couponCodesActions[0].state="error"}finally{e.__couponCodesActions=[...e.__couponCodesActions],setTimeout((()=>{e.__couponCodesActions[0].state="idle",e.__couponCodesActions=[...e.__couponCodesActions]}),1e3)}}}]}static get properties(){return o(o({},super.properties),{},{getTransactionPageHref:{attribute:!1},__couponCodesActions:{type:Array}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",({inclusive_tax_rate:e})=>!e||e>=0||"inclusive-tax-rate:v8n_too_small",({inclusive_tax_rate:e})=>!e||e<=1||"inclusive-tax-rate:v8n_too_big",({number_of_uses_allowed:e})=>!e||e>=0||"number-of-uses-allowed:v8n_too_small",({coupon_discount_details:e})=>!!e||"rules:v8n_required",({coupon_discount_details:e})=>!e||e.length<=200||"rules:v8n_too_long",({item_option_restrictions:e})=>!e||JSON.stringify(e).length<=6e3||"item-option-restrictions:v8n_too_long",({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long",({customer_attribute_restrictions:e})=>!e||e.length<=2e3||"customer-attribute-restrictions:v8n_too_long",({number_of_uses_allowed_per_code:e})=>!e||e>=0||"number-of-uses-allowed-per-code:v8n_too_small",({customer_subscription_restrictions:e})=>!e||e.length<=200||"customer-subscription-restrictions:v8n_too_long",({number_of_uses_allowed_per_customer:e})=>!e||e>=0||"number-of-uses-allowed-per-customer:v8n_too_small"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.push("coupon-codes","category-restrictions","attributes"),new i(e.join(" ").trim())}get headerSubtitleOptions(){return o(o({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}renderHeaderActions(e){return l(Z||(Z=P` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-coupon-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:coupon_codes"].href],e._links["fx:coupon_codes"].href,[e._links["fx:coupon_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,s,o,i,n,a;let d;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:coupon_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),d=r.toString()}catch(e){d=void 0}return l(z||(z=P` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="coupon-codes" item="foxy-coupon-code-card" form="foxy-coupon-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-array-map-control infer="item-option-restrictions"> </foxy-internal-array-map-control> <foxy-internal-query-builder-control infer="customer-attribute-restrictions" disable-zoom disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-summary-control infer="auto-apply"> <foxy-internal-switch-control infer="customer-auto-apply"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="coupon_uri" own-uri="${0}" embed-key="fx:coupon_item_categories" options-href="${0}" links-href="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-summary-control infer="uses"> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-customer" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-code" step="1" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="timeframe"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="taxes"> <foxy-internal-number-control layout="summary-item" infer="inclusive-tax-rate" min="0" max="1"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="options"> <foxy-internal-switch-control infer="multiple-codes-allowed"></foxy-internal-switch-control> <foxy-internal-switch-control infer="combinable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-category-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-line-item-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="is-taxable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="shared-codes-allowed"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),d,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],this.__customerAttributeRestrictionsOperators,this.__customerAttributeRestrictionsGetValue,this.__customerAttributeRestrictionsSetValue,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,h(null===(r=this.data)||void 0===r?void 0:r._links.self.href),h(null===(o=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===o?void 0:o._links["fx:item_categories"].href),h(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),h(null===(n=this.data)||void 0===n?void 0:n._links["fx:attributes"].href),super.renderBody(),h(null===(a=this.data)||void 0===a?void 0:a._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-coupon-form",G);export{G as CouponForm};
@@ -1 +1 @@
1
- import"./shared-31b98ac2.js";import"./shared-1fcf3749.js";import"./shared-0782fee5.js";import"./shared-e1b97b27.js";import"./shared-7ab454fb.js";import{I as e}from"./shared-edb68eb7.js";import"./shared-b15d45b1.js";import{a as t}from"./shared-fefaece7.js";import{B as i}from"./shared-d1195c27.js";import{p as s}from"./shared-6042ee79.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-47962c3f.js";import{p as n}from"./shared-bb43f0ad.js";import{I as a}from"./shared-0c61b5ce.js";import"./shared-1c6a1571.js";import"./shared-5cea7ef0.js";import"./shared-256fe764.js";import"./shared-944dc1e2.js";import"./shared-00cd0e86.js";import"./shared-f0afd1ee.js";import"./shared-c3fd2e9c.js";import"./shared-00b50480.js";import"./shared-53e42a77.js";import"./shared-56f7db6f.js";import"./shared-4558cdb4.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-188a9c2e.js";import"./shared-421b13a8.js";import"./shared-15ded782.js";import"./shared-0564def4.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-b7889b37.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-eeb2bd18.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-a208ae8c.js";import"./shared-e14bc410.js";import"./foxy-pagination.js";import"./shared-a63c89a1.js";import"./shared-4215bff2.js";import"./shared-355ef444.js";import"./shared-a3f1420c.js";import"./shared-cf8e2611.js";import"./shared-cb2a2e33.js";import"./shared-b4b9735c.js";import"./shared-6524d421.js";import"./shared-651c44fa.js";import"./shared-c2ca5bee.js";import"./shared-75908858.js";import"./shared-82614ac9.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";let r,l=e=>e;const d=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form",class extends d{constructor(){super(...arguments),this.__valuesInputParams={type:"number",step:"1",min:"1",max:"999"},this.__valuesGetValue=()=>{var e;return null===(e=this.form.values)||void 0===e?void 0:e.map((e=>{if(".5m"===e)return{value:e,label:this.t("values.twice_a_week")};const{units:t,count:i}=s(e);return{value:e,label:this.t(`values.${t}`,{count:i})}}))},this.__valuesSetValue=e=>{const t=e.filter((({value:e})=>parseFloat(e)<=999)).map((({unit:e,value:t})=>e?`${t}${e}`:t)).filter(((e,t,i)=>i.indexOf(e)===t));this.edit({values:t})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({values:e})=>!!e&&e.length>0||"values:v8n_required",({values:e})=>!e||e.length<=20||"values:v8n_too_long"]}get hiddenSelector(){return new i(`timestamps ${super.hiddenSelector}`.trim())}renderBody(){return o(r||(r=l` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-editable-list-control infer="values" .inputParams="${0}" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__valuesInputParams,this.__valuesGetValue,this.__valuesSetValue,[{label:this.t("values.unit_years"),value:"y"},{label:this.t("values.unit_months"),value:"m"},{label:this.t("values.unit_weeks"),value:"w"},{label:this.t("values.unit_days"),value:"d"}],super.renderBody())}});let u,c=e=>e;const f=t(a);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card",class extends f{renderBody(){var e;const{jsonataQuery:t,values:i}=null!==(e=this.data)&&void 0!==e?e:{},n=null==i?void 0:i.map((e=>{if(".5m"===e)return this.t("twice_a_week");const{units:t,count:i}=s(e);return this.t(t,{count:i})}));return o(u||(u=c` <section class="h-s flex flex-col justify-center leading-xs"> <p class="text-m font-medium min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),"*"===t?"title_all":"title_matching",{query:t},(null==i?void 0:i.length)?"subtitle_list":"subtitle_empty",{list:null==n?void 0:n.join(", ")})}});let p,h=e=>e;const m=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form",class extends m{constructor(){super(...arguments),this.__minmaxRestrictionsGetValue=()=>{const e=[],t=this.form;return t.min&&e.push("min"),t.max&&e.push("max"),e},this.__minmaxRestrictionsSetValue=e=>{const t=this.form;this.edit({min:e.includes("min")?t.min||"1m":null,max:e.includes("max")?t.max||"1y":null})},this.__minmaxRestrictionsOptions=[{label:"option_min",value:"min"},{label:"option_max",value:"max"}],this.__dayAndDateRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.type;return"day"===t?"days":"month"===t?"dates":"none"},this.__dayAndDateRestrictionsSetValue=e=>{"dates"===e?this.edit({allowedDays:{type:"month",days:[]}}):"days"===e?this.edit({allowedDays:{type:"day",days:[]}}):this.edit({allowedDays:null})},this.__dayAndDateRestrictionsOptions=[{label:"option_none",value:"none"},{label:"option_dates",value:"dates"},{label:"option_days",value:"days"}],this.__daysOfWeekGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>String(e))))&&void 0!==t?t:[]},this.__daysOfWeekSetValue=e=>{this.edit({allowedDays:{type:"day",days:e.map(Number)}})},this.__daysOfWeekOptions=[{label:"option_1",value:"1"},{label:"option_2",value:"2"},{label:"option_3",value:"3"},{label:"option_4",value:"4"},{label:"option_5",value:"5"},{label:"option_6",value:"6"},{label:"option_7",value:"7"}],this.__datesOfMonthInputParams={type:"number",min:"1",max:"31",step:"1"},this.__datesOfMonthGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>({value:String(e)}))))&&void 0!==t?t:[]},this.__datesOfMonthSetValue=e=>{this.edit({allowedDays:{type:"month",days:e.map((e=>parseInt(e.value))).filter((e=>Number.isInteger(e)&&e>=1&&e<=31))}})},this.__disallowedDatesInputParams={type:"date"},this.__disallowedDatesGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.disallowedDates)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==t?t:[]},this.__disallowedDatesSetValue=e=>{this.edit({disallowedDates:e.map((e=>e.value))})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({disallowedDates:e})=>!e||e.length<=10||"disallowed-dates:v8n_too_long"]}get hiddenSelector(){var e,t;const s=["timestamps",super.hiddenSelector.toString()],o=this.form;return o.min||s.unshift("min"),o.max||s.unshift("max"),"day"!==(null===(e=o.allowedDays)||void 0===e?void 0:e.type)&&s.unshift("days-of-week"),"month"!==(null===(t=o.allowedDays)||void 0===t?void 0:t.type)&&s.unshift("dates-of-month"),new i(s.join(" ").trim())}renderBody(){return o(p||(p=h` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="minmax-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-frequency-control infer="min"></foxy-internal-frequency-control> <foxy-internal-frequency-control infer="max"></foxy-internal-frequency-control> <foxy-internal-radio-group-control infer="day-and-date-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="days-of-week" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="dates-of-month" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="disallowed-dates" range="optional" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__minmaxRestrictionsGetValue,this.__minmaxRestrictionsSetValue,this.__minmaxRestrictionsOptions,this.__dayAndDateRestrictionsGetValue,this.__dayAndDateRestrictionsSetValue,this.__dayAndDateRestrictionsOptions,this.__daysOfWeekGetValue,this.__daysOfWeekSetValue,this.__daysOfWeekOptions,this.__datesOfMonthInputParams,this.__datesOfMonthGetValue,this.__datesOfMonthSetValue,this.__disallowedDatesInputParams,this.__disallowedDatesGetValue,this.__disallowedDatesSetValue,super.renderBody())}});let y,_=e=>e;const v=t(a);function x(e){try{return new URL(e).origin===e.toLowerCase()}catch(e){return!1}}customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card",class extends v{renderBody(){var e;const{min:t,max:i,allowedDays:s,jsonataQuery:a,disallowedDates:r}=null!==(e=this.data)&&void 0!==e?e:{},l=t?n(t):void 0,d=i?n(i):void 0,u="*"===a?"line_1_all":"line_1_matching",c={query:a},f={from:l?this.t(`unit_${l.units}`,{count:l.count}):this.t("any"),to:d?this.t(`unit_${d.units}`,{count:d.count}):this.t("any")},p=`line_3_${s?s.type:"any"}`,h={list:"month"===(null==s?void 0:s.type)?null==s?void 0:s.days.join(", "):null==s?void 0:s.days.map((e=>this.t(`day_${e}`))).join(", ")},m=r?"line_4_some":"line_4_none",v={list:null==r?void 0:r.map((e=>{const[t,i]=e.split("..");return t&&i?this.t("date_range",{from:t,to:i}):this.t("single_date",{value:e})})).join(", ")};return o(y||(y=_` <section class="leading-xs" style="margin:-.25ch 0"> <p class="text-m font-medium truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> </p> <p class="text-s text-secondary"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),u,c,f,p,h,m,v)}});let g,b=e=>e;const j=t(e,"customer-portal-settings-form");class w extends j{constructor(){super(...arguments),this.__sessionLifespanInMinutesOptions=[{value:"m",label:"option_minute"},{value:"h",label:"option_hour"},{value:"d",label:"option_day"},{value:"w",label:"option_week"}],this.__sessionLifespanInMinutesGetValue=()=>{var e;const t=null!==(e=this.form.sessionLifespanInMinutes)&&void 0!==e?e:0;return t%10080==0?t/10080+"w":t%1440==0?t/1440+"d":t%60==0?t/60+"h":`${t}m`},this.__sessionLifespanInMinutesSetValue=e=>{const t=parseInt(e);e.endsWith("w")?this.edit({sessionLifespanInMinutes:10080*t}):e.endsWith("d")?this.edit({sessionLifespanInMinutes:1440*t}):e.endsWith("h")?this.edit({sessionLifespanInMinutes:60*t}):this.edit({sessionLifespanInMinutes:t})},this.__allowedOriginsGetValue=()=>{var e;return null===(e=this.form.allowedOrigins)||void 0===e?void 0:e.map((e=>({label:x(e)?e:`⚠️ ${e}`,value:e})))},this.__allowedOriginsSetValue=e=>{this.edit({allowedOrigins:e.map((({value:e})=>function(e){try{return new URL(e).origin}catch(t){return e}}(e))).filter(((e,t,i)=>i.indexOf(e)===t))})},this.__featuresOptions=[{value:"sso",label:"option_sso"},{value:"sign-up",label:"option_sign_up"},{value:"frequency-modification",label:"option_frequency_modification"},{value:"next-date-modification",label:"option_next_date_modification"}],this.__featuresGetValue=()=>{var e,t,i;const s=[];return this.form.sso&&s.push("sso"),(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)&&s.push("sign-up"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&s.push("next-date-modification"),(null===(i=this.form.subscriptions)||void 0===i?void 0:i.allowFrequencyModification.length)&&s.push("frequency-modification"),s},this.__featuresSetValue=e=>{var t,i,s,o,n;const a=null!==(i=null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification)&&void 0!==i?i:[];this.edit({sso:e.includes("sso"),signUp:{enabled:e.includes("sign-up"),verification:null!==(o=null===(s=this.form.signUp)||void 0===s?void 0:s.verification)&&void 0!==o?o:{type:"hcaptcha",siteKey:"",secretKey:""}},subscriptions:{allowFrequencyModification:e.includes("frequency-modification")?0===a.length?[{jsonataQuery:"*",values:[]}]:a:[],allowNextDateModification:!!e.includes("next-date-modification")&&((null===(n=this.form.subscriptions)||void 0===n?void 0:n.allowNextDateModification)||[])}})},this.__signUpVerificationHcaptchaSiteKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.siteKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSiteKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.secretKey)&&void 0!==o?o:"",siteKey:e,type:"hcaptcha"}}})},this.__signUpVerificationHcaptchaSecretKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.secretKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSecretKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:e,siteKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.siteKey)&&void 0!==o?o:"",type:"hcaptcha"}}})},this.__jwtSecretGeneratorOptions={charset:"abcdefghijklmnopqrstuvwxyz0123456789",length:64}}static get v8n(){return[({sessionLifespanInMinutes:e})=>"number"!=typeof e||e<=40320||"session-lifespan-in-minutes:v8n_too_long",({allowedOrigins:e=[]})=>e.length<=10||"allowed-origins:v8n_too_many",({allowedOrigins:e=[]})=>e.every(x)||"allowed-origins:v8n_invalid",({jwtSharedSecret:e})=>!e||/^[a-z0-9-]+$/.test(e)||"jwt-shared-secret:v8n_invalid",({jwtSharedSecret:e})=>!e||e.length>=40||"jwt-shared-secret:v8n_too_short",({jwtSharedSecret:e})=>!e||e.length<=100||"jwt-shared-secret:v8n_too_long",({signUp:e})=>{const t=null==e?void 0:e.verification.siteKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-site-key:v8n_too_long"},({signUp:e})=>{const t=null==e?void 0:e.verification.secretKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-secret-key:v8n_too_long"}]}get hiddenSelector(){var e,t,s;const o=["header:copy-id",super.hiddenSelector.toString()];return(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)||o.push("sign-up-verification-hcaptcha-site-key","sign-up-verification-hcaptcha-secret-key"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification.length)||o.push("subscriptions-allow-frequency-modification"),(null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)||o.push("subscriptions-allow-next-date-modification"),new i(o.join(" ").trim())}renderBody(){return o(g||(g=b` ${0} <foxy-internal-editable-list-control infer="allowed-origins" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="features" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-site-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-secret-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowFrequencyModification" infer="subscriptions-allow-frequency-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowNextDateModification" infer="subscriptions-allow-next-date-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-frequency-control infer="session-lifespan-in-minutes" max="" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-password-control property="jwtSharedSecret" infer="jwt-shared-secret" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> ${0} `),this.renderHeader(),this.__allowedOriginsGetValue,this.__allowedOriginsSetValue,this.__featuresGetValue,this.__featuresSetValue,this.__featuresOptions,this.__signUpVerificationHcaptchaSiteKeyGetValue,this.__signUpVerificationHcaptchaSiteKeySetValue,this.__signUpVerificationHcaptchaSecretKeyGetValue,this.__signUpVerificationHcaptchaSecretKeySetValue,this.virtualHost,this.virtualHost,this.__sessionLifespanInMinutesGetValue,this.__sessionLifespanInMinutesSetValue,this.__sessionLifespanInMinutesOptions,this.__jwtSecretGeneratorOptions,super.renderBody())}async _sendPost(e){return this.__removeNullProperties(e),super._sendPost(e)}async _sendPatch(e){return this.__removeNullProperties(e),super._sendPatch(e)}__removeNullProperties(e){var t,i;"object"==typeof(null===(t=e.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&(null===(i=e.subscriptions)||void 0===i||i.allowNextDateModification.forEach((e=>{for(const t in e){const i=t;null===e[i]&&delete e[i]}})))}}customElements.define("foxy-customer-portal-settings-form",w);export{w as CustomerPortalSettingsForm};
1
+ import"./shared-31b98ac2.js";import"./shared-1fcf3749.js";import"./shared-2edce408.js";import"./shared-e1b97b27.js";import"./shared-7ab454fb.js";import{I as e}from"./shared-edb68eb7.js";import"./shared-b15d45b1.js";import{a as t}from"./shared-fefaece7.js";import{B as i}from"./shared-d1195c27.js";import{p as s}from"./shared-6042ee79.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-47962c3f.js";import{p as n}from"./shared-bb43f0ad.js";import{I as a}from"./shared-0c61b5ce.js";import"./shared-1c6a1571.js";import"./shared-5cea7ef0.js";import"./shared-256fe764.js";import"./shared-944dc1e2.js";import"./shared-00cd0e86.js";import"./shared-f0afd1ee.js";import"./shared-c3fd2e9c.js";import"./shared-00b50480.js";import"./shared-53e42a77.js";import"./shared-56f7db6f.js";import"./shared-4558cdb4.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-188a9c2e.js";import"./shared-421b13a8.js";import"./shared-15ded782.js";import"./shared-0564def4.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-b7889b37.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-eeb2bd18.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-a208ae8c.js";import"./shared-e14bc410.js";import"./foxy-pagination.js";import"./shared-a63c89a1.js";import"./shared-4215bff2.js";import"./shared-355ef444.js";import"./shared-a3f1420c.js";import"./shared-cf8e2611.js";import"./shared-cb2a2e33.js";import"./shared-b4b9735c.js";import"./shared-6524d421.js";import"./shared-651c44fa.js";import"./shared-c2ca5bee.js";import"./shared-75908858.js";import"./shared-82614ac9.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";let r,l=e=>e;const d=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form",class extends d{constructor(){super(...arguments),this.__valuesInputParams={type:"number",step:"1",min:"1",max:"999"},this.__valuesGetValue=()=>{var e;return null===(e=this.form.values)||void 0===e?void 0:e.map((e=>{if(".5m"===e)return{value:e,label:this.t("values.twice_a_week")};const{units:t,count:i}=s(e);return{value:e,label:this.t(`values.${t}`,{count:i})}}))},this.__valuesSetValue=e=>{const t=e.filter((({value:e})=>parseFloat(e)<=999)).map((({unit:e,value:t})=>e?`${t}${e}`:t)).filter(((e,t,i)=>i.indexOf(e)===t));this.edit({values:t})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({values:e})=>!!e&&e.length>0||"values:v8n_required",({values:e})=>!e||e.length<=20||"values:v8n_too_long"]}get hiddenSelector(){return new i(`timestamps ${super.hiddenSelector}`.trim())}renderBody(){return o(r||(r=l` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-editable-list-control infer="values" .inputParams="${0}" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__valuesInputParams,this.__valuesGetValue,this.__valuesSetValue,[{label:this.t("values.unit_years"),value:"y"},{label:this.t("values.unit_months"),value:"m"},{label:this.t("values.unit_weeks"),value:"w"},{label:this.t("values.unit_days"),value:"d"}],super.renderBody())}});let u,c=e=>e;const f=t(a);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card",class extends f{renderBody(){var e;const{jsonataQuery:t,values:i}=null!==(e=this.data)&&void 0!==e?e:{},n=null==i?void 0:i.map((e=>{if(".5m"===e)return this.t("twice_a_week");const{units:t,count:i}=s(e);return this.t(t,{count:i})}));return o(u||(u=c` <section class="h-s flex flex-col justify-center leading-xs"> <p class="text-m font-medium min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),"*"===t?"title_all":"title_matching",{query:t},(null==i?void 0:i.length)?"subtitle_list":"subtitle_empty",{list:null==n?void 0:n.join(", ")})}});let p,h=e=>e;const m=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form",class extends m{constructor(){super(...arguments),this.__minmaxRestrictionsGetValue=()=>{const e=[],t=this.form;return t.min&&e.push("min"),t.max&&e.push("max"),e},this.__minmaxRestrictionsSetValue=e=>{const t=this.form;this.edit({min:e.includes("min")?t.min||"1m":null,max:e.includes("max")?t.max||"1y":null})},this.__minmaxRestrictionsOptions=[{label:"option_min",value:"min"},{label:"option_max",value:"max"}],this.__dayAndDateRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.type;return"day"===t?"days":"month"===t?"dates":"none"},this.__dayAndDateRestrictionsSetValue=e=>{"dates"===e?this.edit({allowedDays:{type:"month",days:[]}}):"days"===e?this.edit({allowedDays:{type:"day",days:[]}}):this.edit({allowedDays:null})},this.__dayAndDateRestrictionsOptions=[{label:"option_none",value:"none"},{label:"option_dates",value:"dates"},{label:"option_days",value:"days"}],this.__daysOfWeekGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>String(e))))&&void 0!==t?t:[]},this.__daysOfWeekSetValue=e=>{this.edit({allowedDays:{type:"day",days:e.map(Number)}})},this.__daysOfWeekOptions=[{label:"option_1",value:"1"},{label:"option_2",value:"2"},{label:"option_3",value:"3"},{label:"option_4",value:"4"},{label:"option_5",value:"5"},{label:"option_6",value:"6"},{label:"option_7",value:"7"}],this.__datesOfMonthInputParams={type:"number",min:"1",max:"31",step:"1"},this.__datesOfMonthGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>({value:String(e)}))))&&void 0!==t?t:[]},this.__datesOfMonthSetValue=e=>{this.edit({allowedDays:{type:"month",days:e.map((e=>parseInt(e.value))).filter((e=>Number.isInteger(e)&&e>=1&&e<=31))}})},this.__disallowedDatesInputParams={type:"date"},this.__disallowedDatesGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.disallowedDates)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==t?t:[]},this.__disallowedDatesSetValue=e=>{this.edit({disallowedDates:e.map((e=>e.value))})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({disallowedDates:e})=>!e||e.length<=10||"disallowed-dates:v8n_too_long"]}get hiddenSelector(){var e,t;const s=["timestamps",super.hiddenSelector.toString()],o=this.form;return o.min||s.unshift("min"),o.max||s.unshift("max"),"day"!==(null===(e=o.allowedDays)||void 0===e?void 0:e.type)&&s.unshift("days-of-week"),"month"!==(null===(t=o.allowedDays)||void 0===t?void 0:t.type)&&s.unshift("dates-of-month"),new i(s.join(" ").trim())}renderBody(){return o(p||(p=h` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="minmax-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-frequency-control infer="min"></foxy-internal-frequency-control> <foxy-internal-frequency-control infer="max"></foxy-internal-frequency-control> <foxy-internal-radio-group-control infer="day-and-date-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="days-of-week" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="dates-of-month" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="disallowed-dates" range="optional" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__minmaxRestrictionsGetValue,this.__minmaxRestrictionsSetValue,this.__minmaxRestrictionsOptions,this.__dayAndDateRestrictionsGetValue,this.__dayAndDateRestrictionsSetValue,this.__dayAndDateRestrictionsOptions,this.__daysOfWeekGetValue,this.__daysOfWeekSetValue,this.__daysOfWeekOptions,this.__datesOfMonthInputParams,this.__datesOfMonthGetValue,this.__datesOfMonthSetValue,this.__disallowedDatesInputParams,this.__disallowedDatesGetValue,this.__disallowedDatesSetValue,super.renderBody())}});let y,_=e=>e;const v=t(a);function x(e){try{return new URL(e).origin===e.toLowerCase()}catch(e){return!1}}customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card",class extends v{renderBody(){var e;const{min:t,max:i,allowedDays:s,jsonataQuery:a,disallowedDates:r}=null!==(e=this.data)&&void 0!==e?e:{},l=t?n(t):void 0,d=i?n(i):void 0,u="*"===a?"line_1_all":"line_1_matching",c={query:a},f={from:l?this.t(`unit_${l.units}`,{count:l.count}):this.t("any"),to:d?this.t(`unit_${d.units}`,{count:d.count}):this.t("any")},p=`line_3_${s?s.type:"any"}`,h={list:"month"===(null==s?void 0:s.type)?null==s?void 0:s.days.join(", "):null==s?void 0:s.days.map((e=>this.t(`day_${e}`))).join(", ")},m=r?"line_4_some":"line_4_none",v={list:null==r?void 0:r.map((e=>{const[t,i]=e.split("..");return t&&i?this.t("date_range",{from:t,to:i}):this.t("single_date",{value:e})})).join(", ")};return o(y||(y=_` <section class="leading-xs" style="margin:-.25ch 0"> <p class="text-m font-medium truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> </p> <p class="text-s text-secondary"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),u,c,f,p,h,m,v)}});let g,b=e=>e;const j=t(e,"customer-portal-settings-form");class w extends j{constructor(){super(...arguments),this.__sessionLifespanInMinutesOptions=[{value:"m",label:"option_minute"},{value:"h",label:"option_hour"},{value:"d",label:"option_day"},{value:"w",label:"option_week"}],this.__sessionLifespanInMinutesGetValue=()=>{var e;const t=null!==(e=this.form.sessionLifespanInMinutes)&&void 0!==e?e:0;return t%10080==0?t/10080+"w":t%1440==0?t/1440+"d":t%60==0?t/60+"h":`${t}m`},this.__sessionLifespanInMinutesSetValue=e=>{const t=parseInt(e);e.endsWith("w")?this.edit({sessionLifespanInMinutes:10080*t}):e.endsWith("d")?this.edit({sessionLifespanInMinutes:1440*t}):e.endsWith("h")?this.edit({sessionLifespanInMinutes:60*t}):this.edit({sessionLifespanInMinutes:t})},this.__allowedOriginsGetValue=()=>{var e;return null===(e=this.form.allowedOrigins)||void 0===e?void 0:e.map((e=>({label:x(e)?e:`⚠️ ${e}`,value:e})))},this.__allowedOriginsSetValue=e=>{this.edit({allowedOrigins:e.map((({value:e})=>function(e){try{return new URL(e).origin}catch(t){return e}}(e))).filter(((e,t,i)=>i.indexOf(e)===t))})},this.__featuresOptions=[{value:"sso",label:"option_sso"},{value:"sign-up",label:"option_sign_up"},{value:"frequency-modification",label:"option_frequency_modification"},{value:"next-date-modification",label:"option_next_date_modification"}],this.__featuresGetValue=()=>{var e,t,i;const s=[];return this.form.sso&&s.push("sso"),(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)&&s.push("sign-up"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&s.push("next-date-modification"),(null===(i=this.form.subscriptions)||void 0===i?void 0:i.allowFrequencyModification.length)&&s.push("frequency-modification"),s},this.__featuresSetValue=e=>{var t,i,s,o,n;const a=null!==(i=null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification)&&void 0!==i?i:[];this.edit({sso:e.includes("sso"),signUp:{enabled:e.includes("sign-up"),verification:null!==(o=null===(s=this.form.signUp)||void 0===s?void 0:s.verification)&&void 0!==o?o:{type:"hcaptcha",siteKey:"",secretKey:""}},subscriptions:{allowFrequencyModification:e.includes("frequency-modification")?0===a.length?[{jsonataQuery:"*",values:[]}]:a:[],allowNextDateModification:!!e.includes("next-date-modification")&&((null===(n=this.form.subscriptions)||void 0===n?void 0:n.allowNextDateModification)||[])}})},this.__signUpVerificationHcaptchaSiteKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.siteKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSiteKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.secretKey)&&void 0!==o?o:"",siteKey:e,type:"hcaptcha"}}})},this.__signUpVerificationHcaptchaSecretKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.secretKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSecretKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:e,siteKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.siteKey)&&void 0!==o?o:"",type:"hcaptcha"}}})},this.__jwtSecretGeneratorOptions={charset:"abcdefghijklmnopqrstuvwxyz0123456789",length:64}}static get v8n(){return[({sessionLifespanInMinutes:e})=>"number"!=typeof e||e<=40320||"session-lifespan-in-minutes:v8n_too_long",({allowedOrigins:e=[]})=>e.length<=10||"allowed-origins:v8n_too_many",({allowedOrigins:e=[]})=>e.every(x)||"allowed-origins:v8n_invalid",({jwtSharedSecret:e})=>!e||/^[a-z0-9-]+$/.test(e)||"jwt-shared-secret:v8n_invalid",({jwtSharedSecret:e})=>!e||e.length>=40||"jwt-shared-secret:v8n_too_short",({jwtSharedSecret:e})=>!e||e.length<=100||"jwt-shared-secret:v8n_too_long",({signUp:e})=>{const t=null==e?void 0:e.verification.siteKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-site-key:v8n_too_long"},({signUp:e})=>{const t=null==e?void 0:e.verification.secretKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-secret-key:v8n_too_long"}]}get hiddenSelector(){var e,t,s;const o=["header:copy-id",super.hiddenSelector.toString()];return(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)||o.push("sign-up-verification-hcaptcha-site-key","sign-up-verification-hcaptcha-secret-key"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification.length)||o.push("subscriptions-allow-frequency-modification"),(null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)||o.push("subscriptions-allow-next-date-modification"),new i(o.join(" ").trim())}renderBody(){return o(g||(g=b` ${0} <foxy-internal-editable-list-control infer="allowed-origins" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="features" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-site-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-secret-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowFrequencyModification" infer="subscriptions-allow-frequency-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowNextDateModification" infer="subscriptions-allow-next-date-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-frequency-control infer="session-lifespan-in-minutes" max="" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-password-control property="jwtSharedSecret" infer="jwt-shared-secret" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> ${0} `),this.renderHeader(),this.__allowedOriginsGetValue,this.__allowedOriginsSetValue,this.__featuresGetValue,this.__featuresSetValue,this.__featuresOptions,this.__signUpVerificationHcaptchaSiteKeyGetValue,this.__signUpVerificationHcaptchaSiteKeySetValue,this.__signUpVerificationHcaptchaSecretKeyGetValue,this.__signUpVerificationHcaptchaSecretKeySetValue,this.virtualHost,this.virtualHost,this.__sessionLifespanInMinutesGetValue,this.__sessionLifespanInMinutesSetValue,this.__sessionLifespanInMinutesOptions,this.__jwtSecretGeneratorOptions,super.renderBody())}async _sendPost(e){return this.__removeNullProperties(e),super._sendPost(e)}async _sendPatch(e){return this.__removeNullProperties(e),super._sendPatch(e)}__removeNullProperties(e){var t,i;"object"==typeof(null===(t=e.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&(null===(i=e.subscriptions)||void 0===i||i.allowNextDateModification.forEach((e=>{for(const t in e){const i=t;null===e[i]&&delete e[i]}})))}}customElements.define("foxy-customer-portal-settings-form",w);export{w as CustomerPortalSettingsForm};
@@ -1,4 +1,4 @@
1
- import"./foxy-customer.js";import"./shared-f0afd1ee.js";import"./shared-b7889b37.js";import"./shared-00b50480.js";import"./shared-7ab454fb.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-edb68eb7.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import{u as s}from"./shared-ef11a60b.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import"./shared-bb43f0ad.js";import{_ as r,B as o,aH as i}from"./shared-d1195c27.js";import{h as a,L as n,c as d}from"./shared-ba5c42c7.js";import{A as l}from"./shared-9ca85d1e.js";import"./shared-c2efc54e.js";import{C as c}from"./shared-82e82908.js";import{a as m,T as u}from"./shared-fefaece7.js";import{U as p}from"./shared-cd96ff03.js";import{i as h}from"./shared-53e42a77.js";import{c as f}from"./shared-4e709717.js";import{A as g}from"./shared-7e9fdf64.js";import{C as y}from"./shared-eeb2bd18.js";import{I as $}from"./shared-17a61265.js";import"./shared-944dc1e2.js";import"./foxy-update-payment-method-form.js";import"./shared-a72df5aa.js";import"./shared-0782fee5.js";import"./shared-256fe764.js";import"./shared-00cd0e86.js";import"./shared-5cea7ef0.js";import"./shared-188a9c2e.js";import"./shared-421b13a8.js";import"./shared-15ded782.js";import"./shared-0564def4.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-d1dfac4d.js";import"./shared-343d1fd7.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a208ae8c.js";import"./shared-e14bc410.js";import"./foxy-copy-to-clipboard.js";import"./shared-56f7db6f.js";import"./shared-4558cdb4.js";import"./foxy-nucleon-element.js";import"./shared-53e476fd.js";import"./shared-bab2ea2c.js";import"./foxy-template-set-card.js";import"./shared-e4159eb9.js";import"./shared-0c61b5ce.js";import"./foxy-payment-card-embed.js";import"./shared-355ef444.js";import"./shared-4215bff2.js";import"./shared-6524d421.js";import"./shared-c3fd2e9c.js";import"./shared-0d757c1c.js";import"./shared-5fd5805c.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-1c6a1571.js";import"./shared-b15d45b1.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./shared-31b98ac2.js";import"./shared-c5fa5c92.js";import"./shared-b4b9735c.js";import"./shared-651c44fa.js";import"./shared-a3f1420c.js";import"./shared-c2ca5bee.js";import"./shared-75908858.js";import"./shared-b293a928.js";import"./shared-d0aed1c1.js";import"./foxy-table.js";import"./shared-95339d7a.js";import"./shared-ae4d5fd6.js";import"./shared-a63c89a1.js";import"./shared-cf8e2611.js";import"./shared-c1a3e4fd.js";import"./shared-cb2a2e33.js";import"./shared-c6ce69fc.js";import"./shared-df76d498.js";import"./shared-1563cd85.js";import"./shared-e7b48aaa.js";import"./shared-6042ee79.js";import"./shared-cf613436.js";import"./shared-6aa8f7ee.js";import"./shared-1036a0cd.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-47962c3f.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-641786b2.js";import"./shared-a6b2bd14.js";import"./shared-82614ac9.js";import"./shared-b738ee96.js";import"./shared-1eeddc24.js";
1
+ import"./foxy-customer.js";import"./shared-f0afd1ee.js";import"./shared-b7889b37.js";import"./shared-00b50480.js";import"./shared-7ab454fb.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-edb68eb7.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import{u as s}from"./shared-ef11a60b.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import"./shared-bb43f0ad.js";import{_ as r,B as o,aH as i}from"./shared-d1195c27.js";import{h as a,L as n,c as d}from"./shared-ba5c42c7.js";import{A as l}from"./shared-9ca85d1e.js";import"./shared-c2efc54e.js";import{C as c}from"./shared-82e82908.js";import{a as m,T as u}from"./shared-fefaece7.js";import{U as p}from"./shared-cd96ff03.js";import{i as h}from"./shared-53e42a77.js";import{c as f}from"./shared-4e709717.js";import{A as g}from"./shared-7e9fdf64.js";import{C as y}from"./shared-eeb2bd18.js";import{I as $}from"./shared-17a61265.js";import"./shared-944dc1e2.js";import"./foxy-update-payment-method-form.js";import"./shared-79f84a95.js";import"./shared-2edce408.js";import"./shared-256fe764.js";import"./shared-00cd0e86.js";import"./shared-5cea7ef0.js";import"./shared-188a9c2e.js";import"./shared-421b13a8.js";import"./shared-15ded782.js";import"./shared-0564def4.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-d1dfac4d.js";import"./shared-343d1fd7.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a208ae8c.js";import"./shared-e14bc410.js";import"./foxy-copy-to-clipboard.js";import"./shared-56f7db6f.js";import"./shared-4558cdb4.js";import"./foxy-nucleon-element.js";import"./shared-53e476fd.js";import"./shared-bab2ea2c.js";import"./foxy-template-set-card.js";import"./shared-e4159eb9.js";import"./shared-0c61b5ce.js";import"./foxy-payment-card-embed.js";import"./shared-355ef444.js";import"./shared-4215bff2.js";import"./shared-6524d421.js";import"./shared-c3fd2e9c.js";import"./shared-0d757c1c.js";import"./shared-5fd5805c.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-1c6a1571.js";import"./shared-b15d45b1.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./shared-31b98ac2.js";import"./shared-c5fa5c92.js";import"./shared-b4b9735c.js";import"./shared-651c44fa.js";import"./shared-a3f1420c.js";import"./shared-c2ca5bee.js";import"./shared-75908858.js";import"./shared-b293a928.js";import"./shared-d0aed1c1.js";import"./foxy-table.js";import"./shared-95339d7a.js";import"./shared-ae4d5fd6.js";import"./shared-a63c89a1.js";import"./shared-cf8e2611.js";import"./shared-c1a3e4fd.js";import"./shared-cb2a2e33.js";import"./shared-c6ce69fc.js";import"./shared-df76d498.js";import"./shared-1563cd85.js";import"./shared-e7b48aaa.js";import"./shared-6042ee79.js";import"./shared-cf613436.js";import"./shared-6aa8f7ee.js";import"./shared-1036a0cd.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-47962c3f.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-641786b2.js";import"./shared-a6b2bd14.js";import"./shared-82614ac9.js";import"./shared-b738ee96.js";import"./shared-1eeddc24.js";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -1,4 +1,4 @@
1
- import"./shared-00b50480.js";import"./shared-b7889b37.js";import{h as t}from"./shared-944dc1e2.js";import"./shared-f0afd1ee.js";import"./shared-5212ef4f.js";import"./foxy-payment-method-card.js";import"./foxy-update-payment-method-form.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-ef11a60b.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-bb43f0ad.js";import{aH as e,_ as s}from"./shared-d1195c27.js";import{L as r,h as a,c as o}from"./shared-ba5c42c7.js";import{C as i}from"./shared-eeb2bd18.js";import"./shared-256fe764.js";import"./shared-4558cdb4.js";import{z as h,S as d,T as n,a as l}from"./shared-fefaece7.js";import{c as m}from"./shared-4e709717.js";import{S as c}from"./shared-ae4d5fd6.js";import"./shared-e14bc410.js";import{G as v}from"./shared-1563cd85.js";import"./shared-355ef444.js";import"./shared-6524d421.js";import"./shared-421b13a8.js";import"./shared-c3fd2e9c.js";import"./shared-0d757c1c.js";import"./shared-4215bff2.js";import{N as p}from"./shared-d1dfac4d.js";import{S as f}from"./shared-e7b48aaa.js";import{i as g}from"./shared-53e42a77.js";import"./shared-00cd0e86.js";import"./shared-a208ae8c.js";import"./shared-cf613436.js";import"./foxy-nucleon-element.js";import"./shared-7e9fdf64.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-17a61265.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a72df5aa.js";import"./shared-0782fee5.js";import"./shared-5cea7ef0.js";import"./shared-188a9c2e.js";import"./shared-15ded782.js";import"./shared-0564def4.js";import"./shared-edb68eb7.js";import"./foxy-copy-to-clipboard.js";import"./shared-56f7db6f.js";import"./shared-bab2ea2c.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-53e476fd.js";import"./foxy-template-set-card.js";import"./shared-e4159eb9.js";import"./shared-0c61b5ce.js";import"./foxy-payment-card-embed.js";import"./shared-9ca85d1e.js";import"./shared-c2efc54e.js";import"./shared-5fd5805c.js";import"./shared-b4b9735c.js";import"./shared-651c44fa.js";import"./shared-a3f1420c.js";import"./shared-c2ca5bee.js";import"./shared-75908858.js";import"./shared-6aa8f7ee.js";import"./shared-a63c89a1.js";import"./shared-1036a0cd.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-47962c3f.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-6042ee79.js";import"./shared-641786b2.js";import"./shared-95339d7a.js";import"./shared-1c6a1571.js";import"./shared-b15d45b1.js";import"./shared-a6b2bd14.js";import"./shared-7ab454fb.js";import"./shared-82614ac9.js";import"./shared-b293a928.js";import"./shared-d0aed1c1.js";import"./shared-b738ee96.js";import"./shared-31b98ac2.js";import"./shared-c5fa5c92.js";import"./shared-cf8e2611.js";import"./shared-c1a3e4fd.js";import"./shared-cb2a2e33.js";import"./shared-c6ce69fc.js";import"./shared-df76d498.js";let z,u,b,$=t=>t;class H extends r{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return h.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(a(z||(z=$` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,m({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(a(u||(u=$` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,m({hidden:this.value!==s}),this.value!==s,s));return a(b||(b=$` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
1
+ import"./shared-00b50480.js";import"./shared-b7889b37.js";import{h as t}from"./shared-944dc1e2.js";import"./shared-f0afd1ee.js";import"./shared-5212ef4f.js";import"./foxy-payment-method-card.js";import"./foxy-update-payment-method-form.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-ef11a60b.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-bb43f0ad.js";import{aH as e,_ as s}from"./shared-d1195c27.js";import{L as r,h as a,c as o}from"./shared-ba5c42c7.js";import{C as i}from"./shared-eeb2bd18.js";import"./shared-256fe764.js";import"./shared-4558cdb4.js";import{z as h,S as d,T as n,a as l}from"./shared-fefaece7.js";import{c as m}from"./shared-4e709717.js";import{S as c}from"./shared-ae4d5fd6.js";import"./shared-e14bc410.js";import{G as v}from"./shared-1563cd85.js";import"./shared-355ef444.js";import"./shared-6524d421.js";import"./shared-421b13a8.js";import"./shared-c3fd2e9c.js";import"./shared-0d757c1c.js";import"./shared-4215bff2.js";import{N as p}from"./shared-d1dfac4d.js";import{S as f}from"./shared-e7b48aaa.js";import{i as g}from"./shared-53e42a77.js";import"./shared-00cd0e86.js";import"./shared-a208ae8c.js";import"./shared-cf613436.js";import"./foxy-nucleon-element.js";import"./shared-7e9fdf64.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-17a61265.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-79f84a95.js";import"./shared-2edce408.js";import"./shared-5cea7ef0.js";import"./shared-188a9c2e.js";import"./shared-15ded782.js";import"./shared-0564def4.js";import"./shared-edb68eb7.js";import"./foxy-copy-to-clipboard.js";import"./shared-56f7db6f.js";import"./shared-bab2ea2c.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-53e476fd.js";import"./foxy-template-set-card.js";import"./shared-e4159eb9.js";import"./shared-0c61b5ce.js";import"./foxy-payment-card-embed.js";import"./shared-9ca85d1e.js";import"./shared-c2efc54e.js";import"./shared-5fd5805c.js";import"./shared-b4b9735c.js";import"./shared-651c44fa.js";import"./shared-a3f1420c.js";import"./shared-c2ca5bee.js";import"./shared-75908858.js";import"./shared-6aa8f7ee.js";import"./shared-a63c89a1.js";import"./shared-1036a0cd.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-47962c3f.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-6042ee79.js";import"./shared-641786b2.js";import"./shared-95339d7a.js";import"./shared-1c6a1571.js";import"./shared-b15d45b1.js";import"./shared-a6b2bd14.js";import"./shared-7ab454fb.js";import"./shared-82614ac9.js";import"./shared-b293a928.js";import"./shared-d0aed1c1.js";import"./shared-b738ee96.js";import"./shared-31b98ac2.js";import"./shared-c5fa5c92.js";import"./shared-cf8e2611.js";import"./shared-c1a3e4fd.js";import"./shared-cb2a2e33.js";import"./shared-c6ce69fc.js";import"./shared-df76d498.js";let z,u,b,$=t=>t;class H extends r{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return h.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(a(z||(z=$` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,m({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(a(u||(u=$` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,m({hidden:this.value!==s}),this.value!==s,s));return a(b||(b=$` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2014 The Polymer Project Authors. All rights reserved.