@foxy.io/elements 1.32.0-beta.3 → 1.32.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +2 -2
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-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 +1 -1
- 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-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 +1 -1
- 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-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 +1 -1
- 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-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-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-4efc6bb8.js → shared-001dfdb6.js} +1 -1
- package/dist/cdn/{shared-b6ab5711.js → shared-02d4f592.js} +1 -1
- package/dist/cdn/shared-03427c91.js +1 -0
- package/dist/cdn/{shared-24c7c37f.js → shared-08e7b7e5.js} +1 -1
- package/dist/cdn/{shared-9de0a899.js → shared-09350008.js} +1 -1
- package/dist/cdn/{shared-838cc86b.js → shared-0e58c95c.js} +1 -1
- package/dist/cdn/{shared-9e94c56d.js → shared-0e80f20c.js} +1 -1
- package/dist/cdn/{shared-a4b0ccf4.js → shared-0ec6badf.js} +1 -1
- package/dist/cdn/{shared-f97ed2ff.js → shared-10674b72.js} +1 -1
- package/dist/cdn/{shared-9ef03974.js → shared-1183a365.js} +1 -1
- package/dist/cdn/{shared-64d9ac2a.js → shared-11902e83.js} +1 -1
- package/dist/cdn/{shared-c9f3f8d3.js → shared-12c2e2c7.js} +1 -1
- package/dist/cdn/{shared-55bc51c8.js → shared-1e827d8b.js} +1 -1
- package/dist/cdn/{shared-4e1b5fa3.js → shared-20b733ff.js} +1 -1
- package/dist/cdn/{shared-978aaaf2.js → shared-297ee58c.js} +1 -1
- package/dist/cdn/{shared-1c169878.js → shared-2ae2767e.js} +1 -1
- package/dist/cdn/{shared-91560256.js → shared-2d2e210c.js} +1 -1
- package/dist/cdn/{shared-1cd2db2d.js → shared-32af1656.js} +1 -1
- package/dist/cdn/{shared-45bef1ac.js → shared-33c54c6e.js} +1 -1
- package/dist/cdn/{shared-f1b29592.js → shared-35093aea.js} +7 -7
- package/dist/cdn/{shared-f0d70be1.js → shared-394d6660.js} +1 -1
- package/dist/cdn/{shared-537d2efe.js → shared-395b2f4c.js} +1 -1
- package/dist/cdn/{shared-ed9c9bab.js → shared-3e302c9e.js} +1 -1
- package/dist/cdn/{shared-ac6e1790.js → shared-513e54c9.js} +1 -1
- package/dist/cdn/{shared-783f6e58.js → shared-51415f88.js} +1 -1
- package/dist/cdn/{shared-30b4c05b.js → shared-532dd9aa.js} +1 -1
- package/dist/cdn/{shared-1cfea4b6.js → shared-555c2785.js} +1 -1
- package/dist/cdn/{shared-eff5dcb0.js → shared-58e2c070.js} +1 -1
- package/dist/cdn/{shared-3a066450.js → shared-5f00bc80.js} +1 -1
- package/dist/cdn/{shared-c6b69d4e.js → shared-65c53765.js} +1 -1
- package/dist/cdn/{shared-d713c00f.js → shared-6745d2ec.js} +1 -1
- package/dist/cdn/{shared-906fe068.js → shared-676a6445.js} +1 -1
- package/dist/cdn/{shared-de45ad84.js → shared-68470d06.js} +1 -1
- package/dist/cdn/{shared-be093279.js → shared-68ae5d92.js} +1 -1
- package/dist/cdn/{shared-08c637a9.js → shared-772745f5.js} +1 -1
- package/dist/cdn/shared-7c1d9bf8.js +1 -0
- package/dist/cdn/{shared-4a86d1ca.js → shared-8405bdfa.js} +1 -1
- package/dist/cdn/{shared-25324930.js → shared-89db9c39.js} +1 -1
- package/dist/cdn/{shared-d8cd61ed.js → shared-8f8c3902.js} +1 -1
- package/dist/cdn/{shared-85989cf3.js → shared-94965d32.js} +1 -1
- package/dist/cdn/{shared-8a8bfd72.js → shared-960eac62.js} +1 -1
- package/dist/cdn/{shared-787e52c4.js → shared-a62af87b.js} +1 -1
- package/dist/cdn/{shared-5ff1affd.js → shared-a811962b.js} +1 -1
- package/dist/cdn/{shared-26425c01.js → shared-abc64854.js} +1 -1
- package/dist/cdn/{shared-08e42e78.js → shared-acba6fbd.js} +1 -1
- package/dist/cdn/{shared-0f261023.js → shared-ad9eae20.js} +1 -1
- package/dist/cdn/{shared-51bb937b.js → shared-af70646d.js} +1 -1
- package/dist/cdn/{shared-011d6240.js → shared-b4b7767a.js} +1 -1
- package/dist/cdn/{shared-45ecb912.js → shared-b6c5ab3b.js} +1 -1
- package/dist/cdn/shared-b79fd251.js +1 -0
- package/dist/cdn/{shared-0a24f318.js → shared-b7ee8271.js} +1 -1
- package/dist/cdn/{shared-c7ffb9f2.js → shared-b8bdf3ae.js} +2 -2
- package/dist/cdn/{shared-620dccaa.js → shared-b9af1789.js} +1 -1
- package/dist/cdn/{shared-4d543043.js → shared-bd59ddc4.js} +1 -1
- package/dist/cdn/{shared-0e44bfff.js → shared-c1c20484.js} +1 -1
- package/dist/cdn/{shared-37cf92bd.js → shared-c1c481c3.js} +1 -1
- package/dist/cdn/{shared-c89f7ad5.js → shared-ca0700a7.js} +1 -1
- package/dist/cdn/{shared-b74187e9.js → shared-d6bf2433.js} +1 -1
- package/dist/cdn/{shared-8f3fdf8b.js → shared-de2dfe65.js} +5 -5
- package/dist/cdn/{shared-34c84b9f.js → shared-e24f4d30.js} +1 -1
- package/dist/cdn/{shared-c40a4b0c.js → shared-e86b8958.js} +1 -1
- package/dist/cdn/{shared-9411a937.js → shared-e95ac70b.js} +1 -1
- package/dist/cdn/{shared-e3647540.js → shared-ea378d0a.js} +1 -1
- package/dist/cdn/{shared-3491d10e.js → shared-f0c7a963.js} +1 -1
- package/dist/cdn/{shared-e1850e5f.js → shared-f23cde6c.js} +1 -1
- package/dist/cdn/{shared-045bd59c.js → shared-f7474be7.js} +1 -1
- package/dist/cdn/{shared-57cc81b4.js → shared-fa5e0813.js} +1 -1
- package/dist/cdn/{shared-8b9ae780.js → shared-fc176bc4.js} +1 -1
- package/dist/cdn/translations/coupon-form/en.json +39 -39
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/InternalAsyncResourceLinkListControl.js +13 -27
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/InternalAsyncResourceLinkListControl.js.map +1 -1
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js +123 -139
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js.map +1 -1
- package/dist/elements/internal/InternalQueryBuilderControl/InternalQueryBuilderControl.d.ts +2 -2
- package/dist/elements/internal/InternalQueryBuilderControl/InternalQueryBuilderControl.js +28 -47
- package/dist/elements/internal/InternalQueryBuilderControl/InternalQueryBuilderControl.js.map +1 -1
- package/dist/elements/public/CouponForm/CouponForm.d.ts +1 -0
- package/dist/elements/public/CouponForm/CouponForm.js +27 -24
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/CouponForm/internal/InternalCouponFormRulesControl/InternalCouponFormRulesControl.js +9 -27
- package/dist/elements/public/CouponForm/internal/InternalCouponFormRulesControl/InternalCouponFormRulesControl.js.map +1 -1
- package/dist/elements/public/DiscountBuilder/DiscountBuilder.js +1 -5
- package/dist/elements/public/DiscountBuilder/DiscountBuilder.js.map +1 -1
- package/dist/elements/public/QueryBuilder/QueryBuilder.d.ts +4 -2
- package/dist/elements/public/QueryBuilder/QueryBuilder.js +6 -3
- package/dist/elements/public/QueryBuilder/QueryBuilder.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/Rule.js +4 -3
- package/dist/elements/public/QueryBuilder/components/Rule.js.map +1 -1
- package/dist/elements/public/QueryBuilder/utils/stringify.d.ts +1 -1
- package/dist/elements/public/QueryBuilder/utils/stringify.js +7 -5
- package/dist/elements/public/QueryBuilder/utils/stringify.js.map +1 -1
- package/dist/mixins/themeable.js +0 -5
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-56d1eae5.js +0 -1
- package/dist/cdn/shared-73c1d31e.js +0 -1
- package/dist/cdn/shared-97e1f413.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-ed9c9bab.js";import"./shared-85989cf3.js";import"./shared-787e52c4.js";import"./shared-25324930.js";import"./shared-b74187e9.js";import"./shared-ac6e1790.js";import"./shared-1c169878.js";import"./shared-838cc86b.js";import{I as t}from"./shared-a4b0ccf4.js";import"./foxy-nucleon-element.js";import"./shared-51bb937b.js";import{_ as e}from"./shared-d1195c27.js";import{R as o,a as n}from"./shared-4efc6bb8.js";import{i as r}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import{a as i}from"./shared-9cf15285.js";import"./shared-24c7c37f.js";import"./shared-4d543043.js";import"./shared-8a8bfd72.js";import"./shared-1cfea4b6.js";import"./shared-e1850e5f.js";import"./shared-4e1b5fa3.js";import"./shared-55bc51c8.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-045bd59c.js";import"./shared-011d6240.js";import"./shared-d8cd61ed.js";import"./shared-9e94c56d.js";import"./shared-de45ad84.js";import"./shared-61ade33e.js";import"./shared-9411a937.js";import"./shared-be093279.js";import"./shared-f0d70be1.js";import"./shared-34c84b9f.js";import"./shared-f97ed2ff.js";import"./shared-c7ffb9f2.js";import"./shared-906fe068.js";import"./shared-651c44fa.js";import"./shared-08e42e78.js";import"./shared-9de0a899.js";import"./shared-1cd2db2d.js";import"./shared-c9f3f8d3.js";import"./shared-c89f7ad5.js";import"./shared-783f6e58.js";import"./foxy-copy-to-clipboard.js";import"./shared-64d9ac2a.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,l,u,c,m,f,_,p,y,d,h,g=t=>t;const x=o(n(t,"store-form"));class b extends x{constructor(){super(...arguments),this.customerPasswordHashTypes=null,this.shippingAddressTypes=null,this.storeVersions=null,this.checkoutTypes=null,this.localeCodes=null,this.languages=null,this.timezones=null,this.countries=null,this.regions=null,this.__currencyStyleOptions=[{rawLabel:"12.34",value:"101"},{rawLabel:"USD 12.34",value:"001"},{rawLabel:"$12.34",value:"000"},{rawLabel:"12",value:"111"},{rawLabel:"USD 12",value:"011"},{rawLabel:"$12",value:"010"}],this.__currencyStyleGetValue=()=>({101:"101",100:"101","001":"001","000":"000",111:"111",110:"111","011":"011","010":"010"}[[this.form.hide_currency_symbol,this.form.hide_decimal_characters,this.form.use_international_currency_symbol].map((t=>Number(Boolean(t)))).join("")]),this.__currencyStyleSetValue=t=>{this.edit({hide_currency_symbol:Boolean(Number(t[0])),hide_decimal_characters:Boolean(Number(t[1])),use_international_currency_symbol:Boolean(Number(t[2]))})},this.__appSessionTimeOptions=[{value:"s",label:"second"},{value:"m",label:"minute"},{value:"h",label:"hour"},{value:"d",label:"day"}],this.__getStoreEmailValue=()=>{var t;return(null!==(t=this.form.store_email)&&void 0!==t?t:"").split(",").map((t=>({value:t.trim()}))).filter((({value:t})=>t.length>0))},this.__setStoreEmailValue=t=>{this.edit({store_email:t.map((t=>t.value)).join(",")})},this.__getUseSmtpConfigValue=()=>!!this.form.smtp_config,this.__setUseSmtpConfigValue=t=>{t?this.edit({smtp_config:JSON.stringify({username:"",password:"",security:"",host:"",port:""})}):this.edit({smtp_config:""})},this.__getAppSessionTimeValue=()=>{const t=this.form.app_session_time||43200;return t%86400==0?t/86400+"d":t%3600==0?t/3600+"h":t%60==0?t/60+"m":`${t}s`},this.__setAppSessionTimeValue=t=>{const e=t[t.length-1],o=parseInt(t.substring(0,t.length-1));this.edit({app_session_time:{d:86400,h:3600,m:60,s:1}[e]*o})},this.__setStoreDomainValue=t=>{if(t.endsWith(".foxycart.com")){const e=t.substring(0,t.length-13);this.edit({store_domain:e,use_remote_domain:e.includes(".")})}else this.edit({store_domain:t,use_remote_domain:t.includes(".")})},this.__smtpConfigHostGetValue=()=>this.__getSmtpConfig().host,this.__smtpConfigHostSetValue=t=>{this.__setSmtpConfig("host",t)},this.__smtpConfigPortGetValue=()=>{const t=parseInt(this.__getSmtpConfig().port);return isNaN(t)?void 0:t},this.__smtpConfigPortSetValue=t=>{this.__setSmtpConfig("port",String(t))},this.__smtpConfigUsernameGetValue=()=>this.__getSmtpConfig().username,this.__smtpConfigUsernameSetValue=t=>{this.__setSmtpConfig("username",t)},this.__smtpConfigPasswordGetValue=()=>this.__getSmtpConfig().password,this.__smtpConfigPasswordSetValue=t=>{this.__setSmtpConfig("password",t)},this.__smtpConfigSecurityGetValue=()=>this.__getSmtpConfig().security,this.__smtpConfigSecuritySetValue=t=>{this.__setSmtpConfig("security",t)},this.__smtpConfigSecurityOptions=[{label:"option_ssl",value:"ssl"},{label:"option_tls",value:"tls"},{label:"option_none",value:""}],this.__webhookKeyGeneratorOptions={length:32,separator:""},this.__webhookKeyApiLegacyGetValue=()=>this.__getWebhookKey().api_legacy,this.__webhookKeyApiLegacySetValue=t=>{this.__setWebhookKey("api_legacy",t)},this.__webhookKeyCartSigningGetValue=()=>this.__getWebhookKey().cart_signing,this.__webhookKeyCartSigningSetValue=t=>{this.__setWebhookKey("cart_signing",t)},this.__webhookKeyXmlDatafeedGetValue=()=>this.__getWebhookKey().xml_datafeed,this.__webhookKeyXmlDatafeedSetValue=t=>{this.__setWebhookKey("xml_datafeed",t)},this.__webhookKeySsoGetValue=()=>this.__getWebhookKey().sso,this.__webhookKeySsoSetValue=t=>{this.__setWebhookKey("sso",t)}}static get properties(){return e(e({},super.properties),{},{customerPasswordHashTypes:{attribute:"customer-password-hash-types"},shippingAddressTypes:{attribute:"shipping-address-types"},storeVersions:{attribute:"store-versions"},checkoutTypes:{attribute:"checkout-types"},localeCodes:{attribute:"locale-codes"},languages:{},timezones:{},countries:{},regions:{}})}static get v8n(){return[({store_name:t})=>!!t||"store-name:v8n_required",({store_name:t})=>t&&t.length<=50||"store-name:v8n_too_long",({store_domain:t})=>!!t||"store-domain:v8n_required",({store_domain:t})=>t&&t.length<=100||"store-domain:v8n_too_long",({store_url:t})=>!!t||"store-url:v8n_required",({store_url:t})=>t&&t.length<=300||"store-url:v8n_too_long",({receipt_continue_url:t})=>!t||t.length<=300||"receipt-continue-url:v8n_too_long",({store_email:t})=>!!t||"store-email:v8n_required",({store_email:t})=>t&&t.length<=300||"store-email:v8n_too_long",({from_email:t})=>!t||t.length<=100||"from-email:v8n_too_long",({smtp_config:t})=>!t||t.length<=1e3||"use-smtp-config:v8n_too_long",({postal_code:t})=>!!t||"postal-code:v8n_required",({postal_code:t})=>t&&t.length<=50||"postal-code:v8n_too_long",({region:t})=>!!t||"region:v8n_required",({region:t})=>t&&t.length<=100||"region:v8n_too_long",({country:t})=>!!t||"country:v8n_required",({logo_url:t})=>!t||t.length<=200||"logo-url:v8n_too_long",({webhook_url:t,use_webhook:e})=>!e||!t||t.length<=300||"webhook-url:v8n_too_long",({webhook_key:t,use_webhook:e,use_cart_validation:o})=>!e&&!o||!!t||"webhook-key:v8n_required",({webhook_key:t,use_webhook:e,use_cart_validation:o})=>!e&&!o||!t||t.length<=200||"webhook-key:v8n_too_long",({single_sign_on_url:t,use_single_sign_on:e})=>!e||!!t||"single-sign-on-url:v8n_required",({single_sign_on_url:t,use_single_sign_on:e})=>!e||!t||t.length<=300||"single-sign-on-url:v8n_too_long",({customer_password_hash_config:t})=>!t||String(t).length<=100||"customer-password-hash-config:v8n_too_long",({unified_order_entry_password:t})=>!t||String(t).length<=100||"unified-order-entry-password:v8n_too_long",({custom_display_id_config:t})=>!t||String(t).length<=500||"custom-display-id-config-enabled:v8n_too_long"]}get headerSubtitleOptions(){var t;return{context:(null===(t=this.data)||void 0===t?void 0:t.is_active)?"active":"inactive"}}renderBody(){var t,e,o,n,r,i,h,x,b,v,w,$,V,S;const j=this.t(this.form.use_remote_domain&&!(null===(t=this.data)||void 0===t?void 0:t.use_remote_domain)?"essentials.store-domain.custom_domain_note":"essentials.store-domain.helper_text"),C=!this.form.store_domain||this.form.store_domain.includes(".")?"":".foxycart.com",k=this.__renderLoader(1),K=this.__renderLoader(2),q=this.__renderLoader(7),I=this.__renderLoader(8),O=this.__renderLoader(9),G=Object.entries(null!==(o=null===(e=null==K?void 0:K.data)||void 0===e?void 0:e.values)&&void 0!==o?o:{}),T=null!==(r=null===(n=null==q?void 0:q.data)||void 0===n?void 0:n.values.timezone)&&void 0!==r?r:[],D=Object.values(null!==(h=null===(i=null==I?void 0:I.data)||void 0===i?void 0:i.values)&&void 0!==h?h:{}),L=Object.values(null!==(b=null===(x=null==O?void 0:O.data)||void 0===x?void 0:x.values)&&void 0!==b?b:{}),E=Object.entries(null!==(w=null===(v=null==k?void 0:k.data)||void 0===v?void 0:v.values)&&void 0!==w?w:{}),J=E.map((t=>({rawLabel:t[1].description,value:t[0]}))),P=G.map((([t,e])=>({rawLabel:e,value:t}))),N=T.map((t=>({rawLabel:t.description,value:t.timezone}))),M=D.map((t=>({rawLabel:t.default,value:t.cc2}))),U=L.map((t=>({rawLabel:t.default,value:t.code})));let W;try{const t=new URL(null!==($=this.regions)&&void 0!==$?$:""),e=this.form.country;e&&t.searchParams.set("country_code",e),W=t.toString()}catch(t){W=void 0}const A=this.__getCustomDisplayIdConfig(),H=A.transaction_journal_entries,z=H.log_detail_request_types,B=this.__displayIdExamples,X=this.__journalIdExamples;return s(a||(a=g` ${0} <foxy-internal-summary-control infer="essentials"> <foxy-internal-text-control layout="summary-item" infer="store-name"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="logo-url"> </foxy-internal-text-control> <foxy-internal-text-control helper-text="${0}" layout="summary-item" suffix="${0}" infer="store-domain" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-url"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-switch-control infer="is-maintenance-mode"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-editable-list-control layout="summary-item" infer="store-email" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-select-control layout="summary-item" infer="timezone" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control layout="summary-item" infer="country" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control layout="summary-item" infer="postal-code"> </foxy-internal-text-control> <foxy-internal-select-control layout="summary-item" infer="currency-style" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="legacy-api"> <foxy-internal-password-control layout="summary-item" infer="webhook-key-api-legacy" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="emails"> <foxy-internal-text-control layout="summary-item" infer="from-email" placeholder="${0}"> </foxy-internal-text-control> <foxy-internal-switch-control infer="use-email-dns" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="use-smtp-config" helper-text-as-tooltip .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="shipping"> <foxy-internal-select-control layout="summary-item" infer="shipping-address-type" .options="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="features-multiship" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="require-signed-shipping-rates" helper-text-as-tooltip> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="cart"> <foxy-internal-frequency-control layout="summary-item" infer="app-session-time" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-switch-control infer="products-require-expires-property" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="use-cart-validation" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-cart-signing" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout"> <foxy-internal-select-control layout="summary-item" infer="customer-password-hash-type" .options="${0}" .setValue="${0}"> </foxy-internal-select-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout" label="" helper-text=""> <foxy-internal-password-control layout="summary-item" infer="unified-order-entry-password" show-generator> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout" label="" helper-text=""> <foxy-internal-switch-control infer="use-single-sign-on"></foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="receipt"> <foxy-internal-text-control layout="summary-item" infer="receipt-continue-url"> </foxy-internal-text-control> <foxy-internal-switch-control infer="bcc-on-receipt-email"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="custom-display-id-config"> <foxy-internal-switch-control infer="custom-display-id-config-enabled" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control helper-text="" label="" infer="custom-display-id-config"> <foxy-internal-switch-control infer="custom-display-id-config-transaction-journal-entries-enabled" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="xml-datafeed"> <foxy-internal-switch-control infer="use-webhook"></foxy-internal-switch-control> ${0} </foxy-internal-summary-control> ${0} ${0} ${0} ${0} ${0} ${0} `),this.renderHeader(),j,C,this.__setStoreDomainValue,this.__getStoreEmailValue,this.__setStoreEmailValue,N,M,U.length>0?s(l||(l=g` <foxy-internal-select-control layout="summary-item" infer="region" .options="${0}"> </foxy-internal-select-control> `),U):s(u||(u=g` <foxy-internal-text-control layout="summary-item" infer="region"> </foxy-internal-text-control> `)),this.__currencyStyleOptions,this.__currencyStyleGetValue,this.__currencyStyleSetValue,this.__webhookKeyGeneratorOptions,this.__webhookKeyApiLegacyGetValue,this.__webhookKeyApiLegacySetValue,null!==(S=null===(V=this.__getStoreEmailValue()[0])||void 0===V?void 0:V.value)&&void 0!==S?S:this.t("emails.from-email.placeholder"),this.__getUseSmtpConfigValue,this.__setUseSmtpConfigValue,this.form.smtp_config?s(c||(c=g` <foxy-internal-text-control layout="summary-item" infer="smtp-config-host" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" infer="smtp-config-port" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-text-control layout="summary-item" infer="smtp-config-username" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="smtp-config-password" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-select-control layout="summary-item" infer="smtp-config-security" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> `),this.__smtpConfigHostGetValue,this.__smtpConfigHostSetValue,this.__smtpConfigPortGetValue,this.__smtpConfigPortSetValue,this.__smtpConfigUsernameGetValue,this.__smtpConfigUsernameSetValue,this.__smtpConfigPasswordGetValue,this.__smtpConfigPasswordSetValue,this.__smtpConfigSecurityGetValue,this.__smtpConfigSecuritySetValue,this.__smtpConfigSecurityOptions):"",P,this.__getAppSessionTimeValue,this.__setAppSessionTimeValue,this.__appSessionTimeOptions,this.__webhookKeyGeneratorOptions,this.__webhookKeyCartSigningGetValue,this.__webhookKeyCartSigningSetValue,J,(t=>{var e;const o=E.find((([e])=>e===t));this.edit({customer_password_hash_type:t,customer_password_hash_config:null!==(e=null==o?void 0:o[1].config)&&void 0!==e?e:""})}),"number"==typeof this.form.customer_password_hash_config?s(m||(m=g` <foxy-internal-number-control layout="summary-item" infer="customer-password-hash-config"> </foxy-internal-number-control> `)):s(f||(f=g` <foxy-internal-text-control layout="summary-item" infer="customer-password-hash-config"> </foxy-internal-text-control> `)),this.form.use_single_sign_on?s(_||(_=g` <foxy-internal-text-control layout="summary-item" infer="single-sign-on-url"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-sso" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__webhookKeyGeneratorOptions,this.__webhookKeySsoGetValue,this.__webhookKeySsoSetValue):"",(()=>A.enabled),(t=>{this.__setCustomDisplayIdConfig("enabled",t)}),A.enabled?s(p||(p=g` <foxy-internal-number-control layout="summary-item" infer="custom-display-id-config-start" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="custom-display-id-config-length" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-suffix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <div class="text-right text-secondary"> <p class="flex justify-end"> <foxy-i18n infer="" key="custom-display-id-config-first-example"></foxy-i18n> <span style="font-family:monospace"> ${0}</span> </p> <p class="flex justify-end"> <foxy-i18n infer="" key="custom-display-id-config-random-example"></foxy-i18n> <span style="font-family:monospace"> ${0}</span> </p> </div> `),(()=>parseInt(A.start||"0")),(t=>{this.__setCustomDisplayIdConfig("start",String(t))}),(()=>parseInt(A.length||"0")),(t=>{this.__setCustomDisplayIdConfig("length",String(t))}),(()=>A.prefix),(t=>{this.__setCustomDisplayIdConfig("prefix",t)}),(()=>A.suffix),(t=>{this.__setCustomDisplayIdConfig("suffix",t)}),null==B?void 0:B.first,null==B?void 0:B.random):"",(()=>H.enabled),(t=>{this.__setTransactionJournalEntriesConfig("enabled",t)}),H.enabled?s(y||(y=g` <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-authcapture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-capture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-void-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-refund-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-transaction-separator" class="col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <div class="sm-col-span-2 leading-s text-right text-secondary"> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-authcapture-example"> </foxy-i18n> <span style="font-family:monospace"> ${0} </span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-capture-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-void-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-refund-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> </div> `),(()=>z.transaction_authcapture.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_authcapture",t)}),(()=>z.transaction_capture.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_capture",t)}),(()=>z.transaction_void.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_void",t)}),(()=>z.transaction_refund.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_refund",t)}),(()=>H.transaction_separator),(t=>{this.__setTransactionJournalEntriesConfig("transaction_separator",t)}),null==X?void 0:X.authcapture,null==X?void 0:X.capture,null==X?void 0:X.void,null==X?void 0:X.refund):"",this.form.use_webhook?s(d||(d=g` <foxy-internal-text-control layout="summary-item" infer="webhook-url"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-xml-datafeed" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__webhookKeyGeneratorOptions,this.__webhookKeyXmlDatafeedGetValue,this.__webhookKeyXmlDatafeedSetValue):"",super.renderBody(),k.render(this.customerPasswordHashTypes),K.render(this.shippingAddressTypes),q.render(this.timezones),I.render(this.countries),O.render(W))}get __displayIdExamples(){const t=this.__getCustomDisplayIdConfig(),e=parseInt(t.start||"0"),o=parseInt(t.length||"0")-t.prefix.length-t.suffix.length,n=Math.min(e+Math.floor(Math.random()*Math.pow(10,o)),Math.pow(10,o)-1);if(t.start&&t.length&&e/10<=o)return{first:`${t.prefix}${e.toString().padStart(o,"0")}${t.suffix}`,random:`${t.prefix}${n.toString().padStart(o,"0")}${t.suffix}`}}get __journalIdExamples(){const t=this.__getCustomDisplayIdConfig(),e=t.transaction_journal_entries,o=parseInt(t.start||"0"),n=parseInt(t.length||"0")-t.prefix.length-t.suffix.length,r=Math.min(o+Math.floor(Math.random()*Math.pow(10,n)),Math.pow(10,n)-1),s=`${t.prefix}${r.toString().padStart(n,"0")}${t.suffix}`,i=Math.floor(1e3*Math.random()),a=String(i).padStart(3,"0");if(t.start&&t.length&&o/10<=n)return{authcapture:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_authcapture.prefix}${a}`,capture:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_capture.prefix}${a}`,refund:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_refund.prefix}${a}`,void:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_void.prefix}${a}`}}__getWebhookKey(){var t,e;let o;try{o=JSON.parse(null!==(t=this.form.webhook_key)&&void 0!==t?t:"")}catch(t){const n=null!==(e=this.form.webhook_key)&&void 0!==e?e:"";o={cart_signing:n,xml_datafeed:n,api_legacy:n,sso:n}}return o}__setWebhookKey(t,e){const o=this.__getWebhookKey();o[t]=e,this.edit({webhook_key:JSON.stringify(o)})}__getCustomDisplayIdConfig(){var t;const e={enabled:!1,start:"0",length:"0",prefix:"",suffix:"",transaction_journal_entries:{enabled:!1,transaction_separator:"",log_detail_request_types:{transaction_authcapture:{prefix:""},transaction_capture:{prefix:""},transaction_refund:{prefix:""},transaction_void:{prefix:""}}}};let o;try{o=JSON.parse(null!==(t=this.form.custom_display_id_config)&&void 0!==t?t:"")}catch(t){o=i(e)}return o}__setCustomDisplayIdConfig(t,e){const o=this.__getCustomDisplayIdConfig();o[t]=e,this.edit({custom_display_id_config:JSON.stringify(o)})}__getTransactionJournalEntriesConfig(){return this.__getCustomDisplayIdConfig().transaction_journal_entries}__setTransactionJournalEntriesConfig(t,e){const o=this.__getCustomDisplayIdConfig().transaction_journal_entries;o[t]=e,this.__setCustomDisplayIdConfig("transaction_journal_entries",o)}__setTransactionJournalEntriesPrefix(t,e){const o=this.__getTransactionJournalEntriesConfig();o.log_detail_request_types[t].prefix=e,this.__setTransactionJournalEntriesConfig("log_detail_request_types",o.log_detail_request_types)}__getSmtpConfig(){var t;let e;try{e=JSON.parse(null!==(t=this.form.smtp_config)&&void 0!==t?t:"")}catch(t){e={username:"",password:"",security:"",host:"",port:""}}return e}__setSmtpConfig(t,e){const o=this.__getSmtpConfig();o[t]=e,this.edit({smtp_config:JSON.stringify(o)})}__renderLoader(t){var e;const o=`loader-${t}`;return{data:null===(e=this.renderRoot.querySelector(`#${o}`))||void 0===e?void 0:e.data,render:t=>s(h||(h=g` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),r(null!=t?t:void 0),o,(()=>this.requestUpdate()))}}}customElements.define("foxy-store-form",b);export{b as StoreForm};
|
|
1
|
+
import"./shared-3e302c9e.js";import"./shared-94965d32.js";import"./shared-a62af87b.js";import"./shared-89db9c39.js";import"./shared-d6bf2433.js";import"./shared-513e54c9.js";import"./shared-2ae2767e.js";import"./shared-0e58c95c.js";import{I as t}from"./shared-0ec6badf.js";import"./foxy-nucleon-element.js";import"./shared-af70646d.js";import{_ as e}from"./shared-d1195c27.js";import{R as o,a as n}from"./shared-001dfdb6.js";import{i as r}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import{a as i}from"./shared-9cf15285.js";import"./shared-08e7b7e5.js";import"./shared-bd59ddc4.js";import"./shared-960eac62.js";import"./shared-555c2785.js";import"./shared-f23cde6c.js";import"./shared-20b733ff.js";import"./shared-1e827d8b.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-f7474be7.js";import"./shared-b4b7767a.js";import"./shared-8f8c3902.js";import"./shared-0e80f20c.js";import"./shared-68470d06.js";import"./shared-61ade33e.js";import"./shared-e95ac70b.js";import"./shared-68ae5d92.js";import"./shared-394d6660.js";import"./shared-e24f4d30.js";import"./shared-10674b72.js";import"./shared-b8bdf3ae.js";import"./shared-676a6445.js";import"./shared-651c44fa.js";import"./shared-acba6fbd.js";import"./shared-09350008.js";import"./shared-32af1656.js";import"./shared-12c2e2c7.js";import"./shared-ca0700a7.js";import"./shared-51415f88.js";import"./foxy-copy-to-clipboard.js";import"./shared-11902e83.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,l,u,c,m,f,_,p,y,d,h,g=t=>t;const x=o(n(t,"store-form"));class b extends x{constructor(){super(...arguments),this.customerPasswordHashTypes=null,this.shippingAddressTypes=null,this.storeVersions=null,this.checkoutTypes=null,this.localeCodes=null,this.languages=null,this.timezones=null,this.countries=null,this.regions=null,this.__currencyStyleOptions=[{rawLabel:"12.34",value:"101"},{rawLabel:"USD 12.34",value:"001"},{rawLabel:"$12.34",value:"000"},{rawLabel:"12",value:"111"},{rawLabel:"USD 12",value:"011"},{rawLabel:"$12",value:"010"}],this.__currencyStyleGetValue=()=>({101:"101",100:"101","001":"001","000":"000",111:"111",110:"111","011":"011","010":"010"}[[this.form.hide_currency_symbol,this.form.hide_decimal_characters,this.form.use_international_currency_symbol].map((t=>Number(Boolean(t)))).join("")]),this.__currencyStyleSetValue=t=>{this.edit({hide_currency_symbol:Boolean(Number(t[0])),hide_decimal_characters:Boolean(Number(t[1])),use_international_currency_symbol:Boolean(Number(t[2]))})},this.__appSessionTimeOptions=[{value:"s",label:"second"},{value:"m",label:"minute"},{value:"h",label:"hour"},{value:"d",label:"day"}],this.__getStoreEmailValue=()=>{var t;return(null!==(t=this.form.store_email)&&void 0!==t?t:"").split(",").map((t=>({value:t.trim()}))).filter((({value:t})=>t.length>0))},this.__setStoreEmailValue=t=>{this.edit({store_email:t.map((t=>t.value)).join(",")})},this.__getUseSmtpConfigValue=()=>!!this.form.smtp_config,this.__setUseSmtpConfigValue=t=>{t?this.edit({smtp_config:JSON.stringify({username:"",password:"",security:"",host:"",port:""})}):this.edit({smtp_config:""})},this.__getAppSessionTimeValue=()=>{const t=this.form.app_session_time||43200;return t%86400==0?t/86400+"d":t%3600==0?t/3600+"h":t%60==0?t/60+"m":`${t}s`},this.__setAppSessionTimeValue=t=>{const e=t[t.length-1],o=parseInt(t.substring(0,t.length-1));this.edit({app_session_time:{d:86400,h:3600,m:60,s:1}[e]*o})},this.__setStoreDomainValue=t=>{if(t.endsWith(".foxycart.com")){const e=t.substring(0,t.length-13);this.edit({store_domain:e,use_remote_domain:e.includes(".")})}else this.edit({store_domain:t,use_remote_domain:t.includes(".")})},this.__smtpConfigHostGetValue=()=>this.__getSmtpConfig().host,this.__smtpConfigHostSetValue=t=>{this.__setSmtpConfig("host",t)},this.__smtpConfigPortGetValue=()=>{const t=parseInt(this.__getSmtpConfig().port);return isNaN(t)?void 0:t},this.__smtpConfigPortSetValue=t=>{this.__setSmtpConfig("port",String(t))},this.__smtpConfigUsernameGetValue=()=>this.__getSmtpConfig().username,this.__smtpConfigUsernameSetValue=t=>{this.__setSmtpConfig("username",t)},this.__smtpConfigPasswordGetValue=()=>this.__getSmtpConfig().password,this.__smtpConfigPasswordSetValue=t=>{this.__setSmtpConfig("password",t)},this.__smtpConfigSecurityGetValue=()=>this.__getSmtpConfig().security,this.__smtpConfigSecuritySetValue=t=>{this.__setSmtpConfig("security",t)},this.__smtpConfigSecurityOptions=[{label:"option_ssl",value:"ssl"},{label:"option_tls",value:"tls"},{label:"option_none",value:""}],this.__webhookKeyGeneratorOptions={length:32,separator:""},this.__webhookKeyApiLegacyGetValue=()=>this.__getWebhookKey().api_legacy,this.__webhookKeyApiLegacySetValue=t=>{this.__setWebhookKey("api_legacy",t)},this.__webhookKeyCartSigningGetValue=()=>this.__getWebhookKey().cart_signing,this.__webhookKeyCartSigningSetValue=t=>{this.__setWebhookKey("cart_signing",t)},this.__webhookKeyXmlDatafeedGetValue=()=>this.__getWebhookKey().xml_datafeed,this.__webhookKeyXmlDatafeedSetValue=t=>{this.__setWebhookKey("xml_datafeed",t)},this.__webhookKeySsoGetValue=()=>this.__getWebhookKey().sso,this.__webhookKeySsoSetValue=t=>{this.__setWebhookKey("sso",t)}}static get properties(){return e(e({},super.properties),{},{customerPasswordHashTypes:{attribute:"customer-password-hash-types"},shippingAddressTypes:{attribute:"shipping-address-types"},storeVersions:{attribute:"store-versions"},checkoutTypes:{attribute:"checkout-types"},localeCodes:{attribute:"locale-codes"},languages:{},timezones:{},countries:{},regions:{}})}static get v8n(){return[({store_name:t})=>!!t||"store-name:v8n_required",({store_name:t})=>t&&t.length<=50||"store-name:v8n_too_long",({store_domain:t})=>!!t||"store-domain:v8n_required",({store_domain:t})=>t&&t.length<=100||"store-domain:v8n_too_long",({store_url:t})=>!!t||"store-url:v8n_required",({store_url:t})=>t&&t.length<=300||"store-url:v8n_too_long",({receipt_continue_url:t})=>!t||t.length<=300||"receipt-continue-url:v8n_too_long",({store_email:t})=>!!t||"store-email:v8n_required",({store_email:t})=>t&&t.length<=300||"store-email:v8n_too_long",({from_email:t})=>!t||t.length<=100||"from-email:v8n_too_long",({smtp_config:t})=>!t||t.length<=1e3||"use-smtp-config:v8n_too_long",({postal_code:t})=>!!t||"postal-code:v8n_required",({postal_code:t})=>t&&t.length<=50||"postal-code:v8n_too_long",({region:t})=>!!t||"region:v8n_required",({region:t})=>t&&t.length<=100||"region:v8n_too_long",({country:t})=>!!t||"country:v8n_required",({logo_url:t})=>!t||t.length<=200||"logo-url:v8n_too_long",({webhook_url:t,use_webhook:e})=>!e||!t||t.length<=300||"webhook-url:v8n_too_long",({webhook_key:t,use_webhook:e,use_cart_validation:o})=>!e&&!o||!!t||"webhook-key:v8n_required",({webhook_key:t,use_webhook:e,use_cart_validation:o})=>!e&&!o||!t||t.length<=200||"webhook-key:v8n_too_long",({single_sign_on_url:t,use_single_sign_on:e})=>!e||!!t||"single-sign-on-url:v8n_required",({single_sign_on_url:t,use_single_sign_on:e})=>!e||!t||t.length<=300||"single-sign-on-url:v8n_too_long",({customer_password_hash_config:t})=>!t||String(t).length<=100||"customer-password-hash-config:v8n_too_long",({unified_order_entry_password:t})=>!t||String(t).length<=100||"unified-order-entry-password:v8n_too_long",({custom_display_id_config:t})=>!t||String(t).length<=500||"custom-display-id-config-enabled:v8n_too_long"]}get headerSubtitleOptions(){var t;return{context:(null===(t=this.data)||void 0===t?void 0:t.is_active)?"active":"inactive"}}renderBody(){var t,e,o,n,r,i,h,x,b,v,w,$,V,S;const j=this.t(this.form.use_remote_domain&&!(null===(t=this.data)||void 0===t?void 0:t.use_remote_domain)?"essentials.store-domain.custom_domain_note":"essentials.store-domain.helper_text"),C=!this.form.store_domain||this.form.store_domain.includes(".")?"":".foxycart.com",k=this.__renderLoader(1),K=this.__renderLoader(2),q=this.__renderLoader(7),I=this.__renderLoader(8),O=this.__renderLoader(9),G=Object.entries(null!==(o=null===(e=null==K?void 0:K.data)||void 0===e?void 0:e.values)&&void 0!==o?o:{}),T=null!==(r=null===(n=null==q?void 0:q.data)||void 0===n?void 0:n.values.timezone)&&void 0!==r?r:[],D=Object.values(null!==(h=null===(i=null==I?void 0:I.data)||void 0===i?void 0:i.values)&&void 0!==h?h:{}),L=Object.values(null!==(b=null===(x=null==O?void 0:O.data)||void 0===x?void 0:x.values)&&void 0!==b?b:{}),E=Object.entries(null!==(w=null===(v=null==k?void 0:k.data)||void 0===v?void 0:v.values)&&void 0!==w?w:{}),J=E.map((t=>({rawLabel:t[1].description,value:t[0]}))),P=G.map((([t,e])=>({rawLabel:e,value:t}))),N=T.map((t=>({rawLabel:t.description,value:t.timezone}))),M=D.map((t=>({rawLabel:t.default,value:t.cc2}))),U=L.map((t=>({rawLabel:t.default,value:t.code})));let W;try{const t=new URL(null!==($=this.regions)&&void 0!==$?$:""),e=this.form.country;e&&t.searchParams.set("country_code",e),W=t.toString()}catch(t){W=void 0}const A=this.__getCustomDisplayIdConfig(),H=A.transaction_journal_entries,z=H.log_detail_request_types,B=this.__displayIdExamples,X=this.__journalIdExamples;return s(a||(a=g` ${0} <foxy-internal-summary-control infer="essentials"> <foxy-internal-text-control layout="summary-item" infer="store-name"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="logo-url"> </foxy-internal-text-control> <foxy-internal-text-control helper-text="${0}" layout="summary-item" suffix="${0}" infer="store-domain" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-url"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-switch-control infer="is-maintenance-mode"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-editable-list-control layout="summary-item" infer="store-email" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-select-control layout="summary-item" infer="timezone" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control layout="summary-item" infer="country" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control layout="summary-item" infer="postal-code"> </foxy-internal-text-control> <foxy-internal-select-control layout="summary-item" infer="currency-style" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="legacy-api"> <foxy-internal-password-control layout="summary-item" infer="webhook-key-api-legacy" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="emails"> <foxy-internal-text-control layout="summary-item" infer="from-email" placeholder="${0}"> </foxy-internal-text-control> <foxy-internal-switch-control infer="use-email-dns" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="use-smtp-config" helper-text-as-tooltip .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="shipping"> <foxy-internal-select-control layout="summary-item" infer="shipping-address-type" .options="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="features-multiship" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="require-signed-shipping-rates" helper-text-as-tooltip> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="cart"> <foxy-internal-frequency-control layout="summary-item" infer="app-session-time" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-switch-control infer="products-require-expires-property" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="use-cart-validation" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-cart-signing" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout"> <foxy-internal-select-control layout="summary-item" infer="customer-password-hash-type" .options="${0}" .setValue="${0}"> </foxy-internal-select-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout" label="" helper-text=""> <foxy-internal-password-control layout="summary-item" infer="unified-order-entry-password" show-generator> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout" label="" helper-text=""> <foxy-internal-switch-control infer="use-single-sign-on"></foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="receipt"> <foxy-internal-text-control layout="summary-item" infer="receipt-continue-url"> </foxy-internal-text-control> <foxy-internal-switch-control infer="bcc-on-receipt-email"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="custom-display-id-config"> <foxy-internal-switch-control infer="custom-display-id-config-enabled" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control helper-text="" label="" infer="custom-display-id-config"> <foxy-internal-switch-control infer="custom-display-id-config-transaction-journal-entries-enabled" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="xml-datafeed"> <foxy-internal-switch-control infer="use-webhook"></foxy-internal-switch-control> ${0} </foxy-internal-summary-control> ${0} ${0} ${0} ${0} ${0} ${0} `),this.renderHeader(),j,C,this.__setStoreDomainValue,this.__getStoreEmailValue,this.__setStoreEmailValue,N,M,U.length>0?s(l||(l=g` <foxy-internal-select-control layout="summary-item" infer="region" .options="${0}"> </foxy-internal-select-control> `),U):s(u||(u=g` <foxy-internal-text-control layout="summary-item" infer="region"> </foxy-internal-text-control> `)),this.__currencyStyleOptions,this.__currencyStyleGetValue,this.__currencyStyleSetValue,this.__webhookKeyGeneratorOptions,this.__webhookKeyApiLegacyGetValue,this.__webhookKeyApiLegacySetValue,null!==(S=null===(V=this.__getStoreEmailValue()[0])||void 0===V?void 0:V.value)&&void 0!==S?S:this.t("emails.from-email.placeholder"),this.__getUseSmtpConfigValue,this.__setUseSmtpConfigValue,this.form.smtp_config?s(c||(c=g` <foxy-internal-text-control layout="summary-item" infer="smtp-config-host" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" infer="smtp-config-port" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-text-control layout="summary-item" infer="smtp-config-username" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="smtp-config-password" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-select-control layout="summary-item" infer="smtp-config-security" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> `),this.__smtpConfigHostGetValue,this.__smtpConfigHostSetValue,this.__smtpConfigPortGetValue,this.__smtpConfigPortSetValue,this.__smtpConfigUsernameGetValue,this.__smtpConfigUsernameSetValue,this.__smtpConfigPasswordGetValue,this.__smtpConfigPasswordSetValue,this.__smtpConfigSecurityGetValue,this.__smtpConfigSecuritySetValue,this.__smtpConfigSecurityOptions):"",P,this.__getAppSessionTimeValue,this.__setAppSessionTimeValue,this.__appSessionTimeOptions,this.__webhookKeyGeneratorOptions,this.__webhookKeyCartSigningGetValue,this.__webhookKeyCartSigningSetValue,J,(t=>{var e;const o=E.find((([e])=>e===t));this.edit({customer_password_hash_type:t,customer_password_hash_config:null!==(e=null==o?void 0:o[1].config)&&void 0!==e?e:""})}),"number"==typeof this.form.customer_password_hash_config?s(m||(m=g` <foxy-internal-number-control layout="summary-item" infer="customer-password-hash-config"> </foxy-internal-number-control> `)):s(f||(f=g` <foxy-internal-text-control layout="summary-item" infer="customer-password-hash-config"> </foxy-internal-text-control> `)),this.form.use_single_sign_on?s(_||(_=g` <foxy-internal-text-control layout="summary-item" infer="single-sign-on-url"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-sso" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__webhookKeyGeneratorOptions,this.__webhookKeySsoGetValue,this.__webhookKeySsoSetValue):"",(()=>A.enabled),(t=>{this.__setCustomDisplayIdConfig("enabled",t)}),A.enabled?s(p||(p=g` <foxy-internal-number-control layout="summary-item" infer="custom-display-id-config-start" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="custom-display-id-config-length" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-suffix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <div class="text-right text-secondary"> <p class="flex justify-end"> <foxy-i18n infer="" key="custom-display-id-config-first-example"></foxy-i18n> <span style="font-family:monospace"> ${0}</span> </p> <p class="flex justify-end"> <foxy-i18n infer="" key="custom-display-id-config-random-example"></foxy-i18n> <span style="font-family:monospace"> ${0}</span> </p> </div> `),(()=>parseInt(A.start||"0")),(t=>{this.__setCustomDisplayIdConfig("start",String(t))}),(()=>parseInt(A.length||"0")),(t=>{this.__setCustomDisplayIdConfig("length",String(t))}),(()=>A.prefix),(t=>{this.__setCustomDisplayIdConfig("prefix",t)}),(()=>A.suffix),(t=>{this.__setCustomDisplayIdConfig("suffix",t)}),null==B?void 0:B.first,null==B?void 0:B.random):"",(()=>H.enabled),(t=>{this.__setTransactionJournalEntriesConfig("enabled",t)}),H.enabled?s(y||(y=g` <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-authcapture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-capture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-void-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-refund-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-transaction-separator" class="col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <div class="sm-col-span-2 leading-s text-right text-secondary"> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-authcapture-example"> </foxy-i18n> <span style="font-family:monospace"> ${0} </span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-capture-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-void-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-refund-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> </div> `),(()=>z.transaction_authcapture.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_authcapture",t)}),(()=>z.transaction_capture.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_capture",t)}),(()=>z.transaction_void.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_void",t)}),(()=>z.transaction_refund.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_refund",t)}),(()=>H.transaction_separator),(t=>{this.__setTransactionJournalEntriesConfig("transaction_separator",t)}),null==X?void 0:X.authcapture,null==X?void 0:X.capture,null==X?void 0:X.void,null==X?void 0:X.refund):"",this.form.use_webhook?s(d||(d=g` <foxy-internal-text-control layout="summary-item" infer="webhook-url"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-xml-datafeed" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__webhookKeyGeneratorOptions,this.__webhookKeyXmlDatafeedGetValue,this.__webhookKeyXmlDatafeedSetValue):"",super.renderBody(),k.render(this.customerPasswordHashTypes),K.render(this.shippingAddressTypes),q.render(this.timezones),I.render(this.countries),O.render(W))}get __displayIdExamples(){const t=this.__getCustomDisplayIdConfig(),e=parseInt(t.start||"0"),o=parseInt(t.length||"0")-t.prefix.length-t.suffix.length,n=Math.min(e+Math.floor(Math.random()*Math.pow(10,o)),Math.pow(10,o)-1);if(t.start&&t.length&&e/10<=o)return{first:`${t.prefix}${e.toString().padStart(o,"0")}${t.suffix}`,random:`${t.prefix}${n.toString().padStart(o,"0")}${t.suffix}`}}get __journalIdExamples(){const t=this.__getCustomDisplayIdConfig(),e=t.transaction_journal_entries,o=parseInt(t.start||"0"),n=parseInt(t.length||"0")-t.prefix.length-t.suffix.length,r=Math.min(o+Math.floor(Math.random()*Math.pow(10,n)),Math.pow(10,n)-1),s=`${t.prefix}${r.toString().padStart(n,"0")}${t.suffix}`,i=Math.floor(1e3*Math.random()),a=String(i).padStart(3,"0");if(t.start&&t.length&&o/10<=n)return{authcapture:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_authcapture.prefix}${a}`,capture:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_capture.prefix}${a}`,refund:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_refund.prefix}${a}`,void:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_void.prefix}${a}`}}__getWebhookKey(){var t,e;let o;try{o=JSON.parse(null!==(t=this.form.webhook_key)&&void 0!==t?t:"")}catch(t){const n=null!==(e=this.form.webhook_key)&&void 0!==e?e:"";o={cart_signing:n,xml_datafeed:n,api_legacy:n,sso:n}}return o}__setWebhookKey(t,e){const o=this.__getWebhookKey();o[t]=e,this.edit({webhook_key:JSON.stringify(o)})}__getCustomDisplayIdConfig(){var t;const e={enabled:!1,start:"0",length:"0",prefix:"",suffix:"",transaction_journal_entries:{enabled:!1,transaction_separator:"",log_detail_request_types:{transaction_authcapture:{prefix:""},transaction_capture:{prefix:""},transaction_refund:{prefix:""},transaction_void:{prefix:""}}}};let o;try{o=JSON.parse(null!==(t=this.form.custom_display_id_config)&&void 0!==t?t:"")}catch(t){o=i(e)}return o}__setCustomDisplayIdConfig(t,e){const o=this.__getCustomDisplayIdConfig();o[t]=e,this.edit({custom_display_id_config:JSON.stringify(o)})}__getTransactionJournalEntriesConfig(){return this.__getCustomDisplayIdConfig().transaction_journal_entries}__setTransactionJournalEntriesConfig(t,e){const o=this.__getCustomDisplayIdConfig().transaction_journal_entries;o[t]=e,this.__setCustomDisplayIdConfig("transaction_journal_entries",o)}__setTransactionJournalEntriesPrefix(t,e){const o=this.__getTransactionJournalEntriesConfig();o.log_detail_request_types[t].prefix=e,this.__setTransactionJournalEntriesConfig("log_detail_request_types",o.log_detail_request_types)}__getSmtpConfig(){var t;let e;try{e=JSON.parse(null!==(t=this.form.smtp_config)&&void 0!==t?t:"")}catch(t){e={username:"",password:"",security:"",host:"",port:""}}return e}__setSmtpConfig(t,e){const o=this.__getSmtpConfig();o[t]=e,this.edit({smtp_config:JSON.stringify(o)})}__renderLoader(t){var e;const o=`loader-${t}`;return{data:null===(e=this.renderRoot.querySelector(`#${o}`))||void 0===e?void 0:e.data,render:t=>s(h||(h=g` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),r(null!=t?t:void 0),o,(()=>this.requestUpdate()))}}}customElements.define("foxy-store-form",b);export{b as StoreForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-b79fd251.js";import"./shared-b9af1789.js";import"./shared-a62af87b.js";import"./shared-89db9c39.js";import"./shared-2d2e210c.js";import"./shared-d6bf2433.js";import"./shared-0e58c95c.js";import{I as e}from"./shared-0ec6badf.js";import"./foxy-shipping-container-card.js";import"./foxy-shipping-drop-type-card.js";import"./foxy-shipping-service-card.js";import"./foxy-shipping-method-card.js";import"./foxy-nucleon-element.js";import{_ as t,B as r}from"./shared-d1195c27.js";import{a as o}from"./shared-001dfdb6.js";import{i}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-b7ee8271.js";import"./shared-555c2785.js";import"./shared-bd59ddc4.js";import"./shared-960eac62.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-f23cde6c.js";import"./shared-11902e83.js";import"./shared-af70646d.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-12c2e2c7.js";import"./shared-4e709717.js";import"./shared-1e827d8b.js";import"./shared-51c4a6dd.js";import"./shared-5f00bc80.js";import"./shared-e24f4d30.js";import"./shared-10674b72.js";import"./shared-b8bdf3ae.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-ca0700a7.js";import"./shared-51415f88.js";import"./foxy-copy-to-clipboard.js";import"./shared-08e7b7e5.js";import"./shared-20b733ff.js";import"./shared-bab2ea2c.js";import"./shared-32af1656.js";import"./shared-b4b7767a.js";import"./shared-0e80f20c.js";import"./shared-68470d06.js";import"./shared-8f8c3902.js";import"./shared-22ba9566.js";import"./shared-03427c91.js";import"./shared-1183a365.js";import"./shared-ad9eae20.js";let n,a=e=>e;const d=o(e,"store-shipping-method-form");class p extends d{constructor(){super(...arguments),this.shippingMethods=null,this.__shippingMethodLoaderId="shippingMethodLoader",this.__shippingMethodUriSetValue=e=>{this.undo(),this.edit({shipping_method_uri:e})},this.__useCustomAccount=!1,this.__useCustomAccountGetValue=()=>Boolean(this.__useCustomAccount||this.form.authentication_key||this.form.meter_number||this.form.accountid||this.form.password),this.__useCustomAccountSetValue=e=>{e||this.edit({authentication_key:"",meter_number:"",accountid:"",password:""}),this.__useCustomAccount=e}}static get properties(){return t(t({},super.properties),{},{shippingMethods:{attribute:"shipping-methods"},__useCustomAccount:{attribute:!1}})}static get v8n(){return[({shipping_method_uri:e})=>e&&(e=>{try{return new URL(e),!0}catch(e){return!1}})(e)||"shipping-method-uri:v8n_required",({accountid:e})=>!e||e.length<=50||"accountid:v8n_too_long",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({meter_number:e})=>!e||e.length<=50||"meter-number:v8n_too_long",({authentication_key:e})=>!e||e.length<=50||"authentication-key:v8n_too_long",({custom_code:e})=>!e||new Blob([e]).size/1024<=64||"custom-code:v8n_too_long"]}get hiddenSelector(){var e;const t=!!this.data,o=null===(e=this.__shippingMethod)||void 0===e?void 0:e.code;let i="general:shipping-container-uri general:shipping-drop-type-uri destinations account endpoint custom-code";if(o){const e={"CUSTOM-ENDPOINT-POST":"general destinations account custom-code","CUSTOM-CODE":"general destinations account endpoint",CUSTOM:"general account endpoint custom-code",FedEx:"endpoint custom-code",USPS:"account endpoint custom-code",UPS:"endpoint custom-code"};e[o]&&(i=e[o])}return t&&!(null==o?void 0:o.startsWith("CUSTOM-"))||(i+=" services"),t&&(i=`general:shipping-method-uri ${i}`),this.__useCustomAccountGetValue()||(i+=" account:accountid account:password account:authentication-key account:meter-number"),new r(`${i} ${super.hiddenSelector}`.trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}get headerTitleOptions(){var e;return t(t({},super.headerTitleOptions),{},{provider:null===(e=this.__shippingMethod)||void 0===e?void 0:e.name})}renderBody(){var e,t,r,o;const d=this.__shippingMethod;return s(n||(n=a` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-resource-picker-control layout="summary-item" infer="shipping-method-uri" first="${0}" item="foxy-shipping-method-card" .setValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-resource-picker-control layout="summary-item" infer="shipping-container-uri" first="${0}" item="foxy-shipping-container-card"> </foxy-internal-resource-picker-control> <foxy-internal-resource-picker-control layout="summary-item" infer="shipping-drop-type-uri" first="${0}" item="foxy-shipping-drop-type-card"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="destinations"> <foxy-internal-switch-control infer="use-for-domestic"></foxy-internal-switch-control> <foxy-internal-switch-control infer="use-for-international"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="account"> <foxy-internal-switch-control infer="use-custom-account" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="authentication-key"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="meter-number"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="accountid"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="password"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-text-control infer="endpoint" property="accountid"> </foxy-internal-text-control> <foxy-internal-source-control infer="custom-code"></foxy-internal-source-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="shipping_service_uri" foreign-key-for-id="shipping_service_id" own-key-for-uri="shipping_method_uri" own-uri="${0}" embed-key="fx:store_shipping_services" options-href="${0}" links-href="${0}" infer="services" limit="200" item="foxy-shipping-service-card"> </foxy-internal-async-resource-link-list-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} `),this.renderHeader(),i(null!==(e=this.shippingMethods)&&void 0!==e?e:null===(t=this.form._links)||void 0===t?void 0:t["fx:shipping_methods"].href),this.__shippingMethodUriSetValue,i(null==d?void 0:d._links["fx:shipping_containers"].href),i(null==d?void 0:d._links["fx:shipping_drop_types"].href),this.__useCustomAccountGetValue,this.__useCustomAccountSetValue,i(null===(r=this.data)||void 0===r?void 0:r._links.self.href),i(null==d?void 0:d._links["fx:shipping_services"].href),i(null===(o=this.data)||void 0===o?void 0:o._links["fx:store_shipping_services"].href),i(this.form.shipping_method_uri||void 0),this.__shippingMethodLoaderId,(()=>this.requestUpdate()),super.renderBody())}updated(e){super.updated(e),e.has("href")&&(this.__useCustomAccount=!1)}async _fetch(...e){try{return await super._fetch(...e)}catch(e){const t=[];try{for(const r of(await e.json())._embedded["fx:errors"])r.message.startsWith("shipping_container_id must be")?t.push("shipping-container-uri:v8n_required"):r.message.startsWith("shipping_drop_type_id must be")&&t.push("shipping-drop-type-uri:v8n_required")}catch(e){}throw t.length>0?t:e}}get __shippingMethodLoader(){return this.renderRoot.querySelector(`#${this.__shippingMethodLoaderId}`)}get __shippingMethod(){var e;return null===(e=this.__shippingMethodLoader)||void 0===e?void 0:e.data}}customElements.define("foxy-store-shipping-method-form",p);export{p as StoreShippingMethodForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-08e7b7e5.js";import"./shared-11902e83.js";import"./shared-f23cde6c.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-af70646d.js";import{_ as t}from"./shared-d1195c27.js";import{h as s}from"./shared-dc73b9a5.js";import{C as e}from"./shared-d1cb97c6.js";import{N as i}from"./shared-2ad18636.js";import{R as a,T as n,a as r}from"./shared-001dfdb6.js";import{c as o}from"./shared-4e709717.js";import{p as d}from"./shared-7c1d9bf8.js";import"./shared-bd59ddc4.js";import"./shared-960eac62.js";import"./shared-555c2785.js";import"./shared-20b733ff.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let c,l=t=>t;const m=e(a(n(r(i,"subscription-card"))));class f extends m{render(){var t,e,i,a,n;const r=!!(null===(t=this.data)||void 0===t?void 0:t.is_active),d=!!(null===(e=this.data)||void 0===e?void 0:e.first_failed_transaction_date);return s(c||(c=l` <div class="relative text-left"> <div class="${0}"> <div class="${0}"> <iron-icon class="m-auto" icon="${0}"> </iron-icon> </div> <div class="flex-1 min-w-0 leading-xs flex flex-col sm-flex-row sm-items-center"> <div class="order-1 sm-order-0"> <div class="text-body font-medium origin-top-left text-m"> <foxy-i18n data-testid="summary" options="${0}" lang="${0}" key="transaction_summary" ns="${0}"> </foxy-i18n> ​ </div> <div class="${0}"> <foxy-i18n data-testid="status" options="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> ​ </div> </div> <div class="flex-1 leading-xs mb-xs sm-mb-0 sm-text-right order-0 sm-order-1"> <foxy-i18n data-testid="price" options="${0}" class="text-xxs sm-text-l font-tnum tracking-wide sm-tracking-normal uppercase sm-normal-case font-medium text-secondary sm-text-body sm-block" lang="${0}" key="price_${0}" ns="${0}"> </foxy-i18n> <span class="text-secondary font-medium sm-font-normal sm-block text-xxs sm-text-s"> <span class="sm-hidden">(</span><span class="hidden sm-inline">*</span><foxy-i18n infer="" key="fees_hint"></foxy-i18n><span class="sm-hidden">)</span> <iron-icon id="hint" icon="icons:info-outline" class="icon-inline"></iron-icon> <vcf-tooltip for="hint" position="bottom"> <span class="text-s"><foxy-i18n infer="" key="fees_explainer"></foxy-i18n></span> </vcf-tooltip> <span> ​ </span></span></div> </div> </div> <div data-testid="spinner" class="${0}"> <foxy-spinner state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> ${0} `),o({"flex items-start sm-items-center space-x-m transition duration-150 ease-in-out":!0,"opacity-0":!this.in({idle:"snapshot"})}),o({"min-w-0 flex-shrink-0 rounded-full relative flex p-s":!0,"text-success bg-success-10":r&&!d,"text-body bg-contrast-5":!r&&!d,"text-error bg-error-10":d}),d?"error-outline":r?"done":"done-all",JSON.stringify(this.__getSummaryOptions()),this.lang,this.ns,o({"text-m":!0,"text-tertiary":!r&&!d,"text-success":r&&!d,"text-error":d}),JSON.stringify(this.__getStatusOptions()),this.lang,this.__getStatusKey(),this.ns,JSON.stringify(this.__getPriceOptions()),this.lang,".5m"===(null===(i=this.data)||void 0===i?void 0:i.frequency)?"twice_a_month":"recurring",this.ns,o({"pointer-events-none absolute inset-0 flex transition ease-in-out duration-150":!0,"opacity-0":this.in({idle:"snapshot"})}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(n=null===(a=customElements.get("foxy-spinner"))||void 0===a?void 0:a.defaultNS)&&void 0!==n?n:"",this.renderTemplateOrSlot())}__getSummaryOptions(){if(null===this.data)return{};const t=this.data._embedded["fx:transaction_template"]._embedded["fx:items"];return{most_expensive_item:[...t].sort(((t,s)=>t.price-s.price))[0],count_minus_one:t.length-1,count:t.length}}__getStatusOptions(){const t=this.data;return null===t?{}:t.first_failed_transaction_date?{date:t.first_failed_transaction_date}:t.end_date?{date:t.end_date}:!1===t.is_active?{}:new Date(t.start_date)>new Date?{date:t.start_date}:{date:t.next_transaction_date}}__getPriceOptions(){if(null===this.data)return{};const s=this.data._embedded["fx:transaction_template"],e=`${s.total_order} ${s.currency_code}`;return t(t({},d(this.data.frequency)),{},{amount:e})}__getStatusKey(){const t=this.data;if(null!==t){if(t.first_failed_transaction_date)return"subscription_failed";if(t.end_date){return new Date(t.end_date).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}return!1===t.is_active?"subscription_inactive":new Date(t.start_date)>new Date?"subscription_will_be_active":"subscription_active"}}}customElements.define("foxy-subscription-card",f);export{f as SubscriptionCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-24c7c37f.js";import"./shared-f0d70be1.js";import"./shared-c9f3f8d3.js";import"./shared-64d9ac2a.js";import"./shared-e1850e5f.js";import{I as e}from"./shared-a4b0ccf4.js";import"./shared-3a066450.js";import"./shared-ac6e1790.js";import"./shared-30b4c05b.js";import"./shared-51c4a6dd.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-51bb937b.js";import{_ as t,B as a}from"./shared-d1195c27.js";import"./shared-1cfea4b6.js";import"./shared-4e1b5fa3.js";import{h as s}from"./shared-dc73b9a5.js";import{S as i,R as r,a as n}from"./shared-4efc6bb8.js";import{c as o}from"./shared-4e709717.js";import{C as d}from"./shared-d713c00f.js";import"./shared-783f6e58.js";import{S as l}from"./shared-8b9ae780.js";import{G as c}from"./shared-e3647540.js";import"./shared-d8cd61ed.js";import"./shared-906fe068.js";import"./shared-f97ed2ff.js";import"./shared-de45ad84.js";import"./shared-b6ab5711.js";import"./shared-011d6240.js";import{p as u}from"./shared-73c1d31e.js";import{s as m}from"./shared-79d0699c.js";import{i as h}from"./shared-9803aa7c.js";import{p as f}from"./shared-0e156ee7.js";import{j as _}from"./shared-c2efc54e.js";import"./shared-4d543043.js";import"./shared-8a8bfd72.js";import"./shared-34c84b9f.js";import"./shared-c7ffb9f2.js";import"./shared-651c44fa.js";import"./shared-9e94c56d.js";import"./shared-61ade33e.js";import"./shared-08e42e78.js";import"./shared-9de0a899.js";import"./shared-55bc51c8.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-c89f7ad5.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-0a24f318.js";import"./foxy-collection-page.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-045bd59c.js";import"./shared-43e2c3f6.js";import"./shared-97e1f413.js";import"./shared-9ef03974.js";import"./shared-3491d10e.js";import"./shared-91560256.js";import"./shared-641786b2.js";import"./shared-9411a937.js";import"./shared-978aaaf2.js";import"./shared-be093279.js";import"./shared-4a86d1ca.js";import"./shared-c6b69d4e.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":l,"x-choice":d,"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-08e7b7e5.js";import"./shared-394d6660.js";import"./shared-12c2e2c7.js";import"./shared-11902e83.js";import"./shared-f23cde6c.js";import{I as e}from"./shared-0ec6badf.js";import"./shared-5f00bc80.js";import"./shared-513e54c9.js";import"./shared-532dd9aa.js";import"./shared-51c4a6dd.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-af70646d.js";import{_ as t,B as a}from"./shared-d1195c27.js";import"./shared-555c2785.js";import"./shared-20b733ff.js";import{h as s}from"./shared-dc73b9a5.js";import{S as i,R as r,a as n}from"./shared-001dfdb6.js";import{c as o}from"./shared-4e709717.js";import{C as d}from"./shared-6745d2ec.js";import"./shared-51415f88.js";import{S as l}from"./shared-fc176bc4.js";import{G as c}from"./shared-ea378d0a.js";import"./shared-8f8c3902.js";import"./shared-676a6445.js";import"./shared-10674b72.js";import"./shared-68470d06.js";import"./shared-02d4f592.js";import"./shared-b4b7767a.js";import{p as u}from"./shared-7c1d9bf8.js";import{s as m}from"./shared-79d0699c.js";import{i as h}from"./shared-9803aa7c.js";import{p as f}from"./shared-0e156ee7.js";import{j as _}from"./shared-c2efc54e.js";import"./shared-bd59ddc4.js";import"./shared-960eac62.js";import"./shared-e24f4d30.js";import"./shared-b8bdf3ae.js";import"./shared-651c44fa.js";import"./shared-0e80f20c.js";import"./shared-61ade33e.js";import"./shared-acba6fbd.js";import"./shared-09350008.js";import"./shared-1e827d8b.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-ca0700a7.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-b7ee8271.js";import"./foxy-collection-page.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-f7474be7.js";import"./shared-43e2c3f6.js";import"./shared-03427c91.js";import"./shared-1183a365.js";import"./shared-f0c7a963.js";import"./shared-2d2e210c.js";import"./shared-641786b2.js";import"./shared-e95ac70b.js";import"./shared-297ee58c.js";import"./shared-68ae5d92.js";import"./shared-8405bdfa.js";import"./shared-65c53765.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":l,"x-choice":d,"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-3e302c9e.js";import"./shared-89db9c39.js";import"./shared-d6bf2433.js";import"./shared-2ae2767e.js";import"./shared-513e54c9.js";import"./shared-0e58c95c.js";import{I as e}from"./shared-0ec6badf.js";import{a as t}from"./shared-001dfdb6.js";import{B as r}from"./shared-d1195c27.js";import{h as i}from"./shared-dc73b9a5.js";import"./shared-08e7b7e5.js";import"./shared-bd59ddc4.js";import"./shared-960eac62.js";import"./shared-555c2785.js";import"./shared-f23cde6c.js";import"./shared-20b733ff.js";import"./shared-1e827d8b.js";import"./shared-51c4a6dd.js";import"./shared-af70646d.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-394d6660.js";import"./shared-e24f4d30.js";import"./shared-10674b72.js";import"./shared-b8bdf3ae.js";import"./shared-676a6445.js";import"./shared-b4b7767a.js";import"./shared-651c44fa.js";import"./shared-8f8c3902.js";import"./shared-0e80f20c.js";import"./shared-68470d06.js";import"./shared-61ade33e.js";import"./shared-acba6fbd.js";import"./shared-09350008.js";import"./shared-f7474be7.js";import"./shared-12c2e2c7.js";import"./shared-ca0700a7.js";import"./shared-51415f88.js";import"./foxy-copy-to-clipboard.js";import"./shared-11902e83.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let s,a=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(s||(s=a` ${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="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-switch-control infer="send-email-receipts-for-automated-billing" helper-text-as-tooltip> </foxy-internal-switch-control> <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-af70646d.js";import{S as s}from"./shared-de2dfe65.js";export{S as SubscriptionsTable}from"./shared-de2dfe65.js";import"./shared-f23cde6c.js";import"./shared-bd59ddc4.js";import"./shared-001dfdb6.js";import"./shared-d1195c27.js";import"./shared-dc73b9a5.js";import"./shared-11902e83.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-a811962b.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./foxy-nucleon-element.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-7c1d9bf8.js";customElements.define("foxy-subscriptions-table",s);
|
package/dist/cdn/foxy-table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import{T as s}from"./shared-
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import{T as s}from"./shared-a811962b.js";export{T as Table}from"./shared-a811962b.js";import"./shared-dc73b9a5.js";import"./shared-f23cde6c.js";import"./shared-bd59ddc4.js";import"./shared-001dfdb6.js";import"./shared-d1195c27.js";import"./shared-11902e83.js";import"./shared-af70646d.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./foxy-nucleon-element.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";customElements.define("foxy-table",s);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import{a as r}from"./shared-
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import{a as r}from"./shared-001dfdb6.js";import{T as e}from"./shared-ad9eae20.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-f23cde6c.js";import"./shared-bd59ddc4.js";import"./shared-11902e83.js";import"./shared-af70646d.js";import"./shared-d1195c27.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-1183a365.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let t,s,d=r=>r;class o extends(r(e,"tax-card")){renderBody(){return super.renderBody({title:r=>a(t||(t=d`${0}`),r.name),subtitle:r=>a(s||(s=d`${0} • ${0}`),this.getTypeLabel(r),this.getRateLabel(r))})}getTypeLabel({type:r,country:e,region:a,city:t}){return"global"===r?this.t("tax_global"):"union"===r?this.t("tax_union"):"country"===r?e:"region"===r?`${e}, ${a}`:"local"===r?`${e}, ${a}, ${t}`:void 0}getRateLabel({is_live:r,rate:e}){var a;if(!r)return this.t("percent",{fraction:e/100});const t=null===(a=this.data)||void 0===a?void 0:a.service_provider;return"onesource"===t?"Thomson Reuters ONESOURCE":"avalara"===t?"Avalara AvaTax 15":"taxjar"===t?"TaxJar":this.t("tax_rate_provider_default")}}customElements.define("foxy-tax-card",o);export{o as TaxCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-c89f7ad5.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-51bb937b.js";import"./shared-045bd59c.js";import"./shared-9e94c56d.js";import"./shared-f0d70be1.js";import"./shared-c9f3f8d3.js";import{D as e}from"./shared-8b9ae780.js";import{n as t,_ as i}from"./shared-d1195c27.js";import{C as r}from"./shared-37cf92bd.js";import"./shared-d713c00f.js";import"./shared-783f6e58.js";import{h as s}from"./shared-dc73b9a5.js";import{T as a,S as n,a as o}from"./shared-4efc6bb8.js";import"./shared-d8cd61ed.js";import"./shared-906fe068.js";import"./shared-f97ed2ff.js";import"./shared-de45ad84.js";import"./shared-b6ab5711.js";import"./shared-1cfea4b6.js";import"./shared-011d6240.js";import"./shared-e1850e5f.js";import"./shared-4e1b5fa3.js";import{M as d}from"./shared-eff5dcb0.js";import{c as l}from"./shared-4e709717.js";import{C as h}from"./shared-d1cb97c6.js";import{N as c}from"./shared-2ad18636.js";import{i as m}from"./shared-9803aa7c.js";import{i as _}from"./shared-fcdb896f.js";import"./shared-64d9ac2a.js";import"./shared-4d543043.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-61ade33e.js";import"./shared-8a8bfd72.js";import"./shared-34c84b9f.js";import"./shared-c7ffb9f2.js";import"./shared-651c44fa.js";import"./shared-08e42e78.js";import"./shared-9de0a899.js";import"./shared-4a86d1ca.js";import"./shared-c6b69d4e.js";import"./shared-9411a937.js";import"./shared-978aaaf2.js";import"./shared-be093279.js";import"./shared-99940888.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";let p,u,y,g,f,v,$,b,x,S,T,j,E,k,O=e=>e;const C=["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"],w=[...C,"AU"],H=h(a(n(o(c,"tax-form"))));class A extends H{constructor(){var e;super(...arguments),e=this,this.__previousCountry=void 0,this.__countries="",this.__regions="",this.__countriesService=_(t.withConfig({services:{sendGet:async function(){const t=await new A.API(e).fetch(e.countries);if(!t.ok)throw new Error(await t.text());return await t.json()}}})),this.__regionsService=_(t.withConfig({services:{sendGet:async function(){var t;const i=new URL(e.regions);i.searchParams.set("country_code",null!==(t=e.form.country)&&void 0!==t?t:"US");const r=await new A.API(e).fetch(i.toString());if(!r.ok)throw new Error(await r.text());return await r.json()}}}))}static get scopedElements(){return{"vaadin-number-field":customElements.get("vaadin-number-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"vaadin-button":customElements.get("vaadin-button"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-metadata":d,"x-checkbox":r,"x-dropdown":e}}static get properties(){return i(i({},super.properties),{},{countries:{type:String,noAccessor:!0},regions:{type:String,noAccessor:!0}})}static get v8n(){return[({name:e})=>!!e||"name_required",({name:e})=>!e||e.length<=30||"name_too_long",({country:e,type:t})=>"country"!==t||!!e||"country_required",({country:e,type:t})=>"region"!==t||!!e||"country_required",({country:e,use_origin_rates:t})=>!t||!!e||"country_required",({country:e})=>!e||!!e.match(/[A-Z]{2}/)||"country_invalid",({region:e,type:t})=>"region"!=t||!!e||"region_required",({region:e})=>!e||e.length<=20||"region_too_long",({city:e})=>!e||e.length<=50||"city_too_long",({city:e,type:t})=>"local"!=t||!!e||"city_required",({rate:e})=>!e||e<=100||"rate_invalid"]}get countries(){return this.__countries}set countries(e){this.__countries=e,e?this.__countriesService.send({type:"FETCH"}):this.__countriesService.send({type:"SET_DATA",data:null})}get regions(){return this.__regions}set regions(e){this.__regions=e,e?this.__regionsService.send({type:"FETCH"}):this.__regionsService.send({type:"SET_DATA",data:null})}connectedCallback(){super.connectedCallback(),this.__countriesService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__countriesService.onChange((()=>this.requestUpdate())),this.__countriesService.start(),this.__regionsService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__regionsService.onChange((()=>this.requestUpdate())),this.__regionsService.start()}render(){var e,t;return s(p||(p=O` <div class="relative space-y-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.__isNameHidden?null:this.__renderName(),this.__isTypeHidden?null:this.__renderType(),this.__isCountryHidden?null:this.__renderCountry(),this.__isRegionHidden?null:this.__renderRegion(),this.__isCityHidden?null:this.__renderCity(),this.__isProviderHidden?null:this.__renderProvider(),this.__isRateHidden?null:this.__renderRate(),this.__isApplyToShippingHidden?null:this.__renderApplyToShipping(),this.__isUseOriginRatesHidden?null:this.__renderUseOriginRates(),this.__isExemptAllCustomerTaxIdsHidden?null:this.__renderExemptAllCustomerTaxIds(),this.__isTimestampsHidden?null:this.__renderTimestamps(),this.__isCreateHidden?null:this.__renderCreate(),this.__isDeleteHidden?null:this.__renderDelete(),l({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":this.in("busy")?"busy":"empty",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}updated(e){super.updated(e),this.form.country!==this.__previousCountry&&(this.__previousCountry=this.form.country,this.__regionsService.send({type:"FETCH"})),this.renderRoot.querySelectorAll("vaadin-combo-box").forEach((e=>e.validate()))}disconnectedCallback(){super.disconnectedCallback(),this.__countriesService.stop(),this.__regionsService.stop()}get __isNameHidden(){return this.hiddenSelector.matches("name",!0)}get __isTypeHidden(){return this.hiddenSelector.matches("type",!0)}get __isCountryHidden(){return!!this.hiddenSelector.matches("country",!0)||("union"===this.form.type?!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type))}get __isRegionHidden(){return!!this.hiddenSelector.matches("region",!0)||"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return!!this.hiddenSelector.matches("city",!0)||"local"!==this.form.type}get __isProviderHidden(){return!!this.hiddenSelector.matches("provider",!0)||(!this.form.type||"global"===this.form.type||"local"===this.form.type)}get __isRateHidden(){return!!this.hiddenSelector.matches("rate",!0)||(!this.form.type||!0===this.form.is_live)}get __isApplyToShippingHidden(){return!!this.hiddenSelector.matches("apply-to-shipping",!0)||(void 0===this.form.type||!!this.form.is_live&&C.includes(this.form.country))}get __isUseOriginRatesHidden(){return!!this.hiddenSelector.matches("use-origin-rates",!0)||("union"!==this.form.type||!this.form.is_live||!!this.form.service_provider)}get __isExemptAllCustomerTaxIdsHidden(){if(this.hiddenSelector.matches("exempt-all-customer-tax-ids",!0))return!0;const e=this.form.service_provider;return void 0===e||"onesource"===e||"avalara"===e}get __isTimestampsHidden(){return!!this.hiddenSelector.matches("timestamps",!0)||!this.data}get __isCreateHidden(){return!!this.hiddenSelector.matches("create",!0)||!!this.data}get __isDeleteHidden(){return!!this.hiddenSelector.matches("delete",!0)||!this.data}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__getValidator(e){return()=>!this.errors.some((t=>t.startsWith(e)))}__renderName(){return s(u||(u=O` <div> ${0} <vaadin-text-field data-testid="name" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("name:before"),this.t("name"),m(this.form.name),this.__getValidator("name"),this.__getErrorMessage("name"),!this.in("idle")||this.disabledSelector.matches("name",!0),this.readonlySelector.matches("name",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({name:t})}),this.renderTemplateOrSlot("name:after"))}__renderType(){return this.form.type||this.edit({type:"global"}),s(y||(y=O` <div> ${0} <x-dropdown data-testid="type" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("type:before"),this.t("type"),m(this.form.type),["global","union","country","region","local"],(e=>this.t(`tax_${e}`)),!this.in("idle")||this.disabledSelector.matches("type",!0),this.readonlySelector.matches("type",!0),(e=>{this.edit({type:e.detail,country:"",region:"",city:"",service_provider:"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})}),this.renderTemplateOrSlot("type:after"))}__renderCountry(){var e,t,i;const r=!!(null===(e=this.__countriesService.state)||void 0===e?void 0:e.matches("busy")),a=this.in("busy"),n=r||a,o=this.in("fail"),d=null===(t=this.__countriesService.state)||void 0===t?void 0:t.context.data,l=Object.values(null!==(i=null==d?void 0:d.values)&&void 0!==i?i:{});return s(g||(g=O` <div> ${0} <vaadin-combo-box item-value-path="cc2" item-label-path="default" item-id-path="cc2" data-testid="country" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("country:before"),this.t("country"),r?` • ${this.t("loading_busy")}`:"",m(r?void 0:this.form.country),this.__getValidator("country"),this.__getErrorMessage("country"),l,0===l.length,o||n||this.disabledSelector.matches("country",!0),this.readonlySelector.matches("country",!0),(e=>{this.edit({country:e.currentTarget.value,region:"",city:"",is_live:!1,service_provider:""}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__regionsService.send({type:"FETCH"})}),this.renderTemplateOrSlot("country:after"))}__renderRegion(){var e,t,i;const r=!!(null===(e=this.__regionsService.state)||void 0===e?void 0:e.matches("busy")),a=this.in("busy"),n=r||a,o=this.in("fail"),d=null===(t=this.__regionsService.state)||void 0===t?void 0:t.context.data,l=Object.values(null!==(i=null==d?void 0:d.values)&&void 0!==i?i:{});return s(f||(f=O` <div> ${0} <vaadin-combo-box item-value-path="code" item-label-path="default" item-id-path="code" data-testid="region" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("region:before"),this.t("region"),r?` • ${this.t("loading_busy")}`:"",m(r?void 0:this.form.region),this.__getValidator("region"),this.__getErrorMessage("region"),l,0===l.length,o||n||this.disabledSelector.matches("region",!0),this.readonlySelector.matches("region",!0),(e=>{const t=e.currentTarget.value;this.edit({region:t,city:""})}),this.renderTemplateOrSlot("region:after"))}__renderCity(){return s(v||(v=O` <div> ${0} <vaadin-text-field data-testid="city" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("city:before"),this.t("city"),m(this.form.city),this.__getValidator("city"),this.__getErrorMessage("city"),!this.in("idle")||this.disabledSelector.matches("city",!0),this.readonlySelector.matches("city",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({city:t})}),this.renderTemplateOrSlot("city:after"))}__renderProvider(){const e=[{label:this.t("tax_rate_provider_none"),value:"none"},{label:"Avalara AvaTax 15",value:"avalara"},{label:"Thomson Reuters ONESOURCE",value:"onesource"}];return("union"===this.form.type||C.includes(this.form.country))&&e.push({label:this.t("tax_rate_provider_default"),value:"default"}),w.includes(this.form.country)&&e.push({label:"TaxJar",value:"taxjar"}),s($||($=O` <div> ${0} <x-dropdown data-testid="provider" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("provider:before"),this.t("tax_rate_provider"),this.form.service_provider||(this.form.is_live?"default":"none"),e.map((e=>e.value)),(t=>{var i;return null===(i=e.find((e=>e.value===t)))||void 0===i?void 0:i.label}),!this.in("idle")||this.disabledSelector.matches("provider",!0),this.readonlySelector.matches("provider",!0),(e=>{const t=e.detail,i=["none","default"].includes(t)?"":t;this.edit({service_provider:i,is_live:"none"!==t}),this.__isExemptAllCustomerTaxIdsHidden&&this.edit({exempt_all_customer_tax_ids:!1}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__isUseOriginRatesHidden&&this.edit({use_origin_rates:!1})}),this.renderTemplateOrSlot("provider:after"))}__renderRate(){return s(b||(b=O` <div> ${0} <vaadin-number-field data-testid="rate" class="w-full" label="${0}" value="${0}" min="0" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @change="${0}"> </vaadin-number-field> ${0} </div> `),this.renderTemplateOrSlot("rate:before"),this.t("tax_rate"),m(this.form.rate),this.__getValidator("rate"),this.__getErrorMessage("rate"),!this.in("idle")||this.disabledSelector.matches("rate",!0),this.readonlySelector.matches("rate",!0),this.__submitOnEnter,(e=>{const t=parseFloat(e.currentTarget.value);isNaN(t)||this.edit({rate:t})}),this.renderTemplateOrSlot("rate:after"))}__renderApplyToShipping(){return s(x||(x=O` <div> ${0} <x-checkbox data-testid="apply-to-shipping" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_apply_to_shipping" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_apply_to_shipping_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("apply-to-shipping:before"),!this.in("idle")||this.disabledSelector.matches("apply-to-shipping",!0),this.readonlySelector.matches("apply-to-shipping",!0),!!this.form.apply_to_shipping,(e=>this.edit({apply_to_shipping:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("apply-to-shipping:after"))}__renderUseOriginRates(){return s(S||(S=O` <div> ${0} <x-checkbox data-testid="use-origin-rates" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_use_origin_rates" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_use_origin_rates_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("use-origin-rates:before"),!this.in("idle")||this.disabledSelector.matches("use-origin-rates",!0),this.readonlySelector.matches("use-origin-rates",!0),!!this.form.use_origin_rates,(e=>this.edit({use_origin_rates:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("use-origin-rates:after"))}__renderExemptAllCustomerTaxIds(){const e="exempt-all-customer-tax-ids";return s(T||(T=O` <div> ${0} <x-checkbox data-testid="${0}" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_exempt_all_customer_tax_ids" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_exempt_all_customer_tax_ids_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),e,!this.in("idle")||this.disabledSelector.matches(e,!0),this.readonlySelector.matches(e,!0),!!this.form.exempt_all_customer_tax_ids,(e=>{this.edit({exempt_all_customer_tax_ids:e.detail})}),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot(`${e}:after`))}__renderTimestamps(){return s(j||(j=O` <div> ${0} <x-metadata data-testid="timestamps" .items="${0}"> </x-metadata> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot("timestamps:after"))}__renderCreate(){const e=this.in({idle:{template:{clean:"invalid"}}}),t=this.in({idle:{template:{dirty:"invalid"}}}),i=this.in({idle:{snapshot:{clean:"invalid"}}}),r=this.in({idle:{snapshot:{dirty:"invalid"}}}),a=e||t||(i||r),n=this.in("idle");return s(E||(E=O` <div> ${0} <vaadin-button data-testid="create" class="w-full" theme="primary success" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="create" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("create:before"),!n||a||this.disabledSelector.matches("create",!0),this.submit,this.ns,this.lang,this.renderTemplateOrSlot("create:after"))}__renderDelete(){return s(k||(k=O` <div> <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} <vaadin-button data-testid="delete" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="delete" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.lang,this.ns,(e=>!e.detail.cancelled&&this.delete()),this.renderTemplateOrSlot("delete:before"),!this.in("idle")||this.disabledSelector.matches("delete",!0),(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}),this.ns,this.lang,this.renderTemplateOrSlot("delete:after"))}__submitOnEnter(e){"Enter"===e.key&&this.submit()}}customElements.define("foxy-tax-form",A);export{A as TaxForm};
|
|
1
|
+
import"./shared-ca0700a7.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-af70646d.js";import"./shared-f7474be7.js";import"./shared-0e80f20c.js";import"./shared-394d6660.js";import"./shared-12c2e2c7.js";import{D as e}from"./shared-fc176bc4.js";import{n as t,_ as i}from"./shared-d1195c27.js";import{C as r}from"./shared-c1c481c3.js";import"./shared-6745d2ec.js";import"./shared-51415f88.js";import{h as s}from"./shared-dc73b9a5.js";import{T as a,S as n,a as o}from"./shared-001dfdb6.js";import"./shared-8f8c3902.js";import"./shared-676a6445.js";import"./shared-10674b72.js";import"./shared-68470d06.js";import"./shared-02d4f592.js";import"./shared-555c2785.js";import"./shared-b4b7767a.js";import"./shared-f23cde6c.js";import"./shared-20b733ff.js";import{M as d}from"./shared-58e2c070.js";import{c as l}from"./shared-4e709717.js";import{C as h}from"./shared-d1cb97c6.js";import{N as c}from"./shared-2ad18636.js";import{i as m}from"./shared-9803aa7c.js";import{i as _}from"./shared-fcdb896f.js";import"./shared-11902e83.js";import"./shared-bd59ddc4.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-61ade33e.js";import"./shared-960eac62.js";import"./shared-e24f4d30.js";import"./shared-b8bdf3ae.js";import"./shared-651c44fa.js";import"./shared-acba6fbd.js";import"./shared-09350008.js";import"./shared-8405bdfa.js";import"./shared-65c53765.js";import"./shared-e95ac70b.js";import"./shared-297ee58c.js";import"./shared-68ae5d92.js";import"./shared-99940888.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";let p,u,y,g,v,f,$,b,x,S,T,j,E,k,O=e=>e;const C=["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"],w=[...C,"AU"],H=h(a(n(o(c,"tax-form"))));class A extends H{constructor(){var e;super(...arguments),e=this,this.__previousCountry=void 0,this.__countries="",this.__regions="",this.__countriesService=_(t.withConfig({services:{sendGet:async function(){const t=await new A.API(e).fetch(e.countries);if(!t.ok)throw new Error(await t.text());return await t.json()}}})),this.__regionsService=_(t.withConfig({services:{sendGet:async function(){var t;const i=new URL(e.regions);i.searchParams.set("country_code",null!==(t=e.form.country)&&void 0!==t?t:"US");const r=await new A.API(e).fetch(i.toString());if(!r.ok)throw new Error(await r.text());return await r.json()}}}))}static get scopedElements(){return{"vaadin-number-field":customElements.get("vaadin-number-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"vaadin-button":customElements.get("vaadin-button"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-metadata":d,"x-checkbox":r,"x-dropdown":e}}static get properties(){return i(i({},super.properties),{},{countries:{type:String,noAccessor:!0},regions:{type:String,noAccessor:!0}})}static get v8n(){return[({name:e})=>!!e||"name_required",({name:e})=>!e||e.length<=30||"name_too_long",({country:e,type:t})=>"country"!==t||!!e||"country_required",({country:e,type:t})=>"region"!==t||!!e||"country_required",({country:e,use_origin_rates:t})=>!t||!!e||"country_required",({country:e})=>!e||!!e.match(/[A-Z]{2}/)||"country_invalid",({region:e,type:t})=>"region"!=t||!!e||"region_required",({region:e})=>!e||e.length<=20||"region_too_long",({city:e})=>!e||e.length<=50||"city_too_long",({city:e,type:t})=>"local"!=t||!!e||"city_required",({rate:e})=>!e||e<=100||"rate_invalid"]}get countries(){return this.__countries}set countries(e){this.__countries=e,e?this.__countriesService.send({type:"FETCH"}):this.__countriesService.send({type:"SET_DATA",data:null})}get regions(){return this.__regions}set regions(e){this.__regions=e,e?this.__regionsService.send({type:"FETCH"}):this.__regionsService.send({type:"SET_DATA",data:null})}connectedCallback(){super.connectedCallback(),this.__countriesService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__countriesService.onChange((()=>this.requestUpdate())),this.__countriesService.start(),this.__regionsService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__regionsService.onChange((()=>this.requestUpdate())),this.__regionsService.start()}render(){var e,t;return s(p||(p=O` <div class="relative space-y-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.__isNameHidden?null:this.__renderName(),this.__isTypeHidden?null:this.__renderType(),this.__isCountryHidden?null:this.__renderCountry(),this.__isRegionHidden?null:this.__renderRegion(),this.__isCityHidden?null:this.__renderCity(),this.__isProviderHidden?null:this.__renderProvider(),this.__isRateHidden?null:this.__renderRate(),this.__isApplyToShippingHidden?null:this.__renderApplyToShipping(),this.__isUseOriginRatesHidden?null:this.__renderUseOriginRates(),this.__isExemptAllCustomerTaxIdsHidden?null:this.__renderExemptAllCustomerTaxIds(),this.__isTimestampsHidden?null:this.__renderTimestamps(),this.__isCreateHidden?null:this.__renderCreate(),this.__isDeleteHidden?null:this.__renderDelete(),l({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":this.in("busy")?"busy":"empty",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}updated(e){super.updated(e),this.form.country!==this.__previousCountry&&(this.__previousCountry=this.form.country,this.__regionsService.send({type:"FETCH"})),this.renderRoot.querySelectorAll("vaadin-combo-box").forEach((e=>e.validate()))}disconnectedCallback(){super.disconnectedCallback(),this.__countriesService.stop(),this.__regionsService.stop()}get __isNameHidden(){return this.hiddenSelector.matches("name",!0)}get __isTypeHidden(){return this.hiddenSelector.matches("type",!0)}get __isCountryHidden(){return!!this.hiddenSelector.matches("country",!0)||("union"===this.form.type?!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type))}get __isRegionHidden(){return!!this.hiddenSelector.matches("region",!0)||"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return!!this.hiddenSelector.matches("city",!0)||"local"!==this.form.type}get __isProviderHidden(){return!!this.hiddenSelector.matches("provider",!0)||(!this.form.type||"global"===this.form.type||"local"===this.form.type)}get __isRateHidden(){return!!this.hiddenSelector.matches("rate",!0)||(!this.form.type||!0===this.form.is_live)}get __isApplyToShippingHidden(){return!!this.hiddenSelector.matches("apply-to-shipping",!0)||(void 0===this.form.type||!!this.form.is_live&&C.includes(this.form.country))}get __isUseOriginRatesHidden(){return!!this.hiddenSelector.matches("use-origin-rates",!0)||("union"!==this.form.type||!this.form.is_live||!!this.form.service_provider)}get __isExemptAllCustomerTaxIdsHidden(){if(this.hiddenSelector.matches("exempt-all-customer-tax-ids",!0))return!0;const e=this.form.service_provider;return void 0===e||"onesource"===e||"avalara"===e}get __isTimestampsHidden(){return!!this.hiddenSelector.matches("timestamps",!0)||!this.data}get __isCreateHidden(){return!!this.hiddenSelector.matches("create",!0)||!!this.data}get __isDeleteHidden(){return!!this.hiddenSelector.matches("delete",!0)||!this.data}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__getValidator(e){return()=>!this.errors.some((t=>t.startsWith(e)))}__renderName(){return s(u||(u=O` <div> ${0} <vaadin-text-field data-testid="name" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("name:before"),this.t("name"),m(this.form.name),this.__getValidator("name"),this.__getErrorMessage("name"),!this.in("idle")||this.disabledSelector.matches("name",!0),this.readonlySelector.matches("name",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({name:t})}),this.renderTemplateOrSlot("name:after"))}__renderType(){return this.form.type||this.edit({type:"global"}),s(y||(y=O` <div> ${0} <x-dropdown data-testid="type" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("type:before"),this.t("type"),m(this.form.type),["global","union","country","region","local"],(e=>this.t(`tax_${e}`)),!this.in("idle")||this.disabledSelector.matches("type",!0),this.readonlySelector.matches("type",!0),(e=>{this.edit({type:e.detail,country:"",region:"",city:"",service_provider:"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})}),this.renderTemplateOrSlot("type:after"))}__renderCountry(){var e,t,i;const r=!!(null===(e=this.__countriesService.state)||void 0===e?void 0:e.matches("busy")),a=this.in("busy"),n=r||a,o=this.in("fail"),d=null===(t=this.__countriesService.state)||void 0===t?void 0:t.context.data,l=Object.values(null!==(i=null==d?void 0:d.values)&&void 0!==i?i:{});return s(g||(g=O` <div> ${0} <vaadin-combo-box item-value-path="cc2" item-label-path="default" item-id-path="cc2" data-testid="country" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("country:before"),this.t("country"),r?` • ${this.t("loading_busy")}`:"",m(r?void 0:this.form.country),this.__getValidator("country"),this.__getErrorMessage("country"),l,0===l.length,o||n||this.disabledSelector.matches("country",!0),this.readonlySelector.matches("country",!0),(e=>{this.edit({country:e.currentTarget.value,region:"",city:"",is_live:!1,service_provider:""}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__regionsService.send({type:"FETCH"})}),this.renderTemplateOrSlot("country:after"))}__renderRegion(){var e,t,i;const r=!!(null===(e=this.__regionsService.state)||void 0===e?void 0:e.matches("busy")),a=this.in("busy"),n=r||a,o=this.in("fail"),d=null===(t=this.__regionsService.state)||void 0===t?void 0:t.context.data,l=Object.values(null!==(i=null==d?void 0:d.values)&&void 0!==i?i:{});return s(v||(v=O` <div> ${0} <vaadin-combo-box item-value-path="code" item-label-path="default" item-id-path="code" data-testid="region" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("region:before"),this.t("region"),r?` • ${this.t("loading_busy")}`:"",m(r?void 0:this.form.region),this.__getValidator("region"),this.__getErrorMessage("region"),l,0===l.length,o||n||this.disabledSelector.matches("region",!0),this.readonlySelector.matches("region",!0),(e=>{const t=e.currentTarget.value;this.edit({region:t,city:""})}),this.renderTemplateOrSlot("region:after"))}__renderCity(){return s(f||(f=O` <div> ${0} <vaadin-text-field data-testid="city" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("city:before"),this.t("city"),m(this.form.city),this.__getValidator("city"),this.__getErrorMessage("city"),!this.in("idle")||this.disabledSelector.matches("city",!0),this.readonlySelector.matches("city",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({city:t})}),this.renderTemplateOrSlot("city:after"))}__renderProvider(){const e=[{label:this.t("tax_rate_provider_none"),value:"none"},{label:"Avalara AvaTax 15",value:"avalara"},{label:"Thomson Reuters ONESOURCE",value:"onesource"}];return("union"===this.form.type||C.includes(this.form.country))&&e.push({label:this.t("tax_rate_provider_default"),value:"default"}),w.includes(this.form.country)&&e.push({label:"TaxJar",value:"taxjar"}),s($||($=O` <div> ${0} <x-dropdown data-testid="provider" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("provider:before"),this.t("tax_rate_provider"),this.form.service_provider||(this.form.is_live?"default":"none"),e.map((e=>e.value)),(t=>{var i;return null===(i=e.find((e=>e.value===t)))||void 0===i?void 0:i.label}),!this.in("idle")||this.disabledSelector.matches("provider",!0),this.readonlySelector.matches("provider",!0),(e=>{const t=e.detail,i=["none","default"].includes(t)?"":t;this.edit({service_provider:i,is_live:"none"!==t}),this.__isExemptAllCustomerTaxIdsHidden&&this.edit({exempt_all_customer_tax_ids:!1}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__isUseOriginRatesHidden&&this.edit({use_origin_rates:!1})}),this.renderTemplateOrSlot("provider:after"))}__renderRate(){return s(b||(b=O` <div> ${0} <vaadin-number-field data-testid="rate" class="w-full" label="${0}" value="${0}" min="0" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @change="${0}"> </vaadin-number-field> ${0} </div> `),this.renderTemplateOrSlot("rate:before"),this.t("tax_rate"),m(this.form.rate),this.__getValidator("rate"),this.__getErrorMessage("rate"),!this.in("idle")||this.disabledSelector.matches("rate",!0),this.readonlySelector.matches("rate",!0),this.__submitOnEnter,(e=>{const t=parseFloat(e.currentTarget.value);isNaN(t)||this.edit({rate:t})}),this.renderTemplateOrSlot("rate:after"))}__renderApplyToShipping(){return s(x||(x=O` <div> ${0} <x-checkbox data-testid="apply-to-shipping" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_apply_to_shipping" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_apply_to_shipping_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("apply-to-shipping:before"),!this.in("idle")||this.disabledSelector.matches("apply-to-shipping",!0),this.readonlySelector.matches("apply-to-shipping",!0),!!this.form.apply_to_shipping,(e=>this.edit({apply_to_shipping:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("apply-to-shipping:after"))}__renderUseOriginRates(){return s(S||(S=O` <div> ${0} <x-checkbox data-testid="use-origin-rates" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_use_origin_rates" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_use_origin_rates_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("use-origin-rates:before"),!this.in("idle")||this.disabledSelector.matches("use-origin-rates",!0),this.readonlySelector.matches("use-origin-rates",!0),!!this.form.use_origin_rates,(e=>this.edit({use_origin_rates:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("use-origin-rates:after"))}__renderExemptAllCustomerTaxIds(){const e="exempt-all-customer-tax-ids";return s(T||(T=O` <div> ${0} <x-checkbox data-testid="${0}" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_exempt_all_customer_tax_ids" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_exempt_all_customer_tax_ids_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),e,!this.in("idle")||this.disabledSelector.matches(e,!0),this.readonlySelector.matches(e,!0),!!this.form.exempt_all_customer_tax_ids,(e=>{this.edit({exempt_all_customer_tax_ids:e.detail})}),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot(`${e}:after`))}__renderTimestamps(){return s(j||(j=O` <div> ${0} <x-metadata data-testid="timestamps" .items="${0}"> </x-metadata> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot("timestamps:after"))}__renderCreate(){const e=this.in({idle:{template:{clean:"invalid"}}}),t=this.in({idle:{template:{dirty:"invalid"}}}),i=this.in({idle:{snapshot:{clean:"invalid"}}}),r=this.in({idle:{snapshot:{dirty:"invalid"}}}),a=e||t||(i||r),n=this.in("idle");return s(E||(E=O` <div> ${0} <vaadin-button data-testid="create" class="w-full" theme="primary success" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="create" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("create:before"),!n||a||this.disabledSelector.matches("create",!0),this.submit,this.ns,this.lang,this.renderTemplateOrSlot("create:after"))}__renderDelete(){return s(k||(k=O` <div> <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} <vaadin-button data-testid="delete" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="delete" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.lang,this.ns,(e=>!e.detail.cancelled&&this.delete()),this.renderTemplateOrSlot("delete:before"),!this.in("idle")||this.disabledSelector.matches("delete",!0),(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}),this.ns,this.lang,this.renderTemplateOrSlot("delete:after"))}__submitOnEnter(e){"Enter"===e.key&&this.submit()}}customElements.define("foxy-tax-form",A);export{A as TaxForm};
|