@foxy.io/elements 1.24.0-beta.3 → 1.24.0-beta.5
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-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-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +2 -2
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-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 +2 -2
- 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-nucleon-element.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-payments-api.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +4 -4
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-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 +2 -2
- 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-user-card.js +1 -1
- package/dist/cdn/foxy-user-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-9caffb4d.js → shared-017ab35f.js} +1 -1
- package/dist/cdn/{shared-e6828dbf.js → shared-0689b25a.js} +5 -5
- package/dist/cdn/shared-0dabe195.js +15 -0
- package/dist/cdn/{shared-1b060170.js → shared-125d1a00.js} +1 -1
- package/dist/cdn/shared-13cc4ed4.js +9 -0
- package/dist/cdn/{shared-ff992ead.js → shared-15fe0f50.js} +1 -1
- package/dist/cdn/{shared-379b37e6.js → shared-19c9fe00.js} +7 -11
- package/dist/cdn/shared-1b2e0709.js +1 -0
- package/dist/cdn/shared-1e43b4db.js +1 -0
- package/dist/cdn/{shared-c7f2f1ab.js → shared-1fd59009.js} +1 -1
- package/dist/cdn/{shared-31651a9c.js → shared-2fa6a5a0.js} +1 -1
- package/dist/cdn/{shared-65318cc1.js → shared-3164d0c3.js} +1 -1
- package/dist/cdn/{shared-e10052d0.js → shared-31a891e8.js} +3 -3
- package/dist/cdn/{shared-b3ac59eb.js → shared-403af08d.js} +2 -2
- package/dist/cdn/{shared-a92ae606.js → shared-421e46e9.js} +1 -1
- package/dist/cdn/{shared-dccf0420.js → shared-42adf053.js} +1 -1
- package/dist/cdn/{shared-77a4d8e8.js → shared-46f3f71c.js} +1 -1
- package/dist/cdn/{shared-e84fa0ea.js → shared-4966b3e4.js} +1 -1
- package/dist/cdn/{shared-b48a83b0.js → shared-4a0298cb.js} +1 -1
- package/dist/cdn/{shared-17d0db7f.js → shared-4bd1efd7.js} +3 -3
- package/dist/cdn/{shared-51d28e6d.js → shared-527abf31.js} +1 -1
- package/dist/cdn/{shared-fe54babe.js → shared-53532131.js} +1 -1
- package/dist/cdn/{shared-9c626d58.js → shared-5616a12f.js} +1 -1
- package/dist/cdn/{shared-c97e0d6e.js → shared-57922341.js} +1 -1
- package/dist/cdn/shared-619bcf83.js +1 -0
- package/dist/cdn/{shared-ba658670.js → shared-6273b7e1.js} +1 -1
- package/dist/cdn/{shared-4904bca4.js → shared-639dda4b.js} +1 -1
- package/dist/cdn/{shared-d14c2060.js → shared-6b0498b2.js} +3 -3
- package/dist/cdn/{shared-6f84ac3e.js → shared-6b3be508.js} +1 -1
- package/dist/cdn/{shared-c6c6ba69.js → shared-6dffe67d.js} +1 -1
- package/dist/cdn/{shared-4c956a8e.js → shared-72a13fda.js} +1 -1
- package/dist/cdn/{shared-4b67d699.js → shared-763a6797.js} +1 -1
- package/dist/cdn/shared-7680d300.js +122 -0
- package/dist/cdn/shared-79d01877.js +1 -0
- package/dist/cdn/{shared-6abdfcf2.js → shared-7bf6e728.js} +1 -1
- package/dist/cdn/{shared-69a21b9d.js → shared-7d4e0011.js} +1 -1
- package/dist/cdn/shared-7e887e5b.js +1 -0
- package/dist/cdn/{shared-8474bc4a.js → shared-7ead930c.js} +1 -1
- package/dist/cdn/shared-7f33a83a.js +12 -12
- package/dist/cdn/{shared-6dc64a17.js → shared-8128b5e3.js} +1 -1
- package/dist/cdn/{shared-984fcdf5.js → shared-8134d8a7.js} +3 -3
- package/dist/cdn/{shared-c4240bc6.js → shared-8465a37a.js} +1 -1
- package/dist/cdn/{shared-e7c3b7b6.js → shared-848813a4.js} +1 -1
- package/dist/cdn/shared-8528906b.js +1 -0
- package/dist/cdn/{shared-a3c73e91.js → shared-897ab5e6.js} +1 -1
- package/dist/cdn/{shared-4bbd600d.js → shared-8fbab85c.js} +1 -1
- package/dist/cdn/{shared-4dc58b73.js → shared-90be9ac7.js} +1 -1
- package/dist/cdn/{shared-0a248c0d.js → shared-91eb066c.js} +1 -1
- package/dist/cdn/{shared-1d28220a.js → shared-9765be8f.js} +1 -1
- package/dist/cdn/{shared-e6997950.js → shared-9bdd5400.js} +1 -1
- package/dist/cdn/{shared-dfe2602a.js → shared-a134d313.js} +1 -1
- package/dist/cdn/shared-a6517170.js +1 -0
- package/dist/cdn/shared-a7475f62.js +212 -0
- package/dist/cdn/shared-a88c5cf1.js +29 -0
- package/dist/cdn/{shared-479ad951.js → shared-a96a2154.js} +1 -1
- package/dist/cdn/shared-aa22ee61.js +1 -0
- package/dist/cdn/shared-aa569a99.js +804 -0
- package/dist/cdn/{shared-e8e92fe3.js → shared-ad0256d0.js} +2 -2
- package/dist/cdn/{shared-25f64060.js → shared-b334c8b6.js} +1 -1
- package/dist/cdn/{shared-1d08a5ad.js → shared-bbbb8894.js} +1 -1
- package/dist/cdn/{shared-bafcab47.js → shared-bf2113a4.js} +3 -3
- package/dist/cdn/{shared-88e36564.js → shared-c541c9e9.js} +26 -27
- package/dist/cdn/{shared-36725fe3.js → shared-c758220c.js} +1 -1
- package/dist/cdn/{shared-4674063d.js → shared-c97f7178.js} +27 -27
- package/dist/cdn/shared-d2222c8d.js +1 -0
- package/dist/cdn/{shared-64f98a0f.js → shared-db06114b.js} +7 -2
- package/dist/cdn/{shared-665d6cc4.js → shared-e5786b8b.js} +1 -1
- package/dist/cdn/shared-e640e9fa.js +1 -0
- package/dist/cdn/{shared-7995407d.js → shared-eb232194.js} +3 -3
- package/dist/cdn/{shared-bdb51db9.js → shared-f4822b9e.js} +1 -1
- package/dist/cdn/{shared-db21f6db.js → shared-fa5f0117.js} +2 -2
- package/dist/cdn/shared-fc77174e.js +1 -0
- package/dist/cdn/shared-fec6fd04.js +1 -0
- package/dist/cdn/translations/address-form/en.json +577 -0
- package/dist/cdn/translations/customer/en.json +577 -0
- package/dist/cdn/translations/customer-portal/en.json +579 -1
- package/dist/cdn/translations/error-entry-card/en.json +4 -0
- package/dist/cdn/translations/webhook-form/en.json +1 -1
- package/dist/elements/internal/InternalRadioGroupControl/InternalRadioGroupControl.js +2 -1
- package/dist/elements/internal/InternalRadioGroupControl/InternalRadioGroupControl.js.map +1 -1
- package/dist/elements/public/AddressForm/AddressForm.d.ts +2 -1
- package/dist/elements/public/AddressForm/AddressForm.js +53 -17
- package/dist/elements/public/AddressForm/AddressForm.js.map +1 -1
- package/dist/elements/public/AddressForm/countries.d.ts +1 -1
- package/dist/elements/public/AddressForm/countries.js +554 -251
- package/dist/elements/public/AddressForm/countries.js.map +1 -1
- package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.d.ts +0 -1
- package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.js +34 -30
- package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.js.map +1 -1
- package/dist/elements/public/ErrorEntryCard/ResourceViewer.js +9 -0
- package/dist/elements/public/ErrorEntryCard/ResourceViewer.js.map +1 -1
- package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js +3 -0
- package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js.map +1 -1
- package/dist/elements/public/WebhookForm/WebhookForm.d.ts +2 -0
- package/dist/elements/public/WebhookForm/WebhookForm.js +7 -0
- package/dist/elements/public/WebhookForm/WebhookForm.js.map +1 -1
- package/package.json +10 -10
- package/dist/cdn/shared-09d4fbb8.js +0 -29
- package/dist/cdn/shared-1eac92fa.js +0 -1
- package/dist/cdn/shared-307262a1.js +0 -15
- package/dist/cdn/shared-332f2997.js +0 -1
- package/dist/cdn/shared-39f3b48d.js +0 -1
- package/dist/cdn/shared-432c5183.js +0 -9
- package/dist/cdn/shared-4dee79d4.js +0 -1
- package/dist/cdn/shared-53061389.js +0 -1
- package/dist/cdn/shared-59042137.js +0 -201
- package/dist/cdn/shared-65ba8b39.js +0 -1
- package/dist/cdn/shared-7f5618ba.js +0 -1
- package/dist/cdn/shared-92f27a38.js +0 -1
- package/dist/cdn/shared-b0f534ef.js +0 -1
- package/dist/cdn/shared-be24dd36.js +0 -804
- package/dist/cdn/shared-bf62a65b.js +0 -1
- package/dist/cdn/shared-c2d3b32b.js +0 -1
- package/dist/cdn/shared-cf269a17.js +0 -1
- package/dist/cdn/shared-fef9ecc1.js +0 -122
- package/dist/elements/public/AddressForm/regions.d.ts +0 -1
- package/dist/elements/public/AddressForm/regions.js +0 -67
- package/dist/elements/public/AddressForm/regions.js.map +0 -1
- /package/dist/cdn/{shared-64657919.js → shared-343d1fd7.js} +0 -0
- /package/dist/cdn/{shared-d6276c83.js → shared-3ab0306f.js} +0 -0
- /package/dist/cdn/{shared-e6f3e9f0.js → shared-bb05cfed.js} +0 -0
- /package/dist/cdn/{shared-99065f2a.js → shared-d7be11de.js} +0 -0
- /package/dist/cdn/{shared-0479553e.js → shared-f9180815.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as t,c as e,h as s}from"./shared-7f33a83a.js";import{w as a}from"./shared-
|
|
1
|
+
import{L as t,c as e,h as s}from"./shared-7f33a83a.js";import{w as a}from"./shared-a88c5cf1.js";let d,i,r,l=t=>t;class o extends t{constructor(){super(...arguments),this.items=[],this.disabled=!1}static get properties(){return{disabled:{type:Boolean,reflect:!0},items:{attribute:!1}}}static get styles(){return[a.styles,e(d||(d=l`.max-w-0{max-width:0}`))]}render(){const t=this.disabled?"text-disabled":"text-body",e=this.disabled?"text-disabled":"text-secondary",a="max-w-0 truncate py-s";return s(i||(i=l` <table class="font-lumo text-m leading-m w-full"> <tbody class="divide-y divide-contrast-10"> ${0} </tbody> </table> `),this.items.map((({name:d,value:i})=>s(r||(r=l` <tr> <td class="${0} ${0} w-1-3 pr-m" title="${0}">${0}</td> <td class="${0} ${0} w-2-3" title="${0}">${0}</td> </tr> `),a,e,d,d,a,t,i,i))))}}export{o as P};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,aj as t,ak as s}from"./shared-0dabe195.js";var n=function(e,t,s,n){return new(s||(s=Promise))((function(i,o){function r(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(r,a)}c((n=n.apply(e,t||[])).next())}))};class i extends e{constructor(e){super(Object.assign(Object.assign({},e),{fetch:(...e)=>this.__fetch(...e)}))}signIn(t){return n(this,void 0,void 0,(function*(){i.v8n.credentials.check(t);const s=yield this.fetch(new URL("./authenticate",this.base).toString(),{body:JSON.stringify(t),method:"POST"});if(!s.ok){const t=401===s.status?"UNAUTHORIZED":"UNKNOWN";throw new e.AuthError({code:t})}{const e=yield s.json(),t=Object.assign(Object.assign({},e),{date_created:(new Date).toISOString()});this.storage.setItem(i.SESSION,JSON.stringify(t))}}))}sendPasswordResetEmail(t){return n(this,void 0,void 0,(function*(){i.v8n.email.check(t.email);if(!(yield this.fetch(new URL("./forgot_password",this.base).toString(),{body:JSON.stringify(t),method:"POST"})).ok)throw new e.AuthError({code:"UNKNOWN"})}))}signOut(){return n(this,void 0,void 0,(function*(){if(!(yield this.fetch(new URL("./authenticate",this.base).toString(),{method:"DELETE"})).ok)throw new e.AuthError({code:"UNKNOWN"});this.storage.clear(),this.cache.clear()}))}__fetch(e,t){var o;return n(this,void 0,void 0,(function*(){let n=JSON.parse(null!==(o=this.storage.getItem(i.SESSION))&&void 0!==o?o:"null");const r=new s.Request(e,t);if(null!==n){new Date(n.date_created).getTime()+1e3*n.expires_in<Date.now()?(this.console.info("Session has expired, signing out."),this.storage.clear(),this.cache.clear(),n=null):r.headers.set("Authorization",`Bearer ${n.session_token}`)}r.headers.set("Content-Type","application/json"),r.headers.set("FOXY-API-VERSION","1"),this.console.trace(`${r.method} ${r.url}`);const a=yield s.fetch(r);if(n&&a.ok){const e=Object.assign(Object.assign({},n),{date_created:(new Date).toISOString()});this.storage.setItem(i.SESSION,JSON.stringify(e))}return a}))}}i.SESSION="session",i.v8n=Object.assign({},e.v8n,{credentials:t().schema({email:t().string(),newPassword:t().optional(t().string()),password:t().string()}),email:t().string()});let o=/(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([a-zµμ]*)/gi;function r(e="",t="ms"){var s=null;return(e=e.replace(/(\d),(\d)/g,"$1$2")).replace(o,(function(e,t,n){(n=r[n]||r[n.toLowerCase().replace(/s$/,"")])&&(s=(s||0)+parseFloat(t,10)*n)})),s&&s/r[t]}r.nanosecond=r.ns=1e-6,r["µs"]=r["μs"]=r.us=r.microsecond=.001,r.millisecond=r.ms=1,r.second=r.sec=r.s=1e3*r.ms,r.minute=r.min=r.m=60*r.s,r.hour=r.hr=r.h=60*r.m,r.day=r.d=24*r.h,r.week=r.wk=r.w=7*r.d,r.month=r.b=30.4375*r.d,r.year=r.yr=r.y=365.25*r.d;export{i as A,r as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-7680d300.js";import"./shared-0689b25a.js";import{I as e}from"./shared-a134d313.js";import{_ as i}from"./shared-0dabe195.js";import{i as r}from"./shared-d3bf9ac0.js";import{h as s}from"./shared-7f33a83a.js";let t,l,a,n=e=>e;customElements.define("foxy-internal-number-control",class extends e{constructor(){super(...arguments),this.prefix=null,this.suffix=null,this.min=null,this.max=null}static get properties(){return i(i({},super.properties),{},{prefix:{},suffix:{},min:{type:Number},max:{type:Number}})}renderControl(){var e,i;return s(t||(t=n` <vaadin-number-field error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" min="${0}" max="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" clear-button-visible @keydown="${0}" @change="${0}"> ${0} ${0} </vaadin-number-field> `),r(this._errorMessage),this.placeholder,this.helperText,this.label,r(null!==(e=this.min)&&void 0!==e?e:void 0),r(null!==(i=this.max)&&void 0!==i?i:void 0),this.disabled,this.readonly,this._checkValidity,String(this._value),(e=>{var i;return"Enter"===e.key&&(null===(i=this.nucleon)||void 0===i?void 0:i.submit())}),(e=>{const i=e.currentTarget;this._value=parseFloat(i.value)}),this.prefix?s(l||(l=n`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?s(a||(a=n`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:0}set _value(e){super._value=e}});
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* subject to an additional IP rights grant found at
|
|
12
12
|
* http://polymer.github.io/PATENTS.txt
|
|
13
13
|
*/
|
|
14
|
-
const t="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,e=(t,e,s=null,i=null)=>{for(;e!==s;){const s=e.nextSibling;t.insertBefore(e,i),e=s}},s=(t,e,s=null)=>{for(;e!==s;){const s=e.nextSibling;t.removeChild(e),e=s}},i=`{{lit-${String(Math.random()).slice(2)}}}`,n=`\x3c!--${i}--\x3e`,r=new RegExp(`${i}|${n}`);class
|
|
14
|
+
const t="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,e=(t,e,s=null,i=null)=>{for(;e!==s;){const s=e.nextSibling;t.insertBefore(e,i),e=s}},s=(t,e,s=null)=>{for(;e!==s;){const s=e.nextSibling;t.removeChild(e),e=s}},i=`{{lit-${String(Math.random()).slice(2)}}}`,n=`\x3c!--${i}--\x3e`,r=new RegExp(`${i}|${n}`),o="$lit$";class a{constructor(t,e){this.parts=[],this.element=e;const s=[],n=[],a=document.createTreeWalker(e.content,133,null,!1);let h=0,p=-1,u=0;const{strings:m,values:{length:_}}=t;for(;u<_;){const t=a.nextNode();if(null!==t){if(p++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:s}=e;let i=0;for(let t=0;t<s;t++)l(e[t].name,o)&&i++;for(;i-- >0;){const e=m[u],s=c.exec(e)[2],i=s.toLowerCase()+o,n=t.getAttribute(i);t.removeAttribute(i);const a=n.split(r);this.parts.push({type:"attribute",index:p,name:s,strings:a}),u+=a.length-1}}"TEMPLATE"===t.tagName&&(n.push(t),a.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(i)>=0){const i=t.parentNode,n=e.split(r),a=n.length-1;for(let e=0;e<a;e++){let s,r=n[e];if(""===r)s=d();else{const t=c.exec(r);null!==t&&l(t[2],o)&&(r=r.slice(0,t.index)+t[1]+t[2].slice(0,-5)+t[3]),s=document.createTextNode(r)}i.insertBefore(s,t),this.parts.push({type:"node",index:++p})}""===n[a]?(i.insertBefore(d(),t),s.push(t)):t.data=n[a],u+=a}}else if(8===t.nodeType)if(t.data===i){const e=t.parentNode;null!==t.previousSibling&&p!==h||(p++,e.insertBefore(d(),t)),h=p,this.parts.push({type:"node",index:p}),null===t.nextSibling?t.data="":(s.push(t),p--),u++}else{let e=-1;for(;-1!==(e=t.data.indexOf(i,e+1));)this.parts.push({type:"node",index:-1}),u++}}else a.currentNode=n.pop()}for(const t of s)t.parentNode.removeChild(t)}}const l=(t,e)=>{const s=t.length-e.length;return s>=0&&t.slice(s)===e},h=t=>-1!==t.index,d=()=>document.createComment(""),c=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function p(t,e){const{element:{content:s},parts:i}=t,n=document.createTreeWalker(s,133,null,!1);let r=m(i),o=i[r],a=-1,l=0;const h=[];let d=null;for(;n.nextNode();){a++;const t=n.currentNode;for(t.previousSibling===d&&(d=null),e.has(t)&&(h.push(t),null===d&&(d=t)),null!==d&&l++;void 0!==o&&o.index===a;)o.index=null!==d?-1:o.index-l,r=m(i,r),o=i[r]}h.forEach((t=>t.parentNode.removeChild(t)))}const u=t=>{let e=11===t.nodeType?0:1;const s=document.createTreeWalker(t,133,null,!1);for(;s.nextNode();)e++;return e},m=(t,e=-1)=>{for(let s=e+1;s<t.length;s++){const e=t[s];if(h(e))return s}return-1};
|
|
15
15
|
/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -25,7 +25,7 @@ const t="undefined"!=typeof window&&null!=window.customElements&&void 0!==window
|
|
|
25
25
|
* subject to an additional IP rights grant found at
|
|
26
26
|
* http://polymer.github.io/PATENTS.txt
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
28
|
+
const _=new WeakMap,f=t=>(...e)=>{const s=t(...e);return _.set(s,!0),s},y=t=>"function"==typeof t&&_.has(t),g={},S={};
|
|
29
29
|
/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -39,7 +39,7 @@ const m=new WeakMap,_=t=>(...e)=>{const s=t(...e);return m.set(s,!0),s},f=t=>"fu
|
|
|
39
39
|
* subject to an additional IP rights grant found at
|
|
40
40
|
* http://polymer.github.io/PATENTS.txt
|
|
41
41
|
*/
|
|
42
|
-
class
|
|
42
|
+
class v{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this.options=s}update(t){let e=0;for(const s of this.__parts)void 0!==s&&s.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const e=t?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),s=[],i=this.template.parts,n=document.createTreeWalker(e,133,null,!1);let r,o=0,a=0,l=n.nextNode();for(;o<i.length;)if(r=i[o],h(r)){for(;a<r.index;)a++,"TEMPLATE"===l.nodeName&&(s.push(l),n.currentNode=l.content),null===(l=n.nextNode())&&(n.currentNode=s.pop(),l=n.nextNode());if("node"===r.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(l.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,r.name,r.strings,this.options));o++}else this.__parts.push(void 0),o++;return t&&(document.adoptNode(e),customElements.upgrade(e)),e}}
|
|
43
43
|
/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -52,7 +52,7 @@ class S{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this
|
|
|
52
52
|
* Code distributed by Google as part of the polymer project is also
|
|
53
53
|
* subject to an additional IP rights grant found at
|
|
54
54
|
* http://polymer.github.io/PATENTS.txt
|
|
55
|
-
*/const
|
|
55
|
+
*/const w=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),b=` ${i} `;class x{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="",s=!1;for(let r=0;r<t;r++){const t=this.strings[r],a=t.lastIndexOf("\x3c!--");s=(a>-1||s)&&-1===t.indexOf("--\x3e",a+1);const l=c.exec(t);e+=null===l?t+(s?b:n):t.substr(0,l.index)+l[1]+l[2]+o+l[3]+i}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==w&&(e=w.createHTML(e)),t.innerHTML=e,t}}class P extends x{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const t=super.getTemplateElement(),s=t.content,i=s.firstChild;return s.removeChild(i),e(s,i.firstChild),t}}
|
|
56
56
|
/**
|
|
57
57
|
* @license
|
|
58
58
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -65,7 +65,7 @@ class S{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this
|
|
|
65
65
|
* Code distributed by Google as part of the polymer project is also
|
|
66
66
|
* subject to an additional IP rights grant found at
|
|
67
67
|
* http://polymer.github.io/PATENTS.txt
|
|
68
|
-
*/const
|
|
68
|
+
*/const C=t=>null===t||!("object"==typeof t||"function"==typeof t),N=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class T{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;t<s.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new A(this)}_getValue(){const t=this.strings,e=t.length-1,s=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=s[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!N(t))return t}let i="";for(let n=0;n<e;n++){i+=t[n];const e=s[n];if(void 0!==e){const t=e.value;if(C(t)||!N(t))i+="string"==typeof t?t:String(t);else for(const e of t)i+="string"==typeof e?e:String(e)}}return i+=t[e],i}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class A{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===g||C(t)&&t===this.value||(this.value=t,y(t)||(this.committer.dirty=!0))}commit(){for(;y(this.value);){const t=this.value;this.value=g,t(this)}this.value!==g&&this.committer.commit()}}class E{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(d()),this.endNode=t.appendChild(d())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=d()),t.__insert(this.endNode=d())}insertAfterPart(t){t.__insert(this.startNode=d()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;y(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=g,t(this)}const t=this.__pendingValue;t!==g&&(C(t)?t!==this.value&&this.__commitText(t):t instanceof x?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):N(t)?this.__commitIterable(t):t===S?(this.value=S,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,s="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=s:this.__commitNode(document.createTextNode(s)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof v&&this.value.template===e)this.value.update(t.values);else{const s=new v(e,t.processor,this.options),i=s._clone();s.update(t.values),this.__commitNode(i),this.value=s}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let s,i=0;for(const n of t)s=e[i],void 0===s&&(s=new E(this.options),e.push(s),0===i?s.appendIntoPart(this):s.insertAfterPart(e[i-1])),s.setValue(n),s.commit(),i++;i<e.length&&(e.length=i,this.clear(s&&s.endNode))}clear(t=this.startNode){s(this.startNode.parentNode,t.nextSibling,this.endNode)}}class V{constructor(t,e,s){if(this.value=void 0,this.__pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=s}setValue(t){this.__pendingValue=t}commit(){for(;y(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=g,t(this)}if(this.__pendingValue===g)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=g}}class U extends T{constructor(t,e,s){super(t,e,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new O(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class O extends A{}let R=!1;(()=>{try{const t={get capture(){return R=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class k{constructor(t,e,s){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=s,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;y(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=g,t(this)}if(this.__pendingValue===g)return;const t=this.__pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=M(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=g}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const M=t=>t&&(R?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)
|
|
69
69
|
/**
|
|
70
70
|
* @license
|
|
71
71
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -78,7 +78,7 @@ class S{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this
|
|
|
78
78
|
* Code distributed by Google as part of the polymer project is also
|
|
79
79
|
* subject to an additional IP rights grant found at
|
|
80
80
|
* http://polymer.github.io/PATENTS.txt
|
|
81
|
-
*/;function
|
|
81
|
+
*/;function q(t){let e=L.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},L.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const n=t.strings.join(i);return s=e.keyString.get(n),void 0===s&&(s=new a(t,t.getTemplateElement()),e.keyString.set(n,s)),e.stringsArray.set(t.strings,s),s}const L=new Map,I=new WeakMap,j=(t,e,i)=>{let n=I.get(e);void 0===n&&(s(e,e.firstChild),I.set(e,n=new E(Object.assign({templateFactory:q},i))),n.appendInto(e)),n.setValue(t),n.commit()};
|
|
82
82
|
/**
|
|
83
83
|
* @license
|
|
84
84
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -91,7 +91,7 @@ class S{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this
|
|
|
91
91
|
* Code distributed by Google as part of the polymer project is also
|
|
92
92
|
* subject to an additional IP rights grant found at
|
|
93
93
|
* http://polymer.github.io/PATENTS.txt
|
|
94
|
-
*/const
|
|
94
|
+
*/const H=new
|
|
95
95
|
/**
|
|
96
96
|
* @license
|
|
97
97
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -105,7 +105,7 @@ class S{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this
|
|
|
105
105
|
* subject to an additional IP rights grant found at
|
|
106
106
|
* http://polymer.github.io/PATENTS.txt
|
|
107
107
|
*/
|
|
108
|
-
class{handleAttributeExpressions(t,e,s,i){const n=e[0];if("."===n){return new
|
|
108
|
+
class{handleAttributeExpressions(t,e,s,i){const n=e[0];if("."===n){return new U(t,e.slice(1),s).parts}if("@"===n)return[new k(t,e.slice(1),i.eventContext)];if("?"===n)return[new V(t,e.slice(1),s)];return new T(t,e,s).parts}handleTextExpression(t){return new E(t)}};
|
|
109
109
|
/**
|
|
110
110
|
* @license
|
|
111
111
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -118,7 +118,7 @@ class{handleAttributeExpressions(t,e,s,i){const n=e[0];if("."===n){return new V(
|
|
|
118
118
|
* Code distributed by Google as part of the polymer project is also
|
|
119
119
|
* subject to an additional IP rights grant found at
|
|
120
120
|
* http://polymer.github.io/PATENTS.txt
|
|
121
|
-
*/"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const
|
|
121
|
+
*/"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const B=(t,...e)=>new x(t,e,"html",H),F=(t,...e)=>new P(t,e,"svg",H)
|
|
122
122
|
/**
|
|
123
123
|
* @license
|
|
124
124
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -131,7 +131,7 @@ class{handleAttributeExpressions(t,e,s,i){const n=e[0];if("."===n){return new V(
|
|
|
131
131
|
* Code distributed by Google as part of the polymer project is also
|
|
132
132
|
* subject to an additional IP rights grant found at
|
|
133
133
|
* http://polymer.github.io/PATENTS.txt
|
|
134
|
-
|
|
134
|
+
*/,$=(t,e)=>`${t}--${e}`;let z=!0;void 0===window.ShadyCSS?z=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),z=!1);const W=t=>e=>{const s=$(e.type,t);let n=L.get(s);void 0===n&&(n={stringsArray:new WeakMap,keyString:new Map},L.set(s,n));let r=n.stringsArray.get(e.strings);if(void 0!==r)return r;const o=e.strings.join(i);if(r=n.keyString.get(o),void 0===r){const s=e.getTemplateElement();z&&window.ShadyCSS.prepareTemplateDom(s,t),r=new a(e,s),n.keyString.set(o,r)}return n.stringsArray.set(e.strings,r),r},D=["html","svg"],J=new Set,G=(t,e,s)=>{J.add(t);const i=s?s.element:document.createElement("template"),n=e.querySelectorAll("style"),{length:r}=n;if(0===r)return void window.ShadyCSS.prepareTemplateStyles(i,t);const o=document.createElement("style");for(let t=0;t<r;t++){const e=n[t];e.parentNode.removeChild(e),o.textContent+=e.textContent}(t=>{D.forEach((e=>{const s=L.get($(e,t));void 0!==s&&s.keyString.forEach((t=>{const{element:{content:e}}=t,s=new Set;Array.from(e.querySelectorAll("style")).forEach((t=>{s.add(t)})),p(t,s)}))}))})(t);const a=i.content;s?function(t,e,s=null){const{element:{content:i},parts:n}=t;if(null==s)return void i.appendChild(e);const r=document.createTreeWalker(i,133,null,!1);let o=m(n),a=0,l=-1;for(;r.nextNode();)for(l++,r.currentNode===s&&(a=u(e),s.parentNode.insertBefore(e,s));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=m(n,o);return}o=m(n,o)}}(s,o,a.firstChild):a.insertBefore(o,a.firstChild),window.ShadyCSS.prepareTemplateStyles(i,t);const l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(s){a.insertBefore(o,a.firstChild);const t=new Set;t.add(o),p(s,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const K={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},Q=(t,e)=>e!==t&&(e==e||t==t),X={attribute:!0,type:String,converter:K,reflect:!1,hasChanged:Q},Y="finalized";class Z extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach(((e,s)=>{const i=this._attributeNameForProperty(s,e);void 0!==i&&(this._attributeToPropertyMap.set(i,s),t.push(i))})),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach(((t,e)=>this._classProperties.set(e,t)))}}static createProperty(t,e=X){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const s="symbol"==typeof t?Symbol():`__${t}`,i=this.getPropertyDescriptor(t,s,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(i){const n=this[t];this[e]=i,this.requestUpdateInternal(t,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||X}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty(Y)||t.finalize(),this[Y]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const s of e)this.createProperty(s,t[s])}}static _attributeNameForProperty(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,s=Q){return s(t,e)}static _propertyValueFromAttribute(t,e){const s=e.type,i=e.converter||K,n="function"==typeof i?i:i.fromAttribute;return n?n(t,s):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const s=e.type,i=e.converter;return(i&&i.toAttribute||K.toAttribute)(t,s)}initialize(){this._updateState=0,this._updatePromise=new Promise((t=>this._enableUpdatingResolver=t)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((t,e)=>this[e]=t)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,s){e!==s&&this._attributeToProperty(t,s)}_propertyToAttribute(t,e,s=X){const i=this.constructor,n=i._attributeNameForProperty(t,s);if(void 0!==n){const t=i._propertyValueToAttribute(e,s);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(n):this.setAttribute(n,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const s=this.constructor,i=s._attributeToPropertyMap.get(t);if(void 0!==i){const t=s.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=s._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,s){let i=!0;if(void 0!==t){const n=this.constructor;s=s||n.getPropertyOptions(t),n._valueHasChanged(this[t],e,s.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==s.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,s))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((t,e)=>this._propertyToAttribute(e,this[e],t))),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}Z[Y]=!0;
|
|
135
135
|
/**
|
|
136
136
|
@license
|
|
137
137
|
Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
|
|
@@ -142,7 +142,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
142
142
|
part of the polymer project is also subject to an additional IP rights grant
|
|
143
143
|
found at http://polymer.github.io/PATENTS.txt
|
|
144
144
|
*/
|
|
145
|
-
const
|
|
145
|
+
const tt=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,et=Symbol();class st{constructor(t,e){if(e!==et)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(tt?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const it=t=>new st(String(t),et),nt=(t,...e)=>{const s=e.reduce(((e,s,i)=>e+(t=>{if(t instanceof st)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(s)+t[i+1]),t[0]);return new st(s,et)};
|
|
146
146
|
/**
|
|
147
147
|
* @license
|
|
148
148
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -156,4 +156,4 @@ const Y=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
|
|
|
156
156
|
* subject to an additional IP rights grant found at
|
|
157
157
|
* http://polymer.github.io/PATENTS.txt
|
|
158
158
|
*/
|
|
159
|
-
(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const
|
|
159
|
+
(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const rt={};class ot extends Z{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,s)=>t.reduceRight(((t,s)=>Array.isArray(s)?e(s,t):(t.add(s),t)),s),s=e(t,new Set),i=[];s.forEach((t=>i.unshift(t))),this._styles=i}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!tt){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return it(e)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?tt?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==rt&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return rt}}ot.finalized=!0,ot.render=(t,e,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const n=i.scopeName,r=I.has(e),o=z&&11===e.nodeType&&!!e.host,a=o&&!J.has(n),l=a?document.createDocumentFragment():e;if(j(t,l,Object.assign({templateFactory:W(n)},i)),a){const t=I.get(l);I.delete(l);const i=t.value instanceof v?t.value.template:void 0;G(n,l,i),s(e,e.firstChild),e.appendChild(l),I.set(e,t)}!r&&o&&window.ShadyCSS.styleElement(e.host)},ot.shadowRootOptions={mode:"open"};export{A,V as B,st as C,k as E,ot as L,E as N,O as P,a as T,x as a,d as b,nt as c,f as d,s as e,j as f,B as h,i as m,g as n,e as r,F as s,L as t,it as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-9bdd5400.js";import"./shared-46f3f71c.js";import{_ as t}from"./shared-0dabe195.js";import{h as e}from"./shared-7f33a83a.js";import{D as s}from"./shared-c758220c.js";let i,n=t=>t;customElements.define("foxy-internal-confirm-dialog",class extends s{constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.alert=!0,this.confirm="confirm",this.message="message",this.cancel="cancel",this.theme="primary"}static get properties(){return t(t({},super.properties),{},{confirm:{type:String},message:{type:String},cancel:{type:String},theme:{type:String}})}render(){return super.render((()=>e(i||(i=n` <foxy-i18n class="block font-lumo text-m text-body text-center mb-m" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> <vaadin-button data-testid="cancelButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> <vaadin-button theme="${0}" data-testid="confirmButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> </div> `),this.lang,this.message,this.ns,this.__handleCancel,this.ns,this.lang,this.cancel,this.theme,this.__handleConfirm,this.ns,this.lang,this.confirm)))}async __handleCancel(){await this.hide(!0)}async __handleConfirm(){await this.hide()}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as e,C as t,T as
|
|
1
|
+
import{E as e,C as t,T as a}from"./shared-4bd1efd7.js";import{h as i,P as r}from"./shared-a7475f62.js";import{a as l}from"./shared-0689b25a.js";const o=i`<dom-module id="lumo-text-area" theme-for="vaadin-text-area">
|
|
2
2
|
<template>
|
|
3
3
|
<style include="lumo-text-field">
|
|
4
4
|
[part="input-field"],
|
|
@@ -62,7 +62,7 @@ import{E as e,C as t,T as i}from"./shared-17d0db7f.js";import{h as a,P as r}from
|
|
|
62
62
|
Copyright (c) 2017 Vaadin Ltd.
|
|
63
63
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
64
64
|
*/
|
|
65
|
-
class n extends(e(l(t(
|
|
65
|
+
class n extends(e(l(t(a(r))))){static get template(){return i`
|
|
66
66
|
<style include="vaadin-text-field-shared-styles">
|
|
67
67
|
.vaadin-text-area-container {
|
|
68
68
|
flex: auto;
|
|
@@ -131,4 +131,4 @@ class n extends(e(l(t(i(r))))){static get template(){return a`
|
|
|
131
131
|
<div part="error-message" id="[[_errorId]]" aria-live="assertive" aria-hidden\$="[[_getErrorMessageAriaHidden(invalid, errorMessage, _errorId)]]">[[errorMessage]]</div>
|
|
132
132
|
|
|
133
133
|
</div>
|
|
134
|
-
`}static get is(){return"vaadin-text-area"}static get version(){return"2.
|
|
134
|
+
`}static get is(){return"vaadin-text-area"}static get version(){return"2.10.0"}static get properties(){return{pattern:{type:String}}}static get observers(){return["_textAreaValueChanged(value)"]}ready(){super.ready(),this._updateHeight(),this.addEventListener("animationend",this._onAnimationEnd),this._inputField=this.root.querySelector("[part=input-field]"),this._inputField.addEventListener("wheel",(e=>{const t=this._inputField.scrollTop;this._inputField.scrollTop+=e.deltaY,t!==this._inputField.scrollTop&&(e.preventDefault(),this.__scrollPositionUpdated())})),this.__scrollPositionUpdated()}__scrollPositionUpdated(){this.updateStyles({"--_text-area-vertical-scroll-position":this._inputField.scrollTop+"px"})}_onAnimationEnd(e){0===e.animationName.indexOf("vaadin-text-area-appear")&&this._updateHeight()}get _slottedTagName(){return"textarea"}_textAreaValueChanged(e){this._updateHeight()}_updateHeight(){const e=this.root.querySelector("[part=input-field]"),t=e.scrollTop,a=this.inputElement,i=this.value?this.value.length:0;if(this._oldValueLength>=i){const t=getComputedStyle(e).height,i=getComputedStyle(a).width;e.style.display="block",e.style.height=t,a.style.maxWidth=i,a.style.height="auto"}this._oldValueLength=i;const r=a.scrollHeight;r>a.clientHeight&&(a.style.height=r+"px"),a.style.removeProperty("max-width"),e.style.removeProperty("display"),e.style.removeProperty("height"),e.scrollTop=t,this._dispatchIronResizeEventIfNeeded("InputHeight",r)}checkValidity(){if(!super.checkValidity())return!1;if(!this.pattern||!this._inputElementValue)return!0;try{const e=this._inputElementValue.match(this.pattern);return!!e&&e[0]===e.input}catch(e){return!0}}}customElements.define(n.is,n);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-c541c9e9.js";import{I as e}from"./shared-a134d313.js";import"./shared-46f3f71c.js";import{_ as t}from"./shared-0dabe195.js";import{i as a}from"./shared-d3bf9ac0.js";import{h as s}from"./shared-7f33a83a.js";let r,l=e=>e;customElements.define("foxy-internal-select-control",class extends e{constructor(){super(...arguments),this.options=[],this.theme=null}static get properties(){return t(t({},super.properties),{},{options:{type:Array},theme:{type:String}})}renderControl(){var e;return s(r||(r=l` <vaadin-combo-box item-value-path="value" item-label-path="label" error-message="${0}" item-id-path="value" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" theme="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible .checkValidity="${0}" .items="${0}" .value="${0}" @change="${0}"> </vaadin-combo-box> `),a(this._errorMessage),this.helperText,this.placeholder,this.label,a(null!==(e=this.theme)&&void 0!==e?e:void 0),this.disabled,this.readonly,this._checkValidity,this.options.map((({value:e,label:t})=>({value:e,label:this.t(t)}))),this._value,(e=>{e.stopPropagation();const t=e.currentTarget;this._value=t.value,t.validate()}))}updated(e){super.updated(e);const t=this.renderRoot.querySelector("vaadin-combo-box");t&&t.value!==this._value&&(t.value=this._value)}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as t}from"./shared-
|
|
1
|
+
import{_ as t}from"./shared-0dabe195.js";import{T as e}from"./shared-4966b3e4.js";import{a as s}from"./shared-a88c5cf1.js";import{p as a}from"./shared-1e43b4db.js";let n,o,r,i,c=t=>t;class l extends(s(e,"subscriptions-table")){constructor(){super(...arguments),this.columns=[l.priceColumn,l.summaryColumn,l.statusColumn,l.subTokenURLColumn]}}l.priceColumn={cell:e=>{const s=e.data._embedded["fx:transaction_template"],o=`${s.total_order} ${s.currency_code}`;return e.html(n||(n=c`
|
|
2
2
|
<foxy-i18n
|
|
3
3
|
data-testclass="i18n frequencies"
|
|
4
4
|
class="font-medium text-m font-tnum"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t,h as e,j as n,k as i,l as r,p as s,n as o,o as a,q as h,s as c,u,v as d,w as l,x as f,y as p,z as v,C as y,D as w,E as x,F as b,G as m,H as g,I as E,J as S,K as T,L,M as _,N as O,S as k,O as C,P as N,Q as M,T as z,U as D,V as P,W as I,X as R}from"./shared-0dabe195.js";var q={deferEvents:!1},J=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=t(t({},q),e)}return e.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents)return void this.schedule(t);this.process(t)}this.flushEvents()},e.prototype.schedule=function(t){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()}else this.queue.push(t)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},e.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(t){throw this.clear(),t}finally{this.processingEvent=!1}},e}(),j=new Map,F=0,U=function(){return"x:"+F++},X=function(t,e){return j.set(t,e),t},A=function(t){return j.get(t)},V=function(t){j.delete(t)};function G(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0}var H,K={sync:!1,autoForward:!1};!function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(H||(H={}));var Q=function(){function q(e,n){var i=this;void 0===n&&(n=q.defaultOptions),this.machine=e,this.scheduler=new J,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=H.NotStarted,this.children=new Map,this.forwardTo=new Set,this.init=this.start,this.send=function(t,e){if(_(t))return i.batch(t),i.state;var n=c(O(t,e));if(i.status===H.Stopped)return i.state;if(i.status!==H.Running&&!i.options.deferEvents)throw new Error('Event "'+n.name+'" was sent to uninitialized service "'+i.machine.id+'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: '+JSON.stringify(n.data));return i.scheduler.schedule((function(){i.forward(n);var t=i.nextState(n);i.update(t,n)})),i._state},this.sendTo=function(e,n){var r=i.parent&&(n===k.Parent||i.parent.id===n),s=r?i.parent:C(n)?i.children.get(n)||A(n):N(n)?n:void 0;if(s)"machine"in s?s.send(t(t({},e),{name:e.name===M?""+T(i.id):e.name,origin:i.sessionId})):s.send(e.data);else if(!r)throw new Error("Unable to send event to child '"+n+"' from service '"+i.id+"'.")};var r=t(t({},q.defaultOptions),n),s=r.clock,o=r.logger,a=r.parent,h=r.id,u=void 0!==h?h:e.id;this.id=u,this.logger=o,this.clock=s,this.parent=a,this.options=r,this.scheduler=new J({deferEvents:this.options.deferEvents}),this.sessionId=U()}return Object.defineProperty(q.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:s(this,(function(){return t._initialState=t.machine.initialState,t._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),q.prototype.execute=function(t,n){var i,r;try{for(var s=e(t.actions),o=s.next();!o.done;o=s.next()){var a=o.value;this.exec(a,t,n)}}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}},q.prototype.update=function(t,s){var o,a,h,c,u,d,l,f,p=this;if(t._sessionid=this.sessionId,this._state=t,this.options.execute&&this.execute(this.state),this.children.forEach((function(t){p.state.children[t.id]=t})),this.devTools&&this.devTools.send(s.data,t),t.event)try{for(var v=e(this.eventListeners),y=v.next();!y.done;y=v.next()){(0,y.value)(t.event)}}catch(t){o={error:t}}finally{try{y&&!y.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}try{for(var w=e(this.listeners),x=w.next();!x.done;x=w.next()){(0,x.value)(t,t.event)}}catch(t){h={error:t}}finally{try{x&&!x.done&&(c=w.return)&&c.call(w)}finally{if(h)throw h.error}}try{for(var b=e(this.contextListeners),m=b.next();!m.done;m=b.next()){(0,m.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(t){u={error:t}}finally{try{m&&!m.done&&(d=b.return)&&d.call(b)}finally{if(u)throw u.error}}var g=n(t.configuration||[],this.machine);if(this.state.configuration&&g){var E=t.configuration.find((function(t){return"final"===t.type&&t.parent===p.machine})),S=E&&E.doneData?i(E.doneData,t.context,s):void 0;try{for(var T=e(this.doneListeners),L=T.next();!L.done;L=T.next()){(0,L.value)(r(this.id,S))}}catch(t){l={error:t}}finally{try{L&&!L.done&&(f=T.return)&&f.call(T)}finally{if(l)throw l.error}}this.stop()}},q.prototype.onTransition=function(t){return this.listeners.add(t),this.status===H.Running&&t(this.state,this.state.event),this},q.prototype.subscribe=function(t,e,n){var i,r=this;if(!t)return{unsubscribe:function(){}};var s=n;return"function"==typeof t?i=t:(i=t.next.bind(t),s=t.complete.bind(t)),this.listeners.add(i),this.status===H.Running&&i(this.state),s&&this.onDone(s),{unsubscribe:function(){i&&r.listeners.delete(i),s&&r.doneListeners.delete(s)}}},q.prototype.onEvent=function(t){return this.eventListeners.add(t),this},q.prototype.onSend=function(t){return this.sendListeners.add(t),this},q.prototype.onChange=function(t){return this.contextListeners.add(t),this},q.prototype.onStop=function(t){return this.stopListeners.add(t),this},q.prototype.onDone=function(t){return this.doneListeners.add(t),this},q.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},q.prototype.start=function(t){var e=this;if(this.status===H.Running)return this;X(this.sessionId,this),this.initialized=!0,this.status=H.Running;var n=void 0===t?this.initialState:s(this,(function(){return z(t)?e.machine.resolveState(t):e.machine.resolveState(D.from(t,e.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){e.update(n,o)})),this},q.prototype.stop=function(){var t,n,i,r,s,o,c,u,d,l,f=this;try{for(var p=e(this.listeners),v=p.next();!v.done;v=p.next()){var y=v.value;this.listeners.delete(y)}}catch(e){t={error:e}}finally{try{v&&!v.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}try{for(var w=e(this.stopListeners),x=w.next();!x.done;x=w.next()){(y=x.value)(),this.stopListeners.delete(y)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(r=w.return)&&r.call(w)}finally{if(i)throw i.error}}try{for(var b=e(this.contextListeners),m=b.next();!m.done;m=b.next()){y=m.value;this.contextListeners.delete(y)}}catch(t){s={error:t}}finally{try{m&&!m.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}try{for(var g=e(this.doneListeners),E=g.next();!E.done;E=g.next()){y=E.value;this.doneListeners.delete(y)}}catch(t){c={error:t}}finally{try{E&&!E.done&&(u=g.return)&&u.call(g)}finally{if(c)throw c.error}}this.state.configuration.forEach((function(t){var n,i;try{for(var r=e(t.definition.exit),s=r.next();!s.done;s=r.next()){var o=s.value;f.exec(o,f.state)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}})),this.children.forEach((function(t){a(t.stop)&&t.stop()}));try{for(var S=e(h(this.delayedEventsMap)),T=S.next();!T.done;T=S.next()){var L=T.value;this.clock.clearTimeout(this.delayedEventsMap[L])}}catch(t){d={error:t}}finally{try{T&&!T.done&&(l=S.return)&&l.call(S)}finally{if(d)throw d.error}}return this.scheduler.clear(),this.initialized=!1,this.status=H.Stopped,V(this.sessionId),this},q.prototype.batch=function(t){var n=this;if(this.status===H.NotStarted&&this.options.deferEvents);else if(this.status!==H.Running)throw new Error(t.length+' event(s) were sent to uninitialized service "'+this.machine.id+'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.');this.scheduler.schedule((function(){var i,r,o=n.state,a=!1,h=[],u=function(t){var e=c(t);n.forward(e),o=s(n,(function(){return n.machine.transition(o,e)})),h.push.apply(h,P(o.actions.map((function(t){return I(t,o)})))),a=a||!!o.changed};try{for(var d=e(t),l=d.next();!l.done;l=d.next()){u(l.value)}}catch(t){i={error:t}}finally{try{l&&!l.done&&(r=d.return)&&r.call(d)}finally{if(i)throw i.error}}o.changed=a,o.actions=h,n.update(o,c(t[t.length-1]))}))},q.prototype.sender=function(t){return this.send.bind(this,t)},q.prototype.nextState=function(t){var e=this,n=c(t);if(0===n.name.indexOf(u)&&!this.state.nextEvents.some((function(t){return 0===t.indexOf(u)})))throw n.data.data;return s(this,(function(){return e.machine.transition(e.state,n)}))},q.prototype.forward=function(t){var n,i;try{for(var r=e(this.forwardTo),s=r.next();!s.done;s=r.next()){var o=s.value,a=this.children.get(o);if(!a)throw new Error("Unable to forward event '"+t+"' from interpreter '"+this.id+"' to nonexistant child '"+o+"'.");a.send(t)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}},q.prototype.defer=function(t){var e=this;this.delayedEventsMap[t.id]=this.clock.setTimeout((function(){t.to?e.sendTo(t._event,t.to):e.send(t._event)}),t.delay)},q.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},q.prototype.exec=function(t,e,n){void 0===n&&(n=this.machine.options.actions);var r=e.context,s=e._event,o=t.exec||d(t.type,n),h=a(o)?o:o?o.exec:t.exec;if(h)try{return h(r,s.data,{action:t,state:this.state,_event:s})}catch(t){throw this.parent&&this.parent.send({type:"xstate.error",data:t}),t}switch(t.type){case g:var c=t;if("number"==typeof c.delay)return void this.defer(c);c.to?this.sendTo(c._event,c.to):this.send(c._event);break;case m:this.cancel(t.sendId);break;case p:var u=t.activity;if(!this.state.activities[u.id||u.type])break;if(u.type===v.Invoke){var E=y(u.src),S=this.machine.options.services?this.machine.options.services[E.type]:void 0,T=u.id,L=u.data,_="autoForward"in u?u.autoForward:!!u.forward;if(!S)return;var O=L?i(L,r,s):void 0,k=a(S)?S(r,s.data,{data:O,src:E}):S;w(k)?this.spawnPromise(Promise.resolve(k),T):a(k)?this.spawnCallback(k,T):x(k)?this.spawnObservable(k,T):b(k)&&this.spawnMachine(O?k.withContext(O):k,{id:T,autoForward:_})}else this.spawnActivity(u);break;case f:this.stopChild(t.activity.id);break;case l:var C=t.label,N=t.value;C?this.logger(C,N):this.logger(N)}},q.prototype.removeChild=function(t){this.children.delete(t),this.forwardTo.delete(t),delete this.state.children[t]},q.prototype.stopChild=function(t){var e=this.children.get(t);e&&(this.removeChild(t),a(e.stop)&&e.stop())},q.prototype.spawn=function(e,n,i){if(w(e))return this.spawnPromise(Promise.resolve(e),n);if(a(e))return this.spawnCallback(e,n);if(E(e))return this.spawnActor(e);if(x(e))return this.spawnObservable(e,n);if(b(e))return this.spawnMachine(e,t(t({},i),{id:n}));throw new Error('Unable to spawn entity "'+n+'" of type "'+typeof e+'".')},q.prototype.spawnMachine=function(e,n){var i=this;void 0===n&&(n={});var r=new q(e,t(t({},this.options),{parent:this,id:n.id||e.id})),s=t(t({},K),n);s.sync&&r.onTransition((function(t){i.send(S,{state:t,id:r.id})}));var o=r;return this.children.set(r.id,o),s.autoForward&&this.forwardTo.add(r.id),r.onDone((function(t){i.removeChild(r.id),i.send(c(t,{origin:r.id}))})).start(),o},q.prototype.spawnPromise=function(t,e){var n=this,i=!1;t.then((function(t){i||(n.removeChild(e),n.send(c(r(e,t),{origin:e})))}),(function(t){if(!i){n.removeChild(e);var r=T(e,t);try{n.send(c(r,{origin:e}))}catch(t){n.devTools&&n.devTools.send(r,n.state),n.machine.strict&&n.stop()}}}));var s={id:e,send:function(){},subscribe:function(e,n,i){var r=R(e,n,i),s=!1;return t.then((function(t){s||(r.next(t),s||r.complete())}),(function(t){s||r.error(t)})),{unsubscribe:function(){return s=!0}}},stop:function(){i=!0},toJSON:function(){return{id:e}}};return this.children.set(e,s),s},q.prototype.spawnCallback=function(t,e){var n,i=this,r=!1,s=new Set,o=new Set;try{n=t((function(t){o.forEach((function(e){return e(t)})),r||i.send(c(t,{origin:e}))}),(function(t){s.add(t)}))}catch(t){this.send(T(e,t))}if(w(n))return this.spawnPromise(n,e);var h={id:e,send:function(t){return s.forEach((function(e){return e(t)}))},subscribe:function(t){return o.add(t),{unsubscribe:function(){o.delete(t)}}},stop:function(){r=!0,a(n)&&n()},toJSON:function(){return{id:e}}};return this.children.set(e,h),h},q.prototype.spawnObservable=function(t,e){var n=this,i=t.subscribe((function(t){n.send(c(t,{origin:e}))}),(function(t){n.removeChild(e),n.send(c(T(e,t),{origin:e}))}),(function(){n.removeChild(e),n.send(c(r(e),{origin:e}))})),s={id:e,send:function(){},subscribe:function(e,n,i){return t.subscribe(e,n,i)},stop:function(){return i.unsubscribe()},toJSON:function(){return{id:e}}};return this.children.set(e,s),s},q.prototype.spawnActor=function(t){return this.children.set(t.id,t),t},q.prototype.spawnActivity=function(t){var e=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(e){var n=e(this.state.context,t);this.spawnEffect(t.id,n)}},q.prototype.spawnEffect=function(t,e){this.children.set(t,{id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:e||void 0,toJSON:function(){return{id:t}}})},q.prototype.attachDev=function(){var e=G();if(this.options.devTools&&e&&e.__REDUX_DEVTOOLS_EXTENSION__){var n="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(t(t({name:this.id,autoPause:!0,stateSanitizer:function(t){return{value:t.value,context:t.context,actions:t.actions}}},n),{features:t({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}},q.prototype.toJSON=function(){return{id:this.id}},q.prototype[L]=function(){return this},q.defaultOptions=function(t){return{execute:!0,deferEvents:!0,clock:{setTimeout:function(t,e){return setTimeout(t,e)},clearTimeout:function(t){return clearTimeout(t)}},logger:t.console.log.bind(console),devTools:!1}}("undefined"!=typeof self?self:global),q.interpret=W,q}();function W(t,e){return new Q(t,e)}export{W as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-0689b25a.js";import{I as e}from"./shared-a134d313.js";import{_ as s}from"./shared-0dabe195.js";import{i as t}from"./shared-d3bf9ac0.js";import{h as r}from"./shared-7f33a83a.js";let i,l,a,o=e=>e;customElements.define("foxy-internal-text-control",class extends e{constructor(){super(...arguments),this.prefix=null,this.suffix=null}static get properties(){return s(s({},super.properties),{},{prefix:{},suffix:{}})}renderControl(){return r(i||(i=o` <vaadin-text-field error-message="${0}" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" ?clear-button-visible="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @input="${0}"> ${0} ${0} </vaadin-text-field> `),t(this._errorMessage),this.helperText,this.placeholder,this.label,!this.suffix,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var s;return"Enter"===e.key&&(null===(s=this.nucleon)||void 0===s?void 0:s.submit())}),(e=>{const s=e.currentTarget;this._value=s.value}),this.prefix?r(l||(l=o`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?r(a||(a=o`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-7680d300.js";import"./shared-0689b25a.js";import"./shared-13cc4ed4.js";import"./shared-db06114b.js";import"./shared-c541c9e9.js";import{I as e}from"./shared-a134d313.js";import{_ as a}from"./shared-0dabe195.js";import{c as t,h as i}from"./shared-7f33a83a.js";let s,l,r=e=>e;customElements.define("foxy-internal-frequency-control",class extends e{constructor(){super(...arguments),this.options=[{value:"d",label:"day"},{value:"w",label:"week"},{value:"m",label:"month"},{value:"y",label:"year"}],this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{var a;const t=e.startsWith(".")?`0${e}`:e,i=parseFloat(e.substring(0,Math.max(t.length-1,0))),s=null!==(a=t[t.length-1])&&void 0!==a?a:"";return isNaN(i)?["0",""]:[i.toString(),s]}}}static get properties(){return a(a({},super.properties),{},{options:{attribute:!1}})}static get styles(){return[super.styles,t(s||(s=r`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))]}renderControl(){var e,a;const t=null!==(e=this._value)&&void 0!==e?e:"",s=parseFloat(this.__i18n.parseValue(t)[0]),d=this.options.map((({value:e,label:a})=>({label:this.t(a,{count:s}),value:e})));return i(l||(l=r` <vaadin-custom-field ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .errorMessage="${0}" .helperText="${0}" .label="${0}" .value="${0}" .i18n="${0}" @change="${0}"> <vaadin-integer-field max="999" min="1" prevent-invalid-input has-controls ?disabled="${0}" ?readonly="${0}" ?invalid="${0}" @keydown="${0}"> </vaadin-integer-field> <vaadin-combo-box item-value-path="value" item-label-path="label" ?disabled="${0}" ?readonly="${0}" ?invalid="${0}" .items="${0}" @keydown="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.disabled,this.readonly,this._checkValidity,null!==(a=this._errorMessage)&&void 0!==a?a:"",this.helperText,this.label,t,this.__i18n,(e=>{const a=e.currentTarget;this._value=a.value}),this.disabled,this.readonly,!this._checkValidity(),(e=>{var a;return"Enter"===e.key&&(null===(a=this.nucleon)||void 0===a?void 0:a.submit())}),this.disabled,this.readonly,!this._checkValidity(),d,(e=>{var a;return"Enter"===e.key&&(null===(a=this.nucleon)||void 0===a?void 0:a.submit())}))}updated(e){var a;super.updated(e);const t=this.renderRoot.querySelector("vaadin-custom-field");t&&t.value!==this._value&&(t.value=null!==(a=this._value)&&void 0!==a?a:"")}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-f9180815.js";import"./shared-46f3f71c.js";import{_ as e}from"./shared-0dabe195.js";import{C as r}from"./shared-1fd59009.js";import{a as t,T as s}from"./shared-a88c5cf1.js";import{h as n,f as o,L as i}from"./shared-7f33a83a.js";import{I as a}from"./shared-763a6797.js";import{N as l}from"./shared-a6517170.js";let d,f,p,u,h=e=>e;class m extends(r(t(s(a(i))))){constructor(){super(...arguments),this.nucleon=null}static get inferredProperties(){return[...super.inferredProperties,"nucleon"]}static get properties(){return e(e({},super.properties),{},{nucleon:{attribute:!1}})}inferFromElement(e,r){return"nucleon"===e&&r instanceof l?r:super.inferFromElement(e,r)}applyInferredProperties(e){var r,t;super.applyInferredProperties(e),this.nucleon=null!==(r=e.get("nucleon"))&&void 0!==r?r:null,this.disabled=!1===(null===(t=this.nucleon)||void 0===t?void 0:t.in("idle"))||super.disabled}updated(e){if(super.updated(e),"string"==typeof this.infer){const e=n(d||(d=h` <slot name="${0}:before" slot="before"></slot> <slot name="${0}:after" slot="after"></slot> `),this.infer,this.infer);o(e,this)}}renderControl(){return n(f||(f=h``))}render(){return this.hidden?n(p||(p=h``)):n(u||(u=h` ${0} ${0} ${0} `),this.renderTemplateOrSlot("before",this.nucleon),this.renderControl(),this.renderTemplateOrSlot("after",this.nucleon))}}customElements.define("foxy-internal-control",m);export{m as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-9bdd5400.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-46f3f71c.js";import{I as e}from"./shared-a134d313.js";import"./shared-8128b5e3.js";import{_ as t}from"./shared-0dabe195.js";import{i}from"./shared-d3bf9ac0.js";import{c as r}from"./shared-4e709717.js";import{h as o}from"./shared-7f33a83a.js";let a,n,s,l,d,c,h,f,u,m,p,g=e=>e;customElements.define("foxy-internal-async-list-control",class extends e{constructor(){super(...arguments),this.keepDialogOpenOnDelete=!1,this.keepDialogOpenOnPost=!1,this.createPageHref=null,this.related=[],this.limit=20,this.first=null,this.form=null,this.item=null,this.wide=!1,this.alert=!1,this.hideDeleteButton=!1,this.hideCreateButton=!1,this.getPageHref=null,this.__deletionConfimationCallback=null,this.__cachedCardRenderer=null,this.__itemRenderer=e=>{var t;if(!e.data)return this.__cardRenderer(e);if("string"!=typeof(null===(t=this.getPageHref)||void 0===t?void 0:t.call(this,e.href,e.data))&&!this.form)return this.__cardRenderer(e);const i=this.disabledSelector.matches("card",!0),d=this.__cardRenderer(e);let c;const h=r({"rounded-t":!e.previous,"rounded-b":!e.next,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-left w-full block transition-colors":!0,"hover-bg-contrast-5":!i});if(this.getPageHref)if(i)c=o(a||(a=g`<div class="${0}">${0}</div>`),h,d);else{const t=this.getPageHref(e.href,e.data);c=o(n||(n=g`<a class="${0}" href="${0}">${0}</a>`),h,t,d)}else{c=o(s||(s=g` <button ?disabled="${0}" class="${0}" @click="${0}">${0}</button> `),i,h,(t=>{const i=t.currentTarget,r=this.__dialog;r.header="header_update",r.href=e.href,r.show(i)}),d)}return this.hideDeleteButton?c:o(l||(l=g` <foxy-swipe-actions class="block"> ${0} <vaadin-button theme="primary error" class="h-full" slot="action" @click="${0}"> <foxy-i18n infer="" key="delete_button_text"></foxy-i18n> </vaadin-button> </foxy-swipe-actions> `),c,(e=>{const t=e.currentTarget;this.renderRoot.querySelector("#confirm").show(t),this.__deletionConfimationCallback=()=>{const e=t.previousElementSibling.querySelector("[href]");null==e||e.delete(),this.__deletionConfimationCallback=null}}))}}static get properties(){return t(t({},super.properties),{},{keepDialogOpenOnDelete:{type:Boolean,attribute:"keep-dialog-open-on-delete"},keepDialogOpenOnPost:{type:Boolean,attribute:"keep-dialog-open-on-post"},hideDeleteButton:{type:Boolean,attribute:"hide-delete-button"},hideCreateButton:{type:Boolean,attribute:"hide-create-button"},createPageHref:{attribute:"create-page-href"},getPageHref:{attribute:!1},related:{type:Array},first:{},limit:{type:Number},form:{},item:{},wide:{type:Boolean},alert:{type:Boolean}})}renderControl(){var e,t;let r;try{const t=new URL(null!==(e=this.first)&&void 0!==e?e:"");t.searchParams.set("limit",String(this.limit)),r=t.toString()}catch(e){r=void 0}return o(d||(d=g` ${0} ${0} ${0} <foxy-pagination first="${0}" infer="pagination"> <foxy-collection-page class="mb-s block divide-y divide-contrast-5 rounded overflow-hidden bg-contrast-5" infer="card" .related="${0}" .item="${0}"> </foxy-collection-page> ${0} </foxy-pagination> `),this.form?o(c||(c=g` <foxy-form-dialog parent="${0}" infer="dialog" id="form" ?wide="${0}" ?alert="${0}" ?keep-open-on-post="${0}" ?keep-open-on-delete="${0}" .related="${0}" .form="${0}"> </foxy-form-dialog> `),i(null!==(t=this.first)&&void 0!==t?t:void 0),this.wide,this.alert,this.keepDialogOpenOnPost,this.keepDialogOpenOnDelete,this.related,this.form):"",this.hideDeleteButton?"":o(h||(h=g` <foxy-internal-confirm-dialog message="delete_message" confirm="delete_confirm" cancel="delete_cancel" header="delete_header" theme="error" infer="" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> `),(e=>{var t;e.detail.cancelled||null===(t=this.__deletionConfimationCallback)||void 0===t||t.call(this)})),this.label&&"label"!==this.label?o(f||(f=g`<div class="font-medium text-secondary text-s mb-xs">${0}</div>`),this.label):"",i(r),this.related,this.__itemRenderer,!this.form&&!this.createPageHref||this.readonly||this.hideCreateButton?"":this.createPageHref&&!this.disabled?o(u||(u=g` <a class="mb-s w-full flex items-center justify-center h-m px-m rounded text-m font-medium transition-colors bg-contrast-5 text-success hover-bg-contrast-10 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="create_button_text"></foxy-i18n> </a> `),this.createPageHref):o(m||(m=g` <vaadin-button class="mb-s w-full" theme="success" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="create_button_text"></foxy-i18n> </vaadin-button> `),this.disabled,(e=>{e.preventDefault(),e.stopPropagation();const t=this.__dialog,i=e.currentTarget;t.header="header_create",t.href="",t.show(i)})))}get __dialog(){return this.renderRoot.querySelector("#form")}get __cardRenderer(){var e;const t=this.item;return(null===(e=this.__cachedCardRenderer)||void 0===e?void 0:e.item)!==t&&(this.__cachedCardRenderer={item:t,render:"string"==typeof t?new Function("ctx",`return ctx.html\`<${t} related=\${JSON.stringify(ctx.related)} parent=\${ctx.parent} style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)" infer href=\${ctx.href}></${t}>\``):e=>o(p||(p=g` <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> `),null==t?void 0:t(e))}),this.__cachedCardRenderer.render}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as t,C as e,T as o}from"./shared-
|
|
1
|
+
import{E as t,C as e,T as o}from"./shared-4bd1efd7.js";import{h as r,G as i,P as a,b as s}from"./shared-a7475f62.js";const n=r`<dom-module id="lumo-button" theme-for="vaadin-button">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e}from"./shared-
|
|
1
|
+
import{I as e}from"./shared-91eb066c.js";import{_ as t}from"./shared-0dabe195.js";class r extends e{constructor(){super(...arguments),this.getValue=()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.form[this.property]},this.setValue=e=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.edit({[this.property]:e})},this.__placeholder=null,this.__helperText=null,this.__v8nPrefix=null,this.__property=null,this.__label=null}static get properties(){return t(t({},super.properties),{},{placeholder:{type:String,noAccessor:!0},helperText:{type:String,attribute:"helper-text",noAccessor:!0},v8nPrefix:{type:String,attribute:"v8n-prefix",noAccessor:!0},getValue:{attribute:!1},setValue:{attribute:!1},property:{type:String,noAccessor:!0},label:{type:String,noAccessor:!0}})}get placeholder(){return"string"==typeof this.__placeholder?this.__placeholder:this.t("placeholder")}set placeholder(e){this.requestUpdate("placeholder",this.__placeholder),this.__placeholder=e}get helperText(){return"string"==typeof this.__helperText?this.__helperText:this.t("helper_text")}set helperText(e){this.requestUpdate("helperText",this.__helperText),this.__helperText=e}get v8nPrefix(){return"string"==typeof this.__v8nPrefix?this.__v8nPrefix:"string"==typeof this.infer?`${this.infer}:`:""}set v8nPrefix(e){this.requestUpdate("v8nPrefix",this.__v8nPrefix),this.__v8nPrefix=e}get property(){return"string"==typeof this.__property?this.__property:"string"==typeof this.infer?this.infer.replace(/-/g,"_"):""}set property(e){this.requestUpdate("property",this.__property),this.__property=e}get label(){return"string"==typeof this.__label?this.__label:this.t("label")}set label(e){this.requestUpdate("label",this.__label),this.__label=e}resetPlaceholder(){this.requestUpdate("placeholder",this.__placeholder),this.__placeholder=null}resetHelperText(){this.requestUpdate("helperText",this.__helperText),this.__helperText=null}resetV8nPrefix(){this.requestUpdate("v8nPrefix",this.__v8nPrefix),this.__v8nPrefix=null}resetProperty(){this.requestUpdate("property",this.__property),this.__property=null}resetLabel(){this.requestUpdate("label",this.__label),this.__label=null}reportValidity(){const e=this.ownerDocument.createTreeWalker(this.renderRoot,NodeFilter.SHOW_ELEMENT);do{const t=e.currentNode,r=["reportValidity","validate"];for(const e of r)if(e in t)try{t[e]();break}catch(e){continue}}while(e.nextNode())}get _value(){return this.getValue()}set _value(e){const t=new CustomEvent("change",{cancelable:!0,detail:e});this.dispatchEvent(t)&&this.setValue(e)}get _error(){var e;return null===(e=this.nucleon)||void 0===e?void 0:e.errors.find((e=>e.startsWith(this.v8nPrefix)))}get _errorMessage(){return this._error?this.t(this._error.substring(this.v8nPrefix.length)):void 0}get _checkValidity(){return()=>!this._error}}customElements.define("foxy-internal-editable-control",r);export{r as I};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,m as t,e as s,f as r,_ as i,R as n}from"./shared-0dabe195.js";import{h as o,L as h}from"./shared-7f33a83a.js";import{A as a}from"./shared-bbbb8894.js";import{F as d}from"./shared-343d1fd7.js";import{U as u,a as l}from"./shared-3ab0306f.js";import{I as c}from"./shared-763a6797.js";import{i as _}from"./shared-8528906b.js";function f(t,s){let r=null;return e(s).forEach((function(){var e,s,i,n,o,h,a,d,u,l,c;if(null===(i=null===(s=null===(e=this.node)||void 0===e?void 0:e._links)||void 0===s?void 0:s.self)||void 0===i?void 0:i.href){const e=null===(h=null===(o=null===(n=this.node)||void 0===n?void 0:n._links)||void 0===o?void 0:o.self)||void 0===h?void 0:h.href,s=new URL(null===(u=null===(d=null===(a=this.node)||void 0===a?void 0:a._links)||void 0===d?void 0:d.self)||void 0===u?void 0:u.href);if(s.searchParams.delete("zoom"),t===e||t===s.toString())return r=JSON.stringify(this.node),void this.stop()}Object.entries(null!==(c=null===(l=this.node)||void 0===l?void 0:l._links)&&void 0!==c?c:{}).some((([e,s])=>{var i,n;if(s.href!==t)return!1;const o=null===(n=null===(i=this.node)||void 0===i?void 0:i._embedded)||void 0===n?void 0:n[e];if(!o||!Array.isArray(o))return!1;const h=o.length<20?o.length:21,a=new URL(t),d=new URL(t);return a.searchParams.set("offset",o.length.toString()),d.searchParams.set("offset",h.toString()),r=JSON.stringify({returned_items:o.length,total_items:h,offset:0,limit:20,_embedded:{[e]:o},_links:{curies:this.node._links.curies,first:{href:t},last:{href:d.toString()},prev:{href:t},next:{href:a.toString()},self:{href:t}}}),this.stop(),!0}))})),new Response(r,{status:r?200:404})}let v,p=e=>e;class m extends(c(h)){constructor(){super(),this.lang="",this.parent="",this.related=[],this.__hrefToLoad=null,this.__group="",this.__unsubscribeFromRumour=null,this.__fetchEventQueue=[],this.__service=_(s.withConfig({services:{sendDelete:()=>this._sendDelete(),sendPatch:({edits:e})=>this._sendPatch(e),sendPost:({edits:e})=>this._sendPost(e),sendGet:()=>this._sendGet()},actions:{validate:r({errors:e=>{const t=this.constructor.v8n,s=i(i({},e.data),e.edits);return t.map((e=>e(s))).filter((e=>"string"==typeof e)).filter(((e,t,s)=>s.indexOf(e)===t))}})}})),this.__createService()}static get inferredProperties(){return[...super.inferredProperties,"group","lang"]}static get properties(){return{__state:{type:String,reflect:!0,attribute:"state"},related:{type:Array},parent:{type:String},group:{type:String,noAccessor:!0},href:{type:String,noAccessor:!0},lang:{type:String}}}static get v8n(){return[]}get failure(){return this.__service.state.context.failure}get errors(){return this.__service.state.context.errors}get form(){const{data:e,edits:t}=this.__service.state.context;return i(i({},e),t)}get data(){return this.__service.state.context.data}set data(e){this.__destroyRumour(),this.__hrefToLoad=null,this.__service.send({type:"SET_DATA",data:e}),e&&this.__createRumour()}get group(){return this.__group}set group(e){this.__group=e,this.__destroyRumour(),this.__createRumour()}get href(){var e,t,s;return null!==(s=null!==(t=null===(e=this.form._links)||void 0===e?void 0:e.self.href)&&void 0!==t?t:this.__hrefToLoad)&&void 0!==s?s:""}set href(e){this.__hrefToLoad=e,e?this.__service.send({type:"FETCH"}):this.data=null}in(e){return this.__service.state.matches(e)}undo(){this.__service.send({type:"UNDO"})}edit(e){var t;"string"==typeof(null===(t=e._links)||void 0===t?void 0:t.self.href)&&(this.__hrefToLoad=null),this.__service.send({type:"EDIT",data:e})}submit(){this.reportValidity(),this.__service.send({type:"SUBMIT"})}checkValidity(){const e=this.in({idle:{template:{dirty:"valid"}}}),t=this.in({idle:{snapshot:{dirty:"valid"}}}),s=this.in({idle:{template:{clean:"valid"}}}),r=this.in({idle:{snapshot:{clean:"valid"}}});return s||e||(r||t)}reportValidity(){const e=this.ownerDocument.createTreeWalker(this.renderRoot,NodeFilter.SHOW_ELEMENT);do{const t=e.currentNode,s=["reportValidity","validate"];for(const e of s)if(e in t)try{t[e]();break}catch(e){continue}}while(e.nextNode());return this.checkValidity()}delete(){this.__service.send({type:"DELETE"})}refresh(){this.__service.send({type:"REFRESH"})}render(){return o(v||(v=p`<slot></slot>`))}connectedCallback(){super.connectedCallback(),this.href&&!this.data&&this.__service.send({type:"FETCH"}),this.__createRumour(),this.__createServer(),this.__processFetchEventQueue(),this.dispatchEvent(new u)}disconnectedCallback(){super.disconnectedCallback(),this.__destroyRumour(),this.__destroyServer(),this.__flushFetchEventQueue("parent element was disconnected"),this.dispatchEvent(new u)}applyInferredProperties(e){var t,s;super.applyInferredProperties(e),null!==this.infer&&(this.group=null!==(t=e.get("group"))&&void 0!==t?t:"",this.lang=null!==(s=e.get("lang"))&&void 0!==s?s:"")}async _fetch(...e){const t=await new a(this).fetch(...e);if(!t.ok)throw t;return t.json()}async _sendPost(e){let t;this.__destroyRumour();try{const s=JSON.stringify(e),r=await this._fetch(this.parent,{body:s,method:"POST"});t=await this._fetch(r._links.self.href);const i=m.Rumour(this.group),n=[...this.related,this.parent];i.share({data:t,related:n,source:t._links.self.href})}finally{this.__createRumour()}return t}async _sendGet(){let e;this.__destroyRumour();try{e=await this._fetch(this.href),m.Rumour(this.group).share({data:e,source:this.href})}finally{this.__createRumour()}return e}async _sendPatch(e){let t;this.__destroyRumour();try{const s=JSON.stringify(e);t=await this._fetch(this.href,{body:s,method:"PATCH"});m.Rumour(this.group).share({data:t,source:this.href,related:this.related})}finally{this.__createRumour()}return t}async _sendDelete(){this.__destroyRumour();try{await this._fetch(this.href,{method:"DELETE"});const e=m.Rumour(this.group),t=[...this.related,this.parent];e.share({data:null,source:this.href,related:t})}finally{this.__createRumour()}return null}get __state(){const e=this.__service.state.toStrings().reduce(((e,t)=>[...e,...t.split(".")]),[]);return[...new Set(e)].join(" ")}__createService(){this.__service.onTransition((e=>{var t,s;if(!e.changed)return;let r;e.matches("idle")&&((null===(t=e.history)||void 0===t?void 0:t.matches({busy:"deleting"}))?r=l.ResourceDeleted:(null===(s=e.history)||void 0===s?void 0:s.matches({busy:"creating"}))&&(r=l.ResourceCreated)),this.requestUpdate(),this.dispatchEvent(new u("update",{detail:{result:r}})),e.matches("busy")||this.__processFetchEventQueue()})),this.__service.onChange((()=>{this.requestUpdate(),this.dispatchEvent(new u)})),this.__service.start()}__createRumour(){const e=m.Rumour(this.group);this.__unsubscribeFromRumour=e.track((e=>this.__handleRumourUpdate(e)))}__destroyRumour(){var e;null===(e=this.__unsubscribeFromRumour)||void 0===e||e.call(this),this.__unsubscribeFromRumour=null}__createServer(){this.__fetchEventHandler=this.__handleFetchEvent.bind(this),this.addEventListener("fetch",this.__fetchEventHandler)}__destroyServer(){this.removeEventListener("fetch",this.__fetchEventHandler)}__handleRumourUpdate(e){var t;try{const s=null===(t=this.__service.state)||void 0===t?void 0:t.context.data,r=s?e(s):s;if(r!==s&&(this.data=r,!r)){const e=l.ResourceDeleted,t=new u("update",{detail:{result:e}});this.dispatchEvent(t)}}catch(e){if(!(e instanceof n.UpdateError))throw e;this.__service.send({type:"REFRESH"})}}__processFetchEventQueue(){const e=new m.API(this);this.__fetchEventQueue.forEach((t=>{const s=t.request,r=f(s.url,this.data),i=r.ok?r:e.fetch(s);t.respondWith(Promise.resolve(i)),r.ok&&console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${s.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;","")})),this.__fetchEventQueue=[]}__flushFetchEventQueue(e){this.__fetchEventQueue.forEach((t=>{t.respondWith(Promise.reject(new Error(e)))})),this.__fetchEventQueue=[]}__handleFetchEvent(e){e instanceof d&&(e.defaultPrevented||"GET"===e.request.method&&(e.request.url.startsWith("foxy://")||e.composedPath()[0]!==this&&(e.preventDefault(),this.__fetchEventQueue.push(e),this.__service.state.matches("busy")||this.__processFetchEventQueue())))}}m.UpdateEvent=u,m.Rumour=t((()=>new n)),m.API=a;export{m as N,f as s};
|