@foxy.io/elements 1.38.0-beta.1 → 1.38.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-billing-address-card.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +2 -2
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +11 -11
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-experimental-add-to-cart-builder.js +2 -2
- package/dist/cdn/foxy-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +3 -3
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-card.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card-embed.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-payments-api.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +1 -1
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-container-card.js +1 -1
- package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-shipping-service-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-store-card.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +7 -7
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-user-invitation-card.js +1 -1
- package/dist/cdn/foxy-user-invitation-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-aa45d4ec.js → shared-0164a1bb.js} +1 -1
- package/dist/cdn/{shared-57c3f0e4.js → shared-01fc874a.js} +1 -1
- package/dist/cdn/{shared-d54b3216.js → shared-0881a17c.js} +1 -1
- package/dist/cdn/{shared-893ead61.js → shared-099c2c3a.js} +1 -1
- package/dist/cdn/{shared-2db8d17c.js → shared-0a177e2c.js} +1 -1
- package/dist/cdn/shared-0aedd809.js +1 -0
- package/dist/cdn/{shared-8e36bcc1.js → shared-0ba8919d.js} +1 -1
- package/dist/cdn/{shared-dc6eb904.js → shared-1643e28d.js} +1 -1
- package/dist/cdn/{shared-6555fd71.js → shared-17b9f264.js} +1 -1
- package/dist/cdn/{shared-322ae633.js → shared-188614a4.js} +1 -1
- package/dist/cdn/{shared-82e82908.js → shared-1d0839af.js} +1 -1
- package/dist/cdn/{shared-d8cab6ab.js → shared-234b03f8.js} +2 -2
- package/dist/cdn/{shared-3691a26f.js → shared-243e3357.js} +1 -1
- package/dist/cdn/{shared-f6e9eda6.js → shared-25b175fb.js} +1 -1
- package/dist/cdn/{shared-17a61265.js → shared-2aa23b5f.js} +1 -1
- package/dist/cdn/{shared-812c706e.js → shared-3d276862.js} +1 -1
- package/dist/cdn/{shared-f61e5463.js → shared-3ff5c3d1.js} +2 -2
- package/dist/cdn/{shared-cba2b787.js → shared-4070a0d5.js} +1 -1
- package/dist/cdn/{shared-efecf1ca.js → shared-424970b6.js} +1 -1
- package/dist/cdn/{shared-569db166.js → shared-427529a8.js} +1 -1
- package/dist/cdn/shared-4a38cb3e.js +1 -0
- package/dist/cdn/{shared-bd941702.js → shared-516205e7.js} +1 -1
- package/dist/cdn/{shared-7e9fdf64.js → shared-5592ec6e.js} +1 -1
- package/dist/cdn/{shared-49e0541d.js → shared-58202132.js} +4 -4
- package/dist/cdn/{shared-ccc91a5f.js → shared-58400227.js} +1 -1
- package/dist/cdn/{shared-eeb2bd18.js → shared-5afb584d.js} +1 -1
- package/dist/cdn/shared-5e4a03d1.js +1 -0
- package/dist/cdn/{shared-fcdb896f.js → shared-5ef40e86.js} +1 -1
- package/dist/cdn/{shared-aab278b5.js → shared-5f157a83.js} +1 -1
- package/dist/cdn/{shared-c27ee44e.js → shared-62d05dde.js} +1 -1
- package/dist/cdn/{shared-3a446f14.js → shared-64ed7d2b.js} +1 -1
- package/dist/cdn/{shared-c2efc54e.js → shared-673d668a.js} +1 -1
- package/dist/cdn/{shared-1137b243.js → shared-6d8a44c7.js} +1 -1
- package/dist/cdn/{shared-2550f6d9.js → shared-704cd73c.js} +1 -1
- package/dist/cdn/{shared-58e7f6b1.js → shared-71f2c754.js} +1 -1
- package/dist/cdn/{shared-299543b6.js → shared-745bd2f4.js} +1 -1
- package/dist/cdn/{shared-019348d7.js → shared-7594e563.js} +1 -1
- package/dist/cdn/{shared-12a553c2.js → shared-7f7549aa.js} +1 -1
- package/dist/cdn/{shared-13d65f57.js → shared-844ab7a4.js} +1 -1
- package/dist/cdn/{shared-9f07fab6.js → shared-8650b26e.js} +1 -1
- package/dist/cdn/{shared-fcf6424c.js → shared-9127e26b.js} +1 -1
- package/dist/cdn/{shared-498ce88a.js → shared-9380d4fb.js} +1 -1
- package/dist/cdn/{shared-604261a0.js → shared-939a75a1.js} +1 -1
- package/dist/cdn/{shared-71f3226f.js → shared-93e5feba.js} +1 -1
- package/dist/cdn/{shared-4bcfe691.js → shared-988e3176.js} +1 -1
- package/dist/cdn/shared-994c7754.js +1 -0
- package/dist/cdn/{shared-9ca85d1e.js → shared-99a8889a.js} +1 -1
- package/dist/cdn/{shared-5a08dbb0.js → shared-9bd0911a.js} +1 -1
- package/dist/cdn/{shared-f2c4875b.js → shared-9ce51b25.js} +1 -1
- package/dist/cdn/{shared-dea71762.js → shared-9e6a97dd.js} +1 -1
- package/dist/cdn/{shared-85323ced.js → shared-a271467a.js} +1 -1
- package/dist/cdn/{shared-41aa53e0.js → shared-b3985d0a.js} +1 -1
- package/dist/cdn/{shared-6960ab99.js → shared-b3d72cd9.js} +1 -1
- package/dist/cdn/{shared-d4d11fb8.js → shared-b72066f8.js} +1 -1
- package/dist/cdn/{shared-2762e106.js → shared-b7a745ad.js} +1 -1
- package/dist/cdn/{shared-7d797451.js → shared-beba68ab.js} +1 -1
- package/dist/cdn/{shared-25a19cbe.js → shared-c0159ceb.js} +1 -1
- package/dist/cdn/{shared-166204e5.js → shared-c23fa7d5.js} +2 -2
- package/dist/cdn/{shared-1da49e3d.js → shared-c6624d27.js} +2 -2
- package/dist/cdn/{shared-6ef0392a.js → shared-c6f0f6b1.js} +1 -1
- package/dist/cdn/{shared-d1195c27.js → shared-cb58dfcd.js} +1 -1
- package/dist/cdn/{shared-a2693527.js → shared-cbd8c028.js} +1 -1
- package/dist/cdn/{shared-34119bbf.js → shared-d0fb346b.js} +1 -1
- package/dist/cdn/{shared-d199f862.js → shared-d1bf9a87.js} +2 -2
- package/dist/cdn/{shared-a2a27012.js → shared-d4e728a4.js} +1 -1
- package/dist/cdn/{shared-e6cd721f.js → shared-d5588203.js} +1 -1
- package/dist/cdn/{shared-3a3dc0d9.js → shared-d5961db8.js} +1 -1
- package/dist/cdn/{shared-f438f0f4.js → shared-d793edcb.js} +1 -1
- package/dist/cdn/{shared-59e22bc6.js → shared-d7dcb404.js} +1 -1
- package/dist/cdn/{shared-2bcdd0c6.js → shared-d888c826.js} +1 -1
- package/dist/cdn/{shared-1ba78e12.js → shared-daa5a8b2.js} +1 -1
- package/dist/cdn/{shared-674ba44d.js → shared-de7d816d.js} +1 -1
- package/dist/cdn/{shared-f3209496.js → shared-e18a194d.js} +1 -1
- package/dist/cdn/{shared-e1a6c036.js → shared-e3147d1a.js} +1 -1
- package/dist/cdn/{shared-aa211938.js → shared-e3b504c0.js} +1 -1
- package/dist/cdn/{shared-641786b2.js → shared-eb963ba3.js} +1 -1
- package/dist/cdn/{shared-56ba2d28.js → shared-ef4ad461.js} +1 -1
- package/dist/cdn/shared-f83207fb.js +1 -0
- package/dist/cdn/{shared-7c863df2.js → shared-fa5aa1c3.js} +1 -1
- package/dist/cdn/shared-ff8eb8a3.js +1 -0
- package/dist/cdn/translations/admin-subscription-form/en.json +4 -4
- package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.d.ts +4 -0
- package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js +34 -13
- package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js.map +1 -1
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/InternalAdminSubscriptionFormLinkControl.js +23 -40
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/InternalAdminSubscriptionFormLinkControl.js.map +1 -1
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/index.d.ts +0 -1
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/index.js +0 -1
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/index.js.map +1 -1
- package/dist/elements/public/StoreForm/StoreForm.js +2 -2
- package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js +14 -10
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js.map +1 -1
- package/dist/mixins/themeable.js +0 -12
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-1aff7995.js +0 -1
- package/dist/cdn/shared-882a0fda.js +0 -1
- package/dist/cdn/shared-9cf15285.js +0 -1
- package/dist/cdn/shared-a1f85307.js +0 -1
- package/dist/cdn/shared-d1dfac4d.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-57c3f0e4.js";import"./shared-604261a0.js";import"./shared-25a19cbe.js";import"./shared-dc6eb904.js";import"./shared-893ead61.js";import{I as e}from"./shared-6960ab99.js";import"./shared-4bcfe691.js";import"./shared-7c863df2.js";import"./shared-f3209496.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-5a08dbb0.js";import{_ as t,B as a}from"./shared-d1195c27.js";import"./shared-8e36bcc1.js";import"./shared-674ba44d.js";import{h as s}from"./shared-ba5c42c7.js";import{S as i,R as r,a as n}from"./shared-f61e5463.js";import{c as o}from"./shared-4e709717.js";import{S as d,C as l}from"./shared-bd941702.js";import"./shared-2550f6d9.js";import{G as c}from"./shared-6555fd71.js";import"./shared-13d65f57.js";import"./shared-3a446f14.js";import"./shared-e6cd721f.js";import"./shared-59e22bc6.js";import"./shared-7d797451.js";import"./shared-d54b3216.js";import{p as u}from"./shared-882a0fda.js";import{s as m}from"./shared-79d0699c.js";import{i as h}from"./shared-53e42a77.js";import{p as f}from"./shared-9ca85d1e.js";import{j as _}from"./shared-c2efc54e.js";import"./shared-f2c4875b.js";import"./shared-efecf1ca.js";import"./shared-1ba78e12.js";import"./shared-d8cab6ab.js";import"./shared-651c44fa.js";import"./shared-a2693527.js";import"./shared-166204e5.js";import"./shared-dea71762.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-eeb2bd18.js";import"./shared-17a61265.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";import"./shared-9f07fab6.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-6ef0392a.js";import"./shared-a2a27012.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-299543b6.js";import"./shared-43e2c3f6.js";import"./shared-a1f85307.js";import"./shared-f438f0f4.js";import"./shared-c27ee44e.js";import"./shared-12a553c2.js";import"./shared-641786b2.js";import"./shared-aab278b5.js";import"./shared-2bcdd0c6.js";import"./shared-1137b243.js";import"./shared-2db8d17c.js";import"./shared-34119bbf.js";function p(e){return function*(e){const t=[];for(const a of e.settings.subscriptions.allowFrequencyModification)if(_(a.jsonataQuery).evaluate(e.subscription))for(const e of a.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}class y extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function v(e){const t=864e5,a=31*t;if(".5m"===e)return a/2;const s=parseInt(e.substring(0,e.length-1));if(isNaN(s))throw new y(e);if(e.endsWith("y"))return 31536e6*s;if(e.endsWith("m"))return s*a;if(e.endsWith("w"))return 6048e5*s;if(e.endsWith("d"))return s*t;throw new y(e)}function x(e,t){if("boolean"==typeof t)return t;const a=t.filter((t=>Boolean(_(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var a,s,i,r,n;if(t.min){const a=e.min?v(e.min):1/0;v(t.min)<a&&(e.min=t.min)}if(t.max){const a=e.max?v(e.max):-1/0;v(t.max)>a&&(e.max=t.max)}if("day"===(null===(a=t.allowedDays)||void 0===a?void 0:a.type)){const a=[...null!==(s=e.allowedDaysOfWeek)&&void 0!==s?s:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(a))}if("month"===(null===(i=t.allowedDays)||void 0===i?void 0:i.type)){const a=[...null!==(r=e.allowedDaysOfMonth)&&void 0!==r?r:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(a))}if(t.disallowedDates){const a=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(a))}return e}),{});return 0!==Object.keys(a).length&&a}function g(e){const[t,a,s]=e.split("-").map((e=>parseInt(e)));return new Date(t,a-1,s)}function b(e){const t=e.settings.subscriptions.allow_next_date_modification;let a;return a="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,a;const s=g(e.value),i=s.getTime(),r=x(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof r)return r;if(!1===(null===(t=r.allowedDaysOfMonth)||void 0===t?void 0:t.includes(s.getDate())))return!1;if(!1===(null===(a=r.allowedDaysOfWeek)||void 0===a?void 0:a.includes(s.getDay())))return!1;if(r.disallowedDates&&r.disallowedDates.find((e=>{const[t,a]=e.split("..").map((e=>g(e).getTime()));return i===t||void 0!==a&&i>=t&&i<=a})))return!1;if(r.min){const e=f(r.min);if(null!==e&&Date.now()+e>=i)return!1}if(r.max){const e=f(r.max);if(null!==e&&Date.now()+e<=i)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:a}},subscription:e.subscription,value:e.value})}let $,j,D,w,S,T,q,E,k,H,C,L=e=>e;const A=i(r(n(e,"subscription-form")));class I extends A{constructor(){super(...arguments),this.getTransactionPageHref=(e,t)=>null==t?void 0:t._links["fx:receipt"].href,this.getCustomerPageHref=null,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderItemsActions=()=>s($||($=L` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-s font-medium text-secondary" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var e;let t;try{const a=this.__transactionTemplate,s=new URL(null!==(e=null==a?void 0:a._links["fx:items"].href)&&void 0!==e?e:"");s.searchParams.set("zoom","item_options"),t=s.toString()}catch(e){t=void 0}return s(j||(j=L` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" infer="items" item="foxy-item-card" .itemProps="${0}"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),h(t),{"locale-codes":this.localeCodes})},this.__renderEndDate=()=>{var e;const{data:t,lang:a,ns:i}=this;return s(D||(D=L` <div data-testid="end-date"> ${0} <x-group frame> <foxy-i18n key="end_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),i,a,h(null===(e=null==t?void 0:t.end_date)||void 0===e?void 0:e.substr(0,10)),h(null==t?void 0:t.end_date),a,!this.__isEndDateEditable,this.disabledSelector.matches("end-date",!0),this.__checkEndDateAvailability,(e=>{const t=e.target;this.edit({end_date:t.value})}),this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:a}=this;if(t&&a){return b({value:m(e),settings:t,subscription:a})}return e.getTime()>=Date.now()},this.__checkStartDateAvailability=e=>e.getTime()>=Date.now(),this.__checkEndDateAvailability=e=>{const t=new Date;return t.setDate(t.getDate()+1),t.setHours(0,0,0,0),e.getTime()>=t.getTime()},this.__renderStartDate=()=>{const{data:e,lang:t,ns:a}=this;return s(w||(w=L` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),a,t,h(null==e?void 0:e.start_date.substr(0,10)),h(null==e?void 0:e.start_date),t,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(e=>{const t=e.target;this.edit({start_date:t.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:a}=this,i=!!(null==e?void 0:e.is_active);return s(S||(S=L` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),a,t,h(null==e?void 0:e.next_transaction_date.substr(0,10)),h(null==e?void 0:e.next_transaction_date),t,!i||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),a=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",u(e)),value:e})));return s(T||(T=L` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),h(this.form.frequency),a,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:a,ns:i}=this;return s(q||(q=L` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),i,a,i,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>s(E||(E=L` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(e)),e,a,".5m"===e?"twice_a_month":"frequency",i))))},this.__renderFrequency=()=>s(k||(k=L` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__renderCustomer=()=>{var e,t;const a=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,i=a?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,a):void 0;return s(H||(H=L` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="customer" href="${0}"></foxy-customer-card> </a> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),o({"block rounded transition-colors":!0,"ring-1 ring-contrast-10":!i,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!i,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!i}),h(i),h(a),this.renderTemplateOrSlot("customer:after"))}}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-customer-card":customElements.get("foxy-customer-card"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":d,"x-choice":l,"x-group":c}}static get properties(){return t(t({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},settings:{type:Object},coupons:{}})}get hiddenSelector(){return new a(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}get headerTitleOptions(){if(this.data&&this.__currencyCode){const e=u(this.data.frequency),a=this.__transactionTemplate,s=`${null==a?void 0:a.total_order} ${this.__currencyCode}`,i=this.__currencyDisplay,r=this.__currencyCode?".5m"===this.data.frequency?"twice_a_month":"recurring":"existing";return t(t({},e),{},{amount:s,currencyDisplay:i,context:r})}return{}}get headerSubtitleOptions(){var e,t,a;let s,i=null;if(null===(e=this.data)||void 0===e?void 0:e.first_failed_transaction_date)s="failed",i=this.data.first_failed_transaction_date;else if(null===(t=this.data)||void 0===t?void 0:t.end_date){s=new Date(this.data.end_date).getTime()>Date.now()?"will_be_cancelled":"cancelled",i=this.data.end_date}else(null===(a=this.data)||void 0===a?void 0:a.is_active)?new Date(this.data.start_date)>new Date?(s="will_be_active",i=this.data.start_date):(s="active",i=this.data.next_transaction_date):s="inactive";return{date:i,context:s}}renderBody(){var e,t,a,i,r;let n;try{const a=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");a.searchParams.set("order","transaction_date desc"),a.searchParams.set("zoom","items"),n=a.toString()}catch(e){n=void 0}return s(C||(C=L` ${0} <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> </div> `),this.renderHeader(),h(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),h(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),h(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),h(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),h(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("customer",!0)?"":this.__renderCustomer(),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",this.__isEndDateVisible?this.__renderEndDate():"",h(null!==(a=this.__currencyCode)&&void 0!==a?a:void 0),h(null===(r=null===(i=this.data)||void 0===i?void 0:i._links["fx:attributes"])||void 0===r?void 0:r.href),h(n),this.getTransactionPageHref)}get __transactionTemplateHref(){var e;const t=this.data;return(null===(e=null==t?void 0:t._embedded)||void 0===e?void 0:e["fx:transaction_template"])||null==t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var e,t,a;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(a=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==a?a:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __templateSetHref(){const e=this.__transactionTemplate;if(!(null==e?void 0:e.currency_code))return(null==e?void 0:e.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t,a;const s=this.data,i=null===(e=null==s?void 0:s._embedded)||void 0===e?void 0:e["fx:transaction_template"],r=`#${this.__transactionTemplateLoaderId}`;return null!==(a=null!=i?i:null===(t=this.renderRoot.querySelector(r))||void 0===t?void 0:t.data)&&void 0!==a?a:null}get __defaultTemplateSet(){var e,t;const a=`#${this.__defaultTemplateSetLoaderId}`,s=this.renderRoot.querySelector(a);return null!==(t=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const a=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const a=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const a=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __isNextTransactionDateVisible(){if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;const e=this.settings.subscriptions.allow_next_date_modification;return!!function(e,t){let a;return a="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),x(e,a)}(this.data,e)}get __isStartDateVisible(){return!this.hiddenSelector.matches("start-date",!0)&&this.__isNextTransactionDateVisible}get __isEndDateVisible(){return!this.hiddenSelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())&&(!1!==this.data.is_active&&!this.settings)))}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isEndDateEditable(){return!this.readonlySelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&null===this.settings)))}get __isFrequencyVisible(){if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;return!p({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=p({subscription:this.data,settings:this.settings});return Array.from(e)}get __currencyCode(){var e,t,a,s;const i=this.__transactionTemplate;if(null==i?void 0:i.currency_code)return i.currency_code;const r=this.__localeCodesHelper,n=null===(t=null!==(e=this.__templateSet)&&void 0!==e?e:this.__defaultTemplateSet)||void 0===t?void 0:t.locale_code,o=n?null==r?void 0:r.values[n]:void 0;return o&&null!==(s=null===(a=/Currency: ([A-Z]{3})/g.exec(o))||void 0===a?void 0:a[1])&&void 0!==s?s:null}get __currencyDisplay(){var e;return(null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol)?"code":"symbol"}}customElements.define("foxy-subscription-form",I);export{I as SubscriptionForm};
|
|
1
|
+
import"./shared-01fc874a.js";import"./shared-939a75a1.js";import"./shared-c0159ceb.js";import"./shared-1643e28d.js";import"./shared-099c2c3a.js";import{I as e}from"./shared-b3d72cd9.js";import"./shared-988e3176.js";import"./shared-fa5aa1c3.js";import"./shared-e18a194d.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-9bd0911a.js";import{_ as t,B as a}from"./shared-cb58dfcd.js";import"./shared-0ba8919d.js";import"./shared-de7d816d.js";import{h as s}from"./shared-ba5c42c7.js";import{S as i,R as r,a as n}from"./shared-3ff5c3d1.js";import{c as o}from"./shared-4e709717.js";import{S as d,C as l}from"./shared-516205e7.js";import"./shared-704cd73c.js";import{G as c}from"./shared-17b9f264.js";import"./shared-844ab7a4.js";import"./shared-64ed7d2b.js";import"./shared-d5588203.js";import"./shared-d7dcb404.js";import"./shared-beba68ab.js";import"./shared-0881a17c.js";import{p as u}from"./shared-ff8eb8a3.js";import{s as m}from"./shared-79d0699c.js";import{i as h}from"./shared-53e42a77.js";import{p as f}from"./shared-99a8889a.js";import{j as _}from"./shared-673d668a.js";import"./shared-9ce51b25.js";import"./shared-424970b6.js";import"./shared-daa5a8b2.js";import"./shared-234b03f8.js";import"./shared-651c44fa.js";import"./shared-cbd8c028.js";import"./shared-c23fa7d5.js";import"./shared-9e6a97dd.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";import"./shared-8650b26e.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-c6f0f6b1.js";import"./shared-d4e728a4.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-745bd2f4.js";import"./shared-43e2c3f6.js";import"./shared-994c7754.js";import"./shared-d793edcb.js";import"./shared-62d05dde.js";import"./shared-7f7549aa.js";import"./shared-eb963ba3.js";import"./shared-5f157a83.js";import"./shared-d888c826.js";import"./shared-6d8a44c7.js";import"./shared-0a177e2c.js";import"./shared-d0fb346b.js";function p(e){return function*(e){const t=[];for(const a of e.settings.subscriptions.allowFrequencyModification)if(_(a.jsonataQuery).evaluate(e.subscription))for(const e of a.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}class y extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function v(e){const t=864e5,a=31*t;if(".5m"===e)return a/2;const s=parseInt(e.substring(0,e.length-1));if(isNaN(s))throw new y(e);if(e.endsWith("y"))return 31536e6*s;if(e.endsWith("m"))return s*a;if(e.endsWith("w"))return 6048e5*s;if(e.endsWith("d"))return s*t;throw new y(e)}function x(e,t){if("boolean"==typeof t)return t;const a=t.filter((t=>Boolean(_(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var a,s,i,r,n;if(t.min){const a=e.min?v(e.min):1/0;v(t.min)<a&&(e.min=t.min)}if(t.max){const a=e.max?v(e.max):-1/0;v(t.max)>a&&(e.max=t.max)}if("day"===(null===(a=t.allowedDays)||void 0===a?void 0:a.type)){const a=[...null!==(s=e.allowedDaysOfWeek)&&void 0!==s?s:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(a))}if("month"===(null===(i=t.allowedDays)||void 0===i?void 0:i.type)){const a=[...null!==(r=e.allowedDaysOfMonth)&&void 0!==r?r:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(a))}if(t.disallowedDates){const a=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(a))}return e}),{});return 0!==Object.keys(a).length&&a}function g(e){const[t,a,s]=e.split("-").map((e=>parseInt(e)));return new Date(t,a-1,s)}function b(e){const t=e.settings.subscriptions.allow_next_date_modification;let a;return a="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,a;const s=g(e.value),i=s.getTime(),r=x(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof r)return r;if(!1===(null===(t=r.allowedDaysOfMonth)||void 0===t?void 0:t.includes(s.getDate())))return!1;if(!1===(null===(a=r.allowedDaysOfWeek)||void 0===a?void 0:a.includes(s.getDay())))return!1;if(r.disallowedDates&&r.disallowedDates.find((e=>{const[t,a]=e.split("..").map((e=>g(e).getTime()));return i===t||void 0!==a&&i>=t&&i<=a})))return!1;if(r.min){const e=f(r.min);if(null!==e&&Date.now()+e>=i)return!1}if(r.max){const e=f(r.max);if(null!==e&&Date.now()+e<=i)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:a}},subscription:e.subscription,value:e.value})}let $,j,D,w,S,T,q,E,k,H,C,L=e=>e;const A=i(r(n(e,"subscription-form")));class I extends A{constructor(){super(...arguments),this.getTransactionPageHref=(e,t)=>null==t?void 0:t._links["fx:receipt"].href,this.getCustomerPageHref=null,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderItemsActions=()=>s($||($=L` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-s font-medium text-secondary" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var e;let t;try{const a=this.__transactionTemplate,s=new URL(null!==(e=null==a?void 0:a._links["fx:items"].href)&&void 0!==e?e:"");s.searchParams.set("zoom","item_options"),t=s.toString()}catch(e){t=void 0}return s(j||(j=L` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" infer="items" item="foxy-item-card" .itemProps="${0}"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),h(t),{"locale-codes":this.localeCodes})},this.__renderEndDate=()=>{var e;const{data:t,lang:a,ns:i}=this;return s(D||(D=L` <div data-testid="end-date"> ${0} <x-group frame> <foxy-i18n key="end_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),i,a,h(null===(e=null==t?void 0:t.end_date)||void 0===e?void 0:e.substr(0,10)),h(null==t?void 0:t.end_date),a,!this.__isEndDateEditable,this.disabledSelector.matches("end-date",!0),this.__checkEndDateAvailability,(e=>{const t=e.target;this.edit({end_date:t.value})}),this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:a}=this;if(t&&a){return b({value:m(e),settings:t,subscription:a})}return e.getTime()>=Date.now()},this.__checkStartDateAvailability=e=>e.getTime()>=Date.now(),this.__checkEndDateAvailability=e=>{const t=new Date;return t.setDate(t.getDate()+1),t.setHours(0,0,0,0),e.getTime()>=t.getTime()},this.__renderStartDate=()=>{const{data:e,lang:t,ns:a}=this;return s(w||(w=L` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),a,t,h(null==e?void 0:e.start_date.substr(0,10)),h(null==e?void 0:e.start_date),t,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(e=>{const t=e.target;this.edit({start_date:t.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:a}=this,i=!!(null==e?void 0:e.is_active);return s(S||(S=L` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),a,t,h(null==e?void 0:e.next_transaction_date.substr(0,10)),h(null==e?void 0:e.next_transaction_date),t,!i||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),a=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",u(e)),value:e})));return s(T||(T=L` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),h(this.form.frequency),a,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:a,ns:i}=this;return s(q||(q=L` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),i,a,i,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>s(E||(E=L` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(e)),e,a,".5m"===e?"twice_a_month":"frequency",i))))},this.__renderFrequency=()=>s(k||(k=L` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__renderCustomer=()=>{var e,t;const a=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,i=a?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,a):void 0;return s(H||(H=L` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="customer" href="${0}"></foxy-customer-card> </a> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),o({"block rounded transition-colors":!0,"ring-1 ring-contrast-10":!i,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!i,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!i}),h(i),h(a),this.renderTemplateOrSlot("customer:after"))}}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-customer-card":customElements.get("foxy-customer-card"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":d,"x-choice":l,"x-group":c}}static get properties(){return t(t({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},settings:{type:Object},coupons:{}})}get hiddenSelector(){return new a(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}get headerTitleOptions(){if(this.data&&this.__currencyCode){const e=u(this.data.frequency),a=this.__transactionTemplate,s=`${null==a?void 0:a.total_order} ${this.__currencyCode}`,i=this.__currencyDisplay,r=this.__currencyCode?".5m"===this.data.frequency?"twice_a_month":"recurring":"existing";return t(t({},e),{},{amount:s,currencyDisplay:i,context:r})}return{}}get headerSubtitleOptions(){var e,t,a;let s,i=null;if(null===(e=this.data)||void 0===e?void 0:e.first_failed_transaction_date)s="failed",i=this.data.first_failed_transaction_date;else if(null===(t=this.data)||void 0===t?void 0:t.end_date){s=new Date(this.data.end_date).getTime()>Date.now()?"will_be_cancelled":"cancelled",i=this.data.end_date}else(null===(a=this.data)||void 0===a?void 0:a.is_active)?new Date(this.data.start_date)>new Date?(s="will_be_active",i=this.data.start_date):(s="active",i=this.data.next_transaction_date):s="inactive";return{date:i,context:s}}renderBody(){var e,t,a,i,r;let n;try{const a=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");a.searchParams.set("order","transaction_date desc"),a.searchParams.set("zoom","items"),n=a.toString()}catch(e){n=void 0}return s(C||(C=L` ${0} <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> </div> `),this.renderHeader(),h(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),h(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),h(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),h(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),h(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("customer",!0)?"":this.__renderCustomer(),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",this.__isEndDateVisible?this.__renderEndDate():"",h(null!==(a=this.__currencyCode)&&void 0!==a?a:void 0),h(null===(r=null===(i=this.data)||void 0===i?void 0:i._links["fx:attributes"])||void 0===r?void 0:r.href),h(n),this.getTransactionPageHref)}get __transactionTemplateHref(){var e;const t=this.data;return(null===(e=null==t?void 0:t._embedded)||void 0===e?void 0:e["fx:transaction_template"])||null==t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var e,t,a;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(a=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==a?a:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __templateSetHref(){const e=this.__transactionTemplate;if(!(null==e?void 0:e.currency_code))return(null==e?void 0:e.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t,a;const s=this.data,i=null===(e=null==s?void 0:s._embedded)||void 0===e?void 0:e["fx:transaction_template"],r=`#${this.__transactionTemplateLoaderId}`;return null!==(a=null!=i?i:null===(t=this.renderRoot.querySelector(r))||void 0===t?void 0:t.data)&&void 0!==a?a:null}get __defaultTemplateSet(){var e,t;const a=`#${this.__defaultTemplateSetLoaderId}`,s=this.renderRoot.querySelector(a);return null!==(t=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const a=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const a=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const a=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(a))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __isNextTransactionDateVisible(){if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;const e=this.settings.subscriptions.allow_next_date_modification;return!!function(e,t){let a;return a="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),x(e,a)}(this.data,e)}get __isStartDateVisible(){return!this.hiddenSelector.matches("start-date",!0)&&this.__isNextTransactionDateVisible}get __isEndDateVisible(){return!this.hiddenSelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())&&(!1!==this.data.is_active&&!this.settings)))}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isEndDateEditable(){return!this.readonlySelector.matches("end-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&null===this.settings)))}get __isFrequencyVisible(){if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;return!p({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=p({subscription:this.data,settings:this.settings});return Array.from(e)}get __currencyCode(){var e,t,a,s;const i=this.__transactionTemplate;if(null==i?void 0:i.currency_code)return i.currency_code;const r=this.__localeCodesHelper,n=null===(t=null!==(e=this.__templateSet)&&void 0!==e?e:this.__defaultTemplateSet)||void 0===t?void 0:t.locale_code,o=n?null==r?void 0:r.values[n]:void 0;return o&&null!==(s=null===(a=/Currency: ([A-Z]{3})/g.exec(o))||void 0===a?void 0:a[1])&&void 0!==s?s:null}get __currencyDisplay(){var e;return(null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol)?"code":"symbol"}}customElements.define("foxy-subscription-form",I);export{I as SubscriptionForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-71f2c754.js";import"./shared-d4e728a4.js";import"./shared-93e5feba.js";import"./shared-25b175fb.js";import"./shared-fa5aa1c3.js";import"./shared-427529a8.js";import{I as e}from"./shared-b3d72cd9.js";import{a as t}from"./shared-3ff5c3d1.js";import{B as r}from"./shared-cb58dfcd.js";import{h as i}from"./shared-ba5c42c7.js";import"./shared-01fc874a.js";import"./shared-9ce51b25.js";import"./shared-424970b6.js";import"./shared-0ba8919d.js";import"./shared-099c2c3a.js";import"./shared-de7d816d.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-9bd0911a.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-939a75a1.js";import"./shared-daa5a8b2.js";import"./shared-d5588203.js";import"./shared-234b03f8.js";import"./shared-64ed7d2b.js";import"./shared-0881a17c.js";import"./shared-651c44fa.js";import"./shared-844ab7a4.js";import"./shared-cbd8c028.js";import"./shared-d7dcb404.js";import"./shared-c0159ceb.js";import"./shared-c23fa7d5.js";import"./shared-9e6a97dd.js";import"./shared-53e42a77.js";import"./shared-745bd2f4.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";import"./shared-8650b26e.js";import"./shared-704cd73c.js";import"./foxy-copy-to-clipboard.js";import"./shared-1643e28d.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"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./foxy-spinner.js";import"./shared-9bd0911a.js";import{S as s}from"./shared-58202132.js";export{S as SubscriptionsTable}from"./shared-58202132.js";import"./shared-099c2c3a.js";import"./shared-9ce51b25.js";import"./shared-3ff5c3d1.js";import"./shared-cb58dfcd.js";import"./shared-ba5c42c7.js";import"./shared-1643e28d.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-0164a1bb.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./foxy-nucleon-element.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4e709717.js";import"./shared-ff8eb8a3.js";customElements.define("foxy-subscriptions-table",s);
|
package/dist/cdn/foxy-table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-5212ef4f.js";import"./foxy-spinner.js";import{T as s}from"./shared-
|
|
1
|
+
import"./shared-5212ef4f.js";import"./foxy-spinner.js";import{T as s}from"./shared-0164a1bb.js";export{T as Table}from"./shared-0164a1bb.js";import"./shared-ba5c42c7.js";import"./shared-099c2c3a.js";import"./shared-9ce51b25.js";import"./shared-3ff5c3d1.js";import"./shared-cb58dfcd.js";import"./shared-1643e28d.js";import"./shared-9bd0911a.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./foxy-nucleon-element.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4e709717.js";customElements.define("foxy-table",s);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-5212ef4f.js";import"./foxy-spinner.js";import{a as
|
|
1
|
+
import"./shared-5212ef4f.js";import"./foxy-spinner.js";import{a as e}from"./shared-3ff5c3d1.js";import{T as r}from"./shared-9127e26b.js";import{h as t}from"./shared-ba5c42c7.js";import"./shared-099c2c3a.js";import"./shared-9ce51b25.js";import"./shared-1643e28d.js";import"./shared-9bd0911a.js";import"./shared-cb58dfcd.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./shared-d793edcb.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4e709717.js";let a,s,o=e=>e;class d extends(e(r,"tax-card")){renderBody(){return super.renderBody({title:e=>t(a||(a=o`${0}`),e.name),subtitle:e=>t(s||(s=o`${0} • ${0}`),this.getTypeLabel(e),this.getRateLabel(e))})}getTypeLabel({type:e,country:r,region:t,city:a}){return"global"===e?this.t("tax_global"):"union"===e?this.t("tax_union"):"country"===e?r:"region"===e?`${r}, ${t}`:"local"===e?`${r}, ${t}, ${a}`:"custom_tax"===e?this.t("tax_custom_tax"):void 0}getRateLabel({is_live:e,rate:r}){var t;if(!e)return this.t("percent",{fraction:r/100});const a=null===(t=this.data)||void 0===t?void 0:t.service_provider;return"onesource"===a?"Thomson Reuters ONESOURCE":"avalara"===a?"Avalara AvaTax 15":"taxjar"===a?"TaxJar":"custom_tax_endpoint"===a?this.t("tax_rate_provider_custom"):this.t("tax_rate_provider_default")}}customElements.define("foxy-tax-card",d);export{d as TaxCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-4bcfe691.js";import"./shared-a2a27012.js";import"./shared-f6e9eda6.js";import"./shared-71f3226f.js";import"./shared-7c863df2.js";import"./shared-569db166.js";import{I as e}from"./shared-6960ab99.js";import"./foxy-native-integration-card.js";import"./foxy-nucleon-element.js";import{_ as t,B as r}from"./shared-d1195c27.js";import{a as i}from"./shared-f61e5463.js";import{i as o}from"./shared-53e42a77.js";import{h as n}from"./shared-ba5c42c7.js";import"./shared-8e36bcc1.js";import"./shared-f2c4875b.js";import"./shared-893ead61.js";import"./shared-efecf1ca.js";import"./shared-6ef0392a.js";import"./shared-25a19cbe.js";import"./shared-1ba78e12.js";import"./shared-e6cd721f.js";import"./shared-d8cab6ab.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-dc6eb904.js";import"./shared-5a08dbb0.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-eeb2bd18.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-9f07fab6.js";import"./shared-2550f6d9.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-604261a0.js";import"./shared-3a446f14.js";import"./shared-d54b3216.js";import"./shared-651c44fa.js";import"./shared-13d65f57.js";import"./shared-a2693527.js";import"./shared-59e22bc6.js";import"./shared-166204e5.js";import"./shared-dea71762.js";import"./shared-57c3f0e4.js";import"./shared-674ba44d.js";import"./shared-299543b6.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-a1f85307.js";import"./shared-f438f0f4.js";let s,a=e=>e;const l=i(e,"tax-form"),d=["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"],u=[...d,"AU"];class c extends l{constructor(){super(...arguments),this.nativeIntegrations=null,this.countries=null,this.regions=null,this.__serviceProviderGetValue=()=>this.form.service_provider||(this.form.is_live?"default":"none"),this.__serviceProviderSetValue=e=>{const t=["none","default"].includes(e)?"":e;this.edit({service_provider:t,use_origin_rates:!1,is_live:"none"!==e}),this.edit({exempt_all_customer_tax_ids:this.__isExemptAllCustomerTaxIdsHidden,apply_to_shipping:this.__isApplyToShippingHidden})},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,i;const o=[super.hiddenSelector.toString()];void 0===this.__nativeIntegrationsUrl&&o.unshift("native-integrations"),this.__isCountryHidden&&o.unshift("group-three:country"),this.__isRegionHidden&&o.unshift("group-three:region-select","group-three:region-input"),this.__isCityHidden&&o.unshift("group-three:city"),this.__isProviderHidden&&o.unshift("group-one:service-provider"),this.__isRateHidden&&o.unshift("group-one:rate"),this.__isApplyToShippingHidden&&o.unshift("group-two:apply-to-shipping"),this.__isUseOriginRatesHidden&&o.unshift("group-two:use-origin-rates"),this.__isExemptAllCustomerTaxIdsHidden&&o.unshift("group-two:exempt-all-customer-tax-ids");const n=Object.values(null!==(i=null===(t=null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==i?i:{});return o.unshift("group-three:region-"+(n.length?"input":"select")),new r(o.join(" ").trim())}renderBody(){var e,t,r,i,l,d,u;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!==(d=null===(l=null===(i=this.__regionsLoader)||void 0===i?void 0:i.data)||void 0===l?void 0:l.values)&&void 0!==d?d:{}).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-select-control options="${0}" layout="summary-item" infer="service-provider" .getValue="${0}" .setValue="${0}"> </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),this.__serviceProviderGetValue,this.__serviceProviderSetValue,o(this.__nativeIntegrationsUrl),JSON.stringify(c),this.__countrySetValue,JSON.stringify(p),this.__regionSetValue,this.__regionSetValue,super.renderBody(),o(null!==(u=this.countries)&&void 0!==u?u:void 0),(()=>this.requestUpdate()),o(this.__regionsUrl),(()=>this.requestUpdate()))}get __serviceProviderOptions(){const e=[{label:"option_none",value:"none"},{label:"option_avalara",value:"avalara"},{label:"option_onesource",value:"onesource"}];return"union"!==this.form.type&&this.form.country&&!d.includes(this.form.country)||e.unshift({label:"option_default",value:"default"}),"union"!==this.form.type&&this.form.country&&!u.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&&d.includes(this.form.country)))}get __isUseOriginRatesHidden(){return"union"!==this.form.type||!this.form.is_live||!!this.form.service_provider}get __isProviderHidden(){const e=this.form.type;return!e||"global"===e||"local"===e||"custom_tax_endpoint"===e}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}get __isRateHidden(){const e=this.form.type;return!e||"custom_tax_endpoint"===e||!0===this.form.is_live}}customElements.define("foxy-tax-form",c);export{c as TaxForm};
|
|
1
|
+
import"./shared-988e3176.js";import"./shared-d4e728a4.js";import"./shared-25b175fb.js";import"./shared-93e5feba.js";import"./shared-fa5aa1c3.js";import"./shared-427529a8.js";import{I as e}from"./shared-b3d72cd9.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 i}from"./shared-3ff5c3d1.js";import{i as o}from"./shared-53e42a77.js";import{h as n}from"./shared-ba5c42c7.js";import"./shared-0ba8919d.js";import"./shared-9ce51b25.js";import"./shared-099c2c3a.js";import"./shared-424970b6.js";import"./shared-c6f0f6b1.js";import"./shared-c0159ceb.js";import"./shared-daa5a8b2.js";import"./shared-d5588203.js";import"./shared-234b03f8.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-1643e28d.js";import"./shared-9bd0911a.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-8650b26e.js";import"./shared-704cd73c.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-939a75a1.js";import"./shared-64ed7d2b.js";import"./shared-0881a17c.js";import"./shared-651c44fa.js";import"./shared-844ab7a4.js";import"./shared-cbd8c028.js";import"./shared-d7dcb404.js";import"./shared-c23fa7d5.js";import"./shared-9e6a97dd.js";import"./shared-01fc874a.js";import"./shared-de7d816d.js";import"./shared-745bd2f4.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-994c7754.js";import"./shared-d793edcb.js";let s,a=e=>e;const l=i(e,"tax-form"),d=["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"],u=[...d,"AU"];class c extends l{constructor(){super(...arguments),this.nativeIntegrations=null,this.countries=null,this.regions=null,this.__serviceProviderGetValue=()=>this.form.service_provider||(this.form.is_live?"default":"none"),this.__serviceProviderSetValue=e=>{const t=["none","default"].includes(e)?"":e;this.edit({service_provider:t,use_origin_rates:!1,is_live:"none"!==e}),this.edit({exempt_all_customer_tax_ids:this.__isExemptAllCustomerTaxIdsHidden,apply_to_shipping:this.__isApplyToShippingHidden})},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,i;const o=[super.hiddenSelector.toString()];void 0===this.__nativeIntegrationsUrl&&o.unshift("native-integrations"),this.__isCountryHidden&&o.unshift("group-three:country"),this.__isRegionHidden&&o.unshift("group-three:region-select","group-three:region-input"),this.__isCityHidden&&o.unshift("group-three:city"),this.__isProviderHidden&&o.unshift("group-one:service-provider"),this.__isRateHidden&&o.unshift("group-one:rate"),this.__isApplyToShippingHidden&&o.unshift("group-two:apply-to-shipping"),this.__isUseOriginRatesHidden&&o.unshift("group-two:use-origin-rates"),this.__isExemptAllCustomerTaxIdsHidden&&o.unshift("group-two:exempt-all-customer-tax-ids");const n=Object.values(null!==(i=null===(t=null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==i?i:{});return o.unshift("group-three:region-"+(n.length?"input":"select")),new r(o.join(" ").trim())}renderBody(){var e,t,r,i,l,d,u;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!==(d=null===(l=null===(i=this.__regionsLoader)||void 0===i?void 0:i.data)||void 0===l?void 0:l.values)&&void 0!==d?d:{}).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-select-control options="${0}" layout="summary-item" infer="service-provider" .getValue="${0}" .setValue="${0}"> </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),this.__serviceProviderGetValue,this.__serviceProviderSetValue,o(this.__nativeIntegrationsUrl),JSON.stringify(c),this.__countrySetValue,JSON.stringify(p),this.__regionSetValue,this.__regionSetValue,super.renderBody(),o(null!==(u=this.countries)&&void 0!==u?u:void 0),(()=>this.requestUpdate()),o(this.__regionsUrl),(()=>this.requestUpdate()))}get __serviceProviderOptions(){const e=[{label:"option_none",value:"none"},{label:"option_avalara",value:"avalara"},{label:"option_onesource",value:"onesource"}];return"union"!==this.form.type&&this.form.country&&!d.includes(this.form.country)||e.unshift({label:"option_default",value:"default"}),"union"!==this.form.type&&this.form.country&&!u.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&&d.includes(this.form.country)))}get __isUseOriginRatesHidden(){return"union"!==this.form.type||!this.form.is_live||!!this.form.service_provider}get __isProviderHidden(){const e=this.form.type;return!e||"global"===e||"local"===e||"custom_tax_endpoint"===e}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}get __isRateHidden(){const e=this.form.type;return!e||"custom_tax_endpoint"===e||!0===this.form.is_live}}customElements.define("foxy-tax-form",c);export{c as TaxForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-58e7f6b1.js";import"./shared-a2a27012.js";import"./shared-71f3226f.js";import"./shared-f6e9eda6.js";import"./shared-12a553c2.js";import"./shared-569db166.js";import{a as e,I as t}from"./shared-6960ab99.js";import"./foxy-nucleon-element.js";import"./shared-5a08dbb0.js";import{l as o}from"./shared-cf613436.js";import{c as n}from"./shared-4e709717.js";import{h as i,s}from"./shared-ba5c42c7.js";import{_ as r,B as a}from"./shared-d1195c27.js";import{C as l}from"./shared-eeb2bd18.js";import{N as c}from"./shared-d1dfac4d.js";import{T as u,a as d,R as p}from"./shared-f61e5463.js";import{i as f}from"./shared-53e42a77.js";import"./shared-57c3f0e4.js";import"./shared-f2c4875b.js";import"./shared-efecf1ca.js";import"./shared-8e36bcc1.js";import"./shared-893ead61.js";import"./shared-674ba44d.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-604261a0.js";import"./shared-1ba78e12.js";import"./shared-e6cd721f.js";import"./shared-d8cab6ab.js";import"./shared-3a446f14.js";import"./shared-d54b3216.js";import"./shared-651c44fa.js";import"./shared-13d65f57.js";import"./shared-a2693527.js";import"./shared-59e22bc6.js";import"./shared-25a19cbe.js";import"./shared-166204e5.js";import"./shared-dea71762.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-5212ef4f.js";import"./shared-17a61265.js";import"./shared-9f07fab6.js";import"./shared-2550f6d9.js";import"./shared-7e9fdf64.js";import"./shared-343d1fd7.js";import"./foxy-copy-to-clipboard.js";import"./shared-dc6eb904.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";let _,h,y=e=>e;customElements.define("foxy-internal-template-config-form-supported-cards-control",class extends e{renderControl(){const e={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return i(_||(_=y` <div class="flex flex-wrap -m-xs"> ${0} </div> `),Object.entries(o).map((([t,o])=>{if(!e[t])return;const s=this._value.includes(t);return i(h||(h=y` <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,n({"m-xs rounded":!0,"opacity-50 cursor-default":this.disabled,"cursor-pointer ring-primary-50 focus-within-ring-2":!this.disabled}),n({"overflow-hidden transition-colors flex rounded-s border":!0,"border-primary bg-primary-10 text-primary":s&&!this.readonly,"border-contrast bg-contrast-5 text-secondary":s&&this.readonly,"hover-text-body":s&&!this.disabled&&!this.readonly,"border-contrast-10":!s,"hover-border-primary":!s&&!this.disabled&&!this.readonly,"hover-text-primary":!s&&!this.disabled&&!this.readonly}),o,e[t],this.disabled,this.readonly,s,(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 g,m,x,b,v,j=e=>e;const w=l(u(d(c)));let $,k,S,O=e=>e;customElements.define("foxy-internal-template-config-form-filter-values-control-item",class extends w{constructor(){super(...arguments),this.regions=[],this.name="",this.code="",this.__newRegion=""}static get properties(){return r(r({},super.properties),{},{__newRegion:{attribute:!1},regions:{type:Array},name:{type:String},code:{type:String}})}render(){var e,t;return i(g||(g=j` <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> ${0} </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> <div data-testid="regions" class="flex flex-wrap p-xs text-s"> ${0} <div data-testid="new-region" class="${0}"> <input placeholder="${0}" class="bg-transparent appearance-none h-s text-s px-s font-medium focus-outline-none" style="width:8rem" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> <datalist id="list"> ${0} </datalist> </div> </div> `),n({"border border-contrast-5 rounded-s font-medium overflow-hidden":!0,"text-disabled":this.disabled}),this.name||this.code,this.name?i(m||(m=j`<span class="text-secondary">${0}</span>`),this.code):"",this.t("delete"),n({"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"))),this.regions.map((e=>{var t,o;const s=null===(o=null===(t=this.data)||void 0===t?void 0:t.values[e])||void 0===o?void 0:o.default;return i(x||(x=j` <div class="flex items-center rounded-s border border-contrast-10 h-s m-xs"> <span class="mx-s"> <span>${0}</span> ${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> `),s||e,s?i(b||(b=j`<span class="text-secondary">${0}</span>`),e):"",this.t("delete"),n({"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"))}))})),n({"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}),this.t("add_region"),this.__newRegion,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newRegion&&this.__addRegion()}),(e=>{const t=e.currentTarget;this.__newRegion=t.value}),n({"flex-shrink-0":!0,"flex items-center justify-center rounded-s transition-colors":!0,"text-transparent cursor-default":!this.__newRegion,"bg-contrast-5 text-body cursor-pointer":!!this.__newRegion,"hover-bg-success hover-text-success-contrast":!!this.__newRegion,"focus-outline-none focus-ring-2 ring-inset ring-primary-50":!!this.__newRegion}),this.disabled||!this.__newRegion,this.__addRegion,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>i(v||(v=j`<option value="${0}">${0}</option>`),e.code,e.default))))}__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 e{constructor(){super(...arguments),this.countries=null,this.regions=null,this.__newCountry=""}static get properties(){return r(r({},super.properties),{},{__newCountry:{attribute:!1},countries:{},regions:{}})}renderControl(){var e,t,o,s;const a=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:{};return i($||($=O` <div class="space-y-s" data-testid="countries"> ${0} <div data-testid="new-country" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent font-medium appearance-none h-m focus-outline-none" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <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:add" class="icon-inline text-m"></iron-icon> </button> </div> </div> <datalist id="list"> ${0} </datalist> <foxy-nucleon infer="" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> `),Object.entries(this._value).map((([e,t])=>{var o,n;let s;try{const t=new URL(null!==(o=this.regions)&&void 0!==o?o:"");t.searchParams.set("country_code",e),s=t.toString()}catch(e){s=""}return i(k||(k=O` <foxy-internal-template-config-form-filter-values-control-item regions="${0}" infer="" code="${0}" name="${0}" href="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </foxy-internal-template-config-form-filter-values-control-item> `),JSON.stringify("*"===t?[]:t),e,f(null===(n=a[e])||void 0===n?void 0:n.default),s,this.disabled,this.readonly,(t=>{const o=r({},this._value),n=t.currentTarget.regions;o[e]=n.length?n:"*",this._value=o}),(()=>{const t=r({},this._value);delete t[e],this._value=t}))})),n({"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}),this.t("add_country"),this.__newCountry,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newCountry&&this.__addCountry()}),(e=>{const t=e.currentTarget;this.__newCountry=t.value}),this.t("create"),n({"mr-xs flex-shrink-0":!0,"flex items-center justify-center rounded-s transition-colors":!0,"text-transparent cursor-default":!this.__newCountry,"bg-contrast-5 text-body cursor-pointer":!!this.__newCountry,"hover-bg-success hover-text-success-contrast":!!this.__newCountry,"focus-outline-none focus-ring-2 ring-inset ring-primary-50":!!this.__newCountry}),!this.__newCountry||this.disabled,this.__addCountry,Object.entries(a).map((([e,t])=>i(S||(S=O`<option value="${0}">${0}</option>`),e,t.default))),f(null!==(s=this.countries)&&void 0!==s?s:void 0),(()=>this.requestUpdate()))}__addCountry(){this._value=r(r({},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 J,N,q,C,F,V,R,T,z=e=>e;const E=p(d(t,"template-config-form"));class D extends E{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=r(r({},t.location_filtering),{},{shipping_filter_values:e,billing_filter_values:e});this.edit({json:JSON.stringify(r(r({},t),{},{location_filtering:o}))})},this.__locationFilteringFilterTypeSetValue=e=>{const t=this.__formJson,o=r(r({},t.location_filtering),{},{shipping_filter_type:e,billing_filter_type:e});this.edit({json:JSON.stringify(r(r({},t),{},{location_filtering:o}))})},this.__foxycompleteShowComboboxGetValue=()=>this.__formJson.foxycomplete.show_combobox?"combobox":"search",this.__foxycompleteShowComboboxSetValue=e=>{const t="combobox"===e,o=r(r({},this.__formJson.foxycomplete),{},{show_combobox:t});this.edit({json:JSON.stringify(r(r({},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 r(r({},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 a(o.join(" ").trim())}renderBody(){var e,t,o,n,r,a,l,c;const u=[["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"]],d=[["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 i(J||(J=z` ${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" 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" regions="${0}" 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" regions="${0}" 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" regions="${0}" 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,d.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)})))),d.map(((e,t)=>i(N||(N=z` <foxy-internal-summary-control infer="cart-group-${0}"> ${0} </foxy-internal-summary-control> `),0===t?"two":"three",e.map((e=>i(q||(q=z` <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,f(null!==(e=this.countries)&&void 0!==e?e:void 0),f(null!==(t=this.regions)&&void 0!==t?t:void 0),this.__locationFilteringFilterValuesSetValue,this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__defaultJSON,f(null!==(o=this.countries)&&void 0!==o?o:void 0),f(null!==(n=this.regions)&&void 0!==n?n:void 0),this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__defaultJSON,f(null!==(r=this.countries)&&void 0!==r?r:void 0),f(null!==(a=this.regions)&&void 0!==a?a: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,s(C||(C=z`<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,u.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)})))),u.map(((e,t)=>i(F||(F=z` <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 i(V||(V=z` <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,s(R||(R=z`<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,s(T||(T=z`<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(),f(null!==(l=this.store)&&void 0!==l?l:null===(c=this.data)||void 0===c?void 0:c._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",D);export{D as TemplateConfigForm};
|
|
1
|
+
import"./shared-71f2c754.js";import"./shared-d4e728a4.js";import"./shared-93e5feba.js";import"./shared-25b175fb.js";import"./shared-7f7549aa.js";import"./shared-427529a8.js";import{a as e,I as t}from"./shared-b3d72cd9.js";import"./foxy-nucleon-element.js";import"./shared-9bd0911a.js";import{l as o}from"./shared-cf613436.js";import{c as n}from"./shared-4e709717.js";import{h as i,s}from"./shared-ba5c42c7.js";import{_ as r,B as a}from"./shared-cb58dfcd.js";import{C as l}from"./shared-5afb584d.js";import{N as c}from"./shared-f83207fb.js";import{T as u,a as d,R as p}from"./shared-3ff5c3d1.js";import{i as _}from"./shared-53e42a77.js";import"./shared-01fc874a.js";import"./shared-9ce51b25.js";import"./shared-424970b6.js";import"./shared-0ba8919d.js";import"./shared-099c2c3a.js";import"./shared-de7d816d.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-939a75a1.js";import"./shared-daa5a8b2.js";import"./shared-d5588203.js";import"./shared-234b03f8.js";import"./shared-64ed7d2b.js";import"./shared-0881a17c.js";import"./shared-651c44fa.js";import"./shared-844ab7a4.js";import"./shared-cbd8c028.js";import"./shared-d7dcb404.js";import"./shared-c0159ceb.js";import"./shared-c23fa7d5.js";import"./shared-9e6a97dd.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5212ef4f.js";import"./shared-2aa23b5f.js";import"./shared-8650b26e.js";import"./shared-704cd73c.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./foxy-copy-to-clipboard.js";import"./shared-1643e28d.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";let f,h,y=e=>e;customElements.define("foxy-internal-template-config-form-supported-cards-control",class extends e{renderControl(){const e={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return i(f||(f=y` <div class="flex flex-wrap -m-xs"> ${0} </div> `),Object.entries(o).map((([t,o])=>{if(!e[t])return;const s=this._value.includes(t);return i(h||(h=y` <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,n({"m-xs rounded":!0,"opacity-50 cursor-default":this.disabled,"cursor-pointer ring-primary-50 focus-within-ring-2":!this.disabled}),n({"overflow-hidden transition-colors flex rounded-s border":!0,"border-primary bg-primary-10 text-primary":s&&!this.readonly,"border-contrast bg-contrast-5 text-secondary":s&&this.readonly,"hover-text-body":s&&!this.disabled&&!this.readonly,"border-contrast-10":!s,"hover-border-primary":!s&&!this.disabled&&!this.readonly,"hover-text-primary":!s&&!this.disabled&&!this.readonly}),o,e[t],this.disabled,this.readonly,s,(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 g,m,x,b,v,j=e=>e;const w=l(u(d(c)));let $,k,S,O=e=>e;customElements.define("foxy-internal-template-config-form-filter-values-control-item",class extends w{constructor(){super(...arguments),this.regions=[],this.name="",this.code="",this.__newRegion=""}static get properties(){return r(r({},super.properties),{},{__newRegion:{attribute:!1},regions:{type:Array},name:{type:String},code:{type:String}})}render(){var e,t;return i(g||(g=j` <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> ${0} </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> <div data-testid="regions" class="flex flex-wrap p-xs text-s"> ${0} <div data-testid="new-region" class="${0}"> <input placeholder="${0}" class="bg-transparent appearance-none h-s text-s px-s font-medium focus-outline-none" style="width:8rem" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> <datalist id="list"> ${0} </datalist> </div> </div> `),n({"border border-contrast-5 rounded-s font-medium overflow-hidden":!0,"text-disabled":this.disabled}),this.name||this.code,this.name?i(m||(m=j`<span class="text-secondary">${0}</span>`),this.code):"",this.t("delete"),n({"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"))),this.regions.map((e=>{var t,o;const s=null===(o=null===(t=this.data)||void 0===t?void 0:t.values[e])||void 0===o?void 0:o.default;return i(x||(x=j` <div class="flex items-center rounded-s border border-contrast-10 h-s m-xs"> <span class="mx-s"> <span>${0}</span> ${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> `),s||e,s?i(b||(b=j`<span class="text-secondary">${0}</span>`),e):"",this.t("delete"),n({"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"))}))})),n({"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}),this.t("add_region"),this.__newRegion,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newRegion&&this.__addRegion()}),(e=>{const t=e.currentTarget;this.__newRegion=t.value}),n({"flex-shrink-0":!0,"flex items-center justify-center rounded-s transition-colors":!0,"text-transparent cursor-default":!this.__newRegion,"bg-contrast-5 text-body cursor-pointer":!!this.__newRegion,"hover-bg-success hover-text-success-contrast":!!this.__newRegion,"focus-outline-none focus-ring-2 ring-inset ring-primary-50":!!this.__newRegion}),this.disabled||!this.__newRegion,this.__addRegion,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>i(v||(v=j`<option value="${0}">${0}</option>`),e.code,e.default))))}__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 e{constructor(){super(...arguments),this.countries=null,this.regions=null,this.__newCountry=""}static get properties(){return r(r({},super.properties),{},{__newCountry:{attribute:!1},countries:{},regions:{}})}renderControl(){var e,t,o,s;const a=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:{};return i($||($=O` <div class="space-y-s" data-testid="countries"> ${0} <div data-testid="new-country" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent font-medium appearance-none h-m focus-outline-none" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <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:add" class="icon-inline text-m"></iron-icon> </button> </div> </div> <datalist id="list"> ${0} </datalist> <foxy-nucleon infer="" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> `),Object.entries(this._value).map((([e,t])=>{var o,n;let s;try{const t=new URL(null!==(o=this.regions)&&void 0!==o?o:"");t.searchParams.set("country_code",e),s=t.toString()}catch(e){s=""}return i(k||(k=O` <foxy-internal-template-config-form-filter-values-control-item regions="${0}" infer="" code="${0}" name="${0}" href="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </foxy-internal-template-config-form-filter-values-control-item> `),JSON.stringify("*"===t?[]:t),e,_(null===(n=a[e])||void 0===n?void 0:n.default),s,this.disabled,this.readonly,(t=>{const o=r({},this._value),n=t.currentTarget.regions;o[e]=n.length?n:"*",this._value=o}),(()=>{const t=r({},this._value);delete t[e],this._value=t}))})),n({"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}),this.t("add_country"),this.__newCountry,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newCountry&&this.__addCountry()}),(e=>{const t=e.currentTarget;this.__newCountry=t.value}),this.t("create"),n({"mr-xs flex-shrink-0":!0,"flex items-center justify-center rounded-s transition-colors":!0,"text-transparent cursor-default":!this.__newCountry,"bg-contrast-5 text-body cursor-pointer":!!this.__newCountry,"hover-bg-success hover-text-success-contrast":!!this.__newCountry,"focus-outline-none focus-ring-2 ring-inset ring-primary-50":!!this.__newCountry}),!this.__newCountry||this.disabled,this.__addCountry,Object.entries(a).map((([e,t])=>i(S||(S=O`<option value="${0}">${0}</option>`),e,t.default))),_(null!==(s=this.countries)&&void 0!==s?s:void 0),(()=>this.requestUpdate()))}__addCountry(){this._value=r(r({},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 J,N,q,C,F,V,R,T,z=e=>e;const E=p(d(t,"template-config-form"));class D extends E{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=r(r({},t.location_filtering),{},{shipping_filter_values:e,billing_filter_values:e});this.edit({json:JSON.stringify(r(r({},t),{},{location_filtering:o}))})},this.__locationFilteringFilterTypeSetValue=e=>{const t=this.__formJson,o=r(r({},t.location_filtering),{},{shipping_filter_type:e,billing_filter_type:e});this.edit({json:JSON.stringify(r(r({},t),{},{location_filtering:o}))})},this.__foxycompleteShowComboboxGetValue=()=>this.__formJson.foxycomplete.show_combobox?"combobox":"search",this.__foxycompleteShowComboboxSetValue=e=>{const t="combobox"===e,o=r(r({},this.__formJson.foxycomplete),{},{show_combobox:t});this.edit({json:JSON.stringify(r(r({},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 r(r({},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 a(o.join(" ").trim())}renderBody(){var e,t,o,n,r,a,l,c;const u=[["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"]],d=[["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 i(J||(J=z` ${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" 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" regions="${0}" 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" regions="${0}" 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" regions="${0}" 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,d.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)})))),d.map(((e,t)=>i(N||(N=z` <foxy-internal-summary-control infer="cart-group-${0}"> ${0} </foxy-internal-summary-control> `),0===t?"two":"three",e.map((e=>i(q||(q=z` <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,_(null!==(e=this.countries)&&void 0!==e?e:void 0),_(null!==(t=this.regions)&&void 0!==t?t:void 0),this.__locationFilteringFilterValuesSetValue,this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__defaultJSON,_(null!==(o=this.countries)&&void 0!==o?o:void 0),_(null!==(n=this.regions)&&void 0!==n?n:void 0),this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__defaultJSON,_(null!==(r=this.countries)&&void 0!==r?r:void 0),_(null!==(a=this.regions)&&void 0!==a?a: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,s(C||(C=z`<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,u.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)})))),u.map(((e,t)=>i(F||(F=z` <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 i(V||(V=z` <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,s(R||(R=z`<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,s(T||(T=z`<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(),_(null!==(l=this.store)&&void 0!==l?l:null===(c=this.data)||void 0===c?void 0:c._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",D);export{D as TemplateConfigForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-d4e728a4.js";import"./shared-7f7549aa.js";import"./shared-427529a8.js";import{b as e,I as t}from"./shared-b3d72cd9.js";import"./shared-c0159ceb.js";import"./shared-9bd0911a.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-3ff5c3d1.js";import{i as n}from"./shared-53e42a77.js";import"./shared-5fd5805c.js";import"./shared-cbd8c028.js";import"./shared-0ba8919d.js";import"./shared-9ce51b25.js";import"./shared-d7dcb404.js";import"./shared-0881a17c.js";import"./shared-844ab7a4.js";import"./shared-424970b6.js";import"./shared-4e709717.js";import"./shared-d0aed1c1.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-8650b26e.js";import"./shared-704cd73c.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./foxy-copy-to-clipboard.js";import"./shared-01fc874a.js";import"./shared-099c2c3a.js";import"./shared-de7d816d.js";import"./shared-1643e28d.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.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 e{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(t,"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-5212ef4f.js";import"./foxy-spinner.js";import{a as
|
|
1
|
+
import"./shared-5212ef4f.js";import"./foxy-spinner.js";import{a as e}from"./shared-3ff5c3d1.js";import{T as r}from"./shared-9127e26b.js";import{h as s}from"./shared-ba5c42c7.js";import"./shared-099c2c3a.js";import"./shared-9ce51b25.js";import"./shared-1643e28d.js";import"./shared-9bd0911a.js";import"./shared-cb58dfcd.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./shared-d793edcb.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4e709717.js";let d,t,a=e=>e;const o=e(r,"template-set-card");class m extends o{renderBody(){return super.renderBody({title:e=>s(d||(d=a`${0}`),e.description),subtitle:e=>s(t||(t=a`${0}`),e.code)})}}customElements.define("foxy-template-set-card",m);export{m as TemplateSetCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-3d276862.js";import"./shared-25b175fb.js";import"./shared-427529a8.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-b3d72cd9.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 t,a as s}from"./shared-3ff5c3d1.js";import{i as a}from"./shared-53e42a77.js";import{h as d}from"./shared-ba5c42c7.js";import"./shared-c0159ceb.js";import"./shared-0ba8919d.js";import"./shared-9ce51b25.js";import"./shared-424970b6.js";import"./shared-988e3176.js";import"./shared-099c2c3a.js";import"./shared-c6f0f6b1.js";import"./shared-daa5a8b2.js";import"./shared-d5588203.js";import"./shared-234b03f8.js";import"./shared-d4e728a4.js";import"./shared-9bd0911a.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-1643e28d.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-8650b26e.js";import"./shared-704cd73c.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./foxy-copy-to-clipboard.js";import"./shared-01fc874a.js";import"./shared-de7d816d.js";import"./shared-bab2ea2c.js";import"./shared-939a75a1.js";import"./shared-64ed7d2b.js";import"./shared-0881a17c.js";import"./shared-651c44fa.js";import"./shared-844ab7a4.js";import"./shared-cbd8c028.js";import"./shared-d7dcb404.js";import"./shared-c23fa7d5.js";import"./shared-9e6a97dd.js";import"./shared-d0aed1c1.js";import"./shared-9127e26b.js";import"./shared-d793edcb.js";import"./shared-0a177e2c.js";let i,n,l=e=>e;const c=t(s(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 t=[];return(null===(e=this.__languagesLoader)||void 0===e?void 0:e.data)||t.push("language"),(null===(r=this.__localeCodesLoader)||void 0===r?void 0:r.data)||t.push("locale-code"),new o(`${t.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,t,s,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===(s=null===(t=this.__languagesLoader)||void 0===t?void 0:t.data)||void 0===s?void 0:s.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};
|