diff --git a/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/AbstractWebUiConfig.java b/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/AbstractWebUiConfig.java index 3d96c9a1ea2..5c776f50257 100644 --- a/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/AbstractWebUiConfig.java +++ b/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/AbstractWebUiConfig.java @@ -160,7 +160,7 @@ public AbstractWebUiConfig( this.independentTimeZone = independentTimeZone; this.masterActionOptions = masterActionOptions.orElse(ALL_OFF).name(); this.webUiBuilder = new WebUiBuilder(this); - this.dispatchingEmitter = new EventSourceDispatchingEmitter(); + this.dispatchingEmitter = new EventSourceDispatchingEmitter(this::appVersion); Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { logger.info("Closing Event Source Dispatching Emitter with all registered emitters..."); diff --git a/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/ApplicationConfigurationResource.java b/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/ApplicationConfigurationResource.java index 364a9e3431b..a6ea6a57edb 100644 --- a/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/ApplicationConfigurationResource.java +++ b/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/ApplicationConfigurationResource.java @@ -102,6 +102,9 @@ static LinkedHashMap buildConfiguration( // IDates uses 1–7 for Mon–Sun; JS date pickers use 0 for Sun, so convert accordingly. configs.put("firstDayOfWeek", dates.startOfWeek() % 7); configs.put("title", webUiConfig.title()); + // The version the client is loaded with, later compared against the server version. + // Server version is announced upon SSE (re)connection to detect a new deployment. + configs.put("appVersion", webUiConfig.appVersion()); configs.put("ideaUri", webUiConfig.ideaUri()); configs.put("panelColor", webUiConfig.mainPanelColor()); configs.put("watermark", webUiConfig.watermark()); diff --git a/platform-web-resources/src/main/java/ua/com/fielden/platform/web/sse/EventSourceDispatchingEmitter.java b/platform-web-resources/src/main/java/ua/com/fielden/platform/web/sse/EventSourceDispatchingEmitter.java index 31d09e68fda..06e4ee47d69 100644 --- a/platform-web-resources/src/main/java/ua/com/fielden/platform/web/sse/EventSourceDispatchingEmitter.java +++ b/platform-web-resources/src/main/java/ua/com/fielden/platform/web/sse/EventSourceDispatchingEmitter.java @@ -1,10 +1,11 @@ package ua.com.fielden.platform.web.sse; -import static java.lang.String.format; -import static org.apache.logging.log4j.LogManager.getLogger; -import static ua.com.fielden.platform.error.Result.failure; -import static ua.com.fielden.platform.error.Result.successful; -import static ua.com.fielden.platform.types.tuples.T2.t2; +import org.apache.commons.lang3.mutable.MutableBoolean; +import org.apache.logging.log4j.Logger; +import ua.com.fielden.platform.error.Result; +import ua.com.fielden.platform.security.user.User; +import ua.com.fielden.platform.types.tuples.T2; +import ua.com.fielden.platform.web.sse.exceptions.SseException; import java.io.IOException; import java.util.HashMap; @@ -15,49 +16,62 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Supplier; -import org.apache.logging.log4j.Logger; - -import ua.com.fielden.platform.error.Result; -import ua.com.fielden.platform.security.user.User; -import ua.com.fielden.platform.types.tuples.T2; -import ua.com.fielden.platform.web.sse.exceptions.SseException; +import static java.lang.String.format; +import static org.apache.logging.log4j.LogManager.getLogger; +import static org.apache.tika.utils.StringUtils.isBlank; +import static ua.com.fielden.platform.error.Result.failure; +import static ua.com.fielden.platform.error.Result.successful; +import static ua.com.fielden.platform.types.tuples.T2.t2; -/** - * {@link IEventSourceEmitter} implementation that acts as a dispatching emitter, which dispatches events to registered emitters. - * Every emitter is added on a request from a web client (every client makes such request), and is associated with a specific user and a unique identifier. - * There can potentially be multiple emitters for the same user. For example, a user who loads an application in 2 browser tabs would have 2 separate emitters associated with that user. - *

- * At this stage dispatching happens by means of broadcasting every event to all emitters. - * However, in the future, it is planned to support sending events to emitters, associated with specific users. - *

- * Another important role for this class, is to instantiate and register event sources that are specified at the level of Entity Centre configurations. - * All such event sources get connected to an instance of this class, which ensures that any emitter registered with this class will have events from all the event sources dispatched to them. - *

- * By design, there should be only a single instance of this class per application – one dispatching emitter per application. - * - * @author TG Team - * - */ +/// [IEventSourceEmitter] implementation that acts as a dispatching emitter, which dispatches events to registered emitters. +/// Every emitter is added on a request from a web client (every client makes such request), and is associated with a specific user and a unique identifier. +/// There can potentially be multiple emitters for the same user. +/// For example, a user who loads an application in 2 browser tabs would have 2 separate emitters associated with that user. +/// +/// At this stage dispatching happens by means of broadcasting every event to all emitters. +/// However, in the future, it is planned to support sending events to emitters, associated with specific users. +/// +/// Another important role for this class, is to instantiate and register event sources that are specified at the level of Entity Centre configurations. +/// All such event sources get connected to an instance of this class. +/// This ensures that any emitter registered with this class will have events from all the event sources dispatched to them. +/// +/// By design, there should be only a single instance of this class per application – one dispatching emitter per application. +/// public class EventSourceDispatchingEmitter implements IEventSourceEmitter, IEventSourceEmitterRegister { private static final Logger LOGGER = getLogger(EventSourceDispatchingEmitter.class); - /** - * A register of emitters. The key is a pair of user id and a client SSE id. - * {@link ConcurrentHashMap} is used as the register to support the concurrent nature of such register. - * It makes it thread-safe to register new emitters, close emitters and dispatch events to emitters concurrently. - */ + /// The name of the SSE event used to announce the current application version to a client upon establishing a connection. + /// The client (see `tg-event-source.js`) listens for an event with this exact name. + /// + public static final String APP_VERSION_EVENT_NAME = "application-version"; + + /// A register of emitters. The key is a pair of user id and a client SSE id. + /// [ConcurrentHashMap] is used as the register to support the concurrent nature of such register. + /// It makes it thread-safe to register new emitters, close emitters and dispatch events to emitters concurrently. + /// private final ConcurrentHashMap, IEventSourceEmitter> register = new ConcurrentHashMap<>(100); - /** - * Controls the state of this dispatching emitter of whether it is open for registration of new emitters and can dispatch events. - * This is required to ensure that no new emitters get registered and no new events are dispatched if the dispatcher was already closed or is being closed. - */ + /// Controls the state of this dispatching emitter of whether it is open for registration of new emitters and can dispatch events. + /// This is required to ensure that no new emitters get registered and no new events are dispatched if the dispatcher was already closed or is being closed. + /// private final AtomicBoolean isActive = new AtomicBoolean(true); - /** - * A helper function that creates a register key from {@code user} and {@code sseUid}. - */ + /// Supplies the current application version, announced to each client upon establishing an SSE connection. + /// A client uses this to detect that a newer application version has been deployed since it was loaded. + /// + private final Supplier appVersionSupplier; + + /// Creates a dispatching emitter. + /// + /// @param appVersionSupplier supplier of String-based version to be announced to each client upon establishing an SSE connection + /// + public EventSourceDispatchingEmitter(final Supplier appVersionSupplier) { + this.appVersionSupplier = appVersionSupplier; + } + + /// A helper function that creates a register key from `user` and `sseUid`. + /// private static T2 key(final User user, final String sseUid) { if (user == null) { throw new SseException("A user is required to register an SSE emitter."); @@ -65,21 +79,14 @@ private static T2 key(final User user, final String sseUid) { return t2(user.getId(), sseUid); } - /** - * A collection of event sources, specified for various Entity Centres. - * The only reason for this collection is to prevent GC from collecting instantiated event sources, which are required for SSE eventing. - */ + /// A collection of event sources, specified for various Entity Centres. + /// The only reason for this collection is to prevent GC from collecting instantiated event sources, which are required for SSE eventing. + /// private final Map, IEventSource> eventSources = new HashMap<>(); - /** - * Creates and registers an instance of {@code eventSourceClass}, but only if such SSE class was not instantiated before. - * SSE classes may get specified as part of Entity Centre configurations. - * - * @param eventSourceClass - * @param eventSourceSupplier - * @return - * @throws IOException - */ + /// Creates and registers an instance of `eventSourceClass`, but only if such SSE class was not instantiated before. + /// SSE classes may get specified as part of Entity Centre configurations. + /// public EventSourceDispatchingEmitter createAndRegisterEventSource(final Class eventSourceClass, final Supplier eventSourceSupplier) throws IOException { if (isActive.get()) { eventSources.computeIfAbsent(eventSourceClass, argNotUsed -> { @@ -98,18 +105,42 @@ public EventSourceDispatchingEmitter createAndRegisterEventSource(final Class emitterFactory) { LOGGER.info(format("Registering event emitter for web client [%s, %s].", user, sseUid)); if (isActive.get()) { - final IEventSourceEmitter emitter = register.computeIfAbsent(key(user, sseUid), argNotUsed -> emitterFactory.get()); + // `computeIfAbsent` runs its mapping function only for a previously unseen client, i.e., a new or re-established connection. + // The application version is announced only for such new emitters. + final var isNewEmitter = new MutableBoolean(false); + final var emitter = register.computeIfAbsent(key(user, sseUid), argNotUsed -> { + isNewEmitter.setTrue(); + return emitterFactory.get(); + }); + if (isNewEmitter.isTrue()) { + announceAppVersion(emitter); + } logRegisterSize(); return successful(emitter); } return failure("The dispatcher is inactive and no new emitters can be registered."); } + /// Announces the current application version, if any, to `emitter`. + /// This lets a client detect that a newer application version has been deployed since it was loaded, and prompt the user to reload. + /// + private void announceAppVersion(final IEventSourceEmitter emitter) { + final var appVersion = appVersionSupplier.get(); + if (!isBlank(appVersion)) { + try { + emitter.event(APP_VERSION_EVENT_NAME, appVersion); + } catch (final IOException ex) { + // A failure here is non-critical: the client will receive the announcement upon its next (re)connection. + LOGGER.warn(format("Could not announce application version [%s] to a newly connected SSE client.", appVersion), ex); + } + } + } + @Override public void deregisterEmitter(final User user, final String sseUid) { LOGGER.info(format("Deregistering event emitter for web client [%s, %s].", user, sseUid)); - // no exceptions are expected during the emitter removal and closing, but let's be defensive - // and because we cannot do much in such a case, we simply log the error for further analysis + // No exceptions are expected during the emitter removal and closing, but let's be defensive. + // Because we cannot do much in such a case, we simply log the error for further analysis. try { final IEventSourceEmitter emitter = register.remove(key(user, sseUid)); if (emitter != null) { @@ -122,9 +153,8 @@ public void deregisterEmitter(final User user, final String sseUid) { } } - /** - * A helper method to report the number of SSE connections – a distinct by user and a total number. - */ + /// A helper method to report the number of SSE connections – a distinct by user and a total number. + /// private void logRegisterSize() { final KeySetView, IEventSourceEmitter> keySet = register.keySet(); final long distinctUserConnections = keySet.stream().map(t2 -> t2._1).distinct().count(); @@ -137,13 +167,14 @@ public IEventSourceEmitter getEmitter(final User user, final String sseUid) { return register.get(key(user, sseUid)); } - /** - * Broadcasts an event to all registered emitters (i.e., clients). - * This method is thread-safe and could in practice get invoked by multiple threads. - *

- * Iterating over emitters, which are stored in a concurrent map, is thread-safe with "weak consistency". - * This means that iterators obtained for {@link ConcurrentHashMap} can tolerate concurrent modification, traverses elements as they existed when an iterator was constructed and may (but not guaranteed to) reflect modifications to the collection after the construction of an iterator. - */ + /// Broadcasts an event to all registered emitters (i.e., clients). + /// This method is thread-safe and could in practice get invoked by multiple threads. + /// + /// Iterating over emitters, which are stored in a concurrent map, is thread-safe with "weak consistency". + /// This means that iterators obtained for [ConcurrentHashMap] can tolerate concurrent modification. + /// And it traverses elements as they existed when an iterator was constructed. + /// And it may (but not guaranteed to) reflect modifications to the collection after the construction of an iterator. + /// @Override public void event(final String eventName, final String data) throws IOException { if (isActive.get()) { @@ -155,10 +186,9 @@ public void event(final String eventName, final String data) throws IOException } } - /** - * Broadcasts {@code data} to all registered emitters (i.e., clients). - * This method is thread-safe and could in practice get invoked by multiple threads, as per explanation in {@link #event(String, String)}. - */ + /// Broadcasts `data` to all registered emitters (i.e., clients). + /// This method is thread-safe and could in practice get invoked by multiple threads, as per explanation in [#event(String,String)]. + /// @Override public void data(final String data) throws IOException { if (isActive.get()) { @@ -170,10 +200,9 @@ public void data(final String data) throws IOException { } } - /** - * Broadcasts {@code comment} to all registered emitters (i.e., clients). - * This method is thread-safe and could in practice get invoked by multiple threads, as per explanation in {@link #event(String, String)}. - */ + /// Broadcasts `comment` to all registered emitters (i.e., clients). + /// This method is thread-safe and could in practice get invoked by multiple threads, as per explanation in [#event(String,String)]. + /// @Override public void comment(final String comment) throws IOException { if (isActive.get()) { @@ -185,9 +214,8 @@ public void comment(final String comment) throws IOException { } } - /** - * Removes and closes all emitters, registered previously. - */ + /// Removes and closes all emitters, registered previously. + /// @Override public void close() { if (isActive.getAndSet(false)) { @@ -198,7 +226,7 @@ public void close() { eventSource.disconnect(); iter.remove(); } catch (final Throwable ex) { - LOGGER.warn(format("Non critical error during closing of emitters."), ex); + LOGGER.warn("Non critical error during closing of emitters.", ex); } } @@ -209,7 +237,7 @@ public void close() { try { emitter.close(); } catch (final Throwable ex) { - LOGGER.warn(format("Non critical error during closing of emitters."), ex); + LOGGER.warn("Non critical error during closing of emitters.", ex); } } diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/app/IWebUiConfig.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/app/IWebUiConfig.java index 6f5b136e1f1..1a482060049 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/app/IWebUiConfig.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/app/IWebUiConfig.java @@ -231,6 +231,15 @@ default boolean isEmbeddedCentreAndNotAllowCustomised(final Class this._handleAppVersionAnnouncement(event.detail?.version)); }, attached: function () { @@ -853,7 +861,30 @@ Polymer({ detached: function () { window.removeEventListener("beforeunload", this._checkWhetherCanLeave); }, - + + /// Prompts the user to reload when the server reports an application version different from the one this client was loaded with. + /// Guarded so that both versions must be known, must actually differ, and the user is prompted only once per newly reported version. + /// + _handleAppVersionAnnouncement: function (serverAppVersion) { + const bootAppVersion = window.TG_APP?.appVersion; + if (serverAppVersion && bootAppVersion && serverAppVersion !== bootAppVersion && serverAppVersion !== this._notifiedAppVersion) { + this._notifiedAppVersion = serverAppVersion; + // Reload is a filled button, coloured as the application top panel, which makes it the primary action. + const reloadStyle = 'color: white; border-radius: 6px; ' + + 'background: var(--tg-main-pannel-color, var(--paper-light-blue-700));'; + showStickyToast({ + text: 'A new application version is available.', + detail: `${serverAppVersion} — reload to update.`, + actions: 'Later' + + `Reload`, + handlers: { + reload: () => window.location.reload(), + later: () => hideStickyToast() + } + }); + } + }, + /** * Provides custom 'state' object for history entries. Updates 'currentHistoryState' property. */ diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/tg-entity-centre.js b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/tg-entity-centre.js index e7ee7dda0ff..7adf8547eff 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/tg-entity-centre.js +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/tg-entity-centre.js @@ -17,6 +17,7 @@ import '/resources/actions/tg-ui-action.js'; import { TgElementSelectorBehavior, queryElements} from '/resources/components/tg-element-selector-behavior.js'; import { _timeZoneHeader } from '/resources/reflection/tg-date-utils.js'; import { resetCustomSettings } from '/resources/centre/tg-entity-centre-insertion-point.js'; +import { showStickyToast, hideStickyToast } from '/resources/components/tg-sticky-toast.js'; import { TgSerialiser } from '/resources/serialisation/tg-serialiser.js'; import '/resources/polymer/@polymer/iron-pages/iron-pages.js'; @@ -1053,6 +1054,17 @@ Polymer({ persistedIps.forEach(tagName => resetCustomSettings(this.miType, tagName)); // Remove all IP orders from each container and splitter positions too. this.resetCustomSettingsForInsertionPoints(); + + // Let the user know that their custom layout was reset, explaining the reason in the second row. + showStickyToast({ + text: 'Custom layout was reset.', + detail: 'Due to the software update your custom layout needed to be reset to ensure its integrity. ' + + 'Please adjust the new layout to fit your workflow.', + actions: 'Close', + handlers: { + close: () => hideStickyToast() + } + }); } } }, diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/checksums.json b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/checksums.json index b57d83a5995..a5000d69ba2 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/checksums.json +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/checksums.json @@ -1,7 +1,7 @@ { "/app/tg-app-index.html" : "682361701BC908EDBBFF69C3B8F2AD9940D7870486B08801B73BF8F0AD308456", "/resources/app/tg-app-resource-loader.js" : "A2028B469B2DB85ED564CB3802D6C8100EC5455520FB282679ABB89D2B306AAF", - "/resources/startup-resources-vulcanized.js" : "4D6BE899597A9FB43E08C00455BB2E884662FAB35FC02E3F3556E7E229BD8E11", + "/resources/startup-resources-vulcanized.js" : "D166F4F3E573895C2CF4FE7B0ABF01F3815D23C8B7662599A0F510DC404C5B44", "/resources/polymer/@webcomponents/webcomponentsjs/webcomponents-bundle.js" : "1F22281AACB4B120F0F9A0109510E7234C40340452AC957AB6FAC9B2D0DA4098", "/resources/polymer/web-animations-js/web-animations-next-lite.min.js" : "162C89BA2AB0CCF3D84CBA20CDE32BC49235EAD227D0A50F1830FC9914697413", "/resources/filesaver/FileSaver.min.js" : "8FD5FB1D7697E32235E56D4DEFB3EA65CBBDE8F35A821A19F839C98433D57AA9", @@ -9,7 +9,7 @@ "/resources/icons/tg-icon192x192.png" : "E3335E72AC56573BDA21C25807B602C71B2DD5753AAD0899C4DD80345C1D4BB2", "/resources/icons/tg-icon144x144.png" : "2848EC4F6AE98B5862F5E22DF3103814FDC32811A8656747F2DD7C7FB669DB85", "/resources/zxcvbn/zxcvbn.js" : "F42C651F40506ACB6B662490F338DD47A5951D3312039C4AB8FE5090484F351A", - "/resources/login-startup-resources-vulcanized.js" : "B0C040C72DD0AA836BAC3CB30D01C192CF63215ABEA23F165D0B1A6959AC129F", + "/resources/login-startup-resources-vulcanized.js" : "6086B5B5BAE78B0C196DA3E8D9AD9D4F63CA12E845AA041187FC110C74B8192D", "/resources/icons/tg-icon.png" : "B3E54E885A4DB79814624FF7F4DC2E04031D11E276E4E3D94E9F27472C3A2E33", "/app/login-initiate-reset.html" : "D04A16C021135891525E9343BA7BC2771D640CE5284371BA2EDA7584CBC86EDE", "/resources/login-initiated-reset.html" : "6E79A5940D16D96DC5159389E51AB41EB4F52C8CD26A38F247165689CBA47143", diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/components/tg-event-source.js b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/components/tg-event-source.js index b3e47622511..d5c35b55a68 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/components/tg-event-source.js +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/components/tg-event-source.js @@ -55,6 +55,12 @@ const registerEventSourceHandlers = function (sourceObj) { console.log('opened connection'); }, false); + // The server announces its current application version upon each (re)connection (see `EventSourceDispatchingEmitter`). + // Notify (see `tg-app-template.js`) through a window event., so that it can compare against the version this client was loaded with. + source.addEventListener('application-version', function (e) { + window.dispatchEvent(new CustomEvent('tg-application-version', { detail: { version: e.data } })); + }, false); + source.addEventListener('error', function (e) { console.log('an error occurred: ', e); diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/components/tg-message-panel.js b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/components/tg-message-panel.js index ad6722cdfc4..4522a910225 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/components/tg-message-panel.js +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/components/tg-message-panel.js @@ -8,6 +8,8 @@ import '/resources/polymer/@polymer/paper-styles/paper-styles.js'; import {Polymer} from '/resources/polymer/@polymer/polymer/lib/legacy/polymer-fn.js'; import {html} from '/resources/polymer/@polymer/polymer/lib/utils/html-tag.js'; +import { TgTooltipBehavior } from '/resources/components/tg-tooltip-behavior.js'; + const template = html` + `; +stickyToastStyle.setAttribute('style', 'display: none;'); +document.head.appendChild(stickyToastStyle.content); + +const template = html` + +

+
+
+
+
+ `; + +/// A toast that stays visible until it gets dismissed, intended for messages that a user must not miss. +/// +/// Unlike [tg-toast], which is transient and shares a single slot with all other transient messages, this toast has a slot of its own. +/// It therefore never gets overridden by, and never overrides, other messages. +/// It is placed at the bottom of the shared toast container, so that all transient toasts are shifted above it. +/// +class TgStickyToast extends mixinBehaviors([TgToastBehavior], PolymerElement) { + + static get template() { + return template; + } + + static get properties() { + return { + /// Maps the `data-tap` identifiers, used in the current message, to their handler functions. + /// + _messageHandlers: { + type: Object, + value: () => ({}) + } + }; + } + + ready() { + super.ready(); + // The refit function of paper-toast behaves erratically, hence it is disabled, as in other TG toasts. + this.$.stickyToast.refit = function () {}; + } + + /// Displays `message`, replacing whatever was displayed before. + /// + /// `message.text` is the message itself and may contain HTML markup, including inline styles and links. + /// `message.detail` is an optional less emphasised second row, also supporting markup. + /// `message.actions` is an optional row of actionable elements, displayed at the end of the message. + /// + /// An element in any of the above becomes actionable by carrying a `data-tap` attribute. + /// Its value identifies the handler function in `message.handlers`. + /// + showMessage (message) { + const { text = '', detail = '', actions = '', handlers = {} } = message || {}; + this._messageHandlers = handlers; + this.$.messageText.innerHTML = text; + this.$.messageDetail.innerHTML = detail; + this.$.messageActions.innerHTML = actions; + this.$.messageDetail.hidden = !detail; + this.$.messageActions.hidden = !actions; + this.show(); + } + + /// Makes this toast visible, relocating it into the shared toast container if needed. + /// + /// The toast is appended rather than prepended, which is what other TG toasts do. + /// This keeps it at the bottom of the container, so that all transient toasts are shifted above it. + /// + show () { + if (!this.getDocumentToast('stickyToast')) { + this.getToastContainer().appendChild(this.$.stickyToast); + } + this.$.stickyToast.open(); + } + + hide () { + this.$.stickyToast.close(); + } + + /// Invokes the handler for the tapped element, identified by its `data-tap` attribute, if there is such a handler. + /// + _handleMessageTap (e) { + const path = e.composedPath(); + // Only the part of the path inside the message is of interest, hence the search stops at the message container. + const containerIdx = path.indexOf(this.$.messageContainer); + const messagePath = containerIdx >= 0 ? path.slice(0, containerIdx) : path; + const actionElement = messagePath.find(node => node.nodeType === Node.ELEMENT_NODE && node.hasAttribute('data-tap')); + if (actionElement) { + const handler = this._messageHandlers[actionElement.getAttribute('data-tap')]; + if (handler) { + handler(e); + } + } + } + + _toast () { + return this.$.stickyToast; + } + +} + +customElements.define('tg-sticky-toast', TgStickyToast); + +/// A single sticky toast for the whole application. +/// It is created similarly as it is done for tg-delayed-action-toast. +/// +const stickyToastElement = document.createElement('tg-sticky-toast'); +document.body.appendChild(stickyToastElement); + +/// Displays `message` in the application sticky toast. +/// This works from anywhere in the application, with no need for the caller to have access to the toast. +/// See `showMessage` of `tg-sticky-toast` for the supported shape of `message`. +/// +export const showStickyToast = function (message) { + stickyToastElement.showMessage(message); +}; + +/// Dismisses the application sticky toast. +/// +export const hideStickyToast = function () { + stickyToastElement.hide(); +}; diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/login-startup-resources-vulcanized.js b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/login-startup-resources-vulcanized.js index e1c3ddd9ae0..0aaac544909 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/login-startup-resources-vulcanized.js +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/login-startup-resources-vulcanized.js @@ -16,7 +16,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/class StyleNode{constructor(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""}}function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){let t=new StyleNode;t.start=0,t.end=e.length;let i=t;for(let n=0,r=e.length;n-1?i=t:(n=t,i=e.getAttribute&&e.getAttribute("is")||""):(i=e.is,n=e.extends),{is:i,typeExtension:n}}function gatherStyleText(e){const t=[],i=e.querySelectorAll("style");for(let e=0;e-1?n=t:(r=t,n=e.getAttribute&&e.getAttribute("is")||""):(n=e.is,r=e.extends),{is:n,typeExtension:r}}function gatherStyleText(e){const t=[],n=e.querySelectorAll("style");for(let e=0;e{":root"===e.selector&&(e.selector="html"),this.transformRule(e)}),e.textContent=toCssText(t),t}transformRules(e,t){this._currentElement=t,forEachRule(e,e=>{this.transformRule(e)}),this._currentElement=null}transformRule(e){e.cssText=this.transformCssText(e.parsedCssText,e),":root"===e.selector&&(e.selector=":host > *")}transformCssText(e,t){return e=e.replace(VAR_ASSIGN,(e,i,n,r)=>this._produceCssProperties(e,i,n,r,t)),this._consumeCssProperties(e,t)}_getInitialValueForProperty(e){return this._measureElement||(this._measureElement=document.createElement("meta"),this._measureElement.setAttribute("apply-shim-measure",""),this._measureElement.style.all="initial",document.head.appendChild(this._measureElement)),window.getComputedStyle(this._measureElement).getPropertyValue(e)}_fallbacksFromPreviousRules(e){let t=e;for(;t.parent;)t=t.parent;const i={};let n=!1;return forEachRule(t,t=>{n=n||t===e,n||t.selector===e.selector&&Object.assign(i,this._cssTextToMap(t.parsedCssText))}),i}_consumeCssProperties(e,t){let i=null;for(;i=MIXIN_MATCH.exec(e);){let n=i[0],r=i[1],a=i.index,s=a+n.indexOf("@apply"),o=a+n.length,l=e.slice(0,s),h=e.slice(o),c=t?this._fallbacksFromPreviousRules(t):{};Object.assign(c,this._cssTextToMap(l));let p=this._atApplyToCssProperties(r,c);e=`${l}${p}${h}`,MIXIN_MATCH.lastIndex=a+p.length}return e}_atApplyToCssProperties(e,t){e=e.replace(APPLY_NAME_CLEAN,"");let i=[],n=this._map.get(e);if(n||(this._map.set(e,{}),n=this._map.get(e)),n){let r,a;this._currentElement&&(n.dependants[this._currentElement]=!0);const s=n.properties,o=Object.keys(s);let l=o.length;for(;l--;){const n=o[l];a=t&&t[n],r=[n,": var(",e,"_-_",n],a&&r.push(",",a.replace(IMPORTANT,"")),r.push(")"),IMPORTANT.test(s[n])&&r.push(" !important"),i.push(r.join(""))}}return i.join("; ")}_replaceInitialOrInherit(e,t){let i=INITIAL_INHERIT.exec(t);return i&&(t=i[1]?this._getInitialValueForProperty(e):"apply-shim-inherit"),t}_cssTextToMap(e,t=!1){let i,n,r=e.split(";"),a={};for(let e,s,o=0;o1&&(i=s[0].trim(),n=s.slice(1).join(":"),t&&(n=this._replaceInitialOrInherit(i,n)),a[i]=n));return a}_invalidateMixinEntry(e){if(invalidCallback)for(let t in e.dependants)t!==this._currentElement&&invalidCallback(t)}_produceCssProperties(e,t,i,n,r){if(i&&processVariableAndFallback(i,(e,t)=>{t&&this._map.get(t)&&(n=`@apply ${t};`)}),!n)return e;let a=this._consumeCssProperties(""+n,r),s=e.slice(0,e.indexOf("--")),o=this._cssTextToMap(a,!0),l=o,h=this._map.get(t),c=h&&h.properties;c?l=Object.assign(Object.create(c),o):this._map.set(t,l);let p,d=[],u=!1;const m=Object.keys(l);let f=m.length;for(;f--;){const e=m[f];p=o[e],void 0===p&&(p="initial"),c&&!(e in c)&&(u=!0),d.push(`${t}_-_${e}: ${p}`)}return u&&this._invalidateMixinEntry(h),h&&(h.properties=l),i&&(s=`${e};${s}`),`${s}${d.join("; ")};`}}ApplyShim.prototype.detectMixin=ApplyShim.prototype.detectMixin,ApplyShim.prototype.transformStyle=ApplyShim.prototype.transformStyle,ApplyShim.prototype.transformCustomStyle=ApplyShim.prototype.transformCustomStyle,ApplyShim.prototype.transformRules=ApplyShim.prototype.transformRules,ApplyShim.prototype.transformRule=ApplyShim.prototype.transformRule,ApplyShim.prototype.transformTemplate=ApplyShim.prototype.transformTemplate,ApplyShim.prototype._separator="_-_",Object.defineProperty(ApplyShim.prototype,"invalidCallback",{get:()=>invalidCallback,set(e){invalidCallback=e}}); +*/const APPLY_NAME_CLEAN=/;\s*/m,INITIAL_INHERIT=/^\s*(initial)|(inherit)\s*$/,IMPORTANT=/\s*!important/,MIXIN_VAR_SEP="_-_";class MixinMap{constructor(){this._map={}}set(e,t){e=e.trim(),this._map[e]={properties:t,dependants:{}}}get(e){return e=e.trim(),this._map[e]||null}}let invalidCallback=null;class ApplyShim{constructor(){this._currentElement=null,this._measureElement=null,this._map=new MixinMap}detectMixin(e){return detectMixin(e)}gatherStyles(e){const t=gatherStyleText(e.content);if(t){const n=document.createElement("style");return n.textContent=t,e.content.insertBefore(n,e.content.firstChild),n}return null}transformTemplate(e,t){void 0===e._gatheredStyle&&(e._gatheredStyle=this.gatherStyles(e));const n=e._gatheredStyle;return n?this.transformStyle(n,t):null}transformStyle(e,t=""){let n=rulesForStyle(e);return this.transformRules(n,t),e.textContent=toCssText(n),n}transformCustomStyle(e){let t=rulesForStyle(e);return forEachRule(t,e=>{":root"===e.selector&&(e.selector="html"),this.transformRule(e)}),e.textContent=toCssText(t),t}transformRules(e,t){this._currentElement=t,forEachRule(e,e=>{this.transformRule(e)}),this._currentElement=null}transformRule(e){e.cssText=this.transformCssText(e.parsedCssText,e),":root"===e.selector&&(e.selector=":host > *")}transformCssText(e,t){return e=e.replace(VAR_ASSIGN,(e,n,r,o)=>this._produceCssProperties(e,n,r,o,t)),this._consumeCssProperties(e,t)}_getInitialValueForProperty(e){return this._measureElement||(this._measureElement=document.createElement("meta"),this._measureElement.setAttribute("apply-shim-measure",""),this._measureElement.style.all="initial",document.head.appendChild(this._measureElement)),window.getComputedStyle(this._measureElement).getPropertyValue(e)}_fallbacksFromPreviousRules(e){let t=e;for(;t.parent;)t=t.parent;const n={};let r=!1;return forEachRule(t,t=>{r=r||t===e,r||t.selector===e.selector&&Object.assign(n,this._cssTextToMap(t.parsedCssText))}),n}_consumeCssProperties(e,t){let n=null;for(;n=MIXIN_MATCH.exec(e);){let r=n[0],o=n[1],i=n.index,s=i+r.indexOf("@apply"),a=i+r.length,l=e.slice(0,s),c=e.slice(a),d=t?this._fallbacksFromPreviousRules(t):{};Object.assign(d,this._cssTextToMap(l));let p=this._atApplyToCssProperties(o,d);e=`${l}${p}${c}`,MIXIN_MATCH.lastIndex=i+p.length}return e}_atApplyToCssProperties(e,t){e=e.replace(APPLY_NAME_CLEAN,"");let n=[],r=this._map.get(e);if(r||(this._map.set(e,{}),r=this._map.get(e)),r){let o,i;this._currentElement&&(r.dependants[this._currentElement]=!0);const s=r.properties,a=Object.keys(s);let l=a.length;for(;l--;){const r=a[l];i=t&&t[r],o=[r,": var(",e,"_-_",r],i&&o.push(",",i.replace(IMPORTANT,"")),o.push(")"),IMPORTANT.test(s[r])&&o.push(" !important"),n.push(o.join(""))}}return n.join("; ")}_replaceInitialOrInherit(e,t){let n=INITIAL_INHERIT.exec(t);return n&&(t=n[1]?this._getInitialValueForProperty(e):"apply-shim-inherit"),t}_cssTextToMap(e,t=!1){let n,r,o=e.split(";"),i={};for(let e,s,a=0;a1&&(n=s[0].trim(),r=s.slice(1).join(":"),t&&(r=this._replaceInitialOrInherit(n,r)),i[n]=r));return i}_invalidateMixinEntry(e){if(invalidCallback)for(let t in e.dependants)t!==this._currentElement&&invalidCallback(t)}_produceCssProperties(e,t,n,r,o){if(n&&processVariableAndFallback(n,(e,t)=>{t&&this._map.get(t)&&(r=`@apply ${t};`)}),!r)return e;let i=this._consumeCssProperties(""+r,o),s=e.slice(0,e.indexOf("--")),a=this._cssTextToMap(i,!0),l=a,c=this._map.get(t),d=c&&c.properties;d?l=Object.assign(Object.create(d),a):this._map.set(t,l);let p,u=[],h=!1;const f=Object.keys(l);let m=f.length;for(;m--;){const e=f[m];p=a[e],void 0===p&&(p="initial"),d&&!(e in d)&&(h=!0),u.push(`${t}_-_${e}: ${p}`)}return h&&this._invalidateMixinEntry(c),c&&(c.properties=l),n&&(s=`${e};${s}`),`${s}${u.join("; ")};`}}ApplyShim.prototype.detectMixin=ApplyShim.prototype.detectMixin,ApplyShim.prototype.transformStyle=ApplyShim.prototype.transformStyle,ApplyShim.prototype.transformCustomStyle=ApplyShim.prototype.transformCustomStyle,ApplyShim.prototype.transformRules=ApplyShim.prototype.transformRules,ApplyShim.prototype.transformRule=ApplyShim.prototype.transformRule,ApplyShim.prototype.transformTemplate=ApplyShim.prototype.transformTemplate,ApplyShim.prototype._separator="_-_",Object.defineProperty(ApplyShim.prototype,"invalidCallback",{get:()=>invalidCallback,set(e){invalidCallback=e}}); /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -80,7 +80,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/const SEEN_MARKER="__seenByShadyCSS",CACHED_STYLE="__shadyCSSCachedStyle";let transformFn=null,validateFn=null;class CustomStyleInterface$1{constructor(){this.customStyles=[],this.enqueued=!1,documentWait(()=>{window.ShadyCSS.flushCustomStyles&&window.ShadyCSS.flushCustomStyles()})}enqueueDocumentValidation(){!this.enqueued&&validateFn&&(this.enqueued=!0,documentWait(validateFn))}addCustomStyle(e){e[SEEN_MARKER]||(e[SEEN_MARKER]=!0,this.customStyles.push(e),this.enqueueDocumentValidation())}getStyleForCustomStyle(e){if(e[CACHED_STYLE])return e[CACHED_STYLE];let t;return t=e.getStyle?e.getStyle():e,t}processStyles(){const e=this.customStyles;for(let t=0;ttransformFn,set(e){transformFn=e}},validateCallback:{get:()=>validateFn,set(e){let t=!1;validateFn||(t=!0),validateFn=e,t&&this.enqueueDocumentValidation()}}}); +*/const SEEN_MARKER="__seenByShadyCSS",CACHED_STYLE="__shadyCSSCachedStyle";let transformFn=null,validateFn=null;class CustomStyleInterface$1{constructor(){this.customStyles=[],this.enqueued=!1,documentWait(()=>{window.ShadyCSS.flushCustomStyles&&window.ShadyCSS.flushCustomStyles()})}enqueueDocumentValidation(){!this.enqueued&&validateFn&&(this.enqueued=!0,documentWait(validateFn))}addCustomStyle(e){e[SEEN_MARKER]||(e[SEEN_MARKER]=!0,this.customStyles.push(e),this.enqueueDocumentValidation())}getStyleForCustomStyle(e){if(e[CACHED_STYLE])return e[CACHED_STYLE];let t;return t=e.getStyle?e.getStyle():e,t}processStyles(){const e=this.customStyles;for(let t=0;ttransformFn,set(e){transformFn=e}},validateCallback:{get:()=>validateFn,set(e){let t=!1;validateFn||(t=!0),validateFn=e,t&&this.enqueueDocumentValidation()}}}); /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -90,7 +90,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -const applyShim=new ApplyShim;class ApplyShimInterface{constructor(){this.customStyleInterface=null,applyShim.invalidCallback=invalidate}ensure(){this.customStyleInterface||window.ShadyCSS.CustomStyleInterface&&(this.customStyleInterface=window.ShadyCSS.CustomStyleInterface,this.customStyleInterface.transformCallback=e=>{applyShim.transformCustomStyle(e)},this.customStyleInterface.validateCallback=()=>{requestAnimationFrame(()=>{this.customStyleInterface.enqueued&&this.flushCustomStyles()})})}prepareTemplate(e,t){if(this.ensure(),elementHasBuiltCss(e))return;templateMap[t]=e;let i=applyShim.transformTemplate(e,t);e._styleAst=i}flushCustomStyles(){if(this.ensure(),!this.customStyleInterface)return;let e=this.customStyleInterface.processStyles();if(this.customStyleInterface.enqueued){for(let t=0;tgetComputedStyleValue(e,t),flushCustomStyles(){e.flushCustomStyles()},nativeCss:nativeCssVariables,nativeShadow:nativeShadow,cssBuild:cssBuild,disableRuntime:disableRuntime},t&&(window.ShadyCSS.CustomStyleInterface=t)}window.ShadyCSS.ApplyShim=applyShim, +const applyShim=new ApplyShim;class ApplyShimInterface{constructor(){this.customStyleInterface=null,applyShim.invalidCallback=invalidate}ensure(){this.customStyleInterface||window.ShadyCSS.CustomStyleInterface&&(this.customStyleInterface=window.ShadyCSS.CustomStyleInterface,this.customStyleInterface.transformCallback=e=>{applyShim.transformCustomStyle(e)},this.customStyleInterface.validateCallback=()=>{requestAnimationFrame(()=>{this.customStyleInterface.enqueued&&this.flushCustomStyles()})})}prepareTemplate(e,t){if(this.ensure(),elementHasBuiltCss(e))return;templateMap[t]=e;let n=applyShim.transformTemplate(e,t);e._styleAst=n}flushCustomStyles(){if(this.ensure(),!this.customStyleInterface)return;let e=this.customStyleInterface.processStyles();if(this.customStyleInterface.enqueued){for(let t=0;tgetComputedStyleValue(e,t),flushCustomStyles(){e.flushCustomStyles()},nativeCss:nativeCssVariables,nativeShadow:nativeShadow,cssBuild:cssBuild,disableRuntime:disableRuntime},t&&(window.ShadyCSS.CustomStyleInterface=t)}window.ShadyCSS.ApplyShim=applyShim, /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -110,7 +110,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -let workingURL,resolveDoc,CSS_URL_RX=/(url\()([^)]*)(\))/g,ABS_URL=/(^\/[^\/])|(^#)|(^[\w-\d]*:)/;function resolveUrl(e,t){if(e&&ABS_URL.test(e))return e;if("//"===e)return e;if(void 0===workingURL){workingURL=!1;try{const e=new URL("b","http://a");e.pathname="c%20d",workingURL="http://a/c%20d"===e.href}catch(e){}}if(t||(t=document.baseURI||window.location.href),workingURL)try{return new URL(e,t).href}catch(t){return e}return resolveDoc||(resolveDoc=document.implementation.createHTMLDocument("temp"),resolveDoc.base=resolveDoc.createElement("base"),resolveDoc.head.appendChild(resolveDoc.base),resolveDoc.anchor=resolveDoc.createElement("a"),resolveDoc.body.appendChild(resolveDoc.anchor)),resolveDoc.base.href=t,resolveDoc.anchor.href=e,resolveDoc.anchor.href||e}function resolveCss(e,t){return e.replace(CSS_URL_RX,function(e,i,n,r){return i+"'"+resolveUrl(n.replace(/["']/g,""),t)+"'"+r})}function pathFromUrl(e){return e.substring(0,e.lastIndexOf("/")+1)} +let workingURL,resolveDoc,CSS_URL_RX=/(url\()([^)]*)(\))/g,ABS_URL=/(^\/[^\/])|(^#)|(^[\w-\d]*:)/;function resolveUrl(e,t){if(e&&ABS_URL.test(e))return e;if("//"===e)return e;if(void 0===workingURL){workingURL=!1;try{const e=new URL("b","http://a");e.pathname="c%20d",workingURL="http://a/c%20d"===e.href}catch(e){}}if(t||(t=document.baseURI||window.location.href),workingURL)try{return new URL(e,t).href}catch(t){return e}return resolveDoc||(resolveDoc=document.implementation.createHTMLDocument("temp"),resolveDoc.base=resolveDoc.createElement("base"),resolveDoc.head.appendChild(resolveDoc.base),resolveDoc.anchor=resolveDoc.createElement("a"),resolveDoc.body.appendChild(resolveDoc.anchor)),resolveDoc.base.href=t,resolveDoc.anchor.href=e,resolveDoc.anchor.href||e}function resolveCss(e,t){return e.replace(CSS_URL_RX,function(e,n,r,o){return n+"'"+resolveUrl(r.replace(/["']/g,""),t)+"'"+o})}function pathFromUrl(e){return e.substring(0,e.lastIndexOf("/")+1)} /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -119,7 +119,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/const useShadow=!window.ShadyDOM||!window.ShadyDOM.inUse;Boolean(!window.ShadyCSS||window.ShadyCSS.nativeCss);const supportsAdoptingStyleSheets=useShadow&&"adoptedStyleSheets"in Document.prototype&&"replaceSync"in CSSStyleSheet.prototype&&(()=>{try{const e=new CSSStyleSheet;e.replaceSync("");const t=document.createElement("div");return t.attachShadow({mode:"open"}),t.shadowRoot.adoptedStyleSheets=[e],t.shadowRoot.adoptedStyleSheets[0]===e}catch(e){return!1}})();let rootPath=window.Polymer&&window.Polymer.rootPath||pathFromUrl(document.baseURI||window.location.href),sanitizeDOMValue=window.Polymer&&window.Polymer.sanitizeDOMValue||void 0,passiveTouchGestures=window.Polymer&&window.Polymer.setPassiveTouchGestures||!1,strictTemplatePolicy=window.Polymer&&window.Polymer.strictTemplatePolicy||!1,allowTemplateFromDomModule=window.Polymer&&window.Polymer.allowTemplateFromDomModule||!1,legacyOptimizations=window.Polymer&&window.Polymer.legacyOptimizations||!1,legacyWarnings=window.Polymer&&window.Polymer.legacyWarnings||!1,syncInitialRender=window.Polymer&&window.Polymer.syncInitialRender||!1,legacyUndefined=window.Polymer&&window.Polymer.legacyUndefined||!1,orderedComputed=window.Polymer&&window.Polymer.orderedComputed||!1,removeNestedTemplates=window.Polymer&&window.Polymer.removeNestedTemplates||!1,fastDomIf=window.Polymer&&window.Polymer.fastDomIf||!1,suppressTemplateNotifications=window.Polymer&&window.Polymer.suppressTemplateNotifications||!1,legacyNoObservedAttributes=window.Polymer&&window.Polymer.legacyNoObservedAttributes||!1,useAdoptedStyleSheetsWithBuiltCSS=window.Polymer&&window.Polymer.useAdoptedStyleSheetsWithBuiltCSS||!1,dedupeId$1=0;const dedupingMixin=function(e){let t=e.__mixinApplications;t||(t=new WeakMap,e.__mixinApplications=t);let i=dedupeId$1++;return function(n){let r=n.__mixinSet;if(r&&r[i])return n;let a=t,s=a.get(n);if(!s){s=e(n),a.set(n,s);let t=Object.create(s.__mixinSet||r||null);t[i]=!0,s.__mixinSet=t}return s}}; +*/const useShadow=!window.ShadyDOM||!window.ShadyDOM.inUse;Boolean(!window.ShadyCSS||window.ShadyCSS.nativeCss);const supportsAdoptingStyleSheets=useShadow&&"adoptedStyleSheets"in Document.prototype&&"replaceSync"in CSSStyleSheet.prototype&&(()=>{try{const e=new CSSStyleSheet;e.replaceSync("");const t=document.createElement("div");return t.attachShadow({mode:"open"}),t.shadowRoot.adoptedStyleSheets=[e],t.shadowRoot.adoptedStyleSheets[0]===e}catch(e){return!1}})();let rootPath=window.Polymer&&window.Polymer.rootPath||pathFromUrl(document.baseURI||window.location.href),sanitizeDOMValue=window.Polymer&&window.Polymer.sanitizeDOMValue||void 0,passiveTouchGestures=window.Polymer&&window.Polymer.setPassiveTouchGestures||!1,strictTemplatePolicy=window.Polymer&&window.Polymer.strictTemplatePolicy||!1,allowTemplateFromDomModule=window.Polymer&&window.Polymer.allowTemplateFromDomModule||!1,legacyOptimizations=window.Polymer&&window.Polymer.legacyOptimizations||!1,legacyWarnings=window.Polymer&&window.Polymer.legacyWarnings||!1,syncInitialRender=window.Polymer&&window.Polymer.syncInitialRender||!1,legacyUndefined=window.Polymer&&window.Polymer.legacyUndefined||!1,orderedComputed=window.Polymer&&window.Polymer.orderedComputed||!1,removeNestedTemplates=window.Polymer&&window.Polymer.removeNestedTemplates||!1,fastDomIf=window.Polymer&&window.Polymer.fastDomIf||!1,suppressTemplateNotifications=window.Polymer&&window.Polymer.suppressTemplateNotifications||!1,legacyNoObservedAttributes=window.Polymer&&window.Polymer.legacyNoObservedAttributes||!1,useAdoptedStyleSheetsWithBuiltCSS=window.Polymer&&window.Polymer.useAdoptedStyleSheetsWithBuiltCSS||!1,dedupeId$1=0;const dedupingMixin=function(e){let t=e.__mixinApplications;t||(t=new WeakMap,e.__mixinApplications=t);let n=dedupeId$1++;return function(r){let o=r.__mixinSet;if(o&&o[n])return r;let i=t,s=i.get(r);if(!s){s=e(r),i.set(r,s);let t=Object.create(s.__mixinSet||o||null);t[n]=!0,s.__mixinSet=t}return s}}; /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -128,7 +128,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/let modules={},lcModules={};function setModule(e,t){modules[e]=lcModules[e.toLowerCase()]=t}function findModule(e){return modules[e]||lcModules[e.toLowerCase()]}function styleOutsideTemplateCheck(e){e.querySelector("style")&&console.warn("dom-module %s has style outside template",e.id)}class DomModule extends HTMLElement{static get observedAttributes(){return["id"]}static import(e,t){if(e){let i=findModule(e);return i&&t?i.querySelector(t):i}return null}attributeChangedCallback(e,t,i,n){t!==i&&this.register()}get assetpath(){if(!this.__assetpath){const e=window.HTMLImports&&HTMLImports.importForElement?HTMLImports.importForElement(this)||document:this.ownerDocument,t=resolveUrl(this.getAttribute("assetpath")||"",e.baseURI);this.__assetpath=pathFromUrl(t)}return this.__assetpath}register(e){if(e=e||this.id){if(strictTemplatePolicy&&void 0!==findModule(e))throw setModule(e,null),new Error(`strictTemplatePolicy: dom-module ${e} re-registered`);this.id=e,setModule(e,this),styleOutsideTemplateCheck(this)}}}DomModule.prototype.modules=modules,customElements.define("dom-module",DomModule); +*/let modules={},lcModules={};function setModule(e,t){modules[e]=lcModules[e.toLowerCase()]=t}function findModule(e){return modules[e]||lcModules[e.toLowerCase()]}function styleOutsideTemplateCheck(e){e.querySelector("style")&&console.warn("dom-module %s has style outside template",e.id)}class DomModule extends HTMLElement{static get observedAttributes(){return["id"]}static import(e,t){if(e){let n=findModule(e);return n&&t?n.querySelector(t):n}return null}attributeChangedCallback(e,t,n,r){t!==n&&this.register()}get assetpath(){if(!this.__assetpath){const e=window.HTMLImports&&HTMLImports.importForElement?HTMLImports.importForElement(this)||document:this.ownerDocument,t=resolveUrl(this.getAttribute("assetpath")||"",e.baseURI);this.__assetpath=pathFromUrl(t)}return this.__assetpath}register(e){if(e=e||this.id){if(strictTemplatePolicy&&void 0!==findModule(e))throw setModule(e,null),new Error(`strictTemplatePolicy: dom-module ${e} re-registered`);this.id=e,setModule(e,this),styleOutsideTemplateCheck(this)}}}DomModule.prototype.modules=modules,customElements.define("dom-module",DomModule); /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -138,7 +138,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -const MODULE_STYLE_LINK_SELECTOR="link[rel=import][type~=css]",INCLUDE_ATTR="include",SHADY_UNSCOPED_ATTR="shady-unscoped";function importModule(e){return DomModule.import(e)}function styleForImport(e){const t=resolveCss((e.body?e.body:e).textContent,e.baseURI),i=document.createElement("style");return i.textContent=t,i}function stylesFromModules(e){const t=e.trim().split(/\s+/),i=[];for(let e=0;eShadyDOM.patch(e):e=>e; +*/const wrap$1=window.ShadyDOM&&window.ShadyDOM.noPatch&&window.ShadyDOM.wrap?window.ShadyDOM.wrap:window.ShadyDOM?e=>ShadyDOM.patch(e):e=>e; /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -156,7 +156,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/function isPath(e){return e.indexOf(".")>=0}function root(e){let t=e.indexOf(".");return-1===t?e:e.slice(0,t)}function isAncestor(e,t){return 0===e.indexOf(t+".")}function isDescendant(e,t){return 0===t.indexOf(e+".")}function translate(e,t,i){return t+i.slice(e.length)}function matches(e,t){return e===t||isAncestor(e,t)||isDescendant(e,t)}function normalize(e){if(Array.isArray(e)){let t=[];for(let i=0;i1){for(let e=0;e=0}function root(e){let t=e.indexOf(".");return-1===t?e:e.slice(0,t)}function isAncestor(e,t){return 0===e.indexOf(t+".")}function isDescendant(e,t){return 0===t.indexOf(e+".")}function translate(e,t,n){return t+n.slice(e.length)}function matches$2(e,t){return e===t||isAncestor(e,t)||isDescendant(e,t)}function normalize$1(e){if(Array.isArray(e)){let t=[];for(let n=0;n1){for(let e=0;e{throw e})}}microtaskCallbacks.splice(0,e),microtaskLastHandle+=e}new window.MutationObserver(microtaskFlush).observe(microtaskNode,{characterData:!0});const timeOut={after:e=>({run:t=>window.setTimeout(t,e),cancel(e){window.clearTimeout(e)}}),run:(e,t)=>window.setTimeout(e,t),cancel(e){window.clearTimeout(e)}},microTask={run:e=>(microtaskScheduled||(microtaskScheduled=!0,microtaskNode.textContent=microtaskNodeContent++),microtaskCallbacks.push(e),microtaskCurrHandle++),cancel(e){const t=e-microtaskLastHandle;if(t>=0){if(!microtaskCallbacks[t])throw new Error("invalid async handle: "+e);microtaskCallbacks[t]=null}}},microtask=microTask,PropertiesChanged=dedupingMixin(e=>class extends e{static createProperties(e){const t=this.prototype;for(let i in e)i in t||t._createPropertyAccessor(i)}static attributeNameForProperty(e){return e.toLowerCase()}static typeForProperty(e){}_createPropertyAccessor(e,t){this._addPropertyToAttributeMap(e),this.hasOwnProperty(JSCompiler_renameProperty("__dataHasAccessor",this))||(this.__dataHasAccessor=Object.assign({},this.__dataHasAccessor)),this.__dataHasAccessor[e]||(this.__dataHasAccessor[e]=!0,this._definePropertyAccessor(e,t))}_addPropertyToAttributeMap(e){this.hasOwnProperty(JSCompiler_renameProperty("__dataAttributes",this))||(this.__dataAttributes=Object.assign({},this.__dataAttributes));let t=this.__dataAttributes[e];return t||(t=this.constructor.attributeNameForProperty(e),this.__dataAttributes[t]=e),t}_definePropertyAccessor(e,t){Object.defineProperty(this,e,{get(){return this.__data[e]},set:t?function(){}:function(t){this._setPendingProperty(e,t,!0)&&this._invalidateProperties()}})}constructor(){super(),this.__dataEnabled=!1,this.__dataReady=!1,this.__dataInvalid=!1,this.__data={},this.__dataPending=null,this.__dataOld=null,this.__dataInstanceProps=null,this.__dataCounter=0,this.__serializing=!1,this._initializeProperties()}ready(){this.__dataReady=!0,this._flushProperties()}_initializeProperties(){for(let e in this.__dataHasAccessor)this.hasOwnProperty(e)&&(this.__dataInstanceProps=this.__dataInstanceProps||{},this.__dataInstanceProps[e]=this[e],delete this[e])}_initializeInstanceProperties(e){Object.assign(this,e)}_setProperty(e,t){this._setPendingProperty(e,t)&&this._invalidateProperties()}_getProperty(e){return this.__data[e]}_setPendingProperty(e,t,i){let n=this.__data[e],r=this._shouldPropertyChange(e,t,n);return r&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),this.__dataOld&&!(e in this.__dataOld)&&(this.__dataOld[e]=n),this.__data[e]=t,this.__dataPending[e]=t),r}_isPropertyPending(e){return!(!this.__dataPending||!this.__dataPending.hasOwnProperty(e))}_invalidateProperties(){!this.__dataInvalid&&this.__dataReady&&(this.__dataInvalid=!0,microtask.run(()=>{this.__dataInvalid&&(this.__dataInvalid=!1,this._flushProperties())}))}_enableProperties(){this.__dataEnabled||(this.__dataEnabled=!0,this.__dataInstanceProps&&(this._initializeInstanceProperties(this.__dataInstanceProps),this.__dataInstanceProps=null),this.ready())}_flushProperties(){this.__dataCounter++;const e=this.__data,t=this.__dataPending,i=this.__dataOld;this._shouldPropertiesChange(e,t,i)&&(this.__dataPending=null,this.__dataOld=null,this._propertiesChanged(e,t,i)),this.__dataCounter--}_shouldPropertiesChange(e,t,i){return Boolean(t)}_propertiesChanged(e,t,i){}_shouldPropertyChange(e,t,i){return i!==t&&(i==i||t==t)}attributeChangedCallback(e,t,i,n){t!==i&&this._attributeToProperty(e,i),super.attributeChangedCallback&&super.attributeChangedCallback(e,t,i,n)}_attributeToProperty(e,t,i){if(!this.__serializing){const n=this.__dataAttributes,r=n&&n[e]||e;this[r]=this._deserializeValue(t,i||this.constructor.typeForProperty(r))}}_propertyToAttribute(e,t,i){this.__serializing=!0,i=arguments.length<3?this[e]:i,this._valueToNodeAttribute(this,i,t||this.constructor.attributeNameForProperty(e)),this.__serializing=!1}_valueToNodeAttribute(e,t,i){const n=this._serializeValue(t);"class"!==i&&"name"!==i&&"slot"!==i||(e=wrap(e)),void 0===n?e.removeAttribute(i):e.setAttribute(i,""===n&&window.trustedTypes?window.trustedTypes.emptyScript:n)}_serializeValue(e){return"boolean"==typeof e?e?"":void 0:null!=e?e.toString():void 0}_deserializeValue(e,t){switch(t){case Boolean:return null!==e;case Number:return Number(e);default:return e}}}),nativeProperties={};let proto=HTMLElement.prototype;for(;proto;){let e=Object.getOwnPropertyNames(proto);for(let t=0;ttrustedTypes.isHTML(e)||trustedTypes.isScript(e)||trustedTypes.isScriptURL(e):()=>!1;function saveAccessorValue(e,t){if(!nativeProperties[t]){let i=e[t];void 0!==i&&(e.__data?e._setPendingProperty(t,i):(e.__dataProto?e.hasOwnProperty(JSCompiler_renameProperty("__dataProto",e))||(e.__dataProto=Object.create(e.__dataProto)):e.__dataProto={},e.__dataProto[t]=i))}}const PropertyAccessors=dedupingMixin(e=>{const t=PropertiesChanged(e);return class extends t{static createPropertiesForAttributes(){let e=this.observedAttributes;for(let t=0;t{throw e})}}microtaskCallbacks.splice(0,e),microtaskLastHandle+=e}new window.MutationObserver(microtaskFlush).observe(microtaskNode,{characterData:!0});const timeOut={after:e=>({run:t=>window.setTimeout(t,e),cancel(e){window.clearTimeout(e)}}),run:(e,t)=>window.setTimeout(e,t),cancel(e){window.clearTimeout(e)}},microTask={run:e=>(microtaskScheduled||(microtaskScheduled=!0,microtaskNode.textContent=microtaskNodeContent++),microtaskCallbacks.push(e),microtaskCurrHandle++),cancel(e){const t=e-microtaskLastHandle;if(t>=0){if(!microtaskCallbacks[t])throw new Error("invalid async handle: "+e);microtaskCallbacks[t]=null}}},microtask=microTask,PropertiesChanged=dedupingMixin(e=>class extends e{static createProperties(e){const t=this.prototype;for(let n in e)n in t||t._createPropertyAccessor(n)}static attributeNameForProperty(e){return e.toLowerCase()}static typeForProperty(e){}_createPropertyAccessor(e,t){this._addPropertyToAttributeMap(e),this.hasOwnProperty(JSCompiler_renameProperty("__dataHasAccessor",this))||(this.__dataHasAccessor=Object.assign({},this.__dataHasAccessor)),this.__dataHasAccessor[e]||(this.__dataHasAccessor[e]=!0,this._definePropertyAccessor(e,t))}_addPropertyToAttributeMap(e){this.hasOwnProperty(JSCompiler_renameProperty("__dataAttributes",this))||(this.__dataAttributes=Object.assign({},this.__dataAttributes));let t=this.__dataAttributes[e];return t||(t=this.constructor.attributeNameForProperty(e),this.__dataAttributes[t]=e),t}_definePropertyAccessor(e,t){Object.defineProperty(this,e,{get(){return this.__data[e]},set:t?function(){}:function(t){this._setPendingProperty(e,t,!0)&&this._invalidateProperties()}})}constructor(){super(),this.__dataEnabled=!1,this.__dataReady=!1,this.__dataInvalid=!1,this.__data={},this.__dataPending=null,this.__dataOld=null,this.__dataInstanceProps=null,this.__dataCounter=0,this.__serializing=!1,this._initializeProperties()}ready(){this.__dataReady=!0,this._flushProperties()}_initializeProperties(){for(let e in this.__dataHasAccessor)this.hasOwnProperty(e)&&(this.__dataInstanceProps=this.__dataInstanceProps||{},this.__dataInstanceProps[e]=this[e],delete this[e])}_initializeInstanceProperties(e){Object.assign(this,e)}_setProperty(e,t){this._setPendingProperty(e,t)&&this._invalidateProperties()}_getProperty(e){return this.__data[e]}_setPendingProperty(e,t,n){let r=this.__data[e],o=this._shouldPropertyChange(e,t,r);return o&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),this.__dataOld&&!(e in this.__dataOld)&&(this.__dataOld[e]=r),this.__data[e]=t,this.__dataPending[e]=t),o}_isPropertyPending(e){return!(!this.__dataPending||!this.__dataPending.hasOwnProperty(e))}_invalidateProperties(){!this.__dataInvalid&&this.__dataReady&&(this.__dataInvalid=!0,microtask.run(()=>{this.__dataInvalid&&(this.__dataInvalid=!1,this._flushProperties())}))}_enableProperties(){this.__dataEnabled||(this.__dataEnabled=!0,this.__dataInstanceProps&&(this._initializeInstanceProperties(this.__dataInstanceProps),this.__dataInstanceProps=null),this.ready())}_flushProperties(){this.__dataCounter++;const e=this.__data,t=this.__dataPending,n=this.__dataOld;this._shouldPropertiesChange(e,t,n)&&(this.__dataPending=null,this.__dataOld=null,this._propertiesChanged(e,t,n)),this.__dataCounter--}_shouldPropertiesChange(e,t,n){return Boolean(t)}_propertiesChanged(e,t,n){}_shouldPropertyChange(e,t,n){return n!==t&&(n==n||t==t)}attributeChangedCallback(e,t,n,r){t!==n&&this._attributeToProperty(e,n),super.attributeChangedCallback&&super.attributeChangedCallback(e,t,n,r)}_attributeToProperty(e,t,n){if(!this.__serializing){const r=this.__dataAttributes,o=r&&r[e]||e;this[o]=this._deserializeValue(t,n||this.constructor.typeForProperty(o))}}_propertyToAttribute(e,t,n){this.__serializing=!0,n=arguments.length<3?this[e]:n,this._valueToNodeAttribute(this,n,t||this.constructor.attributeNameForProperty(e)),this.__serializing=!1}_valueToNodeAttribute(e,t,n){const r=this._serializeValue(t);"class"!==n&&"name"!==n&&"slot"!==n||(e=wrap$1(e)),void 0===r?e.removeAttribute(n):e.setAttribute(n,""===r&&window.trustedTypes?window.trustedTypes.emptyScript:r)}_serializeValue(e){return"boolean"==typeof e?e?"":void 0:null!=e?e.toString():void 0}_deserializeValue(e,t){switch(t){case Boolean:return null!==e;case Number:return Number(e);default:return e}}}),nativeProperties={};let proto=HTMLElement.prototype;for(;proto;){let e=Object.getOwnPropertyNames(proto);for(let t=0;ttrustedTypes.isHTML(e)||trustedTypes.isScript(e)||trustedTypes.isScriptURL(e):()=>!1;function saveAccessorValue(e,t){if(!nativeProperties[t]){let n=e[t];void 0!==n&&(e.__data?e._setPendingProperty(t,n):(e.__dataProto?e.hasOwnProperty(JSCompiler_renameProperty("__dataProto",e))||(e.__dataProto=Object.create(e.__dataProto)):e.__dataProto={},e.__dataProto[t]=n))}}const PropertyAccessors=dedupingMixin(e=>{const t=PropertiesChanged(e);return class extends t{static createPropertiesForAttributes(){let e=this.observedAttributes;for(let t=0;t{const e=window.trustedTypes&&window.trustedTypes.createPolicy("polymer-template-event-attribute-policy",{createScript:e=>e});return(t,i,n)=>{const r=i.getAttribute(n);e&&n.startsWith("on-")?t.setAttribute(n,e.createScript(r,n)):t.setAttribute(n,r)}})();function wrapTemplateExtension(e){let t=e.getAttribute("is");if(t&&templateExtensions[t]){let i=e;for(i.removeAttribute("is"),e=i.ownerDocument.createElement(t),i.parentNode.replaceChild(e,i),e.appendChild(i);i.attributes.length;){const{name:t}=i.attributes[0];copyAttributeWithTemplateEventPolicy(e,i,t),i.removeAttribute(t)}}return e}function findTemplateNode(e,t){let i=t.parentInfo&&findTemplateNode(e,t.parentInfo);if(!i)return e;for(let e=i.firstChild,n=0;e;e=e.nextSibling)if(t.parentIndex===n++)return e}function applyIdToMap(e,t,i,n){n.id&&(t[n.id]=i)}function applyEventListener(e,t,i){if(i.events&&i.events.length)for(let n,r=0,a=i.events;rclass extends e{static _parseTemplate(e,t){if(!e._templateInfo){let i=e._templateInfo={};i.nodeInfoList=[],i.nestedTemplate=Boolean(t),i.stripWhiteSpace=t&&t.stripWhiteSpace||e.hasAttribute&&e.hasAttribute("strip-whitespace"),this._parseTemplateContent(e,i,{parent:null})}return e._templateInfo}static _parseTemplateContent(e,t,i){return this._parseTemplateNode(e.content,t,i)}static _parseTemplateNode(e,t,i){let n=!1,r=e;return"template"!=r.localName||r.hasAttribute("preserve-content")?"slot"===r.localName&&(t.hasInsertionPoint=!0):n=this._parseTemplateNestedTemplate(r,t,i)||n,fixPlaceholder(r),r.firstChild&&this._parseTemplateChildNodes(r,t,i),r.hasAttributes&&r.hasAttributes()&&(n=this._parseTemplateNodeAttributes(r,t,i)||n),n||i.noted}static _parseTemplateChildNodes(e,t,i){if("script"!==e.localName&&"style"!==e.localName)for(let n,r=e.firstChild,a=0;r;r=n){if("template"==r.localName&&(r=wrapTemplateExtension(r)),n=r.nextSibling,r.nodeType===Node.TEXT_NODE){let i=n;for(;i&&i.nodeType===Node.TEXT_NODE;)r.textContent+=i.textContent,n=i.nextSibling,e.removeChild(i),i=n;if(t.stripWhiteSpace&&!r.textContent.trim()){e.removeChild(r);continue}}let s={parentIndex:a,parentInfo:i};this._parseTemplateNode(r,t,s)&&(s.infoIndex=t.nodeInfoList.push(s)-1),r.parentNode&&a++}}static _parseTemplateNestedTemplate(e,t,i){let n=e,r=this._parseTemplate(n,t);return(r.content=n.content.ownerDocument.createDocumentFragment()).appendChild(n.content),i.templateInfo=r,!0}static _parseTemplateNodeAttributes(e,t,i){let n=!1,r=Array.from(e.attributes);for(let a,s=r.length-1;a=r[s];s--)n=this._parseTemplateNodeAttribute(e,t,i,a.name,a.value)||n;return n}static _parseTemplateNodeAttribute(e,t,i,n,r){return"on-"===n.slice(0,3)?(e.removeAttribute(n),i.events=i.events||[],i.events.push({name:n.slice(3),value:r}),!0):"id"===n&&(i.id=r,!0)}static _contentForTemplate(e){let t=e._templateInfo;return t&&t.content||e.content}_stampTemplate(e,t){e&&!e.content&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(e);let i=(t=t||this.constructor._parseTemplate(e)).nodeInfoList,n=t.content||e.content,r=document.importNode(n,!0);r.__noInsertionPoint=!t.hasInsertionPoint;let a=r.nodeList=new Array(i.length);r.$={};for(let e,n=0,s=i.length;n{const e=window.trustedTypes&&window.trustedTypes.createPolicy("polymer-template-event-attribute-policy",{createScript:e=>e});return(t,n,r)=>{const o=n.getAttribute(r);e&&r.startsWith("on-")?t.setAttribute(r,e.createScript(o,r)):t.setAttribute(r,o)}})();function wrapTemplateExtension(e){let t=e.getAttribute("is");if(t&&templateExtensions[t]){let n=e;for(n.removeAttribute("is"),e=n.ownerDocument.createElement(t),n.parentNode.replaceChild(e,n),e.appendChild(n);n.attributes.length;){const{name:t}=n.attributes[0];copyAttributeWithTemplateEventPolicy(e,n,t),n.removeAttribute(t)}}return e}function findTemplateNode(e,t){let n=t.parentInfo&&findTemplateNode(e,t.parentInfo);if(!n)return e;for(let e=n.firstChild,r=0;e;e=e.nextSibling)if(t.parentIndex===r++)return e}function applyIdToMap(e,t,n,r){r.id&&(t[r.id]=n)}function applyEventListener(e,t,n){if(n.events&&n.events.length)for(let r,o=0,i=n.events;oclass extends e{static _parseTemplate(e,t){if(!e._templateInfo){let n=e._templateInfo={};n.nodeInfoList=[],n.nestedTemplate=Boolean(t),n.stripWhiteSpace=t&&t.stripWhiteSpace||e.hasAttribute&&e.hasAttribute("strip-whitespace"),this._parseTemplateContent(e,n,{parent:null})}return e._templateInfo}static _parseTemplateContent(e,t,n){return this._parseTemplateNode(e.content,t,n)}static _parseTemplateNode(e,t,n){let r=!1,o=e;return"template"!=o.localName||o.hasAttribute("preserve-content")?"slot"===o.localName&&(t.hasInsertionPoint=!0):r=this._parseTemplateNestedTemplate(o,t,n)||r,fixPlaceholder(o),o.firstChild&&this._parseTemplateChildNodes(o,t,n),o.hasAttributes&&o.hasAttributes()&&(r=this._parseTemplateNodeAttributes(o,t,n)||r),r||n.noted}static _parseTemplateChildNodes(e,t,n){if("script"!==e.localName&&"style"!==e.localName)for(let r,o=e.firstChild,i=0;o;o=r){if("template"==o.localName&&(o=wrapTemplateExtension(o)),r=o.nextSibling,o.nodeType===Node.TEXT_NODE){let n=r;for(;n&&n.nodeType===Node.TEXT_NODE;)o.textContent+=n.textContent,r=n.nextSibling,e.removeChild(n),n=r;if(t.stripWhiteSpace&&!o.textContent.trim()){e.removeChild(o);continue}}let s={parentIndex:i,parentInfo:n};this._parseTemplateNode(o,t,s)&&(s.infoIndex=t.nodeInfoList.push(s)-1),o.parentNode&&i++}}static _parseTemplateNestedTemplate(e,t,n){let r=e,o=this._parseTemplate(r,t);return(o.content=r.content.ownerDocument.createDocumentFragment()).appendChild(r.content),n.templateInfo=o,!0}static _parseTemplateNodeAttributes(e,t,n){let r=!1,o=Array.from(e.attributes);for(let i,s=o.length-1;i=o[s];s--)r=this._parseTemplateNodeAttribute(e,t,n,i.name,i.value)||r;return r}static _parseTemplateNodeAttribute(e,t,n,r,o){return"on-"===r.slice(0,3)?(e.removeAttribute(r),n.events=n.events||[],n.events.push({name:r.slice(3),value:o}),!0):"id"===r&&(n.id=o,!0)}static _contentForTemplate(e){let t=e._templateInfo;return t&&t.content||e.content}_stampTemplate(e,t){e&&!e.content&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(e);let n=(t=t||this.constructor._parseTemplate(e)).nodeInfoList,r=t.content||e.content,o=document.importNode(r,!0);o.__noInsertionPoint=!t.hasInsertionPoint;let i=o.nodeList=new Array(n.length);o.$={};for(let e,r=0,s=n.length;r{let n=0,r=t.length-1,a=-1;for(;n<=r;){const s=n+r>>1,o=i.get(t[s].methodInfo)-i.get(e.methodInfo);if(o<0)n=s+1;else{if(!(o>0)){a=s;break}r=s-1}}a<0&&(a=r+1),t.splice(a,0,e)},enqueueEffectsFor=(e,t,i,n,r)=>{const a=t[r?root(e):e];if(a)for(let t=0;t{const t=e.info.methodInfo;--s,0===--r[t]&&a.push(t)})}if(0!==s){const t=e;console.warn(`Computed graph for ${t.localName} incomplete; circular?`)}e.constructor.__orderedComputedDeps=t}return t}function dependencyCounts(e){const t=e[COMPUTE_INFO],i={},n=e[TYPES.COMPUTE],r=[];let a=0;for(let e in t){const n=t[e];a+=i[e]=n.args.filter(e=>!e.literal).length+(n.dynamicFn?1:0)}for(let e in n)t[e]||r.push(e);return{counts:i,ready:r,total:a}}function runComputedEffect(e,t,i,n,r){let a=runMethodEffect(e,t,i,n,r);if(a===NOOP)return!1;let s=r.methodInfo;return e.__dataHasAccessor&&e.__dataHasAccessor[s]?e._setPendingProperty(s,a,!0):(e[s]=a,!1)}function computeLinkedPaths(e,t,i){let n=e.__dataLinkedPaths;if(n){let r;for(let a in n){let s=n[a];isDescendant(a,t)?(r=translate(a,s,t),e._setPendingPropertyOrPath(r,i,!0,!0)):isDescendant(s,t)&&(r=translate(s,a,t),e._setPendingPropertyOrPath(r,i,!0,!0))}}}function addBinding(e,t,i,n,r,a,s){i.bindings=i.bindings||[];let o={kind:n,target:r,parts:a,literal:s,isCompound:1!==a.length};if(i.bindings.push(o),shouldAddListener(o)){let{event:e,negate:t}=o.parts[0];o.listenerEvent=e||camelToDashCase(r)+"-changed",o.listenerNegate=t}let l=t.nodeInfoList.length;for(let i=0;ih.source.length&&"property"==l.kind&&!l.isCompound&&o.__isPropertyEffectsClient&&o.__dataHasAccessor&&o.__dataHasAccessor[l.target]){let n=i[t];t=translate(h.source,l.target,t),o._setPendingPropertyOrPath(t,n,!1,!0)&&e._enqueueClient(o)}else{let s=r.evaluator._evaluateBinding(e,h,t,i,n,a);s!==NOOP&&applyBindingValue(e,o,l,h,s)}}function applyBindingValue(e,t,i,n,r){if(r=computeBindingValue(t,r,i,n),sanitizeDOMValue&&(r=sanitizeDOMValue(r,i.target,i.kind,t)),"attribute"==i.kind)e._valueToNodeAttribute(t,r,i.target);else{let n=i.target;t.__isPropertyEffectsClient&&t.__dataHasAccessor&&t.__dataHasAccessor[n]?t[TYPES.READ_ONLY]&&t[TYPES.READ_ONLY][n]||t._setPendingProperty(n,r)&&e._enqueueClient(t):e._setUnmanagedPropertyToNode(t,n,r)}}function computeBindingValue(e,t,i,n){if(i.isCompound){let r=e.__dataCompoundStorage[i.target];r[n.compoundIndex]=t,t=r.join("")}return"attribute"!==i.kind&&("textContent"!==i.target&&("value"!==i.target||"input"!==e.localName&&"textarea"!==e.localName)||(t=null==t?"":t)),t}function shouldAddListener(e){return Boolean(e.target)&&"attribute"!=e.kind&&"text"!=e.kind&&!e.isCompound&&"{"===e.parts[0].mode}function setupBindings(e,t){let{nodeList:i,nodeInfoList:n}=t;if(n.length)for(let t=0;t="0"&&n<="9"&&(n="#"),n){case"'":case'"':i.value=t.slice(1,-1),i.literal=!0;break;case"#":i.value=Number(t),i.literal=!0}return i.literal||(i.rootProperty=root(t),i.structured=isPath(t),i.structured&&(i.wildcard=".*"==t.slice(-2),i.wildcard&&(i.name=t.slice(0,-2)))),i}function getArgValue(e,t,i){let n=get(e,i);return void 0===n&&(n=t[i]),n}function notifySplices(e,t,i,n){const r={indexSplices:n};legacyUndefined&&!e._overrideLegacyUndefined&&(t.splices=r),e.notifyPath(i+".splices",r),e.notifyPath(i+".length",t.length),legacyUndefined&&!e._overrideLegacyUndefined&&(r.indexSplices=[])}function notifySplice(e,t,i,n,r,a){notifySplices(e,t,i,[{index:n,addedCount:r,removed:a,object:t,type:"splice"}])}function upper(e){return e[0].toUpperCase()+e.substring(1)}const PropertyEffects=dedupingMixin(e=>{const t=TemplateStamp(PropertyAccessors(e));return class extends t{constructor(){super(),this.__isPropertyEffectsClient=!0,this.__dataClientsReady,this.__dataPendingClients,this.__dataToNotify,this.__dataLinkedPaths,this.__dataHasPaths,this.__dataCompoundStorage,this.__dataHost,this.__dataTemp,this.__dataClientsInitialized,this.__data,this.__dataPending,this.__dataOld,this.__computeEffects,this.__computeInfo,this.__reflectEffects,this.__notifyEffects,this.__propagateEffects,this.__observeEffects,this.__readOnly,this.__templateInfo,this._overrideLegacyUndefined}get PROPERTY_EFFECT_TYPES(){return TYPES}_initializeProperties(){super._initializeProperties(),this._registerHost(),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}_registerHost(){if(hostStack.length){let e=hostStack[hostStack.length-1];e._enqueueClient(this),this.__dataHost=e}}_initializeProtoProperties(e){this.__data=Object.create(e),this.__dataPending=Object.create(e),this.__dataOld={}}_initializeInstanceProperties(e){let t=this[TYPES.READ_ONLY];for(let i in e)t&&t[i]||(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[i]=this.__dataPending[i]=e[i])}_addPropertyEffect(e,t,i){this._createPropertyAccessor(e,t==TYPES.READ_ONLY);let n=ensureOwnEffectMap(this,t,!0)[e];n||(n=this[t][e]=[]),n.push(i)}_removePropertyEffect(e,t,i){let n=ensureOwnEffectMap(this,t,!0)[e],r=n.indexOf(i);r>=0&&n.splice(r,1)}_hasPropertyEffect(e,t){let i=this[t];return Boolean(i&&i[e])}_hasReadOnlyEffect(e){return this._hasPropertyEffect(e,TYPES.READ_ONLY)}_hasNotifyEffect(e){return this._hasPropertyEffect(e,TYPES.NOTIFY)}_hasReflectEffect(e){return this._hasPropertyEffect(e,TYPES.REFLECT)}_hasComputedEffect(e){return this._hasPropertyEffect(e,TYPES.COMPUTE)}_setPendingPropertyOrPath(e,t,i,n){if(n||root(Array.isArray(e)?e[0]:e)!==e){if(!n){let i=get(this,e);if(!(e=set(this,e,t))||!super._shouldPropertyChange(e,t,i))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(e,t,i))return computeLinkedPaths(this,e,t),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[e])return this._setPendingProperty(e,t,i);this[e]=t}return!1}_setUnmanagedPropertyToNode(e,t,i){i===e[t]&&"object"!=typeof i||("className"===t&&(e=wrap(e)),e[t]=i)}_setPendingProperty(e,t,i){let n=this.__dataHasPaths&&isPath(e),r=n?this.__dataTemp:this.__data;return!!this._shouldPropertyChange(e,t,r[e])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),e in this.__dataOld||(this.__dataOld[e]=this.__data[e]),n?this.__dataTemp[e]=t:this.__data[e]=t,this.__dataPending[e]=t,(n||this[TYPES.NOTIFY]&&this[TYPES.NOTIFY][e])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[e]=i),!0)}_setProperty(e,t){this._setPendingProperty(e,t,!0)&&this._invalidateProperties()}_invalidateProperties(){this.__dataReady&&this._flushProperties()}_enqueueClient(e){this.__dataPendingClients=this.__dataPendingClients||[],e!==this&&this.__dataPendingClients.push(e)}_flushClients(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}__enableOrFlushClients(){let e=this.__dataPendingClients;if(e){this.__dataPendingClients=null;for(let t=0;t{runEffects(this,e.propertyEffects,t,i,n,e.nodeList);for(let r=e.firstChild;r;r=r.nextSibling)this._runEffectsForTemplate(r,t,i,n)};e.runEffects?e.runEffects(r,t,n):r(t,n)}linkPaths(e,t){e=normalize(e),t=normalize(t),this.__dataLinkedPaths=this.__dataLinkedPaths||{},this.__dataLinkedPaths[e]=t}unlinkPaths(e){e=normalize(e),this.__dataLinkedPaths&&delete this.__dataLinkedPaths[e]}notifySplices(e,t){let i={path:""};notifySplices(this,get(this,e,i),i.path,t)}get(e,t){return get(t||this,e)}set(e,t,i){i?set(i,e,t):this[TYPES.READ_ONLY]&&this[TYPES.READ_ONLY][e]||this._setPendingPropertyOrPath(e,t,!0)&&this._invalidateProperties()}push(e,...t){let i={path:""},n=get(this,e,i),r=n.length,a=n.push(...t);return t.length&¬ifySplice(this,n,i.path,r,t.length,[]),a}pop(e){let t={path:""},i=get(this,e,t),n=Boolean(i.length),r=i.pop();return n&¬ifySplice(this,i,t.path,i.length,0,[r]),r}splice(e,t,i,...n){let r,a={path:""},s=get(this,e,a);return t<0?t=s.length-Math.floor(-t):t&&(t=Math.floor(t)),r=2===arguments.length?s.splice(t):s.splice(t,i,...n),(n.length||r.length)&¬ifySplice(this,s,a.path,t,n.length,r),r}shift(e){let t={path:""},i=get(this,e,t),n=Boolean(i.length),r=i.shift();return n&¬ifySplice(this,i,t.path,0,0,[r]),r}unshift(e,...t){let i={path:""},n=get(this,e,i),r=n.unshift(...t);return t.length&¬ifySplice(this,n,i.path,0,t.length,[]),r}notifyPath(e,t){let i;if(1==arguments.length){let n={path:""};t=get(this,e,n),i=n.path}else i=Array.isArray(e)?normalize(e):e;this._setPendingPropertyOrPath(i,t,!0,!0)&&this._invalidateProperties()}_createReadOnlyProperty(e,t){this._addPropertyEffect(e,TYPES.READ_ONLY),t&&(this["_set"+upper(e)]=function(t){this._setProperty(e,t)})}_createPropertyObserver(e,t,i){let n={property:e,method:t,dynamicFn:Boolean(i)};this._addPropertyEffect(e,TYPES.OBSERVE,{fn:runObserverEffect,info:n,trigger:{name:e}}),i&&this._addPropertyEffect(t,TYPES.OBSERVE,{fn:runObserverEffect,info:n,trigger:{name:t}})}_createMethodObserver(e,t){let i=parseMethod(e);if(!i)throw new Error("Malformed observer expression '"+e+"'");createMethodEffect(this,i,TYPES.OBSERVE,runMethodEffect,null,t)}_createNotifyingProperty(e){this._addPropertyEffect(e,TYPES.NOTIFY,{fn:runNotifyEffect,info:{eventName:camelToDashCase(e)+"-changed",property:e}})}_createReflectedProperty(e){let t=this.constructor.attributeNameForProperty(e);"-"===t[0]?console.warn("Property "+e+" cannot be reflected to attribute "+t+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.'):this._addPropertyEffect(e,TYPES.REFLECT,{fn:runReflectEffect,info:{attrName:t}})}_createComputedProperty(e,t,i){let n=parseMethod(t);if(!n)throw new Error("Malformed computed expression '"+t+"'");const r=createMethodEffect(this,n,TYPES.COMPUTE,runComputedEffect,e,i);ensureOwnEffectMap(this,COMPUTE_INFO)[e]=r}_marshalArgs(e,t,i){const n=this.__data,r=[];for(let a=0,s=e.length;a1)return NOOP;r[a]=h}return r}static addPropertyEffect(e,t,i){this.prototype._addPropertyEffect(e,t,i)}static createPropertyObserver(e,t,i){this.prototype._createPropertyObserver(e,t,i)}static createMethodObserver(e,t){this.prototype._createMethodObserver(e,t)}static createNotifyingProperty(e){this.prototype._createNotifyingProperty(e)}static createReadOnlyProperty(e,t){this.prototype._createReadOnlyProperty(e,t)}static createReflectedProperty(e){this.prototype._createReflectedProperty(e)}static createComputedProperty(e,t,i){this.prototype._createComputedProperty(e,t,i)}static bindTemplate(e){return this.prototype._bindTemplate(e)}_bindTemplate(e,t){let i=this.constructor._parseTemplate(e),n=this.__preBoundTemplateInfo==i;if(!n)for(let e in i.propertyEffects)this._createPropertyAccessor(e);if(t)if(i=Object.create(i),i.wasPreBound=n,this.__templateInfo){const t=e._parentTemplateInfo||this.__templateInfo,n=t.lastChild;i.parent=t,t.lastChild=i,i.previousSibling=n,n?n.nextSibling=i:t.firstChild=i}else this.__templateInfo=i;else this.__preBoundTemplateInfo=i;return i}static _addTemplatePropertyEffect(e,t,i){(e.hostProps=e.hostProps||{})[t]=!0;let n=e.propertyEffects=e.propertyEffects||{};(n[t]=n[t]||[]).push(i)}_stampTemplate(e,t){t=t||this._bindTemplate(e,!0),hostStack.push(this);let i=super._stampTemplate(e,t);if(hostStack.pop(),t.nodeList=i.nodeList,!t.wasPreBound){let e=t.childNodes=[];for(let t=i.firstChild;t;t=t.nextSibling)e.push(t)}return i.templateInfo=t,setupBindings(this,t),this.__dataClientsReady&&(this._runEffectsForTemplate(t,this.__data,null,!1),this._flushClients()),i}_removeBoundDom(e){const t=e.templateInfo,{previousSibling:i,nextSibling:n,parent:r}=t;i?i.nextSibling=n:r&&(r.firstChild=n),n?n.previousSibling=i:r&&(r.lastChild=i),t.nextSibling=t.previousSibling=null;let a=t.childNodes;for(let e=0;er&&n.push({literal:e.slice(r,i.index)});let a=i[1][0],s=Boolean(i[2]),o=i[3].trim(),l=!1,h="",c=-1;"{"==a&&(c=o.indexOf("::"))>0&&(h=o.substring(c+2),o=o.substring(0,c),l=!0);let p=parseMethod(o),d=[];if(p){let{args:e,methodName:i}=p;for(let t=0;t{let r=0,o=t.length-1,i=-1;for(;r<=o;){const s=r+o>>1,a=n.get(t[s].methodInfo)-n.get(e.methodInfo);if(a<0)r=s+1;else{if(!(a>0)){i=s;break}o=s-1}}i<0&&(i=o+1),t.splice(i,0,e)},enqueueEffectsFor=(e,t,n,r,o)=>{const i=t[o?root(e):e];if(i)for(let t=0;t{const t=e.info.methodInfo;--s,0===--o[t]&&i.push(t)})}if(0!==s){const t=e;console.warn(`Computed graph for ${t.localName} incomplete; circular?`)}e.constructor.__orderedComputedDeps=t}return t}function dependencyCounts(e){const t=e[COMPUTE_INFO],n={},r=e[TYPES.COMPUTE],o=[];let i=0;for(let e in t){const r=t[e];i+=n[e]=r.args.filter(e=>!e.literal).length+(r.dynamicFn?1:0)}for(let e in r)t[e]||o.push(e);return{counts:n,ready:o,total:i}}function runComputedEffect(e,t,n,r,o){let i=runMethodEffect(e,t,n,r,o);if(i===NOOP)return!1;let s=o.methodInfo;return e.__dataHasAccessor&&e.__dataHasAccessor[s]?e._setPendingProperty(s,i,!0):(e[s]=i,!1)}function computeLinkedPaths(e,t,n){let r=e.__dataLinkedPaths;if(r){let o;for(let i in r){let s=r[i];isDescendant(i,t)?(o=translate(i,s,t),e._setPendingPropertyOrPath(o,n,!0,!0)):isDescendant(s,t)&&(o=translate(s,i,t),e._setPendingPropertyOrPath(o,n,!0,!0))}}}function addBinding(e,t,n,r,o,i,s){n.bindings=n.bindings||[];let a={kind:r,target:o,parts:i,literal:s,isCompound:1!==i.length};if(n.bindings.push(a),shouldAddListener(a)){let{event:e,negate:t}=a.parts[0];a.listenerEvent=e||camelToDashCase(o)+"-changed",a.listenerNegate=t}let l=t.nodeInfoList.length;for(let n=0;nc.source.length&&"property"==l.kind&&!l.isCompound&&a.__isPropertyEffectsClient&&a.__dataHasAccessor&&a.__dataHasAccessor[l.target]){let r=n[t];t=translate(c.source,l.target,t),a._setPendingPropertyOrPath(t,r,!1,!0)&&e._enqueueClient(a)}else{let s=o.evaluator._evaluateBinding(e,c,t,n,r,i);s!==NOOP&&applyBindingValue(e,a,l,c,s)}}function applyBindingValue(e,t,n,r,o){if(o=computeBindingValue(t,o,n,r),sanitizeDOMValue&&(o=sanitizeDOMValue(o,n.target,n.kind,t)),"attribute"==n.kind)e._valueToNodeAttribute(t,o,n.target);else{let r=n.target;t.__isPropertyEffectsClient&&t.__dataHasAccessor&&t.__dataHasAccessor[r]?t[TYPES.READ_ONLY]&&t[TYPES.READ_ONLY][r]||t._setPendingProperty(r,o)&&e._enqueueClient(t):e._setUnmanagedPropertyToNode(t,r,o)}}function computeBindingValue(e,t,n,r){if(n.isCompound){let o=e.__dataCompoundStorage[n.target];o[r.compoundIndex]=t,t=o.join("")}return"attribute"!==n.kind&&("textContent"!==n.target&&("value"!==n.target||"input"!==e.localName&&"textarea"!==e.localName)||(t=null==t?"":t)),t}function shouldAddListener(e){return Boolean(e.target)&&"attribute"!=e.kind&&"text"!=e.kind&&!e.isCompound&&"{"===e.parts[0].mode}function setupBindings(e,t){let{nodeList:n,nodeInfoList:r}=t;if(r.length)for(let t=0;t="0"&&r<="9"&&(r="#"),r){case"'":case'"':n.value=t.slice(1,-1),n.literal=!0;break;case"#":n.value=Number(t),n.literal=!0}return n.literal||(n.rootProperty=root(t),n.structured=isPath(t),n.structured&&(n.wildcard=".*"==t.slice(-2),n.wildcard&&(n.name=t.slice(0,-2)))),n}function getArgValue(e,t,n){let r=get(e,n);return void 0===r&&(r=t[n]),r}function notifySplices(e,t,n,r){const o={indexSplices:r};legacyUndefined&&!e._overrideLegacyUndefined&&(t.splices=o),e.notifyPath(n+".splices",o),e.notifyPath(n+".length",t.length),legacyUndefined&&!e._overrideLegacyUndefined&&(o.indexSplices=[])}function notifySplice(e,t,n,r,o,i){notifySplices(e,t,n,[{index:r,addedCount:o,removed:i,object:t,type:"splice"}])}function upper(e){return e[0].toUpperCase()+e.substring(1)}const PropertyEffects=dedupingMixin(e=>{const t=TemplateStamp(PropertyAccessors(e));return class extends t{constructor(){super(),this.__isPropertyEffectsClient=!0,this.__dataClientsReady,this.__dataPendingClients,this.__dataToNotify,this.__dataLinkedPaths,this.__dataHasPaths,this.__dataCompoundStorage,this.__dataHost,this.__dataTemp,this.__dataClientsInitialized,this.__data,this.__dataPending,this.__dataOld,this.__computeEffects,this.__computeInfo,this.__reflectEffects,this.__notifyEffects,this.__propagateEffects,this.__observeEffects,this.__readOnly,this.__templateInfo,this._overrideLegacyUndefined}get PROPERTY_EFFECT_TYPES(){return TYPES}_initializeProperties(){super._initializeProperties(),this._registerHost(),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}_registerHost(){if(hostStack.length){let e=hostStack[hostStack.length-1];e._enqueueClient(this),this.__dataHost=e}}_initializeProtoProperties(e){this.__data=Object.create(e),this.__dataPending=Object.create(e),this.__dataOld={}}_initializeInstanceProperties(e){let t=this[TYPES.READ_ONLY];for(let n in e)t&&t[n]||(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[n]=this.__dataPending[n]=e[n])}_addPropertyEffect(e,t,n){this._createPropertyAccessor(e,t==TYPES.READ_ONLY);let r=ensureOwnEffectMap(this,t,!0)[e];r||(r=this[t][e]=[]),r.push(n)}_removePropertyEffect(e,t,n){let r=ensureOwnEffectMap(this,t,!0)[e],o=r.indexOf(n);o>=0&&r.splice(o,1)}_hasPropertyEffect(e,t){let n=this[t];return Boolean(n&&n[e])}_hasReadOnlyEffect(e){return this._hasPropertyEffect(e,TYPES.READ_ONLY)}_hasNotifyEffect(e){return this._hasPropertyEffect(e,TYPES.NOTIFY)}_hasReflectEffect(e){return this._hasPropertyEffect(e,TYPES.REFLECT)}_hasComputedEffect(e){return this._hasPropertyEffect(e,TYPES.COMPUTE)}_setPendingPropertyOrPath(e,t,n,r){if(r||root(Array.isArray(e)?e[0]:e)!==e){if(!r){let n=get(this,e);if(!(e=set(this,e,t))||!super._shouldPropertyChange(e,t,n))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(e,t,n))return computeLinkedPaths(this,e,t),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[e])return this._setPendingProperty(e,t,n);this[e]=t}return!1}_setUnmanagedPropertyToNode(e,t,n){n===e[t]&&"object"!=typeof n||("className"===t&&(e=wrap$1(e)),e[t]=n)}_setPendingProperty(e,t,n){let r=this.__dataHasPaths&&isPath(e),o=r?this.__dataTemp:this.__data;return!!this._shouldPropertyChange(e,t,o[e])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),e in this.__dataOld||(this.__dataOld[e]=this.__data[e]),r?this.__dataTemp[e]=t:this.__data[e]=t,this.__dataPending[e]=t,(r||this[TYPES.NOTIFY]&&this[TYPES.NOTIFY][e])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[e]=n),!0)}_setProperty(e,t){this._setPendingProperty(e,t,!0)&&this._invalidateProperties()}_invalidateProperties(){this.__dataReady&&this._flushProperties()}_enqueueClient(e){this.__dataPendingClients=this.__dataPendingClients||[],e!==this&&this.__dataPendingClients.push(e)}_flushClients(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}__enableOrFlushClients(){let e=this.__dataPendingClients;if(e){this.__dataPendingClients=null;for(let t=0;t{runEffects(this,e.propertyEffects,t,n,r,e.nodeList);for(let o=e.firstChild;o;o=o.nextSibling)this._runEffectsForTemplate(o,t,n,r)};e.runEffects?e.runEffects(o,t,r):o(t,r)}linkPaths(e,t){e=normalize$1(e),t=normalize$1(t),this.__dataLinkedPaths=this.__dataLinkedPaths||{},this.__dataLinkedPaths[e]=t}unlinkPaths(e){e=normalize$1(e),this.__dataLinkedPaths&&delete this.__dataLinkedPaths[e]}notifySplices(e,t){let n={path:""};notifySplices(this,get(this,e,n),n.path,t)}get(e,t){return get(t||this,e)}set(e,t,n){n?set(n,e,t):this[TYPES.READ_ONLY]&&this[TYPES.READ_ONLY][e]||this._setPendingPropertyOrPath(e,t,!0)&&this._invalidateProperties()}push(e,...t){let n={path:""},r=get(this,e,n),o=r.length,i=r.push(...t);return t.length&¬ifySplice(this,r,n.path,o,t.length,[]),i}pop(e){let t={path:""},n=get(this,e,t),r=Boolean(n.length),o=n.pop();return r&¬ifySplice(this,n,t.path,n.length,0,[o]),o}splice(e,t,n,...r){let o,i={path:""},s=get(this,e,i);return t<0?t=s.length-Math.floor(-t):t&&(t=Math.floor(t)),o=2===arguments.length?s.splice(t):s.splice(t,n,...r),(r.length||o.length)&¬ifySplice(this,s,i.path,t,r.length,o),o}shift(e){let t={path:""},n=get(this,e,t),r=Boolean(n.length),o=n.shift();return r&¬ifySplice(this,n,t.path,0,0,[o]),o}unshift(e,...t){let n={path:""},r=get(this,e,n),o=r.unshift(...t);return t.length&¬ifySplice(this,r,n.path,0,t.length,[]),o}notifyPath(e,t){let n;if(1==arguments.length){let r={path:""};t=get(this,e,r),n=r.path}else n=Array.isArray(e)?normalize$1(e):e;this._setPendingPropertyOrPath(n,t,!0,!0)&&this._invalidateProperties()}_createReadOnlyProperty(e,t){this._addPropertyEffect(e,TYPES.READ_ONLY),t&&(this["_set"+upper(e)]=function(t){this._setProperty(e,t)})}_createPropertyObserver(e,t,n){let r={property:e,method:t,dynamicFn:Boolean(n)};this._addPropertyEffect(e,TYPES.OBSERVE,{fn:runObserverEffect,info:r,trigger:{name:e}}),n&&this._addPropertyEffect(t,TYPES.OBSERVE,{fn:runObserverEffect,info:r,trigger:{name:t}})}_createMethodObserver(e,t){let n=parseMethod(e);if(!n)throw new Error("Malformed observer expression '"+e+"'");createMethodEffect(this,n,TYPES.OBSERVE,runMethodEffect,null,t)}_createNotifyingProperty(e){this._addPropertyEffect(e,TYPES.NOTIFY,{fn:runNotifyEffect,info:{eventName:camelToDashCase(e)+"-changed",property:e}})}_createReflectedProperty(e){let t=this.constructor.attributeNameForProperty(e);"-"===t[0]?console.warn("Property "+e+" cannot be reflected to attribute "+t+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.'):this._addPropertyEffect(e,TYPES.REFLECT,{fn:runReflectEffect,info:{attrName:t}})}_createComputedProperty(e,t,n){let r=parseMethod(t);if(!r)throw new Error("Malformed computed expression '"+t+"'");const o=createMethodEffect(this,r,TYPES.COMPUTE,runComputedEffect,e,n);ensureOwnEffectMap(this,COMPUTE_INFO)[e]=o}_marshalArgs(e,t,n){const r=this.__data,o=[];for(let i=0,s=e.length;i1)return NOOP;o[i]=c}return o}static addPropertyEffect(e,t,n){this.prototype._addPropertyEffect(e,t,n)}static createPropertyObserver(e,t,n){this.prototype._createPropertyObserver(e,t,n)}static createMethodObserver(e,t){this.prototype._createMethodObserver(e,t)}static createNotifyingProperty(e){this.prototype._createNotifyingProperty(e)}static createReadOnlyProperty(e,t){this.prototype._createReadOnlyProperty(e,t)}static createReflectedProperty(e){this.prototype._createReflectedProperty(e)}static createComputedProperty(e,t,n){this.prototype._createComputedProperty(e,t,n)}static bindTemplate(e){return this.prototype._bindTemplate(e)}_bindTemplate(e,t){let n=this.constructor._parseTemplate(e),r=this.__preBoundTemplateInfo==n;if(!r)for(let e in n.propertyEffects)this._createPropertyAccessor(e);if(t)if(n=Object.create(n),n.wasPreBound=r,this.__templateInfo){const t=e._parentTemplateInfo||this.__templateInfo,r=t.lastChild;n.parent=t,t.lastChild=n,n.previousSibling=r,r?r.nextSibling=n:t.firstChild=n}else this.__templateInfo=n;else this.__preBoundTemplateInfo=n;return n}static _addTemplatePropertyEffect(e,t,n){(e.hostProps=e.hostProps||{})[t]=!0;let r=e.propertyEffects=e.propertyEffects||{};(r[t]=r[t]||[]).push(n)}_stampTemplate(e,t){t=t||this._bindTemplate(e,!0),hostStack.push(this);let n=super._stampTemplate(e,t);if(hostStack.pop(),t.nodeList=n.nodeList,!t.wasPreBound){let e=t.childNodes=[];for(let t=n.firstChild;t;t=t.nextSibling)e.push(t)}return n.templateInfo=t,setupBindings(this,t),this.__dataClientsReady&&(this._runEffectsForTemplate(t,this.__data,null,!1),this._flushClients()),n}_removeBoundDom(e){const t=e.templateInfo,{previousSibling:n,nextSibling:r,parent:o}=t;n?n.nextSibling=r:o&&(o.firstChild=r),r?r.previousSibling=n:o&&(o.lastChild=n),t.nextSibling=t.previousSibling=null;let i=t.childNodes;for(let e=0;eo&&r.push({literal:e.slice(o,n.index)});let i=n[1][0],s=Boolean(n[2]),a=n[3].trim(),l=!1,c="",d=-1;"{"==i&&(d=a.indexOf("::"))>0&&(c=a.substring(d+2),a=a.substring(0,d),l=!0);let p=parseMethod(a),u=[];if(p){let{args:e,methodName:n}=p;for(let t=0;t{const t=PropertiesChanged(e);function i(e){const t=Object.getPrototypeOf(e);return t.prototype instanceof r?t:null}function n(e){if(!e.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",e))){let t=null;if(e.hasOwnProperty(JSCompiler_renameProperty("properties",e))){const i=e.properties;i&&(t=normalizeProperties(i))}e.__ownProperties=t}return e.__ownProperties}class r extends t{static get observedAttributes(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))){register$1(this.prototype);const e=this._properties;this.__observedAttributes=e?Object.keys(e).map(e=>this.prototype._addPropertyToAttributeMap(e)):[]}return this.__observedAttributes}static finalize(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__finalized",this))){const e=i(this);e&&e.finalize(),this.__finalized=!0,this._finalizeClass()}}static _finalizeClass(){const e=n(this);e&&this.createProperties(e)}static get _properties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__properties",this))){const e=i(this);this.__properties=Object.assign({},e&&e._properties,n(this))}return this.__properties}static typeForProperty(e){const t=this._properties[e];return t&&t.type}_initializeProperties(){this.constructor.finalize(),super._initializeProperties()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._enableProperties()}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback()}}return r}),version="3.5.2",builtCSS=window.ShadyCSS&&window.ShadyCSS.cssBuild,ElementMixin=dedupingMixin(e=>{const t=PropertiesMixin(PropertyEffects(e));function i(e,t,i,n){i.computed&&(i.readOnly=!0),i.computed&&(e._hasReadOnlyEffect(t)?console.warn(`Cannot redefine computed property '${t}'.`):e._createComputedProperty(t,i.computed,n)),i.readOnly&&!e._hasReadOnlyEffect(t)?e._createReadOnlyProperty(t,!i.computed):!1===i.readOnly&&e._hasReadOnlyEffect(t)&&console.warn(`Cannot make readOnly property '${t}' non-readOnly.`),i.reflectToAttribute&&!e._hasReflectEffect(t)?e._createReflectedProperty(t):!1===i.reflectToAttribute&&e._hasReflectEffect(t)&&console.warn(`Cannot make reflected property '${t}' non-reflected.`),i.notify&&!e._hasNotifyEffect(t)?e._createNotifyingProperty(t):!1===i.notify&&e._hasNotifyEffect(t)&&console.warn(`Cannot make notify property '${t}' non-notify.`),i.observer&&e._createPropertyObserver(t,i.observer,n[i.observer]),e._addPropertyToAttributeMap(t)}return class extends t{static get polymerElementVersion(){return"3.5.2"}static _finalizeClass(){t._finalizeClass.call(this);const e=((i=this).hasOwnProperty(JSCompiler_renameProperty("__ownObservers",i))||(i.__ownObservers=i.hasOwnProperty(JSCompiler_renameProperty("observers",i))?i.observers:null),i.__ownObservers);var i;e&&this.createObservers(e,this._properties),this._prepareTemplate()}static _prepareTemplate(){let e=this.template;e&&("string"==typeof e?(console.error("template getter must return HTMLTemplateElement"),e=null):legacyOptimizations||(e=e.cloneNode(!0))),this.prototype._template=e}static createProperties(e){for(let t in e)i(this.prototype,t,e[t],e)}static createObservers(e,t){const i=this.prototype;for(let n=0;n{t+=e.textContent,e.parentNode.removeChild(e)}),e._styleSheet=new CSSStyleSheet,e._styleSheet.replaceSync(t)}}}(this,t,e,i?resolveUrl(i):""),this.prototype._bindTemplate(t)}}connectedCallback(){window.ShadyCSS&&this._template&&window.ShadyCSS.styleElement(this),super.connectedCallback()}ready(){this._template&&(this.root=this._stampTemplate(this._template),this.$=this.root.$),super.ready()}_readyClients(){this._template&&(this.root=this._attachDom(this.root)),super._readyClients()}_attachDom(e){const t=wrap(this);if(t.attachShadow)return e?(t.shadowRoot||(t.attachShadow({mode:"open",shadyUpgradeFragment:e}),t.shadowRoot.appendChild(e),this.constructor._styleSheet&&(t.shadowRoot.adoptedStyleSheets=[this.constructor._styleSheet])),syncInitialRender&&window.ShadyDOM&&window.ShadyDOM.flushInitial(t.shadowRoot),t.shadowRoot):null;throw new Error("ShadowDOM not available. PolymerElement can create dom as children instead of in ShadowDOM by setting `this.root = this;` before `ready`.")}updateStyles(e){window.ShadyCSS&&window.ShadyCSS.styleSubtree(this,e)}resolveUrl(e,t){return!t&&this.importPath&&(t=resolveUrl(this.importPath)),resolveUrl(e,t)}static _parseTemplateContent(e,i,n){return i.dynamicFns=i.dynamicFns||this._properties,t._parseTemplateContent.call(this,e,i,n)}static _addTemplatePropertyEffect(e,i,n){return!legacyWarnings||i in this._properties||n.info.part.signature&&n.info.part.signature.static||n.info.part.hostProp||e.nestedTemplate||console.warn(`Property '${i}' used in template but not declared in 'properties'; attribute will not be observed.`),t._addTemplatePropertyEffect.call(this,e,i,n)}}}); +*/function normalizeProperties(e){const t={};for(let n in e){const r=e[n];t[n]="function"==typeof r?{type:r}:r}return t}const PropertiesMixin=dedupingMixin(e=>{const t=PropertiesChanged(e);function n(e){const t=Object.getPrototypeOf(e);return t.prototype instanceof o?t:null}function r(e){if(!e.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",e))){let t=null;if(e.hasOwnProperty(JSCompiler_renameProperty("properties",e))){const n=e.properties;n&&(t=normalizeProperties(n))}e.__ownProperties=t}return e.__ownProperties}class o extends t{static get observedAttributes(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))){register$1(this.prototype);const e=this._properties;this.__observedAttributes=e?Object.keys(e).map(e=>this.prototype._addPropertyToAttributeMap(e)):[]}return this.__observedAttributes}static finalize(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__finalized",this))){const e=n(this);e&&e.finalize(),this.__finalized=!0,this._finalizeClass()}}static _finalizeClass(){const e=r(this);e&&this.createProperties(e)}static get _properties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__properties",this))){const e=n(this);this.__properties=Object.assign({},e&&e._properties,r(this))}return this.__properties}static typeForProperty(e){const t=this._properties[e];return t&&t.type}_initializeProperties(){this.constructor.finalize(),super._initializeProperties()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._enableProperties()}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback()}}return o}),version="3.5.2",builtCSS=window.ShadyCSS&&window.ShadyCSS.cssBuild,ElementMixin=dedupingMixin(e=>{const t=PropertiesMixin(PropertyEffects(e));function n(e,t,n,r){n.computed&&(n.readOnly=!0),n.computed&&(e._hasReadOnlyEffect(t)?console.warn(`Cannot redefine computed property '${t}'.`):e._createComputedProperty(t,n.computed,r)),n.readOnly&&!e._hasReadOnlyEffect(t)?e._createReadOnlyProperty(t,!n.computed):!1===n.readOnly&&e._hasReadOnlyEffect(t)&&console.warn(`Cannot make readOnly property '${t}' non-readOnly.`),n.reflectToAttribute&&!e._hasReflectEffect(t)?e._createReflectedProperty(t):!1===n.reflectToAttribute&&e._hasReflectEffect(t)&&console.warn(`Cannot make reflected property '${t}' non-reflected.`),n.notify&&!e._hasNotifyEffect(t)?e._createNotifyingProperty(t):!1===n.notify&&e._hasNotifyEffect(t)&&console.warn(`Cannot make notify property '${t}' non-notify.`),n.observer&&e._createPropertyObserver(t,n.observer,r[n.observer]),e._addPropertyToAttributeMap(t)}return class extends t{static get polymerElementVersion(){return"3.5.2"}static _finalizeClass(){t._finalizeClass.call(this);const e=((n=this).hasOwnProperty(JSCompiler_renameProperty("__ownObservers",n))||(n.__ownObservers=n.hasOwnProperty(JSCompiler_renameProperty("observers",n))?n.observers:null),n.__ownObservers);var n;e&&this.createObservers(e,this._properties),this._prepareTemplate()}static _prepareTemplate(){let e=this.template;e&&("string"==typeof e?(console.error("template getter must return HTMLTemplateElement"),e=null):legacyOptimizations||(e=e.cloneNode(!0))),this.prototype._template=e}static createProperties(e){for(let t in e)n(this.prototype,t,e[t],e)}static createObservers(e,t){const n=this.prototype;for(let r=0;r{t+=e.textContent,e.parentNode.removeChild(e)}),e._styleSheet=new CSSStyleSheet,e._styleSheet.replaceSync(t)}}}(this,t,e,n?resolveUrl(n):""),this.prototype._bindTemplate(t)}}connectedCallback(){window.ShadyCSS&&this._template&&window.ShadyCSS.styleElement(this),super.connectedCallback()}ready(){this._template&&(this.root=this._stampTemplate(this._template),this.$=this.root.$),super.ready()}_readyClients(){this._template&&(this.root=this._attachDom(this.root)),super._readyClients()}_attachDom(e){const t=wrap$1(this);if(t.attachShadow)return e?(t.shadowRoot||(t.attachShadow({mode:"open",shadyUpgradeFragment:e}),t.shadowRoot.appendChild(e),this.constructor._styleSheet&&(t.shadowRoot.adoptedStyleSheets=[this.constructor._styleSheet])),syncInitialRender&&window.ShadyDOM&&window.ShadyDOM.flushInitial(t.shadowRoot),t.shadowRoot):null;throw new Error("ShadowDOM not available. PolymerElement can create dom as children instead of in ShadowDOM by setting `this.root = this;` before `ready`.")}updateStyles(e){window.ShadyCSS&&window.ShadyCSS.styleSubtree(this,e)}resolveUrl(e,t){return!t&&this.importPath&&(t=resolveUrl(this.importPath)),resolveUrl(e,t)}static _parseTemplateContent(e,n,r){return n.dynamicFns=n.dynamicFns||this._properties,t._parseTemplateContent.call(this,e,n,r)}static _addTemplatePropertyEffect(e,n,r){return!legacyWarnings||n in this._properties||r.info.part.signature&&r.info.part.signature.static||r.info.part.hostProp||e.nestedTemplate||console.warn(`Property '${n}' used in template but not declared in 'properties'; attribute will not be observed.`),t._addTemplatePropertyEffect.call(this,e,n,r)}}}); /** * @fileoverview * @suppress {checkPrototypalTypes} @@ -234,7 +234,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -class Debouncer{constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(e,t){this._asyncModule=e,this._callback=t,this._timer=this._asyncModule.run(()=>{this._timer=null,debouncerQueue.delete(this),this._callback()})}cancel(){this.isActive()&&(this._cancelAsync(),debouncerQueue.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}static debounce(e,t,i){return e instanceof Debouncer?e._cancelAsync():e=new Debouncer,e.setConfig(t,i),e}}let debouncerQueue=new Set;const enqueueDebouncer=function(e){debouncerQueue.add(e)},flushDebouncers=function(){const e=Boolean(debouncerQueue.size);return debouncerQueue.forEach(e=>{try{e.flush()}catch(e){setTimeout(()=>{throw e})}}),e}; +class Debouncer{constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(e,t){this._asyncModule=e,this._callback=t,this._timer=this._asyncModule.run(()=>{this._timer=null,debouncerQueue.delete(this),this._callback()})}cancel(){this.isActive()&&(this._cancelAsync(),debouncerQueue.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}static debounce(e,t,n){return e instanceof Debouncer?e._cancelAsync():e=new Debouncer,e.setConfig(t,n),e}}let debouncerQueue=new Set;const enqueueDebouncer=function(e){debouncerQueue.add(e)},flushDebouncers=function(){const e=Boolean(debouncerQueue.size);return debouncerQueue.forEach(e=>{try{e.flush()}catch(e){setTimeout(()=>{throw e})}}),e}; /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -244,7 +244,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -let HAS_NATIVE_TA="string"==typeof document.head.style.touchAction,GESTURE_KEY="__polymerGestures",HANDLED_OBJ="__polymerGesturesHandled",TOUCH_ACTION="__polymerGesturesTouchAction",TAP_DISTANCE=25,TRACK_DISTANCE=5,TRACK_LENGTH=2,MOUSE_TIMEOUT=2500,MOUSE_EVENTS=["mousedown","mousemove","mouseup","click"],MOUSE_WHICH_TO_BUTTONS=[0,1,4,2],MOUSE_HAS_BUTTONS=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}();function isMouseEvent(e){return MOUSE_EVENTS.indexOf(e)>-1}let supportsPassive=!1;function PASSIVE_TOUCH(e){if(!isMouseEvent(e)&&"touchend"!==e)return HAS_NATIVE_TA&&supportsPassive&&passiveTouchGestures?{passive:!0}:void 0}!function(){try{let e=Object.defineProperty({},"passive",{get(){supportsPassive=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}}();let IS_TOUCH_ONLY=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);const clickedLabels=[],labellable={button:!0,input:!0,keygen:!0,meter:!0,output:!0,textarea:!0,progress:!0,select:!0},canBeDisabled={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function canBeLabelled(e){return labellable[e.localName]||!1}function matchingLabels(e){let t=Array.prototype.slice.call(e.labels||[]);if(!t.length){t=[];try{let i=e.getRootNode();if(e.id){let n=i.querySelectorAll(`label[for = '${e.id}']`);for(let e=0;e-1}if(i[e]===POINTERSTATE.mouse.target)return}if(t)return;e.preventDefault(),e.stopPropagation()}};function setupTeardownMouseCanceller(e){let t=IS_TOUCH_ONLY?["click"]:MOUSE_EVENTS;for(let i,n=0;n=i.left&&n<=i.right&&r>=i.top&&r<=i.bottom)}return!1}let POINTERSTATE={mouse:{target:null,mouseIgnoreJob:null},touch:{x:0,y:0,id:-1,scrollDecided:!1}};function firstTouchAction(e){let t="auto",i=getComposedPath(e);for(let e,n=0;ne.composedPath&&e.composedPath()||[],gestures={},recognizers=[];function deepTargetFind(e,t){let i=document.elementFromPoint(e,t),n=i;for(;n&&n.shadowRoot&&!window.ShadyDOM;){let r=n;if(n=n.shadowRoot.elementFromPoint(e,t),r===n)break;n&&(i=n)}return i}function _findOriginalTarget(e){const t=getComposedPath(e);return t.length>0?t[0]:e.target}function _handleNative(e){let t,i=e.type,n=e.currentTarget[GESTURE_KEY];if(!n)return;let r=n[i];if(r){if(!e[HANDLED_OBJ]&&(e[HANDLED_OBJ]={},"touch"===i.slice(0,5))){let t=e.changedTouches[0];if("touchstart"===i&&1===e.touches.length&&(POINTERSTATE.touch.id=t.identifier),POINTERSTATE.touch.id!==t.identifier)return;HAS_NATIVE_TA||"touchstart"!==i&&"touchmove"!==i||_handleTouchAction(e)}if(t=e[HANDLED_OBJ],!t.skip){for(let i,n=0;n-1&&i.reset&&i.reset();for(let n,a=0;ar:"pan-y"===i&&(n=r>a)),n?e.preventDefault():prevent("track")}}function addListener(e,t,i){return!!gestures[t]&&(_add(e,t,i),!0)}function removeListener(e,t,i){return!!gestures[t]&&(_remove(e,t,i),!0)}function _add(e,t,i){let n=gestures[t],r=n.deps,a=n.name,s=e[GESTURE_KEY];s||(e[GESTURE_KEY]=s={});for(let t,i,n=0;n{e.style.touchAction=t}),e[TOUCH_ACTION]=t}function _fire(e,t,i){let n=new Event(t,{bubbles:!0,cancelable:!0,composed:!0});if(n.detail=i,wrap(e).dispatchEvent(n),n.defaultPrevented){let e=i.preventer||i.sourceEvent;e&&e.preventDefault&&e.preventDefault()}}function prevent(e){let t=_findRecognizerByEvent(e);t.info&&(t.info.prevent=!0)}function downupFire(e,t,i,n){t&&_fire(t,e,{x:i.clientX,y:i.clientY,sourceEvent:i,preventer:n,prevent:function(e){return prevent(e)}})}function trackHasMovedEnough(e,t,i){if(e.prevent)return!1;if(e.started)return!0;let n=Math.abs(e.x-t),r=Math.abs(e.y-i);return n>=TRACK_DISTANCE||r>=TRACK_DISTANCE}function trackFire(e,t,i){if(!t)return;let n,r=e.moves[e.moves.length-2],a=e.moves[e.moves.length-1],s=a.x-e.x,o=a.y-e.y,l=0;r&&(n=a.x-r.x,l=a.y-r.y),_fire(t,"track",{state:e.state,x:i.clientX,y:i.clientY,dx:s,dy:o,ddx:n,ddy:l,sourceEvent:i,hover:function(){return deepTargetFind(i.clientX,i.clientY)}})}function trackForward(e,t,i){let n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y),a=_findOriginalTarget(i||t);!a||canBeDisabled[a.localName]&&a.hasAttribute("disabled")||(isNaN(n)||isNaN(r)||n<=TAP_DISTANCE&&r<=TAP_DISTANCE||isSyntheticClick(t))&&(e.prevent||_fire(a,"tap",{x:t.clientX,y:t.clientY,sourceEvent:t,preventer:i}))} +let HAS_NATIVE_TA="string"==typeof document.head.style.touchAction,GESTURE_KEY="__polymerGestures",HANDLED_OBJ="__polymerGesturesHandled",TOUCH_ACTION="__polymerGesturesTouchAction",TAP_DISTANCE=25,TRACK_DISTANCE=5,TRACK_LENGTH=2,MOUSE_TIMEOUT=2500,MOUSE_EVENTS=["mousedown","mousemove","mouseup","click"],MOUSE_WHICH_TO_BUTTONS=[0,1,4,2],MOUSE_HAS_BUTTONS=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}();function isMouseEvent(e){return MOUSE_EVENTS.indexOf(e)>-1}let supportsPassive=!1;function PASSIVE_TOUCH(e){if(!isMouseEvent(e)&&"touchend"!==e)return HAS_NATIVE_TA&&supportsPassive&&passiveTouchGestures?{passive:!0}:void 0}!function(){try{let e=Object.defineProperty({},"passive",{get(){supportsPassive=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}}();let IS_TOUCH_ONLY=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);const clickedLabels=[],labellable={button:!0,input:!0,keygen:!0,meter:!0,output:!0,textarea:!0,progress:!0,select:!0},canBeDisabled={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function canBeLabelled(e){return labellable[e.localName]||!1}function matchingLabels(e){let t=Array.prototype.slice.call(e.labels||[]);if(!t.length){t=[];try{let n=e.getRootNode();if(e.id){let r=n.querySelectorAll(`label[for = '${e.id}']`);for(let e=0;e-1}if(n[e]===POINTERSTATE.mouse.target)return}if(t)return;e.preventDefault(),e.stopPropagation()}};function setupTeardownMouseCanceller(e){let t=IS_TOUCH_ONLY?["click"]:MOUSE_EVENTS;for(let n,r=0;r=n.left&&r<=n.right&&o>=n.top&&o<=n.bottom)}return!1}let POINTERSTATE={mouse:{target:null,mouseIgnoreJob:null},touch:{x:0,y:0,id:-1,scrollDecided:!1}};function firstTouchAction(e){let t="auto",n=getComposedPath(e);for(let e,r=0;re.composedPath&&e.composedPath()||[],gestures={},recognizers=[];function deepTargetFind(e,t){let n=document.elementFromPoint(e,t),r=n;for(;r&&r.shadowRoot&&!window.ShadyDOM;){let o=r;if(r=r.shadowRoot.elementFromPoint(e,t),o===r)break;r&&(n=r)}return n}function _findOriginalTarget(e){const t=getComposedPath(e);return t.length>0?t[0]:e.target}function _handleNative(e){let t,n=e.type,r=e.currentTarget[GESTURE_KEY];if(!r)return;let o=r[n];if(o){if(!e[HANDLED_OBJ]&&(e[HANDLED_OBJ]={},"touch"===n.slice(0,5))){let t=e.changedTouches[0];if("touchstart"===n&&1===e.touches.length&&(POINTERSTATE.touch.id=t.identifier),POINTERSTATE.touch.id!==t.identifier)return;HAS_NATIVE_TA||"touchstart"!==n&&"touchmove"!==n||_handleTouchAction(e)}if(t=e[HANDLED_OBJ],!t.skip){for(let n,r=0;r-1&&n.reset&&n.reset();for(let r,i=0;io:"pan-y"===n&&(r=o>i)),r?e.preventDefault():prevent("track")}}function addListener(e,t,n){return!!gestures[t]&&(_add(e,t,n),!0)}function removeListener(e,t,n){return!!gestures[t]&&(_remove(e,t,n),!0)}function _add(e,t,n){let r=gestures[t],o=r.deps,i=r.name,s=e[GESTURE_KEY];s||(e[GESTURE_KEY]=s={});for(let t,n,r=0;r{e.style.touchAction=t}),e[TOUCH_ACTION]=t}function _fire(e,t,n){let r=new Event(t,{bubbles:!0,cancelable:!0,composed:!0});if(r.detail=n,wrap$1(e).dispatchEvent(r),r.defaultPrevented){let e=n.preventer||n.sourceEvent;e&&e.preventDefault&&e.preventDefault()}}function prevent(e){let t=_findRecognizerByEvent(e);t.info&&(t.info.prevent=!0)}function downupFire(e,t,n,r){t&&_fire(t,e,{x:n.clientX,y:n.clientY,sourceEvent:n,preventer:r,prevent:function(e){return prevent(e)}})}function trackHasMovedEnough(e,t,n){if(e.prevent)return!1;if(e.started)return!0;let r=Math.abs(e.x-t),o=Math.abs(e.y-n);return r>=TRACK_DISTANCE||o>=TRACK_DISTANCE}function trackFire(e,t,n){if(!t)return;let r,o=e.moves[e.moves.length-2],i=e.moves[e.moves.length-1],s=i.x-e.x,a=i.y-e.y,l=0;o&&(r=i.x-o.x,l=i.y-o.y),_fire(t,"track",{state:e.state,x:n.clientX,y:n.clientY,dx:s,dy:a,ddx:r,ddy:l,sourceEvent:n,hover:function(){return deepTargetFind(n.clientX,n.clientY)}})}function trackForward(e,t,n){let r=Math.abs(t.clientX-e.x),o=Math.abs(t.clientY-e.y),i=_findOriginalTarget(n||t);!i||canBeDisabled[i.localName]&&i.hasAttribute("disabled")||(isNaN(r)||isNaN(o)||r<=TAP_DISTANCE&&o<=TAP_DISTANCE||isSyntheticClick(t))&&(e.prevent||_fire(i,"tap",{x:t.clientX,y:t.clientY,sourceEvent:t,preventer:n}))} /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -253,7 +253,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/register({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){untrackDocument(this.info)},mousedown:function(e){if(!hasLeftMouseButton(e))return;let t=_findOriginalTarget(e),i=this;trackDocument(this.info,function(e){hasLeftMouseButton(e)||(downupFire("up",t,e),untrackDocument(i.info))},function(e){hasLeftMouseButton(e)&&downupFire("up",t,e),untrackDocument(i.info)}),downupFire("down",t,e)},touchstart:function(e){downupFire("down",_findOriginalTarget(e),e.changedTouches[0],e)},touchend:function(e){downupFire("up",_findOriginalTarget(e),e.changedTouches[0],e)}}),register({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove:function(e){this.moves.length>TRACK_LENGTH&&this.moves.shift(),this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset:function(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,untrackDocument(this.info)},mousedown:function(e){if(!hasLeftMouseButton(e))return;let t=_findOriginalTarget(e),i=this,n=function(e){let n=e.clientX,r=e.clientY;trackHasMovedEnough(i.info,n,r)&&(i.info.state=i.info.started?"mouseup"===e.type?"end":"track":"start","start"===i.info.state&&prevent("tap"),i.info.addMove({x:n,y:r}),hasLeftMouseButton(e)||(i.info.state="end",untrackDocument(i.info)),t&&trackFire(i.info,t,e),i.info.started=!0)};trackDocument(this.info,n,function(e){i.info.started&&n(e),untrackDocument(i.info)}),this.info.x=e.clientX,this.info.y=e.clientY},touchstart:function(e){let t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchmove:function(e){let t=_findOriginalTarget(e),i=e.changedTouches[0],n=i.clientX,r=i.clientY;trackHasMovedEnough(this.info,n,r)&&("start"===this.info.state&&prevent("tap"),this.info.addMove({x:n,y:r}),trackFire(this.info,t,i),this.info.state="track",this.info.started=!0)},touchend:function(e){let t=_findOriginalTarget(e),i=e.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:i.clientX,y:i.clientY}),trackFire(this.info,t,i))}}),register({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:function(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown:function(e){hasLeftMouseButton(e)&&(this.info.x=e.clientX,this.info.y=e.clientY)},click:function(e){hasLeftMouseButton(e)&&trackForward(this.info,e)},touchstart:function(e){const t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchend:function(e){trackForward(this.info,e.changedTouches[0],e)}});const GestureEventListeners=dedupingMixin(e=>class extends e{_addEventListenerToNode(e,t,i){addListener(e,t,i)||super._addEventListenerToNode(e,t,i)}_removeEventListenerFromNode(e,t,i){removeListener(e,t,i)||super._removeEventListenerFromNode(e,t,i)}}),HOST_DIR=/:host\(:dir\((ltr|rtl)\)\)/g,HOST_DIR_REPLACMENT=':host([dir="$1"])',EL_DIR=/([\s\w-#\.\[\]\*]*):dir\((ltr|rtl)\)/g,EL_DIR_REPLACMENT=':host([dir="$2"]) $1',DIR_CHECK=/:dir\((?:ltr|rtl)\)/,SHIM_SHADOW=Boolean(window.ShadyDOM&&window.ShadyDOM.inUse),DIR_INSTANCES=[]; +*/register({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){untrackDocument(this.info)},mousedown:function(e){if(!hasLeftMouseButton(e))return;let t=_findOriginalTarget(e),n=this;trackDocument(this.info,function(e){hasLeftMouseButton(e)||(downupFire("up",t,e),untrackDocument(n.info))},function(e){hasLeftMouseButton(e)&&downupFire("up",t,e),untrackDocument(n.info)}),downupFire("down",t,e)},touchstart:function(e){downupFire("down",_findOriginalTarget(e),e.changedTouches[0],e)},touchend:function(e){downupFire("up",_findOriginalTarget(e),e.changedTouches[0],e)}}),register({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove:function(e){this.moves.length>TRACK_LENGTH&&this.moves.shift(),this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset:function(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,untrackDocument(this.info)},mousedown:function(e){if(!hasLeftMouseButton(e))return;let t=_findOriginalTarget(e),n=this,r=function(e){let r=e.clientX,o=e.clientY;trackHasMovedEnough(n.info,r,o)&&(n.info.state=n.info.started?"mouseup"===e.type?"end":"track":"start","start"===n.info.state&&prevent("tap"),n.info.addMove({x:r,y:o}),hasLeftMouseButton(e)||(n.info.state="end",untrackDocument(n.info)),t&&trackFire(n.info,t,e),n.info.started=!0)};trackDocument(this.info,r,function(e){n.info.started&&r(e),untrackDocument(n.info)}),this.info.x=e.clientX,this.info.y=e.clientY},touchstart:function(e){let t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchmove:function(e){let t=_findOriginalTarget(e),n=e.changedTouches[0],r=n.clientX,o=n.clientY;trackHasMovedEnough(this.info,r,o)&&("start"===this.info.state&&prevent("tap"),this.info.addMove({x:r,y:o}),trackFire(this.info,t,n),this.info.state="track",this.info.started=!0)},touchend:function(e){let t=_findOriginalTarget(e),n=e.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:n.clientX,y:n.clientY}),trackFire(this.info,t,n))}}),register({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:function(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown:function(e){hasLeftMouseButton(e)&&(this.info.x=e.clientX,this.info.y=e.clientY)},click:function(e){hasLeftMouseButton(e)&&trackForward(this.info,e)},touchstart:function(e){const t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchend:function(e){trackForward(this.info,e.changedTouches[0],e)}});const GestureEventListeners=dedupingMixin(e=>class extends e{_addEventListenerToNode(e,t,n){addListener(e,t,n)||super._addEventListenerToNode(e,t,n)}_removeEventListenerFromNode(e,t,n){removeListener(e,t,n)||super._removeEventListenerFromNode(e,t,n)}}),HOST_DIR=/:host\(:dir\((ltr|rtl)\)\)/g,HOST_DIR_REPLACMENT=':host([dir="$1"])',EL_DIR=/([\s\w-#\.\[\]\*]*):dir\((ltr|rtl)\)/g,EL_DIR_REPLACMENT=':host([dir="$2"]) $1',DIR_CHECK=/:dir\((?:ltr|rtl)\)/,SHIM_SHADOW=Boolean(window.ShadyDOM&&window.ShadyDOM.inUse),DIR_INSTANCES=[]; /** * @fileoverview * @suppress {checkPrototypalTypes} @@ -264,7 +264,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by * Google as part of the polymer project is also subject to an additional IP * rights grant found at http://polymer.github.io/PATENTS.txt - */let observer=null,documentDir="";function getRTL(){documentDir=document.documentElement.getAttribute("dir")}function setRTL(e){if(!e.__autoDirOptOut){e.setAttribute("dir",documentDir)}}function updateDirection(){getRTL(),documentDir=document.documentElement.getAttribute("dir");for(let e=0;e{SHIM_SHADOW||observer||(getRTL(),observer=new MutationObserver(updateDirection),observer.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}));const t=PropertyAccessors(e);class i extends t{static _processStyleText(e,i){return e=t._processStyleText.call(this,e,i),!SHIM_SHADOW&&DIR_CHECK.test(e)&&(e=this._replaceDirInCssText(e),this.__activateDir=!0),e}static _replaceDirInCssText(e){let t=e;return t=t.replace(HOST_DIR,':host([dir="$1"])'),t=t.replace(EL_DIR,EL_DIR_REPLACMENT),t}constructor(){super(),this.__autoDirOptOut=!1}ready(){super.ready(),this.__autoDirOptOut=this.hasAttribute("dir")}connectedCallback(){t.prototype.connectedCallback&&super.connectedCallback(),this.constructor.__activateDir&&(takeRecords(),DIR_INSTANCES.push(this),setRTL(this))}disconnectedCallback(){if(t.prototype.disconnectedCallback&&super.disconnectedCallback(),this.constructor.__activateDir){const e=DIR_INSTANCES.indexOf(this);e>-1&&DIR_INSTANCES.splice(e,1)}}}return i.__activateDir=!1,i}); + */let observer=null,documentDir="";function getRTL(){documentDir=document.documentElement.getAttribute("dir")}function setRTL(e){if(!e.__autoDirOptOut){e.setAttribute("dir",documentDir)}}function updateDirection(){getRTL(),documentDir=document.documentElement.getAttribute("dir");for(let e=0;e{SHIM_SHADOW||observer||(getRTL(),observer=new MutationObserver(updateDirection),observer.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}));const t=PropertyAccessors(e);class n extends t{static _processStyleText(e,n){return e=t._processStyleText.call(this,e,n),!SHIM_SHADOW&&DIR_CHECK.test(e)&&(e=this._replaceDirInCssText(e),this.__activateDir=!0),e}static _replaceDirInCssText(e){let t=e;return t=t.replace(HOST_DIR,':host([dir="$1"])'),t=t.replace(EL_DIR,EL_DIR_REPLACMENT),t}constructor(){super(),this.__autoDirOptOut=!1}ready(){super.ready(),this.__autoDirOptOut=this.hasAttribute("dir")}connectedCallback(){t.prototype.connectedCallback&&super.connectedCallback(),this.constructor.__activateDir&&(takeRecords(),DIR_INSTANCES.push(this),setRTL(this))}disconnectedCallback(){if(t.prototype.disconnectedCallback&&super.disconnectedCallback(),this.constructor.__activateDir){const e=DIR_INSTANCES.indexOf(this);e>-1&&DIR_INSTANCES.splice(e,1)}}}return n.__activateDir=!1,n}); /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -283,7 +283,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -function newSplice(e,t,i){return{index:e,removed:t,addedCount:i}}"interactive"===document.readyState||"complete"===document.readyState?resolve():window.addEventListener("DOMContentLoaded",resolve);const EDIT_LEAVE=0,EDIT_UPDATE=1,EDIT_ADD=2,EDIT_DELETE=3;function calcEditDistances(e,t,i,n,r,a){let s=a-r+1,o=i-t+1,l=new Array(s);for(let e=0;e0||i>0;){if(0==t){r.push(2),i--;continue}if(0==i){r.push(3),t--;continue}let a,s=e[t-1][i-1],o=e[t-1][i],l=e[t][i-1];a=o0||n>0;){if(0==t){o.push(2),n--;continue}if(0==n){o.push(3),t--;continue}let i,s=e[t-1][n-1],a=e[t-1][n],l=e[t][n-1];i=a{this._schedule()},this.connect(),this._schedule()}connect(){isSlot(this._target)?this._listenSlots([this._target]):wrap(this._target).children&&(this._listenSlots(wrap(this._target).children),window.ShadyDOM?this._shadyChildrenObserver=window.ShadyDOM.observeChildren(this._target,e=>{this._processMutations(e)}):(this._nativeChildrenObserver=new MutationObserver(e=>{this._processMutations(e)}),this._nativeChildrenObserver.observe(this._target,{childList:!0}))),this._connected=!0}disconnect(){isSlot(this._target)?this._unlistenSlots([this._target]):wrap(this._target).children&&(this._unlistenSlots(wrap(this._target).children),window.ShadyDOM&&this._shadyChildrenObserver?(window.ShadyDOM.unobserveChildren(this._shadyChildrenObserver),this._shadyChildrenObserver=null):this._nativeChildrenObserver&&(this._nativeChildrenObserver.disconnect(),this._nativeChildrenObserver=null)),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,microTask.run(()=>this.flush()))}_processMutations(e){this._processSlotMutations(e),this.flush()}_processSlotMutations(e){if(e)for(let t=0;t{this._schedule()},this.connect(),this._schedule()}connect(){isSlot(this._target)?this._listenSlots([this._target]):wrap$1(this._target).children&&(this._listenSlots(wrap$1(this._target).children),window.ShadyDOM?this._shadyChildrenObserver=window.ShadyDOM.observeChildren(this._target,e=>{this._processMutations(e)}):(this._nativeChildrenObserver=new MutationObserver(e=>{this._processMutations(e)}),this._nativeChildrenObserver.observe(this._target,{childList:!0}))),this._connected=!0}disconnect(){isSlot(this._target)?this._unlistenSlots([this._target]):wrap$1(this._target).children&&(this._unlistenSlots(wrap$1(this._target).children),window.ShadyDOM&&this._shadyChildrenObserver?(window.ShadyDOM.unobserveChildren(this._shadyChildrenObserver),this._shadyChildrenObserver=null):this._nativeChildrenObserver&&(this._nativeChildrenObserver.disconnect(),this._nativeChildrenObserver=null)),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,microTask.run(()=>this.flush()))}_processMutations(e){this._processSlotMutations(e),this.flush()}_processSlotMutations(e){if(e)for(let t=0;t{"activeElement"!=t&&(e.prototype[t]=DomApiNative.prototype[t])}),forwardReadOnlyProperties(e.prototype,["classList"]),DomApiImpl=e,Object.defineProperties(EventApi.prototype,{localTarget:{get(){const e=this.event.currentTarget,t=e&&dom(e).getOwnerRoot(),i=this.path;for(let e=0;e{"activeElement"!=t&&(e.prototype[t]=DomApiNative.prototype[t])}),forwardReadOnlyProperties(e.prototype,["classList"]),DomApiImpl=e,Object.defineProperties(EventApi.prototype,{localTarget:{get(){const e=this.event.currentTarget,t=e&&dom(e).getOwnerRoot(),n=this.path;for(let e=0;e{if(!sameScope(e,r))return;const t=Array.from(ShadyDOM$1.nativeMethods.querySelectorAll.call(e,"*"));t.push(e);for(let e=0;e{for(let t=0;t{if(!sameScope(e,o))return;const t=Array.from(ShadyDOM$1.nativeMethods.querySelectorAll.call(e,"*"));t.push(e);for(let e=0;e{for(let t=0;t{for(;e;){const t=Object.getOwnPropertyDescriptor(e,"observedAttributes");if(t)return t.get;e=Object.getPrototypeOf(e.prototype).constructor}return()=>[]};dedupingMixin(e=>{const t=ElementMixin(e);let i=findObservedAttributesGetter(t);return class extends t{constructor(){super(),this.__isUpgradeDisabled}static get observedAttributes(){return i.call(this).concat(DISABLED_ATTR$1)}_initializeProperties(){this.hasAttribute(DISABLED_ATTR$1)?this.__isUpgradeDisabled=!0:super._initializeProperties()}_enableProperties(){this.__isUpgradeDisabled||super._enableProperties()}_canApplyPropertyDefault(e){return super._canApplyPropertyDefault(e)&&!(this.__isUpgradeDisabled&&this._isPropertyPending(e))}attributeChangedCallback(e,t,i,n){e==DISABLED_ATTR$1?this.__isUpgradeDisabled&&null==i&&(super._initializeProperties(),this.__isUpgradeDisabled=!1,wrap(this).isConnected&&super.connectedCallback()):super.attributeChangedCallback(e,t,i,n)}connectedCallback(){this.__isUpgradeDisabled||super.connectedCallback()}disconnectedCallback(){this.__isUpgradeDisabled||super.disconnectedCallback()}}}); + */const DISABLED_ATTR$1="disable-upgrade",findObservedAttributesGetter=e=>{for(;e;){const t=Object.getOwnPropertyDescriptor(e,"observedAttributes");if(t)return t.get;e=Object.getPrototypeOf(e.prototype).constructor}return()=>[]};dedupingMixin(e=>{const t=ElementMixin(e);let n=findObservedAttributesGetter(t);return class extends t{constructor(){super(),this.__isUpgradeDisabled}static get observedAttributes(){return n.call(this).concat(DISABLED_ATTR$1)}_initializeProperties(){this.hasAttribute(DISABLED_ATTR$1)?this.__isUpgradeDisabled=!0:super._initializeProperties()}_enableProperties(){this.__isUpgradeDisabled||super._enableProperties()}_canApplyPropertyDefault(e){return super._canApplyPropertyDefault(e)&&!(this.__isUpgradeDisabled&&this._isPropertyPending(e))}attributeChangedCallback(e,t,n,r){e==DISABLED_ATTR$1?this.__isUpgradeDisabled&&null==n&&(super._initializeProperties(),this.__isUpgradeDisabled=!1,wrap$1(this).isConnected&&super.connectedCallback()):super.attributeChangedCallback(e,t,n,r)}connectedCallback(){this.__isUpgradeDisabled||super.connectedCallback()}disconnectedCallback(){this.__isUpgradeDisabled||super.disconnectedCallback()}}}); /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -331,7 +331,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -const DISABLED_ATTR="disable-upgrade";let styleInterface=window.ShadyCSS;const LegacyElementMixin=dedupingMixin(e=>{const t=GestureEventListeners(ElementMixin(e)),i=builtCSS?t:DirMixin(t),n=findObservedAttributesGetter(i),r={x:"pan-x",y:"pan-y",none:"none",all:"auto"};class a extends i{constructor(){super(),this.isAttached,this.__boundListeners,this._debouncers,this.__isUpgradeDisabled,this.__needsAttributesAtConnected,this._legacyForceObservedAttributes}static get importMeta(){return this.prototype.importMeta}created(){}__attributeReaction(e,t,i){(this.__dataAttributes&&this.__dataAttributes[e]||e===DISABLED_ATTR)&&this.attributeChangedCallback(e,t,i,null)}setAttribute(e,t){if(legacyNoObservedAttributes&&!this._legacyForceObservedAttributes){const i=this.getAttribute(e);super.setAttribute(e,t),this.__attributeReaction(e,i,String(t))}else super.setAttribute(e,t)}removeAttribute(e){if(legacyNoObservedAttributes&&!this._legacyForceObservedAttributes){const t=this.getAttribute(e);super.removeAttribute(e),this.__attributeReaction(e,t,null)}else super.removeAttribute(e)}static get observedAttributes(){return legacyNoObservedAttributes&&!this.prototype._legacyForceObservedAttributes?(this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))||(this.__observedAttributes=[],register$1(this.prototype)),this.__observedAttributes):n.call(this).concat(DISABLED_ATTR)}_enableProperties(){this.__isUpgradeDisabled||super._enableProperties()}_canApplyPropertyDefault(e){return super._canApplyPropertyDefault(e)&&!(this.__isUpgradeDisabled&&this._isPropertyPending(e))}connectedCallback(){this.__needsAttributesAtConnected&&this._takeAttributes(),this.__isUpgradeDisabled||(super.connectedCallback(),this.isAttached=!0,this.attached())}attached(){}disconnectedCallback(){this.__isUpgradeDisabled||(super.disconnectedCallback(),this.isAttached=!1,this.detached())}detached(){}attributeChangedCallback(e,t,i,n){t!==i&&(e==DISABLED_ATTR?this.__isUpgradeDisabled&&null==i&&(this._initializeProperties(),this.__isUpgradeDisabled=!1,wrap(this).isConnected&&this.connectedCallback()):(super.attributeChangedCallback(e,t,i,n),this.attributeChanged(e,t,i)))}attributeChanged(e,t,i){}_initializeProperties(){if(legacyOptimizations&&this.hasAttribute(DISABLED_ATTR))this.__isUpgradeDisabled=!0;else{let e=Object.getPrototypeOf(this);e.hasOwnProperty(JSCompiler_renameProperty("__hasRegisterFinished",e))||(this._registered(),e.__hasRegisterFinished=!0),super._initializeProperties(),this.root=this,this.created(),legacyNoObservedAttributes&&!this._legacyForceObservedAttributes&&(this.hasAttributes()?this._takeAttributes():this.parentNode||(this.__needsAttributesAtConnected=!0)),this._applyListeners()}}_takeAttributes(){const e=this.attributes;for(let t=0,i=e.length;t0?timeOut.after(i):microTask,t.bind(this))}isDebouncerActive(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];return!(!t||!t.isActive())}flushDebouncer(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];t&&t.flush()}cancelDebouncer(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];t&&t.cancel()}async(e,t){return t>0?timeOut.run(e.bind(this),t):~microTask.run(e.bind(this))}cancelAsync(e){e<0?microTask.cancel(~e):timeOut.cancel(e)}create(e,t){let i=document.createElement(e);if(t)if(i.setProperties)i.setProperties(t);else for(let e in t)i[e]=t[e];return i}elementMatches(e,t){return matchesSelector(t||this,e)}toggleAttribute(e,t){let i=this;return 3===arguments.length&&(i=arguments[2]),1==arguments.length&&(t=!i.hasAttribute(e)),t?(wrap(i).setAttribute(e,""),!0):(wrap(i).removeAttribute(e),!1)}toggleClass(e,t,i){i=i||this,1==arguments.length&&(t=!i.classList.contains(e)),t?i.classList.add(e):i.classList.remove(e)}transform(e,t){(t=t||this).style.webkitTransform=e,t.style.transform=e}translate3d(e,t,i,n){n=n||this,this.transform("translate3d("+e+","+t+","+i+")",n)}arrayDelete(e,t){let i;if(Array.isArray(e)){if(i=e.indexOf(t),i>=0)return e.splice(i,1)}else{if(i=get(this,e).indexOf(t),i>=0)return this.splice(e,i,1)}return null}_logger(e,t){switch(Array.isArray(t)&&1===t.length&&Array.isArray(t[0])&&(t=t[0]),e){case"log":case"warn":case"error":console[e](...t)}}_log(...e){this._logger("log",e)}_warn(...e){this._logger("warn",e)}_error(...e){this._logger("error",e)}_logf(e,...t){return["[%s::%s]",this.is,e,...t]}}return a.prototype.is="",a}),lifecycleProps={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,listeners:!0,hostAttributes:!0},excludeOnInfo={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,behaviors:!0,_noAccessors:!0},excludeOnBehaviors=Object.assign({listeners:!0,hostAttributes:!0,properties:!0,observers:!0},excludeOnInfo); +const DISABLED_ATTR="disable-upgrade";let styleInterface=window.ShadyCSS;const LegacyElementMixin=dedupingMixin(e=>{const t=GestureEventListeners(ElementMixin(e)),n=builtCSS?t:DirMixin(t),r=findObservedAttributesGetter(n),o={x:"pan-x",y:"pan-y",none:"none",all:"auto"};class i extends n{constructor(){super(),this.isAttached,this.__boundListeners,this._debouncers,this.__isUpgradeDisabled,this.__needsAttributesAtConnected,this._legacyForceObservedAttributes}static get importMeta(){return this.prototype.importMeta}created(){}__attributeReaction(e,t,n){(this.__dataAttributes&&this.__dataAttributes[e]||e===DISABLED_ATTR)&&this.attributeChangedCallback(e,t,n,null)}setAttribute(e,t){if(legacyNoObservedAttributes&&!this._legacyForceObservedAttributes){const n=this.getAttribute(e);super.setAttribute(e,t),this.__attributeReaction(e,n,String(t))}else super.setAttribute(e,t)}removeAttribute(e){if(legacyNoObservedAttributes&&!this._legacyForceObservedAttributes){const t=this.getAttribute(e);super.removeAttribute(e),this.__attributeReaction(e,t,null)}else super.removeAttribute(e)}static get observedAttributes(){return legacyNoObservedAttributes&&!this.prototype._legacyForceObservedAttributes?(this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))||(this.__observedAttributes=[],register$1(this.prototype)),this.__observedAttributes):r.call(this).concat(DISABLED_ATTR)}_enableProperties(){this.__isUpgradeDisabled||super._enableProperties()}_canApplyPropertyDefault(e){return super._canApplyPropertyDefault(e)&&!(this.__isUpgradeDisabled&&this._isPropertyPending(e))}connectedCallback(){this.__needsAttributesAtConnected&&this._takeAttributes(),this.__isUpgradeDisabled||(super.connectedCallback(),this.isAttached=!0,this.attached())}attached(){}disconnectedCallback(){this.__isUpgradeDisabled||(super.disconnectedCallback(),this.isAttached=!1,this.detached())}detached(){}attributeChangedCallback(e,t,n,r){t!==n&&(e==DISABLED_ATTR?this.__isUpgradeDisabled&&null==n&&(this._initializeProperties(),this.__isUpgradeDisabled=!1,wrap$1(this).isConnected&&this.connectedCallback()):(super.attributeChangedCallback(e,t,n,r),this.attributeChanged(e,t,n)))}attributeChanged(e,t,n){}_initializeProperties(){if(legacyOptimizations&&this.hasAttribute(DISABLED_ATTR))this.__isUpgradeDisabled=!0;else{let e=Object.getPrototypeOf(this);e.hasOwnProperty(JSCompiler_renameProperty("__hasRegisterFinished",e))||(this._registered(),e.__hasRegisterFinished=!0),super._initializeProperties(),this.root=this,this.created(),legacyNoObservedAttributes&&!this._legacyForceObservedAttributes&&(this.hasAttributes()?this._takeAttributes():this.parentNode||(this.__needsAttributesAtConnected=!0)),this._applyListeners()}}_takeAttributes(){const e=this.attributes;for(let t=0,n=e.length;t0?timeOut.after(n):microTask,t.bind(this))}isDebouncerActive(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];return!(!t||!t.isActive())}flushDebouncer(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];t&&t.flush()}cancelDebouncer(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];t&&t.cancel()}async(e,t){return t>0?timeOut.run(e.bind(this),t):~microTask.run(e.bind(this))}cancelAsync(e){e<0?microTask.cancel(~e):timeOut.cancel(e)}create(e,t){let n=document.createElement(e);if(t)if(n.setProperties)n.setProperties(t);else for(let e in t)n[e]=t[e];return n}elementMatches(e,t){return matchesSelector(t||this,e)}toggleAttribute(e,t){let n=this;return 3===arguments.length&&(n=arguments[2]),1==arguments.length&&(t=!n.hasAttribute(e)),t?(wrap$1(n).setAttribute(e,""),!0):(wrap$1(n).removeAttribute(e),!1)}toggleClass(e,t,n){n=n||this,1==arguments.length&&(t=!n.classList.contains(e)),t?n.classList.add(e):n.classList.remove(e)}transform(e,t){(t=t||this).style.webkitTransform=e,t.style.transform=e}translate3d(e,t,n,r){r=r||this,this.transform("translate3d("+e+","+t+","+n+")",r)}arrayDelete(e,t){let n;if(Array.isArray(e)){if(n=e.indexOf(t),n>=0)return e.splice(n,1)}else{if(n=get(this,e).indexOf(t),n>=0)return this.splice(e,n,1)}return null}_logger(e,t){switch(Array.isArray(t)&&1===t.length&&Array.isArray(t[0])&&(t=t[0]),e){case"log":case"warn":case"error":console[e](...t)}}_log(...e){this._logger("log",e)}_warn(...e){this._logger("warn",e)}_error(...e){this._logger("error",e)}_logf(e,...t){return["[%s::%s]",this.is,e,...t]}}return i.prototype.is="",i}),lifecycleProps={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,listeners:!0,hostAttributes:!0},excludeOnInfo={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,behaviors:!0,_noAccessors:!0},excludeOnBehaviors=Object.assign({listeners:!0,hostAttributes:!0,properties:!0,observers:!0},excludeOnInfo); /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -340,7 +340,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/function copyProperties(e,t,i){const n=e._noAccessors,r=Object.getOwnPropertyNames(e);for(let a=0;a=0;n--){let r=e[n];r?Array.isArray(r)?flattenBehaviors(r,t):t.indexOf(r)<0&&(!i||i.indexOf(r)<0)&&t.unshift(r):console.warn("behavior is null, check for missing or 404 import")}return t}function mergeProperties(e,t){for(const i in t){const n=e[i],r=t[i];e[i]=!("value"in r)&&n&&"value"in n?Object.assign({value:n.value},r):r}}const LegacyElement=LegacyElementMixin(HTMLElement);function GenerateClassFromInfo(e,t,i){let n;const r={};class a extends t{static _finalizeClass(){if(this.hasOwnProperty(JSCompiler_renameProperty("generatedFrom",this))){if(n)for(let e,t=0;t=0;t--){const i=e[t];for(let e in i)this._ensureAttribute(e,i[e])}super._ensureAttributes()}ready(){super.ready();let e=r.ready;if(e)for(let t=0;t{n&&applyBehaviors(t,n,r),applyInfo(t,e,r,excludeOnInfo)};return legacyOptimizations||s(a.prototype),a.generatedFrom=e,a}const Class=function(e,t){e||console.warn("Polymer.Class requires `info` argument");let i=t?t(LegacyElement):LegacyElement;return i=GenerateClassFromInfo(e,i,e.behaviors),i.is=i.prototype.is=e.is,i},Polymer=function(e){let t;return t="function"==typeof e?e:Polymer.Class(e),e._legacyForceObservedAttributes&&(t.prototype._legacyForceObservedAttributes=e._legacyForceObservedAttributes),customElements.define(t.is,t),t}; +*/function copyProperties(e,t,n){const r=e._noAccessors,o=Object.getOwnPropertyNames(e);for(let i=0;i=0;r--){let o=e[r];o?Array.isArray(o)?flattenBehaviors(o,t):t.indexOf(o)<0&&(!n||n.indexOf(o)<0)&&t.unshift(o):console.warn("behavior is null, check for missing or 404 import")}return t}function mergeProperties(e,t){for(const n in t){const r=e[n],o=t[n];e[n]=!("value"in o)&&r&&"value"in r?Object.assign({value:r.value},o):o}}const LegacyElement=LegacyElementMixin(HTMLElement);function GenerateClassFromInfo(e,t,n){let r;const o={};class i extends t{static _finalizeClass(){if(this.hasOwnProperty(JSCompiler_renameProperty("generatedFrom",this))){if(r)for(let e,t=0;t=0;t--){const n=e[t];for(let e in n)this._ensureAttribute(e,n[e])}super._ensureAttributes()}ready(){super.ready();let e=o.ready;if(e)for(let t=0;t{r&&applyBehaviors(t,r,o),applyInfo(t,e,o,excludeOnInfo)};return legacyOptimizations||s(i.prototype),i.generatedFrom=e,i}const Class=function(e,t){e||console.warn("Polymer.Class requires `info` argument");let n=t?t(LegacyElement):LegacyElement;return n=GenerateClassFromInfo(e,n,e.behaviors),n.is=n.prototype.is=e.is,n},Polymer=function(e){let t;return t="function"==typeof e?e:Polymer.Class(e),e._legacyForceObservedAttributes&&(t.prototype._legacyForceObservedAttributes=e._legacyForceObservedAttributes),customElements.define(t.is,t),t}; /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -359,7 +359,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -function mutablePropertyChange(e,t,i,n,r){let a;r&&(a="object"==typeof i&&null!==i,a&&(n=e.__dataTemp[t]));let s=n!==i&&(n==n||i==i);return a&&s&&(e.__dataTemp[t]=i),s}Polymer.Class=Class;const MutableData=dedupingMixin(e=>class extends e{_shouldPropertyChange(e,t,i){return mutablePropertyChange(this,e,t,i,!0)}}),OptionalMutableData=dedupingMixin(e=>class extends e{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(e,t,i){return mutablePropertyChange(this,e,t,i,this.mutableData)}});MutableData._mutablePropertyChange=mutablePropertyChange; +function mutablePropertyChange(e,t,n,r,o){let i;o&&(i="object"==typeof n&&null!==n,i&&(r=e.__dataTemp[t]));let s=r!==n&&(r==r||n==n);return i&&s&&(e.__dataTemp[t]=n),s}Polymer.Class=Class;const MutableData=dedupingMixin(e=>class extends e{_shouldPropertyChange(e,t,n){return mutablePropertyChange(this,e,t,n,!0)}}),OptionalMutableData=dedupingMixin(e=>class extends e{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(e,t,n){return mutablePropertyChange(this,e,t,n,this.mutableData)}});MutableData._mutablePropertyChange=mutablePropertyChange; /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -369,7 +369,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -let newInstance=null;function HTMLTemplateElementExtension(){return newInstance}HTMLTemplateElementExtension.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:HTMLTemplateElementExtension,writable:!0}});const DataTemplate=PropertyEffects(HTMLTemplateElementExtension),MutableDataTemplate=MutableData(DataTemplate);function upgradeTemplate(e,t){newInstance=e,Object.setPrototypeOf(e,t.prototype),new t,newInstance=null}const templateInstanceBase=PropertyEffects(class{});function showHideChildren(e,t){for(let i=0;i{e.model=this,i(e)});else{let n=this.__dataHost.__dataHost;n&&n._addEventListenerToNode(e,t,i)}}_showHideChildren(e){showHideChildren(e,this.children)}_setUnmanagedPropertyToNode(e,t,i){e.__hideTemplateChildren__&&e.nodeType==Node.TEXT_NODE&&"textContent"==t?e.__polymerTextContent__=i:super._setUnmanagedPropertyToNode(e,t,i)}get parentModel(){let e=this.__parentModel;if(!e){let t;e=this;do{e=e.__dataHost.__dataHost}while((t=e.__templatizeOptions)&&!t.parentModel);this.__parentModel=e}return e}dispatchEvent(e){return!0}}TemplateInstanceBase.prototype.__dataHost,TemplateInstanceBase.prototype.__templatizeOptions,TemplateInstanceBase.prototype._methodHost,TemplateInstanceBase.prototype.__templatizeOwner,TemplateInstanceBase.prototype.__hostProps;const MutableTemplateInstanceBase=MutableData(TemplateInstanceBase);function findMethodHost(e){let t=e.__dataHost;return t&&t._methodHost||t}function createTemplatizerClass(e,t,i){let n=i.mutableData?MutableTemplateInstanceBase:TemplateInstanceBase;templatize.mixin&&(n=templatize.mixin(n));let r=class extends n{};return r.prototype.__templatizeOptions=i,r.prototype._bindTemplate(e),addNotifyEffects(r,e,t,i),r}function addPropagateEffects(e,t,i,n){let r=i.forwardHostProp;if(r&&t.hasHostProps){const a="template"==e.localName;let s=t.templatizeTemplateClass;if(!s){if(a){let e=i.mutableData?MutableDataTemplate:DataTemplate;class n extends e{}s=t.templatizeTemplateClass=n}else{const i=e.constructor;class n extends i{}s=t.templatizeTemplateClass=n}let o=t.hostProps;for(let e in o)s.prototype._addPropertyEffect("_host_"+e,s.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:createForwardHostPropEffect(e,r)}),s.prototype._createNotifyingProperty("_host_"+e);legacyWarnings&&n&&warnOnUndeclaredProperties(t,i,n)}if(e.__dataProto&&Object.assign(e.__data,e.__dataProto),a)upgradeTemplate(e,s),e.__dataTemp={},e.__dataPending=null,e.__dataOld=null,e._enableProperties();else{Object.setPrototypeOf(e,s.prototype);const i=t.hostProps;for(let t in i)if(t="_host_"+t,t in e){const i=e[t];delete e[t],e.__data[t]=i}}}}function createForwardHostPropEffect(e,t){return function(e,i,n){t.call(e.__templatizeOwner,i.substring(6),n[i])}}function addNotifyEffects(e,t,i,n){let r=i.hostProps||{};for(let t in n.instanceProps){delete r[t];let i=n.notifyInstanceProp;i&&e.prototype._addPropertyEffect(t,e.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:createNotifyInstancePropEffect(t,i)})}if(n.forwardHostProp&&t.__dataHost)for(let t in r)i.hasHostProps||(i.hasHostProps=!0),e.prototype._addPropertyEffect(t,e.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:createNotifyHostPropEffect()})}function createNotifyInstancePropEffect(e,t){return function(e,i,n){t.call(e.__templatizeOwner,e,i,n[i])}}function createNotifyHostPropEffect(){return function(e,t,i){e.__dataHost._setPendingPropertyOrPath("_host_"+t,i[t],!0,!0)}}function templatize(e,t,i){if(strictTemplatePolicy&&!findMethodHost(e))throw new Error("strictTemplatePolicy: template owner not trusted");if(i=i||{},e.__templatizeOwner)throw new Error("A