@foxy.io/elements 1.18.0-beta.2 → 1.18.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-api-browser.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-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 +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-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.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-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-item-card.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-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +6 -6
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-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-shipping-method-form.js +1 -150
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-swipe-actions.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-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-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 +5 -5
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-75e34b5b.js → shared-023c287a.js} +1 -1
- package/dist/cdn/{shared-e1c1e8e2.js → shared-0479553e.js} +1 -1
- package/dist/cdn/{shared-32b15545.js → shared-07834676.js} +1 -1
- package/dist/cdn/{shared-fd001fd3.js → shared-09d39b25.js} +1 -1
- package/dist/cdn/{shared-12f8034b.js → shared-1009388a.js} +1 -1
- package/dist/cdn/{shared-99940888.js → shared-11c2efc8.js} +1 -1
- package/dist/cdn/{shared-59796faa.js → shared-1971bbbd.js} +1 -1
- package/dist/cdn/{shared-2b077e01.js → shared-19ae2188.js} +3 -3
- package/dist/cdn/{shared-8166ba00.js → shared-1c660ed1.js} +1 -1
- package/dist/cdn/{shared-30bb4828.js → shared-240700a9.js} +1 -1
- package/dist/cdn/{shared-d6ed2e5c.js → shared-27ef5935.js} +1 -1
- package/dist/cdn/{shared-2f186d21.js → shared-296f4621.js} +1 -1
- package/dist/cdn/{shared-e25c676a.js → shared-2a472b2d.js} +1 -1
- package/dist/cdn/{shared-7ed7818e.js → shared-2e0927c2.js} +1 -1
- package/dist/cdn/{shared-95f4cffd.js → shared-3368abe5.js} +1 -1
- package/dist/cdn/{shared-b772fbb1.js → shared-3a7cf739.js} +1 -1
- package/dist/cdn/{shared-824f6e03.js → shared-403fd4e3.js} +1 -1
- package/dist/cdn/{shared-2f19b670.js → shared-408341aa.js} +1 -1
- package/dist/cdn/{shared-9f9cdbb0.js → shared-41655ecf.js} +1 -1
- package/dist/cdn/{shared-4fc53390.js → shared-44f45339.js} +1 -1
- package/dist/cdn/{shared-0b9c755c.js → shared-4b5b7eb5.js} +1 -1
- package/dist/cdn/{shared-e6a7b2f1.js → shared-4c0520f6.js} +1 -1
- package/dist/cdn/{shared-17331dc5.js → shared-56f2ae96.js} +1 -1
- package/dist/cdn/{shared-d673b138.js → shared-628c7355.js} +1 -1
- package/dist/cdn/{shared-c5a638d1.js → shared-63e71a69.js} +1 -1
- package/dist/cdn/shared-6629d6b0.js +150 -0
- package/dist/cdn/{shared-dc73b9a5.js → shared-7f33a83a.js} +1 -1
- package/dist/cdn/{shared-6eeb69e7.js → shared-81b7c484.js} +1 -1
- package/dist/cdn/{shared-c13674cb.js → shared-833a8b4e.js} +1 -1
- package/dist/cdn/{shared-4473f0cf.js → shared-85bcfcde.js} +1 -1
- package/dist/cdn/{shared-d6dd67a5.js → shared-87176207.js} +1 -1
- package/dist/cdn/{shared-b52c7edf.js → shared-8a86a620.js} +1 -1
- package/dist/cdn/{shared-da130124.js → shared-8ec9793b.js} +1 -1
- package/dist/cdn/{shared-4f8fe424.js → shared-91ad37aa.js} +2 -2
- package/dist/cdn/{shared-6c1aab74.js → shared-977dcc25.js} +1 -1
- package/dist/cdn/{shared-0eb966c5.js → shared-99065f2a.js} +1 -1
- package/dist/cdn/shared-9b392ba8.js +1 -0
- package/dist/cdn/{shared-1bbd9b73.js → shared-9be1a70f.js} +1 -1
- package/dist/cdn/{shared-58a35351.js → shared-b15671a5.js} +1 -1
- package/dist/cdn/{shared-33b47806.js → shared-b4865438.js} +3 -3
- package/dist/cdn/{shared-2caab7af.js → shared-b4d0adff.js} +4 -4
- package/dist/cdn/{shared-5652560a.js → shared-b778d103.js} +1 -1
- package/dist/cdn/{shared-40689cd2.js → shared-c37600c8.js} +1 -1
- package/dist/cdn/{shared-fadcb2e1.js → shared-ca0f14c1.js} +1 -1
- package/dist/cdn/{shared-d539ee69.js → shared-cbb340fa.js} +1 -1
- package/dist/cdn/{shared-a64ead08.js → shared-cbbd7f8c.js} +1 -1
- package/dist/cdn/{shared-48ef8a04.js → shared-d071c963.js} +1 -1
- package/dist/cdn/{shared-9803aa7c.js → shared-d3bf9ac0.js} +2 -2
- package/dist/cdn/shared-d4d44ca4.js +1 -0
- package/dist/cdn/{shared-a0c6a159.js → shared-d519a301.js} +2 -2
- package/dist/cdn/{shared-5f411ce2.js → shared-d8b553fa.js} +1 -1
- package/dist/cdn/shared-d988a664.js +1 -0
- package/dist/cdn/shared-e66740a4.js +1 -0
- package/dist/cdn/{shared-f9f9ed5b.js → shared-e6f3e9f0.js} +1 -1
- package/dist/cdn/{shared-8936b109.js → shared-ea418c18.js} +1 -1
- package/dist/cdn/shared-ebb63c77.js +1 -0
- package/dist/cdn/{shared-e06de519.js → shared-edc7150d.js} +1 -1
- package/dist/cdn/{shared-f966bbc3.js → shared-f2608c7d.js} +1 -1
- package/dist/cdn/{shared-22ba9566.js → shared-f3b35364.js} +1 -1
- package/dist/cdn/shared-f4056083.js +1 -0
- package/dist/cdn/{shared-dbdc2a38.js → shared-f48ff40a.js} +1 -1
- package/dist/cdn/translations/gift-card-code-form/en.json +29 -0
- package/dist/cdn/translations/gift-card-form/en.json +25 -0
- package/dist/cdn/translations/store-shipping-method-form/en.json +8 -1
- package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js +5 -2
- package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js.map +1 -1
- package/dist/elements/internal/InternalControl/InternalControl.js +3 -2
- package/dist/elements/internal/InternalControl/InternalControl.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.d.ts +2 -0
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +12 -0
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/index.d.ts +5 -4
- package/dist/elements/public/GiftCardCodeForm/index.js +5 -4
- package/dist/elements/public/GiftCardCodeForm/index.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormTransactionControl/InternalGiftCardCodeFormTransactionControl.d.ts +5 -0
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormTransactionControl/InternalGiftCardCodeFormTransactionControl.js +50 -0
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormTransactionControl/InternalGiftCardCodeFormTransactionControl.js.map +1 -0
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormTransactionControl/index.d.ts +5 -0
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormTransactionControl/index.js +7 -0
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormTransactionControl/index.js.map +1 -0
- package/dist/elements/public/GiftCardForm/GiftCardForm.js +31 -0
- package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
- package/dist/elements/public/GiftCardForm/index.d.ts +1 -2
- package/dist/elements/public/GiftCardForm/index.js +1 -2
- package/dist/elements/public/GiftCardForm/index.js.map +1 -1
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/InternalGiftCardFormProvisioningControl.d.ts +14 -0
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/InternalGiftCardFormProvisioningControl.js +93 -0
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/InternalGiftCardFormProvisioningControl.js.map +1 -0
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/index.d.ts +6 -0
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/index.js +8 -0
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/index.js.map +1 -0
- package/dist/elements/public/NucleonElement/NucleonElement.d.ts +2 -1
- package/dist/elements/public/NucleonElement/NucleonElement.js +11 -8
- package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
- package/dist/elements/public/ShipmentCard/types.d.ts +2 -16
- package/dist/elements/public/ShipmentCard/types.js.map +1 -1
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.d.ts +2 -2
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js +78 -32
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js.map +1 -1
- package/dist/elements/public/index.d.ts +0 -1
- package/dist/elements/public/index.defined.d.ts +0 -1
- package/dist/elements/public/index.defined.js +0 -1
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +0 -1
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/configurable.js +16 -8
- package/dist/mixins/configurable.js.map +1 -1
- package/dist/mixins/inferrable.js +25 -23
- package/dist/mixins/inferrable.js.map +1 -1
- package/dist/mixins/themeable.js +56 -16
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +2 -2
- package/dist/cdn/foxy-store-shipping-method-card.js +0 -1
- package/dist/cdn/shared-16d10bca.js +0 -1
- package/dist/cdn/shared-29dd9d87.js +0 -1
- package/dist/cdn/shared-89dce718.js +0 -1
- package/dist/cdn/shared-fcdc4903.js +0 -1
- package/dist/cdn/translations/store-shipping-method-card/en.json +0 -15
- package/dist/elements/public/StoreShippingMethodCard/StoreShippingMethodCard.d.ts +0 -16
- package/dist/elements/public/StoreShippingMethodCard/StoreShippingMethodCard.js +0 -60
- package/dist/elements/public/StoreShippingMethodCard/StoreShippingMethodCard.js.map +0 -1
- package/dist/elements/public/StoreShippingMethodCard/index.d.ts +0 -6
- package/dist/elements/public/StoreShippingMethodCard/index.js +0 -8
- package/dist/elements/public/StoreShippingMethodCard/index.js.map +0 -1
- package/dist/elements/public/StoreShippingMethodCard/types.d.ts +0 -5
- package/dist/elements/public/StoreShippingMethodCard/types.js +0 -2
- package/dist/elements/public/StoreShippingMethodCard/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e,i as n,d as i,e as r,p as s,f as o,S as a,g as h,h as c,k as u,j as d,l,n as f,o as p,s as v,q as y,r as w,u as b,v as x,w as m,x as g,y as E,z as S,C as T,D as L,E as _,G as O,H as k,I as C,J as N,K as M,L as z,M as D,N as P,O as I,P as R}from"./shared-b772fbb1.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++},A=function(t,e){return j.set(t,e),t},X=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 B=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(k(t))return i.batch(t),i.state;var n=d(C(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===N.Parent||i.parent.id===n),s=r?i.parent:M(n)?i.children.get(n)||X(n):z(n)?n:void 0;if(s)"machine"in s?s.send(t(t({},e),{name:e.name===D?""+_(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,c=void 0!==h?h:e.id;this.id=c,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),b=w.next();!b.done;b=w.next()){(0,b.value)(t,t.event)}}catch(t){h={error:t}}finally{try{b&&!b.done&&(c=w.return)&&c.call(w)}finally{if(h)throw h.error}}try{for(var x=e(this.contextListeners),m=x.next();!m.done;m=x.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=x.return)&&d.call(x)}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;A(this.sessionId,this),this.initialized=!0,this.status=H.Running;var n=void 0===t?this.initialState:s(this,(function(){return o(t)?e.machine.resolveState(t):e.machine.resolveState(a.from(t,e.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){e.update(n,h)})),this},q.prototype.stop=function(){var t,n,i,r,s,o,a,h,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),b=w.next();!b.done;b=w.next()){(y=b.value)(),this.stopListeners.delete(y)}}catch(t){i={error:t}}finally{try{b&&!b.done&&(r=w.return)&&r.call(w)}finally{if(i)throw i.error}}try{for(var x=e(this.contextListeners),m=x.next();!m.done;m=x.next()){y=m.value;this.contextListeners.delete(y)}}catch(t){s={error:t}}finally{try{m&&!m.done&&(o=x.return)&&o.call(x)}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){a={error:t}}finally{try{E&&!E.done&&(h=g.return)&&h.call(g)}finally{if(a)throw a.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){c(t.stop)&&t.stop()}));try{for(var S=e(u(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=[],c=function(t){var e=d(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 u=e(t),l=u.next();!l.done;l=u.next()){c(l.value)}}catch(t){i={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}o.changed=a,o.actions=h,n.update(o,d(t[t.length-1]))}))},q.prototype.sender=function(t){return this.send.bind(this,t)},q.prototype.nextState=function(t){var e=this,n=d(t);if(0===n.name.indexOf(l)&&!this.state.nextEvents.some((function(t){return 0===t.indexOf(l)})))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||f(t.type,n),a=c(o)?o:o?o.exec:t.exec;if(a)try{return a(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 S:var h=t;if("number"==typeof h.delay)return void this.defer(h);h.to?this.sendTo(h._event,h.to):this.send(h._event);break;case E:this.cancel(t.sendId);break;case y:var u=t.activity;if(!this.state.activities[u.id||u.type])break;if(u.type===w.Invoke){var d=b(u.src),l=this.machine.options.services?this.machine.options.services[d.type]:void 0,T=u.id,L=u.data,_="autoForward"in u?u.autoForward:!!u.forward;if(!l)return;var O=L?i(L,r,s):void 0,k=c(l)?l(r,s.data,{data:O,src:d}):l;x(k)?this.spawnPromise(Promise.resolve(k),T):c(k)?this.spawnCallback(k,T):m(k)?this.spawnObservable(k,T):g(k)&&this.spawnMachine(O?k.withContext(O):k,{id:T,autoForward:_})}else this.spawnActivity(u);break;case v:this.stopChild(t.activity.id);break;case p: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),c(e.stop)&&e.stop())},q.prototype.spawn=function(e,n,i){if(x(e))return this.spawnPromise(Promise.resolve(e),n);if(c(e))return this.spawnCallback(e,n);if(T(e))return this.spawnActor(e);if(m(e))return this.spawnObservable(e,n);if(g(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(L,{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(d(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(d(r(e,t),{origin:e})))}),(function(t){if(!i){n.removeChild(e);var r=_(e,t);try{n.send(d(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(d(t,{origin:e}))}),(function(t){s.add(t)}))}catch(t){this.send(_(e,t))}if(x(n))return this.spawnPromise(n,e);var a={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,c(n)&&n()},toJSON:function(){return{id:e}}};return this.children.set(e,a),a},q.prototype.spawnObservable=function(t,e){var n=this,i=t.subscribe((function(t){n.send(d(t,{origin:e}))}),(function(t){n.removeChild(e),n.send(d(_(e,t),{origin:e}))}),(function(){n.removeChild(e),n.send(d(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[O]=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=Q,q}();function Q(t,e){return new B(t,e)}export{Q as i};
|
|
1
|
+
import{_ as t,c as e,i as n,d as i,e as r,p as s,f as o,S as a,g as h,h as c,k as u,j as d,l,n as f,o as p,s as v,q as y,r as w,u as x,v as b,w as m,x as g,y as E,z as S,C as T,D as L,E as _,G as O,H as k,I as C,J as N,K as M,L as z,M as D,N as P,O as I,P as R}from"./shared-3a7cf739.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++},A=function(t,e){return j.set(t,e),t},X=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 B=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(k(t))return i.batch(t),i.state;var n=d(C(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===N.Parent||i.parent.id===n),s=r?i.parent:M(n)?i.children.get(n)||X(n):z(n)?n:void 0;if(s)"machine"in s?s.send(t(t({},e),{name:e.name===D?""+_(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,c=void 0!==h?h:e.id;this.id=c,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;A(this.sessionId,this),this.initialized=!0,this.status=H.Running;var n=void 0===t?this.initialState:s(this,(function(){return o(t)?e.machine.resolveState(t):e.machine.resolveState(a.from(t,e.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){e.update(n,h)})),this},q.prototype.stop=function(){var t,n,i,r,s,o,a,h,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){a={error:t}}finally{try{E&&!E.done&&(h=g.return)&&h.call(g)}finally{if(a)throw a.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){c(t.stop)&&t.stop()}));try{for(var S=e(u(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=[],c=function(t){var e=d(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 u=e(t),l=u.next();!l.done;l=u.next()){c(l.value)}}catch(t){i={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}o.changed=a,o.actions=h,n.update(o,d(t[t.length-1]))}))},q.prototype.sender=function(t){return this.send.bind(this,t)},q.prototype.nextState=function(t){var e=this,n=d(t);if(0===n.name.indexOf(l)&&!this.state.nextEvents.some((function(t){return 0===t.indexOf(l)})))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||f(t.type,n),a=c(o)?o:o?o.exec:t.exec;if(a)try{return a(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 S:var h=t;if("number"==typeof h.delay)return void this.defer(h);h.to?this.sendTo(h._event,h.to):this.send(h._event);break;case E:this.cancel(t.sendId);break;case y:var u=t.activity;if(!this.state.activities[u.id||u.type])break;if(u.type===w.Invoke){var d=x(u.src),l=this.machine.options.services?this.machine.options.services[d.type]:void 0,T=u.id,L=u.data,_="autoForward"in u?u.autoForward:!!u.forward;if(!l)return;var O=L?i(L,r,s):void 0,k=c(l)?l(r,s.data,{data:O,src:d}):l;b(k)?this.spawnPromise(Promise.resolve(k),T):c(k)?this.spawnCallback(k,T):m(k)?this.spawnObservable(k,T):g(k)&&this.spawnMachine(O?k.withContext(O):k,{id:T,autoForward:_})}else this.spawnActivity(u);break;case v:this.stopChild(t.activity.id);break;case p: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),c(e.stop)&&e.stop())},q.prototype.spawn=function(e,n,i){if(b(e))return this.spawnPromise(Promise.resolve(e),n);if(c(e))return this.spawnCallback(e,n);if(T(e))return this.spawnActor(e);if(m(e))return this.spawnObservable(e,n);if(g(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(L,{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(d(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(d(r(e,t),{origin:e})))}),(function(t){if(!i){n.removeChild(e);var r=_(e,t);try{n.send(d(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(d(t,{origin:e}))}),(function(t){s.add(t)}))}catch(t){this.send(_(e,t))}if(b(n))return this.spawnPromise(n,e);var a={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,c(n)&&n()},toJSON:function(){return{id:e}}};return this.children.set(e,a),a},q.prototype.spawnObservable=function(t,e){var n=this,i=t.subscribe((function(t){n.send(d(t,{origin:e}))}),(function(t){n.removeChild(e),n.send(d(_(e,t),{origin:e}))}),(function(){n.removeChild(e),n.send(d(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[O]=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=Q,q}();function Q(t,e){return new B(t,e)}export{Q as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as t}from"./shared-
|
|
1
|
+
import{h as t}from"./shared-833a8b4e.js";import{T as e}from"./shared-07834676.js";import{D as l}from"./shared-b4865438.js";const r=t`<dom-module id="lumo-email-field" theme-for="vaadin-email-field">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:not(*):placeholder-shown, /* to prevent broken styles on IE */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-spinner.js";import{T as e}from"./shared-
|
|
1
|
+
import"./foxy-spinner.js";import{T as e}from"./shared-b4865438.js";import{N as i}from"./shared-d4d44ca4.js";import{c as s}from"./shared-4e709717.js";import{h as t}from"./shared-7f33a83a.js";let n,r,a=e=>e;class o extends(e(i)){renderBody(){return t(n||(n=a``))}render(){return t(r||(r=a` <div aria-busy="${0}" aria-live="polite" class="relative leading-m text-body text-m font-lumo"> <div class="${0}"> ${0} </div> <div class="${0}"> <foxy-spinner layout="${0}" state="${0}" class="m-auto" infer="spinner"> </foxy-spinner> </div> </div> `),this.in("busy"),s({"transition duration-500 ease-in-out":!0,"opacity-0 pointer-events-none":!this.in({idle:"snapshot"})}),this.renderBody(),s({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in({idle:"snapshot"})}),this.in("busy")?"no-label":"horizontal",this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy")}}customElements.define("foxy-internal-card",o);export{o as I};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as e,D as t,E as i,C as s}from"./shared-
|
|
1
|
+
import{T as e,D as t,E as i,C as s}from"./shared-ea418c18.js";import{h as o,P as n,D as r,t as a,a as l,p as h,i as d,e as c,y as u,z as _}from"./shared-833a8b4e.js";import"./shared-07834676.js";import{t as m,m as p,F as v,P as f,f as g,d as y,O as b,D as I,a as x}from"./shared-09d39b25.js";import{u as w}from"./shared-b4865438.js";
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import{C as e}from"./shared-1971bbbd.js";import{T as t,D as r}from"./shared-ea418c18.js";import"./shared-07834676.js";import{h as o,P as a}from"./shared-833a8b4e.js";import{F as s}from"./shared-09d39b25.js";import{I as l}from"./shared-296f4621.js";import"./shared-8ec9793b.js";import{_ as i}from"./shared-ca0f14c1.js";import{i as h}from"./shared-d3bf9ac0.js";import{h as d}from"./shared-7f33a83a.js";const n=o`<dom-module id="lumo-checkbox-group" theme-for="vaadin-checkbox-group">
|
|
2
|
+
<template>
|
|
3
|
+
<style include="lumo-required-field">
|
|
4
|
+
:host {
|
|
5
|
+
color: var(--lumo-body-text-color);
|
|
6
|
+
font-size: var(--lumo-font-size-m);
|
|
7
|
+
font-family: var(--lumo-font-family);
|
|
8
|
+
-webkit-font-smoothing: antialiased;
|
|
9
|
+
-moz-osx-font-smoothing: grayscale;
|
|
10
|
+
-webkit-tap-highlight-color: transparent;
|
|
11
|
+
padding: var(--lumo-space-xs) 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host::before {
|
|
15
|
+
height: var(--lumo-size-m);
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host([theme~="vertical"]) [part="group-field"] {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[part="label"] {
|
|
27
|
+
padding-bottom: 0.7em;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([disabled]) [part="label"] {
|
|
31
|
+
color: var(--lumo-disabled-text-color);
|
|
32
|
+
-webkit-text-fill-color: var(--lumo-disabled-text-color);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([focused]:not([disabled])) [part="label"] {
|
|
36
|
+
color: var(--lumo-primary-text-color);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host(:hover:not([disabled]):not([focused])) [part="label"],
|
|
40
|
+
:host(:hover:not([disabled]):not([focused])) [part="helper-text"],
|
|
41
|
+
:host(:hover:not([disabled]):not([focused])) [part="helper-text"] ::slotted(*) {
|
|
42
|
+
color: var(--lumo-body-text-color);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([has-helper]) [part="helper-text"]::before {
|
|
46
|
+
content: "";
|
|
47
|
+
display: block;
|
|
48
|
+
height: 0.4em;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[part="helper-text"],
|
|
52
|
+
[part="helper-text"] ::slotted(*) {
|
|
53
|
+
display: block;
|
|
54
|
+
color: var(--lumo-secondary-text-color);
|
|
55
|
+
font-size: var(--lumo-font-size-xs);
|
|
56
|
+
line-height: var(--lumo-line-height-xs);
|
|
57
|
+
margin-left: calc(var(--lumo-border-radius-m) / 4);
|
|
58
|
+
transition: color 0.2s;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* helper-text position */
|
|
62
|
+
|
|
63
|
+
:host([has-helper][theme~="helper-above-field"]) [part="helper-text"]::before {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([has-helper][theme~="helper-above-field"]) [part="helper-text"]::after {
|
|
68
|
+
content: "";
|
|
69
|
+
display: block;
|
|
70
|
+
height: 0.4em;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([has-helper][theme~="helper-above-field"]) [part="label"] {
|
|
74
|
+
order: 0;
|
|
75
|
+
padding-bottom: 0.4em;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([has-helper][theme~="helper-above-field"]) [part="helper-text"] {
|
|
79
|
+
order: 1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:host([has-helper][theme~="helper-above-field"]) [part="group-field"] {
|
|
83
|
+
order: 2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:host([has-helper][theme~="helper-above-field"]) [part="error-message"] {
|
|
87
|
+
order: 3;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Touch device adjustment */
|
|
91
|
+
@media (pointer: coarse) {
|
|
92
|
+
:host(:hover:not([disabled]):not([focused])) [part="label"] {
|
|
93
|
+
color: var(--lumo-secondary-text-color);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
97
|
+
</template>
|
|
98
|
+
</dom-module>`;document.head.appendChild(n.content);
|
|
99
|
+
/**
|
|
100
|
+
@license
|
|
101
|
+
Copyright (c) 2017 Vaadin Ltd.
|
|
102
|
+
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
103
|
+
*/
|
|
104
|
+
class c extends(t(r(a))){static get template(){return o`
|
|
105
|
+
<style>
|
|
106
|
+
:host {
|
|
107
|
+
display: inline-flex;
|
|
108
|
+
|
|
109
|
+
/* Prevent horizontal overflow in IE 11 instead of wrapping checkboxes */
|
|
110
|
+
max-width: 100%;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host::before {
|
|
114
|
+
content: "\\2003";
|
|
115
|
+
width: 0;
|
|
116
|
+
display: inline-block;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:host([hidden]) {
|
|
120
|
+
display: none !important;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.vaadin-group-field-container {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
|
|
127
|
+
/* Prevent horizontal overflow in IE 11 instead of wrapping checkboxes */
|
|
128
|
+
width: 100%;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
[part="label"]:empty {
|
|
132
|
+
display: none;
|
|
133
|
+
}
|
|
134
|
+
</style>
|
|
135
|
+
|
|
136
|
+
<div class="vaadin-group-field-container">
|
|
137
|
+
<label part="label">[[label]]</label>
|
|
138
|
+
|
|
139
|
+
<div part="group-field">
|
|
140
|
+
<slot id="slot"></slot>
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<div part="helper-text" aria-live="assertive" aria-hidden\$="[[_getHelperTextAriaHidden(helperText, _hasSlottedHelper)]]">
|
|
144
|
+
<slot name="helper">[[helperText]]</slot>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div part="error-message" aria-live="assertive" aria-hidden\$="[[_getErrorMessageAriaHidden(invalid, errorMessage)]]">[[errorMessage]]</div>
|
|
148
|
+
|
|
149
|
+
</div>
|
|
150
|
+
`}static get is(){return"vaadin-checkbox-group"}static get properties(){return{disabled:{type:Boolean,reflectToAttribute:!0,observer:"_disabledChanged"},label:{type:String,value:"",observer:"_labelChanged"},value:{type:Array,value:()=>[],notify:!0},errorMessage:{type:String,value:"",observer:"_errorMessageChanged"},helperText:{type:String,value:"",observer:"_helperTextChanged"},required:{type:Boolean,reflectToAttribute:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},_hasSlottedHelper:Boolean}}static get observers(){return["_updateValue(value, value.splices)"]}ready(){super.ready(),this.addEventListener("focusin",(()=>this._setFocused(this._containsFocus()))),this.addEventListener("focusout",(e=>{this._checkboxes.some((t=>e.relatedTarget===t||t.shadowRoot.contains(e.relatedTarget)))||(this.validate(),this._setFocused(!1))}));const e=e=>{this._changeSelectedCheckbox(e.target)};this._observer=new s(this,(t=>{const r=this._filterCheckboxes(t.addedNodes);r.forEach((t=>{t.addEventListener("checked-changed",e),this.disabled&&(t.disabled=!0),t.checked?this._addCheckboxToValue(t.value):this.value.indexOf(t.value)>-1&&(t.checked=!0)})),this._filterCheckboxes(t.removedNodes).forEach((t=>{t.removeEventListener("checked-changed",e),t.checked&&this._removeCheckboxFromValue(t.value)})),this._setOrToggleHasHelperAttribute();r.every((e=>{const{value:t}=e;return e.hasAttribute("value")||t&&"on"!==t}))||console.warn("Please add value attribute to all checkboxes in checkbox group")}))}validate(){return this.invalid=this.required&&0===this.value.length,!this.invalid}get _checkboxes(){return this._filterCheckboxes(this.querySelectorAll("*"))}_filterCheckboxes(t){return Array.from(t).filter((t=>t instanceof e))}_disabledChanged(e){this.setAttribute("aria-disabled",e),this._checkboxes.forEach((t=>t.disabled=e))}_addCheckboxToValue(e){-1===this.value.indexOf(e)&&(this.value=this.value.concat(e))}_removeCheckboxFromValue(e){this.value=this.value.filter((t=>t!==e))}_changeSelectedCheckbox(e){this._updatingValue||(e.checked?this._addCheckboxToValue(e.value):this._removeCheckboxFromValue(e.value))}_updateValue(e,t){0===e.length&&void 0===this._oldValue||(e.length?this.setAttribute("has-value",""):this.removeAttribute("has-value"),this._oldValue=e,this._updatingValue=!0,this._checkboxes.forEach((t=>{t.checked=e.indexOf(t.value)>-1})),this._updatingValue=!1,this.validate())}_labelChanged(e){this._setOrToggleAttribute("has-label",!!e)}_errorMessageChanged(e){this._setOrToggleAttribute("has-error-message",!!e)}_helperTextChanged(e){this._setOrToggleAttribute("has-helper",!!e)}_setOrToggleAttribute(e,t){e&&(t?this.setAttribute(e,"boolean"==typeof t?"":t):this.removeAttribute(e))}_getErrorMessageAriaHidden(e,t){return(!t||!e).toString()}_containsFocus(){const e=this.getRootNode(),t=void 0!==e._activeElement?e._activeElement:e.activeElement;return this.contains(t)}_setFocused(e){e?this.setAttribute("focused",""):this.removeAttribute("focused")}_setOrToggleHasHelperAttribute(){const e=this.shadowRoot.querySelector('[name="helper"]').assignedNodes();this._hasSlottedHelper=e.filter((e=>3!==e.nodeType)).length>0,this._setOrToggleAttribute("has-helper",this._hasSlottedHelper?"slotted":!!this.helperText)}_getHelperTextAriaHidden(e,t){return(!(e||t)).toString()}}customElements.define(c.is,c);let u,p,b=e=>e;customElements.define("foxy-internal-checkbox-group-control",class extends l{constructor(){super(...arguments),this.options=[],this.theme=null}static get properties(){return i(i({},super.properties),{},{options:{type:Array},theme:{type:String}})}renderControl(){var e;return d(u||(u=b` <vaadin-checkbox-group error-message="${0}" helper-text="${0}" label="${0}" class="w-full" theme="${0}" ?disabled="${0}" .checkValidity="${0}" .value="${0}" @change="${0}"> ${0} </vaadin-checkbox-group> `),h(this._errorMessage),this.helperText,this.label,h(null!==(e=this.theme)&&void 0!==e?e:void 0),this.disabled||this.readonly,this._checkValidity,this._value,(e=>{const t=e.currentTarget;this._value=t.value}),this.options.map((e=>d(p||(p=b` <vaadin-checkbox value="${0}"> <foxy-i18n infer="" key="${0}"></foxy-i18n> </vaadin-checkbox> `),e.value,e.label))))}});
|
|
@@ -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 it={};class nt extends X{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&&!Y){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return et(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?Y?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!==it&&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 it}}nt.finalized=!0,nt.render=(t,e,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const n=i.scopeName,r=q.has(e),o=F&&11===e.nodeType&&!!e.host,a=o&&!D.has(n),l=a?document.createDocumentFragment():e;if(L(t,l,Object.assign({templateFactory:z(n)},i)),a){const t=q.get(l);q.delete(l);const i=t.value instanceof S?t.value.template:void 0;J(n,l,i),s(e,e.firstChild),e.appendChild(l),q.set(e,t)}!r&&o&&window.ShadyCSS.styleElement(e.host)},nt.shadowRootOptions={mode:"open"};export{T as A,E as B,tt as C,R as E,nt as L,A as N,U as P,o as T,b as a,h as b,st as c,_ as d,e,
|
|
159
|
+
(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const it={};class nt extends X{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&&!Y){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return et(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?Y?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!==it&&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 it}}nt.finalized=!0,nt.render=(t,e,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const n=i.scopeName,r=q.has(e),o=F&&11===e.nodeType&&!!e.host,a=o&&!D.has(n),l=a?document.createDocumentFragment():e;if(L(t,l,Object.assign({templateFactory:z(n)},i)),a){const t=q.get(l);q.delete(l);const i=t.value instanceof S?t.value.template:void 0;J(n,l,i),s(e,e.firstChild),e.appendChild(l),q.set(e,t)}!r&&o&&window.ShadyCSS.styleElement(e.host)},nt.shadowRootOptions={mode:"open"};export{T as A,E as B,tt as C,R as E,nt as L,A as N,U as P,o as T,b as a,h as b,st as c,_ as d,s as e,L as f,j as h,i as m,y as n,e as r,H as s,$ as t,et as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as t}from"./shared-
|
|
1
|
+
import{_ as t}from"./shared-ca0f14c1.js";import{T as e}from"./shared-85bcfcde.js";import{a as s}from"./shared-b4865438.js";import{p as a}from"./shared-ebb63c77.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:last_transaction"],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-semibold text-m font-tnum"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as t,r as e,e as n,g as r,f as i,h as s,o,b as a,p as l,j as c,k as d,m as h,c as u,n as p,q as _,s as f,t as m,v as y}from"./shared-
|
|
1
|
+
import{D as t,r as e,e as n,g as r,f as i,h as s,o,b as a,p as l,j as c,k as d,m as h,c as u,n as p,q as _,s as f,t as m,v as y}from"./shared-b4865438.js";
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e}from"./shared-
|
|
1
|
+
import{_ as e}from"./shared-ca0f14c1.js";import{h as t}from"./shared-7f33a83a.js";import{C as l}from"./shared-240700a9.js";import"./foxy-nucleon-element.js";import{R as s,T as a,a as i}from"./shared-b4865438.js";import{c as r}from"./shared-4e709717.js";import{N as d}from"./shared-d4d44ca4.js";let n,o,h,c,m,u=e=>e;const p=l(s(a(i(d))));class b extends p{constructor(){super(...arguments),this.templates={},this.columns=[]}static get properties(){return e(e({},super.properties),{},{columns:{attribute:!1}})}render(){var e,l;const s=this.columns.some((e=>!!e.header));return t(n||(n=u` <div data-testid="wrapper" aria-busy="${0}" aria-live="polite" class="relative font-lumo text-m"> <table class="table-fixed w-full" data-testid="table"> <thead class="${0}"> <tr> ${0} </tr> </thead> <tbody class="divide-y divide-contrast-10"> ${0} </tbody> </table> ${0} </div> ${0} `),this.in("busy"),s?"border-b border-contrast-10":"sr-only",this.columns.map(((e,l)=>{var s;return t(o||(o=u` <th class="${0}"> ${0} </th> `),r({"truncate h-l text-tertiary text-m text-left font-medium":!0,"text-right":l===this.columns.length-1,"hidden sm-table-cell":"sm"===e.hideBelow,"hidden md-table-cell":"md"===e.hideBelow,"hidden lg-table-cell":"lg"===e.hideBelow,"hidden xl-table-cell":"xl"===e.hideBelow}),null===(s=e.header)||void 0===s?void 0:s.call(e,{html:t,lang:this.lang,data:this.data,ns:this.ns}))})),this.__rows.map((e=>{var l;return t(h||(h=u` <tr class="h-l"> ${0} </tr> `),null===(l=this.columns)||void 0===l?void 0:l.map(((l,s)=>{var a;return t(c||(c=u` <td class="${0}"> ${0} </td> `),r({"text-right":s===this.columns.length-1,"hidden sm-table-cell":"sm"===l.hideBelow,"hidden md-table-cell":"md"===l.hideBelow,"hidden lg-table-cell":"lg"===l.hideBelow,"hidden xl-table-cell":"xl"===l.hideBelow,"truncate h-l text-body":!0}),e?null===(a=l.cell)||void 0===a?void 0:a.call(l,{html:t,lang:this.lang,data:e,ns:this.ns}):"")})))})),this.in({idle:"snapshot"})?"":t(m||(m=u` <div class="absolute inset-0 flex items-center justify-center"> <foxy-spinner data-testid="spinner" layout="vertical" state="${0}" class="p-m bg-base shadow-xs rounded-t-l rounded-b-l" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> `),this.in("busy")?"busy":this.in("idle")?"empty":"error",this.lang,this.ns,null!==(l=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==l?l:""),this.renderTemplateOrSlot())}get __rows(){var e,t,l;const s=Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e._embedded)&&void 0!==t?t:{}).reduce(((e,t)=>[...e,...t]),[]);let a;if(0===s.length)try{const e=new URL(null!==(l=this.href)&&void 0!==l?l:"").searchParams.get("limit"),t=parseInt(null!=e?e:"");a=isNaN(t)?20:t}catch(e){a=20}else a=s.length;return new Array(a).fill(null).map(((e,t)=>{var l;return null!==(l=s[t])&&void 0!==l?l:e}))}}export{b as T};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-44f45339.js";import"./shared-09d39b25.js";import{_ as e,I as l}from"./shared-ca0f14c1.js";import{s as t,h as n,c as a,L as s}from"./shared-7f33a83a.js";import{o}from"./shared-e6f3e9f0.js";import{c as i}from"./shared-4e709717.js";import{i as r}from"./shared-d3bf9ac0.js";import{s as d}from"./shared-2061be9a.js";import{r as u}from"./shared-d519a301.js";import{R as c,T as v,a as p}from"./shared-b4865438.js";var f,h;!function(e){e.Attribute="attribute",e.Boolean="boolean",e.String="string",e.Number="number",e.Date="date",e.Any="any"}(f||(f={})),function(e){e.LessThanOrEqual="lessthanorequal",e.LessThan="lessthan",e.GreaterThanOrEqual="greaterthanorequal",e.GreaterThan="greaterthan",e.IsDefined="isdefined",e.Not="not",e.In="in"}(h||(h={}));let g;const C=t(g||(g=(e=>e)`
|
|
2
2
|
<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
3
|
<path d="M26.4 14.7399C26.4 15.2922 25.9523 15.7399 25.4 15.7399H10.6C10.0477 15.7399 9.60001 15.2922 9.60001 14.7399V14.2C9.60001 13.6477 10.0477 13.2 10.6 13.2H25.4C25.9523 13.2 26.4 13.6477 26.4 14.2V14.7399ZM26.4 21.8C26.4 22.3523 25.9523 22.8 25.4 22.8H10.6C10.0477 22.8 9.60001 22.3523 9.60001 21.8V21.2601C9.60001 20.7078 10.0477 20.2601 10.6 20.2601H25.4C25.9523 20.2601 26.4 20.7078 26.4 21.2601V21.8Z" class="fill-current"/>
|
|
4
4
|
</svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e,_ as t}from"./shared-
|
|
1
|
+
import{I as e,_ as t}from"./shared-ca0f14c1.js";import{h as n,L as r}from"./shared-7f33a83a.js";import{i as s,a}from"./shared-b4865438.js";import{F as i,A as o}from"./shared-3a7cf739.js";const c={type:"backend",init:()=>{},read:(e,t,n)=>{const r=async e=>{const t=e.ok?null:new Error(await e.text()),r=!!e.ok&&await e.json();n(t,r)},s=e=>{const t=e instanceof Error?e:new Error(String(e));n(t,!1)},a=new i("fetch",{cancelable:!0,composed:!0,bubbles:!0,request:new o.WHATWGRequest(`foxy://i18n/${t}/${e}`),resolve:r,reject:s});dispatchEvent(a),a.defaultPrevented||fetch(a.request).then(r).catch(s)},create:()=>{throw new Error("foxy-i18n does not support resource creation")}};function l(e,t=!1){var n;const r=e.replace(/(y|m|w|d)/,""),s=e.replace(/\.?\d+/,"");return{count:".5"===r?.5:parseInt(r),units:t&&null!==(n={y:"year",m:"month",w:"week",d:"day"}[s])&&void 0!==n?n:s}}const u={discount:({ns:e,type:t,details:n},r,s)=>{const a=t.endsWith("_percentage")?.01:1,i=n.split("|"),o=`${["allunits","incremental","repeat","single"].includes(i[0])?i.shift():"single"}_${t}_discount_summary`;return i.map((t=>{var n,r;const s=null!==(r=null===(n=/[-+]/.exec(t))||void 0===n?void 0:n.index)&&void 0!==r?r:-1,i=parseFloat(t.substring(s))*a,c=parseFloat(t.substring(0,s));return`$t(${o}, ${JSON.stringify({adjustment:i,from:c,ns:e})})`})).join("; ")},relative:(e,t,n)=>{const r=new Intl.RelativeTimeFormat(n);let{count:s,units:a}=l(e,!0);return.5===s&&"month"===a&&(s=2,a="week"),r.format(s,a)},percent:(e,t,n)=>{let r=null;try{"number"==typeof e&&(r=e.toLocaleString(n,{style:"percent"}))}catch(e){console.warn(`i18next formatter error: ${e.message}`)}return r||String(e)},ordinal:(e,t,n)=>`${e}$t(ordinal_${new Intl.PluralRules(n,{type:"ordinal"}).select(e)})`,price:(e,t,n,r)=>{var s;try{const[t,a]=e.split(" ");return parseFloat(t).toLocaleString(n,{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:null!==(s=null==r?void 0:r.currencyDisplay)&&void 0!==s?s:"symbol",style:"currency",currency:a})}catch(t){return e}},date:(e,t,n)=>{if(!e)return"$t(unknown)";const r=new Date(e),s=(new Date).getFullYear()===r.getFullYear()?void 0:"numeric";return r.toLocaleDateString(n,{month:"long",year:s,day:"numeric"})},time:(e,t,n)=>new Date(e).toLocaleTimeString(n,{hour:"numeric",minute:"numeric"})};let d,p=e=>e;class m extends(a(e(r),"")){constructor(){super(...arguments),this.options={},this.key=""}static onTranslationChange(e){const t=["initialized","loaded"],n=["removed","added"];return t.forEach((t=>m.i18next.on(t,e))),n.forEach((t=>m.i18next.store.on(t,e))),()=>{t.forEach((t=>m.i18next.off(t,e))),n.forEach((t=>m.i18next.store.off(t,e)))}}static onResourceFetch(e){const t=t=>{if(t instanceof i&&t.request.url.startsWith("foxy://i18n/")){const[n,r]=t.request.url.split("/").reverse();t.respondWith(e(r,n))}};return addEventListener("fetch",t),()=>removeEventListener("fetch",t)}static setGateways({values:e}){for(const t in e)this.i18next.addResource("en","gateways",`gateways.${t}`,e[t].name)}static get properties(){return t(t({},super.properties),{},{options:{type:Object},key:{type:String}})}connectedCallback(){super.connectedCallback(),this.__unsubscribe=m.onTranslationChange((()=>this.requestUpdate()))}render(){return n(d||(d=p`<span>${0}</span>`),this.t(this.key,t(t({},this.options),{},{lng:this.lang})))}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.__unsubscribe)||void 0===e||e.call(this)}}m.FetchEvent=i,m.i18next=s.createInstance().use(c),m.i18next.init({interpolation:{format:(e,t="",n="en",r={})=>t.split(" ").filter((e=>!!e.trim())).reduce(((e,t)=>{var s,a;return null!==(a=null===(s=u[t])||void 0===s?void 0:s.call(u,e,t,n,r))&&void 0!==a?a:e}),e),escapeValue:!1},fallbackLng:"en",fallbackNS:"shared",defaultNS:"shared",ns:["shared"]}),customElements.define("foxy-i18n",m);export{m as I,l as p};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e}from"./shared-
|
|
1
|
+
import{_ as e}from"./shared-ca0f14c1.js";import{a as t,E as s,T as i,C as n}from"./shared-ea418c18.js";import{T as r}from"./shared-07834676.js";import{O as o,I as a}from"./shared-63e71a69.js";import{h as l,D as d,t as A,P as h}from"./shared-833a8b4e.js";import{F as c,P as m,a as u}from"./shared-09d39b25.js";import{z as p,w as g,y as v}from"./shared-b4865438.js";import{c as _,L as y,h as b}from"./shared-7f33a83a.js";import{D as f}from"./shared-b4d0adff.js";class x extends CustomEvent{constructor(e){super("change",{detail:e})}}class w extends x{}const E=l`<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
@@ -311,4 +311,4 @@ const M=document.createElement("template");M.innerHTML="<custom-style>\n <style
|
|
|
311
311
|
[part='items'] ::slotted(vaadin-item.dropdown-sub-item){
|
|
312
312
|
margin-left:var(--lumo-space-l);
|
|
313
313
|
}
|
|
314
|
-
`)));class $ extends b{constructor(){super(),this.disabled=!1,this.label="",this.value=null,this.items=null,this.getText=e=>e,this.__unexistentValue=`@foxy.io/elements#dropdown-${Math.random().toFixed(16).substr(2)}`,this.__renderedItems={},this.__list=document.createElement("vaadin-list-box")}static get properties(){return e(e({},super.properties),{},{disabled:{type:Boolean},getText:{type:Object,attribute:!1},items:{type:Array},label:{type:String},value:{type:String}})}static get styles(){return g.styles}render(){return y(q||(q=O` <vaadin-select class="w-full ${0}" data-testid="select" .label="${0}" .value="${0}" .disabled="${0}" .renderer="${0}" @change="${0}"> </vaadin-select> `),this.label?"-mt-m":"",this.label,null===this.value?this.__unexistentValue:this.value,this.disabled,this.__renderItems.bind(this),this.__handleChange)}__renderItems(e){var t;let s=e.querySelector("vaadin-list-box");null===s&&(e.appendChild(this.__list),s=this.__list);for(const e of Object.values(this.__renderedItems))e.dataset.keep="";const i=null!==(t=this.items)&&void 0!==t?t:[];for(let e=0;e<i.length;++e)if("string"==typeof i[e])this.__addOrKeepItem(i[e],i[e],s).classList.add("dropdown-item");else if(Array.isArray(i[e])){const t=this.__addOrKeepItem(i[e][0],i[e][0],s);t.classList.add("dropdown-item","dropdown-divisor"),t.disabled=!0;for(const t of i[e][1])this.__addOrKeepItem(i[e][0]+": "+t,t,s).classList.add("dropdown-sub-item")}for(const e of Object.values(this.__renderedItems)){const t=e;t.dataset.keep||(e.remove(),delete this.__renderedItems[t.dataset.trackId])}}__addOrKeepItem(e,t,s){let i;return this.__renderedItems[e]?i=this.__renderedItems[e]:(i=document.createElement("vaadin-item"),this.__renderedItems[e]=i,i.value=e,s.appendChild(i)),i.dataset.keep="true",i.dataset.trackId=e,i.textContent=this.getText(t),i}__handleChange(e){const t=e.target.value,s=t===this.__unexistentValue?null:t;this.dispatchEvent(new f(s))}}let P,j,H=e=>e;class V extends b{constructor(){super(...arguments),this.variant=null}static get styles(){return[g.styles,_(P||(P=H`@keyframes blink{from{opacity:.5}to{opacity:1}}.animated{animation:blink .5s infinite alternate}:host{display:inline-block;min-width:4rem}`))]}static get properties(){return e(e({},super.properties),{},{variant:{type:String}})}render(){const e="error"===this.variant?"bg-error-10":"bg-contrast-10",t=null===this.variant?"animated":"";return y(j||(j=H` <div class="relative"> <span class="opacity-0"><slot></slot></span> <div class="${0} ${0} rounded my-xs absolute inset-0"></div> </div> `),e,t)}}let N,z,K,F=e=>e;class G extends v{constructor(){super(...arguments),this.key=""}static get scopedElements(){return{"x-skeleton":V}}static get properties(){return e(e({},super.properties),{},{key:{type:String,reflect:!0},opts:{type:Object}})}static get styles(){return[super.styles,_(N||(N=F`:host{display:inline-block}`))]}get whenReady(){return this._whenI18nReady.then((()=>this.updateComplete))}render(){return this._isI18nReady?y(z||(z=F`${0}<slot></slot>`),this._t(this.key,this.opts)):y(K||(K=F`<x-skeleton class="block">${0}<slot></slot></x-skeleton>`),this.key)}}function W(...e){return e.filter((e=>!!e))}let U,Y,J,Z,X=e=>e;class ee extends v{constructor(){super(...arguments),this.disabled=!1,this.value=[]}static get scopedElements(){return{"x-i18n":G}}static get properties(){return e(e({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=ee._allDays.map((e=>{try{return e.toLocaleString(this.lang,{minimumIntegerDigits:2})}catch(t){return e.toString()}}));return y(U||(U=X` <div class="space-y-s"> <div class="flex flex-wrap -mx-xs -mb-xs" style="max-width:364px;font-feature-settings:'tnum' 1"> ${0} </div> ${0} </div> `),ee._allDays.map(((t,s)=>y(Y||(Y=X` <label class="${0}"> ${0} <input type="checkbox" class="sr-only" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> `),this._getLabelClass(t),e[s],this.disabled,this.value.includes(t),(e=>this._handleChange(e,t))))),W(this.value.length>0&&y(J||(J=X` <p class="text-s text-tertiary leading-s"> <x-i18n key="monthday-picker.hint" .opts="${0}" .lang="${0}"> </x-i18n> ${0} </p> `),{days:this.value},this.lang,W([29,30,31].some((e=>this.value.includes(e)))&&y(Z||(Z=X`<x-i18n key="monthday-picker.warning" .lang="${0}"></x-i18n>`),this.lang)))))}_getLabelClass(e){let t="flex items-center justify-center m-xs p-s rounded text-m font-medium transition duration-200 sm-p-0 sm-h-m sm-w-l ";return this.value.includes(e)||(t+="bg-contrast-5 "),this._isI18nReady&&!this.disabled?(t+="cursor-pointer ",t+=this.value.includes(e)?"text-base ":"hover-bg-primary-10 ",e<29?(t+="focus-within-shadow-outline ",t+=this.value.includes(e)?"bg-primary":"text-body"):(t+="focus-within-shadow-outline-error ",t+=this.value.includes(e)?"bg-error":"text-error")):(t+="text-transparent ",this.value.includes(e)&&(t+=e<29?"bg-primary-50":"bg-error-10")),t}_handleChange(e,t){e.stopPropagation(),this._toggle(t),this._sendChange()}_sendChange(){this.dispatchEvent(new x(this.value))}_toggle(e){const t=this.value.indexOf(e);this.value=-1===t?[...this.value,e]:this.value.filter(((e,s)=>s!==t))}}ee._allDays=Array.from(new Array(31),((e,t)=>t+1));const te=document.createElement("template");function se(e,t,s="long"){const i=new Date;for(;i.getDay()!==e;)i.setDate(i.getDate()+1);return i.toLocaleDateString(t,{weekday:s})}te.innerHTML='<dom-module id="lumo-badge">\n <template>\n <style>\n [theme~="badge"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n padding: 0.4em calc(0.5em + var(--lumo-border-radius-s) / 4);\n color: var(--lumo-primary-text-color);\n background-color: var(--lumo-primary-color-10pct);\n border-radius: var(--lumo-border-radius-s);\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size-s);\n line-height: 1;\n font-weight: 500;\n text-transform: initial;\n letter-spacing: initial;\n min-width: calc(var(--lumo-line-height-xs) * 1em + 0.45em);\n }\n\n /* Ensure proper vertical alignment */\n [theme~="badge"]::before {\n display: inline-block;\n content: "\\2003";\n width: 0;\n }\n\n [theme~="badge"][theme~="small"] {\n font-size: var(--lumo-font-size-xxs);\n line-height: 1;\n }\n\n /* Colors */\n\n [theme~="badge"][theme~="success"] {\n color: var(--lumo-success-text-color);\n background-color: var(--lumo-success-color-10pct);\n }\n\n [theme~="badge"][theme~="error"] {\n color: var(--lumo-error-text-color);\n background-color: var(--lumo-error-color-10pct);\n }\n\n [theme~="badge"][theme~="contrast"] {\n color: var(--lumo-contrast-80pct);\n background-color: var(--lumo-contrast-5pct);\n }\n\n /* Primary */\n\n [theme~="badge"][theme~="primary"] {\n color: var(--lumo-primary-contrast-color);\n background-color: var(--lumo-primary-color);\n }\n\n [theme~="badge"][theme~="success"][theme~="primary"] {\n color: var(--lumo-success-contrast-color);\n background-color: var(--lumo-success-color);\n }\n\n [theme~="badge"][theme~="error"][theme~="primary"] {\n color: var(--lumo-error-contrast-color);\n background-color: var(--lumo-error-color);\n }\n\n [theme~="badge"][theme~="contrast"][theme~="primary"] {\n color: var(--lumo-base-color);\n background-color: var(--lumo-contrast);\n }\n\n /* Links */\n\n [theme~="badge"][href]:hover {\n text-decoration: none;\n }\n\n /* Icon */\n\n [theme~="badge"] iron-icon {\n margin: -0.25em 0;\n --iron-icon-width: 1.5em;\n --iron-icon-height: 1.5em;\n }\n\n [theme~="badge"] iron-icon:first-child {\n margin-left: -0.375em;\n }\n\n [theme~="badge"] iron-icon:last-child {\n margin-right: -0.375em;\n }\n\n [theme~="badge"][icon] {\n min-width: 0;\n padding: 0;\n font-size: 1rem;\n --iron-icon-width: var(--lumo-icon-size-m);\n --iron-icon-height: var(--lumo-icon-size-m);\n }\n\n [theme~="badge"][icon][theme~="small"] {\n --iron-icon-width: var(--lumo-icon-size-s);\n --iron-icon-height: var(--lumo-icon-size-s);\n }\n\n /* Empty */\n\n [theme~="badge"]:not([icon]):empty {\n min-width: 0;\n width: 1em;\n height: 1em;\n padding: 0;\n border-radius: 50%;\n background-color: var(--lumo-primary-color);\n }\n\n [theme~="badge"][theme~="small"]:not([icon]):empty {\n width: 0.75em;\n height: 0.75em;\n }\n\n [theme~="badge"][theme~="contrast"]:not([icon]):empty {\n background-color: var(--lumo-contrast);\n }\n\n [theme~="badge"][theme~="success"]:not([icon]):empty {\n background-color: var(--lumo-success-color);\n }\n\n [theme~="badge"][theme~="error"]:not([icon]):empty {\n background-color: var(--lumo-error-color);\n }\n\n /* Pill */\n\n [theme~="badge"][theme~="pill"] {\n --lumo-border-radius-s: 1em;\n }\n\n /* RTL specific styles */\n\n [dir="rtl"][theme~="badge"] iron-icon:first-child {\n margin-right: -0.375em;\n margin-left: 0;\n }\n\n [dir="rtl"][theme~="badge"] iron-icon:last-child {\n margin-left: -0.375em;\n margin-right: 0;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(te.content);let ie,ne,re,oe=e=>e;class ae extends ee{render(){return y(ie||(ie=oe` <div class="space-y-s"> <div class="flex flex-wrap -mx-xs -mb-xs text-m uppercase"> ${0} </div> ${0} </div> `),ae._allDays.map((e=>y(ne||(ne=oe` <label class="${0}"> ${0} <input type="checkbox" class="sr-only" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> `),this._getLabelClass(e),se(e,this.lang,"short"),this.disabled||!this._isI18nReady,this.value.includes(e),(t=>this._handleChange(t,e))))),W(this.value.length>0&&y(re||(re=oe` <p class="text-s text-tertiary leading-s"> <x-i18n key="weekday-picker.hint" .lang="${0}" .opts="${0}"> </x-i18n> </p> `),this.lang,{days:this.value})))}_getLabelClass(e){let t="flex items-center justify-center m-xs h-m w-xl rounded font-medium transition duration-200 ";return this._isI18nReady&&!this.disabled?(t+="cursor-pointer focus-within-shadow-outline ",t+=this.value.includes(e)?"text-base bg-primary":"bg-contrast-5 hover-bg-contrast-10 text-body"):(t+="text-transparent ",t+=this.value.includes(e)?"bg-primary-50":"bg-contrast-5"),t}_sendChange(){this.dispatchEvent(new w(this.value))}}ae._allDays=new Array(7).fill(0).map(((e,t)=>t));export{$ as D,G as I,ee as M,V as S,ae as W,Q as a,W as c,se as t};
|
|
314
|
+
`)));class $ extends y{constructor(){super(),this.disabled=!1,this.label="",this.value=null,this.items=null,this.getText=e=>e,this.__unexistentValue=`@foxy.io/elements#dropdown-${Math.random().toFixed(16).substr(2)}`,this.__renderedItems={},this.__list=document.createElement("vaadin-list-box")}static get properties(){return e(e({},super.properties),{},{disabled:{type:Boolean},getText:{type:Object,attribute:!1},items:{type:Array},label:{type:String},value:{type:String}})}static get styles(){return g.styles}render(){return b(q||(q=O` <vaadin-select class="w-full ${0}" data-testid="select" .label="${0}" .value="${0}" .disabled="${0}" .renderer="${0}" @change="${0}"> </vaadin-select> `),this.label?"-mt-m":"",this.label,null===this.value?this.__unexistentValue:this.value,this.disabled,this.__renderItems.bind(this),this.__handleChange)}__renderItems(e){var t;let s=e.querySelector("vaadin-list-box");null===s&&(e.appendChild(this.__list),s=this.__list);for(const e of Object.values(this.__renderedItems))e.dataset.keep="";const i=null!==(t=this.items)&&void 0!==t?t:[];for(let e=0;e<i.length;++e)if("string"==typeof i[e])this.__addOrKeepItem(i[e],i[e],s).classList.add("dropdown-item");else if(Array.isArray(i[e])){const t=this.__addOrKeepItem(i[e][0],i[e][0],s);t.classList.add("dropdown-item","dropdown-divisor"),t.disabled=!0;for(const t of i[e][1])this.__addOrKeepItem(i[e][0]+": "+t,t,s).classList.add("dropdown-sub-item")}for(const e of Object.values(this.__renderedItems)){const t=e;t.dataset.keep||(e.remove(),delete this.__renderedItems[t.dataset.trackId])}}__addOrKeepItem(e,t,s){let i;return this.__renderedItems[e]?i=this.__renderedItems[e]:(i=document.createElement("vaadin-item"),this.__renderedItems[e]=i,i.value=e,s.appendChild(i)),i.dataset.keep="true",i.dataset.trackId=e,i.textContent=this.getText(t),i}__handleChange(e){const t=e.target.value,s=t===this.__unexistentValue?null:t;this.dispatchEvent(new f(s))}}let P,j,H=e=>e;class V extends y{constructor(){super(...arguments),this.variant=null}static get styles(){return[g.styles,_(P||(P=H`@keyframes blink{from{opacity:.5}to{opacity:1}}.animated{animation:blink .5s infinite alternate}:host{display:inline-block;min-width:4rem}`))]}static get properties(){return e(e({},super.properties),{},{variant:{type:String}})}render(){const e="error"===this.variant?"bg-error-10":"bg-contrast-10",t=null===this.variant?"animated":"";return b(j||(j=H` <div class="relative"> <span class="opacity-0"><slot></slot></span> <div class="${0} ${0} rounded my-xs absolute inset-0"></div> </div> `),e,t)}}let N,z,K,F=e=>e;class G extends v{constructor(){super(...arguments),this.key=""}static get scopedElements(){return{"x-skeleton":V}}static get properties(){return e(e({},super.properties),{},{key:{type:String,reflect:!0},opts:{type:Object}})}static get styles(){return[super.styles,_(N||(N=F`:host{display:inline-block}`))]}get whenReady(){return this._whenI18nReady.then((()=>this.updateComplete))}render(){return this._isI18nReady?b(z||(z=F`${0}<slot></slot>`),this._t(this.key,this.opts)):b(K||(K=F`<x-skeleton class="block">${0}<slot></slot></x-skeleton>`),this.key)}}function W(...e){return e.filter((e=>!!e))}let U,Y,J,Z,X=e=>e;class ee extends v{constructor(){super(...arguments),this.disabled=!1,this.value=[]}static get scopedElements(){return{"x-i18n":G}}static get properties(){return e(e({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=ee._allDays.map((e=>{try{return e.toLocaleString(this.lang,{minimumIntegerDigits:2})}catch(t){return e.toString()}}));return b(U||(U=X` <div class="space-y-s"> <div class="flex flex-wrap -mx-xs -mb-xs" style="max-width:364px;font-feature-settings:'tnum' 1"> ${0} </div> ${0} </div> `),ee._allDays.map(((t,s)=>b(Y||(Y=X` <label class="${0}"> ${0} <input type="checkbox" class="sr-only" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> `),this._getLabelClass(t),e[s],this.disabled,this.value.includes(t),(e=>this._handleChange(e,t))))),W(this.value.length>0&&b(J||(J=X` <p class="text-s text-tertiary leading-s"> <x-i18n key="monthday-picker.hint" .opts="${0}" .lang="${0}"> </x-i18n> ${0} </p> `),{days:this.value},this.lang,W([29,30,31].some((e=>this.value.includes(e)))&&b(Z||(Z=X`<x-i18n key="monthday-picker.warning" .lang="${0}"></x-i18n>`),this.lang)))))}_getLabelClass(e){let t="flex items-center justify-center m-xs p-s rounded text-m font-medium transition duration-200 sm-p-0 sm-h-m sm-w-l ";return this.value.includes(e)||(t+="bg-contrast-5 "),this._isI18nReady&&!this.disabled?(t+="cursor-pointer ",t+=this.value.includes(e)?"text-base ":"hover-bg-primary-10 ",e<29?(t+="focus-within-shadow-outline ",t+=this.value.includes(e)?"bg-primary":"text-body"):(t+="focus-within-shadow-outline-error ",t+=this.value.includes(e)?"bg-error":"text-error")):(t+="text-transparent ",this.value.includes(e)&&(t+=e<29?"bg-primary-50":"bg-error-10")),t}_handleChange(e,t){e.stopPropagation(),this._toggle(t),this._sendChange()}_sendChange(){this.dispatchEvent(new x(this.value))}_toggle(e){const t=this.value.indexOf(e);this.value=-1===t?[...this.value,e]:this.value.filter(((e,s)=>s!==t))}}ee._allDays=Array.from(new Array(31),((e,t)=>t+1));const te=document.createElement("template");function se(e,t,s="long"){const i=new Date;for(;i.getDay()!==e;)i.setDate(i.getDate()+1);return i.toLocaleDateString(t,{weekday:s})}te.innerHTML='<dom-module id="lumo-badge">\n <template>\n <style>\n [theme~="badge"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n padding: 0.4em calc(0.5em + var(--lumo-border-radius-s) / 4);\n color: var(--lumo-primary-text-color);\n background-color: var(--lumo-primary-color-10pct);\n border-radius: var(--lumo-border-radius-s);\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size-s);\n line-height: 1;\n font-weight: 500;\n text-transform: initial;\n letter-spacing: initial;\n min-width: calc(var(--lumo-line-height-xs) * 1em + 0.45em);\n }\n\n /* Ensure proper vertical alignment */\n [theme~="badge"]::before {\n display: inline-block;\n content: "\\2003";\n width: 0;\n }\n\n [theme~="badge"][theme~="small"] {\n font-size: var(--lumo-font-size-xxs);\n line-height: 1;\n }\n\n /* Colors */\n\n [theme~="badge"][theme~="success"] {\n color: var(--lumo-success-text-color);\n background-color: var(--lumo-success-color-10pct);\n }\n\n [theme~="badge"][theme~="error"] {\n color: var(--lumo-error-text-color);\n background-color: var(--lumo-error-color-10pct);\n }\n\n [theme~="badge"][theme~="contrast"] {\n color: var(--lumo-contrast-80pct);\n background-color: var(--lumo-contrast-5pct);\n }\n\n /* Primary */\n\n [theme~="badge"][theme~="primary"] {\n color: var(--lumo-primary-contrast-color);\n background-color: var(--lumo-primary-color);\n }\n\n [theme~="badge"][theme~="success"][theme~="primary"] {\n color: var(--lumo-success-contrast-color);\n background-color: var(--lumo-success-color);\n }\n\n [theme~="badge"][theme~="error"][theme~="primary"] {\n color: var(--lumo-error-contrast-color);\n background-color: var(--lumo-error-color);\n }\n\n [theme~="badge"][theme~="contrast"][theme~="primary"] {\n color: var(--lumo-base-color);\n background-color: var(--lumo-contrast);\n }\n\n /* Links */\n\n [theme~="badge"][href]:hover {\n text-decoration: none;\n }\n\n /* Icon */\n\n [theme~="badge"] iron-icon {\n margin: -0.25em 0;\n --iron-icon-width: 1.5em;\n --iron-icon-height: 1.5em;\n }\n\n [theme~="badge"] iron-icon:first-child {\n margin-left: -0.375em;\n }\n\n [theme~="badge"] iron-icon:last-child {\n margin-right: -0.375em;\n }\n\n [theme~="badge"][icon] {\n min-width: 0;\n padding: 0;\n font-size: 1rem;\n --iron-icon-width: var(--lumo-icon-size-m);\n --iron-icon-height: var(--lumo-icon-size-m);\n }\n\n [theme~="badge"][icon][theme~="small"] {\n --iron-icon-width: var(--lumo-icon-size-s);\n --iron-icon-height: var(--lumo-icon-size-s);\n }\n\n /* Empty */\n\n [theme~="badge"]:not([icon]):empty {\n min-width: 0;\n width: 1em;\n height: 1em;\n padding: 0;\n border-radius: 50%;\n background-color: var(--lumo-primary-color);\n }\n\n [theme~="badge"][theme~="small"]:not([icon]):empty {\n width: 0.75em;\n height: 0.75em;\n }\n\n [theme~="badge"][theme~="contrast"]:not([icon]):empty {\n background-color: var(--lumo-contrast);\n }\n\n [theme~="badge"][theme~="success"]:not([icon]):empty {\n background-color: var(--lumo-success-color);\n }\n\n [theme~="badge"][theme~="error"]:not([icon]):empty {\n background-color: var(--lumo-error-color);\n }\n\n /* Pill */\n\n [theme~="badge"][theme~="pill"] {\n --lumo-border-radius-s: 1em;\n }\n\n /* RTL specific styles */\n\n [dir="rtl"][theme~="badge"] iron-icon:first-child {\n margin-right: -0.375em;\n margin-left: 0;\n }\n\n [dir="rtl"][theme~="badge"] iron-icon:last-child {\n margin-left: -0.375em;\n margin-right: 0;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(te.content);let ie,ne,re,oe=e=>e;class ae extends ee{render(){return b(ie||(ie=oe` <div class="space-y-s"> <div class="flex flex-wrap -mx-xs -mb-xs text-m uppercase"> ${0} </div> ${0} </div> `),ae._allDays.map((e=>b(ne||(ne=oe` <label class="${0}"> ${0} <input type="checkbox" class="sr-only" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> `),this._getLabelClass(e),se(e,this.lang,"short"),this.disabled||!this._isI18nReady,this.value.includes(e),(t=>this._handleChange(t,e))))),W(this.value.length>0&&b(re||(re=oe` <p class="text-s text-tertiary leading-s"> <x-i18n key="weekday-picker.hint" .lang="${0}" .opts="${0}"> </x-i18n> </p> `),this.lang,{days:this.value})))}_getLabelClass(e){let t="flex items-center justify-center m-xs h-m w-xl rounded font-medium transition duration-200 ";return this._isI18nReady&&!this.disabled?(t+="cursor-pointer focus-within-shadow-outline ",t+=this.value.includes(e)?"text-base bg-primary":"bg-contrast-5 hover-bg-contrast-10 text-body"):(t+="text-transparent ",t+=this.value.includes(e)?"bg-primary-50":"bg-contrast-5"),t}_sendChange(){this.dispatchEvent(new w(this.value))}}ae._allDays=new Array(7).fill(0).map(((e,t)=>t));export{$ as D,G as I,ee as M,V as S,ae as W,Q as a,W as c,se as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-cbb340fa.js";import"./shared-8ec9793b.js";import{_ as t}from"./shared-ca0f14c1.js";import{h as e}from"./shared-7f33a83a.js";import{D as s}from"./shared-1c660ed1.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()}});
|