@foxy.io/elements 1.42.0-beta.7 → 1.43.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-billing-address-card.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +2 -2
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-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 +2 -2
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-experimental-add-to-cart-builder.js +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 +2 -2
- package/dist/cdn/foxy-reports-table.js +6 -6
- 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 +1 -1
- 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-3a2134c8.js → shared-0224f0b8.js} +1 -1
- package/dist/cdn/{shared-4d919766.js → shared-0d0585dc.js} +1 -1
- package/dist/cdn/{shared-f79f08cc.js → shared-1cd02e50.js} +1 -1
- package/dist/cdn/{shared-3cdec25d.js → shared-264e8301.js} +1 -1
- package/dist/cdn/{shared-0c242246.js → shared-274dec57.js} +1 -1
- package/dist/cdn/{shared-5a04e75c.js → shared-2828fcbf.js} +1 -1
- package/dist/cdn/{shared-330e57d9.js → shared-2cb397e4.js} +1 -1
- package/dist/cdn/{shared-1d03f911.js → shared-2f5cc0e2.js} +1 -1
- package/dist/cdn/{shared-8e010314.js → shared-2f8e53c0.js} +1 -1
- package/dist/cdn/{shared-98f382f3.js → shared-41208627.js} +1 -1
- package/dist/cdn/{shared-4bd1f3d8.js → shared-44b46fef.js} +1 -1
- package/dist/cdn/{shared-ae2336ab.js → shared-4b393539.js} +1 -1
- package/dist/cdn/{shared-35c9fa1d.js → shared-4c764a91.js} +1 -1
- package/dist/cdn/{shared-692691ca.js → shared-4cafa2e7.js} +1 -1
- package/dist/cdn/{shared-7eeb591f.js → shared-4dd24dda.js} +1 -1
- package/dist/cdn/{shared-d8694661.js → shared-567ba8ae.js} +1 -1
- package/dist/cdn/{shared-5d7c4673.js → shared-5f8c01f8.js} +1 -1
- package/dist/cdn/{shared-a60ca6fe.js → shared-6033e09d.js} +1 -1
- package/dist/cdn/{shared-3aca4932.js → shared-656a46f7.js} +1 -1
- package/dist/cdn/{shared-948919d2.js → shared-66201dc5.js} +1 -1
- package/dist/cdn/{shared-b05ef317.js → shared-678beccf.js} +3 -3
- package/dist/cdn/{shared-0cc8df04.js → shared-6962f117.js} +1 -1
- package/dist/cdn/{shared-ceeb14e9.js → shared-6b3fed56.js} +1 -1
- package/dist/cdn/{shared-753fdd34.js → shared-70e6f32c.js} +1 -1
- package/dist/cdn/{shared-cae254ee.js → shared-74d599dc.js} +1 -1
- package/dist/cdn/{shared-2b126cea.js → shared-7fd51889.js} +3 -3
- package/dist/cdn/shared-87b93771.js +1 -0
- package/dist/cdn/shared-894c69f8.js +1 -0
- package/dist/cdn/{shared-8c42634c.js → shared-89d4000a.js} +1 -1
- package/dist/cdn/{shared-e615d2d9.js → shared-8a0bd046.js} +1 -1
- package/dist/cdn/{shared-1aff90a9.js → shared-8ea2bbcc.js} +1 -1
- package/dist/cdn/{shared-d3d4badd.js → shared-8f009bbb.js} +1 -1
- package/dist/cdn/{shared-434cdfec.js → shared-9171c265.js} +1 -1
- package/dist/cdn/{shared-9d4813e6.js → shared-9342ca50.js} +1 -1
- package/dist/cdn/{shared-4cae017c.js → shared-94716ec1.js} +1 -1
- package/dist/cdn/{shared-40028e80.js → shared-97e2abfb.js} +1 -1
- package/dist/cdn/{shared-c584966f.js → shared-9b9d5ff1.js} +1 -1
- package/dist/cdn/{shared-58b6710c.js → shared-9c010e0a.js} +1 -1
- package/dist/cdn/{shared-5520b96c.js → shared-9dc36194.js} +1 -1
- package/dist/cdn/{shared-d743d0fd.js → shared-a4216b50.js} +1 -1
- package/dist/cdn/{shared-4f808d2e.js → shared-a507d54f.js} +4 -4
- package/dist/cdn/{shared-c5b019e5.js → shared-a6c75cc0.js} +1 -1
- package/dist/cdn/{shared-e1400289.js → shared-aa6dab90.js} +2 -2
- package/dist/cdn/{shared-7977d581.js → shared-ad60e8d1.js} +2 -2
- package/dist/cdn/{shared-393a7ab2.js → shared-b1435a0a.js} +1 -1
- package/dist/cdn/{shared-b6c5ac14.js → shared-b6f53f3b.js} +2 -2
- package/dist/cdn/{shared-c009b9b6.js → shared-bb6d7b97.js} +1 -1
- package/dist/cdn/{shared-0cfb1c08.js → shared-bedc5e82.js} +1 -1
- package/dist/cdn/{shared-53253d60.js → shared-c31c50e2.js} +1 -1
- package/dist/cdn/{shared-2fe8aabd.js → shared-c502de27.js} +1 -1
- package/dist/cdn/{shared-92995c02.js → shared-c832f3a1.js} +1 -1
- package/dist/cdn/{shared-cf008f13.js → shared-cae7a43b.js} +1 -1
- package/dist/cdn/{shared-ec9893c7.js → shared-cc4b3b42.js} +1 -1
- package/dist/cdn/{shared-6f08d218.js → shared-d68c6616.js} +1 -1
- package/dist/cdn/{shared-b1c9199f.js → shared-d7d949bc.js} +1 -1
- package/dist/cdn/{shared-1b46df2a.js → shared-dc4d2996.js} +1 -1
- package/dist/cdn/shared-dd303282.js +1 -0
- package/dist/cdn/{shared-c231e3bf.js → shared-e2d3c014.js} +1 -1
- package/dist/cdn/{shared-241b6cca.js → shared-e6a1eef8.js} +1 -1
- package/dist/cdn/{shared-86337ba8.js → shared-e88763ec.js} +1 -1
- package/dist/cdn/{shared-2939f350.js → shared-f7bfb29e.js} +2 -2
- package/dist/cdn/{shared-0553380e.js → shared-fed829c2.js} +1 -1
- package/dist/cdn/{shared-8f81f4ed.js → shared-ffd5932d.js} +1 -1
- package/dist/cdn/translations/experimental-add-to-cart-builder/en.json +3 -1
- package/dist/cdn/translations/item-category-form/en.json +3 -0
- package/dist/cdn/translations/store-form/en.json +7 -0
- package/dist/cdn/translations/tax-card/en.json +3 -0
- package/dist/cdn/translations/tax-form/en.json +23 -0
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/InternalAsyncResourceLinkListControl.js +13 -5
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/InternalAsyncResourceLinkListControl.js.map +1 -1
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/index.js +11 -0
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/index.js.map +1 -1
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js +2 -1
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js.map +1 -1
- package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.js +78 -55
- package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.js.map +1 -1
- package/dist/elements/public/StoreForm/StoreForm.d.ts +3 -0
- package/dist/elements/public/StoreForm/StoreForm.js +21 -0
- package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
- package/dist/elements/public/TaxCard/TaxCard.d.ts +5 -4
- package/dist/elements/public/TaxCard/TaxCard.js +54 -8
- package/dist/elements/public/TaxCard/TaxCard.js.map +1 -1
- package/dist/elements/public/TaxCard/index.d.ts +2 -2
- package/dist/elements/public/TaxCard/index.js +2 -2
- package/dist/elements/public/TaxCard/index.js.map +1 -1
- package/dist/elements/public/TaxForm/TaxForm.d.ts +2 -0
- package/dist/elements/public/TaxForm/TaxForm.js +21 -2
- package/dist/elements/public/TaxForm/TaxForm.js.map +1 -1
- package/dist/elements/public/TaxForm/index.d.ts +2 -0
- package/dist/elements/public/TaxForm/index.js +2 -0
- package/dist/elements/public/TaxForm/index.js.map +1 -1
- package/dist/mixins/themeable.js +4 -0
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-0f4dfb14.js +0 -1
- package/dist/cdn/shared-46f8e3d9.js +0 -1
- package/dist/cdn/shared-578cde14.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-a6c75cc0.js";import"./shared-70e6f32c.js";import{I as e}from"./shared-ffd5932d.js";import{a as r}from"./shared-aa6dab90.js";import{h as s}from"./shared-ba5c42c7.js";import"./shared-0d0585dc.js";import"./shared-9c010e0a.js";import"./shared-567ba8ae.js";import"./shared-ad60e8d1.js";import"./shared-1cd02e50.js";import"./shared-5f8c01f8.js";import"./shared-e6a1eef8.js";import"./shared-cc4b3b42.js";import"./shared-5212ef4f.js";import"./shared-2f5cc0e2.js";import"./shared-cb58dfcd.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-5fd5805c.js";import"./shared-2f8e53c0.js";import"./shared-c31c50e2.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-9171c265.js";import"./shared-dc4d2996.js";import"./shared-8ea2bbcc.js";import"./shared-e2d3c014.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let i,t=e=>e;const o=r(e,"custom-field-form");class a extends o{constructor(){super(...arguments),this.__visibilityGetValue=()=>this.form.is_hidden?["hidden"]:[],this.__visibilitySetValue=e=>{this.edit({is_hidden:e.includes("hidden")})},this.__visibilityOptions=[{label:"option_hidden",value:"hidden"}]}static get v8n(){return[({value:e})=>e&&e.length>0||"value:v8n_required",({value:e})=>!e||e.length<=700||"value:v8n_too_long",({name:e})=>e&&e.length>0||"name:v8n_required",({name:e})=>!e||e.length<=100||"name:v8n_too_long"]}renderBody(){return s(i||(i=t` ${0} <foxy-internal-source-control infer="name"></foxy-internal-source-control> <foxy-internal-source-control infer="value"></foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="visibility" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.renderHeader(),this.__visibilityGetValue,this.__visibilitySetValue,this.__visibilityOptions,super.renderBody())}}customElements.define("foxy-custom-field-form",a);export{a as CustomFieldForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-2f5cc0e2.js";import{h as e}from"./shared-ba5c42c7.js";import{C as t}from"./shared-5afb584d.js";import{N as a}from"./shared-f83207fb.js";import{T as s,a as i}from"./shared-aa6dab90.js";import{c as r}from"./shared-4e709717.js";import"./shared-dc4d2996.js";import"./shared-e6a1eef8.js";import"./shared-567ba8ae.js";import"./shared-e2d3c014.js";import"./shared-cb58dfcd.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-53e42a77.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";let d,o,n,l,m,h,p,c=e=>e;const f=s(t(i(a,"customer-card")));class v extends f{render(){var t,a;const s=this.hiddenSelector;return e(d||(d=c` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"leading-xs transition-opacity":!0,"opacity-0":!this.data}),s.matches("name",!0)?"":this.__renderName(),s.matches("email",!0)?"":this.__renderEmail(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(a=null===(t=customElements.get("foxy-spinner"))||void 0===t?void 0:t.defaultNS)&&void 0!==a?a:"")}__renderName(){var t,a,s,i,r;const d=this.data,m=`${null!==(t=null==d?void 0:d.first_name)&&void 0!==t?t:""} ${null!==(a=null==d?void 0:d.last_name)&&void 0!==a?a:""}`.trim()||"–",h=d?e(o||(o=c`${0}`),m):e(n||(n=c`​`));let p;try{p=null!==(r=new URL(null!==(i=null===(s=this.data)||void 0===s?void 0:s._links.self.href)&&void 0!==i?i:"").pathname.split("/").pop())&&void 0!==r?r:""}catch(e){p=""}return e(l||(l=c` <div data-testid="name"> ${0} <div class="flex items-center gap-m"> <div class="font-medium text-body truncate mr-auto">${0}</div> <div class="text-tertiary text-s">ID ${0}</div> </div> ${0} </div> `),this.renderTemplateOrSlot("name:before"),h,p,this.renderTemplateOrSlot("name:after"))}__renderEmail(){var t;const a=this.data,s=`${null!==(t=null==a?void 0:a.email)&&void 0!==t?t:""}`.trim()||"–",i=a?e(m||(m=c`${0}`),s):e(h||(h=c`​`));return e(p||(p=c` <div data-testid="email"> ${0} <div class="text-secondary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("email:before"),i,this.renderTemplateOrSlot("email:after"))}}customElements.define("foxy-customer-card",v);export{v as CustomerCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-a6b2bd14.js";import"./shared-
|
|
1
|
+
import"./shared-a6b2bd14.js";import"./shared-274dec57.js";import"./shared-9b9d5ff1.js";import"./shared-66201dc5.js";import"./shared-ffd5932d.js";export{C as CustomerForm}from"./shared-cae7a43b.js";import"./shared-9c010e0a.js";import"./shared-567ba8ae.js";import"./shared-aa6dab90.js";import"./shared-cb58dfcd.js";import"./shared-ba5c42c7.js";import"./shared-ad60e8d1.js";import"./shared-1cd02e50.js";import"./shared-5f8c01f8.js";import"./shared-e6a1eef8.js";import"./shared-cc4b3b42.js";import"./shared-5212ef4f.js";import"./shared-2f5cc0e2.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4e709717.js";import"./shared-bedc5e82.js";import"./shared-9342ca50.js";import"./shared-c502de27.js";import"./shared-a4216b50.js";import"./shared-d0aed1c1.js";import"./shared-2f8e53c0.js";import"./shared-c31c50e2.js";import"./foxy-copy-to-clipboard.js";import"./shared-9171c265.js";import"./shared-dc4d2996.js";import"./shared-8ea2bbcc.js";import"./shared-e2d3c014.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-b738ee96.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-c5b019e5.js";import"./shared-4bd1f3d8.js";import"./shared-3aca4932.js";import"./shared-8c42634c.js";import"./shared-c584966f.js";import{I as e}from"./shared-8f81f4ed.js";import"./shared-753fdd34.js";import{a as t}from"./shared-e1400289.js";import{B as i}from"./shared-cb58dfcd.js";import{p as s}from"./shared-40028e80.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-578cde14.js";import{p as n}from"./shared-1d03f911.js";import{I as a}from"./shared-c009b9b6.js";import"./shared-0c242246.js";import"./shared-4d919766.js";import"./shared-58b6710c.js";import"./shared-d8694661.js";import"./shared-7977d581.js";import"./shared-f79f08cc.js";import"./shared-5d7c4673.js";import"./shared-241b6cca.js";import"./shared-ec9893c7.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-434cdfec.js";import"./shared-1b46df2a.js";import"./shared-1aff90a9.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-b1c9199f.js";import"./shared-e615d2d9.js";import"./shared-9d4813e6.js";import"./shared-2b126cea.js";import"./shared-d743d0fd.js";import"./shared-2fe8aabd.js";import"./shared-2939f350.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-c231e3bf.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-8e010314.js";import"./shared-53253d60.js";import"./foxy-pagination.js";import"./shared-4cae017c.js";import"./shared-b05ef317.js";import"./shared-a60ca6fe.js";import"./shared-330e57d9.js";import"./shared-d3d4badd.js";import"./shared-0cfb1c08.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";let r,l=e=>e;const d=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form",class extends d{constructor(){super(...arguments),this.__valuesInputParams={type:"number",step:"1",min:"1",max:"999"},this.__valuesGetValue=()=>{var e;return null===(e=this.form.values)||void 0===e?void 0:e.map((e=>{if(".5m"===e)return{value:e,label:this.t("values.twice_a_week")};const{units:t,count:i}=s(e);return{value:e,label:this.t(`values.${t}`,{count:i})}}))},this.__valuesSetValue=e=>{const t=e.filter((({value:e})=>parseFloat(e)<=999)).map((({unit:e,value:t})=>e?`${t}${e}`:t)).filter(((e,t,i)=>i.indexOf(e)===t));this.edit({values:t})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({values:e})=>!!e&&e.length>0||"values:v8n_required",({values:e})=>!e||e.length<=20||"values:v8n_too_long"]}get hiddenSelector(){return new i(`timestamps ${super.hiddenSelector}`.trim())}renderBody(){return o(r||(r=l` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-editable-list-control infer="values" .inputParams="${0}" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__valuesInputParams,this.__valuesGetValue,this.__valuesSetValue,[{label:this.t("values.unit_years"),value:"y"},{label:this.t("values.unit_months"),value:"m"},{label:this.t("values.unit_weeks"),value:"w"},{label:this.t("values.unit_days"),value:"d"}],super.renderBody())}});let u,c=e=>e;const f=t(a);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card",class extends f{renderBody(){var e;const{jsonataQuery:t,values:i}=null!==(e=this.data)&&void 0!==e?e:{},n=null==i?void 0:i.map((e=>{if(".5m"===e)return this.t("twice_a_week");const{units:t,count:i}=s(e);return this.t(t,{count:i})}));return o(u||(u=c` <section class="h-s flex flex-col justify-center leading-xs"> <p class="text-m font-medium min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),"*"===t?"title_all":"title_matching",{query:t},(null==i?void 0:i.length)?"subtitle_list":"subtitle_empty",{list:null==n?void 0:n.join(", ")})}});let p,h=e=>e;const m=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form",class extends m{constructor(){super(...arguments),this.__minmaxRestrictionsGetValue=()=>{const e=[],t=this.form;return t.min&&e.push("min"),t.max&&e.push("max"),e},this.__minmaxRestrictionsSetValue=e=>{const t=this.form;this.edit({min:e.includes("min")?t.min||"1m":null,max:e.includes("max")?t.max||"1y":null})},this.__minmaxRestrictionsOptions=[{label:"option_min",value:"min"},{label:"option_max",value:"max"}],this.__dayAndDateRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.type;return"day"===t?"days":"month"===t?"dates":"none"},this.__dayAndDateRestrictionsSetValue=e=>{"dates"===e?this.edit({allowedDays:{type:"month",days:[]}}):"days"===e?this.edit({allowedDays:{type:"day",days:[]}}):this.edit({allowedDays:null})},this.__dayAndDateRestrictionsOptions=[{label:"option_none",value:"none"},{label:"option_dates",value:"dates"},{label:"option_days",value:"days"}],this.__daysOfWeekGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>String(e))))&&void 0!==t?t:[]},this.__daysOfWeekSetValue=e=>{this.edit({allowedDays:{type:"day",days:e.map(Number)}})},this.__daysOfWeekOptions=[{label:"option_1",value:"1"},{label:"option_2",value:"2"},{label:"option_3",value:"3"},{label:"option_4",value:"4"},{label:"option_5",value:"5"},{label:"option_6",value:"6"},{label:"option_7",value:"7"}],this.__datesOfMonthInputParams={type:"number",min:"1",max:"31",step:"1"},this.__datesOfMonthGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>({value:String(e)}))))&&void 0!==t?t:[]},this.__datesOfMonthSetValue=e=>{this.edit({allowedDays:{type:"month",days:e.map((e=>parseInt(e.value))).filter((e=>Number.isInteger(e)&&e>=1&&e<=31))}})},this.__disallowedDatesInputParams={type:"date"},this.__disallowedDatesGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.disallowedDates)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==t?t:[]},this.__disallowedDatesSetValue=e=>{this.edit({disallowedDates:e.map((e=>e.value))})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({disallowedDates:e})=>!e||e.length<=10||"disallowed-dates:v8n_too_long"]}get hiddenSelector(){var e,t;const s=["timestamps",super.hiddenSelector.toString()],o=this.form;return o.min||s.unshift("min"),o.max||s.unshift("max"),"day"!==(null===(e=o.allowedDays)||void 0===e?void 0:e.type)&&s.unshift("days-of-week"),"month"!==(null===(t=o.allowedDays)||void 0===t?void 0:t.type)&&s.unshift("dates-of-month"),new i(s.join(" ").trim())}renderBody(){return o(p||(p=h` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="minmax-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-frequency-control infer="min"></foxy-internal-frequency-control> <foxy-internal-frequency-control infer="max"></foxy-internal-frequency-control> <foxy-internal-radio-group-control infer="day-and-date-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="days-of-week" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="dates-of-month" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="disallowed-dates" range="optional" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__minmaxRestrictionsGetValue,this.__minmaxRestrictionsSetValue,this.__minmaxRestrictionsOptions,this.__dayAndDateRestrictionsGetValue,this.__dayAndDateRestrictionsSetValue,this.__dayAndDateRestrictionsOptions,this.__daysOfWeekGetValue,this.__daysOfWeekSetValue,this.__daysOfWeekOptions,this.__datesOfMonthInputParams,this.__datesOfMonthGetValue,this.__datesOfMonthSetValue,this.__disallowedDatesInputParams,this.__disallowedDatesGetValue,this.__disallowedDatesSetValue,super.renderBody())}});let y,_=e=>e;const v=t(a);function x(e){try{return new URL(e).origin===e.toLowerCase()}catch(e){return!1}}customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card",class extends v{renderBody(){var e;const{min:t,max:i,allowedDays:s,jsonataQuery:a,disallowedDates:r}=null!==(e=this.data)&&void 0!==e?e:{},l=t?n(t):void 0,d=i?n(i):void 0,u="*"===a?"line_1_all":"line_1_matching",c={query:a},f={from:l?this.t(`unit_${l.units}`,{count:l.count}):this.t("any"),to:d?this.t(`unit_${d.units}`,{count:d.count}):this.t("any")},p=`line_3_${s?s.type:"any"}`,h={list:"month"===(null==s?void 0:s.type)?null==s?void 0:s.days.join(", "):null==s?void 0:s.days.map((e=>this.t(`day_${e}`))).join(", ")},m=r?"line_4_some":"line_4_none",v={list:null==r?void 0:r.map((e=>{const[t,i]=e.split("..");return t&&i?this.t("date_range",{from:t,to:i}):this.t("single_date",{value:e})})).join(", ")};return o(y||(y=_` <section class="leading-xs" style="margin:-.25ch 0"> <p class="text-m font-medium truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> </p> <p class="text-s text-secondary"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),u,c,f,p,h,m,v)}});let g,b=e=>e;const j=t(e,"customer-portal-settings-form");class w extends j{constructor(){super(...arguments),this.__sessionLifespanInMinutesOptions=[{value:"m",label:"option_minute"},{value:"h",label:"option_hour"},{value:"d",label:"option_day"},{value:"w",label:"option_week"}],this.__sessionLifespanInMinutesGetValue=()=>{var e;const t=null!==(e=this.form.sessionLifespanInMinutes)&&void 0!==e?e:0;return t%10080==0?t/10080+"w":t%1440==0?t/1440+"d":t%60==0?t/60+"h":`${t}m`},this.__sessionLifespanInMinutesSetValue=e=>{const t=parseInt(e);e.endsWith("w")?this.edit({sessionLifespanInMinutes:10080*t}):e.endsWith("d")?this.edit({sessionLifespanInMinutes:1440*t}):e.endsWith("h")?this.edit({sessionLifespanInMinutes:60*t}):this.edit({sessionLifespanInMinutes:t})},this.__allowedOriginsGetValue=()=>{var e;return null===(e=this.form.allowedOrigins)||void 0===e?void 0:e.map((e=>({label:x(e)?e:`⚠️ ${e}`,value:e})))},this.__allowedOriginsSetValue=e=>{this.edit({allowedOrigins:e.map((({value:e})=>function(e){try{return new URL(e).origin}catch(t){return e}}(e))).filter(((e,t,i)=>i.indexOf(e)===t))})},this.__featuresOptions=[{value:"sso",label:"option_sso"},{value:"sign-up",label:"option_sign_up"},{value:"frequency-modification",label:"option_frequency_modification"},{value:"next-date-modification",label:"option_next_date_modification"}],this.__featuresGetValue=()=>{var e,t,i;const s=[];return this.form.sso&&s.push("sso"),(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)&&s.push("sign-up"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&s.push("next-date-modification"),(null===(i=this.form.subscriptions)||void 0===i?void 0:i.allowFrequencyModification.length)&&s.push("frequency-modification"),s},this.__featuresSetValue=e=>{var t,i,s,o,n;const a=null!==(i=null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification)&&void 0!==i?i:[];this.edit({sso:e.includes("sso"),signUp:{enabled:e.includes("sign-up"),verification:null!==(o=null===(s=this.form.signUp)||void 0===s?void 0:s.verification)&&void 0!==o?o:{type:"hcaptcha",siteKey:"",secretKey:""}},subscriptions:{allowFrequencyModification:e.includes("frequency-modification")?0===a.length?[{jsonataQuery:"*",values:[]}]:a:[],allowNextDateModification:!!e.includes("next-date-modification")&&((null===(n=this.form.subscriptions)||void 0===n?void 0:n.allowNextDateModification)||[])}})},this.__signUpVerificationHcaptchaSiteKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.siteKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSiteKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.secretKey)&&void 0!==o?o:"",siteKey:e,type:"hcaptcha"}}})},this.__signUpVerificationHcaptchaSecretKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.secretKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSecretKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:e,siteKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.siteKey)&&void 0!==o?o:"",type:"hcaptcha"}}})},this.__jwtSecretGeneratorOptions={charset:"abcdefghijklmnopqrstuvwxyz0123456789",length:64}}static get v8n(){return[({sessionLifespanInMinutes:e})=>"number"!=typeof e||e<=40320||"session-lifespan-in-minutes:v8n_too_long",({allowedOrigins:e=[]})=>e.length<=10||"allowed-origins:v8n_too_many",({allowedOrigins:e=[]})=>e.every(x)||"allowed-origins:v8n_invalid",({jwtSharedSecret:e})=>!e||/^[a-z0-9-]+$/.test(e)||"jwt-shared-secret:v8n_invalid",({jwtSharedSecret:e})=>!e||e.length>=40||"jwt-shared-secret:v8n_too_short",({jwtSharedSecret:e})=>!e||e.length<=100||"jwt-shared-secret:v8n_too_long",({signUp:e})=>{const t=null==e?void 0:e.verification.siteKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-site-key:v8n_too_long"},({signUp:e})=>{const t=null==e?void 0:e.verification.secretKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-secret-key:v8n_too_long"}]}get hiddenSelector(){var e,t,s;const o=["header:copy-id",super.hiddenSelector.toString()];return(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)||o.push("sign-up-verification-hcaptcha-site-key","sign-up-verification-hcaptcha-secret-key"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification.length)||o.push("subscriptions-allow-frequency-modification"),(null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)||o.push("subscriptions-allow-next-date-modification"),new i(o.join(" ").trim())}renderBody(){return o(g||(g=b` ${0} <foxy-internal-editable-list-control infer="allowed-origins" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="features" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-site-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-secret-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowFrequencyModification" infer="subscriptions-allow-frequency-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowNextDateModification" infer="subscriptions-allow-next-date-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-frequency-control infer="session-lifespan-in-minutes" max="" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-password-control property="jwtSharedSecret" infer="jwt-shared-secret" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> ${0} `),this.renderHeader(),this.__allowedOriginsGetValue,this.__allowedOriginsSetValue,this.__featuresGetValue,this.__featuresSetValue,this.__featuresOptions,this.__signUpVerificationHcaptchaSiteKeyGetValue,this.__signUpVerificationHcaptchaSiteKeySetValue,this.__signUpVerificationHcaptchaSecretKeyGetValue,this.__signUpVerificationHcaptchaSecretKeySetValue,this.virtualHost,this.virtualHost,this.__sessionLifespanInMinutesGetValue,this.__sessionLifespanInMinutesSetValue,this.__sessionLifespanInMinutesOptions,this.__jwtSecretGeneratorOptions,super.renderBody())}async _sendPost(e){return this.__removeNullProperties(e),super._sendPost(e)}async _sendPatch(e){return this.__removeNullProperties(e),super._sendPatch(e)}__removeNullProperties(e){var t,i;"object"==typeof(null===(t=e.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&(null===(i=e.subscriptions)||void 0===i||i.allowNextDateModification.forEach((e=>{for(const t in e){const i=t;null===e[i]&&delete e[i]}})))}}customElements.define("foxy-customer-portal-settings-form",w);export{w as CustomerPortalSettingsForm};
|
|
1
|
+
import"./shared-a6c75cc0.js";import"./shared-44b46fef.js";import"./shared-656a46f7.js";import"./shared-89d4000a.js";import"./shared-9b9d5ff1.js";import{I as e}from"./shared-ffd5932d.js";import"./shared-70e6f32c.js";import{a as t}from"./shared-aa6dab90.js";import{B as i}from"./shared-cb58dfcd.js";import{p as s}from"./shared-97e2abfb.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-894c69f8.js";import{p as n}from"./shared-2f5cc0e2.js";import{I as a}from"./shared-bb6d7b97.js";import"./shared-274dec57.js";import"./shared-0d0585dc.js";import"./shared-9c010e0a.js";import"./shared-567ba8ae.js";import"./shared-ad60e8d1.js";import"./shared-1cd02e50.js";import"./shared-5f8c01f8.js";import"./shared-e6a1eef8.js";import"./shared-cc4b3b42.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-9171c265.js";import"./shared-dc4d2996.js";import"./shared-8ea2bbcc.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-d7d949bc.js";import"./shared-8a0bd046.js";import"./shared-9342ca50.js";import"./shared-7fd51889.js";import"./shared-a4216b50.js";import"./shared-c502de27.js";import"./shared-f7bfb29e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-e2d3c014.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-2f8e53c0.js";import"./shared-c31c50e2.js";import"./foxy-pagination.js";import"./shared-94716ec1.js";import"./shared-678beccf.js";import"./shared-6033e09d.js";import"./shared-2cb397e4.js";import"./shared-8f009bbb.js";import"./shared-bedc5e82.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";let r,l=e=>e;const d=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form",class extends d{constructor(){super(...arguments),this.__valuesInputParams={type:"number",step:"1",min:"1",max:"999"},this.__valuesGetValue=()=>{var e;return null===(e=this.form.values)||void 0===e?void 0:e.map((e=>{if(".5m"===e)return{value:e,label:this.t("values.twice_a_week")};const{units:t,count:i}=s(e);return{value:e,label:this.t(`values.${t}`,{count:i})}}))},this.__valuesSetValue=e=>{const t=e.filter((({value:e})=>parseFloat(e)<=999)).map((({unit:e,value:t})=>e?`${t}${e}`:t)).filter(((e,t,i)=>i.indexOf(e)===t));this.edit({values:t})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({values:e})=>!!e&&e.length>0||"values:v8n_required",({values:e})=>!e||e.length<=20||"values:v8n_too_long"]}get hiddenSelector(){return new i(`timestamps ${super.hiddenSelector}`.trim())}renderBody(){return o(r||(r=l` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-editable-list-control infer="values" .inputParams="${0}" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__valuesInputParams,this.__valuesGetValue,this.__valuesSetValue,[{label:this.t("values.unit_years"),value:"y"},{label:this.t("values.unit_months"),value:"m"},{label:this.t("values.unit_weeks"),value:"w"},{label:this.t("values.unit_days"),value:"d"}],super.renderBody())}});let u,c=e=>e;const f=t(a);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card",class extends f{renderBody(){var e;const{jsonataQuery:t,values:i}=null!==(e=this.data)&&void 0!==e?e:{},n=null==i?void 0:i.map((e=>{if(".5m"===e)return this.t("twice_a_week");const{units:t,count:i}=s(e);return this.t(t,{count:i})}));return o(u||(u=c` <section class="h-s flex flex-col justify-center leading-xs"> <p class="text-m font-medium min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),"*"===t?"title_all":"title_matching",{query:t},(null==i?void 0:i.length)?"subtitle_list":"subtitle_empty",{list:null==n?void 0:n.join(", ")})}});let p,h=e=>e;const m=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form",class extends m{constructor(){super(...arguments),this.__minmaxRestrictionsGetValue=()=>{const e=[],t=this.form;return t.min&&e.push("min"),t.max&&e.push("max"),e},this.__minmaxRestrictionsSetValue=e=>{const t=this.form;this.edit({min:e.includes("min")?t.min||"1m":null,max:e.includes("max")?t.max||"1y":null})},this.__minmaxRestrictionsOptions=[{label:"option_min",value:"min"},{label:"option_max",value:"max"}],this.__dayAndDateRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.type;return"day"===t?"days":"month"===t?"dates":"none"},this.__dayAndDateRestrictionsSetValue=e=>{"dates"===e?this.edit({allowedDays:{type:"month",days:[]}}):"days"===e?this.edit({allowedDays:{type:"day",days:[]}}):this.edit({allowedDays:null})},this.__dayAndDateRestrictionsOptions=[{label:"option_none",value:"none"},{label:"option_dates",value:"dates"},{label:"option_days",value:"days"}],this.__daysOfWeekGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>String(e))))&&void 0!==t?t:[]},this.__daysOfWeekSetValue=e=>{this.edit({allowedDays:{type:"day",days:e.map(Number)}})},this.__daysOfWeekOptions=[{label:"option_1",value:"1"},{label:"option_2",value:"2"},{label:"option_3",value:"3"},{label:"option_4",value:"4"},{label:"option_5",value:"5"},{label:"option_6",value:"6"},{label:"option_7",value:"7"}],this.__datesOfMonthInputParams={type:"number",min:"1",max:"31",step:"1"},this.__datesOfMonthGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>({value:String(e)}))))&&void 0!==t?t:[]},this.__datesOfMonthSetValue=e=>{this.edit({allowedDays:{type:"month",days:e.map((e=>parseInt(e.value))).filter((e=>Number.isInteger(e)&&e>=1&&e<=31))}})},this.__disallowedDatesInputParams={type:"date"},this.__disallowedDatesGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.disallowedDates)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==t?t:[]},this.__disallowedDatesSetValue=e=>{this.edit({disallowedDates:e.map((e=>e.value))})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({disallowedDates:e})=>!e||e.length<=10||"disallowed-dates:v8n_too_long"]}get hiddenSelector(){var e,t;const s=["timestamps",super.hiddenSelector.toString()],o=this.form;return o.min||s.unshift("min"),o.max||s.unshift("max"),"day"!==(null===(e=o.allowedDays)||void 0===e?void 0:e.type)&&s.unshift("days-of-week"),"month"!==(null===(t=o.allowedDays)||void 0===t?void 0:t.type)&&s.unshift("dates-of-month"),new i(s.join(" ").trim())}renderBody(){return o(p||(p=h` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="minmax-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-frequency-control infer="min"></foxy-internal-frequency-control> <foxy-internal-frequency-control infer="max"></foxy-internal-frequency-control> <foxy-internal-radio-group-control infer="day-and-date-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="days-of-week" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="dates-of-month" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="disallowed-dates" range="optional" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__minmaxRestrictionsGetValue,this.__minmaxRestrictionsSetValue,this.__minmaxRestrictionsOptions,this.__dayAndDateRestrictionsGetValue,this.__dayAndDateRestrictionsSetValue,this.__dayAndDateRestrictionsOptions,this.__daysOfWeekGetValue,this.__daysOfWeekSetValue,this.__daysOfWeekOptions,this.__datesOfMonthInputParams,this.__datesOfMonthGetValue,this.__datesOfMonthSetValue,this.__disallowedDatesInputParams,this.__disallowedDatesGetValue,this.__disallowedDatesSetValue,super.renderBody())}});let y,_=e=>e;const v=t(a);function x(e){try{return new URL(e).origin===e.toLowerCase()}catch(e){return!1}}customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card",class extends v{renderBody(){var e;const{min:t,max:i,allowedDays:s,jsonataQuery:a,disallowedDates:r}=null!==(e=this.data)&&void 0!==e?e:{},l=t?n(t):void 0,d=i?n(i):void 0,u="*"===a?"line_1_all":"line_1_matching",c={query:a},f={from:l?this.t(`unit_${l.units}`,{count:l.count}):this.t("any"),to:d?this.t(`unit_${d.units}`,{count:d.count}):this.t("any")},p=`line_3_${s?s.type:"any"}`,h={list:"month"===(null==s?void 0:s.type)?null==s?void 0:s.days.join(", "):null==s?void 0:s.days.map((e=>this.t(`day_${e}`))).join(", ")},m=r?"line_4_some":"line_4_none",v={list:null==r?void 0:r.map((e=>{const[t,i]=e.split("..");return t&&i?this.t("date_range",{from:t,to:i}):this.t("single_date",{value:e})})).join(", ")};return o(y||(y=_` <section class="leading-xs" style="margin:-.25ch 0"> <p class="text-m font-medium truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> </p> <p class="text-s text-secondary"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),u,c,f,p,h,m,v)}});let g,b=e=>e;const j=t(e,"customer-portal-settings-form");class w extends j{constructor(){super(...arguments),this.__sessionLifespanInMinutesOptions=[{value:"m",label:"option_minute"},{value:"h",label:"option_hour"},{value:"d",label:"option_day"},{value:"w",label:"option_week"}],this.__sessionLifespanInMinutesGetValue=()=>{var e;const t=null!==(e=this.form.sessionLifespanInMinutes)&&void 0!==e?e:0;return t%10080==0?t/10080+"w":t%1440==0?t/1440+"d":t%60==0?t/60+"h":`${t}m`},this.__sessionLifespanInMinutesSetValue=e=>{const t=parseInt(e);e.endsWith("w")?this.edit({sessionLifespanInMinutes:10080*t}):e.endsWith("d")?this.edit({sessionLifespanInMinutes:1440*t}):e.endsWith("h")?this.edit({sessionLifespanInMinutes:60*t}):this.edit({sessionLifespanInMinutes:t})},this.__allowedOriginsGetValue=()=>{var e;return null===(e=this.form.allowedOrigins)||void 0===e?void 0:e.map((e=>({label:x(e)?e:`⚠️ ${e}`,value:e})))},this.__allowedOriginsSetValue=e=>{this.edit({allowedOrigins:e.map((({value:e})=>function(e){try{return new URL(e).origin}catch(t){return e}}(e))).filter(((e,t,i)=>i.indexOf(e)===t))})},this.__featuresOptions=[{value:"sso",label:"option_sso"},{value:"sign-up",label:"option_sign_up"},{value:"frequency-modification",label:"option_frequency_modification"},{value:"next-date-modification",label:"option_next_date_modification"}],this.__featuresGetValue=()=>{var e,t,i;const s=[];return this.form.sso&&s.push("sso"),(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)&&s.push("sign-up"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&s.push("next-date-modification"),(null===(i=this.form.subscriptions)||void 0===i?void 0:i.allowFrequencyModification.length)&&s.push("frequency-modification"),s},this.__featuresSetValue=e=>{var t,i,s,o,n;const a=null!==(i=null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification)&&void 0!==i?i:[];this.edit({sso:e.includes("sso"),signUp:{enabled:e.includes("sign-up"),verification:null!==(o=null===(s=this.form.signUp)||void 0===s?void 0:s.verification)&&void 0!==o?o:{type:"hcaptcha",siteKey:"",secretKey:""}},subscriptions:{allowFrequencyModification:e.includes("frequency-modification")?0===a.length?[{jsonataQuery:"*",values:[]}]:a:[],allowNextDateModification:!!e.includes("next-date-modification")&&((null===(n=this.form.subscriptions)||void 0===n?void 0:n.allowNextDateModification)||[])}})},this.__signUpVerificationHcaptchaSiteKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.siteKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSiteKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.secretKey)&&void 0!==o?o:"",siteKey:e,type:"hcaptcha"}}})},this.__signUpVerificationHcaptchaSecretKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.secretKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSecretKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:e,siteKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.siteKey)&&void 0!==o?o:"",type:"hcaptcha"}}})},this.__jwtSecretGeneratorOptions={charset:"abcdefghijklmnopqrstuvwxyz0123456789",length:64}}static get v8n(){return[({sessionLifespanInMinutes:e})=>"number"!=typeof e||e<=40320||"session-lifespan-in-minutes:v8n_too_long",({allowedOrigins:e=[]})=>e.length<=10||"allowed-origins:v8n_too_many",({allowedOrigins:e=[]})=>e.every(x)||"allowed-origins:v8n_invalid",({jwtSharedSecret:e})=>!e||/^[a-z0-9-]+$/.test(e)||"jwt-shared-secret:v8n_invalid",({jwtSharedSecret:e})=>!e||e.length>=40||"jwt-shared-secret:v8n_too_short",({jwtSharedSecret:e})=>!e||e.length<=100||"jwt-shared-secret:v8n_too_long",({signUp:e})=>{const t=null==e?void 0:e.verification.siteKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-site-key:v8n_too_long"},({signUp:e})=>{const t=null==e?void 0:e.verification.secretKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-secret-key:v8n_too_long"}]}get hiddenSelector(){var e,t,s;const o=["header:copy-id",super.hiddenSelector.toString()];return(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)||o.push("sign-up-verification-hcaptcha-site-key","sign-up-verification-hcaptcha-secret-key"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification.length)||o.push("subscriptions-allow-frequency-modification"),(null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)||o.push("subscriptions-allow-next-date-modification"),new i(o.join(" ").trim())}renderBody(){return o(g||(g=b` ${0} <foxy-internal-editable-list-control infer="allowed-origins" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="features" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-site-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-secret-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowFrequencyModification" infer="subscriptions-allow-frequency-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowNextDateModification" infer="subscriptions-allow-next-date-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-frequency-control infer="session-lifespan-in-minutes" max="" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-password-control property="jwtSharedSecret" infer="jwt-shared-secret" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> ${0} `),this.renderHeader(),this.__allowedOriginsGetValue,this.__allowedOriginsSetValue,this.__featuresGetValue,this.__featuresSetValue,this.__featuresOptions,this.__signUpVerificationHcaptchaSiteKeyGetValue,this.__signUpVerificationHcaptchaSiteKeySetValue,this.__signUpVerificationHcaptchaSecretKeyGetValue,this.__signUpVerificationHcaptchaSecretKeySetValue,this.virtualHost,this.virtualHost,this.__sessionLifespanInMinutesGetValue,this.__sessionLifespanInMinutesSetValue,this.__sessionLifespanInMinutesOptions,this.__jwtSecretGeneratorOptions,super.renderBody())}async _sendPost(e){return this.__removeNullProperties(e),super._sendPost(e)}async _sendPatch(e){return this.__removeNullProperties(e),super._sendPatch(e)}__removeNullProperties(e){var t,i;"object"==typeof(null===(t=e.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&(null===(i=e.subscriptions)||void 0===i||i.allowNextDateModification.forEach((e=>{for(const t in e){const i=t;null===e[i]&&delete e[i]}})))}}customElements.define("foxy-customer-portal-settings-form",w);export{w as CustomerPortalSettingsForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aJ as e,_ as t,aK as s,aL as i}from"./shared-cb58dfcd.js";import"./shared-1b46df2a.js";import{B as a}from"./shared-f79f08cc.js";import{E as n,F as l}from"./shared-5a04e75c.js";import"./shared-58b6710c.js";import"./shared-1aff90a9.js";import{L as r,h as d,c as o}from"./shared-ba5c42c7.js";import{A as h,z as c,y as u,w as _}from"./shared-e1400289.js";import{a as g,I as p,D as m,b as v,S as x,c as y,C as $,M as f,W as b,d as w,t as k,e as E}from"./shared-cae254ee.js";import"./shared-53253d60.js";import"./shared-d743d0fd.js";import"./shared-e615d2d9.js";import"./shared-5d7c4673.js";import"./shared-0553380e.js";import"./shared-9d4813e6.js";import{c as C}from"./shared-4e709717.js";import{C as S}from"./shared-d3d4badd.js";import"./shared-b05ef317.js";import"./shared-2fe8aabd.js";import{I as R}from"./shared-330e57d9.js";import"./shared-c231e3bf.js";import{P as I}from"./shared-0cfb1c08.js";import{i as j}from"./shared-4a38cb3e.js";import{i as V,a as M}from"./shared-5e4a03d1.js";import{G as q}from"./shared-ae2336ab.js";import{p as N}from"./shared-1d03f911.js";import{j as T}from"./shared-673d668a.js";import{p as D}from"./shared-43e2c3f6.js";import{W as A}from"./shared-692691ca.js";import{D as U}from"./shared-3cdec25d.js";import{i as O}from"./shared-5ef40e86.js";import"./shared-241b6cca.js";import"./shared-d8694661.js";import"./shared-7977d581.js";import"./shared-86337ba8.js";import"./shared-b1c9199f.js";import"./shared-2b126cea.js";import"./shared-2aa23b5f.js";import"./shared-53e476fd.js";import"./shared-7eeb591f.js";import"./shared-0cc8df04.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./shared-7594e563.js";var F=1/0,L=17976931348623157e292;function B(e){return e?(e=h(e))===F||e===-F?(e<0?-1:1)*L:e==e?e:0:0===e?e:0}var z=Math.floor,P=Math.random;var Q=parseFloat,K=Math.min,J=Math.random;function G(e,t,s){if(s&&"boolean"!=typeof s&&j(e,t,s)&&(t=s=void 0),void 0===s&&("boolean"==typeof t?(s=t,t=void 0):"boolean"==typeof e&&(s=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=B(e),void 0===t?(t=e,e=0):t=B(t)),e>t){var i=e;e=t,t=i}if(s||e%1||t%1){var a=J();return K(e+a*(t-e+Q("1e-"+((a+"").length-1))),t)}return function(e,t){return e+z(P()*(t-e+1))}(e,t)}var H=4294967295,W=Math.min;function Y(t,s){if(t=function(e){var t=B(e),s=t%1;return t==t?s?t-s:t:0}(t),t<1||t>9007199254740991)return[];var i,a=H,n=W(t,H);t-=H;for(var l=e(n,s="function"==typeof(i=s)?i:V);++a<t;)s(a);return l}class X extends CustomEvent{constructor(e){super("change",{detail:e})}}let Z,ee,te=e=>e;class se extends r{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return c.styles}render(){return d(Z||(Z=te` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>d(ee||(ee=te` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new X(this.value))}}let ie,ae,ne=e=>e;class le extends r{static get styles(){return[c.styles,o(ie||(ie=ne`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return d(ae||(ae=ne` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let re,de,oe=e=>e;class he extends r{static get styles(){return[c.styles,o(re||(re=oe`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return d(de||(de=oe` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-medium text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let ce,ue,_e=e=>e;class ge extends he{static get styles(){return[super.styles,o(ce||(ce=_e`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return d(ue||(ue=_e` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-medium text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let pe,me=e=>e;class ve extends CustomEvent{constructor(e){super("change",{detail:e})}}class xe extends r{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return t(t({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return c.styles}render(){return d(pe||(pe=me` <label class="${0}"> <span class="text-body font-medium text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),C({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),C({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),C({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new ve(this.checked))}))}}class ye extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class $e extends CustomEvent{static emit(e){return new Promise(((s,i)=>{const a=new $e(t({resolve:s,reject:i},e));e.source.dispatchEvent(a)&&i(new ye)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}let fe,be=e=>e;class we extends CustomEvent{constructor(e){super("change",{detail:e})}}class ke extends u{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":R,"vaadin-custom-field":S,"vaadin-select":g,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return d(fe||(fe=be` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),C({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new we({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let Ee,Ce=e=>e;class Se extends CustomEvent{constructor(e){super("change",{detail:e})}}class Re extends u{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":I,"vaadin-button":a,"iron-icon":customElements.get("iron-icon"),"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return d(Ee||(Ee=Ce` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=Y(72,(()=>G(35).toString(36))).join(""),this.dispatchEvent(new Se({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new Se({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function Ie(e){return t=>{t.preventDefault(),e(t)}}class je extends m{}let Ve,Me=e=>e;class qe extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=qe.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":v}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return d(Ve||(Ve=Me` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return N(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return N(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new je(this.value))}}qe.defaultValue="1w";class Ne extends X{}let Te,De,Ae,Ue,Oe=e=>e;class Fe extends u{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=qe.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":qe,"x-skeleton":x,"x-list":se,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return d(Te||(Te=Oe` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?d(De||(De=Oe`<span slot="${0}">${0}</span>`),t,this.__getText(e)):d(Ae||(Ae=Oe`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?d(Ue||(Ue=Oe` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,C({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=qe.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ne(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class Le extends y{}let Be,ze,Pe=e=>e;class Qe extends u{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=_((e=>{try{T(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":$,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return d(Be||(Be=Pe` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?d(ze||(ze=Pe` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new Le(this.value))}}class Ke extends CustomEvent{constructor(e){super("change",{detail:e})}}class Je extends CustomEvent{constructor(){super("remove")}}let Ge,He,We=e=>e;class Ye extends u{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":Fe,"x-jsonata-input":Qe,"iron-icon":customElements.get("iron-icon"),"x-group":q,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return d(Ge||(Ge=We` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),C({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,Ie((()=>{this.dispatchEvent(new Je)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=N(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return d(He||(He=We` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=t(t({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=t(t({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new Ke(this.value))}}class Xe extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ze,et,tt=e=>e;class st extends u{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":Ye,"vaadin-button":customElements.get("vaadin-button"),"x-section":ge,"iron-icon":customElements.get("iron-icon"),"x-group":q,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return d(Ze||(Ze=tt` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.subtitle" slot="subtitle" class="mr-xl"></x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>d(et||(et=tt` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,C({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new Xe(this.value))}}function it(e,s){const i=(new Date).getFullYear(),a={month:"long",day:"numeric"};return e.split("..").map((e=>{const n=D(e),l=(null==n?void 0:n.getFullYear())===i?void 0:"numeric";return null==n?void 0:n.toLocaleDateString(s,t({year:l},a))})).join(" – ")}class at extends CustomEvent{constructor(e){super("change",{detail:e})}}let nt,lt,rt,dt=e=>e;class ot extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":f,"x-weekday-picker":b,"x-choice":$,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return d(nt||(nt=dt` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?d(lt||(lt=dt` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?d(rt||(rt=dt` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new at(this.value))}}class ht extends X{}let ct,ut,_t,gt,pt=e=>e;class mt extends u{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":U,"vaadin-button":a,"x-skeleton":x,"iron-icon":customElements.get("iron-icon"),"x-i18n":p,"x-list":se}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return d(ct||(ct=pt` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?d(ut||(ut=pt`<span slot="${0}" class="truncate">${0}</span>`),t,it(e,this.lang)):d(_t||(_t=pt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?d(gt||(gt=pt` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,C({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=D(this.__endValue),s=D(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new ht(this.value))}}class vt extends CustomEvent{constructor(e){super("change",{detail:e})}}let xt,yt,$t=e=>e;class ft extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":qe,"x-choice":$,"x-group":q,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return d(xt||(xt=$t` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?d(yt||(yt=$t` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=N(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new vt(this.value))}}class bt extends CustomEvent{constructor(e){super("change",{detail:e})}}class wt extends CustomEvent{constructor(){super("remove")}}let kt,Et,Ct,St,Rt,It,jt,Vt,Mt,qt=e=>e;class Nt extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":mt,"x-jsonata-input":Qe,"x-offset-input":ft,"x-allowed-days":ot,"iron-icon":customElements.get("iron-icon"),"x-warning":A,"x-group":q,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:s,allowedDays:i,jsonataQuery:a,disallowedDates:n}=this.value,l=e||s,r=i&&i.days.length>0,o=n&&n.length>0,h=this.open?"":"rounded-b-l";return d(kt||(kt=qt` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),C({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),h,this.ns,this.lang,`ndmod.${"*"===a?"all":"some"}Title`,"*"!==a?this.__renderJSONataSummary(a):"",l||r||o?d(Et||(Et=qt` <div> ${0} </div> `),w(l&&this.__renderMinMaxSummary(e,s),r&&this.__renderAllowedSummary(i),o&&this.__renderDisallowedSummary(n))):"",this.disabled||!this._isI18nReady,Ie((()=>this.dispatchEvent(new wt))),this.ns,this.lang,this.ns,this.lang,a,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,s)?d(Ct||(Ct=qt` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=n?n:[],this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new bt(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=N(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return d(St||(St=qt` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return d(Rt||(Rt=qt` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return d(It||(It=qt`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return d(jt||(jt=qt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} — ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?N(e):void 0),this.__renderMinMaxContent(t?N(t):void 0))}__renderAllowedSummary({type:e,days:t}){return d(Vt||(Vt=qt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>k(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return d(Mt||(Mt=qt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>it(e,this.lang))).join("; "))}}class Tt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Dt,At,Ut,Ot=e=>e;class Ft extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":Nt,"vaadin-button":customElements.get("vaadin-button"),"x-section":ge,"iron-icon":customElements.get("iron-icon"),"x-switch":xe,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return d(Dt||(Dt=Ot` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?d(At||(At=Ot` ${0} `),this.__normalizedValue.map(((e,t,s)=>d(Ut||(Ut=Ot` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,C({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Tt(this.value))}}class Lt extends X{}let Bt,zt,Pt,Qt=e=>e;class Kt extends u{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":x,"iron-icon":customElements.get("iron-icon"),"x-group":q,"x-list":se,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return d(Bt||(Bt=Qt` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?d(zt||(zt=Qt` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):d(Pt||(Pt=Qt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,C({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new Lt(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}class Jt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Gt,Ht=e=>e;class Wt extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":ge,"x-switch":xe,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return d(Gt||(Gt=Ht` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sso.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="sso.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang)}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Jt(this.value))}}const Yt=E.assign({error:(e,t)=>t.data.type}),Xt=E.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),Zt=E.assign({oldResource:e=>e.newResource}),es=E.assign({invalid:[],newResource:({oldResource:e})=>e}),ts=E.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:Y(72,(()=>G(35).toString(36))).join(""),sessionLifespanInMinutes:40320,signUp:{enabled:!1,verification:{type:"hcaptcha",siteKey:"",secretKey:""}},sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),ss=E.assign({newResource:null}),is=E.assign({error:"setup_needed"}),as=E.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{allowedOrigins:i})}}),ns=E.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{subscriptions:t(t({},e.subscriptions),{},{allowFrequencyModification:i})})}}),ls=E.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{subscriptions:t(t({},e.subscriptions),{},{allowNextDateModification:i})})}}),rs=E.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{signUp:i})}}),ds=E.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{sessionLifespanInMinutes:i})}}),os=E.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{jwtSharedSecret:i})}}),hs=E.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),cs=E.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{sso:i})}}),us={SET_SSO:{target:"#cps.idle",actions:"setSSO"},SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_SIGN_UP:{target:"#cps.idle",actions:"setSignUp"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},_s={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},gs=s({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:us},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:t({on:us},_s),updated:t({on:us},_s),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>i(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:ns,setNextDateModification:ls,setOrigins:as,setSession:ds,setSecret:os,setSignUp:rs,setHref:hs,setSSO:cs,handleLoadingSuccess:Xt,handleSavingSuccess:Zt,handleError:Yt,create:ts,reset:es,remove:ss,requireSetup:is}});class ps extends CustomEvent{constructor(e){super("change",{detail:e})}}let ms,vs,xs=e=>e;class ys extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=void 0}static get scopedElements(){return{"vaadin-password-field":I,"x-section":ge,"x-switch":xe,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s;return d(ms||(ms=xs` <x-section> <x-switch data-testid="toggle" class="-my-xs" slot="title" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sign_up.title" class="text-l"></x-i18n> </x-switch> <x-i18n class="mr-xl" slot="subtitle" key="sign_up.subtitle" .lang="${0}" .ns="${0}"> </x-i18n> ${0} </x-section> `),this.disabled||!this._isI18nReady,this.__normalizedValue.enabled,(()=>{const e=this.__normalizedValue;e.enabled=!e.enabled,e.enabled||(e.verification.siteKey="",e.verification.secretKey=""),this.value=e,this.requestUpdate(),this.__sendChange()}),this.ns,this.lang,this.lang,this.ns,(null===(e=this.__normalizedValue)||void 0===e?void 0:e.enabled)?d(vs||(vs=xs` <div class="grid gap-m sm-grid-cols-2"> <vaadin-password-field .placeholder="${0}" .disabled="${0}" .value="${0}" .label="${0}" autocomplete="off" data-testid="site-key" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-password-field .placeholder="${0}" .disabled="${0}" .value="${0}" .label="${0}" autocomplete="off" data-testid="secret-key" @change="${0}" @input="${0}"> </vaadin-password-field> <x-i18n class="sm-col-span-2 text-s text-secondary" lang="${0}" key="sign_up.hcaptcha_explainer" ns="${0}"> </x-i18n> </div> `),this._isI18nReady?this._t("sign_up.site_key_placeholder").toString():"---",this.disabled||!this._isI18nReady,this._isI18nReady?null===(t=this.value)||void 0===t?void 0:t.verification.siteKey:"",this._isI18nReady?this._t("sign_up.site_key_label").toString():"---",(e=>e.stopPropagation()),(e=>{const t=this.__normalizedValue;t.verification.siteKey=e.target.value,this.value=t,this.requestUpdate(),this.__sendChange()}),this._isI18nReady?this._t("sign_up.secret_key_placeholder").toString():"---",this.disabled||!this._isI18nReady,this._isI18nReady?null===(s=this.value)||void 0===s?void 0:s.verification.secretKey:"",this._isI18nReady?this._t("sign_up.secret_key_label").toString():"---",(e=>e.stopPropagation()),(e=>{const t=this.__normalizedValue;t.verification.secretKey=e.target.value,this.value=t,this.requestUpdate(),this.__sendChange()}),this.lang,this.ns):"")}get __normalizedValue(){return this.value?M(this.value):{verification:{type:"hcaptcha",siteKey:"",secretKey:""},enabled:!1}}__sendChange(){this.dispatchEvent(new ps(this.value))}}let $s,fs,bs,ws,ks=e=>e;function Es(e){if(!e.ok)throw new l(401===e.status?"unauthorized":"unknown")}class Cs extends CustomEvent{constructor(){super("ready")}}class Ss extends CustomEvent{constructor(){super("update")}}class Rs extends u{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=gs.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=O(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":st,"x-next-date-modification":Ft,"x-session-duration":ke,"x-session-secret":Re,"x-loading-screen":le,"x-error-screen":n,"x-origins-list":Kt,"x-sso-switch":Wt,"x-skeleton":x,"x-section":ge,"x-sign-up":ys,"x-switch":xe,"x-i18n":p,"x-page":he}}static get properties(){return t(t({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,s,i,a,n,l;if(this.__service.state.matches("error"))return d($s||($s=ks` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:r}=this.__service.state.context,o=this.__service.state.matches("idle.dirty.created"),h=this.__service.state.matches("idle.dirty.deleted"),c=this.__service.state.matches("idle.dirty.updated"),u=this.__service.state.matches("idle.clean.enabled"),_=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return d(fs||(fs=ks` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-sso-switch data-testid="sso" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-sso-switch> <x-sign-up data-testid="signup" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-sign-up> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,u||o||c,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==r?void 0:r.allowedOrigins)&&void 0!==e?e:[],!r,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(s=null==r?void 0:r.subscriptions.allowFrequencyModification)&&void 0!==s?s:[],!r,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==r?void 0:r.subscriptions.allowNextDateModification)&&void 0!==i&&i,!r,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(a=null==r?void 0:r.sso)&&void 0!==a&&a,!r,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),!r,null==r?void 0:r.signUp,this.lang,this.ns,(e=>{this.__service.send({type:"SET_SIGN_UP",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!r||!this._isI18nReady,null!==(n=null==r?void 0:r.sessionLifespanInMinutes)&&void 0!==n?n:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(t({type:"SET_SESSION"},e))}),!r||!this._isI18nReady,null!==(l=null==r?void 0:r.jwtSharedSecret)&&void 0!==l?l:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(t({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?d(bs||(bs=ks` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),h?"error":"success",_,(()=>this.__service.send("SAVE")),this.lang,this.ns,o?"create":h?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?d(ws||(ws=ks`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new l("setup_needed");try{await this.updateComplete;const e=await $e.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await $e.emit({source:this,init:["/"]});Es(e);const i=(await e.json())._links["fx:store"].href,a=await $e.emit({source:this,init:[i]});Es(a),s=await a.json()}else{Es(e),t=await e.json();const i=t._links["fx:store"].href,a=await $e.emit({source:this,init:[i]});Es(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof l)throw e;if(e instanceof ye)throw new l("setup_needed");throw new l("unknown")}finally{await this.updateComplete,this.dispatchEvent(new Cs)}}async __save(){try{const e=this.__service.state.context,t=M(e.newResource),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};Es(await $e.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof l)throw e;if(e instanceof ye)throw new l("setup_needed");throw new l("unknown")}finally{await this.updateComplete,this.dispatchEvent(new Ss)}}}customElements.define("foxy-customer-portal-settings",Rs);export{Rs as CustomerPortalSettings};
|
|
1
|
+
import{aJ as e,_ as t,aK as s,aL as i}from"./shared-cb58dfcd.js";import"./shared-dc4d2996.js";import{B as a}from"./shared-1cd02e50.js";import{E as n,F as l}from"./shared-2828fcbf.js";import"./shared-9c010e0a.js";import"./shared-8ea2bbcc.js";import{L as r,h as d,c as o}from"./shared-ba5c42c7.js";import{A as h,z as c,y as u,w as _}from"./shared-aa6dab90.js";import{a as g,I as p,D as m,b as v,S as x,c as y,C as $,M as f,W as b,d as w,t as k,e as E}from"./shared-74d599dc.js";import"./shared-c31c50e2.js";import"./shared-a4216b50.js";import"./shared-8a0bd046.js";import"./shared-5f8c01f8.js";import"./shared-fed829c2.js";import"./shared-9342ca50.js";import{c as C}from"./shared-4e709717.js";import{C as S}from"./shared-8f009bbb.js";import"./shared-678beccf.js";import"./shared-c502de27.js";import{I as R}from"./shared-2cb397e4.js";import"./shared-e2d3c014.js";import{P as I}from"./shared-bedc5e82.js";import{i as j}from"./shared-4a38cb3e.js";import{i as V,a as M}from"./shared-5e4a03d1.js";import{G as q}from"./shared-4b393539.js";import{p as N}from"./shared-2f5cc0e2.js";import{j as T}from"./shared-673d668a.js";import{p as D}from"./shared-43e2c3f6.js";import{W as A}from"./shared-4cafa2e7.js";import{D as U}from"./shared-264e8301.js";import{i as O}from"./shared-5ef40e86.js";import"./shared-e6a1eef8.js";import"./shared-567ba8ae.js";import"./shared-ad60e8d1.js";import"./shared-e88763ec.js";import"./shared-d7d949bc.js";import"./shared-7fd51889.js";import"./shared-2aa23b5f.js";import"./shared-53e476fd.js";import"./shared-4dd24dda.js";import"./shared-6962f117.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./shared-7594e563.js";var F=1/0,L=17976931348623157e292;function B(e){return e?(e=h(e))===F||e===-F?(e<0?-1:1)*L:e==e?e:0:0===e?e:0}var z=Math.floor,P=Math.random;var Q=parseFloat,K=Math.min,J=Math.random;function G(e,t,s){if(s&&"boolean"!=typeof s&&j(e,t,s)&&(t=s=void 0),void 0===s&&("boolean"==typeof t?(s=t,t=void 0):"boolean"==typeof e&&(s=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=B(e),void 0===t?(t=e,e=0):t=B(t)),e>t){var i=e;e=t,t=i}if(s||e%1||t%1){var a=J();return K(e+a*(t-e+Q("1e-"+((a+"").length-1))),t)}return function(e,t){return e+z(P()*(t-e+1))}(e,t)}var H=4294967295,W=Math.min;function Y(t,s){if(t=function(e){var t=B(e),s=t%1;return t==t?s?t-s:t:0}(t),t<1||t>9007199254740991)return[];var i,a=H,n=W(t,H);t-=H;for(var l=e(n,s="function"==typeof(i=s)?i:V);++a<t;)s(a);return l}class X extends CustomEvent{constructor(e){super("change",{detail:e})}}let Z,ee,te=e=>e;class se extends r{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return c.styles}render(){return d(Z||(Z=te` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>d(ee||(ee=te` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new X(this.value))}}let ie,ae,ne=e=>e;class le extends r{static get styles(){return[c.styles,o(ie||(ie=ne`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return d(ae||(ae=ne` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let re,de,oe=e=>e;class he extends r{static get styles(){return[c.styles,o(re||(re=oe`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return d(de||(de=oe` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-medium text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let ce,ue,_e=e=>e;class ge extends he{static get styles(){return[super.styles,o(ce||(ce=_e`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return d(ue||(ue=_e` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-medium text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let pe,me=e=>e;class ve extends CustomEvent{constructor(e){super("change",{detail:e})}}class xe extends r{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return t(t({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return c.styles}render(){return d(pe||(pe=me` <label class="${0}"> <span class="text-body font-medium text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),C({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),C({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),C({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new ve(this.checked))}))}}class ye extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class $e extends CustomEvent{static emit(e){return new Promise(((s,i)=>{const a=new $e(t({resolve:s,reject:i},e));e.source.dispatchEvent(a)&&i(new ye)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}let fe,be=e=>e;class we extends CustomEvent{constructor(e){super("change",{detail:e})}}class ke extends u{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":R,"vaadin-custom-field":S,"vaadin-select":g,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return d(fe||(fe=be` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),C({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new we({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let Ee,Ce=e=>e;class Se extends CustomEvent{constructor(e){super("change",{detail:e})}}class Re extends u{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":I,"vaadin-button":a,"iron-icon":customElements.get("iron-icon"),"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return d(Ee||(Ee=Ce` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=Y(72,(()=>G(35).toString(36))).join(""),this.dispatchEvent(new Se({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new Se({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function Ie(e){return t=>{t.preventDefault(),e(t)}}class je extends m{}let Ve,Me=e=>e;class qe extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=qe.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":v}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return d(Ve||(Ve=Me` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return N(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return N(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new je(this.value))}}qe.defaultValue="1w";class Ne extends X{}let Te,De,Ae,Ue,Oe=e=>e;class Fe extends u{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=qe.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":qe,"x-skeleton":x,"x-list":se,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return d(Te||(Te=Oe` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?d(De||(De=Oe`<span slot="${0}">${0}</span>`),t,this.__getText(e)):d(Ae||(Ae=Oe`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?d(Ue||(Ue=Oe` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,C({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=qe.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ne(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class Le extends y{}let Be,ze,Pe=e=>e;class Qe extends u{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=_((e=>{try{T(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":$,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return d(Be||(Be=Pe` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?d(ze||(ze=Pe` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new Le(this.value))}}class Ke extends CustomEvent{constructor(e){super("change",{detail:e})}}class Je extends CustomEvent{constructor(){super("remove")}}let Ge,He,We=e=>e;class Ye extends u{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":Fe,"x-jsonata-input":Qe,"iron-icon":customElements.get("iron-icon"),"x-group":q,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return d(Ge||(Ge=We` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),C({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,Ie((()=>{this.dispatchEvent(new Je)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=N(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return d(He||(He=We` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=t(t({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=t(t({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new Ke(this.value))}}class Xe extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ze,et,tt=e=>e;class st extends u{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":Ye,"vaadin-button":customElements.get("vaadin-button"),"x-section":ge,"iron-icon":customElements.get("iron-icon"),"x-group":q,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return d(Ze||(Ze=tt` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.subtitle" slot="subtitle" class="mr-xl"></x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>d(et||(et=tt` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,C({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new Xe(this.value))}}function it(e,s){const i=(new Date).getFullYear(),a={month:"long",day:"numeric"};return e.split("..").map((e=>{const n=D(e),l=(null==n?void 0:n.getFullYear())===i?void 0:"numeric";return null==n?void 0:n.toLocaleDateString(s,t({year:l},a))})).join(" – ")}class at extends CustomEvent{constructor(e){super("change",{detail:e})}}let nt,lt,rt,dt=e=>e;class ot extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":f,"x-weekday-picker":b,"x-choice":$,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return d(nt||(nt=dt` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?d(lt||(lt=dt` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?d(rt||(rt=dt` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new at(this.value))}}class ht extends X{}let ct,ut,_t,gt,pt=e=>e;class mt extends u{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":U,"vaadin-button":a,"x-skeleton":x,"iron-icon":customElements.get("iron-icon"),"x-i18n":p,"x-list":se}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return d(ct||(ct=pt` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?d(ut||(ut=pt`<span slot="${0}" class="truncate">${0}</span>`),t,it(e,this.lang)):d(_t||(_t=pt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?d(gt||(gt=pt` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,C({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=D(this.__endValue),s=D(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new ht(this.value))}}class vt extends CustomEvent{constructor(e){super("change",{detail:e})}}let xt,yt,$t=e=>e;class ft extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":qe,"x-choice":$,"x-group":q,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return d(xt||(xt=$t` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?d(yt||(yt=$t` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=N(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new vt(this.value))}}class bt extends CustomEvent{constructor(e){super("change",{detail:e})}}class wt extends CustomEvent{constructor(){super("remove")}}let kt,Et,Ct,St,Rt,It,jt,Vt,Mt,qt=e=>e;class Nt extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":mt,"x-jsonata-input":Qe,"x-offset-input":ft,"x-allowed-days":ot,"iron-icon":customElements.get("iron-icon"),"x-warning":A,"x-group":q,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:s,allowedDays:i,jsonataQuery:a,disallowedDates:n}=this.value,l=e||s,r=i&&i.days.length>0,o=n&&n.length>0,h=this.open?"":"rounded-b-l";return d(kt||(kt=qt` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),C({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),h,this.ns,this.lang,`ndmod.${"*"===a?"all":"some"}Title`,"*"!==a?this.__renderJSONataSummary(a):"",l||r||o?d(Et||(Et=qt` <div> ${0} </div> `),w(l&&this.__renderMinMaxSummary(e,s),r&&this.__renderAllowedSummary(i),o&&this.__renderDisallowedSummary(n))):"",this.disabled||!this._isI18nReady,Ie((()=>this.dispatchEvent(new wt))),this.ns,this.lang,this.ns,this.lang,a,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,s)?d(Ct||(Ct=qt` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=n?n:[],this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new bt(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=N(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return d(St||(St=qt` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return d(Rt||(Rt=qt` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return d(It||(It=qt`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return d(jt||(jt=qt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} — ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?N(e):void 0),this.__renderMinMaxContent(t?N(t):void 0))}__renderAllowedSummary({type:e,days:t}){return d(Vt||(Vt=qt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>k(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return d(Mt||(Mt=qt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>it(e,this.lang))).join("; "))}}class Tt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Dt,At,Ut,Ot=e=>e;class Ft extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":Nt,"vaadin-button":customElements.get("vaadin-button"),"x-section":ge,"iron-icon":customElements.get("iron-icon"),"x-switch":xe,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return d(Dt||(Dt=Ot` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?d(At||(At=Ot` ${0} `),this.__normalizedValue.map(((e,t,s)=>d(Ut||(Ut=Ot` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,C({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Tt(this.value))}}class Lt extends X{}let Bt,zt,Pt,Qt=e=>e;class Kt extends u{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":x,"iron-icon":customElements.get("iron-icon"),"x-group":q,"x-list":se,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return d(Bt||(Bt=Qt` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?d(zt||(zt=Qt` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):d(Pt||(Pt=Qt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,C({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new Lt(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}class Jt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Gt,Ht=e=>e;class Wt extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":ge,"x-switch":xe,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return d(Gt||(Gt=Ht` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sso.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="sso.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang)}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Jt(this.value))}}const Yt=E.assign({error:(e,t)=>t.data.type}),Xt=E.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),Zt=E.assign({oldResource:e=>e.newResource}),es=E.assign({invalid:[],newResource:({oldResource:e})=>e}),ts=E.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:Y(72,(()=>G(35).toString(36))).join(""),sessionLifespanInMinutes:40320,signUp:{enabled:!1,verification:{type:"hcaptcha",siteKey:"",secretKey:""}},sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),ss=E.assign({newResource:null}),is=E.assign({error:"setup_needed"}),as=E.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{allowedOrigins:i})}}),ns=E.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{subscriptions:t(t({},e.subscriptions),{},{allowFrequencyModification:i})})}}),ls=E.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{subscriptions:t(t({},e.subscriptions),{},{allowNextDateModification:i})})}}),rs=E.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{signUp:i})}}),ds=E.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{sessionLifespanInMinutes:i})}}),os=E.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{jwtSharedSecret:i})}}),hs=E.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),cs=E.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{sso:i})}}),us={SET_SSO:{target:"#cps.idle",actions:"setSSO"},SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_SIGN_UP:{target:"#cps.idle",actions:"setSignUp"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},_s={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},gs=s({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:us},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:t({on:us},_s),updated:t({on:us},_s),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>i(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:ns,setNextDateModification:ls,setOrigins:as,setSession:ds,setSecret:os,setSignUp:rs,setHref:hs,setSSO:cs,handleLoadingSuccess:Xt,handleSavingSuccess:Zt,handleError:Yt,create:ts,reset:es,remove:ss,requireSetup:is}});class ps extends CustomEvent{constructor(e){super("change",{detail:e})}}let ms,vs,xs=e=>e;class ys extends u{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=void 0}static get scopedElements(){return{"vaadin-password-field":I,"x-section":ge,"x-switch":xe,"x-i18n":p}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s;return d(ms||(ms=xs` <x-section> <x-switch data-testid="toggle" class="-my-xs" slot="title" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sign_up.title" class="text-l"></x-i18n> </x-switch> <x-i18n class="mr-xl" slot="subtitle" key="sign_up.subtitle" .lang="${0}" .ns="${0}"> </x-i18n> ${0} </x-section> `),this.disabled||!this._isI18nReady,this.__normalizedValue.enabled,(()=>{const e=this.__normalizedValue;e.enabled=!e.enabled,e.enabled||(e.verification.siteKey="",e.verification.secretKey=""),this.value=e,this.requestUpdate(),this.__sendChange()}),this.ns,this.lang,this.lang,this.ns,(null===(e=this.__normalizedValue)||void 0===e?void 0:e.enabled)?d(vs||(vs=xs` <div class="grid gap-m sm-grid-cols-2"> <vaadin-password-field .placeholder="${0}" .disabled="${0}" .value="${0}" .label="${0}" autocomplete="off" data-testid="site-key" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-password-field .placeholder="${0}" .disabled="${0}" .value="${0}" .label="${0}" autocomplete="off" data-testid="secret-key" @change="${0}" @input="${0}"> </vaadin-password-field> <x-i18n class="sm-col-span-2 text-s text-secondary" lang="${0}" key="sign_up.hcaptcha_explainer" ns="${0}"> </x-i18n> </div> `),this._isI18nReady?this._t("sign_up.site_key_placeholder").toString():"---",this.disabled||!this._isI18nReady,this._isI18nReady?null===(t=this.value)||void 0===t?void 0:t.verification.siteKey:"",this._isI18nReady?this._t("sign_up.site_key_label").toString():"---",(e=>e.stopPropagation()),(e=>{const t=this.__normalizedValue;t.verification.siteKey=e.target.value,this.value=t,this.requestUpdate(),this.__sendChange()}),this._isI18nReady?this._t("sign_up.secret_key_placeholder").toString():"---",this.disabled||!this._isI18nReady,this._isI18nReady?null===(s=this.value)||void 0===s?void 0:s.verification.secretKey:"",this._isI18nReady?this._t("sign_up.secret_key_label").toString():"---",(e=>e.stopPropagation()),(e=>{const t=this.__normalizedValue;t.verification.secretKey=e.target.value,this.value=t,this.requestUpdate(),this.__sendChange()}),this.lang,this.ns):"")}get __normalizedValue(){return this.value?M(this.value):{verification:{type:"hcaptcha",siteKey:"",secretKey:""},enabled:!1}}__sendChange(){this.dispatchEvent(new ps(this.value))}}let $s,fs,bs,ws,ks=e=>e;function Es(e){if(!e.ok)throw new l(401===e.status?"unauthorized":"unknown")}class Cs extends CustomEvent{constructor(){super("ready")}}class Ss extends CustomEvent{constructor(){super("update")}}class Rs extends u{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=gs.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=O(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":st,"x-next-date-modification":Ft,"x-session-duration":ke,"x-session-secret":Re,"x-loading-screen":le,"x-error-screen":n,"x-origins-list":Kt,"x-sso-switch":Wt,"x-skeleton":x,"x-section":ge,"x-sign-up":ys,"x-switch":xe,"x-i18n":p,"x-page":he}}static get properties(){return t(t({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,s,i,a,n,l;if(this.__service.state.matches("error"))return d($s||($s=ks` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:r}=this.__service.state.context,o=this.__service.state.matches("idle.dirty.created"),h=this.__service.state.matches("idle.dirty.deleted"),c=this.__service.state.matches("idle.dirty.updated"),u=this.__service.state.matches("idle.clean.enabled"),_=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return d(fs||(fs=ks` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-sso-switch data-testid="sso" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-sso-switch> <x-sign-up data-testid="signup" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-sign-up> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,u||o||c,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==r?void 0:r.allowedOrigins)&&void 0!==e?e:[],!r,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(s=null==r?void 0:r.subscriptions.allowFrequencyModification)&&void 0!==s?s:[],!r,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==r?void 0:r.subscriptions.allowNextDateModification)&&void 0!==i&&i,!r,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(a=null==r?void 0:r.sso)&&void 0!==a&&a,!r,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),!r,null==r?void 0:r.signUp,this.lang,this.ns,(e=>{this.__service.send({type:"SET_SIGN_UP",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!r||!this._isI18nReady,null!==(n=null==r?void 0:r.sessionLifespanInMinutes)&&void 0!==n?n:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(t({type:"SET_SESSION"},e))}),!r||!this._isI18nReady,null!==(l=null==r?void 0:r.jwtSharedSecret)&&void 0!==l?l:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(t({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?d(bs||(bs=ks` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),h?"error":"success",_,(()=>this.__service.send("SAVE")),this.lang,this.ns,o?"create":h?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?d(ws||(ws=ks`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new l("setup_needed");try{await this.updateComplete;const e=await $e.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await $e.emit({source:this,init:["/"]});Es(e);const i=(await e.json())._links["fx:store"].href,a=await $e.emit({source:this,init:[i]});Es(a),s=await a.json()}else{Es(e),t=await e.json();const i=t._links["fx:store"].href,a=await $e.emit({source:this,init:[i]});Es(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof l)throw e;if(e instanceof ye)throw new l("setup_needed");throw new l("unknown")}finally{await this.updateComplete,this.dispatchEvent(new Cs)}}async __save(){try{const e=this.__service.state.context,t=M(e.newResource),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};Es(await $e.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof l)throw e;if(e instanceof ye)throw new l("setup_needed");throw new l("unknown")}finally{await this.updateComplete,this.dispatchEvent(new Ss)}}}customElements.define("foxy-customer-portal-settings",Rs);export{Rs as CustomerPortalSettings};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./foxy-customer.js";import"./shared-
|
|
1
|
+
import"./foxy-customer.js";import"./shared-1cd02e50.js";import"./shared-e2d3c014.js";import"./shared-dc4d2996.js";import"./shared-9b9d5ff1.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-ffd5932d.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import{u as s}from"./shared-cae7a43b.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import"./shared-2f5cc0e2.js";import{_ as r,B as o,aH as i}from"./shared-cb58dfcd.js";import{h as a,L as n,c as d}from"./shared-ba5c42c7.js";import{A as l}from"./shared-99a8889a.js";import"./shared-673d668a.js";import{C as c}from"./shared-d0363ae9.js";import{a as m,T as u}from"./shared-aa6dab90.js";import{U as p}from"./shared-cd96ff03.js";import{i as h}from"./shared-53e42a77.js";import{c as f}from"./shared-4e709717.js";import{A as g}from"./shared-5592ec6e.js";import{C as y}from"./shared-5afb584d.js";import{I as $}from"./shared-2aa23b5f.js";import"./shared-567ba8ae.js";import"./foxy-update-payment-method-form.js";import"./shared-4c764a91.js";import"./shared-656a46f7.js";import"./shared-9c010e0a.js";import"./shared-e6a1eef8.js";import"./shared-ad60e8d1.js";import"./shared-0d0585dc.js";import"./shared-d7d949bc.js";import"./shared-8a0bd046.js";import"./shared-9342ca50.js";import"./shared-7fd51889.js";import"./shared-a4216b50.js";import"./shared-c502de27.js";import"./shared-5f8c01f8.js";import"./shared-f7bfb29e.js";import"./shared-cc4b3b42.js";import"./shared-f83207fb.js";import"./shared-343d1fd7.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-94716ec1.js";import"./shared-678beccf.js";import"./shared-6033e09d.js";import"./shared-2f8e53c0.js";import"./shared-c31c50e2.js";import"./foxy-copy-to-clipboard.js";import"./shared-9171c265.js";import"./shared-8ea2bbcc.js";import"./foxy-nucleon-element.js";import"./shared-53e476fd.js";import"./shared-bab2ea2c.js";import"./foxy-template-set-card.js";import"./shared-b1435a0a.js";import"./shared-bb6d7b97.js";import"./foxy-payment-card-embed.js";import"./shared-fed829c2.js";import"./shared-5fd5805c.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-274dec57.js";import"./shared-70e6f32c.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./shared-a6c75cc0.js";import"./shared-66201dc5.js";import"./shared-d0aed1c1.js";import"./foxy-table.js";import"./shared-c832f3a1.js";import"./shared-74d599dc.js";import"./shared-2cb397e4.js";import"./shared-e88763ec.js";import"./shared-8f009bbb.js";import"./shared-4dd24dda.js";import"./shared-6962f117.js";import"./shared-4b393539.js";import"./shared-6b3fed56.js";import"./shared-97e2abfb.js";import"./shared-ada5e9f5.js";import"./shared-cf613436.js";import"./shared-0224f0b8.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-894c69f8.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-eb963ba3.js";import"./shared-a6b2bd14.js";import"./shared-bedc5e82.js";import"./shared-b738ee96.js";import"./shared-a507d54f.js";
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-dc4d2996.js";import"./shared-e2d3c014.js";import{h as t}from"./shared-567ba8ae.js";import"./shared-1cd02e50.js";import"./shared-5212ef4f.js";import"./foxy-payment-method-card.js";import"./foxy-update-payment-method-form.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-cae7a43b.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-2f5cc0e2.js";import{aH as e,_ as s}from"./shared-cb58dfcd.js";import{L as r,h as a,c as o}from"./shared-ba5c42c7.js";import{C as i}from"./shared-5afb584d.js";import"./shared-9c010e0a.js";import"./shared-8ea2bbcc.js";import{z as h,S as d,T as n,a as l}from"./shared-aa6dab90.js";import{c as m}from"./shared-4e709717.js";import{S as c}from"./shared-74d599dc.js";import"./shared-c31c50e2.js";import{G as v}from"./shared-4b393539.js";import"./shared-a4216b50.js";import"./shared-8a0bd046.js";import"./shared-5f8c01f8.js";import"./shared-fed829c2.js";import"./shared-9342ca50.js";import{N as p}from"./shared-f83207fb.js";import{S as f}from"./shared-6b3fed56.js";import{i as g}from"./shared-53e42a77.js";import"./shared-e6a1eef8.js";import"./shared-ad60e8d1.js";import"./shared-2f8e53c0.js";import"./shared-cf613436.js";import"./foxy-nucleon-element.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-2aa23b5f.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4c764a91.js";import"./shared-656a46f7.js";import"./shared-0d0585dc.js";import"./shared-d7d949bc.js";import"./shared-7fd51889.js";import"./shared-c502de27.js";import"./shared-f7bfb29e.js";import"./shared-cc4b3b42.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-94716ec1.js";import"./shared-678beccf.js";import"./shared-6033e09d.js";import"./shared-ffd5932d.js";import"./foxy-copy-to-clipboard.js";import"./shared-9171c265.js";import"./shared-bab2ea2c.js";import"./shared-53e476fd.js";import"./foxy-template-set-card.js";import"./shared-b1435a0a.js";import"./shared-bb6d7b97.js";import"./foxy-payment-card-embed.js";import"./shared-99a8889a.js";import"./shared-673d668a.js";import"./shared-5fd5805c.js";import"./shared-0224f0b8.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-894c69f8.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-97e2abfb.js";import"./shared-eb963ba3.js";import"./shared-ada5e9f5.js";import"./shared-c832f3a1.js";import"./shared-274dec57.js";import"./shared-70e6f32c.js";import"./shared-a6b2bd14.js";import"./shared-9b9d5ff1.js";import"./shared-bedc5e82.js";import"./shared-66201dc5.js";import"./shared-d0aed1c1.js";import"./shared-b738ee96.js";import"./shared-a6c75cc0.js";import"./shared-2cb397e4.js";import"./shared-e88763ec.js";import"./shared-8f009bbb.js";import"./shared-4dd24dda.js";import"./shared-6962f117.js";let z,u,b,$=t=>t;class H extends r{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return h.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(a(z||(z=$` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,m({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(a(u||(u=$` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,m({hidden:this.value!==s}),this.value!==s,s));return a(b||(b=$` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|