@foxy.io/elements 1.42.0-beta.4 → 1.42.0-beta.6

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 (79) hide show
  1. package/dist/cdn/foxy-address-form.js +1 -1
  2. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  3. package/dist/cdn/foxy-api-browser.js +1 -1
  4. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  5. package/dist/cdn/foxy-attribute-form.js +1 -1
  6. package/dist/cdn/foxy-cart-form.js +1 -1
  7. package/dist/cdn/foxy-client-form.js +1 -1
  8. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  9. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  10. package/dist/cdn/foxy-coupon-form.js +1 -1
  11. package/dist/cdn/foxy-custom-field-form.js +1 -1
  12. package/dist/cdn/foxy-customer-form.js +1 -1
  13. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  14. package/dist/cdn/foxy-customer-portal.js +1 -1
  15. package/dist/cdn/foxy-customer.js +1 -1
  16. package/dist/cdn/foxy-downloadable-form.js +1 -1
  17. package/dist/cdn/foxy-email-template-form.js +1 -1
  18. package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
  19. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  20. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  21. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  22. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  23. package/dist/cdn/foxy-gift-card-form.js +1 -1
  24. package/dist/cdn/foxy-integration-form.js +1 -1
  25. package/dist/cdn/foxy-item-category-form.js +1 -1
  26. package/dist/cdn/foxy-item-form.js +1 -1
  27. package/dist/cdn/foxy-item-option-form.js +1 -1
  28. package/dist/cdn/foxy-native-integration-form.js +1 -1
  29. package/dist/cdn/foxy-pagination.js +1 -1
  30. package/dist/cdn/foxy-passkey-form.js +1 -1
  31. package/dist/cdn/foxy-payment-method-card.js +1 -1
  32. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  33. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  34. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  35. package/dist/cdn/foxy-store-form.js +1 -1
  36. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  37. package/dist/cdn/foxy-subscription-form.js +1 -1
  38. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  39. package/dist/cdn/foxy-tax-form.js +1 -1
  40. package/dist/cdn/foxy-template-config-form.js +1 -1
  41. package/dist/cdn/foxy-template-form.js +1 -1
  42. package/dist/cdn/foxy-template-set-form.js +1 -1
  43. package/dist/cdn/foxy-transaction.js +1 -1
  44. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  45. package/dist/cdn/foxy-user-form.js +1 -1
  46. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  47. package/dist/cdn/foxy-users-table.js +1 -1
  48. package/dist/cdn/foxy-webhook-form.js +1 -1
  49. package/dist/cdn/{shared-f15af5d1.js → shared-076f086a.js} +1 -1
  50. package/dist/cdn/{shared-6286efb1.js → shared-0e1ad508.js} +1 -1
  51. package/dist/cdn/shared-21fba20d.js +1 -0
  52. package/dist/cdn/{shared-63b647a8.js → shared-2a5d1cdf.js} +1 -1
  53. package/dist/cdn/{shared-9f4f8e95.js → shared-3ca95e21.js} +1 -1
  54. package/dist/cdn/{shared-ef98e595.js → shared-56d91134.js} +1 -1
  55. package/dist/cdn/{shared-6332db39.js → shared-5960c279.js} +1 -1
  56. package/dist/cdn/{shared-32883b02.js → shared-663794ff.js} +1 -1
  57. package/dist/cdn/shared-677953e0.js +1 -0
  58. package/dist/cdn/{shared-42a4540f.js → shared-77f39a8a.js} +1 -1
  59. package/dist/cdn/{shared-0643656a.js → shared-7995cbcf.js} +1 -1
  60. package/dist/cdn/{shared-bfdbe217.js → shared-7f5f6657.js} +1 -1
  61. package/dist/cdn/{shared-93c8789e.js → shared-90754404.js} +1 -1
  62. package/dist/cdn/{shared-79a6aa1a.js → shared-a1f654fc.js} +1 -1
  63. package/dist/cdn/{shared-38eb8858.js → shared-a3a18e8d.js} +1 -1
  64. package/dist/cdn/{shared-dd2a66a5.js → shared-df369311.js} +1 -1
  65. package/dist/cdn/{shared-bf5b2106.js → shared-e653b80e.js} +1 -1
  66. package/dist/cdn/{shared-c92d72ba.js → shared-eb086cef.js} +1 -1
  67. package/dist/cdn/{shared-d6f46d44.js → shared-fc66cb5d.js} +1 -1
  68. package/dist/cdn/{shared-91bf0fa2.js → shared-fca3a317.js} +1 -1
  69. package/dist/cdn/translations/payments-api-payment-method-form/en.json +76 -36
  70. package/dist/cdn/translations/payments-api-payment-preset-form/en.json +76 -36
  71. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js +15 -4
  72. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js.map +1 -1
  73. package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js +89 -78
  74. package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js.map +1 -1
  75. package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js +1 -0
  76. package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js.map +1 -1
  77. package/package.json +1 -1
  78. package/dist/cdn/shared-303dc2a6.js +0 -1
  79. package/dist/cdn/shared-cc5e4c06.js +0 -1
@@ -1 +1 @@
1
- import"./shared-127ec8a7.js";import"./shared-5c057c26.js";import"./shared-68a5368a.js";import"./shared-75e7361d.js";import"./shared-0995ae7c.js";import{I as e}from"./shared-0643656a.js";import"./shared-bfdbe217.js";import"./shared-6286efb1.js";import"./shared-bc2eb9bb.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-70380f94.js";import{_ as t,B as s}from"./shared-cb58dfcd.js";import"./shared-7b3aac7e.js";import"./shared-16ae74b2.js";import{h as a}from"./shared-ba5c42c7.js";import{S as i,R as r,a as n}from"./shared-1ce5b073.js";import{c as o}from"./shared-4e709717.js";import{S as d,C as l}from"./shared-eed9b226.js";import"./shared-a4ca1c5d.js";import{G as c}from"./shared-ee9ee09a.js";import"./shared-d2304d50.js";import"./shared-0662adb7.js";import"./shared-986d0f7f.js";import"./shared-92153a7f.js";import"./shared-864ea319.js";import"./shared-76cbea00.js";import{p as u}from"./shared-8b891950.js";import{s as m}from"./shared-79d0699c.js";import{i as h}from"./shared-53e42a77.js";import{a as f,g as _}from"./shared-ada5e9f5.js";import{p}from"./shared-99a8889a.js";import{j as y}from"./shared-673d668a.js";import"./shared-a3a4c368.js";import"./shared-500b7eb7.js";import"./shared-20fb2969.js";import"./shared-292dcee0.js";import"./shared-651c44fa.js";import"./shared-4ded48ee.js";import"./shared-c365c1ae.js";import"./shared-f28e46bf.js";import"./shared-cc5e4c06.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-1f6366c0.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-42c91940.js";import"./shared-ef98e595.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-6b3b8c63.js";import"./shared-43e2c3f6.js";import"./shared-7a4ca3f1.js";import"./shared-253e51f7.js";import"./shared-91bf0fa2.js";import"./shared-63b647a8.js";import"./shared-eb963ba3.js";import"./shared-7a2aaafa.js";import"./shared-9a4d52dd.js";import"./shared-f9f64dee.js";import"./shared-d5f6483f.js";import"./shared-25167d28.js";function v(e){return function*(e){const t=[];for(const s of e.settings.subscriptions.allowFrequencyModification)if(y(s.jsonataQuery).evaluate(e.subscription))for(const e of s.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}class g extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function x(e){const t=864e5,s=31*t;if(".5m"===e)return s/2;const a=parseInt(e.substring(0,e.length-1));if(isNaN(a))throw new g(e);if(e.endsWith("y"))return 31536e6*a;if(e.endsWith("m"))return a*s;if(e.endsWith("w"))return 6048e5*a;if(e.endsWith("d"))return a*t;throw new g(e)}function b(e,t){if("boolean"==typeof t)return t;const s=t.filter((t=>Boolean(y(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var s,a,i,r,n;if(t.min){const s=e.min?x(e.min):1/0;x(t.min)<s&&(e.min=t.min)}if(t.max){const s=e.max?x(e.max):-1/0;x(t.max)>s&&(e.max=t.max)}if("day"===(null===(s=t.allowedDays)||void 0===s?void 0:s.type)){const s=[...null!==(a=e.allowedDaysOfWeek)&&void 0!==a?a:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(s))}if("month"===(null===(i=t.allowedDays)||void 0===i?void 0:i.type)){const s=[...null!==(r=e.allowedDaysOfMonth)&&void 0!==r?r:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(s))}if(t.disallowedDates){const s=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(s))}return e}),{});return 0!==Object.keys(s).length&&s}function $(e){const[t,s,a]=e.split("-").map((e=>parseInt(e)));return new Date(t,s-1,a)}function j(e){const t=e.settings.subscriptions.allow_next_date_modification;let s;return s="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,s;const a=$(e.value),i=a.getTime(),r=b(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof r)return r;if(!1===(null===(t=r.allowedDaysOfMonth)||void 0===t?void 0:t.includes(a.getDate())))return!1;if(!1===(null===(s=r.allowedDaysOfWeek)||void 0===s?void 0:s.includes(a.getDay())))return!1;if(r.disallowedDates&&r.disallowedDates.find((e=>{const[t,s]=e.split("..").map((e=>$(e).getTime()));return i===t||void 0!==s&&i>=t&&i<=s})))return!1;if(r.min){const e=p(r.min);if(null!==e&&Date.now()+e>=i)return!1}if(r.max){const e=p(r.max);if(null!==e&&Date.now()+e<=i)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:s}},subscription:e.subscription,value:e.value})}let S,w,D,T,q,E,k,H,C,L,A,I=e=>e;const O=i(r(n(e,"subscription-form")));class N extends O{constructor(){super(...arguments),this.getTransactionPageHref=(e,t)=>null==t?void 0:t._links["fx:receipt"].href,this.getCustomerPageHref=null,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderItemsActions=()=>a(S||(S=I` <div class="flex items-center gap-s text-m" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-l font-medium text-body leading-m" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var e;let t;try{const s=this.__transactionTemplate,a=new URL(null!==(e=null==s?void 0:s._links["fx:items"].href)&&void 0!==e?e:"");a.searchParams.set("zoom","item_options"),t=a.toString()}catch(e){t=void 0}return a(w||(w=I` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" infer="items" item="foxy-item-card" .itemProps="${0}"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),h(t),{"locale-codes":this.localeCodes,".settings":this.settings})},this.__renderEndDate=()=>{var e;const{data:t,lang:s,ns:i}=this;return a(D||(D=I` <div data-testid="end-date"> ${0} <x-group frame> <foxy-i18n key="end_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),i,s,h(null===(e=null==t?void 0:t.end_date)||void 0===e?void 0:e.substr(0,10)),h(null==t?void 0:t.end_date),s,!this.__isEndDateEditable,this.disabledSelector.matches("end-date",!0),this.__checkEndDateAvailability,(e=>{const t=e.target;this.edit({end_date:t.value})}),this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:s}=this;if(t&&s){return j({value:m(e),settings:t,subscription:s})}return e.getTime()>=Date.now()},this.__checkStartDateAvailability=e=>e.getTime()>=Date.now(),this.__checkEndDateAvailability=e=>{const t=new Date;return t.setDate(t.getDate()+1),t.setHours(0,0,0,0),e.getTime()>=t.getTime()},this.__renderStartDate=()=>{const{data:e,lang:t,ns:s}=this;return a(T||(T=I` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),s,t,h(null==e?void 0:e.start_date.substr(0,10)),h(null==e?void 0:e.start_date),t,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(e=>{const t=e.target;this.edit({start_date:t.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:s}=this,i=!!(null==e?void 0:e.is_active);return a(q||(q=I` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),s,t,h(null==e?void 0:e.next_transaction_date.substr(0,10)),h(null==e?void 0:e.next_transaction_date),t,!i||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),s=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",u(e)),value:e})));return a(E||(E=I` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),h(this.form.frequency),s,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:s,ns:i}=this;return a(k||(k=I` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),i,s,i,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>a(H||(H=I` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(e)),e,s,".5m"===e?"twice_a_month":"frequency",i))))},this.__renderFrequency=()=>a(C||(C=I` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__renderCustomer=()=>{var e,t;const s=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,i=s?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,s):void 0;return a(L||(L=I` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-l font-medium leading-xs mb-s" key="label"> </foxy-i18n> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="customer" href="${0}"></foxy-customer-card> </a> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),o({"block rounded transition-colors":!0,"ring-1 ring-contrast-10":!i,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!i,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!i}),h(i),h(s),this.renderTemplateOrSlot("customer:after"))}}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-customer-card":customElements.get("foxy-customer-card"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":d,"x-choice":l,"x-group":c}}static get properties(){return t(t({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},settings:{type:Object},coupons:{}})}get hiddenSelector(){return new s(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}get headerTitleOptions(){var e,s;if(this.data&&this.__currencyCode){const a=u(this.data.frequency),i=this.__transactionTemplate,r=`${null==i?void 0:i.total_order} ${this.__currencyCode}`,n=this.__currencyDisplay,o=null===(s=null===(e=this.settings)||void 0===e?void 0:e.cart_display_config.show_sub_frequency)||void 0===s||s,d=this.__currencyCode&&o?".5m"===this.data.frequency?"twice_a_month":"recurring":"existing";return t(t({},a),{},{amount:r,currencyDisplay:n,context:d})}return{}}get headerSubtitleKey(){const e=this.settings?f(this.data,this.settings):_(this.data);return e?`subtitle_${e}`:super.headerSubtitleKey}renderBody(){var e,t,s,i,r;let n;try{const s=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");s.searchParams.set("order","transaction_date desc"),s.searchParams.set("zoom","items"),n=s.toString()}catch(e){n=void 0}return a(A||(A=I` ${0} <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> </div> `),this.renderHeader(),h(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),h(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),h(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),h(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),h(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("customer",!0)?"":this.__renderCustomer(),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",this.__isEndDateVisible?this.__renderEndDate():"",h(null!==(s=this.__currencyCode)&&void 0!==s?s:void 0),h(null===(r=null===(i=this.data)||void 0===i?void 0:i._links["fx:attributes"])||void 0===r?void 0:r.href),h(n),this.getTransactionPageHref)}get __transactionTemplateHref(){var e;const t=this.data;return(null===(e=null==t?void 0:t._embedded)||void 0===e?void 0:e["fx:transaction_template"])||null==t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var e,t,s;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(s=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==s?s:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __templateSetHref(){const e=this.__transactionTemplate;if(!(null==e?void 0:e.currency_code))return(null==e?void 0:e.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t,s;const a=this.data,i=null===(e=null==a?void 0:a._embedded)||void 0===e?void 0:e["fx:transaction_template"],r=`#${this.__transactionTemplateLoaderId}`;return null!==(s=null!=i?i:null===(t=this.renderRoot.querySelector(r))||void 0===t?void 0:t.data)&&void 0!==s?s:null}get __defaultTemplateSet(){var e,t;const s=`#${this.__defaultTemplateSetLoaderId}`,a=this.renderRoot.querySelector(s);return null!==(t=null===(e=null==a?void 0:a.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const s=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(s))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const s=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(s))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const s=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(s))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __isNextTransactionDateVisible(){var e;if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(!1===(null===(e=this.settings)||void 0===e?void 0:e.cart_display_config.show_sub_nextdate))return!1;if(null===this.settings)return!0;const t=this.settings.subscriptions.allow_next_date_modification;return!!function(e,t){let s;return s="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),b(e,s)}(this.data,t)}get __isStartDateVisible(){var e;return!this.hiddenSelector.matches("start-date",!0)&&(!1!==(null===(e=this.settings)||void 0===e?void 0:e.cart_display_config.show_sub_startdate)&&this.__isNextTransactionDateVisible)}get __isEndDateVisible(){return!this.hiddenSelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())&&(!1!==this.data.is_active&&!this.settings)))}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isEndDateEditable(){return!this.readonlySelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&null===this.settings)))}get __isFrequencyVisible(){var e;if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(!1===(null===(e=this.settings)||void 0===e?void 0:e.cart_display_config.show_sub_frequency))return!1;if(null===this.settings)return!0;return!v({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=v({subscription:this.data,settings:this.settings});return Array.from(e)}get __currencyCode(){var e,t,s,a;const i=this.__transactionTemplate;if(null==i?void 0:i.currency_code)return i.currency_code;const r=this.__localeCodesHelper,n=null===(t=null!==(e=this.__templateSet)&&void 0!==e?e:this.__defaultTemplateSet)||void 0===t?void 0:t.locale_code,o=n?null==r?void 0:r.values[n]:void 0;return o&&null!==(a=null===(s=/Currency: ([A-Z]{3})/g.exec(o))||void 0===s?void 0:s[1])&&void 0!==a?a:null}get __currencyDisplay(){var e;return(null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol)?"code":"symbol"}}customElements.define("foxy-subscription-form",N);export{N as SubscriptionForm};
1
+ import"./shared-127ec8a7.js";import"./shared-5c057c26.js";import"./shared-68a5368a.js";import"./shared-75e7361d.js";import"./shared-0995ae7c.js";import{I as e}from"./shared-7995cbcf.js";import"./shared-7f5f6657.js";import"./shared-0e1ad508.js";import"./shared-bc2eb9bb.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-70380f94.js";import{_ as t,B as s}from"./shared-cb58dfcd.js";import"./shared-7b3aac7e.js";import"./shared-16ae74b2.js";import{h as a}from"./shared-ba5c42c7.js";import{S as i,R as r,a as n}from"./shared-1ce5b073.js";import{c as o}from"./shared-4e709717.js";import{S as d,C as l}from"./shared-eed9b226.js";import"./shared-a4ca1c5d.js";import{G as c}from"./shared-ee9ee09a.js";import"./shared-d2304d50.js";import"./shared-0662adb7.js";import"./shared-986d0f7f.js";import"./shared-92153a7f.js";import"./shared-864ea319.js";import"./shared-76cbea00.js";import{p as u}from"./shared-8b891950.js";import{s as m}from"./shared-79d0699c.js";import{i as h}from"./shared-53e42a77.js";import{a as f,g as _}from"./shared-ada5e9f5.js";import{p}from"./shared-99a8889a.js";import{j as y}from"./shared-673d668a.js";import"./shared-a3a4c368.js";import"./shared-500b7eb7.js";import"./shared-20fb2969.js";import"./shared-292dcee0.js";import"./shared-651c44fa.js";import"./shared-4ded48ee.js";import"./shared-c365c1ae.js";import"./shared-f28e46bf.js";import"./shared-677953e0.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-1f6366c0.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-42c91940.js";import"./shared-56d91134.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-6b3b8c63.js";import"./shared-43e2c3f6.js";import"./shared-7a4ca3f1.js";import"./shared-253e51f7.js";import"./shared-fca3a317.js";import"./shared-2a5d1cdf.js";import"./shared-eb963ba3.js";import"./shared-7a2aaafa.js";import"./shared-9a4d52dd.js";import"./shared-f9f64dee.js";import"./shared-d5f6483f.js";import"./shared-25167d28.js";function v(e){return function*(e){const t=[];for(const s of e.settings.subscriptions.allowFrequencyModification)if(y(s.jsonataQuery).evaluate(e.subscription))for(const e of s.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}class g extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function x(e){const t=864e5,s=31*t;if(".5m"===e)return s/2;const a=parseInt(e.substring(0,e.length-1));if(isNaN(a))throw new g(e);if(e.endsWith("y"))return 31536e6*a;if(e.endsWith("m"))return a*s;if(e.endsWith("w"))return 6048e5*a;if(e.endsWith("d"))return a*t;throw new g(e)}function b(e,t){if("boolean"==typeof t)return t;const s=t.filter((t=>Boolean(y(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var s,a,i,r,n;if(t.min){const s=e.min?x(e.min):1/0;x(t.min)<s&&(e.min=t.min)}if(t.max){const s=e.max?x(e.max):-1/0;x(t.max)>s&&(e.max=t.max)}if("day"===(null===(s=t.allowedDays)||void 0===s?void 0:s.type)){const s=[...null!==(a=e.allowedDaysOfWeek)&&void 0!==a?a:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(s))}if("month"===(null===(i=t.allowedDays)||void 0===i?void 0:i.type)){const s=[...null!==(r=e.allowedDaysOfMonth)&&void 0!==r?r:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(s))}if(t.disallowedDates){const s=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(s))}return e}),{});return 0!==Object.keys(s).length&&s}function $(e){const[t,s,a]=e.split("-").map((e=>parseInt(e)));return new Date(t,s-1,a)}function j(e){const t=e.settings.subscriptions.allow_next_date_modification;let s;return s="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,s;const a=$(e.value),i=a.getTime(),r=b(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof r)return r;if(!1===(null===(t=r.allowedDaysOfMonth)||void 0===t?void 0:t.includes(a.getDate())))return!1;if(!1===(null===(s=r.allowedDaysOfWeek)||void 0===s?void 0:s.includes(a.getDay())))return!1;if(r.disallowedDates&&r.disallowedDates.find((e=>{const[t,s]=e.split("..").map((e=>$(e).getTime()));return i===t||void 0!==s&&i>=t&&i<=s})))return!1;if(r.min){const e=p(r.min);if(null!==e&&Date.now()+e>=i)return!1}if(r.max){const e=p(r.max);if(null!==e&&Date.now()+e<=i)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:s}},subscription:e.subscription,value:e.value})}let S,w,D,T,q,E,k,H,C,L,A,I=e=>e;const O=i(r(n(e,"subscription-form")));class N extends O{constructor(){super(...arguments),this.getTransactionPageHref=(e,t)=>null==t?void 0:t._links["fx:receipt"].href,this.getCustomerPageHref=null,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderItemsActions=()=>a(S||(S=I` <div class="flex items-center gap-s text-m" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-l font-medium text-body leading-m" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var e;let t;try{const s=this.__transactionTemplate,a=new URL(null!==(e=null==s?void 0:s._links["fx:items"].href)&&void 0!==e?e:"");a.searchParams.set("zoom","item_options"),t=a.toString()}catch(e){t=void 0}return a(w||(w=I` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" infer="items" item="foxy-item-card" .itemProps="${0}"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),h(t),{"locale-codes":this.localeCodes,".settings":this.settings})},this.__renderEndDate=()=>{var e;const{data:t,lang:s,ns:i}=this;return a(D||(D=I` <div data-testid="end-date"> ${0} <x-group frame> <foxy-i18n key="end_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),i,s,h(null===(e=null==t?void 0:t.end_date)||void 0===e?void 0:e.substr(0,10)),h(null==t?void 0:t.end_date),s,!this.__isEndDateEditable,this.disabledSelector.matches("end-date",!0),this.__checkEndDateAvailability,(e=>{const t=e.target;this.edit({end_date:t.value})}),this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:s}=this;if(t&&s){return j({value:m(e),settings:t,subscription:s})}return e.getTime()>=Date.now()},this.__checkStartDateAvailability=e=>e.getTime()>=Date.now(),this.__checkEndDateAvailability=e=>{const t=new Date;return t.setDate(t.getDate()+1),t.setHours(0,0,0,0),e.getTime()>=t.getTime()},this.__renderStartDate=()=>{const{data:e,lang:t,ns:s}=this;return a(T||(T=I` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),s,t,h(null==e?void 0:e.start_date.substr(0,10)),h(null==e?void 0:e.start_date),t,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(e=>{const t=e.target;this.edit({start_date:t.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:s}=this,i=!!(null==e?void 0:e.is_active);return a(q||(q=I` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),s,t,h(null==e?void 0:e.next_transaction_date.substr(0,10)),h(null==e?void 0:e.next_transaction_date),t,!i||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),s=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",u(e)),value:e})));return a(E||(E=I` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),h(this.form.frequency),s,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:s,ns:i}=this;return a(k||(k=I` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),i,s,i,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>a(H||(H=I` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(e)),e,s,".5m"===e?"twice_a_month":"frequency",i))))},this.__renderFrequency=()=>a(C||(C=I` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__renderCustomer=()=>{var e,t;const s=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,i=s?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,s):void 0;return a(L||(L=I` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-l font-medium leading-xs mb-s" key="label"> </foxy-i18n> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="customer" href="${0}"></foxy-customer-card> </a> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),o({"block rounded transition-colors":!0,"ring-1 ring-contrast-10":!i,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!i,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!i}),h(i),h(s),this.renderTemplateOrSlot("customer:after"))}}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-customer-card":customElements.get("foxy-customer-card"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":d,"x-choice":l,"x-group":c}}static get properties(){return t(t({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},settings:{type:Object},coupons:{}})}get hiddenSelector(){return new s(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}get headerTitleOptions(){var e,s;if(this.data&&this.__currencyCode){const a=u(this.data.frequency),i=this.__transactionTemplate,r=`${null==i?void 0:i.total_order} ${this.__currencyCode}`,n=this.__currencyDisplay,o=null===(s=null===(e=this.settings)||void 0===e?void 0:e.cart_display_config.show_sub_frequency)||void 0===s||s,d=this.__currencyCode&&o?".5m"===this.data.frequency?"twice_a_month":"recurring":"existing";return t(t({},a),{},{amount:r,currencyDisplay:n,context:d})}return{}}get headerSubtitleKey(){const e=this.settings?f(this.data,this.settings):_(this.data);return e?`subtitle_${e}`:super.headerSubtitleKey}renderBody(){var e,t,s,i,r;let n;try{const s=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");s.searchParams.set("order","transaction_date desc"),s.searchParams.set("zoom","items"),n=s.toString()}catch(e){n=void 0}return a(A||(A=I` ${0} <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> </div> `),this.renderHeader(),h(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),h(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),h(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),h(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),h(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("customer",!0)?"":this.__renderCustomer(),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",this.__isEndDateVisible?this.__renderEndDate():"",h(null!==(s=this.__currencyCode)&&void 0!==s?s:void 0),h(null===(r=null===(i=this.data)||void 0===i?void 0:i._links["fx:attributes"])||void 0===r?void 0:r.href),h(n),this.getTransactionPageHref)}get __transactionTemplateHref(){var e;const t=this.data;return(null===(e=null==t?void 0:t._embedded)||void 0===e?void 0:e["fx:transaction_template"])||null==t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var e,t,s;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(s=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==s?s:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __templateSetHref(){const e=this.__transactionTemplate;if(!(null==e?void 0:e.currency_code))return(null==e?void 0:e.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t,s;const a=this.data,i=null===(e=null==a?void 0:a._embedded)||void 0===e?void 0:e["fx:transaction_template"],r=`#${this.__transactionTemplateLoaderId}`;return null!==(s=null!=i?i:null===(t=this.renderRoot.querySelector(r))||void 0===t?void 0:t.data)&&void 0!==s?s:null}get __defaultTemplateSet(){var e,t;const s=`#${this.__defaultTemplateSetLoaderId}`,a=this.renderRoot.querySelector(s);return null!==(t=null===(e=null==a?void 0:a.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const s=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(s))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const s=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(s))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const s=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(s))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __isNextTransactionDateVisible(){var e;if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(!1===(null===(e=this.settings)||void 0===e?void 0:e.cart_display_config.show_sub_nextdate))return!1;if(null===this.settings)return!0;const t=this.settings.subscriptions.allow_next_date_modification;return!!function(e,t){let s;return s="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),b(e,s)}(this.data,t)}get __isStartDateVisible(){var e;return!this.hiddenSelector.matches("start-date",!0)&&(!1!==(null===(e=this.settings)||void 0===e?void 0:e.cart_display_config.show_sub_startdate)&&this.__isNextTransactionDateVisible)}get __isEndDateVisible(){return!this.hiddenSelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())&&(!1!==this.data.is_active&&!this.settings)))}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isEndDateEditable(){return!this.readonlySelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&null===this.settings)))}get __isFrequencyVisible(){var e;if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(!1===(null===(e=this.settings)||void 0===e?void 0:e.cart_display_config.show_sub_frequency))return!1;if(null===this.settings)return!0;return!v({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=v({subscription:this.data,settings:this.settings});return Array.from(e)}get __currencyCode(){var e,t,s,a;const i=this.__transactionTemplate;if(null==i?void 0:i.currency_code)return i.currency_code;const r=this.__localeCodesHelper,n=null===(t=null!==(e=this.__templateSet)&&void 0!==e?e:this.__defaultTemplateSet)||void 0===t?void 0:t.locale_code,o=n?null==r?void 0:r.values[n]:void 0;return o&&null!==(a=null===(s=/Currency: ([A-Z]{3})/g.exec(o))||void 0===s?void 0:s[1])&&void 0!==a?a:null}get __currencyDisplay(){var e;return(null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol)?"code":"symbol"}}customElements.define("foxy-subscription-form",N);export{N as SubscriptionForm};
@@ -1 +1 @@
1
- import"./shared-6332db39.js";import"./shared-ef98e595.js";import"./shared-bf5b2106.js";import"./shared-c92d72ba.js";import"./shared-6286efb1.js";import"./shared-f15af5d1.js";import{I as e}from"./shared-0643656a.js";import{a as t}from"./shared-1ce5b073.js";import{B as r}from"./shared-cb58dfcd.js";import{h as i}from"./shared-ba5c42c7.js";import"./shared-127ec8a7.js";import"./shared-a3a4c368.js";import"./shared-500b7eb7.js";import"./shared-7b3aac7e.js";import"./shared-0995ae7c.js";import"./shared-16ae74b2.js";import"./shared-cc5e4c06.js";import"./shared-5212ef4f.js";import"./shared-70380f94.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-5c057c26.js";import"./shared-20fb2969.js";import"./shared-986d0f7f.js";import"./shared-292dcee0.js";import"./shared-0662adb7.js";import"./shared-76cbea00.js";import"./shared-651c44fa.js";import"./shared-d2304d50.js";import"./shared-4ded48ee.js";import"./shared-92153a7f.js";import"./shared-68a5368a.js";import"./shared-c365c1ae.js";import"./shared-f28e46bf.js";import"./shared-6b3b8c63.js";import"./shared-1f6366c0.js";import"./shared-a4ca1c5d.js";import"./foxy-copy-to-clipboard.js";import"./shared-75e7361d.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,s=e=>e;const o=t(e,"subscription-settings-form");class n extends o{constructor(){super(...arguments),this.__pastDueAmountHandlingOptions=[{label:"option_increment",value:"increment"},{label:"option_replace",value:"replace"}],this.__positiveIntegerInputParams={type:"number",step:"1",min:"0"},this.__expiringSoonPaymentReminderScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.expiring_soon_payment_reminder_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,r)=>!isNaN(e)&&r.indexOf(e)===t)).sort(((e,t)=>t-e)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__expiringSoonPaymentReminderScheduleSetValue=e=>{this.edit({expiring_soon_payment_reminder_schedule:e.map((({value:e})=>e)).join()})},this.__reminderEmailScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reminder_email_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,r)=>!isNaN(e)&&r.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reminderEmailScheduleSetValue=e=>{this.edit({reminder_email_schedule:e.map((({value:e})=>e)).join()})},this.__reattemptScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reattempt_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,r)=>!isNaN(e)&&r.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reattemptScheduleSetValue=e=>{this.edit({reattempt_schedule:e.map((({value:e})=>e)).join()})},this.__getReattemptBypassStringsValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reattempt_bypass_strings)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>e.trim())).filter(((e,t,r)=>e&&r.indexOf(e)===t)).map((e=>({value:e})))},this.__setReattemptBypassStringsValue=e=>{this.edit({reattempt_bypass_strings:e.map((({value:e})=>e)).join()})},this.__reattemptBypassLogicOptions=[{value:"",label:"option_always_reattempt"},{value:"skip_if_exists",label:"option_skip_if_exists"},{value:"reattempt_if_exists",label:"option_reattempt_if_exists"}]}static get v8n(){return[({expiring_soon_payment_reminder_schedule:e})=>!e||e.length<=100||"expiring-soon-payment-reminder-schedule:v8n_too_long",({reattempt_bypass_strings:e})=>!e||e.length<=400||"reattempt-bypass-strings:v8n_too_long",({reminder_email_schedule:e})=>!e||e.length<=100||"reminder-email-schedule:v8n_too_long",({reattempt_schedule:e})=>!e||e.length<=100||"reattempt-schedule:v8n_too_long"]}get hiddenSelector(){const e=["header:copy-id",super.hiddenSelector.toString()];return this.form.reattempt_bypass_logic||e.push("reattempts-group:reattempt-bypass-strings"),new r(e.join(" ").trim())}renderBody(){return i(a||(a=s` ${0} <foxy-internal-summary-control infer="past-due-amount-group"> <foxy-internal-select-control layout="summary-item" infer="past-due-amount-handling" .options="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="automatically-charge-past-due-amount" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="reset-nextdate-on-makeup-payment" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="send-email-receipts-for-automated-billing" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="prevent-customer-cancel-with-past-due" helper-text-as-tooltip> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="reattempts-group"> <foxy-internal-select-control layout="summary-item" infer="reattempt-bypass-logic" .options="${0}"> </foxy-internal-select-control> <foxy-internal-editable-list-control layout="summary-item" infer="reattempt-bypass-strings" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control layout="summary-item" infer="reattempt-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="emails-group"> <foxy-internal-editable-list-control layout="summary-item" infer="reminder-email-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control layout="summary-item" infer="expiring-soon-payment-reminder-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="modification-group"> <foxy-internal-text-control layout="summary-item" infer="modification-url"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="cancellation-group"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="cancellation-schedule" step="1" min="1"> </foxy-internal-number-control> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.__pastDueAmountHandlingOptions,this.__reattemptBypassLogicOptions,this.__getReattemptBypassStringsValue,this.__setReattemptBypassStringsValue,this.__positiveIntegerInputParams,this.__reattemptScheduleGetValue,this.__reattemptScheduleSetValue,this.__positiveIntegerInputParams,this.__reminderEmailScheduleGetValue,this.__reminderEmailScheduleSetValue,this.__positiveIntegerInputParams,this.__expiringSoonPaymentReminderScheduleGetValue,this.__expiringSoonPaymentReminderScheduleSetValue,this.__cancellationScheduleSuffix,super.renderBody())}get __cancellationScheduleSuffix(){const e=this.form.cancellation_schedule;return e?this.t("day_suffix",{count:e}):""}}customElements.define("foxy-subscription-settings-form",n);export{n as SubscriptionSettingsForm};
1
+ import"./shared-5960c279.js";import"./shared-56d91134.js";import"./shared-e653b80e.js";import"./shared-eb086cef.js";import"./shared-0e1ad508.js";import"./shared-076f086a.js";import{I as e}from"./shared-7995cbcf.js";import{a as t}from"./shared-1ce5b073.js";import{B as r}from"./shared-cb58dfcd.js";import{h as i}from"./shared-ba5c42c7.js";import"./shared-127ec8a7.js";import"./shared-a3a4c368.js";import"./shared-500b7eb7.js";import"./shared-7b3aac7e.js";import"./shared-0995ae7c.js";import"./shared-16ae74b2.js";import"./shared-677953e0.js";import"./shared-5212ef4f.js";import"./shared-70380f94.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-5c057c26.js";import"./shared-20fb2969.js";import"./shared-986d0f7f.js";import"./shared-292dcee0.js";import"./shared-0662adb7.js";import"./shared-76cbea00.js";import"./shared-651c44fa.js";import"./shared-d2304d50.js";import"./shared-4ded48ee.js";import"./shared-92153a7f.js";import"./shared-68a5368a.js";import"./shared-c365c1ae.js";import"./shared-f28e46bf.js";import"./shared-6b3b8c63.js";import"./shared-1f6366c0.js";import"./shared-a4ca1c5d.js";import"./foxy-copy-to-clipboard.js";import"./shared-75e7361d.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,s=e=>e;const o=t(e,"subscription-settings-form");class n extends o{constructor(){super(...arguments),this.__pastDueAmountHandlingOptions=[{label:"option_increment",value:"increment"},{label:"option_replace",value:"replace"}],this.__positiveIntegerInputParams={type:"number",step:"1",min:"0"},this.__expiringSoonPaymentReminderScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.expiring_soon_payment_reminder_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,r)=>!isNaN(e)&&r.indexOf(e)===t)).sort(((e,t)=>t-e)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__expiringSoonPaymentReminderScheduleSetValue=e=>{this.edit({expiring_soon_payment_reminder_schedule:e.map((({value:e})=>e)).join()})},this.__reminderEmailScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reminder_email_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,r)=>!isNaN(e)&&r.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reminderEmailScheduleSetValue=e=>{this.edit({reminder_email_schedule:e.map((({value:e})=>e)).join()})},this.__reattemptScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reattempt_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,r)=>!isNaN(e)&&r.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reattemptScheduleSetValue=e=>{this.edit({reattempt_schedule:e.map((({value:e})=>e)).join()})},this.__getReattemptBypassStringsValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reattempt_bypass_strings)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>e.trim())).filter(((e,t,r)=>e&&r.indexOf(e)===t)).map((e=>({value:e})))},this.__setReattemptBypassStringsValue=e=>{this.edit({reattempt_bypass_strings:e.map((({value:e})=>e)).join()})},this.__reattemptBypassLogicOptions=[{value:"",label:"option_always_reattempt"},{value:"skip_if_exists",label:"option_skip_if_exists"},{value:"reattempt_if_exists",label:"option_reattempt_if_exists"}]}static get v8n(){return[({expiring_soon_payment_reminder_schedule:e})=>!e||e.length<=100||"expiring-soon-payment-reminder-schedule:v8n_too_long",({reattempt_bypass_strings:e})=>!e||e.length<=400||"reattempt-bypass-strings:v8n_too_long",({reminder_email_schedule:e})=>!e||e.length<=100||"reminder-email-schedule:v8n_too_long",({reattempt_schedule:e})=>!e||e.length<=100||"reattempt-schedule:v8n_too_long"]}get hiddenSelector(){const e=["header:copy-id",super.hiddenSelector.toString()];return this.form.reattempt_bypass_logic||e.push("reattempts-group:reattempt-bypass-strings"),new r(e.join(" ").trim())}renderBody(){return i(a||(a=s` ${0} <foxy-internal-summary-control infer="past-due-amount-group"> <foxy-internal-select-control layout="summary-item" infer="past-due-amount-handling" .options="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="automatically-charge-past-due-amount" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="reset-nextdate-on-makeup-payment" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="send-email-receipts-for-automated-billing" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="prevent-customer-cancel-with-past-due" helper-text-as-tooltip> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="reattempts-group"> <foxy-internal-select-control layout="summary-item" infer="reattempt-bypass-logic" .options="${0}"> </foxy-internal-select-control> <foxy-internal-editable-list-control layout="summary-item" infer="reattempt-bypass-strings" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control layout="summary-item" infer="reattempt-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="emails-group"> <foxy-internal-editable-list-control layout="summary-item" infer="reminder-email-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control layout="summary-item" infer="expiring-soon-payment-reminder-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="modification-group"> <foxy-internal-text-control layout="summary-item" infer="modification-url"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="cancellation-group"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="cancellation-schedule" step="1" min="1"> </foxy-internal-number-control> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.__pastDueAmountHandlingOptions,this.__reattemptBypassLogicOptions,this.__getReattemptBypassStringsValue,this.__setReattemptBypassStringsValue,this.__positiveIntegerInputParams,this.__reattemptScheduleGetValue,this.__reattemptScheduleSetValue,this.__positiveIntegerInputParams,this.__reminderEmailScheduleGetValue,this.__reminderEmailScheduleSetValue,this.__positiveIntegerInputParams,this.__expiringSoonPaymentReminderScheduleGetValue,this.__expiringSoonPaymentReminderScheduleSetValue,this.__cancellationScheduleSuffix,super.renderBody())}get __cancellationScheduleSuffix(){const e=this.form.cancellation_schedule;return e?this.t("day_suffix",{count:e}):""}}customElements.define("foxy-subscription-settings-form",n);export{n as SubscriptionSettingsForm};
@@ -1 +1 @@
1
- import"./shared-bfdbe217.js";import"./shared-ef98e595.js";import"./shared-c92d72ba.js";import"./shared-bf5b2106.js";import"./shared-6286efb1.js";import"./shared-f15af5d1.js";import{I as e}from"./shared-0643656a.js";import"./foxy-native-integration-card.js";import"./foxy-nucleon-element.js";import{_ as t,B as r}from"./shared-cb58dfcd.js";import{a as o}from"./shared-1ce5b073.js";import{i}from"./shared-53e42a77.js";import{h as n}from"./shared-ba5c42c7.js";import"./shared-7b3aac7e.js";import"./shared-a3a4c368.js";import"./shared-0995ae7c.js";import"./shared-500b7eb7.js";import"./shared-42c91940.js";import"./shared-68a5368a.js";import"./shared-20fb2969.js";import"./shared-986d0f7f.js";import"./shared-292dcee0.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-75e7361d.js";import"./shared-70380f94.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-1f6366c0.js";import"./shared-a4ca1c5d.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-cc5e4c06.js";import"./shared-5212ef4f.js";import"./shared-6b3b8c63.js";import"./shared-76cbea00.js";import"./shared-d2304d50.js";import"./shared-4ded48ee.js";import"./shared-92153a7f.js";import"./shared-5c057c26.js";import"./shared-0662adb7.js";import"./shared-651c44fa.js";import"./shared-c365c1ae.js";import"./shared-f28e46bf.js";import"./shared-127ec8a7.js";import"./shared-16ae74b2.js";import"./shared-d0aed1c1.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-7a4ca3f1.js";import"./shared-253e51f7.js";let s,a=e=>e;const l=o(e,"tax-form"),u=["US","CA","AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IM","IT","LT","LU","LV","MC","MT","NL","PL","PT","RO","SE","SI","SK"],d=[...u,"AU"];class c extends l{constructor(){super(...arguments),this.nativeIntegrations=null,this.countries=null,this.regions=null,this.__countrySetValue=e=>{this.edit({country:e,region:"",city:""}),this.edit({apply_to_shipping:this.__isApplyToShippingHidden})},this.__regionSetValue=e=>{this.edit({region:e,city:""})},this.__typeSetValue=e=>{this.edit({type:e,country:"",region:"",city:"",service_provider:"custom_tax_endpoint"===e?"custom_tax":"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})},this.__typeOptions=JSON.stringify([{label:"option_custom_tax_endpoint",value:"custom_tax_endpoint"},{label:"option_global",value:"global"},{label:"option_union",value:"union"},{label:"option_country",value:"country"},{label:"option_region",value:"region"},{label:"option_local",value:"local"}])}static get properties(){return t(t({},super.properties),{},{nativeIntegrations:{attribute:"native-integrations"},countries:{},regions:{}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=30||"name:v8n_too_long",({country:e,type:t})=>"country"!==t||!!e||"country:v8n_required",({country:e,type:t})=>"region"!==t||!!e||"country:v8n_required",({country:e,use_origin_rates:t})=>!t||!!e||"country:v8n_required",({region:e,type:t})=>"region"!=t||!!e||"region:v8n_required",({region:e})=>!e||e.length<=20||"region:v8n_too_long",({city:e})=>!e||e.length<=50||"city:v8n_too_long",({city:e,type:t})=>"local"!=t||!!e||"city:v8n_required",({rate:e,type:t,is_live:r})=>void 0===e||e>0||"custom_tax_endpoint"===t||void 0===t||r||"rate:v8n_invalid"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return e.unshift("native-integrations"),new r(e.join(" ").trim())}get hiddenSelector(){var e,t,o;const i=[super.hiddenSelector.toString()],n=this.form.type;"global"===n||"custom_tax_endpoint"===n?(i.unshift("group-one:is-live","group-one:service-provider"),"custom_tax_endpoint"===n&&i.unshift("group-one:rate")):this.form.is_live?i.unshift("group-one:rate"):i.unshift("group-one:service-provider"),void 0===this.__nativeIntegrationsUrl&&i.unshift("native-integrations"),this.__isCountryHidden&&i.unshift("group-three:country"),this.__isRegionHidden&&i.unshift("group-three:region-select","group-three:region-input"),this.__isCityHidden&&i.unshift("group-three:city"),this.__isApplyToShippingHidden&&i.unshift("group-two:apply-to-shipping"),this.__isUseOriginRatesHidden&&i.unshift("group-two:use-origin-rates"),this.__isExemptAllCustomerTaxIdsHidden&&i.unshift("group-two:exempt-all-customer-tax-ids");const s=Object.values(null!==(o=null===(t=null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==o?o:{});return i.unshift("group-three:region-"+(s.length?"input":"select")),new r(i.join(" ").trim())}renderBody(){var e,t,r,o,l,u,d;const c=Object.values(null!==(r=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.cc2}))),p=Object.values(null!==(u=null===(l=null===(o=this.__regionsLoader)||void 0===o?void 0:o.data)||void 0===l?void 0:l.values)&&void 0!==u?u:{}).map((e=>({rawLabel:e.default,value:e.code})));return n(s||(s=a` ${0} <foxy-internal-summary-control infer="group-one"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> <foxy-internal-select-control options="${0}" layout="summary-item" infer="type" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="is-live"></foxy-internal-switch-control> <foxy-internal-select-control options="${0}" layout="summary-item" infer="service-provider"> </foxy-internal-select-control> <foxy-internal-number-control layout="summary-item" suffix="%" infer="rate" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="native-integrations" first="${0}" item="foxy-native-integration-card"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="group-two"> <foxy-internal-switch-control infer="exempt-all-customer-tax-ids"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="apply-to-shipping"></foxy-internal-switch-control> <foxy-internal-switch-control infer="use-origin-rates"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="group-three"> <foxy-internal-select-control options="${0}" layout="summary-item" infer="country" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-select-control property="region" options="${0}" layout="summary-item" infer="region-select" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-text-control property="region" layout="summary-item" infer="region-input" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="city"></foxy-internal-text-control> </foxy-internal-summary-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" class="hidden" href="${0}" id="regionsLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__typeOptions,this.__typeSetValue,JSON.stringify(this.__serviceProviderOptions),i(this.__nativeIntegrationsUrl),JSON.stringify(c),this.__countrySetValue,JSON.stringify(p),this.__regionSetValue,this.__regionSetValue,super.renderBody(),i(null!==(d=this.countries)&&void 0!==d?d:void 0),(()=>this.requestUpdate()),i(this.__regionsUrl),(()=>this.requestUpdate()))}get __serviceProviderOptions(){const e=[{label:"option_avalara",value:"avalara"},{label:"option_onesource",value:"onesource"}];return"union"!==this.form.type&&this.form.country&&!u.includes(this.form.country)||e.unshift({label:"option_default",value:""}),"union"!==this.form.type&&this.form.country&&!d.includes(this.form.country)||e.push({label:"option_taxjar",value:"taxjar"}),e}get __nativeIntegrationsUrl(){var e;try{const t=new URL(null!==(e=this.nativeIntegrations)&&void 0!==e?e:""),r=this.form.service_provider;if(r)return t.searchParams.set("provider",r),t.toString()}catch(e){}}get __regionsUrl(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),r=this.form.country;return r&&t.searchParams.set("country_code",r),t.toString()}catch(e){}}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get __regionsLoader(){return this.renderRoot.querySelector("#regionsLoader")}get __isExemptAllCustomerTaxIdsHidden(){const e=this.form.type;if("custom_tax_endpoint"===e)return!0;if("country"===e||"region"===e||"local"===e)return!!this.form.is_live;const t=this.form.service_provider;return!t||"onesource"===t||"avalara"===t||"taxjar"===t}get __isApplyToShippingHidden(){const e=this.form.type;return!e||"custom_tax_endpoint"===e||"union"!==e&&(!("country"!==e||!this.form.is_live)||(!("region"!==e||!this.form.is_live)||!!this.form.is_live&&u.includes(this.form.country)))}get __isUseOriginRatesHidden(){return"union"!==this.form.type||!this.form.is_live||!!this.form.service_provider}get __isCountryHidden(){return"union"===this.form.type?(!this.form.service_provider||this.form.is_live)&&!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type)}get __isRegionHidden(){return"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return"local"!==this.form.type}}customElements.define("foxy-tax-form",c);export{c as TaxForm};
1
+ import"./shared-7f5f6657.js";import"./shared-56d91134.js";import"./shared-eb086cef.js";import"./shared-e653b80e.js";import"./shared-0e1ad508.js";import"./shared-076f086a.js";import{I as e}from"./shared-7995cbcf.js";import"./foxy-native-integration-card.js";import"./foxy-nucleon-element.js";import{_ as t,B as r}from"./shared-cb58dfcd.js";import{a as o}from"./shared-1ce5b073.js";import{i}from"./shared-53e42a77.js";import{h as n}from"./shared-ba5c42c7.js";import"./shared-7b3aac7e.js";import"./shared-a3a4c368.js";import"./shared-0995ae7c.js";import"./shared-500b7eb7.js";import"./shared-42c91940.js";import"./shared-68a5368a.js";import"./shared-20fb2969.js";import"./shared-986d0f7f.js";import"./shared-292dcee0.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-75e7361d.js";import"./shared-70380f94.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-1f6366c0.js";import"./shared-a4ca1c5d.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-677953e0.js";import"./shared-5212ef4f.js";import"./shared-6b3b8c63.js";import"./shared-76cbea00.js";import"./shared-d2304d50.js";import"./shared-4ded48ee.js";import"./shared-92153a7f.js";import"./shared-5c057c26.js";import"./shared-0662adb7.js";import"./shared-651c44fa.js";import"./shared-c365c1ae.js";import"./shared-f28e46bf.js";import"./shared-127ec8a7.js";import"./shared-16ae74b2.js";import"./shared-d0aed1c1.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-7a4ca3f1.js";import"./shared-253e51f7.js";let s,a=e=>e;const l=o(e,"tax-form"),u=["US","CA","AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IM","IT","LT","LU","LV","MC","MT","NL","PL","PT","RO","SE","SI","SK"],d=[...u,"AU"];class c extends l{constructor(){super(...arguments),this.nativeIntegrations=null,this.countries=null,this.regions=null,this.__countrySetValue=e=>{this.edit({country:e,region:"",city:""}),this.edit({apply_to_shipping:this.__isApplyToShippingHidden})},this.__regionSetValue=e=>{this.edit({region:e,city:""})},this.__typeSetValue=e=>{this.edit({type:e,country:"",region:"",city:"",service_provider:"custom_tax_endpoint"===e?"custom_tax":"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})},this.__typeOptions=JSON.stringify([{label:"option_custom_tax_endpoint",value:"custom_tax_endpoint"},{label:"option_global",value:"global"},{label:"option_union",value:"union"},{label:"option_country",value:"country"},{label:"option_region",value:"region"},{label:"option_local",value:"local"}])}static get properties(){return t(t({},super.properties),{},{nativeIntegrations:{attribute:"native-integrations"},countries:{},regions:{}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=30||"name:v8n_too_long",({country:e,type:t})=>"country"!==t||!!e||"country:v8n_required",({country:e,type:t})=>"region"!==t||!!e||"country:v8n_required",({country:e,use_origin_rates:t})=>!t||!!e||"country:v8n_required",({region:e,type:t})=>"region"!=t||!!e||"region:v8n_required",({region:e})=>!e||e.length<=20||"region:v8n_too_long",({city:e})=>!e||e.length<=50||"city:v8n_too_long",({city:e,type:t})=>"local"!=t||!!e||"city:v8n_required",({rate:e,type:t,is_live:r})=>void 0===e||e>0||"custom_tax_endpoint"===t||void 0===t||r||"rate:v8n_invalid"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return e.unshift("native-integrations"),new r(e.join(" ").trim())}get hiddenSelector(){var e,t,o;const i=[super.hiddenSelector.toString()],n=this.form.type;"global"===n||"custom_tax_endpoint"===n?(i.unshift("group-one:is-live","group-one:service-provider"),"custom_tax_endpoint"===n&&i.unshift("group-one:rate")):this.form.is_live?i.unshift("group-one:rate"):i.unshift("group-one:service-provider"),void 0===this.__nativeIntegrationsUrl&&i.unshift("native-integrations"),this.__isCountryHidden&&i.unshift("group-three:country"),this.__isRegionHidden&&i.unshift("group-three:region-select","group-three:region-input"),this.__isCityHidden&&i.unshift("group-three:city"),this.__isApplyToShippingHidden&&i.unshift("group-two:apply-to-shipping"),this.__isUseOriginRatesHidden&&i.unshift("group-two:use-origin-rates"),this.__isExemptAllCustomerTaxIdsHidden&&i.unshift("group-two:exempt-all-customer-tax-ids");const s=Object.values(null!==(o=null===(t=null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==o?o:{});return i.unshift("group-three:region-"+(s.length?"input":"select")),new r(i.join(" ").trim())}renderBody(){var e,t,r,o,l,u,d;const c=Object.values(null!==(r=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.cc2}))),p=Object.values(null!==(u=null===(l=null===(o=this.__regionsLoader)||void 0===o?void 0:o.data)||void 0===l?void 0:l.values)&&void 0!==u?u:{}).map((e=>({rawLabel:e.default,value:e.code})));return n(s||(s=a` ${0} <foxy-internal-summary-control infer="group-one"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> <foxy-internal-select-control options="${0}" layout="summary-item" infer="type" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="is-live"></foxy-internal-switch-control> <foxy-internal-select-control options="${0}" layout="summary-item" infer="service-provider"> </foxy-internal-select-control> <foxy-internal-number-control layout="summary-item" suffix="%" infer="rate" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="native-integrations" first="${0}" item="foxy-native-integration-card"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="group-two"> <foxy-internal-switch-control infer="exempt-all-customer-tax-ids"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="apply-to-shipping"></foxy-internal-switch-control> <foxy-internal-switch-control infer="use-origin-rates"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="group-three"> <foxy-internal-select-control options="${0}" layout="summary-item" infer="country" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-select-control property="region" options="${0}" layout="summary-item" infer="region-select" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-text-control property="region" layout="summary-item" infer="region-input" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="city"></foxy-internal-text-control> </foxy-internal-summary-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" class="hidden" href="${0}" id="regionsLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__typeOptions,this.__typeSetValue,JSON.stringify(this.__serviceProviderOptions),i(this.__nativeIntegrationsUrl),JSON.stringify(c),this.__countrySetValue,JSON.stringify(p),this.__regionSetValue,this.__regionSetValue,super.renderBody(),i(null!==(d=this.countries)&&void 0!==d?d:void 0),(()=>this.requestUpdate()),i(this.__regionsUrl),(()=>this.requestUpdate()))}get __serviceProviderOptions(){const e=[{label:"option_avalara",value:"avalara"},{label:"option_onesource",value:"onesource"}];return"union"!==this.form.type&&this.form.country&&!u.includes(this.form.country)||e.unshift({label:"option_default",value:""}),"union"!==this.form.type&&this.form.country&&!d.includes(this.form.country)||e.push({label:"option_taxjar",value:"taxjar"}),e}get __nativeIntegrationsUrl(){var e;try{const t=new URL(null!==(e=this.nativeIntegrations)&&void 0!==e?e:""),r=this.form.service_provider;if(r)return t.searchParams.set("provider",r),t.toString()}catch(e){}}get __regionsUrl(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),r=this.form.country;return r&&t.searchParams.set("country_code",r),t.toString()}catch(e){}}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get __regionsLoader(){return this.renderRoot.querySelector("#regionsLoader")}get __isExemptAllCustomerTaxIdsHidden(){const e=this.form.type;if("custom_tax_endpoint"===e)return!0;if("country"===e||"region"===e||"local"===e)return!!this.form.is_live;const t=this.form.service_provider;return!t||"onesource"===t||"avalara"===t||"taxjar"===t}get __isApplyToShippingHidden(){const e=this.form.type;return!e||"custom_tax_endpoint"===e||"union"!==e&&(!("country"!==e||!this.form.is_live)||(!("region"!==e||!this.form.is_live)||!!this.form.is_live&&u.includes(this.form.country)))}get __isUseOriginRatesHidden(){return"union"!==this.form.type||!this.form.is_live||!!this.form.service_provider}get __isCountryHidden(){return"union"===this.form.type?(!this.form.service_provider||this.form.is_live)&&!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type)}get __isRegionHidden(){return"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return"local"!==this.form.type}}customElements.define("foxy-tax-form",c);export{c as TaxForm};
@@ -1 +1 @@
1
- import"./shared-6332db39.js";import"./shared-ef98e595.js";import"./shared-bf5b2106.js";import"./shared-c92d72ba.js";import"./shared-63b647a8.js";import"./shared-f15af5d1.js";import{I as e}from"./shared-0643656a.js";import"./foxy-nucleon-element.js";import"./shared-70380f94.js";import{I as t,a as o}from"./shared-cc5e4c06.js";import{l as n}from"./shared-cf613436.js";import{c as i}from"./shared-4e709717.js";import{h as s,s as r}from"./shared-ba5c42c7.js";import{_ as a,B as l}from"./shared-cb58dfcd.js";import{i as c}from"./shared-53e42a77.js";import{R as u,a as d}from"./shared-1ce5b073.js";import"./shared-127ec8a7.js";import"./shared-a3a4c368.js";import"./shared-500b7eb7.js";import"./shared-7b3aac7e.js";import"./shared-0995ae7c.js";import"./shared-16ae74b2.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-5c057c26.js";import"./shared-20fb2969.js";import"./shared-986d0f7f.js";import"./shared-292dcee0.js";import"./shared-0662adb7.js";import"./shared-76cbea00.js";import"./shared-651c44fa.js";import"./shared-d2304d50.js";import"./shared-4ded48ee.js";import"./shared-92153a7f.js";import"./shared-68a5368a.js";import"./shared-c365c1ae.js";import"./shared-f28e46bf.js";import"./shared-1f6366c0.js";import"./shared-a4ca1c5d.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./foxy-copy-to-clipboard.js";import"./shared-75e7361d.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-f83207fb.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-5212ef4f.js";let p,f,_=e=>e;customElements.define("foxy-internal-template-config-form-supported-cards-control",class extends t{renderControl(){const e={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return s(p||(p=_` <div class="flex flex-wrap -m-xs"> ${0} </div> `),Object.entries(n).map((([t,o])=>{if(!e[t])return;const n=this._value.includes(t);return s(f||(f=_` <div data-testid="${0}" class="${0}"> <label class="${0}"> <div class="h-s">${0}</div> <div class="text-s font-medium mx-s my-auto leading-none">${0}</div> <input type="checkbox" class="sr-only" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> </label> </div> `),t,i({"m-xs rounded":!0,"opacity-50 cursor-default":this.disabled,"cursor-pointer ring-primary-50 focus-within-ring-2":!this.disabled}),i({"overflow-hidden transition-colors flex rounded-s border":!0,"border-primary bg-primary-10 text-primary":n&&!this.readonly,"border-contrast bg-contrast-5 text-secondary":n&&this.readonly,"hover-text-body":n&&!this.disabled&&!this.readonly,"border-contrast-10":!n,"hover-border-primary":!n&&!this.disabled&&!this.readonly,"hover-text-primary":!n&&!this.disabled&&!this.readonly}),o,e[t],this.disabled,this.readonly,n,(e=>{if(this.readonly)return e.preventDefault();e.stopPropagation();const o=[...this._value];e.currentTarget.checked?o.push(t):o.splice(o.indexOf(t),1),this._value=o}))})))}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:[]}set _value(e){super._value=e}});let h,y,g,m,b,x=e=>e;let v,j,w,$,O=e=>e;customElements.define("foxy-internal-template-config-form-filter-values-control-item",class extends o{constructor(){super(...arguments),this.options={},this.regions=[],this.name="",this.code="",this.__newRegion=""}static get properties(){return a(a({},super.properties),{},{__newRegion:{attribute:!1},options:{type:Object},regions:{type:Array},name:{type:String},code:{type:String}})}render(){const e=Object.values(this.options),t=e.filter((e=>!this.regions.includes(e.c)));return s(h||(h=x` <div class="${0}"> <div data-testid="country" class="h-m flex justify-between items-center bg-contrast-5"> <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <span>${0}</span> </div> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> ${0} </div> `),i({"border border-contrast-5 rounded-s font-medium overflow-hidden":!0,"text-disabled":this.disabled}),this.name||this.code,this.t("delete"),i({"mr-xs items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>this.dispatchEvent(new CustomEvent("delete"))),0===e.length?"":s(y||(y=x` <div data-testid="regions" class="flex flex-wrap p-xs text-s"> ${0} ${0} </div> `),this.regions.map((e=>{var t;return s(g||(g=x` <div class="flex items-center rounded-s border border-contrast-10 h-s m-xs"> <span class="mx-s">${0}</span> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),(null===(t=this.options[e])||void 0===t?void 0:t.n)||e,this.t("delete"),i({"items-center justify-center rounded-s transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-primary-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),0===t.length?"":s(m||(m=x` <div data-testid="new-region" class="${0}"> <select class="${0}" ?disabled="${0}" @change="${0}"> <option value="" disabled="disabled" selected="selected">${0}</option> ${0} </select> </div> `),i({"h-s m-xs items-center transition-colors border border-contrast-10 rounded-s":!0,"focus-within-ring-1 ring-primary-50 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),i({"appearance-none bg-transparent h-s text-s px-s font-medium":!0,"transition-colors rounded-s focus-outline-none":!0,"cursor-pointer hover-bg-contrast-5":!this.disabled}),this.disabled,(e=>{const t=e.currentTarget;this.__newRegion=t.value,this.__addRegion(),t.value=""}),this.t("add_region"),t.map((e=>s(b||(b=x`<option value="${0}">${0}</option>`),e.c,e.n))))))}__addRegion(){this.regions=[...new Set([...this.regions,this.__newRegion])],this.__newRegion="",this.dispatchEvent(new CustomEvent("update:regions"))}}),customElements.define("foxy-internal-template-config-form-filter-values-control",class extends t{constructor(){super(...arguments),this.countries=null,this.__newCountry=""}static get properties(){return a(a({},super.properties),{},{__newCountry:{attribute:!1},countries:{}})}renderControl(){var e,t,o,n;const r=Object.values(null!==(o=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==o?o:{}),l=r.filter((e=>!(e.cc2 in this._value)));return s(v||(v=O` <div class="space-y-s" data-testid="countries"> ${0} ${0} </div> <foxy-nucleon infer="" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> `),Object.entries(this._value).map((([e,t])=>{var o;const n=r.find((t=>t.cc2===e));return s(j||(j=O` <foxy-internal-template-config-form-filter-values-control-item regions="${0}" options="${0}" infer="" code="${0}" name="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </foxy-internal-template-config-form-filter-values-control-item> `),JSON.stringify("*"===t?[]:t),JSON.stringify(Array.isArray(null==n?void 0:n.regions)?{}:null!==(o=null==n?void 0:n.regions)&&void 0!==o?o:{}),e,c(null==n?void 0:n.default),this.disabled,this.readonly,(t=>{const o=a({},this._value),n=t.currentTarget.regions;o[e]=n.length?n:"*",this._value=o}),(()=>{const t=a({},this._value);delete t[e],this._value=t}))})),0===l.length&&0!==r.length?"":s(w||(w=O` <div data-testid="new-country" class="${0}"> <select class="${0}" ?disabled="${0}" @change="${0}"> <option value="" disabled="disabled" selected="selected">${0}</option> ${0} </select> </div> `),i({"h-m flex items-center rounded-s transition-colors":!0,"border border-contrast-10 ring-primary-50":!0,"focus-within-ring-1 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),i({"appearance-none bg-transparent h-m text-m px-s flex-1 font-medium":!0,"transition-colors rounded-s focus-outline-none":!0,"cursor-pointer hover-bg-contrast-5":!this.disabled,"text-disabled":this.disabled}),this.disabled,(e=>{const t=e.currentTarget;this.__newCountry=t.value,this.__addCountry(),t.value=""}),this.t("add_country"),l.map((e=>s($||($=O`<option value="${0}">${0}</option>`),e.cc2,e.default)))),c(null!==(n=this.countries)&&void 0!==n?n:void 0),(()=>this.requestUpdate()))}__addCountry(){this._value=a(a({},this._value),{},{[this.__newCountry]:"*"}),this.__newCountry=""}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:{}}set _value(e){super._value=e}});let S,k,J,N,q,F,C,V,T=e=>e;const R=u(d(e,"template-config-form"));class z extends R{constructor(){super(...arguments),this.countries=null,this.regions=null,this.store=null,this.__customCheckoutFieldCouponEntryRequirementsOptions=JSON.stringify([{label:"option_enabled",value:"enabled"},{label:"option_disabled",value:"disabled"}]),this.__customCheckoutFieldRequirementsOptions=JSON.stringify([{label:"option_default",value:"default"},{label:"option_optional",value:"optional"},{label:"option_required",value:"required"},{label:"option_hidden",value:"hidden"}]),this.__tosCheckboxSettingsInitialStateOptions=JSON.stringify([{label:"option_checked",value:"checked"},{label:"option_unchecked",value:"unchecked"}]),this.__locationFilteringFilterTypeOptions=JSON.stringify([{label:"option_blocklist",value:"blacklist"},{label:"option_allowlist",value:"whitelist"}]),this.__foxycompleteShowComboboxOptions=JSON.stringify([{label:"option_combobox",value:"combobox"},{label:"option_search",value:"search"}]),this.__tosCheckboxSettingsUsageOptions=JSON.stringify([{label:"option_none",value:"none"},{label:"option_optional",value:"optional"},{label:"option_required",value:"required"}]),this.__locationFilteringUsageOptions=JSON.stringify([{label:"option_none",value:"none"},{label:"option_shipping",value:"shipping"},{label:"option_billing",value:"billing"},{label:"option_both",value:"both"},{label:"option_independent",value:"independent"}]),this.__cscRequirementsValueOptions=JSON.stringify([{label:"option_all_cards",value:"all_cards"},{label:"option_sso_only",value:"sso_only"},{label:"option_new_cards_only",value:"new_cards_only"}]),this.__checkoutTypeDefaultOptions=JSON.stringify([{label:"option_default_account",value:"default_account"},{label:"option_default_guest",value:"default_guest"}]),this.__checkoutTypeAccountOptions=JSON.stringify([{label:"option_account",value:"account_only"},{label:"option_guest",value:"guest_only"},{label:"option_both",value:"default_guest"}]),this.__cartTypeOptions=JSON.stringify([{label:"option_default",value:"default"},{label:"option_fullpage",value:"fullpage"},{label:"option_custom",value:"custom"}]),this.__locationFilteringFilterValuesSetValue=e=>{const t=this.__formJson,o=a(a({},t.location_filtering),{},{shipping_filter_values:e,billing_filter_values:e});this.edit({json:JSON.stringify(a(a({},t),{},{location_filtering:o}))})},this.__locationFilteringFilterTypeSetValue=e=>{const t=this.__formJson,o=a(a({},t.location_filtering),{},{shipping_filter_type:e,billing_filter_type:e});this.edit({json:JSON.stringify(a(a({},t),{},{location_filtering:o}))})},this.__foxycompleteShowComboboxGetValue=()=>this.__formJson.foxycomplete.show_combobox?"combobox":"search",this.__foxycompleteShowComboboxSetValue=e=>{const t="combobox"===e,o=a(a({},this.__formJson.foxycomplete),{},{show_combobox:t});this.edit({json:JSON.stringify(a(a({},this.__formJson),{},{foxycomplete:o}))})},this.__checkoutTypeAccountGetValue=()=>{const e=this.__formJson;return e.checkout_type.includes("default")?"default_guest":e.checkout_type},this.__customConfigGetValue=()=>{const e=this.__formJson;return"string"==typeof e.custom_config?e.custom_config:JSON.stringify(e.custom_config,null,2)},this.__customConfigSetValue=e=>{const t=this.__formJson;try{t.custom_config=JSON.parse(e)}catch(o){t.custom_config=e}this.edit({json:JSON.stringify(t)})},this.__defaultJSON=JSON.stringify({cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},google_tag:{usage:"none",send_to:"",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}})}static get properties(){return a(a({},super.properties),{},{countries:{},regions:{},store:{}})}get hiddenSelector(){var e,t;const o=[super.hiddenSelector.toString()],n=this.__dataJson,i=this.__formJson,s=i.location_filtering.usage,r=i.checkout_type;return"required"!==i.cart_display_config.usage&&o.unshift("cart-group-two","cart-group-three","cart-group-four"),"required"!==i.foxycomplete.usage&&o.unshift("country-and-region-group-one:foxycomplete-show-combobox","country-and-region-group-one:foxycomplete-combobox-open","country-and-region-group-one:foxycomplete-combobox-close","country-and-region-group-one:foxycomplete-show-flags"),!1===i.foxycomplete.show_combobox&&o.unshift("country-and-region-group-one:foxycomplete-combobox-open","country-and-region-group-one:foxycomplete-combobox-close"),"both"!==s&&o.unshift("country-and-region-group-two"),"shipping"!==s&&"independent"!==s&&o.unshift("country-and-region-group-three"),"billing"!==s&&"independent"!==s&&o.unshift("country-and-region-group-four"),"default_account"!==r&&"default_guest"!==r&&o.unshift("customer-accounts:checkout-type-default"),"none"===i.tos_checkbox_settings.usage&&o.unshift("consent-group-one:tos-checkbox-settings-url","consent-group-one:tos-checkbox-settings-initial-state","consent-group-one:tos-checkbox-settings-is-hidden"),"required"!==i.analytics_config.usage&&o.unshift("analytics-config-google-analytics","analytics-config-google-tag"),"required"!==(null==n?void 0:n.analytics_config.google_analytics.usage)&&o.unshift("analytics-config-google-analytics"),"required"!==i.analytics_config.google_analytics.usage&&o.unshift("analytics-config-google-analytics:analytics-config-google-analytics-account-id","analytics-config-google-analytics:analytics-config-google-analytics-include-on-site"),"required"!==i.analytics_config.google_tag.usage&&(o.unshift("analytics-config-google-tag:analytics-config-google-tag-account-id"),o.unshift("analytics-config-google-tag:analytics-config-google-tag-send-to")),!0!==(null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.features_multiship)&&o.unshift("custom-script-values-multiship-checkout-fields"),new l(o.join(" ").trim())}renderBody(){var e,t,o,n,i;const a=[["billing_address1","billing_address2","billing_city","billing_region","billing_postal_code","billing_country"],["billing_first_name","billing_last_name","billing_company","billing_tax_id","billing_phone","coupon_entry"]],l=[["show_product_weight","show_product_category","show_product_code","show_product_options"],["show_sub_frequency","show_sub_startdate","show_sub_nextdate","show_sub_enddate"]];return s(S||(S=T` ${0} <foxy-internal-summary-control infer="cart-group-one"> <foxy-internal-select-control json-template="${0}" json-path="cart_type" property="json" options="${0}" layout="summary-item" infer="cart-type"> </foxy-internal-select-control> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="cart_display_config.usage" property="json" infer="cart-display-config-usage" invert> </foxy-internal-switch-control> </foxy-internal-summary-control> <div class="grid sm-grid-cols-2 gap-m" ?hidden="${0}"> ${0} </div> <foxy-internal-summary-control infer="cart-group-four"> <foxy-internal-editable-list-control json-template="${0}" json-path="cart_display_config.hidden_product_options" property="json" layout="summary-item" infer="cart-display-config-hidden-product-options" simple-value> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-one"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="foxycomplete.usage" property="json" infer="foxycomplete-usage"> </foxy-internal-switch-control> <foxy-internal-select-control options="${0}" layout="summary-item" infer="foxycomplete-show-combobox" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-text-control json-template="${0}" json-path="foxycomplete.combobox_open" property="json" layout="summary-item" infer="foxycomplete-combobox-open"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="foxycomplete.combobox_close" property="json" layout="summary-item" infer="foxycomplete-combobox-close"> </foxy-internal-text-control> <foxy-internal-switch-control json-template="${0}" json-path="foxycomplete.show_flags" property="json" infer="foxycomplete-show-flags"> </foxy-internal-switch-control> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="enabled" json-path="postal_code_lookup.usage" property="json" infer="postal-code-lookup"> </foxy-internal-switch-control> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.usage" property="json" options="${0}" layout="summary-item" infer="location-filtering-usage"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-two"> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.shipping_filter_type" property="json" options="${0}" layout="summary-item" infer="location-filtering-filter-type" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-template-config-form-filter-values-control json-template="${0}" json-path="location_filtering.shipping_filter_values" countries="${0}" property="json" infer="location-filtering-filter-values" .setValue="${0}"> </foxy-internal-template-config-form-filter-values-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-three"> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.shipping_filter_type" property="json" options="${0}" layout="summary-item" infer="location-filtering-shipping-filter-type"> </foxy-internal-select-control> <foxy-internal-template-config-form-filter-values-control json-template="${0}" json-path="location_filtering.shipping_filter_values" countries="${0}" property="json" infer="location-filtering-shipping-filter-values"> </foxy-internal-template-config-form-filter-values-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-four"> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.billing_filter_type" property="json" options="${0}" layout="summary-item" infer="location-filtering-billing-filter-type"> </foxy-internal-select-control> <foxy-internal-template-config-form-filter-values-control json-template="${0}" json-path="location_filtering.billing_filter_values" countries="${0}" property="json" infer="location-filtering-billing-filter-values"> </foxy-internal-template-config-form-filter-values-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="customer-accounts"> <foxy-internal-select-control json-template="${0}" json-path="checkout_type" property="json" options="${0}" layout="summary-item" infer="checkout-type-account" .getValue="${0}"> </foxy-internal-select-control> <foxy-internal-select-control json-template="${0}" json-path="checkout_type" property="json" options="${0}" layout="summary-item" infer="checkout-type-default"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="consent-group-one"> <foxy-internal-select-control json-template="${0}" json-path="tos_checkbox_settings.usage" property="json" options="${0}" layout="summary-item" infer="tos-checkbox-settings-usage"> </foxy-internal-select-control> <foxy-internal-text-control json-template="${0}" json-path="tos_checkbox_settings.url" property="json" layout="summary-item" infer="tos-checkbox-settings-url"> </foxy-internal-text-control> <foxy-internal-select-control json-template="${0}" json-path="tos_checkbox_settings.initial_state" property="json" options="${0}" layout="summary-item" infer="tos-checkbox-settings-initial-state"> </foxy-internal-select-control> <foxy-internal-switch-control json-template="${0}" json-path="tos_checkbox_settings.is_hidden" property="json" infer="tos-checkbox-settings-is-hidden"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="consent-group-two"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="eu_secure_data_transfer_consent.usage" property="json" infer="eu-secure-data-transfer-consent-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="consent-group-three"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="newsletter_subscribe.usage" property="json" infer="newsletter-subscribe-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="supported-cards-group"> <foxy-internal-template-config-form-supported-cards-control json-template="${0}" json-path="supported_payment_cards" property="json" infer="supported-payment-cards"> </foxy-internal-template-config-form-supported-cards-control> <p class="flex items-start gap-s"> ${0} <foxy-i18n infer="" key="disclaimer"></foxy-i18n> </p> </foxy-internal-summary-control> <foxy-internal-summary-control infer="csc-requirements-group"> <foxy-internal-select-control json-template="${0}" json-path="csc_requirements" property="json" options="${0}" layout="summary-item" infer="csc-requirements"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout-fields-group-one"> <foxy-internal-switch-control json-template="${0}" false-alias="disabled" true-alias="enabled" json-path="custom_checkout_field_requirements.cart_controls" property="json" infer="custom-checkout-field-requirements-cart-controls"> </foxy-internal-switch-control> </foxy-internal-summary-control> <div class="grid sm-grid-cols-2 gap-m" ?hidden="${0}"> ${0} </div> <foxy-internal-summary-control infer="analytics-config"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="analytics_config.usage" property="json" infer="analytics-config-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="analytics-config-google-analytics"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="analytics_config.google_analytics.usage" property="json" infer="analytics-config-google-analytics-usage"> </foxy-internal-switch-control> <foxy-internal-text-control json-template="${0}" json-path="analytics_config.google_analytics.account_id" property="json" layout="summary-item" infer="analytics-config-google-analytics-account-id"> </foxy-internal-text-control> <foxy-internal-switch-control json-template="${0}" json-path="analytics_config.google_analytics.include_on_site" property="json" infer="analytics-config-google-analytics-include-on-site"> </foxy-internal-switch-control> <p class="flex items-start gap-s bg-error-10 text-error"> ${0} <foxy-i18n infer="" key="deprecation_notice"></foxy-i18n> </p> </foxy-internal-summary-control> <foxy-internal-summary-control infer="analytics-config-google-tag"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="analytics_config.google_tag.usage" property="json" infer="analytics-config-google-tag-usage"> </foxy-internal-switch-control> <foxy-internal-text-control json-template="${0}" json-path="analytics_config.google_tag.account_id" property="json" layout="summary-item" infer="analytics-config-google-tag-account-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="analytics_config.google_tag.send_to" property="json" layout="summary-item" infer="analytics-config-google-tag-send-to"> </foxy-internal-text-control> <p class="flex items-start gap-s"> ${0} <span> <foxy-i18n infer="" key="usage_notice"></foxy-i18n> <br> <a target="_blank" class="cursor-pointer group text-primary rounded-s font-medium focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://wiki.foxycart.com/v/2.0/analytics#google_tag_ga4_google_ads" rel="nofollow noreferrer noopener"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="docs_link"> </foxy-i18n> </a> </span> </p> </foxy-internal-summary-control> <foxy-internal-summary-control infer="debug"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="debug.usage" property="json" infer="debug-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-source-control infer="custom-config" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.header" property="json" infer="custom-script-values-header"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.checkout_fields" property="json" infer="custom-script-values-checkout-fields"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.multiship_checkout_fields" property="json" infer="custom-script-values-multiship-checkout-fields"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.footer" property="json" infer="custom-script-values-footer"> </foxy-internal-source-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__defaultJSON,this.__cartTypeOptions,this.__defaultJSON,l.every(((e,t)=>e.every((e=>{const o=`cart-group-${0===t?"two":"three"}:cart-display-config-${e.replace(/_/g,"-")}`;return this.hiddenSelector.matches(o,!0)})))),l.map(((e,t)=>s(k||(k=T` <foxy-internal-summary-control infer="cart-group-${0}"> ${0} </foxy-internal-summary-control> `),0===t?"two":"three",e.map((e=>s(J||(J=T` <foxy-internal-switch-control json-template="${0}" json-path="cart_display_config.${0}" property="json" infer="cart-display-config-${0}"> </foxy-internal-switch-control> `),this.__defaultJSON,e,e.replace(/_/g,"-"))))))),this.__defaultJSON,this.__defaultJSON,this.__foxycompleteShowComboboxOptions,this.__foxycompleteShowComboboxGetValue,this.__foxycompleteShowComboboxSetValue,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__locationFilteringUsageOptions,this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__locationFilteringFilterTypeSetValue,this.__defaultJSON,c(null!==(e=this.countries)&&void 0!==e?e:void 0),this.__locationFilteringFilterValuesSetValue,this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__defaultJSON,c(null!==(t=this.countries)&&void 0!==t?t:void 0),this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__defaultJSON,c(null!==(o=this.countries)&&void 0!==o?o:void 0),this.__defaultJSON,this.__checkoutTypeAccountOptions,this.__checkoutTypeAccountGetValue,this.__defaultJSON,this.__checkoutTypeDefaultOptions,this.__defaultJSON,this.__tosCheckboxSettingsUsageOptions,this.__defaultJSON,this.__defaultJSON,this.__tosCheckboxSettingsInitialStateOptions,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,r(N||(N=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),this.__defaultJSON,this.__cscRequirementsValueOptions,this.__defaultJSON,a.every(((e,t)=>e.every((e=>{const o=`checkout-fields-group-${0===t?"two":"three"}:custom-checkout-field-requirements-${e.replace(/_/g,"-").replace("1","-one").replace("2","-two")}`;return this.hiddenSelector.matches(o,!0)})))),a.map(((e,t)=>s(q||(q=T` <foxy-internal-summary-control infer="checkout-fields-group-${0}"> ${0} </foxy-internal-summary-control> `),0===t?"two":"three",e.map((e=>{const t=e.replace(/_/g,"-").replace("1","-one").replace("2","-two"),o=`custom_checkout_field_requirements.${e}`;return s(F||(F=T` <foxy-internal-select-control json-template="${0}" json-path="${0}" property="json" options="${0}" layout="summary-item" infer="custom-checkout-field-requirements-${0}"> </foxy-internal-select-control> `),this.__defaultJSON,o,"coupon_entry"===e?this.__customCheckoutFieldCouponEntryRequirementsOptions:this.__customCheckoutFieldRequirementsOptions,t)}))))),this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,r(C||(C=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,r(V||(V=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),this.__defaultJSON,this.__customConfigGetValue,this.__customConfigSetValue,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,super.renderBody(),c(null!==(n=this.store)&&void 0!==n?n:null===(i=this.data)||void 0===i?void 0:i._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}get __formJson(){return this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},google_tag:{usage:"none",send_to:"",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}}}get __dataJson(){var e;return(null===(e=this.data)||void 0===e?void 0:e.json)?JSON.parse(this.data.json):null}}customElements.define("foxy-template-config-form",z);export{z as TemplateConfigForm};
1
+ import"./shared-5960c279.js";import"./shared-56d91134.js";import"./shared-e653b80e.js";import"./shared-eb086cef.js";import"./shared-2a5d1cdf.js";import"./shared-076f086a.js";import{I as e}from"./shared-7995cbcf.js";import"./foxy-nucleon-element.js";import"./shared-70380f94.js";import{I as t,a as o}from"./shared-677953e0.js";import{l as n}from"./shared-cf613436.js";import{c as i}from"./shared-4e709717.js";import{h as s,s as r}from"./shared-ba5c42c7.js";import{_ as a,B as l}from"./shared-cb58dfcd.js";import{i as c}from"./shared-53e42a77.js";import{R as u,a as d}from"./shared-1ce5b073.js";import"./shared-127ec8a7.js";import"./shared-a3a4c368.js";import"./shared-500b7eb7.js";import"./shared-7b3aac7e.js";import"./shared-0995ae7c.js";import"./shared-16ae74b2.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-5c057c26.js";import"./shared-20fb2969.js";import"./shared-986d0f7f.js";import"./shared-292dcee0.js";import"./shared-0662adb7.js";import"./shared-76cbea00.js";import"./shared-651c44fa.js";import"./shared-d2304d50.js";import"./shared-4ded48ee.js";import"./shared-92153a7f.js";import"./shared-68a5368a.js";import"./shared-c365c1ae.js";import"./shared-f28e46bf.js";import"./shared-1f6366c0.js";import"./shared-a4ca1c5d.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./foxy-copy-to-clipboard.js";import"./shared-75e7361d.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-f83207fb.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-5212ef4f.js";let p,f,_=e=>e;customElements.define("foxy-internal-template-config-form-supported-cards-control",class extends t{renderControl(){const e={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return s(p||(p=_` <div class="flex flex-wrap -m-xs"> ${0} </div> `),Object.entries(n).map((([t,o])=>{if(!e[t])return;const n=this._value.includes(t);return s(f||(f=_` <div data-testid="${0}" class="${0}"> <label class="${0}"> <div class="h-s">${0}</div> <div class="text-s font-medium mx-s my-auto leading-none">${0}</div> <input type="checkbox" class="sr-only" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> </label> </div> `),t,i({"m-xs rounded":!0,"opacity-50 cursor-default":this.disabled,"cursor-pointer ring-primary-50 focus-within-ring-2":!this.disabled}),i({"overflow-hidden transition-colors flex rounded-s border":!0,"border-primary bg-primary-10 text-primary":n&&!this.readonly,"border-contrast bg-contrast-5 text-secondary":n&&this.readonly,"hover-text-body":n&&!this.disabled&&!this.readonly,"border-contrast-10":!n,"hover-border-primary":!n&&!this.disabled&&!this.readonly,"hover-text-primary":!n&&!this.disabled&&!this.readonly}),o,e[t],this.disabled,this.readonly,n,(e=>{if(this.readonly)return e.preventDefault();e.stopPropagation();const o=[...this._value];e.currentTarget.checked?o.push(t):o.splice(o.indexOf(t),1),this._value=o}))})))}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:[]}set _value(e){super._value=e}});let h,y,g,m,b,x=e=>e;let v,j,w,$,O=e=>e;customElements.define("foxy-internal-template-config-form-filter-values-control-item",class extends o{constructor(){super(...arguments),this.options={},this.regions=[],this.name="",this.code="",this.__newRegion=""}static get properties(){return a(a({},super.properties),{},{__newRegion:{attribute:!1},options:{type:Object},regions:{type:Array},name:{type:String},code:{type:String}})}render(){const e=Object.values(this.options),t=e.filter((e=>!this.regions.includes(e.c)));return s(h||(h=x` <div class="${0}"> <div data-testid="country" class="h-m flex justify-between items-center bg-contrast-5"> <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <span>${0}</span> </div> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> ${0} </div> `),i({"border border-contrast-5 rounded-s font-medium overflow-hidden":!0,"text-disabled":this.disabled}),this.name||this.code,this.t("delete"),i({"mr-xs items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>this.dispatchEvent(new CustomEvent("delete"))),0===e.length?"":s(y||(y=x` <div data-testid="regions" class="flex flex-wrap p-xs text-s"> ${0} ${0} </div> `),this.regions.map((e=>{var t;return s(g||(g=x` <div class="flex items-center rounded-s border border-contrast-10 h-s m-xs"> <span class="mx-s">${0}</span> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),(null===(t=this.options[e])||void 0===t?void 0:t.n)||e,this.t("delete"),i({"items-center justify-center rounded-s transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-primary-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),0===t.length?"":s(m||(m=x` <div data-testid="new-region" class="${0}"> <select class="${0}" ?disabled="${0}" @change="${0}"> <option value="" disabled="disabled" selected="selected">${0}</option> ${0} </select> </div> `),i({"h-s m-xs items-center transition-colors border border-contrast-10 rounded-s":!0,"focus-within-ring-1 ring-primary-50 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),i({"appearance-none bg-transparent h-s text-s px-s font-medium":!0,"transition-colors rounded-s focus-outline-none":!0,"cursor-pointer hover-bg-contrast-5":!this.disabled}),this.disabled,(e=>{const t=e.currentTarget;this.__newRegion=t.value,this.__addRegion(),t.value=""}),this.t("add_region"),t.map((e=>s(b||(b=x`<option value="${0}">${0}</option>`),e.c,e.n))))))}__addRegion(){this.regions=[...new Set([...this.regions,this.__newRegion])],this.__newRegion="",this.dispatchEvent(new CustomEvent("update:regions"))}}),customElements.define("foxy-internal-template-config-form-filter-values-control",class extends t{constructor(){super(...arguments),this.countries=null,this.__newCountry=""}static get properties(){return a(a({},super.properties),{},{__newCountry:{attribute:!1},countries:{}})}renderControl(){var e,t,o,n;const r=Object.values(null!==(o=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==o?o:{}),l=r.filter((e=>!(e.cc2 in this._value)));return s(v||(v=O` <div class="space-y-s" data-testid="countries"> ${0} ${0} </div> <foxy-nucleon infer="" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> `),Object.entries(this._value).map((([e,t])=>{var o;const n=r.find((t=>t.cc2===e));return s(j||(j=O` <foxy-internal-template-config-form-filter-values-control-item regions="${0}" options="${0}" infer="" code="${0}" name="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </foxy-internal-template-config-form-filter-values-control-item> `),JSON.stringify("*"===t?[]:t),JSON.stringify(Array.isArray(null==n?void 0:n.regions)?{}:null!==(o=null==n?void 0:n.regions)&&void 0!==o?o:{}),e,c(null==n?void 0:n.default),this.disabled,this.readonly,(t=>{const o=a({},this._value),n=t.currentTarget.regions;o[e]=n.length?n:"*",this._value=o}),(()=>{const t=a({},this._value);delete t[e],this._value=t}))})),0===l.length&&0!==r.length?"":s(w||(w=O` <div data-testid="new-country" class="${0}"> <select class="${0}" ?disabled="${0}" @change="${0}"> <option value="" disabled="disabled" selected="selected">${0}</option> ${0} </select> </div> `),i({"h-m flex items-center rounded-s transition-colors":!0,"border border-contrast-10 ring-primary-50":!0,"focus-within-ring-1 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),i({"appearance-none bg-transparent h-m text-m px-s flex-1 font-medium":!0,"transition-colors rounded-s focus-outline-none":!0,"cursor-pointer hover-bg-contrast-5":!this.disabled,"text-disabled":this.disabled}),this.disabled,(e=>{const t=e.currentTarget;this.__newCountry=t.value,this.__addCountry(),t.value=""}),this.t("add_country"),l.map((e=>s($||($=O`<option value="${0}">${0}</option>`),e.cc2,e.default)))),c(null!==(n=this.countries)&&void 0!==n?n:void 0),(()=>this.requestUpdate()))}__addCountry(){this._value=a(a({},this._value),{},{[this.__newCountry]:"*"}),this.__newCountry=""}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:{}}set _value(e){super._value=e}});let S,k,J,N,q,F,C,V,T=e=>e;const R=u(d(e,"template-config-form"));class z extends R{constructor(){super(...arguments),this.countries=null,this.regions=null,this.store=null,this.__customCheckoutFieldCouponEntryRequirementsOptions=JSON.stringify([{label:"option_enabled",value:"enabled"},{label:"option_disabled",value:"disabled"}]),this.__customCheckoutFieldRequirementsOptions=JSON.stringify([{label:"option_default",value:"default"},{label:"option_optional",value:"optional"},{label:"option_required",value:"required"},{label:"option_hidden",value:"hidden"}]),this.__tosCheckboxSettingsInitialStateOptions=JSON.stringify([{label:"option_checked",value:"checked"},{label:"option_unchecked",value:"unchecked"}]),this.__locationFilteringFilterTypeOptions=JSON.stringify([{label:"option_blocklist",value:"blacklist"},{label:"option_allowlist",value:"whitelist"}]),this.__foxycompleteShowComboboxOptions=JSON.stringify([{label:"option_combobox",value:"combobox"},{label:"option_search",value:"search"}]),this.__tosCheckboxSettingsUsageOptions=JSON.stringify([{label:"option_none",value:"none"},{label:"option_optional",value:"optional"},{label:"option_required",value:"required"}]),this.__locationFilteringUsageOptions=JSON.stringify([{label:"option_none",value:"none"},{label:"option_shipping",value:"shipping"},{label:"option_billing",value:"billing"},{label:"option_both",value:"both"},{label:"option_independent",value:"independent"}]),this.__cscRequirementsValueOptions=JSON.stringify([{label:"option_all_cards",value:"all_cards"},{label:"option_sso_only",value:"sso_only"},{label:"option_new_cards_only",value:"new_cards_only"}]),this.__checkoutTypeDefaultOptions=JSON.stringify([{label:"option_default_account",value:"default_account"},{label:"option_default_guest",value:"default_guest"}]),this.__checkoutTypeAccountOptions=JSON.stringify([{label:"option_account",value:"account_only"},{label:"option_guest",value:"guest_only"},{label:"option_both",value:"default_guest"}]),this.__cartTypeOptions=JSON.stringify([{label:"option_default",value:"default"},{label:"option_fullpage",value:"fullpage"},{label:"option_custom",value:"custom"}]),this.__locationFilteringFilterValuesSetValue=e=>{const t=this.__formJson,o=a(a({},t.location_filtering),{},{shipping_filter_values:e,billing_filter_values:e});this.edit({json:JSON.stringify(a(a({},t),{},{location_filtering:o}))})},this.__locationFilteringFilterTypeSetValue=e=>{const t=this.__formJson,o=a(a({},t.location_filtering),{},{shipping_filter_type:e,billing_filter_type:e});this.edit({json:JSON.stringify(a(a({},t),{},{location_filtering:o}))})},this.__foxycompleteShowComboboxGetValue=()=>this.__formJson.foxycomplete.show_combobox?"combobox":"search",this.__foxycompleteShowComboboxSetValue=e=>{const t="combobox"===e,o=a(a({},this.__formJson.foxycomplete),{},{show_combobox:t});this.edit({json:JSON.stringify(a(a({},this.__formJson),{},{foxycomplete:o}))})},this.__checkoutTypeAccountGetValue=()=>{const e=this.__formJson;return e.checkout_type.includes("default")?"default_guest":e.checkout_type},this.__customConfigGetValue=()=>{const e=this.__formJson;return"string"==typeof e.custom_config?e.custom_config:JSON.stringify(e.custom_config,null,2)},this.__customConfigSetValue=e=>{const t=this.__formJson;try{t.custom_config=JSON.parse(e)}catch(o){t.custom_config=e}this.edit({json:JSON.stringify(t)})},this.__defaultJSON=JSON.stringify({cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},google_tag:{usage:"none",send_to:"",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}})}static get properties(){return a(a({},super.properties),{},{countries:{},regions:{},store:{}})}get hiddenSelector(){var e,t;const o=[super.hiddenSelector.toString()],n=this.__dataJson,i=this.__formJson,s=i.location_filtering.usage,r=i.checkout_type;return"required"!==i.cart_display_config.usage&&o.unshift("cart-group-two","cart-group-three","cart-group-four"),"required"!==i.foxycomplete.usage&&o.unshift("country-and-region-group-one:foxycomplete-show-combobox","country-and-region-group-one:foxycomplete-combobox-open","country-and-region-group-one:foxycomplete-combobox-close","country-and-region-group-one:foxycomplete-show-flags"),!1===i.foxycomplete.show_combobox&&o.unshift("country-and-region-group-one:foxycomplete-combobox-open","country-and-region-group-one:foxycomplete-combobox-close"),"both"!==s&&o.unshift("country-and-region-group-two"),"shipping"!==s&&"independent"!==s&&o.unshift("country-and-region-group-three"),"billing"!==s&&"independent"!==s&&o.unshift("country-and-region-group-four"),"default_account"!==r&&"default_guest"!==r&&o.unshift("customer-accounts:checkout-type-default"),"none"===i.tos_checkbox_settings.usage&&o.unshift("consent-group-one:tos-checkbox-settings-url","consent-group-one:tos-checkbox-settings-initial-state","consent-group-one:tos-checkbox-settings-is-hidden"),"required"!==i.analytics_config.usage&&o.unshift("analytics-config-google-analytics","analytics-config-google-tag"),"required"!==(null==n?void 0:n.analytics_config.google_analytics.usage)&&o.unshift("analytics-config-google-analytics"),"required"!==i.analytics_config.google_analytics.usage&&o.unshift("analytics-config-google-analytics:analytics-config-google-analytics-account-id","analytics-config-google-analytics:analytics-config-google-analytics-include-on-site"),"required"!==i.analytics_config.google_tag.usage&&(o.unshift("analytics-config-google-tag:analytics-config-google-tag-account-id"),o.unshift("analytics-config-google-tag:analytics-config-google-tag-send-to")),!0!==(null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.features_multiship)&&o.unshift("custom-script-values-multiship-checkout-fields"),new l(o.join(" ").trim())}renderBody(){var e,t,o,n,i;const a=[["billing_address1","billing_address2","billing_city","billing_region","billing_postal_code","billing_country"],["billing_first_name","billing_last_name","billing_company","billing_tax_id","billing_phone","coupon_entry"]],l=[["show_product_weight","show_product_category","show_product_code","show_product_options"],["show_sub_frequency","show_sub_startdate","show_sub_nextdate","show_sub_enddate"]];return s(S||(S=T` ${0} <foxy-internal-summary-control infer="cart-group-one"> <foxy-internal-select-control json-template="${0}" json-path="cart_type" property="json" options="${0}" layout="summary-item" infer="cart-type"> </foxy-internal-select-control> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="cart_display_config.usage" property="json" infer="cart-display-config-usage" invert> </foxy-internal-switch-control> </foxy-internal-summary-control> <div class="grid sm-grid-cols-2 gap-m" ?hidden="${0}"> ${0} </div> <foxy-internal-summary-control infer="cart-group-four"> <foxy-internal-editable-list-control json-template="${0}" json-path="cart_display_config.hidden_product_options" property="json" layout="summary-item" infer="cart-display-config-hidden-product-options" simple-value> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-one"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="foxycomplete.usage" property="json" infer="foxycomplete-usage"> </foxy-internal-switch-control> <foxy-internal-select-control options="${0}" layout="summary-item" infer="foxycomplete-show-combobox" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-text-control json-template="${0}" json-path="foxycomplete.combobox_open" property="json" layout="summary-item" infer="foxycomplete-combobox-open"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="foxycomplete.combobox_close" property="json" layout="summary-item" infer="foxycomplete-combobox-close"> </foxy-internal-text-control> <foxy-internal-switch-control json-template="${0}" json-path="foxycomplete.show_flags" property="json" infer="foxycomplete-show-flags"> </foxy-internal-switch-control> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="enabled" json-path="postal_code_lookup.usage" property="json" infer="postal-code-lookup"> </foxy-internal-switch-control> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.usage" property="json" options="${0}" layout="summary-item" infer="location-filtering-usage"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-two"> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.shipping_filter_type" property="json" options="${0}" layout="summary-item" infer="location-filtering-filter-type" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-template-config-form-filter-values-control json-template="${0}" json-path="location_filtering.shipping_filter_values" countries="${0}" property="json" infer="location-filtering-filter-values" .setValue="${0}"> </foxy-internal-template-config-form-filter-values-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-three"> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.shipping_filter_type" property="json" options="${0}" layout="summary-item" infer="location-filtering-shipping-filter-type"> </foxy-internal-select-control> <foxy-internal-template-config-form-filter-values-control json-template="${0}" json-path="location_filtering.shipping_filter_values" countries="${0}" property="json" infer="location-filtering-shipping-filter-values"> </foxy-internal-template-config-form-filter-values-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-four"> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.billing_filter_type" property="json" options="${0}" layout="summary-item" infer="location-filtering-billing-filter-type"> </foxy-internal-select-control> <foxy-internal-template-config-form-filter-values-control json-template="${0}" json-path="location_filtering.billing_filter_values" countries="${0}" property="json" infer="location-filtering-billing-filter-values"> </foxy-internal-template-config-form-filter-values-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="customer-accounts"> <foxy-internal-select-control json-template="${0}" json-path="checkout_type" property="json" options="${0}" layout="summary-item" infer="checkout-type-account" .getValue="${0}"> </foxy-internal-select-control> <foxy-internal-select-control json-template="${0}" json-path="checkout_type" property="json" options="${0}" layout="summary-item" infer="checkout-type-default"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="consent-group-one"> <foxy-internal-select-control json-template="${0}" json-path="tos_checkbox_settings.usage" property="json" options="${0}" layout="summary-item" infer="tos-checkbox-settings-usage"> </foxy-internal-select-control> <foxy-internal-text-control json-template="${0}" json-path="tos_checkbox_settings.url" property="json" layout="summary-item" infer="tos-checkbox-settings-url"> </foxy-internal-text-control> <foxy-internal-select-control json-template="${0}" json-path="tos_checkbox_settings.initial_state" property="json" options="${0}" layout="summary-item" infer="tos-checkbox-settings-initial-state"> </foxy-internal-select-control> <foxy-internal-switch-control json-template="${0}" json-path="tos_checkbox_settings.is_hidden" property="json" infer="tos-checkbox-settings-is-hidden"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="consent-group-two"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="eu_secure_data_transfer_consent.usage" property="json" infer="eu-secure-data-transfer-consent-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="consent-group-three"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="newsletter_subscribe.usage" property="json" infer="newsletter-subscribe-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="supported-cards-group"> <foxy-internal-template-config-form-supported-cards-control json-template="${0}" json-path="supported_payment_cards" property="json" infer="supported-payment-cards"> </foxy-internal-template-config-form-supported-cards-control> <p class="flex items-start gap-s"> ${0} <foxy-i18n infer="" key="disclaimer"></foxy-i18n> </p> </foxy-internal-summary-control> <foxy-internal-summary-control infer="csc-requirements-group"> <foxy-internal-select-control json-template="${0}" json-path="csc_requirements" property="json" options="${0}" layout="summary-item" infer="csc-requirements"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout-fields-group-one"> <foxy-internal-switch-control json-template="${0}" false-alias="disabled" true-alias="enabled" json-path="custom_checkout_field_requirements.cart_controls" property="json" infer="custom-checkout-field-requirements-cart-controls"> </foxy-internal-switch-control> </foxy-internal-summary-control> <div class="grid sm-grid-cols-2 gap-m" ?hidden="${0}"> ${0} </div> <foxy-internal-summary-control infer="analytics-config"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="analytics_config.usage" property="json" infer="analytics-config-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="analytics-config-google-analytics"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="analytics_config.google_analytics.usage" property="json" infer="analytics-config-google-analytics-usage"> </foxy-internal-switch-control> <foxy-internal-text-control json-template="${0}" json-path="analytics_config.google_analytics.account_id" property="json" layout="summary-item" infer="analytics-config-google-analytics-account-id"> </foxy-internal-text-control> <foxy-internal-switch-control json-template="${0}" json-path="analytics_config.google_analytics.include_on_site" property="json" infer="analytics-config-google-analytics-include-on-site"> </foxy-internal-switch-control> <p class="flex items-start gap-s bg-error-10 text-error"> ${0} <foxy-i18n infer="" key="deprecation_notice"></foxy-i18n> </p> </foxy-internal-summary-control> <foxy-internal-summary-control infer="analytics-config-google-tag"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="analytics_config.google_tag.usage" property="json" infer="analytics-config-google-tag-usage"> </foxy-internal-switch-control> <foxy-internal-text-control json-template="${0}" json-path="analytics_config.google_tag.account_id" property="json" layout="summary-item" infer="analytics-config-google-tag-account-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="analytics_config.google_tag.send_to" property="json" layout="summary-item" infer="analytics-config-google-tag-send-to"> </foxy-internal-text-control> <p class="flex items-start gap-s"> ${0} <span> <foxy-i18n infer="" key="usage_notice"></foxy-i18n> <br> <a target="_blank" class="cursor-pointer group text-primary rounded-s font-medium focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://wiki.foxycart.com/v/2.0/analytics#google_tag_ga4_google_ads" rel="nofollow noreferrer noopener"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="docs_link"> </foxy-i18n> </a> </span> </p> </foxy-internal-summary-control> <foxy-internal-summary-control infer="debug"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="debug.usage" property="json" infer="debug-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-source-control infer="custom-config" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.header" property="json" infer="custom-script-values-header"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.checkout_fields" property="json" infer="custom-script-values-checkout-fields"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.multiship_checkout_fields" property="json" infer="custom-script-values-multiship-checkout-fields"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.footer" property="json" infer="custom-script-values-footer"> </foxy-internal-source-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__defaultJSON,this.__cartTypeOptions,this.__defaultJSON,l.every(((e,t)=>e.every((e=>{const o=`cart-group-${0===t?"two":"three"}:cart-display-config-${e.replace(/_/g,"-")}`;return this.hiddenSelector.matches(o,!0)})))),l.map(((e,t)=>s(k||(k=T` <foxy-internal-summary-control infer="cart-group-${0}"> ${0} </foxy-internal-summary-control> `),0===t?"two":"three",e.map((e=>s(J||(J=T` <foxy-internal-switch-control json-template="${0}" json-path="cart_display_config.${0}" property="json" infer="cart-display-config-${0}"> </foxy-internal-switch-control> `),this.__defaultJSON,e,e.replace(/_/g,"-"))))))),this.__defaultJSON,this.__defaultJSON,this.__foxycompleteShowComboboxOptions,this.__foxycompleteShowComboboxGetValue,this.__foxycompleteShowComboboxSetValue,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__locationFilteringUsageOptions,this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__locationFilteringFilterTypeSetValue,this.__defaultJSON,c(null!==(e=this.countries)&&void 0!==e?e:void 0),this.__locationFilteringFilterValuesSetValue,this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__defaultJSON,c(null!==(t=this.countries)&&void 0!==t?t:void 0),this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__defaultJSON,c(null!==(o=this.countries)&&void 0!==o?o:void 0),this.__defaultJSON,this.__checkoutTypeAccountOptions,this.__checkoutTypeAccountGetValue,this.__defaultJSON,this.__checkoutTypeDefaultOptions,this.__defaultJSON,this.__tosCheckboxSettingsUsageOptions,this.__defaultJSON,this.__defaultJSON,this.__tosCheckboxSettingsInitialStateOptions,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,r(N||(N=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),this.__defaultJSON,this.__cscRequirementsValueOptions,this.__defaultJSON,a.every(((e,t)=>e.every((e=>{const o=`checkout-fields-group-${0===t?"two":"three"}:custom-checkout-field-requirements-${e.replace(/_/g,"-").replace("1","-one").replace("2","-two")}`;return this.hiddenSelector.matches(o,!0)})))),a.map(((e,t)=>s(q||(q=T` <foxy-internal-summary-control infer="checkout-fields-group-${0}"> ${0} </foxy-internal-summary-control> `),0===t?"two":"three",e.map((e=>{const t=e.replace(/_/g,"-").replace("1","-one").replace("2","-two"),o=`custom_checkout_field_requirements.${e}`;return s(F||(F=T` <foxy-internal-select-control json-template="${0}" json-path="${0}" property="json" options="${0}" layout="summary-item" infer="custom-checkout-field-requirements-${0}"> </foxy-internal-select-control> `),this.__defaultJSON,o,"coupon_entry"===e?this.__customCheckoutFieldCouponEntryRequirementsOptions:this.__customCheckoutFieldRequirementsOptions,t)}))))),this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,r(C||(C=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,r(V||(V=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),this.__defaultJSON,this.__customConfigGetValue,this.__customConfigSetValue,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,super.renderBody(),c(null!==(n=this.store)&&void 0!==n?n:null===(i=this.data)||void 0===i?void 0:i._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}get __formJson(){return this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},google_tag:{usage:"none",send_to:"",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}}}get __dataJson(){var e;return(null===(e=this.data)||void 0===e?void 0:e.json)?JSON.parse(this.data.json):null}}customElements.define("foxy-template-config-form",z);export{z as TemplateConfigForm};
@@ -1 +1 @@
1
- import"./shared-ef98e595.js";import"./shared-63b647a8.js";import"./shared-f15af5d1.js";import{I as e}from"./shared-0643656a.js";import"./shared-68a5368a.js";import{a as t}from"./shared-cc5e4c06.js";import"./shared-70380f94.js";import{_ as r,B as s}from"./shared-cb58dfcd.js";import{N as a}from"./shared-f83207fb.js";import{h as o}from"./shared-ba5c42c7.js";import{a as i}from"./shared-1ce5b073.js";import{i as n}from"./shared-53e42a77.js";import"./shared-5fd5805c.js";import"./shared-4ded48ee.js";import"./shared-7b3aac7e.js";import"./shared-a3a4c368.js";import"./shared-92153a7f.js";import"./shared-76cbea00.js";import"./shared-d2304d50.js";import"./shared-500b7eb7.js";import"./shared-4e709717.js";import"./shared-d0aed1c1.js";import"./shared-1f6366c0.js";import"./shared-a4ca1c5d.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./foxy-copy-to-clipboard.js";import"./shared-127ec8a7.js";import"./shared-0995ae7c.js";import"./shared-16ae74b2.js";import"./shared-75e7361d.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-5212ef4f.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";let d,c=e=>e;customElements.define("foxy-internal-template-form-async-action",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return r(r({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const e=this.__state,t="fail"===e?"error":"";return o(d||(d=c` <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),`${this.theme} ${null!=t?t:""}`.trim(),"busy"===e||this.disabled,this.__submit,e)}async __submit(){var e,t;if("busy"!==this.__state)try{this.__state="busy";const r=new a.API(this),s=await r.fetch(null!==(e=this.href)&&void 0!==e?e:"",{method:"POST"});this.__state=s.ok?"idle":"fail",s.ok&&(null===(t=this.nucleon)||void 0===t||t.refresh())}catch(e){this.__state="fail"}}});let h,l=e=>e;const m=i(e,"template-form");class f extends m{get readonlySelector(){const e=[super.readonlySelector.toString()];return this.form.content_url&&e.unshift("content"),new s(e.join(" ").trim())}get disabledSelector(){const e=[super.disabledSelector.toString()];return this.in({idle:{snapshot:"clean"}})&&this.data.content_url||e.unshift("source:cache"),new s(e.join(" ").trim())}get hiddenSelector(){var e;const t=[super.hiddenSelector.toString()];return(null===(e=this.data)||void 0===e?void 0:e.content_url)||t.unshift("source:cache"),new s(t.join(" ").trim())}renderBody(){var e;return o(h||(h=l` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> </foxy-internal-summary-control> ${0} <foxy-internal-source-control infer="content"></foxy-internal-source-control> <foxy-internal-summary-control infer="source"> <foxy-internal-text-control layout="summary-item" infer="content-url"> </foxy-internal-text-control> <foxy-internal-template-form-async-action theme="tertiary-inline" infer="cache" href="${0}"> </foxy-internal-template-form-async-action> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.renderTemplateOrSlot(),n(null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href),super.renderBody())}async _sendPost(e){const t=await super._sendPost(e);if(e.content_url){const e=t._links["fx:cache"].href;if(!(await new f.API(this).fetch(e,{method:"POST"})).ok)throw["error:failed_to_cache"]}return await this._fetch(t._links.self.href)}async _sendPatch(e){const t=await super._sendPatch(e);if(!e.content_url)return t;const r=t._links["fx:cache"].href;if(!(await new f.API(this).fetch(r,{method:"POST"})).ok)throw["error:failed_to_cache"];return await this._fetch(t._links.self.href)}}customElements.define("foxy-template-form",f);export{f as TemplateForm};
1
+ import"./shared-56d91134.js";import"./shared-2a5d1cdf.js";import"./shared-076f086a.js";import{I as e}from"./shared-7995cbcf.js";import"./shared-68a5368a.js";import{a as t}from"./shared-677953e0.js";import"./shared-70380f94.js";import{_ as r,B as s}from"./shared-cb58dfcd.js";import{N as o}from"./shared-f83207fb.js";import{h as a}from"./shared-ba5c42c7.js";import{a as i}from"./shared-1ce5b073.js";import{i as n}from"./shared-53e42a77.js";import"./shared-5fd5805c.js";import"./shared-4ded48ee.js";import"./shared-7b3aac7e.js";import"./shared-a3a4c368.js";import"./shared-92153a7f.js";import"./shared-76cbea00.js";import"./shared-d2304d50.js";import"./shared-500b7eb7.js";import"./shared-4e709717.js";import"./shared-d0aed1c1.js";import"./shared-1f6366c0.js";import"./shared-a4ca1c5d.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./foxy-copy-to-clipboard.js";import"./shared-127ec8a7.js";import"./shared-0995ae7c.js";import"./shared-16ae74b2.js";import"./shared-75e7361d.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-5212ef4f.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";let d,c=e=>e;customElements.define("foxy-internal-template-form-async-action",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return r(r({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const e=this.__state,t="fail"===e?"error":"";return a(d||(d=c` <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),`${this.theme} ${null!=t?t:""}`.trim(),"busy"===e||this.disabled,this.__submit,e)}async __submit(){var e,t;if("busy"!==this.__state)try{this.__state="busy";const r=new o.API(this),s=await r.fetch(null!==(e=this.href)&&void 0!==e?e:"",{method:"POST"});this.__state=s.ok?"idle":"fail",s.ok&&(null===(t=this.nucleon)||void 0===t||t.refresh())}catch(e){this.__state="fail"}}});let h,l=e=>e;const m=i(e,"template-form");class f extends m{get readonlySelector(){const e=[super.readonlySelector.toString()];return this.form.content_url&&e.unshift("content"),new s(e.join(" ").trim())}get disabledSelector(){const e=[super.disabledSelector.toString()];return this.in({idle:{snapshot:"clean"}})&&this.data.content_url||e.unshift("source:cache"),new s(e.join(" ").trim())}get hiddenSelector(){var e;const t=[super.hiddenSelector.toString()];return(null===(e=this.data)||void 0===e?void 0:e.content_url)||t.unshift("source:cache"),new s(t.join(" ").trim())}renderBody(){var e;return a(h||(h=l` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> </foxy-internal-summary-control> ${0} <foxy-internal-source-control infer="content"></foxy-internal-source-control> <foxy-internal-summary-control infer="source"> <foxy-internal-text-control layout="summary-item" infer="content-url"> </foxy-internal-text-control> <foxy-internal-template-form-async-action theme="tertiary-inline" infer="cache" href="${0}"> </foxy-internal-template-form-async-action> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.renderTemplateOrSlot(),n(null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href),super.renderBody())}async _sendPost(e){const t=await super._sendPost(e);if(e.content_url){const e=t._links["fx:cache"].href;if(!(await new f.API(this).fetch(e,{method:"POST"})).ok)throw["error:failed_to_cache"]}return await this._fetch(t._links.self.href)}async _sendPatch(e){const t=await super._sendPatch(e);if(!e.content_url)return t;const r=t._links["fx:cache"].href;if(!(await new f.API(this).fetch(r,{method:"POST"})).ok)throw["error:failed_to_cache"];return await this._fetch(t._links.self.href)}}customElements.define("foxy-template-form",f);export{f as TemplateForm};
@@ -1 +1 @@
1
- import"./shared-303dc2a6.js";import"./shared-c92d72ba.js";import"./shared-f15af5d1.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-0643656a.js";import"./foxy-payments-api-payment-preset-card.js";import"./foxy-nucleon-element.js";import"./foxy-i18n-editor.js";import{_ as r,B as o}from"./shared-cb58dfcd.js";import{R as s,a as t}from"./shared-1ce5b073.js";import{i as a}from"./shared-53e42a77.js";import{h as d}from"./shared-ba5c42c7.js";import"./shared-68a5368a.js";import"./shared-7b3aac7e.js";import"./shared-a3a4c368.js";import"./shared-500b7eb7.js";import"./shared-bfdbe217.js";import"./shared-0995ae7c.js";import"./shared-42c91940.js";import"./shared-20fb2969.js";import"./shared-986d0f7f.js";import"./shared-292dcee0.js";import"./shared-ef98e595.js";import"./shared-cc5e4c06.js";import"./shared-70380f94.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-75e7361d.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-1f6366c0.js";import"./shared-a4ca1c5d.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-6286efb1.js";import"./shared-6b3b8c63.js";import"./shared-76cbea00.js";import"./shared-d2304d50.js";import"./shared-4ded48ee.js";import"./shared-92153a7f.js";import"./foxy-copy-to-clipboard.js";import"./shared-127ec8a7.js";import"./shared-16ae74b2.js";import"./shared-bab2ea2c.js";import"./shared-5c057c26.js";import"./shared-0662adb7.js";import"./shared-651c44fa.js";import"./shared-c365c1ae.js";import"./shared-f28e46bf.js";import"./shared-d0aed1c1.js";import"./shared-49337d35.js";import"./shared-253e51f7.js";import"./shared-d5f6483f.js";let i,n,l=e=>e;const c=s(t(e,"template-set-form"));class p extends c{constructor(){super(...arguments),this.paymentMethodSets=null,this.languageStrings=null,this.localeCodes=null,this.languages=null,this.__localeCodesLoaderId="localeCodesLoader",this.__languagesLoaderId="languagesLoader"}static get properties(){return r(r({},super.properties),{},{paymentMethodSets:{attribute:"payment-method-sets"},languageStrings:{attribute:"language-strings"},localeCodes:{attribute:"locale-codes"},languages:{}})}static get v8n(){return[({description:e})=>!!e||"description:v8n_required",({description:e})=>!!e&&e.length<=100||"description:v8n_too_long",({code:e})=>!!e||"code:v8n_required",({code:e})=>!!e&&e.length<=50||"code:v8n_too_long",({language:e})=>!!e||"language:v8n_required",({locale_code:e})=>!!e||"locale_code:v8n_required"]}get headerSubtitleOptions(){var e;return r(r({},super.headerSubtitleOptions),{},{context:"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)?"default":""})}get disabledSelector(){var e,r;const s=[];return(null===(e=this.__languagesLoader)||void 0===e?void 0:e.data)||s.push("language"),(null===(r=this.__localeCodesLoader)||void 0===r?void 0:r.data)||s.push("locale-code"),new o(`${s.join(" ")} ${super.disabledSelector}`)}get hiddenSelector(){var e;const r=[];return"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)&&r.push("delete","code","description"),new o(`${r.join(" ")} ${super.hiddenSelector}`)}renderBody(){var e,r,o,s,t,c,p,h;const m=Object.entries(null!==(o=null===(r=null===(e=this.__localeCodesLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.values)&&void 0!==o?o:{}).map((([e,r])=>({value:e,rawLabel:r}))),u=Object.entries(null!==(c=null===(t=null===(s=this.__languagesLoader)||void 0===s?void 0:s.data)||void 0===t?void 0:t.values)&&void 0!==c?c:{}).map((([e,r])=>({value:e,label:r})));return d(i||(i=l` ${0} <div class="grid grid-cols-1 gap-m sm-grid-cols-2"> <foxy-internal-text-control infer="description"></foxy-internal-text-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-select-control infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="locale-code" .options="${0}"> </foxy-internal-select-control> </div> <foxy-internal-resource-picker-control infer="payment-method-set-uri" first="${0}" item="foxy-payments-api-payment-preset-card"> </foxy-internal-resource-picker-control> ${0} ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),u,m,this.paymentMethodSets,this.data&&this.languageStrings&&!this.hiddenSelector.matches("language-overrides",!0)?d(n||(n=l` <div> ${0} <foxy-i18n-editor language-overrides="${0}" selected-language="${0}" infer="language-overrides" href="${0}"> </foxy-i18n-editor> ${0} </div> `),this.renderTemplateOrSlot("language-overrides:before"),this.data._links["fx:language_overrides"].href,this.form.language,this.languageStrings,this.renderTemplateOrSlot("language-overrides:after")):"",super.renderBody(),a(null!==(p=this.languages)&&void 0!==p?p:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),a(null!==(h=this.localeCodes)&&void 0!==h?h:void 0),this.__localeCodesLoaderId,(()=>this.requestUpdate()))}get __localeCodesLoader(){return this.renderRoot.querySelector(`#${this.__localeCodesLoaderId}`)}get __languagesLoader(){return this.renderRoot.querySelector(`#${this.__languagesLoaderId}`)}}customElements.define("foxy-template-set-form",p);export{p as TemplateSetForm};
1
+ import"./shared-21fba20d.js";import"./shared-eb086cef.js";import"./shared-076f086a.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-7995cbcf.js";import"./foxy-payments-api-payment-preset-card.js";import"./foxy-nucleon-element.js";import"./foxy-i18n-editor.js";import{_ as r,B as o}from"./shared-cb58dfcd.js";import{R as s,a as t}from"./shared-1ce5b073.js";import{i as a}from"./shared-53e42a77.js";import{h as d}from"./shared-ba5c42c7.js";import"./shared-68a5368a.js";import"./shared-7b3aac7e.js";import"./shared-a3a4c368.js";import"./shared-500b7eb7.js";import"./shared-7f5f6657.js";import"./shared-0995ae7c.js";import"./shared-42c91940.js";import"./shared-20fb2969.js";import"./shared-986d0f7f.js";import"./shared-292dcee0.js";import"./shared-56d91134.js";import"./shared-677953e0.js";import"./shared-70380f94.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-75e7361d.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-1f6366c0.js";import"./shared-a4ca1c5d.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-0e1ad508.js";import"./shared-6b3b8c63.js";import"./shared-76cbea00.js";import"./shared-d2304d50.js";import"./shared-4ded48ee.js";import"./shared-92153a7f.js";import"./foxy-copy-to-clipboard.js";import"./shared-127ec8a7.js";import"./shared-16ae74b2.js";import"./shared-bab2ea2c.js";import"./shared-5c057c26.js";import"./shared-0662adb7.js";import"./shared-651c44fa.js";import"./shared-c365c1ae.js";import"./shared-f28e46bf.js";import"./shared-d0aed1c1.js";import"./shared-49337d35.js";import"./shared-253e51f7.js";import"./shared-d5f6483f.js";let i,n,l=e=>e;const p=s(t(e,"template-set-form"));class c extends p{constructor(){super(...arguments),this.paymentMethodSets=null,this.languageStrings=null,this.localeCodes=null,this.languages=null,this.__localeCodesLoaderId="localeCodesLoader",this.__languagesLoaderId="languagesLoader"}static get properties(){return r(r({},super.properties),{},{paymentMethodSets:{attribute:"payment-method-sets"},languageStrings:{attribute:"language-strings"},localeCodes:{attribute:"locale-codes"},languages:{}})}static get v8n(){return[({description:e})=>!!e||"description:v8n_required",({description:e})=>!!e&&e.length<=100||"description:v8n_too_long",({code:e})=>!!e||"code:v8n_required",({code:e})=>!!e&&e.length<=50||"code:v8n_too_long",({language:e})=>!!e||"language:v8n_required",({locale_code:e})=>!!e||"locale_code:v8n_required"]}get headerSubtitleOptions(){var e;return r(r({},super.headerSubtitleOptions),{},{context:"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)?"default":""})}get disabledSelector(){var e,r;const s=[];return(null===(e=this.__languagesLoader)||void 0===e?void 0:e.data)||s.push("language"),(null===(r=this.__localeCodesLoader)||void 0===r?void 0:r.data)||s.push("locale-code"),new o(`${s.join(" ")} ${super.disabledSelector}`)}get hiddenSelector(){var e;const r=[];return"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)&&r.push("delete","code","description"),new o(`${r.join(" ")} ${super.hiddenSelector}`)}renderBody(){var e,r,o,s,t,p,c,h;const m=Object.entries(null!==(o=null===(r=null===(e=this.__localeCodesLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.values)&&void 0!==o?o:{}).map((([e,r])=>({value:e,rawLabel:r}))),u=Object.entries(null!==(p=null===(t=null===(s=this.__languagesLoader)||void 0===s?void 0:s.data)||void 0===t?void 0:t.values)&&void 0!==p?p:{}).map((([e,r])=>({value:e,label:r})));return d(i||(i=l` ${0} <div class="grid grid-cols-1 gap-m sm-grid-cols-2"> <foxy-internal-text-control infer="description"></foxy-internal-text-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-select-control infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="locale-code" .options="${0}"> </foxy-internal-select-control> </div> <foxy-internal-resource-picker-control infer="payment-method-set-uri" first="${0}" item="foxy-payments-api-payment-preset-card"> </foxy-internal-resource-picker-control> ${0} ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),u,m,this.paymentMethodSets,this.data&&this.languageStrings&&!this.hiddenSelector.matches("language-overrides",!0)?d(n||(n=l` <div> ${0} <foxy-i18n-editor language-overrides="${0}" selected-language="${0}" infer="language-overrides" href="${0}"> </foxy-i18n-editor> ${0} </div> `),this.renderTemplateOrSlot("language-overrides:before"),this.data._links["fx:language_overrides"].href,this.form.language,this.languageStrings,this.renderTemplateOrSlot("language-overrides:after")):"",super.renderBody(),a(null!==(c=this.languages)&&void 0!==c?c:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),a(null!==(h=this.localeCodes)&&void 0!==h?h:void 0),this.__localeCodesLoaderId,(()=>this.requestUpdate()))}get __localeCodesLoader(){return this.renderRoot.querySelector(`#${this.__localeCodesLoaderId}`)}get __languagesLoader(){return this.renderRoot.querySelector(`#${this.__languagesLoaderId}`)}}customElements.define("foxy-template-set-form",c);export{c as TemplateSetForm};