@foxy.io/elements 1.8.0-beta.1 → 1.8.1-beta.1
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 +2 -2
- package/dist/cdn/foxy-address-form.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-cancellation-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-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +3 -3
- package/dist/cdn/foxy-customer-portal.js +14 -14
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +230 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +2 -2
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/{shared-3747bcc6.js → shared-090432b4.js} +1 -1
- package/dist/cdn/shared-1d0ef57d.js +1 -0
- package/dist/cdn/{shared-720656e1.js → shared-23966eed.js} +1 -1
- package/dist/cdn/{shared-0fab8117.js → shared-497fd63c.js} +1 -1
- package/dist/cdn/{shared-963eb150.js → shared-4b33c6d2.js} +2 -2
- package/dist/cdn/{shared-18f51b0f.js → shared-525dd8c8.js} +1 -1
- package/dist/cdn/{shared-654b4125.js → shared-6872bf5c.js} +1 -1
- package/dist/cdn/shared-69d0ca61.js +1 -0
- package/dist/cdn/{shared-0073399d.js → shared-6f84ea16.js} +1 -1
- package/dist/cdn/{shared-3fbdd8df.js → shared-77bdf956.js} +1 -1
- package/dist/cdn/shared-8057ee9c.js +1 -0
- package/dist/cdn/{shared-67b701fa.js → shared-84203d52.js} +1 -1
- package/dist/cdn/shared-851b97ef.js +1 -0
- package/dist/cdn/{shared-3eee4ff4.js → shared-8f34ce95.js} +1 -1
- package/dist/cdn/{shared-75c1b56a.js → shared-92d03925.js} +1 -1
- package/dist/cdn/{shared-4d16f087.js → shared-96de56d4.js} +1 -1
- package/dist/cdn/{shared-090ed5f4.js → shared-9f78e096.js} +1 -1
- package/dist/cdn/{shared-c7566461.js → shared-a5fbfdc7.js} +1 -1
- package/dist/cdn/{shared-4b3d6aeb.js → shared-a7709d26.js} +1 -1
- package/dist/cdn/{shared-b817761e.js → shared-aac9fed8.js} +1 -1
- package/dist/cdn/{shared-4b7b3564.js → shared-b13a5ed3.js} +1 -1
- package/dist/cdn/{shared-a67a2bc1.js → shared-bba615b8.js} +1 -1
- package/dist/cdn/{shared-3e548f74.js → shared-bf28ab5e.js} +1 -1
- package/dist/cdn/shared-c70d9713.js +1 -0
- package/dist/cdn/{shared-5bfca1d2.js → shared-e058cb87.js} +1 -1
- package/dist/cdn/{shared-97fc8fd7.js → shared-f06d08d5.js} +1 -1
- package/dist/cdn/translations/shared/en.json +3 -0
- package/dist/cdn/translations/shared/es.json +3 -0
- package/dist/elements/private/Dialog/DialogWindow.d.ts +3 -2
- package/dist/elements/private/Dialog/DialogWindow.js +11 -1
- package/dist/elements/private/Dialog/DialogWindow.js.map +1 -1
- package/dist/elements/public/CustomerApi/cookieStorage.js +2 -1
- package/dist/elements/public/CustomerApi/cookieStorage.js.map +1 -1
- package/dist/elements/public/CustomerPortalSettings/private/DisallowedDates/DisallowedDates.js +1 -1
- package/dist/elements/public/CustomerPortalSettings/private/DisallowedDates/DisallowedDates.js.map +1 -1
- package/dist/elements/public/CustomerPortalSettings/private/FrequencyList/FrequencyList.js +3 -2
- package/dist/elements/public/CustomerPortalSettings/private/FrequencyList/FrequencyList.js.map +1 -1
- package/dist/elements/public/CustomerPortalSettings/private/NextDateModificationRule/NextDateModificationRule.js +2 -2
- package/dist/elements/public/CustomerPortalSettings/private/NextDateModificationRule/NextDateModificationRule.js.map +1 -1
- package/dist/elements/public/CustomerPortalSettings/private/OriginsList/OriginsList.js +2 -1
- package/dist/elements/public/CustomerPortalSettings/private/OriginsList/OriginsList.js.map +1 -1
- package/dist/elements/public/SignInForm/SignInForm.d.ts +7 -0
- package/dist/elements/public/SignInForm/SignInForm.js +57 -2
- package/dist/elements/public/SignInForm/SignInForm.js.map +1 -1
- package/dist/elements/public/SignInForm/index.d.ts +1 -0
- package/dist/elements/public/SignInForm/index.js +1 -0
- package/dist/elements/public/SignInForm/index.js.map +1 -1
- package/dist/elements/public/SignInForm/types.d.ts +3 -0
- package/dist/elements/public/SignInForm/types.js.map +1 -1
- package/dist/elements/public/SubscriptionCard/SubscriptionCard.js +2 -2
- package/dist/elements/public/SubscriptionCard/SubscriptionCard.js.map +1 -1
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js +1 -1
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js.map +1 -1
- package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.js +8 -2
- package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.js.map +1 -1
- package/dist/mixins/themeable.js +30 -25
- package/dist/mixins/themeable.js.map +1 -1
- package/dist/mixins/translatable.d.ts +3 -4
- package/dist/mixins/translatable.js +2 -6
- package/dist/mixins/translatable.js.map +1 -1
- package/package.json +2 -2
- package/dist/cdn/shared-51f550e3.js +0 -1
- package/dist/cdn/shared-6dc6912f.js +0 -1
- package/dist/cdn/shared-75bde6c4.js +0 -1
- package/dist/cdn/shared-916991a9.js +0 -1
- package/dist/cdn/shared-a494131d.js +0 -1
- package/dist/cdn/shared-c7ab8ec5.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac.js";import"./shared-45d647e4.js";import"./shared-
|
|
1
|
+
import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac.js";import"./shared-45d647e4.js";import"./shared-090432b4.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./shared-92d03925.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as e,h as t,L as s,c as r,aw as o}from"./shared-84203d52.js";import{A as i}from"./shared-96de56d4.js";import"./shared-aac9fed8.js";import{C as n}from"./shared-f06d08d5.js";import{a,T as l,R as d}from"./shared-8057ee9c.js";import{A as c}from"./shared-497fd63c.js";import{C as m,i as h}from"./shared-23966eed.js";import{N as p}from"./shared-b13a5ed3.js";import{c as u}from"./shared-4e709717.js";import"./shared-747b0842.js";import"./foxy-attribute-card.js";import"./foxy-i18n.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";import"./foxy-attribute-form.js";import"./shared-bba615b8.js";import"./shared-e0248713.js";import"./shared-3ae39e52.js";import"./shared-54c485d2.js";import"./shared-87ca7818.js";import"./shared-bf28ab5e.js";import"./shared-851b97ef.js";import"./shared-525dd8c8.js";import"./shared-a7709d26.js";import"./foxy-customer-form.js";import"./foxy-nucleon-element.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-1d0ef57d.js";import"./shared-4b33c6d2.js";import"./shared-69d0ca61.js";import"./shared-77bdf956.js";import"./shared-c70d9713.js";import"./shared-6872bf5c.js";import"./shared-e058cb87.js";import"./shared-8f34ce95.js";import"./shared-5fedf5e4.js";import"./shared-2860a3d3.js";let g,f,$=e=>e;class y extends(a(l(n),"customer-portal")){constructor(){super(...arguments),this.group=""}static get properties(){return e(e({},super.properties),{},{group:{type:String}})}render(){return this.api.storage.getItem(i.SESSION)?t(g||(g=$` <foxy-internal-customer-portal-logged-in-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" customer="${0}" group="${0}" class="h-full" lang="${0}" href="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.base,this.group,this.lang,new URL("./customer_portal_settings",this.base).toString(),this.ns,this.templates):t(f||(f=$` <foxy-internal-customer-portal-logged-out-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" group="${0}" class="h-full" lang="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-out-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.group,this.lang,this.ns,this.templates)}}let b,S,v=e=>e;const _=d(l(a(s)));let x,T,w=e=>e;class O extends(l(s)){constructor(){super(...arguments),this.href="",this.icon=""}static get properties(){return e(e({},super.properties),{},{href:{type:String},icon:{type:String}})}render(){return t(x||(x=w` <a class="flex-auto font-medium tracking-wide cursor-pointer text-s rounded-s hover-text-primary focus-text-primary focus-outline-none focus-ring-2 focus-ring-primary-50 focus-ring-offset-2" href="${0}" rel="nofollow noopener"> ${0} <slot></slot> </a> `),this.href,this.icon?t(T||(T=w`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"")}}let j,k,R,z,E,A,F,I,N,H,U=e=>e;const q=l(m(a(p)));let L,P,C,V,D,J,W,B,G,K,M=e=>e;const Q=l(m(a(s)));const X=["html"],Y=["html"];let Z,ee,te,se,re,oe,ie,ne,ae,le,de,ce,me=e=>e;const he=a(m(l(s)));let pe,ue,ge,fe=e=>e;const $e=m(l(a(s,"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends q{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var s,r,o;const i="customer:header:actions:sign-out",n=this.loggingOutState,a=!!(null===(s=this.__customerElement)||void 0===s?void 0:s.in({idle:"snapshot"}));return t(j||(j=U` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="padding:var(--lumo-space-xs);margin:0;border-radius:100%;display:flex" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${i}:before`),this.t("sign_out").toString(),this.disabledSelector.matches(i)||!a||"idle"!==n,(async function(){try{e.loggingOutState="busy",await new c(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===n?t(k||(k=U`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):t(R||(R=U` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> `),"fail"===n?"error":"busy",this.lang,this.ns,null!==(o=null===(r=customElements.get("foxy-customer"))||void 0===r?void 0:r.defaultNS)&&void 0!==o?o:""),this.renderTemplateOrSlot(`${i}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(z||(z=U`
|
|
2
2
|
${0}
|
|
3
3
|
|
|
4
4
|
<foxy-internal-customer-portal-subscriptions
|
|
@@ -15,7 +15,7 @@ import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac
|
|
|
15
15
|
</foxy-internal-customer-portal-subscriptions>
|
|
16
16
|
|
|
17
17
|
${0}
|
|
18
|
-
`),this.renderTemplateOrSlot(`${
|
|
18
|
+
`),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),this.hiddenSelector.zoom(s).toString(),t.group,t.lang,t.ns,this.getNestedTemplates(s),this.data,t.data,this.renderTemplateOrSlot(`${s}:after`))},this.__renderTransactions=(e,t)=>{const s="customer:transactions";return e(E||(E=U`
|
|
19
19
|
${0}
|
|
20
20
|
|
|
21
21
|
<foxy-internal-customer-portal-transactions
|
|
@@ -31,12 +31,12 @@ import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac
|
|
|
31
31
|
</foxy-internal-customer-portal-transactions>
|
|
32
32
|
|
|
33
33
|
${0}
|
|
34
|
-
`),this.renderTemplateOrSlot(`${
|
|
34
|
+
`),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),this.hiddenSelector.zoom(s).toString(),t.group,t.lang,t.ns,this.getNestedTemplates(s),t.data,this.renderTemplateOrSlot(`${s}:after`))}}static get properties(){return e(e({},super.properties),{},{customer:{type:String},loggingOutState:{attribute:!1},loggingOutStateResetTimeout:{attribute:!1}})}render(){var e,s;const r=this.hiddenSelector.zoom("customer"),o=[r.toString(),"header:actions:edit:form:delete","attributes","transactions","subscriptions","addresses:actions:create","payment-methods:list:card"],i=this.getNestedTemplates("customer"),n=i["header:actions:after"],a=i["header:actions:edit:form:timestamps:after"],l=i.default;return i["header:actions:after"]=(e,t)=>{const s=t.hiddenSelector.matches("header:actions:sign-out",!0);return e(A||(A=U`
|
|
35
35
|
<div style="display:flex">
|
|
36
36
|
${0}
|
|
37
37
|
${0}
|
|
38
38
|
</div>
|
|
39
|
-
`),
|
|
39
|
+
`),s?"":this.__renderHeaderActionsSignOut(),null==n?void 0:n(e,t))},i.default=(e,t)=>{const s=this.__renderSubscriptions,o=this.__renderTransactions;return e(F||(F=U`
|
|
40
40
|
<style>
|
|
41
41
|
.space-y-m > :not([hidden]) ~ :not([hidden]) {
|
|
42
42
|
--tw-space-y-reverse: 0;
|
|
@@ -51,7 +51,7 @@ import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac
|
|
|
51
51
|
${0}
|
|
52
52
|
${0}
|
|
53
53
|
</div>
|
|
54
|
-
`),
|
|
54
|
+
`),r.matches("default",!0)?"":null==l?void 0:l(e,t),r.matches("subscriptions",!0)?"":s(e,t),r.matches("transactions",!0)?"":o(e,t))},i["header:actions:edit:form:timestamps:after"]=(e,t)=>{var s,r;const o="change-password";return e(I||(I=U`
|
|
55
55
|
${0}
|
|
56
56
|
${0}
|
|
57
57
|
`),null==a?void 0:a(e,t),t.hiddenSelector.matches(o,!0)?"":e(N||(N=U`
|
|
@@ -69,7 +69,7 @@ import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac
|
|
|
69
69
|
</foxy-internal-customer-portal-change-password>
|
|
70
70
|
|
|
71
71
|
${0}
|
|
72
|
-
`),t.renderTemplateOrSlot(`${o}:before`),t.href,null!==(
|
|
72
|
+
`),t.renderTemplateOrSlot(`${o}:before`),t.href,null!==(r=null===(s=t.data)||void 0===s?void 0:s.email)&&void 0!==r?r:"",t.lang,t.ns,t.in("busy")||t.disabledSelector.matches(o,!0),t.renderTemplateOrSlot(`${o}:after`)))},t(H||(H=U` <foxy-customer readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="customer" group="${0}" href="${0}" lang="${0}" ns="${0} ${0}" id="customer" .templates="${0}" @update="${0}"> </foxy-customer> `),this.readonlySelector.zoom("customer").toString(),this.disabledSelector.zoom("customer").toString(),o.join(" ").trim(),this.group,this.customer,this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-customer"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",i,(()=>this.requestUpdate()))}disconnectedCallback(){super.disconnectedCallback(),this.loggingOutStateResetTimeout&&clearTimeout(this.loggingOutStateResetTimeout)}get __customerElement(){return this.renderRoot.querySelector("#customer")}}),customElements.define("foxy-internal-customer-portal-logged-out-view",class extends Q{constructor(){super(...arguments),this.group="",this.page="sign-in",this.__renderAccessRecoveryHeader=()=>{const{lang:e,ns:s}=this,r=this.renderRoot.querySelector("#access-recovery-form"),o=!!(null==r?void 0:r.in("busy"));return t(L||(L=M` <div class="flex flex-col leading-m font-lumo" data-testid="access-recovery:header"> ${0} <foxy-i18n class="text-xxl font-bold ${0}" lang="${0}" key="recover_access" ns="${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="recover_access_hint" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:header:before"),o?"text-disabled":"text-body",e,s,o?"text-disabled":"text-secondary",e,s,this.renderTemplateOrSlot("access-recovery:header:after"))},this.__renderAccessRecoveryBack=()=>{const e=this.renderRoot.querySelector("#access-recovery-form"),s=this.disabledSelector.zoom("access-recovery");return t(P||(P=M` <div> ${0} <vaadin-button data-testid="access-recovery:back" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="cancel"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:back:before"),!!(null==e?void 0:e.in("busy"))||s.matches("back",!0),(()=>this.page="sign-in"),this.ns,this.lang,this.renderTemplateOrSlot("access-recovery:back:after"))},this.__renderAccessRecoveryForm=()=>{var e,s;const r="access-recovery:form",o=this.hiddenSelector.zoom(r);return t(C||(C=M` <div> ${0} <foxy-access-recovery-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="access-recovery:form" parent="foxy://customer-api/recover" group="${0}" lang="${0}" ns="${0} ${0}" id="access-recovery-form" .templates="${0}" @update="${0}"> </foxy-access-recovery-form> ${0} </div> `),this.renderTemplateOrSlot(`${r}:before`),this.readonlySelector.zoom(r).toString(),this.disabledSelector.zoom(r).toString(),o.toString(),this.group,this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",this.getNestedTemplates(r),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${r}:after`))},this.__renderAccessRecovery=()=>{const e="access-recovery",s=this.hiddenSelector.zoom(e);return t(V||(V=M` <div class="h-full flex" data-testid="access-recovery"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${e}:before`),s.matches("header",!0)?"":this.__renderAccessRecoveryHeader(),s.matches("form",!0)?"":this.__renderAccessRecoveryForm(),s.matches("back",!0)?"":this.__renderAccessRecoveryBack(),this.renderTemplateOrSlot(`${e}:after`))},this.__renderSignInHeader=()=>{const{lang:e,ns:s}=this,r=this.renderRoot.querySelector("#sign-in-form"),o=!!(null==r?void 0:r.in("busy"));return t(D||(D=M` <div class="flex flex-col leading-m font-lumo" data-testid="sign-in:header"> ${0} <foxy-i18n class="text-xxl font-bold ${0}" lang="${0}" key="sign_in" ns="${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="sign_in_hint" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("sign-in:header:before"),o?"text-disabled":"text-body",e,s,o?"text-disabled":"text-secondary",e,s,this.renderTemplateOrSlot("sign-in:header:after"))},this.__renderSignInRecover=()=>{const e=this.renderRoot.querySelector("#sign-in-form"),s=this.disabledSelector.zoom("sign-in");return t(J||(J=M` <div> ${0} <vaadin-button data-testid="sign-in:recover" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="recover_access"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-in:recover:before"),!!(null==e?void 0:e.in("busy"))||s.matches("recover",!0),(()=>this.page="access-recovery"),this.ns,this.lang,this.renderTemplateOrSlot("sign-in:recover:after"))},this.__renderSignInForm=()=>{var e,s;const r="sign-in:form",o=this.hiddenSelector.zoom(r);return t(W||(W=M` <div> ${0} <foxy-sign-in-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="sign-in:form" parent="foxy://customer-api/session" group="${0}" lang="${0}" id="sign-in-form" ns="${0} ${0}" .templates="${0}" @update="${0}"> </foxy-sign-in-form> ${0} </div> `),this.renderTemplateOrSlot(`${r}:before`),this.readonlySelector.zoom(r).toString(),this.disabledSelector.zoom(r).toString(),o.toString(),this.group,this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",this.getNestedTemplates("sign-in:form"),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${r}:after`))},this.__renderSignIn=()=>{const e="sign-in",s=this.hiddenSelector.zoom(e);return t(B||(B=M` <div class="h-full flex" data-testid="sign-in"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot("sign-in:before"),s.matches("header",!0)?"":this.__renderSignInHeader(),s.matches("form",!0)?"":this.__renderSignInForm(),s.matches("recover",!0)?"":this.__renderSignInRecover(),this.renderTemplateOrSlot("sign-in:after"))}}static get properties(){return e(e({},super.properties),{},{group:{type:String},page:{type:String}})}static get styles(){return[super.styles,r(G||(G=M`.max-w-20rem{max-width:20rem}`))]}render(){const{page:e,hiddenSelector:s}=this;return"access-recovery"!==e||s.matches("access-recovery",!0)?"sign-in"!==e||s.matches("sign-in",!0)?t(K||(K=M``)):this.__renderSignIn():this.__renderAccessRecovery()}}),customElements.define("foxy-internal-customer-portal-subscriptions",class extends he{constructor(){super(...arguments),this.settings=null,this.customer=null,this.group="",this.__renderFormHeaderActionsUpdate=(e,t)=>{let s="";if(t.in({idle:"snapshot"})){const e=t.data._links["fx:sub_token_url"].href,r=new URL(e);r.searchParams.set("cart","checkout"),r.searchParams.set("sub_restart","auto"),s=r.toString()}return e(Z||(Z=me`
|
|
73
73
|
${0}
|
|
74
74
|
|
|
75
75
|
<foxy-internal-customer-portal-link
|
|
@@ -81,7 +81,7 @@ import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac
|
|
|
81
81
|
</foxy-internal-customer-portal-link>
|
|
82
82
|
|
|
83
83
|
${0}
|
|
84
|
-
`),t.renderTemplateOrSlot("header:actions:update:before"),
|
|
84
|
+
`),t.renderTemplateOrSlot("header:actions:update:before"),s,t.lang,t.ns,t.renderTemplateOrSlot("header:actions:update:after"))},this.__renderFormHeaderActionsEnd=(e,t)=>{let s="";if(t.in({idle:"snapshot"})){const e=new URL(t.data._links["fx:sub_token_url"].href);e.searchParams.set("sub_cancel","true"),s=e.toString()}return e(ee||(ee=me`
|
|
85
85
|
${0}
|
|
86
86
|
|
|
87
87
|
<foxy-internal-customer-portal-link
|
|
@@ -93,7 +93,7 @@ import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac
|
|
|
93
93
|
</foxy-internal-customer-portal-link>
|
|
94
94
|
|
|
95
95
|
${0}
|
|
96
|
-
`),t.renderTemplateOrSlot("header:actions:end:before"),
|
|
96
|
+
`),t.renderTemplateOrSlot("header:actions:end:before"),s,t.lang,t.ns,t.renderTemplateOrSlot("header:actions:end:after"))},this.__renderFormHeaderActions=(e,t)=>{const s=t.hiddenSelector.matches("header:actions:update"),r=t.hiddenSelector.matches("header:actions:end");return e(te||(te=me`
|
|
97
97
|
<style>
|
|
98
98
|
main {
|
|
99
99
|
display: flex;
|
|
@@ -113,7 +113,7 @@ import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac
|
|
|
113
113
|
</main>
|
|
114
114
|
|
|
115
115
|
${0}
|
|
116
|
-
`),t.renderTemplateOrSlot("header:actions:before"),
|
|
116
|
+
`),t.renderTemplateOrSlot("header:actions:before"),s?"":this.__renderFormHeaderActionsUpdate(e,t),r?"":this.__renderFormHeaderActionsEnd(e,t),t.renderTemplateOrSlot("header:actions:after"))},this.__renderFormItemsActionsUpdate=(e,t)=>{var s,r,o;const i=null!==(o=null===(r=null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"])||void 0===r?void 0:r.href)&&void 0!==o?o:"";return e(se||(se=me`
|
|
117
117
|
${0}
|
|
118
118
|
|
|
119
119
|
<foxy-internal-customer-portal-link
|
|
@@ -125,13 +125,13 @@ import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac
|
|
|
125
125
|
</foxy-internal-customer-portal-link>
|
|
126
126
|
|
|
127
127
|
${0}
|
|
128
|
-
`),t.renderTemplateOrSlot("items:actions:update:before"),i,t.lang,t.ns,t.renderTemplateOrSlot("items:actions:update:after"))},this.__renderForm=
|
|
128
|
+
`),t.renderTemplateOrSlot("items:actions:update:before"),i,t.lang,t.ns,t.renderTemplateOrSlot("items:actions:update:after"))},this.__renderForm=s=>{const r=e({},s.dialog.templates),o=r["header:after"],i=r["items:actions:after"];return r["header:after"]=(e,t)=>{const s=t.hiddenSelector.matches("header:actions",!0);return e(re||(re=me`
|
|
129
129
|
${0}
|
|
130
130
|
${0}
|
|
131
|
-
`),
|
|
131
|
+
`),s?"":this.__renderFormHeaderActions(e,t),null==o?void 0:o(e,t))},r["items:actions:after"]=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"]),o=t.hiddenSelector.matches("items:actions:update",!0);return e(oe||(oe=me`
|
|
132
132
|
${0}
|
|
133
133
|
${0}
|
|
134
|
-
`),
|
|
134
|
+
`),r&&!o?this.__renderFormItemsActionsUpdate(e,t):"",null==i?void 0:i(e,t))},t(ie||(ie=me` <foxy-subscription-form disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" settings="${0}" parent="${0}" group="${0}" lang="${0}" href="${0}" ns="${0}" id="form" .templates="${0}" @update="${0}" @fetch="${0}"> </foxy-subscription-form> `),s.dialog.disabledControls.toString(),s.dialog.readonlyControls.toString(),s.dialog.hiddenControls.toString(),JSON.stringify(this.settings),s.dialog.parent,s.dialog.group,s.dialog.lang,s.dialog.href,s.dialog.ns,r,s.handleUpdate,s.handleFetch)},this.__renderPageItem=e=>{let{html:t}=e,s=o(e,X);var r,i;return t(ne||(ne=me`
|
|
135
135
|
<button
|
|
136
136
|
class=${0}
|
|
137
137
|
?disabled=${0}
|
|
@@ -147,7 +147,7 @@ import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac
|
|
|
147
147
|
>
|
|
148
148
|
</foxy-subscription-card>
|
|
149
149
|
</button>
|
|
150
|
-
`),u({"block w-full border border-contrast-10 p-m rounded-t-l rounded-b-l":!0,"focus-outline-none focus-border-primary":!0,"hover-border-contrast-30":null!==
|
|
150
|
+
`),u({"block w-full border border-contrast-10 p-m rounded-t-l rounded-b-l":!0,"focus-outline-none focus-border-primary":!0,"hover-border-contrast-30":null!==s.data}),null===s.data,(e=>{const t=new URL(s.href);t.searchParams.set("zoom","last_transaction,transaction_template:items"),this.__subscriptionDialog.href=t.toString(),this.__subscriptionDialog.show(e.currentTarget)}),s.parent,s.group,s.lang,s.href,s.ns,null!==(i=null===(r=customElements.get("foxy-subscription-card"))||void 0===r?void 0:r.defaultNS)&&void 0!==i?i:"",s.templates)},this.__renderPage=e=>{let{html:t}=e,s=o(e,Y);return t(ae||(ae=me`
|
|
151
151
|
<foxy-collection-page
|
|
152
152
|
ns=${0}
|
|
153
153
|
href=${0}
|
|
@@ -158,4 +158,4 @@ import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac
|
|
|
158
158
|
.templates=${0}
|
|
159
159
|
>
|
|
160
160
|
</foxy-collection-page>
|
|
161
|
-
`),
|
|
161
|
+
`),s.ns,s.href,s.lang,s.group,this.__renderPageItem,s.templates)},this.__renderHeader=()=>t(le||(le=me` ${0} <foxy-i18n class="block text-m font-semibold" lang="${0}" key="subscription_plural" ns="${0}"> </foxy-i18n> ${0} `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{var e;const s=this.disabledSelector.zoom("list"),r=this.readonlySelector.zoom("list"),o=[this.hiddenSelector.zoom("list").zoom("form").toString(),"end-date"];return t(de||(de=me` ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" header="update" parent="${0}" group="${0}" lang="${0}" ns="${0}" id="subscription-dialog" .form="${0}" .templates="${0}"> </foxy-form-dialog> <foxy-collection-pages class="block space-y-m" first="${0}" group="${0}" lang="${0}" ns="${0}" manual .page="${0}" .templates="${0}"> </foxy-collection-pages> ${0} `),this.renderTemplateOrSlot("list:before"),r.zoom("form").toString(),s.zoom("form").toString(),o.join(" ").trim(),h(null===(e=this.customer)||void 0===e?void 0:e._links["fx:subscriptions"].href),this.group,this.lang,this.ns,this.__renderForm,this.getNestedTemplates("list:form"),this.__activeSubscriptionsLink,this.group,this.lang,this.ns,this.__renderPage,this.getNestedTemplates("list:card"),this.renderTemplateOrSlot("list:after"))}}static get properties(){return e(e({},super.properties),{},{settings:{attribute:!1},customer:{attribute:!1},group:{type:String}})}render(){return t(ce||(ce=me` <div class="space-y-s" data-testid="subscriptions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(),this.hiddenSelector.matches("list",!0)?"":this.__renderList())}get __subscriptionDialog(){return this.renderRoot.querySelector("#subscription-dialog")}get __activeSubscriptionsLink(){try{const e=new URL(this.customer._links["fx:subscriptions"].href);return e.searchParams.set("zoom","last_transaction,transaction_template:items"),e.toString()}catch(e){return""}}}),customElements.define("foxy-internal-customer-portal-transactions",class extends $e{constructor(){super(...arguments),this.customer=null,this.group="",this.__renderHeader=()=>t(pe||(pe=fe` <div> ${0} <foxy-i18n class="text-m font-semibold" lang="${0}" key="transaction_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{let e="";if(this.customer){const t=new URL(this.customer._links["fx:transactions"].href);t.searchParams.set("zoom","items"),e=t.toString()}return t(ue||(ue=fe` <div> ${0} <foxy-collection-pages spinner="foxy-spinner" group="${0}" first="${0}" class="block divide-y divide-contrast-10 px-m border border-contrast-10 rounded-t-l rounded-b-l" page="foxy-transactions-table" lang="${0}" ns="${0}" manual .templates="${0}"> </foxy-collection-pages> ${0} </div> `),this.renderTemplateOrSlot("list:before"),this.group,e,this.lang,this.ns,this.getNestedTemplates("table"),this.renderTemplateOrSlot("list:after"))}}static get properties(){return e(e({},super.properties),{},{customer:{attribute:!1},group:{type:String}})}render(){return t(ge||(ge=fe` <div class="space-y-s" data-testid="transactions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header")?"":this.__renderHeader(),this.hiddenSelector.matches("list")?"":this.__renderList())}}),customElements.define("foxy-internal-customer-portal-change-password",class extends _{constructor(){super(...arguments),this.isErrorVisible=!1,this.disabled=!1,this.customer="",this.session="",this.email="",this.step=1,this.__handleTriggerClick=e=>{const t=e.currentTarget,s=this.renderRoot.querySelector("#dialog");this.isErrorVisible=!1,this.step=1,s.show(t)},this.__handleSignInFormUpdate=(e,t)=>{var s,r,o,i;t.handleUpdate(e);const n=e.currentTarget;!(null===(s=n.form.credential)||void 0===s?void 0:s.email)&&this.email&&n.edit({type:null!==(r=n.form.type)&&void 0!==r?r:"password",credential:{email:this.email,password:null!==(i=null===(o=n.form.credential)||void 0===o?void 0:o.password)&&void 0!==i?i:""}})},this.__handleSignInFormFetch=e=>{e.defaultPrevented||"POST"===e.request.method&&e.request.url===this.session&&(e.preventDefault(),e.stopImmediatePropagation(),e.respondWith(this.__getResponse(e.request)))},this.__renderSignInForm=e=>{const s=[],r=["email"];let o="bg-primary-10",i="text-primary",n="icons:lock-outline",a="password:before";return 2===this.step&&(r.push("password"),a="new-password:before",n="icons:lock-open"),3===this.step&&(s.push("new-password"),r.push("password","submit"),o="bg-success-10",i="text-success",a="new-password:before",n="icons:done-all"),this.isErrorVisible||r.push("error"),t(b||(b=v` <foxy-sign-in-form readonlycontrols="${0}" hiddencontrols="${0}" parent="${0}" class="mt-s sm-w-narrow-modal" lang="${0}" ns="${0}" @update="${0}" @fetch="${0}"> <div class="mx-auto flex mb-m w-l h-l rounded-t-l rounded-b-l ${0}" slot="${0}"> <iron-icon icon="${0}" class="m-auto ${0}"></iron-icon> </div> <foxy-i18n class="block text-center text-m text-secondary leading-m mb-m" lang="${0}" slot="${0}" key="change_password_step_${0}" ns="${0}"> </foxy-i18n> </foxy-sign-in-form> `),s.join(" "),r.join(" "),this.session,e.dialog.lang,e.dialog.ns,(t=>this.__handleSignInFormUpdate(t,e)),this.__handleSignInFormFetch,o,a,n,i,e.dialog.lang,a,this.step,e.dialog.ns)}}static get properties(){return e(e({},super.properties),{},{isErrorVisible:{attribute:!1},disabled:{type:Boolean},customer:{type:String},session:{type:String},email:{type:String},step:{attribute:!1},fail:{attribute:!1}})}render(){return t(S||(S=v` <foxy-form-dialog hiddencontrols="save-button" header="change_password" lang="${0}" ns="${0}" alert id="dialog" .form="${0}"> </foxy-form-dialog> <vaadin-button class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="change_password" ns="${0}"></foxy-i18n> </vaadin-button> `),this.lang,this.ns,this.__renderSignInForm,this.disabled,this.__handleTriggerClick,this.lang,this.ns)}async __getResponse(e){const t=await e.clone().json(),s=new c(this);if(this.isErrorVisible=!1,1===this.step){const r=await s.fetch(e.url,{method:e.method,body:JSON.stringify(t)});if(r.ok){this.step=2;const e={_embedded:{"fx:errors":[{code:"new_password_required_error"}]}};return new c.WHATWGResponse(JSON.stringify(e),{status:400})}return this.isErrorVisible=!0,r}if(2===this.step){const r=await s.fetch(this.customer,{method:"PATCH",body:JSON.stringify({password:t.credential.new_password,password_old:t.credential.password})});return r.ok?(this.step=3,t._links={self:{href:e.url}},new c.WHATWGResponse(JSON.stringify(t))):(this.isErrorVisible=!0,r)}return s.fetch(e)}}),customElements.define("foxy-internal-customer-portal-link",O),customElements.define("foxy-customer-portal",y);export{y as CustomerPortal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-45d647e4.js";import"./shared-cd700eac.js";import{h as t}from"./shared-747b0842.js";import"./shared-b98f88c9.js";import"./shared-
|
|
1
|
+
import"./shared-45d647e4.js";import"./shared-cd700eac.js";import{h as t}from"./shared-747b0842.js";import"./shared-b98f88c9.js";import"./shared-090432b4.js";import"./foxy-payment-method-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./shared-92d03925.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./foxy-i18n.js";import{L as e,h as s,c as r,aw as a}from"./shared-84203d52.js";import{C as o,i as h}from"./shared-23966eed.js";import"./shared-e0248713.js";import{b as i,S as d,T as n,a as l}from"./shared-8057ee9c.js";import{S as m}from"./shared-bba615b8.js";import"./shared-851b97ef.js";import"./shared-54c485d2.js";import"./shared-3ae39e52.js";import{G as c}from"./shared-525dd8c8.js";import{c as v}from"./shared-4e709717.js";import{N as p}from"./shared-b13a5ed3.js";import{S as z}from"./shared-4b33c6d2.js";import"./shared-bf28ab5e.js";import"./foxy-nucleon-element.js";import"./shared-77bdf956.js";import"./shared-c70d9713.js";import"./shared-6872bf5c.js";import"./shared-87ca7818.js";import"./shared-e058cb87.js";import"./shared-96de56d4.js";import"./shared-aac9fed8.js";import"./shared-8f34ce95.js";import"./shared-1d0ef57d.js";import"./shared-69d0ca61.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";import"./shared-a7709d26.js";import"./shared-b738ee96.js";let g,f,u,b=t=>t;class $ extends e{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return i.styles}render(){const t=[],e=[];for(let r=0;r<this.size;++r)t.push(s(g||(g=b` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),r,v({"text-m font-semibold px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==r}),r,this.value===r,(()=>this.value=r),this.__handleKeyDown,r)),e.push(s(f||(f=b` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),r,r,v({hidden:this.value!==r}),this.value!==r,r));return s(u||(u=b` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-spinner.js";import"./foxy-i18n.js";import{T as s}from"./shared-
|
|
1
|
+
import"./foxy-spinner.js";import"./foxy-i18n.js";import{T as s}from"./shared-1d0ef57d.js";import{a as e}from"./shared-8057ee9c.js";import{h as a}from"./shared-84203d52.js";import"./shared-45d647e4.js";import"./shared-747b0842.js";import"./shared-cd700eac.js";import"./shared-23966eed.js";import"./foxy-nucleon-element.js";import"./shared-b13a5ed3.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";import"./shared-4e709717.js";let t,n,o,d,r=s=>s;class l extends(e(s,"customers-table")){constructor(){super(...arguments),this.columns=[l.nameColumn,l.idColumn,l.dateColumn,l.emailColumn]}}l.nameColumn={cell:s=>a(t||(t=r` <span data-testclass="names">${0} ${0}</span> `),s.data.first_name,s.data.last_name)},l.idColumn={hideBelow:"md",cell:s=>a(n||(n=r` <span role="presentation" class="text-s text-tertiary">ID </span> <span data-testclass="ids" class="text-s text-secondary font-tnum">${0}</span> `),s.data.id)},l.dateColumn={hideBelow:"md",cell:s=>a(o||(o=r` <span class="text-s text-secondary font-tnum"> <foxy-i18n data-testclass="i18n" lang="${0}" key="date_created" ns="${0}"> </foxy-i18n> <foxy-i18n data-testclass="dates i18n" lang="${0}" key="date" ns="${0}" .options="${0}"> </foxy-i18n> </span> `),s.lang,s.ns,s.lang,s.ns,{value:s.data.date_created})},l.emailColumn={cell:s=>a(d||(d=r`<span data-testclass="emails" class="text-s text-secondary">${0}</span>`),s.data.email)},l.__ns="customers-table",customElements.define("foxy-customers-table",l);export{l as CustomersTable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,h as e}from"./shared-
|
|
1
|
+
import{_ as t,h as e}from"./shared-84203d52.js";import"./shared-b98f88c9.js";import{D as s,C as n,I as i}from"./shared-bba615b8.js";import"./shared-3ae39e52.js";import{c as r}from"./shared-8057ee9c.js";import{p as a}from"./shared-87ca7818.js";import{C as o}from"./shared-a5fbfdc7.js";import"./shared-851b97ef.js";import{E as c}from"./shared-e058cb87.js";import"./shared-54c485d2.js";import"./foxy-i18n.js";import{G as m}from"./shared-525dd8c8.js";import"./shared-45d647e4.js";import"./shared-e0248713.js";import"./shared-747b0842.js";import"./shared-9f78e096.js";import"./shared-23966eed.js";import"./shared-497fd63c.js";import"./shared-4e709717.js";class h extends CustomEvent{constructor(t){super("change",{detail:t})}}class u extends CustomEvent{constructor(){super("submit",{cancelable:!0})}}let d,l,y,p,g,f,$,x,_=t=>t;class b extends r{constructor(){super("donation"),this.currency=null,this.amount=null,this.store=null,this.name=null,this.custom=null,this.amounts=null,this.frequency=null,this.frequencies=null,this.designation=null,this.designations=null,this.comment=null,this.anonymity=!1,this.anonymous=!1,this.image=null,this.code=null,this.url=null,this.cart="checkout",this.target="_top"}static get scopedElements(){return{"vaadin-text-area":customElements.get("vaadin-text-area"),"x-error-screen":c,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":s,"x-checkbox":o,"x-choice":n,"x-group":m,"x-i18n":i}}static get properties(){return t(t({},super.properties),{},{currency:{type:String},custom:{type:Array},amount:{type:Number},amounts:{type:Array},frequency:{type:String},frequencies:{type:Array},designation:{type:Array},designations:{type:Array},comment:{type:String},anonymity:{reflect:!0,type:Boolean},anonymous:{reflect:!0,type:Boolean},image:{type:String},store:{type:String},name:{type:String},code:{type:String},url:{type:String},cart:{type:String},target:{type:String},empty:{type:String}})}static get events(){return{change:h,submit:u}}submit(){this.dispatchEvent(new u)&&this.__form.submit()}render(){var t,s;if(!(this.currency&&this.amount&&this.store&&this.name))return e(d||(d=_` <x-error-screen data-testid="error" type="setup_needed" class="relative"></x-error-screen> `));const n=this.store.includes(".")?this.store:`${this.store}.foxycart.com`;return e(l||(l=_` <form target="${0}" class="sr-only" method="POST" action="https://${0}/cart" data-testid="form"> ${0} </form> <section> ${0} </section> <section> ${0} </section> <section> ${0} </section> <section> ${0} <div class="flex flex-wrap -m-s"> ${0} <div class="flex-1 p-s"> <vaadin-button class="w-full" theme="primary" data-testid="submit" @click="${0}"> <x-i18n .opts="${0}" lang="${0}" key="${0}" ns="${0}"> </x-i18n> </vaadin-button> </div> </div> </section> `),this.target,n,[...this.__data.entries()].map((([t,s])=>e(y||(y=_`<input type="hidden" name="${0}" value="${0}">`),t,s))),this.amounts&&this.amounts.length>0?e(p||(p=_` <x-group frame> <x-i18n ns="${0}" lang="${0}" key="amount" slot="header"></x-i18n> <x-choice ?custom="${0}" .getText="${0}" .items="${0}" .value="${0}" type="integer" lang="${0}" min="1" ns="${0}" data-testid="amount" @change="${0}"> </x-choice> </x-group> <slot name="amount" class="block my-m"></slot> `),this.ns,this.lang,!!(null===(t=this.custom)||void 0===t?void 0:t.includes("amount")),(t=>this.__translateAmount(parseInt(t,10))),this.amounts.map(String),this.amount.toString(),this.lang,this.ns,(t=>{const e=parseInt(t.detail);this.amount=isNaN(e)?1:e})):"",this.designations&&this.designations.length>0?e(g||(g=_` <x-dropdown .label="${0}" .items="${0}" .value="${0}" data-testid="designation" @change="${0}"> </x-dropdown> <slot name="designation" class="block my-m"></slot> `),this._t("designation").toString(),this.designations,Array.isArray(this.designation)?"${this.designation[0]}: ${this.designation[1]}":this.designation,(t=>{this.designation=t.detail})):"","string"==typeof this.comment?e(f||(f=_` <vaadin-text-area placeholder="${0}" value="${0}" label="${0}" class="w-full" data-testid="comment" @input="${0}"> </vaadin-text-area> <slot name="comment" class="block my-m"></slot> `),this._t("comment_placeholder").toString(),this.comment,this._t("comment_label").toString(),(t=>{t.stopPropagation(),this.comment=t.target.value})):"",this.anonymity?e($||($=_` <x-checkbox class="my-m" data-testid="anonymity" ?checked="${0}" @change="${0}"> ${0} </x-checkbox> `),this.anonymous,(t=>this.anonymous=t.detail),this._t("anonymous")):"",this.frequencies&&this.frequencies.length>0?e(x||(x=_` <div class="flex-1 p-s"> <x-dropdown .value="${0}" .items="${0}" .getText="${0}" data-testid="frequency" @change="${0}"> </x-dropdown> </div> `),this.frequency,this.frequencies,this.__translateFrequency.bind(this),(t=>{this.frequency=t.detail})):"",(()=>this.submit()),{amount:this.__translateAmount(this.amount),frequency:this.frequency?this.__translateFrequency(this.frequency):""},this.lang,this.frequency&&!(null===(s=this.frequencies)||void 0===s?void 0:s.length)?"donate_recurrently":"donate",this.ns)}updated(){this.dispatchEvent(new h(this.__data))}get __data(){const t=new FormData;return"string"==typeof this.designation&&t.set("Designation",this.designation.trim()),"number"==typeof this.amount&&"string"==typeof this.currency&&t.set("price",`${this.amount.toFixed(2)}${this.currency}`),this.frequency&&t.set("sub_frequency",this.frequency),"string"==typeof this.comment&&t.set("Comment",this.comment.trim()),"string"==typeof this.image&&t.set("image",this.image),"string"==typeof this.code&&t.set("code",this.code),"string"==typeof this.name&&t.set("name",this.name.trim()),"string"==typeof this.url&&t.set("url",this.url),"string"==typeof this.cart&&t.set("cart",this.cart),this.empty&&t.set("empty",this.empty),this.anonymous&&t.set("Anonymous","true"),t.set("quantity","1"),t}get __form(){return this.shadowRoot.querySelector("form")}__translateFrequency(t){if(!t||t.match(/^\s*$/))return this._t("frequency_once");if(".5m"===t)return this._t("frequency_0_5m");const{count:e,units:s}=a(t);return this._t("frequency",{units:this._t(s,{count:e}),count:e})}__translateAmount(t){return t.toLocaleString(this.lang,{minimumFractionDigits:0,currency:this.currency,style:"currency"})}}customElements.define("foxy-donation",b);export{b as Donation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as e,c as s,h as t,aw as r,_ as a}from"./shared-
|
|
1
|
+
import{L as e,c as s,h as t,aw as r,_ as a}from"./shared-84203d52.js";import{T as i,a as n,S as o}from"./shared-8057ee9c.js";import{c as l}from"./shared-4e709717.js";import{G as d}from"./shared-525dd8c8.js";import"./foxy-nucleon-element.js";import{N as c}from"./shared-b13a5ed3.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";let p,u,m,x=e=>e;class y extends(i(e)){constructor(){super(...arguments),this.data=[]}static get properties(){return{data:{type:Array}}}static get styles(){return[super.styles,s(p||(p=x`dd,dt{display:inline-block;overflow:hidden;vertical-align:top;overflow-wrap:anywhere}dt{min-width:calc(5 * var(--lumo-size-l));padding-right:.5em}dd{max-width:calc(15 * var(--lumo-size-l));min-width:calc(10 * var(--lumo-size-l))}`))]}render(){return t(u||(u=x` <dl class="space-y-s"> ${0} </dl> `),this.data.map((e=>{const s=String(e[1]).trim();return t(m||(m=x` <div> <dt class="text-secondary truncate">${0}</dt> <dd class="${0}">${0}</dd> </div> `),e[0],l({"text-tertiary":!s}),s||"–")})))}}let f,h,g=e=>e;const v=["_links","_embedded"],$=n(i(o(c)));class _ extends ${static get scopedElements(){return{"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":y}}render(){if(this.in({idle:"snapshot"})){const e=this.data,s=r(e,v);return t(f||(f=g` <x-data-list aria-live="polite" aria-busy="false" class="leading-s text-s" data="${0}"> </x-data-list> `),JSON.stringify(Array.from(Object.entries(s))))}const e=this.in("busy");return t(h||(h=g` <div aria-live="polite" aria-busy="${0}" data-testid="wrapper" class="flex justify-center"> <foxy-spinner data-testid="spinner" layout="horizontal" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> `),e,this.in("fail")?"error":e?"busy":"empty",this.lang,this.ns)}}let b,w,j,k,S,E,O,N,T,z=e=>e;const G=n(i(o(c)),"error-entry-card");class J extends G{constructor(){super(...arguments),this.open=!1}static get scopedElements(){return{"x-resource-viewer":_,"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":y,"iron-icon":customElements.get("iron-icon"),"foxy-i18n":customElements.get("foxy-i18n"),"x-group":d}}static get properties(){return a(a({},super.properties),{},{open:{type:Boolean,reflect:!0}})}render(){const e=this.data,s=this.in("busy");if(e){const{hide_error:r}=e,{open:a}=this;return t(b||(b=z` <details aria-busy="${0}" aria-live="polite" class="text-body w-full" ?open="${0}" @toggle="${0}"> <summary class="rounded-s ring-offset-4 ring-primary-50 focus-outline-none focus-ring-2"> <div style="padding-left:calc(var(--lumo-space-xs) + var(--lumo-space-s) - 1px)" class="${0}"> ${0} </div> </summary> ${0} </details> `),s,a,this.__handleToggle,l({"border-l-2 leading-s relative cursor-pointer":!0,"border-contrast":r&&!a,"border-primary":!r,"border-error":r&&a,"h-l":!a}),this.__renderSummary(e),a?this.__renderDetails(e):"")}return t(w||(w=z` <div aria-busy="${0}" aria-live="polite" style="padding-left:calc(var(--lumo-space-xs) + var(--lumo-space-s) - 1px)" class="flex items-center justify-center border-l-2 leading-s relative border-contrast-10 h-l"> <foxy-spinner data-testid="spinner" layout="horizontal" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> `),s,s?"busy":this.in("fail")?"error":"empty",this.lang,this.ns)}__renderGetOrPostValues(e,s){const r=e||s,a=new URLSearchParams(this.__decodeHtml(r));return t(j||(j=z` <div class="relative leading-xs pt-s"> <div class="absolute font-semibold right-0 text-tertiary text-xs top-0 mt-s">${0}</div> <x-data-list data="${0}"></x-data-list> </div> `),e?"GET":"POST",JSON.stringify(Array.from(a.entries())))}__renderReferrer(e){return t(k||(k=z` <span class="text-secondary">Navigated from</span> <a target="_blank" class="font-semibold text-primary hover-underline" href="${0}" rel="nofollow noopener noreferrer"> ${0} </a> `),e,e)}__renderSummary(e){return t(S||(S=z` <div class="text-s absolute right-0 top-0 text-tertiary"> <iron-icon icon="icons:expand-${0}"></iron-icon> </div> <div class="text-s mb-xs ${0}"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </div> <p class="${0} overflow-hidden font-medium"> ${0} </p> `),this.open?"less":"more",e.hide_error?"text-error":"text-primary",JSON.stringify({value:e.date_created}),this.lang,this.ns,JSON.stringify({value:e.date_created}),this.lang,this.ns,this.open?"":"truncate",e.error_message)}__renderDetails(e){return t(E||(E=z` <div class="space-y-m pt-m"> <x-group frame> <foxy-i18n slot="header" lang="${0}" key="request" ns="${0}"></foxy-i18n> <div class="mx-xs p-s text-s divide-y divide-contrast-10 space-y-s"> <p> <span class="block font-semibold">${0}</span> ${0} </p> ${0} </div> </x-group> <x-group frame> <foxy-i18n slot="header" lang="${0}" key="client" ns="${0}"></foxy-i18n> <div class="text-s flex flex-col mx-xs p-s"> <span class="font-semibold"> ${0} ${0} </span> ${0} </div> </x-group> ${0} </div> `),this.lang,this.ns,e.url,e.referrer?this.__renderReferrer(e.referrer):"",e.get_values||e.post_values?this.__renderGetOrPostValues(e.get_values,e.post_values):"",this.lang,this.ns,e.ip_address,e.ip_country?t(O||(O=z`<span class="text-tertiary"> • </span>${0}`),e.ip_country):"",e.user_agent?t(N||(N=z`<span class="text-secondary">${0}</span>`),e.user_agent):"",Object.entries(e._links).map((([e,s])=>["self","fx:store","curies"].includes(e)?"":t(T||(T=z` <x-group frame> <foxy-i18n slot="header" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <x-resource-viewer class="p-s mx-xs" href="${0}" lang="${0}" ns="${0}"> </x-resource-viewer> </x-group> `),this.lang,e.substr(3),this.ns,s.href,this.lang,this.ns))))}__handleToggle(e){var s;const t=e.target;t.open&&!1===(null===(s=this.data)||void 0===s?void 0:s.hide_error)&&(this.edit({hide_error:!0}),this.submit()),this.open=t.open}__decodeHtml(e){const s=document.createElement("textarea");return s.innerHTML=e,s.value}}customElements.define("foxy-error-entry-card",J);export{J as ErrorEntryCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-i18n.js";import"./shared-
|
|
1
|
+
import"./foxy-i18n.js";import"./shared-bf28ab5e.js";import{F as e,_ as t,h as o}from"./shared-84203d52.js";import{A as r}from"./shared-497fd63c.js";import{D as n}from"./shared-851b97ef.js";import{U as s}from"./shared-7684cb05.js";import"./shared-8057ee9c.js";import"./shared-b98f88c9.js";import"./shared-747b0842.js";import"./shared-23966eed.js";import"./shared-4e709717.js";let i,d,a=e=>e;class l extends n{constructor(){super(...arguments),this.parent="",this.group="",this.href="",this.__form=null,this.__renderForm=null,this.__handleFetch=t=>{t instanceof e&&(t.stopImmediatePropagation(),t.preventDefault(),t.respondWith(new r(this).fetch(t.request).then((e=>{const o=t.request.url===this.href&&"DELETE"===t.request.method,r=t.request.url===this.parent&&"POST"===t.request.method;return e.ok&&(o||r)&&(this.open=!1),e}))))},this.__handleUpdate=e=>{if(!(e instanceof s))return;const t=e.target;this.closable=!t.in("busy"),this.editable=t.in({idle:{template:{clean:"valid"}}})||t.in({idle:{template:{dirty:"valid"}}})||t.in({idle:{snapshot:{dirty:"valid"}}})}}static get properties(){return t(t({},super.properties),{},{href:{type:String},form:{type:String,noAccessor:!0},group:{type:String},parent:{type:String}})}get form(){return this.__form}set form(e){this.__form=e,this.__renderForm="string"==typeof e?new Function("options",`return options.html\`\n <${e}\n id="form"\n ns="\${options.dialog.ns} \${customElements.get('${e}')?.defaultNS ?? ''}"\n href=\${options.dialog.href}\n lang=\${options.dialog.lang}\n group=\${options.dialog.group}\n parent=\${options.dialog.parent}\n disabledcontrols=\${options.dialog.disabledControls.toString()}\n readonlycontrols=\${options.dialog.readonlyControls.toString()}\n hiddencontrols=\${options.dialog.hiddenControls.toString()}\n ?disabled=\${options.dialog.disabled}\n ?readonly=\${options.dialog.readonly}\n ?hidden=\${options.dialog.hidden}\n .templates=\${options.dialog.templates}\n @fetch=\${options.handleFetch}\n @update=\${options.handleUpdate}\n >\n </${e}>\``):e,this.requestUpdate()}render(){return o(i||(i=a` <foxy-internal-confirm-dialog message="undo_message" confirm="undo_confirm" cancel="undo_cancel" header="undo_header" theme="error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} `),this.lang,this.ns,(e=>!e.detail.cancelled&&super.hide(!0)),super.render((()=>{var e;return o(d||(d=a`${0}`),null===(e=this.__renderForm)||void 0===e?void 0:e.call(this,{handleUpdate:this.__handleUpdate,handleFetch:this.__handleFetch,dialog:this,html:o}))})))}async hide(e=!1){if(!e)return super.hide(e);this.renderRoot.querySelector("#confirm").show()}async save(){this.renderRoot.querySelector("#form").submit()}}customElements.define("foxy-form-dialog",l);export{l as FormDialog};
|
package/dist/cdn/foxy-i18n.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e,A as t,_ as n,h as r,L as s}from"./shared-
|
|
1
|
+
import{F as e,A as t,_ as n,h as r,L as s}from"./shared-84203d52.js";import{a as o,i}from"./shared-8057ee9c.js";const a={type:"backend",init:()=>{},read:(n,r,s)=>{const o=async e=>{const t=e.ok?null:new Error(await e.text()),n=!!e.ok&&await e.json();s(t,n)},i=e=>{const t=e instanceof Error?e:new Error(String(e));s(t,!1)},a=new e("fetch",{cancelable:!0,composed:!0,bubbles:!0,request:new t.WHATWGRequest(`foxy://i18n/${r}/${n}`),resolve:o,reject:i});dispatchEvent(a),a.defaultPrevented||fetch(a.request).then(o).catch(i)},create:()=>{throw new Error("foxy-i18n does not support resource creation")}};let c,l=e=>e;class u extends(o(s,"")){constructor(){super(...arguments),this.options={},this.key=""}static onTranslationChange(e){const t=["initialized","loaded"],n=["removed","added"];return t.forEach((t=>u.i18next.on(t,e))),n.forEach((t=>u.i18next.store.on(t,e))),()=>{t.forEach((t=>u.i18next.off(t,e))),n.forEach((t=>u.i18next.store.off(t,e)))}}static onResourceFetch(t){const n=n=>{if(n instanceof e&&n.request.url.startsWith("foxy://i18n/")){const[e,r]=n.request.url.split("/").reverse();n.respondWith(t(r,e))}};return addEventListener("fetch",n),()=>removeEventListener("fetch",n)}static get properties(){return n(n({},super.properties),{},{options:{type:Object},key:{type:String}})}connectedCallback(){super.connectedCallback(),this.__unsubscribe=u.onTranslationChange((()=>this.requestUpdate()))}render(){return r(c||(c=l`${0}`),this.t(this.key,n(n({},this.options),{},{lng:this.lang})))}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.__unsubscribe)||void 0===e||e.call(this)}}u.FetchEvent=e,u.i18next=i.createInstance().use(a),u.i18next.init({interpolation:{format:(...e)=>{var t,n,r;const s=e[0],o=null!==(n=null===(t=e[1])||void 0===t?void 0:t.split(" "))&&void 0!==n?n:[],i=null!==(r=e[2])&&void 0!==r?r:"en";return o.reduce(((e,t)=>"price"===t?((e,t,n)=>{try{const[t,r]=e.split(" ");return parseFloat(t).toLocaleString(n,{maximumFractionDigits:2,minimumFractionDigits:2,style:"currency",currency:r})}catch(t){return e}})(e,0,i):"date"===t?((e,t,n)=>{const r=new Date(e);return r.toLocaleDateString(n,{month:"long",year:(new Date).getFullYear()===r.getFullYear()?void 0:"numeric",day:"numeric"})})(e,0,i):"time"===t?((e,t,n)=>new Date(e).toLocaleTimeString(n,{hour:"numeric",minute:"numeric"}))(e,0,i):e),s)}},fallbackLng:"en",fallbackNS:"shared",defaultNS:"shared",ns:["shared"]}),customElements.define("foxy-i18n",u);export{u as I18n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as Item,I as ItemsForm}from"./shared-
|
|
1
|
+
export{a as Item,I as ItemsForm}from"./shared-6872bf5c.js";import"./shared-84203d52.js";import"./shared-b98f88c9.js";import"./shared-747b0842.js";import"./shared-87ca7818.js";import"./shared-45d647e4.js";import"./shared-e0248713.js";import"./shared-8057ee9c.js";import"./shared-bba615b8.js";import"./shared-3ae39e52.js";import"./shared-54c485d2.js";import"./foxy-i18n.js";import"./shared-9f78e096.js";import"./shared-851b97ef.js";import"./shared-497fd63c.js";import"./shared-23966eed.js";import"./shared-4e709717.js";import"./shared-e058cb87.js";import"./shared-cd700eac.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as e}from"./shared-
|
|
1
|
+
import{N as e}from"./shared-b13a5ed3.js";export{N as NucleonElement}from"./shared-b13a5ed3.js";import"./shared-84203d52.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";customElements.define("foxy-nucleon",e);
|