@foxy.io/elements 1.39.0-beta.3 → 1.39.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/cdn/foxy-admin-subscription-card.js +1 -1
  2. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  3. package/dist/cdn/foxy-cancellation-form.js +1 -1
  4. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  5. package/dist/cdn/foxy-customer-portal.js +6 -10
  6. package/dist/cdn/foxy-customer.js +1 -1
  7. package/dist/cdn/foxy-donation.js +1 -1
  8. package/dist/cdn/foxy-error-entry-card.js +1 -1
  9. package/dist/cdn/foxy-item-card.js +1 -1
  10. package/dist/cdn/foxy-report-form.js +1 -1
  11. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  12. package/dist/cdn/foxy-subscription-card.js +1 -1
  13. package/dist/cdn/foxy-subscription-form.js +1 -1
  14. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  15. package/dist/cdn/{shared-56d70cc2.js → shared-230dee11.js} +5 -5
  16. package/dist/cdn/shared-84eb85dd.js +1 -0
  17. package/dist/cdn/shared-ada5e9f5.js +1 -0
  18. package/dist/cdn/translations/customer/en.json +18 -10
  19. package/dist/cdn/translations/customer-portal/de.json +33 -13
  20. package/dist/cdn/translations/customer-portal/en.json +24 -8
  21. package/dist/cdn/translations/customer-portal/es.json +32 -12
  22. package/dist/cdn/translations/customer-portal/fr.json +33 -13
  23. package/dist/cdn/translations/customer-portal/nl.json +33 -13
  24. package/dist/cdn/translations/customer-portal/pl.json +33 -13
  25. package/dist/cdn/translations/customer-portal/sv.json +33 -13
  26. package/dist/cdn/translations/customer-portal/zh-hk.json +34 -14
  27. package/dist/cdn/translations/store-shipping-method-form/en.json +4 -3
  28. package/dist/cdn/translations/subscription-card/en.json +8 -0
  29. package/dist/cdn/translations/subscription-form/en.json +16 -8
  30. package/dist/elements/private/Group/Group.js +2 -2
  31. package/dist/elements/private/Group/Group.js.map +1 -1
  32. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLink.js +2 -2
  33. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLink.js.map +1 -1
  34. package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js +3 -6
  35. package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js.map +1 -1
  36. package/dist/elements/public/ItemCard/ItemCard.d.ts +3 -1
  37. package/dist/elements/public/ItemCard/ItemCard.js +20 -9
  38. package/dist/elements/public/ItemCard/ItemCard.js.map +1 -1
  39. package/dist/elements/public/ItemCard/types.d.ts +4 -2
  40. package/dist/elements/public/ItemCard/types.js.map +1 -1
  41. package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js +25 -4
  42. package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js.map +1 -1
  43. package/dist/elements/public/SubscriptionCard/SubscriptionCard.d.ts +4 -1
  44. package/dist/elements/public/SubscriptionCard/SubscriptionCard.js +19 -6
  45. package/dist/elements/public/SubscriptionCard/SubscriptionCard.js.map +1 -1
  46. package/dist/elements/public/SubscriptionCard/types.d.ts +4 -2
  47. package/dist/elements/public/SubscriptionCard/types.js.map +1 -1
  48. package/dist/elements/public/SubscriptionForm/SubscriptionForm.js +20 -7
  49. package/dist/elements/public/SubscriptionForm/SubscriptionForm.js.map +1 -1
  50. package/dist/utils/get-subscription-status.d.ts +3 -1
  51. package/dist/utils/get-subscription-status.js +27 -0
  52. package/dist/utils/get-subscription-status.js.map +1 -1
  53. package/package.json +2 -2
  54. package/dist/cdn/shared-4f64c35e.js +0 -1
  55. package/dist/cdn/shared-e2675ed0.js +0 -1
@@ -1,4 +1,4 @@
1
- import"./foxy-customer.js";import"./shared-8ef0ca65.js";import"./shared-c18f681b.js";import"./shared-37348820.js";import"./shared-4a4f6eb9.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-5b4e2567.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import{u as s}from"./shared-2508187b.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{_ as r,B as o,aH as i}from"./shared-cb58dfcd.js";import{h as a,L as n,c as d}from"./shared-ba5c42c7.js";import{A as l}from"./shared-99a8889a.js";import"./shared-673d668a.js";import{C as c}from"./shared-1d0839af.js";import{a as m,T as u}from"./shared-11351c00.js";import{U as p}from"./shared-cd96ff03.js";import{i as h}from"./shared-53e42a77.js";import{c as f}from"./shared-4e709717.js";import{A as g}from"./shared-5592ec6e.js";import{C as y}from"./shared-5afb584d.js";import{I as $}from"./shared-2aa23b5f.js";import"./shared-21e68b72.js";import"./foxy-update-payment-method-form.js";import"./shared-27cfa174.js";import"./shared-0c134ce7.js";import"./shared-f9ac8763.js";import"./shared-315d7620.js";import"./shared-6957b8e6.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-80a1bf6f.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-f83207fb.js";import"./shared-343d1fd7.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-copy-to-clipboard.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./foxy-nucleon-element.js";import"./shared-53e476fd.js";import"./shared-bab2ea2c.js";import"./foxy-template-set-card.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";import"./foxy-payment-card-embed.js";import"./shared-be442f26.js";import"./shared-8b0f00fa.js";import"./shared-c1e86ea4.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import"./shared-5fd5805c.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-cc7e1dc6.js";import"./shared-3a952968.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./shared-9e8ed3af.js";import"./shared-eea8debb.js";import"./shared-243456aa.js";import"./shared-651c44fa.js";import"./shared-edeeb089.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-afe24913.js";import"./shared-d0aed1c1.js";import"./foxy-table.js";import"./shared-e3421ca1.js";import"./shared-c46affa4.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-495860b4.js";import"./shared-6683daed.js";import"./shared-a03facdf.js";import"./shared-a587fd4b.js";import"./shared-4f64c35e.js";import"./shared-56d70cc2.js";import"./shared-8eeddc22.js";import"./shared-e2675ed0.js";import"./shared-cf613436.js";import"./shared-c05643e6.js";import"./shared-f69aacbc.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-3661a086.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-eb963ba3.js";import"./shared-a6b2bd14.js";import"./shared-8b25a098.js";import"./shared-b738ee96.js";import"./shared-f1033d78.js";
1
+ import"./foxy-customer.js";import"./shared-8ef0ca65.js";import"./shared-c18f681b.js";import"./shared-37348820.js";import"./shared-4a4f6eb9.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-5b4e2567.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import{u as s}from"./shared-2508187b.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{_ as r,B as o,aH as i}from"./shared-cb58dfcd.js";import{h as a,L as n,c as d}from"./shared-ba5c42c7.js";import{A as l}from"./shared-99a8889a.js";import"./shared-673d668a.js";import{C as c}from"./shared-1d0839af.js";import{a as m,T as u}from"./shared-11351c00.js";import{U as p}from"./shared-cd96ff03.js";import{i as h}from"./shared-53e42a77.js";import{c as f}from"./shared-4e709717.js";import{A as g}from"./shared-5592ec6e.js";import{C as y}from"./shared-5afb584d.js";import{I as $}from"./shared-2aa23b5f.js";import"./shared-21e68b72.js";import"./foxy-update-payment-method-form.js";import"./shared-27cfa174.js";import"./shared-0c134ce7.js";import"./shared-f9ac8763.js";import"./shared-315d7620.js";import"./shared-6957b8e6.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-80a1bf6f.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-f83207fb.js";import"./shared-343d1fd7.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-copy-to-clipboard.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./foxy-nucleon-element.js";import"./shared-53e476fd.js";import"./shared-bab2ea2c.js";import"./foxy-template-set-card.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";import"./foxy-payment-card-embed.js";import"./shared-be442f26.js";import"./shared-8b0f00fa.js";import"./shared-c1e86ea4.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import"./shared-5fd5805c.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-cc7e1dc6.js";import"./shared-3a952968.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./shared-9e8ed3af.js";import"./shared-eea8debb.js";import"./shared-243456aa.js";import"./shared-651c44fa.js";import"./shared-edeeb089.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-afe24913.js";import"./shared-d0aed1c1.js";import"./foxy-table.js";import"./shared-e3421ca1.js";import"./shared-c46affa4.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-495860b4.js";import"./shared-6683daed.js";import"./shared-a03facdf.js";import"./shared-a587fd4b.js";import"./shared-84eb85dd.js";import"./shared-230dee11.js";import"./shared-8eeddc22.js";import"./shared-ada5e9f5.js";import"./shared-cf613436.js";import"./shared-c05643e6.js";import"./shared-f69aacbc.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-3661a086.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-eb963ba3.js";import"./shared-a6b2bd14.js";import"./shared-8b25a098.js";import"./shared-b738ee96.js";import"./shared-f1033d78.js";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,7 +12,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function v(e,t,s){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,s),s}let b,x,S,_=e=>e;var j;class w extends(m(u(c),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[t.priceColumn,t.summaryColumn,t.statusColumn,t.idColumn,t.dateColumn,t.receiptColumn],j.set(this,null),this.skipPasswordReset=!1,this.embedUrl=null,this.group=""}static get properties(){return r(r({},super.properties),{},{transactionsTableColumns:{attribute:!1},skipPasswordReset:{type:Boolean,attribute:"skip-password-reset"},embedUrl:{attribute:"embed-url"},group:{type:String}})}render(){var e,t;let s;try{s=new URL("./customer_portal_settings",this.base)}catch(e){s=void 0}return this.api.storage.getItem(l.SESSION)?!this.skipPasswordReset&&this.api.usesTemporaryPassword?a(b||(b=_` <foxy-internal-customer-portal-password-reset-view password-old="${0}" infer="password-reset" href="${0}" @update="${0}"> </foxy-internal-customer-portal-password-reset-view> `),h(null!==(e=function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}(this,j))&&void 0!==e?e:void 0),this.base,(e=>{var t;(null===(t=e.detail)||void 0===t?void 0:t.result)===p.UpdateResult.ResourceUpdated&&(this.api.usesTemporaryPassword=!1,v(this,j,null),this.requestUpdate())})):a(x||(x=_` <foxy-internal-customer-portal-logged-in-view embed-url="${0}" customer="${0}" class="h-full" infer="" href="${0}" .transactionsTableColumns="${0}"> </foxy-internal-customer-portal-logged-in-view> `),h(null!==(t=this.embedUrl)&&void 0!==t?t:void 0),this.base,h(null==s?void 0:s.toString()),this.transactionsTableColumns):a(S||(S=_` <foxy-internal-customer-portal-logged-out-view class="h-full" infer="" href="${0}" @password="${0}"> </foxy-internal-customer-portal-logged-out-view> `),h(null==s?void 0:s.toString()),(e=>{v(this,j,e.detail)}))}updated(e){super.updated(e);!(null!==this.api.storage.getItem(l.SESSION))||!this.skipPasswordReset&&this.api.usesTemporaryPassword||v(this,j,null)}}j=new WeakMap;let T,k,O,R,U=e=>e;class z extends(u(n)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return r(r({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=f({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),t=a(T||(T=U` ${0} <slot></slot> `),this.icon?a(k||(k=U`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?a(O||(O=U`<button class="${0}" disabled="disabled">${0}</button>`),e,t):a(R||(R=U` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let E,N,A,C,I,H,F,P,q=e=>e;const L=m(e);let B,D,G,J,M,W,K,Q,V,X,Y,Z,ee,te,se,re=e=>e;const oe=m(e);const ie=["html"],ae=["html"];let ne,de,le,ce,me,ue,pe,he,fe,ge,ye,$e,ve=e=>e;const be=m(y(u($(n))));let xe,Se,_e,je=e=>e;const we=y(u(m($(n),"customer-portal")));let Te,ke,Oe=e=>e;const Re=s.passwordStrength;class Ue extends(m(e)){constructor(){super(...arguments),this.passwordOld=null,this.__generatorOptions={checkStrength:e=>Re(e).id>=2}}static get properties(){return r(r({},super.properties),{},{passwordOld:{attribute:"password-old"}})}static get styles(){return[super.styles,d(Te||(Te=Oe`.max-w-25rem{max-width:25rem}`))]}static get v8n(){return[({password:e})=>!!e||"password:v8n_required",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({password:e})=>!e||Re(e).id>=2||"password:v8n_too_weak"]}renderBody(){return a(ke||(ke=Oe` <div class="m-auto max-w-25rem leading-s"> <p class="text-xxl font-medium ${0}"> <foxy-i18n infer="" key="title"></foxy-i18n> </p> <p class="text-l ${0}"> <foxy-i18n infer="" key="subtitle"></foxy-i18n> </p> <foxy-internal-password-control infer="password" class="mt-m" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> <vaadin-button class="w-full mt-l" theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="submit"></foxy-i18n> </vaadin-button> </div> `),this.in("busy")?"text-disabled":"text-body",this.in("busy")?"text-disabled":"text-secondary",this.__generatorOptions,this.disabled||!this.in("idle"),(()=>this.submit()))}submit(){var e;this.edit({password_old:null!==(e=this.passwordOld)&&void 0!==e?e:""}),super.submit()}}customElements.define("foxy-internal-customer-portal-logged-in-view",class extends L{constructor(){var e;super(...arguments),e=this,this.customer="",this.embedUrl=null,this.loggingOutState="idle",this.transactionsTableColumns=[],this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,s,r,o,i;const n="customer:header:actions:sign-out",d=this.loggingOutState,l=this.disabledSelector.matches(n)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==d,c={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:l?"default":"pointer"};return a(E||(E=q` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${n}:before`),this.t("sign_out").toString(),Object.entries(c).reduce(((e,[t,s])=>`${e}${t}:${s};`),""),l,(async function(){try{e.loggingOutState="busy",await new g(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"===d?a(N||(N=q`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):a(A||(A=q` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===d?"error":"busy",this.lang,[this.ns,null!==(r=null===(s=customElements.get("foxy-customer"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",null!==(i=null===(o=customElements.get("foxy-spinner"))||void 0===o?void 0:o.defaultNS)&&void 0!==i?i:""].join(" ")),this.renderTemplateOrSlot(`${n}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(C||(C=q`
15
+ ***************************************************************************** */function v(e,t,s){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,s),s}let b,x,S,_=e=>e;var j;class w extends(m(u(c),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[t.priceColumn,t.summaryColumn,t.statusColumn,t.idColumn,t.dateColumn,t.receiptColumn],j.set(this,null),this.skipPasswordReset=!1,this.embedUrl=null,this.group=""}static get properties(){return r(r({},super.properties),{},{transactionsTableColumns:{attribute:!1},skipPasswordReset:{type:Boolean,attribute:"skip-password-reset"},embedUrl:{attribute:"embed-url"},group:{type:String}})}render(){var e,t;let s;try{s=new URL("./customer_portal_settings",this.base)}catch(e){s=void 0}return this.api.storage.getItem(l.SESSION)?!this.skipPasswordReset&&this.api.usesTemporaryPassword?a(b||(b=_` <foxy-internal-customer-portal-password-reset-view password-old="${0}" infer="password-reset" href="${0}" @update="${0}"> </foxy-internal-customer-portal-password-reset-view> `),h(null!==(e=function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}(this,j))&&void 0!==e?e:void 0),this.base,(e=>{var t;(null===(t=e.detail)||void 0===t?void 0:t.result)===p.UpdateResult.ResourceUpdated&&(this.api.usesTemporaryPassword=!1,v(this,j,null),this.requestUpdate())})):a(x||(x=_` <foxy-internal-customer-portal-logged-in-view embed-url="${0}" customer="${0}" class="h-full" infer="" href="${0}" .transactionsTableColumns="${0}"> </foxy-internal-customer-portal-logged-in-view> `),h(null!==(t=this.embedUrl)&&void 0!==t?t:void 0),this.base,h(null==s?void 0:s.toString()),this.transactionsTableColumns):a(S||(S=_` <foxy-internal-customer-portal-logged-out-view class="h-full" infer="" href="${0}" @password="${0}"> </foxy-internal-customer-portal-logged-out-view> `),h(null==s?void 0:s.toString()),(e=>{v(this,j,e.detail)}))}updated(e){super.updated(e);!(null!==this.api.storage.getItem(l.SESSION))||!this.skipPasswordReset&&this.api.usesTemporaryPassword||v(this,j,null)}}j=new WeakMap;let T,k,O,R,U=e=>e;class z extends(u(n)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return r(r({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=f({"flex-auto leading-m font-medium tracking-wide text-m rounded-s transition-colors":!0,"text-primary hover-underline hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),t=a(T||(T=U` ${0} <slot></slot> `),this.icon?a(k||(k=U`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?a(O||(O=U`<button class="${0}" disabled="disabled">${0}</button>`),e,t):a(R||(R=U` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let E,N,A,C,I,H,F,P,q=e=>e;const L=m(e);let B,D,G,J,M,W,K,Q,V,X,Y,Z,ee,te,se,re=e=>e;const oe=m(e);const ie=["html"],ae=["html"];let ne,de,le,ce,me,ue,pe,he,fe,ge,ye,$e,ve=e=>e;const be=m(y(u($(n))));let xe,Se,_e,je=e=>e;const we=y(u(m($(n),"customer-portal")));let Te,ke,Oe=e=>e;const Re=s.passwordStrength;class Ue extends(m(e)){constructor(){super(...arguments),this.passwordOld=null,this.__generatorOptions={checkStrength:e=>Re(e).id>=2}}static get properties(){return r(r({},super.properties),{},{passwordOld:{attribute:"password-old"}})}static get styles(){return[super.styles,d(Te||(Te=Oe`.max-w-25rem{max-width:25rem}`))]}static get v8n(){return[({password:e})=>!!e||"password:v8n_required",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({password:e})=>!e||Re(e).id>=2||"password:v8n_too_weak"]}renderBody(){return a(ke||(ke=Oe` <div class="m-auto max-w-25rem leading-s"> <p class="text-xxl font-medium ${0}"> <foxy-i18n infer="" key="title"></foxy-i18n> </p> <p class="text-l ${0}"> <foxy-i18n infer="" key="subtitle"></foxy-i18n> </p> <foxy-internal-password-control infer="password" class="mt-m" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> <vaadin-button class="w-full mt-l" theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="submit"></foxy-i18n> </vaadin-button> </div> `),this.in("busy")?"text-disabled":"text-body",this.in("busy")?"text-disabled":"text-secondary",this.__generatorOptions,this.disabled||!this.in("idle"),(()=>this.submit()))}submit(){var e;this.edit({password_old:null!==(e=this.passwordOld)&&void 0!==e?e:""}),super.submit()}}customElements.define("foxy-internal-customer-portal-logged-in-view",class extends L{constructor(){var e;super(...arguments),e=this,this.customer="",this.embedUrl=null,this.loggingOutState="idle",this.transactionsTableColumns=[],this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,s,r,o,i;const n="customer:header:actions:sign-out",d=this.loggingOutState,l=this.disabledSelector.matches(n)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==d,c={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:l?"default":"pointer"};return a(E||(E=q` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${n}:before`),this.t("sign_out").toString(),Object.entries(c).reduce(((e,[t,s])=>`${e}${t}:${s};`),""),l,(async function(){try{e.loggingOutState="busy",await new g(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"===d?a(N||(N=q`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):a(A||(A=q` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===d?"error":"busy",this.lang,[this.ns,null!==(r=null===(s=customElements.get("foxy-customer"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",null!==(i=null===(o=customElements.get("foxy-spinner"))||void 0===o?void 0:o.defaultNS)&&void 0!==i?i:""].join(" ")),this.renderTemplateOrSlot(`${n}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(C||(C=q`
16
16
  ${0}
17
17
 
18
18
  <foxy-internal-customer-portal-subscriptions
@@ -72,7 +72,6 @@ PERFORMANCE OF THIS SOFTWARE.
72
72
  <foxy-internal-customer-portal-link
73
73
  data-testid="header:actions:update"
74
74
  href=${0}
75
- icon="icons:credit-card"
76
75
  ?disabled=${0}
77
76
  >
78
77
  <foxy-i18n lang=${0} key="update_billing" ns=${0}></foxy-i18n>
@@ -85,7 +84,6 @@ PERFORMANCE OF THIS SOFTWARE.
85
84
  <foxy-internal-customer-portal-link
86
85
  data-testid="header:actions:end"
87
86
  href=${0}
88
- icon="icons:block"
89
87
  ?disabled=${0}
90
88
  >
91
89
  <foxy-i18n lang=${0} key="end_subscription" ns=${0}></foxy-i18n>
@@ -96,10 +94,7 @@ PERFORMANCE OF THIS SOFTWARE.
96
94
  <style>
97
95
  main {
98
96
  display: flex;
99
- justify-content: space-between;
100
- padding-top: var(--lumo-space-xs);
101
- margin-top: var(--lumo-space-s);
102
- border-top: 1px solid var(--lumo-contrast-10pct);
97
+ gap: var(--lumo-space-m);
103
98
  color: var(--lumo-secondary-color);
104
99
  }
105
100
  </style>
@@ -139,6 +134,7 @@ PERFORMANCE OF THIS SOFTWARE.
139
134
  >
140
135
  <foxy-subscription-card
141
136
  hiddencontrols="email"
137
+ settings=${0}
142
138
  parent=${0}
143
139
  group=${0}
144
140
  lang=${0}
@@ -148,7 +144,7 @@ PERFORMANCE OF THIS SOFTWARE.
148
144
  >
149
145
  </foxy-subscription-card>
150
146
  </button>
151
- `),f({"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","transaction_template:items"),this.__subscriptionDialog.href=t.toString(),this.__subscriptionDialog.show(e.currentTarget)}),s.parent,s.group,s.lang,s.href,s.ns,null!==(o=null===(r=customElements.get("foxy-subscription-card"))||void 0===r?void 0:r.defaultNS)&&void 0!==o?o:"",s.templates)},this.__renderPage=e=>{let{html:t}=e,s=i(e,ae);return t(fe||(fe=ve`
147
+ `),f({"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","transaction_template:items"),this.__subscriptionDialog.href=t.toString(),this.__subscriptionDialog.show(e.currentTarget)}),JSON.stringify(this.settings),s.parent,s.group,s.lang,s.href,s.ns,null!==(o=null===(r=customElements.get("foxy-subscription-card"))||void 0===r?void 0:r.defaultNS)&&void 0!==o?o:"",s.templates)},this.__renderPage=e=>{let{html:t}=e,s=i(e,ae);return t(fe||(fe=ve`
152
148
  <foxy-collection-page
153
149
  ns=${0}
154
150
  href=${0}
@@ -159,4 +155,4 @@ PERFORMANCE OF THIS SOFTWARE.
159
155
  .templates=${0}
160
156
  >
161
157
  </foxy-collection-page>
162
- `),s.ns,s.href,s.lang,s.group,this.__renderPageItem,s.templates)},this.__renderHeader=()=>a(ge||(ge=ve` ${0} <foxy-i18n class="block text-l font-medium" 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 t=this.disabledSelector.zoom("list"),s=this.readonlySelector.zoom("list"),r=[this.hiddenSelector.zoom("list").zoom("form").toString(),"end-date"];return a(ye||(ye=ve` ${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"),s.zoom("form").toString(),t.zoom("form").toString(),r.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 r(r({},super.properties),{},{settings:{attribute:!1},customer:{attribute:!1},group:{type:String}})}render(){return a($e||($e=ve` <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","transaction_template:items"),e.toString()}catch(e){return""}}}),customElements.define("foxy-internal-customer-portal-transactions",class extends we{constructor(){super(...arguments),this.customer=null,this.columns=[],this.group="",this.__renderHeader=()=>a(xe||(xe=je` <div> ${0} <foxy-i18n class="text-l font-medium" 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 a(Se||(Se=je` <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}" .props="${0}"> </foxy-collection-pages> ${0} </div> `),this.renderTemplateOrSlot("list:before"),this.group,e,this.lang,this.ns,this.getNestedTemplates("table"),{".columns":this.columns},this.renderTemplateOrSlot("list:after"))}}static get properties(){return r(r({},super.properties),{},{customer:{attribute:!1},columns:{attribute:!1},group:{type:String}})}render(){return a(_e||(_e=je` <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-link",z),customElements.define("foxy-customer-portal",w);export{w as CustomerPortal};
158
+ `),s.ns,s.href,s.lang,s.group,this.__renderPageItem,s.templates)},this.__renderHeader=()=>a(ge||(ge=ve` ${0} <foxy-i18n class="block text-l font-medium" 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 t=this.disabledSelector.zoom("list"),s=this.readonlySelector.zoom("list"),r=[this.hiddenSelector.zoom("list").zoom("form").toString(),"end-date"];return a(ye||(ye=ve` ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" header="update" parent="${0}" group="${0}" lang="${0}" ns="${0}" id="subscription-dialog" alert .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"),s.zoom("form").toString(),t.zoom("form").toString(),r.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 r(r({},super.properties),{},{settings:{attribute:!1},customer:{attribute:!1},group:{type:String}})}render(){return a($e||($e=ve` <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","transaction_template:items"),e.toString()}catch(e){return""}}}),customElements.define("foxy-internal-customer-portal-transactions",class extends we{constructor(){super(...arguments),this.customer=null,this.columns=[],this.group="",this.__renderHeader=()=>a(xe||(xe=je` <div> ${0} <foxy-i18n class="text-l font-medium" 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 a(Se||(Se=je` <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}" .props="${0}"> </foxy-collection-pages> ${0} </div> `),this.renderTemplateOrSlot("list:before"),this.group,e,this.lang,this.ns,this.getNestedTemplates("table"),{".columns":this.columns},this.renderTemplateOrSlot("list:after"))}}static get properties(){return r(r({},super.properties),{},{customer:{attribute:!1},columns:{attribute:!1},group:{type:String}})}render(){return a(_e||(_e=je` <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-link",z),customElements.define("foxy-customer-portal",w);export{w as CustomerPortal};
@@ -1,4 +1,4 @@
1
- import"./shared-37348820.js";import"./shared-c18f681b.js";import{h as t}from"./shared-21e68b72.js";import"./shared-8ef0ca65.js";import"./shared-5212ef4f.js";import"./foxy-payment-method-card.js";import"./foxy-update-payment-method-form.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-2508187b.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-4d32d19e.js";import{aH as e,_ as s}from"./shared-cb58dfcd.js";import{L as r,h as a,c as o}from"./shared-ba5c42c7.js";import{C as i}from"./shared-5afb584d.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import{z as h,S as d,T as n,a as l}from"./shared-11351c00.js";import{c as m}from"./shared-4e709717.js";import{S as c}from"./shared-c46affa4.js";import"./shared-048d5cae.js";import{G as v}from"./shared-4f64c35e.js";import"./shared-be442f26.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import"./shared-8b0f00fa.js";import{N as p}from"./shared-f83207fb.js";import{S as f}from"./shared-56d70cc2.js";import{i as g}from"./shared-53e42a77.js";import"./shared-315d7620.js";import"./shared-e5546d55.js";import"./shared-cf613436.js";import"./foxy-nucleon-element.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-2aa23b5f.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-27cfa174.js";import"./shared-0c134ce7.js";import"./shared-6957b8e6.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-80a1bf6f.js";import"./shared-5b4e2567.js";import"./foxy-copy-to-clipboard.js";import"./shared-d807cb20.js";import"./shared-bab2ea2c.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-53e476fd.js";import"./foxy-template-set-card.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";import"./foxy-payment-card-embed.js";import"./shared-99a8889a.js";import"./shared-673d668a.js";import"./shared-5fd5805c.js";import"./shared-243456aa.js";import"./shared-651c44fa.js";import"./shared-edeeb089.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-c05643e6.js";import"./shared-b65d169b.js";import"./shared-f69aacbc.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-3661a086.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-8eeddc22.js";import"./shared-eb963ba3.js";import"./shared-e2675ed0.js";import"./shared-e3421ca1.js";import"./shared-cc7e1dc6.js";import"./shared-3a952968.js";import"./shared-a6b2bd14.js";import"./shared-4a4f6eb9.js";import"./shared-8b25a098.js";import"./shared-afe24913.js";import"./shared-d0aed1c1.js";import"./shared-b738ee96.js";import"./shared-9e8ed3af.js";import"./shared-eea8debb.js";import"./shared-83c5e004.js";import"./shared-495860b4.js";import"./shared-6683daed.js";import"./shared-a03facdf.js";import"./shared-a587fd4b.js";let z,u,b,$=t=>t;class H extends r{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return h.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(a(z||(z=$` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,m({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(a(u||(u=$` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,m({hidden:this.value!==s}),this.value!==s,s));return a(b||(b=$` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
1
+ import"./shared-37348820.js";import"./shared-c18f681b.js";import{h as t}from"./shared-21e68b72.js";import"./shared-8ef0ca65.js";import"./shared-5212ef4f.js";import"./foxy-payment-method-card.js";import"./foxy-update-payment-method-form.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-2508187b.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-4d32d19e.js";import{aH as e,_ as s}from"./shared-cb58dfcd.js";import{L as r,h as a,c as o}from"./shared-ba5c42c7.js";import{C as i}from"./shared-5afb584d.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import{z as h,S as d,T as n,a as l}from"./shared-11351c00.js";import{c as m}from"./shared-4e709717.js";import{S as c}from"./shared-c46affa4.js";import"./shared-048d5cae.js";import{G as v}from"./shared-84eb85dd.js";import"./shared-be442f26.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import"./shared-8b0f00fa.js";import{N as p}from"./shared-f83207fb.js";import{S as f}from"./shared-230dee11.js";import{i as g}from"./shared-53e42a77.js";import"./shared-315d7620.js";import"./shared-e5546d55.js";import"./shared-cf613436.js";import"./foxy-nucleon-element.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-2aa23b5f.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-27cfa174.js";import"./shared-0c134ce7.js";import"./shared-6957b8e6.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-80a1bf6f.js";import"./shared-5b4e2567.js";import"./foxy-copy-to-clipboard.js";import"./shared-d807cb20.js";import"./shared-bab2ea2c.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-53e476fd.js";import"./foxy-template-set-card.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";import"./foxy-payment-card-embed.js";import"./shared-99a8889a.js";import"./shared-673d668a.js";import"./shared-5fd5805c.js";import"./shared-243456aa.js";import"./shared-651c44fa.js";import"./shared-edeeb089.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-c05643e6.js";import"./shared-b65d169b.js";import"./shared-f69aacbc.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-3661a086.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-8eeddc22.js";import"./shared-eb963ba3.js";import"./shared-ada5e9f5.js";import"./shared-e3421ca1.js";import"./shared-cc7e1dc6.js";import"./shared-3a952968.js";import"./shared-a6b2bd14.js";import"./shared-4a4f6eb9.js";import"./shared-8b25a098.js";import"./shared-afe24913.js";import"./shared-d0aed1c1.js";import"./shared-b738ee96.js";import"./shared-9e8ed3af.js";import"./shared-eea8debb.js";import"./shared-83c5e004.js";import"./shared-495860b4.js";import"./shared-6683daed.js";import"./shared-a03facdf.js";import"./shared-a587fd4b.js";let z,u,b,$=t=>t;class H extends r{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return h.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(a(z||(z=$` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,m({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(a(u||(u=$` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,m({hidden:this.value!==s}),this.value!==s,s));return a(b||(b=$` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
@@ -1 +1 @@
1
- import{_ as t}from"./shared-cb58dfcd.js";import"./shared-8ef0ca65.js";import"./shared-495860b4.js";import"./shared-edeeb089.js";import{L as e,c as s,h as i}from"./shared-ba5c42c7.js";import{T as r,y as a}from"./shared-11351c00.js";import{p as n}from"./shared-4d32d19e.js";import"./shared-37348820.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import{c as o}from"./shared-4e709717.js";import{b as c,C as h,I as d}from"./shared-c46affa4.js";import"./shared-048d5cae.js";import{E as l}from"./shared-3fcf4feb.js";import{G as m}from"./shared-4f64c35e.js";import"./shared-be442f26.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import"./shared-8b0f00fa.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-6683daed.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-53e476fd.js";import"./shared-5ef40e86.js";import"./shared-a03facdf.js";import"./shared-a587fd4b.js";import"./shared-5592ec6e.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";class u extends CustomEvent{constructor(t){super("change",{detail:t})}}let p,y,f=t=>t;class g extends(r(e)){constructor(){super(...arguments),this.readonly=!1,this.disabled=!1,this.checked=!1}static get properties(){return t(t({},super.properties),{},{readonly:{type:Boolean},disabled:{type:Boolean},checked:{type:Boolean}})}static get styles(){return[super.styles,s(p||(p=f`:host{--check-size:1.125rem}label{margin:calc(((1rem * var(--lumo-line-height-s)) - var(--check-size))/ -2) 0}label>:first-child{height:calc(1rem * var(--lumo-line-height-s))}.ml-xxl{margin-left:calc(var(--lumo-space-m) + var(--check-size))}.check{height:var(--check-size);width:var(--check-size)}`))]}render(){return i(y||(y=f` <label class="${0}"> <div class="flex items-center"> <div class="${0}"> <iron-icon icon="lumo:checkmark" class="${0}"> </iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ?disabled="${0}" data-testid="input" @change="${0}"> </div> </div> <div class="flex-1 font-lumo leading-s ml-m"> <slot></slot> </div> </label> <div class="${0}"> <slot name="content"></slot> </div> `),o({"flex items-start group transition-colors":!0,"cursor-default":this.disabled||this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"cursor-pointer":!this.disabled}),o({"flex-shrink-0 check transition-colors rounded-s border":!0,"focus-within-shadow-outline":!0,"bg-primary text-primary-contrast":!this.readonly&&this.checked,"border-dashed border-contrast-30":this.readonly,"border-transparent":!this.readonly,"opacity-50":this.disabled,"text-secondary bg-contrast-20":!this.readonly&&!this.checked,"group-hover-bg-contrast-30":!this.readonly&&!this.checked}),o({"block w-full h-full transition-transform transform":!0,"scale-100":this.checked,"scale-0":!this.checked}),this.checked,this.disabled,(t=>{if(this.readonly)return t.preventDefault();t.stopPropagation(),this.checked=!this.checked,this.dispatchEvent(new u(this.checked))}),o({"font-lumo ml-xxl transition-colors":!0,"text-disabled":this.disabled}))}}class b extends CustomEvent{constructor(t){super("change",{detail:t})}}class x extends CustomEvent{constructor(){super("submit",{cancelable:!0})}}let $,v,j,_,k,q,S,w,A=t=>t;class E extends a{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":l,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":c,"x-checkbox":g,"x-choice":h,"x-group":m,"x-i18n":d}}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:b,submit:x}}submit(){this.dispatchEvent(new x)&&this.__form.submit()}render(){var t,e;if(!(this.currency&&this.amount&&this.store&&this.name))return i($||($=A` <x-error-screen data-testid="error" type="setup_needed" class="relative"></x-error-screen> `));const s=this.store.includes(".")?this.store:`${this.store}.foxycart.com`;return i(v||(v=A` <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,s,[...this.__data.entries()].map((([t,e])=>i(j||(j=A`<input type="hidden" name="${0}" value="${0}">`),t,e))),this.amounts&&this.amounts.length>0?i(_||(_=A` <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="number" 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(parseFloat(t))),this.amounts.map(String),this.amount.toString(),this.lang,this.ns,(t=>{const e=parseFloat(t.detail);this.amount=isNaN(e)?1:e})):"",this.designations&&this.designations.length>0?i(k||(k=A` <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?i(q||(q=A` <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?i(S||(S=A` <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?i(w||(w=A` <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===(e=this.frequencies)||void 0===e?void 0:e.length)?"donate_recurrently":"donate",this.ns)}updated(){this.dispatchEvent(new b(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}=n(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",E);export{E as Donation};
1
+ import{_ as t}from"./shared-cb58dfcd.js";import"./shared-8ef0ca65.js";import"./shared-495860b4.js";import"./shared-edeeb089.js";import{L as e,c as s,h as i}from"./shared-ba5c42c7.js";import{T as r,y as a}from"./shared-11351c00.js";import{p as n}from"./shared-4d32d19e.js";import"./shared-37348820.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import{c as o}from"./shared-4e709717.js";import{b as c,C as h,I as d}from"./shared-c46affa4.js";import"./shared-048d5cae.js";import{E as l}from"./shared-3fcf4feb.js";import{G as m}from"./shared-84eb85dd.js";import"./shared-be442f26.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import"./shared-8b0f00fa.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-6683daed.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-53e476fd.js";import"./shared-5ef40e86.js";import"./shared-a03facdf.js";import"./shared-a587fd4b.js";import"./shared-5592ec6e.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";class u extends CustomEvent{constructor(t){super("change",{detail:t})}}let p,y,f=t=>t;class g extends(r(e)){constructor(){super(...arguments),this.readonly=!1,this.disabled=!1,this.checked=!1}static get properties(){return t(t({},super.properties),{},{readonly:{type:Boolean},disabled:{type:Boolean},checked:{type:Boolean}})}static get styles(){return[super.styles,s(p||(p=f`:host{--check-size:1.125rem}label{margin:calc(((1rem * var(--lumo-line-height-s)) - var(--check-size))/ -2) 0}label>:first-child{height:calc(1rem * var(--lumo-line-height-s))}.ml-xxl{margin-left:calc(var(--lumo-space-m) + var(--check-size))}.check{height:var(--check-size);width:var(--check-size)}`))]}render(){return i(y||(y=f` <label class="${0}"> <div class="flex items-center"> <div class="${0}"> <iron-icon icon="lumo:checkmark" class="${0}"> </iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ?disabled="${0}" data-testid="input" @change="${0}"> </div> </div> <div class="flex-1 font-lumo leading-s ml-m"> <slot></slot> </div> </label> <div class="${0}"> <slot name="content"></slot> </div> `),o({"flex items-start group transition-colors":!0,"cursor-default":this.disabled||this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"cursor-pointer":!this.disabled}),o({"flex-shrink-0 check transition-colors rounded-s border":!0,"focus-within-shadow-outline":!0,"bg-primary text-primary-contrast":!this.readonly&&this.checked,"border-dashed border-contrast-30":this.readonly,"border-transparent":!this.readonly,"opacity-50":this.disabled,"text-secondary bg-contrast-20":!this.readonly&&!this.checked,"group-hover-bg-contrast-30":!this.readonly&&!this.checked}),o({"block w-full h-full transition-transform transform":!0,"scale-100":this.checked,"scale-0":!this.checked}),this.checked,this.disabled,(t=>{if(this.readonly)return t.preventDefault();t.stopPropagation(),this.checked=!this.checked,this.dispatchEvent(new u(this.checked))}),o({"font-lumo ml-xxl transition-colors":!0,"text-disabled":this.disabled}))}}class b extends CustomEvent{constructor(t){super("change",{detail:t})}}class x extends CustomEvent{constructor(){super("submit",{cancelable:!0})}}let $,v,j,_,k,q,S,w,A=t=>t;class E extends a{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":l,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":c,"x-checkbox":g,"x-choice":h,"x-group":m,"x-i18n":d}}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:b,submit:x}}submit(){this.dispatchEvent(new x)&&this.__form.submit()}render(){var t,e;if(!(this.currency&&this.amount&&this.store&&this.name))return i($||($=A` <x-error-screen data-testid="error" type="setup_needed" class="relative"></x-error-screen> `));const s=this.store.includes(".")?this.store:`${this.store}.foxycart.com`;return i(v||(v=A` <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,s,[...this.__data.entries()].map((([t,e])=>i(j||(j=A`<input type="hidden" name="${0}" value="${0}">`),t,e))),this.amounts&&this.amounts.length>0?i(_||(_=A` <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="number" 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(parseFloat(t))),this.amounts.map(String),this.amount.toString(),this.lang,this.ns,(t=>{const e=parseFloat(t.detail);this.amount=isNaN(e)?1:e})):"",this.designations&&this.designations.length>0?i(k||(k=A` <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?i(q||(q=A` <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?i(S||(S=A` <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?i(w||(w=A` <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===(e=this.frequencies)||void 0===e?void 0:e.length)?"donate_recurrently":"donate",this.ns)}updated(){this.dispatchEvent(new b(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}=n(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",E);export{E as Donation};
@@ -1 +1 @@
1
- import{aH as e,_ as s}from"./shared-cb58dfcd.js";import{L as r,c as t,h as a}from"./shared-ba5c42c7.js";import{T as i,a as n,S as o}from"./shared-11351c00.js";import{c as d}from"./shared-4e709717.js";import{G as l}from"./shared-4f64c35e.js";import"./foxy-nucleon-element.js";import{g as c}from"./shared-bab2ea2c.js";import{N as p}from"./shared-f83207fb.js";import{d as u}from"./shared-eb963ba3.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-2aa23b5f.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";let m,f,h,y=e=>e;class x extends(i(r)){constructor(){super(...arguments),this.data=[]}static get properties(){return{data:{type:Array}}}static get styles(){return[super.styles,t(m||(m=y`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 a(f||(f=y` <dl class="space-y-s"> ${0} </dl> `),this.data.map((e=>{const s=String(e[1]).trim();return a(h||(h=y` <div> <dt class="text-secondary truncate">${0}</dt> <dd class="${0}">${0}</dd> </div> `),e[0],d({"text-tertiary":!s}),s||"–")})))}}let g,v,$=e=>e;const _=["_links","_embedded"],b=n(i(o(p)));class j extends b{static get scopedElements(){return{"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":x}}render(){if(this.in({idle:"snapshot"})){const s=this.data,{_links:r,_embedded:t}=s,i=e(s,_);try{const e=c(r.self.href);null!==e&&(i.id=e)}catch(e){}return a(g||(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(i))))}const s=this.in("busy");return a(v||(v=$` <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> `),s,this.in("fail")?"error":s?"busy":"empty",this.lang,this.ns)}}let w,k,S,E,O,N,z,T,G,J,P,A=e=>e;const R=n(i(o(p)),"error-entry-card");class D extends R{constructor(){super(...arguments),this.open=!1}static get scopedElements(){return{"x-resource-viewer":j,"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":x,"iron-icon":customElements.get("iron-icon"),"foxy-i18n":customElements.get("foxy-i18n"),"x-group":l}}static get properties(){return s(s({},super.properties),{},{open:{type:Boolean,reflect:!0}})}render(){var e,s;const r=this.data,t=this.in("busy");if(r){const{hide_error:e}=r,{open:s}=this;return a(w||(w=A` <details aria-busy="${0}" aria-live="polite" class="text-body w-full" ?open="${0}" @toggle="${0}"> <summary class="rounded-s ring-offset-4 ring-offset-base 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> `),t,s,this.__handleToggle,d({"border-l-2 leading-s relative cursor-pointer":!0,"border-contrast":e&&!s,"border-primary":!e,"border-error":e&&s,"h-l":!s}),this.__renderSummary(r),s?this.__renderDetails(r):"")}return a(k||(k=A` <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} ${0}"> </foxy-spinner> </div> `),t,t?"busy":this.in("fail")?"error":"empty",this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}__renderGetOrPostValues(e,s){const r=new URLSearchParams(u(e||s));return a(S||(S=A` <div class="relative leading-xs pt-s"> <div class="absolute font-medium 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(r.entries())))}__renderReferrer(e){return a(E||(E=A` <span class="text-secondary">Navigated from</span> <a target="_blank" class="font-medium text-primary hover-underline" href="${0}" rel="nofollow noopener noreferrer"> ${0} </a> `),e,e)}__renderSummary(e){return a(O||(O=A` <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 a(N||(N=A` <div class="space-y-m pt-m"> ${0} ${0} ${0} </div> `),e.referrer||e.get_values||e.post_values?a(z||(z=A` <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-medium">${0}</span> ${0} </p> ${0} </div> </x-group> `),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):""):"",e.ip_address||e.ip_country||e.user_agent?a(T||(T=A` <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-medium"> ${0} ${0} </span> ${0} </div> </x-group> `),this.lang,this.ns,e.ip_address,e.ip_country?a(G||(G=A`<span class="text-tertiary"> • </span>${0}`),e.ip_country):"",e.user_agent?a(J||(J=A`<span class="text-secondary">${0}</span>`),e.user_agent):""):"",Object.entries(e._links).map((([e,s])=>["self","fx:store","curies"].includes(e)?"":a(P||(P=A` <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 r=e.target;r.open&&!1===(null===(s=this.data)||void 0===s?void 0:s.hide_error)&&(this.edit({hide_error:!0}),this.submit()),this.open=r.open}}customElements.define("foxy-error-entry-card",D);export{D as ErrorEntryCard};
1
+ import{aH as e,_ as s}from"./shared-cb58dfcd.js";import{L as r,c as t,h as a}from"./shared-ba5c42c7.js";import{T as i,a as n,S as o}from"./shared-11351c00.js";import{c as d}from"./shared-4e709717.js";import{G as l}from"./shared-84eb85dd.js";import"./foxy-nucleon-element.js";import{g as c}from"./shared-bab2ea2c.js";import{N as p}from"./shared-f83207fb.js";import{d as u}from"./shared-eb963ba3.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-2aa23b5f.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";let m,f,h,y=e=>e;class x extends(i(r)){constructor(){super(...arguments),this.data=[]}static get properties(){return{data:{type:Array}}}static get styles(){return[super.styles,t(m||(m=y`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 a(f||(f=y` <dl class="space-y-s"> ${0} </dl> `),this.data.map((e=>{const s=String(e[1]).trim();return a(h||(h=y` <div> <dt class="text-secondary truncate">${0}</dt> <dd class="${0}">${0}</dd> </div> `),e[0],d({"text-tertiary":!s}),s||"–")})))}}let g,v,$=e=>e;const _=["_links","_embedded"],b=n(i(o(p)));class j extends b{static get scopedElements(){return{"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":x}}render(){if(this.in({idle:"snapshot"})){const s=this.data,{_links:r,_embedded:t}=s,i=e(s,_);try{const e=c(r.self.href);null!==e&&(i.id=e)}catch(e){}return a(g||(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(i))))}const s=this.in("busy");return a(v||(v=$` <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> `),s,this.in("fail")?"error":s?"busy":"empty",this.lang,this.ns)}}let w,k,S,E,O,N,z,T,G,J,P,A=e=>e;const R=n(i(o(p)),"error-entry-card");class D extends R{constructor(){super(...arguments),this.open=!1}static get scopedElements(){return{"x-resource-viewer":j,"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":x,"iron-icon":customElements.get("iron-icon"),"foxy-i18n":customElements.get("foxy-i18n"),"x-group":l}}static get properties(){return s(s({},super.properties),{},{open:{type:Boolean,reflect:!0}})}render(){var e,s;const r=this.data,t=this.in("busy");if(r){const{hide_error:e}=r,{open:s}=this;return a(w||(w=A` <details aria-busy="${0}" aria-live="polite" class="text-body w-full" ?open="${0}" @toggle="${0}"> <summary class="rounded-s ring-offset-4 ring-offset-base 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> `),t,s,this.__handleToggle,d({"border-l-2 leading-s relative cursor-pointer":!0,"border-contrast":e&&!s,"border-primary":!e,"border-error":e&&s,"h-l":!s}),this.__renderSummary(r),s?this.__renderDetails(r):"")}return a(k||(k=A` <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} ${0}"> </foxy-spinner> </div> `),t,t?"busy":this.in("fail")?"error":"empty",this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}__renderGetOrPostValues(e,s){const r=new URLSearchParams(u(e||s));return a(S||(S=A` <div class="relative leading-xs pt-s"> <div class="absolute font-medium 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(r.entries())))}__renderReferrer(e){return a(E||(E=A` <span class="text-secondary">Navigated from</span> <a target="_blank" class="font-medium text-primary hover-underline" href="${0}" rel="nofollow noopener noreferrer"> ${0} </a> `),e,e)}__renderSummary(e){return a(O||(O=A` <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 a(N||(N=A` <div class="space-y-m pt-m"> ${0} ${0} ${0} </div> `),e.referrer||e.get_values||e.post_values?a(z||(z=A` <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-medium">${0}</span> ${0} </p> ${0} </div> </x-group> `),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):""):"",e.ip_address||e.ip_country||e.user_agent?a(T||(T=A` <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-medium"> ${0} ${0} </span> ${0} </div> </x-group> `),this.lang,this.ns,e.ip_address,e.ip_country?a(G||(G=A`<span class="text-tertiary"> • </span>${0}`),e.ip_country):"",e.user_agent?a(J||(J=A`<span class="text-secondary">${0}</span>`),e.user_agent):""):"",Object.entries(e._links).map((([e,s])=>["self","fx:store","curies"].includes(e)?"":a(P||(P=A` <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 r=e.target;r.open&&!1===(null===(s=this.data)||void 0===s?void 0:s.hide_error)&&(this.edit({hide_error:!0}),this.submit()),this.open=r.open}}customElements.define("foxy-error-entry-card",D);export{D as ErrorEntryCard};
@@ -1 +1 @@
1
- import"./shared-3661a086.js";import"./foxy-nucleon-element.js";import"./shared-4d32d19e.js";import{_ as e}from"./shared-cb58dfcd.js";import{a as t}from"./shared-11351c00.js";import{C as i}from"./shared-5afb584d.js";import{p as r}from"./shared-8eeddc22.js";import{I as o}from"./shared-f1a70f51.js";import{i as a}from"./shared-53e42a77.js";import{d as s}from"./shared-eb963ba3.js";import{h as d}from"./shared-ba5c42c7.js";import"./foxy-spinner.js";import"./shared-37348820.js";import"./shared-21e68b72.js";import"./shared-c18f681b.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4e709717.js";let l,n,c,u,_,h,v=e=>e;const f=i(t(o,"item-card"));class p extends f{constructor(){super(...arguments),this.localeCodes=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__transactionLoaderId="transactionLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__cartLoaderId="cartLoader"}static get properties(){return e(e({},super.properties),{},{localeCodes:{type:String,attribute:"locale-codes"}})}renderBody(){var e,t,i,r,o,f,m,y,x,L;const $=null!==(t=null===(e=this.data)||void 0===e?void 0:e.quantity)&&void 0!==t?t:0,g=null===(r=null===(i=this.data)||void 0===i?void 0:i._embedded)||void 0===r?void 0:r["fx:item_options"],C=null!==(f=null===(o=this.data)||void 0===o?void 0:o.price)&&void 0!==f?f:0,H=this.__currencyDisplay,b=this.__currencyCode;return d(l||(l=v` <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> <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> <div class="flex items-start leading-xs" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <img class="relative h-s w-s object-cover rounded-s bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <div class="flex-1 min-w-0"> <div class="h-s flex items-center"> <div class="min-w-0 flex-1 leading-s"> <div class="flex items-center justify-between"> <div class="truncate text-m font-medium"> ${0} </div> <span class="text-s text-tertiary whitespace-nowrap"> ${0} &times; <foxy-i18n .options="${0}" key="price" infer=""> </foxy-i18n> </span> </div> <div class="truncate text-secondary text-s"> ${0} ${0} &ZeroWidthSpace; </div> </div> </div> ${0} </div> </div> `),a(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),a(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),a(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),a(this.__transactionHref),this.__transactionLoaderId,(()=>this.requestUpdate()),a(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),a(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),a(this.__cartHref),this.__cartLoaderId,(()=>this.requestUpdate()),a(null===(m=this.data)||void 0===m?void 0:m.image),(e=>{e.currentTarget.src=p.__placeholder}),s(null===(y=this.data)||void 0===y?void 0:y.name)||d(n||(n=v`<foxy-i18n infer="" key="no_code"></foxy-i18n>`)),$,{amount:`${C} ${b}`,currencyDisplay:H},(null===(x=this.data)||void 0===x?void 0:x.code)||void 0,(null===(L=this.data)||void 0===L?void 0:L.subscription_frequency)&&!this.hiddenSelector.matches("autorenew-icon",!0)?d(c||(c=v` <span> &bull; </span> <foxy-i18n infer="" key="${0}" .options="${0}"> </foxy-i18n> `),this.__subinfoKey,this.__subinfoOptions):"",g&&g.length>0?d(u||(u=v` <div class="mt-m"> ${0} </div> `),g.map((e=>d(_||(_=v` <div data-testclass="option" class="flex items-center gap-s text-s leading-s"> <div class="truncate text-secondary"> ${0}: <span class="font-medium text-body">${0}</span> </div> ${0} </div> `),e.name,e.value,e.price_mod?d(h||(h=v` <div class="border-t border-dashed border-contrast-10 flex-1"></div> <div class="whitespace-nowrap text-tertiary"> <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> </div> `),JSON.stringify({amount:`${e.price_mod} ${b}`,signDisplay:"exceptZero",currencyDisplay:H})):"")))):"")}get isBodyReady(){const e=!!this.__currencyDisplay&&!!this.__currencyCode;return super.isBodyReady&&e}get __transactionTemplateHref(){var e,t,i;try{const r=null===(e=this.data)||void 0===e?void 0:e._links,o=new URL(null!==(i=null===(t=null==r?void 0:r["fx:subscription"])||void 0===t?void 0:t.href)&&void 0!==i?i:"");return o.searchParams.set("zoom","transaction_template"),o.toString()}catch(e){}}get __defaultTemplateSetHref(){var e,t,i,r;if(""===(null===(t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate)||void 0===t?void 0:t.template_set_uri))try{const e=new URL(null!==(r=null===(i=this.__store)||void 0===i?void 0:i._links["fx:template_sets"].href)&&void 0!==r?r:"");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 __transactionHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transaction"])||void 0===t?void 0:t.href}get __templateSetHref(){var e;const t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(!(null==t?void 0:t.currency_code))return(null==t?void 0:t.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 __cartHref(){var e,t;const i=null===(e=this.data)||void 0===e?void 0:e._links;return null===(t=null==i?void 0:i["fx:cart"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t;const i=`#${this.__transactionTemplateLoaderId}`,r=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._embedded["fx:transaction_template"])&&void 0!==t?t:null}get __defaultTemplateSet(){var e,t;const i=`#${this.__defaultTemplateSetLoaderId}`,r=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const i=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __transaction(){var e,t;const i=`#${this.__transactionLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const i=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const i=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __cart(){var e,t;const i=`#${this.__cartLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __currencyDisplay(){var e;const t=null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol;return!0===t?"code":!1===t||this.data&&!this.data._links["fx:store"]?"symbol":void 0}get __currencyCode(){var e,t,i,r;const o=this.__transaction;if(o)return o.currency_code;{const o=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(null==o?void 0:o.currency_code)return o.currency_code;{const e=this.__localeCodesHelper,o=null===(i=null!==(t=this.__templateSet)&&void 0!==t?t:this.__defaultTemplateSet)||void 0===i?void 0:i.locale_code,a=o?null==e?void 0:e.values[o]:void 0;if(a)return null===(r=/Currency: ([A-Z]{3})/g.exec(a))||void 0===r?void 0:r[1]}}}get __subinfoOptions(){var t,i,o;const a=this.__currencyDisplay;if(void 0===a)return;const s=this.__currencyCode;if(void 0===s)return;const d=null===(t=this.__transactionTemplate)||void 0===t?void 0:t.total_order;if(void 0===d)return;const l=null===(i=this.data)||void 0===i?void 0:i.subscription_frequency;if(void 0===l)return;const n=null===(o=this.data)||void 0===o?void 0:o.subscription_start_date;return void 0!==n?e(e({},r(l)),{},{amount:`${d} ${s}`,currencyDisplay:a,startDate:n}):void 0}get __subinfoKey(){var e;const t=null===(e=this.data)||void 0===e?void 0:e.subscription_frequency;if(t)return"subinfo_"+(".5m"===t?"twice_a_month":"recurring")}}p.__placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E',customElements.define("foxy-item-card",p);export{p as ItemCard};
1
+ import"./shared-3661a086.js";import"./foxy-nucleon-element.js";import"./shared-4d32d19e.js";import{_ as e}from"./shared-cb58dfcd.js";import{a as t}from"./shared-11351c00.js";import{C as i}from"./shared-5afb584d.js";import{p as r}from"./shared-8eeddc22.js";import{I as o}from"./shared-f1a70f51.js";import{i as s}from"./shared-53e42a77.js";import{d}from"./shared-eb963ba3.js";import{h as a}from"./shared-ba5c42c7.js";import"./foxy-spinner.js";import"./shared-37348820.js";import"./shared-21e68b72.js";import"./shared-c18f681b.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4e709717.js";let l,n,c,u,_,h,v,p=e=>e;const f=i(t(o,"item-card"));class m extends f{constructor(){super(...arguments),this.localeCodes=null,this.settings=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__transactionLoaderId="transactionLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__cartLoaderId="cartLoader"}static get properties(){return e(e({},super.properties),{},{localeCodes:{type:String,attribute:"locale-codes"},settings:{type:Object}})}renderBody(){var e,t,i,r,o,f,y,x,L,g,$;const C=null===(e=this.settings)||void 0===e?void 0:e.cart_display_config,H=null!==(i=null===(t=this.data)||void 0===t?void 0:t.quantity)&&void 0!==i?i:0,b=this.__filteredOptions,w=null!==(o=null===(r=this.data)||void 0===r?void 0:r.price)&&void 0!==o?o:0,S=null!==(y=null===(f=this.data)||void 0===f?void 0:f.code)&&void 0!==y?y:"",j=C?C.show_product_code?S:"":S,E=this.__currencyDisplay,I=this.__currencyCode;return a(l||(l=p` <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> <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> <div class="flex items-start leading-xs" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <img class="relative h-s w-s object-cover rounded-s bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <div class="flex-1 min-w-0"> <div class="h-s flex items-center"> <div class="min-w-0 flex-1 leading-s"> <div class="flex items-center justify-between"> <div class="truncate text-m font-medium"> ${0} </div> <span class="text-s text-tertiary whitespace-nowrap"> ${0} &times; <foxy-i18n .options="${0}" key="price" infer=""> </foxy-i18n> </span> </div> <div class="truncate text-secondary text-s"> ${0} ${0} &ZeroWidthSpace; </div> </div> </div> ${0} </div> </div> `),s(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),s(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),s(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),s(this.__transactionHref),this.__transactionLoaderId,(()=>this.requestUpdate()),s(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),s(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),s(this.__cartHref),this.__cartLoaderId,(()=>this.requestUpdate()),s(null===(x=this.data)||void 0===x?void 0:x.image),(e=>{e.currentTarget.src=m.__placeholder}),d(null===(L=this.data)||void 0===L?void 0:L.name)||a(n||(n=p`<foxy-i18n infer="" key="no_code"></foxy-i18n>`)),H,{amount:`${w} ${I}`,currencyDisplay:E},j,null!==(g=null==C?void 0:C.show_sub_frequency)&&void 0!==g&&!g||!(null===($=this.data)||void 0===$?void 0:$.subscription_frequency)||this.hiddenSelector.matches("autorenew-icon",!0)?"":a(c||(c=p` ${0} <foxy-i18n infer="" key="${0}" .options="${0}"> </foxy-i18n> `),j?a(u||(u=p`<span> &bull; </span>`)):"",this.__subinfoKey,this.__subinfoOptions),b&&b.length>0?a(_||(_=p` <div class="mt-m"> ${0} </div> `),b.map((e=>a(h||(h=p` <div data-testclass="option" class="flex items-center gap-s text-s leading-s"> <div class="truncate text-secondary"> ${0}: <span class="font-medium text-body">${0}</span> </div> ${0} </div> `),e.name,e.value,e.price_mod?a(v||(v=p` <div class="border-t border-dashed border-contrast-10 flex-1"></div> <div class="whitespace-nowrap text-tertiary"> <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> </div> `),JSON.stringify({amount:`${e.price_mod} ${I}`,signDisplay:"exceptZero",currencyDisplay:E})):"")))):"")}get isBodyReady(){const e=!!this.__currencyDisplay&&!!this.__currencyCode;return super.isBodyReady&&e}get __transactionTemplateHref(){var e,t,i;try{const r=null===(e=this.data)||void 0===e?void 0:e._links,o=new URL(null!==(i=null===(t=null==r?void 0:r["fx:subscription"])||void 0===t?void 0:t.href)&&void 0!==i?i:"");return o.searchParams.set("zoom","transaction_template"),o.toString()}catch(e){}}get __defaultTemplateSetHref(){var e,t,i,r;if(""===(null===(t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate)||void 0===t?void 0:t.template_set_uri))try{const e=new URL(null!==(r=null===(i=this.__store)||void 0===i?void 0:i._links["fx:template_sets"].href)&&void 0!==r?r:"");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 __transactionHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transaction"])||void 0===t?void 0:t.href}get __templateSetHref(){var e;const t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(!(null==t?void 0:t.currency_code))return(null==t?void 0:t.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 __cartHref(){var e,t;const i=null===(e=this.data)||void 0===e?void 0:e._links;return null===(t=null==i?void 0:i["fx:cart"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t;const i=`#${this.__transactionTemplateLoaderId}`,r=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._embedded["fx:transaction_template"])&&void 0!==t?t:null}get __defaultTemplateSet(){var e,t;const i=`#${this.__defaultTemplateSetLoaderId}`,r=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const i=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __transaction(){var e,t;const i=`#${this.__transactionLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const i=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const i=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __cart(){var e,t;const i=`#${this.__cartLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __currencyDisplay(){var e;const t=null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol;return!0===t?"code":!1===t||this.data&&!this.data._links["fx:store"]?"symbol":void 0}get __currencyCode(){var e,t,i,r;const o=this.__transaction;if(o)return o.currency_code;{const o=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(null==o?void 0:o.currency_code)return o.currency_code;{const e=this.__localeCodesHelper,o=null===(i=null!==(t=this.__templateSet)&&void 0!==t?t:this.__defaultTemplateSet)||void 0===i?void 0:i.locale_code,s=o?null==e?void 0:e.values[o]:void 0;if(s)return null===(r=/Currency: ([A-Z]{3})/g.exec(s))||void 0===r?void 0:r[1]}}}get __subinfoOptions(){var t,i,o;const s=this.__currencyDisplay;if(void 0===s)return;const d=this.__currencyCode;if(void 0===d)return;const a=null===(t=this.__transactionTemplate)||void 0===t?void 0:t.total_order;if(void 0===a)return;const l=null===(i=this.data)||void 0===i?void 0:i.subscription_frequency;if(void 0===l)return;const n=null===(o=this.data)||void 0===o?void 0:o.subscription_start_date;return void 0!==n?e(e({},r(l)),{},{amount:`${a} ${d}`,currencyDisplay:s,startDate:n}):void 0}get __subinfoKey(){var e;const t=null===(e=this.data)||void 0===e?void 0:e.subscription_frequency;if(t)return"subinfo_"+(".5m"===t?"twice_a_month":"recurring")}get __filteredOptions(){var e,t,i,r,o;const s=null===(t=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:item_options"],d=null!==(o=null===(r=null===(i=this.settings)||void 0===i?void 0:i.cart_display_config)||void 0===r?void 0:r.hidden_product_options)&&void 0!==o?o:[];return null==s?void 0:s.filter((e=>!d.includes(e.name)))}}m.__placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E',customElements.define("foxy-item-card",m);export{m as ItemCard};
@@ -1,4 +1,4 @@
1
- import{C as e}from"./shared-6683daed.js";import{D as t,a as i}from"./shared-29f60d2f.js";import{C as a,a as s}from"./shared-243456aa.js";import{h as n,C as r,P as d}from"./shared-21e68b72.js";import{T as l,E as o}from"./shared-315d7620.js";import"./shared-be442f26.js";import"./shared-8b0f00fa.js";import{T as h}from"./shared-edeeb089.js";import{a as m}from"./shared-1c355fac.js";import{C as _}from"./shared-8ef0ca65.js";import"./shared-6957b8e6.js";import{C as u,c}from"./shared-c46affa4.js";import"./shared-e5546d55.js";import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{_ as p}from"./shared-cb58dfcd.js";import"./shared-37348820.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import{h as g,r as v}from"./shared-ba5c42c7.js";import{z as f,S as b,R as y,T as k,a as x}from"./shared-11351c00.js";import{c as T}from"./shared-4e709717.js";import"./shared-048d5cae.js";import{G as $}from"./shared-4f64c35e.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import{C as D}from"./shared-5afb584d.js";import{N as E}from"./shared-f83207fb.js";import{i as w}from"./shared-53e42a77.js";import{l as S}from"./shared-d0aed1c1.js";import"./shared-a587fd4b.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-cf12f33b.js";import"./shared-651c44fa.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-495860b4.js";import"./shared-2aa23b5f.js";import"./shared-53e476fd.js";import"./shared-5ef40e86.js";import"./shared-a03facdf.js";import"./shared-c18f681b.js";import"./shared-343d1fd7.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";let P,C,I,M=e=>e;class V extends f{constructor(){super(...arguments),this.disabled=!1,this.items=[]}static get properties(){return p(p({},super.properties),{},{disabled:{type:Boolean,reflect:!0},items:{attribute:!1}})}render(){return g(P||(P=M` <p class="font-lumo text-xs leading-s text-secondary"> ${0} </p> `),this.items.map((({name:e,value:t},i)=>g(C||(C=M`${0}${0} ${0}`),0===i?"":g(I||(I=M`&bull;`)),e,t))))}}
1
+ import{C as e}from"./shared-6683daed.js";import{D as t,a as i}from"./shared-29f60d2f.js";import{C as a,a as s}from"./shared-243456aa.js";import{h as n,C as r,P as d}from"./shared-21e68b72.js";import{T as l,E as o}from"./shared-315d7620.js";import"./shared-be442f26.js";import"./shared-8b0f00fa.js";import{T as h}from"./shared-edeeb089.js";import{a as m}from"./shared-1c355fac.js";import{C as _}from"./shared-8ef0ca65.js";import"./shared-6957b8e6.js";import{C as u,c}from"./shared-c46affa4.js";import"./shared-e5546d55.js";import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{_ as p}from"./shared-cb58dfcd.js";import"./shared-37348820.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import{h as g,r as v}from"./shared-ba5c42c7.js";import{z as f,S as b,R as y,T as k,a as x}from"./shared-11351c00.js";import{c as T}from"./shared-4e709717.js";import"./shared-048d5cae.js";import{G as $}from"./shared-84eb85dd.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import{C as D}from"./shared-5afb584d.js";import{N as E}from"./shared-f83207fb.js";import{i as w}from"./shared-53e42a77.js";import{l as S}from"./shared-d0aed1c1.js";import"./shared-a587fd4b.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-cf12f33b.js";import"./shared-651c44fa.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-495860b4.js";import"./shared-2aa23b5f.js";import"./shared-53e476fd.js";import"./shared-5ef40e86.js";import"./shared-a03facdf.js";import"./shared-c18f681b.js";import"./shared-343d1fd7.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";let P,C,I,M=e=>e;class V extends f{constructor(){super(...arguments),this.disabled=!1,this.items=[]}static get properties(){return p(p({},super.properties),{},{disabled:{type:Boolean,reflect:!0},items:{attribute:!1}})}render(){return g(P||(P=M` <p class="font-lumo text-xs leading-s text-secondary"> ${0} </p> `),this.items.map((({name:e,value:t},i)=>g(C||(C=M`${0}${0} ${0}`),0===i?"":g(I||(I=M`&bull;`)),e,t))))}}
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2017 Vaadin Ltd.
@@ -1 +1 @@
1
- import"./shared-17f2f27a.js";import"./shared-27cfa174.js";import"./shared-4a4f6eb9.js";import"./shared-80a1bf6f.js";import"./shared-3a952968.js";import"./shared-2c81b7df.js";import"./shared-afe24913.js";import{I as e}from"./shared-5b4e2567.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-cb58dfcd.js";import{a as o}from"./shared-11351c00.js";import{i}from"./shared-53e42a77.js";import{h as s}from"./shared-ba5c42c7.js";import"./shared-6957b8e6.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-8ef0ca65.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-37348820.js";import"./shared-c18f681b.js";import"./shared-4d32d19e.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-pagination.js";import"./shared-4e709717.js";import"./shared-0c134ce7.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-copy-to-clipboard.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-bab2ea2c.js";import"./shared-8b25a098.js";import"./shared-8b0f00fa.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-be442f26.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-3661a086.js";import"./shared-f1a70f51.js";import"./shared-0df46275.js";let n,a=e=>e;const d=o(e,"store-shipping-method-form");class p 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;const o=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==o?void 0:o._links["fx:shipping_containers"].href),i(null==o?void 0:o._links["fx:shipping_drop_types"].href),this.__useCustomAccountGetValue,this.__useCustomAccountSetValue,i(null==o?void 0:o._links.self.href),i(null==o?void 0:o._links["fx:shipping_services"].href),i(null===(r=this.data)||void 0===r?void 0:r._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",p);export{p as StoreShippingMethodForm};
1
+ import"./shared-17f2f27a.js";import"./shared-27cfa174.js";import"./shared-4a4f6eb9.js";import"./shared-80a1bf6f.js";import"./shared-3a952968.js";import"./shared-2c81b7df.js";import"./shared-afe24913.js";import{I as e}from"./shared-5b4e2567.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-cb58dfcd.js";import{a as o}from"./shared-11351c00.js";import{i}from"./shared-53e42a77.js";import{h as s,s as n}from"./shared-ba5c42c7.js";import"./shared-6957b8e6.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-8ef0ca65.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-37348820.js";import"./shared-c18f681b.js";import"./shared-4d32d19e.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-pagination.js";import"./shared-4e709717.js";import"./shared-0c134ce7.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-copy-to-clipboard.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-bab2ea2c.js";import"./shared-8b25a098.js";import"./shared-8b0f00fa.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-be442f26.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-3661a086.js";import"./shared-f1a70f51.js";import"./shared-0df46275.js";let a,d,c,p=e=>e;const h=o(e,"store-shipping-method-form");class u extends h{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 account:accountid account:password account:authentication-key"};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 h=this.__shippingMethod;return s(a||(a=p` ${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> ${0} </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==h?void 0:h._links["fx:shipping_containers"].href),i(null==h?void 0:h._links["fx:shipping_drop_types"].href),this.__useCustomAccountGetValue,this.__useCustomAccountSetValue,this.__useCustomAccountGetValue()&&"UPS"===(null===(r=this.__shippingMethod)||void 0===r?void 0:r.code)?s(d||(d=p` <div class="flex items-start" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="ups_use_legacy_admin_message"></foxy-i18n> <br> <a target="_blank" class="mt-xs inline-block rounded font-medium text-primary transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> admin.foxycart.com </a> </p> </div> `),n(c||(c=p`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`))):"",i(null==h?void 0:h._links.self.href),i(null==h?void 0:h._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",u);export{u as StoreShippingMethodForm};
@@ -1 +1 @@
1
- import"./shared-d807cb20.js";import"./shared-c18f681b.js";import"./shared-37348820.js";import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{_ as s}from"./shared-cb58dfcd.js";import{h as t}from"./shared-ba5c42c7.js";import{C as e}from"./shared-5afb584d.js";import{N as i}from"./shared-f83207fb.js";import{R as n,T as r,a}from"./shared-11351c00.js";import{c as o}from"./shared-4e709717.js";import{p as d}from"./shared-8eeddc22.js";import{g as m}from"./shared-e2675ed0.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-53e42a77.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";let l,c=s=>s;const p=e(n(r(a(i,"subscription-card"))));class f extends p{render(){var s,e,i;const n=m(this.data),r="failed"===n,a="next_payment"===n||!!(null==n?void 0:n.startsWith("will_end")),d=!a&&!r;return t(l||(l=c` <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> &#8203; </div> <div class="${0}"> <foxy-i18n data-testid="status" lang="${0}" key="status_${0}" ns="${0}" .options="${0}"> </foxy-i18n> &#8203; </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> &#8203; </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":a,"text-body bg-contrast-5":d,"text-error bg-error-10":r}),r?"error-outline":a?"done":"done-all",JSON.stringify(this.__getSummaryOptions()),this.lang,this.ns,o({"text-m":!0,"text-tertiary":d,"text-success":a,"text-error":r}),this.lang,n,this.ns,this.data,JSON.stringify(this.__getPriceOptions()),this.lang,".5m"===(null===(s=this.data)||void 0===s?void 0:s.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!==(i=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==i?i:"",this.renderTemplateOrSlot())}__getSummaryOptions(){if(null===this.data)return{};const s=this.data._embedded["fx:transaction_template"]._embedded["fx:items"];return{most_expensive_item:[...s].sort(((s,t)=>s.price-t.price))[0],count_minus_one:s.length-1,count:s.length}}__getPriceOptions(){if(null===this.data)return{};const t=this.data._embedded["fx:transaction_template"],e=`${t.total_order} ${t.currency_code}`;return s(s({},d(this.data.frequency)),{},{amount:e})}}customElements.define("foxy-subscription-card",f);export{f as SubscriptionCard};
1
+ import"./shared-d807cb20.js";import"./shared-c18f681b.js";import"./shared-37348820.js";import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{_ as s}from"./shared-cb58dfcd.js";import{h as t}from"./shared-ba5c42c7.js";import{C as e}from"./shared-5afb584d.js";import{N as i}from"./shared-f83207fb.js";import{R as n,T as r,a}from"./shared-11351c00.js";import{c as o}from"./shared-4e709717.js";import{p as d}from"./shared-8eeddc22.js";import{a as m,g as l}from"./shared-ada5e9f5.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-53e42a77.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";let c,p=s=>s;const f=e(n(r(a(i,"subscription-card"))));class h extends f{constructor(){super(...arguments),this.settings=null}static get properties(){return s(s({},super.properties),{},{settings:{type:Object}})}render(){var s,e,i,n,r;const a=this.settings?m(this.data,this.settings):l(this.data),d="failed"===a,f=(null==a?void 0:a.startsWith("next_payment"))||!!(null==a?void 0:a.startsWith("will_end")),h=!f&&!d;return t(c||(c=p` <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> &#8203; </div> <div class="${0}"> <foxy-i18n data-testid="status" lang="${0}" key="status_${0}" ns="${0}" .options="${0}"> </foxy-i18n> &#8203; </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> &#8203; </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":f,"text-body bg-contrast-5":h,"text-error bg-error-10":d}),d?"error-outline":f?"done":"done-all",JSON.stringify(this.__getSummaryOptions()),this.lang,this.ns,o({"text-m":!0,"text-tertiary":h,"text-success":f,"text-error":d}),this.lang,a,this.ns,this.data,JSON.stringify(this.__getPriceOptions()),this.lang,null===(e=null===(s=this.settings)||void 0===s?void 0:s.cart_display_config.show_sub_frequency)||void 0===e||e?"_"+(".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!==(r=null===(n=customElements.get("foxy-spinner"))||void 0===n?void 0:n.defaultNS)&&void 0!==r?r:"",this.renderTemplateOrSlot())}__getSummaryOptions(){if(null===this.data)return{};const s=this.data._embedded["fx:transaction_template"]._embedded["fx:items"];return{most_expensive_item:[...s].sort(((s,t)=>s.price-t.price))[0],count_minus_one:s.length-1,count:s.length}}__getPriceOptions(){if(null===this.data)return{};const t=this.data._embedded["fx:transaction_template"],e=`${t.total_order} ${t.currency_code}`;return s(s({},d(this.data.frequency)),{},{amount:e})}}customElements.define("foxy-subscription-card",h);export{h as SubscriptionCard};
@@ -1 +1 @@
1
- import"./shared-d807cb20.js";import"./shared-243456aa.js";import"./shared-8ef0ca65.js";import"./shared-c18f681b.js";import"./shared-37348820.js";import{I as e}from"./shared-5b4e2567.js";import"./shared-0c134ce7.js";import"./shared-c05643e6.js";import"./shared-f69aacbc.js";import"./shared-5212ef4f.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-4d32d19e.js";import{_ as t,B as s}from"./shared-cb58dfcd.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import{h as a}from"./shared-ba5c42c7.js";import{S as r,R as i,a as n}from"./shared-11351c00.js";import{c as o}from"./shared-4e709717.js";import{S as d,C as l}from"./shared-c46affa4.js";import"./shared-048d5cae.js";import{G as c}from"./shared-4f64c35e.js";import"./shared-be442f26.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import"./shared-8b0f00fa.js";import{g as u}from"./shared-e2675ed0.js";import{p as m}from"./shared-8eeddc22.js";import{s as h}from"./shared-79d0699c.js";import{i as f}from"./shared-53e42a77.js";import{p as _}from"./shared-99a8889a.js";import{j as p}from"./shared-673d668a.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-651c44fa.js";import"./shared-edeeb089.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-6957b8e6.js";import"./shared-80a1bf6f.js";import"./foxy-collection-page.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-b65d169b.js";import"./shared-43e2c3f6.js";import"./shared-3661a086.js";import"./shared-f1a70f51.js";import"./shared-cc7e1dc6.js";import"./shared-3a952968.js";import"./shared-eb963ba3.js";import"./shared-83c5e004.js";import"./shared-495860b4.js";import"./shared-6683daed.js";import"./shared-a03facdf.js";import"./shared-a587fd4b.js";function y(e){return function*(e){const t=[];for(const s of e.settings.subscriptions.allowFrequencyModification)if(p(s.jsonataQuery).evaluate(e.subscription))for(const e of s.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 v extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function x(e){const t=864e5,s=31*t;if(".5m"===e)return s/2;const a=parseInt(e.substring(0,e.length-1));if(isNaN(a))throw new v(e);if(e.endsWith("y"))return 31536e6*a;if(e.endsWith("m"))return a*s;if(e.endsWith("w"))return 6048e5*a;if(e.endsWith("d"))return a*t;throw new v(e)}function g(e,t){if("boolean"==typeof t)return t;const s=t.filter((t=>Boolean(p(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var s,a,r,i,n;if(t.min){const s=e.min?x(e.min):1/0;x(t.min)<s&&(e.min=t.min)}if(t.max){const s=e.max?x(e.max):-1/0;x(t.max)>s&&(e.max=t.max)}if("day"===(null===(s=t.allowedDays)||void 0===s?void 0:s.type)){const s=[...null!==(a=e.allowedDaysOfWeek)&&void 0!==a?a:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(s))}if("month"===(null===(r=t.allowedDays)||void 0===r?void 0:r.type)){const s=[...null!==(i=e.allowedDaysOfMonth)&&void 0!==i?i:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(s))}if(t.disallowedDates){const s=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(s))}return e}),{});return 0!==Object.keys(s).length&&s}function b(e){const[t,s,a]=e.split("-").map((e=>parseInt(e)));return new Date(t,s-1,a)}function $(e){const t=e.settings.subscriptions.allow_next_date_modification;let s;return s="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,s;const a=b(e.value),r=a.getTime(),i=g(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof i)return i;if(!1===(null===(t=i.allowedDaysOfMonth)||void 0===t?void 0:t.includes(a.getDate())))return!1;if(!1===(null===(s=i.allowedDaysOfWeek)||void 0===s?void 0:s.includes(a.getDay())))return!1;if(i.disallowedDates&&i.disallowedDates.find((e=>{const[t,s]=e.split("..").map((e=>b(e).getTime()));return r===t||void 0!==s&&r>=t&&r<=s})))return!1;if(i.min){const e=_(i.min);if(null!==e&&Date.now()+e>=r)return!1}if(i.max){const e=_(i.max);if(null!==e&&Date.now()+e<=r)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:s}},subscription:e.subscription,value:e.value})}let j,S,D,w,T,q,E,k,H,C,L,A=e=>e;const I=r(i(n(e,"subscription-form")));class O extends I{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=()=>a(j||(j=A` <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 s=this.__transactionTemplate,a=new URL(null!==(e=null==s?void 0:s._links["fx:items"].href)&&void 0!==e?e:"");a.searchParams.set("zoom","item_options"),t=a.toString()}catch(e){t=void 0}return a(S||(S=A` <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(),f(t),{"locale-codes":this.localeCodes})},this.__renderEndDate=()=>{var e;const{data:t,lang:s,ns:r}=this;return a(D||(D=A` <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"),r,s,f(null===(e=null==t?void 0:t.end_date)||void 0===e?void 0:e.substr(0,10)),f(null==t?void 0:t.end_date),s,!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:s}=this;if(t&&s){return $({value:h(e),settings:t,subscription:s})}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:s}=this;return a(w||(w=A` <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"),s,t,f(null==e?void 0:e.start_date.substr(0,10)),f(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:s}=this,r=!!(null==e?void 0:e.is_active);return a(T||(T=A` <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"),s,t,f(null==e?void 0:e.next_transaction_date.substr(0,10)),f(null==e?void 0:e.next_transaction_date),t,!r||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),s=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",m(e)),value:e})));return a(q||(q=A` <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(),f(this.form.frequency),s,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:s,ns:r}=this;return a(E||(E=A` <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> `),r,s,r,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=>a(k||(k=A` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(m(e)),e,s,".5m"===e?"twice_a_month":"frequency",r))))},this.__renderFrequency=()=>a(H||(H=A` <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 s=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,r=s?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,s):void 0;return a(C||(C=A` <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":!r,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!r,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!r}),f(r),f(s),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":d,"x-choice":l,"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 s(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}get headerTitleOptions(){if(this.data&&this.__currencyCode){const e=m(this.data.frequency),s=this.__transactionTemplate,a=`${null==s?void 0:s.total_order} ${this.__currencyCode}`,r=this.__currencyDisplay,i=this.__currencyCode?".5m"===this.data.frequency?"twice_a_month":"recurring":"existing";return t(t({},e),{},{amount:a,currencyDisplay:r,context:i})}return{}}get headerSubtitleKey(){const e=u(this.data);return e?`subtitle_${e}`:super.headerSubtitleKey}renderBody(){var e,t,s,r,i;let n;try{const s=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");s.searchParams.set("order","transaction_date desc"),s.searchParams.set("zoom","items"),n=s.toString()}catch(e){n=void 0}return a(L||(L=A` ${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(),f(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),f(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),f(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),f(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),f(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():"",f(null!==(s=this.__currencyCode)&&void 0!==s?s:void 0),f(null===(i=null===(r=this.data)||void 0===r?void 0:r._links["fx:attributes"])||void 0===i?void 0:i.href),f(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,s;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(s=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==s?s:"");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,s;const a=this.data,r=null===(e=null==a?void 0:a._embedded)||void 0===e?void 0:e["fx:transaction_template"],i=`#${this.__transactionTemplateLoaderId}`;return null!==(s=null!=r?r:null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==s?s:null}get __defaultTemplateSet(){var e,t;const s=`#${this.__defaultTemplateSetLoaderId}`,a=this.renderRoot.querySelector(s);return null!==(t=null===(e=null==a?void 0:a.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const s=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(s))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const s=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(s))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const s=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(s))||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 s;return s="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}))),g(e,s)}(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!y({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=y({subscription:this.data,settings:this.settings});return Array.from(e)}get __currencyCode(){var e,t,s,a;const r=this.__transactionTemplate;if(null==r?void 0:r.currency_code)return r.currency_code;const i=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==i?void 0:i.values[n]:void 0;return o&&null!==(a=null===(s=/Currency: ([A-Z]{3})/g.exec(o))||void 0===s?void 0:s[1])&&void 0!==a?a: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",O);export{O as SubscriptionForm};
1
+ import"./shared-d807cb20.js";import"./shared-243456aa.js";import"./shared-8ef0ca65.js";import"./shared-c18f681b.js";import"./shared-37348820.js";import{I as e}from"./shared-5b4e2567.js";import"./shared-0c134ce7.js";import"./shared-c05643e6.js";import"./shared-f69aacbc.js";import"./shared-5212ef4f.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-4d32d19e.js";import{_ as t,B as s}from"./shared-cb58dfcd.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import{h as a}from"./shared-ba5c42c7.js";import{S as i,R as r,a as n}from"./shared-11351c00.js";import{c as o}from"./shared-4e709717.js";import{S as d,C as l}from"./shared-c46affa4.js";import"./shared-048d5cae.js";import{G as c}from"./shared-84eb85dd.js";import"./shared-be442f26.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import"./shared-8b0f00fa.js";import{p as u}from"./shared-8eeddc22.js";import{s as m}from"./shared-79d0699c.js";import{i as h}from"./shared-53e42a77.js";import{a as f,g as _}from"./shared-ada5e9f5.js";import{p}from"./shared-99a8889a.js";import{j as y}from"./shared-673d668a.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-651c44fa.js";import"./shared-edeeb089.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-6957b8e6.js";import"./shared-80a1bf6f.js";import"./foxy-collection-page.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-b65d169b.js";import"./shared-43e2c3f6.js";import"./shared-3661a086.js";import"./shared-f1a70f51.js";import"./shared-cc7e1dc6.js";import"./shared-3a952968.js";import"./shared-eb963ba3.js";import"./shared-83c5e004.js";import"./shared-495860b4.js";import"./shared-6683daed.js";import"./shared-a03facdf.js";import"./shared-a587fd4b.js";function v(e){return function*(e){const t=[];for(const s of e.settings.subscriptions.allowFrequencyModification)if(y(s.jsonataQuery).evaluate(e.subscription))for(const e of s.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 g extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function x(e){const t=864e5,s=31*t;if(".5m"===e)return s/2;const a=parseInt(e.substring(0,e.length-1));if(isNaN(a))throw new g(e);if(e.endsWith("y"))return 31536e6*a;if(e.endsWith("m"))return a*s;if(e.endsWith("w"))return 6048e5*a;if(e.endsWith("d"))return a*t;throw new g(e)}function b(e,t){if("boolean"==typeof t)return t;const s=t.filter((t=>Boolean(y(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var s,a,i,r,n;if(t.min){const s=e.min?x(e.min):1/0;x(t.min)<s&&(e.min=t.min)}if(t.max){const s=e.max?x(e.max):-1/0;x(t.max)>s&&(e.max=t.max)}if("day"===(null===(s=t.allowedDays)||void 0===s?void 0:s.type)){const s=[...null!==(a=e.allowedDaysOfWeek)&&void 0!==a?a:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(s))}if("month"===(null===(i=t.allowedDays)||void 0===i?void 0:i.type)){const s=[...null!==(r=e.allowedDaysOfMonth)&&void 0!==r?r:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(s))}if(t.disallowedDates){const s=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(s))}return e}),{});return 0!==Object.keys(s).length&&s}function $(e){const[t,s,a]=e.split("-").map((e=>parseInt(e)));return new Date(t,s-1,a)}function j(e){const t=e.settings.subscriptions.allow_next_date_modification;let s;return s="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,s;const a=$(e.value),i=a.getTime(),r=b(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(a.getDate())))return!1;if(!1===(null===(s=r.allowedDaysOfWeek)||void 0===s?void 0:s.includes(a.getDay())))return!1;if(r.disallowedDates&&r.disallowedDates.find((e=>{const[t,s]=e.split("..").map((e=>$(e).getTime()));return i===t||void 0!==s&&i>=t&&i<=s})))return!1;if(r.min){const e=p(r.min);if(null!==e&&Date.now()+e>=i)return!1}if(r.max){const e=p(r.max);if(null!==e&&Date.now()+e<=i)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:s}},subscription:e.subscription,value:e.value})}let S,w,D,T,q,E,k,H,C,L,A,I=e=>e;const O=i(r(n(e,"subscription-form")));class N extends O{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=()=>a(S||(S=I` <div class="flex items-center gap-s text-m" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-l font-medium text-body leading-m" 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 s=this.__transactionTemplate,a=new URL(null!==(e=null==s?void 0:s._links["fx:items"].href)&&void 0!==e?e:"");a.searchParams.set("zoom","item_options"),t=a.toString()}catch(e){t=void 0}return a(w||(w=I` <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,".settings":this.settings})},this.__renderEndDate=()=>{var e;const{data:t,lang:s,ns:i}=this;return a(D||(D=I` <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,s,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),s,!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:s}=this;if(t&&s){return j({value:m(e),settings:t,subscription:s})}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:s}=this;return a(T||(T=I` <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"),s,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:s}=this,i=!!(null==e?void 0:e.is_active);return a(q||(q=I` <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"),s,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),s=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",u(e)),value:e})));return a(E||(E=I` <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),s,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:s,ns:i}=this;return a(k||(k=I` <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,s,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=>a(H||(H=I` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(e)),e,s,".5m"===e?"twice_a_month":"frequency",i))))},this.__renderFrequency=()=>a(C||(C=I` <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 s=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,i=s?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,s):void 0;return a(L||(L=I` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-l font-medium leading-xs mb-s" 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(s),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":d,"x-choice":l,"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 s(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}get headerTitleOptions(){var e,s;if(this.data&&this.__currencyCode){const a=u(this.data.frequency),i=this.__transactionTemplate,r=`${null==i?void 0:i.total_order} ${this.__currencyCode}`,n=this.__currencyDisplay,o=null===(s=null===(e=this.settings)||void 0===e?void 0:e.cart_display_config.show_sub_frequency)||void 0===s||s,d=this.__currencyCode&&o?".5m"===this.data.frequency?"twice_a_month":"recurring":"existing";return t(t({},a),{},{amount:r,currencyDisplay:n,context:d})}return{}}get headerSubtitleKey(){const e=this.settings?f(this.data,this.settings):_(this.data);return e?`subtitle_${e}`:super.headerSubtitleKey}renderBody(){var e,t,s,i,r;let n;try{const s=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");s.searchParams.set("order","transaction_date desc"),s.searchParams.set("zoom","items"),n=s.toString()}catch(e){n=void 0}return a(A||(A=I` ${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!==(s=this.__currencyCode)&&void 0!==s?s: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,s;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(s=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==s?s:"");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,s;const a=this.data,i=null===(e=null==a?void 0:a._embedded)||void 0===e?void 0:e["fx:transaction_template"],r=`#${this.__transactionTemplateLoaderId}`;return null!==(s=null!=i?i:null===(t=this.renderRoot.querySelector(r))||void 0===t?void 0:t.data)&&void 0!==s?s:null}get __defaultTemplateSet(){var e,t;const s=`#${this.__defaultTemplateSetLoaderId}`,a=this.renderRoot.querySelector(s);return null!==(t=null===(e=null==a?void 0:a.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const s=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(s))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const s=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(s))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const s=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(s))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __isNextTransactionDateVisible(){var e;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(!1===(null===(e=this.settings)||void 0===e?void 0:e.cart_display_config.show_sub_nextdate))return!1;if(null===this.settings)return!0;const t=this.settings.subscriptions.allow_next_date_modification;return!!function(e,t){let s;return s="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}))),b(e,s)}(this.data,t)}get __isStartDateVisible(){var e;return!this.hiddenSelector.matches("start-date",!0)&&(!1!==(null===(e=this.settings)||void 0===e?void 0:e.cart_display_config.show_sub_startdate)&&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(){var e;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(!1===(null===(e=this.settings)||void 0===e?void 0:e.cart_display_config.show_sub_frequency))return!1;if(null===this.settings)return!0;return!v({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=v({subscription:this.data,settings:this.settings});return Array.from(e)}get __currencyCode(){var e,t,s,a;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!==(a=null===(s=/Currency: ([A-Z]{3})/g.exec(o))||void 0===s?void 0:s[1])&&void 0!==a?a: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",N);export{N as SubscriptionForm};
@@ -1 +1 @@
1
- import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{S as s}from"./shared-56d70cc2.js";export{S as SubscriptionsTable}from"./shared-56d70cc2.js";import"./shared-37348820.js";import"./shared-21e68b72.js";import"./shared-11351c00.js";import"./shared-cb58dfcd.js";import"./shared-ba5c42c7.js";import"./shared-c18f681b.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-e3421ca1.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./foxy-nucleon-element.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4e709717.js";import"./shared-8eeddc22.js";import"./shared-e2675ed0.js";customElements.define("foxy-subscriptions-table",s);
1
+ import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{S as s}from"./shared-230dee11.js";export{S as SubscriptionsTable}from"./shared-230dee11.js";import"./shared-37348820.js";import"./shared-21e68b72.js";import"./shared-11351c00.js";import"./shared-cb58dfcd.js";import"./shared-ba5c42c7.js";import"./shared-c18f681b.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-e3421ca1.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./foxy-nucleon-element.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4e709717.js";import"./shared-8eeddc22.js";import"./shared-ada5e9f5.js";customElements.define("foxy-subscriptions-table",s);