@foxy.io/elements 1.32.0-beta.1 → 1.32.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-billing-address-card.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +2 -2
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-card.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card-embed.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -64
- package/dist/cdn/foxy-report-form.js +1 -1
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-container-card.js +1 -1
- package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-shipping-service-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-store-card.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +7 -7
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-user-invitation-card.js +1 -1
- package/dist/cdn/foxy-user-invitation-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-8fc527b7.js → shared-011d6240.js} +1 -1
- package/dist/cdn/{shared-c98881c7.js → shared-045bd59c.js} +1 -1
- package/dist/cdn/{shared-e709057b.js → shared-08c637a9.js} +1 -1
- package/dist/cdn/{shared-f893763a.js → shared-08e42e78.js} +1 -1
- package/dist/cdn/{shared-6f0504e2.js → shared-0a24f318.js} +1 -1
- package/dist/cdn/{shared-f67f6fc5.js → shared-0e44bfff.js} +1 -1
- package/dist/cdn/{shared-d3044c4c.js → shared-0f261023.js} +1 -1
- package/dist/cdn/{shared-9092b5db.js → shared-1c169878.js} +1 -1
- package/dist/cdn/{shared-9e360643.js → shared-1cd2db2d.js} +1 -1
- package/dist/cdn/{shared-f998f9c8.js → shared-1cfea4b6.js} +1 -1
- package/dist/cdn/{shared-11694c05.js → shared-24c7c37f.js} +1 -1
- package/dist/cdn/{shared-374e6faa.js → shared-25324930.js} +1 -1
- package/dist/cdn/{shared-c508d5dc.js → shared-26425c01.js} +1 -1
- package/dist/cdn/{shared-6b8c2a83.js → shared-30b4c05b.js} +1 -1
- package/dist/cdn/{shared-c5647b62.js → shared-3491d10e.js} +1 -1
- package/dist/cdn/{shared-40af05b3.js → shared-34c84b9f.js} +1 -1
- package/dist/cdn/{shared-74eedbe6.js → shared-37cf92bd.js} +1 -1
- package/dist/cdn/{shared-aaf72aad.js → shared-3a066450.js} +1 -1
- package/dist/cdn/{shared-185dffc3.js → shared-45bef1ac.js} +1 -1
- package/dist/cdn/{shared-8a3fd383.js → shared-45ecb912.js} +1 -1
- package/dist/cdn/{shared-ca0847b0.js → shared-4a86d1ca.js} +1 -1
- package/dist/cdn/{shared-adcfd50a.js → shared-4d543043.js} +1 -1
- package/dist/cdn/{shared-c4f15ea3.js → shared-4e1b5fa3.js} +1 -1
- package/dist/cdn/{shared-b726120d.js → shared-4efc6bb8.js} +1 -1
- package/dist/cdn/{shared-acd33590.js → shared-51bb937b.js} +1 -1
- package/dist/cdn/{shared-1a30f25e.js → shared-537d2efe.js} +1 -1
- package/dist/cdn/{shared-f8368b97.js → shared-55bc51c8.js} +1 -1
- package/dist/cdn/{shared-2bc0d0cd.js → shared-56d1eae5.js} +1 -1
- package/dist/cdn/{shared-c9346893.js → shared-57cc81b4.js} +1 -1
- package/dist/cdn/{shared-f5547471.js → shared-5ff1affd.js} +1 -1
- package/dist/cdn/shared-620dccaa.js +1 -0
- package/dist/cdn/{shared-4903b2e3.js → shared-64d9ac2a.js} +1 -1
- package/dist/cdn/shared-73c1d31e.js +1 -0
- package/dist/cdn/{shared-df51ee50.js → shared-783f6e58.js} +1 -1
- package/dist/cdn/{shared-193bb806.js → shared-787e52c4.js} +1 -1
- package/dist/cdn/{shared-5c35d93a.js → shared-838cc86b.js} +1 -1
- package/dist/cdn/{shared-92192fe1.js → shared-85989cf3.js} +1 -1
- package/dist/cdn/{shared-65479601.js → shared-8a8bfd72.js} +1 -1
- package/dist/cdn/{shared-7c15c149.js → shared-8b9ae780.js} +1 -1
- package/dist/cdn/{shared-482ba043.js → shared-8f3fdf8b.js} +5 -5
- package/dist/cdn/{shared-9a59aab2.js → shared-906fe068.js} +1 -1
- package/dist/cdn/{shared-15100be0.js → shared-91560256.js} +1 -1
- package/dist/cdn/{shared-2e090291.js → shared-9411a937.js} +1 -1
- package/dist/cdn/{shared-d4a1658e.js → shared-978aaaf2.js} +1 -1
- package/dist/cdn/shared-97e1f413.js +1 -0
- package/dist/cdn/{shared-97cfdcdb.js → shared-9de0a899.js} +1 -1
- package/dist/cdn/{shared-8b5e05df.js → shared-9e94c56d.js} +1 -1
- package/dist/cdn/{shared-19df2a73.js → shared-9ef03974.js} +1 -1
- package/dist/cdn/{shared-bc023a29.js → shared-a4b0ccf4.js} +1 -1
- package/dist/cdn/{shared-8a73d1aa.js → shared-ac6e1790.js} +1 -1
- package/dist/cdn/{shared-60209b2d.js → shared-b6ab5711.js} +1 -1
- package/dist/cdn/{shared-745f340a.js → shared-b74187e9.js} +1 -1
- package/dist/cdn/{shared-c538157f.js → shared-be093279.js} +1 -1
- package/dist/cdn/{shared-86a9b27a.js → shared-c40a4b0c.js} +1 -1
- package/dist/cdn/{shared-5c846a3b.js → shared-c6b69d4e.js} +1 -1
- package/dist/cdn/{shared-8da3186f.js → shared-c7ffb9f2.js} +2 -2
- package/dist/cdn/{shared-28ebee50.js → shared-c89f7ad5.js} +1 -1
- package/dist/cdn/{shared-239062b0.js → shared-c9f3f8d3.js} +1 -1
- package/dist/cdn/{shared-addddf0e.js → shared-d713c00f.js} +1 -1
- package/dist/cdn/{shared-562d466d.js → shared-d8cd61ed.js} +1 -1
- package/dist/cdn/{shared-7ceceb4c.js → shared-de45ad84.js} +1 -1
- package/dist/cdn/{shared-5513e830.js → shared-e1850e5f.js} +1 -1
- package/dist/cdn/{shared-6e1b5baf.js → shared-e3647540.js} +1 -1
- package/dist/cdn/{shared-9d309e97.js → shared-ed9c9bab.js} +1 -1
- package/dist/cdn/{shared-dfe41029.js → shared-eff5dcb0.js} +1 -1
- package/dist/cdn/{shared-913e1955.js → shared-f0d70be1.js} +1 -1
- package/dist/cdn/shared-f1b29592.js +64 -0
- package/dist/cdn/{shared-91d8985f.js → shared-f97ed2ff.js} +1 -1
- package/dist/cdn/translations/cart-form/en.json +79 -68
- package/dist/cdn/translations/coupon-form/en.json +8 -52
- package/dist/elements/internal/InternalArrayMapControl/InternalArrayMapControl.d.ts +12 -0
- package/dist/elements/internal/InternalArrayMapControl/InternalArrayMapControl.js +277 -0
- package/dist/elements/internal/InternalArrayMapControl/InternalArrayMapControl.js.map +1 -0
- package/dist/elements/internal/InternalArrayMapControl/index.d.ts +4 -0
- package/dist/elements/internal/InternalArrayMapControl/index.js +6 -0
- package/dist/elements/internal/InternalArrayMapControl/index.js.map +1 -0
- package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.d.ts +3 -0
- package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js +51 -16
- package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js.map +1 -1
- package/dist/elements/internal/InternalResourcePickerControl/index.d.ts +2 -0
- package/dist/elements/internal/InternalResourcePickerControl/index.js +2 -0
- package/dist/elements/internal/InternalResourcePickerControl/index.js.map +1 -1
- package/dist/elements/public/CartForm/CartForm.d.ts +2 -0
- package/dist/elements/public/CartForm/CartForm.js +15 -11
- package/dist/elements/public/CartForm/CartForm.js.map +1 -1
- package/dist/elements/public/CopyToClipboard/CopyToClipboard.d.ts +7 -1
- package/dist/elements/public/CopyToClipboard/CopyToClipboard.js +60 -30
- package/dist/elements/public/CopyToClipboard/CopyToClipboard.js.map +1 -1
- package/dist/elements/public/CouponForm/CouponForm.d.ts +2 -3
- package/dist/elements/public/CouponForm/CouponForm.js +51 -25
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/CouponForm/index.d.ts +1 -0
- package/dist/elements/public/CouponForm/index.js +1 -0
- package/dist/elements/public/CouponForm/index.js.map +1 -1
- package/dist/elements/public/QueryBuilder/utils/parse.js +3 -1
- package/dist/elements/public/QueryBuilder/utils/parse.js.map +1 -1
- package/dist/elements/public/QueryBuilder/utils/stringify.js +10 -3
- package/dist/elements/public/QueryBuilder/utils/stringify.js.map +1 -1
- package/dist/elements/public/Transaction/index.d.ts +1 -0
- package/dist/elements/public/Transaction/index.js +1 -0
- package/dist/elements/public/Transaction/index.js.map +1 -1
- package/dist/mixins/themeable.js +4 -0
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-492da078.js +0 -1
- package/dist/cdn/shared-5e09e162.js +0 -1
- package/dist/cdn/shared-7275324b.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-97e1f413.js";import"./foxy-nucleon-element.js";import"./shared-51bb937b.js";import{_ as e}from"./shared-d1195c27.js";import{a as t}from"./shared-4efc6bb8.js";import{I as s}from"./shared-9ef03974.js";import{i as r}from"./shared-9803aa7c.js";import{h as i}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-e1850e5f.js";import"./shared-4d543043.js";import"./shared-64d9ac2a.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let o,a=e=>e;const h=t(s,"shipping-method-card");class d extends h{constructor(){super(...arguments),this.storeShippingMethods=null,this.getImageSrc=null,this.__storeShippingMethodsLoaderId="storeShippingMethods"}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' fill='none' viewBox='0 0 40 40'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill='%23E8E8E8' d='M0 0h40v40H0z'/%3E%3Cpath fill='%23fff' d='M0 14.81V7.88L7.88 0h6.93L0 14.81ZM0 0h6.47L0 6.47V0Zm16.22 0L0 16.22v6.93l9-9V14c0-.55.2-1.02.59-1.41.39-.4.86-.59 1.41-.59h.15l12-12h-6.93ZM9 15.57l-9 9v6.93l9-9v-6.93Zm.15 8.19L0 32.91v6.93l12.33-12.33a3.28 3.28 0 0 1-.46-.39A2.9 2.9 0 0 1 11 25c-.55 0-1.02-.2-1.41-.59a2 2 0 0 1-.44-.65Zm4.17 4.17L1.26 40h6.92L23 25.18V25h-6c0 .83-.3 1.54-.88 2.13A2.9 2.9 0 0 1 14 28a3.2 3.2 0 0 1-.68-.07Zm11.85-3.5.26-.26A.98.98 0 0 1 26 24c.28 0 .52.1.71.29.2.19.29.43.29.71 0 .28-.1.52-.29.71A.94.94 0 0 1 26 26a.97.97 0 0 1-.71-.29A.97.97 0 0 1 25 25a1 1 0 0 1 .17-.57Z'/%3E%3Cpath fill='%23fff' d='M23.29 26.31 9.59 40h6.94L40 16.53V9.6l-9.6 9.6.4.53c.07.08.12.17.15.27s.05.2.05.32V24c0 .28-.1.52-.29.71A.94.94 0 0 1 30 25h-1c0 .83-.3 1.54-.88 2.13A2.9 2.9 0 0 1 26 28a3 3 0 0 1-2.71-1.69Zm6.51-7.92L40 8.19V1.25L25.26 16h2.24a1 1 0 0 1 .45.1 1 1 0 0 1 .35.3l1.5 1.99ZM25 14.84 39.84 0h-6.93l-12 12H23c.55 0 1.02.2 1.41.59.4.39.59.86.59 1.41v.84ZM19.5 12l12-12h-6.93l-12 12h6.93Zm-1.56 28L40 17.94v6.93L24.87 40h-6.93ZM40 26.29 26.29 40h6.93L40 33.22v-6.93ZM34.63 40 40 34.63V40h-5.37ZM13 25c0 .28.1.52.29.71.19.2.43.29.71.29.28 0 .52-.1.71-.29.2-.19.29-.43.29-.71 0-.28-.1-.52-.29-.71A.97.97 0 0 0 14 24c-.07 0-.14 0-.2.02a.95.95 0 0 0-.51.27.95.95 0 0 0-.29.71Z'/%3E%3Cpath fill='%23fff' d='M25 18v3h4.21l-.85-1.18-.68-.91L27 18h-2Z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h40v40H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E"}static get properties(){return e(e({},super.properties),{},{storeShippingMethods:{attribute:"store-shipping-methods"},getImageSrc:{attribute:!1}})}renderBody(){var e,t,s;const h=d.defaultImageSrc,p=1===(null===(e=this.__storeShippingMethodsItems)||void 0===e?void 0:e.length),l=this.data;return i(o||(o=a` <figure class="flex" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <img class="relative h-s w-s object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="${0}" @error="${0}"> <figcaption class="min-w-0 flex-1 leading-xs -my-xs"> <p class="text-m truncate text-body font-medium">${0}</p> <p class="text-s truncate text-secondary"> <foxy-i18n infer="" key="${0}"></foxy-i18n> </p> </figcaption> </figure> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),null!==(s=l?null===(t=this.getImageSrc)||void 0===t?void 0:t.call(this,l.code):null)&&void 0!==s?s:h,this.t("image_alt"),(e=>e.currentTarget.src=h),null==l?void 0:l.name,p?"status_active":"status_inactive",r(this.__storeShippingMethodsHref),this.__storeShippingMethodsLoaderId,(()=>this.requestUpdate()))}get isBodyReady(){return!!super.isBodyReady&&(!this.storeShippingMethods||!!this.__storeShippingMethodsItems)}get __storeShippingMethodsHref(){try{const e=new URL(this.storeShippingMethods);return e.searchParams.set("shipping_method_id",this.href.split("/").pop()),e.searchParams.set("limit","1"),e.toString()}catch(e){}}get __storeShippingMethodsLoader(){return this.renderRoot.querySelector(`#${this.__storeShippingMethodsLoaderId}`)}get __storeShippingMethodsItems(){var e,t;return null===(t=null===(e=this.__storeShippingMethodsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t._embedded["fx:store_shipping_methods"]}}customElements.define("foxy-shipping-method-card",d);export{d as ShippingMethodCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-51c4a6dd.js";import"./shared-
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./shared-97e1f413.js";import"./shared-51bb937b.js";import{a as r}from"./shared-4efc6bb8.js";import{T as s}from"./shared-0f261023.js";import{h as e}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-e1850e5f.js";import"./shared-4d543043.js";import"./shared-64d9ac2a.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-9ef03974.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";let d,a,i=r=>r;const o=r(s,"shipping-service-card");class t extends o{renderBody(){return super.renderBody({title:r=>e(d||(d=i`${0}`),r.name),subtitle:r=>e(a||(a=i` <foxy-i18n infer="" key="subtitle" .options="${0}"> </foxy-i18n> `),{context:r.is_international?"international_only":"",code:r.code})})}}customElements.define("foxy-shipping-service-card",t);export{t as ShippingServiceCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-e709057b.js";import"./shared-8b5e05df.js";import"./shared-9e360643.js";import"./shared-6f0504e2.js";import"./shared-239062b0.js";import"./shared-f998f9c8.js";import"./shared-5513e830.js";import"./shared-c4f15ea3.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-acd33590.js";import{_ as e}from"./shared-d1195c27.js";import{h as t}from"./shared-dc73b9a5.js";import{C as r}from"./shared-d1cb97c6.js";import{N as i}from"./shared-2ad18636.js";import{T as o,a as n}from"./shared-b726120d.js";import{c as a}from"./shared-4e709717.js";import{i as s}from"./shared-9803aa7c.js";import{v as d}from"./shared-b738ee96.js";import"./shared-adcfd50a.js";import"./shared-7ceceb4c.js";import"./shared-8fc527b7.js";import"./shared-562d466d.js";import"./shared-61ade33e.js";import"./shared-65479601.js";import"./shared-4903b2e3.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";!function(e){var t={};function r(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(i,o,function(t){return e[t]}.bind(null,o));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){var i,o;void 0===(o="function"==typeof(i=function(){for(var e=[null,[[10,7,17,13],[1,1,1,1],[]],[[16,10,28,22],[1,1,1,1],[4,16]],[[26,15,22,18],[1,1,2,2],[4,20]],[[18,20,16,26],[2,1,4,2],[4,24]],[[24,26,22,18],[2,1,4,4],[4,28]],[[16,18,28,24],[4,2,4,4],[4,32]],[[18,20,26,18],[4,2,5,6],[4,20,36]],[[22,24,26,22],[4,2,6,6],[4,22,40]],[[22,30,24,20],[5,2,8,8],[4,24,44]],[[26,18,28,24],[5,4,8,8],[4,26,48]],[[30,20,24,28],[5,4,11,8],[4,28,52]],[[22,24,28,26],[8,4,11,10],[4,30,56]],[[22,26,22,24],[9,4,16,12],[4,32,60]],[[24,30,24,20],[9,4,16,16],[4,24,44,64]],[[24,22,24,30],[10,6,18,12],[4,24,46,68]],[[28,24,30,24],[10,6,16,17],[4,24,48,72]],[[28,28,28,28],[11,6,19,16],[4,28,52,76]],[[26,30,28,28],[13,6,21,18],[4,28,54,80]],[[26,28,26,26],[14,7,25,21],[4,28,56,84]],[[26,28,28,30],[16,8,25,20],[4,32,60,88]],[[26,28,30,28],[17,8,25,23],[4,26,48,70,92]],[[28,28,24,30],[17,9,34,23],[4,24,48,72,96]],[[28,30,30,30],[18,9,30,25],[4,28,52,76,100]],[[28,30,30,30],[20,10,32,27],[4,26,52,78,104]],[[28,26,30,30],[21,12,35,29],[4,30,56,82,108]],[[28,28,30,28],[23,12,37,34],[4,28,56,84,112]],[[28,30,30,30],[25,12,40,34],[4,32,60,88,116]],[[28,30,30,30],[26,13,42,35],[4,24,48,72,96,120]],[[28,30,30,30],[28,14,45,38],[4,28,52,76,100,124]],[[28,30,30,30],[29,15,48,40],[4,24,50,76,102,128]],[[28,30,30,30],[31,16,51,43],[4,28,54,80,106,132]],[[28,30,30,30],[33,17,54,45],[4,32,58,84,110,136]],[[28,30,30,30],[35,18,57,48],[4,28,56,84,112,140]],[[28,30,30,30],[37,19,60,51],[4,32,60,88,116,144]],[[28,30,30,30],[38,19,63,53],[4,28,52,76,100,124,148]],[[28,30,30,30],[40,20,66,56],[4,22,48,74,100,126,152]],[[28,30,30,30],[43,21,70,59],[4,26,52,78,104,130,156]],[[28,30,30,30],[45,22,74,62],[4,30,56,82,108,134,160]],[[28,30,30,30],[47,24,77,65],[4,24,52,80,108,136,164]],[[28,30,30,30],[49,25,81,68],[4,28,56,84,112,140,168]]],t=/^\d*$/,r=/^[A-Za-z0-9 $%*+\-./:]*$/,i=/^[A-Z0-9 $%*+\-./:]*$/,o=[],n=[-1],a=0,s=1;a<255;++a)o.push(s),n[s]=a,s=2*s^(s>=128?285:0);var d=[[]];for(a=0;a<30;++a){for(var l=d[a],u=[],c=0;c<=a;++c){var f=c<a?o[l[c]]:0,h=o[(a+(l[c-1]||0))%255];u.push(n[f^h])}d.push(u)}var p={};for(a=0;a<45;++a)p["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".charAt(a)]=a;var m=[function(e,t){return(e+t)%2==0},function(e,t){return e%2==0},function(e,t){return t%3==0},function(e,t){return(e+t)%3==0},function(e,t){return((e/2|0)+(t/3|0))%2==0},function(e,t){return e*t%2+e*t%3==0},function(e,t){return(e*t%2+e*t%3)%2==0},function(e,t){return((e+t)%2+e*t%3)%2==0}],v=function(e){return e>6},b=function(t,r){var i=-8&function(t){var r=e[t],i=16*t*t+128*t+64;return v(t)&&(i-=36),r[2].length&&(i-=25*r[2].length*r[2].length-10*r[2].length-55),i}(t),o=e[t];return i-8*o[0][r]*o[1][r]},g=function(e,t){switch(t){case 1:return e<10?10:e<27?12:14;case 2:return e<10?9:e<27?11:13;case 4:return e<10?8:16;case 8:return e<10?8:e<27?10:12}},y=function(e,t,r){var i=b(e,r)-4-g(e,t);switch(t){case 1:return 3*(i/10|0)+(i%10<4?0:i%10<7?1:2);case 2:return 2*(i/11|0)+(i%11<6?0:1);case 4:return i/8|0;case 8:return i/13|0}},_=function(e,t){for(var r=e.slice(0),i=e.length,a=t.length,s=0;s<a;++s)r.push(0);for(s=0;s<i;){var d=n[r[s++]];if(d>=0)for(var l=0;l<a;++l)r[s+l]^=o[(d+t[l])%255]}return r.slice(i)},w=function(e,t,r,i){for(var o=e<<i,n=t-1;n>=0;--n)o>>i+n&1&&(o^=r<<n);return e<<i|o},$=function(e,t,r){for(var i=m[r],o=e.length,n=0;n<o;++n)for(var a=0;a<o;++a)t[n][a]||(e[n][a]^=i(n,a));return e},S=function(e,t,r,i){for(var o=e.length,n=21522^w(r<<3|i,5,1335,10),a=0;a<15;++a){var s=[o-1,o-2,o-3,o-4,o-5,o-6,o-7,o-8,7,5,4,3,2,1,0][a];e[[0,1,2,3,4,5,7,8,o-7,o-6,o-5,o-4,o-3,o-2,o-1][a]][8]=e[8][s]=n>>a&1}return e},x=function(e){for(var t=function(e){for(var t=0,r=0;r<e.length;++r)e[r]>=5&&(t+=e[r]-5+3);for(r=5;r<e.length;r+=2){var i=e[r];e[r-1]==i&&e[r-2]==3*i&&e[r-3]==i&&e[r-4]==i&&(e[r-5]>=4*i||e[r+1]>=4*i)&&(t+=40)}return t},r=e.length,i=0,o=0,n=0;n<r;++n){var a,s=e[n];a=[0];for(var d=0;d<r;){for(l=0;d<r&&s[d];++l)++d;for(a.push(l),l=0;d<r&&!s[d];++l)++d;a.push(l)}for(i+=t(a),a=[0],d=0;d<r;){var l;for(l=0;d<r&&e[d][n];++l)++d;for(a.push(l),l=0;d<r&&!e[d][n];++l)++d;a.push(l)}i+=t(a);var u=e[n+1]||[];for(o+=s[0],d=1;d<r;++d){var c=s[d];o+=c,s[d-1]==c&&u[d]===c&&u[d-1]===c&&(i+=3)}}return i+10*(Math.abs(o/r/r-.5)/.05|0)},j=function(t,r,i,o,n){var a=e[r],s=function(e,t,r,i){var o=[],n=0,a=8,s=r.length,d=function(e,t){if(t>=a){for(o.push(n|e>>(t-=a));t>=8;)o.push(e>>(t-=8)&255);n=0,a=8}t>0&&(n|=(e&(1<<t)-1)<<(a-=t))},l=g(e,t);switch(d(t,4),d(s,l),t){case 1:for(var u=2;u<s;u+=3)d(parseInt(r.substring(u-2,u+1),10),10);d(parseInt(r.substring(u-2),10),[0,4,7][s%3]);break;case 2:for(u=1;u<s;u+=2)d(45*p[r.charAt(u-1)]+p[r.charAt(u)],11);s%2==1&&d(p[r.charAt(u-1)],6);break;case 4:for(u=0;u<s;++u)d(r[u],8)}for(d(0,4),a<8&&o.push(n);o.length+1<i;)o.push(236,17);return o.length<i&&o.push(236),o}(r,i,t,b(r,o)>>3);s=function(e,t,r){for(var i=[],o=e.length/t|0,n=0,a=t-e.length%t,s=0;s<a;++s)i.push(n),n+=o;for(s=a;s<t;++s)i.push(n),n+=o+1;i.push(n);var d=[];for(s=0;s<t;++s)d.push(_(e.slice(i[s],i[s+1]),r));var l=[],u=e.length/t|0;for(s=0;s<u;++s)for(var c=0;c<t;++c)l.push(e[i[c]+s]);for(c=a;c<t;++c)l.push(e[i[c+1]-1]);for(s=0;s<r.length;++s)for(c=0;c<t;++c)l.push(d[c][s]);return l}(s,a[1][o],d[a[0][o]]);var l=function(t){for(var r=e[t],i=function(e){return 4*e+17}(t),o=[],n=[],a=0;a<i;++a)o.push([]),n.push([]);var s=function(e,t,r,i,a){for(var s=0;s<r;++s)for(var d=0;d<i;++d)o[e+s][t+d]=a[s]>>d&1,n[e+s][t+d]=1};for(s(0,0,9,9,[127,65,93,93,93,65,383,0,64]),s(i-8,0,8,9,[256,127,65,93,93,93,65,127]),s(0,i-8,9,8,[254,130,186,186,186,130,254,0,0]),a=9;a<i-8;++a)o[6][a]=o[a][6]=1&~a,n[6][a]=n[a][6]=1;var d=r[2],l=d.length;for(a=0;a<l;++a)for(var u=0==a?l-1:l,c=0==a||a==l-1?1:0;c<u;++c)s(d[a],d[c],5,5,[31,17,21,17,31]);if(v(t)){var f=w(t,6,7973,12),h=0;for(a=0;a<6;++a)for(c=0;c<3;++c)o[a][i-11+c]=o[i-11+c][a]=f>>h++&1,n[a][i-11+c]=n[i-11+c][a]=1}return{matrix:o,reserved:n}}(r),u=l.matrix,c=l.reserved;if(function(e,t,r){for(var i=e.length,o=0,n=-1,a=i-1;a>=0;a-=2){6==a&&--a;for(var s=n<0?i-1:0,d=0;d<i;++d){for(var l=a;l>a-2;--l)t[s][l]||(e[s][l]=r[o>>3]>>(7&~o)&1,++o);s+=n}n=-n}}(u,c,s),n<0){$(u,c,0),S(u,0,o,0);var f=0,h=x(u);for($(u,c,0),n=1;n<8;++n){$(u,c,n),S(u,0,o,n);var m=x(u);h>m&&(h=m,f=n),$(u,c,n)}n=f}return $(u,c,n),S(u,0,o,n),u},k={generate:function(e,o){var n=(o=o||{}).version||-1,a={L:1,M:0,Q:3,H:2}[(o.ecclevel||"L").toUpperCase()],s=o.mode?{numeric:1,alphanumeric:2,octet:4}[o.mode.toLowerCase()]:-1,d="mask"in o?o.mask:-1;if(s<0)s="string"==typeof e?e.match(t)?1:e.match(i)?2:4:4;else if(1!=s&&2!=s&&4!=s)throw"invalid or unsupported mode";if(null===(e=function(e,i){switch(e){case 1:return i.match(t)?i:null;case 2:return i.match(r)?i.toUpperCase():null;case 4:if("string"==typeof i){for(var o=[],n=0;n<i.length;++n){var a=i.charCodeAt(n);a<128?o.push(a):a<2048?o.push(192|a>>6,128|63&a):a<65536?o.push(224|a>>12,128|a>>6&63,128|63&a):o.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|63&a)}return o}return i}}(s,e)))throw"invalid data format";if(a<0||a>3)throw"invalid ECC level";if(n<0){for(n=1;n<=40&&!(e.length<=y(n,s,a));++n);if(n>40)throw"too large data"}else if(n<1||n>40)throw"invalid version";if(-1!=d&&(d<0||d>8))throw"invalid mask";return j(e,n,s,a,d)},generateHTML:function(e,t){t=t||{};for(var r=k.generate(e,t),i=Math.max(t.modulesize||5,.5),o=t.unit||"px",n=t.ratio||1,a=Math.max(null!==t.margin?t.margin:4,0),s=document.createElement("div"),d=r.length,l=['<table border="0" cellspacing="0" cellpadding="0" style="border:'+i*a+'px solid #fff;background:#fff">'],u=0;u<d;++u){l.push("<tr>");for(var c=0;c<d;++c){const e="px"!==o?"width:"+i*n+o+"; height:"+i*n+o:"width:"+i+"px;height:"+i+"px";console.log("generateHTML",{unit:o,ratio:n,modsize:i,size:e}),l.push('<td style="'+e+(r[u][c]?";background:#000":"")+'" part="'+(r[u][c]?"module-fg":"module-bg")+'" ></td>')}l.push("</tr>")}return s.className="qrcode",s.innerHTML=l.join("")+"</table>",s},generateSVG:function(e,t){t=t||{};var r=k.generate(e,t),i=r.length,o=Math.max(t.modulesize||5,.5),n=Math.max(null!==t.margin?t.margin:4,0),a=o*(i+2*n),s=' class= "fg" width="'+o+'" height="'+o+'"/>',d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttribute("viewBox","0 0 "+a+" "+a),d.setAttribute("style","shape-rendering:crispEdges"),t.modulesize&&(d.setAttribute("width",a),d.setAttribute("height",a));for(var l=["<style scoped>.bg{fill:#FFF}.fg{fill:#000}</style>",'<rect class="bg" x="0" y="0"','width="'+a+'" height="'+a+'"/>'],u=n*o,c=0;c<i;++c){for(var f=n*o,h=0;h<i;++h)r[c][h]&&l.push('<rect x="'+f+'" y="'+u+'"',s),f+=o;u+=o}return d.innerHTML=l.join(""),d},generatePNG:function(e,t){t=t||{};var r,i=k.generate(e,t),o=Math.max(t.modulesize||5,.5),n=Math.max(null!==t.margin?t.margin:4,0),a=i.length,s=o*(a+2*n),d=document.createElement("canvas");if(d.width=d.height=s,!(r=d.getContext("2d")))throw"canvas support is needed for PNG output";r.fillStyle="#fff",r.fillRect(0,0,s,s),r.fillStyle="#000";for(var l=0;l<a;++l)for(var u=0;u<a;++u)i[l][u]&&r.fillRect(o*(n+u),o*(n+l),o,o);return d.toDataURL()}};return k})?i.apply(t,[]):i)||(e.exports=o)},function(e,t,r){r.r(t);var i=r(0),o=r.n(i);function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===n(o)?o:String(o)),i)}var o}function s(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return u(e,arguments,h(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),f(i,e)})(e)}function u(e,t,r){return(u=c()?Reflect.construct.bind():function(e,t,r){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return r&&f(o,r.prototype),o}).apply(null,arguments)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(p,e);var t,r,i,n,l,u=(t=p,r=c(),function(){var e,i=h(t);if(r){var o=h(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return s(this,e)});function p(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),(e=u.call(this))._defineProperty=e._defineProperty.bind(d(e)),e.attachShadow({mode:"open"}),Object.keys(p.defaultAttributes).map(e._defineProperty),e}return i=p,l=[{key:"defaultAttributes",get:function(){return{data:null,format:"png",modulesize:5,margin:4,unit:"px",ratio:1}}},{key:"observedAttributes",get:function(){return Object.keys(p.defaultAttributes)}}],(n=[{key:"attributeChangedCallback",value:function(e,t,r){var i=this[e+"Changed"];i&&"function"==typeof i&&i.call(this,t,r),this.generate()}},{key:"_defineProperty",value:function(e){var t=this;Object.defineProperty(this,e,{get:function(){var r=t.getAttribute(e);return null===r?p.defaultAttributes[e]:r},set:function(r){t.setAttribute(e,r)}})}},{key:"getOptions",value:function(){var e=this.modulesize,t=this.margin,r=this.unit,i=this.ratio;return{margin:null!==t?parseInt(t):t,modulesize:null!==e?parseInt(e):e,unit:r||"px",ratio:i||1}}},{key:"generate",value:function(){try{this.clear(),null!==this.data?"png"===this.format?this.generatePNG():"html"===this.format?this.generateHTML():"svg"===this.format?this.generateSVG():this.shadowRoot.textContent="qr-code: ".concat(this.format," not supported!"):this.shadowRoot.textContent="qr-code: no data!"}catch(e){console.error(e),this.shadowRoot.textContent="qr-code: error!"}}},{key:"generatePNG",value:function(){var e=document.createElement("img");e.src=o.a.generatePNG(this.data,this.getOptions()),e.setAttribute("part","img"),this.shadowRoot.appendChild(e)}},{key:"generateHTML",value:function(){var e=o.a.generateHTML(this.data,this.getOptions()).firstChild;e.setAttribute("part","table"),this.shadowRoot.appendChild(e)}},{key:"generateSVG",value:function(){var e=o.a.generateSVG(this.data,this.getOptions());e.setAttribute("part","svg"),this.shadowRoot.appendChild(e)}},{key:"clear",value:function(){for(;this.shadowRoot.lastChild;)this.shadowRoot.removeChild(this.shadowRoot.lastChild)}}])&&a(i.prototype,n),l&&a(i,l),Object.defineProperty(i,"prototype",{writable:!1}),p}(l(HTMLElement));customElements.get("qr-code")||customElements.define("qr-code",p)}]);let l,u,c,f,h,p,m,v,b,g=e=>e;const y=o(r(n(i,"sign-in-form")));class _ extends y{constructor(){super(...arguments),this.issuer="Unknown",this.__emailValidator=()=>!this.errors.some((e=>e.startsWith("email"))),this.__passwordValidator=()=>!this.errors.some((e=>e.startsWith("password"))),this.__newPasswordValidator=()=>!this.errors.some((e=>e.startsWith("new_password")&&!e.endsWith("_error"))),this.__mfaTotpCodeValidator=()=>!this.errors.some((e=>e.startsWith("mfa_totp_code")&&!e.endsWith("_error"))),this.__renderEmail=()=>{var e;const{disabledSelector:r,readonlySelector:i,errors:o}=this,n=o.find((e=>e.startsWith("email"))),a=null==n?void 0:n.replace("email","v8n"),d=a?this.t(a).toString():"",u=this.in("busy");return t(l||(l=g` <div> ${0} <vaadin-email-field error-message="${0}" data-testid="email" class="w-full mb-m" label="${0}" value="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" @keydown="${0}" @input="${0}"> </vaadin-email-field> ${0} </div> `),this.renderTemplateOrSlot("email:before"),d,this.t("email").toString(),s(null===(e=this.form.credential)||void 0===e?void 0:e.email),u||r.matches("email",!0),i.matches("email",!0),this.__emailValidator,(e=>"Enter"===e.key&&this.submit()),(e=>{var t,r;const i=e.target.value,o=null!==(r=null===(t=this.form.credential)||void 0===t?void 0:t.password)&&void 0!==r?r:"";this.edit({credential:{email:i,password:o},type:"password"})}),this.renderTemplateOrSlot("email:after"))},this.__renderPassword=()=>{var e;const{disabledSelector:r,readonlySelector:i,errors:o}=this,n=o.find((e=>e.startsWith("password"))),a=null==n?void 0:n.replace("password","v8n"),d=a?this.t(a).toString():"",l=this.in("busy");return t(u||(u=g` <div> ${0} <vaadin-password-field error-message="${0}" data-testid="password" class="w-full mb-m" label="${0}" value="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" @keydown="${0}" @input="${0}"> </vaadin-password-field> ${0} </div> `),this.renderTemplateOrSlot("password:before"),d,this.t("password").toString(),s(null===(e=this.form.credential)||void 0===e?void 0:e.password),l||r.matches("password",!0),i.matches("password",!0),this.__passwordValidator,(e=>"Enter"===e.key&&this.submit()),(e=>{var t,r;const i=null!==(r=null===(t=this.form.credential)||void 0===t?void 0:t.email)&&void 0!==r?r:"",o=e.target.value;this.edit({credential:{email:i,password:o},type:"password"})}),this.renderTemplateOrSlot("password:after"))},this.__renderNewPassword=()=>{var e;const{disabledSelector:r,readonlySelector:i,errors:o}=this,n=o.find((e=>e.startsWith("new_password")&&!e.endsWith("_error"))),a=null==n?void 0:n.replace("new_password","v8n"),d=a?this.t(a).toString():"",l=this.in("busy");return t(c||(c=g` <div> ${0} <vaadin-password-field error-message="${0}" data-testid="new-password" class="w-full mb-m" label="${0}" value="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" @keydown="${0}" @input="${0}"> </vaadin-password-field> ${0} </div> `),this.renderTemplateOrSlot("new-password:before"),d,this.t("new_password").toString(),s(null===(e=this.form.credential)||void 0===e?void 0:e.new_password),l||r.matches("new-password",!0),i.matches("new-password",!0),this.__newPasswordValidator,(e=>"Enter"===e.key&&this.submit()),(e=>{var t,r,i,o;this.edit({type:"password",credential:{email:null!==(r=null===(t=this.form.credential)||void 0===t?void 0:t.email)&&void 0!==r?r:"",password:null!==(o=null===(i=this.form.credential)||void 0===i?void 0:i.password)&&void 0!==o?o:"",new_password:e.target.value}})}),this.renderTemplateOrSlot("new-password:after"))},this.__renderMfaTotpCode=()=>{var r;const{disabledSelector:i,readonlySelector:o,errors:n}=this,a=this.__mfaSecretCode,d="mfa_totp_code",l="mfa-totp-code",u=n.find((e=>e.startsWith(d)&&!e.endsWith("_error"))),c=null==u?void 0:u.replace(d,"v8n"),h=c?this.t(c).toString():"",p=this.in("busy");return t(f||(f=g` <div> ${0} <vaadin-text-field error-message="${0}" helper-text="${0}" placeholder="123456" data-testid="${0}" class="w-full mb-m" label="${0}" value="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" autofocus @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${l}:before`),h,a?this.t("mfa_totp_code_hint"):"",l,this.t(d).toString(),s(null===(r=this.form.credential)||void 0===r?void 0:r.mfa_totp_code),p||i.matches(l,!0),o.matches(l,!0),this.__mfaTotpCodeValidator,(e=>"Enter"===e.key&&this.submit()),(t=>{const r=t.target.value,i=e(e({},this.form.credential),{},{mfa_totp_code:r});a&&(i.mfa_secret_code=a),this.edit({type:"password",credential:i})}),this.renderTemplateOrSlot(`${l}:after`))},this.__renderMfaSecretCode=()=>{var e,r;const i="mfa-secret-code",o=this.__mfaSecretCode,n=encodeURIComponent(this.issuer),a=encodeURIComponent(null!==(r=null===(e=this.form.credential)||void 0===e?void 0:e.email)&&void 0!==r?r:""),s=new URL(`otpauth://totp/${n}:${a}`);return s.searchParams.set("secret",o),s.searchParams.set("issuer",this.issuer),t(h||(h=g` <div> ${0} <div data-testid="${0}" class="flex space-x-m overflow-hidden rounded border p-m mb-m border-contrast-10" style="background:#fff;color:#000"> <qr-code modulesize="2" margin="0" format="svg" class="inline-flex" data="${0}"> </qr-code> <div class="break-all font-medium leading-s text-xs tracking-widest"> ${0} </div> </div> ${0} </div> `),this.renderTemplateOrSlot(`${i}:before`),i,s.toString(),o,this.renderTemplateOrSlot(`${i}:after`))},this.__renderMfaRememberDevice=()=>{var r;const{__mfaSecretCode:i,form:o,lang:n,ns:a}=this,s="mfa-remember-device",d=this.in("busy")||this.disabledSelector.matches(s,!0);return t(p||(p=g` <div> ${0} <vaadin-checkbox data-testid="${0}" class="mb-m" ?disabled="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block" lang="${0}" key="mfa_remember_device" ns="${0}"></foxy-i18n> <foxy-i18n class="block text-xs ${0}" lang="${0}" key="mfa_remember_device_hint" ns="${0}"> </foxy-i18n> </vaadin-checkbox> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),s,d,!!(null===(r=o.credential)||void 0===r?void 0:r.mfa_remember_device),(t=>{var r,n;const a=t.currentTarget,s=e(e({},o.credential),{},{mfa_remember_device:a.checked,mfa_totp_code:null!==(n=null===(r=o.credential)||void 0===r?void 0:r.mfa_totp_code)&&void 0!==n?n:""});i&&(s.mfa_secret_code=i),this.edit({credential:s})}),n,a,d?"text-disabled":"text-secondary",n,a,this.renderTemplateOrSlot(`${s}:after`))},this.__renderError=()=>t(m||(m=g` <div> ${0} <p class="leading-s flex items-start text-s rounded p-s bg-error-10 text-error"> <iron-icon class="flex-shrink-0 mr-s icon-inline text-l" icon="lumo:error"></iron-icon> <foxy-i18n data-testid="error" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </p> ${0} </div> `),this.renderTemplateOrSlot("error:before"),this.lang,this.errors[0],this.ns,this.renderTemplateOrSlot("error:after")),this.__renderSubmit=()=>{const e=this.in({idle:{snapshot:{dirty:"valid"}}})||this.in({idle:{snapshot:{clean:"valid"}}})||this.in({idle:{template:{dirty:"valid"}}})||this.in({idle:{template:{clean:"valid"}}});return t(v||(v=g` <div> ${0} <vaadin-button data-testid="submit" class="w-full mt-m" theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="sign_in"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("submit:before"),!e||this.in("busy")||this.disabledSelector.matches("submit",!0),(()=>this.submit()),this.ns,this.lang,this.renderTemplateOrSlot("submit:after"))}}static get properties(){return e(e({},super.properties),{},{issuer:{type:String}})}static get v8n(){return[({credential:e})=>!!(null==e?void 0:e.email)||"email_required",({credential:e})=>{var t;return d(null!==(t=null==e?void 0:e.email)&&void 0!==t?t:"")||"email_invalid_email"},({credential:e})=>!!(null==e?void 0:e.password)||"password_required",({credential:e})=>{var t;return 0!==(null===(t=null==e?void 0:e.new_password)||void 0===t?void 0:t.length)||"new_password_required"},({credential:e})=>{var t;return 0!==(null===(t=null==e?void 0:e.mfa_totp_code)||void 0===t?void 0:t.length)||"mfa_totp_code_required"}]}render(){var e,r,i,o;const{hiddenSelector:n,errors:s,lang:d,form:l,ns:u}=this,c=this.__mfaSecretCode,f=null===(e=l.credential)||void 0===e?void 0:e.mfa_totp_code,h=!!c||!!f||s.some((e=>e.startsWith("mfa"))),p="string"==typeof(null===(r=this.form.credential)||void 0===r?void 0:r.new_password)||s.some((e=>e.startsWith("new_password_"))),m=!h&&!f||n.matches("mfa-totp-code",!0),v=!h||h&&c||n.matches("mfa-remember-device",!0),y=!c||n.matches("mfa-secret-code",!0),_=h||n.matches("new-password",!0),w=s.some((e=>e.endsWith("_error"))),$=this.in("busy");return t(b||(b=g` <main aria-live="polite" aria-busy="${0}" class="relative font-lumo text-m leading-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="busy" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </main> `),$,n.matches("email",!0)?"":this.__renderEmail(),h||n.matches("password",!0)?"":this.__renderPassword(),_||!p?"":this.__renderNewPassword(),m?"":this.__renderMfaTotpCode(),y?"":this.__renderMfaSecretCode(),v?"":this.__renderMfaRememberDevice(),n.matches("error",!0)||!w?"":this.__renderError(),n.matches("submit",!0)?"":this.__renderSubmit(),a({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!$}),d,u,null!==(o=null===(i=customElements.get("foxy-spinner"))||void 0===i?void 0:i.defaultNS)&&void 0!==o?o:"")}async _sendPost(e){const t=JSON.stringify(e),r=await this._fetch(this.parent,{body:t,method:"POST"}),o=i.Rumour(this.group),n=[...this.related,this.parent];return o.share({data:r,related:n,source:r._links.self.href}),r}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t="unknown_error";try{const r=(await e.json())._embedded["fx:errors"][0].code;"string"==typeof r&&(t=r)}catch(e){}throw[t]}}get __mfaSecretCode(){var e;const t=null===(e=this.form.credential)||void 0===e?void 0:e.mfa_secret_code;if(t)return t;const r="mfa_required",i=this.errors.find((e=>e.startsWith(r)));return null==i?void 0:i.replace(r,"").trim()}}customElements.define("foxy-sign-in-form",_);export{_ as SignInForm};
|
|
1
|
+
import"./shared-08c637a9.js";import"./shared-9e94c56d.js";import"./shared-1cd2db2d.js";import"./shared-0a24f318.js";import"./shared-c9f3f8d3.js";import"./shared-1cfea4b6.js";import"./shared-e1850e5f.js";import"./shared-4e1b5fa3.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-51bb937b.js";import{_ as e}from"./shared-d1195c27.js";import{h as t}from"./shared-dc73b9a5.js";import{C as r}from"./shared-d1cb97c6.js";import{N as i}from"./shared-2ad18636.js";import{T as o,a as n}from"./shared-4efc6bb8.js";import{c as a}from"./shared-4e709717.js";import{i as s}from"./shared-9803aa7c.js";import{v as d}from"./shared-b738ee96.js";import"./shared-4d543043.js";import"./shared-de45ad84.js";import"./shared-011d6240.js";import"./shared-d8cd61ed.js";import"./shared-61ade33e.js";import"./shared-8a8bfd72.js";import"./shared-64d9ac2a.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";!function(e){var t={};function r(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(i,o,function(t){return e[t]}.bind(null,o));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){var i,o;void 0===(o="function"==typeof(i=function(){for(var e=[null,[[10,7,17,13],[1,1,1,1],[]],[[16,10,28,22],[1,1,1,1],[4,16]],[[26,15,22,18],[1,1,2,2],[4,20]],[[18,20,16,26],[2,1,4,2],[4,24]],[[24,26,22,18],[2,1,4,4],[4,28]],[[16,18,28,24],[4,2,4,4],[4,32]],[[18,20,26,18],[4,2,5,6],[4,20,36]],[[22,24,26,22],[4,2,6,6],[4,22,40]],[[22,30,24,20],[5,2,8,8],[4,24,44]],[[26,18,28,24],[5,4,8,8],[4,26,48]],[[30,20,24,28],[5,4,11,8],[4,28,52]],[[22,24,28,26],[8,4,11,10],[4,30,56]],[[22,26,22,24],[9,4,16,12],[4,32,60]],[[24,30,24,20],[9,4,16,16],[4,24,44,64]],[[24,22,24,30],[10,6,18,12],[4,24,46,68]],[[28,24,30,24],[10,6,16,17],[4,24,48,72]],[[28,28,28,28],[11,6,19,16],[4,28,52,76]],[[26,30,28,28],[13,6,21,18],[4,28,54,80]],[[26,28,26,26],[14,7,25,21],[4,28,56,84]],[[26,28,28,30],[16,8,25,20],[4,32,60,88]],[[26,28,30,28],[17,8,25,23],[4,26,48,70,92]],[[28,28,24,30],[17,9,34,23],[4,24,48,72,96]],[[28,30,30,30],[18,9,30,25],[4,28,52,76,100]],[[28,30,30,30],[20,10,32,27],[4,26,52,78,104]],[[28,26,30,30],[21,12,35,29],[4,30,56,82,108]],[[28,28,30,28],[23,12,37,34],[4,28,56,84,112]],[[28,30,30,30],[25,12,40,34],[4,32,60,88,116]],[[28,30,30,30],[26,13,42,35],[4,24,48,72,96,120]],[[28,30,30,30],[28,14,45,38],[4,28,52,76,100,124]],[[28,30,30,30],[29,15,48,40],[4,24,50,76,102,128]],[[28,30,30,30],[31,16,51,43],[4,28,54,80,106,132]],[[28,30,30,30],[33,17,54,45],[4,32,58,84,110,136]],[[28,30,30,30],[35,18,57,48],[4,28,56,84,112,140]],[[28,30,30,30],[37,19,60,51],[4,32,60,88,116,144]],[[28,30,30,30],[38,19,63,53],[4,28,52,76,100,124,148]],[[28,30,30,30],[40,20,66,56],[4,22,48,74,100,126,152]],[[28,30,30,30],[43,21,70,59],[4,26,52,78,104,130,156]],[[28,30,30,30],[45,22,74,62],[4,30,56,82,108,134,160]],[[28,30,30,30],[47,24,77,65],[4,24,52,80,108,136,164]],[[28,30,30,30],[49,25,81,68],[4,28,56,84,112,140,168]]],t=/^\d*$/,r=/^[A-Za-z0-9 $%*+\-./:]*$/,i=/^[A-Z0-9 $%*+\-./:]*$/,o=[],n=[-1],a=0,s=1;a<255;++a)o.push(s),n[s]=a,s=2*s^(s>=128?285:0);var d=[[]];for(a=0;a<30;++a){for(var l=d[a],u=[],c=0;c<=a;++c){var f=c<a?o[l[c]]:0,h=o[(a+(l[c-1]||0))%255];u.push(n[f^h])}d.push(u)}var p={};for(a=0;a<45;++a)p["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".charAt(a)]=a;var m=[function(e,t){return(e+t)%2==0},function(e,t){return e%2==0},function(e,t){return t%3==0},function(e,t){return(e+t)%3==0},function(e,t){return((e/2|0)+(t/3|0))%2==0},function(e,t){return e*t%2+e*t%3==0},function(e,t){return(e*t%2+e*t%3)%2==0},function(e,t){return((e+t)%2+e*t%3)%2==0}],v=function(e){return e>6},b=function(t,r){var i=-8&function(t){var r=e[t],i=16*t*t+128*t+64;return v(t)&&(i-=36),r[2].length&&(i-=25*r[2].length*r[2].length-10*r[2].length-55),i}(t),o=e[t];return i-8*o[0][r]*o[1][r]},g=function(e,t){switch(t){case 1:return e<10?10:e<27?12:14;case 2:return e<10?9:e<27?11:13;case 4:return e<10?8:16;case 8:return e<10?8:e<27?10:12}},y=function(e,t,r){var i=b(e,r)-4-g(e,t);switch(t){case 1:return 3*(i/10|0)+(i%10<4?0:i%10<7?1:2);case 2:return 2*(i/11|0)+(i%11<6?0:1);case 4:return i/8|0;case 8:return i/13|0}},_=function(e,t){for(var r=e.slice(0),i=e.length,a=t.length,s=0;s<a;++s)r.push(0);for(s=0;s<i;){var d=n[r[s++]];if(d>=0)for(var l=0;l<a;++l)r[s+l]^=o[(d+t[l])%255]}return r.slice(i)},w=function(e,t,r,i){for(var o=e<<i,n=t-1;n>=0;--n)o>>i+n&1&&(o^=r<<n);return e<<i|o},$=function(e,t,r){for(var i=m[r],o=e.length,n=0;n<o;++n)for(var a=0;a<o;++a)t[n][a]||(e[n][a]^=i(n,a));return e},S=function(e,t,r,i){for(var o=e.length,n=21522^w(r<<3|i,5,1335,10),a=0;a<15;++a){var s=[o-1,o-2,o-3,o-4,o-5,o-6,o-7,o-8,7,5,4,3,2,1,0][a];e[[0,1,2,3,4,5,7,8,o-7,o-6,o-5,o-4,o-3,o-2,o-1][a]][8]=e[8][s]=n>>a&1}return e},x=function(e){for(var t=function(e){for(var t=0,r=0;r<e.length;++r)e[r]>=5&&(t+=e[r]-5+3);for(r=5;r<e.length;r+=2){var i=e[r];e[r-1]==i&&e[r-2]==3*i&&e[r-3]==i&&e[r-4]==i&&(e[r-5]>=4*i||e[r+1]>=4*i)&&(t+=40)}return t},r=e.length,i=0,o=0,n=0;n<r;++n){var a,s=e[n];a=[0];for(var d=0;d<r;){for(l=0;d<r&&s[d];++l)++d;for(a.push(l),l=0;d<r&&!s[d];++l)++d;a.push(l)}for(i+=t(a),a=[0],d=0;d<r;){var l;for(l=0;d<r&&e[d][n];++l)++d;for(a.push(l),l=0;d<r&&!e[d][n];++l)++d;a.push(l)}i+=t(a);var u=e[n+1]||[];for(o+=s[0],d=1;d<r;++d){var c=s[d];o+=c,s[d-1]==c&&u[d]===c&&u[d-1]===c&&(i+=3)}}return i+10*(Math.abs(o/r/r-.5)/.05|0)},j=function(t,r,i,o,n){var a=e[r],s=function(e,t,r,i){var o=[],n=0,a=8,s=r.length,d=function(e,t){if(t>=a){for(o.push(n|e>>(t-=a));t>=8;)o.push(e>>(t-=8)&255);n=0,a=8}t>0&&(n|=(e&(1<<t)-1)<<(a-=t))},l=g(e,t);switch(d(t,4),d(s,l),t){case 1:for(var u=2;u<s;u+=3)d(parseInt(r.substring(u-2,u+1),10),10);d(parseInt(r.substring(u-2),10),[0,4,7][s%3]);break;case 2:for(u=1;u<s;u+=2)d(45*p[r.charAt(u-1)]+p[r.charAt(u)],11);s%2==1&&d(p[r.charAt(u-1)],6);break;case 4:for(u=0;u<s;++u)d(r[u],8)}for(d(0,4),a<8&&o.push(n);o.length+1<i;)o.push(236,17);return o.length<i&&o.push(236),o}(r,i,t,b(r,o)>>3);s=function(e,t,r){for(var i=[],o=e.length/t|0,n=0,a=t-e.length%t,s=0;s<a;++s)i.push(n),n+=o;for(s=a;s<t;++s)i.push(n),n+=o+1;i.push(n);var d=[];for(s=0;s<t;++s)d.push(_(e.slice(i[s],i[s+1]),r));var l=[],u=e.length/t|0;for(s=0;s<u;++s)for(var c=0;c<t;++c)l.push(e[i[c]+s]);for(c=a;c<t;++c)l.push(e[i[c+1]-1]);for(s=0;s<r.length;++s)for(c=0;c<t;++c)l.push(d[c][s]);return l}(s,a[1][o],d[a[0][o]]);var l=function(t){for(var r=e[t],i=function(e){return 4*e+17}(t),o=[],n=[],a=0;a<i;++a)o.push([]),n.push([]);var s=function(e,t,r,i,a){for(var s=0;s<r;++s)for(var d=0;d<i;++d)o[e+s][t+d]=a[s]>>d&1,n[e+s][t+d]=1};for(s(0,0,9,9,[127,65,93,93,93,65,383,0,64]),s(i-8,0,8,9,[256,127,65,93,93,93,65,127]),s(0,i-8,9,8,[254,130,186,186,186,130,254,0,0]),a=9;a<i-8;++a)o[6][a]=o[a][6]=1&~a,n[6][a]=n[a][6]=1;var d=r[2],l=d.length;for(a=0;a<l;++a)for(var u=0==a?l-1:l,c=0==a||a==l-1?1:0;c<u;++c)s(d[a],d[c],5,5,[31,17,21,17,31]);if(v(t)){var f=w(t,6,7973,12),h=0;for(a=0;a<6;++a)for(c=0;c<3;++c)o[a][i-11+c]=o[i-11+c][a]=f>>h++&1,n[a][i-11+c]=n[i-11+c][a]=1}return{matrix:o,reserved:n}}(r),u=l.matrix,c=l.reserved;if(function(e,t,r){for(var i=e.length,o=0,n=-1,a=i-1;a>=0;a-=2){6==a&&--a;for(var s=n<0?i-1:0,d=0;d<i;++d){for(var l=a;l>a-2;--l)t[s][l]||(e[s][l]=r[o>>3]>>(7&~o)&1,++o);s+=n}n=-n}}(u,c,s),n<0){$(u,c,0),S(u,0,o,0);var f=0,h=x(u);for($(u,c,0),n=1;n<8;++n){$(u,c,n),S(u,0,o,n);var m=x(u);h>m&&(h=m,f=n),$(u,c,n)}n=f}return $(u,c,n),S(u,0,o,n),u},k={generate:function(e,o){var n=(o=o||{}).version||-1,a={L:1,M:0,Q:3,H:2}[(o.ecclevel||"L").toUpperCase()],s=o.mode?{numeric:1,alphanumeric:2,octet:4}[o.mode.toLowerCase()]:-1,d="mask"in o?o.mask:-1;if(s<0)s="string"==typeof e?e.match(t)?1:e.match(i)?2:4:4;else if(1!=s&&2!=s&&4!=s)throw"invalid or unsupported mode";if(null===(e=function(e,i){switch(e){case 1:return i.match(t)?i:null;case 2:return i.match(r)?i.toUpperCase():null;case 4:if("string"==typeof i){for(var o=[],n=0;n<i.length;++n){var a=i.charCodeAt(n);a<128?o.push(a):a<2048?o.push(192|a>>6,128|63&a):a<65536?o.push(224|a>>12,128|a>>6&63,128|63&a):o.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|63&a)}return o}return i}}(s,e)))throw"invalid data format";if(a<0||a>3)throw"invalid ECC level";if(n<0){for(n=1;n<=40&&!(e.length<=y(n,s,a));++n);if(n>40)throw"too large data"}else if(n<1||n>40)throw"invalid version";if(-1!=d&&(d<0||d>8))throw"invalid mask";return j(e,n,s,a,d)},generateHTML:function(e,t){t=t||{};for(var r=k.generate(e,t),i=Math.max(t.modulesize||5,.5),o=t.unit||"px",n=t.ratio||1,a=Math.max(null!==t.margin?t.margin:4,0),s=document.createElement("div"),d=r.length,l=['<table border="0" cellspacing="0" cellpadding="0" style="border:'+i*a+'px solid #fff;background:#fff">'],u=0;u<d;++u){l.push("<tr>");for(var c=0;c<d;++c){const e="px"!==o?"width:"+i*n+o+"; height:"+i*n+o:"width:"+i+"px;height:"+i+"px";console.log("generateHTML",{unit:o,ratio:n,modsize:i,size:e}),l.push('<td style="'+e+(r[u][c]?";background:#000":"")+'" part="'+(r[u][c]?"module-fg":"module-bg")+'" ></td>')}l.push("</tr>")}return s.className="qrcode",s.innerHTML=l.join("")+"</table>",s},generateSVG:function(e,t){t=t||{};var r=k.generate(e,t),i=r.length,o=Math.max(t.modulesize||5,.5),n=Math.max(null!==t.margin?t.margin:4,0),a=o*(i+2*n),s=' class= "fg" width="'+o+'" height="'+o+'"/>',d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttribute("viewBox","0 0 "+a+" "+a),d.setAttribute("style","shape-rendering:crispEdges"),t.modulesize&&(d.setAttribute("width",a),d.setAttribute("height",a));for(var l=["<style scoped>.bg{fill:#FFF}.fg{fill:#000}</style>",'<rect class="bg" x="0" y="0"','width="'+a+'" height="'+a+'"/>'],u=n*o,c=0;c<i;++c){for(var f=n*o,h=0;h<i;++h)r[c][h]&&l.push('<rect x="'+f+'" y="'+u+'"',s),f+=o;u+=o}return d.innerHTML=l.join(""),d},generatePNG:function(e,t){t=t||{};var r,i=k.generate(e,t),o=Math.max(t.modulesize||5,.5),n=Math.max(null!==t.margin?t.margin:4,0),a=i.length,s=o*(a+2*n),d=document.createElement("canvas");if(d.width=d.height=s,!(r=d.getContext("2d")))throw"canvas support is needed for PNG output";r.fillStyle="#fff",r.fillRect(0,0,s,s),r.fillStyle="#000";for(var l=0;l<a;++l)for(var u=0;u<a;++u)i[l][u]&&r.fillRect(o*(n+u),o*(n+l),o,o);return d.toDataURL()}};return k})?i.apply(t,[]):i)||(e.exports=o)},function(e,t,r){r.r(t);var i=r(0),o=r.n(i);function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===n(o)?o:String(o)),i)}var o}function s(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return u(e,arguments,h(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),f(i,e)})(e)}function u(e,t,r){return(u=c()?Reflect.construct.bind():function(e,t,r){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return r&&f(o,r.prototype),o}).apply(null,arguments)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(p,e);var t,r,i,n,l,u=(t=p,r=c(),function(){var e,i=h(t);if(r){var o=h(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return s(this,e)});function p(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),(e=u.call(this))._defineProperty=e._defineProperty.bind(d(e)),e.attachShadow({mode:"open"}),Object.keys(p.defaultAttributes).map(e._defineProperty),e}return i=p,l=[{key:"defaultAttributes",get:function(){return{data:null,format:"png",modulesize:5,margin:4,unit:"px",ratio:1}}},{key:"observedAttributes",get:function(){return Object.keys(p.defaultAttributes)}}],(n=[{key:"attributeChangedCallback",value:function(e,t,r){var i=this[e+"Changed"];i&&"function"==typeof i&&i.call(this,t,r),this.generate()}},{key:"_defineProperty",value:function(e){var t=this;Object.defineProperty(this,e,{get:function(){var r=t.getAttribute(e);return null===r?p.defaultAttributes[e]:r},set:function(r){t.setAttribute(e,r)}})}},{key:"getOptions",value:function(){var e=this.modulesize,t=this.margin,r=this.unit,i=this.ratio;return{margin:null!==t?parseInt(t):t,modulesize:null!==e?parseInt(e):e,unit:r||"px",ratio:i||1}}},{key:"generate",value:function(){try{this.clear(),null!==this.data?"png"===this.format?this.generatePNG():"html"===this.format?this.generateHTML():"svg"===this.format?this.generateSVG():this.shadowRoot.textContent="qr-code: ".concat(this.format," not supported!"):this.shadowRoot.textContent="qr-code: no data!"}catch(e){console.error(e),this.shadowRoot.textContent="qr-code: error!"}}},{key:"generatePNG",value:function(){var e=document.createElement("img");e.src=o.a.generatePNG(this.data,this.getOptions()),e.setAttribute("part","img"),this.shadowRoot.appendChild(e)}},{key:"generateHTML",value:function(){var e=o.a.generateHTML(this.data,this.getOptions()).firstChild;e.setAttribute("part","table"),this.shadowRoot.appendChild(e)}},{key:"generateSVG",value:function(){var e=o.a.generateSVG(this.data,this.getOptions());e.setAttribute("part","svg"),this.shadowRoot.appendChild(e)}},{key:"clear",value:function(){for(;this.shadowRoot.lastChild;)this.shadowRoot.removeChild(this.shadowRoot.lastChild)}}])&&a(i.prototype,n),l&&a(i,l),Object.defineProperty(i,"prototype",{writable:!1}),p}(l(HTMLElement));customElements.get("qr-code")||customElements.define("qr-code",p)}]);let l,u,c,f,h,p,m,v,b,g=e=>e;const y=o(r(n(i,"sign-in-form")));class _ extends y{constructor(){super(...arguments),this.issuer="Unknown",this.__emailValidator=()=>!this.errors.some((e=>e.startsWith("email"))),this.__passwordValidator=()=>!this.errors.some((e=>e.startsWith("password"))),this.__newPasswordValidator=()=>!this.errors.some((e=>e.startsWith("new_password")&&!e.endsWith("_error"))),this.__mfaTotpCodeValidator=()=>!this.errors.some((e=>e.startsWith("mfa_totp_code")&&!e.endsWith("_error"))),this.__renderEmail=()=>{var e;const{disabledSelector:r,readonlySelector:i,errors:o}=this,n=o.find((e=>e.startsWith("email"))),a=null==n?void 0:n.replace("email","v8n"),d=a?this.t(a).toString():"",u=this.in("busy");return t(l||(l=g` <div> ${0} <vaadin-email-field error-message="${0}" data-testid="email" class="w-full mb-m" label="${0}" value="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" @keydown="${0}" @input="${0}"> </vaadin-email-field> ${0} </div> `),this.renderTemplateOrSlot("email:before"),d,this.t("email").toString(),s(null===(e=this.form.credential)||void 0===e?void 0:e.email),u||r.matches("email",!0),i.matches("email",!0),this.__emailValidator,(e=>"Enter"===e.key&&this.submit()),(e=>{var t,r;const i=e.target.value,o=null!==(r=null===(t=this.form.credential)||void 0===t?void 0:t.password)&&void 0!==r?r:"";this.edit({credential:{email:i,password:o},type:"password"})}),this.renderTemplateOrSlot("email:after"))},this.__renderPassword=()=>{var e;const{disabledSelector:r,readonlySelector:i,errors:o}=this,n=o.find((e=>e.startsWith("password"))),a=null==n?void 0:n.replace("password","v8n"),d=a?this.t(a).toString():"",l=this.in("busy");return t(u||(u=g` <div> ${0} <vaadin-password-field error-message="${0}" data-testid="password" class="w-full mb-m" label="${0}" value="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" @keydown="${0}" @input="${0}"> </vaadin-password-field> ${0} </div> `),this.renderTemplateOrSlot("password:before"),d,this.t("password").toString(),s(null===(e=this.form.credential)||void 0===e?void 0:e.password),l||r.matches("password",!0),i.matches("password",!0),this.__passwordValidator,(e=>"Enter"===e.key&&this.submit()),(e=>{var t,r;const i=null!==(r=null===(t=this.form.credential)||void 0===t?void 0:t.email)&&void 0!==r?r:"",o=e.target.value;this.edit({credential:{email:i,password:o},type:"password"})}),this.renderTemplateOrSlot("password:after"))},this.__renderNewPassword=()=>{var e;const{disabledSelector:r,readonlySelector:i,errors:o}=this,n=o.find((e=>e.startsWith("new_password")&&!e.endsWith("_error"))),a=null==n?void 0:n.replace("new_password","v8n"),d=a?this.t(a).toString():"",l=this.in("busy");return t(c||(c=g` <div> ${0} <vaadin-password-field error-message="${0}" data-testid="new-password" class="w-full mb-m" label="${0}" value="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" @keydown="${0}" @input="${0}"> </vaadin-password-field> ${0} </div> `),this.renderTemplateOrSlot("new-password:before"),d,this.t("new_password").toString(),s(null===(e=this.form.credential)||void 0===e?void 0:e.new_password),l||r.matches("new-password",!0),i.matches("new-password",!0),this.__newPasswordValidator,(e=>"Enter"===e.key&&this.submit()),(e=>{var t,r,i,o;this.edit({type:"password",credential:{email:null!==(r=null===(t=this.form.credential)||void 0===t?void 0:t.email)&&void 0!==r?r:"",password:null!==(o=null===(i=this.form.credential)||void 0===i?void 0:i.password)&&void 0!==o?o:"",new_password:e.target.value}})}),this.renderTemplateOrSlot("new-password:after"))},this.__renderMfaTotpCode=()=>{var r;const{disabledSelector:i,readonlySelector:o,errors:n}=this,a=this.__mfaSecretCode,d="mfa_totp_code",l="mfa-totp-code",u=n.find((e=>e.startsWith(d)&&!e.endsWith("_error"))),c=null==u?void 0:u.replace(d,"v8n"),h=c?this.t(c).toString():"",p=this.in("busy");return t(f||(f=g` <div> ${0} <vaadin-text-field error-message="${0}" helper-text="${0}" placeholder="123456" data-testid="${0}" class="w-full mb-m" label="${0}" value="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" autofocus @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${l}:before`),h,a?this.t("mfa_totp_code_hint"):"",l,this.t(d).toString(),s(null===(r=this.form.credential)||void 0===r?void 0:r.mfa_totp_code),p||i.matches(l,!0),o.matches(l,!0),this.__mfaTotpCodeValidator,(e=>"Enter"===e.key&&this.submit()),(t=>{const r=t.target.value,i=e(e({},this.form.credential),{},{mfa_totp_code:r});a&&(i.mfa_secret_code=a),this.edit({type:"password",credential:i})}),this.renderTemplateOrSlot(`${l}:after`))},this.__renderMfaSecretCode=()=>{var e,r;const i="mfa-secret-code",o=this.__mfaSecretCode,n=encodeURIComponent(this.issuer),a=encodeURIComponent(null!==(r=null===(e=this.form.credential)||void 0===e?void 0:e.email)&&void 0!==r?r:""),s=new URL(`otpauth://totp/${n}:${a}`);return s.searchParams.set("secret",o),s.searchParams.set("issuer",this.issuer),t(h||(h=g` <div> ${0} <div data-testid="${0}" class="flex space-x-m overflow-hidden rounded border p-m mb-m border-contrast-10" style="background:#fff;color:#000"> <qr-code modulesize="2" margin="0" format="svg" class="inline-flex" data="${0}"> </qr-code> <div class="break-all font-medium leading-s text-xs tracking-widest"> ${0} </div> </div> ${0} </div> `),this.renderTemplateOrSlot(`${i}:before`),i,s.toString(),o,this.renderTemplateOrSlot(`${i}:after`))},this.__renderMfaRememberDevice=()=>{var r;const{__mfaSecretCode:i,form:o,lang:n,ns:a}=this,s="mfa-remember-device",d=this.in("busy")||this.disabledSelector.matches(s,!0);return t(p||(p=g` <div> ${0} <vaadin-checkbox data-testid="${0}" class="mb-m" ?disabled="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block" lang="${0}" key="mfa_remember_device" ns="${0}"></foxy-i18n> <foxy-i18n class="block text-xs ${0}" lang="${0}" key="mfa_remember_device_hint" ns="${0}"> </foxy-i18n> </vaadin-checkbox> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),s,d,!!(null===(r=o.credential)||void 0===r?void 0:r.mfa_remember_device),(t=>{var r,n;const a=t.currentTarget,s=e(e({},o.credential),{},{mfa_remember_device:a.checked,mfa_totp_code:null!==(n=null===(r=o.credential)||void 0===r?void 0:r.mfa_totp_code)&&void 0!==n?n:""});i&&(s.mfa_secret_code=i),this.edit({credential:s})}),n,a,d?"text-disabled":"text-secondary",n,a,this.renderTemplateOrSlot(`${s}:after`))},this.__renderError=()=>t(m||(m=g` <div> ${0} <p class="leading-s flex items-start text-s rounded p-s bg-error-10 text-error"> <iron-icon class="flex-shrink-0 mr-s icon-inline text-l" icon="lumo:error"></iron-icon> <foxy-i18n data-testid="error" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </p> ${0} </div> `),this.renderTemplateOrSlot("error:before"),this.lang,this.errors[0],this.ns,this.renderTemplateOrSlot("error:after")),this.__renderSubmit=()=>{const e=this.in({idle:{snapshot:{dirty:"valid"}}})||this.in({idle:{snapshot:{clean:"valid"}}})||this.in({idle:{template:{dirty:"valid"}}})||this.in({idle:{template:{clean:"valid"}}});return t(v||(v=g` <div> ${0} <vaadin-button data-testid="submit" class="w-full mt-m" theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="sign_in"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("submit:before"),!e||this.in("busy")||this.disabledSelector.matches("submit",!0),(()=>this.submit()),this.ns,this.lang,this.renderTemplateOrSlot("submit:after"))}}static get properties(){return e(e({},super.properties),{},{issuer:{type:String}})}static get v8n(){return[({credential:e})=>!!(null==e?void 0:e.email)||"email_required",({credential:e})=>{var t;return d(null!==(t=null==e?void 0:e.email)&&void 0!==t?t:"")||"email_invalid_email"},({credential:e})=>!!(null==e?void 0:e.password)||"password_required",({credential:e})=>{var t;return 0!==(null===(t=null==e?void 0:e.new_password)||void 0===t?void 0:t.length)||"new_password_required"},({credential:e})=>{var t;return 0!==(null===(t=null==e?void 0:e.mfa_totp_code)||void 0===t?void 0:t.length)||"mfa_totp_code_required"}]}render(){var e,r,i,o;const{hiddenSelector:n,errors:s,lang:d,form:l,ns:u}=this,c=this.__mfaSecretCode,f=null===(e=l.credential)||void 0===e?void 0:e.mfa_totp_code,h=!!c||!!f||s.some((e=>e.startsWith("mfa"))),p="string"==typeof(null===(r=this.form.credential)||void 0===r?void 0:r.new_password)||s.some((e=>e.startsWith("new_password_"))),m=!h&&!f||n.matches("mfa-totp-code",!0),v=!h||h&&c||n.matches("mfa-remember-device",!0),y=!c||n.matches("mfa-secret-code",!0),_=h||n.matches("new-password",!0),w=s.some((e=>e.endsWith("_error"))),$=this.in("busy");return t(b||(b=g` <main aria-live="polite" aria-busy="${0}" class="relative font-lumo text-m leading-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="busy" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </main> `),$,n.matches("email",!0)?"":this.__renderEmail(),h||n.matches("password",!0)?"":this.__renderPassword(),_||!p?"":this.__renderNewPassword(),m?"":this.__renderMfaTotpCode(),y?"":this.__renderMfaSecretCode(),v?"":this.__renderMfaRememberDevice(),n.matches("error",!0)||!w?"":this.__renderError(),n.matches("submit",!0)?"":this.__renderSubmit(),a({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!$}),d,u,null!==(o=null===(i=customElements.get("foxy-spinner"))||void 0===i?void 0:i.defaultNS)&&void 0!==o?o:"")}async _sendPost(e){const t=JSON.stringify(e),r=await this._fetch(this.parent,{body:t,method:"POST"}),o=i.Rumour(this.group),n=[...this.related,this.parent];return o.share({data:r,related:n,source:r._links.self.href}),r}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t="unknown_error";try{const r=(await e.json())._embedded["fx:errors"][0].code;"string"==typeof r&&(t=r)}catch(e){}throw[t]}}get __mfaSecretCode(){var e;const t=null===(e=this.form.credential)||void 0===e?void 0:e.mfa_secret_code;if(t)return t;const r="mfa_required",i=this.errors.find((e=>e.startsWith(r)));return null==i?void 0:i.replace(r,"").trim()}}customElements.define("foxy-sign-in-form",_);export{_ as SignInForm};
|
package/dist/cdn/foxy-spinner.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-e1850e5f.js";import"./shared-64d9ac2a.js";import"./shared-51bb937b.js";import{_ as t}from"./shared-d1195c27.js";import{h as e,L as s,s as i}from"./shared-dc73b9a5.js";import{I as r}from"./shared-17a61265.js";import{a as o,T as n}from"./shared-4efc6bb8.js";import"./shared-4d543043.js";import"./shared-343d1fd7.js";let a,c,d,l,p,h,x=t=>t;const m=o(n(r(s)),"spinner");class y extends m{constructor(){super(...arguments),this.layout="horizontal",this.state="busy"}static get properties(){return t(t({},super.properties),{},{layout:{type:String},state:{type:String}})}render(){let t,s,r,o;return"end"===this.state?(s=e(a||(a=x`<iron-icon data-testid="icon" icon="icons:done-all"></iron-icon>`)),r="loading_end",o="text-tertiary"):"error"===this.state?(s=e(c||(c=x`<iron-icon data-testid="icon" icon="icons:error-outline"></iron-icon>`)),r="loading_error",o="text-error"):"paused"===this.state?(s=e(d||(d=x`<iron-icon data-testid="icon" icon="icons:more-horiz"></iron-icon>`)),r="loading_paused",o="text-tertiary"):"empty"===this.state?(s=e(l||(l=x`<iron-icon data-testid="icon" icon="icons:info-outline"></iron-icon>`)),r="loading_empty",o="text-tertiary"):(s=i(p||(p=x`
|
|
2
2
|
<svg data-testid="icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 22 22" preserveAspectRatio="xMidYMid" class="animate-spin h-full w-full">
|
|
3
3
|
<circle cx="11" cy="11" fill="none" stroke="#e15b64" stroke-width="2" r="8" stroke-dasharray="24 12" class="stroke-current"></circle>
|
|
4
4
|
</svg>
|
|
5
|
-
`)),r="loading_busy",o="text-tertiary"),t="horizontal"===this.layout?"flex items-center space-x-s h-xxs":"flex flex-col items-center space-y-s",
|
|
5
|
+
`)),r="loading_busy",o="text-tertiary"),t="horizontal"===this.layout?"flex items-center space-x-s h-xxs":"flex flex-col items-center space-y-s",e(h||(h=x` <div class="font-lumo leading-none text-s ${0} ${0}"> <div class="w-xxs h-xss flex items-center justify-center">${0}</div> <foxy-i18n data-testid="text" class="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </div> `),t,o,s,"no-label"===this.layout?"sr-only":"",this.lang,r,this.ns)}}customElements.define("foxy-spinner",y);export{y as Spinner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-51bb937b.js";import{_ as s}from"./shared-d1195c27.js";import{a as r}from"./shared-4efc6bb8.js";import{T as e}from"./shared-0f261023.js";import{c as t}from"./shared-4e709717.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-e1850e5f.js";import"./shared-4d543043.js";import"./shared-64d9ac2a.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-9ef03974.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let d,i,o=s=>s;const m=r(e,"store-card");class c extends m{constructor(){super(...arguments),this.defaultDomain=null}static get properties(){return s(s({},super.properties),{},{defaultDomain:{attribute:"default-domain"}})}renderBody(){return super.renderBody({title:s=>a(d||(d=o`${0}`),s.store_name),subtitle:s=>{const r=this.defaultDomain,e=null==s?void 0:s.store_domain;return a(i||(i=o` <span aria-label="${0}" style="width:.55em;height:.55em" class="${0}"></span> ${0} `),this.t("status_"+(s.is_active?"active":"inactive")),t({"inline-block flex-shrink-0 rounded-full":!0,"bg-success":s.is_active,"border border-contrast-50":!s.is_active}),(null==e?void 0:e.includes("."))||!r?e:`${e}.${r}`)}})}}customElements.define("foxy-store-card",c);export{c as StoreCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-9d309e97.js";import"./shared-92192fe1.js";import"./shared-193bb806.js";import"./shared-374e6faa.js";import"./shared-745f340a.js";import"./shared-8a73d1aa.js";import"./shared-9092b5db.js";import"./shared-5c35d93a.js";import{I as t}from"./shared-bc023a29.js";import"./foxy-nucleon-element.js";import"./shared-acd33590.js";import{_ as e}from"./shared-d1195c27.js";import{R as o,a as n}from"./shared-b726120d.js";import{i as r}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import{a as i}from"./shared-9cf15285.js";import"./shared-11694c05.js";import"./shared-adcfd50a.js";import"./shared-65479601.js";import"./shared-f998f9c8.js";import"./shared-5513e830.js";import"./shared-c4f15ea3.js";import"./shared-f8368b97.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-c98881c7.js";import"./shared-8fc527b7.js";import"./shared-562d466d.js";import"./shared-8b5e05df.js";import"./shared-7ceceb4c.js";import"./shared-61ade33e.js";import"./shared-2e090291.js";import"./shared-c538157f.js";import"./shared-913e1955.js";import"./shared-40af05b3.js";import"./shared-91d8985f.js";import"./shared-8da3186f.js";import"./shared-9a59aab2.js";import"./shared-651c44fa.js";import"./shared-f893763a.js";import"./shared-97cfdcdb.js";import"./shared-9e360643.js";import"./shared-239062b0.js";import"./shared-28ebee50.js";import"./shared-df51ee50.js";import"./foxy-copy-to-clipboard.js";import"./shared-4903b2e3.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,l,u,c,m,f,_,p,y,d,h,g=t=>t;const x=o(n(t,"store-form"));class b extends x{constructor(){super(...arguments),this.customerPasswordHashTypes=null,this.shippingAddressTypes=null,this.storeVersions=null,this.checkoutTypes=null,this.localeCodes=null,this.languages=null,this.timezones=null,this.countries=null,this.regions=null,this.__currencyStyleOptions=[{rawLabel:"12.34",value:"101"},{rawLabel:"USD 12.34",value:"001"},{rawLabel:"$12.34",value:"000"},{rawLabel:"12",value:"111"},{rawLabel:"USD 12",value:"011"},{rawLabel:"$12",value:"010"}],this.__currencyStyleGetValue=()=>({101:"101",100:"101","001":"001","000":"000",111:"111",110:"111","011":"011","010":"010"}[[this.form.hide_currency_symbol,this.form.hide_decimal_characters,this.form.use_international_currency_symbol].map((t=>Number(Boolean(t)))).join("")]),this.__currencyStyleSetValue=t=>{this.edit({hide_currency_symbol:Boolean(Number(t[0])),hide_decimal_characters:Boolean(Number(t[1])),use_international_currency_symbol:Boolean(Number(t[2]))})},this.__appSessionTimeOptions=[{value:"s",label:"second"},{value:"m",label:"minute"},{value:"h",label:"hour"},{value:"d",label:"day"}],this.__getStoreEmailValue=()=>{var t;return(null!==(t=this.form.store_email)&&void 0!==t?t:"").split(",").map((t=>({value:t.trim()}))).filter((({value:t})=>t.length>0))},this.__setStoreEmailValue=t=>{this.edit({store_email:t.map((t=>t.value)).join(",")})},this.__getUseSmtpConfigValue=()=>!!this.form.smtp_config,this.__setUseSmtpConfigValue=t=>{t?this.edit({smtp_config:JSON.stringify({username:"",password:"",security:"",host:"",port:""})}):this.edit({smtp_config:""})},this.__getAppSessionTimeValue=()=>{const t=this.form.app_session_time||43200;return t%86400==0?t/86400+"d":t%3600==0?t/3600+"h":t%60==0?t/60+"m":`${t}s`},this.__setAppSessionTimeValue=t=>{const e=t[t.length-1],o=parseInt(t.substring(0,t.length-1));this.edit({app_session_time:{d:86400,h:3600,m:60,s:1}[e]*o})},this.__setStoreDomainValue=t=>{if(t.endsWith(".foxycart.com")){const e=t.substring(0,t.length-13);this.edit({store_domain:e,use_remote_domain:e.includes(".")})}else this.edit({store_domain:t,use_remote_domain:t.includes(".")})},this.__smtpConfigHostGetValue=()=>this.__getSmtpConfig().host,this.__smtpConfigHostSetValue=t=>{this.__setSmtpConfig("host",t)},this.__smtpConfigPortGetValue=()=>{const t=parseInt(this.__getSmtpConfig().port);return isNaN(t)?void 0:t},this.__smtpConfigPortSetValue=t=>{this.__setSmtpConfig("port",String(t))},this.__smtpConfigUsernameGetValue=()=>this.__getSmtpConfig().username,this.__smtpConfigUsernameSetValue=t=>{this.__setSmtpConfig("username",t)},this.__smtpConfigPasswordGetValue=()=>this.__getSmtpConfig().password,this.__smtpConfigPasswordSetValue=t=>{this.__setSmtpConfig("password",t)},this.__smtpConfigSecurityGetValue=()=>this.__getSmtpConfig().security,this.__smtpConfigSecuritySetValue=t=>{this.__setSmtpConfig("security",t)},this.__smtpConfigSecurityOptions=[{label:"option_ssl",value:"ssl"},{label:"option_tls",value:"tls"},{label:"option_none",value:""}],this.__webhookKeyGeneratorOptions={length:32,separator:""},this.__webhookKeyApiLegacyGetValue=()=>this.__getWebhookKey().api_legacy,this.__webhookKeyApiLegacySetValue=t=>{this.__setWebhookKey("api_legacy",t)},this.__webhookKeyCartSigningGetValue=()=>this.__getWebhookKey().cart_signing,this.__webhookKeyCartSigningSetValue=t=>{this.__setWebhookKey("cart_signing",t)},this.__webhookKeyXmlDatafeedGetValue=()=>this.__getWebhookKey().xml_datafeed,this.__webhookKeyXmlDatafeedSetValue=t=>{this.__setWebhookKey("xml_datafeed",t)},this.__webhookKeySsoGetValue=()=>this.__getWebhookKey().sso,this.__webhookKeySsoSetValue=t=>{this.__setWebhookKey("sso",t)}}static get properties(){return e(e({},super.properties),{},{customerPasswordHashTypes:{attribute:"customer-password-hash-types"},shippingAddressTypes:{attribute:"shipping-address-types"},storeVersions:{attribute:"store-versions"},checkoutTypes:{attribute:"checkout-types"},localeCodes:{attribute:"locale-codes"},languages:{},timezones:{},countries:{},regions:{}})}static get v8n(){return[({store_name:t})=>!!t||"store-name:v8n_required",({store_name:t})=>t&&t.length<=50||"store-name:v8n_too_long",({store_domain:t})=>!!t||"store-domain:v8n_required",({store_domain:t})=>t&&t.length<=100||"store-domain:v8n_too_long",({store_url:t})=>!!t||"store-url:v8n_required",({store_url:t})=>t&&t.length<=300||"store-url:v8n_too_long",({receipt_continue_url:t})=>!t||t.length<=300||"receipt-continue-url:v8n_too_long",({store_email:t})=>!!t||"store-email:v8n_required",({store_email:t})=>t&&t.length<=300||"store-email:v8n_too_long",({from_email:t})=>!t||t.length<=100||"from-email:v8n_too_long",({smtp_config:t})=>!t||t.length<=1e3||"use-smtp-config:v8n_too_long",({postal_code:t})=>!!t||"postal-code:v8n_required",({postal_code:t})=>t&&t.length<=50||"postal-code:v8n_too_long",({region:t})=>!!t||"region:v8n_required",({region:t})=>t&&t.length<=100||"region:v8n_too_long",({country:t})=>!!t||"country:v8n_required",({logo_url:t})=>!t||t.length<=200||"logo-url:v8n_too_long",({webhook_url:t,use_webhook:e})=>!e||!t||t.length<=300||"webhook-url:v8n_too_long",({webhook_key:t,use_webhook:e,use_cart_validation:o})=>!e&&!o||!!t||"webhook-key:v8n_required",({webhook_key:t,use_webhook:e,use_cart_validation:o})=>!e&&!o||!t||t.length<=200||"webhook-key:v8n_too_long",({single_sign_on_url:t,use_single_sign_on:e})=>!e||!!t||"single-sign-on-url:v8n_required",({single_sign_on_url:t,use_single_sign_on:e})=>!e||!t||t.length<=300||"single-sign-on-url:v8n_too_long",({customer_password_hash_config:t})=>!t||String(t).length<=100||"customer-password-hash-config:v8n_too_long",({unified_order_entry_password:t})=>!t||String(t).length<=100||"unified-order-entry-password:v8n_too_long",({custom_display_id_config:t})=>!t||String(t).length<=500||"custom-display-id-config-enabled:v8n_too_long"]}get headerSubtitleOptions(){var t;return{context:(null===(t=this.data)||void 0===t?void 0:t.is_active)?"active":"inactive"}}renderBody(){var t,e,o,n,r,i,h,x,b,v,w,$,V,S;const j=this.t(this.form.use_remote_domain&&!(null===(t=this.data)||void 0===t?void 0:t.use_remote_domain)?"essentials.store-domain.custom_domain_note":"essentials.store-domain.helper_text"),C=!this.form.store_domain||this.form.store_domain.includes(".")?"":".foxycart.com",k=this.__renderLoader(1),K=this.__renderLoader(2),q=this.__renderLoader(7),I=this.__renderLoader(8),O=this.__renderLoader(9),G=Object.entries(null!==(o=null===(e=null==K?void 0:K.data)||void 0===e?void 0:e.values)&&void 0!==o?o:{}),T=null!==(r=null===(n=null==q?void 0:q.data)||void 0===n?void 0:n.values.timezone)&&void 0!==r?r:[],D=Object.values(null!==(h=null===(i=null==I?void 0:I.data)||void 0===i?void 0:i.values)&&void 0!==h?h:{}),L=Object.values(null!==(b=null===(x=null==O?void 0:O.data)||void 0===x?void 0:x.values)&&void 0!==b?b:{}),E=Object.entries(null!==(w=null===(v=null==k?void 0:k.data)||void 0===v?void 0:v.values)&&void 0!==w?w:{}),J=E.map((t=>({rawLabel:t[1].description,value:t[0]}))),P=G.map((([t,e])=>({rawLabel:e,value:t}))),N=T.map((t=>({rawLabel:t.description,value:t.timezone}))),M=D.map((t=>({rawLabel:t.default,value:t.cc2}))),U=L.map((t=>({rawLabel:t.default,value:t.code})));let W;try{const t=new URL(null!==($=this.regions)&&void 0!==$?$:""),e=this.form.country;e&&t.searchParams.set("country_code",e),W=t.toString()}catch(t){W=void 0}const A=this.__getCustomDisplayIdConfig(),H=A.transaction_journal_entries,z=H.log_detail_request_types,B=this.__displayIdExamples,X=this.__journalIdExamples;return s(a||(a=g` ${0} <foxy-internal-summary-control infer="essentials"> <foxy-internal-text-control layout="summary-item" infer="store-name"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="logo-url"> </foxy-internal-text-control> <foxy-internal-text-control helper-text="${0}" layout="summary-item" suffix="${0}" infer="store-domain" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-url"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-switch-control infer="is-maintenance-mode"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-editable-list-control layout="summary-item" infer="store-email" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-select-control layout="summary-item" infer="timezone" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control layout="summary-item" infer="country" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control layout="summary-item" infer="postal-code"> </foxy-internal-text-control> <foxy-internal-select-control layout="summary-item" infer="currency-style" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="legacy-api"> <foxy-internal-password-control layout="summary-item" infer="webhook-key-api-legacy" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="emails"> <foxy-internal-text-control layout="summary-item" infer="from-email" placeholder="${0}"> </foxy-internal-text-control> <foxy-internal-switch-control infer="use-email-dns" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="use-smtp-config" helper-text-as-tooltip .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="shipping"> <foxy-internal-select-control layout="summary-item" infer="shipping-address-type" .options="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="features-multiship" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="require-signed-shipping-rates" helper-text-as-tooltip> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="cart"> <foxy-internal-frequency-control layout="summary-item" infer="app-session-time" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-switch-control infer="products-require-expires-property" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="use-cart-validation" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-cart-signing" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout"> <foxy-internal-select-control layout="summary-item" infer="customer-password-hash-type" .options="${0}" .setValue="${0}"> </foxy-internal-select-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout" label="" helper-text=""> <foxy-internal-password-control layout="summary-item" infer="unified-order-entry-password" show-generator> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout" label="" helper-text=""> <foxy-internal-switch-control infer="use-single-sign-on"></foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="receipt"> <foxy-internal-text-control layout="summary-item" infer="receipt-continue-url"> </foxy-internal-text-control> <foxy-internal-switch-control infer="bcc-on-receipt-email"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="custom-display-id-config"> <foxy-internal-switch-control infer="custom-display-id-config-enabled" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control helper-text="" label="" infer="custom-display-id-config"> <foxy-internal-switch-control infer="custom-display-id-config-transaction-journal-entries-enabled" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="xml-datafeed"> <foxy-internal-switch-control infer="use-webhook"></foxy-internal-switch-control> ${0} </foxy-internal-summary-control> ${0} ${0} ${0} ${0} ${0} ${0} `),this.renderHeader(),j,C,this.__setStoreDomainValue,this.__getStoreEmailValue,this.__setStoreEmailValue,N,M,U.length>0?s(l||(l=g` <foxy-internal-select-control layout="summary-item" infer="region" .options="${0}"> </foxy-internal-select-control> `),U):s(u||(u=g` <foxy-internal-text-control layout="summary-item" infer="region"> </foxy-internal-text-control> `)),this.__currencyStyleOptions,this.__currencyStyleGetValue,this.__currencyStyleSetValue,this.__webhookKeyGeneratorOptions,this.__webhookKeyApiLegacyGetValue,this.__webhookKeyApiLegacySetValue,null!==(S=null===(V=this.__getStoreEmailValue()[0])||void 0===V?void 0:V.value)&&void 0!==S?S:this.t("emails.from-email.placeholder"),this.__getUseSmtpConfigValue,this.__setUseSmtpConfigValue,this.form.smtp_config?s(c||(c=g` <foxy-internal-text-control layout="summary-item" infer="smtp-config-host" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" infer="smtp-config-port" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-text-control layout="summary-item" infer="smtp-config-username" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="smtp-config-password" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-select-control layout="summary-item" infer="smtp-config-security" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> `),this.__smtpConfigHostGetValue,this.__smtpConfigHostSetValue,this.__smtpConfigPortGetValue,this.__smtpConfigPortSetValue,this.__smtpConfigUsernameGetValue,this.__smtpConfigUsernameSetValue,this.__smtpConfigPasswordGetValue,this.__smtpConfigPasswordSetValue,this.__smtpConfigSecurityGetValue,this.__smtpConfigSecuritySetValue,this.__smtpConfigSecurityOptions):"",P,this.__getAppSessionTimeValue,this.__setAppSessionTimeValue,this.__appSessionTimeOptions,this.__webhookKeyGeneratorOptions,this.__webhookKeyCartSigningGetValue,this.__webhookKeyCartSigningSetValue,J,(t=>{var e;const o=E.find((([e])=>e===t));this.edit({customer_password_hash_type:t,customer_password_hash_config:null!==(e=null==o?void 0:o[1].config)&&void 0!==e?e:""})}),"number"==typeof this.form.customer_password_hash_config?s(m||(m=g` <foxy-internal-number-control layout="summary-item" infer="customer-password-hash-config"> </foxy-internal-number-control> `)):s(f||(f=g` <foxy-internal-text-control layout="summary-item" infer="customer-password-hash-config"> </foxy-internal-text-control> `)),this.form.use_single_sign_on?s(_||(_=g` <foxy-internal-text-control layout="summary-item" infer="single-sign-on-url"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-sso" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__webhookKeyGeneratorOptions,this.__webhookKeySsoGetValue,this.__webhookKeySsoSetValue):"",(()=>A.enabled),(t=>{this.__setCustomDisplayIdConfig("enabled",t)}),A.enabled?s(p||(p=g` <foxy-internal-number-control layout="summary-item" infer="custom-display-id-config-start" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="custom-display-id-config-length" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-suffix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <div class="text-right text-secondary"> <p class="flex justify-end"> <foxy-i18n infer="" key="custom-display-id-config-first-example"></foxy-i18n> <span style="font-family:monospace"> ${0}</span> </p> <p class="flex justify-end"> <foxy-i18n infer="" key="custom-display-id-config-random-example"></foxy-i18n> <span style="font-family:monospace"> ${0}</span> </p> </div> `),(()=>parseInt(A.start||"0")),(t=>{this.__setCustomDisplayIdConfig("start",String(t))}),(()=>parseInt(A.length||"0")),(t=>{this.__setCustomDisplayIdConfig("length",String(t))}),(()=>A.prefix),(t=>{this.__setCustomDisplayIdConfig("prefix",t)}),(()=>A.suffix),(t=>{this.__setCustomDisplayIdConfig("suffix",t)}),null==B?void 0:B.first,null==B?void 0:B.random):"",(()=>H.enabled),(t=>{this.__setTransactionJournalEntriesConfig("enabled",t)}),H.enabled?s(y||(y=g` <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-authcapture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-capture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-void-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-refund-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-transaction-separator" class="col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <div class="sm-col-span-2 leading-s text-right text-secondary"> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-authcapture-example"> </foxy-i18n> <span style="font-family:monospace"> ${0} </span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-capture-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-void-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-refund-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> </div> `),(()=>z.transaction_authcapture.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_authcapture",t)}),(()=>z.transaction_capture.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_capture",t)}),(()=>z.transaction_void.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_void",t)}),(()=>z.transaction_refund.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_refund",t)}),(()=>H.transaction_separator),(t=>{this.__setTransactionJournalEntriesConfig("transaction_separator",t)}),null==X?void 0:X.authcapture,null==X?void 0:X.capture,null==X?void 0:X.void,null==X?void 0:X.refund):"",this.form.use_webhook?s(d||(d=g` <foxy-internal-text-control layout="summary-item" infer="webhook-url"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-xml-datafeed" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__webhookKeyGeneratorOptions,this.__webhookKeyXmlDatafeedGetValue,this.__webhookKeyXmlDatafeedSetValue):"",super.renderBody(),k.render(this.customerPasswordHashTypes),K.render(this.shippingAddressTypes),q.render(this.timezones),I.render(this.countries),O.render(W))}get __displayIdExamples(){const t=this.__getCustomDisplayIdConfig(),e=parseInt(t.start||"0"),o=parseInt(t.length||"0")-t.prefix.length-t.suffix.length,n=Math.min(e+Math.floor(Math.random()*Math.pow(10,o)),Math.pow(10,o)-1);if(t.start&&t.length&&e/10<=o)return{first:`${t.prefix}${e.toString().padStart(o,"0")}${t.suffix}`,random:`${t.prefix}${n.toString().padStart(o,"0")}${t.suffix}`}}get __journalIdExamples(){const t=this.__getCustomDisplayIdConfig(),e=t.transaction_journal_entries,o=parseInt(t.start||"0"),n=parseInt(t.length||"0")-t.prefix.length-t.suffix.length,r=Math.min(o+Math.floor(Math.random()*Math.pow(10,n)),Math.pow(10,n)-1),s=`${t.prefix}${r.toString().padStart(n,"0")}${t.suffix}`,i=Math.floor(1e3*Math.random()),a=String(i).padStart(3,"0");if(t.start&&t.length&&o/10<=n)return{authcapture:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_authcapture.prefix}${a}`,capture:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_capture.prefix}${a}`,refund:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_refund.prefix}${a}`,void:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_void.prefix}${a}`}}__getWebhookKey(){var t,e;let o;try{o=JSON.parse(null!==(t=this.form.webhook_key)&&void 0!==t?t:"")}catch(t){const n=null!==(e=this.form.webhook_key)&&void 0!==e?e:"";o={cart_signing:n,xml_datafeed:n,api_legacy:n,sso:n}}return o}__setWebhookKey(t,e){const o=this.__getWebhookKey();o[t]=e,this.edit({webhook_key:JSON.stringify(o)})}__getCustomDisplayIdConfig(){var t;const e={enabled:!1,start:"0",length:"0",prefix:"",suffix:"",transaction_journal_entries:{enabled:!1,transaction_separator:"",log_detail_request_types:{transaction_authcapture:{prefix:""},transaction_capture:{prefix:""},transaction_refund:{prefix:""},transaction_void:{prefix:""}}}};let o;try{o=JSON.parse(null!==(t=this.form.custom_display_id_config)&&void 0!==t?t:"")}catch(t){o=i(e)}return o}__setCustomDisplayIdConfig(t,e){const o=this.__getCustomDisplayIdConfig();o[t]=e,this.edit({custom_display_id_config:JSON.stringify(o)})}__getTransactionJournalEntriesConfig(){return this.__getCustomDisplayIdConfig().transaction_journal_entries}__setTransactionJournalEntriesConfig(t,e){const o=this.__getCustomDisplayIdConfig().transaction_journal_entries;o[t]=e,this.__setCustomDisplayIdConfig("transaction_journal_entries",o)}__setTransactionJournalEntriesPrefix(t,e){const o=this.__getTransactionJournalEntriesConfig();o.log_detail_request_types[t].prefix=e,this.__setTransactionJournalEntriesConfig("log_detail_request_types",o.log_detail_request_types)}__getSmtpConfig(){var t;let e;try{e=JSON.parse(null!==(t=this.form.smtp_config)&&void 0!==t?t:"")}catch(t){e={username:"",password:"",security:"",host:"",port:""}}return e}__setSmtpConfig(t,e){const o=this.__getSmtpConfig();o[t]=e,this.edit({smtp_config:JSON.stringify(o)})}__renderLoader(t){var e;const o=`loader-${t}`;return{data:null===(e=this.renderRoot.querySelector(`#${o}`))||void 0===e?void 0:e.data,render:t=>s(h||(h=g` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),r(null!=t?t:void 0),o,(()=>this.requestUpdate()))}}}customElements.define("foxy-store-form",b);export{b as StoreForm};
|
|
1
|
+
import"./shared-ed9c9bab.js";import"./shared-85989cf3.js";import"./shared-787e52c4.js";import"./shared-25324930.js";import"./shared-b74187e9.js";import"./shared-ac6e1790.js";import"./shared-1c169878.js";import"./shared-838cc86b.js";import{I as t}from"./shared-a4b0ccf4.js";import"./foxy-nucleon-element.js";import"./shared-51bb937b.js";import{_ as e}from"./shared-d1195c27.js";import{R as o,a as n}from"./shared-4efc6bb8.js";import{i as r}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import{a as i}from"./shared-9cf15285.js";import"./shared-24c7c37f.js";import"./shared-4d543043.js";import"./shared-8a8bfd72.js";import"./shared-1cfea4b6.js";import"./shared-e1850e5f.js";import"./shared-4e1b5fa3.js";import"./shared-55bc51c8.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-045bd59c.js";import"./shared-011d6240.js";import"./shared-d8cd61ed.js";import"./shared-9e94c56d.js";import"./shared-de45ad84.js";import"./shared-61ade33e.js";import"./shared-9411a937.js";import"./shared-be093279.js";import"./shared-f0d70be1.js";import"./shared-34c84b9f.js";import"./shared-f97ed2ff.js";import"./shared-c7ffb9f2.js";import"./shared-906fe068.js";import"./shared-651c44fa.js";import"./shared-08e42e78.js";import"./shared-9de0a899.js";import"./shared-1cd2db2d.js";import"./shared-c9f3f8d3.js";import"./shared-c89f7ad5.js";import"./shared-783f6e58.js";import"./foxy-copy-to-clipboard.js";import"./shared-64d9ac2a.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,l,u,c,m,f,_,p,y,d,h,g=t=>t;const x=o(n(t,"store-form"));class b extends x{constructor(){super(...arguments),this.customerPasswordHashTypes=null,this.shippingAddressTypes=null,this.storeVersions=null,this.checkoutTypes=null,this.localeCodes=null,this.languages=null,this.timezones=null,this.countries=null,this.regions=null,this.__currencyStyleOptions=[{rawLabel:"12.34",value:"101"},{rawLabel:"USD 12.34",value:"001"},{rawLabel:"$12.34",value:"000"},{rawLabel:"12",value:"111"},{rawLabel:"USD 12",value:"011"},{rawLabel:"$12",value:"010"}],this.__currencyStyleGetValue=()=>({101:"101",100:"101","001":"001","000":"000",111:"111",110:"111","011":"011","010":"010"}[[this.form.hide_currency_symbol,this.form.hide_decimal_characters,this.form.use_international_currency_symbol].map((t=>Number(Boolean(t)))).join("")]),this.__currencyStyleSetValue=t=>{this.edit({hide_currency_symbol:Boolean(Number(t[0])),hide_decimal_characters:Boolean(Number(t[1])),use_international_currency_symbol:Boolean(Number(t[2]))})},this.__appSessionTimeOptions=[{value:"s",label:"second"},{value:"m",label:"minute"},{value:"h",label:"hour"},{value:"d",label:"day"}],this.__getStoreEmailValue=()=>{var t;return(null!==(t=this.form.store_email)&&void 0!==t?t:"").split(",").map((t=>({value:t.trim()}))).filter((({value:t})=>t.length>0))},this.__setStoreEmailValue=t=>{this.edit({store_email:t.map((t=>t.value)).join(",")})},this.__getUseSmtpConfigValue=()=>!!this.form.smtp_config,this.__setUseSmtpConfigValue=t=>{t?this.edit({smtp_config:JSON.stringify({username:"",password:"",security:"",host:"",port:""})}):this.edit({smtp_config:""})},this.__getAppSessionTimeValue=()=>{const t=this.form.app_session_time||43200;return t%86400==0?t/86400+"d":t%3600==0?t/3600+"h":t%60==0?t/60+"m":`${t}s`},this.__setAppSessionTimeValue=t=>{const e=t[t.length-1],o=parseInt(t.substring(0,t.length-1));this.edit({app_session_time:{d:86400,h:3600,m:60,s:1}[e]*o})},this.__setStoreDomainValue=t=>{if(t.endsWith(".foxycart.com")){const e=t.substring(0,t.length-13);this.edit({store_domain:e,use_remote_domain:e.includes(".")})}else this.edit({store_domain:t,use_remote_domain:t.includes(".")})},this.__smtpConfigHostGetValue=()=>this.__getSmtpConfig().host,this.__smtpConfigHostSetValue=t=>{this.__setSmtpConfig("host",t)},this.__smtpConfigPortGetValue=()=>{const t=parseInt(this.__getSmtpConfig().port);return isNaN(t)?void 0:t},this.__smtpConfigPortSetValue=t=>{this.__setSmtpConfig("port",String(t))},this.__smtpConfigUsernameGetValue=()=>this.__getSmtpConfig().username,this.__smtpConfigUsernameSetValue=t=>{this.__setSmtpConfig("username",t)},this.__smtpConfigPasswordGetValue=()=>this.__getSmtpConfig().password,this.__smtpConfigPasswordSetValue=t=>{this.__setSmtpConfig("password",t)},this.__smtpConfigSecurityGetValue=()=>this.__getSmtpConfig().security,this.__smtpConfigSecuritySetValue=t=>{this.__setSmtpConfig("security",t)},this.__smtpConfigSecurityOptions=[{label:"option_ssl",value:"ssl"},{label:"option_tls",value:"tls"},{label:"option_none",value:""}],this.__webhookKeyGeneratorOptions={length:32,separator:""},this.__webhookKeyApiLegacyGetValue=()=>this.__getWebhookKey().api_legacy,this.__webhookKeyApiLegacySetValue=t=>{this.__setWebhookKey("api_legacy",t)},this.__webhookKeyCartSigningGetValue=()=>this.__getWebhookKey().cart_signing,this.__webhookKeyCartSigningSetValue=t=>{this.__setWebhookKey("cart_signing",t)},this.__webhookKeyXmlDatafeedGetValue=()=>this.__getWebhookKey().xml_datafeed,this.__webhookKeyXmlDatafeedSetValue=t=>{this.__setWebhookKey("xml_datafeed",t)},this.__webhookKeySsoGetValue=()=>this.__getWebhookKey().sso,this.__webhookKeySsoSetValue=t=>{this.__setWebhookKey("sso",t)}}static get properties(){return e(e({},super.properties),{},{customerPasswordHashTypes:{attribute:"customer-password-hash-types"},shippingAddressTypes:{attribute:"shipping-address-types"},storeVersions:{attribute:"store-versions"},checkoutTypes:{attribute:"checkout-types"},localeCodes:{attribute:"locale-codes"},languages:{},timezones:{},countries:{},regions:{}})}static get v8n(){return[({store_name:t})=>!!t||"store-name:v8n_required",({store_name:t})=>t&&t.length<=50||"store-name:v8n_too_long",({store_domain:t})=>!!t||"store-domain:v8n_required",({store_domain:t})=>t&&t.length<=100||"store-domain:v8n_too_long",({store_url:t})=>!!t||"store-url:v8n_required",({store_url:t})=>t&&t.length<=300||"store-url:v8n_too_long",({receipt_continue_url:t})=>!t||t.length<=300||"receipt-continue-url:v8n_too_long",({store_email:t})=>!!t||"store-email:v8n_required",({store_email:t})=>t&&t.length<=300||"store-email:v8n_too_long",({from_email:t})=>!t||t.length<=100||"from-email:v8n_too_long",({smtp_config:t})=>!t||t.length<=1e3||"use-smtp-config:v8n_too_long",({postal_code:t})=>!!t||"postal-code:v8n_required",({postal_code:t})=>t&&t.length<=50||"postal-code:v8n_too_long",({region:t})=>!!t||"region:v8n_required",({region:t})=>t&&t.length<=100||"region:v8n_too_long",({country:t})=>!!t||"country:v8n_required",({logo_url:t})=>!t||t.length<=200||"logo-url:v8n_too_long",({webhook_url:t,use_webhook:e})=>!e||!t||t.length<=300||"webhook-url:v8n_too_long",({webhook_key:t,use_webhook:e,use_cart_validation:o})=>!e&&!o||!!t||"webhook-key:v8n_required",({webhook_key:t,use_webhook:e,use_cart_validation:o})=>!e&&!o||!t||t.length<=200||"webhook-key:v8n_too_long",({single_sign_on_url:t,use_single_sign_on:e})=>!e||!!t||"single-sign-on-url:v8n_required",({single_sign_on_url:t,use_single_sign_on:e})=>!e||!t||t.length<=300||"single-sign-on-url:v8n_too_long",({customer_password_hash_config:t})=>!t||String(t).length<=100||"customer-password-hash-config:v8n_too_long",({unified_order_entry_password:t})=>!t||String(t).length<=100||"unified-order-entry-password:v8n_too_long",({custom_display_id_config:t})=>!t||String(t).length<=500||"custom-display-id-config-enabled:v8n_too_long"]}get headerSubtitleOptions(){var t;return{context:(null===(t=this.data)||void 0===t?void 0:t.is_active)?"active":"inactive"}}renderBody(){var t,e,o,n,r,i,h,x,b,v,w,$,V,S;const j=this.t(this.form.use_remote_domain&&!(null===(t=this.data)||void 0===t?void 0:t.use_remote_domain)?"essentials.store-domain.custom_domain_note":"essentials.store-domain.helper_text"),C=!this.form.store_domain||this.form.store_domain.includes(".")?"":".foxycart.com",k=this.__renderLoader(1),K=this.__renderLoader(2),q=this.__renderLoader(7),I=this.__renderLoader(8),O=this.__renderLoader(9),G=Object.entries(null!==(o=null===(e=null==K?void 0:K.data)||void 0===e?void 0:e.values)&&void 0!==o?o:{}),T=null!==(r=null===(n=null==q?void 0:q.data)||void 0===n?void 0:n.values.timezone)&&void 0!==r?r:[],D=Object.values(null!==(h=null===(i=null==I?void 0:I.data)||void 0===i?void 0:i.values)&&void 0!==h?h:{}),L=Object.values(null!==(b=null===(x=null==O?void 0:O.data)||void 0===x?void 0:x.values)&&void 0!==b?b:{}),E=Object.entries(null!==(w=null===(v=null==k?void 0:k.data)||void 0===v?void 0:v.values)&&void 0!==w?w:{}),J=E.map((t=>({rawLabel:t[1].description,value:t[0]}))),P=G.map((([t,e])=>({rawLabel:e,value:t}))),N=T.map((t=>({rawLabel:t.description,value:t.timezone}))),M=D.map((t=>({rawLabel:t.default,value:t.cc2}))),U=L.map((t=>({rawLabel:t.default,value:t.code})));let W;try{const t=new URL(null!==($=this.regions)&&void 0!==$?$:""),e=this.form.country;e&&t.searchParams.set("country_code",e),W=t.toString()}catch(t){W=void 0}const A=this.__getCustomDisplayIdConfig(),H=A.transaction_journal_entries,z=H.log_detail_request_types,B=this.__displayIdExamples,X=this.__journalIdExamples;return s(a||(a=g` ${0} <foxy-internal-summary-control infer="essentials"> <foxy-internal-text-control layout="summary-item" infer="store-name"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="logo-url"> </foxy-internal-text-control> <foxy-internal-text-control helper-text="${0}" layout="summary-item" suffix="${0}" infer="store-domain" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-url"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-switch-control infer="is-maintenance-mode"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-editable-list-control layout="summary-item" infer="store-email" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-select-control layout="summary-item" infer="timezone" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control layout="summary-item" infer="country" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control layout="summary-item" infer="postal-code"> </foxy-internal-text-control> <foxy-internal-select-control layout="summary-item" infer="currency-style" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="legacy-api"> <foxy-internal-password-control layout="summary-item" infer="webhook-key-api-legacy" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="emails"> <foxy-internal-text-control layout="summary-item" infer="from-email" placeholder="${0}"> </foxy-internal-text-control> <foxy-internal-switch-control infer="use-email-dns" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="use-smtp-config" helper-text-as-tooltip .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="shipping"> <foxy-internal-select-control layout="summary-item" infer="shipping-address-type" .options="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="features-multiship" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="require-signed-shipping-rates" helper-text-as-tooltip> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="cart"> <foxy-internal-frequency-control layout="summary-item" infer="app-session-time" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-switch-control infer="products-require-expires-property" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="use-cart-validation" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-cart-signing" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout"> <foxy-internal-select-control layout="summary-item" infer="customer-password-hash-type" .options="${0}" .setValue="${0}"> </foxy-internal-select-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout" label="" helper-text=""> <foxy-internal-password-control layout="summary-item" infer="unified-order-entry-password" show-generator> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout" label="" helper-text=""> <foxy-internal-switch-control infer="use-single-sign-on"></foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="receipt"> <foxy-internal-text-control layout="summary-item" infer="receipt-continue-url"> </foxy-internal-text-control> <foxy-internal-switch-control infer="bcc-on-receipt-email"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="custom-display-id-config"> <foxy-internal-switch-control infer="custom-display-id-config-enabled" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control helper-text="" label="" infer="custom-display-id-config"> <foxy-internal-switch-control infer="custom-display-id-config-transaction-journal-entries-enabled" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="xml-datafeed"> <foxy-internal-switch-control infer="use-webhook"></foxy-internal-switch-control> ${0} </foxy-internal-summary-control> ${0} ${0} ${0} ${0} ${0} ${0} `),this.renderHeader(),j,C,this.__setStoreDomainValue,this.__getStoreEmailValue,this.__setStoreEmailValue,N,M,U.length>0?s(l||(l=g` <foxy-internal-select-control layout="summary-item" infer="region" .options="${0}"> </foxy-internal-select-control> `),U):s(u||(u=g` <foxy-internal-text-control layout="summary-item" infer="region"> </foxy-internal-text-control> `)),this.__currencyStyleOptions,this.__currencyStyleGetValue,this.__currencyStyleSetValue,this.__webhookKeyGeneratorOptions,this.__webhookKeyApiLegacyGetValue,this.__webhookKeyApiLegacySetValue,null!==(S=null===(V=this.__getStoreEmailValue()[0])||void 0===V?void 0:V.value)&&void 0!==S?S:this.t("emails.from-email.placeholder"),this.__getUseSmtpConfigValue,this.__setUseSmtpConfigValue,this.form.smtp_config?s(c||(c=g` <foxy-internal-text-control layout="summary-item" infer="smtp-config-host" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" infer="smtp-config-port" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-text-control layout="summary-item" infer="smtp-config-username" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="smtp-config-password" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-select-control layout="summary-item" infer="smtp-config-security" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> `),this.__smtpConfigHostGetValue,this.__smtpConfigHostSetValue,this.__smtpConfigPortGetValue,this.__smtpConfigPortSetValue,this.__smtpConfigUsernameGetValue,this.__smtpConfigUsernameSetValue,this.__smtpConfigPasswordGetValue,this.__smtpConfigPasswordSetValue,this.__smtpConfigSecurityGetValue,this.__smtpConfigSecuritySetValue,this.__smtpConfigSecurityOptions):"",P,this.__getAppSessionTimeValue,this.__setAppSessionTimeValue,this.__appSessionTimeOptions,this.__webhookKeyGeneratorOptions,this.__webhookKeyCartSigningGetValue,this.__webhookKeyCartSigningSetValue,J,(t=>{var e;const o=E.find((([e])=>e===t));this.edit({customer_password_hash_type:t,customer_password_hash_config:null!==(e=null==o?void 0:o[1].config)&&void 0!==e?e:""})}),"number"==typeof this.form.customer_password_hash_config?s(m||(m=g` <foxy-internal-number-control layout="summary-item" infer="customer-password-hash-config"> </foxy-internal-number-control> `)):s(f||(f=g` <foxy-internal-text-control layout="summary-item" infer="customer-password-hash-config"> </foxy-internal-text-control> `)),this.form.use_single_sign_on?s(_||(_=g` <foxy-internal-text-control layout="summary-item" infer="single-sign-on-url"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-sso" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__webhookKeyGeneratorOptions,this.__webhookKeySsoGetValue,this.__webhookKeySsoSetValue):"",(()=>A.enabled),(t=>{this.__setCustomDisplayIdConfig("enabled",t)}),A.enabled?s(p||(p=g` <foxy-internal-number-control layout="summary-item" infer="custom-display-id-config-start" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="custom-display-id-config-length" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-suffix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <div class="text-right text-secondary"> <p class="flex justify-end"> <foxy-i18n infer="" key="custom-display-id-config-first-example"></foxy-i18n> <span style="font-family:monospace"> ${0}</span> </p> <p class="flex justify-end"> <foxy-i18n infer="" key="custom-display-id-config-random-example"></foxy-i18n> <span style="font-family:monospace"> ${0}</span> </p> </div> `),(()=>parseInt(A.start||"0")),(t=>{this.__setCustomDisplayIdConfig("start",String(t))}),(()=>parseInt(A.length||"0")),(t=>{this.__setCustomDisplayIdConfig("length",String(t))}),(()=>A.prefix),(t=>{this.__setCustomDisplayIdConfig("prefix",t)}),(()=>A.suffix),(t=>{this.__setCustomDisplayIdConfig("suffix",t)}),null==B?void 0:B.first,null==B?void 0:B.random):"",(()=>H.enabled),(t=>{this.__setTransactionJournalEntriesConfig("enabled",t)}),H.enabled?s(y||(y=g` <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-authcapture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-capture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-void-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-refund-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-transaction-separator" class="col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <div class="sm-col-span-2 leading-s text-right text-secondary"> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-authcapture-example"> </foxy-i18n> <span style="font-family:monospace"> ${0} </span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-capture-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-void-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-refund-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> </div> `),(()=>z.transaction_authcapture.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_authcapture",t)}),(()=>z.transaction_capture.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_capture",t)}),(()=>z.transaction_void.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_void",t)}),(()=>z.transaction_refund.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_refund",t)}),(()=>H.transaction_separator),(t=>{this.__setTransactionJournalEntriesConfig("transaction_separator",t)}),null==X?void 0:X.authcapture,null==X?void 0:X.capture,null==X?void 0:X.void,null==X?void 0:X.refund):"",this.form.use_webhook?s(d||(d=g` <foxy-internal-text-control layout="summary-item" infer="webhook-url"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-xml-datafeed" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__webhookKeyGeneratorOptions,this.__webhookKeyXmlDatafeedGetValue,this.__webhookKeyXmlDatafeedSetValue):"",super.renderBody(),k.render(this.customerPasswordHashTypes),K.render(this.shippingAddressTypes),q.render(this.timezones),I.render(this.countries),O.render(W))}get __displayIdExamples(){const t=this.__getCustomDisplayIdConfig(),e=parseInt(t.start||"0"),o=parseInt(t.length||"0")-t.prefix.length-t.suffix.length,n=Math.min(e+Math.floor(Math.random()*Math.pow(10,o)),Math.pow(10,o)-1);if(t.start&&t.length&&e/10<=o)return{first:`${t.prefix}${e.toString().padStart(o,"0")}${t.suffix}`,random:`${t.prefix}${n.toString().padStart(o,"0")}${t.suffix}`}}get __journalIdExamples(){const t=this.__getCustomDisplayIdConfig(),e=t.transaction_journal_entries,o=parseInt(t.start||"0"),n=parseInt(t.length||"0")-t.prefix.length-t.suffix.length,r=Math.min(o+Math.floor(Math.random()*Math.pow(10,n)),Math.pow(10,n)-1),s=`${t.prefix}${r.toString().padStart(n,"0")}${t.suffix}`,i=Math.floor(1e3*Math.random()),a=String(i).padStart(3,"0");if(t.start&&t.length&&o/10<=n)return{authcapture:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_authcapture.prefix}${a}`,capture:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_capture.prefix}${a}`,refund:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_refund.prefix}${a}`,void:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_void.prefix}${a}`}}__getWebhookKey(){var t,e;let o;try{o=JSON.parse(null!==(t=this.form.webhook_key)&&void 0!==t?t:"")}catch(t){const n=null!==(e=this.form.webhook_key)&&void 0!==e?e:"";o={cart_signing:n,xml_datafeed:n,api_legacy:n,sso:n}}return o}__setWebhookKey(t,e){const o=this.__getWebhookKey();o[t]=e,this.edit({webhook_key:JSON.stringify(o)})}__getCustomDisplayIdConfig(){var t;const e={enabled:!1,start:"0",length:"0",prefix:"",suffix:"",transaction_journal_entries:{enabled:!1,transaction_separator:"",log_detail_request_types:{transaction_authcapture:{prefix:""},transaction_capture:{prefix:""},transaction_refund:{prefix:""},transaction_void:{prefix:""}}}};let o;try{o=JSON.parse(null!==(t=this.form.custom_display_id_config)&&void 0!==t?t:"")}catch(t){o=i(e)}return o}__setCustomDisplayIdConfig(t,e){const o=this.__getCustomDisplayIdConfig();o[t]=e,this.edit({custom_display_id_config:JSON.stringify(o)})}__getTransactionJournalEntriesConfig(){return this.__getCustomDisplayIdConfig().transaction_journal_entries}__setTransactionJournalEntriesConfig(t,e){const o=this.__getCustomDisplayIdConfig().transaction_journal_entries;o[t]=e,this.__setCustomDisplayIdConfig("transaction_journal_entries",o)}__setTransactionJournalEntriesPrefix(t,e){const o=this.__getTransactionJournalEntriesConfig();o.log_detail_request_types[t].prefix=e,this.__setTransactionJournalEntriesConfig("log_detail_request_types",o.log_detail_request_types)}__getSmtpConfig(){var t;let e;try{e=JSON.parse(null!==(t=this.form.smtp_config)&&void 0!==t?t:"")}catch(t){e={username:"",password:"",security:"",host:"",port:""}}return e}__setSmtpConfig(t,e){const o=this.__getSmtpConfig();o[t]=e,this.edit({smtp_config:JSON.stringify(o)})}__renderLoader(t){var e;const o=`loader-${t}`;return{data:null===(e=this.renderRoot.querySelector(`#${o}`))||void 0===e?void 0:e.data,render:t=>s(h||(h=g` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),r(null!=t?t:void 0),o,(()=>this.requestUpdate()))}}}customElements.define("foxy-store-form",b);export{b as StoreForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-56d1eae5.js";import"./shared-620dccaa.js";import"./shared-787e52c4.js";import"./shared-25324930.js";import"./shared-91560256.js";import"./shared-b74187e9.js";import"./shared-838cc86b.js";import{I as e}from"./shared-a4b0ccf4.js";import"./foxy-shipping-container-card.js";import"./foxy-shipping-drop-type-card.js";import"./foxy-shipping-service-card.js";import"./foxy-shipping-method-card.js";import"./foxy-nucleon-element.js";import{_ as t,B as r}from"./shared-d1195c27.js";import{a as o}from"./shared-4efc6bb8.js";import{i}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-0a24f318.js";import"./shared-1cfea4b6.js";import"./shared-4d543043.js";import"./shared-8a8bfd72.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-e1850e5f.js";import"./shared-64d9ac2a.js";import"./shared-51bb937b.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-c9f3f8d3.js";import"./shared-4e709717.js";import"./shared-55bc51c8.js";import"./shared-51c4a6dd.js";import"./shared-3a066450.js";import"./shared-34c84b9f.js";import"./shared-f97ed2ff.js";import"./shared-c7ffb9f2.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-c89f7ad5.js";import"./shared-783f6e58.js";import"./foxy-copy-to-clipboard.js";import"./shared-24c7c37f.js";import"./shared-4e1b5fa3.js";import"./shared-bab2ea2c.js";import"./shared-1cd2db2d.js";import"./shared-011d6240.js";import"./shared-9e94c56d.js";import"./shared-de45ad84.js";import"./shared-d8cd61ed.js";import"./shared-22ba9566.js";import"./shared-97e1f413.js";import"./shared-9ef03974.js";import"./shared-0f261023.js";let n,a=e=>e;const d=o(e,"store-shipping-method-form");class c extends d{constructor(){super(...arguments),this.shippingMethods=null,this.__shippingMethodLoaderId="shippingMethodLoader",this.__shippingMethodUriSetValue=e=>{this.undo(),this.edit({shipping_method_uri:e})},this.__useCustomAccount=!1,this.__useCustomAccountGetValue=()=>Boolean(this.__useCustomAccount||this.form.authentication_key||this.form.meter_number||this.form.accountid||this.form.password),this.__useCustomAccountSetValue=e=>{e||this.edit({authentication_key:"",meter_number:"",accountid:"",password:""}),this.__useCustomAccount=e}}static get properties(){return t(t({},super.properties),{},{shippingMethods:{attribute:"shipping-methods"},__useCustomAccount:{attribute:!1}})}static get v8n(){return[({shipping_method_uri:e})=>e&&(e=>{try{return new URL(e),!0}catch(e){return!1}})(e)||"shipping-method-uri:v8n_required",({accountid:e})=>!e||e.length<=50||"accountid:v8n_too_long",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({meter_number:e})=>!e||e.length<=50||"meter-number:v8n_too_long",({authentication_key:e})=>!e||e.length<=50||"authentication-key:v8n_too_long",({custom_code:e})=>!e||new Blob([e]).size/1024<=64||"custom-code:v8n_too_long"]}get hiddenSelector(){var e;const t=!!this.data,o=null===(e=this.__shippingMethod)||void 0===e?void 0:e.code;let i="general:shipping-container-uri general:shipping-drop-type-uri destinations account endpoint custom-code";if(o){const e={"CUSTOM-ENDPOINT-POST":"general destinations account custom-code","CUSTOM-CODE":"general destinations account endpoint",CUSTOM:"general account endpoint custom-code",FedEx:"endpoint custom-code",USPS:"account endpoint custom-code",UPS:"endpoint custom-code"};e[o]&&(i=e[o])}return t&&!(null==o?void 0:o.startsWith("CUSTOM-"))||(i+=" services"),t&&(i=`general:shipping-method-uri ${i}`),this.__useCustomAccountGetValue()||(i+=" account:accountid account:password account:authentication-key account:meter-number"),new r(`${i} ${super.hiddenSelector}`.trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}get headerTitleOptions(){var e;return t(t({},super.headerTitleOptions),{},{provider:null===(e=this.__shippingMethod)||void 0===e?void 0:e.name})}renderBody(){var e,t,r,o;const d=this.__shippingMethod;return s(n||(n=a` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-resource-picker-control layout="summary-item" infer="shipping-method-uri" first="${0}" item="foxy-shipping-method-card" .setValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-resource-picker-control layout="summary-item" infer="shipping-container-uri" first="${0}" item="foxy-shipping-container-card"> </foxy-internal-resource-picker-control> <foxy-internal-resource-picker-control layout="summary-item" infer="shipping-drop-type-uri" first="${0}" item="foxy-shipping-drop-type-card"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="destinations"> <foxy-internal-switch-control infer="use-for-domestic"></foxy-internal-switch-control> <foxy-internal-switch-control infer="use-for-international"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="account"> <foxy-internal-switch-control infer="use-custom-account" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="authentication-key"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="meter-number"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="accountid"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="password"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-text-control infer="endpoint" property="accountid"> </foxy-internal-text-control> <foxy-internal-source-control infer="custom-code"></foxy-internal-source-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="shipping_service_uri" foreign-key-for-id="shipping_service_id" own-key-for-uri="shipping_method_uri" own-uri="${0}" embed-key="fx:store_shipping_services" options-href="${0}" links-href="${0}" infer="services" limit="200" item="foxy-shipping-service-card"> </foxy-internal-async-resource-link-list-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} `),this.renderHeader(),i(null!==(e=this.shippingMethods)&&void 0!==e?e:null===(t=this.form._links)||void 0===t?void 0:t["fx:shipping_methods"].href),this.__shippingMethodUriSetValue,i(null==d?void 0:d._links["fx:shipping_containers"].href),i(null==d?void 0:d._links["fx:shipping_drop_types"].href),this.__useCustomAccountGetValue,this.__useCustomAccountSetValue,i(null===(r=this.data)||void 0===r?void 0:r._links.self.href),i(null==d?void 0:d._links["fx:shipping_services"].href),i(null===(o=this.data)||void 0===o?void 0:o._links["fx:store_shipping_services"].href),i(this.form.shipping_method_uri||void 0),this.__shippingMethodLoaderId,(()=>this.requestUpdate()),super.renderBody())}updated(e){super.updated(e),e.has("href")&&(this.__useCustomAccount=!1)}async _fetch(...e){try{return await super._fetch(...e)}catch(e){const t=[];try{for(const r of(await e.json())._embedded["fx:errors"])r.message.startsWith("shipping_container_id must be")?t.push("shipping-container-uri:v8n_required"):r.message.startsWith("shipping_drop_type_id must be")&&t.push("shipping-drop-type-uri:v8n_required")}catch(e){}throw t.length>0?t:e}}get __shippingMethodLoader(){return this.renderRoot.querySelector(`#${this.__shippingMethodLoaderId}`)}get __shippingMethod(){var e;return null===(e=this.__shippingMethodLoader)||void 0===e?void 0:e.data}}customElements.define("foxy-store-shipping-method-form",c);export{c as StoreShippingMethodForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-24c7c37f.js";import"./shared-64d9ac2a.js";import"./shared-e1850e5f.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-51bb937b.js";import{_ as t}from"./shared-d1195c27.js";import{h as s}from"./shared-dc73b9a5.js";import{C as e}from"./shared-d1cb97c6.js";import{N as i}from"./shared-2ad18636.js";import{R as a,T as n,a as r}from"./shared-4efc6bb8.js";import{c as o}from"./shared-4e709717.js";import{p as d}from"./shared-73c1d31e.js";import"./shared-4d543043.js";import"./shared-8a8bfd72.js";import"./shared-1cfea4b6.js";import"./shared-4e1b5fa3.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let c,l=t=>t;const m=e(a(n(r(i,"subscription-card"))));class f extends m{render(){var t,e,i,a,n;const r=!!(null===(t=this.data)||void 0===t?void 0:t.is_active),d=!!(null===(e=this.data)||void 0===e?void 0:e.first_failed_transaction_date);return s(c||(c=l` <div class="relative text-left"> <div class="${0}"> <div class="${0}"> <iron-icon class="m-auto" icon="${0}"> </iron-icon> </div> <div class="flex-1 min-w-0 leading-xs flex flex-col sm-flex-row sm-items-center"> <div class="order-1 sm-order-0"> <div class="text-body font-medium origin-top-left text-m"> <foxy-i18n data-testid="summary" options="${0}" lang="${0}" key="transaction_summary" ns="${0}"> </foxy-i18n> ​ </div> <div class="${0}"> <foxy-i18n data-testid="status" options="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> ​ </div> </div> <div class="flex-1 leading-xs mb-xs sm-mb-0 sm-text-right order-0 sm-order-1"> <foxy-i18n data-testid="price" options="${0}" class="text-xxs sm-text-l font-tnum tracking-wide sm-tracking-normal uppercase sm-normal-case font-medium text-secondary sm-text-body sm-block" lang="${0}" key="price_${0}" ns="${0}"> </foxy-i18n> <span class="text-secondary font-medium sm-font-normal sm-block text-xxs sm-text-s"> <span class="sm-hidden">(</span><span class="hidden sm-inline">*</span><foxy-i18n infer="" key="fees_hint"></foxy-i18n><span class="sm-hidden">)</span> <iron-icon id="hint" icon="icons:info-outline" class="icon-inline"></iron-icon> <vcf-tooltip for="hint" position="bottom"> <span class="text-s"><foxy-i18n infer="" key="fees_explainer"></foxy-i18n></span> </vcf-tooltip> <span> ​ </span></span></div> </div> </div> <div data-testid="spinner" class="${0}"> <foxy-spinner state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> ${0} `),o({"flex items-start sm-items-center space-x-m transition duration-150 ease-in-out":!0,"opacity-0":!this.in({idle:"snapshot"})}),o({"min-w-0 flex-shrink-0 rounded-full relative flex p-s":!0,"text-success bg-success-10":r&&!d,"text-body bg-contrast-5":!r&&!d,"text-error bg-error-10":d}),d?"error-outline":r?"done":"done-all",JSON.stringify(this.__getSummaryOptions()),this.lang,this.ns,o({"text-m":!0,"text-tertiary":!r&&!d,"text-success":r&&!d,"text-error":d}),JSON.stringify(this.__getStatusOptions()),this.lang,this.__getStatusKey(),this.ns,JSON.stringify(this.__getPriceOptions()),this.lang,".5m"===(null===(i=this.data)||void 0===i?void 0:i.frequency)?"twice_a_month":"recurring",this.ns,o({"pointer-events-none absolute inset-0 flex transition ease-in-out duration-150":!0,"opacity-0":this.in({idle:"snapshot"})}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(n=null===(a=customElements.get("foxy-spinner"))||void 0===a?void 0:a.defaultNS)&&void 0!==n?n:"",this.renderTemplateOrSlot())}__getSummaryOptions(){if(null===this.data)return{};const t=this.data._embedded["fx:transaction_template"]._embedded["fx:items"];return{most_expensive_item:[...t].sort(((t,s)=>t.price-s.price))[0],count_minus_one:t.length-1,count:t.length}}__getStatusOptions(){const t=this.data;return null===t?{}:t.first_failed_transaction_date?{date:t.first_failed_transaction_date}:t.end_date?{date:t.end_date}:!1===t.is_active?{}:new Date(t.start_date)>new Date?{date:t.start_date}:{date:t.next_transaction_date}}__getPriceOptions(){if(null===this.data)return{};const s=this.data._embedded["fx:transaction_template"],e=`${s.total_order} ${s.currency_code}`;return t(t({},d(this.data.frequency)),{},{amount:e})}__getStatusKey(){const t=this.data;if(null!==t){if(t.first_failed_transaction_date)return"subscription_failed";if(t.end_date){return new Date(t.end_date).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}return!1===t.is_active?"subscription_inactive":new Date(t.start_date)>new Date?"subscription_will_be_active":"subscription_active"}}}customElements.define("foxy-subscription-card",f);export{f as SubscriptionCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-11694c05.js";import"./shared-913e1955.js";import"./shared-239062b0.js";import"./shared-4903b2e3.js";import"./shared-5513e830.js";import{I as e}from"./shared-bc023a29.js";import"./shared-aaf72aad.js";import"./shared-8a73d1aa.js";import"./shared-6b8c2a83.js";import"./shared-51c4a6dd.js";import"./foxy-transaction-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"./shared-acd33590.js";import{_ as t,B as a}from"./shared-d1195c27.js";import"./shared-f998f9c8.js";import"./shared-c4f15ea3.js";import{h as s}from"./shared-dc73b9a5.js";import{S as i,R as r,a as n}from"./shared-b726120d.js";import{c as o}from"./shared-4e709717.js";import{C as d}from"./shared-addddf0e.js";import"./shared-df51ee50.js";import{S as l}from"./shared-7c15c149.js";import{G as c}from"./shared-6e1b5baf.js";import"./shared-562d466d.js";import"./shared-9a59aab2.js";import"./shared-91d8985f.js";import"./shared-7ceceb4c.js";import"./shared-60209b2d.js";import"./shared-8fc527b7.js";import{p as u}from"./shared-492da078.js";import{s as m}from"./shared-79d0699c.js";import{i as h}from"./shared-9803aa7c.js";import{p as f}from"./shared-0e156ee7.js";import{j as _}from"./shared-c2efc54e.js";import"./shared-adcfd50a.js";import"./shared-65479601.js";import"./shared-40af05b3.js";import"./shared-8da3186f.js";import"./shared-651c44fa.js";import"./shared-8b5e05df.js";import"./shared-61ade33e.js";import"./shared-f893763a.js";import"./shared-97cfdcdb.js";import"./shared-f8368b97.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-28ebee50.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-6f0504e2.js";import"./foxy-collection-page.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-c98881c7.js";import"./shared-43e2c3f6.js";import"./shared-5e09e162.js";import"./shared-19df2a73.js";import"./shared-c5647b62.js";import"./shared-15100be0.js";import"./shared-641786b2.js";import"./shared-2e090291.js";import"./shared-d4a1658e.js";import"./shared-c538157f.js";import"./shared-ca0847b0.js";import"./shared-5c846a3b.js";function p(e){return function*(e){const t=[];for(const a of e.settings.subscriptions.allowFrequencyModification)if(_(a.jsonataQuery).evaluate(e.subscription))for(const e of a.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}class y extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function v(e){const t=864e5,a=31*t;if(".5m"===e)return a/2;const s=parseInt(e.substring(0,e.length-1));if(isNaN(s))throw new y(e);if(e.endsWith("y"))return 31536e6*s;if(e.endsWith("m"))return s*a;if(e.endsWith("w"))return 6048e5*s;if(e.endsWith("d"))return s*t;throw new y(e)}function x(e,t){if("boolean"==typeof t)return t;const a=t.filter((t=>Boolean(_(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var a,s,i,r,n;if(t.min){const a=e.min?v(e.min):1/0;v(t.min)<a&&(e.min=t.min)}if(t.max){const a=e.max?v(e.max):-1/0;v(t.max)>a&&(e.max=t.max)}if("day"===(null===(a=t.allowedDays)||void 0===a?void 0:a.type)){const a=[...null!==(s=e.allowedDaysOfWeek)&&void 0!==s?s:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(a))}if("month"===(null===(i=t.allowedDays)||void 0===i?void 0:i.type)){const a=[...null!==(r=e.allowedDaysOfMonth)&&void 0!==r?r:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(a))}if(t.disallowedDates){const a=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(a))}return e}),{});return 0!==Object.keys(a).length&&a}function g(e){const[t,a,s]=e.split("-").map((e=>parseInt(e)));return new Date(t,a-1,s)}function b(e){const t=e.settings.subscriptions.allow_next_date_modification;let a;return a="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,a;const s=g(e.value),i=s.getTime(),r=x(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof r)return r;if(!1===(null===(t=r.allowedDaysOfMonth)||void 0===t?void 0:t.includes(s.getDate())))return!1;if(!1===(null===(a=r.allowedDaysOfWeek)||void 0===a?void 0:a.includes(s.getDay())))return!1;if(r.disallowedDates&&r.disallowedDates.find((e=>{const[t,a]=e.split("..").map((e=>g(e).getTime()));return i===t||void 0!==a&&i>=t&&i<=a})))return!1;if(r.min){const e=f(r.min);if(null!==e&&Date.now()+e>=i)return!1}if(r.max){const e=f(r.max);if(null!==e&&Date.now()+e<=i)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:a}},subscription:e.subscription,value:e.value})}let $,j,D,w,S,T,q,E,k,H,C,L=e=>e;const A=i(r(n(e,"subscription-form")));class I extends A{constructor(){super(...arguments),this.getTransactionPageHref=(e,t)=>null==t?void 0:t._links["fx:receipt"].href,this.getCustomerPageHref=null,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderItemsActions=()=>s($||($=L` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-s font-medium text-secondary" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var e;let t;try{const a=this.__transactionTemplate,s=new URL(null!==(e=null==a?void 0:a._links["fx:items"].href)&&void 0!==e?e:"");s.searchParams.set("zoom","item_options"),t=s.toString()}catch(e){t=void 0}return s(j||(j=L` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" infer="items" item="foxy-item-card" .itemProps="${0}"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),h(t),{"locale-codes":this.localeCodes})},this.__renderEndDate=()=>{var e;const{data:t,lang:a,ns:i}=this;return s(D||(D=L` <div data-testid="end-date"> ${0} <x-group frame> <foxy-i18n key="end_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),i,a,h(null===(e=null==t?void 0:t.end_date)||void 0===e?void 0:e.substr(0,10)),h(null==t?void 0:t.end_date),a,!this.__isEndDateEditable,this.disabledSelector.matches("end-date",!0),this.__checkEndDateAvailability,(e=>{const t=e.target;this.edit({end_date:t.value})}),this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:a}=this;if(t&&a){return b({value:m(e),settings:t,subscription:a})}return e.getTime()>=Date.now()},this.__checkStartDateAvailability=e=>e.getTime()>=Date.now(),this.__checkEndDateAvailability=e=>{const t=new Date;return t.setDate(t.getDate()+1),t.setHours(0,0,0,0),e.getTime()>=t.getTime()},this.__renderStartDate=()=>{const{data:e,lang:t,ns:a}=this;return s(w||(w=L` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),a,t,h(null==e?void 0:e.start_date.substr(0,10)),h(null==e?void 0:e.start_date),t,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(e=>{const t=e.target;this.edit({start_date:t.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:a}=this,i=!!(null==e?void 0:e.is_active);return s(S||(S=L` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),a,t,h(null==e?void 0:e.next_transaction_date.substr(0,10)),h(null==e?void 0:e.next_transaction_date),t,!i||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),a=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",u(e)),value:e})));return s(T||(T=L` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),h(this.form.frequency),a,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:a,ns:i}=this;return s(q||(q=L` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),i,a,i,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>s(E||(E=L` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(e)),e,a,".5m"===e?"twice_a_month":"frequency",i))))},this.__renderFrequency=()=>s(k||(k=L` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__renderCustomer=()=>{var e,t;const a=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,i=a?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,a):void 0;return s(H||(H=L` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="customer" href="${0}"></foxy-customer-card> </a> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),o({"block rounded transition-colors":!0,"ring-1 ring-contrast-10":!i,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!i,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!i}),h(i),h(a),this.renderTemplateOrSlot("customer:after"))}}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-customer-card":customElements.get("foxy-customer-card"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":l,"x-choice":d,"x-group":c}}static get properties(){return t(t({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},settings:{type:Object},coupons:{}})}get hiddenSelector(){return new a(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}get headerTitleOptions(){if(this.data&&this.__currencyCode){const e=u(this.data.frequency),a=this.__transactionTemplate,s=`${null==a?void 0:a.total_order} ${this.__currencyCode}`,i=this.__currencyDisplay,r=this.__currencyCode?".5m"===this.data.frequency?"twice_a_month":"recurring":"existing";return t(t({},e),{},{amount:s,currencyDisplay:i,context:r})}return{}}get headerSubtitleOptions(){var e,t,a;let s,i=null;if(null===(e=this.data)||void 0===e?void 0:e.first_failed_transaction_date)s="failed",i=this.data.first_failed_transaction_date;else if(null===(t=this.data)||void 0===t?void 0:t.end_date){s=new Date(this.data.end_date).getTime()>Date.now()?"will_be_cancelled":"cancelled",i=this.data.end_date}else(null===(a=this.data)||void 0===a?void 0:a.is_active)?new Date(this.data.start_date)>new Date?(s="will_be_active",i=this.data.start_date):(s="active",i=this.data.next_transaction_date):s="inactive";return{date:i,context:s}}renderBody(){var e,t,a,i,r;let n;try{const a=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");a.searchParams.set("order","transaction_date desc"),a.searchParams.set("zoom","items"),n=a.toString()}catch(e){n=void 0}return s(C||(C=L` ${0} <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> <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> <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> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> </div> `),this.renderHeader(),h(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),h(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),h(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),h(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),h(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("customer",!0)?"":this.__renderCustomer(),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",this.__isEndDateVisible?this.__renderEndDate():"",h(null!==(a=this.__currencyCode)&&void 0!==a?a:void 0),h(null===(r=null===(i=this.data)||void 0===i?void 0:i._links["fx:attributes"])||void 0===r?void 0:r.href),h(n),this.getTransactionPageHref)}get __transactionTemplateHref(){var e;const t=this.data;return(null===(e=null==t?void 0:t._embedded)||void 0===e?void 0:e["fx:transaction_template"])||null==t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var e,t,a;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(a=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==a?a:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __templateSetHref(){const e=this.__transactionTemplate;if(!(null==e?void 0:e.currency_code))return(null==e?void 0:e.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t,a;const s=this.data,i=null===(e=null==s?void 0:s._embedded)||void 0===e?void 0:e["fx:transaction_template"],r=`#${this.__transactionTemplateLoaderId}`;return null!==(a=null!=i?i:null===(t=this.renderRoot.querySelector(r))||void 0===t?void 0:t.data)&&void 0!==a?a:null}get __defaultTemplateSet(){var e,t;const a=`#${this.__defaultTemplateSetLoaderId}`,s=this.renderRoot.querySelector(a);return null!==(t=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const a=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const a=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const a=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __isNextTransactionDateVisible(){if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;const e=this.settings.subscriptions.allow_next_date_modification;return!!function(e,t){let a;return a="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),x(e,a)}(this.data,e)}get __isStartDateVisible(){return!this.hiddenSelector.matches("start-date",!0)&&this.__isNextTransactionDateVisible}get __isEndDateVisible(){return!this.hiddenSelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())&&(!1!==this.data.is_active&&!this.settings)))}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isEndDateEditable(){return!this.readonlySelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&null===this.settings)))}get __isFrequencyVisible(){if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;return!p({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=p({subscription:this.data,settings:this.settings});return Array.from(e)}get __currencyCode(){var e,t,a,s;const i=this.__transactionTemplate;if(null==i?void 0:i.currency_code)return i.currency_code;const r=this.__localeCodesHelper,n=null===(t=null!==(e=this.__templateSet)&&void 0!==e?e:this.__defaultTemplateSet)||void 0===t?void 0:t.locale_code,o=n?null==r?void 0:r.values[n]:void 0;return o&&null!==(s=null===(a=/Currency: ([A-Z]{3})/g.exec(o))||void 0===a?void 0:a[1])&&void 0!==s?s:null}get __currencyDisplay(){var e;return(null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol)?"code":"symbol"}}customElements.define("foxy-subscription-form",I);export{I as SubscriptionForm};
|
|
1
|
+
import"./shared-24c7c37f.js";import"./shared-f0d70be1.js";import"./shared-c9f3f8d3.js";import"./shared-64d9ac2a.js";import"./shared-e1850e5f.js";import{I as e}from"./shared-a4b0ccf4.js";import"./shared-3a066450.js";import"./shared-ac6e1790.js";import"./shared-30b4c05b.js";import"./shared-51c4a6dd.js";import"./foxy-transaction-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"./shared-51bb937b.js";import{_ as t,B as a}from"./shared-d1195c27.js";import"./shared-1cfea4b6.js";import"./shared-4e1b5fa3.js";import{h as s}from"./shared-dc73b9a5.js";import{S as i,R as r,a as n}from"./shared-4efc6bb8.js";import{c as o}from"./shared-4e709717.js";import{C as d}from"./shared-d713c00f.js";import"./shared-783f6e58.js";import{S as l}from"./shared-8b9ae780.js";import{G as c}from"./shared-e3647540.js";import"./shared-d8cd61ed.js";import"./shared-906fe068.js";import"./shared-f97ed2ff.js";import"./shared-de45ad84.js";import"./shared-b6ab5711.js";import"./shared-011d6240.js";import{p as u}from"./shared-73c1d31e.js";import{s as m}from"./shared-79d0699c.js";import{i as h}from"./shared-9803aa7c.js";import{p as f}from"./shared-0e156ee7.js";import{j as _}from"./shared-c2efc54e.js";import"./shared-4d543043.js";import"./shared-8a8bfd72.js";import"./shared-34c84b9f.js";import"./shared-c7ffb9f2.js";import"./shared-651c44fa.js";import"./shared-9e94c56d.js";import"./shared-61ade33e.js";import"./shared-08e42e78.js";import"./shared-9de0a899.js";import"./shared-55bc51c8.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-c89f7ad5.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-0a24f318.js";import"./foxy-collection-page.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-045bd59c.js";import"./shared-43e2c3f6.js";import"./shared-97e1f413.js";import"./shared-9ef03974.js";import"./shared-3491d10e.js";import"./shared-91560256.js";import"./shared-641786b2.js";import"./shared-9411a937.js";import"./shared-978aaaf2.js";import"./shared-be093279.js";import"./shared-4a86d1ca.js";import"./shared-c6b69d4e.js";function p(e){return function*(e){const t=[];for(const a of e.settings.subscriptions.allowFrequencyModification)if(_(a.jsonataQuery).evaluate(e.subscription))for(const e of a.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}class y extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function v(e){const t=864e5,a=31*t;if(".5m"===e)return a/2;const s=parseInt(e.substring(0,e.length-1));if(isNaN(s))throw new y(e);if(e.endsWith("y"))return 31536e6*s;if(e.endsWith("m"))return s*a;if(e.endsWith("w"))return 6048e5*s;if(e.endsWith("d"))return s*t;throw new y(e)}function x(e,t){if("boolean"==typeof t)return t;const a=t.filter((t=>Boolean(_(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var a,s,i,r,n;if(t.min){const a=e.min?v(e.min):1/0;v(t.min)<a&&(e.min=t.min)}if(t.max){const a=e.max?v(e.max):-1/0;v(t.max)>a&&(e.max=t.max)}if("day"===(null===(a=t.allowedDays)||void 0===a?void 0:a.type)){const a=[...null!==(s=e.allowedDaysOfWeek)&&void 0!==s?s:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(a))}if("month"===(null===(i=t.allowedDays)||void 0===i?void 0:i.type)){const a=[...null!==(r=e.allowedDaysOfMonth)&&void 0!==r?r:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(a))}if(t.disallowedDates){const a=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(a))}return e}),{});return 0!==Object.keys(a).length&&a}function g(e){const[t,a,s]=e.split("-").map((e=>parseInt(e)));return new Date(t,a-1,s)}function b(e){const t=e.settings.subscriptions.allow_next_date_modification;let a;return a="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,a;const s=g(e.value),i=s.getTime(),r=x(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof r)return r;if(!1===(null===(t=r.allowedDaysOfMonth)||void 0===t?void 0:t.includes(s.getDate())))return!1;if(!1===(null===(a=r.allowedDaysOfWeek)||void 0===a?void 0:a.includes(s.getDay())))return!1;if(r.disallowedDates&&r.disallowedDates.find((e=>{const[t,a]=e.split("..").map((e=>g(e).getTime()));return i===t||void 0!==a&&i>=t&&i<=a})))return!1;if(r.min){const e=f(r.min);if(null!==e&&Date.now()+e>=i)return!1}if(r.max){const e=f(r.max);if(null!==e&&Date.now()+e<=i)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:a}},subscription:e.subscription,value:e.value})}let $,j,D,w,S,T,q,E,k,H,C,L=e=>e;const A=i(r(n(e,"subscription-form")));class I extends A{constructor(){super(...arguments),this.getTransactionPageHref=(e,t)=>null==t?void 0:t._links["fx:receipt"].href,this.getCustomerPageHref=null,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderItemsActions=()=>s($||($=L` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-s font-medium text-secondary" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var e;let t;try{const a=this.__transactionTemplate,s=new URL(null!==(e=null==a?void 0:a._links["fx:items"].href)&&void 0!==e?e:"");s.searchParams.set("zoom","item_options"),t=s.toString()}catch(e){t=void 0}return s(j||(j=L` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" infer="items" item="foxy-item-card" .itemProps="${0}"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),h(t),{"locale-codes":this.localeCodes})},this.__renderEndDate=()=>{var e;const{data:t,lang:a,ns:i}=this;return s(D||(D=L` <div data-testid="end-date"> ${0} <x-group frame> <foxy-i18n key="end_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),i,a,h(null===(e=null==t?void 0:t.end_date)||void 0===e?void 0:e.substr(0,10)),h(null==t?void 0:t.end_date),a,!this.__isEndDateEditable,this.disabledSelector.matches("end-date",!0),this.__checkEndDateAvailability,(e=>{const t=e.target;this.edit({end_date:t.value})}),this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:a}=this;if(t&&a){return b({value:m(e),settings:t,subscription:a})}return e.getTime()>=Date.now()},this.__checkStartDateAvailability=e=>e.getTime()>=Date.now(),this.__checkEndDateAvailability=e=>{const t=new Date;return t.setDate(t.getDate()+1),t.setHours(0,0,0,0),e.getTime()>=t.getTime()},this.__renderStartDate=()=>{const{data:e,lang:t,ns:a}=this;return s(w||(w=L` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),a,t,h(null==e?void 0:e.start_date.substr(0,10)),h(null==e?void 0:e.start_date),t,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(e=>{const t=e.target;this.edit({start_date:t.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:a}=this,i=!!(null==e?void 0:e.is_active);return s(S||(S=L` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),a,t,h(null==e?void 0:e.next_transaction_date.substr(0,10)),h(null==e?void 0:e.next_transaction_date),t,!i||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),a=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",u(e)),value:e})));return s(T||(T=L` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),h(this.form.frequency),a,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:a,ns:i}=this;return s(q||(q=L` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),i,a,i,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>s(E||(E=L` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(e)),e,a,".5m"===e?"twice_a_month":"frequency",i))))},this.__renderFrequency=()=>s(k||(k=L` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__renderCustomer=()=>{var e,t;const a=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,i=a?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,a):void 0;return s(H||(H=L` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="customer" href="${0}"></foxy-customer-card> </a> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),o({"block rounded transition-colors":!0,"ring-1 ring-contrast-10":!i,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!i,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!i}),h(i),h(a),this.renderTemplateOrSlot("customer:after"))}}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-customer-card":customElements.get("foxy-customer-card"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":l,"x-choice":d,"x-group":c}}static get properties(){return t(t({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},settings:{type:Object},coupons:{}})}get hiddenSelector(){return new a(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}get headerTitleOptions(){if(this.data&&this.__currencyCode){const e=u(this.data.frequency),a=this.__transactionTemplate,s=`${null==a?void 0:a.total_order} ${this.__currencyCode}`,i=this.__currencyDisplay,r=this.__currencyCode?".5m"===this.data.frequency?"twice_a_month":"recurring":"existing";return t(t({},e),{},{amount:s,currencyDisplay:i,context:r})}return{}}get headerSubtitleOptions(){var e,t,a;let s,i=null;if(null===(e=this.data)||void 0===e?void 0:e.first_failed_transaction_date)s="failed",i=this.data.first_failed_transaction_date;else if(null===(t=this.data)||void 0===t?void 0:t.end_date){s=new Date(this.data.end_date).getTime()>Date.now()?"will_be_cancelled":"cancelled",i=this.data.end_date}else(null===(a=this.data)||void 0===a?void 0:a.is_active)?new Date(this.data.start_date)>new Date?(s="will_be_active",i=this.data.start_date):(s="active",i=this.data.next_transaction_date):s="inactive";return{date:i,context:s}}renderBody(){var e,t,a,i,r;let n;try{const a=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");a.searchParams.set("order","transaction_date desc"),a.searchParams.set("zoom","items"),n=a.toString()}catch(e){n=void 0}return s(C||(C=L` ${0} <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> <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> <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> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> </div> `),this.renderHeader(),h(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),h(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),h(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),h(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),h(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("customer",!0)?"":this.__renderCustomer(),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",this.__isEndDateVisible?this.__renderEndDate():"",h(null!==(a=this.__currencyCode)&&void 0!==a?a:void 0),h(null===(r=null===(i=this.data)||void 0===i?void 0:i._links["fx:attributes"])||void 0===r?void 0:r.href),h(n),this.getTransactionPageHref)}get __transactionTemplateHref(){var e;const t=this.data;return(null===(e=null==t?void 0:t._embedded)||void 0===e?void 0:e["fx:transaction_template"])||null==t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var e,t,a;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(a=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==a?a:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __templateSetHref(){const e=this.__transactionTemplate;if(!(null==e?void 0:e.currency_code))return(null==e?void 0:e.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t,a;const s=this.data,i=null===(e=null==s?void 0:s._embedded)||void 0===e?void 0:e["fx:transaction_template"],r=`#${this.__transactionTemplateLoaderId}`;return null!==(a=null!=i?i:null===(t=this.renderRoot.querySelector(r))||void 0===t?void 0:t.data)&&void 0!==a?a:null}get __defaultTemplateSet(){var e,t;const a=`#${this.__defaultTemplateSetLoaderId}`,s=this.renderRoot.querySelector(a);return null!==(t=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const a=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const a=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const a=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __isNextTransactionDateVisible(){if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;const e=this.settings.subscriptions.allow_next_date_modification;return!!function(e,t){let a;return a="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),x(e,a)}(this.data,e)}get __isStartDateVisible(){return!this.hiddenSelector.matches("start-date",!0)&&this.__isNextTransactionDateVisible}get __isEndDateVisible(){return!this.hiddenSelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())&&(!1!==this.data.is_active&&!this.settings)))}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isEndDateEditable(){return!this.readonlySelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&null===this.settings)))}get __isFrequencyVisible(){if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;return!p({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=p({subscription:this.data,settings:this.settings});return Array.from(e)}get __currencyCode(){var e,t,a,s;const i=this.__transactionTemplate;if(null==i?void 0:i.currency_code)return i.currency_code;const r=this.__localeCodesHelper,n=null===(t=null!==(e=this.__templateSet)&&void 0!==e?e:this.__defaultTemplateSet)||void 0===t?void 0:t.locale_code,o=n?null==r?void 0:r.values[n]:void 0;return o&&null!==(s=null===(a=/Currency: ([A-Z]{3})/g.exec(o))||void 0===a?void 0:a[1])&&void 0!==s?s:null}get __currencyDisplay(){var e;return(null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol)?"code":"symbol"}}customElements.define("foxy-subscription-form",I);export{I as SubscriptionForm};
|