@foxy.io/elements 1.36.0-beta.3 → 1.36.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 (53) hide show
  1. package/dist/cdn/foxy-cart-form.js +1 -1
  2. package/dist/cdn/foxy-customer-api.js +1 -1
  3. package/dist/cdn/foxy-customer-form.js +1 -1
  4. package/dist/cdn/foxy-customer-portal.js +27 -13
  5. package/dist/cdn/foxy-customer.js +1 -1
  6. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  7. package/dist/cdn/foxy-payment-method-card.js +1 -1
  8. package/dist/cdn/foxy-subscription-form.js +1 -1
  9. package/dist/cdn/foxy-transaction.js +1 -1
  10. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  11. package/dist/cdn/shared-231687fd.js +1 -0
  12. package/dist/cdn/{shared-5a9e9e89.js → shared-82e82908.js} +1 -1
  13. package/dist/cdn/shared-9ca85d1e.js +1 -0
  14. package/dist/cdn/translations/customer-portal/de.json +18 -0
  15. package/dist/cdn/translations/customer-portal/en.json +18 -0
  16. package/dist/cdn/translations/customer-portal/es.json +18 -0
  17. package/dist/cdn/translations/customer-portal/fr.json +18 -0
  18. package/dist/cdn/translations/customer-portal/nl.json +18 -0
  19. package/dist/cdn/translations/customer-portal/pl.json +18 -0
  20. package/dist/cdn/translations/customer-portal/sv.json +18 -0
  21. package/dist/cdn/translations/customer-portal/zh-hk.json +18 -0
  22. package/dist/elements/public/CartForm/types.d.ts +1 -9
  23. package/dist/elements/public/CartForm/types.js.map +1 -1
  24. package/dist/elements/public/CustomerPortal/CustomerPortal.d.ts +4 -0
  25. package/dist/elements/public/CustomerPortal/CustomerPortal.js +48 -13
  26. package/dist/elements/public/CustomerPortal/CustomerPortal.js.map +1 -1
  27. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js +7 -1
  28. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js.map +1 -1
  29. package/dist/elements/public/CustomerPortal/InternalCustomerPortalPasswordResetView.d.ts +25 -0
  30. package/dist/elements/public/CustomerPortal/InternalCustomerPortalPasswordResetView.js +72 -0
  31. package/dist/elements/public/CustomerPortal/InternalCustomerPortalPasswordResetView.js.map +1 -0
  32. package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js +1 -1
  33. package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js.map +1 -1
  34. package/dist/elements/public/CustomerPortal/index.d.ts +2 -0
  35. package/dist/elements/public/CustomerPortal/index.js +4 -0
  36. package/dist/elements/public/CustomerPortal/index.js.map +1 -1
  37. package/dist/elements/public/EmailTemplateForm/types.d.ts +1 -3
  38. package/dist/elements/public/EmailTemplateForm/types.js.map +1 -1
  39. package/dist/elements/public/StoreForm/types.d.ts +4 -38
  40. package/dist/elements/public/StoreForm/types.js.map +1 -1
  41. package/dist/elements/public/SubscriptionSettingsForm/types.d.ts +1 -3
  42. package/dist/elements/public/SubscriptionSettingsForm/types.js.map +1 -1
  43. package/dist/elements/public/Transaction/Transaction.js +13 -17
  44. package/dist/elements/public/Transaction/Transaction.js.map +1 -1
  45. package/dist/elements/public/UserCard/UserCard.js +0 -2
  46. package/dist/elements/public/UserCard/UserCard.js.map +1 -1
  47. package/dist/elements/public/UserInvitationCard/types.d.ts +3 -1
  48. package/dist/elements/public/UserInvitationCard/types.js +1 -1
  49. package/dist/elements/public/UserInvitationCard/types.js.map +1 -1
  50. package/dist/elements/public/UserInvitationForm/types.d.ts +2 -41
  51. package/dist/elements/public/UserInvitationForm/types.js.map +1 -1
  52. package/package.json +3 -3
  53. package/dist/cdn/shared-0e156ee7.js +0 -1
@@ -1 +1 @@
1
- import"./shared-2503aefc.js";import"./shared-10b54c49.js";import"./shared-0b1b1c14.js";import"./shared-5f43aa36.js";import"./shared-01bb183b.js";import{I as e}from"./shared-d784b79a.js";import"./shared-7ce74b42.js";import"./shared-528b3bdb.js";import"./shared-0d8e7067.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-4e8a5b95.js";import{_ as t,B as a}from"./shared-d1195c27.js";import"./shared-1482d5dd.js";import"./shared-89d09114.js";import{h as s}from"./shared-ba5c42c7.js";import{S as i,R as r,a as n}from"./shared-f72d82a9.js";import{c as o}from"./shared-4e709717.js";import{S as d,C as l}from"./shared-cbd1fab7.js";import"./shared-1a49f70b.js";import{G as c}from"./shared-61ef8001.js";import"./shared-cd652fd0.js";import"./shared-6d11190a.js";import"./shared-d2340faa.js";import"./shared-6b76afc2.js";import"./shared-cc76a917.js";import"./shared-fea2714e.js";import{p as u}from"./shared-9d7ae4aa.js";import{s as m}from"./shared-79d0699c.js";import{i as h}from"./shared-53e42a77.js";import{p as f}from"./shared-0e156ee7.js";import{j as _}from"./shared-c2efc54e.js";import"./shared-c52295d5.js";import"./shared-c1ade7a9.js";import"./shared-2879b67f.js";import"./shared-6a45a781.js";import"./shared-651c44fa.js";import"./shared-2e8361e1.js";import"./shared-3aaf64e6.js";import"./shared-76dcc864.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-eeb2bd18.js";import"./shared-17a61265.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";import"./shared-4c90701b.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-0b00883f.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-d279baa5.js";import"./shared-43e2c3f6.js";import"./shared-1c07cd7f.js";import"./shared-93774efe.js";import"./shared-c5cf889e.js";import"./shared-8676e5c0.js";import"./shared-641786b2.js";import"./shared-e0d1856d.js";import"./shared-86aa139c.js";import"./shared-4cf87721.js";import"./shared-f92b9842.js";import"./shared-60150977.js";function p(e){return function*(e){const t=[];for(const a of e.settings.subscriptions.allowFrequencyModification)if(_(a.jsonataQuery).evaluate(e.subscription))for(const e of a.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}class y extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function v(e){const t=864e5,a=31*t;if(".5m"===e)return a/2;const s=parseInt(e.substring(0,e.length-1));if(isNaN(s))throw new y(e);if(e.endsWith("y"))return 31536e6*s;if(e.endsWith("m"))return s*a;if(e.endsWith("w"))return 6048e5*s;if(e.endsWith("d"))return s*t;throw new y(e)}function x(e,t){if("boolean"==typeof t)return t;const a=t.filter((t=>Boolean(_(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var a,s,i,r,n;if(t.min){const a=e.min?v(e.min):1/0;v(t.min)<a&&(e.min=t.min)}if(t.max){const a=e.max?v(e.max):-1/0;v(t.max)>a&&(e.max=t.max)}if("day"===(null===(a=t.allowedDays)||void 0===a?void 0:a.type)){const a=[...null!==(s=e.allowedDaysOfWeek)&&void 0!==s?s:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(a))}if("month"===(null===(i=t.allowedDays)||void 0===i?void 0:i.type)){const a=[...null!==(r=e.allowedDaysOfMonth)&&void 0!==r?r:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(a))}if(t.disallowedDates){const a=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(a))}return e}),{});return 0!==Object.keys(a).length&&a}function g(e){const[t,a,s]=e.split("-").map((e=>parseInt(e)));return new Date(t,a-1,s)}function b(e){const t=e.settings.subscriptions.allow_next_date_modification;let a;return a="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,a;const s=g(e.value),i=s.getTime(),r=x(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof r)return r;if(!1===(null===(t=r.allowedDaysOfMonth)||void 0===t?void 0:t.includes(s.getDate())))return!1;if(!1===(null===(a=r.allowedDaysOfWeek)||void 0===a?void 0:a.includes(s.getDay())))return!1;if(r.disallowedDates&&r.disallowedDates.find((e=>{const[t,a]=e.split("..").map((e=>g(e).getTime()));return i===t||void 0!==a&&i>=t&&i<=a})))return!1;if(r.min){const e=f(r.min);if(null!==e&&Date.now()+e>=i)return!1}if(r.max){const e=f(r.max);if(null!==e&&Date.now()+e<=i)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:a}},subscription:e.subscription,value:e.value})}let $,j,D,w,S,T,q,E,k,H,C,L=e=>e;const A=i(r(n(e,"subscription-form")));class I extends A{constructor(){super(...arguments),this.getTransactionPageHref=(e,t)=>null==t?void 0:t._links["fx:receipt"].href,this.getCustomerPageHref=null,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderItemsActions=()=>s($||($=L` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-s font-medium text-secondary" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var e;let t;try{const a=this.__transactionTemplate,s=new URL(null!==(e=null==a?void 0:a._links["fx:items"].href)&&void 0!==e?e:"");s.searchParams.set("zoom","item_options"),t=s.toString()}catch(e){t=void 0}return s(j||(j=L` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" infer="items" item="foxy-item-card" .itemProps="${0}"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),h(t),{"locale-codes":this.localeCodes})},this.__renderEndDate=()=>{var e;const{data:t,lang:a,ns:i}=this;return s(D||(D=L` <div data-testid="end-date"> ${0} <x-group frame> <foxy-i18n key="end_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),i,a,h(null===(e=null==t?void 0:t.end_date)||void 0===e?void 0:e.substr(0,10)),h(null==t?void 0:t.end_date),a,!this.__isEndDateEditable,this.disabledSelector.matches("end-date",!0),this.__checkEndDateAvailability,(e=>{const t=e.target;this.edit({end_date:t.value})}),this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:a}=this;if(t&&a){return b({value:m(e),settings:t,subscription:a})}return e.getTime()>=Date.now()},this.__checkStartDateAvailability=e=>e.getTime()>=Date.now(),this.__checkEndDateAvailability=e=>{const t=new Date;return t.setDate(t.getDate()+1),t.setHours(0,0,0,0),e.getTime()>=t.getTime()},this.__renderStartDate=()=>{const{data:e,lang:t,ns:a}=this;return s(w||(w=L` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),a,t,h(null==e?void 0:e.start_date.substr(0,10)),h(null==e?void 0:e.start_date),t,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(e=>{const t=e.target;this.edit({start_date:t.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:a}=this,i=!!(null==e?void 0:e.is_active);return s(S||(S=L` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),a,t,h(null==e?void 0:e.next_transaction_date.substr(0,10)),h(null==e?void 0:e.next_transaction_date),t,!i||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),a=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",u(e)),value:e})));return s(T||(T=L` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),h(this.form.frequency),a,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:a,ns:i}=this;return s(q||(q=L` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),i,a,i,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>s(E||(E=L` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(e)),e,a,".5m"===e?"twice_a_month":"frequency",i))))},this.__renderFrequency=()=>s(k||(k=L` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__renderCustomer=()=>{var e,t;const a=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,i=a?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,a):void 0;return s(H||(H=L` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="customer" href="${0}"></foxy-customer-card> </a> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),o({"block rounded transition-colors":!0,"ring-1 ring-contrast-10":!i,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!i,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!i}),h(i),h(a),this.renderTemplateOrSlot("customer:after"))}}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-customer-card":customElements.get("foxy-customer-card"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":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 a(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}get headerTitleOptions(){if(this.data&&this.__currencyCode){const e=u(this.data.frequency),a=this.__transactionTemplate,s=`${null==a?void 0:a.total_order} ${this.__currencyCode}`,i=this.__currencyDisplay,r=this.__currencyCode?".5m"===this.data.frequency?"twice_a_month":"recurring":"existing";return t(t({},e),{},{amount:s,currencyDisplay:i,context:r})}return{}}get headerSubtitleOptions(){var e,t,a;let s,i=null;if(null===(e=this.data)||void 0===e?void 0:e.first_failed_transaction_date)s="failed",i=this.data.first_failed_transaction_date;else if(null===(t=this.data)||void 0===t?void 0:t.end_date){s=new Date(this.data.end_date).getTime()>Date.now()?"will_be_cancelled":"cancelled",i=this.data.end_date}else(null===(a=this.data)||void 0===a?void 0:a.is_active)?new Date(this.data.start_date)>new Date?(s="will_be_active",i=this.data.start_date):(s="active",i=this.data.next_transaction_date):s="inactive";return{date:i,context:s}}renderBody(){var e,t,a,i,r;let n;try{const a=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");a.searchParams.set("order","transaction_date desc"),a.searchParams.set("zoom","items"),n=a.toString()}catch(e){n=void 0}return s(C||(C=L` ${0} <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> </div> `),this.renderHeader(),h(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),h(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),h(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),h(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),h(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("customer",!0)?"":this.__renderCustomer(),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",this.__isEndDateVisible?this.__renderEndDate():"",h(null!==(a=this.__currencyCode)&&void 0!==a?a:void 0),h(null===(r=null===(i=this.data)||void 0===i?void 0:i._links["fx:attributes"])||void 0===r?void 0:r.href),h(n),this.getTransactionPageHref)}get __transactionTemplateHref(){var e;const t=this.data;return(null===(e=null==t?void 0:t._embedded)||void 0===e?void 0:e["fx:transaction_template"])||null==t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var e,t,a;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(a=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==a?a:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __templateSetHref(){const e=this.__transactionTemplate;if(!(null==e?void 0:e.currency_code))return(null==e?void 0:e.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t,a;const s=this.data,i=null===(e=null==s?void 0:s._embedded)||void 0===e?void 0:e["fx:transaction_template"],r=`#${this.__transactionTemplateLoaderId}`;return null!==(a=null!=i?i:null===(t=this.renderRoot.querySelector(r))||void 0===t?void 0:t.data)&&void 0!==a?a:null}get __defaultTemplateSet(){var e,t;const a=`#${this.__defaultTemplateSetLoaderId}`,s=this.renderRoot.querySelector(a);return null!==(t=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const a=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const a=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const a=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __isNextTransactionDateVisible(){if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;const e=this.settings.subscriptions.allow_next_date_modification;return!!function(e,t){let a;return a="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),x(e,a)}(this.data,e)}get __isStartDateVisible(){return!this.hiddenSelector.matches("start-date",!0)&&this.__isNextTransactionDateVisible}get __isEndDateVisible(){return!this.hiddenSelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())&&(!1!==this.data.is_active&&!this.settings)))}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isEndDateEditable(){return!this.readonlySelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&null===this.settings)))}get __isFrequencyVisible(){if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;return!p({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=p({subscription:this.data,settings:this.settings});return Array.from(e)}get __currencyCode(){var e,t,a,s;const i=this.__transactionTemplate;if(null==i?void 0:i.currency_code)return i.currency_code;const r=this.__localeCodesHelper,n=null===(t=null!==(e=this.__templateSet)&&void 0!==e?e:this.__defaultTemplateSet)||void 0===t?void 0:t.locale_code,o=n?null==r?void 0:r.values[n]:void 0;return o&&null!==(s=null===(a=/Currency: ([A-Z]{3})/g.exec(o))||void 0===a?void 0:a[1])&&void 0!==s?s:null}get __currencyDisplay(){var e;return(null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol)?"code":"symbol"}}customElements.define("foxy-subscription-form",I);export{I as SubscriptionForm};
1
+ import"./shared-2503aefc.js";import"./shared-10b54c49.js";import"./shared-0b1b1c14.js";import"./shared-5f43aa36.js";import"./shared-01bb183b.js";import{I as e}from"./shared-d784b79a.js";import"./shared-7ce74b42.js";import"./shared-528b3bdb.js";import"./shared-0d8e7067.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-4e8a5b95.js";import{_ as t,B as a}from"./shared-d1195c27.js";import"./shared-1482d5dd.js";import"./shared-89d09114.js";import{h as s}from"./shared-ba5c42c7.js";import{S as i,R as r,a as n}from"./shared-f72d82a9.js";import{c as o}from"./shared-4e709717.js";import{S as d,C as l}from"./shared-cbd1fab7.js";import"./shared-1a49f70b.js";import{G as c}from"./shared-61ef8001.js";import"./shared-cd652fd0.js";import"./shared-6d11190a.js";import"./shared-d2340faa.js";import"./shared-6b76afc2.js";import"./shared-cc76a917.js";import"./shared-fea2714e.js";import{p as u}from"./shared-9d7ae4aa.js";import{s as m}from"./shared-79d0699c.js";import{i as h}from"./shared-53e42a77.js";import{p as f}from"./shared-9ca85d1e.js";import{j as _}from"./shared-c2efc54e.js";import"./shared-c52295d5.js";import"./shared-c1ade7a9.js";import"./shared-2879b67f.js";import"./shared-6a45a781.js";import"./shared-651c44fa.js";import"./shared-2e8361e1.js";import"./shared-3aaf64e6.js";import"./shared-76dcc864.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-eeb2bd18.js";import"./shared-17a61265.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";import"./shared-4c90701b.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-0b00883f.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-d279baa5.js";import"./shared-43e2c3f6.js";import"./shared-1c07cd7f.js";import"./shared-93774efe.js";import"./shared-c5cf889e.js";import"./shared-8676e5c0.js";import"./shared-641786b2.js";import"./shared-e0d1856d.js";import"./shared-86aa139c.js";import"./shared-4cf87721.js";import"./shared-f92b9842.js";import"./shared-60150977.js";function p(e){return function*(e){const t=[];for(const a of e.settings.subscriptions.allowFrequencyModification)if(_(a.jsonataQuery).evaluate(e.subscription))for(const e of a.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}class y extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function v(e){const t=864e5,a=31*t;if(".5m"===e)return a/2;const s=parseInt(e.substring(0,e.length-1));if(isNaN(s))throw new y(e);if(e.endsWith("y"))return 31536e6*s;if(e.endsWith("m"))return s*a;if(e.endsWith("w"))return 6048e5*s;if(e.endsWith("d"))return s*t;throw new y(e)}function x(e,t){if("boolean"==typeof t)return t;const a=t.filter((t=>Boolean(_(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var a,s,i,r,n;if(t.min){const a=e.min?v(e.min):1/0;v(t.min)<a&&(e.min=t.min)}if(t.max){const a=e.max?v(e.max):-1/0;v(t.max)>a&&(e.max=t.max)}if("day"===(null===(a=t.allowedDays)||void 0===a?void 0:a.type)){const a=[...null!==(s=e.allowedDaysOfWeek)&&void 0!==s?s:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(a))}if("month"===(null===(i=t.allowedDays)||void 0===i?void 0:i.type)){const a=[...null!==(r=e.allowedDaysOfMonth)&&void 0!==r?r:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(a))}if(t.disallowedDates){const a=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(a))}return e}),{});return 0!==Object.keys(a).length&&a}function g(e){const[t,a,s]=e.split("-").map((e=>parseInt(e)));return new Date(t,a-1,s)}function b(e){const t=e.settings.subscriptions.allow_next_date_modification;let a;return a="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,a;const s=g(e.value),i=s.getTime(),r=x(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof r)return r;if(!1===(null===(t=r.allowedDaysOfMonth)||void 0===t?void 0:t.includes(s.getDate())))return!1;if(!1===(null===(a=r.allowedDaysOfWeek)||void 0===a?void 0:a.includes(s.getDay())))return!1;if(r.disallowedDates&&r.disallowedDates.find((e=>{const[t,a]=e.split("..").map((e=>g(e).getTime()));return i===t||void 0!==a&&i>=t&&i<=a})))return!1;if(r.min){const e=f(r.min);if(null!==e&&Date.now()+e>=i)return!1}if(r.max){const e=f(r.max);if(null!==e&&Date.now()+e<=i)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:a}},subscription:e.subscription,value:e.value})}let $,j,D,w,S,T,q,E,k,H,C,L=e=>e;const A=i(r(n(e,"subscription-form")));class I extends A{constructor(){super(...arguments),this.getTransactionPageHref=(e,t)=>null==t?void 0:t._links["fx:receipt"].href,this.getCustomerPageHref=null,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderItemsActions=()=>s($||($=L` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-s font-medium text-secondary" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var e;let t;try{const a=this.__transactionTemplate,s=new URL(null!==(e=null==a?void 0:a._links["fx:items"].href)&&void 0!==e?e:"");s.searchParams.set("zoom","item_options"),t=s.toString()}catch(e){t=void 0}return s(j||(j=L` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" infer="items" item="foxy-item-card" .itemProps="${0}"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),h(t),{"locale-codes":this.localeCodes})},this.__renderEndDate=()=>{var e;const{data:t,lang:a,ns:i}=this;return s(D||(D=L` <div data-testid="end-date"> ${0} <x-group frame> <foxy-i18n key="end_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),i,a,h(null===(e=null==t?void 0:t.end_date)||void 0===e?void 0:e.substr(0,10)),h(null==t?void 0:t.end_date),a,!this.__isEndDateEditable,this.disabledSelector.matches("end-date",!0),this.__checkEndDateAvailability,(e=>{const t=e.target;this.edit({end_date:t.value})}),this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:a}=this;if(t&&a){return b({value:m(e),settings:t,subscription:a})}return e.getTime()>=Date.now()},this.__checkStartDateAvailability=e=>e.getTime()>=Date.now(),this.__checkEndDateAvailability=e=>{const t=new Date;return t.setDate(t.getDate()+1),t.setHours(0,0,0,0),e.getTime()>=t.getTime()},this.__renderStartDate=()=>{const{data:e,lang:t,ns:a}=this;return s(w||(w=L` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),a,t,h(null==e?void 0:e.start_date.substr(0,10)),h(null==e?void 0:e.start_date),t,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(e=>{const t=e.target;this.edit({start_date:t.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:a}=this,i=!!(null==e?void 0:e.is_active);return s(S||(S=L` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),a,t,h(null==e?void 0:e.next_transaction_date.substr(0,10)),h(null==e?void 0:e.next_transaction_date),t,!i||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),a=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",u(e)),value:e})));return s(T||(T=L` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),h(this.form.frequency),a,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:a,ns:i}=this;return s(q||(q=L` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),i,a,i,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>s(E||(E=L` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(e)),e,a,".5m"===e?"twice_a_month":"frequency",i))))},this.__renderFrequency=()=>s(k||(k=L` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__renderCustomer=()=>{var e,t;const a=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,i=a?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,a):void 0;return s(H||(H=L` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="customer" href="${0}"></foxy-customer-card> </a> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),o({"block rounded transition-colors":!0,"ring-1 ring-contrast-10":!i,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!i,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!i}),h(i),h(a),this.renderTemplateOrSlot("customer:after"))}}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-customer-card":customElements.get("foxy-customer-card"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":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 a(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}get headerTitleOptions(){if(this.data&&this.__currencyCode){const e=u(this.data.frequency),a=this.__transactionTemplate,s=`${null==a?void 0:a.total_order} ${this.__currencyCode}`,i=this.__currencyDisplay,r=this.__currencyCode?".5m"===this.data.frequency?"twice_a_month":"recurring":"existing";return t(t({},e),{},{amount:s,currencyDisplay:i,context:r})}return{}}get headerSubtitleOptions(){var e,t,a;let s,i=null;if(null===(e=this.data)||void 0===e?void 0:e.first_failed_transaction_date)s="failed",i=this.data.first_failed_transaction_date;else if(null===(t=this.data)||void 0===t?void 0:t.end_date){s=new Date(this.data.end_date).getTime()>Date.now()?"will_be_cancelled":"cancelled",i=this.data.end_date}else(null===(a=this.data)||void 0===a?void 0:a.is_active)?new Date(this.data.start_date)>new Date?(s="will_be_active",i=this.data.start_date):(s="active",i=this.data.next_transaction_date):s="inactive";return{date:i,context:s}}renderBody(){var e,t,a,i,r;let n;try{const a=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");a.searchParams.set("order","transaction_date desc"),a.searchParams.set("zoom","items"),n=a.toString()}catch(e){n=void 0}return s(C||(C=L` ${0} <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> </div> `),this.renderHeader(),h(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),h(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),h(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),h(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),h(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("customer",!0)?"":this.__renderCustomer(),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",this.__isEndDateVisible?this.__renderEndDate():"",h(null!==(a=this.__currencyCode)&&void 0!==a?a:void 0),h(null===(r=null===(i=this.data)||void 0===i?void 0:i._links["fx:attributes"])||void 0===r?void 0:r.href),h(n),this.getTransactionPageHref)}get __transactionTemplateHref(){var e;const t=this.data;return(null===(e=null==t?void 0:t._embedded)||void 0===e?void 0:e["fx:transaction_template"])||null==t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var e,t,a;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(a=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==a?a:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __templateSetHref(){const e=this.__transactionTemplate;if(!(null==e?void 0:e.currency_code))return(null==e?void 0:e.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t,a;const s=this.data,i=null===(e=null==s?void 0:s._embedded)||void 0===e?void 0:e["fx:transaction_template"],r=`#${this.__transactionTemplateLoaderId}`;return null!==(a=null!=i?i:null===(t=this.renderRoot.querySelector(r))||void 0===t?void 0:t.data)&&void 0!==a?a:null}get __defaultTemplateSet(){var e,t;const a=`#${this.__defaultTemplateSetLoaderId}`,s=this.renderRoot.querySelector(a);return null!==(t=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const a=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const a=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const a=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __isNextTransactionDateVisible(){if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;const e=this.settings.subscriptions.allow_next_date_modification;return!!function(e,t){let a;return a="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),x(e,a)}(this.data,e)}get __isStartDateVisible(){return!this.hiddenSelector.matches("start-date",!0)&&this.__isNextTransactionDateVisible}get __isEndDateVisible(){return!this.hiddenSelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())&&(!1!==this.data.is_active&&!this.settings)))}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isEndDateEditable(){return!this.readonlySelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&null===this.settings)))}get __isFrequencyVisible(){if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;return!p({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=p({subscription:this.data,settings:this.settings});return Array.from(e)}get __currencyCode(){var e,t,a,s;const i=this.__transactionTemplate;if(null==i?void 0:i.currency_code)return i.currency_code;const r=this.__localeCodesHelper,n=null===(t=null!==(e=this.__templateSet)&&void 0!==e?e:this.__defaultTemplateSet)||void 0===t?void 0:t.locale_code,o=n?null==r?void 0:r.values[n]:void 0;return o&&null!==(s=null===(a=/Currency: ([A-Z]{3})/g.exec(o))||void 0===a?void 0:a[1])&&void 0!==s?s:null}get __currencyDisplay(){var e;return(null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol)?"code":"symbol"}}customElements.define("foxy-subscription-form",I);export{I as SubscriptionForm};
@@ -1 +1 @@
1
- import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./foxy-address-form.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-4e8a5b95.js";import"./shared-7ce74b42.js";import"./shared-42bb9e8e.js";import"./shared-8521017c.js";import{b as t,I as e}from"./shared-d784b79a.js";import"./shared-0b1b1c14.js";import"./shared-4c90701b.js";import{_ as o,B as i}from"./shared-d1195c27.js";import{h as r,s}from"./shared-ba5c42c7.js";import{N as n}from"./shared-d1dfac4d.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{g as a}from"./shared-bab2ea2c.js";import{i as d}from"./shared-53e42a77.js";import{c as l}from"./shared-4e709717.js";import{R as c,a as u}from"./shared-f72d82a9.js";import"./shared-1c07cd7f.js";import"./shared-93774efe.js";import"./shared-5f43aa36.js";import"./shared-01bb183b.js";import"./shared-c52295d5.js";import"./shared-5212ef4f.js";import"./shared-eeb2bd18.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-c5cf889e.js";import"./shared-1482d5dd.js";import"./shared-c1ade7a9.js";import"./shared-6b76afc2.js";import"./shared-8676e5c0.js";import"./shared-5fd5805c.js";import"./shared-1a49f70b.js";import"./shared-2503aefc.js";import"./shared-89d09114.js";import"./shared-0053cf93.js";import"./shared-0b00883f.js";import"./shared-25893d83.js";import"./shared-641786b2.js";import"./shared-cf613436.js";import"./shared-901b41cf.js";import"./shared-f20eefdd.js";import"./shared-fea2714e.js";import"./shared-2e8361e1.js";import"./shared-cd652fd0.js";import"./shared-cf28d2c8.js";import"./shared-10b54c49.js";import"./shared-2879b67f.js";import"./shared-d2340faa.js";import"./shared-6a45a781.js";import"./shared-6d11190a.js";import"./shared-651c44fa.js";import"./shared-3aaf64e6.js";import"./shared-76dcc864.js";import"./shared-133fc37b.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-9d7ae4aa.js";import"./shared-2d11750b.js";import"./foxy-form-dialog.js";import"./shared-53e476fd.js";import"./shared-43e551f2.js";import"./shared-d279baa5.js";import"./shared-e0d1856d.js";import"./shared-4cf87721.js";import"./shared-528b3bdb.js";import"./shared-22dd6cbe.js";import"./shared-e622d8cf.js";import"./shared-60150977.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let f,p=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return o(o({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"idle"===t?this.theme:"";return r(f||(f=p` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button theme="${0} tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),e,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const e=new n.API(this),o=await e.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=o.ok?"idle":"fail",o.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let m,h,_,y,v=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends t{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return o(o({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var t,e,o,i;const n=this.nucleon,c=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t._links["fx:customer"].href,u=c?null===(e=null==n?void 0:n.getCustomerPageHref)||void 0===e?void 0:e.call(n,c):void 0;return r(m||(m=v` <foxy-i18n infer="" class="block text-l font-medium leading-xs mb-s" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),l({"block ring-inset rounded transition-colors bg-contrast-5":!0,"cursor-pointer hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),d(u),d(c),this.__renderCopyAction(s(h||(h=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",c?String(a(c)):""),this.__renderCopyAction(s(_||(_=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(i=null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.customer_email)&&void 0!==i?i:""))}__renderCopyAction(t,e,o,i){const s=this[o],n="fail"===s?"error":"done"===s?"end":"busy";return r(y||(y=v` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==s,(()=>"idle"===s&&this.__copy(i,o)),(t=>"idle"!==s&&t.stopPropagation()),(t=>"idle"!==s&&t.stopPropagation()),l({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==s}),t,e,l({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===s}),n)}async __copy(t,e){this[e]="busy";try{await navigator.clipboard.writeText(t),this[e]="done"}catch(t){this[e]="fail"}setTimeout((()=>this[e]="idle"),3e3)}});let x,b,g,j,w,$,k=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends t{renderControl(){var t,e,o,i,s,n,a,d,l,c;return r(x||(x=k` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} </div> `),(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(l=this.nucleon)||void 0===l?void 0:l.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"")}__renderSendEmailsAction(){var t,e;return r(b||(b=k` <foxy-internal-transaction-post-action-control infer="send-emails" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,e;return r(g||(g=k` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,e,o;return r(j||(j=k` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(o=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:void"])||void 0===o?void 0:o.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,e,o;return r(w||(w=k` <foxy-internal-transaction-post-action-control infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(o=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:refund"])||void 0===o?void 0:o.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderSubscriptionAction(){var t,e,o;const i=this.nucleon,s=null===(e=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t._links["fx:subscription"])||void 0===e?void 0:e.href,n=s?null===(o=null==i?void 0:i.getSubscriptionPageHref)||void 0===o?void 0:o.call(i,s):void 0;return r($||($=k` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),d(n))}});let S,P,A,C,H,L,E,I,R,B,q=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends t{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var t,e,o,i,s,n,a,l,c;const u=null===(t=this.nucleon)||void 0===t?void 0:t.data;if(!u)return r(S||(S=q``));const f=null!==(o=null===(e=null==u?void 0:u._embedded)||void 0===e?void 0:e["fx:applied_taxes"])&&void 0!==o?o:[],p=null!==(s=null===(i=u._embedded)||void 0===i?void 0:i["fx:shipments"])&&void 0!==s?s:[];return r(P||(P=q` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>&colon;</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>&colon; ${0} </span> </span> </p> `),d(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===p.length||0===u.total_shipping?r(A||(A=q` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>&colon;</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((t=>r(C||(C=q` <span>${0}&colon;</span> <span>${0}</span> `),t.shipping_service_description,this.__renderPrice(t.total_shipping,!0)))),0===f.length||0===u.total_tax?r(H||(H=q` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>&colon;</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((t=>r(L||(L=q` <span>${0}&colon;</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),null===(a=null===(n=null==u?void 0:u._embedded)||void 0===n?void 0:n["fx:applied_gift_card_codes"])||void 0===a?void 0:a.map((t=>{var e;return r(E||(E=q` <span>${0}&colon;</span> <span>${0}</span> `),t._embedded["fx:gift_card"].name,this.__renderPrice(null!==(e=t.balance_adjustment)&&void 0!==e?e:0,!0))})),null===(c=null===(l=null==u?void 0:u._embedded)||void 0===l?void 0:l["fx:discounts"])||void 0===c?void 0:c.map((t=>r(I||(I=q` <span data-testclass="discount">${0}&colon;</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}get __storeHref(){var t,e,o;return null===(o=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:store"])||void 0===o?void 0:o.href}get __store(){var t,e;const o=`#${this.__storeLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(o))||void 0===t?void 0:t.data)&&void 0!==e?e:null}__renderPrice(t,e=!1){var o,i,s;const n=(null===(o=this.__store)||void 0===o?void 0:o.use_international_currency_symbol)?"code":"symbol",a=null===(s=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===s?void 0:s.currency_code;return r(R||(R=q` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),e&&0!==t?t>0?"text-success":"text-error":"",{currencyDisplay:n,signDisplay:e?"exceptZero":"auto",amount:`${t} ${a}`})}__renderStatus(){var t,e;const o=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e.status)||"completed";let i="";return i=["capturing","captured","approved","authorized","pending"].includes(o)?"text-success bg-success-10":o&&"completed"!==o?["problem","pending_fraud_review","rejected","declined"].includes(o)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",r(B||(B=q` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),i,o)}});let G,T,U,Z=t=>t;const M=c(u(e,"transaction"));class O extends M{constructor(){var t;super(...arguments),t=this,this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.localeCodes=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null,this.__webhooksBulkActions=[{name:"refeed",onClick:async function(e){if(!t.data)return;const o=t.data._links["fx:send_webhooks"].href,i=new O.API(t),r=await i.fetch(o,{method:"POST",body:JSON.stringify({refeed_hooks:e.map((t=>a(t._links.self.href))),event:"refeed"})});if(e.forEach((t=>{O.Rumour("").share({related:[...e.map((t=>t._links["fx:logs"].href)),...e.map((t=>t._links["fx:statuses"].href))],source:t._links.self.href,data:t})})),!r.ok)throw new Error(await r.text())}}]}static get properties(){return o(o({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},localeCodes:{attribute:"locale-codes"}})}get readonlySelector(){var t,e,o;const r=["billing-addresses","datafeed","webhooks:dialog:url",super.readonlySelector];return Boolean(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==e?e:null===(o=this.data)||void 0===o?void 0:o._links["fx:refund"])||r.push("items","attributes","custom-fields"),new i(r.join(" ").trim())}get hiddenSelector(){var t,e,o,r;const s=["billing-addresses:dialog:delete","billing-addresses:dialog:timestamps","webhooks:dialog:header:copy-json","webhooks:dialog:header:copy-id","webhooks:dialog:timestamps","webhooks:dialog:name","webhooks:dialog:query","webhooks:dialog:encryption-key","webhooks:dialog:delete",super.readonlySelector],n=null===(t=this.data)||void 0===t?void 0:t.type;return(null===(e=this.data)||void 0===e?void 0:e._links["fx:subscription"])||s.unshift("subscription"),"subscription_modification"===n&&s.unshift("actions"),"updateinfo"===n&&s.unshift("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===n&&s.unshift("not=customer,subscription,custom-fields,attributes"),(null===(r=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===r?void 0:r.use_webhook)||s.unshift("datafeed"),new i(s.join(" ").trim())}get headerSubtitleOptions(){var t,e,o,i,r;const s=null===(t=this.data)||void 0===t?void 0:t.source,n=null===(e=this.data)||void 0===e?void 0:e.type;let a="";return"updateinfo"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===s?"admin_changed_payment_method_with_uoe":"mit_api"===s?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===s?"admin_changed_subscription_with_uoe":"mit_api"===s?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===n?"mit_recurring"===s?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===s?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===s&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===n?"cit_recurring_cancellation"===s?a="customer_canceled_subscription":"mit_recurring_cancellation"===s&&(a="admin_canceled_subscription"):(null===(o=this.data)||void 0===o?void 0:o._links["fx:subscription"])?(null==s?void 0:s.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===s?a="admin_subscribed_with_uoe":"mit_api"===s&&(a="integration_subscribed"):(null==s?void 0:s.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===s?a="admin_placed_order_with_uoe":"mit_api"===s&&(a="integration_placed_order"),{transaction_date:null===(i=this.data)||void 0===i?void 0:i.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerCopyIdValue(){var t,e,o;return null!==(o=null===(e=null===(t=this.data)||void 0===t?void 0:t.display_id)||void 0===e?void 0:e.toString())&&void 0!==o?o:""}renderHeaderActions(){return r(G||(G=Z` <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> `))}renderBody(){var t,e,o,i,s,n,a,l,c,u,f,p,m,h,_;let y,v,x;const b=this.hiddenSelector;if(this.data)try{const o=new URL(this.data._links["fx:shipments"].href),i=new URL(null!==(e=null===(t=this.__storeLoader)||void 0===t?void 0:t.data._links["fx:webhooks"].href)&&void 0!==e?e:""),r=new URL(this.data._links["fx:items"].href);o.searchParams.set("zoom","items:item_category"),i.searchParams.set("event_resource","transaction"),r.searchParams.set("zoom","item_options"),y=o.toString(),v=i.toString(),x=r.toString()}catch(t){}return r(T||(T=Z` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert wide .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="webhooks" first="${0}" item="foxy-webhook-card" form="foxy-webhook-form" hide-create-button hide-delete-button alert .bulkActions="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="datafeed"> <foxy-internal-switch-control infer="data-is-fed"></foxy-internal-switch-control> <foxy-internal-transaction-post-action-control infer="process-webhook" href="${0}"> </foxy-internal-transaction-post-action-control> </foxy-internal-summary-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(i=null===(o=this.data)||void 0===o?void 0:o.status)&&void 0!==i?i:"")?r(U||(U=Z` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(s=this.data)||void 0===s?void 0:s.status):"",b.matches("items",!0)&&b.matches("summary",!0),d(x),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(a=null===(n=this.__storeLoader)||void 0===n?void 0:n.data)||void 0===a?void 0:a._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href},d(null===(c=this.data)||void 0===c?void 0:c._links["fx:billing_addresses"].href),d(null===(u=this.data)||void 0===u?void 0:u._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},d(null===(f=this.data)||void 0===f?void 0:f._links["fx:custom_fields"].href),d(null===(p=this.data)||void 0===p?void 0:p._links["fx:attributes"].href),d(y),d(v),this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},d(null===(h=null===(m=this.data)||void 0===m?void 0:m._links["fx:process_webhook"])||void 0===h?void 0:h.href),d(null===(_=this.data)||void 0===_?void 0:_._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-transaction",O);export{O as Transaction};
1
+ import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./foxy-address-form.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-4e8a5b95.js";import"./shared-7ce74b42.js";import"./shared-42bb9e8e.js";import"./shared-8521017c.js";import{b as t,I as e}from"./shared-d784b79a.js";import"./shared-0b1b1c14.js";import"./shared-4c90701b.js";import{_ as o,B as i}from"./shared-d1195c27.js";import{h as r,s}from"./shared-ba5c42c7.js";import{N as n}from"./shared-d1dfac4d.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{g as a}from"./shared-bab2ea2c.js";import{i as d}from"./shared-53e42a77.js";import{c as l}from"./shared-4e709717.js";import{R as c,a as u}from"./shared-f72d82a9.js";import"./shared-1c07cd7f.js";import"./shared-93774efe.js";import"./shared-5f43aa36.js";import"./shared-01bb183b.js";import"./shared-c52295d5.js";import"./shared-5212ef4f.js";import"./shared-eeb2bd18.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-c5cf889e.js";import"./shared-1482d5dd.js";import"./shared-c1ade7a9.js";import"./shared-6b76afc2.js";import"./shared-8676e5c0.js";import"./shared-5fd5805c.js";import"./shared-1a49f70b.js";import"./shared-2503aefc.js";import"./shared-89d09114.js";import"./shared-0053cf93.js";import"./shared-0b00883f.js";import"./shared-25893d83.js";import"./shared-641786b2.js";import"./shared-cf613436.js";import"./shared-901b41cf.js";import"./shared-f20eefdd.js";import"./shared-fea2714e.js";import"./shared-2e8361e1.js";import"./shared-cd652fd0.js";import"./shared-cf28d2c8.js";import"./shared-10b54c49.js";import"./shared-2879b67f.js";import"./shared-d2340faa.js";import"./shared-6a45a781.js";import"./shared-6d11190a.js";import"./shared-651c44fa.js";import"./shared-3aaf64e6.js";import"./shared-76dcc864.js";import"./shared-133fc37b.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-9d7ae4aa.js";import"./shared-2d11750b.js";import"./foxy-form-dialog.js";import"./shared-53e476fd.js";import"./shared-43e551f2.js";import"./shared-d279baa5.js";import"./shared-e0d1856d.js";import"./shared-4cf87721.js";import"./shared-528b3bdb.js";import"./shared-22dd6cbe.js";import"./shared-e622d8cf.js";import"./shared-60150977.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let f,p=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return o(o({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"idle"===t?this.theme:"";return r(f||(f=p` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button theme="${0} tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),e,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const e=new n.API(this),o=await e.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=o.ok?"idle":"fail",o.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let m,h,_,y,v=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends t{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return o(o({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var t,e,o,i;const n=this.nucleon,c=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t._links["fx:customer"].href,u=c?null===(e=null==n?void 0:n.getCustomerPageHref)||void 0===e?void 0:e.call(n,c):void 0;return r(m||(m=v` <foxy-i18n infer="" class="block text-l font-medium leading-xs mb-s" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),l({"block ring-inset rounded transition-colors bg-contrast-5":!0,"cursor-pointer hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),d(u),d(c),this.__renderCopyAction(s(h||(h=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",c?String(a(c)):""),this.__renderCopyAction(s(_||(_=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(i=null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.customer_email)&&void 0!==i?i:""))}__renderCopyAction(t,e,o,i){const s=this[o],n="fail"===s?"error":"done"===s?"end":"busy";return r(y||(y=v` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==s,(()=>"idle"===s&&this.__copy(i,o)),(t=>"idle"!==s&&t.stopPropagation()),(t=>"idle"!==s&&t.stopPropagation()),l({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==s}),t,e,l({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===s}),n)}async __copy(t,e){this[e]="busy";try{await navigator.clipboard.writeText(t),this[e]="done"}catch(t){this[e]="fail"}setTimeout((()=>this[e]="idle"),3e3)}});let x,b,g,j,w,$,k=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends t{renderControl(){var t,e,o,i,s,n,a,d,l,c;return r(x||(x=k` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} </div> `),(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(l=this.nucleon)||void 0===l?void 0:l.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"")}__renderSendEmailsAction(){var t,e;return r(b||(b=k` <foxy-internal-transaction-post-action-control infer="send-emails" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,e;return r(g||(g=k` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,e,o;return r(j||(j=k` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(o=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:void"])||void 0===o?void 0:o.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,e,o;return r(w||(w=k` <foxy-internal-transaction-post-action-control infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(o=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:refund"])||void 0===o?void 0:o.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderSubscriptionAction(){var t,e,o;const i=this.nucleon,s=null===(e=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t._links["fx:subscription"])||void 0===e?void 0:e.href,n=s?null===(o=null==i?void 0:i.getSubscriptionPageHref)||void 0===o?void 0:o.call(i,s):void 0;return r($||($=k` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),d(n))}});let S,P,A,C,H,L,E,I,R,B,q=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends t{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var t,e,o,i,s,n,a,l,c;const u=null===(t=this.nucleon)||void 0===t?void 0:t.data;if(!u)return r(S||(S=q``));const f=null!==(o=null===(e=null==u?void 0:u._embedded)||void 0===e?void 0:e["fx:applied_taxes"])&&void 0!==o?o:[],p=null!==(s=null===(i=u._embedded)||void 0===i?void 0:i["fx:shipments"])&&void 0!==s?s:[];return r(P||(P=q` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>&colon;</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>&colon; ${0} </span> </span> </p> `),d(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===p.length||0===u.total_shipping?r(A||(A=q` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>&colon;</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((t=>r(C||(C=q` <span>${0}&colon;</span> <span>${0}</span> `),t.shipping_service_description,this.__renderPrice(t.total_shipping,!0)))),0===f.length||0===u.total_tax?r(H||(H=q` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>&colon;</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((t=>r(L||(L=q` <span>${0}&colon;</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),null===(a=null===(n=null==u?void 0:u._embedded)||void 0===n?void 0:n["fx:applied_gift_card_codes"])||void 0===a?void 0:a.map((t=>{var e;return r(E||(E=q` <span>${0}&colon;</span> <span>${0}</span> `),t._embedded["fx:gift_card"].name,this.__renderPrice(null!==(e=t.balance_adjustment)&&void 0!==e?e:0,!0))})),null===(c=null===(l=null==u?void 0:u._embedded)||void 0===l?void 0:l["fx:discounts"])||void 0===c?void 0:c.map((t=>r(I||(I=q` <span data-testclass="discount">${0}&colon;</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}get __storeHref(){var t,e,o;return null===(o=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:store"])||void 0===o?void 0:o.href}get __store(){var t,e;const o=`#${this.__storeLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(o))||void 0===t?void 0:t.data)&&void 0!==e?e:null}__renderPrice(t,e=!1){var o,i,s;const n=(null===(o=this.__store)||void 0===o?void 0:o.use_international_currency_symbol)?"code":"symbol",a=null===(s=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===s?void 0:s.currency_code;return r(R||(R=q` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),e&&0!==t?t>0?"text-success":"text-error":"",{currencyDisplay:n,signDisplay:e?"exceptZero":"auto",amount:`${t} ${a}`})}__renderStatus(){var t,e;const o=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e.status)||"completed";let i="";return i=["capturing","captured","approved","authorized","pending"].includes(o)?"text-success bg-success-10":o&&"completed"!==o?["problem","pending_fraud_review","rejected","declined"].includes(o)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",r(B||(B=q` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),i,o)}});let G,T,U,Z=t=>t;const M=c(u(e,"transaction"));class O extends M{constructor(){var t;super(...arguments),t=this,this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.localeCodes=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null,this.__webhooksBulkActions=[{name:"refeed",onClick:async function(e){if(!t.data)return;const o=t.data._links["fx:send_webhooks"].href,i=new O.API(t),r=await i.fetch(o,{method:"POST",body:JSON.stringify({refeed_hooks:e.map((t=>a(t._links.self.href))),event:"refeed"})});if(e.forEach((t=>{O.Rumour("").share({related:[...e.map((t=>t._links["fx:logs"].href)),...e.map((t=>t._links["fx:statuses"].href))],source:t._links.self.href,data:t})})),!r.ok)throw new Error(await r.text())}}]}static get properties(){return o(o({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},localeCodes:{attribute:"locale-codes"}})}get readonlySelector(){var t,e,o;const r=["billing-addresses","datafeed","webhooks:dialog:url",super.readonlySelector];return Boolean(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==e?e:null===(o=this.data)||void 0===o?void 0:o._links["fx:refund"])||r.push("items","attributes","custom-fields"),new i(r.join(" ").trim())}get hiddenSelector(){var t,e,o,r;const s=["billing-addresses:dialog:delete","billing-addresses:dialog:timestamps","webhooks:dialog:header:copy-json","webhooks:dialog:header:copy-id","webhooks:dialog:timestamps","webhooks:dialog:name","webhooks:dialog:query","webhooks:dialog:encryption-key","webhooks:dialog:delete",super.readonlySelector],n=null===(t=this.data)||void 0===t?void 0:t.type;return(null===(e=this.data)||void 0===e?void 0:e._links["fx:subscription"])||s.unshift("subscription"),"subscription_modification"===n&&s.unshift("actions"),"updateinfo"===n&&s.unshift("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===n&&s.unshift("not=customer,subscription,custom-fields,attributes"),(null===(r=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===r?void 0:r.use_webhook)||s.unshift("datafeed"),new i(s.join(" ").trim())}get headerSubtitleOptions(){var t,e,o,i,r;const s=null===(t=this.data)||void 0===t?void 0:t.source,n=null===(e=this.data)||void 0===e?void 0:e.type;let a="";return"updateinfo"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===s?"admin_changed_payment_method_with_uoe":"mit_api"===s?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===s?"admin_changed_subscription_with_uoe":"mit_api"===s?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===n?"mit_recurring"===s?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===s?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===s&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===n?"cit_recurring_cancellation"===s?a="customer_canceled_subscription":"mit_recurring_cancellation"===s&&(a="admin_canceled_subscription"):(null===(o=this.data)||void 0===o?void 0:o._links["fx:subscription"])?(null==s?void 0:s.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===s?a="admin_subscribed_with_uoe":"mit_api"===s&&(a="integration_subscribed"):(null==s?void 0:s.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===s?a="admin_placed_order_with_uoe":"mit_api"===s&&(a="integration_placed_order"),{transaction_date:null===(i=this.data)||void 0===i?void 0:i.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerCopyIdValue(){var t,e,o;return null!==(o=null===(e=null===(t=this.data)||void 0===t?void 0:t.display_id)||void 0===e?void 0:e.toString())&&void 0!==o?o:""}renderHeaderActions(){return r(G||(G=Z` <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> `))}renderBody(){var t,e,o,i,s,n,a,l,c,u,f,p,m,h,_,y;let v,x,b;const g=this.hiddenSelector;if(this.data)try{const i=new URL(this.data._links["fx:shipments"].href),r=new URL(null!==(o=null===(e=null===(t=this.__storeLoader)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:webhooks"].href)&&void 0!==o?o:""),s=new URL(this.data._links["fx:items"].href);i.searchParams.set("zoom","items:item_category"),r.searchParams.set("event_resource","transaction"),s.searchParams.set("zoom","item_options"),v=i.toString(),x=r.toString(),b=s.toString()}catch(t){}return r(T||(T=Z` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert wide .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="webhooks" first="${0}" item="foxy-webhook-card" form="foxy-webhook-form" hide-create-button hide-delete-button alert .bulkActions="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="datafeed"> <foxy-internal-switch-control infer="data-is-fed"></foxy-internal-switch-control> <foxy-internal-transaction-post-action-control infer="process-webhook" href="${0}"> </foxy-internal-transaction-post-action-control> </foxy-internal-summary-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(s=null===(i=this.data)||void 0===i?void 0:i.status)&&void 0!==s?s:"")?r(U||(U=Z` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(n=this.data)||void 0===n?void 0:n.status):"",g.matches("items",!0)&&g.matches("summary",!0),d(b),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(l=null===(a=this.__storeLoader)||void 0===a?void 0:a.data)||void 0===l?void 0:l._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href},d(null===(u=this.data)||void 0===u?void 0:u._links["fx:billing_addresses"].href),d(null===(f=this.data)||void 0===f?void 0:f._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},d(null===(p=this.data)||void 0===p?void 0:p._links["fx:custom_fields"].href),d(null===(m=this.data)||void 0===m?void 0:m._links["fx:attributes"].href),d(v),d(x),this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},d(null===(_=null===(h=this.data)||void 0===h?void 0:h._links["fx:process_webhook"])||void 0===_?void 0:_.href),d(null===(y=this.data)||void 0===y?void 0:y._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-transaction",O);export{O as Transaction};
@@ -1 +1 @@
1
- import"./shared-2d11750b.js";import{b as e,I as t}from"./shared-d784b79a.js";import"./foxy-template-set-card.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./foxy-payment-card-embed.js";import"./shared-4e8a5b95.js";import"./shared-0b1b1c14.js";import{_ as r,B as s}from"./shared-d1195c27.js";import{i as o}from"./shared-53e42a77.js";import{h as a}from"./shared-ba5c42c7.js";import{g as i}from"./shared-bab2ea2c.js";import{a as d}from"./shared-f72d82a9.js";import"./shared-7ce74b42.js";import"./shared-1482d5dd.js";import"./shared-c52295d5.js";import"./shared-01bb183b.js";import"./shared-c1ade7a9.js";import"./shared-0b00883f.js";import"./shared-2879b67f.js";import"./shared-d2340faa.js";import"./shared-6a45a781.js";import"./foxy-collection-page.js";import"./shared-eeb2bd18.js";import"./shared-343d1fd7.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-17a61265.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./shared-5f43aa36.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-4c90701b.js";import"./shared-1a49f70b.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./foxy-copy-to-clipboard.js";import"./shared-2503aefc.js";import"./shared-89d09114.js";import"./shared-5212ef4f.js";import"./shared-25893d83.js";import"./shared-93774efe.js";import"./shared-cd652fd0.js";import"./shared-fea2714e.js";import"./shared-6d11190a.js";import"./shared-6b76afc2.js";import"./shared-cc76a917.js";import"./shared-0e156ee7.js";import"./shared-c2efc54e.js";let n,m=e=>e;customElements.define("foxy-internal-update-payment-method-form-cc-token-control",class extends e{constructor(){super(...arguments),this.embedUrl=null}static get properties(){return r(r({},super.properties),{},{embedUrl:{attribute:"embed-url"}})}renderControl(){return a(n||(n=m` <foxy-payment-card-embed infer="payment-card-embed" url="${0}" @submit="${0}"> </foxy-payment-card-embed> <vaadin-button theme="primary" class="w-full mt-l" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="tokenize"></foxy-i18n> </vaadin-button> `),o(this.embedUrl),this.__tokenize,this.disabled,(()=>this.__tokenize()))}async __tokenize(){var e,t,r;const s=this.renderRoot.querySelector("[infer=payment-card-embed]");try{null===(e=this.nucleon)||void 0===e||e.edit({cc_token:await s.tokenize()}),null===(t=this.nucleon)||void 0===t||t.submit()}catch(e){null===(r=this.nucleon)||void 0===r||r.undo()}}});let l,p,c=e=>e;const h=d(t,"update-payment-method-form");class f extends h{constructor(){super(...arguments),this.embedUrl=null,this.__templateSetGetValue=()=>this.__templateSetOverride,this.__templateSetSetValue=e=>this.__templateSetOverride=e,this.__templateSetOverride=null}static get properties(){return r(r({},super.properties),{},{__templateSetOverride:{attribute:!1},embedUrl:{attribute:"embed-url"}})}get hiddenSelector(){var e;const t=null===(e=this.__formEmbedUrl)||void 0===e?void 0:e.searchParams,r=["header:copy-id","header:copy-json",super.hiddenSelector.toString()],o=null==t?void 0:t.has("demo");return(this.__isPreConfigured||o)&&r.unshift("template-set"),(null==t?void 0:t.has("template_set_id"))||o||r.unshift("cc-token"),new s(r.join(" ").trim())}renderBody(){var e;if(!this.href)return a(l||(l=c` <div class="flex items-center justify-center p-xl"> <foxy-spinner layout="vertical" infer="spinner" state="empty"></foxy-spinner> </div> `));const t=this.__formEmbedUrl,r=this.renderRoot.querySelector("#store-loader");return a(p||(p=c` ${0} <foxy-internal-resource-picker-control first="${0}" infer="template-set" item="foxy-template-set-card" .getValue="${0}" .setValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-update-payment-method-form-cc-token-control embed-url="${0}" infer="cc-token"> </foxy-internal-update-payment-method-form-cc-token-control> <foxy-nucleon infer="" class="hidden" href="${0}" id="store-loader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),o(null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:template_sets"].href),this.__templateSetGetValue,this.__templateSetSetValue,o(null==t?void 0:t.toString()),o(this.__storeLoaderHref),(()=>this.requestUpdate()))}updated(e){super.updated(e),(e.has("embedUrl")||e.has("href"))&&(this.__templateSetOverride=null)}async _fetch(...e){try{const t=await super._fetch(...e);return"PATCH"===new f.API.WHATWGRequest(...e).method&&(this.status={key:"cc_token_success"}),t}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw t.includes("cc_token you provided is invalid")?["error:cc_token_invalid"]:e}}get __storeLoaderHref(){const e=this.data;return e&&"fx:store"in e._links?e._links["fx:store"].href:void 0}get __isPreConfigured(){var e;try{return new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"").searchParams.has("template_set_id")}catch(e){return!1}}get __formEmbedUrl(){var e;try{const t=new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"");if(this.__templateSetOverride){const e=i(this.__templateSetOverride);null!==e&&t.searchParams.set("template_set_id",String(e))}return t}catch(e){}}}customElements.define("foxy-update-payment-method-form",f);export{f as UpdatePaymentMethodForm};
1
+ import"./shared-2d11750b.js";import{b as e,I as t}from"./shared-d784b79a.js";import"./foxy-template-set-card.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./foxy-payment-card-embed.js";import"./shared-4e8a5b95.js";import"./shared-0b1b1c14.js";import{_ as r,B as s}from"./shared-d1195c27.js";import{i as o}from"./shared-53e42a77.js";import{h as a}from"./shared-ba5c42c7.js";import{g as i}from"./shared-bab2ea2c.js";import{a as d}from"./shared-f72d82a9.js";import"./shared-7ce74b42.js";import"./shared-1482d5dd.js";import"./shared-c52295d5.js";import"./shared-01bb183b.js";import"./shared-c1ade7a9.js";import"./shared-0b00883f.js";import"./shared-2879b67f.js";import"./shared-d2340faa.js";import"./shared-6a45a781.js";import"./foxy-collection-page.js";import"./shared-eeb2bd18.js";import"./shared-343d1fd7.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-17a61265.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./shared-5f43aa36.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-4c90701b.js";import"./shared-1a49f70b.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./foxy-copy-to-clipboard.js";import"./shared-2503aefc.js";import"./shared-89d09114.js";import"./shared-5212ef4f.js";import"./shared-25893d83.js";import"./shared-93774efe.js";import"./shared-cd652fd0.js";import"./shared-fea2714e.js";import"./shared-6d11190a.js";import"./shared-6b76afc2.js";import"./shared-cc76a917.js";import"./shared-9ca85d1e.js";import"./shared-c2efc54e.js";let n,m=e=>e;customElements.define("foxy-internal-update-payment-method-form-cc-token-control",class extends e{constructor(){super(...arguments),this.embedUrl=null}static get properties(){return r(r({},super.properties),{},{embedUrl:{attribute:"embed-url"}})}renderControl(){return a(n||(n=m` <foxy-payment-card-embed infer="payment-card-embed" url="${0}" @submit="${0}"> </foxy-payment-card-embed> <vaadin-button theme="primary" class="w-full mt-l" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="tokenize"></foxy-i18n> </vaadin-button> `),o(this.embedUrl),this.__tokenize,this.disabled,(()=>this.__tokenize()))}async __tokenize(){var e,t,r;const s=this.renderRoot.querySelector("[infer=payment-card-embed]");try{null===(e=this.nucleon)||void 0===e||e.edit({cc_token:await s.tokenize()}),null===(t=this.nucleon)||void 0===t||t.submit()}catch(e){null===(r=this.nucleon)||void 0===r||r.undo()}}});let l,p,c=e=>e;const h=d(t,"update-payment-method-form");class f extends h{constructor(){super(...arguments),this.embedUrl=null,this.__templateSetGetValue=()=>this.__templateSetOverride,this.__templateSetSetValue=e=>this.__templateSetOverride=e,this.__templateSetOverride=null}static get properties(){return r(r({},super.properties),{},{__templateSetOverride:{attribute:!1},embedUrl:{attribute:"embed-url"}})}get hiddenSelector(){var e;const t=null===(e=this.__formEmbedUrl)||void 0===e?void 0:e.searchParams,r=["header:copy-id","header:copy-json",super.hiddenSelector.toString()],o=null==t?void 0:t.has("demo");return(this.__isPreConfigured||o)&&r.unshift("template-set"),(null==t?void 0:t.has("template_set_id"))||o||r.unshift("cc-token"),new s(r.join(" ").trim())}renderBody(){var e;if(!this.href)return a(l||(l=c` <div class="flex items-center justify-center p-xl"> <foxy-spinner layout="vertical" infer="spinner" state="empty"></foxy-spinner> </div> `));const t=this.__formEmbedUrl,r=this.renderRoot.querySelector("#store-loader");return a(p||(p=c` ${0} <foxy-internal-resource-picker-control first="${0}" infer="template-set" item="foxy-template-set-card" .getValue="${0}" .setValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-update-payment-method-form-cc-token-control embed-url="${0}" infer="cc-token"> </foxy-internal-update-payment-method-form-cc-token-control> <foxy-nucleon infer="" class="hidden" href="${0}" id="store-loader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),o(null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:template_sets"].href),this.__templateSetGetValue,this.__templateSetSetValue,o(null==t?void 0:t.toString()),o(this.__storeLoaderHref),(()=>this.requestUpdate()))}updated(e){super.updated(e),(e.has("embedUrl")||e.has("href"))&&(this.__templateSetOverride=null)}async _fetch(...e){try{const t=await super._fetch(...e);return"PATCH"===new f.API.WHATWGRequest(...e).method&&(this.status={key:"cc_token_success"}),t}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw t.includes("cc_token you provided is invalid")?["error:cc_token_invalid"]:e}}get __storeLoaderHref(){const e=this.data;return e&&"fx:store"in e._links?e._links["fx:store"].href:void 0}get __isPreConfigured(){var e;try{return new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"").searchParams.has("template_set_id")}catch(e){return!1}}get __formEmbedUrl(){var e;try{const t=new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"");if(this.__templateSetOverride){const e=i(this.__templateSetOverride);null!==e&&t.searchParams.set("template_set_id",String(e))}return t}catch(e){}}}customElements.define("foxy-update-payment-method-form",f);export{f as UpdatePaymentMethodForm};
@@ -0,0 +1 @@
1
+ import"./shared-a6b2bd14.js";import"./shared-c5cf889e.js";import"./shared-901b41cf.js";import"./shared-133fc37b.js";import{b as e,I as t}from"./shared-d784b79a.js";import"./shared-4e8a5b95.js";import{i as s}from"./shared-53e42a77.js";import{h as o}from"./shared-ba5c42c7.js";import{c as r,_ as n,B as i}from"./shared-d1195c27.js";import{S as a,a as l}from"./shared-f72d82a9.js";import{v as d}from"./shared-b738ee96.js";import{c}from"./shared-4e709717.js";let h,p=e=>e;customElements.define("foxy-internal-customer-form-legal-notice-control",class extends e{renderControl(){var e,t;const r=this.nucleon;return o(h||(h=p` <p class="leading-s text-xs text-secondary"> <foxy-i18n infer="" key="text"></foxy-i18n> <a class="font-medium text-body rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" target="_blank" href="${0}" rel="noopener noreferrer"> <foxy-i18n infer="" key="link"></foxy-i18n> </a> </p> `),s(null===(t=null===(e=null==r?void 0:r.settings)||void 0===e?void 0:e.tos_checkbox_settings)||void 0===t?void 0:t.url))}});var u=r((function(e){!function(){const t=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}],s=(e,s=t,o="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let r=e||"";s[0].minDiversity=0,s[0].minLength=0;const n=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];o&&n.push({regex:`[${o}]`,message:"symbol"});let i={};i.contains=n.filter((e=>new RegExp(`${e.regex}`).test(r))).map((e=>e.message)),i.length=r.length;let a=s.filter((e=>i.contains.length>=e.minDiversity)).filter((e=>i.length>=e.minLength)).sort(((e,t)=>t.id-e.id)).map((e=>({id:e.id,value:e.value})));return Object.assign(i,a[0]),i};e.exports={passwordStrength:s,defaultOptions:t}}()}));let m,f,_=e=>e;const g=a(l(t,"customer-form")),x=u.passwordStrength;class v extends g{constructor(){super(...arguments),this.passwordless=!1,this.settings=null,this.__passwordGeneratorOptions={checkStrength:e=>x(e).id>=2},this.__isAnonymousGetValue=()=>{var e;return!1===(null===(e=this.form)||void 0===e?void 0:e.is_anonymous)?"false":"true"},this.__isAnonymousSetValue=e=>{const t="true"===e;this.edit({is_anonymous:t}),t&&this.form.password&&this.edit({password:""}),t&&this.form.password_old&&this.edit({password_old:""}),t&&this.form.forgot_password&&this.edit({forgot_password:""})},this.__isAnonymousOptions=[{value:"true",label:"option_true"},{value:"false",label:"option_false"}],this.__refreshInterval=null}static get scopedElements(){return{"foxy-internal-customer-form-legal-notice-control":customElements.get("foxy-internal-customer-form-legal-notice-control"),"foxy-internal-radio-group-control":customElements.get("foxy-internal-radio-group-control"),"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-password-control":customElements.get("foxy-internal-password-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-spinner":customElements.get("foxy-spinner"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"h-captcha":customElements.get("h-captcha"),"vaadin-button":customElements.get("vaadin-button")}}static get properties(){return n(n({},super.properties),{},{passwordless:{type:Boolean},settings:{type:Object}})}static get v8n(){return[({password:e,_links:t,is_anonymous:s=!0},o)=>!!o.passwordless||(!!(t||s||e)||"password:v8n_required"),({password_old:e,password:t,_links:s},o)=>{var r;return!s||(void 0===(null===(r=o.settings)||void 0===r?void 0:r.sign_up)||(!(t&&!e)||"password-old:v8n_required"))},({first_name:e})=>!e||e.length<=50||"first-name:v8n_too_long",({last_name:e})=>!e||e.length<=50||"last-name:v8n_too_long",({password:e})=>!e||x(e).id>=2||"password:v8n_too_weak",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({tax_id:e})=>!e||e.length<=50||"tax-id:v8n_too_long",({email:e})=>e&&e.length>0||"email:v8n_required",({email:e})=>!e||e.length<=100||"email:v8n_too_long",({email:e})=>!e||d(e)||"email:v8n_invalid_email"]}get hiddenSelector(){const e=new Set(super.hiddenSelector.toString().split(" "));return this.settings?(e.add("forgot-password"),e.add("is-anonymous"),this.form.password||e.add("password-old"),"none"===this.settings.tos_checkbox_settings.usage&&e.add("legal-notice")):(!1!==this.form.is_anonymous&&(e.add("forgot-password"),e.add("password")),e.add("password-old"),e.add("legal-notice")),this.href&&(e.add("is-anonymous"),e.add("legal-notice")),new i(Array.from(e).join(" ").trim())}get headerTitleOptions(){var e,t;const s=this.data;return!s||(null===(e=s.first_name)||void 0===e?void 0:e.trim())||(null===(t=s.last_name)||void 0===t?void 0:t.trim())?super.headerTitleOptions:n(n({},super.headerTitleOptions),{},{context:"no_name"})}get headerSubtitleKey(){var e;return(null===(e=this.data)||void 0===e?void 0:e.is_anonymous)?"subtitle_anonymous":"subtitle_registered"}get headerSubtitleOptions(){return n(n({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}disconnectedCallback(){super.disconnectedCallback();const e=this.__refreshInterval;e&&clearInterval(e)}connectedCallback(){super.connectedCallback();const e=setInterval((()=>this.requestUpdate()),6e4);this.__refreshInterval=e}renderBody(){var e,t,s,r;const n=this.hiddenSelector.matches("first-name",!0),i=this.hiddenSelector.matches("last-name",!0);return o(m||(m=_` ${0} <div class="${0}"> <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> </div> <foxy-internal-text-control helper-text="${0}" infer="email"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="is-anonymous" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-password-control placeholder="${0}" helper-text="${0}" infer="password" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="password-old"></foxy-internal-password-control> <foxy-internal-password-control helper-text="${0}" infer="forgot-password" show-generator> </foxy-internal-password-control> <foxy-internal-text-control infer="tax-id"></foxy-internal-text-control> <foxy-internal-customer-form-legal-notice-control infer="legal-notice"> </foxy-internal-customer-form-legal-notice-control> ${0} ${0} `),this.renderHeader(),c({"grid-cols-2":!n&&!i,hidden:n&&i,"gap-m":!0,grid:!n||!i}),this.__emailHelperText,this.__isAnonymousGetValue,this.__isAnonymousSetValue,this.__isAnonymousOptions,this.__passwordPlaceholder,this.__passwordHelperText,this.__passwordGeneratorOptions,this.__forgotPasswordHelperText,!this.data&&(null===(t=null===(e=this.settings)||void 0===e?void 0:e.sign_up)||void 0===t?void 0:t.enabled)&&"hcaptcha"===(null===(r=null===(s=this.settings)||void 0===s?void 0:s.sign_up)||void 0===r?void 0:r.verification.type)?o(f||(f=_` <h-captcha site-key="${0}" class="hidden" size="invisible" hl="${0}" @verified="${0}"> </h-captcha> `),this.settings.sign_up.verification.site_key,this.lang,(({token:e})=>{this.edit({verification:{type:"hcaptcha",token:e}}),super.submit()})):"",super.renderBody())}submit(){var e,t,s,o,r;"hcaptcha"!==(null===(s=null===(t=null===(e=this.settings)||void 0===e?void 0:e.sign_up)||void 0===t?void 0:t.verification)||void 0===s?void 0:s.type)||this.data?super.submit():(null===(o=this.__hcaptcha)||void 0===o||o.reset(),null===(r=this.__hcaptcha)||void 0===r||r.execute())}async _sendPatch(e){const t=await super._sendPatch(e);if(e.password){const e={key:"password_change_success",options:{email:t.email}};this.status=e}return t}async _sendGet(){return this.status=null,await super._sendGet()}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw"Conflict"===t||t.startsWith("This email address is already in use")?["error:email_already_used"]:t.startsWith("Customer registration is disabled")?["error:registration_disabled"]:t.startsWith("Client verification failed")?["error:verification_failed"]:t.startsWith("Provided password is incorrect")?["error:old_password_incorrect"]:e}}get __forgotPasswordHelperText(){var e,t;const s=null===(e=this.data)||void 0===e?void 0:e.forgot_password_timestamp,o="forgot-password.helper_text";if((null===(t=this.data)||void 0===t?void 0:t.forgot_password)&&s){const e=new Date(new Date(s).getTime()+18e5),t=Math.floor((e.getTime()-Date.now())/1e3/60);return t<=0?this.t(`${o}_expired_on`,{expiresOn:e}):this.t(`${o}_expires_in`,{expiresInMin:`${t}minutes`})}return this.t(o)}get __passwordPlaceholder(){return this.data?this.t("password.placeholder_new"):this.t("password.placeholder")}get __passwordHelperText(){return this.data?this.t("password.helper_text_new"):this.t("password.helper_text")}get __emailHelperText(){var e;return(null===(e=this.data)||void 0===e?void 0:e.last_login_date)?this.t("email.helper_text_last_login_date",{date:this.data.last_login_date}):this.t("email.helper_text")}get __hcaptcha(){return this.renderRoot.querySelector("h-captcha")}}customElements.define("foxy-customer-form",v);export{v as C,u};
@@ -1 +1 @@
1
- import{c as e,aI as t,_ as n}from"./shared-d1195c27.js";import{h as r,L as s}from"./shared-ba5c42c7.js";import{A as o}from"./shared-0e156ee7.js";import"./shared-c2efc54e.js";import{C as i}from"./shared-eeb2bd18.js";import{F as a}from"./shared-343d1fd7.js";import{I as u}from"./shared-17a61265.js";var l=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatCookie=void 0;var n=function(e){var t=e.path,n=e.domain,r=e.expires,s=e.secure,o=function(e){var t=e.sameSite;return void 0===t?null:["none","lax","strict"].indexOf(t.toLowerCase())>=0?t:null}(e);return[null==t?"":";path="+t,null==n?"":";domain="+n,null==r?"":";expires="+r.toUTCString(),void 0===s||!1===s?"":";secure",null===o?"":";SameSite="+o].join("")};t.formatCookie=function(e,t,r){return[encodeURIComponent(e),"=",encodeURIComponent(t),n(r)].join("")}})),c=e((function(e,t){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,s=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){s=!0,o=e}finally{try{r||null==a.return||a.return()}finally{if(s)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.parseCookies=void 0;t.parseCookies=function(e){if(0===e.length)return{};var t={},r=new RegExp("\\s*;\\s*");return e.split(r).forEach((function(e){var r=n(e.split("="),2),s=r[0],o=r[1],i=decodeURIComponent(s),a=decodeURIComponent(o);t[i]=a})),t}})),h=e((function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0}),t.CookieStorage=void 0;var r=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaultOptions=Object.assign({domain:null,expires:null,path:null,secure:!1},t),"undefined"!=typeof Proxy)return new Proxy(this,s)}var t,r,o;return t=e,(r=[{key:"clear",value:function(){var e=this,t=c.parseCookies(this._getCookie());Object.keys(t).forEach((function(t){return e.removeItem(t)}))}},{key:"getItem",value:function(e){var t=c.parseCookies(this._getCookie());return Object.prototype.hasOwnProperty.call(t,e)?t[e]:null}},{key:"key",value:function(e){var t=c.parseCookies(this._getCookie()),n=Object.keys(t).sort();return e<n.length?n[e]:null}},{key:"removeItem",value:function(e,t){var n=Object.assign(Object.assign(Object.assign({},this._defaultOptions),t),{expires:new Date(0)}),r=l.formatCookie(e,"",n);this._setCookie(r)}},{key:"setItem",value:function(e,t,n){var r=Object.assign(Object.assign({},this._defaultOptions),n),s=l.formatCookie(e,t,r);this._setCookie(s)}},{key:"_getCookie",value:function(){return"undefined"==typeof document||void 0===document.cookie?"":document.cookie}},{key:"_setCookie",value:function(e){document.cookie=e}},{key:"length",get:function(){var e=c.parseCookies(this._getCookie());return Object.keys(e).length}}])&&n(t.prototype,r),o&&n(t,o),e}();t.CookieStorage=r;var s={defineProperty:function(e,t,n){return e.setItem(t.toString(),String(n.value)),!0},deleteProperty:function(e,t){return e.removeItem(t.toString()),!0},get:function(e,t,n){if("string"==typeof t&&t in e)return e[t];var r=e.getItem(t.toString());return null!==r?r:void 0},getOwnPropertyDescriptor:function(e,t){if(!(t in e))return{configurable:!0,enumerable:!0,value:e.getItem(t.toString()),writable:!0}},has:function(e,t){return"string"==typeof t&&t in e||null!==e.getItem(t.toString())},ownKeys:function(e){for(var t=[],n=0;n<e.length;n++){var r=e.key(n);null!==r&&t.push(r)}return t},preventExtensions:function(e){throw new TypeError("can't prevent extensions on this proxy object")},set:function(e,t,n,r){return e.setItem(t.toString(),String(n)),!0}}})),p=t(e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CookieStorage",{enumerable:!0,get:function(){return h.CookieStorage}}),Object.defineProperty(t,"formatCookie",{enumerable:!0,get:function(){return l.formatCookie}}),Object.defineProperty(t,"parseCookies",{enumerable:!0,get:function(){return c.parseCookies}})})));class f extends p.CookieStorage{constructor(){super({sameSite:"Strict",expires:new Date,secure:!0,domain:location.hostname,path:"/"})}getItem(e){if(e===o.SESSION){const e=super.getItem("fx.customer"),t=super.getItem("fx.customer.duration"),n=super.getItem("fx.customer.start"),r=super.getItem("fx.customer.jwt");if(null===e||null===t||null===n||null===r)return null;const s={session_token:e,date_created:n,expires_in:parseInt(t),jwt:r},o=super.getItem("fx.customer.sso");return null!==o&&(s.sso=o),JSON.stringify(s)}return super.getItem(e)}setItem(e,t,n){if(e!==o.SESSION)return super.setItem(e,t,n);{const e=JSON.parse(t),n=1e3*e.expires_in,r=new Date(new Date(e.date_created).getTime()+n);super.setItem("fx.customer",e.session_token,{expires:r}),super.setItem("fx.customer.jwt",e.jwt,{expires:r}),super.setItem("fx.customer.start",e.date_created,{expires:r}),super.setItem("fx.customer.duration",String(e.expires_in),{expires:r}),e.sso&&super.setItem("fx.customer.sso",e.sso,{expires:r})}}clear(){for(let e=0;e<this.length;){const t=super.key(e);t.startsWith("fx.customer")?super.removeItem(t):e++}}}const d=new f;let g,m=e=>e;class _ extends(i(u(s))){constructor(){var e;super(...arguments),e=this,this.__storage="local",this.__level=0,this.__base=location.origin,this.__api=this.__createAPIInstance(),this.__handleFetch=async function(t){if(!(t instanceof a))return;if(t.defaultPrevented)return;if(t.composedPath()[0]===e)return;t.preventDefault();const n=new a("fetch",{cancelable:!0,composed:!0,request:t.request,bubbles:!0,reject:e=>t.respondWith(Promise.reject(e)),resolve:r=>{"foxy://customer-api/session"===n.request.url&&e.requestUpdate(),401===r.status&&e.requestUpdate(),t.respondWith(Promise.resolve(r))}});e.dispatchEvent(n)&&n.respondWith(e.__handleRequest(n.request))}}static get properties(){return n(n({},super.properties),{},{storage:{type:String,noAccessor:!0},level:{type:Number,noAccessor:!0},base:{type:String,noAccessor:!0}})}get isLoggedIn(){return!!this.api.storage.getItem(o.SESSION)}get api(){return this.__api}get base(){return this.__base}set base(e){this.__base=e,this.__api=this.__createAPIInstance()}get level(){return this.__level}set level(e){this.__level=e,this.__api=this.__createAPIInstance()}get storage(){return this.__storage}set storage(e){this.__storage=e,this.__api=this.__createAPIInstance()}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__handleFetch)}render(){return r(g||(g=m` ${0} <slot></slot> `),this.renderTemplateOrSlot(this.isLoggedIn?"logged-in":"logged-out"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("fetch",this.__handleFetch)}__createAPIInstance(){const e={session:sessionStorage,cookie:d,local:localStorage};return new o({storage:e[this.storage],level:this.level,base:new URL(this.base)})}async __handleVirtualAuthSessionDelete(){return await this.api.signOut(),this.dispatchEvent(new _.SignOutEvent("signout")),this.requestUpdate(),new Response}async __handleVirtualAuthSessionPost(e){const t=await e.clone().json();if("password"!==t.type)throw new Error(`Unknown payload type ${t.type}`);let r,s;try{await this.api.signIn(t.credential),this.dispatchEvent(new _.SignInEvent("signin")),this.requestUpdate(),r=200,s=n({_links:{self:{href:e.url}}},t)}catch(e){if(!(e instanceof o.AuthError))throw e;if("UNAUTHORIZED"!==e.code)throw e;r=401,s={total:1,_embedded:{"fx:errors":[{message:e.message,logref:"unavailable",code:"invalid_credential_error"}]}}}return new Response(JSON.stringify(s),{status:r})}async __handleVirtualAuthSessionAny(e){return new Response(JSON.stringify({_links:{self:{href:e.url}},message:"POST to this endpoint to sign in"}))}async __handleVirtualAuthRecoverPost(e){const t=await e.clone().json();if("email"===t.type)return await this.api.sendPasswordResetEmail(t.detail),new Response(JSON.stringify({_links:{self:{href:e.url}},email:t.email}));throw new Error(`Unknown payload type ${t.type}`)}async __handleVirtualAuthRecoverAny(e){return new Response(JSON.stringify({_links:{self:{href:e.url}},message:"POST to this endpoint to request a password reset"}))}async __handleVirtualAuthSignUpPost(e){const t=await e.clone().json();try{await this.api.signUp(t)}catch(e){if(!(e instanceof o.AuthError))throw e;let t,n;if("UNAUTHORIZED"===e.code)t="Customer registration is disabled for this store.",n=401;else if("UNAVAILABLE"===e.code)t="This email address is already in use by an existing customer of this store.",n=403;else{if("INVALID_FORM"!==e.code)throw e;t="Client verification failed.",n=400}const r=JSON.stringify({total:1,_embedded:{"fx:errors":[{message:t}]}});return new Response(r,{status:n})}return t.password&&await this.api.signIn(t),this.requestUpdate(),this.dispatchEvent(new _.SignUpEvent("signup")),new Response(JSON.stringify({_links:{self:{href:e.url}},message:"Account created"}))}async __handleVirtualAuthSignUpAny(e){return new Response(JSON.stringify({_links:{self:{href:e.url}},message:"POST to this endpoint to create an account"}))}async __handleRequest(e){const t=e.url,n=e.method;try{if(t.startsWith("foxy://customer-api/session"))return"DELETE"===n?this.__handleVirtualAuthSessionDelete():"POST"===n?this.__handleVirtualAuthSessionPost(e):this.__handleVirtualAuthSessionAny(e);if(t.startsWith("foxy://customer-api/recover"))return"POST"===n?this.__handleVirtualAuthRecoverPost(e):this.__handleVirtualAuthRecoverAny(e);if(t.startsWith("foxy://customer-api/signup"))return"POST"===n?this.__handleVirtualAuthSignUpPost(e):this.__handleVirtualAuthSignUpAny(e);const r=await this.api.fetch(e);return 401===r.status&&(this.api.storage.clear(),this.dispatchEvent(new _.SignOutEvent("signout")),this.requestUpdate()),r}catch(e){return new Response(null,{status:500})}}}_.SignOutEvent=class extends CustomEvent{},_.SignInEvent=class extends CustomEvent{},_.SignUpEvent=class extends CustomEvent{};export{_ as C};
1
+ import{c as e,aI as t,_ as n}from"./shared-d1195c27.js";import{h as r,L as s}from"./shared-ba5c42c7.js";import{A as o}from"./shared-9ca85d1e.js";import"./shared-c2efc54e.js";import{C as i}from"./shared-eeb2bd18.js";import{F as a}from"./shared-343d1fd7.js";import{I as u}from"./shared-17a61265.js";var l=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatCookie=void 0;var n=function(e){var t=e.path,n=e.domain,r=e.expires,s=e.secure,o=function(e){var t=e.sameSite;return void 0===t?null:["none","lax","strict"].indexOf(t.toLowerCase())>=0?t:null}(e);return[null==t?"":";path="+t,null==n?"":";domain="+n,null==r?"":";expires="+r.toUTCString(),void 0===s||!1===s?"":";secure",null===o?"":";SameSite="+o].join("")};t.formatCookie=function(e,t,r){return[encodeURIComponent(e),"=",encodeURIComponent(t),n(r)].join("")}})),c=e((function(e,t){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,s=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){s=!0,o=e}finally{try{r||null==a.return||a.return()}finally{if(s)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.parseCookies=void 0;t.parseCookies=function(e){if(0===e.length)return{};var t={},r=new RegExp("\\s*;\\s*");return e.split(r).forEach((function(e){var r=n(e.split("="),2),s=r[0],o=r[1],i=decodeURIComponent(s),a=decodeURIComponent(o);t[i]=a})),t}})),h=e((function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0}),t.CookieStorage=void 0;var r=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaultOptions=Object.assign({domain:null,expires:null,path:null,secure:!1},t),"undefined"!=typeof Proxy)return new Proxy(this,s)}var t,r,o;return t=e,(r=[{key:"clear",value:function(){var e=this,t=c.parseCookies(this._getCookie());Object.keys(t).forEach((function(t){return e.removeItem(t)}))}},{key:"getItem",value:function(e){var t=c.parseCookies(this._getCookie());return Object.prototype.hasOwnProperty.call(t,e)?t[e]:null}},{key:"key",value:function(e){var t=c.parseCookies(this._getCookie()),n=Object.keys(t).sort();return e<n.length?n[e]:null}},{key:"removeItem",value:function(e,t){var n=Object.assign(Object.assign(Object.assign({},this._defaultOptions),t),{expires:new Date(0)}),r=l.formatCookie(e,"",n);this._setCookie(r)}},{key:"setItem",value:function(e,t,n){var r=Object.assign(Object.assign({},this._defaultOptions),n),s=l.formatCookie(e,t,r);this._setCookie(s)}},{key:"_getCookie",value:function(){return"undefined"==typeof document||void 0===document.cookie?"":document.cookie}},{key:"_setCookie",value:function(e){document.cookie=e}},{key:"length",get:function(){var e=c.parseCookies(this._getCookie());return Object.keys(e).length}}])&&n(t.prototype,r),o&&n(t,o),e}();t.CookieStorage=r;var s={defineProperty:function(e,t,n){return e.setItem(t.toString(),String(n.value)),!0},deleteProperty:function(e,t){return e.removeItem(t.toString()),!0},get:function(e,t,n){if("string"==typeof t&&t in e)return e[t];var r=e.getItem(t.toString());return null!==r?r:void 0},getOwnPropertyDescriptor:function(e,t){if(!(t in e))return{configurable:!0,enumerable:!0,value:e.getItem(t.toString()),writable:!0}},has:function(e,t){return"string"==typeof t&&t in e||null!==e.getItem(t.toString())},ownKeys:function(e){for(var t=[],n=0;n<e.length;n++){var r=e.key(n);null!==r&&t.push(r)}return t},preventExtensions:function(e){throw new TypeError("can't prevent extensions on this proxy object")},set:function(e,t,n,r){return e.setItem(t.toString(),String(n)),!0}}})),p=t(e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CookieStorage",{enumerable:!0,get:function(){return h.CookieStorage}}),Object.defineProperty(t,"formatCookie",{enumerable:!0,get:function(){return l.formatCookie}}),Object.defineProperty(t,"parseCookies",{enumerable:!0,get:function(){return c.parseCookies}})})));class f extends p.CookieStorage{constructor(){super({sameSite:"Strict",expires:new Date,secure:!0,domain:location.hostname,path:"/"})}getItem(e){if(e===o.SESSION){const e=super.getItem("fx.customer"),t=super.getItem("fx.customer.duration"),n=super.getItem("fx.customer.start"),r=super.getItem("fx.customer.jwt");if(null===e||null===t||null===n||null===r)return null;const s={session_token:e,date_created:n,expires_in:parseInt(t),jwt:r},o=super.getItem("fx.customer.sso");return null!==o&&(s.sso=o),JSON.stringify(s)}return super.getItem(e)}setItem(e,t,n){if(e!==o.SESSION)return super.setItem(e,t,n);{const e=JSON.parse(t),n=1e3*e.expires_in,r=new Date(new Date(e.date_created).getTime()+n);super.setItem("fx.customer",e.session_token,{expires:r}),super.setItem("fx.customer.jwt",e.jwt,{expires:r}),super.setItem("fx.customer.start",e.date_created,{expires:r}),super.setItem("fx.customer.duration",String(e.expires_in),{expires:r}),e.sso&&super.setItem("fx.customer.sso",e.sso,{expires:r})}}clear(){for(let e=0;e<this.length;){const t=super.key(e);t.startsWith("fx.customer")?super.removeItem(t):e++}}}const d=new f;let g,m=e=>e;class _ extends(i(u(s))){constructor(){var e;super(...arguments),e=this,this.__storage="local",this.__level=0,this.__base=location.origin,this.__api=this.__createAPIInstance(),this.__handleFetch=async function(t){if(!(t instanceof a))return;if(t.defaultPrevented)return;if(t.composedPath()[0]===e)return;t.preventDefault();const n=new a("fetch",{cancelable:!0,composed:!0,request:t.request,bubbles:!0,reject:e=>t.respondWith(Promise.reject(e)),resolve:r=>{"foxy://customer-api/session"===n.request.url&&e.requestUpdate(),401===r.status&&e.requestUpdate(),t.respondWith(Promise.resolve(r))}});e.dispatchEvent(n)&&n.respondWith(e.__handleRequest(n.request))}}static get properties(){return n(n({},super.properties),{},{storage:{type:String,noAccessor:!0},level:{type:Number,noAccessor:!0},base:{type:String,noAccessor:!0}})}get isLoggedIn(){return!!this.api.storage.getItem(o.SESSION)}get api(){return this.__api}get base(){return this.__base}set base(e){this.__base=e,this.__api=this.__createAPIInstance()}get level(){return this.__level}set level(e){this.__level=e,this.__api=this.__createAPIInstance()}get storage(){return this.__storage}set storage(e){this.__storage=e,this.__api=this.__createAPIInstance()}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__handleFetch)}render(){return r(g||(g=m` ${0} <slot></slot> `),this.renderTemplateOrSlot(this.isLoggedIn?"logged-in":"logged-out"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("fetch",this.__handleFetch)}__createAPIInstance(){const e={session:sessionStorage,cookie:d,local:localStorage};return new o({storage:e[this.storage],level:this.level,base:new URL(this.base)})}async __handleVirtualAuthSessionDelete(){return await this.api.signOut(),this.dispatchEvent(new _.SignOutEvent("signout")),this.requestUpdate(),new Response}async __handleVirtualAuthSessionPost(e){const t=await e.clone().json();if("password"!==t.type)throw new Error(`Unknown payload type ${t.type}`);let r,s;try{await this.api.signIn(t.credential),this.dispatchEvent(new _.SignInEvent("signin")),this.requestUpdate(),r=200,s=n({_links:{self:{href:e.url}}},t)}catch(e){if(!(e instanceof o.AuthError))throw e;if("UNAUTHORIZED"!==e.code)throw e;r=401,s={total:1,_embedded:{"fx:errors":[{message:e.message,logref:"unavailable",code:"invalid_credential_error"}]}}}return new Response(JSON.stringify(s),{status:r})}async __handleVirtualAuthSessionAny(e){return new Response(JSON.stringify({_links:{self:{href:e.url}},message:"POST to this endpoint to sign in"}))}async __handleVirtualAuthRecoverPost(e){const t=await e.clone().json();if("email"===t.type)return await this.api.sendPasswordResetEmail(t.detail),new Response(JSON.stringify({_links:{self:{href:e.url}},email:t.email}));throw new Error(`Unknown payload type ${t.type}`)}async __handleVirtualAuthRecoverAny(e){return new Response(JSON.stringify({_links:{self:{href:e.url}},message:"POST to this endpoint to request a password reset"}))}async __handleVirtualAuthSignUpPost(e){const t=await e.clone().json();try{await this.api.signUp(t)}catch(e){if(!(e instanceof o.AuthError))throw e;let t,n;if("UNAUTHORIZED"===e.code)t="Customer registration is disabled for this store.",n=401;else if("UNAVAILABLE"===e.code)t="This email address is already in use by an existing customer of this store.",n=403;else{if("INVALID_FORM"!==e.code)throw e;t="Client verification failed.",n=400}const r=JSON.stringify({total:1,_embedded:{"fx:errors":[{message:t}]}});return new Response(r,{status:n})}return t.password&&await this.api.signIn(t),this.requestUpdate(),this.dispatchEvent(new _.SignUpEvent("signup")),new Response(JSON.stringify({_links:{self:{href:e.url}},message:"Account created"}))}async __handleVirtualAuthSignUpAny(e){return new Response(JSON.stringify({_links:{self:{href:e.url}},message:"POST to this endpoint to create an account"}))}async __handleRequest(e){const t=e.url,n=e.method;try{if(t.startsWith("foxy://customer-api/session"))return"DELETE"===n?this.__handleVirtualAuthSessionDelete():"POST"===n?this.__handleVirtualAuthSessionPost(e):this.__handleVirtualAuthSessionAny(e);if(t.startsWith("foxy://customer-api/recover"))return"POST"===n?this.__handleVirtualAuthRecoverPost(e):this.__handleVirtualAuthRecoverAny(e);if(t.startsWith("foxy://customer-api/signup"))return"POST"===n?this.__handleVirtualAuthSignUpPost(e):this.__handleVirtualAuthSignUpAny(e);const r=await this.api.fetch(e);return 401===r.status&&(this.api.storage.clear(),this.dispatchEvent(new _.SignOutEvent("signout")),this.requestUpdate()),r}catch(e){return new Response(null,{status:500})}}}_.SignOutEvent=class extends CustomEvent{},_.SignInEvent=class extends CustomEvent{},_.SignUpEvent=class extends CustomEvent{};export{_ as C};
@@ -0,0 +1 @@
1
+ import{A as e,aF as t,aG as s}from"./shared-d1195c27.js";var n=function(e,t,s,n){return new(s||(s=Promise))((function(i,r){function o(e){try{h(n.next(e))}catch(e){r(e)}}function a(e){try{h(n.throw(e))}catch(e){r(e)}}function h(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}h((n=n.apply(e,t||[])).next())}))};class i extends e{constructor(e){super(Object.assign(Object.assign({},e),{fetch:(...e)=>this.__fetch(...e)}))}signIn(t){return n(this,void 0,void 0,(function*(){i.v8n.credentials.check(t);const s=yield this.fetch(new URL("./authenticate",this.base).toString(),{body:JSON.stringify(t),method:"POST"});if(!s.ok){const t=401===s.status?"UNAUTHORIZED":"UNKNOWN";throw new e.AuthError({code:t})}{const e=yield s.json(),t=Object.assign(Object.assign({},e),{date_created:(new Date).toISOString()});this.storage.setItem(i.SESSION,JSON.stringify(t))}}))}signUp(t){return n(this,void 0,void 0,(function*(){i.v8n.signUpParams.check(t);const s=new URL("./sign_up",this.base),n=yield this.fetch(s.toString(),{method:"POST",body:JSON.stringify(t)});if(!n.ok){if(400===n.status)throw new e.AuthError({code:"INVALID_FORM"});if(401===n.status)throw new e.AuthError({code:"UNAUTHORIZED"});if(403===n.status)throw new e.AuthError({code:"UNAVAILABLE"});throw new e.AuthError({code:"UNKNOWN"})}}))}sendPasswordResetEmail(t){return n(this,void 0,void 0,(function*(){i.v8n.email.check(t.email);if(!(yield this.fetch(new URL("./forgot_password",this.base).toString(),{body:JSON.stringify(t),method:"POST"})).ok)throw new e.AuthError({code:"UNKNOWN"})}))}signOut(){return n(this,void 0,void 0,(function*(){if(!(yield this.fetch(new URL("./authenticate",this.base).toString(),{method:"DELETE"})).ok)throw new e.AuthError({code:"UNKNOWN"});this.storage.clear(),this.cache.clear()}))}get usesTemporaryPassword(){const e=this.storage.getItem(i.SESSION);return!!e&&!!JSON.parse(e).force_password_reset}set usesTemporaryPassword(e){i.v8n.boolean.check(e);const t=this.storage.getItem(i.SESSION);if(t){const s=JSON.parse(t);s.force_password_reset=e,this.storage.setItem(i.SESSION,JSON.stringify(s))}}__fetch(e,t){var r;return n(this,void 0,void 0,(function*(){let n=JSON.parse(null!==(r=this.storage.getItem(i.SESSION))&&void 0!==r?r:"null");const o=new s.Request(e,t);if(null!==n){new Date(n.date_created).getTime()+1e3*n.expires_in<Date.now()?(this.console.info("Session has expired, signing out."),this.storage.clear(),this.cache.clear(),n=null):o.headers.set("Authorization",`Bearer ${n.session_token}`)}o.headers.set("Content-Type","application/json"),o.headers.set("FOXY-API-VERSION","1"),this.console.trace(`${o.method} ${o.url}`);const a=yield s.fetch(o);if(n&&a.ok){const e=Object.assign(Object.assign({},n),{date_created:(new Date).toISOString()});this.storage.setItem(i.SESSION,JSON.stringify(e))}return a}))}}i.SESSION="session",i.v8n=Object.assign({},e.v8n,{signUpParams:t().schema({verification:t().schema({token:t().string(),type:t().passesAnyOf(t().exact("hcaptcha"))}),first_name:t().optional(t().string().maxLength(50)),last_name:t().optional(t().string().maxLength(50)),password:t().string().maxLength(50),email:t().string().maxLength(100)}),credentials:t().schema({email:t().string(),newPassword:t().optional(t().string()),password:t().string()}),boolean:t().boolean(),email:t().string()});let r=/(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([a-zµμ]*)/gi;function o(e="",t="ms"){var s=null;return(e=e.replace(/(\d),(\d)/g,"$1$2")).replace(r,(function(e,t,n){(n=o[n]||o[n.toLowerCase().replace(/s$/,"")])&&(s=(s||0)+parseFloat(t,10)*n)})),s&&s/o[t]}o.nanosecond=o.ns=1e-6,o["µs"]=o["μs"]=o.us=o.microsecond=.001,o.millisecond=o.ms=1,o.second=o.sec=o.s=1e3*o.ms,o.minute=o.min=o.m=60*o.s,o.hour=o.hr=o.h=60*o.m,o.day=o.d=24*o.h,o.week=o.wk=o.w=7*o.d,o.month=o.b=30.4375*o.d,o.year=o.yr=o.y=365.25*o.d;var a=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(s[n[i]]=e[n[i]])}return s};class h{constructor(e){var{url:t}=e,s=a(e,["url"]);this.onsubmit=null,this.__tokenizationRequests=[],this.__iframeMessageHandler=e=>{var t,s;const n=JSON.parse(e.data);switch(n.type){case"tokenization_response":{const e=this.__tokenizationRequests.find((e=>e.id===n.id));n.token?null==e||e.resolve(n.token):null==e||e.reject(),this.__tokenizationRequests=this.__tokenizationRequests.filter((e=>e.id!==n.id));break}case"submit":null===(t=this.onsubmit)||void 0===t||t.call(this);break;case"resize":this.__iframe&&(this.__iframe.style.height=n.height);break;case"ready":this.configure(this.__config),null===(s=this.__mountingTask)||void 0===s||s.resolve()}},this.__iframeLoadHandler=e=>{if(this.__channel){const t=e.currentTarget.contentWindow;if(!t)throw new Error("Content window is not available.");t.postMessage("connect","*",[this.__channel.port2])}},this.__mountingTask=null,this.__channel=null,this.__iframe=null,this.__config=s,this.__url=t}configure(e){var t;this.__config=e;const s=Object.assign({type:"config"},e);null===(t=this.__channel)||void 0===t||t.port1.postMessage(JSON.stringify(s))}tokenize(){return new Promise(((e,t)=>{if(this.__channel){const s=this._createId();this.__tokenizationRequests.push({id:s,reject:t,resolve:e}),this.__channel.port1.postMessage(JSON.stringify({id:s,type:"tokenization_request"}))}else t()}))}unmount(){var e,t,s,n,i,r;null===(e=this.__channel)||void 0===e||e.port1.removeEventListener("message",this.__iframeMessageHandler),null===(t=this.__channel)||void 0===t||t.port1.close(),null===(s=this.__channel)||void 0===s||s.port2.close(),this.__channel=null,null===(n=this.__iframe)||void 0===n||n.removeEventListener("load",this.__iframeLoadHandler),null===(i=this.__iframe)||void 0===i||i.remove(),this.__iframe=null,null===(r=this.__mountingTask)||void 0===r||r.reject(),this.__mountingTask=null}mount(e){return this.unmount(),this.__channel=this._createMessageChannel(),this.__channel.port1.addEventListener("message",this.__iframeMessageHandler),this.__channel.port1.start(),this.__iframe=this._createIframe(e),this.__iframe.addEventListener("load",this.__iframeLoadHandler),this.__iframe.style.transition="height 0.15s ease",this.__iframe.style.margin="-2px",this.__iframe.style.height="100px",this.__iframe.style.width="calc(100% + 4px)",this.__iframe.src=this.__url,e.append(this.__iframe),new Promise(((e,t)=>{this.__mountingTask={reject:t,resolve:e}}))}clear(){var e;null===(e=this.__channel)||void 0===e||e.port1.postMessage(JSON.stringify({type:"clear"}))}_createMessageChannel(){return new MessageChannel}_createIframe(e){return e.ownerDocument.createElement("iframe")}_createId(){return`${Date.now()}${Math.random().toFixed(6).slice(2)}`}}export{i as A,h as P,o as p};
@@ -1,4 +1,22 @@
1
1
  {
2
+ "password-reset": {
3
+ "title": "Passwort zurücksetzen",
4
+ "subtitle": "Bitte aktualisieren Sie jetzt Ihr Passwort, um Ihr Konto zu sichern.",
5
+ "submit": "Weiter",
6
+ "password": {
7
+ "label": "Neues Passwort",
8
+ "placeholder": "Erforderlich",
9
+ "helper_text": "Klicken Sie auf ✨, um ein sicheres Zufallspasswort für dieses Konto zu generieren.",
10
+ "v8n_too_long": "Bitte verwenden Sie ein Passwort, das nicht länger als 50 Zeichen ist.",
11
+ "v8n_too_weak": "Bitte verwenden Sie ein stärkeres Passwort. Um dieses Passwort stärker zu machen, sollte es mindestens 8 Zeichen lang sein und einige Groß- und Kleinbuchstaben, Zahlen und Sonderzeichen enthalten.",
12
+ "v8n_required": "Bitte füllen Sie dieses Feld aus."
13
+ },
14
+ "spinner": {
15
+ "refresh": "Aktualisierung",
16
+ "loading_busy": "Wird geladen",
17
+ "loading_error": "Unbekannter Fehler"
18
+ }
19
+ },
2
20
  "access-recovery-form": {
3
21
  "back": "Zurückkehren",
4
22
  "email": "Email",
@@ -1,4 +1,22 @@
1
1
  {
2
+ "password-reset": {
3
+ "title": "Password reset",
4
+ "subtitle": "Please update your password now to keep your account secure.",
5
+ "submit": "Continue",
6
+ "password": {
7
+ "label": "New password",
8
+ "placeholder": "Required",
9
+ "helper_text": "Click ✨ to generate a secure random password for this account.",
10
+ "v8n_too_long": "Please use a password that is no longer than 50 characters.",
11
+ "v8n_too_weak": "Please use a stronger password. To make this password stronger, make it at least 8 characters long and include a few upper and lower case letters, numbers, and special characters.",
12
+ "v8n_required": "Please fill out this field."
13
+ },
14
+ "spinner": {
15
+ "refresh": "Refresh",
16
+ "loading_busy": "Loading",
17
+ "loading_error": "Unknown error"
18
+ }
19
+ },
2
20
  "access-recovery-form": {
3
21
  "back": "Go back",
4
22
  "email": "Email",
@@ -1,4 +1,22 @@
1
1
  {
2
+ "password-reset": {
3
+ "title": "Restablecimiento de contraseña",
4
+ "subtitle": "Por favor, actualice su contraseña ahora para mantener su cuenta segura.",
5
+ "submit": "Continuar",
6
+ "password": {
7
+ "label": "Nueva contraseña",
8
+ "placeholder": "Requerido",
9
+ "helper_text": "Haga clic en ✨ para generar una contraseña segura aleatoria para esta cuenta.",
10
+ "v8n_too_long": "Por favor, use una contraseña que no tenga más de 50 caracteres.",
11
+ "v8n_too_weak": "Por favor, use una contraseña más segura. Para hacer esta contraseña más segura, hágala de al menos 8 caracteres e incluya algunas letras mayúsculas y minúsculas, números y caracteres especiales.",
12
+ "v8n_required": "Por favor, rellene este campo."
13
+ },
14
+ "spinner": {
15
+ "refresh": "Actualizar",
16
+ "loading_busy": "Cargando",
17
+ "loading_error": "Error desconocido"
18
+ }
19
+ },
2
20
  "access-recovery-form": {
3
21
  "back": "Volver",
4
22
  "email": "Correo electrónico",
@@ -1,4 +1,22 @@
1
1
  {
2
+ "password-reset": {
3
+ "title": "Réinitialisation du mot de passe",
4
+ "subtitle": "Veuillez mettre à jour votre mot de passe maintenant pour sécuriser votre compte.",
5
+ "submit": "Continuer",
6
+ "password": {
7
+ "label": "Nouveau mot de passe",
8
+ "placeholder": "Requis",
9
+ "helper_text": "Cliquez sur ✨ pour générer un mot de passe aléatoire sécurisé pour ce compte.",
10
+ "v8n_too_long": "Veuillez utiliser un mot de passe ne dépassant pas 50 caractères.",
11
+ "v8n_too_weak": "Veuillez utiliser un mot de passe plus fort. Pour renforcer ce mot de passe, faites-le d'au moins 8 caractères et incluez quelques lettres majuscules et minuscules, des chiffres et des caractères spéciaux.",
12
+ "v8n_required": "Merci de remplir ce champ."
13
+ },
14
+ "spinner": {
15
+ "refresh": "Rafraîchir",
16
+ "loading_busy": "Chargement",
17
+ "loading_error": "Erreur inconnue"
18
+ }
19
+ },
2
20
  "access-recovery-form": {
3
21
  "back": "Retourner",
4
22
  "email": "E-mail",
@@ -1,4 +1,22 @@
1
1
  {
2
+ "password-reset": {
3
+ "title": "Wachtwoord resetten",
4
+ "subtitle": "Werk nu uw wachtwoord bij om uw account veilig te houden.",
5
+ "submit": "Doorgaan",
6
+ "password": {
7
+ "label": "Nieuw wachtwoord",
8
+ "placeholder": "Vereist",
9
+ "helper_text": "Klik op ✨ om een ​​veilig willekeurig wachtwoord voor dit account te genereren.",
10
+ "v8n_too_long": "Gebruik een wachtwoord dat niet langer is dan 50 tekens.",
11
+ "v8n_too_weak": "Gebruik een sterker wachtwoord. Maak dit wachtwoord sterker door het minstens 8 tekens lang te maken en een paar hoofdletters en kleine letters, cijfers en speciale tekens op te nemen.",
12
+ "v8n_required": "Vul alstublieft dit veld in."
13
+ },
14
+ "spinner": {
15
+ "refresh": "Vernieuwen",
16
+ "loading_busy": "Bezig met laden",
17
+ "loading_error": "Onbekende fout"
18
+ }
19
+ },
2
20
  "access-recovery-form": {
3
21
  "back": "Ga terug",
4
22
  "email": "E-mail",
@@ -1,4 +1,22 @@
1
1
  {
2
+ "password-reset": {
3
+ "title": "Resetowanie hasła",
4
+ "subtitle": "Proszę zaktualizować swoje hasło, aby zabezpieczyć konto.",
5
+ "submit": "Kontynuuj",
6
+ "password": {
7
+ "label": "Nowe hasło",
8
+ "placeholder": "Wymagany",
9
+ "helper_text": "Kliknij ✨, aby wygenerować bezpieczne losowe hasło dla tego konta.",
10
+ "v8n_too_long": "Proszę używać hasła nie dłuższego niż 50 znaków.",
11
+ "v8n_too_weak": "Proszę użyć silniejszego hasła. Aby wzmocnić to hasło, powinno mieć co najmniej 8 znaków i zawierać kilka wielkich i małych liter, cyfr oraz znaków specjalnych.",
12
+ "v8n_required": "Proszę wypełnić to pole."
13
+ },
14
+ "spinner": {
15
+ "refresh": "Odświeżać",
16
+ "loading_busy": "Ładowanie",
17
+ "loading_error": "Nieznany błąd"
18
+ }
19
+ },
2
20
  "access-recovery-form": {
3
21
  "back": "Wróć",
4
22
  "email": "E-mail",
@@ -1,4 +1,22 @@
1
1
  {
2
+ "password-reset": {
3
+ "title": "Återställ lösenord",
4
+ "subtitle": "Uppdatera ditt lösenord nu för att hålla ditt konto säkert.",
5
+ "submit": "Fortsätt",
6
+ "password": {
7
+ "label": "Nytt lösenord",
8
+ "placeholder": "Nödvändig",
9
+ "helper_text": "Klicka på ✨ för att generera ett säkert slumpmässigt lösenord för detta konto.",
10
+ "v8n_too_long": "Använd ett lösenord som inte är längre än 50 tecken.",
11
+ "v8n_too_weak": "Använd ett starkare lösenord. För att göra detta lösenord starkare, gör det minst 8 tecken långt och inkludera några stora och små bokstäver, siffror och specialtecken.",
12
+ "v8n_required": "Var vänlig fyll i det här fältet."
13
+ },
14
+ "spinner": {
15
+ "refresh": "Uppdatera",
16
+ "loading_busy": "Läser in",
17
+ "loading_error": "Okänt fel"
18
+ }
19
+ },
2
20
  "access-recovery-form": {
3
21
  "back": "Gå tillbaka",
4
22
  "email": "E-post",
@@ -1,4 +1,22 @@
1
1
  {
2
+ "password-reset": {
3
+ "title": "重置密码",
4
+ "subtitle": "请立即更新您的密码以确保帐户安全。",
5
+ "submit": "继续",
6
+ "password": {
7
+ "label": "新密码",
8
+ "placeholder": "必需的",
9
+ "helper_text": "点击 ✨ 为此帐户生成一个安全的随机密码。",
10
+ "v8n_too_long": "请使用不超过 50 个字符的密码。",
11
+ "v8n_too_weak": "请使用更强的密码。为了使此密码更强,请使其至少 8 个字符长,并包含一些大写和小写字母、数字和特殊字符。",
12
+ "v8n_required": "请填写此字段。"
13
+ },
14
+ "spinner": {
15
+ "refresh": "刷新",
16
+ "loading_busy": "加载中",
17
+ "loading_error": "未知错误"
18
+ }
19
+ },
2
20
  "access-recovery-form": {
3
21
  "back": "回去",
4
22
  "email": "电子邮件",