From ac561cbf66dcc0036d31c7a5b7a7abfb36c1a7f0 Mon Sep 17 00:00:00 2001 From: Zach Ahn Date: Mon, 20 Nov 2023 18:36:15 -0500 Subject: [PATCH] Bump a bunch of packages --- app/assets/javascripts/super/application.js | 4131 ++++++++++-------- app/assets/stylesheets/super/application.css | 2 +- frontend/super-frontend/dist/application.css | 2 +- frontend/super-frontend/dist/application.js | 4131 ++++++++++-------- frontend/super-frontend/source/package.json | 20 +- frontend/super-frontend/source/yarn.lock | 2045 ++++----- 6 files changed, 5541 insertions(+), 4790 deletions(-) diff --git a/app/assets/javascripts/super/application.js b/app/assets/javascripts/super/application.js index fc1dd94..0467b1c 100644 --- a/app/assets/javascripts/super/application.js +++ b/app/assets/javascripts/super/application.js @@ -1222,26 +1222,21 @@ window.customElements.define('details-dialog', DetailsDialogElement); } - function createCommonjsModule(fn) { - var module = { exports: {} }; - return fn(module, module.exports), module.exports; - } - /******/ - createCommonjsModule(function (module) { + (function () { (() => { // webpackBootstrap /******/ var __webpack_modules__ = [ /* 0 */ - , /* 1 */ + , ( /* 1 */ /***/() => { window.up = { - version: '3.3.0' + version: '3.5.2' }; /***/ - }, /* 2 */ + }), ( /* 2 */ /***/() => { up.mockable = function (originalFn) { if (window.jasmine) { @@ -1260,7 +1255,7 @@ }; /***/ - }, /* 3 */ + }), ( /* 3 */ /***/() => { up.util = function () { function noop() {} @@ -1810,11 +1805,6 @@ function upperCaseFirst(str) { return str[0].toUpperCase() + str.slice(1); } - function defineGetter(object, prop, get) { - Object.defineProperty(object, prop, { - get - }); - } function defineDelegates(object, props, targetProvider) { for (let prop of props) { Object.defineProperty(object, prop, { @@ -1909,16 +1899,17 @@ }; } } - function memoizeMethod(object, propOrProps) { - for (let prop of wrapList(propOrProps)) { - let oldImpl = object[prop]; - object[prop] = function (...args) { - var _a; - let cache = this[_a = `__${prop}MemoizeCache`] || (this[_a] = {}); + function memoizeMethod(object, propLiteral) { + for (let prop in propLiteral) { + let originalDescriptor = Object.getOwnPropertyDescriptor(object, prop); + let oldImpl = originalDescriptor.value; + let cachingImpl = function (...args) { + let cache = this[`__${prop}MemoizeCache`] ||= {}; let cacheKey = JSON.stringify(args); - cache[cacheKey] || (cache[cacheKey] = buildMemoizeCacheEntry(oldImpl, this, args)); + cache[cacheKey] ||= buildMemoizeCacheEntry(oldImpl, this, args); return useMemoizeCacheEntry(cache[cacheKey]); }; + object[prop] = cachingImpl; } } function safeStringifyJSON(value) { @@ -2021,7 +2012,6 @@ uid, upperCaseFirst, lowerCaseFirst, - getter: defineGetter, delegate: defineDelegates, reverse, camelToKebabCase, @@ -2036,7 +2026,7 @@ }(); /***/ - }, /* 4 */ + }), ( /* 4 */ /***/() => { up.error = function () { function fail(...args) { @@ -2046,39 +2036,58 @@ return typeof error !== 'object' || error.name !== 'AbortError' && !(error instanceof up.RenderResult) && !(error instanceof up.Response); } function muteUncriticalRejection(promise) { - return promise.catch(rethrowCritical); + return promise.catch(throwCritical); } function muteUncriticalSync(block) { try { return block(); } catch (e) { - rethrowCritical(e); + throwCritical(e); } } - function rethrowCritical(value) { + function throwCritical(value) { if (isCritical(value)) { throw value; } } + function report(error) { + console.error('Uncaught %o', error); + let event = new ErrorEvent('error', { + error, + message: 'Uncaught ' + error + }); + window.dispatchEvent(event); + } + function guard(fn) { + try { + return fn(); + } catch (error) { + report(error); + } + } + function guardFn(fn) { + return (...args) => guard(() => fn(...args)); + } return { fail, - rethrowCritical, - isCritical, + throwCritical, muteUncriticalRejection, - muteUncriticalSync + muteUncriticalSync, + guard, + guardFn }; }(); up.fail = up.error.fail; /***/ - }, /* 5 */ + }), ( /* 5 */ /***/() => { up.migrate = { config: {} }; /***/ - }, /* 6 */ + }), ( /* 6 */ /***/() => { up.browser = function () { const u = up.util; @@ -2123,7 +2132,7 @@ }(); /***/ - }, /* 7 */ + }), ( /* 7 */ /***/(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(8); up.element = function () { @@ -2233,7 +2242,7 @@ function insertBefore(existingElement, newElement) { existingElement.insertAdjacentElement('beforebegin', newElement); } - function createFromSelector(selector, attrs) { + function createFromSelector(selector, attrs = {}) { let { includePath } = parseSelector(selector); @@ -2267,23 +2276,21 @@ previousElement?.appendChild(depthElement); previousElement = depthElement; } - if (attrs) { - let value; - if (value = u.pluckKey(attrs, 'class')) { + for (let key in attrs) { + let value = attrs[key]; + if (key === 'class') { for (let klass of u.wrapList(value)) { rootElement.classList.add(klass); } - } - if (value = u.pluckKey(attrs, 'style')) { + } else if (key === 'style') { setInlineStyle(rootElement, value); - } - if (value = u.pluckKey(attrs, 'text')) { + } else if (key === 'text') { rootElement.textContent = value; - } - if (value = u.pluckKey(attrs, 'content')) { + } else if (key === 'content') { rootElement.innerHTML = value; + } else { + rootElement.setAttribute(key, value); } - setAttrs(rootElement, attrs); } return rootElement; } @@ -2372,7 +2379,7 @@ return element; } const SINGLETON_TAG_NAMES = ['HTML', 'BODY', 'HEAD', 'TITLE']; - const isSingleton = up.mockable(element => element.matches(SINGLETON_TAG_NAMES.join(','))); + const isSingleton = up.mockable(element => element.matches(SINGLETON_TAG_NAMES.join())); function elementTagName(element) { return element.tagName.toLowerCase(); } @@ -2398,17 +2405,13 @@ function createBrokenDocumentFromHTML(html) { return new DOMParser().parseFromString(html, 'text/html'); } - function fixScriptish(scriptish) { - let clone = document.createElement(scriptish.tagName); - for (let { - name, - value - } of scriptish.attributes) { - clone.setAttribute(name, value); - } - clone.textContent = scriptish.innerHTML; + function fixParserDamage(scriptish) { + let clone = createFromHTML(scriptish.outerHTML); scriptish.replaceWith(clone); } + function disableScript(scriptElement) { + scriptElement.type = 'up-disabled-script'; + } function createFromHTML(html) { const range = document.createRange(); range.setStart(document.body, 0); @@ -2630,24 +2633,31 @@ function isVisible(element) { return !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length); } + function isUpPrefixed(string) { + return /^up-/.test(string); + } function upAttrs(element) { - const upAttributePattern = /^up-/; - const attrs = {}; - for (let attribute of element.attributes) { - const { - name - } = attribute; - if (name.match(upAttributePattern)) { - attrs[name] = attribute.value; - } - } - return attrs; + let attrNames = u.filter(element.getAttributeNames(), isUpPrefixed); + return u.mapObject(attrNames, name => [name, element.getAttribute(name)]); + } + function upClasses(element) { + return u.filter(element.classList.values(), isUpPrefixed); } function cleanJQuery(element) { if (up.browser.canJQuery()) { jQuery(element).remove(); } } + function filteredQuery(parent, includeSelectors, excludeSelectors) { + let fullIncludeSelector = includeSelectors.join(); + let fullExcludeSelector = excludeSelectors.join(); + let elements = parent.querySelectorAll(fullIncludeSelector); + let isExcluded = element => element.matches(fullExcludeSelector); + return u.reject(elements, isExcluded); + } + function isEmpty(element) { + return !element.children.length > 0 && !element.innerText.trim(); + } return { subtree, contains, @@ -2671,7 +2681,7 @@ attrSelector, tagName: elementTagName, createBrokenDocumentFromHTML, - fixScriptish, + fixParserDamage, createFromHTML, get root() { return getRoot(); @@ -2698,23 +2708,27 @@ setStyle: setInlineStyle, isVisible, upAttrs, + upClasses, toggleAttr, addTemporaryClass, setTemporaryAttr, cleanJQuery, - parseSelector + parseSelector, + filteredQuery, + isEmpty, + disableScript }; }(); /***/ - }, /* 8 */ + }), ( /* 8 */ /***/(__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ - }, /* 9 */ + }), ( /* 9 */ /***/() => { up.Error = class Error extends window.Error { constructor(message, props = {}) { @@ -2730,12 +2744,12 @@ }; /***/ - }, /* 10 */ + }), ( /* 10 */ /***/() => { up.NotImplemented = class NotImplemented extends up.Error {}; /***/ - }, /* 11 */ + }), ( /* 11 */ /***/() => { up.Aborted = class Aborted extends up.Error { constructor(message) { @@ -2746,32 +2760,27 @@ }; /***/ - }, /* 12 */ - /***/() => { - up.CannotCompile = class CannotCompile extends up.Error {}; - - /***/ - }, /* 13 */ + }), ( /* 12 */ /***/() => { up.CannotMatch = class CannotMatch extends up.Error {}; /***/ - }, /* 14 */ + }), ( /* 13 */ /***/() => { up.CannotParse = class CannotParse extends up.Error {}; /***/ - }, /* 15 */ + }), ( /* 14 */ /***/() => { up.CannotTarget = class CannotTarget extends up.Error {}; /***/ - }, /* 16 */ + }), ( /* 15 */ /***/() => { up.Offline = class Offline extends up.Error {}; /***/ - }, /* 17 */ + }), ( /* 16 */ /***/() => { const u = up.util; up.Record = class Record { @@ -2796,20 +2805,20 @@ }; /***/ - }, /* 18 */ + }), ( /* 17 */ /***/() => { up.Config = class Config { constructor(blueprintFn = () => ({})) { - this.blueprintFn = blueprintFn; + this._blueprintFn = blueprintFn; this.reset(); } reset() { - Object.assign(this, this.blueprintFn()); + Object.assign(this, this._blueprintFn()); } }; /***/ - }, /* 19 */ + }), ( /* 18 */ /***/() => { let enabledKey = 'up.log.enabled'; let enabled = false; @@ -2835,7 +2844,88 @@ }; /***/ - }, /* 20 */ + }), ( /* 19 */ + /***/() => { + const u = up.util; + const e = up.element; + up.OptionsParser = class OptionsParser { + constructor(element, options, parserOptions = {}) { + this._options = options; + this._element = element; + this._parserOptions = parserOptions; + this._fail = parserOptions.fail; + this._closest = parserOptions.closest; + this._attrPrefix = parserOptions.attrPrefix || 'up-'; + this._defaults = parserOptions.defaults || {}; + } + string(key, keyOptions) { + this.parse(e.attr, key, keyOptions); + } + boolean(key, keyOptions) { + this.parse(e.booleanAttr, key, keyOptions); + } + number(key, keyOptions) { + this.parse(e.numberAttr, key, keyOptions); + } + booleanOrString(key, keyOptions) { + this.parse(e.booleanOrStringAttr, key, keyOptions); + } + json(key, keyOptions) { + this.parse(e.jsonAttr, key, keyOptions); + } + callback(key, keyOptions = {}) { + let parser = (link, attr) => e.callbackAttr(link, attr, keyOptions); + this.parse(parser, key, keyOptions); + } + parse(attrValueFn, key, keyOptions = {}) { + const attrNames = u.wrapList(keyOptions.attr ?? this._attrNameForKey(key)); + let value = this._options[key]; + for (let attrName of attrNames) { + value ??= this._parseFromAttr(attrValueFn, this._element, attrName); + } + value ??= keyOptions.default ?? this._defaults[key]; + let normalizeFn = keyOptions.normalize; + if (normalizeFn) { + value = normalizeFn(value); + } + if (u.isDefined(value)) { + this._options[key] = value; + } + let failKey; + if (this._fail && (failKey = up.fragment.failKey(key))) { + const failAttrNames = u.compact(u.map(attrNames, attrName => this._deriveFailAttrName(attrName))); + this.parse(attrValueFn, failKey, { + ...keyOptions, + attr: failAttrNames + }); + } + } + include(optionsFn) { + let fnResult = optionsFn(this._element, this._options, this._parserOptions); + Object.assign(this._options, fnResult); + } + _parseFromAttr(attrValueFn, element, attrName) { + if (this._closest) { + return e.closestAttr(element, attrName, attrValueFn); + } else { + return attrValueFn(element, attrName); + } + } + _deriveFailAttrName(attr) { + return this._deriveFailAttrNameForPrefix(attr, this._attrPrefix + 'on-') || this._deriveFailAttrNameForPrefix(attr, this._attrPrefix); + } + _deriveFailAttrNameForPrefix(attr, prefix) { + if (attr.startsWith(prefix)) { + return `${prefix}fail-${attr.substring(prefix.length)}`; + } + } + _attrNameForKey(option) { + return `${this._attrPrefix}${u.camelToKebabCase(option)}`; + } + }; + + /***/ + }), ( /* 20 */ /***/() => { const u = up.util; up.FIFOCache = class FIFOCache { @@ -2843,29 +2933,29 @@ capacity = 10, normalizeKey = u.identity } = {}) { - this.map = new Map(); - this.capacity = capacity; - this.normalizeKey = normalizeKey; + this._map = new Map(); + this._capacity = capacity; + this._normalizeKey = normalizeKey; } get(key) { - key = this.normalizeKey(key); - return this.map.get(key); + key = this._normalizeKey(key); + return this._map.get(key); } set(key, value) { - if (this.map.size === this.capacity) { - let oldestKey = this.map.keys().next().value; - this.map.delete(oldestKey); + if (this._map.size === this._capacity) { + let oldestKey = this._map.keys().next().value; + this._map.delete(oldestKey); } - key = this.normalizeKey(key); - this.map.set(key, value); + key = this._normalizeKey(key); + this._map.set(key, value); } clear() { - this.map.clear(); + this._map.clear(); } }; /***/ - }, /* 21 */ + }), ( /* 21 */ /***/() => { up.Rect = class Rect extends up.Record { keys() { @@ -2883,67 +2973,80 @@ }; /***/ - }, /* 22 */ + }), ( /* 22 */ /***/() => { const e = up.element; up.BodyShifter = class BodyShifter { constructor() { - this.unshiftFns = []; - this.reset(); + this._unshiftFns = []; + this._anchoredElements = new Set(); + this._stack = 0; } - reset() { - this.unshiftNow(); - this.shiftCount = 0; + lowerStack() { + this._stack--; + if (this._stack === 0) { + this._unshiftNow(); + } } - shift() { - this.shiftCount++; - if (this.shiftCount > 1) { - return; + raiseStack() { + this._stack++; + if (this._stack === 1) { + this._shiftNow(); } - const scrollbarTookSpace = up.viewport.rootHasReducedWidthFromScrollbar(); + } + onAnchoredElementInserted(element) { + this._anchoredElements.add(element); + if (this._isShifted()) { + this._shiftAnchoredElement(element); + } + return () => this._anchoredElements.delete(element); + } + _isShifted() { + return this._scrollbarTookSpace && this._stack > 0; + } + _shiftNow() { + this._scrollbarWidth = up.viewport.scrollbarWidth(); + this._scrollbarTookSpace = up.viewport.rootHasReducedWidthFromScrollbar(); + if (!this._scrollbarTookSpace) return; + this._shiftBody(); + for (let element of this._anchoredElements) { + this._shiftAnchoredElement(element); + } + } + _shiftBody() { const overflowElement = up.viewport.rootOverflowElement(); - this.changeStyle(overflowElement, { + this._changeStyle(overflowElement, { overflowY: 'hidden' }); - if (!scrollbarTookSpace) { - return; - } const { body } = document; - const scrollbarWidth = up.viewport.scrollbarWidth(); const bodyRightPadding = e.styleNumber(body, 'paddingRight'); - const bodyRightShift = scrollbarWidth + bodyRightPadding; - this.changeStyle(body, { + const bodyRightShift = this._scrollbarWidth + bodyRightPadding; + this._changeStyle(body, { paddingRight: bodyRightShift }); - for (let anchor of up.viewport.anchoredRight()) { - const elementRight = e.styleNumber(anchor, 'right'); - const elementRightShift = scrollbarWidth + elementRight; - this.changeStyle(anchor, { - right: elementRightShift - }); - } } - changeStyle(element, styles) { - this.unshiftFns.push(e.setTemporaryStyle(element, styles)); + _shiftAnchoredElement(element) { + const elementRight = e.styleNumber(element, 'right'); + const elementRightShift = this._scrollbarWidth + elementRight; + this._changeStyle(element, { + right: elementRightShift + }); } - unshift() { - this.shiftCount--; - if (this.shiftCount == 0) { - this.unshiftNow(); - } + _changeStyle(element, styles) { + this._unshiftFns.push(e.setTemporaryStyle(element, styles)); } - unshiftNow() { + _unshiftNow() { let unshiftFn; - while (unshiftFn = this.unshiftFns.pop()) { + while (unshiftFn = this._unshiftFns.pop()) { unshiftFn(); } } }; /***/ - }, /* 23 */ + }), ( /* 23 */ /***/() => { const u = up.util; up.Change = class Change { @@ -2969,18 +3072,17 @@ }; /***/ - }, /* 24 */ + }), ( /* 24 */ /***/() => { const u = up.util; const e = up.element; up.Change.Addition = class Addition extends up.Change { constructor(options) { super(options); - this.responseDoc = options.responseDoc; - this.acceptLayer = options.acceptLayer; - this.dismissLayer = options.dismissLayer; - this.eventPlans = options.eventPlans || []; - this.response = options.meta?.response; + this._acceptLayer = options.acceptLayer; + this._dismissLayer = options.dismissLayer; + this._eventPlans = options.eventPlans || []; + this._response = options.response; } handleLayerChangeRequests() { if (this.layer.isOverlay()) { @@ -2994,7 +3096,7 @@ this.abortWhenLayerClosed(); } this.layer.asCurrent(() => { - for (let eventPlan of this.eventPlans) { + for (let eventPlan of this._eventPlans) { up.emit({ ...eventPlan, ...this.responseOption() @@ -3004,13 +3106,13 @@ }); } tryAcceptLayerFromServer() { - if (u.isDefined(this.acceptLayer) && this.layer.isOverlay()) { - this.layer.accept(this.acceptLayer, this.responseOption()); + if (u.isDefined(this._acceptLayer) && this.layer.isOverlay()) { + this.layer.accept(this._acceptLayer, this.responseOption()); } } tryDismissLayerFromServer() { - if (u.isDefined(this.dismissLayer) && this.layer.isOverlay()) { - this.layer.dismiss(this.dismissLayer, this.responseOption()); + if (u.isDefined(this._dismissLayer) && this.layer.isOverlay()) { + this.layer.dismiss(this._dismissLayer, this.responseOption()); } } abortWhenLayerClosed(layer = this.layer) { @@ -3051,44 +3153,62 @@ } responseOption() { return { - response: this.response + response: this._response }; } + executeSteps(steps, responseDoc, noneOptions) { + return new up.Change.UpdateSteps({ + steps, + noneOptions + }).execute(responseDoc); + } }; /***/ - }, /* 25 */ + }), ( /* 25 */ /***/() => { var _a; const u = up.util; up.RenderJob = (_a = class RenderJob { constructor(options) { this.options = up.RenderOptions.preprocess(options); - this.rendered = this.execute(); + this._rendered = this._execute(); } - async execute() { + async _execute() { try { - let result = await this.makeChange(); - this.runResultCallbacks(result); + let result = await this._makeChange(); + this._handleResult(result); return result; - } catch (error) { - this.runResultCallbacks(error) || this.options.onError?.(error); - throw error; + } catch (resultOrError) { + this._handleResult(resultOrError) || this._handleError(resultOrError); + throw resultOrError; } } - runResultCallbacks(result) { + _handleResult(result) { if (result instanceof up.RenderResult) { - if (!result.none) result.options.onRendered?.(result); - result.finished.then(result.options.onFinished, u.noop); + let { + onRendered, + onFinished + } = result.options; + if (!result.none) up.error.guard(() => onRendered?.(result)); + let guardedOnFinished = function (result) { + up.error.guard(() => onFinished?.(result)); + }; + this.finished.then(guardedOnFinished, u.noop); return true; } } + _handleError(error) { + let prefix = error instanceof up.Aborted ? 'Rendering was aborted' : 'Error while rendering'; + up.puts('up.render()', `${prefix}: ${error.name}: ${error.message}`); + up.error.guard(() => this.options.onError?.(error)); + } get finished() { - return this.awaitFinished(); + return this._awaitFinished(); } - async awaitFinished() { + async _awaitFinished() { try { - let result = await this.rendered; + let result = await this._rendered; return await result.finished; } catch (error) { if (error instanceof up.RenderResult) { @@ -3098,24 +3218,24 @@ } } } - makeChange() { - this.guardRender(); + _makeChange() { + this._guardRender(); if (this.options.url) { - let onRequest = request => this.handleAbortOption(request); + let onRequest = request => this._handleAbortOption(request); this.change = new up.Change.FromURL({ ...this.options, onRequest }); } else if (this.options.response) { this.change = new up.Change.FromResponse(this.options); - this.handleAbortOption(null); + this._handleAbortOption(null); } else { this.change = new up.Change.FromContent(this.options); - this.handleAbortOption(null); + this._handleAbortOption(null); } return this.change.execute(); } - guardRender() { + _guardRender() { up.browser.assertConfirmed(this.options); let guardEvent = u.pluckKey(this.options, 'guardEvent'); if (guardEvent) { @@ -3123,14 +3243,12 @@ if (up.emit(guardEvent, { target: this.options.origin }).defaultPrevented) { - let message = `Rendering was prevented by ${guardEvent.type} listener`; - up.puts('up.render()', message); - throw new up.Aborted(message); + throw new up.Aborted(`Rendering was prevented by ${guardEvent.type} listener`); } } up.RenderOptions.assertContentGiven(this.options); } - handleAbortOption(request) { + _handleAbortOption(request) { let { abort } = this.options; @@ -3138,11 +3256,14 @@ let { fragments, layer, - origin + origin, + newLayer } = this.change.getPreflightProps(); let abortOptions = { except: request, - logOnce: ['up.render()', 'Change with { abort } option will abort other requests'] + logOnce: ['up.render()', 'Change with { abort } option will abort other requests'], + newLayer, + origin }; if (abort === 'target') { up.fragment.abort(fragments, abortOptions); @@ -3161,143 +3282,171 @@ } else { up.fragment.abort(abort, { ...abortOptions, - layer, - origin + layer }); } } }, (() => { u.delegate(_a.prototype, ['then', 'catch', 'finally'], function () { - return this.rendered; + return this._rendered; + }); + u.memoizeMethod(_a.prototype, { + _awaitFinished: true }); })(), _a); /***/ - }, /* 26 */ + }), ( /* 26 */ /***/() => { up.Change.Removal = class Removal extends up.Change {}; /***/ - }, /* 27 */ + }), ( /* 27 */ /***/() => { up.Change.DestroyFragment = class DestroyFragment extends up.Change.Removal { constructor(options) { super(options); - this.layer = up.layer.get(options) || up.layer.current; - this.element = this.options.element; - this.animation = this.options.animation; - this.log = this.options.log; - } - async execute() { - this.parent = this.element.parentNode; - up.fragment.markAsDestroying(this.element); - if (up.motion.willAnimate(this.element, this.animation, this.options)) { - this.emitDestroyed(); - await this.animate(); - this.wipe(); - this.onFinished(); + this._layer = up.layer.get(options) || up.layer.current; + this._element = this.options.element; + this._animation = this.options.animation; + this._log = this.options.log; + } + execute() { + this._parent = this._element.parentNode; + up.fragment.markAsDestroying(this._element); + if (up.motion.willAnimate(this._element, this._animation, this.options)) { + this._destroyAfterAnimation(); } else { - this.wipe(); - this.emitDestroyed(); - this.onFinished(); + this._destroyNow(); } } - animate() { - return up.motion.animate(this.element, this.animation, this.options); + async _destroyAfterAnimation() { + this._emitDestroyed(); + await this._animate(); + this._wipe(); + this.onFinished(); } - wipe() { - this.layer.asCurrent(() => { - up.fragment.abort(this.element); - up.syntax.clean(this.element, { - layer: this.layer + _destroyNow() { + this._wipe(); + this._emitDestroyed(); + this.onFinished(); + } + _animate() { + return up.motion.animate(this._element, this._animation, this.options); + } + _wipe() { + this._layer.asCurrent(() => { + up.fragment.abort(this._element); + up.script.clean(this._element, { + layer: this._layer }); - up.element.cleanJQuery(this.element); - this.element.remove(); + up.element.cleanJQuery(this._element); + this._element.remove(); }); } - emitDestroyed() { - up.fragment.emitDestroyed(this.element, { - parent: this.parent, - log: this.log + _emitDestroyed() { + up.fragment.emitDestroyed(this._element, { + parent: this._parent, + log: this._log }); } }; /***/ - }, /* 28 */ + }), ( /* 28 */ /***/() => { let u = up.util; up.Change.OpenLayer = class OpenLayer extends up.Change.Addition { constructor(options) { super(options); this.target = options.target; - this.origin = options.origin; - this.baseLayer = options.baseLayer; + this._origin = options.origin; + this._baseLayer = options.baseLayer; } getPreflightProps() { return { mode: this.options.mode, - context: this.buildLayer().context, + context: this._buildLayer().context, origin: this.options.origin, target: this.target, - layer: this.baseLayer, + layer: this._baseLayer, fragments: u.compact([up.fragment.get(':main', { - layer: this.baseLayer - })]) + layer: this._baseLayer + })]), + newLayer: true }; } execute(responseDoc, onApplicable) { + this.responseDoc = responseDoc; + this._matchPostflight(); + onApplicable(); + this._createOverlay(); + let unbindClosing = this.layer.on('up:layer:accepting up:layer:dimissing', this._renderOtherLayers.bind(this)); + try { + this._renderOverlayContent(); + this._renderOtherLayers(); + return up.RenderResult.both(this._newOverlayResult, this._otherLayersResult); + } finally { + unbindClosing(); + } + } + _matchPostflight() { if (this.target === ':none') { - this.content = document.createElement('up-none'); + this._content = document.createElement('up-none'); } else { - this.content = responseDoc.select(this.target); + this._content = this.responseDoc.select(this.target); } - if (!this.content || this.baseLayer.isClosed()) { + if (!this._content || this._baseLayer.isClosed()) { throw new up.CannotMatch(); } - onApplicable(); + } + _createOverlay() { up.puts('up.render()', `Opening element "${this.target}" in new overlay`); - this.options.title = this.improveHistoryValue(this.options.title, responseDoc.getTitle()); - if (this.emitOpenEvent().defaultPrevented) { - throw new up.Aborted('Open event was prevented'); - } - this.layer = this.buildLayer(); - this.baseLayer.peel({ + this._assertOpenEventEmitted(); + this.layer = this._buildLayer(); + this._baseLayer.peel({ history: !this.layer.history }); up.layer.stack.push(this.layer); - this.layer.createElements(this.content); + this.layer.createElements(); this.layer.setupHandlers(); - this.handleHistory(); + } + _renderOverlayContent() { + this._handleHistory(); + this.handleLayerChangeRequests(); + this.layer.setContent(this._content); this.setReloadAttrs({ - newElement: this.content, + newElement: this._content, source: this.options.source }); - responseDoc.finalizeElement(this.content); + this.responseDoc.finalizeElement(this._content); + this._newOverlayResult = new up.RenderResult({ + layer: this.layer, + fragments: [this._content], + target: this.target + }); up.hello(this.layer.element, { ...this.options, layer: this.layer }); - this.handleLayerChangeRequests(); - this.handleScroll(); - this.renderResult = new up.RenderResult({ - layer: this.layer, - fragments: [this.content], - target: this.target - }); - this.renderResult.finished = this.finish(); + this._handleScroll(); + this._newOverlayResult.finished = this._finish(); this.layer.opening = false; - this.emitOpenedEvent(); + this._emitOpenedEvent(); this.abortWhenLayerClosed(); - return this.renderResult; } - async finish() { + _renderOtherLayers() { + if (this._otherLayersResult) return; + let otherLayerSteps = this._getHungrySteps().other; + this._otherLayersResult = this.executeSteps(otherLayerSteps, this.responseDoc); + } + async _finish() { await this.layer.startOpenAnimation(); this.abortWhenLayerClosed(); - this.handleFocus(); - return this.renderResult; + this._handleFocus(); + return this._newOverlayResult; } - buildLayer() { + _buildLayer() { const buildOptions = { ...this.options, opening: true @@ -3307,59 +3456,66 @@ }; return up.layer.build(buildOptions, beforeNew); } - handleHistory() { + _handleHistory() { if (this.layer.history === 'auto') { - this.layer.history = up.fragment.hasAutoHistory(this.content); + this.layer.history = up.fragment.hasAutoHistory(this._content); } - this.layer.parent.saveHistory(); + let { + parent + } = this.layer; + this.layer.history &&= parent.history; + parent.saveHistory(); this.layer.updateHistory(this.options); } - handleFocus() { - this.baseLayer.overlayFocus?.moveToBack(); + _handleFocus() { + this._baseLayer.overlayFocus?.moveToBack(); this.layer.overlayFocus.moveToFront(); const fragmentFocus = new up.FragmentFocus({ - fragment: this.content, + fragment: this._content, layer: this.layer, autoMeans: ['autofocus', 'layer'] }); fragmentFocus.process(this.options.focus); } - handleScroll() { + _handleScroll() { const scrollingOptions = { ...this.options, - fragment: this.content, + fragment: this._content, layer: this.layer, autoMeans: ['hash', 'layer'] }; const scrolling = new up.FragmentScrolling(scrollingOptions); scrolling.process(this.options.scroll); } - emitOpenEvent() { - return up.emit('up:layer:open', { - origin: this.origin, - baseLayer: this.baseLayer, + _assertOpenEventEmitted() { + up.event.assertEmitted('up:layer:open', { + origin: this._origin, + baseLayer: this._baseLayer, layerOptions: this.options, log: "Opening new overlay" }); } - emitOpenedEvent() { - return this.layer.emit('up:layer:opened', { - origin: this.origin, + _emitOpenedEvent() { + this.layer.emit('up:layer:opened', { + origin: this._origin, callback: this.layer.callback('onOpened'), log: `Opened new ${this.layer}` }); } - getHungrySteps() { - return up.radio.hungrySteps({ - layer: null, - history: this.layer && this.layer.isHistoryVisible(), - origin: this.options.origin - }); + _getHungrySteps() { + return up.radio.hungrySteps(this._getEffectiveRenderOptions()); + } + _getEffectiveRenderOptions() { + return { + ...this.options, + layer: this.layer, + history: this.layer.history + }; } }; /***/ - }, /* 29 */ + }), ( /* 29 */ /***/() => { var _a; const u = up.util; @@ -3369,40 +3525,47 @@ super(options); this.layer = options.layer; this.target = options.target; - this.context = options.context; - this.useKeep = options.useKeep; - this.steps = up.fragment.parseTargetSteps(this.target, this.options); + this._context = options.context; + this._steps = up.fragment.parseTargetSteps(this.target, this.options); } getPreflightProps() { - this.matchPreflight(); + this._matchPreflight(); return { layer: this.layer, mode: this.layer.mode, - context: u.merge(this.layer.context, this.context), + context: u.merge(this.layer.context, this._context), origin: this.options.origin, - target: this.bestPreflightSelector(), - fragments: this.getFragments() + target: this._bestPreflightSelector(), + fragments: this._getFragments(), + newLayer: false }; } - bestPreflightSelector() { - this.matchPreflight(); - return up.fragment.targetForSteps(this.steps); + _bestPreflightSelector() { + this._matchPreflight(); + return up.fragment.targetForSteps(this._steps); } - getFragments() { - this.matchPreflight(); - return u.map(this.steps, 'oldElement'); + _getFragments() { + this._matchPreflight(); + return u.map(this._steps, 'oldElement'); } execute(responseDoc, onApplicable) { this.responseDoc = responseDoc; - this.matchPostflight(); + this._matchPostflight(); onApplicable(); - if (this.steps.length) { - up.puts('up.render()', `Updating "${this.bestPreflightSelector()}" in ${this.layer}`); - } else { - up.puts('up.render()', 'Nothing was rendered'); + let unbindClosing = this.layer.on('up:layer:accepting up:layer:dimissing', this._renderOtherLayers.bind(this)); + try { + this._renderCurrentLayer(); + this._renderOtherLayers(); + return up.RenderResult.both(this._currentLayerResult, this._otherLayersResult); + } finally { + unbindClosing(); + } + } + _renderCurrentLayer() { + if (this._steps.length) { + up.puts('up.render()', `Updating "${this._bestPreflightSelector()}" in ${this.layer}`); } - this.options.title = this.improveHistoryValue(this.options.title, this.responseDoc.getTitle()); - this.setScrollAndFocusOptions(); + this._setScrollAndFocusOptions(); if (this.options.saveScroll) { up.viewport.saveScroll({ layer: this.layer @@ -3415,51 +3578,62 @@ } if (this.options.peel) { this.layer.peel({ - history: !this.hasHistory() + history: !this._hasHistory() }); } if (this.options.abort !== false) { - up.fragment.abort(this.getFragments(), { + up.fragment.abort(this._getFragments(), { reason: 'Fragment is being replaced' }); } - Object.assign(this.layer.context, this.context); - if (this.hasHistory()) { + Object.assign(this.layer.context, this._context); + if (this._hasHistory()) { this.layer.updateHistory(this.options); } this.handleLayerChangeRequests(); - let renderResult = new up.Change.UpdateSteps({ - steps: this.steps, - noneOptions: this.options - }).execute(responseDoc); - return renderResult; - } - matchPreflight() { - this.steps = this.steps.filter(step => { - const finder = new up.FragmentFinder(step); - step.oldElement || (step.oldElement = finder.find()); + this._currentLayerResult = this.executeSteps(this._steps, this.responseDoc, this.options); + } + _renderOtherLayers() { + if (this._otherLayersResult) return; + let otherLayerSteps = this._getHungrySteps().other; + this._otherLayersResult = this.executeSteps(otherLayerSteps, this.responseDoc); + } + _matchPreflight() { + this._matchOldElements(); + this._compressNestedSteps(); + } + _matchPostflight() { + this._matchOldElements(); + this._addHungryStepsOnCurrentLayer(); + this._compressNestedSteps(); + this._matchNewElements(); + } + _addHungryStepsOnCurrentLayer() { + this._steps.push(...this._getHungrySteps().current); + } + _matchOldElements() { + this._steps = this._steps.filter(step => { + const finder = new up.FragmentFinder(u.pick(step, ['selector', 'origin', 'layer', 'match', 'preferOldElements'])); + step.oldElement ||= finder.find(); if (step.oldElement) { return true; } else if (!step.maybe) { throw new up.CannotMatch(); } }); - this.steps = up.fragment.compressNestedSteps(this.steps); } - matchPostflight() { - this.matchPreflight(); - this.steps = this.responseDoc.selectSteps(this.steps); + _matchNewElements() { + this._steps = this.responseDoc.selectSteps(this._steps); } - getHungrySteps() { - return up.radio.hungrySteps({ - layer: this.layer, - history: this.hasHistory(), - origin: this.options.origin - }); + _compressNestedSteps() { + this._steps = up.fragment.compressNestedSteps(this._steps); + } + _getHungrySteps() { + return up.radio.hungrySteps(this._getEffectiveRenderOptions()); } - setScrollAndFocusOptions() { + _setScrollAndFocusOptions() { let focusCapsule = up.FocusCapsule.preserve(this.layer); - this.steps.forEach((step, i) => { + this._steps.forEach((step, i) => { step.focusCapsule = focusCapsule; if (i > 0) { step.scroll = false; @@ -3470,71 +3644,84 @@ } }); } - hasHistory() { - return u.evalAutoOption(this.options.history, this.hasAutoHistory.bind(this)); + _hasHistory() { + return u.evalAutoOption(this.options.history, this._hasAutoHistory.bind(this)); } - hasAutoHistory() { - const oldFragments = u.map(this.steps, 'oldElement'); + _hasAutoHistory() { + const oldFragments = u.map(this._steps, 'oldElement'); return u.some(oldFragments, up.fragment.hasAutoHistory); } + _getEffectiveRenderOptions() { + return { + ...this.options, + layer: this.layer, + history: this._hasHistory() + }; + } }, (() => { - u.memoizeMethod(_a.prototype, ['matchPreflight', 'matchPostflight', 'hasHistory']); + u.memoizeMethod(_a.prototype, { + _matchPreflight: true, + _matchOldElements: true, + _hasHistory: true, + _getHungrySteps: true + }); })(), _a); /***/ - }, /* 30 */ + }), ( /* 30 */ /***/() => { const u = up.util; const e = up.element; up.Change.UpdateSteps = class UpdateSteps extends up.Change.Addition { constructor(options) { super(options); - this.noneOptions = options.noneOptions || {}; - this.steps = u.copy(options.steps); + this._noneOptions = options.noneOptions || {}; + this._steps = u.copy(options.steps); } execute(responseDoc) { this.responseDoc = responseDoc; - this.steps = responseDoc.selectSteps(this.steps); - if (!this.steps.length) { - return this.executeNone(); + this._steps = responseDoc.selectSteps(this._steps); + this._steps = responseDoc.commitSteps(this._steps); + if (!this._steps.length) { + return this._executeNone(); } this.renderResult = new up.RenderResult({ - layer: this.steps[0]?.layer, - target: up.fragment.targetForSteps(this.steps) + layer: this._steps[0]?.layer, + target: up.fragment.targetForSteps(this._steps) }); - this.steps.reverse(); - const motionEndPromises = this.steps.map(step => this.executeStep(step)); - this.renderResult.finished = this.finish(motionEndPromises); + this._steps.reverse(); + const motionEndPromises = this._steps.map(step => this._executeStep(step)); + this.renderResult.finished = this._finish(motionEndPromises); return this.renderResult; } - executeNone() { - this.handleFocus(null, this.noneOptions); - this.handleScroll(null, this.noneOptions); + _executeNone() { + this._handleFocus(null, this._noneOptions); + this._handleScroll(null, this._noneOptions); return up.RenderResult.buildNone(); } - async finish(motionEndPromises) { + async _finish(motionEndPromises) { await Promise.all(motionEndPromises); - for (let step of this.steps) { + for (let step of this._steps) { this.abortWhenLayerClosed(step.layer); } return this.renderResult; } - addToResult(fragment) { + _addToResult(fragment) { let newFragments = fragment.matches('up-wrapper') ? fragment.children : [fragment]; this.renderResult.fragments.unshift(...newFragments); } - executeStep(step) { + _executeStep(step) { this.setReloadAttrs(step); switch (step.placement) { case 'swap': { - let keepPlan = this.findKeepPlan(step); + let keepPlan = this._findKeepPlan(step); if (keepPlan) { - this.handleFocus(step.oldElement, step); - this.handleScroll(step.oldElement, step); + this._handleFocus(step.oldElement, step); + this._handleScroll(step.oldElement, step); return Promise.resolve(); } else { - this.preserveKeepables(step); + this._preserveKeepables(step); const parent = step.oldElement.parentNode; const morphOptions = { ...step, @@ -3542,13 +3729,14 @@ up.fragment.markAsDestroying(step.oldElement); }, afterInsert: () => { + this._restoreKeepables(step); this.responseDoc.finalizeElement(step.newElement); - this.restoreKeepables(step); + this._unmarkKeepables(step); up.hello(step.newElement, step); - this.addToResult(step.newElement); + this._addToResult(step.newElement); }, beforeDetach: () => { - up.syntax.clean(step.oldElement, { + up.script.clean(step.oldElement, { layer: step.layer }); }, @@ -3560,8 +3748,8 @@ }); }, scrollNew: () => { - this.handleFocus(step.newElement, step); - this.handleScroll(step.newElement, step); + this._handleFocus(step.newElement, step); + this._handleScroll(step.newElement, step); } }; return up.morph(step.oldElement, step.newElement, step.transition, morphOptions); @@ -3578,9 +3766,9 @@ newElement: newWrapper, focus: false }; - return this.executeStep(wrapperStep).then(() => { + return this._executeStep(wrapperStep).then(() => { e.unwrap(newWrapper); - this.handleFocus(step.oldElement, step); + this._handleFocus(step.oldElement, step); }); } case 'before': @@ -3591,9 +3779,9 @@ step.oldElement.insertAdjacentElement(position, wrapper); this.responseDoc.finalizeElement(wrapper); up.hello(wrapper, step); - this.addToResult(wrapper); - this.handleFocus(wrapper, step); - this.handleScroll(wrapper, step); + this._addToResult(wrapper); + this._handleFocus(wrapper, step); + this._handleScroll(wrapper, step); return up.animate(wrapper, step.transition, step).then(() => e.unwrap(wrapper)); } default: @@ -3602,7 +3790,7 @@ } } } - findKeepPlan(options) { + _findKeepPlan(options) { if (!options.useKeep) { return; } @@ -3624,22 +3812,23 @@ } else { partner = up.fragment.subtree(newElement, partnerSelector, lookupOpts)[0]; } - if (partner && e.booleanAttr(partner, 'up-keep')) { + if (partner && e.booleanAttr(partner, 'up-keep') !== false) { const plan = { oldElement, newElement: partner, - newData: up.syntax.data(partner) + newData: up.script.data(partner), + renderOptions: options }; if (!up.fragment.emitKeep(plan).defaultPrevented) { return plan; } } } - preserveKeepables(step) { + _preserveKeepables(step) { const keepPlans = []; if (step.useKeep) { for (let keepable of step.oldElement.querySelectorAll('[up-keep]')) { - let keepPlan = this.findKeepPlan({ + let keepPlan = this._findKeepPlan({ ...step, oldElement: keepable, descendantsOnly: true @@ -3647,12 +3836,14 @@ if (keepPlan) { const keepableClone = keepable.cloneNode(true); keepable.insertAdjacentElement('beforebegin', keepableClone); + keepable.classList.add('up-keeping'); + u.each(e.subtree(keepPlan.newElement, 'script'), e.disableScript); let viewports = up.viewport.subtree(keepPlan.oldElement); keepPlan.revivers = viewports.map(function (viewport) { let cursorProps = up.viewport.copyCursorProps(viewport); return () => up.viewport.copyCursorProps(cursorProps, viewport); }); - if (this.willChangeElement(document.body)) { + if (this._willChangeElement(document.body)) { keepPlan.newElement.replaceWith(keepable); } else { document.body.append(keepable); @@ -3663,7 +3854,7 @@ } step.keepPlans = keepPlans; } - restoreKeepables(step) { + _restoreKeepables(step) { for (let keepPlan of step.keepPlans) { keepPlan.newElement.replaceWith(keepPlan.oldElement); for (let reviver of keepPlan.revivers) { @@ -3671,10 +3862,15 @@ } } } - willChangeElement(element) { - return u.some(this.steps, step => step.oldElement.contains(element)); + _unmarkKeepables(step) { + for (let keepPlan of step.keepPlans) { + keepPlan.oldElement.classList.remove('up-keeping'); + } + } + _willChangeElement(element) { + return u.some(this._steps, step => step.oldElement.contains(element)); } - handleFocus(fragment, options) { + _handleFocus(fragment, options) { const fragmentFocus = new up.FragmentFocus({ ...options, fragment, @@ -3682,7 +3878,7 @@ }); return fragmentFocus.process(options.focus); } - handleScroll(fragment, options) { + _handleScroll(fragment, options) { const scrolling = new up.FragmentScrolling({ ...options, fragment, @@ -3693,75 +3889,82 @@ }; /***/ - }, /* 31 */ + }), ( /* 31 */ /***/() => { const u = up.util; up.Change.CloseLayer = class CloseLayer extends up.Change.Removal { constructor(options) { super(options); - this.verb = options.verb; - this.layer = up.layer.get(options); - this.origin = options.origin; - this.value = options.value; - this.preventable = options.preventable ?? true; - this.response = options.response; - this.history = options.history ?? true; + this._verb = options.verb; + this._layer = up.layer.get(options); + this._origin = options.origin; + this._value = options.value; + this._preventable = options.preventable ?? true; + this._response = options.response; + this._history = options.history ?? true; } execute() { - if (!this.layer.isOpen()) { + if (!this._layer.isOpen()) { return Promise.resolve(); } up.browser.assertConfirmed(this.options); - if (this.emitCloseEvent().defaultPrevented && this.preventable) { + if (this._emitCloseEvent().defaultPrevented && this._preventable) { throw new up.Aborted('Close event was prevented'); } + this._emitClosingEvent(); up.fragment.abort({ reason: 'Layer is closing', - layer: this.layer + layer: this._layer }); const { parent - } = this.layer; - this.layer.peel(); - this.layer.stack.remove(this.layer); - if (this.history) { + } = this._layer; + this._layer.peel(); + this._layer.stack.remove(this._layer); + if (this._history) { parent.restoreHistory(); } - this.handleFocus(parent); - this.layer.teardownHandlers(); - this.layer.destroyElements(this.options); - this.emitClosedEvent(parent); + this._handleFocus(parent); + this._layer.teardownHandlers(); + this._layer.destroyElements(this.options); + this._emitClosedEvent(parent); } - emitCloseEvent() { - let event = this.layer.emit(this.buildEvent(`up:layer:${this.verb}`), { - callback: this.layer.callback(`on${u.upperCaseFirst(this.verb)}`), - log: [`Will ${this.verb} ${this.layer} with value %o`, this.value] + _emitCloseEvent() { + let event = this._layer.emit(this._buildEvent(`up:layer:${this._verb}`), { + callback: this._layer.callback(`on${u.upperCaseFirst(this._verb)}`), + log: [`Will ${this._verb} ${this._layer} with value %o`, this._value] }); - this.value = event.value; + this._value = event.value; return event; } - emitClosedEvent(formerParent) { - const verbPast = `${this.verb}ed`; + _emitClosingEvent() { + let event = this._buildEvent(`up:layer:${this._verb}ing`); + this._layer.emit(event, { + log: false + }); + } + _emitClosedEvent(formerParent) { + const verbPast = `${this._verb}ed`; const verbPastUpperCaseFirst = u.upperCaseFirst(verbPast); - return this.layer.emit(this.buildEvent(`up:layer:${verbPast}`), { + return this._layer.emit(this._buildEvent(`up:layer:${verbPast}`), { baseLayer: formerParent, - callback: this.layer.callback(`on${verbPastUpperCaseFirst}`), + callback: this._layer.callback(`on${verbPastUpperCaseFirst}`), ensureBubbles: true, - log: [`${verbPastUpperCaseFirst} ${this.layer} with value %o`, this.value] + log: [`${verbPastUpperCaseFirst} ${this._layer} with value %o`, this._value] }); } - buildEvent(name) { + _buildEvent(name) { return up.event.build(name, { - layer: this.layer, - value: this.value, - origin: this.origin, - response: this.response + layer: this._layer, + value: this._value, + origin: this._origin, + response: this._response }); } - handleFocus(formerParent) { - this.layer.overlayFocus.teardown(); + _handleFocus(formerParent) { + this._layer.overlayFocus.teardown(); formerParent.overlayFocus?.moveToFront(); - let newFocusElement = this.layer.origin || formerParent.element; + let newFocusElement = this._layer.origin || formerParent.element; newFocusElement.focus({ preventScroll: true }); @@ -3769,7 +3972,7 @@ }; /***/ - }, /* 32 */ + }), ( /* 32 */ /***/() => { var _a; const u = up.util; @@ -3780,32 +3983,32 @@ this.options.normalizeLayerOptions = false; } execute() { - let newPageReason = this.newPageReason(); - if (newPageReason) { - up.puts('up.render()', newPageReason); + let _newPageReason = this._newPageReason(); + if (_newPageReason) { + up.puts('up.render()', _newPageReason); up.network.loadPage(this.options); return u.unresolvablePromise(); } - this.request = up.request(this.getRequestAttrs()); + this.request = up.request(this._getRequestAttrs()); this.options.onRequest?.(this.request); up.feedback.showAroundRequest(this.request, this.options); up.form.disableWhile(this.request, this.options); if (this.options.preload) { return this.request; } - return u.always(this.request, responseOrError => this.onRequestSettled(responseOrError)); + return u.always(this.request, responseOrError => this._onRequestSettled(responseOrError)); } - newPageReason() { + _newPageReason() { if (u.isCrossOrigin(this.options.url)) { return 'Loading cross-origin content in new page'; } - if (!up.browser.canPushState()) { + if (this.options.history && !up.browser.canPushState()) { return 'Loading content in new page to restore history support'; } } - getRequestAttrs() { - const successAttrs = this.preflightPropsForRenderOptions(this.options); - const failAttrs = this.preflightPropsForRenderOptions(this.deriveFailOptions(), { + _getRequestAttrs() { + const successAttrs = this._preflightPropsForRenderOptions(this.options); + const failAttrs = this._preflightPropsForRenderOptions(this.deriveFailOptions(), { optional: true }); return { @@ -3815,29 +4018,29 @@ }; } getPreflightProps() { - return this.getRequestAttrs(); + return this._getRequestAttrs(); } - preflightPropsForRenderOptions(renderOptions, requestAttributesOptions) { + _preflightPropsForRenderOptions(renderOptions, requestAttributesOptions) { const preview = new up.Change.FromContent({ ...renderOptions, preview: true }); return preview.getPreflightProps(requestAttributesOptions); } - onRequestSettled(response) { + _onRequestSettled(response) { if (response instanceof up.Response) { - return this.onRequestSettledWithResponse(response); + return this._onRequestSettledWithResponse(response); } else { - return this.onRequestSettledWithError(response); + return this._onRequestSettledWithError(response); } } - onRequestSettledWithResponse(response) { + _onRequestSettledWithResponse(response) { return new up.Change.FromResponse({ ...this.options, response }).execute(); } - onRequestSettledWithError(error) { + _onRequestSettledWithError(error) { if (error instanceof up.Offline) { this.request.emit('up:fragment:offline', { callback: this.options.onOffline, @@ -3852,67 +4055,71 @@ throw error; } }, (() => { - u.memoizeMethod(_a.prototype, ['getRequestAttrs']); + u.memoizeMethod(_a.prototype, { + _getRequestAttrs: true + }); })(), _a); /***/ - }, /* 33 */ + }), ( /* 33 */ /***/() => { var _a; const u = up.util; up.Change.FromResponse = (_a = class FromResponse extends up.Change { constructor(options) { super(options); - this.response = options.response; - this.request = this.response.request; + this._response = options.response; + this._request = this._response.request; } execute() { - if (up.fragment.config.skipResponse(this.loadedEventProps())) { - this.skip(); + if (up.fragment.config.skipResponse(this._loadedEventProps())) { + this._skip(); } else { - this.request.assertEmitted('up:fragment:loaded', { - ...this.loadedEventProps(), + this._request.assertEmitted('up:fragment:loaded', { + ...this._loadedEventProps(), callback: this.options.onLoaded, - log: ['Loaded fragment from %s', this.response.description], - skip: () => this.skip() + log: ['Loaded fragment from %s', this._response.description], + skip: () => this._skip() }); } - let fail = u.evalOption(this.options.fail, this.response) ?? !this.response.ok; + let fail = u.evalOption(this.options.fail, this._response) ?? !this._response.ok; if (fail) { - throw this.updateContentFromResponse(this.deriveFailOptions()); + throw this._updateContentFromResponse(this.deriveFailOptions()); } - return this.updateContentFromResponse(this.options); + return this._updateContentFromResponse(this.options); } - skip() { - up.puts('up.render()', 'Skipping ' + this.response.description); + _skip() { + up.puts('up.render()', 'Skipping ' + this._response.description); this.options.target = ':none'; this.options.failTarget = ':none'; } - updateContentFromResponse(finalRenderOptions) { + _updateContentFromResponse(finalRenderOptions) { if (finalRenderOptions.failPrefixForced) { up.puts('up.render()', 'Rendering failed response using fail-prefixed options (https://unpoly.com/failed-responses)'); } - this.augmentOptionsFromResponse(finalRenderOptions); - finalRenderOptions.meta = this.compilerPassMeta(); + this._augmentOptionsFromResponse(finalRenderOptions); + finalRenderOptions.meta = this._compilerPassMeta(); let result = new up.Change.FromContent(finalRenderOptions).execute(); result.finished = this.finish(result, finalRenderOptions); return result; } async finish(renderResult, originalRenderOptions) { renderResult = await renderResult.finished; - if (up.fragment.shouldRevalidate(this.request, this.response, originalRenderOptions)) { - renderResult = await this.revalidate(renderResult, originalRenderOptions); + if (up.fragment.shouldRevalidate(this._request, this._response, originalRenderOptions)) { + renderResult = await this._revalidate(renderResult, originalRenderOptions); } return renderResult; } - async revalidate(renderResult, originalRenderOptions) { - let target = originalRenderOptions.target; - if (/:(before|after)/.test(target)) { - up.warn('up.render()', 'Cannot revalidate cache when prepending/appending (target %s)', target); + async _revalidate(renderResult, originalRenderOptions) { + let inputTarget = originalRenderOptions.target; + let effectiveTarget = renderResult.target; + if (/:(before|after)/.test(inputTarget)) { + up.warn('up.render()', 'Cannot revalidate cache when prepending/appending (target %s)', inputTarget); } else { - up.puts('up.render()', 'Revalidating cached response for target "%s"', target); - let verifyResult = await up.reload(renderResult.target, { + up.puts('up.render()', 'Revalidating cached response for target "%s"', effectiveTarget); + let verifyResult = await up.reload(effectiveTarget, { ...originalRenderOptions, + preferOldElements: renderResult.fragments, layer: renderResult.layer, onFinished: null, scroll: false, @@ -3922,7 +4129,7 @@ confirm: false, feedback: false, abort: false, - expiredResponse: this.response + expiredResponse: this._response }); if (!verifyResult.none) { renderResult = verifyResult; @@ -3930,30 +4137,34 @@ } return renderResult; } - loadedEventProps() { + _loadedEventProps() { const { expiredResponse } = this.options; return { - request: this.request, - response: this.response, + request: this._request, + response: this._response, renderOptions: this.options, revalidating: !!expiredResponse, expiredResponse }; } - compilerPassMeta() { - return u.pick(this.loadedEventProps(), ['revalidating', 'response']); + _compilerPassMeta() { + let meta = { + revalidating: !!this.options.expiredResponse + }; + up.migrate.processCompilerPassMeta?.(meta, this._response); + return meta; } - augmentOptionsFromResponse(renderOptions) { - const responseURL = this.response.url; + _augmentOptionsFromResponse(renderOptions) { + const responseURL = this._response.url; let serverLocation = responseURL; - let hash = this.request.hash; + let hash = this._request.hash; if (hash) { renderOptions.hash = hash; serverLocation += hash; } - const isReloadable = this.response.method === 'GET'; + const isReloadable = this._response.method === 'GET'; if (isReloadable) { renderOptions.source = this.improveHistoryValue(renderOptions.source, responseURL); } else { @@ -3961,177 +4172,176 @@ renderOptions.history = !!renderOptions.location; } renderOptions.location = this.improveHistoryValue(renderOptions.location, serverLocation); - renderOptions.title = this.improveHistoryValue(renderOptions.title, this.response.title); - renderOptions.eventPlans = this.response.eventPlans; - let serverTarget = this.response.target; + renderOptions.title = this.improveHistoryValue(renderOptions.title, this._response.title); + renderOptions.eventPlans = this._response.eventPlans; + let serverTarget = this._response.target; if (serverTarget) { renderOptions.target = serverTarget; } - renderOptions.acceptLayer = this.response.acceptLayer; - renderOptions.dismissLayer = this.response.dismissLayer; - renderOptions.document = this.response.text; - if (this.response.none) { + renderOptions.acceptLayer = this._response.acceptLayer; + renderOptions.dismissLayer = this._response.dismissLayer; + renderOptions.document = this._response.text; + if (this._response.none) { renderOptions.target = ':none'; } - renderOptions.context = u.merge(renderOptions.context, this.response.context); - renderOptions.cspNonces = this.response.cspNonces; - renderOptions.time ?? (renderOptions.time = this.response.lastModified); - renderOptions.etag ?? (renderOptions.etag = this.response.etag); + renderOptions.context = u.merge(renderOptions.context, this._response.context); + renderOptions.cspNonces = this._response.cspNonces; + renderOptions.time ??= this._response.lastModified; + renderOptions.etag ??= this._response.etag; } }, (() => { - u.memoizeMethod(_a.prototype, ['loadedEventProps']); + u.memoizeMethod(_a.prototype, { + _loadedEventProps: true + }); })(), _a); /***/ - }, /* 34 */ + }), ( /* 34 */ /***/() => { var _a; const u = up.util; up.Change.FromContent = (_a = class FromContent extends up.Change { constructor(options) { super(options); - this.layers = u.filter(up.layer.getAll(this.options), this.isRenderableLayer); - this.origin = this.options.origin; - this.preview = this.options.preview; - this.mode = this.options.mode; - if (this.origin) { - this.originLayer = up.layer.get(this.origin); - } + this._origin = this.options.origin; + this._preview = this.options.preview; } - isRenderableLayer(layer) { - return layer === 'new' || layer.isOpen(); - } - getPlans() { - var _a; + _getPlans() { let plans = []; - if (this.options.fragment) { - (_a = this.options).target || (_a.target = this.getResponseDoc().rootSelector()); - } - this.expandIntoPlans(plans, this.layers, this.options.target); - this.expandIntoPlans(plans, this.layers, this.options.fallback); + this._lookupLayers(); + this._improveOptionsFromResponseDoc(); + this._expandIntoPlans(plans, this._layers, this.options.target); + this._expandIntoPlans(plans, this._layers, this.options.fallback); return plans; } - expandIntoPlans(plans, layers, targets) { + _isRenderableLayer(layer) { + return layer === 'new' || layer.isOpen(); + } + _lookupLayers() { + this._allLayers = up.layer.getAll(this.options); + this._layers = u.filter(this._allLayers, this._isRenderableLayer); + } + _expandIntoPlans(plans, layers, targets) { for (let layer of layers) { - for (let target of this.expandTargets(targets, layer)) { + for (let target of this._expandTargets(targets, layer)) { const props = { ...this.options, target, layer, - defaultPlacement: this.defaultPlacement() + defaultPlacement: this._defaultPlacement() }; const change = layer === 'new' ? new up.Change.OpenLayer(props) : new up.Change.UpdateLayer(props); plans.push(change); } } } - expandTargets(targets, layer) { + _expandTargets(targets, layer) { return up.fragment.expandTargets(targets, { layer, - mode: this.mode, - origin: this.origin + mode: this.options.mode, + origin: this._origin }); } execute() { if (this.options.preload) { return Promise.resolve(); } - return this.seekPlan(this.executePlan.bind(this)) || this.cannotMatchPostflightTarget(); + return this._seekPlan(this._executePlan.bind(this)) || this._cannotMatchPostflightTarget(); } - executePlan(matchedPlan) { - let result; - try { - result = matchedPlan.execute(this.getResponseDoc(), this.onPlanApplicable.bind(this, matchedPlan)); - result.options = this.options; - this.executeHungry(matchedPlan, result); - return result; - } catch (error) { - if (this.isApplicablePlanError(error)) { - this.executeHungry(matchedPlan, result); - } - throw error; - } + _executePlan(matchedPlan) { + let result = matchedPlan.execute(this._getResponseDoc(), this._onPlanApplicable.bind(this, matchedPlan)); + result.options = this.options; + return result; } - isApplicablePlanError(error) { + _isApplicablePlanError(error) { return !(error instanceof up.CannotMatch); } - executeHungry(plan, originalResult) { - if (!this.options.useHungry) return; - let hungrySteps = plan.getHungrySteps(); - let hungryResult = new up.Change.UpdateSteps({ - steps: hungrySteps - }).execute(this.getResponseDoc()); - if (originalResult) { - originalResult.fragments.push(...hungryResult.fragments); - } - } - onPlanApplicable(plan) { - let primaryPlan = this.getPlans()[0]; + _onPlanApplicable(plan) { + let primaryPlan = this._getPlans()[0]; if (plan !== primaryPlan) { up.puts('up.render()', 'Could not match primary target "%s". Updating a fallback target "%s".', primaryPlan.target, plan.target); } + let { + assets + } = this._getResponseDoc(); + if (assets) { + up.script.assertAssetsOK(assets, plan.options); + } } - getResponseDoc() { - if (this.preview) return; + _getResponseDoc() { + if (this._preview) return; const docOptions = u.pick(this.options, ['target', 'content', 'fragment', 'document', 'html', 'cspNonces', 'origin']); up.migrate.handleResponseDocOptions?.(docOptions); - if (this.defaultPlacement() === 'content') { - docOptions.target = this.firstExpandedTarget(docOptions.target); + if (this._defaultPlacement() === 'content') { + docOptions.target = this._firstExpandedTarget(docOptions.target); } return new up.ResponseDoc(docOptions); } - defaultPlacement() { + _improveOptionsFromResponseDoc() { + if (this._preview) return; + let responseDoc = this._getResponseDoc(); + if (this.options.fragment) { + this.options.target ||= responseDoc.rootSelector(); + } + this.options.title = this.improveHistoryValue(this.options.title, responseDoc.title); + this.options.metaTags = this.improveHistoryValue(this.options.metaTags, responseDoc.metaTags); + } + _defaultPlacement() { if (!this.options.document && !this.options.fragment) { return 'content'; } } - firstExpandedTarget(target) { - return this.expandTargets(target || ':main', this.layers[0])[0]; + _firstExpandedTarget(target) { + let layer = this._layers[0] || up.layer.root; + return this._expandTargets(target || ':main', layer)[0]; } getPreflightProps(opts = {}) { const getPlanProps = plan => plan.getPreflightProps(); - return this.seekPlan(getPlanProps) || opts.optional || this.cannotMatchPreflightTarget(); + return this._seekPlan(getPlanProps) || opts.optional || this._cannotMatchPreflightTarget(); } - cannotMatchPreflightTarget() { - this.cannotMatchTarget('Could not find target in current page'); + _cannotMatchPreflightTarget() { + this._cannotMatchTarget('Could not find target in current page'); } - cannotMatchPostflightTarget() { - this.cannotMatchTarget('Could not find common target in current page and response'); + _cannotMatchPostflightTarget() { + this._cannotMatchTarget('Could not find common target in current page and response'); } - cannotMatchTarget(reason) { - let message; - if (this.getPlans().length) { - const planTargets = u.uniq(u.map(this.getPlans(), 'target')); + _cannotMatchTarget(reason) { + if (this._getPlans().length) { + const planTargets = u.uniq(u.map(this._getPlans(), 'target')); const humanizedLayerOption = up.layer.optionToString(this.options.layer); - message = [reason + " (tried selectors %o in %s)", planTargets, humanizedLayerOption]; - } else if (this.layers.length) { - if (this.options.failPrefixForced) { - message = 'No target selector given for failed responses (https://unpoly.com/failed-responses)'; - } else { - message = 'No target selector given'; - } + throw new up.CannotMatch([reason + " (tried selectors %o in %s)", planTargets, humanizedLayerOption]); + } else if (this._layers.length === 0) { + this._cannotMatchLayer(); + } else if (this.options.failPrefixForced) { + throw new up.CannotMatch('No target selector given for failed responses (https://unpoly.com/failed-responses)'); } else { - message = 'Could not find a layer to render in. You may have passed a non-existing layer reference, or a detached element.'; + throw new up.CannotMatch('No target selector given'); } - throw new up.CannotMatch(message); } - seekPlan(fn) { - for (let plan of this.getPlans()) { + _cannotMatchLayer() { + throw new up.CannotMatch('Could not find a layer to render in. You may have passed an unmatchable layer reference, or a detached element.'); + } + _seekPlan(fn) { + for (let plan of this._getPlans()) { try { return fn(plan); } catch (error) { - if (this.isApplicablePlanError(error)) { + if (this._isApplicablePlanError(error)) { throw error; } } } } }, (() => { - u.memoizeMethod(_a.prototype, ['getPlans', 'getResponseDoc', 'getPreflightProps']); + u.memoizeMethod(_a.prototype, { + _getPlans: true, + _getResponseDoc: true, + getPreflightProps: true + }); })(), _a); /***/ - }, /* 35 */ + }), ( /* 35 */ /***/() => { const u = up.util; up.CompilerPass = class CompilerPass { @@ -4141,105 +4351,93 @@ dataMap, meta }) { - layer || (layer = up.layer.get(root) || up.layer.current); - this.root = root; - this.compilers = compilers; - this.layer = layer; - this.data = data; - this.dataMap = dataMap; - this.meta = { - layer, - ...meta - }; - this.errors = []; + layer ||= up.layer.get(root) || up.layer.current; + this._root = root; + this._compilers = compilers; + this._layer = layer; + this._data = data; + this._dataMap = dataMap; + meta ||= {}; + meta.layer = layer; + this._meta = meta; } run() { - this.layer.asCurrent(() => { + this._layer.asCurrent(() => { this.setCompileData(); - for (let compiler of this.compilers) { - this.runCompiler(compiler); + for (let compiler of this._compilers) { + this._runCompiler(compiler); } }); - if (this.errors.length) { - throw new up.CannotCompile('Errors while compiling', { - errors: this.errors - }); - } } setCompileData() { - if (this.data) { - this.root.upCompileData = this.data; + if (this._data) { + this._root.upCompileData = this._data; } - if (this.dataMap) { - for (let selector in this.dataMap) { - for (let match of this.select(selector)) { - match.upCompileData = this.dataMap[selector]; + if (this._dataMap) { + for (let selector in this._dataMap) { + for (let match of this._select(selector)) { + match.upCompileData = this._dataMap[selector]; } } } } - runCompiler(compiler) { - const matches = this.selectOnce(compiler); + _runCompiler(compiler) { + const matches = this._selectOnce(compiler); if (!matches.length) { return; } if (!compiler.isDefault) { - up.puts('up.hello()', 'Compiling %d× "%s" on %s', matches.length, compiler.selector, this.layer); + up.puts('up.hello()', 'Compiling %d× "%s" on %s', matches.length, compiler.selector, this._layer); } if (compiler.batch) { - this.compileBatch(compiler, matches); + this._compileBatch(compiler, matches); } else { for (let match of matches) { - this.compileOneElement(compiler, match); + this._compileOneElement(compiler, match); } } return up.migrate.postCompile?.(matches, compiler); } - compileOneElement(compiler, element) { + _compileOneElement(compiler, element) { const compileArgs = [element]; if (compiler.length !== 1) { - const data = up.syntax.data(element); - compileArgs.push(data, this.meta); + const data = up.script.data(element); + compileArgs.push(data, this._meta); } - const result = this.applyCompilerFunction(compiler, element, compileArgs); - let destructorOrDestructors = this.destructorPresence(result); + const result = this._applyCompilerFunction(compiler, element, compileArgs); + let destructorOrDestructors = this._destructorPresence(result); if (destructorOrDestructors) { up.destructor(element, destructorOrDestructors); } } - compileBatch(compiler, elements) { + _compileBatch(compiler, elements) { const compileArgs = [elements]; if (compiler.length !== 1) { - const dataList = u.map(elements, up.syntax.data); - compileArgs.push(dataList, this.meta); + const dataList = u.map(elements, up.script.data); + compileArgs.push(dataList, this._meta); } - const result = this.applyCompilerFunction(compiler, elements, compileArgs); - if (this.destructorPresence(result)) { + const result = this._applyCompilerFunction(compiler, elements, compileArgs); + if (this._destructorPresence(result)) { up.fail('Compilers with { batch: true } cannot return destructors'); } } - applyCompilerFunction(compiler, elementOrElements, compileArgs) { - try { - return compiler.apply(elementOrElements, compileArgs); - } catch (error) { - this.errors.push(error); - up.log.error('up.hello()', 'While compiling %o: %o', elementOrElements, error); - } + _applyCompilerFunction(compiler, elementOrElements, compileArgs) { + return up.error.guard(() => compiler.apply(elementOrElements, compileArgs)); } - destructorPresence(result) { + _destructorPresence(result) { if (u.isFunction(result) || u.isArray(result) && u.every(result, u.isFunction)) { return result; } } - select(selector) { - return up.fragment.subtree(this.root, u.evalOption(selector), { - layer: this.layer + _select(selector) { + return up.fragment.subtree(this._root, u.evalOption(selector), { + layer: this._layer }); } - selectOnce(compiler) { - let matches = this.select(compiler.selector); + _selectOnce(compiler) { + let matches = this._select(compiler.selector); return u.filter(matches, element => { - let appliedCompilers = element.upAppliedCompilers || (element.upAppliedCompilers = new Set()); + let appliedCompilers = element.upAppliedCompilers ||= new Set(); if (!appliedCompilers.has(compiler)) { appliedCompilers.add(compiler); return true; @@ -4249,154 +4447,143 @@ }; /***/ - }, /* 36 */ + }), ( /* 36 */ /***/() => { const u = up.util; const e = up.element; up.CSSTransition = class CSSTransition { constructor(element, lastFrameKebab, options) { - this.element = element; - this.lastFrameKebab = lastFrameKebab; - this.lastFrameKeysKebab = Object.keys(this.lastFrameKebab); - if (u.some(this.lastFrameKeysKebab, key => key.match(/A-Z/))) { + this._element = element; + this._lastFrameKebab = lastFrameKebab; + this._lastFrameKeysKebab = Object.keys(this._lastFrameKebab); + if (u.some(this._lastFrameKeysKebab, key => key.match(/A-Z/))) { up.fail('Animation keys must be kebab-case'); } - this.finishEvent = options.finishEvent; - this.duration = options.duration; - this.easing = options.easing; - this.finished = false; + this._finishEvent = options.finishEvent; + this._duration = options.duration; + this._easing = options.easing; + this._finished = false; } start() { - if (this.lastFrameKeysKebab.length === 0) { - this.finished = true; + if (this._lastFrameKeysKebab.length === 0) { + this._finished = true; return Promise.resolve(); } - this.deferred = u.newDeferred(); - this.pauseOldTransition(); - this.startTime = new Date(); - this.startFallbackTimer(); - this.listenToFinishEvent(); - this.listenToTransitionEnd(); - this.startMotion(); - return this.deferred; + this._deferred = u.newDeferred(); + this._pauseOldTransition(); + this._startTime = new Date(); + this._startFallbackTimer(); + this._listenToFinishEvent(); + this._listenToTransitionEnd(); + this._startMotion(); + return this._deferred; } - listenToFinishEvent() { - if (this.finishEvent) { - this.stopListenToFinishEvent = up.on(this.element, this.finishEvent, this.onFinishEvent.bind(this)); + _listenToFinishEvent() { + if (this._finishEvent) { + this._stopListenToFinishEvent = up.on(this._element, this._finishEvent, this._onFinishEvent.bind(this)); } } - onFinishEvent(event) { + _onFinishEvent(event) { event.stopPropagation(); - this.finish(); + this._finish(); } - startFallbackTimer() { + _startFallbackTimer() { const timingTolerance = 100; - this.fallbackTimer = u.timer(this.duration + timingTolerance, () => { - this.finish(); + this._fallbackTimer = u.timer(this._duration + timingTolerance, () => { + this._finish(); }); } - stopFallbackTimer() { - clearTimeout(this.fallbackTimer); + _stopFallbackTimer() { + clearTimeout(this._fallbackTimer); } - listenToTransitionEnd() { - this.stopListenToTransitionEnd = up.on(this.element, 'transitionend', this.onTransitionEnd.bind(this)); + _listenToTransitionEnd() { + this._stopListenToTransitionEnd = up.on(this._element, 'transitionend', this._onTransitionEnd.bind(this)); } - onTransitionEnd(event) { - if (event.target !== this.element) { + _onTransitionEnd(event) { + if (event.target !== this._element) { return; } - const elapsed = new Date() - this.startTime; - if (elapsed <= 0.25 * this.duration) { + const elapsed = new Date() - this._startTime; + if (elapsed <= 0.25 * this._duration) { return; } const completedPropertyKebab = event.propertyName; - if (!u.contains(this.lastFrameKeysKebab, completedPropertyKebab)) { + if (!u.contains(this._lastFrameKeysKebab, completedPropertyKebab)) { return; } - this.finish(); + this._finish(); } - finish() { - if (this.finished) { + _finish() { + if (this._finished) { return; } - this.finished = true; - this.stopFallbackTimer(); - this.stopListenToFinishEvent?.(); - this.stopListenToTransitionEnd?.(); - e.concludeCSSTransition(this.element); - this.resumeOldTransition(); - this.deferred.resolve(); + this._finished = true; + this._stopFallbackTimer(); + this._stopListenToFinishEvent?.(); + this._stopListenToTransitionEnd?.(); + e.concludeCSSTransition(this._element); + this._resumeOldTransition(); + this._deferred.resolve(); } - pauseOldTransition() { - const oldTransition = e.style(this.element, ['transitionProperty', 'transitionDuration', 'transitionDelay', 'transitionTimingFunction']); + _pauseOldTransition() { + const oldTransition = e.style(this._element, ['transitionProperty', 'transitionDuration', 'transitionDelay', 'transitionTimingFunction']); if (e.hasCSSTransition(oldTransition)) { if (oldTransition.transitionProperty !== 'all') { const oldTransitionProperties = oldTransition.transitionProperty.split(/\s*,\s*/); - const oldTransitionFrameKebab = e.style(this.element, oldTransitionProperties); - this.setOldTransitionTargetFrame = e.setTemporaryStyle(this.element, oldTransitionFrameKebab); + const oldTransitionFrameKebab = e.style(this._element, oldTransitionProperties); + this._setOldTransitionTargetFrame = e.setTemporaryStyle(this._element, oldTransitionFrameKebab); } - this.setOldTransition = e.concludeCSSTransition(this.element); + this._setOldTransition = e.concludeCSSTransition(this._element); } } - resumeOldTransition() { - this.setOldTransitionTargetFrame?.(); - this.setOldTransition?.(); + _resumeOldTransition() { + this._setOldTransitionTargetFrame?.(); + this._setOldTransition?.(); } - startMotion() { - e.setStyle(this.element, { - transitionProperty: Object.keys(this.lastFrameKebab).join(', '), - transitionDuration: `${this.duration}ms`, - transitionTimingFunction: this.easing + _startMotion() { + e.setStyle(this._element, { + transitionProperty: Object.keys(this._lastFrameKebab).join(', '), + transitionDuration: `${this._duration}ms`, + transitionTimingFunction: this._easing }); - e.setStyle(this.element, this.lastFrameKebab); + e.setStyle(this._element, this._lastFrameKebab); } }; /***/ - }, /* 37 */ + }), ( /* 37 */ /***/() => { const u = up.util; up.DestructorPass = class DestructorPass { constructor(fragment, options) { - this.fragment = fragment; - this.options = options; - this.errors = []; + this._fragment = fragment; + this._options = options; } run() { - for (let cleanable of this.selectCleanables()) { + for (let cleanable of this._selectCleanables()) { let destructors = u.pluckKey(cleanable, 'upDestructors'); if (destructors) { for (let destructor of destructors) { - this.applyDestructorFunction(destructor, cleanable); + this._applyDestructorFunction(destructor, cleanable); } } cleanable.classList.remove('up-can-clean'); } - if (this.errors.length) { - throw new up.Error('Errors while destroying', { - errors: this.errors - }); - } } - selectCleanables() { + _selectCleanables() { const selectOptions = { - ...this.options, + ...this._options, destroying: true }; - return up.fragment.subtree(this.fragment, '.up-can-clean', selectOptions); + return up.fragment.subtree(this._fragment, '.up-can-clean', selectOptions); } - applyDestructorFunction(destructor, element) { - try { - destructor(); - } catch (error) { - this.errors.push(error); - up.log.error('up.destroy()', 'While destroying %o: %o', element, error); - } + _applyDestructorFunction(destructor, element) { + up.error.guard(() => destructor(element)); } }; /***/ - }, /* 38 */ + }), ( /* 38 */ /***/() => { const u = up.util; const e = up.element; @@ -4405,20 +4592,20 @@ return ['target', 'event', 'baseLayer', 'callback', 'log', 'ensureBubbles']; } emit() { - this.logEmission(); + this._logEmission(); if (this.baseLayer) { - this.baseLayer.asCurrent(() => this.dispatchEvent()); + this.baseLayer.asCurrent(() => this._dispatchEvent()); } else { - this.dispatchEvent(); + this._dispatchEvent(); } return this.event; } - dispatchEvent() { + _dispatchEvent() { this.target.dispatchEvent(this.event); if (this.ensureBubbles && !this.target.isConnected) { document.dispatchEvent(this.event); } - this.callback?.(this.event); + up.error.guard(() => this.callback?.(this.event)); } assertEmitted() { const event = this.emit(); @@ -4426,7 +4613,7 @@ throw new up.Aborted(`Event ${event.type} was prevented`); } } - logEmission() { + _logEmission() { if (!up.log.config.enabled) { return; } @@ -4457,8 +4644,8 @@ let layer; if (u.isGiven(options.layer)) { layer = up.layer.get(options.layer); - options.target || (options.target = layer.element); - options.baseLayer || (options.baseLayer = layer); + options.target ||= layer.element; + options.baseLayer ||= layer; } if (options.baseLayer) { options.baseLayer = up.layer.get(options.baseLayer); @@ -4472,7 +4659,7 @@ } if (args[0]?.preventDefault) { options.event = args[0]; - options.log ?? (options.log = args[0].log); + options.log ??= args[0].log; } else if (u.isString(args[0])) { options.event = up.event.build(args[0], options); } else { @@ -4483,7 +4670,7 @@ }; /***/ - }, /* 39 */ + }), ( /* 39 */ /***/() => { const u = up.util; up.EventListener = class EventListener extends up.Record { @@ -4492,30 +4679,29 @@ } constructor(attributes) { super(attributes); - this.key = this.constructor.buildKey(attributes); + this._key = this.constructor._buildKey(attributes); this.isDefault = up.framework.evaling; - this.beforeBoot ?? (this.beforeBoot = this.eventType.indexOf('up:framework:') === 0); + this.beforeBoot ??= this.eventType.indexOf('up:framework:') === 0; this.nativeCallback = this.nativeCallback.bind(this); } bind() { - var _a; - const map = (_a = this.element).upEventListeners || (_a.upEventListeners = {}); - if (map[this.key]) { + const map = this.element.upEventListeners ||= {}; + if (map[this._key]) { up.fail('up.on(): The %o callback %o cannot be registered more than once', this.eventType, this.callback); } - map[this.key] = this; - this.element.addEventListener(...this.addListenerArgs()); + map[this._key] = this; + this.element.addEventListener(...this._addListenerArg()); } - addListenerArgs() { + _addListenerArg() { let options = u.compactObject(u.pick(this, ['once', 'passive'])); return [this.eventType, this.nativeCallback, options]; } unbind() { let map = this.element.upEventListeners; if (map) { - delete map[this.key]; + delete map[this._key]; } - this.element.removeEventListener(...this.addListenerArgs()); + this.element.removeEventListener(...this._addListenerArg()); } nativeCallback(event) { if (up.framework.beforeBoot && !this.beforeBoot) { @@ -4532,7 +4718,7 @@ const args = [event, element]; const expectedArgCount = this.callback.length; if (expectedArgCount !== 1 && expectedArgCount !== 2) { - const data = up.syntax.data(element); + const data = up.script.data(element); args.push(data); } if (this.eventType === 'click' && element.disabled) { @@ -4549,13 +4735,12 @@ static fromElement(attributes) { let map = attributes.element.upEventListeners; if (map) { - const key = this.buildKey(attributes); + const key = this._buildKey(attributes); return map[key]; } } - static buildKey(attributes) { - var _a; - (_a = attributes.callback).upUid || (_a.upUid = u.uid()); + static _buildKey(attributes) { + attributes.callback.upUid ||= u.uid(); return [attributes.eventType, attributes.selector, attributes.callback.upUid].join('|'); } static allNonDefault(element) { @@ -4570,7 +4755,7 @@ }; /***/ - }, /* 40 */ + }), ( /* 40 */ /***/() => { const u = up.util; up.EventListenerGroup = class EventListenerGroup extends up.Record { @@ -4579,21 +4764,21 @@ } bind() { const unbindFns = []; - this.eachListenerAttributes(function (attrs) { + this._eachListenerAttributes(function (attrs) { const listener = new up.EventListener(attrs); listener.bind(); return unbindFns.push(listener.unbind.bind(listener)); }); return u.sequence(unbindFns); } - eachListenerAttributes(fn) { + _eachListenerAttributes(fn) { for (let element of this.elements) { for (let eventType of this.eventTypes) { - fn(this.listenerAttributes(element, eventType)); + fn(this._listenerAttributes(element, eventType)); } } } - listenerAttributes(element, eventType) { + _listenerAttributes(element, eventType) { return { ...this.attributes(), element, @@ -4601,7 +4786,7 @@ }; } unbind() { - this.eachListenerAttributes(function (attrs) { + this._eachListenerAttributes(function (attrs) { let listener = up.EventListener.fromElement(attrs); if (listener) { listener.unbind(); @@ -4639,20 +4824,19 @@ }; /***/ - }, /* 41 */ + }), ( /* 41 */ /***/() => { const u = up.util; up.FieldWatcher = class FieldWatcher { - constructor(form, fields, options, callback) { - this.callback = callback; - this.form = form; - this.fields = fields; - this.options = options; - this.batch = options.batch; - this.unbindFns = []; - } - fieldOptions(field) { - let options = u.copy(this.options); + constructor(fields, options, callback) { + this._callback = callback; + this._fields = fields; + this._options = options; + this._batch = options.batch; + this._unbindFns = []; + } + _fieldOptions(field) { + let options = u.copy(this._options); return up.form.watchOptions(field, options, { defaults: { event: 'input' @@ -4660,78 +4844,81 @@ }); } start() { - this.scheduledValues = null; - this.processedValues = this.readFieldValues(); - this.currentTimer = null; - this.callbackRunning = false; - for (let field of this.fields) { - this.watchField(field); + this._scheduledValues = null; + this._processedValues = this._readFieldValues(); + this._currentTimer = null; + this._callbackRunning = false; + for (let field of this._fields) { + this._watchField(field); } } - watchField(field) { - let fieldOptions = this.fieldOptions(field); - this.unbindFns.push(up.on(field, fieldOptions.event, event => this.check(event, fieldOptions))); - this.unbindFns.push(up.fragment.onAborted(field, () => this.cancelTimer())); + _watchField(field) { + let _fieldOptions = this._fieldOptions(field); + this._unbindFns.push(up.on(field, _fieldOptions.event, event => this._check(event, _fieldOptions))); + this._unbindFns.push(up.fragment.onAborted(field, () => this._cancelTimer())); } stop() { - for (let unbindFn of this.unbindFns) unbindFn(); - this.cancelTimer(); - } - cancelTimer() { - clearTimeout(this.currentTimer); - this.currentTimer = null; - } - isAnyFieldAttached() { - return u.some(this.fields, 'isConnected'); - } - scheduleValues(values, event, fieldOptions) { - this.cancelTimer(); - this.scheduledValues = values; - let delay = u.evalOption(fieldOptions.delay, event); - this.currentTimer = u.timer(delay, () => { - this.currentTimer = null; - if (this.isAnyFieldAttached()) { - this.scheduledFieldOptions = fieldOptions; - this.requestCallback(); + for (let unbindFn of this._unbindFns) unbindFn(); + this._cancelTimer(); + } + _cancelTimer() { + clearTimeout(this._currentTimer); + this._currentTimer = null; + } + _isAnyFieldAttached() { + return u.some(this._fields, 'isConnected'); + } + _scheduleValues(values, event, _fieldOptions) { + this._cancelTimer(); + this._scheduledValues = values; + let delay = u.evalOption(_fieldOptions.delay, event); + this._currentTimer = u.timer(delay, () => { + this._currentTimer = null; + if (this._isAnyFieldAttached()) { + this.scheduledFieldOptions = _fieldOptions; + this._requestCallback(); } else { - this.scheduledValues = null; + this._scheduledValues = null; } }); } - isNewValues(values) { - return !u.isEqual(values, this.processedValues) && !u.isEqual(this.scheduledValues, values); + _isNewValues(values) { + return !u.isEqual(values, this._processedValues) && !u.isEqual(this._scheduledValues, values); } - async requestCallback() { - let fieldOptions = this.scheduledFieldOptions; - if (this.scheduledValues !== null && !this.currentTimer && !this.callbackRunning) { - const diff = this.changedValues(this.processedValues, this.scheduledValues); - this.processedValues = this.scheduledValues; - this.scheduledValues = null; - this.callbackRunning = true; + async _requestCallback() { + let _fieldOptions = this.scheduledFieldOptions; + if (this._scheduledValues !== null && !this._currentTimer && !this._callbackRunning) { + const diff = this._changedValues(this._processedValues, this._scheduledValues); + this._processedValues = this._scheduledValues; + this._scheduledValues = null; + this._callbackRunning = true; this.scheduledFieldOptions = null; let callbackOptions = { - ...fieldOptions, + ..._fieldOptions, disable: false }; const callbackReturnValues = []; - if (this.batch) { - callbackReturnValues.push(this.callback(diff, callbackOptions)); + if (this._batch) { + callbackReturnValues.push(this._runCallback(diff, callbackOptions)); } else { for (let name in diff) { const value = diff[name]; - callbackReturnValues.push(this.callback(value, name, callbackOptions)); + callbackReturnValues.push(this._runCallback(value, name, callbackOptions)); } } if (u.some(callbackReturnValues, u.isPromise)) { let callbackDone = Promise.allSettled(callbackReturnValues); - up.form.disableWhile(callbackDone, fieldOptions); + up.form.disableWhile(callbackDone, _fieldOptions); await callbackDone; } - this.callbackRunning = false; - this.requestCallback(); + this._callbackRunning = false; + this._requestCallback(); } } - changedValues(previous, next) { + _runCallback(...args) { + return up.error.guard(() => this._callback(...args)); + } + _changedValues(previous, next) { const changes = {}; let keys = Object.keys(previous); keys = keys.concat(Object.keys(next)); @@ -4745,49 +4932,49 @@ } return changes; } - readFieldValues() { - return up.Params.fromFields(this.fields).toObject(); + _readFieldValues() { + return up.Params.fromFields(this._fields).toObject(); } - check(event, fieldOptions) { - const values = this.readFieldValues(); - if (this.isNewValues(values)) { - this.scheduleValues(values, event, fieldOptions); + _check(event, _fieldOptions) { + const values = this._readFieldValues(); + if (this._isNewValues(values)) { + this._scheduleValues(values, event, _fieldOptions); } } }; /***/ - }, /* 42 */ + }), ( /* 42 */ /***/() => { const u = up.util; up.FormValidator = class FormValidator { constructor(form) { - this.form = form; - this.dirtySolutions = []; - this.nextRenderTimer = null; - this.rendering = false; - this.resetNextRenderPromise(); - this.honorAbort(); - } - honorAbort() { - up.fragment.onAborted(this.form, { + this._form = form; + this._dirtySolutions = []; + this._nextRenderTimer = null; + this._rendering = false; + this._resetNextRenderPromise(); + this._honorAbort(); + } + _honorAbort() { + up.fragment.onAborted(this._form, { around: true }, ({ target - }) => this.unscheduleSolutionsWithin(target)); + }) => this._unscheduleSolutionsWithin(target)); } - unscheduleSolutionsWithin(container) { - this.dirtySolutions = u.reject(this.dirtySolutions, ({ + _unscheduleSolutionsWithin(container) { + this._dirtySolutions = u.reject(this._dirtySolutions, ({ element }) => container.contains(element)); } - resetNextRenderPromise() { - this.nextRenderPromise = u.newDeferred(); + _resetNextRenderPromise() { + this._nextRenderPromise = u.newDeferred(); } watchContainer(fieldOrForm) { let { event - } = this.originOptions(fieldOrForm); + } = this._originOptions(fieldOrForm); let guard = () => up.fragment.isAlive(fieldOrForm); let callback = () => up.error.muteUncriticalRejection(this.validate({ origin: fieldOrForm @@ -4797,28 +4984,28 @@ }, callback); } validate(options = {}) { - let solutions = this.getSolutions(options); - this.dirtySolutions.push(...solutions); - this.scheduleNextRender(); - return this.nextRenderPromise; + let solutions = this._getSolutions(options); + this._dirtySolutions.push(...solutions); + this._scheduleNextRender(); + return this._nextRenderPromise; } - getSolutions(options) { - let solutions = this.getTargetSelectorSolutions(options) || this.getFieldSolutions(options) || this.getElementSolutions(options.origin); + _getSolutions(options) { + let solutions = this._getTargetSelectorSolutions(options) || this._getFieldSolutions(options) || this._getElementSolutions(options.origin); for (let solution of solutions) { - solution.renderOptions = this.originOptions(solution.origin, options); + solution.renderOptions = this._originOptions(solution.origin, options); solution.target = up.fragment.resolveOrigin(solution.target, solution); } return solutions; } - getFieldSolutions({ + _getFieldSolutions({ origin, ...options }) { if (up.form.isField(origin)) { - return this.getValidateAttrSolutions(origin) || this.getFormGroupSolutions(origin, options); + return this._getValidateAttrSolutions(origin) || this._getFormGroupSolutions(origin, options); } } - getFormGroupSolutions(field, { + _getFormGroupSolutions(field, { formGroup = true }) { if (!formGroup) return; @@ -4828,7 +5015,7 @@ return [solution]; } } - getTargetSelectorSolutions({ + _getTargetSelectorSolutions({ target, origin }) { @@ -4851,7 +5038,7 @@ })); } } - getElementSolutions(element) { + _getElementSolutions(element) { up.puts('up.validate()', 'Validating element %o', element); return [{ element, @@ -4859,57 +5046,57 @@ origin: element }]; } - getValidateAttrSolutions(field) { + _getValidateAttrSolutions(field) { let containerWithAttr = field.closest('[up-validate]'); if (containerWithAttr) { let target = containerWithAttr.getAttribute('up-validate'); - return this.getTargetSelectorSolutions({ + return this._getTargetSelectorSolutions({ target, origin: field }); } } - originOptions(element, overrideOptions) { + _originOptions(element, overrideOptions) { return up.form.watchOptions(element, overrideOptions, { defaults: { event: 'change' } }); } - scheduleNextRender() { - let solutionDelays = this.dirtySolutions.map(solution => solution.renderOptions.delay); + _scheduleNextRender() { + let solutionDelays = this._dirtySolutions.map(solution => solution.renderOptions.delay); let shortestDelay = Math.min(...solutionDelays) || 0; - this.unscheduleNextRender(); - this.nextRenderTimer = u.timer(shortestDelay, () => this.renderDirtySolutions()); + this._unscheduleNextRender(); + this._nextRenderTimer = u.timer(shortestDelay, () => this._renderDirtySolutions()); } - unscheduleNextRender() { - clearTimeout(this.nextRenderTimer); + _unscheduleNextRender() { + clearTimeout(this._nextRenderTimer); } - renderDirtySolutions() { - up.error.muteUncriticalRejection(this.doRenderDirtySolutions()); + _renderDirtySolutions() { + up.error.muteUncriticalRejection(this._doRenderDirtySolutions()); } - async doRenderDirtySolutions() { - this.dirtySolutions = u.filter(this.dirtySolutions, ({ + async _doRenderDirtySolutions() { + this._dirtySolutions = u.filter(this._dirtySolutions, ({ element, origin }) => up.fragment.isAlive(element) && up.fragment.isAlive(origin)); - if (!this.dirtySolutions.length || this.rendering) { + if (!this._dirtySolutions.length || this._rendering) { return; } - let dirtySolutions = this.dirtySolutions; - this.dirtySolutions = []; + let dirtySolutions = this._dirtySolutions; + this._dirtySolutions = []; let dirtyOrigins = u.map(dirtySolutions, 'origin'); let dirtyFields = u.flatMap(dirtyOrigins, up.form.fields); let dirtyNames = u.uniq(u.map(dirtyFields, 'name')); - let dataMap = this.buildDataMap(dirtySolutions); + let dataMap = this._buildDataMap(dirtySolutions); let dirtyRenderOptionsList = u.map(dirtySolutions, 'renderOptions'); let options = u.mergeDefined(...dirtyRenderOptionsList, { dataMap - }, up.form.destinationOptions(this.form)); + }, up.form.destinationOptions(this._form)); options.target = u.map(dirtySolutions, 'target').join(', '); options.feedback = u.some(dirtyRenderOptionsList, 'feedback'); - options.origin = this.form; - options.focus ?? (options.focus = 'keep'); + options.origin = this._form; + options.focus ??= 'keep'; options.failOptions = false; options.params = up.Params.merge(options.params, ...u.map(dirtyRenderOptionsList, 'params')); options.headers = u.merge(...u.map(dirtyRenderOptionsList, 'headers')); @@ -4919,9 +5106,9 @@ log: 'Validating form', params: options.params }); - this.rendering = true; - let renderingPromise = this.nextRenderPromise; - this.resetNextRenderPromise(); + this._rendering = true; + let renderingPromise = this._nextRenderPromise; + this._resetNextRenderPromise(); options.disable = false; for (let solution of dirtySolutions) { up.form.disableWhile(renderingPromise, { @@ -4933,11 +5120,11 @@ renderingPromise.resolve(up.render(options)); await renderingPromise; } finally { - this.rendering = false; - this.renderDirtySolutions(); + this._rendering = false; + this._renderDirtySolutions(); } } - buildDataMap(solutions) { + _buildDataMap(solutions) { let dataMap = {}; for (let solution of solutions) { let data = u.pluckKey(solution.renderOptions, 'data'); @@ -4953,24 +5140,24 @@ } static forElement(element) { let form = up.form.get(element); - return form.upFormValidator || (form.upFormValidator = new this(form)); + return form.upFormValidator ||= new this(form); } }; /***/ - }, /* 43 */ + }), ( /* 43 */ /***/() => { up.FocusCapsule = class FocusCapsule { constructor(target, cursorProps) { - this.target = target; - this.cursorProps = cursorProps; + this._target = target; + this._cursorProps = cursorProps; } restore(layer, options) { - let rediscoveredElement = up.fragment.get(this.target, { + let rediscoveredElement = up.fragment.get(this._target, { layer }); if (rediscoveredElement) { - up.viewport.copyCursorProps(this.cursorProps, rediscoveredElement); + up.viewport.copyCursorProps(this._cursorProps, rediscoveredElement); up.focus(rediscoveredElement, options); return true; } @@ -4986,7 +5173,7 @@ }; /***/ - }, /* 44 */ + }), ( /* 44 */ /***/() => { const u = up.util; up.FragmentProcessor = class FragmentProcessor extends up.Record { @@ -5007,7 +5194,8 @@ return this.processArray(opt); } if (u.isFunction(opt)) { - return this.tryProcess(opt(this.fragment, this.attributes())); + let result = up.error.guard(() => opt(this.fragment, this.attributes())); + return this.tryProcess(result); } if (u.isElement(opt)) { return this.processElement(opt); @@ -5047,47 +5235,50 @@ }; /***/ - }, /* 45 */ + }), ( /* 45 */ /***/() => { const DESCENDANT_SELECTOR = /^([^ >+(]+) (.+)$/; up.FragmentFinder = class FragmentFinder { constructor(options) { - this.options = options; - this.origin = options.origin; - this.selector = options.selector; - this.externalRoot = options.externalRoot; + this._options = options; + this._origin = options.origin; + this._selector = options.selector; + this._document = options.document || window.document; + this._match = options.match ?? up.fragment.config.match; + this._preferOldElements = options.preferOldElements; } find() { - return this.findAroundOrigin() || this.findInLayer(); + return this._findInPreferredElements() || this._findInRegion() || this._findFirst(); + } + _findInPreferredElements() { + if (this._preferOldElements) { + return this._preferOldElements.find(preferOldElement => this._document.contains(preferOldElement) && up.fragment.matches(preferOldElement, this._selector)); + } } - findAroundOrigin() { - if (this.origin && up.fragment.config.matchAroundOrigin && this.origin.isConnected) { - return this.findClosest() || this.findInVicinity(); + _findInRegion() { + if (this._match === 'region' && this._origin?.isConnected) { + return this._findClosest() || this._findDescendantInRegion(); } } - findClosest() { - return up.fragment.closest(this.origin, this.selector, this.options); + _findClosest() { + return up.fragment.closest(this._origin, this._selector, this._options); } - findInVicinity() { - let parts = this.selector.match(DESCENDANT_SELECTOR); + _findDescendantInRegion() { + let parts = this._selector.match(DESCENDANT_SELECTOR); if (parts) { - let parent = up.fragment.closest(this.origin, parts[1], this.options); + let parent = up.fragment.closest(this._origin, parts[1], this._options); if (parent) { return up.fragment.getDumb(parent, parts[2]); } } } - findInLayer() { - if (this.externalRoot) { - return up.fragment.subtree(this.externalRoot, this.selector, this.options)[0]; - } else { - return up.fragment.getDumb(this.selector, this.options); - } + _findFirst() { + return up.fragment.getDumb(this._document, this._selector, this._options); } }; /***/ - }, /* 46 */ + }), ( /* 46 */ /***/() => { const u = up.util; const e = up.element; @@ -5101,57 +5292,57 @@ processPrimitive(opt) { switch (opt) { case 'keep': - return this.restoreLostFocus(); + return this._restoreLostFocus(); case 'restore': - return this.restorePreviousFocusForLocation(); + return this._restorePreviousFocusForLocation(); case 'target': case true: - return this.focusElement(this.fragment); + return this._focusElement(this.fragment); case 'layer': - return this.focusElement(this.layer.getFocusElement()); + return this._focusElement(this.layer.getFocusElement()); case 'main': - return this.focusSelector(':main'); + return this._focusSelector(':main'); case 'hash': - return this.focusHash(); + return this._focusHash(); case 'autofocus': - return this.autofocus(); + return this._autofocus(); default: if (u.isString(opt)) { - return this.focusSelector(opt); + return this._focusSelector(opt); } } } processElement(element) { - return this.focusElement(element); + return this._focusElement(element); } resolveCondition(condition) { if (condition === 'lost') { - return this.wasFocusLost(); + return this._wasFocusLost(); } else { return super.resolveCondition(condition); } } - focusSelector(selector) { + _focusSelector(selector) { let match = this.findSelector(selector); - return this.focusElement(match); + return this._focusElement(match); } - restoreLostFocus() { - if (this.wasFocusLost()) { + _restoreLostFocus() { + if (this._wasFocusLost()) { return this.focusCapsule?.restore(this.layer, PREVENT_SCROLL_OPTIONS); } } - restorePreviousFocusForLocation() { + _restorePreviousFocusForLocation() { return up.viewport.restoreFocus({ layer: this.layer }); } - autofocus() { + _autofocus() { let autofocusElement = this.fragment && e.subtree(this.fragment, '[autofocus]')[0]; if (autofocusElement) { - return this.focusElement(autofocusElement); + return this._focusElement(autofocusElement); } } - focusElement(element) { + _focusElement(element) { if (element) { up.focus(element, { force: true, @@ -5160,124 +5351,182 @@ return true; } } - focusHash() { + _focusHash() { let hashTarget = up.viewport.firstHashTarget(this.hash, { layer: this.layer }); if (hashTarget) { - return this.focusElement(hashTarget); + return this._focusElement(hashTarget); } } - wasFocusLost() { + _wasFocusLost() { return !this.layer.hasFocus(); } }; /***/ - }, /* 47 */ + }), ( /* 47 */ /***/() => { const e = up.element; up.FragmentPolling = class FragmentPolling { constructor(fragment) { - this.options = {}; - this.state = 'initialized'; - this.setFragment(fragment); - this.abortable = true; + this._options = up.radio.pollOptions(fragment); + this._fragment = fragment; + up.destructor(fragment, this._onFragmentDestroyed.bind(this)); + up.fragment.onAborted(fragment, this._onFragmentAborted.bind(this)); + this._state = 'initialized'; + this._abortable = true; + this._loading = false; + this._satisfyInterval(); } static forFragment(fragment) { - return fragment.upPolling || (fragment.upPolling = new this(fragment)); + return fragment.upPolling ||= new this(fragment); } onPollAttributeObserved() { - this.start(); + this._start(); } - onFragmentDestroyed() { - this.stop(); + _onFragmentDestroyed() { + this._stop(); } - onFragmentAborted() { - if (this.abortable) { - this.stop(); - } - } - start() { - if (this.state !== 'started') { - this.state = 'started'; - this.scheduleReload(); + _start(options) { + Object.assign(this._options, options); + if (this._state !== 'started') { + if (!up.fragment.isTargetable(this._fragment)) { + up.warn('[up-poll]', 'Cannot poll untargetable fragment %o', this._fragment); + return; + } + this._state = 'started'; + this._ensureEventsBound(); + this._scheduleRemainingTime(); } } - stop() { - if (this.state === 'started') { - clearTimeout(this.reloadTimer); - this.state = 'stopped'; + _stop() { + if (this._state === 'started') { + this._clearReloadTimer(); + this._state = 'stopped'; + this.unbindEvents?.(); } } forceStart(options) { - Object.assign(this.options, options); + Object.assign(this._options, options); this.forceStarted = true; - this.start(); + this._start(); } forceStop() { - this.stop(); + this._stop(); this.forceStarted = false; } - scheduleReload(delay = this.getInterval()) { - this.reloadTimer = setTimeout(() => this.reload(), delay); + _ensureEventsBound() { + if (!this.unbindEvents) { + this.unbindEvents = up.on('visibilitychange up:layer:opened up:layer:dismissed up:layer:accepted', this._onVisibilityChange.bind(this)); + } + } + _onVisibilityChange() { + if (this._isFragmentVisible()) { + this._scheduleRemainingTime(); + } + } + _isFragmentVisible() { + return !document.hidden && (this._options.ifLayer === 'any' || this._isOnFrontLayer()); + } + _clearReloadTimer() { + clearTimeout(this.reloadTimer); + this.reloadTimer = null; + } + _scheduleRemainingTime() { + if (!this.reloadTimer && !this._loading) { + this._clearReloadTimer(); + this.reloadTimer = setTimeout(this._onTimerReached.bind(this), this._getRemainingDelay()); + } } - reload() { - if (this.state !== 'started') { + _onTimerReached() { + this.reloadTimer = null; + this._tryReload(); + } + _tryReload() { + if (this._state !== 'started') { return; } - let issue = up.radio.pollIssue(this.fragment); - if (issue) { - up.puts('[up-poll]', `Will not poll: ${issue}`); - let reconsiderDisabledDelay = Math.min(10 * 1000, this.getInterval()); - this.scheduleReload(reconsiderDisabledDelay); - } else { - this.reloadNow(); + if (!this._isFragmentVisible()) { + up.puts('[up-poll]', 'Will not poll hidden fragment'); + return; } + if (up.emit(this._fragment, 'up:fragment:poll', { + log: ['Polling fragment', this._fragment] + }).defaultPrevented) { + up.puts('[up-poll]', 'User prevented up:fragment:poll event'); + this._satisfyInterval(); + this._scheduleRemainingTime(); + return; + } + this._reloadNow(); + } + _getFullDelay() { + return this._options.interval ?? e.numberAttr(this._fragment, 'up-interval') ?? up.radio.config.pollInterval; + } + _getRemainingDelay() { + return Math.max(this._getFullDelay() - this._getFragmentAge(), 0); } - reloadNow() { + _getFragmentAge() { + return new Date() - this._lastAttempt; + } + _isOnFrontLayer() { + this.layer ||= up.layer.get(this._fragment); + return this.layer?.isFront?.(); + } + _reloadNow() { + this._clearReloadTimer(); let reloadOptions = { - url: this.options.url, + url: this._options.url, fail: false, background: true }; - let oldAbortable = this.abortable; - this.abortable = false; - up.reload(this.fragment, reloadOptions).then(this.onReloadSuccess.bind(this), this.onReloadFailure.bind(this)); - this.abortable = oldAbortable; + let oldAbortable = this._abortable; + try { + this._abortable = false; + this._loading = true; + up.reload(this._fragment, reloadOptions).then(this._onReloadSuccess.bind(this), this._onReloadFailure.bind(this)); + } finally { + this._abortable = oldAbortable; + } } - onReloadSuccess({ + _onFragmentAborted({ + newLayer + }) { + if (this._abortable && !newLayer) { + this._stop(); + } + } + _onReloadSuccess({ fragment }) { + this._loading = false; + this._satisfyInterval(); if (fragment) { - this.onFragmentSwapped(fragment); + this._onFragmentSwapped(fragment); } else { - this.scheduleReload(); + this._scheduleRemainingTime(); } } - onReloadFailure(reason) { - this.scheduleReload(); - up.error.rethrowCritical(reason); - } - onFragmentSwapped(newFragment) { - this.stop(); - if (this.forceStarted && up.fragment.matches(this.fragment, newFragment)) { - this.constructor.forFragment(newFragment).forceStart(this.options); + _onFragmentSwapped(newFragment) { + this._stop(); + if (this.forceStarted && up.fragment.matches(this._fragment, newFragment)) { + this.constructor.forFragment(newFragment).forceStart(this._options); } } - setFragment(newFragment) { - this.fragment = newFragment; - up.destructor(newFragment, () => this.onFragmentDestroyed()); - up.fragment.onAborted(newFragment, () => this.onFragmentAborted()); + _onReloadFailure(reason) { + this._loading = false; + this._satisfyInterval(); + this._scheduleRemainingTime(); + up.error.throwCritical(reason); } - getInterval() { - let interval = this.options.interval ?? e.numberAttr(this.fragment, 'up-interval') ?? up.radio.config.pollInterval; - return up.radio.config.stretchPollInterval(interval); + _satisfyInterval() { + this._lastAttempt = new Date(); } }; /***/ - }, /* 48 */ + }), ( /* 48 */ /***/() => { const u = up.util; up.FragmentScrolling = class FragmentScrolling extends up.FragmentProcessor { @@ -5287,49 +5536,49 @@ processPrimitive(opt) { switch (opt) { case 'reset': - return this.reset(); + return this._reset(); case 'layer': - return this.revealLayer(); + return this._revealLayer(); case 'main': - return this.revealSelector(':main'); + return this._revealSelector(':main'); case 'restore': - return this.restore(); + return this._restore(); case 'hash': return this.hash && up.viewport.revealHash(this.hash, this.attributes()); case 'target': case 'reveal': case true: - return this.revealElement(this.fragment); + return this._revealElement(this.fragment); default: if (u.isString(opt)) { - return this.revealSelector(opt); + return this._revealSelector(opt); } } } processElement(element) { - return this.revealElement(element); + return this._revealElement(element); } - revealElement(element) { + _revealElement(element) { if (element) { up.reveal(element, this.attributes()); return true; } } - revealSelector(selector) { + _revealSelector(selector) { let match = this.findSelector(selector); - return this.revealElement(match); + return this._revealElement(match); } - revealLayer() { - return this.revealElement(this.layer.getBoxElement()); + _revealLayer() { + return this._revealElement(this.layer.getBoxElement()); } - reset() { + _reset() { up.viewport.resetScroll({ ...this.attributes(), around: this.fragment }); return true; } - restore() { + _restore() { return up.viewport.restoreScroll({ ...this.attributes(), around: this.fragment @@ -5338,7 +5587,7 @@ }; /***/ - }, /* 49 */ + }), ( /* 49 */ /***/() => { const e = up.element; const u = up.util; @@ -5409,8 +5658,11 @@ get descendants() { return this.stack.descendantsOf(this); } + get subtree() { + return [this, ...this.descendants]; + } get index() { - return this.stack.indexOf(this); + return this._index ??= this.stack.indexOf(this); } getContentElement() { return this.contentElement || this.element; @@ -5428,39 +5680,40 @@ return element.closest(up.layer.anySelector()) === this.element; } on(...args) { - return this.buildEventListenerGroup(args).bind(); + return this._buildEventListenerGroup(args).bind(); } off(...args) { - return this.buildEventListenerGroup(args).unbind(); + return this._buildEventListenerGroup(args).unbind(); } - buildEventListenerGroup(args) { + _buildEventListenerGroup(args) { return up.EventListenerGroup.fromBindArgs(args, { - guard: event => this.containsEventTarget(event), + guard: event => this._containsEventTarget(event), elements: [this.element], baseLayer: this }); } - containsEventTarget(event) { + _containsEventTarget(event) { return this.contains(event.target); } wasHitByMouseEvent(event) { const hittableElement = document.elementFromPoint(event.clientX, event.clientY); return !hittableElement || this.contains(hittableElement); } - buildEventEmitter(args) { + _buildEventEmitter(args) { return up.EventEmitter.fromEmitArgs(args, { layer: this }); } emit(...args) { - return this.buildEventEmitter(args).emit(); + return this._buildEventEmitter(args).emit(); } isDetached() { return !this.element.isConnected; } saveHistory() { - if (this.isHistoryVisible()) { + if (this.history) { this.savedTitle = document.title; + this.savedMetaTags = up.history.findMetaTags(); this.savedLocation = up.history.location; } } @@ -5474,6 +5727,9 @@ if (this.savedTitle) { document.title = this.savedTitle; } + if (this.savedMetaTags) { + up.history.updateMetaTags(this.savedMetaTags); + } } asCurrent(fn) { return this.stack.asCurrent(this, fn); @@ -5482,15 +5738,16 @@ if (u.isString(options.location)) { this.location = options.location; } + if (up.history.config.updateMetaTags && u.isList(options.metaTags)) { + up.migrate?.warnOfHungryMetaTags?.(options.metaTags); + this.metaTags = options.metaTags; + } if (u.isString(options.title)) { this.title = options.title; } } - isHistoryVisible() { - return this.history && (this.isRoot() || this.parent.isHistoryVisible()); - } showsLiveHistory() { - return this.isHistoryVisible() && this.isFront() && (up.history.config.enabled || this.isRoot()); + return this.history && this.isFront(); } get title() { if (this.showsLiveHistory()) { @@ -5505,6 +5762,19 @@ document.title = title; } } + get metaTags() { + if (this.showsLiveHistory()) { + return up.history.findMetaTags(); + } else { + return this.savedMetaTags; + } + } + set metaTags(metaTags) { + this.savedMetaTags = metaTags; + if (this.showsLiveHistory()) { + up.history.updateMetaTags(metaTags); + } + } get location() { if (this.showsLiveHistory()) { return up.history.location; @@ -5552,7 +5822,7 @@ }; /***/ - }, /* 50 */ + }), ( /* 50 */ /***/() => { const e = up.element; const u = up.util; @@ -5583,7 +5853,7 @@ } } createElement(parentElement) { - this.nesting || (this.nesting = this.suggestVisualNesting()); + this.nesting ||= this._suggestVisualNesting(); const elementAttrs = u.compactObject(u.pick(this, ['align', 'position', 'size', 'class', 'nesting'])); this.element = this.affixPart(parentElement, null, elementAttrs); } @@ -5598,10 +5868,14 @@ createBoxElement(parentElement) { this.boxElement = this.affixPart(parentElement, 'box'); } - createContentElement(parentElement, content) { + createContentElement(parentElement) { this.contentElement = this.affixPart(parentElement, 'content'); - this.contentElement.appendChild(content); } + setContent(content) { + this.contentElement.append(content); + this.onContentSet(); + } + onContentSet() {} createDismissElement(parentElement) { this.dismissElement = this.affixPart(parentElement, 'dismiss', { 'up-dismiss': '":button"', @@ -5617,12 +5891,12 @@ static selector(part) { return u.compact(['up', this.mode, part]).join('-'); } - suggestVisualNesting() { + _suggestVisualNesting() { const { parent } = this; if (this.mode === parent.mode) { - return 1 + parent.suggestVisualNesting(); + return 1 + parent._suggestVisualNesting(); } else { return 0; } @@ -5630,26 +5904,26 @@ setupHandlers() { super.setupHandlers(); this.overlayFocus = new up.OverlayFocus(this); - if (this.supportsDismissMethod('button')) { + if (this._supportsDismissMethod('button')) { this.createDismissElement(this.getBoxElement()); } - if (this.supportsDismissMethod('outside')) { + if (this._supportsDismissMethod('outside')) { if (this.viewportElement) { up.on(this.viewportElement, 'up:click', event => { if (event.target === this.viewportElement) { - this.onOutsideClicked(event, true); + this._onOutsideClicked(event, true); } }); } else { this.unbindParentClicked = this.parent.on('up:click', (event, element) => { if (!up.layer.isWithinForeignOverlay(element)) { const originClicked = this.origin && this.origin.contains(element); - this.onOutsideClicked(event, originClicked); + this._onOutsideClicked(event, originClicked); } }); } } - if (this.supportsDismissMethod('key')) { + if (this._supportsDismissMethod('key')) { this.unbindEscapePressed = up.event.onEscape(event => this.onEscapePressed(event)); } this.registerClickCloser('up-accept', (value, closeOptions) => { @@ -5659,11 +5933,11 @@ this.dismiss(value, closeOptions); }); up.migrate.registerLayerCloser?.(this); - this.registerEventCloser(this.acceptEvent, this.accept); - this.registerEventCloser(this.dismissEvent, this.dismiss); - this.on('up:click', 'label[for]', (event, label) => this.onLabelClicked(event, label)); + this._registerEventCloser(this.acceptEvent, this.accept); + this._registerEventCloser(this.dismissEvent, this.dismiss); + this.on('up:click', 'label[for]', (event, label) => this._onLabelClicked(event, label)); } - onLabelClicked(event, label) { + _onLabelClicked(event, label) { let id = label.getAttribute('for'); let fieldSelector = up.form.fieldSelector(e.idSelector(id)); let fieldsAnywhere = up.fragment.all(fieldSelector, { @@ -5681,7 +5955,7 @@ } } } - onOutsideClicked(event, halt) { + _onOutsideClicked(event, halt) { up.log.putsEvent(event); if (halt) up.event.halt(event); this.dismiss(':outside', { @@ -5693,7 +5967,7 @@ let field = up.form.focusedField(); if (field) { field.blur(); - } else if (this.supportsDismissMethod('key')) { + } else if (this._supportsDismissMethod('key')) { up.event.halt(event, { log: true }); @@ -5720,7 +5994,7 @@ up.error.muteUncriticalSync(() => closeFn(value, closeOptions)); }); } - registerEventCloser(eventTypes, closeFn) { + _registerEventCloser(eventTypes, closeFn) { if (!eventTypes) { return; } @@ -5732,12 +6006,12 @@ }); } tryAcceptForLocation(options) { - this.tryCloseForLocation(this.acceptLocation, this.accept, options); + this._tryCloseForLocation(this.acceptLocation, this.accept, options); } tryDismissForLocation(options) { - this.tryCloseForLocation(this.dismissLocation, this.dismiss, options); + this._tryCloseForLocation(this.dismissLocation, this.dismiss, options); } - tryCloseForLocation(urlPattern, closeFn, options) { + _tryCloseForLocation(urlPattern, closeFn, options) { let location, resolution; if (urlPattern && (location = this.location) && (resolution = urlPattern.recognize(location))) { const closeValue = { @@ -5754,9 +6028,7 @@ this.overlayFocus.teardown(); } destroyElements(options) { - const animation = () => { - return this.startCloseAnimation(options); - }; + const animation = () => this.startCloseAnimation(options); const onFinished = () => { this.onElementsRemoved(); options.onFinished?.(); @@ -5770,7 +6042,7 @@ up.destroy(this.element, destroyOptions); } onElementsRemoved() {} - startAnimation(options = {}) { + _startAnimation(options = {}) { const boxDone = up.animate(this.getBoxElement(), options.boxAnimation, options); let backdropDone; if (this.backdrop && !up.motion.isNone(options.boxAnimation)) { @@ -5778,35 +6050,33 @@ } return Promise.all([boxDone, backdropDone]); } - startOpenAnimation(options = {}) { - return this.startAnimation({ + async startOpenAnimation(options = {}) { + await this._startAnimation({ boxAnimation: options.animation ?? this.evalOption(this.openAnimation), backdropAnimation: 'fade-in', easing: options.easing || this.openEasing, duration: options.duration || this.openDuration - }).then(() => { - return this.wasEverVisible = true; }); + this.wasEverVisible = true; } startCloseAnimation(options = {}) { - const boxAnimation = this.wasEverVisible && (options.animation ?? this.evalOption(this.closeAnimation)); - return this.startAnimation({ - boxAnimation, - backdropAnimation: 'fade-out', + return this._startAnimation({ + boxAnimation: this.wasEverVisible && (options.animation ?? this.evalOption(this.closeAnimation)), + backdropAnimation: this.wasEverVisible && 'fade-out', easing: options.easing || this.closeEasing, duration: options.duration || this.closeDuration }); } accept(value = null, options = {}) { - return this.executeCloseChange('accept', value, options); + return this._executeCloseChange('accept', value, options); } dismiss(value = null, options = {}) { - return this.executeCloseChange('dismiss', value, options); + return this._executeCloseChange('dismiss', value, options); } - supportsDismissMethod(method) { + _supportsDismissMethod(method) { return u.contains(this.dismissable, method); } - executeCloseChange(verb, value, options) { + _executeCloseChange(verb, value, options) { options = { ...options, verb, @@ -5824,75 +6094,70 @@ }; /***/ - }, /* 51 */ + }), ( /* 51 */ /***/() => { up.Layer.OverlayWithTether = class OverlayWithTether extends up.Layer.Overlay { - createElements(content) { + createElements() { if (!this.origin) { up.fail('Missing { origin } option'); } - this.tether = new up.Tether({ + this._tether = new up.Tether({ anchor: this.origin, align: this.align, position: this.position }); - this.createElement(this.tether.parent); - this.createContentElement(this.element, content); - this.tether.start(this.element); + this.createElement(this._tether.parent); + this.createContentElement(this.element); + } + onContentSet() { + this._tether.start(this.element); } onElementsRemoved() { - this.tether.stop(); + this._tether.stop(); } sync() { if (this.isOpen()) { - if (this.isDetached() || this.tether.isDetached()) { + if (this.isDetached() || this._tether.isDetached()) { this.dismiss(':detached', { animation: false, preventable: false }); } else { - this.tether.sync(); + this._tether.sync(); } } } }; /***/ - }, /* 52 */ + }), ( /* 52 */ /***/() => { - var _a; - up.Layer.OverlayWithViewport = (_a = class OverlayWithViewport extends up.Layer.Overlay { + up.Layer.OverlayWithViewport = class OverlayWithViewport extends up.Layer.Overlay { static getParentElement() { return document.body; } - createElements(content) { - this.shiftBody(); + createElements() { + up.viewport.bodyShifter.raiseStack(); this.createElement(this.constructor.getParentElement()); if (this.backdrop) { this.createBackdropElement(this.element); } this.createViewportElement(this.element); this.createBoxElement(this.viewportElement); - this.createContentElement(this.boxElement, content); + this.createContentElement(this.boxElement); } onElementsRemoved() { - this.unshiftBody(); - } - shiftBody() { - this.constructor.bodyShifter.shift(); - } - unshiftBody() { - this.constructor.bodyShifter.unshift(); + up.viewport.bodyShifter.lowerStack(); } sync() { if (this.isDetached() && this.isOpen()) { this.constructor.getParentElement().appendChild(this.element); } } - }, _a.bodyShifter = new up.BodyShifter(), _a); + }; /***/ - }, /* 53 */ + }), ( /* 53 */ /***/() => { var _a; const e = up.element; @@ -5920,12 +6185,12 @@ this.setupHandlers(); } accept() { - this.cannotCloseRoot(); + this._cannotCloseRoot(); } dismiss() { - this.cannotCloseRoot(); + this._cannotCloseRoot(); } - cannotCloseRoot() { + _cannotCloseRoot() { up.fail('Cannot close the root layer'); } toString() { @@ -5934,115 +6199,117 @@ }, _a.mode = 'root', _a); /***/ - }, /* 54 */ + }), ( /* 54 */ /***/() => { var _a; up.Layer.Modal = (_a = class Modal extends up.Layer.OverlayWithViewport {}, _a.mode = 'modal', _a); /***/ - }, /* 55 */ + }), ( /* 55 */ /***/() => { var _a; up.Layer.Popup = (_a = class Popup extends up.Layer.OverlayWithTether {}, _a.mode = 'popup', _a); /***/ - }, /* 56 */ + }), ( /* 56 */ /***/() => { var _a; up.Layer.Drawer = (_a = class Drawer extends up.Layer.OverlayWithViewport {}, _a.mode = 'drawer', _a); /***/ - }, /* 57 */ + }), ( /* 57 */ /***/() => { var _a; up.Layer.Cover = (_a = class Cover extends up.Layer.OverlayWithViewport {}, _a.mode = 'cover', _a); /***/ - }, /* 58 */ + }), ( /* 58 */ /***/() => { const u = up.util; const e = up.element; up.LayerLookup = class LayerLookup { constructor(stack, ...args) { - this.stack = stack; + this._stack = stack; const options = u.parseArgIntoOptions(args, 'layer'); if (options.normalizeLayerOptions !== false) { up.layer.normalizeOptions(options); } - this.values = u.parseTokens(options.layer); - this.origin = options.origin; - this.baseLayer = options.baseLayer || this.originLayer() || this.stack.current; - if (u.isString(this.baseLayer)) { + this._values = u.parseTokens(options.layer); + this._origin = options.origin; + this._baseLayer = options.baseLayer || this._originLayer() || this._stack.current; + if (u.isString(this._baseLayer)) { const recursiveOptions = { ...options, - baseLayer: this.stack.current, + baseLayer: this._stack.current, normalizeLayerOptions: false }; - this.baseLayer = new this.constructor(this.stack, this.baseLayer, recursiveOptions).first(); + this._baseLayer = new this.constructor(this._stack, this._baseLayer, recursiveOptions).first(); } } - originLayer() { - if (this.origin) { - return this.forElement(this.origin); + _originLayer() { + if (this._origin) { + return this._forElement(this._origin); } } first() { return this.all()[0]; } all() { - let results = u.flatMap(this.values, value => this.resolveValue(value)); + let results = u.flatMap(this._values, value => this._resolveValue(value)); results = u.compact(results); results = u.uniq(results); return results; } - forElement(element) { + _forElement(element) { element = e.get(element); - return u.find(this.stack.reversed(), layer => layer.contains(element)); + return u.find(this._stack.reversed(), layer => layer.contains(element)); } - forIndex(value) { - return this.stack[value]; + _forIndex(value) { + return this._stack.at(value); } - resolveValue(value) { + _resolveValue(value) { if (value instanceof up.Layer) { return value; } if (u.isNumber(value)) { - return this.forIndex(value); + return this._forIndex(value); } if (/^\d+$/.test(value)) { - return this.forIndex(Number(value)); + return this._forIndex(Number(value)); } if (u.isElementish(value)) { - return this.forElement(value); + return this._forElement(value); } switch (value) { case 'any': - return [this.baseLayer, ...this.stack.reversed()]; + return [this._baseLayer, ...this._stack.reversed()]; case 'current': - return this.baseLayer; + return this._baseLayer; case 'closest': - return this.stack.selfAndAncestorsOf(this.baseLayer); + return this._stack.selfAndAncestorsOf(this._baseLayer); case 'parent': - return this.baseLayer.parent; + return this._baseLayer.parent; case 'ancestor': case 'ancestors': - return this.baseLayer.ancestors; + return this._baseLayer.ancestors; case 'child': - return this.baseLayer.child; + return this._baseLayer.child; case 'descendant': case 'descendants': - return this.baseLayer.descendants; + return this._baseLayer.descendants; + case 'subtree': + return this._baseLayer.subtree; case 'new': return 'new'; case 'root': - return this.stack.root; + return this._stack.root; case 'overlay': case 'overlays': - return u.reverse(this.stack.overlays); + return u.reverse(this._stack.overlays); case 'front': - return this.stack.front; + return this._stack.front; case 'origin': - return this.originLayer(); + return this._originLayer(); default: return up.fail("Unknown { layer } option: %o", value); } @@ -6050,24 +6317,22 @@ }; /***/ - }, /* 59 */ + }), ( /* 59 */ /***/() => { const u = up.util; - up.LayerStack = class LayerStack extends Array { + up.LayerStack = class LayerStack { constructor() { - super(); - Object.setPrototypeOf(this, up.LayerStack.prototype); - this.currentOverrides = []; - this.push(this.buildRoot()); + this._currentOverrides = []; + this.layers = [this._buildRoot()]; } - buildRoot() { + _buildRoot() { return up.layer.build({ mode: 'root', stack: this }); } remove(layer) { - u.remove(this, layer); + u.remove(this.layers, layer); } peel(layer, options) { const descendants = u.reverse(layer.descendants); @@ -6083,35 +6348,35 @@ this.peel(this.root, { animation: false }); - this.currentOverrides = []; + this._currentOverrides = []; this.root.reset(); } isOpen(layer) { - return layer.index >= 0; + return u.contains(this.layers, layer); } isClosed(layer) { return !this.isOpen(layer); } parentOf(layer) { - return this[layer.index - 1]; + return this.layers[layer.index - 1]; } childOf(layer) { - return this[layer.index + 1]; + return this.layers[layer.index + 1]; } ancestorsOf(layer) { - return u.reverse(this.slice(0, layer.index)); + return u.reverse(this.layers.slice(0, layer.index)); } selfAndAncestorsOf(layer) { return [layer, ...layer.ancestors]; } descendantsOf(layer) { - return this.slice(layer.index + 1); + return this.layers.slice(layer.index + 1); } isRoot(layer) { - return this[0] === layer; + return this.root === layer; } isOverlay(layer) { - return !this.isRoot(layer); + return this.root !== layer; } isCurrent(layer) { return this.current === layer; @@ -6126,20 +6391,20 @@ return new up.LayerLookup(this, ...args).all(); } sync() { - for (let layer of this) { + for (let layer of this.layers) { layer.sync(); } } asCurrent(layer, fn) { try { - this.currentOverrides.push(layer); + this._currentOverrides.push(layer); return fn(); } finally { - this.currentOverrides.pop(); + this._currentOverrides.pop(); } } reversed() { - return u.reverse(this); + return u.reverse(this.layers); } dismissOverlays(value = null, options = {}) { options.dismissable = false; @@ -6147,136 +6412,135 @@ overlay.dismiss(value, options); } } - [u.copy.key]() { - return u.copyArrayLike(this); + at(index) { + return this.layers[index]; + } + indexOf(layer) { + return this.layers.indexOf(layer); } get count() { - return this.length; + return this.layers.length; } get root() { - return this[0]; + return this.layers[0]; } get overlays() { return this.root.descendants; } get current() { - return u.last(this.currentOverrides) || this.front; + return u.last(this._currentOverrides) || this.front; } get front() { - return u.last(this); + return u.last(this.layers); } }; /***/ - }, /* 60 */ + }), ( /* 60 */ /***/() => { up.LinkFeedbackURLs = class LinkFeedbackURLs { constructor(link) { const normalize = up.feedback.normalizeURL; - this.isSafe = up.link.isSafe(link); - if (this.isSafe) { + this._isSafe = up.link.isSafe(link); + if (this._isSafe) { const href = link.getAttribute('href'); if (href && href !== '#') { this.href = normalize(href); } const upHREF = link.getAttribute('up-href'); if (upHREF) { - this.upHREF = normalize(upHREF); + this._upHREF = normalize(upHREF); } const alias = link.getAttribute('up-alias'); if (alias) { - this.aliasPattern = new up.URLPattern(alias, normalize); + this._aliasPattern = new up.URLPattern(alias, normalize); } } } isCurrent(normalizedLocation) { - return this.isSafe && !!(this.href && this.href === normalizedLocation || this.upHREF && this.upHREF === normalizedLocation || this.aliasPattern && this.aliasPattern.test(normalizedLocation, false)); + return this._isSafe && !!(this.href === normalizedLocation || this._upHREF === normalizedLocation || this._aliasPattern?.test?.(normalizedLocation, false)); } }; /***/ - }, /* 61 */ + }), ( /* 61 */ /***/() => { const u = up.util; const e = up.element; up.LinkPreloader = class LinkPreloader { - constructor() { - this.considerPreload = this.considerPreload.bind(this); - } watchLink(link) { - if (up.link.isSafe(link)) { - this.on(link, 'mouseenter', event => this.considerPreload(event, true)); - this.on(link, 'mousedown touchstart', event => this.considerPreload(event)); - this.on(link, 'mouseleave', event => this.stopPreload(event)); + if (!up.link.preloadIssue(link)) { + this._on(link, 'mouseenter', event => this._considerPreload(event, true)); + this._on(link, 'mousedown touchstart', event => this._considerPreload(event)); + this._on(link, 'mouseleave', event => this._stopPreload(event)); } } - on(link, eventTypes, callback) { + _on(link, eventTypes, callback) { up.on(link, eventTypes, { passive: true }, callback); } - considerPreload(event, applyDelay) { + _considerPreload(event, applyDelay) { const link = event.target; - if (link !== this.currentLink) { + if (link !== this._currentLink) { this.reset(); - this.currentLink = link; + this._currentLink = link; if (up.link.shouldFollowEvent(event, link)) { if (applyDelay) { - this.preloadAfterDelay(event, link); + this._preloadAfterDelay(event, link); } else { - this.preloadNow(event, link); + this._preloadNow(event, link); } } } } - stopPreload(event) { - if (event.target === this.currentLink) { + _stopPreload(event) { + if (event.target === this._currentLink) { return this.reset(); } } reset() { - if (!this.currentLink) { + if (!this._currentLink) { return; } - clearTimeout(this.timer); - if (this.currentRequest?.background) { - this.currentRequest.abort(); + clearTimeout(this._timer); + if (this._currentRequest?.background) { + this._currentRequest.abort(); } - this.currentLink = undefined; - this.currentRequest = undefined; + this._currentLink = undefined; + this._currentRequest = undefined; } - preloadAfterDelay(event, link) { + _preloadAfterDelay(event, link) { const delay = e.numberAttr(link, 'up-preload-delay') ?? up.link.config.preloadDelay; - this.timer = u.timer(delay, () => this.preloadNow(event, link)); + this._timer = u.timer(delay, () => this._preloadNow(event, link)); } - preloadNow(event, link) { + _preloadNow(event, link) { if (!link.isConnected) { this.reset(); return; } const onQueued = request => { - return this.currentRequest = request; + return this._currentRequest = request; }; up.log.putsEvent(event); up.error.muteUncriticalRejection(up.link.preload(link, { onQueued })); - this.queued = true; } }; /***/ - }, /* 62 */ + }), ( /* 62 */ /***/() => { const u = up.util; const e = up.element; up.MotionController = class MotionController { constructor(name) { - this.activeClass = `up-${name}`; - this.selector = `.${this.activeClass}`; + this._activeClass = `up-${name}`; + this._selector = `.${this._activeClass}`; this.finishEvent = `up:${name}:finish`; this.finishCount = 0; - this.clusterCount = 0; + this._clusterCount = 0; } startFunction(cluster, startMotion, memory = {}) { cluster = e.list(cluster); @@ -6287,37 +6551,37 @@ } else { memory.trackMotion = false; this.finish(cluster); - this.markCluster(cluster); - let promise = this.whileForwardingFinishEvent(cluster, mutedAnimator); - promise = promise.then(() => this.unmarkCluster(cluster)); + this._markCluster(cluster); + let promise = this._whileForwardingFinishEvent(cluster, mutedAnimator); + promise = promise.then(() => this._unmarkCluster(cluster)); return promise; } } finish(elements) { this.finishCount++; - if (this.clusterCount === 0 || !up.motion.isEnabled()) { + if (this._clusterCount === 0 || !up.motion.isEnabled()) { return; } - elements = this.expandFinishRequest(elements); + elements = this._expandFinishRequest(elements); for (let element of elements) { - this.finishOneElement(element); + this._finishOneElement(element); } return up.migrate.formerlyAsync?.('up.motion.finish()'); } - expandFinishRequest(elements) { + _expandFinishRequest(elements) { if (elements) { - return u.flatMap(elements, el => e.list(el.closest(this.selector), el.querySelectorAll(this.selector))); + return u.flatMap(elements, el => e.list(el.closest(this._selector), el.querySelectorAll(this._selector))); } else { - return document.querySelectorAll(this.selector); + return document.querySelectorAll(this._selector); } } isActive(element) { - return element.classList.contains(this.activeClass); + return element.classList.contains(this._activeClass); } - finishOneElement(element) { - this.emitFinishEvent(element); + _finishOneElement(element) { + this._emitFinishEvent(element); } - emitFinishEvent(element, eventAttrs = {}) { + _emitFinishEvent(element, eventAttrs = {}) { eventAttrs = { target: element, log: false, @@ -6325,20 +6589,20 @@ }; return up.emit(this.finishEvent, eventAttrs); } - markCluster(cluster) { - this.clusterCount++; - this.toggleActive(cluster, true); + _markCluster(cluster) { + this._clusterCount++; + this._toggleActive(cluster, true); } - unmarkCluster(cluster) { - this.clusterCount--; - this.toggleActive(cluster, false); + _unmarkCluster(cluster) { + this._clusterCount--; + this._toggleActive(cluster, false); } - toggleActive(cluster, isActive) { + _toggleActive(cluster, isActive) { for (let element of cluster) { - element.classList.toggle(this.activeClass, isActive); + element.classList.toggle(this._activeClass, isActive); } } - whileForwardingFinishEvent(cluster, fn) { + _whileForwardingFinishEvent(cluster, fn) { if (cluster.length < 2) { return fn(); } @@ -6346,7 +6610,7 @@ if (!event.forwarded) { for (let element of cluster) { if (element !== event.target && this.isActive(element)) { - this.emitFinishEvent(element, { + this._emitFinishEvent(element, { forwarded: true }); } @@ -6359,12 +6623,12 @@ async reset() { await this.finish(); this.finishCount = 0; - this.clusterCount = 0; + this._clusterCount = 0; } }; /***/ - }, /* 63 */ + }), ( /* 63 */ /***/() => { const u = up.util; const e = up.element; @@ -6383,22 +6647,22 @@ } else if (this.nonce) { let callbackThis = this; return function (...args) { - return callbackThis.runAsNoncedFunction(this, argNames, args); + return callbackThis._runAsNoncedFunction(this, argNames, args); }; } else { - return this.cannotRun.bind(this); + return this._cannotRun.bind(this); } } toString() { return `nonce-${this.nonce} ${this.script}`; } - cannotRun() { + _cannotRun() { throw new Error(`Your Content Security Policy disallows inline JavaScript (${this.script}). See https://unpoly.com/csp for solutions.`); } - runAsNoncedFunction(thisArg, argNames, args) { + _runAsNoncedFunction(thisArg, argNames, args) { let wrappedScript = ` try { - up.noncedEval.value = (function(${argNames.join(',')}) { + up.noncedEval.value = (function(${argNames.join()}) { ${this.script} }).apply(up.noncedEval.thisArg, up.noncedEval.args) } catch (error) { @@ -6427,7 +6691,7 @@ } } } - allowedBy(allowedNonces) { + _allowedBy(allowedNonces) { return this.nonce && u.contains(allowedNonces, this.nonce); } static adoptNonces(element, allowedNonces) { @@ -6435,13 +6699,13 @@ return; } const getPageNonce = u.memoize(up.protocol.cspNonce); - u.each(up.protocol.config.nonceableAttributes, attribute => { + u.each(up.script.config.nonceableAttributes, attribute => { let matches = e.subtree(element, `[${attribute}^="nonce-"]`); u.each(matches, match => { let attributeValue = match.getAttribute(attribute); let callback = this.fromString(attributeValue); let warn = (message, ...args) => up.log.warn('up.render()', `Cannot use callback [${attribute}="${attributeValue}"]: ${message}`, ...args); - if (!callback.allowedBy(allowedNonces)) { + if (!callback._allowedBy(allowedNonces)) { return warn("Callback's CSP nonce (%o) does not match response header (%o)", callback.nonce, allowedNonces); } let pageNonce = getPageNonce(); @@ -6456,142 +6720,66 @@ }; /***/ - }, /* 64 */ - /***/() => { - const u = up.util; - const e = up.element; - up.OptionsParser = class OptionsParser { - constructor(element, options, parserOptions = {}) { - this.options = options; - this.element = element; - this.fail = parserOptions.fail; - this.closest = parserOptions.closest; - this.attrPrefix = parserOptions.attrPrefix || 'up-'; - this.defaults = parserOptions.defaults || {}; - } - string(key, keyOptions) { - this.parse(e.attr, key, keyOptions); - } - boolean(key, keyOptions) { - this.parse(e.booleanAttr, key, keyOptions); - } - number(key, keyOptions) { - this.parse(e.numberAttr, key, keyOptions); - } - booleanOrString(key, keyOptions) { - this.parse(e.booleanOrStringAttr, key, keyOptions); - } - json(key, keyOptions) { - this.parse(e.jsonAttr, key, keyOptions); - } - callback(key, keyOptions = {}) { - let parser = (link, attr) => e.callbackAttr(link, attr, keyOptions); - this.parse(parser, key, keyOptions); - } - parse(attrValueFn, key, keyOptions = {}) { - const attrNames = u.wrapList(keyOptions.attr ?? this.attrNameForKey(key)); - let value = this.options[key]; - for (let attrName of attrNames) { - value ?? (value = this.parseFromAttr(attrValueFn, this.element, attrName)); - } - value ?? (value = keyOptions.default ?? this.defaults[key]); - let normalizeFn = keyOptions.normalize; - if (normalizeFn) { - value = normalizeFn(value); - } - if (u.isDefined(value)) { - this.options[key] = value; - } - let failKey; - if (this.fail && (failKey = up.fragment.failKey(key))) { - const failAttrNames = u.compact(u.map(attrNames, attrName => this.deriveFailAttrName(attrName))); - this.parse(attrValueFn, failKey, { - ...keyOptions, - attr: failAttrNames - }); - } - } - parseFromAttr(attrValueFn, element, attrName) { - if (this.closest) { - return e.closestAttr(element, attrName, attrValueFn); - } else { - return attrValueFn(element, attrName); - } - } - deriveFailAttrName(attr) { - return this.deriveFailAttrNameForPrefix(attr, this.attrPrefix + 'on-') || this.deriveFailAttrNameForPrefix(attr, this.attrPrefix); - } - deriveFailAttrNameForPrefix(attr, prefix) { - if (attr.startsWith(prefix)) { - return `${prefix}fail-${attr.substring(prefix.length)}`; - } - } - attrNameForKey(option) { - return `${this.attrPrefix}${u.camelToKebabCase(option)}`; - } - }; - - /***/ - }, /* 65 */ + }), ( /* 64 */ /***/() => { const e = up.element; const u = up.util; up.OverlayFocus = class OverlayFocus { constructor(layer) { - this.layer = layer; - this.focusElement = this.layer.getFocusElement(); + this._layer = layer; + this._focusElement = this._layer.getFocusElement(); } moveToFront() { - if (this.enabled) { + if (this._enabled) { return; } - this.enabled = true; - this.untrapFocus = up.on('focusin', event => this.onFocus(event)); - this.unsetAttrs = e.setTemporaryAttrs(this.focusElement, { + this._enabled = true; + this._untrapFocus = up.on('focusin', event => this._onFocus(event)); + this._unsetAttrs = e.setTemporaryAttrs(this._focusElement, { 'tabindex': '0', 'role': 'dialog', 'aria-modal': 'true' }); - this.focusTrapBefore = e.affix(this.focusElement, 'beforebegin', 'up-focus-trap[tabindex=0]'); - this.focusTrapAfter = e.affix(this.focusElement, 'afterend', 'up-focus-trap[tabindex=0]'); + this._focusTrapBefore = e.affix(this._focusElement, 'beforebegin', 'up-focus-trap[tabindex=0]'); + this._focusTrapAfter = e.affix(this._focusElement, 'afterend', 'up-focus-trap[tabindex=0]'); } moveToBack() { this.teardown(); } teardown() { - if (!this.enabled) { + if (!this._enabled) { return; } - this.enabled = false; - this.untrapFocus(); - this.unsetAttrs(); - this.focusTrapBefore.remove(); - this.focusTrapAfter.remove(); + this._enabled = false; + this._untrapFocus(); + this._unsetAttrs(); + this._focusTrapBefore.remove(); + this._focusTrapAfter.remove(); } - onFocus(event) { + _onFocus(event) { const { target } = event; - if (this.processingFocusEvent || up.layer.isWithinForeignOverlay(target)) { + if (this._processingFocusEvent || up.layer.isWithinForeignOverlay(target)) { return; } - this.processingFocusEvent = true; - if (target === this.focusTrapBefore) { - this.focusEnd(); - } else if (target === this.focusTrapAfter || !this.layer.contains(target)) { - this.focusStart(); + this._processingFocusEvent = true; + if (target === this._focusTrapBefore) { + this._focusEnd(); + } else if (target === this._focusTrapAfter || !this._layer.contains(target)) { + this._focusStart(); } - this.processingFocusEvent = false; + this._processingFocusEvent = false; } - focusStart(focusOptions) { - up.focus(this.focusElement, focusOptions); + _focusStart(focusOptions) { + up.focus(this._focusElement, focusOptions); } - focusEnd() { - this.focusLastDescendant(this.layer.getBoxElement()) || this.focusStart(); + _focusEnd() { + this._focusLastDescendant(this._layer.getBoxElement()) || this._focusStart(); } - focusLastDescendant(element) { + _focusLastDescendant(element) { for (let child of u.reverse(element.children)) { - if (up.viewport.tryFocus(child) || this.focusLastDescendant(child)) { + if (up.viewport.tryFocus(child) || this._focusLastDescendant(child)) { return true; } } @@ -6599,7 +6787,7 @@ }; /***/ - }, /* 66 */ + }), ( /* 65 */ /***/() => { const u = up.util; const e = up.element; @@ -6622,8 +6810,8 @@ value } = entry; if (!u.isBasicObjectProperty(name)) { - if (this.isArrayKey(name)) { - obj[name] || (obj[name] = []); + if (this._isArrayKey(name)) { + obj[name] ||= []; obj[name].push(value); } else { obj[name] = value; @@ -6646,15 +6834,15 @@ return formData; } toQuery() { - let parts = u.map(this.entries, this.arrayEntryToQuery.bind(this)); + let parts = u.map(this.entries, this._arrayEntryToQuery.bind(this)); parts = u.compact(parts); return parts.join('&'); } - arrayEntryToQuery(entry) { + _arrayEntryToQuery(entry) { const { value } = entry; - if (this.isBinaryValue(value)) { + if (this._isBinaryValue(value)) { return; } let query = encodeURIComponent(entry.name); @@ -6664,12 +6852,12 @@ } return query; } - isBinaryValue(value) { + _isBinaryValue(value) { return value instanceof Blob; } hasBinaryValues() { const values = u.map(this.entries, 'value'); - return u.some(values, this.isBinaryValue); + return u.some(values, this._isBinaryValue); } toURL(base) { let parts = [base, this.toQuery()]; @@ -6689,16 +6877,16 @@ } else if (u.isArray(raw)) { this.entries.push(...raw); } else if (u.isString(raw)) { - this.addAllFromQuery(raw); + this._addAllFromQuery(raw); } else if (u.isFormData(raw)) { - this.addAllFromFormData(raw); + this._addAllFromFormData(raw); } else if (u.isObject(raw)) { - this.addAllFromObject(raw); + this._addAllFromObject(raw); } else { up.fail("Unsupport params type: %o", raw); } } - addAllFromObject(object) { + _addAllFromObject(object) { for (let key in object) { const value = object[key]; const valueElements = u.isArray(value) ? value : [value]; @@ -6707,7 +6895,7 @@ } } } - addAllFromQuery(query) { + _addAllFromQuery(query) { for (let part of query.split('&')) { if (part) { let [name, value] = part.split('='); @@ -6721,7 +6909,7 @@ } } } - addAllFromFormData(formData) { + _addAllFromFormData(formData) { for (let value of formData.entries()) { this.add(...value); } @@ -6731,31 +6919,31 @@ this.add(name, value); } delete(name) { - this.entries = u.reject(this.entries, this.matchEntryFn(name)); + this.entries = u.reject(this.entries, this._matchEntryFn(name)); } - matchEntryFn(name) { + _matchEntryFn(name) { return entry => entry.name === name; } get(name) { - if (this.isArrayKey(name)) { + if (this._isArrayKey(name)) { return this.getAll(name); } else { return this.getFirst(name); } } getFirst(name) { - const entry = u.find(this.entries, this.matchEntryFn(name)); + const entry = u.find(this.entries, this._matchEntryFn(name)); return entry?.value; } getAll(name) { - if (this.isArrayKey(name)) { + if (this._isArrayKey(name)) { return this.getAll(name); } else { - const entries = u.map(this.entries, this.matchEntryFn(name)); + const entries = u.map(this.entries, this._matchEntryFn(name)); return u.map(entries, 'value'); } } - isArrayKey(key) { + _isArrayKey(key) { return key.endsWith('[]'); } [u.isBlank.key]() { @@ -6828,60 +7016,59 @@ }; /***/ - }, /* 67 */ + }), ( /* 66 */ /***/() => { const e = up.element; const TRANSITION_DELAY = 300; up.ProgressBar = class ProgressBar { constructor() { - this.step = 0; - this.element = e.affix(document.body, 'up-progress-bar'); - this.element.style.transition = `width ${TRANSITION_DELAY}ms ease-out`; - this.moveTo(0); - up.element.paint(this.element); - this.width = 31; - this.nextStep(); - } - nextStep() { + this._step = 0; + this._element = e.affix(document.body, 'up-progress-bar'); + this._element.style.transition = `width ${TRANSITION_DELAY}ms ease-out`; + this._moveTo(0); + up.element.paint(this._element); + this._width = 31; + this._nextStep(); + } + _nextStep() { let diff; - if (this.width < 80) { + if (this._width < 80) { if (Math.random() < 0.15) { diff = 7 + 5 * Math.random(); } else { diff = 1.5 + 0.5 * Math.random(); } } else { - diff = 0.13 * (100 - this.width) * Math.random(); + diff = 0.13 * (100 - this._width) * Math.random(); } - this.moveTo(this.width + diff); - this.step++; - const nextStepDelay = TRANSITION_DELAY + this.step * 40; - this.timeout = setTimeout(this.nextStep.bind(this), nextStepDelay); + this._moveTo(this._width + diff); + this._step++; + const nextStepDelay = TRANSITION_DELAY + this._step * 40; + this.timeout = setTimeout(this._nextStep.bind(this), nextStepDelay); } - moveTo(width) { - this.width = width; - this.element.style.width = `${width}vw`; + _moveTo(width) { + this._width = width; + this._element.style.width = `${width}vw`; } destroy() { clearTimeout(this.timeout); - this.element.remove(); + this._element.remove(); } conclude() { clearTimeout(this.timeout); - this.moveTo(100); + this._moveTo(100); setTimeout(this.destroy.bind(this), TRANSITION_DELAY); } }; /***/ - }, /* 68 */ + }), ( /* 67 */ /***/() => { const u = up.util; up.RenderOptions = function () { const GLOBAL_DEFAULTS = { useHungry: true, useKeep: true, - source: true, saveScroll: true, saveFocus: true, focus: 'keep', @@ -6965,7 +7152,7 @@ }(); /***/ - }, /* 69 */ + }), ( /* 68 */ /***/() => { up.RenderResult = class RenderResult extends up.Record { keys() { @@ -6982,6 +7169,19 @@ get fragment() { return this.fragments[0]; } + static both(main, extension, mergeFinished = true) { + if (!extension) return main; + return new this({ + target: main.target, + layer: main.layer, + options: main.options, + fragments: main.fragments.concat(extension.fragments), + finished: mergeFinished && this.mergeFinished(main, extension) + }); + } + static async mergeFinished(main, extension) { + return this.both(await main.finished, await extension.finished, false); + } static buildNone() { return new this({ target: ':none', @@ -6991,7 +7191,7 @@ }; /***/ - }, /* 70 */ + }), ( /* 69 */ /***/() => { var _a; const u = up.util; @@ -7014,24 +7214,24 @@ if (this.wrapMethod == null) { this.wrapMethod = up.network.config.wrapMethod; } - this.normalize(); + this._normalize(); if ((this.target || this.layer || this.origin) && !options.basic) { const layerLookupOptions = { origin: this.origin }; this.layer = up.layer.get(this.layer, layerLookupOptions); - this.failLayer = up.layer.get(this.failLayer || this.layer, layerLookupOptions); - this.context || (this.context = this.layer.context || {}); - this.failContext || (this.failContext = this.failLayer.context || {}); - this.mode || (this.mode = this.layer.mode); - this.failMode || (this.failMode = this.failLayer.mode); + this.failLayer = up.layer.get(this.failLayer, layerLookupOptions); + this.context ||= this.layer.context || {}; + this.failContext ||= this.failLayer?.context || {}; + this.mode ||= this.layer.mode; + this.failMode ||= this.failLayer?.mode; } this.deferred = u.newDeferred(); - this.badResponseTime ?? (this.badResponseTime = u.evalOption(up.network.config.badResponseTime, this)); - this.addAutoHeaders(); + this.badResponseTime ??= u.evalOption(up.network.config.badResponseTime, this); + this._addAutoHeaders(); } get xhr() { - return this._xhr ?? (this._xhr = new XMLHttpRequest()); + return this._xhr ??= new XMLHttpRequest(); } get fragments() { if (this._fragments) { @@ -7052,13 +7252,13 @@ get fragment() { return this.fragments?.[0]; } - normalize() { + _normalize() { this.method = u.normalizeMethod(this.method); - this.extractHashFromURL(); - this.transferParamsToURL(); + this._extractHashFromURL(); + this._transferParamsToURL(); this.url = u.normalizeURL(this.url); } - evictExpensiveAttrs() { + _evictExpensiveAttrs() { u.task(() => { this.layer = undefined; this.failLayer = undefined; @@ -7066,14 +7266,14 @@ this.fragments = undefined; }); } - extractHashFromURL() { + _extractHashFromURL() { let match = this.url?.match(/^([^#]*)(#.+)$/); if (match) { this.url = match[1]; return this.hash = match[2]; } } - transferParamsToURL() { + _transferParamsToURL() { if (!this.url || this.allowsPayload() || u.isBlank(this.params)) { return; } @@ -7093,21 +7293,21 @@ return u.evalAutoOption(this.cache, up.network.config.autoCache, this); } runQueuedCallbacks() { - u.always(this, () => this.evictExpensiveAttrs()); + u.always(this, () => this._evictExpensiveAttrs()); this.onQueued?.(this); } load() { if (this.state !== 'new') return; - if (this.emitLoad()) { + if (this._emitLoad()) { this.state = 'loading'; - this.normalize(); + this._normalize(); this.onLoading?.(); this.expired = false; new up.Request.XHRRenderer(this).buildAndSend({ - onload: () => this.onXHRLoad(), - onerror: () => this.onXHRError(), - ontimeout: () => this.onXHRTimeout(), - onabort: () => this.onXHRAbort() + onload: () => this._onXHRLoad(), + onerror: () => this._onXHRError(), + ontimeout: () => this._onXHRTimeout(), + onabort: () => this._onXHRAbort() }); return true; } else { @@ -7116,7 +7316,7 @@ }); } } - emitLoad() { + _emitLoad() { let event = this.emit('up:request:load', { log: ['Loading %s', this.description] }); @@ -7126,8 +7326,8 @@ up.network.abort(); new up.Request.FormRenderer(this).buildAndSubmit(); } - onXHRLoad() { - const response = this.extractResponseFromXHR(); + _onXHRLoad() { + const response = this._extractResponseFromXHR(); const log = 'Loaded ' + response.description; this.emit('up:request:loaded', { request: response.request, @@ -7136,24 +7336,24 @@ }); this.respondWith(response); } - onXHRError() { - this.setOfflineState('Network error'); + _onXHRError() { + this._setOfflineState('Network error'); } - onXHRTimeout() { - this.setOfflineState('Timeout'); + _onXHRTimeout() { + this._setOfflineState('Timeout'); } - onXHRAbort() { - this.setAbortedState(); + _onXHRAbort() { + this._setAbortedState(); } abort({ reason } = {}) { - if (this.setAbortedState(reason) && this._xhr) { + if (this._setAbortedState(reason) && this._xhr) { this._xhr.abort(); } } - setAbortedState(reason) { - if (this.isSettled()) return; + _setAbortedState(reason) { + if (this._isSettled()) return; let message = 'Aborted request to ' + this.description + (reason ? ': ' + reason : ''); this.state = 'aborted'; this.deferred.reject(new up.Aborted(message)); @@ -7162,18 +7362,18 @@ }); return true; } - setOfflineState(reason) { - if (this.isSettled()) return; + _setOfflineState(reason) { + if (this._isSettled()) return; let message = 'Cannot load request to ' + this.description + (reason ? ': ' + reason : ''); this.state = 'offline'; - this.deferred.reject(new up.Offline(message)); this.emit('up:request:offline', { log: message }); + this.deferred.reject(new up.Offline(message)); } respondWith(response) { this.response = response; - if (this.isSettled()) return; + if (this._isSettled()) return; this.state = 'loaded'; if (response.ok) { this.deferred.resolve(response); @@ -7181,7 +7381,7 @@ this.deferred.reject(response); } } - isSettled() { + _isSettled() { return this.state !== 'new' && this.state !== 'loading' && this.state !== 'tracking'; } csrfHeader() { @@ -7198,7 +7398,7 @@ isCrossOrigin() { return u.isCrossOrigin(this.url); } - extractResponseFromXHR() { + _extractResponseFromXHR() { const responseAttrs = { method: this.method, url: this.url, @@ -7220,7 +7420,7 @@ let urlFromResponse = up.protocol.locationFromXHR(this.xhr); if (urlFromResponse) { if (!u.matchURLs(this.url, urlFromResponse)) { - methodFromResponse || (methodFromResponse = 'GET'); + methodFromResponse ||= 'GET'; } responseAttrs.url = urlFromResponse; } @@ -7229,7 +7429,7 @@ } return new up.Response(responseAttrs); } - buildEventEmitter(args) { + _buildEventEmitter(args) { return up.EventEmitter.fromEmitArgs(args, { layer: this.layer, request: this, @@ -7237,10 +7437,10 @@ }); } emit(...args) { - return this.buildEventEmitter(args).emit(); + return this._buildEventEmitter(args).emit(); } assertEmitted(...args) { - this.buildEventEmitter(args).assertEmitted(); + this._buildEventEmitter(args).assertEmitted(); } get description() { return this.method + ' ' + this.url; @@ -7260,17 +7460,17 @@ header(name) { return this.headers[name]; } - addAutoHeaders() { + _addAutoHeaders() { for (let key of ['target', 'failTarget', 'mode', 'failMode', 'context', 'failContext']) { - this.addAutoHeader(up.protocol.headerize(key), this[key]); + this._addAutoHeader(up.protocol.headerize(key), this[key]); } let csrfHeader, csrfToken; if ((csrfHeader = this.csrfHeader()) && (csrfToken = this.csrfToken())) { - this.addAutoHeader(csrfHeader, csrfToken); + this._addAutoHeader(csrfHeader, csrfToken); } - this.addAutoHeader(up.protocol.headerize('version'), up.version); + this._addAutoHeader(up.protocol.headerize('version'), up.version); } - addAutoHeader(name, value) { + _addAutoHeader(name, value) { if (u.isMissing(value)) { return; } @@ -7306,7 +7506,7 @@ })(), _a); /***/ - }, /* 71 */ + }), ( /* 70 */ /***/() => { const u = up.util; up.Request.Cache = class Cache { @@ -7314,66 +7514,65 @@ this.reset(); } reset() { - this.varyInfo = {}; - this.map = new Map(); + this._varyInfo = {}; + this._map = new Map(); } - cacheKey(request) { - let influencingHeaders = this.getPreviousInfluencingHeaders(request); + _cacheKey(request) { + let influencingHeaders = this._getPreviousInfluencingHeaders(request); let varyPart = u.flatMap(influencingHeaders, headerName => [headerName, request.header(headerName)]); return [request.description, ...varyPart].join(':'); } - getPreviousInfluencingHeaders(request) { - var _a, _b; - return (_a = this.varyInfo)[_b = request.description] || (_a[_b] = new Set()); + _getPreviousInfluencingHeaders(request) { + return this._varyInfo[request.description] ||= new Set(); } get(request) { - request = this.wrap(request); - let cacheKey = this.cacheKey(request); - let cachedRequest = this.map.get(cacheKey); + request = this._wrap(request); + let cacheKey = this._cacheKey(request); + let cachedRequest = this._map.get(cacheKey); if (cachedRequest) { - if (this.isUsable(cachedRequest)) { + if (this._isUsable(cachedRequest)) { return cachedRequest; } else { - this.map.delete(cacheKey); + this._map.delete(cacheKey); } } } - get capacity() { + get _capacity() { return up.network.config.cacheSize; } - isUsable(request) { + _isUsable(request) { return request.age < up.network.config.cacheEvictAge; } async put(request) { - request = this.wrap(request); - this.makeRoom(); - let cacheKey = this.updateCacheKey(request); - this.map.set(cacheKey, request); + request = this._wrap(request); + this._makeRoom(); + let cacheKey = this._updateCacheKey(request); + this._map.set(cacheKey, request); } - updateCacheKey(request) { - let oldCacheKey = this.cacheKey(request); + _updateCacheKey(request) { + let oldCacheKey = this._cacheKey(request); let { response } = request; if (response) { - this.mergePreviousHeaderNames(request, response); - let newCacheKey = this.cacheKey(request); - this.renameMapKey(oldCacheKey, newCacheKey); + this._mergePreviousHeaderNames(request, response); + let newCacheKey = this._cacheKey(request); + this._renameMapKey(oldCacheKey, newCacheKey); return newCacheKey; } else { return oldCacheKey; } } - renameMapKey(oldKey, newKey) { - if (oldKey !== newKey && this.map.has(oldKey)) { - this.map.set(newKey, this.map.get(oldKey)); - this.map.delete(oldKey); + _renameMapKey(oldKey, newKey) { + if (oldKey !== newKey && this._map.has(oldKey)) { + this._map.set(newKey, this._map.get(oldKey)); + this._map.delete(oldKey); } } - mergePreviousHeaderNames(request, response) { + _mergePreviousHeaderNames(request, response) { let headersInfluencingResponse = response.ownInfluncingHeaders; if (headersInfluencingResponse.length) { - let previousInfluencingHeaders = this.getPreviousInfluencingHeaders(request); + let previousInfluencingHeaders = this._getPreviousInfluencingHeaders(request); for (let headerName of headersInfluencingResponse) { previousInfluencingHeaders.add(headerName); } @@ -7382,7 +7581,7 @@ alias(existingCachedRequest, newRequest) { existingCachedRequest = this.get(existingCachedRequest); if (!existingCachedRequest) return; - newRequest = this.wrap(newRequest); + newRequest = this._wrap(newRequest); this.track(existingCachedRequest, newRequest, { force: true }); @@ -7394,7 +7593,7 @@ newRequest.state = 'tracking'; let value = await u.always(existingRequest); if (value instanceof up.Response) { - if (options.force || this.isCacheCompatible(existingRequest, newRequest)) { + if (options.force || this._isCacheCompatible(existingRequest, newRequest)) { newRequest.fromCache = true; value = u.variant(value, { request: newRequest @@ -7414,38 +7613,38 @@ willHaveSameResponse(existingRequest, newRequest) { return existingRequest === newRequest || existingRequest === newRequest.trackedRequest; } - delete(request) { - request = this.wrap(request); - let cacheKey = this.cacheKey(request); - this.map.delete(cacheKey); + _delete(request) { + request = this._wrap(request); + let cacheKey = this._cacheKey(request); + this._map.delete(cacheKey); } evict(condition = true, testerOptions) { - this.eachMatch(condition, testerOptions, request => this.delete(request)); + this._eachMatch(condition, testerOptions, request => this._delete(request)); } expire(condition = true, testerOptions) { - this.eachMatch(condition, testerOptions, request => request.expired = true); + this._eachMatch(condition, testerOptions, request => request.expired = true); } - makeRoom() { - while (this.map.size >= this.capacity) { - let oldestKey = this.map.keys().next().value; - this.map.delete(oldestKey); + _makeRoom() { + while (this._map.size >= this._capacity) { + let oldestKey = this._map.keys().next().value; + this._map.delete(oldestKey); } } - eachMatch(condition = true, testerOptions, fn) { + _eachMatch(condition = true, testerOptions, fn) { let tester = up.Request.tester(condition, testerOptions); - let results = u.filter(this.map.values(), tester); + let results = u.filter(this._map.values(), tester); u.each(results, fn); } - isCacheCompatible(request1, request2) { - return this.cacheKey(request1) === this.cacheKey(request2); + _isCacheCompatible(request1, request2) { + return this._cacheKey(request1) === this._cacheKey(request2); } - wrap(requestOrOptions) { + _wrap(requestOrOptions) { return u.wrapValue(up.Request, requestOrOptions); } }; /***/ - }, /* 72 */ + }), ( /* 71 */ /***/() => { const u = up.util; up.Request.Queue = class Queue { @@ -7453,65 +7652,65 @@ this.reset(); } reset() { - this.queuedRequests = []; - this.currentRequests = []; - this.emittedLate = false; + this._queuedRequests = []; + this._currentRequests = []; + this._emittedLate = false; } get allRequests() { - return this.currentRequests.concat(this.queuedRequests); + return this._currentRequests.concat(this._queuedRequests); } asap(request) { request.runQueuedCallbacks(); - u.always(request, responseOrError => this.onRequestSettled(request, responseOrError)); - this.scheduleSlowTimer(request); - this.queueRequest(request); - u.microtask(() => this.poke()); + u.always(request, responseOrError => this._onRequestSettled(request, responseOrError)); + this._scheduleSlowTimer(request); + this._queueRequest(request); + u.microtask(() => this._poke()); } promoteToForeground(request) { if (request.background) { request.background = false; - this.scheduleSlowTimer(request); + this._scheduleSlowTimer(request); } } - scheduleSlowTimer(request) { + _scheduleSlowTimer(request) { let timeUntilLate = Math.max(request.badResponseTime - request.age, 0); - u.timer(timeUntilLate, () => this.checkLate()); + u.timer(timeUntilLate, () => this._checkLate()); } - getMaxConcurrency() { + _getMaxConcurrency() { return u.evalOption(up.network.config.concurrency); } - hasConcurrencyLeft() { - const maxConcurrency = this.getMaxConcurrency(); - return maxConcurrency === -1 || this.currentRequests.length < maxConcurrency; + _hasConcurrencyLeft() { + const maxConcurrency = this._getMaxConcurrency(); + return maxConcurrency === -1 || this._currentRequests.length < maxConcurrency; } isBusy() { - return this.currentRequests.length > 0 || this.queuedRequests.length > 0; + return this._currentRequests.length > 0 || this._queuedRequests.length > 0; } - queueRequest(request) { - this.queuedRequests.push(request); + _queueRequest(request) { + this._queuedRequests.push(request); } - pluckNextRequest() { - let request = u.find(this.queuedRequests, request => !request.background); - request || (request = this.queuedRequests[0]); - return u.remove(this.queuedRequests, request); + _pluckNextRequest() { + let request = u.find(this._queuedRequests, request => !request.background); + request ||= this._queuedRequests[0]; + return u.remove(this._queuedRequests, request); } - sendRequestNow(request) { + _sendRequestNow(request) { if (request.load()) { - this.currentRequests.push(request); + this._currentRequests.push(request); } } - onRequestSettled(request, responseOrError) { - u.remove(this.currentRequests, request) || u.remove(this.queuedRequests, request); + _onRequestSettled(request, responseOrError) { + u.remove(this._currentRequests, request) || u.remove(this._queuedRequests, request); if (responseOrError instanceof up.Response && responseOrError.ok) { up.network.registerAliasForRedirect(request, responseOrError); } - this.checkLate(); - u.microtask(() => this.poke()); + this._checkLate(); + u.microtask(() => this._poke()); } - poke() { + _poke() { let request; - if (this.hasConcurrencyLeft() && (request = this.pluckNextRequest())) { - return this.sendRequestNow(request); + if (this._hasConcurrencyLeft() && (request = this._pluckNextRequest())) { + return this._sendRequestNow(request); } } abort(...args) { @@ -7525,7 +7724,7 @@ let tester = up.Request.tester(conditions, { except }); - for (let list of [this.currentRequests, this.queuedRequests]) { + for (let list of [this._currentRequests, this._queuedRequests]) { const abortableRequests = u.filter(list, tester); for (let abortableRequest of abortableRequests) { if (logOnce) { @@ -7539,10 +7738,10 @@ } } } - checkLate() { - const currentLate = this.isLate(); - if (this.emittedLate !== currentLate) { - this.emittedLate = currentLate; + _checkLate() { + const currentLate = this._isLate(); + if (this._emittedLate !== currentLate) { + this._emittedLate = currentLate; if (currentLate) { up.emit('up:network:late', { log: 'Server is slow to respond' @@ -7554,7 +7753,7 @@ } } } - isLate() { + _isLate() { const allForegroundRequests = u.reject(this.allRequests, 'background'); const timerTolerance = 1; return u.some(allForegroundRequests, request => request.age >= request.badResponseTime - timerTolerance); @@ -7562,49 +7761,49 @@ }; /***/ - }, /* 73 */ + }), ( /* 72 */ /***/() => { const u = up.util; const e = up.element; const HTML_FORM_METHODS = ['GET', 'POST']; up.Request.FormRenderer = class FormRenderer { constructor(request) { - this.request = request; + this._request = request; } buildAndSubmit() { - this.params = u.copy(this.request.params); - let action = this.request.url; + this.params = u.copy(this._request.params); + let action = this._request.url; let { method - } = this.request; + } = this._request; const paramsFromQuery = up.Params.fromURL(action); this.params.addAll(paramsFromQuery); action = up.Params.stripURL(action); if (!u.contains(HTML_FORM_METHODS, method)) { method = up.protocol.wrapMethod(method, this.params); } - this.form = e.affix(document.body, 'form.up-request-loader', { + this._form = e.affix(document.body, 'form.up-request-loader', { method, action }); - let contentType = this.request.contentType; + let contentType = this._request.contentType; if (contentType) { - this.form.setAttribute('enctype', contentType); + this._form.setAttribute('enctype', contentType); } let csrfParam, csrfToken; - if ((csrfParam = this.request.csrfParam()) && (csrfToken = this.request.csrfToken())) { + if ((csrfParam = this._request.csrfParam()) && (csrfToken = this._request.csrfToken())) { this.params.add(csrfParam, csrfToken); } - u.each(this.params.toArray(), this.addField.bind(this)); - up.browser.submitForm(this.form); + u.each(this.params.toArray(), this._addField.bind(this)); + up.browser.submitForm(this._form); } - addField(attrs) { - e.affix(this.form, 'input[type=hidden]', attrs); + _addField(attrs) { + e.affix(this._form, 'input[type=hidden]', attrs); } }; /***/ - }, /* 74 */ + }), ( /* 73 */ /***/() => { var _a; const CONTENT_TYPE_URL_ENCODED = 'application/x-www-form-urlencoded'; @@ -7612,64 +7811,65 @@ const u = up.util; up.Request.XHRRenderer = (_a = class XHRRenderer { constructor(request) { - this.request = request; + this._request = request; } buildAndSend(handlers) { - const xhr = this.request.xhr; - this.params = u.copy(this.request.params); - if (this.request.timeout) { - xhr.timeout = this.request.timeout; + const xhr = this._request.xhr; + this._params = u.copy(this._request.params); + if (this._request.timeout) { + xhr.timeout = this._request.timeout; } - xhr.open(this.getMethod(), this.request.url); - let contentType = this.getContentType(); + xhr.open(this._getMethod(), this._request.url); + let contentType = this._getContentType(); if (contentType) { xhr.setRequestHeader('Content-Type', contentType); } - for (let headerName in this.request.headers) { - let headerValue = this.request.headers[headerName]; + for (let headerName in this._request.headers) { + let headerValue = this._request.headers[headerName]; xhr.setRequestHeader(headerName, headerValue); } Object.assign(xhr, handlers); - xhr.send(this.getPayload()); + xhr.send(this._getPayload()); } - getMethod() { - if (!this.method) { - this.method = this.request.method; - if (this.request.wrapMethod && !this.request.will302RedirectWithGET()) { - this.method = up.protocol.wrapMethod(this.method, this.params); - } + _getMethod() { + let method = this._request.method; + if (this._request.wrapMethod && !this._request.will302RedirectWithGET()) { + method = up.protocol.wrapMethod(method, this._params); } - return this.method; + return method; } - getContentType() { - this.finalizePayload(); - return this.contentType; + _getContentType() { + this._finalizePayload(); + return this._contentType; } - getPayload() { - this.finalizePayload(); - return this.payload; + _getPayload() { + this._finalizePayload(); + return this._payload; } - finalizePayload() { - this.payload = this.request.payload; - this.contentType = this.request.contentType; - if (!this.payload && this.request.allowsPayload()) { - if (!this.contentType) { - this.contentType = this.params.hasBinaryValues() ? CONTENT_TYPE_FORM_DATA : CONTENT_TYPE_URL_ENCODED; + _finalizePayload() { + this._payload = this._request.payload; + this._contentType = this._request.contentType; + if (!this._payload && this._request.allowsPayload()) { + if (!this._contentType) { + this._contentType = this._params.hasBinaryValues() ? CONTENT_TYPE_FORM_DATA : CONTENT_TYPE_URL_ENCODED; } - if (this.contentType === CONTENT_TYPE_FORM_DATA) { - this.contentType = null; - this.payload = this.params.toFormData(); + if (this._contentType === CONTENT_TYPE_FORM_DATA) { + this._contentType = null; + this._payload = this._params.toFormData(); } else { - this.payload = this.params.toQuery().replace(/%20/g, '+'); + this._payload = this._params.toQuery().replace(/%20/g, '+'); } } } }, (() => { - u.memoizeMethod(_a.prototype, ['finalizePayload']); + u.memoizeMethod(_a.prototype, { + _finalizePayload: true, + _getMethod: true + }); })(), _a); /***/ - }, /* 75 */ + }), ( /* 74 */ /***/() => { const u = up.util; up.Response = class Response extends up.Record { @@ -7714,7 +7914,7 @@ return this.header('ETag'); } get json() { - return this.parsedJSON || (this.parsedJSON = JSON.parse(this.text)); + return this.parsedJSON ||= JSON.parse(this.text); } get age() { let now = new Date(); @@ -7729,121 +7929,200 @@ }; /***/ - }, /* 76 */ + }), ( /* 75 */ /***/() => { var _a; const u = up.util; const e = up.element; up.ResponseDoc = (_a = class ResponseDoc { - constructor(options) { - this.root = this.parseDocument(options) || this.parseFragment(options) || this.parseContent(options); + constructor({ + document, + fragment, + content, + target, + origin, + cspNonces, + match + }) { + if (document) { + this._parseDocument(document); + } else if (fragment) { + this._parseFragment(fragment); + } else { + this._parseContent(content || '', target); + } if (!up.fragment.config.runScripts) { - this.root.querySelectorAll('script').forEach(e => e.remove()); + this._document.querySelectorAll('script').forEach(e => e.remove()); } - this.cspNonces = options.cspNonces; - if (options.origin) { - let originSelector = up.fragment.tryToTarget(options.origin); + this._cspNonces = cspNonces; + if (origin) { + let originSelector = up.fragment.tryToTarget(origin); if (originSelector) { - this.rediscoveredOrigin = this.select(originSelector); + this._rediscoveredOrigin = this.select(originSelector); } } + this._match = match; } - parseDocument(options) { - let document = this.parse(options.document, e.createBrokenDocumentFromHTML); - if (document) { - this.scriptishNeedFix = true; - return document; - } + _parseDocument(document) { + document = this._parse(document, e.createBrokenDocumentFromHTML); + this._isDocumentBroken = true; + this._useParseResult(document); } - parseContent(options) { - let content = options.content || ''; - let target = options.target || up.fail("must pass a { target } when passing { content }"); - target = u.map(up.fragment.parseTargetSteps(target), 'selector').join(','); + _parseFragment(fragment) { + fragment = this._parse(fragment, e.createFromHTML); + this._useParseResult(fragment); + } + _parseContent(content, target) { + if (!target) up.fail("must pass a { target } when passing { content }"); + target = u.map(up.fragment.parseTargetSteps(target), 'selector').join(); const matchingElement = e.createFromSelector(target); if (u.isString(content)) { matchingElement.innerHTML = content; } else { matchingElement.appendChild(content); } - return matchingElement; - } - parseFragment(options) { - return this.parse(options.fragment); + this._useParseResult(matchingElement); } - parse(value, parseFn = e.createFromHTML) { + _parse(value, parseFn) { if (u.isString(value)) { value = parseFn(value); } return value; } + _useParseResult(node) { + if (node instanceof Document) { + this._document = node; + } else { + this._document = document.createElement('up-document'); + this._document.append(node); + this._document.documentElement = node; + } + } rootSelector() { - return up.fragment.toTarget(this.root); + return up.fragment.toTarget(this._document.documentElement); + } + get title() { + return this._fromHead(this._getTitleText); + } + _getHead() { + let { + head + } = this._document; + if (head && head.childNodes.length > 0) { + return head; + } } - getTitle() { - return this.root.querySelector('head title')?.textContent; + _fromHead(fn) { + let head = this._getHead(); + return head && fn(head); + } + get metaTags() { + return this._fromHead(up.history.findMetaTags); + } + get assets() { + return this._fromHead(up.script.findAssets); + } + _getTitleText(head) { + return head.querySelector('title')?.textContent; } select(selector) { let finder = new up.FragmentFinder({ selector: selector, - origin: this.rediscoveredOrigin, - externalRoot: this.root + origin: this._rediscoveredOrigin, + document: this._document, + match: this._match }); return finder.find(); } selectSteps(steps) { return steps.filter(step => { - step.newElement || (step.newElement = this.select(step.selector)); - if (step.newElement) { + return this._trySelectStep(step) || this._cannotMatchStep(step); + }); + } + commitSteps(steps) { + return steps.filter(step => { + if (this._document.contains(step.newElement)) { + step.newElement.remove(); return true; - } else if (!step.maybe) { - throw new up.CannotMatch(); } }); } + _trySelectStep(step) { + if (step.newElement) { + return true; + } + let newElement = this.select(step.selector); + if (!newElement) { + return; + } + let { + selectEvent + } = step; + if (selectEvent) { + selectEvent.newFragment = newElement; + selectEvent.renderOptions = step.originalRenderOptions; + up.emit(step.oldElement, selectEvent, { + callback: step.selectCallback + }); + if (selectEvent.defaultPrevented) { + return; + } + } + step.newElement = newElement; + return true; + } + _cannotMatchStep(step) { + if (!step.maybe) { + throw new up.CannotMatch(); + } + } finalizeElement(element) { - up.NonceableCallback.adoptNonces(element, this.cspNonces); - if (this.scriptishNeedFix) { - element.querySelectorAll('noscript, script').forEach(e.fixScriptish); + up.NonceableCallback.adoptNonces(element, this._cspNonces); + if (this._isDocumentBroken) { + let brokenElements = e.subtree(element, ':is(noscript,script,audio,video):not(.up-keeping, .up-keeping *)'); + u.each(brokenElements, e.fixParserDamage); } } }, (() => { - u.memoizeMethod(_a.prototype, 'getTitle'); + u.memoizeMethod(_a.prototype, { + _getHead: true + }); })(), _a); /***/ - }, /* 77 */ + }), ( /* 76 */ /***/() => { const e = up.element; const u = up.util; up.RevealMotion = class RevealMotion { constructor(element, options = {}) { - this.element = element; - this.options = options; - this.viewport = e.get(this.options.viewport) || up.viewport.get(this.element); - this.obstructionsLayer = up.layer.get(this.viewport); + this._element = element; + this._options = options; + this._viewport = e.get(this._options.viewport) || up.viewport.get(this._element); + this._obstructionsLayer = up.layer.get(this._viewport); const viewportConfig = up.viewport.config; - this.snap = this.options.snap ?? this.options.revealSnap ?? viewportConfig.revealSnap; - this.padding = this.options.padding ?? this.options.revealPadding ?? viewportConfig.revealPadding; - this.top = this.options.top ?? this.options.revealTop ?? viewportConfig.revealTop; - this.max = this.options.max ?? this.options.revealMax ?? viewportConfig.revealMax; - this.topObstructions = viewportConfig.fixedTop; - this.bottomObstructions = viewportConfig.fixedBottom; + this._snap = this._options.snap ?? this._options.revealSnap ?? viewportConfig.revealSnap; + this._padding = this._options.padding ?? this._options.revealPadding ?? viewportConfig.revealPadding; + this._top = this._options.top ?? this._options.revealTop ?? viewportConfig.revealTop; + this._max = this._options.max ?? this._options.revealMax ?? viewportConfig.revealMax; + this._topObstructions = viewportConfig.fixedTopSelectors; + this._bottomObstructions = viewportConfig.fixedBottomSelectors; } start() { - const viewportRect = this.getViewportRect(this.viewport); - const elementRect = up.Rect.fromElement(this.element); - if (this.max) { - const maxPixels = u.evalOption(this.max, this.element); + const viewportRect = this._getViewportRect(this._viewport); + const elementRect = up.Rect.fromElement(this._element); + if (this._max) { + const maxPixels = u.evalOption(this._max, this._element); elementRect.height = Math.min(elementRect.height, maxPixels); } - this.addPadding(elementRect); - this.substractObstructions(viewportRect); + this._addPadding(elementRect); + this._substractObstructions(viewportRect); if (viewportRect.height < 0) { up.fail('Viewport has no visible area'); } - const originalScrollTop = this.viewport.scrollTop; + const originalScrollTop = this._viewport.scrollTop; let newScrollTop = originalScrollTop; - if (this.top || elementRect.height > viewportRect.height) { + if (this._top || elementRect.height > viewportRect.height) { const diff = elementRect.top - viewportRect.top; newScrollTop += diff; } else if (elementRect.top < viewportRect.top) { @@ -7851,18 +8130,18 @@ } else if (elementRect.bottom > viewportRect.bottom) { newScrollTop += elementRect.bottom - viewportRect.bottom; } else ; - if (u.isNumber(this.snap) && newScrollTop < this.snap && elementRect.top < 0.5 * viewportRect.height) { + if (u.isNumber(this._snap) && newScrollTop < this._snap && elementRect.top < 0.5 * viewportRect.height) { newScrollTop = 0; } if (newScrollTop !== originalScrollTop) { - this.viewport.scrollTo({ - ...this.options, + this._viewport.scrollTo({ + ...this._options, top: newScrollTop }); } } - getViewportRect() { - if (up.viewport.isRoot(this.viewport)) { + _getViewportRect() { + if (up.viewport.isRoot(this._viewport)) { return new up.Rect({ left: 0, top: 0, @@ -7870,21 +8149,21 @@ height: up.viewport.rootHeight() }); } else { - return up.Rect.fromElement(this.viewport); + return up.Rect.fromElement(this._viewport); } } - addPadding(elementRect) { - elementRect.top -= this.padding; - elementRect.height += 2 * this.padding; + _addPadding(elementRect) { + elementRect.top -= this._padding; + elementRect.height += 2 * this._padding; } - selectObstructions(selectors) { - let elements = up.fragment.all(selectors.join(','), { - layer: this.obstructionsLayer + _selectObstructions(selectors) { + let elements = up.fragment.all(selectors.join(), { + layer: this._obstructionsLayer }); return u.filter(elements, e.isVisible); } - substractObstructions(viewportRect) { - for (let obstruction of this.selectObstructions(this.topObstructions)) { + _substractObstructions(viewportRect) { + for (let obstruction of this._selectObstructions(this._topObstructions)) { let obstructionRect = up.Rect.fromElement(obstruction); let diff = obstructionRect.bottom - viewportRect.top; if (diff > 0) { @@ -7892,7 +8171,7 @@ viewportRect.height -= diff; } } - for (let obstruction of this.selectObstructions(this.bottomObstructions)) { + for (let obstruction of this._selectObstructions(this._bottomObstructions)) { let obstructionRect = up.Rect.fromElement(obstruction); let diff = viewportRect.bottom - obstructionRect.top; if (diff > 0) { @@ -7903,17 +8182,42 @@ }; /***/ - }, /* 78 */ + }), ( /* 77 */ /***/() => { const u = up.util; + const CSS_HAS_SUFFIX_PATTERN = /:has\(([^)]+)\)$/; up.Selector = class Selector { - constructor(selectors, filters = []) { - this.selectors = selectors; - this.filters = filters; - this.unionSelector = this.selectors.join(',') || 'match-none'; + constructor(selector, elementOrDocument, options = {}) { + this._filters = []; + if (!options.destroying) { + this._filters.push(up.fragment.isNotDestroying); + } + let matchingInExternalDocument = elementOrDocument && !document.contains(elementOrDocument); + let expandTargetLayer; + if (matchingInExternalDocument || options.layer === 'any') { + expandTargetLayer = up.layer.root; + } else { + options.layer ??= u.presence(elementOrDocument, u.isElement); + this._layers = up.layer.getAll(options); + if (!this._layers.length) throw new up.CannotMatch(["Unknown layer: %o", options.layer]); + this._filters.push(match => u.some(this._layers, layer => layer.contains(match))); + expandTargetLayer = this._layers[0]; + } + let expandedTargets = up.fragment.expandTargets(selector, { + ...options, + layer: expandTargetLayer + }); + this._selectors = expandedTargets.map(target => { + target = target.replace(CSS_HAS_SUFFIX_PATTERN, (match, descendantSelector) => { + this._filters.push(element => element.querySelector(descendantSelector)); + return ''; + }); + return target || '*'; + }); + this._unionSelector = this._selectors.join() || 'match-none'; } matches(element) { - return element.matches(this.unionSelector) && this.passesFilter(element); + return element.matches(this._unionSelector) && this._passesFilter(element); } closest(element) { let parentElement; @@ -7923,12 +8227,12 @@ return this.closest(parentElement); } } - passesFilter(element) { - return u.every(this.filters, filter => filter(element)); + _passesFilter(element) { + return u.every(this._filters, filter => filter(element)); } - descendants(root) { - const results = u.flatMap(this.selectors, selector => root.querySelectorAll(selector)); - return u.filter(results, element => this.passesFilter(element)); + descendants(root = document) { + const results = u.flatMap(this._selectors, selector => root.querySelectorAll(selector)); + return u.filter(results, element => this._passesFilter(element)); } subtree(root) { const results = []; @@ -7941,60 +8245,60 @@ }; /***/ - }, /* 79 */ + }), ( /* 78 */ /***/() => { const u = up.util; const e = up.element; up.Tether = class Tether { constructor(options) { up.migrate.handleTetherOptions?.(options); - this.anchor = options.anchor; - this.align = options.align; - this.position = options.position; - this.alignAxis = this.position === 'top' || this.position === 'bottom' ? 'horizontal' : 'vertical'; - this.viewport = up.viewport.get(this.anchor); - this.parent = this.viewport === e.root ? document.body : this.viewport; - this.syncOnScroll = !this.viewport.contains(this.anchor.offsetParent); + this._anchor = options.anchor; + this._align = options.align; + this._position = options.position; + this._alignAxis = this._position === 'top' || this._position === 'bottom' ? 'horizontal' : 'vertical'; + this._viewport = up.viewport.get(this._anchor); + this.parent = this._viewport === e.root ? document.body : this._viewport; + this._syncOnScroll = !this._viewport.contains(this._anchor.offsetParent); } start(element) { - this.element = element; - this.element.style.position = 'absolute'; - this.setOffset(0, 0); + this._element = element; + this._element.style.position = 'absolute'; + this._setOffset(0, 0); this.sync(); - this.changeEventSubscription('on'); + this._changeEventSubscription('on'); } stop() { - this.changeEventSubscription('off'); + this._changeEventSubscription('off'); } - changeEventSubscription(fn) { - let doScheduleSync = this.scheduleSync.bind(this); + _changeEventSubscription(fn) { + let doScheduleSync = this._scheduleSync.bind(this); up[fn](window, 'resize', doScheduleSync); - if (this.syncOnScroll) { - up[fn](this.viewport, 'scroll', doScheduleSync); + if (this._syncOnScroll) { + up[fn](this._viewport, 'scroll', doScheduleSync); } } - scheduleSync() { + _scheduleSync() { clearTimeout(this.syncTimer); return this.syncTimer = u.task(this.sync.bind(this)); } isDetached() { - return !this.parent.isConnected || !this.anchor.isConnected; + return !this.parent.isConnected || !this._anchor.isConnected; } sync() { - const elementBox = this.element.getBoundingClientRect(); + const elementBox = this._element.getBoundingClientRect(); const elementMargin = { - top: e.styleNumber(this.element, 'marginTop'), - right: e.styleNumber(this.element, 'marginRight'), - bottom: e.styleNumber(this.element, 'marginBottom'), - left: e.styleNumber(this.element, 'marginLeft') + top: e.styleNumber(this._element, 'marginTop'), + right: e.styleNumber(this._element, 'marginRight'), + bottom: e.styleNumber(this._element, 'marginBottom'), + left: e.styleNumber(this._element, 'marginLeft') }; - const anchorBox = this.anchor.getBoundingClientRect(); + const anchorBox = this._anchor.getBoundingClientRect(); let left; let top; - switch (this.alignAxis) { + switch (this._alignAxis) { case 'horizontal': { - switch (this.position) { + switch (this._position) { case 'top': top = anchorBox.top - elementMargin.bottom - elementBox.height; break; @@ -8002,7 +8306,7 @@ top = anchorBox.top + anchorBox.height + elementMargin.top; break; } - switch (this.align) { + switch (this._align) { case 'left': left = anchorBox.left + elementMargin.left; break; @@ -8017,7 +8321,7 @@ } case 'vertical': { - switch (this.align) { + switch (this._align) { case 'top': top = anchorBox.top + elementMargin.top; break; @@ -8028,7 +8332,7 @@ top = anchorBox.top + anchorBox.height - elementBox.height - elementMargin.bottom; break; } - switch (this.position) { + switch (this._position) { case 'left': left = anchorBox.left - elementMargin.right - elementBox.width; break; @@ -8040,25 +8344,25 @@ } } if (u.isDefined(left) || u.isDefined(top)) { - this.moveTo(left, top); + this._moveTo(left, top); } else { - up.fail('Invalid tether constraints: %o', this.describeConstraints()); + up.fail('Invalid tether constraints: %o', this._describeConstraints()); } } - describeConstraints() { + _describeConstraints() { return { - position: this.position, - align: this.align + position: this._position, + align: this._align }; } - moveTo(targetLeft, targetTop) { - const elementBox = this.element.getBoundingClientRect(); - this.setOffset(targetLeft - elementBox.left + this.offsetLeft, targetTop - elementBox.top + this.offsetTop); + _moveTo(targetLeft, targetTop) { + const elementBox = this._element.getBoundingClientRect(); + this._setOffset(targetLeft - elementBox.left + this.offsetLeft, targetTop - elementBox.top + this.offsetTop); } - setOffset(left, top) { + _setOffset(left, top) { this.offsetLeft = left; this.offsetTop = top; - e.setStyle(this.element, { + e.setStyle(this._element, { left, top }); @@ -8066,13 +8370,13 @@ }; /***/ - }, /* 80 */ + }), ( /* 79 */ /***/() => { const u = up.util; up.URLPattern = class URLPattern { constructor(fullPattern, normalizeURL = u.normalizeURL) { - this.normalizeURL = normalizeURL; - this.groups = []; + this._normalizeURL = normalizeURL; + this._groups = []; const positiveList = []; const negativeList = []; for (let pattern of u.parseTokens(fullPattern)) { @@ -8082,10 +8386,10 @@ positiveList.push(pattern); } } - this.positiveRegexp = this.buildRegexp(positiveList, true); - this.negativeRegexp = this.buildRegexp(negativeList, false); + this._positiveRegexp = this._buildRegexp(positiveList, true); + this._negativeRegexp = this._buildRegexp(negativeList, false); } - buildRegexp(list, capture) { + _buildRegexp(list, capture) { if (!list.length) { return; } @@ -8093,7 +8397,7 @@ if (url[0] === '*') { url = '/' + url; } - url = this.normalizeURL(url); + url = this._normalizeURL(url); url = u.escapeRegExp(url); return url; }); @@ -8102,7 +8406,7 @@ reCode = reCode.replace(/(:|\\\$)([a-z][\w-]*)/ig, (match, type, name) => { if (type === '\\$') { if (capture) { - this.groups.push({ + this._groups.push({ name, cast: Number }); @@ -8110,7 +8414,7 @@ return '(\\d+)'; } else { if (capture) { - this.groups.push({ + this._groups.push({ name, cast: String }); @@ -8122,18 +8426,18 @@ } test(url, doNormalize = true) { if (doNormalize) { - url = this.normalizeURL(url); + url = this._normalizeURL(url); } - return this.positiveRegexp.test(url) && !this.isExcluded(url); + return this._positiveRegexp.test(url) && !this._isExcluded(url); } recognize(url, doNormalize = true) { if (doNormalize) { - url = this.normalizeURL(url); + url = this._normalizeURL(url); } - let match = this.positiveRegexp.exec(url); - if (match && !this.isExcluded(url)) { + let match = this._positiveRegexp.exec(url); + if (match && !this._isExcluded(url)) { const resolution = {}; - this.groups.forEach((group, groupIndex) => { + this._groups.forEach((group, groupIndex) => { let value = match[groupIndex + 1]; if (value) { return resolution[group.name] = group.cast(value); @@ -8142,13 +8446,13 @@ return resolution; } } - isExcluded(url) { - return this.negativeRegexp?.test(url); + _isExcluded(url) { + return this._negativeRegexp?.test(url); } }; /***/ - }, /* 81 */ + }), ( /* 80 */ /***/() => { up.framework = function () { let readyState = 'evaling'; @@ -8242,7 +8546,7 @@ up.boot = up.framework.boot; /***/ - }, /* 82 */ + }), ( /* 81 */ /***/() => { up.event = function () { const u = up.util; @@ -8341,7 +8645,7 @@ up.emit = up.event.emit; /***/ - }, /* 83 */ + }), ( /* 82 */ /***/() => { up.protocol = function () { const u = up.util; @@ -8413,8 +8717,7 @@ cspNonce() { return e.metaContent('csp-nonce'); }, - csrfHeader: 'X-CSRF-Token', - nonceableAttributes: ['up-watch', 'up-on-accepted', 'up-on-dismissed', 'up-on-loaded', 'up-on-rendered', 'up-on-finished', 'up-on-error', 'up-on-offlne'] + csrfHeader: 'X-CSRF-Token' })); function csrfHeader() { return u.evalOption(config.csrfHeader); @@ -8478,7 +8781,7 @@ }(); /***/ - }, /* 84 */ + }), ( /* 83 */ /***/() => { up.log = function () { const u = up.util; @@ -8519,7 +8822,7 @@ const logo = " __ _____ ___ ___ / /_ __\n" + `/ // / _ \\/ _ \\/ _ \\/ / // / ${up.version}\n` + "\\___/_//_/ .__/\\___/_/\\_. / \n" + " / / / /\n\n"; let text = ""; if (!up.migrate.loaded) { - text += "Load unpoly-migrate.js to enable deprecated APIs.\n\n"; + text += "Load unpoly-migrate.js to polyfill deprecated APIs.\n\n"; } if (config.enabled) { text += "Call `up.log.disable()` to disable logging for this session."; @@ -8555,10 +8858,16 @@ up.warn = up.log.warn; /***/ - }, /* 85 */ + }), ( /* 84 */ /***/() => { - up.syntax = function () { + up.script = function () { const u = up.util; + const e = up.element; + const config = new up.Config(() => ({ + assetSelectors: ['link[rel=stylesheet]', 'script[src]', '[up-asset]'], + noAssetSelectors: ['[up-asset=false]'], + nonceableAttributes: ['up-watch', 'up-on-accepted', 'up-on-dismissed', 'up-on-loaded', 'up-on-rendered', 'up-on-finished', 'up-on-error', 'up-on-offline'] + })); const SYSTEM_MACRO_PRIORITIES = { '[up-back]': -100, '[up-content]': -200, @@ -8568,6 +8877,7 @@ '[up-popup]': -200, '[up-tooltip]': -200, '[up-dash]': -200, + '[up-flashes]': -200, '[up-expand]': -300, '[data-method]': -400, '[data-confirm]': -400 @@ -8581,7 +8891,7 @@ function registerMacro(...args) { const macro = buildCompiler(args); if (up.framework.evaling) { - macro.priority || (macro.priority = detectSystemMacroPriority(macro.selector) || up.fail('Unregistered priority for system macro %o', macro.selector)); + macro.priority ||= detectSystemMacroPriority(macro.selector) || up.fail('Unregistered priority for system macro %o', macro.selector); } return insertCompiler(registeredMacros, macro); } @@ -8636,6 +8946,9 @@ return newCompiler; } function compile(fragment, options) { + up.emit(fragment, 'up:fragment:compile', { + log: false + }); let compilers = options.compilers || registeredMacros.concat(registeredCompilers); const pass = new up.CompilerPass(fragment, compilers, options); pass.run(); @@ -8665,7 +8978,7 @@ } function readData(element) { element = up.fragment.get(element); - return element.upData || (element.upData = buildData(element)); + return element.upData ||= buildData(element); } function buildData(element) { if (!element.getAttribute) { @@ -8685,35 +8998,57 @@ ...element.upCompileData }; } + function findAssets(head = document.head) { + return e.filteredQuery(head, config.assetSelectors, config.noAssetSelectors); + } + function assertAssetsOK(newAssets, renderOptions) { + let oldAssets = findAssets(); + let oldHTML = u.map(oldAssets, 'outerHTML').join(); + let newHTML = u.map(newAssets, 'outerHTML').join(); + if (oldHTML !== newHTML) { + up.event.assertEmitted('up:assets:changed', { + oldAssets, + newAssets, + renderOptions + }); + } + } function reset() { registeredCompilers = u.filter(registeredCompilers, 'isDefault'); registeredMacros = u.filter(registeredMacros, 'isDefault'); + config.reset(); } up.on('up:framework:reset', reset); return { + config, compiler: registerCompiler, macro: registerMacro, destructor: registerDestructor, hello, clean, - data: readData + data: readData, + findAssets, + assertAssetsOK }; }(); - up.compiler = up.syntax.compiler; - up.destructor = up.syntax.destructor; - up.macro = up.syntax.macro; - up.data = up.syntax.data; - up.hello = up.syntax.hello; + up.compiler = up.script.compiler; + up.destructor = up.script.destructor; + up.macro = up.script.macro; + up.data = up.script.data; + up.hello = up.script.hello; /***/ - }, /* 86 */ + }), ( /* 85 */ /***/() => { up.history = function () { const u = up.util; const e = up.element; const config = new up.Config(() => ({ enabled: true, - restoreTargets: ['body'] + updateMetaTags: true, + restoreTargets: ['body'], + metaTagSelectors: ['meta', 'link[rel=alternate]', 'link[rel=canonical]', 'link[rel=icon]', '[up-meta]'], + noMetaTagSelectors: ['meta[http-equiv]', '[up-meta=false]', 'meta[name=csp-nonce]'] })); let previousLocation; let nextPreviousLocation; @@ -8844,6 +9179,18 @@ setTimeout(register, 100); } }); + function findMetaTags(head = document.head) { + return e.filteredQuery(head, config.metaTagSelectors, config.noMetaTagSelectors); + } + function updateMetaTags(newMetaTags) { + let oldMetaTags = findMetaTags(); + for (let oldMetaTag of oldMetaTags) { + oldMetaTag.remove(); + } + for (let newMetaTag of newMetaTags) { + document.head.append(newMetaTag); + } + } up.macro('a[up-back], [up-href][up-back]', function (link) { if (previousLocation) { e.setMissingAttrs(link, { @@ -8866,14 +9213,16 @@ return previousLocation; }, normalizeURL, - isLocation + isLocation, + findMetaTags, + updateMetaTags }; }(); /***/ - }, /* 87 */ + }), ( /* 86 */ /***/(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - __webpack_require__(88); + __webpack_require__(87); const u = up.util; const e = up.element; up.fragment = function () { @@ -8885,7 +9234,7 @@ } const config = new up.Config(() => ({ badTargetClasses: [/^up-/], - targetDerivers: ['[up-id]', '[id]', 'html', 'head', 'body', 'main', '[up-main]', upTagName, 'link[rel][type]', 'link[rel=preload][href]', 'link[rel=preconnect][href]', 'link[rel=prefetch][href]', 'link[rel]', 'meta[property]', '*[name]', 'form[action]', 'a[href]', '[class]', 'form'], + targetDerivers: ['[up-id]', '[id]', 'html', 'head', 'body', 'main', '[up-main]', upTagName, 'link[rel][type]', 'link[rel=preload][href]', 'link[rel=preconnect][href]', 'link[rel=prefetch][href]', 'link[rel]', 'meta[property]', '*[name]', 'form[action]', 'a[href]', '[class]', '[up-flashes]', 'form'], verifyDerivedTarget: true, navigateOptions: { cache: 'auto', @@ -8897,7 +9246,7 @@ history: 'auto', peel: true }, - matchAroundOrigin: true, + match: 'region', runScripts: true, autoHistoryTargets: [':main'], autoFocus: ['hash', 'autofocus', 'main-if-main', 'keep', 'target-if-lost'], @@ -8951,23 +9300,24 @@ }); } function emitFragmentKeep(keepPlan) { - const log = ['Keeping fragment %o', keepPlan.oldElement]; - const callback = e.callbackAttr(keepPlan.oldElement, 'up-on-keep', { + let { + oldElement, + newElement: newFragment, + newData, + renderOptions + } = keepPlan; + const log = ['Keeping fragment %o', oldElement]; + const callback = e.callbackAttr(oldElement, 'up-on-keep', { exposedKeys: ['newFragment', 'newData'] }); - return emitFromKeepPlan(keepPlan, 'up:fragment:keep', { + return up.emit(oldElement, 'up:fragment:keep', { + newFragment, + newData, + renderOptions, log, callback }); } - function emitFromKeepPlan(keepPlan, eventType, emitDetails) { - const keepable = keepPlan.oldElement; - const event = up.event.build(eventType, { - newFragment: keepPlan.newElement, - newData: keepPlan.newData - }); - return up.emit(keepable, event, emitDetails); - } function emitFragmentDestroyed(fragment, options) { const log = options.log ?? ['Destroyed fragment %o', fragment]; const parent = options.parent || document; @@ -8996,13 +9346,13 @@ return new up.FragmentFinder({ selector, origin: options.origin, - layer: options.layer + layer: options.layer, + match: options.match }).find(); } function getDumb(...args) { return getAll(...args)[0]; } - const CSS_HAS_SUFFIX_PATTERN = /:has\(([^)]+)\)$/; function getAll(...args) { const options = u.extractOptions(args); let selectorString = args.pop(); @@ -9013,12 +9363,11 @@ if (u.isList(selectorString)) { return selectorString; } - let selector = buildSelector(selectorString, root, options); - return selector.descendants(root || document); + let selector = new up.Selector(selectorString, root, options); + return selector.descendants(root); } function getSubtree(element, selector, options = {}) { - selector = buildSelector(selector, element, options); - return selector.subtree(element); + return new up.Selector(selector, element, options).subtree(element); } function contains(root, selectorOrElement) { if (u.isElement(selectorOrElement)) { @@ -9028,9 +9377,7 @@ } } function closest(element, selector, options) { - element = e.get(element); - selector = buildSelector(selector, element, options); - return selector.closest(element); + return new up.Selector(selector, element, options).closest(element); } function destroy(...args) { const options = parseTargetAndOptions(args); @@ -9042,7 +9389,7 @@ function parseTargetAndOptions(args) { const options = u.parseArgIntoOptions(args, 'target'); if (u.isElement(options.target)) { - options.origin || (options.origin = options.target); + options.origin ||= options.target; } return options; } @@ -9052,9 +9399,9 @@ } function reload(...args) { const options = parseTargetAndOptions(args); - options.target || (options.target = ':main'); + options.target ||= ':main'; const element = getSmart(options.target, options); - options.url || (options.url = sourceOf(element)); + options.url ||= sourceOf(element); options.headers = u.merge(options.headers, conditionalHeaders(element)); if (options.keepData || e.booleanAttr(element, 'up-keep-data')) { options.data = up.data(element); @@ -9184,7 +9531,7 @@ return result; } function isGoodTarget(target, element, options = {}) { - return !element.isConnected || !config.verifyDerivedTarget || up.fragment.get(target, { + return !isAlive(element) || !config.verifyDerivedTarget || up.fragment.get(target, { layer: element, ...options }) === element; @@ -9226,7 +9573,12 @@ while (targets.length) { const target = targets.shift(); if (target === ':main' || target === true) { - const mode = layer === 'new' ? options.mode : layer.mode; + let mode; + if (layer === 'new') { + mode = options.mode || up.fail('Must pass a { mode } option together with { layer: "new" }'); + } else { + mode = layer.mode; + } targets.unshift(...up.layer.mainTargets(mode)); } else if (target === ':layer') { if (layer !== 'new' && !layer.opening) { @@ -9240,34 +9592,6 @@ } return u.uniq(expanded); } - function buildSelector(selector, element, options = {}) { - const filters = []; - if (!options.destroying) { - filters.push(isNotDestroying); - } - let elementOutsideDocumentGiven = element && !document.contains(element); - let expandTargetLayer; - if (elementOutsideDocumentGiven || options.layer === 'any') { - expandTargetLayer = up.layer.root; - } else { - options.layer ?? (options.layer = element); - const layers = up.layer.getAll(options); - filters.push(match => u.some(layers, layer => layer.contains(match))); - expandTargetLayer = layers[0]; - } - let expandedTargets = up.fragment.expandTargets(selector, { - ...options, - layer: expandTargetLayer - }); - expandedTargets = expandedTargets.map(function (target) { - target = target.replace(CSS_HAS_SUFFIX_PATTERN, function (match, descendantSelector) { - filters.push(element => element.querySelector(descendantSelector)); - return ''; - }); - return target || '*'; - }); - return new up.Selector(expandedTargets, filters); - } function splitTarget(target) { return u.parseTokens(target, { separator: 'comma' @@ -9293,7 +9617,8 @@ ...options, selector, placement, - maybe + maybe, + originalRenderOptions: options }; steps.push(step); } @@ -9313,15 +9638,16 @@ let target = tryToTarget(selector); return target && element.matches(target); } else { - selector = buildSelector(selector, element, options); - return selector.matches(element); + return new up.Selector(selector, element, options).matches(element); } } function shouldRevalidate(request, response, options = {}) { return request.fromCache && u.evalAutoOption(options.revalidate, config.autoRevalidate, response); } function targetForSteps(steps) { - return u.map(steps, 'selector').join(', ') || ':none'; + let requiredSteps = u.reject(steps, 'maybe'); + let selectors = u.map(requiredSteps, 'selector'); + return selectors.join(', ') || ':none'; } function isContainedByRivalStep(steps, candidateStep) { return u.some(steps, function (rivalStep) { @@ -9329,6 +9655,7 @@ }); } function compressNestedSteps(steps) { + if (steps.length < 2) return steps; let compressed = u.uniqBy(steps, 'oldElement'); compressed = u.reject(compressed, step => isContainedByRivalStep(compressed, step)); return compressed; @@ -9337,18 +9664,19 @@ let options = parseTargetAndOptions(args); let testFn; let { - reason + reason, + newLayer } = options; let elements; if (options.target) { elements = getAll(options.target, options); testFn = request => request.isPartOfSubtree(elements); - reason || (reason = 'Aborting requests within fragment'); + reason ||= 'Aborting requests within fragment'; } else { let layers = up.layer.getAll(options); elements = u.map(layers, 'element'); testFn = request => u.contains(layers, request.layer); - reason || (reason = 'Aborting requests within ' + layers.join(', ')); + reason ||= 'Aborting requests within ' + layers.join(', '); } let testFnWithAbortable = request => request.abortable && testFn(request); up.network.abort(testFnWithAbortable, { @@ -9357,6 +9685,7 @@ }); for (let element of elements) { up.emit(element, 'up:fragment:aborted', { + newLayer, log: false }); } @@ -9419,6 +9748,7 @@ splitTarget, parseTargetSteps, isAlive, + isNotDestroying, targetForSteps, compressNestedSteps }; @@ -9431,25 +9761,25 @@ u.delegate(up, ['context'], () => up.layer.current); /***/ - }, /* 88 */ + }), ( /* 87 */ /***/(__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ - }, /* 89 */ + }), ( /* 88 */ /***/(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - __webpack_require__(90); + __webpack_require__(89); up.viewport = function () { const u = up.util; const e = up.element; const f = up.fragment; const config = new up.Config(() => ({ viewportSelectors: ['[up-viewport]', '[up-fixed]'], - fixedTop: ['[up-fixed~=top]'], - fixedBottom: ['[up-fixed~=bottom]'], - anchoredRight: ['[up-anchored~=right]', '[up-fixed~=top]', '[up-fixed~=bottom]', '[up-fixed~=right]'], + fixedTopSelectors: ['[up-fixed~=top]'], + fixedBottomSelectors: ['[up-fixed~=bottom]'], + anchoredRightSelectors: ['[up-anchored~=right]', '[up-fixed~=top]', '[up-fixed~=bottom]', '[up-fixed~=right]'], revealSnap: 200, revealPadding: 0, revealTop: false, @@ -9457,15 +9787,16 @@ return 0.5 * window.innerHeight; } })); + const bodyShifter = new up.BodyShifter(); function reset() { config.reset(); } - function anchoredRight() { - const selector = config.anchoredRight.join(','); - return f.all(selector, { - layer: 'root' - }); + function fullAnchoredRightSelector() { + return config.anchoredRightSelectors.join(); } + up.compiler(fullAnchoredRightSelector, function (element) { + return bodyShifter.onAnchoredElementInserted(element); + }); function reveal(element, options) { options = u.options(options); element = f.get(element, options); @@ -9509,7 +9840,7 @@ } } function allSelector() { - return [rootSelector(), ...config.viewportSelectors].join(','); + return [rootSelector(), ...config.viewportSelectors].join(); } function closest(target, options = {}) { const element = f.get(target, options); @@ -9576,8 +9907,8 @@ return up.fragment.tryToTarget(viewport); } function fixedElements(root = document) { - const queryParts = ['[up-fixed]'].concat(config.fixedTop).concat(config.fixedBottom); - return root.querySelectorAll(queryParts.join(',')); + const queryParts = ['[up-fixed]'].concat(config.fixedTopSelectors).concat(config.fixedBottomSelectors); + return root.querySelectorAll(queryParts.join()); } function saveScroll(...args) { const [viewports, options] = parseOptions(args); @@ -9700,7 +10031,7 @@ } function firstHashTarget(hash, options = {}) { if (hash = pureHash(hash)) { - const selector = [e.attrSelector('id', hash), 'a' + e.attrSelector('name', hash)].join(','); + const selector = [e.attrSelector('id', hash), 'a' + e.attrSelector('name', hash)].join(); return f.get(selector, options); } } @@ -9758,27 +10089,27 @@ resetScroll, saveFocus, restoreFocus, - anchoredRight, absolutize, focus: doFocus, tryFocus, newStateCache, focusedElementWithin, - copyCursorProps + copyCursorProps, + bodyShifter }; }(); up.focus = up.viewport.focus; up.reveal = up.viewport.reveal; /***/ - }, /* 90 */ + }), ( /* 89 */ /***/(__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ - }, /* 91 */ + }), ( /* 90 */ /***/() => { up.motion = function () { const u = up.util; @@ -9792,7 +10123,7 @@ enabled: !matchMedia('(prefers-reduced-motion: reduce)').matches })); function pickDefault(registry) { - return u.pickBy(registry, value => value.isDefault); + return u.pickBy(registry, 'isDefault'); } function reset() { motionController.reset(); @@ -9806,8 +10137,9 @@ function animate(element, animation, options) { element = up.fragment.get(element); options = u.options(options); - const animationFn = findAnimationFn(animation); + let animationFn = findAnimationFn(animation); const willRun = willAnimate(element, animation, options); + animationFn = up.error.guardFn(animationFn); if (willRun) { const runNow = () => animationFn(element, options); return motionController.startFunction(element, runNow, options); @@ -9834,8 +10166,8 @@ return cssTransition.start(); } function applyConfig(options) { - options.easing || (options.easing = config.easing); - options.duration || (options.duration = config.duration); + options.easing ||= config.easing; + options.duration ||= config.duration; } function findNamedAnimation(name) { return namedAnimations[name] || up.fail("Unknown animation %o", name); @@ -9848,8 +10180,9 @@ applyConfig(options); oldElement = up.fragment.get(oldElement); newElement = up.fragment.get(newElement); - const transitionFn = findTransitionFn(transitionObject); + let transitionFn = findTransitionFn(transitionObject); const willMorph = willAnimate(oldElement, transitionFn, options); + transitionFn = up.error.guardFn(transitionFn); const beforeStart = u.pluckKey(options, 'beforeStart') || u.noop; const afterInsert = u.pluckKey(options, 'afterInsert') || u.noop; const beforeDetach = u.pluckKey(options, 'beforeDetach') || u.noop; @@ -9860,7 +10193,7 @@ if (motionController.isActive(oldElement) && options.trackMotion === false) { return transitionFn(oldElement, newElement, options); } - up.puts('up.morph()', 'Morphing %o to %o with transition %O', oldElement, newElement, transitionObject); + up.puts('up.morph()', 'Morphing %o to %o with transition %O over %d ms', oldElement, newElement, transitionObject, options.duration); const viewport = up.viewport.get(oldElement); const scrollTopBeforeReveal = viewport.scrollTop; const oldRemote = up.viewport.absolutize(oldElement, { @@ -9903,7 +10236,7 @@ return findTransitionFn(namedTransition); } } else { - return up.fail("Unknown transition %o", object); + up.fail("Unknown transition %o", object); } } function composeTransitionFn(oldAnimation, newAnimation) { @@ -9923,12 +10256,21 @@ } else if (u.isOptions(object)) { return (element, options) => animateNow(element, object, options); } else { - return up.fail('Unknown animation %o', object); + up.fail('Unknown animation %o', object); } } const swapElementsDirectly = up.mockable(function (oldElement, newElement) { oldElement.replaceWith(newElement); }); + function motionOptions(element, options, parserOptions) { + options = u.options(options); + let parser = new up.OptionsParser(element, options, parserOptions); + parser.booleanOrString('animation'); + parser.booleanOrString('transition'); + parser.string('easing'); + parser.number('duration'); + return options; + } function registerTransition(name, transition) { const fn = findTransitionFn(transition); fn.isDefault = up.framework.evaling; @@ -10024,7 +10366,8 @@ isEnabled, isNone, willAnimate, - swapElementsDirectly + swapElementsDirectly, + motionOptions }; }(); up.transition = up.motion.transition; @@ -10033,21 +10376,17 @@ up.animate = up.motion.animate; /***/ - }, /* 92 */ + }), ( /* 91 */ /***/(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - __webpack_require__(93); + __webpack_require__(92); const u = up.util; up.network = function () { const config = new up.Config(() => ({ - concurrency() { - return shouldReduceRequests() ? 3 : 6; - }, + concurrency: 6, wrapMethod: true, cacheSize: 70, cacheExpireAge: 15 * 1000, cacheEvictAge: 90 * 60 * 1000, - badDownlink: 0.6, - badRTT: 750, badResponseTime: 400, fail(response) { return (response.status < 200 || response.status > 299) && response.status !== 304; @@ -10140,12 +10479,6 @@ function loadPage(requestsAttrs) { new up.Request(requestsAttrs).loadPage(); } - function shouldReduceRequests() { - let netInfo = navigator.connection; - if (netInfo) { - return netInfo.rtt && netInfo.rtt > config.badRTT || netInfo.downlink && netInfo.downlink < config.badDownlink; - } - } function abortRequests(...args) { up.migrate.preprocessAbortArgs?.(args); queue.abort(...args); @@ -10182,7 +10515,6 @@ abort: abortRequests, registerAliasForRedirect, queue, - shouldReduceRequests, loadPage }; }(); @@ -10190,16 +10522,16 @@ up.cache = up.network.cache; /***/ - }, /* 93 */ + }), ( /* 92 */ /***/(__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ - }, /* 94 */ + }), ( /* 93 */ /***/(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - __webpack_require__(95); + __webpack_require__(94); const u = up.util; const e = up.element; up.layer = function () { @@ -10287,7 +10619,7 @@ options.layer = 'new'; const openMethod = match[1]; const shorthandMode = match[3]; - options.mode || (options.mode = shorthandMode || config.mode); + options.mode ||= shorthandMode || config.mode; if (openMethod === 'swap') { if (up.layer.isOverlay()) { options.baseLayer = 'parent'; @@ -10329,7 +10661,7 @@ if (handleDeprecatedConfig) { configs.forEach(handleDeprecatedConfig); } - options.openAnimation ?? (options.openAnimation = u.pluckKey(options, 'animation')); + options.openAnimation ??= u.pluckKey(options, 'animation'); options = u.mergeDefined(...configs, { mode, stack @@ -10374,7 +10706,7 @@ }); } function anySelector() { - return u.map(LAYER_CLASSES, Class => Class.selector()).join(','); + return u.map(LAYER_CLASSES, Class => Class.selector()).join(); } function optionToString(option) { if (u.isString(option)) { @@ -10384,7 +10716,7 @@ } } function isWithinForeignOverlay(element) { - let selector = config.foreignOverlaySelectors.join(','); + let selector = config.foreignOverlaySelectors.join(); return !!(selector && element.closest(selector)); } up.on('up:fragment:destroyed', function () { @@ -10406,7 +10738,7 @@ anySelector, optionToString, get stack() { - return stack; + return stack.layers; }, isWithinForeignOverlay }; @@ -10416,16 +10748,16 @@ }(); /***/ - }, /* 95 */ + }), ( /* 94 */ /***/(__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ - }, /* 96 */ + }), ( /* 95 */ /***/(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - __webpack_require__(97); + __webpack_require__(96); up.link = function () { const u = up.util; const e = up.element; @@ -10445,26 +10777,25 @@ preloadSelectors: combineFollowableSelectors(LINKS_WITH_REMOTE_HTML, ['[up-preload]']), noPreloadSelectors: ['[up-preload=false]'], clickableSelectors: LINKS_WITH_LOCAL_HTML.concat(['[up-emit]', '[up-accept]', '[up-dismiss]', '[up-clickable]']), - preloadDelay: 90, - preloadEnabled: 'auto' + preloadDelay: 90 })); function fullFollowSelector() { - return config.followSelectors.join(','); + return config.followSelectors.join(); } function fullPreloadSelector() { - return config.preloadSelectors.join(','); + return config.preloadSelectors.join(); } function fullInstantSelector() { - return config.instantSelectors.join(','); + return config.instantSelectors.join(); } function fullClickableSelector() { - return config.clickableSelectors.join(','); + return config.clickableSelectors.join(); } function isFollowDisabled(link) { - return link.matches(config.noFollowSelectors.join(',')) || u.isCrossOrigin(link); + return link.matches(config.noFollowSelectors.join()) || u.isCrossOrigin(link); } function isPreloadDisabled(link) { - return !up.browser.canPushState() || link.matches(config.noPreloadSelectors.join(',')) || isFollowDisabled(link) || !willCache(link); + return !up.browser.canPushState() || link.matches(config.noPreloadSelectors.join()) || isFollowDisabled(link) || !willCache(link); } function willCache(link) { const options = parseRequestOptions(link); @@ -10478,7 +10809,7 @@ } } function isInstantDisabled(link) { - return link.matches(config.noInstantSelectors.join(',')) || isFollowDisabled(link); + return link.matches(config.noInstantSelectors.join()) || isFollowDisabled(link); } function reset() { lastMousedownTarget = null; @@ -10490,7 +10821,10 @@ }); function parseRequestOptions(link, options, parserOptions) { options = u.options(options); - const parser = new up.OptionsParser(link, options, parserOptions); + const parser = new up.OptionsParser(link, options, { + ...parserOptions, + fail: false + }); options.url = followURL(link, options); options.method = followMethod(link, options); parser.json('headers'); @@ -10509,14 +10843,15 @@ } function followOptions(link, options, parserOptions) { link = up.fragment.get(link); - options = parseRequestOptions(link, options, parserOptions); + options = u.options(options); const parser = new up.OptionsParser(link, options, { fail: true, ...parserOptions }); + parser.include(parseRequestOptions); parser.boolean('feedback'); + options.origin ||= link; parser.boolean('fail'); - options.origin || (options.origin = link); parser.boolean('navigate', { default: true }); @@ -10525,6 +10860,7 @@ }); parser.string('target'); parser.booleanOrString('fallback'); + parser.string('match'); parser.string('content'); parser.string('fragment'); parser.string('document'); @@ -10573,10 +10909,8 @@ parser.booleanOrString('history'); parser.booleanOrString('location'); parser.booleanOrString('title'); - parser.booleanOrString('animation'); - parser.booleanOrString('transition'); - parser.string('easing'); - parser.number('duration'); + parser.boolean('metaTags'); + parser.include(up.motion.motionOptions); if (!options.guardEvent) { options.guardEvent = up.event.build('up:link:follow', { log: 'Following link' @@ -10601,13 +10935,10 @@ }); } function preloadIssue(link) { - if (!u.evalAutoOption(config.preloadEnabled, autoPreloadEnabled, link)) { - return 'Preloading is disabled'; - } else if (!isSafe(link)) { + if (!isSafe(link)) { return 'Will not preload an unsafe link'; } } - const autoPreloadEnabled = u.negate(up.network.shouldReduceRequests); function followMethod(link, options = {}) { return u.normalizeMethod(options.method || link.getAttribute('up-method') || link.getAttribute('data-method')); } @@ -10706,10 +11037,10 @@ let childLink = e.get(area, selector); if (childLink) { const areaAttrs = e.upAttrs(childLink); - if (!areaAttrs['up-href']) { - areaAttrs['up-href'] = childLink.getAttribute('href'); - } + areaAttrs['up-href'] ||= childLink.getAttribute('href'); e.setMissingAttrs(area, areaAttrs); + const areaClasses = e.upClasses(childLink); + area.classList.add(...areaClasses); makeFollowable(area); } }); @@ -10733,20 +11064,21 @@ config, combineFollowableSelectors, preloadSelector: fullPreloadSelector, - followSelector: fullFollowSelector + followSelector: fullFollowSelector, + preloadIssue }; }(); up.follow = up.link.follow; /***/ - }, /* 97 */ + }), ( /* 96 */ /***/(__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ - }, /* 98 */ + }), ( /* 97 */ /***/() => { up.form = function () { const u = up.util; @@ -10763,13 +11095,13 @@ watchChangeEvents: ['change'] })); function fullSubmitSelector() { - return config.submitSelectors.join(','); + return config.submitSelectors.join(); } function reset() { config.reset(); } function fieldSelector(suffix = '') { - return config.fieldSelectors.map(field => field + suffix).join(','); + return config.fieldSelectors.map(field => field + suffix).join(); } function isField(element) { return element.matches(fieldSelector()); @@ -10801,26 +11133,27 @@ return e.get(form, selector); } function submitButtonSelector() { - return config.submitButtonSelectors.join(','); + return config.submitButtonSelectors.join(); } const submit = up.mockable((form, options) => { return up.render(submitOptions(form, options)); }); function submitOptions(form, options, parserOptions) { form = getForm(form); - options = destinationOptions(form, options, parserOptions); + options = u.options(options); let parser = new up.OptionsParser(form, options, parserOptions); + parser.include(destinationOptions); parser.string('failTarget', { default: up.fragment.tryToTarget(form) }); parser.booleanOrString('disable'); - options.guardEvent || (options.guardEvent = up.event.build('up:form:submit', { + options.guardEvent ||= up.event.build('up:form:submit', { submitButton: options.submitButton, log: 'Submitting form', params: options.params - })); - options.origin || (options.origin = up.viewport.focusedElementWithin(form) || options.submitButton || form); - Object.assign(options, up.link.followOptions(form, options, parserOptions)); + }); + options.origin ||= up.viewport.focusedElementWithin(form) || options.submitButton || form; + parser.include(up.link.followOptions); return options; } function watchOptions(field, options, parserOptions = {}) { @@ -10837,11 +11170,11 @@ let config = up.form.config; if (options.event === 'input') { options.event = u.evalOption(config.watchInputEvents, field); - options.delay ?? (options.delay = config.watchInputDelay); + options.delay ??= config.watchInputDelay; } else if (options.event === 'change') { options.event = u.evalOption(config.watchChangeEvents, field); } - options.origin || (options.origin = field); + options.origin ||= field; return options; } function disableContainer(container) { @@ -10866,7 +11199,7 @@ } function raiseDisableStack(control) { if (!control.upDisableCount) { - control.upDisableCount || (control.upDisableCount = 0); + control.upDisableCount ||= 0; control.upOriginalDisabled = control.disabled; } control.upDisableCount++; @@ -10913,7 +11246,7 @@ form = getForm(form); const parser = new up.OptionsParser(form, options, parserOptions); parser.string('contentType', { - attr: ['enctype', 'up-content-type'] + attr: 'enctype' }); parser.json('headers'); const params = up.Params.fromForm(form); @@ -10921,8 +11254,8 @@ if (submitButton) { options.submitButton = submitButton; params.addField(submitButton); - options.method || (options.method = submitButton.getAttribute('formmethod')); - options.url || (options.url = submitButton.getAttribute('formaction')); + options.method ||= submitButton.getAttribute('formmethod'); + options.url ||= submitButton.getAttribute('formaction'); } params.addAll(options.params); options.params = params; @@ -10947,7 +11280,6 @@ } }); function watch(container, ...args) { - let form = getForm(container); const fields = findFields(container); const unnamedFields = u.reject(fields, 'name'); if (unnamedFields.length) { @@ -10955,7 +11287,7 @@ } const callback = u.extractCallback(args) || watchCallbackFromElement(container) || up.fail('No callback given for up.watch()'); let options = u.extractOptions(args); - const watch = new up.FieldWatcher(form, fields, options, callback); + const watch = new up.FieldWatcher(fields, options, callback); watch.start(); return () => watch.stop(); } @@ -11000,9 +11332,9 @@ function parseValidateArgs(originOrTarget, ...args) { const options = u.extractOptions(args); if (options.origin) { - options.target || (options.target = up.fragment.toTarget(originOrTarget)); + options.target ||= up.fragment.toTarget(originOrTarget); } else { - options.origin || (options.origin = up.fragment.get(originOrTarget)); + options.origin ||= up.fragment.get(originOrTarget); } return options; } @@ -11052,7 +11384,7 @@ } const switchTarget = up.mockable(function (target, fieldValues) { let show; - fieldValues || (fieldValues = switcherValues(findSwitcherForTarget(target))); + fieldValues ||= switcherValues(findSwitcherForTarget(target)); let hideValues = target.getAttribute('up-hide-for'); if (hideValues) { hideValues = parseSwitchTokens(hideValues); @@ -11094,7 +11426,7 @@ return form.matches(fullSubmitSelector()) && !isSubmitDisabled(form); } function isSubmitDisabled(form) { - return form.matches(config.noSubmitSelectors.join(',')); + return form.matches(config.noSubmitSelectors.join()); } up.on('submit', fullSubmitSelector, function (event, form) { if (event.defaultPrevented || isSubmitDisabled(form)) { @@ -11154,7 +11486,7 @@ up.validate = up.form.validate; /***/ - }, /* 99 */ + }), ( /* 98 */ /***/() => { up.feedback = function () { const u = up.util; @@ -11171,7 +11503,7 @@ const CLASS_LOADING = 'up-loading'; const SELECTOR_LINK = 'a, [up-href]'; function navSelector() { - return config.navSelectors.join(','); + return config.navSelectors.join(); } function normalizeURL(url) { if (url) { @@ -11182,7 +11514,7 @@ } } function linkURLs(link) { - return link.upFeedbackURLs || (link.upFeedbackURLs = new up.LinkFeedbackURLs(link)); + return link.upFeedbackURLs ||= new up.LinkFeedbackURLs(link); } function updateFragment(fragment) { const layerOption = { @@ -11260,7 +11592,7 @@ up.on('up:location:changed', _event => { onBrowserLocationChanged(); }); - up.on('up:fragment:inserted', (_event, newFragment) => { + up.on('up:fragment:compile', (_event, newFragment) => { updateFragment(newFragment); }); up.on('up:layer:location:changed', event => { @@ -11275,58 +11607,74 @@ }(); /***/ - }, /* 100 */ + }), ( /* 99 */ /***/() => { up.radio = function () { - const u = up.util; const e = up.element; const config = new up.Config(() => ({ hungrySelectors: ['[up-hungry]'], - pollInterval: 30000, - stretchPollInterval: interval => interval * (up.network.shouldReduceRequests() ? 2 : 1), - pollEnabled: 'auto' + pollInterval: 30000 })); function reset() { config.reset(); } - function hungrySteps({ - layer, - history, - origin - }) { - let hungrySelector = config.hungrySelectors.join(', '); - let hungries = up.fragment.all(hungrySelector, { - layer: 'any' - }); - return u.filterMap(hungries, element => { - let target = up.fragment.tryToTarget(element, { - origin + function hungrySteps(renderOptions) { + let { + useHungry, + origin, + layer: renderLayer + } = renderOptions; + let steps = { + current: [], + other: [] + }; + if (!useHungry) return steps; + let hungrySelector = config.hungrySelectors.join(); + const layerPreference = [renderLayer, ...renderLayer.ancestors, ...renderLayer.descendants]; + for (let elementLayer of layerPreference) { + let hungries = up.fragment.all(elementLayer.element, hungrySelector, { + layer: elementLayer }); - if (!target) { - up.warn('[up-hungry]', 'Ignoring untargetable fragment %o', element); - return; - } - let ifHistory = e.booleanAttr(element, 'up-if-history'); - if (ifHistory && !history) { - return; - } - let ifLayer = e.attr(element, 'up-if-layer'); - let elementLayer = up.layer.get(element); - if (ifLayer !== 'any' && layer !== elementLayer) { - return; + for (let element of hungries) { + let selector = up.fragment.tryToTarget(element, { + origin + }); + if (!selector) { + up.warn('[up-hungry]', 'Ignoring untargetable fragment %o', element); + continue; + } + let ifLayer = e.attr(element, 'up-if-layer'); + let applicableLayers = ifLayer ? up.layer.getAll(ifLayer, { + baseLayer: elementLayer + }) : [elementLayer]; + let motionOptions = up.motion.motionOptions(element); + let selectEvent = up.event.build('up:fragment:hungry', { + log: false + }); + let selectCallback = e.callbackAttr(element, 'up-on-hungry', { + exposedKeys: ['newFragment', 'renderOptions'] + }); + let step = { + selector, + oldElement: element, + layer: elementLayer, + origin, + ...motionOptions, + placement: 'swap', + useKeep: true, + maybe: true, + selectEvent, + selectCallback, + originalRenderOptions: renderOptions + }; + if (applicableLayers.includes(renderLayer)) { + let list = renderLayer === elementLayer ? steps.current : steps.other; + list.push(step); + } } - let transition = e.booleanOrStringAttr(element, 'up-transition'); - return { - selector: target, - oldElement: element, - layer: elementLayer, - origin, - transition, - placement: 'swap', - useKeep: true, - maybe: true - }; - }); + } + steps.other = up.fragment.compressNestedSteps(steps.other); + return steps; } function startPolling(fragment, options = {}) { up.FragmentPolling.forFragment(fragment).forceStart(options); @@ -11334,44 +11682,42 @@ function stopPolling(element) { up.FragmentPolling.forFragment(element).forceStop(); } - function pollIssue(fragment) { - let enabled = config.pollEnabled; - if (enabled === false) { - return 'User has disabled polling'; - } - if (enabled === 'auto') { - if (document.hidden) { - return 'Tab is hidden'; - } - if (!up.layer.get(fragment)?.isFront?.()) { - return 'Fragment is on a background layer'; - } - } - if (up.emit(fragment, 'up:fragment:poll', { - log: ['Polling fragment', fragment] - }).defaultPrevented) { - return 'User prevented up:fragment:poll event'; - } + function pollOptions(fragment, options = {}) { + const parser = new up.OptionsParser(fragment, options); + parser.number('interval', { + default: config.pollInterval + }); + parser.string('ifLayer', { + default: 'front' + }); + return options; } - up.compiler('[up-poll]', function (fragment) { - if (!up.fragment.isTargetable(fragment)) { - up.warn('[up-poll]', 'Ignoring untargetable fragment %o', fragment); - return; - } + up.compiler('[up-poll]:not([up-poll=false])', function (fragment) { up.FragmentPolling.forFragment(fragment).onPollAttributeObserved(); }); + up.macro('[up-flashes]', function (fragment) { + e.setMissingAttrs(fragment, { + 'up-hungry': '', + 'up-if-layer': 'subtree', + 'up-keep': '', + 'role': 'alert' + }); + fragment.addEventListener('up:fragment:keep', function (event) { + if (!e.isEmpty(event.newFragment)) event.preventDefault(); + }); + }); up.on('up:framework:reset', reset); return { config, hungrySteps, startPolling, stopPolling, - pollIssue + pollOptions }; }(); /***/ - }, /* 101 */ + }), ( /* 100 */ /***/() => { (function () { const e = up.element; @@ -11392,7 +11738,7 @@ /***/ } - /******/]; + /******/)]; /************************************************************************/ /******/ // The module cache /******/ @@ -11534,22 +11880,21 @@ __webpack_require__(84); __webpack_require__(85); __webpack_require__(86); - __webpack_require__(87); - __webpack_require__(89); + __webpack_require__(88); + __webpack_require__(90); __webpack_require__(91); - __webpack_require__(92); - __webpack_require__(94); - __webpack_require__(96); + __webpack_require__(93); + __webpack_require__(95); + __webpack_require__(97); __webpack_require__(98); __webpack_require__(99); __webpack_require__(100); - __webpack_require__(101); up.framework.onEvaled(); })(); /******/ })(); - }); + })(); up.compiler(".up-batch", function (element, data, meta) { var directMethods = ["get", "post"]; diff --git a/app/assets/stylesheets/super/application.css b/app/assets/stylesheets/super/application.css index 0ca1e35..35b0e35 100644 --- a/app/assets/stylesheets/super/application.css +++ b/app/assets/stylesheets/super/application.css @@ -1,5 +1,5 @@ /* -! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com +! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com *//* 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) 2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) diff --git a/frontend/super-frontend/dist/application.css b/frontend/super-frontend/dist/application.css index 0ca1e35..35b0e35 100644 --- a/frontend/super-frontend/dist/application.css +++ b/frontend/super-frontend/dist/application.css @@ -1,5 +1,5 @@ /* -! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com +! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com *//* 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) 2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) diff --git a/frontend/super-frontend/dist/application.js b/frontend/super-frontend/dist/application.js index 1ad91e8..2feb4a4 100644 --- a/frontend/super-frontend/dist/application.js +++ b/frontend/super-frontend/dist/application.js @@ -1219,26 +1219,21 @@ if (!window.customElements.get('details-dialog')) { window.customElements.define('details-dialog', DetailsDialogElement); } -function createCommonjsModule(fn) { - var module = { exports: {} }; - return fn(module, module.exports), module.exports; -} - /******/ -createCommonjsModule(function (module) { +(function () { (() => { // webpackBootstrap /******/ var __webpack_modules__ = [ /* 0 */ - , /* 1 */ + , ( /* 1 */ /***/() => { window.up = { - version: '3.3.0' + version: '3.5.2' }; /***/ - }, /* 2 */ + }), ( /* 2 */ /***/() => { up.mockable = function (originalFn) { if (window.jasmine) { @@ -1257,7 +1252,7 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 3 */ + }), ( /* 3 */ /***/() => { up.util = function () { function noop() {} @@ -1807,11 +1802,6 @@ createCommonjsModule(function (module) { function upperCaseFirst(str) { return str[0].toUpperCase() + str.slice(1); } - function defineGetter(object, prop, get) { - Object.defineProperty(object, prop, { - get - }); - } function defineDelegates(object, props, targetProvider) { for (let prop of props) { Object.defineProperty(object, prop, { @@ -1906,16 +1896,17 @@ createCommonjsModule(function (module) { }; } } - function memoizeMethod(object, propOrProps) { - for (let prop of wrapList(propOrProps)) { - let oldImpl = object[prop]; - object[prop] = function (...args) { - var _a; - let cache = this[_a = `__${prop}MemoizeCache`] || (this[_a] = {}); + function memoizeMethod(object, propLiteral) { + for (let prop in propLiteral) { + let originalDescriptor = Object.getOwnPropertyDescriptor(object, prop); + let oldImpl = originalDescriptor.value; + let cachingImpl = function (...args) { + let cache = this[`__${prop}MemoizeCache`] ||= {}; let cacheKey = JSON.stringify(args); - cache[cacheKey] || (cache[cacheKey] = buildMemoizeCacheEntry(oldImpl, this, args)); + cache[cacheKey] ||= buildMemoizeCacheEntry(oldImpl, this, args); return useMemoizeCacheEntry(cache[cacheKey]); }; + object[prop] = cachingImpl; } } function safeStringifyJSON(value) { @@ -2018,7 +2009,6 @@ createCommonjsModule(function (module) { uid, upperCaseFirst, lowerCaseFirst, - getter: defineGetter, delegate: defineDelegates, reverse, camelToKebabCase, @@ -2033,7 +2023,7 @@ createCommonjsModule(function (module) { }(); /***/ - }, /* 4 */ + }), ( /* 4 */ /***/() => { up.error = function () { function fail(...args) { @@ -2043,39 +2033,58 @@ createCommonjsModule(function (module) { return typeof error !== 'object' || error.name !== 'AbortError' && !(error instanceof up.RenderResult) && !(error instanceof up.Response); } function muteUncriticalRejection(promise) { - return promise.catch(rethrowCritical); + return promise.catch(throwCritical); } function muteUncriticalSync(block) { try { return block(); } catch (e) { - rethrowCritical(e); + throwCritical(e); } } - function rethrowCritical(value) { + function throwCritical(value) { if (isCritical(value)) { throw value; } } + function report(error) { + console.error('Uncaught %o', error); + let event = new ErrorEvent('error', { + error, + message: 'Uncaught ' + error + }); + window.dispatchEvent(event); + } + function guard(fn) { + try { + return fn(); + } catch (error) { + report(error); + } + } + function guardFn(fn) { + return (...args) => guard(() => fn(...args)); + } return { fail, - rethrowCritical, - isCritical, + throwCritical, muteUncriticalRejection, - muteUncriticalSync + muteUncriticalSync, + guard, + guardFn }; }(); up.fail = up.error.fail; /***/ - }, /* 5 */ + }), ( /* 5 */ /***/() => { up.migrate = { config: {} }; /***/ - }, /* 6 */ + }), ( /* 6 */ /***/() => { up.browser = function () { const u = up.util; @@ -2120,7 +2129,7 @@ createCommonjsModule(function (module) { }(); /***/ - }, /* 7 */ + }), ( /* 7 */ /***/(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(8); up.element = function () { @@ -2230,7 +2239,7 @@ createCommonjsModule(function (module) { function insertBefore(existingElement, newElement) { existingElement.insertAdjacentElement('beforebegin', newElement); } - function createFromSelector(selector, attrs) { + function createFromSelector(selector, attrs = {}) { let { includePath } = parseSelector(selector); @@ -2264,23 +2273,21 @@ createCommonjsModule(function (module) { previousElement?.appendChild(depthElement); previousElement = depthElement; } - if (attrs) { - let value; - if (value = u.pluckKey(attrs, 'class')) { + for (let key in attrs) { + let value = attrs[key]; + if (key === 'class') { for (let klass of u.wrapList(value)) { rootElement.classList.add(klass); } - } - if (value = u.pluckKey(attrs, 'style')) { + } else if (key === 'style') { setInlineStyle(rootElement, value); - } - if (value = u.pluckKey(attrs, 'text')) { + } else if (key === 'text') { rootElement.textContent = value; - } - if (value = u.pluckKey(attrs, 'content')) { + } else if (key === 'content') { rootElement.innerHTML = value; + } else { + rootElement.setAttribute(key, value); } - setAttrs(rootElement, attrs); } return rootElement; } @@ -2369,7 +2376,7 @@ createCommonjsModule(function (module) { return element; } const SINGLETON_TAG_NAMES = ['HTML', 'BODY', 'HEAD', 'TITLE']; - const isSingleton = up.mockable(element => element.matches(SINGLETON_TAG_NAMES.join(','))); + const isSingleton = up.mockable(element => element.matches(SINGLETON_TAG_NAMES.join())); function elementTagName(element) { return element.tagName.toLowerCase(); } @@ -2395,17 +2402,13 @@ createCommonjsModule(function (module) { function createBrokenDocumentFromHTML(html) { return new DOMParser().parseFromString(html, 'text/html'); } - function fixScriptish(scriptish) { - let clone = document.createElement(scriptish.tagName); - for (let { - name, - value - } of scriptish.attributes) { - clone.setAttribute(name, value); - } - clone.textContent = scriptish.innerHTML; + function fixParserDamage(scriptish) { + let clone = createFromHTML(scriptish.outerHTML); scriptish.replaceWith(clone); } + function disableScript(scriptElement) { + scriptElement.type = 'up-disabled-script'; + } function createFromHTML(html) { const range = document.createRange(); range.setStart(document.body, 0); @@ -2627,24 +2630,31 @@ createCommonjsModule(function (module) { function isVisible(element) { return !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length); } + function isUpPrefixed(string) { + return /^up-/.test(string); + } function upAttrs(element) { - const upAttributePattern = /^up-/; - const attrs = {}; - for (let attribute of element.attributes) { - const { - name - } = attribute; - if (name.match(upAttributePattern)) { - attrs[name] = attribute.value; - } - } - return attrs; + let attrNames = u.filter(element.getAttributeNames(), isUpPrefixed); + return u.mapObject(attrNames, name => [name, element.getAttribute(name)]); + } + function upClasses(element) { + return u.filter(element.classList.values(), isUpPrefixed); } function cleanJQuery(element) { if (up.browser.canJQuery()) { jQuery(element).remove(); } } + function filteredQuery(parent, includeSelectors, excludeSelectors) { + let fullIncludeSelector = includeSelectors.join(); + let fullExcludeSelector = excludeSelectors.join(); + let elements = parent.querySelectorAll(fullIncludeSelector); + let isExcluded = element => element.matches(fullExcludeSelector); + return u.reject(elements, isExcluded); + } + function isEmpty(element) { + return !element.children.length > 0 && !element.innerText.trim(); + } return { subtree, contains, @@ -2668,7 +2678,7 @@ createCommonjsModule(function (module) { attrSelector, tagName: elementTagName, createBrokenDocumentFromHTML, - fixScriptish, + fixParserDamage, createFromHTML, get root() { return getRoot(); @@ -2695,23 +2705,27 @@ createCommonjsModule(function (module) { setStyle: setInlineStyle, isVisible, upAttrs, + upClasses, toggleAttr, addTemporaryClass, setTemporaryAttr, cleanJQuery, - parseSelector + parseSelector, + filteredQuery, + isEmpty, + disableScript }; }(); /***/ - }, /* 8 */ + }), ( /* 8 */ /***/(__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ - }, /* 9 */ + }), ( /* 9 */ /***/() => { up.Error = class Error extends window.Error { constructor(message, props = {}) { @@ -2727,12 +2741,12 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 10 */ + }), ( /* 10 */ /***/() => { up.NotImplemented = class NotImplemented extends up.Error {}; /***/ - }, /* 11 */ + }), ( /* 11 */ /***/() => { up.Aborted = class Aborted extends up.Error { constructor(message) { @@ -2743,32 +2757,27 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 12 */ - /***/() => { - up.CannotCompile = class CannotCompile extends up.Error {}; - - /***/ - }, /* 13 */ + }), ( /* 12 */ /***/() => { up.CannotMatch = class CannotMatch extends up.Error {}; /***/ - }, /* 14 */ + }), ( /* 13 */ /***/() => { up.CannotParse = class CannotParse extends up.Error {}; /***/ - }, /* 15 */ + }), ( /* 14 */ /***/() => { up.CannotTarget = class CannotTarget extends up.Error {}; /***/ - }, /* 16 */ + }), ( /* 15 */ /***/() => { up.Offline = class Offline extends up.Error {}; /***/ - }, /* 17 */ + }), ( /* 16 */ /***/() => { const u = up.util; up.Record = class Record { @@ -2793,20 +2802,20 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 18 */ + }), ( /* 17 */ /***/() => { up.Config = class Config { constructor(blueprintFn = () => ({})) { - this.blueprintFn = blueprintFn; + this._blueprintFn = blueprintFn; this.reset(); } reset() { - Object.assign(this, this.blueprintFn()); + Object.assign(this, this._blueprintFn()); } }; /***/ - }, /* 19 */ + }), ( /* 18 */ /***/() => { let enabledKey = 'up.log.enabled'; let enabled = false; @@ -2832,7 +2841,88 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 20 */ + }), ( /* 19 */ + /***/() => { + const u = up.util; + const e = up.element; + up.OptionsParser = class OptionsParser { + constructor(element, options, parserOptions = {}) { + this._options = options; + this._element = element; + this._parserOptions = parserOptions; + this._fail = parserOptions.fail; + this._closest = parserOptions.closest; + this._attrPrefix = parserOptions.attrPrefix || 'up-'; + this._defaults = parserOptions.defaults || {}; + } + string(key, keyOptions) { + this.parse(e.attr, key, keyOptions); + } + boolean(key, keyOptions) { + this.parse(e.booleanAttr, key, keyOptions); + } + number(key, keyOptions) { + this.parse(e.numberAttr, key, keyOptions); + } + booleanOrString(key, keyOptions) { + this.parse(e.booleanOrStringAttr, key, keyOptions); + } + json(key, keyOptions) { + this.parse(e.jsonAttr, key, keyOptions); + } + callback(key, keyOptions = {}) { + let parser = (link, attr) => e.callbackAttr(link, attr, keyOptions); + this.parse(parser, key, keyOptions); + } + parse(attrValueFn, key, keyOptions = {}) { + const attrNames = u.wrapList(keyOptions.attr ?? this._attrNameForKey(key)); + let value = this._options[key]; + for (let attrName of attrNames) { + value ??= this._parseFromAttr(attrValueFn, this._element, attrName); + } + value ??= keyOptions.default ?? this._defaults[key]; + let normalizeFn = keyOptions.normalize; + if (normalizeFn) { + value = normalizeFn(value); + } + if (u.isDefined(value)) { + this._options[key] = value; + } + let failKey; + if (this._fail && (failKey = up.fragment.failKey(key))) { + const failAttrNames = u.compact(u.map(attrNames, attrName => this._deriveFailAttrName(attrName))); + this.parse(attrValueFn, failKey, { + ...keyOptions, + attr: failAttrNames + }); + } + } + include(optionsFn) { + let fnResult = optionsFn(this._element, this._options, this._parserOptions); + Object.assign(this._options, fnResult); + } + _parseFromAttr(attrValueFn, element, attrName) { + if (this._closest) { + return e.closestAttr(element, attrName, attrValueFn); + } else { + return attrValueFn(element, attrName); + } + } + _deriveFailAttrName(attr) { + return this._deriveFailAttrNameForPrefix(attr, this._attrPrefix + 'on-') || this._deriveFailAttrNameForPrefix(attr, this._attrPrefix); + } + _deriveFailAttrNameForPrefix(attr, prefix) { + if (attr.startsWith(prefix)) { + return `${prefix}fail-${attr.substring(prefix.length)}`; + } + } + _attrNameForKey(option) { + return `${this._attrPrefix}${u.camelToKebabCase(option)}`; + } + }; + + /***/ + }), ( /* 20 */ /***/() => { const u = up.util; up.FIFOCache = class FIFOCache { @@ -2840,29 +2930,29 @@ createCommonjsModule(function (module) { capacity = 10, normalizeKey = u.identity } = {}) { - this.map = new Map(); - this.capacity = capacity; - this.normalizeKey = normalizeKey; + this._map = new Map(); + this._capacity = capacity; + this._normalizeKey = normalizeKey; } get(key) { - key = this.normalizeKey(key); - return this.map.get(key); + key = this._normalizeKey(key); + return this._map.get(key); } set(key, value) { - if (this.map.size === this.capacity) { - let oldestKey = this.map.keys().next().value; - this.map.delete(oldestKey); + if (this._map.size === this._capacity) { + let oldestKey = this._map.keys().next().value; + this._map.delete(oldestKey); } - key = this.normalizeKey(key); - this.map.set(key, value); + key = this._normalizeKey(key); + this._map.set(key, value); } clear() { - this.map.clear(); + this._map.clear(); } }; /***/ - }, /* 21 */ + }), ( /* 21 */ /***/() => { up.Rect = class Rect extends up.Record { keys() { @@ -2880,67 +2970,80 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 22 */ + }), ( /* 22 */ /***/() => { const e = up.element; up.BodyShifter = class BodyShifter { constructor() { - this.unshiftFns = []; - this.reset(); + this._unshiftFns = []; + this._anchoredElements = new Set(); + this._stack = 0; } - reset() { - this.unshiftNow(); - this.shiftCount = 0; + lowerStack() { + this._stack--; + if (this._stack === 0) { + this._unshiftNow(); + } } - shift() { - this.shiftCount++; - if (this.shiftCount > 1) { - return; + raiseStack() { + this._stack++; + if (this._stack === 1) { + this._shiftNow(); } - const scrollbarTookSpace = up.viewport.rootHasReducedWidthFromScrollbar(); + } + onAnchoredElementInserted(element) { + this._anchoredElements.add(element); + if (this._isShifted()) { + this._shiftAnchoredElement(element); + } + return () => this._anchoredElements.delete(element); + } + _isShifted() { + return this._scrollbarTookSpace && this._stack > 0; + } + _shiftNow() { + this._scrollbarWidth = up.viewport.scrollbarWidth(); + this._scrollbarTookSpace = up.viewport.rootHasReducedWidthFromScrollbar(); + if (!this._scrollbarTookSpace) return; + this._shiftBody(); + for (let element of this._anchoredElements) { + this._shiftAnchoredElement(element); + } + } + _shiftBody() { const overflowElement = up.viewport.rootOverflowElement(); - this.changeStyle(overflowElement, { + this._changeStyle(overflowElement, { overflowY: 'hidden' }); - if (!scrollbarTookSpace) { - return; - } const { body } = document; - const scrollbarWidth = up.viewport.scrollbarWidth(); const bodyRightPadding = e.styleNumber(body, 'paddingRight'); - const bodyRightShift = scrollbarWidth + bodyRightPadding; - this.changeStyle(body, { + const bodyRightShift = this._scrollbarWidth + bodyRightPadding; + this._changeStyle(body, { paddingRight: bodyRightShift }); - for (let anchor of up.viewport.anchoredRight()) { - const elementRight = e.styleNumber(anchor, 'right'); - const elementRightShift = scrollbarWidth + elementRight; - this.changeStyle(anchor, { - right: elementRightShift - }); - } } - changeStyle(element, styles) { - this.unshiftFns.push(e.setTemporaryStyle(element, styles)); + _shiftAnchoredElement(element) { + const elementRight = e.styleNumber(element, 'right'); + const elementRightShift = this._scrollbarWidth + elementRight; + this._changeStyle(element, { + right: elementRightShift + }); } - unshift() { - this.shiftCount--; - if (this.shiftCount == 0) { - this.unshiftNow(); - } + _changeStyle(element, styles) { + this._unshiftFns.push(e.setTemporaryStyle(element, styles)); } - unshiftNow() { + _unshiftNow() { let unshiftFn; - while (unshiftFn = this.unshiftFns.pop()) { + while (unshiftFn = this._unshiftFns.pop()) { unshiftFn(); } } }; /***/ - }, /* 23 */ + }), ( /* 23 */ /***/() => { const u = up.util; up.Change = class Change { @@ -2966,18 +3069,17 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 24 */ + }), ( /* 24 */ /***/() => { const u = up.util; const e = up.element; up.Change.Addition = class Addition extends up.Change { constructor(options) { super(options); - this.responseDoc = options.responseDoc; - this.acceptLayer = options.acceptLayer; - this.dismissLayer = options.dismissLayer; - this.eventPlans = options.eventPlans || []; - this.response = options.meta?.response; + this._acceptLayer = options.acceptLayer; + this._dismissLayer = options.dismissLayer; + this._eventPlans = options.eventPlans || []; + this._response = options.response; } handleLayerChangeRequests() { if (this.layer.isOverlay()) { @@ -2991,7 +3093,7 @@ createCommonjsModule(function (module) { this.abortWhenLayerClosed(); } this.layer.asCurrent(() => { - for (let eventPlan of this.eventPlans) { + for (let eventPlan of this._eventPlans) { up.emit({ ...eventPlan, ...this.responseOption() @@ -3001,13 +3103,13 @@ createCommonjsModule(function (module) { }); } tryAcceptLayerFromServer() { - if (u.isDefined(this.acceptLayer) && this.layer.isOverlay()) { - this.layer.accept(this.acceptLayer, this.responseOption()); + if (u.isDefined(this._acceptLayer) && this.layer.isOverlay()) { + this.layer.accept(this._acceptLayer, this.responseOption()); } } tryDismissLayerFromServer() { - if (u.isDefined(this.dismissLayer) && this.layer.isOverlay()) { - this.layer.dismiss(this.dismissLayer, this.responseOption()); + if (u.isDefined(this._dismissLayer) && this.layer.isOverlay()) { + this.layer.dismiss(this._dismissLayer, this.responseOption()); } } abortWhenLayerClosed(layer = this.layer) { @@ -3048,44 +3150,62 @@ createCommonjsModule(function (module) { } responseOption() { return { - response: this.response + response: this._response }; } + executeSteps(steps, responseDoc, noneOptions) { + return new up.Change.UpdateSteps({ + steps, + noneOptions + }).execute(responseDoc); + } }; /***/ - }, /* 25 */ + }), ( /* 25 */ /***/() => { var _a; const u = up.util; up.RenderJob = (_a = class RenderJob { constructor(options) { this.options = up.RenderOptions.preprocess(options); - this.rendered = this.execute(); + this._rendered = this._execute(); } - async execute() { + async _execute() { try { - let result = await this.makeChange(); - this.runResultCallbacks(result); + let result = await this._makeChange(); + this._handleResult(result); return result; - } catch (error) { - this.runResultCallbacks(error) || this.options.onError?.(error); - throw error; + } catch (resultOrError) { + this._handleResult(resultOrError) || this._handleError(resultOrError); + throw resultOrError; } } - runResultCallbacks(result) { + _handleResult(result) { if (result instanceof up.RenderResult) { - if (!result.none) result.options.onRendered?.(result); - result.finished.then(result.options.onFinished, u.noop); + let { + onRendered, + onFinished + } = result.options; + if (!result.none) up.error.guard(() => onRendered?.(result)); + let guardedOnFinished = function (result) { + up.error.guard(() => onFinished?.(result)); + }; + this.finished.then(guardedOnFinished, u.noop); return true; } } + _handleError(error) { + let prefix = error instanceof up.Aborted ? 'Rendering was aborted' : 'Error while rendering'; + up.puts('up.render()', `${prefix}: ${error.name}: ${error.message}`); + up.error.guard(() => this.options.onError?.(error)); + } get finished() { - return this.awaitFinished(); + return this._awaitFinished(); } - async awaitFinished() { + async _awaitFinished() { try { - let result = await this.rendered; + let result = await this._rendered; return await result.finished; } catch (error) { if (error instanceof up.RenderResult) { @@ -3095,24 +3215,24 @@ createCommonjsModule(function (module) { } } } - makeChange() { - this.guardRender(); + _makeChange() { + this._guardRender(); if (this.options.url) { - let onRequest = request => this.handleAbortOption(request); + let onRequest = request => this._handleAbortOption(request); this.change = new up.Change.FromURL({ ...this.options, onRequest }); } else if (this.options.response) { this.change = new up.Change.FromResponse(this.options); - this.handleAbortOption(null); + this._handleAbortOption(null); } else { this.change = new up.Change.FromContent(this.options); - this.handleAbortOption(null); + this._handleAbortOption(null); } return this.change.execute(); } - guardRender() { + _guardRender() { up.browser.assertConfirmed(this.options); let guardEvent = u.pluckKey(this.options, 'guardEvent'); if (guardEvent) { @@ -3120,14 +3240,12 @@ createCommonjsModule(function (module) { if (up.emit(guardEvent, { target: this.options.origin }).defaultPrevented) { - let message = `Rendering was prevented by ${guardEvent.type} listener`; - up.puts('up.render()', message); - throw new up.Aborted(message); + throw new up.Aborted(`Rendering was prevented by ${guardEvent.type} listener`); } } up.RenderOptions.assertContentGiven(this.options); } - handleAbortOption(request) { + _handleAbortOption(request) { let { abort } = this.options; @@ -3135,11 +3253,14 @@ createCommonjsModule(function (module) { let { fragments, layer, - origin + origin, + newLayer } = this.change.getPreflightProps(); let abortOptions = { except: request, - logOnce: ['up.render()', 'Change with { abort } option will abort other requests'] + logOnce: ['up.render()', 'Change with { abort } option will abort other requests'], + newLayer, + origin }; if (abort === 'target') { up.fragment.abort(fragments, abortOptions); @@ -3158,143 +3279,171 @@ createCommonjsModule(function (module) { } else { up.fragment.abort(abort, { ...abortOptions, - layer, - origin + layer }); } } }, (() => { u.delegate(_a.prototype, ['then', 'catch', 'finally'], function () { - return this.rendered; + return this._rendered; + }); + u.memoizeMethod(_a.prototype, { + _awaitFinished: true }); })(), _a); /***/ - }, /* 26 */ + }), ( /* 26 */ /***/() => { up.Change.Removal = class Removal extends up.Change {}; /***/ - }, /* 27 */ + }), ( /* 27 */ /***/() => { up.Change.DestroyFragment = class DestroyFragment extends up.Change.Removal { constructor(options) { super(options); - this.layer = up.layer.get(options) || up.layer.current; - this.element = this.options.element; - this.animation = this.options.animation; - this.log = this.options.log; - } - async execute() { - this.parent = this.element.parentNode; - up.fragment.markAsDestroying(this.element); - if (up.motion.willAnimate(this.element, this.animation, this.options)) { - this.emitDestroyed(); - await this.animate(); - this.wipe(); - this.onFinished(); + this._layer = up.layer.get(options) || up.layer.current; + this._element = this.options.element; + this._animation = this.options.animation; + this._log = this.options.log; + } + execute() { + this._parent = this._element.parentNode; + up.fragment.markAsDestroying(this._element); + if (up.motion.willAnimate(this._element, this._animation, this.options)) { + this._destroyAfterAnimation(); } else { - this.wipe(); - this.emitDestroyed(); - this.onFinished(); + this._destroyNow(); } } - animate() { - return up.motion.animate(this.element, this.animation, this.options); + async _destroyAfterAnimation() { + this._emitDestroyed(); + await this._animate(); + this._wipe(); + this.onFinished(); } - wipe() { - this.layer.asCurrent(() => { - up.fragment.abort(this.element); - up.syntax.clean(this.element, { - layer: this.layer + _destroyNow() { + this._wipe(); + this._emitDestroyed(); + this.onFinished(); + } + _animate() { + return up.motion.animate(this._element, this._animation, this.options); + } + _wipe() { + this._layer.asCurrent(() => { + up.fragment.abort(this._element); + up.script.clean(this._element, { + layer: this._layer }); - up.element.cleanJQuery(this.element); - this.element.remove(); + up.element.cleanJQuery(this._element); + this._element.remove(); }); } - emitDestroyed() { - up.fragment.emitDestroyed(this.element, { - parent: this.parent, - log: this.log + _emitDestroyed() { + up.fragment.emitDestroyed(this._element, { + parent: this._parent, + log: this._log }); } }; /***/ - }, /* 28 */ + }), ( /* 28 */ /***/() => { let u = up.util; up.Change.OpenLayer = class OpenLayer extends up.Change.Addition { constructor(options) { super(options); this.target = options.target; - this.origin = options.origin; - this.baseLayer = options.baseLayer; + this._origin = options.origin; + this._baseLayer = options.baseLayer; } getPreflightProps() { return { mode: this.options.mode, - context: this.buildLayer().context, + context: this._buildLayer().context, origin: this.options.origin, target: this.target, - layer: this.baseLayer, + layer: this._baseLayer, fragments: u.compact([up.fragment.get(':main', { - layer: this.baseLayer - })]) + layer: this._baseLayer + })]), + newLayer: true }; } execute(responseDoc, onApplicable) { + this.responseDoc = responseDoc; + this._matchPostflight(); + onApplicable(); + this._createOverlay(); + let unbindClosing = this.layer.on('up:layer:accepting up:layer:dimissing', this._renderOtherLayers.bind(this)); + try { + this._renderOverlayContent(); + this._renderOtherLayers(); + return up.RenderResult.both(this._newOverlayResult, this._otherLayersResult); + } finally { + unbindClosing(); + } + } + _matchPostflight() { if (this.target === ':none') { - this.content = document.createElement('up-none'); + this._content = document.createElement('up-none'); } else { - this.content = responseDoc.select(this.target); + this._content = this.responseDoc.select(this.target); } - if (!this.content || this.baseLayer.isClosed()) { + if (!this._content || this._baseLayer.isClosed()) { throw new up.CannotMatch(); } - onApplicable(); + } + _createOverlay() { up.puts('up.render()', `Opening element "${this.target}" in new overlay`); - this.options.title = this.improveHistoryValue(this.options.title, responseDoc.getTitle()); - if (this.emitOpenEvent().defaultPrevented) { - throw new up.Aborted('Open event was prevented'); - } - this.layer = this.buildLayer(); - this.baseLayer.peel({ + this._assertOpenEventEmitted(); + this.layer = this._buildLayer(); + this._baseLayer.peel({ history: !this.layer.history }); up.layer.stack.push(this.layer); - this.layer.createElements(this.content); + this.layer.createElements(); this.layer.setupHandlers(); - this.handleHistory(); + } + _renderOverlayContent() { + this._handleHistory(); + this.handleLayerChangeRequests(); + this.layer.setContent(this._content); this.setReloadAttrs({ - newElement: this.content, + newElement: this._content, source: this.options.source }); - responseDoc.finalizeElement(this.content); + this.responseDoc.finalizeElement(this._content); + this._newOverlayResult = new up.RenderResult({ + layer: this.layer, + fragments: [this._content], + target: this.target + }); up.hello(this.layer.element, { ...this.options, layer: this.layer }); - this.handleLayerChangeRequests(); - this.handleScroll(); - this.renderResult = new up.RenderResult({ - layer: this.layer, - fragments: [this.content], - target: this.target - }); - this.renderResult.finished = this.finish(); + this._handleScroll(); + this._newOverlayResult.finished = this._finish(); this.layer.opening = false; - this.emitOpenedEvent(); + this._emitOpenedEvent(); this.abortWhenLayerClosed(); - return this.renderResult; } - async finish() { + _renderOtherLayers() { + if (this._otherLayersResult) return; + let otherLayerSteps = this._getHungrySteps().other; + this._otherLayersResult = this.executeSteps(otherLayerSteps, this.responseDoc); + } + async _finish() { await this.layer.startOpenAnimation(); this.abortWhenLayerClosed(); - this.handleFocus(); - return this.renderResult; + this._handleFocus(); + return this._newOverlayResult; } - buildLayer() { + _buildLayer() { const buildOptions = { ...this.options, opening: true @@ -3304,59 +3453,66 @@ createCommonjsModule(function (module) { }; return up.layer.build(buildOptions, beforeNew); } - handleHistory() { + _handleHistory() { if (this.layer.history === 'auto') { - this.layer.history = up.fragment.hasAutoHistory(this.content); + this.layer.history = up.fragment.hasAutoHistory(this._content); } - this.layer.parent.saveHistory(); + let { + parent + } = this.layer; + this.layer.history &&= parent.history; + parent.saveHistory(); this.layer.updateHistory(this.options); } - handleFocus() { - this.baseLayer.overlayFocus?.moveToBack(); + _handleFocus() { + this._baseLayer.overlayFocus?.moveToBack(); this.layer.overlayFocus.moveToFront(); const fragmentFocus = new up.FragmentFocus({ - fragment: this.content, + fragment: this._content, layer: this.layer, autoMeans: ['autofocus', 'layer'] }); fragmentFocus.process(this.options.focus); } - handleScroll() { + _handleScroll() { const scrollingOptions = { ...this.options, - fragment: this.content, + fragment: this._content, layer: this.layer, autoMeans: ['hash', 'layer'] }; const scrolling = new up.FragmentScrolling(scrollingOptions); scrolling.process(this.options.scroll); } - emitOpenEvent() { - return up.emit('up:layer:open', { - origin: this.origin, - baseLayer: this.baseLayer, + _assertOpenEventEmitted() { + up.event.assertEmitted('up:layer:open', { + origin: this._origin, + baseLayer: this._baseLayer, layerOptions: this.options, log: "Opening new overlay" }); } - emitOpenedEvent() { - return this.layer.emit('up:layer:opened', { - origin: this.origin, + _emitOpenedEvent() { + this.layer.emit('up:layer:opened', { + origin: this._origin, callback: this.layer.callback('onOpened'), log: `Opened new ${this.layer}` }); } - getHungrySteps() { - return up.radio.hungrySteps({ - layer: null, - history: this.layer && this.layer.isHistoryVisible(), - origin: this.options.origin - }); + _getHungrySteps() { + return up.radio.hungrySteps(this._getEffectiveRenderOptions()); + } + _getEffectiveRenderOptions() { + return { + ...this.options, + layer: this.layer, + history: this.layer.history + }; } }; /***/ - }, /* 29 */ + }), ( /* 29 */ /***/() => { var _a; const u = up.util; @@ -3366,40 +3522,47 @@ createCommonjsModule(function (module) { super(options); this.layer = options.layer; this.target = options.target; - this.context = options.context; - this.useKeep = options.useKeep; - this.steps = up.fragment.parseTargetSteps(this.target, this.options); + this._context = options.context; + this._steps = up.fragment.parseTargetSteps(this.target, this.options); } getPreflightProps() { - this.matchPreflight(); + this._matchPreflight(); return { layer: this.layer, mode: this.layer.mode, - context: u.merge(this.layer.context, this.context), + context: u.merge(this.layer.context, this._context), origin: this.options.origin, - target: this.bestPreflightSelector(), - fragments: this.getFragments() + target: this._bestPreflightSelector(), + fragments: this._getFragments(), + newLayer: false }; } - bestPreflightSelector() { - this.matchPreflight(); - return up.fragment.targetForSteps(this.steps); + _bestPreflightSelector() { + this._matchPreflight(); + return up.fragment.targetForSteps(this._steps); } - getFragments() { - this.matchPreflight(); - return u.map(this.steps, 'oldElement'); + _getFragments() { + this._matchPreflight(); + return u.map(this._steps, 'oldElement'); } execute(responseDoc, onApplicable) { this.responseDoc = responseDoc; - this.matchPostflight(); + this._matchPostflight(); onApplicable(); - if (this.steps.length) { - up.puts('up.render()', `Updating "${this.bestPreflightSelector()}" in ${this.layer}`); - } else { - up.puts('up.render()', 'Nothing was rendered'); + let unbindClosing = this.layer.on('up:layer:accepting up:layer:dimissing', this._renderOtherLayers.bind(this)); + try { + this._renderCurrentLayer(); + this._renderOtherLayers(); + return up.RenderResult.both(this._currentLayerResult, this._otherLayersResult); + } finally { + unbindClosing(); + } + } + _renderCurrentLayer() { + if (this._steps.length) { + up.puts('up.render()', `Updating "${this._bestPreflightSelector()}" in ${this.layer}`); } - this.options.title = this.improveHistoryValue(this.options.title, this.responseDoc.getTitle()); - this.setScrollAndFocusOptions(); + this._setScrollAndFocusOptions(); if (this.options.saveScroll) { up.viewport.saveScroll({ layer: this.layer @@ -3412,51 +3575,62 @@ createCommonjsModule(function (module) { } if (this.options.peel) { this.layer.peel({ - history: !this.hasHistory() + history: !this._hasHistory() }); } if (this.options.abort !== false) { - up.fragment.abort(this.getFragments(), { + up.fragment.abort(this._getFragments(), { reason: 'Fragment is being replaced' }); } - Object.assign(this.layer.context, this.context); - if (this.hasHistory()) { + Object.assign(this.layer.context, this._context); + if (this._hasHistory()) { this.layer.updateHistory(this.options); } this.handleLayerChangeRequests(); - let renderResult = new up.Change.UpdateSteps({ - steps: this.steps, - noneOptions: this.options - }).execute(responseDoc); - return renderResult; - } - matchPreflight() { - this.steps = this.steps.filter(step => { - const finder = new up.FragmentFinder(step); - step.oldElement || (step.oldElement = finder.find()); + this._currentLayerResult = this.executeSteps(this._steps, this.responseDoc, this.options); + } + _renderOtherLayers() { + if (this._otherLayersResult) return; + let otherLayerSteps = this._getHungrySteps().other; + this._otherLayersResult = this.executeSteps(otherLayerSteps, this.responseDoc); + } + _matchPreflight() { + this._matchOldElements(); + this._compressNestedSteps(); + } + _matchPostflight() { + this._matchOldElements(); + this._addHungryStepsOnCurrentLayer(); + this._compressNestedSteps(); + this._matchNewElements(); + } + _addHungryStepsOnCurrentLayer() { + this._steps.push(...this._getHungrySteps().current); + } + _matchOldElements() { + this._steps = this._steps.filter(step => { + const finder = new up.FragmentFinder(u.pick(step, ['selector', 'origin', 'layer', 'match', 'preferOldElements'])); + step.oldElement ||= finder.find(); if (step.oldElement) { return true; } else if (!step.maybe) { throw new up.CannotMatch(); } }); - this.steps = up.fragment.compressNestedSteps(this.steps); } - matchPostflight() { - this.matchPreflight(); - this.steps = this.responseDoc.selectSteps(this.steps); + _matchNewElements() { + this._steps = this.responseDoc.selectSteps(this._steps); } - getHungrySteps() { - return up.radio.hungrySteps({ - layer: this.layer, - history: this.hasHistory(), - origin: this.options.origin - }); + _compressNestedSteps() { + this._steps = up.fragment.compressNestedSteps(this._steps); + } + _getHungrySteps() { + return up.radio.hungrySteps(this._getEffectiveRenderOptions()); } - setScrollAndFocusOptions() { + _setScrollAndFocusOptions() { let focusCapsule = up.FocusCapsule.preserve(this.layer); - this.steps.forEach((step, i) => { + this._steps.forEach((step, i) => { step.focusCapsule = focusCapsule; if (i > 0) { step.scroll = false; @@ -3467,71 +3641,84 @@ createCommonjsModule(function (module) { } }); } - hasHistory() { - return u.evalAutoOption(this.options.history, this.hasAutoHistory.bind(this)); + _hasHistory() { + return u.evalAutoOption(this.options.history, this._hasAutoHistory.bind(this)); } - hasAutoHistory() { - const oldFragments = u.map(this.steps, 'oldElement'); + _hasAutoHistory() { + const oldFragments = u.map(this._steps, 'oldElement'); return u.some(oldFragments, up.fragment.hasAutoHistory); } + _getEffectiveRenderOptions() { + return { + ...this.options, + layer: this.layer, + history: this._hasHistory() + }; + } }, (() => { - u.memoizeMethod(_a.prototype, ['matchPreflight', 'matchPostflight', 'hasHistory']); + u.memoizeMethod(_a.prototype, { + _matchPreflight: true, + _matchOldElements: true, + _hasHistory: true, + _getHungrySteps: true + }); })(), _a); /***/ - }, /* 30 */ + }), ( /* 30 */ /***/() => { const u = up.util; const e = up.element; up.Change.UpdateSteps = class UpdateSteps extends up.Change.Addition { constructor(options) { super(options); - this.noneOptions = options.noneOptions || {}; - this.steps = u.copy(options.steps); + this._noneOptions = options.noneOptions || {}; + this._steps = u.copy(options.steps); } execute(responseDoc) { this.responseDoc = responseDoc; - this.steps = responseDoc.selectSteps(this.steps); - if (!this.steps.length) { - return this.executeNone(); + this._steps = responseDoc.selectSteps(this._steps); + this._steps = responseDoc.commitSteps(this._steps); + if (!this._steps.length) { + return this._executeNone(); } this.renderResult = new up.RenderResult({ - layer: this.steps[0]?.layer, - target: up.fragment.targetForSteps(this.steps) + layer: this._steps[0]?.layer, + target: up.fragment.targetForSteps(this._steps) }); - this.steps.reverse(); - const motionEndPromises = this.steps.map(step => this.executeStep(step)); - this.renderResult.finished = this.finish(motionEndPromises); + this._steps.reverse(); + const motionEndPromises = this._steps.map(step => this._executeStep(step)); + this.renderResult.finished = this._finish(motionEndPromises); return this.renderResult; } - executeNone() { - this.handleFocus(null, this.noneOptions); - this.handleScroll(null, this.noneOptions); + _executeNone() { + this._handleFocus(null, this._noneOptions); + this._handleScroll(null, this._noneOptions); return up.RenderResult.buildNone(); } - async finish(motionEndPromises) { + async _finish(motionEndPromises) { await Promise.all(motionEndPromises); - for (let step of this.steps) { + for (let step of this._steps) { this.abortWhenLayerClosed(step.layer); } return this.renderResult; } - addToResult(fragment) { + _addToResult(fragment) { let newFragments = fragment.matches('up-wrapper') ? fragment.children : [fragment]; this.renderResult.fragments.unshift(...newFragments); } - executeStep(step) { + _executeStep(step) { this.setReloadAttrs(step); switch (step.placement) { case 'swap': { - let keepPlan = this.findKeepPlan(step); + let keepPlan = this._findKeepPlan(step); if (keepPlan) { - this.handleFocus(step.oldElement, step); - this.handleScroll(step.oldElement, step); + this._handleFocus(step.oldElement, step); + this._handleScroll(step.oldElement, step); return Promise.resolve(); } else { - this.preserveKeepables(step); + this._preserveKeepables(step); const parent = step.oldElement.parentNode; const morphOptions = { ...step, @@ -3539,13 +3726,14 @@ createCommonjsModule(function (module) { up.fragment.markAsDestroying(step.oldElement); }, afterInsert: () => { + this._restoreKeepables(step); this.responseDoc.finalizeElement(step.newElement); - this.restoreKeepables(step); + this._unmarkKeepables(step); up.hello(step.newElement, step); - this.addToResult(step.newElement); + this._addToResult(step.newElement); }, beforeDetach: () => { - up.syntax.clean(step.oldElement, { + up.script.clean(step.oldElement, { layer: step.layer }); }, @@ -3557,8 +3745,8 @@ createCommonjsModule(function (module) { }); }, scrollNew: () => { - this.handleFocus(step.newElement, step); - this.handleScroll(step.newElement, step); + this._handleFocus(step.newElement, step); + this._handleScroll(step.newElement, step); } }; return up.morph(step.oldElement, step.newElement, step.transition, morphOptions); @@ -3575,9 +3763,9 @@ createCommonjsModule(function (module) { newElement: newWrapper, focus: false }; - return this.executeStep(wrapperStep).then(() => { + return this._executeStep(wrapperStep).then(() => { e.unwrap(newWrapper); - this.handleFocus(step.oldElement, step); + this._handleFocus(step.oldElement, step); }); } case 'before': @@ -3588,9 +3776,9 @@ createCommonjsModule(function (module) { step.oldElement.insertAdjacentElement(position, wrapper); this.responseDoc.finalizeElement(wrapper); up.hello(wrapper, step); - this.addToResult(wrapper); - this.handleFocus(wrapper, step); - this.handleScroll(wrapper, step); + this._addToResult(wrapper); + this._handleFocus(wrapper, step); + this._handleScroll(wrapper, step); return up.animate(wrapper, step.transition, step).then(() => e.unwrap(wrapper)); } default: @@ -3599,7 +3787,7 @@ createCommonjsModule(function (module) { } } } - findKeepPlan(options) { + _findKeepPlan(options) { if (!options.useKeep) { return; } @@ -3621,22 +3809,23 @@ createCommonjsModule(function (module) { } else { partner = up.fragment.subtree(newElement, partnerSelector, lookupOpts)[0]; } - if (partner && e.booleanAttr(partner, 'up-keep')) { + if (partner && e.booleanAttr(partner, 'up-keep') !== false) { const plan = { oldElement, newElement: partner, - newData: up.syntax.data(partner) + newData: up.script.data(partner), + renderOptions: options }; if (!up.fragment.emitKeep(plan).defaultPrevented) { return plan; } } } - preserveKeepables(step) { + _preserveKeepables(step) { const keepPlans = []; if (step.useKeep) { for (let keepable of step.oldElement.querySelectorAll('[up-keep]')) { - let keepPlan = this.findKeepPlan({ + let keepPlan = this._findKeepPlan({ ...step, oldElement: keepable, descendantsOnly: true @@ -3644,12 +3833,14 @@ createCommonjsModule(function (module) { if (keepPlan) { const keepableClone = keepable.cloneNode(true); keepable.insertAdjacentElement('beforebegin', keepableClone); + keepable.classList.add('up-keeping'); + u.each(e.subtree(keepPlan.newElement, 'script'), e.disableScript); let viewports = up.viewport.subtree(keepPlan.oldElement); keepPlan.revivers = viewports.map(function (viewport) { let cursorProps = up.viewport.copyCursorProps(viewport); return () => up.viewport.copyCursorProps(cursorProps, viewport); }); - if (this.willChangeElement(document.body)) { + if (this._willChangeElement(document.body)) { keepPlan.newElement.replaceWith(keepable); } else { document.body.append(keepable); @@ -3660,7 +3851,7 @@ createCommonjsModule(function (module) { } step.keepPlans = keepPlans; } - restoreKeepables(step) { + _restoreKeepables(step) { for (let keepPlan of step.keepPlans) { keepPlan.newElement.replaceWith(keepPlan.oldElement); for (let reviver of keepPlan.revivers) { @@ -3668,10 +3859,15 @@ createCommonjsModule(function (module) { } } } - willChangeElement(element) { - return u.some(this.steps, step => step.oldElement.contains(element)); + _unmarkKeepables(step) { + for (let keepPlan of step.keepPlans) { + keepPlan.oldElement.classList.remove('up-keeping'); + } + } + _willChangeElement(element) { + return u.some(this._steps, step => step.oldElement.contains(element)); } - handleFocus(fragment, options) { + _handleFocus(fragment, options) { const fragmentFocus = new up.FragmentFocus({ ...options, fragment, @@ -3679,7 +3875,7 @@ createCommonjsModule(function (module) { }); return fragmentFocus.process(options.focus); } - handleScroll(fragment, options) { + _handleScroll(fragment, options) { const scrolling = new up.FragmentScrolling({ ...options, fragment, @@ -3690,75 +3886,82 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 31 */ + }), ( /* 31 */ /***/() => { const u = up.util; up.Change.CloseLayer = class CloseLayer extends up.Change.Removal { constructor(options) { super(options); - this.verb = options.verb; - this.layer = up.layer.get(options); - this.origin = options.origin; - this.value = options.value; - this.preventable = options.preventable ?? true; - this.response = options.response; - this.history = options.history ?? true; + this._verb = options.verb; + this._layer = up.layer.get(options); + this._origin = options.origin; + this._value = options.value; + this._preventable = options.preventable ?? true; + this._response = options.response; + this._history = options.history ?? true; } execute() { - if (!this.layer.isOpen()) { + if (!this._layer.isOpen()) { return Promise.resolve(); } up.browser.assertConfirmed(this.options); - if (this.emitCloseEvent().defaultPrevented && this.preventable) { + if (this._emitCloseEvent().defaultPrevented && this._preventable) { throw new up.Aborted('Close event was prevented'); } + this._emitClosingEvent(); up.fragment.abort({ reason: 'Layer is closing', - layer: this.layer + layer: this._layer }); const { parent - } = this.layer; - this.layer.peel(); - this.layer.stack.remove(this.layer); - if (this.history) { + } = this._layer; + this._layer.peel(); + this._layer.stack.remove(this._layer); + if (this._history) { parent.restoreHistory(); } - this.handleFocus(parent); - this.layer.teardownHandlers(); - this.layer.destroyElements(this.options); - this.emitClosedEvent(parent); + this._handleFocus(parent); + this._layer.teardownHandlers(); + this._layer.destroyElements(this.options); + this._emitClosedEvent(parent); } - emitCloseEvent() { - let event = this.layer.emit(this.buildEvent(`up:layer:${this.verb}`), { - callback: this.layer.callback(`on${u.upperCaseFirst(this.verb)}`), - log: [`Will ${this.verb} ${this.layer} with value %o`, this.value] + _emitCloseEvent() { + let event = this._layer.emit(this._buildEvent(`up:layer:${this._verb}`), { + callback: this._layer.callback(`on${u.upperCaseFirst(this._verb)}`), + log: [`Will ${this._verb} ${this._layer} with value %o`, this._value] }); - this.value = event.value; + this._value = event.value; return event; } - emitClosedEvent(formerParent) { - const verbPast = `${this.verb}ed`; + _emitClosingEvent() { + let event = this._buildEvent(`up:layer:${this._verb}ing`); + this._layer.emit(event, { + log: false + }); + } + _emitClosedEvent(formerParent) { + const verbPast = `${this._verb}ed`; const verbPastUpperCaseFirst = u.upperCaseFirst(verbPast); - return this.layer.emit(this.buildEvent(`up:layer:${verbPast}`), { + return this._layer.emit(this._buildEvent(`up:layer:${verbPast}`), { baseLayer: formerParent, - callback: this.layer.callback(`on${verbPastUpperCaseFirst}`), + callback: this._layer.callback(`on${verbPastUpperCaseFirst}`), ensureBubbles: true, - log: [`${verbPastUpperCaseFirst} ${this.layer} with value %o`, this.value] + log: [`${verbPastUpperCaseFirst} ${this._layer} with value %o`, this._value] }); } - buildEvent(name) { + _buildEvent(name) { return up.event.build(name, { - layer: this.layer, - value: this.value, - origin: this.origin, - response: this.response + layer: this._layer, + value: this._value, + origin: this._origin, + response: this._response }); } - handleFocus(formerParent) { - this.layer.overlayFocus.teardown(); + _handleFocus(formerParent) { + this._layer.overlayFocus.teardown(); formerParent.overlayFocus?.moveToFront(); - let newFocusElement = this.layer.origin || formerParent.element; + let newFocusElement = this._layer.origin || formerParent.element; newFocusElement.focus({ preventScroll: true }); @@ -3766,7 +3969,7 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 32 */ + }), ( /* 32 */ /***/() => { var _a; const u = up.util; @@ -3777,32 +3980,32 @@ createCommonjsModule(function (module) { this.options.normalizeLayerOptions = false; } execute() { - let newPageReason = this.newPageReason(); - if (newPageReason) { - up.puts('up.render()', newPageReason); + let _newPageReason = this._newPageReason(); + if (_newPageReason) { + up.puts('up.render()', _newPageReason); up.network.loadPage(this.options); return u.unresolvablePromise(); } - this.request = up.request(this.getRequestAttrs()); + this.request = up.request(this._getRequestAttrs()); this.options.onRequest?.(this.request); up.feedback.showAroundRequest(this.request, this.options); up.form.disableWhile(this.request, this.options); if (this.options.preload) { return this.request; } - return u.always(this.request, responseOrError => this.onRequestSettled(responseOrError)); + return u.always(this.request, responseOrError => this._onRequestSettled(responseOrError)); } - newPageReason() { + _newPageReason() { if (u.isCrossOrigin(this.options.url)) { return 'Loading cross-origin content in new page'; } - if (!up.browser.canPushState()) { + if (this.options.history && !up.browser.canPushState()) { return 'Loading content in new page to restore history support'; } } - getRequestAttrs() { - const successAttrs = this.preflightPropsForRenderOptions(this.options); - const failAttrs = this.preflightPropsForRenderOptions(this.deriveFailOptions(), { + _getRequestAttrs() { + const successAttrs = this._preflightPropsForRenderOptions(this.options); + const failAttrs = this._preflightPropsForRenderOptions(this.deriveFailOptions(), { optional: true }); return { @@ -3812,29 +4015,29 @@ createCommonjsModule(function (module) { }; } getPreflightProps() { - return this.getRequestAttrs(); + return this._getRequestAttrs(); } - preflightPropsForRenderOptions(renderOptions, requestAttributesOptions) { + _preflightPropsForRenderOptions(renderOptions, requestAttributesOptions) { const preview = new up.Change.FromContent({ ...renderOptions, preview: true }); return preview.getPreflightProps(requestAttributesOptions); } - onRequestSettled(response) { + _onRequestSettled(response) { if (response instanceof up.Response) { - return this.onRequestSettledWithResponse(response); + return this._onRequestSettledWithResponse(response); } else { - return this.onRequestSettledWithError(response); + return this._onRequestSettledWithError(response); } } - onRequestSettledWithResponse(response) { + _onRequestSettledWithResponse(response) { return new up.Change.FromResponse({ ...this.options, response }).execute(); } - onRequestSettledWithError(error) { + _onRequestSettledWithError(error) { if (error instanceof up.Offline) { this.request.emit('up:fragment:offline', { callback: this.options.onOffline, @@ -3849,67 +4052,71 @@ createCommonjsModule(function (module) { throw error; } }, (() => { - u.memoizeMethod(_a.prototype, ['getRequestAttrs']); + u.memoizeMethod(_a.prototype, { + _getRequestAttrs: true + }); })(), _a); /***/ - }, /* 33 */ + }), ( /* 33 */ /***/() => { var _a; const u = up.util; up.Change.FromResponse = (_a = class FromResponse extends up.Change { constructor(options) { super(options); - this.response = options.response; - this.request = this.response.request; + this._response = options.response; + this._request = this._response.request; } execute() { - if (up.fragment.config.skipResponse(this.loadedEventProps())) { - this.skip(); + if (up.fragment.config.skipResponse(this._loadedEventProps())) { + this._skip(); } else { - this.request.assertEmitted('up:fragment:loaded', { - ...this.loadedEventProps(), + this._request.assertEmitted('up:fragment:loaded', { + ...this._loadedEventProps(), callback: this.options.onLoaded, - log: ['Loaded fragment from %s', this.response.description], - skip: () => this.skip() + log: ['Loaded fragment from %s', this._response.description], + skip: () => this._skip() }); } - let fail = u.evalOption(this.options.fail, this.response) ?? !this.response.ok; + let fail = u.evalOption(this.options.fail, this._response) ?? !this._response.ok; if (fail) { - throw this.updateContentFromResponse(this.deriveFailOptions()); + throw this._updateContentFromResponse(this.deriveFailOptions()); } - return this.updateContentFromResponse(this.options); + return this._updateContentFromResponse(this.options); } - skip() { - up.puts('up.render()', 'Skipping ' + this.response.description); + _skip() { + up.puts('up.render()', 'Skipping ' + this._response.description); this.options.target = ':none'; this.options.failTarget = ':none'; } - updateContentFromResponse(finalRenderOptions) { + _updateContentFromResponse(finalRenderOptions) { if (finalRenderOptions.failPrefixForced) { up.puts('up.render()', 'Rendering failed response using fail-prefixed options (https://unpoly.com/failed-responses)'); } - this.augmentOptionsFromResponse(finalRenderOptions); - finalRenderOptions.meta = this.compilerPassMeta(); + this._augmentOptionsFromResponse(finalRenderOptions); + finalRenderOptions.meta = this._compilerPassMeta(); let result = new up.Change.FromContent(finalRenderOptions).execute(); result.finished = this.finish(result, finalRenderOptions); return result; } async finish(renderResult, originalRenderOptions) { renderResult = await renderResult.finished; - if (up.fragment.shouldRevalidate(this.request, this.response, originalRenderOptions)) { - renderResult = await this.revalidate(renderResult, originalRenderOptions); + if (up.fragment.shouldRevalidate(this._request, this._response, originalRenderOptions)) { + renderResult = await this._revalidate(renderResult, originalRenderOptions); } return renderResult; } - async revalidate(renderResult, originalRenderOptions) { - let target = originalRenderOptions.target; - if (/:(before|after)/.test(target)) { - up.warn('up.render()', 'Cannot revalidate cache when prepending/appending (target %s)', target); + async _revalidate(renderResult, originalRenderOptions) { + let inputTarget = originalRenderOptions.target; + let effectiveTarget = renderResult.target; + if (/:(before|after)/.test(inputTarget)) { + up.warn('up.render()', 'Cannot revalidate cache when prepending/appending (target %s)', inputTarget); } else { - up.puts('up.render()', 'Revalidating cached response for target "%s"', target); - let verifyResult = await up.reload(renderResult.target, { + up.puts('up.render()', 'Revalidating cached response for target "%s"', effectiveTarget); + let verifyResult = await up.reload(effectiveTarget, { ...originalRenderOptions, + preferOldElements: renderResult.fragments, layer: renderResult.layer, onFinished: null, scroll: false, @@ -3919,7 +4126,7 @@ createCommonjsModule(function (module) { confirm: false, feedback: false, abort: false, - expiredResponse: this.response + expiredResponse: this._response }); if (!verifyResult.none) { renderResult = verifyResult; @@ -3927,30 +4134,34 @@ createCommonjsModule(function (module) { } return renderResult; } - loadedEventProps() { + _loadedEventProps() { const { expiredResponse } = this.options; return { - request: this.request, - response: this.response, + request: this._request, + response: this._response, renderOptions: this.options, revalidating: !!expiredResponse, expiredResponse }; } - compilerPassMeta() { - return u.pick(this.loadedEventProps(), ['revalidating', 'response']); + _compilerPassMeta() { + let meta = { + revalidating: !!this.options.expiredResponse + }; + up.migrate.processCompilerPassMeta?.(meta, this._response); + return meta; } - augmentOptionsFromResponse(renderOptions) { - const responseURL = this.response.url; + _augmentOptionsFromResponse(renderOptions) { + const responseURL = this._response.url; let serverLocation = responseURL; - let hash = this.request.hash; + let hash = this._request.hash; if (hash) { renderOptions.hash = hash; serverLocation += hash; } - const isReloadable = this.response.method === 'GET'; + const isReloadable = this._response.method === 'GET'; if (isReloadable) { renderOptions.source = this.improveHistoryValue(renderOptions.source, responseURL); } else { @@ -3958,177 +4169,176 @@ createCommonjsModule(function (module) { renderOptions.history = !!renderOptions.location; } renderOptions.location = this.improveHistoryValue(renderOptions.location, serverLocation); - renderOptions.title = this.improveHistoryValue(renderOptions.title, this.response.title); - renderOptions.eventPlans = this.response.eventPlans; - let serverTarget = this.response.target; + renderOptions.title = this.improveHistoryValue(renderOptions.title, this._response.title); + renderOptions.eventPlans = this._response.eventPlans; + let serverTarget = this._response.target; if (serverTarget) { renderOptions.target = serverTarget; } - renderOptions.acceptLayer = this.response.acceptLayer; - renderOptions.dismissLayer = this.response.dismissLayer; - renderOptions.document = this.response.text; - if (this.response.none) { + renderOptions.acceptLayer = this._response.acceptLayer; + renderOptions.dismissLayer = this._response.dismissLayer; + renderOptions.document = this._response.text; + if (this._response.none) { renderOptions.target = ':none'; } - renderOptions.context = u.merge(renderOptions.context, this.response.context); - renderOptions.cspNonces = this.response.cspNonces; - renderOptions.time ?? (renderOptions.time = this.response.lastModified); - renderOptions.etag ?? (renderOptions.etag = this.response.etag); + renderOptions.context = u.merge(renderOptions.context, this._response.context); + renderOptions.cspNonces = this._response.cspNonces; + renderOptions.time ??= this._response.lastModified; + renderOptions.etag ??= this._response.etag; } }, (() => { - u.memoizeMethod(_a.prototype, ['loadedEventProps']); + u.memoizeMethod(_a.prototype, { + _loadedEventProps: true + }); })(), _a); /***/ - }, /* 34 */ + }), ( /* 34 */ /***/() => { var _a; const u = up.util; up.Change.FromContent = (_a = class FromContent extends up.Change { constructor(options) { super(options); - this.layers = u.filter(up.layer.getAll(this.options), this.isRenderableLayer); - this.origin = this.options.origin; - this.preview = this.options.preview; - this.mode = this.options.mode; - if (this.origin) { - this.originLayer = up.layer.get(this.origin); - } + this._origin = this.options.origin; + this._preview = this.options.preview; } - isRenderableLayer(layer) { - return layer === 'new' || layer.isOpen(); - } - getPlans() { - var _a; + _getPlans() { let plans = []; - if (this.options.fragment) { - (_a = this.options).target || (_a.target = this.getResponseDoc().rootSelector()); - } - this.expandIntoPlans(plans, this.layers, this.options.target); - this.expandIntoPlans(plans, this.layers, this.options.fallback); + this._lookupLayers(); + this._improveOptionsFromResponseDoc(); + this._expandIntoPlans(plans, this._layers, this.options.target); + this._expandIntoPlans(plans, this._layers, this.options.fallback); return plans; } - expandIntoPlans(plans, layers, targets) { + _isRenderableLayer(layer) { + return layer === 'new' || layer.isOpen(); + } + _lookupLayers() { + this._allLayers = up.layer.getAll(this.options); + this._layers = u.filter(this._allLayers, this._isRenderableLayer); + } + _expandIntoPlans(plans, layers, targets) { for (let layer of layers) { - for (let target of this.expandTargets(targets, layer)) { + for (let target of this._expandTargets(targets, layer)) { const props = { ...this.options, target, layer, - defaultPlacement: this.defaultPlacement() + defaultPlacement: this._defaultPlacement() }; const change = layer === 'new' ? new up.Change.OpenLayer(props) : new up.Change.UpdateLayer(props); plans.push(change); } } } - expandTargets(targets, layer) { + _expandTargets(targets, layer) { return up.fragment.expandTargets(targets, { layer, - mode: this.mode, - origin: this.origin + mode: this.options.mode, + origin: this._origin }); } execute() { if (this.options.preload) { return Promise.resolve(); } - return this.seekPlan(this.executePlan.bind(this)) || this.cannotMatchPostflightTarget(); + return this._seekPlan(this._executePlan.bind(this)) || this._cannotMatchPostflightTarget(); } - executePlan(matchedPlan) { - let result; - try { - result = matchedPlan.execute(this.getResponseDoc(), this.onPlanApplicable.bind(this, matchedPlan)); - result.options = this.options; - this.executeHungry(matchedPlan, result); - return result; - } catch (error) { - if (this.isApplicablePlanError(error)) { - this.executeHungry(matchedPlan, result); - } - throw error; - } + _executePlan(matchedPlan) { + let result = matchedPlan.execute(this._getResponseDoc(), this._onPlanApplicable.bind(this, matchedPlan)); + result.options = this.options; + return result; } - isApplicablePlanError(error) { + _isApplicablePlanError(error) { return !(error instanceof up.CannotMatch); } - executeHungry(plan, originalResult) { - if (!this.options.useHungry) return; - let hungrySteps = plan.getHungrySteps(); - let hungryResult = new up.Change.UpdateSteps({ - steps: hungrySteps - }).execute(this.getResponseDoc()); - if (originalResult) { - originalResult.fragments.push(...hungryResult.fragments); - } - } - onPlanApplicable(plan) { - let primaryPlan = this.getPlans()[0]; + _onPlanApplicable(plan) { + let primaryPlan = this._getPlans()[0]; if (plan !== primaryPlan) { up.puts('up.render()', 'Could not match primary target "%s". Updating a fallback target "%s".', primaryPlan.target, plan.target); } + let { + assets + } = this._getResponseDoc(); + if (assets) { + up.script.assertAssetsOK(assets, plan.options); + } } - getResponseDoc() { - if (this.preview) return; + _getResponseDoc() { + if (this._preview) return; const docOptions = u.pick(this.options, ['target', 'content', 'fragment', 'document', 'html', 'cspNonces', 'origin']); up.migrate.handleResponseDocOptions?.(docOptions); - if (this.defaultPlacement() === 'content') { - docOptions.target = this.firstExpandedTarget(docOptions.target); + if (this._defaultPlacement() === 'content') { + docOptions.target = this._firstExpandedTarget(docOptions.target); } return new up.ResponseDoc(docOptions); } - defaultPlacement() { + _improveOptionsFromResponseDoc() { + if (this._preview) return; + let responseDoc = this._getResponseDoc(); + if (this.options.fragment) { + this.options.target ||= responseDoc.rootSelector(); + } + this.options.title = this.improveHistoryValue(this.options.title, responseDoc.title); + this.options.metaTags = this.improveHistoryValue(this.options.metaTags, responseDoc.metaTags); + } + _defaultPlacement() { if (!this.options.document && !this.options.fragment) { return 'content'; } } - firstExpandedTarget(target) { - return this.expandTargets(target || ':main', this.layers[0])[0]; + _firstExpandedTarget(target) { + let layer = this._layers[0] || up.layer.root; + return this._expandTargets(target || ':main', layer)[0]; } getPreflightProps(opts = {}) { const getPlanProps = plan => plan.getPreflightProps(); - return this.seekPlan(getPlanProps) || opts.optional || this.cannotMatchPreflightTarget(); + return this._seekPlan(getPlanProps) || opts.optional || this._cannotMatchPreflightTarget(); } - cannotMatchPreflightTarget() { - this.cannotMatchTarget('Could not find target in current page'); + _cannotMatchPreflightTarget() { + this._cannotMatchTarget('Could not find target in current page'); } - cannotMatchPostflightTarget() { - this.cannotMatchTarget('Could not find common target in current page and response'); + _cannotMatchPostflightTarget() { + this._cannotMatchTarget('Could not find common target in current page and response'); } - cannotMatchTarget(reason) { - let message; - if (this.getPlans().length) { - const planTargets = u.uniq(u.map(this.getPlans(), 'target')); + _cannotMatchTarget(reason) { + if (this._getPlans().length) { + const planTargets = u.uniq(u.map(this._getPlans(), 'target')); const humanizedLayerOption = up.layer.optionToString(this.options.layer); - message = [reason + " (tried selectors %o in %s)", planTargets, humanizedLayerOption]; - } else if (this.layers.length) { - if (this.options.failPrefixForced) { - message = 'No target selector given for failed responses (https://unpoly.com/failed-responses)'; - } else { - message = 'No target selector given'; - } + throw new up.CannotMatch([reason + " (tried selectors %o in %s)", planTargets, humanizedLayerOption]); + } else if (this._layers.length === 0) { + this._cannotMatchLayer(); + } else if (this.options.failPrefixForced) { + throw new up.CannotMatch('No target selector given for failed responses (https://unpoly.com/failed-responses)'); } else { - message = 'Could not find a layer to render in. You may have passed a non-existing layer reference, or a detached element.'; + throw new up.CannotMatch('No target selector given'); } - throw new up.CannotMatch(message); } - seekPlan(fn) { - for (let plan of this.getPlans()) { + _cannotMatchLayer() { + throw new up.CannotMatch('Could not find a layer to render in. You may have passed an unmatchable layer reference, or a detached element.'); + } + _seekPlan(fn) { + for (let plan of this._getPlans()) { try { return fn(plan); } catch (error) { - if (this.isApplicablePlanError(error)) { + if (this._isApplicablePlanError(error)) { throw error; } } } } }, (() => { - u.memoizeMethod(_a.prototype, ['getPlans', 'getResponseDoc', 'getPreflightProps']); + u.memoizeMethod(_a.prototype, { + _getPlans: true, + _getResponseDoc: true, + getPreflightProps: true + }); })(), _a); /***/ - }, /* 35 */ + }), ( /* 35 */ /***/() => { const u = up.util; up.CompilerPass = class CompilerPass { @@ -4138,105 +4348,93 @@ createCommonjsModule(function (module) { dataMap, meta }) { - layer || (layer = up.layer.get(root) || up.layer.current); - this.root = root; - this.compilers = compilers; - this.layer = layer; - this.data = data; - this.dataMap = dataMap; - this.meta = { - layer, - ...meta - }; - this.errors = []; + layer ||= up.layer.get(root) || up.layer.current; + this._root = root; + this._compilers = compilers; + this._layer = layer; + this._data = data; + this._dataMap = dataMap; + meta ||= {}; + meta.layer = layer; + this._meta = meta; } run() { - this.layer.asCurrent(() => { + this._layer.asCurrent(() => { this.setCompileData(); - for (let compiler of this.compilers) { - this.runCompiler(compiler); + for (let compiler of this._compilers) { + this._runCompiler(compiler); } }); - if (this.errors.length) { - throw new up.CannotCompile('Errors while compiling', { - errors: this.errors - }); - } } setCompileData() { - if (this.data) { - this.root.upCompileData = this.data; + if (this._data) { + this._root.upCompileData = this._data; } - if (this.dataMap) { - for (let selector in this.dataMap) { - for (let match of this.select(selector)) { - match.upCompileData = this.dataMap[selector]; + if (this._dataMap) { + for (let selector in this._dataMap) { + for (let match of this._select(selector)) { + match.upCompileData = this._dataMap[selector]; } } } } - runCompiler(compiler) { - const matches = this.selectOnce(compiler); + _runCompiler(compiler) { + const matches = this._selectOnce(compiler); if (!matches.length) { return; } if (!compiler.isDefault) { - up.puts('up.hello()', 'Compiling %d× "%s" on %s', matches.length, compiler.selector, this.layer); + up.puts('up.hello()', 'Compiling %d× "%s" on %s', matches.length, compiler.selector, this._layer); } if (compiler.batch) { - this.compileBatch(compiler, matches); + this._compileBatch(compiler, matches); } else { for (let match of matches) { - this.compileOneElement(compiler, match); + this._compileOneElement(compiler, match); } } return up.migrate.postCompile?.(matches, compiler); } - compileOneElement(compiler, element) { + _compileOneElement(compiler, element) { const compileArgs = [element]; if (compiler.length !== 1) { - const data = up.syntax.data(element); - compileArgs.push(data, this.meta); + const data = up.script.data(element); + compileArgs.push(data, this._meta); } - const result = this.applyCompilerFunction(compiler, element, compileArgs); - let destructorOrDestructors = this.destructorPresence(result); + const result = this._applyCompilerFunction(compiler, element, compileArgs); + let destructorOrDestructors = this._destructorPresence(result); if (destructorOrDestructors) { up.destructor(element, destructorOrDestructors); } } - compileBatch(compiler, elements) { + _compileBatch(compiler, elements) { const compileArgs = [elements]; if (compiler.length !== 1) { - const dataList = u.map(elements, up.syntax.data); - compileArgs.push(dataList, this.meta); + const dataList = u.map(elements, up.script.data); + compileArgs.push(dataList, this._meta); } - const result = this.applyCompilerFunction(compiler, elements, compileArgs); - if (this.destructorPresence(result)) { + const result = this._applyCompilerFunction(compiler, elements, compileArgs); + if (this._destructorPresence(result)) { up.fail('Compilers with { batch: true } cannot return destructors'); } } - applyCompilerFunction(compiler, elementOrElements, compileArgs) { - try { - return compiler.apply(elementOrElements, compileArgs); - } catch (error) { - this.errors.push(error); - up.log.error('up.hello()', 'While compiling %o: %o', elementOrElements, error); - } + _applyCompilerFunction(compiler, elementOrElements, compileArgs) { + return up.error.guard(() => compiler.apply(elementOrElements, compileArgs)); } - destructorPresence(result) { + _destructorPresence(result) { if (u.isFunction(result) || u.isArray(result) && u.every(result, u.isFunction)) { return result; } } - select(selector) { - return up.fragment.subtree(this.root, u.evalOption(selector), { - layer: this.layer + _select(selector) { + return up.fragment.subtree(this._root, u.evalOption(selector), { + layer: this._layer }); } - selectOnce(compiler) { - let matches = this.select(compiler.selector); + _selectOnce(compiler) { + let matches = this._select(compiler.selector); return u.filter(matches, element => { - let appliedCompilers = element.upAppliedCompilers || (element.upAppliedCompilers = new Set()); + let appliedCompilers = element.upAppliedCompilers ||= new Set(); if (!appliedCompilers.has(compiler)) { appliedCompilers.add(compiler); return true; @@ -4246,154 +4444,143 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 36 */ + }), ( /* 36 */ /***/() => { const u = up.util; const e = up.element; up.CSSTransition = class CSSTransition { constructor(element, lastFrameKebab, options) { - this.element = element; - this.lastFrameKebab = lastFrameKebab; - this.lastFrameKeysKebab = Object.keys(this.lastFrameKebab); - if (u.some(this.lastFrameKeysKebab, key => key.match(/A-Z/))) { + this._element = element; + this._lastFrameKebab = lastFrameKebab; + this._lastFrameKeysKebab = Object.keys(this._lastFrameKebab); + if (u.some(this._lastFrameKeysKebab, key => key.match(/A-Z/))) { up.fail('Animation keys must be kebab-case'); } - this.finishEvent = options.finishEvent; - this.duration = options.duration; - this.easing = options.easing; - this.finished = false; + this._finishEvent = options.finishEvent; + this._duration = options.duration; + this._easing = options.easing; + this._finished = false; } start() { - if (this.lastFrameKeysKebab.length === 0) { - this.finished = true; + if (this._lastFrameKeysKebab.length === 0) { + this._finished = true; return Promise.resolve(); } - this.deferred = u.newDeferred(); - this.pauseOldTransition(); - this.startTime = new Date(); - this.startFallbackTimer(); - this.listenToFinishEvent(); - this.listenToTransitionEnd(); - this.startMotion(); - return this.deferred; + this._deferred = u.newDeferred(); + this._pauseOldTransition(); + this._startTime = new Date(); + this._startFallbackTimer(); + this._listenToFinishEvent(); + this._listenToTransitionEnd(); + this._startMotion(); + return this._deferred; } - listenToFinishEvent() { - if (this.finishEvent) { - this.stopListenToFinishEvent = up.on(this.element, this.finishEvent, this.onFinishEvent.bind(this)); + _listenToFinishEvent() { + if (this._finishEvent) { + this._stopListenToFinishEvent = up.on(this._element, this._finishEvent, this._onFinishEvent.bind(this)); } } - onFinishEvent(event) { + _onFinishEvent(event) { event.stopPropagation(); - this.finish(); + this._finish(); } - startFallbackTimer() { + _startFallbackTimer() { const timingTolerance = 100; - this.fallbackTimer = u.timer(this.duration + timingTolerance, () => { - this.finish(); + this._fallbackTimer = u.timer(this._duration + timingTolerance, () => { + this._finish(); }); } - stopFallbackTimer() { - clearTimeout(this.fallbackTimer); + _stopFallbackTimer() { + clearTimeout(this._fallbackTimer); } - listenToTransitionEnd() { - this.stopListenToTransitionEnd = up.on(this.element, 'transitionend', this.onTransitionEnd.bind(this)); + _listenToTransitionEnd() { + this._stopListenToTransitionEnd = up.on(this._element, 'transitionend', this._onTransitionEnd.bind(this)); } - onTransitionEnd(event) { - if (event.target !== this.element) { + _onTransitionEnd(event) { + if (event.target !== this._element) { return; } - const elapsed = new Date() - this.startTime; - if (elapsed <= 0.25 * this.duration) { + const elapsed = new Date() - this._startTime; + if (elapsed <= 0.25 * this._duration) { return; } const completedPropertyKebab = event.propertyName; - if (!u.contains(this.lastFrameKeysKebab, completedPropertyKebab)) { + if (!u.contains(this._lastFrameKeysKebab, completedPropertyKebab)) { return; } - this.finish(); + this._finish(); } - finish() { - if (this.finished) { + _finish() { + if (this._finished) { return; } - this.finished = true; - this.stopFallbackTimer(); - this.stopListenToFinishEvent?.(); - this.stopListenToTransitionEnd?.(); - e.concludeCSSTransition(this.element); - this.resumeOldTransition(); - this.deferred.resolve(); + this._finished = true; + this._stopFallbackTimer(); + this._stopListenToFinishEvent?.(); + this._stopListenToTransitionEnd?.(); + e.concludeCSSTransition(this._element); + this._resumeOldTransition(); + this._deferred.resolve(); } - pauseOldTransition() { - const oldTransition = e.style(this.element, ['transitionProperty', 'transitionDuration', 'transitionDelay', 'transitionTimingFunction']); + _pauseOldTransition() { + const oldTransition = e.style(this._element, ['transitionProperty', 'transitionDuration', 'transitionDelay', 'transitionTimingFunction']); if (e.hasCSSTransition(oldTransition)) { if (oldTransition.transitionProperty !== 'all') { const oldTransitionProperties = oldTransition.transitionProperty.split(/\s*,\s*/); - const oldTransitionFrameKebab = e.style(this.element, oldTransitionProperties); - this.setOldTransitionTargetFrame = e.setTemporaryStyle(this.element, oldTransitionFrameKebab); + const oldTransitionFrameKebab = e.style(this._element, oldTransitionProperties); + this._setOldTransitionTargetFrame = e.setTemporaryStyle(this._element, oldTransitionFrameKebab); } - this.setOldTransition = e.concludeCSSTransition(this.element); + this._setOldTransition = e.concludeCSSTransition(this._element); } } - resumeOldTransition() { - this.setOldTransitionTargetFrame?.(); - this.setOldTransition?.(); + _resumeOldTransition() { + this._setOldTransitionTargetFrame?.(); + this._setOldTransition?.(); } - startMotion() { - e.setStyle(this.element, { - transitionProperty: Object.keys(this.lastFrameKebab).join(', '), - transitionDuration: `${this.duration}ms`, - transitionTimingFunction: this.easing + _startMotion() { + e.setStyle(this._element, { + transitionProperty: Object.keys(this._lastFrameKebab).join(', '), + transitionDuration: `${this._duration}ms`, + transitionTimingFunction: this._easing }); - e.setStyle(this.element, this.lastFrameKebab); + e.setStyle(this._element, this._lastFrameKebab); } }; /***/ - }, /* 37 */ + }), ( /* 37 */ /***/() => { const u = up.util; up.DestructorPass = class DestructorPass { constructor(fragment, options) { - this.fragment = fragment; - this.options = options; - this.errors = []; + this._fragment = fragment; + this._options = options; } run() { - for (let cleanable of this.selectCleanables()) { + for (let cleanable of this._selectCleanables()) { let destructors = u.pluckKey(cleanable, 'upDestructors'); if (destructors) { for (let destructor of destructors) { - this.applyDestructorFunction(destructor, cleanable); + this._applyDestructorFunction(destructor, cleanable); } } cleanable.classList.remove('up-can-clean'); } - if (this.errors.length) { - throw new up.Error('Errors while destroying', { - errors: this.errors - }); - } } - selectCleanables() { + _selectCleanables() { const selectOptions = { - ...this.options, + ...this._options, destroying: true }; - return up.fragment.subtree(this.fragment, '.up-can-clean', selectOptions); + return up.fragment.subtree(this._fragment, '.up-can-clean', selectOptions); } - applyDestructorFunction(destructor, element) { - try { - destructor(); - } catch (error) { - this.errors.push(error); - up.log.error('up.destroy()', 'While destroying %o: %o', element, error); - } + _applyDestructorFunction(destructor, element) { + up.error.guard(() => destructor(element)); } }; /***/ - }, /* 38 */ + }), ( /* 38 */ /***/() => { const u = up.util; const e = up.element; @@ -4402,20 +4589,20 @@ createCommonjsModule(function (module) { return ['target', 'event', 'baseLayer', 'callback', 'log', 'ensureBubbles']; } emit() { - this.logEmission(); + this._logEmission(); if (this.baseLayer) { - this.baseLayer.asCurrent(() => this.dispatchEvent()); + this.baseLayer.asCurrent(() => this._dispatchEvent()); } else { - this.dispatchEvent(); + this._dispatchEvent(); } return this.event; } - dispatchEvent() { + _dispatchEvent() { this.target.dispatchEvent(this.event); if (this.ensureBubbles && !this.target.isConnected) { document.dispatchEvent(this.event); } - this.callback?.(this.event); + up.error.guard(() => this.callback?.(this.event)); } assertEmitted() { const event = this.emit(); @@ -4423,7 +4610,7 @@ createCommonjsModule(function (module) { throw new up.Aborted(`Event ${event.type} was prevented`); } } - logEmission() { + _logEmission() { if (!up.log.config.enabled) { return; } @@ -4454,8 +4641,8 @@ createCommonjsModule(function (module) { let layer; if (u.isGiven(options.layer)) { layer = up.layer.get(options.layer); - options.target || (options.target = layer.element); - options.baseLayer || (options.baseLayer = layer); + options.target ||= layer.element; + options.baseLayer ||= layer; } if (options.baseLayer) { options.baseLayer = up.layer.get(options.baseLayer); @@ -4469,7 +4656,7 @@ createCommonjsModule(function (module) { } if (args[0]?.preventDefault) { options.event = args[0]; - options.log ?? (options.log = args[0].log); + options.log ??= args[0].log; } else if (u.isString(args[0])) { options.event = up.event.build(args[0], options); } else { @@ -4480,7 +4667,7 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 39 */ + }), ( /* 39 */ /***/() => { const u = up.util; up.EventListener = class EventListener extends up.Record { @@ -4489,30 +4676,29 @@ createCommonjsModule(function (module) { } constructor(attributes) { super(attributes); - this.key = this.constructor.buildKey(attributes); + this._key = this.constructor._buildKey(attributes); this.isDefault = up.framework.evaling; - this.beforeBoot ?? (this.beforeBoot = this.eventType.indexOf('up:framework:') === 0); + this.beforeBoot ??= this.eventType.indexOf('up:framework:') === 0; this.nativeCallback = this.nativeCallback.bind(this); } bind() { - var _a; - const map = (_a = this.element).upEventListeners || (_a.upEventListeners = {}); - if (map[this.key]) { + const map = this.element.upEventListeners ||= {}; + if (map[this._key]) { up.fail('up.on(): The %o callback %o cannot be registered more than once', this.eventType, this.callback); } - map[this.key] = this; - this.element.addEventListener(...this.addListenerArgs()); + map[this._key] = this; + this.element.addEventListener(...this._addListenerArg()); } - addListenerArgs() { + _addListenerArg() { let options = u.compactObject(u.pick(this, ['once', 'passive'])); return [this.eventType, this.nativeCallback, options]; } unbind() { let map = this.element.upEventListeners; if (map) { - delete map[this.key]; + delete map[this._key]; } - this.element.removeEventListener(...this.addListenerArgs()); + this.element.removeEventListener(...this._addListenerArg()); } nativeCallback(event) { if (up.framework.beforeBoot && !this.beforeBoot) { @@ -4529,7 +4715,7 @@ createCommonjsModule(function (module) { const args = [event, element]; const expectedArgCount = this.callback.length; if (expectedArgCount !== 1 && expectedArgCount !== 2) { - const data = up.syntax.data(element); + const data = up.script.data(element); args.push(data); } if (this.eventType === 'click' && element.disabled) { @@ -4546,13 +4732,12 @@ createCommonjsModule(function (module) { static fromElement(attributes) { let map = attributes.element.upEventListeners; if (map) { - const key = this.buildKey(attributes); + const key = this._buildKey(attributes); return map[key]; } } - static buildKey(attributes) { - var _a; - (_a = attributes.callback).upUid || (_a.upUid = u.uid()); + static _buildKey(attributes) { + attributes.callback.upUid ||= u.uid(); return [attributes.eventType, attributes.selector, attributes.callback.upUid].join('|'); } static allNonDefault(element) { @@ -4567,7 +4752,7 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 40 */ + }), ( /* 40 */ /***/() => { const u = up.util; up.EventListenerGroup = class EventListenerGroup extends up.Record { @@ -4576,21 +4761,21 @@ createCommonjsModule(function (module) { } bind() { const unbindFns = []; - this.eachListenerAttributes(function (attrs) { + this._eachListenerAttributes(function (attrs) { const listener = new up.EventListener(attrs); listener.bind(); return unbindFns.push(listener.unbind.bind(listener)); }); return u.sequence(unbindFns); } - eachListenerAttributes(fn) { + _eachListenerAttributes(fn) { for (let element of this.elements) { for (let eventType of this.eventTypes) { - fn(this.listenerAttributes(element, eventType)); + fn(this._listenerAttributes(element, eventType)); } } } - listenerAttributes(element, eventType) { + _listenerAttributes(element, eventType) { return { ...this.attributes(), element, @@ -4598,7 +4783,7 @@ createCommonjsModule(function (module) { }; } unbind() { - this.eachListenerAttributes(function (attrs) { + this._eachListenerAttributes(function (attrs) { let listener = up.EventListener.fromElement(attrs); if (listener) { listener.unbind(); @@ -4636,20 +4821,19 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 41 */ + }), ( /* 41 */ /***/() => { const u = up.util; up.FieldWatcher = class FieldWatcher { - constructor(form, fields, options, callback) { - this.callback = callback; - this.form = form; - this.fields = fields; - this.options = options; - this.batch = options.batch; - this.unbindFns = []; - } - fieldOptions(field) { - let options = u.copy(this.options); + constructor(fields, options, callback) { + this._callback = callback; + this._fields = fields; + this._options = options; + this._batch = options.batch; + this._unbindFns = []; + } + _fieldOptions(field) { + let options = u.copy(this._options); return up.form.watchOptions(field, options, { defaults: { event: 'input' @@ -4657,78 +4841,81 @@ createCommonjsModule(function (module) { }); } start() { - this.scheduledValues = null; - this.processedValues = this.readFieldValues(); - this.currentTimer = null; - this.callbackRunning = false; - for (let field of this.fields) { - this.watchField(field); + this._scheduledValues = null; + this._processedValues = this._readFieldValues(); + this._currentTimer = null; + this._callbackRunning = false; + for (let field of this._fields) { + this._watchField(field); } } - watchField(field) { - let fieldOptions = this.fieldOptions(field); - this.unbindFns.push(up.on(field, fieldOptions.event, event => this.check(event, fieldOptions))); - this.unbindFns.push(up.fragment.onAborted(field, () => this.cancelTimer())); + _watchField(field) { + let _fieldOptions = this._fieldOptions(field); + this._unbindFns.push(up.on(field, _fieldOptions.event, event => this._check(event, _fieldOptions))); + this._unbindFns.push(up.fragment.onAborted(field, () => this._cancelTimer())); } stop() { - for (let unbindFn of this.unbindFns) unbindFn(); - this.cancelTimer(); - } - cancelTimer() { - clearTimeout(this.currentTimer); - this.currentTimer = null; - } - isAnyFieldAttached() { - return u.some(this.fields, 'isConnected'); - } - scheduleValues(values, event, fieldOptions) { - this.cancelTimer(); - this.scheduledValues = values; - let delay = u.evalOption(fieldOptions.delay, event); - this.currentTimer = u.timer(delay, () => { - this.currentTimer = null; - if (this.isAnyFieldAttached()) { - this.scheduledFieldOptions = fieldOptions; - this.requestCallback(); + for (let unbindFn of this._unbindFns) unbindFn(); + this._cancelTimer(); + } + _cancelTimer() { + clearTimeout(this._currentTimer); + this._currentTimer = null; + } + _isAnyFieldAttached() { + return u.some(this._fields, 'isConnected'); + } + _scheduleValues(values, event, _fieldOptions) { + this._cancelTimer(); + this._scheduledValues = values; + let delay = u.evalOption(_fieldOptions.delay, event); + this._currentTimer = u.timer(delay, () => { + this._currentTimer = null; + if (this._isAnyFieldAttached()) { + this.scheduledFieldOptions = _fieldOptions; + this._requestCallback(); } else { - this.scheduledValues = null; + this._scheduledValues = null; } }); } - isNewValues(values) { - return !u.isEqual(values, this.processedValues) && !u.isEqual(this.scheduledValues, values); + _isNewValues(values) { + return !u.isEqual(values, this._processedValues) && !u.isEqual(this._scheduledValues, values); } - async requestCallback() { - let fieldOptions = this.scheduledFieldOptions; - if (this.scheduledValues !== null && !this.currentTimer && !this.callbackRunning) { - const diff = this.changedValues(this.processedValues, this.scheduledValues); - this.processedValues = this.scheduledValues; - this.scheduledValues = null; - this.callbackRunning = true; + async _requestCallback() { + let _fieldOptions = this.scheduledFieldOptions; + if (this._scheduledValues !== null && !this._currentTimer && !this._callbackRunning) { + const diff = this._changedValues(this._processedValues, this._scheduledValues); + this._processedValues = this._scheduledValues; + this._scheduledValues = null; + this._callbackRunning = true; this.scheduledFieldOptions = null; let callbackOptions = { - ...fieldOptions, + ..._fieldOptions, disable: false }; const callbackReturnValues = []; - if (this.batch) { - callbackReturnValues.push(this.callback(diff, callbackOptions)); + if (this._batch) { + callbackReturnValues.push(this._runCallback(diff, callbackOptions)); } else { for (let name in diff) { const value = diff[name]; - callbackReturnValues.push(this.callback(value, name, callbackOptions)); + callbackReturnValues.push(this._runCallback(value, name, callbackOptions)); } } if (u.some(callbackReturnValues, u.isPromise)) { let callbackDone = Promise.allSettled(callbackReturnValues); - up.form.disableWhile(callbackDone, fieldOptions); + up.form.disableWhile(callbackDone, _fieldOptions); await callbackDone; } - this.callbackRunning = false; - this.requestCallback(); + this._callbackRunning = false; + this._requestCallback(); } } - changedValues(previous, next) { + _runCallback(...args) { + return up.error.guard(() => this._callback(...args)); + } + _changedValues(previous, next) { const changes = {}; let keys = Object.keys(previous); keys = keys.concat(Object.keys(next)); @@ -4742,49 +4929,49 @@ createCommonjsModule(function (module) { } return changes; } - readFieldValues() { - return up.Params.fromFields(this.fields).toObject(); + _readFieldValues() { + return up.Params.fromFields(this._fields).toObject(); } - check(event, fieldOptions) { - const values = this.readFieldValues(); - if (this.isNewValues(values)) { - this.scheduleValues(values, event, fieldOptions); + _check(event, _fieldOptions) { + const values = this._readFieldValues(); + if (this._isNewValues(values)) { + this._scheduleValues(values, event, _fieldOptions); } } }; /***/ - }, /* 42 */ + }), ( /* 42 */ /***/() => { const u = up.util; up.FormValidator = class FormValidator { constructor(form) { - this.form = form; - this.dirtySolutions = []; - this.nextRenderTimer = null; - this.rendering = false; - this.resetNextRenderPromise(); - this.honorAbort(); - } - honorAbort() { - up.fragment.onAborted(this.form, { + this._form = form; + this._dirtySolutions = []; + this._nextRenderTimer = null; + this._rendering = false; + this._resetNextRenderPromise(); + this._honorAbort(); + } + _honorAbort() { + up.fragment.onAborted(this._form, { around: true }, ({ target - }) => this.unscheduleSolutionsWithin(target)); + }) => this._unscheduleSolutionsWithin(target)); } - unscheduleSolutionsWithin(container) { - this.dirtySolutions = u.reject(this.dirtySolutions, ({ + _unscheduleSolutionsWithin(container) { + this._dirtySolutions = u.reject(this._dirtySolutions, ({ element }) => container.contains(element)); } - resetNextRenderPromise() { - this.nextRenderPromise = u.newDeferred(); + _resetNextRenderPromise() { + this._nextRenderPromise = u.newDeferred(); } watchContainer(fieldOrForm) { let { event - } = this.originOptions(fieldOrForm); + } = this._originOptions(fieldOrForm); let guard = () => up.fragment.isAlive(fieldOrForm); let callback = () => up.error.muteUncriticalRejection(this.validate({ origin: fieldOrForm @@ -4794,28 +4981,28 @@ createCommonjsModule(function (module) { }, callback); } validate(options = {}) { - let solutions = this.getSolutions(options); - this.dirtySolutions.push(...solutions); - this.scheduleNextRender(); - return this.nextRenderPromise; + let solutions = this._getSolutions(options); + this._dirtySolutions.push(...solutions); + this._scheduleNextRender(); + return this._nextRenderPromise; } - getSolutions(options) { - let solutions = this.getTargetSelectorSolutions(options) || this.getFieldSolutions(options) || this.getElementSolutions(options.origin); + _getSolutions(options) { + let solutions = this._getTargetSelectorSolutions(options) || this._getFieldSolutions(options) || this._getElementSolutions(options.origin); for (let solution of solutions) { - solution.renderOptions = this.originOptions(solution.origin, options); + solution.renderOptions = this._originOptions(solution.origin, options); solution.target = up.fragment.resolveOrigin(solution.target, solution); } return solutions; } - getFieldSolutions({ + _getFieldSolutions({ origin, ...options }) { if (up.form.isField(origin)) { - return this.getValidateAttrSolutions(origin) || this.getFormGroupSolutions(origin, options); + return this._getValidateAttrSolutions(origin) || this._getFormGroupSolutions(origin, options); } } - getFormGroupSolutions(field, { + _getFormGroupSolutions(field, { formGroup = true }) { if (!formGroup) return; @@ -4825,7 +5012,7 @@ createCommonjsModule(function (module) { return [solution]; } } - getTargetSelectorSolutions({ + _getTargetSelectorSolutions({ target, origin }) { @@ -4848,7 +5035,7 @@ createCommonjsModule(function (module) { })); } } - getElementSolutions(element) { + _getElementSolutions(element) { up.puts('up.validate()', 'Validating element %o', element); return [{ element, @@ -4856,57 +5043,57 @@ createCommonjsModule(function (module) { origin: element }]; } - getValidateAttrSolutions(field) { + _getValidateAttrSolutions(field) { let containerWithAttr = field.closest('[up-validate]'); if (containerWithAttr) { let target = containerWithAttr.getAttribute('up-validate'); - return this.getTargetSelectorSolutions({ + return this._getTargetSelectorSolutions({ target, origin: field }); } } - originOptions(element, overrideOptions) { + _originOptions(element, overrideOptions) { return up.form.watchOptions(element, overrideOptions, { defaults: { event: 'change' } }); } - scheduleNextRender() { - let solutionDelays = this.dirtySolutions.map(solution => solution.renderOptions.delay); + _scheduleNextRender() { + let solutionDelays = this._dirtySolutions.map(solution => solution.renderOptions.delay); let shortestDelay = Math.min(...solutionDelays) || 0; - this.unscheduleNextRender(); - this.nextRenderTimer = u.timer(shortestDelay, () => this.renderDirtySolutions()); + this._unscheduleNextRender(); + this._nextRenderTimer = u.timer(shortestDelay, () => this._renderDirtySolutions()); } - unscheduleNextRender() { - clearTimeout(this.nextRenderTimer); + _unscheduleNextRender() { + clearTimeout(this._nextRenderTimer); } - renderDirtySolutions() { - up.error.muteUncriticalRejection(this.doRenderDirtySolutions()); + _renderDirtySolutions() { + up.error.muteUncriticalRejection(this._doRenderDirtySolutions()); } - async doRenderDirtySolutions() { - this.dirtySolutions = u.filter(this.dirtySolutions, ({ + async _doRenderDirtySolutions() { + this._dirtySolutions = u.filter(this._dirtySolutions, ({ element, origin }) => up.fragment.isAlive(element) && up.fragment.isAlive(origin)); - if (!this.dirtySolutions.length || this.rendering) { + if (!this._dirtySolutions.length || this._rendering) { return; } - let dirtySolutions = this.dirtySolutions; - this.dirtySolutions = []; + let dirtySolutions = this._dirtySolutions; + this._dirtySolutions = []; let dirtyOrigins = u.map(dirtySolutions, 'origin'); let dirtyFields = u.flatMap(dirtyOrigins, up.form.fields); let dirtyNames = u.uniq(u.map(dirtyFields, 'name')); - let dataMap = this.buildDataMap(dirtySolutions); + let dataMap = this._buildDataMap(dirtySolutions); let dirtyRenderOptionsList = u.map(dirtySolutions, 'renderOptions'); let options = u.mergeDefined(...dirtyRenderOptionsList, { dataMap - }, up.form.destinationOptions(this.form)); + }, up.form.destinationOptions(this._form)); options.target = u.map(dirtySolutions, 'target').join(', '); options.feedback = u.some(dirtyRenderOptionsList, 'feedback'); - options.origin = this.form; - options.focus ?? (options.focus = 'keep'); + options.origin = this._form; + options.focus ??= 'keep'; options.failOptions = false; options.params = up.Params.merge(options.params, ...u.map(dirtyRenderOptionsList, 'params')); options.headers = u.merge(...u.map(dirtyRenderOptionsList, 'headers')); @@ -4916,9 +5103,9 @@ createCommonjsModule(function (module) { log: 'Validating form', params: options.params }); - this.rendering = true; - let renderingPromise = this.nextRenderPromise; - this.resetNextRenderPromise(); + this._rendering = true; + let renderingPromise = this._nextRenderPromise; + this._resetNextRenderPromise(); options.disable = false; for (let solution of dirtySolutions) { up.form.disableWhile(renderingPromise, { @@ -4930,11 +5117,11 @@ createCommonjsModule(function (module) { renderingPromise.resolve(up.render(options)); await renderingPromise; } finally { - this.rendering = false; - this.renderDirtySolutions(); + this._rendering = false; + this._renderDirtySolutions(); } } - buildDataMap(solutions) { + _buildDataMap(solutions) { let dataMap = {}; for (let solution of solutions) { let data = u.pluckKey(solution.renderOptions, 'data'); @@ -4950,24 +5137,24 @@ createCommonjsModule(function (module) { } static forElement(element) { let form = up.form.get(element); - return form.upFormValidator || (form.upFormValidator = new this(form)); + return form.upFormValidator ||= new this(form); } }; /***/ - }, /* 43 */ + }), ( /* 43 */ /***/() => { up.FocusCapsule = class FocusCapsule { constructor(target, cursorProps) { - this.target = target; - this.cursorProps = cursorProps; + this._target = target; + this._cursorProps = cursorProps; } restore(layer, options) { - let rediscoveredElement = up.fragment.get(this.target, { + let rediscoveredElement = up.fragment.get(this._target, { layer }); if (rediscoveredElement) { - up.viewport.copyCursorProps(this.cursorProps, rediscoveredElement); + up.viewport.copyCursorProps(this._cursorProps, rediscoveredElement); up.focus(rediscoveredElement, options); return true; } @@ -4983,7 +5170,7 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 44 */ + }), ( /* 44 */ /***/() => { const u = up.util; up.FragmentProcessor = class FragmentProcessor extends up.Record { @@ -5004,7 +5191,8 @@ createCommonjsModule(function (module) { return this.processArray(opt); } if (u.isFunction(opt)) { - return this.tryProcess(opt(this.fragment, this.attributes())); + let result = up.error.guard(() => opt(this.fragment, this.attributes())); + return this.tryProcess(result); } if (u.isElement(opt)) { return this.processElement(opt); @@ -5044,47 +5232,50 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 45 */ + }), ( /* 45 */ /***/() => { const DESCENDANT_SELECTOR = /^([^ >+(]+) (.+)$/; up.FragmentFinder = class FragmentFinder { constructor(options) { - this.options = options; - this.origin = options.origin; - this.selector = options.selector; - this.externalRoot = options.externalRoot; + this._options = options; + this._origin = options.origin; + this._selector = options.selector; + this._document = options.document || window.document; + this._match = options.match ?? up.fragment.config.match; + this._preferOldElements = options.preferOldElements; } find() { - return this.findAroundOrigin() || this.findInLayer(); + return this._findInPreferredElements() || this._findInRegion() || this._findFirst(); + } + _findInPreferredElements() { + if (this._preferOldElements) { + return this._preferOldElements.find(preferOldElement => this._document.contains(preferOldElement) && up.fragment.matches(preferOldElement, this._selector)); + } } - findAroundOrigin() { - if (this.origin && up.fragment.config.matchAroundOrigin && this.origin.isConnected) { - return this.findClosest() || this.findInVicinity(); + _findInRegion() { + if (this._match === 'region' && this._origin?.isConnected) { + return this._findClosest() || this._findDescendantInRegion(); } } - findClosest() { - return up.fragment.closest(this.origin, this.selector, this.options); + _findClosest() { + return up.fragment.closest(this._origin, this._selector, this._options); } - findInVicinity() { - let parts = this.selector.match(DESCENDANT_SELECTOR); + _findDescendantInRegion() { + let parts = this._selector.match(DESCENDANT_SELECTOR); if (parts) { - let parent = up.fragment.closest(this.origin, parts[1], this.options); + let parent = up.fragment.closest(this._origin, parts[1], this._options); if (parent) { return up.fragment.getDumb(parent, parts[2]); } } } - findInLayer() { - if (this.externalRoot) { - return up.fragment.subtree(this.externalRoot, this.selector, this.options)[0]; - } else { - return up.fragment.getDumb(this.selector, this.options); - } + _findFirst() { + return up.fragment.getDumb(this._document, this._selector, this._options); } }; /***/ - }, /* 46 */ + }), ( /* 46 */ /***/() => { const u = up.util; const e = up.element; @@ -5098,57 +5289,57 @@ createCommonjsModule(function (module) { processPrimitive(opt) { switch (opt) { case 'keep': - return this.restoreLostFocus(); + return this._restoreLostFocus(); case 'restore': - return this.restorePreviousFocusForLocation(); + return this._restorePreviousFocusForLocation(); case 'target': case true: - return this.focusElement(this.fragment); + return this._focusElement(this.fragment); case 'layer': - return this.focusElement(this.layer.getFocusElement()); + return this._focusElement(this.layer.getFocusElement()); case 'main': - return this.focusSelector(':main'); + return this._focusSelector(':main'); case 'hash': - return this.focusHash(); + return this._focusHash(); case 'autofocus': - return this.autofocus(); + return this._autofocus(); default: if (u.isString(opt)) { - return this.focusSelector(opt); + return this._focusSelector(opt); } } } processElement(element) { - return this.focusElement(element); + return this._focusElement(element); } resolveCondition(condition) { if (condition === 'lost') { - return this.wasFocusLost(); + return this._wasFocusLost(); } else { return super.resolveCondition(condition); } } - focusSelector(selector) { + _focusSelector(selector) { let match = this.findSelector(selector); - return this.focusElement(match); + return this._focusElement(match); } - restoreLostFocus() { - if (this.wasFocusLost()) { + _restoreLostFocus() { + if (this._wasFocusLost()) { return this.focusCapsule?.restore(this.layer, PREVENT_SCROLL_OPTIONS); } } - restorePreviousFocusForLocation() { + _restorePreviousFocusForLocation() { return up.viewport.restoreFocus({ layer: this.layer }); } - autofocus() { + _autofocus() { let autofocusElement = this.fragment && e.subtree(this.fragment, '[autofocus]')[0]; if (autofocusElement) { - return this.focusElement(autofocusElement); + return this._focusElement(autofocusElement); } } - focusElement(element) { + _focusElement(element) { if (element) { up.focus(element, { force: true, @@ -5157,124 +5348,182 @@ createCommonjsModule(function (module) { return true; } } - focusHash() { + _focusHash() { let hashTarget = up.viewport.firstHashTarget(this.hash, { layer: this.layer }); if (hashTarget) { - return this.focusElement(hashTarget); + return this._focusElement(hashTarget); } } - wasFocusLost() { + _wasFocusLost() { return !this.layer.hasFocus(); } }; /***/ - }, /* 47 */ + }), ( /* 47 */ /***/() => { const e = up.element; up.FragmentPolling = class FragmentPolling { constructor(fragment) { - this.options = {}; - this.state = 'initialized'; - this.setFragment(fragment); - this.abortable = true; + this._options = up.radio.pollOptions(fragment); + this._fragment = fragment; + up.destructor(fragment, this._onFragmentDestroyed.bind(this)); + up.fragment.onAborted(fragment, this._onFragmentAborted.bind(this)); + this._state = 'initialized'; + this._abortable = true; + this._loading = false; + this._satisfyInterval(); } static forFragment(fragment) { - return fragment.upPolling || (fragment.upPolling = new this(fragment)); + return fragment.upPolling ||= new this(fragment); } onPollAttributeObserved() { - this.start(); + this._start(); } - onFragmentDestroyed() { - this.stop(); + _onFragmentDestroyed() { + this._stop(); } - onFragmentAborted() { - if (this.abortable) { - this.stop(); - } - } - start() { - if (this.state !== 'started') { - this.state = 'started'; - this.scheduleReload(); + _start(options) { + Object.assign(this._options, options); + if (this._state !== 'started') { + if (!up.fragment.isTargetable(this._fragment)) { + up.warn('[up-poll]', 'Cannot poll untargetable fragment %o', this._fragment); + return; + } + this._state = 'started'; + this._ensureEventsBound(); + this._scheduleRemainingTime(); } } - stop() { - if (this.state === 'started') { - clearTimeout(this.reloadTimer); - this.state = 'stopped'; + _stop() { + if (this._state === 'started') { + this._clearReloadTimer(); + this._state = 'stopped'; + this.unbindEvents?.(); } } forceStart(options) { - Object.assign(this.options, options); + Object.assign(this._options, options); this.forceStarted = true; - this.start(); + this._start(); } forceStop() { - this.stop(); + this._stop(); this.forceStarted = false; } - scheduleReload(delay = this.getInterval()) { - this.reloadTimer = setTimeout(() => this.reload(), delay); + _ensureEventsBound() { + if (!this.unbindEvents) { + this.unbindEvents = up.on('visibilitychange up:layer:opened up:layer:dismissed up:layer:accepted', this._onVisibilityChange.bind(this)); + } + } + _onVisibilityChange() { + if (this._isFragmentVisible()) { + this._scheduleRemainingTime(); + } + } + _isFragmentVisible() { + return !document.hidden && (this._options.ifLayer === 'any' || this._isOnFrontLayer()); + } + _clearReloadTimer() { + clearTimeout(this.reloadTimer); + this.reloadTimer = null; + } + _scheduleRemainingTime() { + if (!this.reloadTimer && !this._loading) { + this._clearReloadTimer(); + this.reloadTimer = setTimeout(this._onTimerReached.bind(this), this._getRemainingDelay()); + } } - reload() { - if (this.state !== 'started') { + _onTimerReached() { + this.reloadTimer = null; + this._tryReload(); + } + _tryReload() { + if (this._state !== 'started') { return; } - let issue = up.radio.pollIssue(this.fragment); - if (issue) { - up.puts('[up-poll]', `Will not poll: ${issue}`); - let reconsiderDisabledDelay = Math.min(10 * 1000, this.getInterval()); - this.scheduleReload(reconsiderDisabledDelay); - } else { - this.reloadNow(); + if (!this._isFragmentVisible()) { + up.puts('[up-poll]', 'Will not poll hidden fragment'); + return; } + if (up.emit(this._fragment, 'up:fragment:poll', { + log: ['Polling fragment', this._fragment] + }).defaultPrevented) { + up.puts('[up-poll]', 'User prevented up:fragment:poll event'); + this._satisfyInterval(); + this._scheduleRemainingTime(); + return; + } + this._reloadNow(); + } + _getFullDelay() { + return this._options.interval ?? e.numberAttr(this._fragment, 'up-interval') ?? up.radio.config.pollInterval; + } + _getRemainingDelay() { + return Math.max(this._getFullDelay() - this._getFragmentAge(), 0); } - reloadNow() { + _getFragmentAge() { + return new Date() - this._lastAttempt; + } + _isOnFrontLayer() { + this.layer ||= up.layer.get(this._fragment); + return this.layer?.isFront?.(); + } + _reloadNow() { + this._clearReloadTimer(); let reloadOptions = { - url: this.options.url, + url: this._options.url, fail: false, background: true }; - let oldAbortable = this.abortable; - this.abortable = false; - up.reload(this.fragment, reloadOptions).then(this.onReloadSuccess.bind(this), this.onReloadFailure.bind(this)); - this.abortable = oldAbortable; + let oldAbortable = this._abortable; + try { + this._abortable = false; + this._loading = true; + up.reload(this._fragment, reloadOptions).then(this._onReloadSuccess.bind(this), this._onReloadFailure.bind(this)); + } finally { + this._abortable = oldAbortable; + } } - onReloadSuccess({ + _onFragmentAborted({ + newLayer + }) { + if (this._abortable && !newLayer) { + this._stop(); + } + } + _onReloadSuccess({ fragment }) { + this._loading = false; + this._satisfyInterval(); if (fragment) { - this.onFragmentSwapped(fragment); + this._onFragmentSwapped(fragment); } else { - this.scheduleReload(); + this._scheduleRemainingTime(); } } - onReloadFailure(reason) { - this.scheduleReload(); - up.error.rethrowCritical(reason); - } - onFragmentSwapped(newFragment) { - this.stop(); - if (this.forceStarted && up.fragment.matches(this.fragment, newFragment)) { - this.constructor.forFragment(newFragment).forceStart(this.options); + _onFragmentSwapped(newFragment) { + this._stop(); + if (this.forceStarted && up.fragment.matches(this._fragment, newFragment)) { + this.constructor.forFragment(newFragment).forceStart(this._options); } } - setFragment(newFragment) { - this.fragment = newFragment; - up.destructor(newFragment, () => this.onFragmentDestroyed()); - up.fragment.onAborted(newFragment, () => this.onFragmentAborted()); + _onReloadFailure(reason) { + this._loading = false; + this._satisfyInterval(); + this._scheduleRemainingTime(); + up.error.throwCritical(reason); } - getInterval() { - let interval = this.options.interval ?? e.numberAttr(this.fragment, 'up-interval') ?? up.radio.config.pollInterval; - return up.radio.config.stretchPollInterval(interval); + _satisfyInterval() { + this._lastAttempt = new Date(); } }; /***/ - }, /* 48 */ + }), ( /* 48 */ /***/() => { const u = up.util; up.FragmentScrolling = class FragmentScrolling extends up.FragmentProcessor { @@ -5284,49 +5533,49 @@ createCommonjsModule(function (module) { processPrimitive(opt) { switch (opt) { case 'reset': - return this.reset(); + return this._reset(); case 'layer': - return this.revealLayer(); + return this._revealLayer(); case 'main': - return this.revealSelector(':main'); + return this._revealSelector(':main'); case 'restore': - return this.restore(); + return this._restore(); case 'hash': return this.hash && up.viewport.revealHash(this.hash, this.attributes()); case 'target': case 'reveal': case true: - return this.revealElement(this.fragment); + return this._revealElement(this.fragment); default: if (u.isString(opt)) { - return this.revealSelector(opt); + return this._revealSelector(opt); } } } processElement(element) { - return this.revealElement(element); + return this._revealElement(element); } - revealElement(element) { + _revealElement(element) { if (element) { up.reveal(element, this.attributes()); return true; } } - revealSelector(selector) { + _revealSelector(selector) { let match = this.findSelector(selector); - return this.revealElement(match); + return this._revealElement(match); } - revealLayer() { - return this.revealElement(this.layer.getBoxElement()); + _revealLayer() { + return this._revealElement(this.layer.getBoxElement()); } - reset() { + _reset() { up.viewport.resetScroll({ ...this.attributes(), around: this.fragment }); return true; } - restore() { + _restore() { return up.viewport.restoreScroll({ ...this.attributes(), around: this.fragment @@ -5335,7 +5584,7 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 49 */ + }), ( /* 49 */ /***/() => { const e = up.element; const u = up.util; @@ -5406,8 +5655,11 @@ createCommonjsModule(function (module) { get descendants() { return this.stack.descendantsOf(this); } + get subtree() { + return [this, ...this.descendants]; + } get index() { - return this.stack.indexOf(this); + return this._index ??= this.stack.indexOf(this); } getContentElement() { return this.contentElement || this.element; @@ -5425,39 +5677,40 @@ createCommonjsModule(function (module) { return element.closest(up.layer.anySelector()) === this.element; } on(...args) { - return this.buildEventListenerGroup(args).bind(); + return this._buildEventListenerGroup(args).bind(); } off(...args) { - return this.buildEventListenerGroup(args).unbind(); + return this._buildEventListenerGroup(args).unbind(); } - buildEventListenerGroup(args) { + _buildEventListenerGroup(args) { return up.EventListenerGroup.fromBindArgs(args, { - guard: event => this.containsEventTarget(event), + guard: event => this._containsEventTarget(event), elements: [this.element], baseLayer: this }); } - containsEventTarget(event) { + _containsEventTarget(event) { return this.contains(event.target); } wasHitByMouseEvent(event) { const hittableElement = document.elementFromPoint(event.clientX, event.clientY); return !hittableElement || this.contains(hittableElement); } - buildEventEmitter(args) { + _buildEventEmitter(args) { return up.EventEmitter.fromEmitArgs(args, { layer: this }); } emit(...args) { - return this.buildEventEmitter(args).emit(); + return this._buildEventEmitter(args).emit(); } isDetached() { return !this.element.isConnected; } saveHistory() { - if (this.isHistoryVisible()) { + if (this.history) { this.savedTitle = document.title; + this.savedMetaTags = up.history.findMetaTags(); this.savedLocation = up.history.location; } } @@ -5471,6 +5724,9 @@ createCommonjsModule(function (module) { if (this.savedTitle) { document.title = this.savedTitle; } + if (this.savedMetaTags) { + up.history.updateMetaTags(this.savedMetaTags); + } } asCurrent(fn) { return this.stack.asCurrent(this, fn); @@ -5479,15 +5735,16 @@ createCommonjsModule(function (module) { if (u.isString(options.location)) { this.location = options.location; } + if (up.history.config.updateMetaTags && u.isList(options.metaTags)) { + up.migrate?.warnOfHungryMetaTags?.(options.metaTags); + this.metaTags = options.metaTags; + } if (u.isString(options.title)) { this.title = options.title; } } - isHistoryVisible() { - return this.history && (this.isRoot() || this.parent.isHistoryVisible()); - } showsLiveHistory() { - return this.isHistoryVisible() && this.isFront() && (up.history.config.enabled || this.isRoot()); + return this.history && this.isFront(); } get title() { if (this.showsLiveHistory()) { @@ -5502,6 +5759,19 @@ createCommonjsModule(function (module) { document.title = title; } } + get metaTags() { + if (this.showsLiveHistory()) { + return up.history.findMetaTags(); + } else { + return this.savedMetaTags; + } + } + set metaTags(metaTags) { + this.savedMetaTags = metaTags; + if (this.showsLiveHistory()) { + up.history.updateMetaTags(metaTags); + } + } get location() { if (this.showsLiveHistory()) { return up.history.location; @@ -5549,7 +5819,7 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 50 */ + }), ( /* 50 */ /***/() => { const e = up.element; const u = up.util; @@ -5580,7 +5850,7 @@ createCommonjsModule(function (module) { } } createElement(parentElement) { - this.nesting || (this.nesting = this.suggestVisualNesting()); + this.nesting ||= this._suggestVisualNesting(); const elementAttrs = u.compactObject(u.pick(this, ['align', 'position', 'size', 'class', 'nesting'])); this.element = this.affixPart(parentElement, null, elementAttrs); } @@ -5595,10 +5865,14 @@ createCommonjsModule(function (module) { createBoxElement(parentElement) { this.boxElement = this.affixPart(parentElement, 'box'); } - createContentElement(parentElement, content) { + createContentElement(parentElement) { this.contentElement = this.affixPart(parentElement, 'content'); - this.contentElement.appendChild(content); } + setContent(content) { + this.contentElement.append(content); + this.onContentSet(); + } + onContentSet() {} createDismissElement(parentElement) { this.dismissElement = this.affixPart(parentElement, 'dismiss', { 'up-dismiss': '":button"', @@ -5614,12 +5888,12 @@ createCommonjsModule(function (module) { static selector(part) { return u.compact(['up', this.mode, part]).join('-'); } - suggestVisualNesting() { + _suggestVisualNesting() { const { parent } = this; if (this.mode === parent.mode) { - return 1 + parent.suggestVisualNesting(); + return 1 + parent._suggestVisualNesting(); } else { return 0; } @@ -5627,26 +5901,26 @@ createCommonjsModule(function (module) { setupHandlers() { super.setupHandlers(); this.overlayFocus = new up.OverlayFocus(this); - if (this.supportsDismissMethod('button')) { + if (this._supportsDismissMethod('button')) { this.createDismissElement(this.getBoxElement()); } - if (this.supportsDismissMethod('outside')) { + if (this._supportsDismissMethod('outside')) { if (this.viewportElement) { up.on(this.viewportElement, 'up:click', event => { if (event.target === this.viewportElement) { - this.onOutsideClicked(event, true); + this._onOutsideClicked(event, true); } }); } else { this.unbindParentClicked = this.parent.on('up:click', (event, element) => { if (!up.layer.isWithinForeignOverlay(element)) { const originClicked = this.origin && this.origin.contains(element); - this.onOutsideClicked(event, originClicked); + this._onOutsideClicked(event, originClicked); } }); } } - if (this.supportsDismissMethod('key')) { + if (this._supportsDismissMethod('key')) { this.unbindEscapePressed = up.event.onEscape(event => this.onEscapePressed(event)); } this.registerClickCloser('up-accept', (value, closeOptions) => { @@ -5656,11 +5930,11 @@ createCommonjsModule(function (module) { this.dismiss(value, closeOptions); }); up.migrate.registerLayerCloser?.(this); - this.registerEventCloser(this.acceptEvent, this.accept); - this.registerEventCloser(this.dismissEvent, this.dismiss); - this.on('up:click', 'label[for]', (event, label) => this.onLabelClicked(event, label)); + this._registerEventCloser(this.acceptEvent, this.accept); + this._registerEventCloser(this.dismissEvent, this.dismiss); + this.on('up:click', 'label[for]', (event, label) => this._onLabelClicked(event, label)); } - onLabelClicked(event, label) { + _onLabelClicked(event, label) { let id = label.getAttribute('for'); let fieldSelector = up.form.fieldSelector(e.idSelector(id)); let fieldsAnywhere = up.fragment.all(fieldSelector, { @@ -5678,7 +5952,7 @@ createCommonjsModule(function (module) { } } } - onOutsideClicked(event, halt) { + _onOutsideClicked(event, halt) { up.log.putsEvent(event); if (halt) up.event.halt(event); this.dismiss(':outside', { @@ -5690,7 +5964,7 @@ createCommonjsModule(function (module) { let field = up.form.focusedField(); if (field) { field.blur(); - } else if (this.supportsDismissMethod('key')) { + } else if (this._supportsDismissMethod('key')) { up.event.halt(event, { log: true }); @@ -5717,7 +5991,7 @@ createCommonjsModule(function (module) { up.error.muteUncriticalSync(() => closeFn(value, closeOptions)); }); } - registerEventCloser(eventTypes, closeFn) { + _registerEventCloser(eventTypes, closeFn) { if (!eventTypes) { return; } @@ -5729,12 +6003,12 @@ createCommonjsModule(function (module) { }); } tryAcceptForLocation(options) { - this.tryCloseForLocation(this.acceptLocation, this.accept, options); + this._tryCloseForLocation(this.acceptLocation, this.accept, options); } tryDismissForLocation(options) { - this.tryCloseForLocation(this.dismissLocation, this.dismiss, options); + this._tryCloseForLocation(this.dismissLocation, this.dismiss, options); } - tryCloseForLocation(urlPattern, closeFn, options) { + _tryCloseForLocation(urlPattern, closeFn, options) { let location, resolution; if (urlPattern && (location = this.location) && (resolution = urlPattern.recognize(location))) { const closeValue = { @@ -5751,9 +6025,7 @@ createCommonjsModule(function (module) { this.overlayFocus.teardown(); } destroyElements(options) { - const animation = () => { - return this.startCloseAnimation(options); - }; + const animation = () => this.startCloseAnimation(options); const onFinished = () => { this.onElementsRemoved(); options.onFinished?.(); @@ -5767,7 +6039,7 @@ createCommonjsModule(function (module) { up.destroy(this.element, destroyOptions); } onElementsRemoved() {} - startAnimation(options = {}) { + _startAnimation(options = {}) { const boxDone = up.animate(this.getBoxElement(), options.boxAnimation, options); let backdropDone; if (this.backdrop && !up.motion.isNone(options.boxAnimation)) { @@ -5775,35 +6047,33 @@ createCommonjsModule(function (module) { } return Promise.all([boxDone, backdropDone]); } - startOpenAnimation(options = {}) { - return this.startAnimation({ + async startOpenAnimation(options = {}) { + await this._startAnimation({ boxAnimation: options.animation ?? this.evalOption(this.openAnimation), backdropAnimation: 'fade-in', easing: options.easing || this.openEasing, duration: options.duration || this.openDuration - }).then(() => { - return this.wasEverVisible = true; }); + this.wasEverVisible = true; } startCloseAnimation(options = {}) { - const boxAnimation = this.wasEverVisible && (options.animation ?? this.evalOption(this.closeAnimation)); - return this.startAnimation({ - boxAnimation, - backdropAnimation: 'fade-out', + return this._startAnimation({ + boxAnimation: this.wasEverVisible && (options.animation ?? this.evalOption(this.closeAnimation)), + backdropAnimation: this.wasEverVisible && 'fade-out', easing: options.easing || this.closeEasing, duration: options.duration || this.closeDuration }); } accept(value = null, options = {}) { - return this.executeCloseChange('accept', value, options); + return this._executeCloseChange('accept', value, options); } dismiss(value = null, options = {}) { - return this.executeCloseChange('dismiss', value, options); + return this._executeCloseChange('dismiss', value, options); } - supportsDismissMethod(method) { + _supportsDismissMethod(method) { return u.contains(this.dismissable, method); } - executeCloseChange(verb, value, options) { + _executeCloseChange(verb, value, options) { options = { ...options, verb, @@ -5821,75 +6091,70 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 51 */ + }), ( /* 51 */ /***/() => { up.Layer.OverlayWithTether = class OverlayWithTether extends up.Layer.Overlay { - createElements(content) { + createElements() { if (!this.origin) { up.fail('Missing { origin } option'); } - this.tether = new up.Tether({ + this._tether = new up.Tether({ anchor: this.origin, align: this.align, position: this.position }); - this.createElement(this.tether.parent); - this.createContentElement(this.element, content); - this.tether.start(this.element); + this.createElement(this._tether.parent); + this.createContentElement(this.element); + } + onContentSet() { + this._tether.start(this.element); } onElementsRemoved() { - this.tether.stop(); + this._tether.stop(); } sync() { if (this.isOpen()) { - if (this.isDetached() || this.tether.isDetached()) { + if (this.isDetached() || this._tether.isDetached()) { this.dismiss(':detached', { animation: false, preventable: false }); } else { - this.tether.sync(); + this._tether.sync(); } } } }; /***/ - }, /* 52 */ + }), ( /* 52 */ /***/() => { - var _a; - up.Layer.OverlayWithViewport = (_a = class OverlayWithViewport extends up.Layer.Overlay { + up.Layer.OverlayWithViewport = class OverlayWithViewport extends up.Layer.Overlay { static getParentElement() { return document.body; } - createElements(content) { - this.shiftBody(); + createElements() { + up.viewport.bodyShifter.raiseStack(); this.createElement(this.constructor.getParentElement()); if (this.backdrop) { this.createBackdropElement(this.element); } this.createViewportElement(this.element); this.createBoxElement(this.viewportElement); - this.createContentElement(this.boxElement, content); + this.createContentElement(this.boxElement); } onElementsRemoved() { - this.unshiftBody(); - } - shiftBody() { - this.constructor.bodyShifter.shift(); - } - unshiftBody() { - this.constructor.bodyShifter.unshift(); + up.viewport.bodyShifter.lowerStack(); } sync() { if (this.isDetached() && this.isOpen()) { this.constructor.getParentElement().appendChild(this.element); } } - }, _a.bodyShifter = new up.BodyShifter(), _a); + }; /***/ - }, /* 53 */ + }), ( /* 53 */ /***/() => { var _a; const e = up.element; @@ -5917,12 +6182,12 @@ createCommonjsModule(function (module) { this.setupHandlers(); } accept() { - this.cannotCloseRoot(); + this._cannotCloseRoot(); } dismiss() { - this.cannotCloseRoot(); + this._cannotCloseRoot(); } - cannotCloseRoot() { + _cannotCloseRoot() { up.fail('Cannot close the root layer'); } toString() { @@ -5931,115 +6196,117 @@ createCommonjsModule(function (module) { }, _a.mode = 'root', _a); /***/ - }, /* 54 */ + }), ( /* 54 */ /***/() => { var _a; up.Layer.Modal = (_a = class Modal extends up.Layer.OverlayWithViewport {}, _a.mode = 'modal', _a); /***/ - }, /* 55 */ + }), ( /* 55 */ /***/() => { var _a; up.Layer.Popup = (_a = class Popup extends up.Layer.OverlayWithTether {}, _a.mode = 'popup', _a); /***/ - }, /* 56 */ + }), ( /* 56 */ /***/() => { var _a; up.Layer.Drawer = (_a = class Drawer extends up.Layer.OverlayWithViewport {}, _a.mode = 'drawer', _a); /***/ - }, /* 57 */ + }), ( /* 57 */ /***/() => { var _a; up.Layer.Cover = (_a = class Cover extends up.Layer.OverlayWithViewport {}, _a.mode = 'cover', _a); /***/ - }, /* 58 */ + }), ( /* 58 */ /***/() => { const u = up.util; const e = up.element; up.LayerLookup = class LayerLookup { constructor(stack, ...args) { - this.stack = stack; + this._stack = stack; const options = u.parseArgIntoOptions(args, 'layer'); if (options.normalizeLayerOptions !== false) { up.layer.normalizeOptions(options); } - this.values = u.parseTokens(options.layer); - this.origin = options.origin; - this.baseLayer = options.baseLayer || this.originLayer() || this.stack.current; - if (u.isString(this.baseLayer)) { + this._values = u.parseTokens(options.layer); + this._origin = options.origin; + this._baseLayer = options.baseLayer || this._originLayer() || this._stack.current; + if (u.isString(this._baseLayer)) { const recursiveOptions = { ...options, - baseLayer: this.stack.current, + baseLayer: this._stack.current, normalizeLayerOptions: false }; - this.baseLayer = new this.constructor(this.stack, this.baseLayer, recursiveOptions).first(); + this._baseLayer = new this.constructor(this._stack, this._baseLayer, recursiveOptions).first(); } } - originLayer() { - if (this.origin) { - return this.forElement(this.origin); + _originLayer() { + if (this._origin) { + return this._forElement(this._origin); } } first() { return this.all()[0]; } all() { - let results = u.flatMap(this.values, value => this.resolveValue(value)); + let results = u.flatMap(this._values, value => this._resolveValue(value)); results = u.compact(results); results = u.uniq(results); return results; } - forElement(element) { + _forElement(element) { element = e.get(element); - return u.find(this.stack.reversed(), layer => layer.contains(element)); + return u.find(this._stack.reversed(), layer => layer.contains(element)); } - forIndex(value) { - return this.stack[value]; + _forIndex(value) { + return this._stack.at(value); } - resolveValue(value) { + _resolveValue(value) { if (value instanceof up.Layer) { return value; } if (u.isNumber(value)) { - return this.forIndex(value); + return this._forIndex(value); } if (/^\d+$/.test(value)) { - return this.forIndex(Number(value)); + return this._forIndex(Number(value)); } if (u.isElementish(value)) { - return this.forElement(value); + return this._forElement(value); } switch (value) { case 'any': - return [this.baseLayer, ...this.stack.reversed()]; + return [this._baseLayer, ...this._stack.reversed()]; case 'current': - return this.baseLayer; + return this._baseLayer; case 'closest': - return this.stack.selfAndAncestorsOf(this.baseLayer); + return this._stack.selfAndAncestorsOf(this._baseLayer); case 'parent': - return this.baseLayer.parent; + return this._baseLayer.parent; case 'ancestor': case 'ancestors': - return this.baseLayer.ancestors; + return this._baseLayer.ancestors; case 'child': - return this.baseLayer.child; + return this._baseLayer.child; case 'descendant': case 'descendants': - return this.baseLayer.descendants; + return this._baseLayer.descendants; + case 'subtree': + return this._baseLayer.subtree; case 'new': return 'new'; case 'root': - return this.stack.root; + return this._stack.root; case 'overlay': case 'overlays': - return u.reverse(this.stack.overlays); + return u.reverse(this._stack.overlays); case 'front': - return this.stack.front; + return this._stack.front; case 'origin': - return this.originLayer(); + return this._originLayer(); default: return up.fail("Unknown { layer } option: %o", value); } @@ -6047,24 +6314,22 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 59 */ + }), ( /* 59 */ /***/() => { const u = up.util; - up.LayerStack = class LayerStack extends Array { + up.LayerStack = class LayerStack { constructor() { - super(); - Object.setPrototypeOf(this, up.LayerStack.prototype); - this.currentOverrides = []; - this.push(this.buildRoot()); + this._currentOverrides = []; + this.layers = [this._buildRoot()]; } - buildRoot() { + _buildRoot() { return up.layer.build({ mode: 'root', stack: this }); } remove(layer) { - u.remove(this, layer); + u.remove(this.layers, layer); } peel(layer, options) { const descendants = u.reverse(layer.descendants); @@ -6080,35 +6345,35 @@ createCommonjsModule(function (module) { this.peel(this.root, { animation: false }); - this.currentOverrides = []; + this._currentOverrides = []; this.root.reset(); } isOpen(layer) { - return layer.index >= 0; + return u.contains(this.layers, layer); } isClosed(layer) { return !this.isOpen(layer); } parentOf(layer) { - return this[layer.index - 1]; + return this.layers[layer.index - 1]; } childOf(layer) { - return this[layer.index + 1]; + return this.layers[layer.index + 1]; } ancestorsOf(layer) { - return u.reverse(this.slice(0, layer.index)); + return u.reverse(this.layers.slice(0, layer.index)); } selfAndAncestorsOf(layer) { return [layer, ...layer.ancestors]; } descendantsOf(layer) { - return this.slice(layer.index + 1); + return this.layers.slice(layer.index + 1); } isRoot(layer) { - return this[0] === layer; + return this.root === layer; } isOverlay(layer) { - return !this.isRoot(layer); + return this.root !== layer; } isCurrent(layer) { return this.current === layer; @@ -6123,20 +6388,20 @@ createCommonjsModule(function (module) { return new up.LayerLookup(this, ...args).all(); } sync() { - for (let layer of this) { + for (let layer of this.layers) { layer.sync(); } } asCurrent(layer, fn) { try { - this.currentOverrides.push(layer); + this._currentOverrides.push(layer); return fn(); } finally { - this.currentOverrides.pop(); + this._currentOverrides.pop(); } } reversed() { - return u.reverse(this); + return u.reverse(this.layers); } dismissOverlays(value = null, options = {}) { options.dismissable = false; @@ -6144,136 +6409,135 @@ createCommonjsModule(function (module) { overlay.dismiss(value, options); } } - [u.copy.key]() { - return u.copyArrayLike(this); + at(index) { + return this.layers[index]; + } + indexOf(layer) { + return this.layers.indexOf(layer); } get count() { - return this.length; + return this.layers.length; } get root() { - return this[0]; + return this.layers[0]; } get overlays() { return this.root.descendants; } get current() { - return u.last(this.currentOverrides) || this.front; + return u.last(this._currentOverrides) || this.front; } get front() { - return u.last(this); + return u.last(this.layers); } }; /***/ - }, /* 60 */ + }), ( /* 60 */ /***/() => { up.LinkFeedbackURLs = class LinkFeedbackURLs { constructor(link) { const normalize = up.feedback.normalizeURL; - this.isSafe = up.link.isSafe(link); - if (this.isSafe) { + this._isSafe = up.link.isSafe(link); + if (this._isSafe) { const href = link.getAttribute('href'); if (href && href !== '#') { this.href = normalize(href); } const upHREF = link.getAttribute('up-href'); if (upHREF) { - this.upHREF = normalize(upHREF); + this._upHREF = normalize(upHREF); } const alias = link.getAttribute('up-alias'); if (alias) { - this.aliasPattern = new up.URLPattern(alias, normalize); + this._aliasPattern = new up.URLPattern(alias, normalize); } } } isCurrent(normalizedLocation) { - return this.isSafe && !!(this.href && this.href === normalizedLocation || this.upHREF && this.upHREF === normalizedLocation || this.aliasPattern && this.aliasPattern.test(normalizedLocation, false)); + return this._isSafe && !!(this.href === normalizedLocation || this._upHREF === normalizedLocation || this._aliasPattern?.test?.(normalizedLocation, false)); } }; /***/ - }, /* 61 */ + }), ( /* 61 */ /***/() => { const u = up.util; const e = up.element; up.LinkPreloader = class LinkPreloader { - constructor() { - this.considerPreload = this.considerPreload.bind(this); - } watchLink(link) { - if (up.link.isSafe(link)) { - this.on(link, 'mouseenter', event => this.considerPreload(event, true)); - this.on(link, 'mousedown touchstart', event => this.considerPreload(event)); - this.on(link, 'mouseleave', event => this.stopPreload(event)); + if (!up.link.preloadIssue(link)) { + this._on(link, 'mouseenter', event => this._considerPreload(event, true)); + this._on(link, 'mousedown touchstart', event => this._considerPreload(event)); + this._on(link, 'mouseleave', event => this._stopPreload(event)); } } - on(link, eventTypes, callback) { + _on(link, eventTypes, callback) { up.on(link, eventTypes, { passive: true }, callback); } - considerPreload(event, applyDelay) { + _considerPreload(event, applyDelay) { const link = event.target; - if (link !== this.currentLink) { + if (link !== this._currentLink) { this.reset(); - this.currentLink = link; + this._currentLink = link; if (up.link.shouldFollowEvent(event, link)) { if (applyDelay) { - this.preloadAfterDelay(event, link); + this._preloadAfterDelay(event, link); } else { - this.preloadNow(event, link); + this._preloadNow(event, link); } } } } - stopPreload(event) { - if (event.target === this.currentLink) { + _stopPreload(event) { + if (event.target === this._currentLink) { return this.reset(); } } reset() { - if (!this.currentLink) { + if (!this._currentLink) { return; } - clearTimeout(this.timer); - if (this.currentRequest?.background) { - this.currentRequest.abort(); + clearTimeout(this._timer); + if (this._currentRequest?.background) { + this._currentRequest.abort(); } - this.currentLink = undefined; - this.currentRequest = undefined; + this._currentLink = undefined; + this._currentRequest = undefined; } - preloadAfterDelay(event, link) { + _preloadAfterDelay(event, link) { const delay = e.numberAttr(link, 'up-preload-delay') ?? up.link.config.preloadDelay; - this.timer = u.timer(delay, () => this.preloadNow(event, link)); + this._timer = u.timer(delay, () => this._preloadNow(event, link)); } - preloadNow(event, link) { + _preloadNow(event, link) { if (!link.isConnected) { this.reset(); return; } const onQueued = request => { - return this.currentRequest = request; + return this._currentRequest = request; }; up.log.putsEvent(event); up.error.muteUncriticalRejection(up.link.preload(link, { onQueued })); - this.queued = true; } }; /***/ - }, /* 62 */ + }), ( /* 62 */ /***/() => { const u = up.util; const e = up.element; up.MotionController = class MotionController { constructor(name) { - this.activeClass = `up-${name}`; - this.selector = `.${this.activeClass}`; + this._activeClass = `up-${name}`; + this._selector = `.${this._activeClass}`; this.finishEvent = `up:${name}:finish`; this.finishCount = 0; - this.clusterCount = 0; + this._clusterCount = 0; } startFunction(cluster, startMotion, memory = {}) { cluster = e.list(cluster); @@ -6284,37 +6548,37 @@ createCommonjsModule(function (module) { } else { memory.trackMotion = false; this.finish(cluster); - this.markCluster(cluster); - let promise = this.whileForwardingFinishEvent(cluster, mutedAnimator); - promise = promise.then(() => this.unmarkCluster(cluster)); + this._markCluster(cluster); + let promise = this._whileForwardingFinishEvent(cluster, mutedAnimator); + promise = promise.then(() => this._unmarkCluster(cluster)); return promise; } } finish(elements) { this.finishCount++; - if (this.clusterCount === 0 || !up.motion.isEnabled()) { + if (this._clusterCount === 0 || !up.motion.isEnabled()) { return; } - elements = this.expandFinishRequest(elements); + elements = this._expandFinishRequest(elements); for (let element of elements) { - this.finishOneElement(element); + this._finishOneElement(element); } return up.migrate.formerlyAsync?.('up.motion.finish()'); } - expandFinishRequest(elements) { + _expandFinishRequest(elements) { if (elements) { - return u.flatMap(elements, el => e.list(el.closest(this.selector), el.querySelectorAll(this.selector))); + return u.flatMap(elements, el => e.list(el.closest(this._selector), el.querySelectorAll(this._selector))); } else { - return document.querySelectorAll(this.selector); + return document.querySelectorAll(this._selector); } } isActive(element) { - return element.classList.contains(this.activeClass); + return element.classList.contains(this._activeClass); } - finishOneElement(element) { - this.emitFinishEvent(element); + _finishOneElement(element) { + this._emitFinishEvent(element); } - emitFinishEvent(element, eventAttrs = {}) { + _emitFinishEvent(element, eventAttrs = {}) { eventAttrs = { target: element, log: false, @@ -6322,20 +6586,20 @@ createCommonjsModule(function (module) { }; return up.emit(this.finishEvent, eventAttrs); } - markCluster(cluster) { - this.clusterCount++; - this.toggleActive(cluster, true); + _markCluster(cluster) { + this._clusterCount++; + this._toggleActive(cluster, true); } - unmarkCluster(cluster) { - this.clusterCount--; - this.toggleActive(cluster, false); + _unmarkCluster(cluster) { + this._clusterCount--; + this._toggleActive(cluster, false); } - toggleActive(cluster, isActive) { + _toggleActive(cluster, isActive) { for (let element of cluster) { - element.classList.toggle(this.activeClass, isActive); + element.classList.toggle(this._activeClass, isActive); } } - whileForwardingFinishEvent(cluster, fn) { + _whileForwardingFinishEvent(cluster, fn) { if (cluster.length < 2) { return fn(); } @@ -6343,7 +6607,7 @@ createCommonjsModule(function (module) { if (!event.forwarded) { for (let element of cluster) { if (element !== event.target && this.isActive(element)) { - this.emitFinishEvent(element, { + this._emitFinishEvent(element, { forwarded: true }); } @@ -6356,12 +6620,12 @@ createCommonjsModule(function (module) { async reset() { await this.finish(); this.finishCount = 0; - this.clusterCount = 0; + this._clusterCount = 0; } }; /***/ - }, /* 63 */ + }), ( /* 63 */ /***/() => { const u = up.util; const e = up.element; @@ -6380,22 +6644,22 @@ createCommonjsModule(function (module) { } else if (this.nonce) { let callbackThis = this; return function (...args) { - return callbackThis.runAsNoncedFunction(this, argNames, args); + return callbackThis._runAsNoncedFunction(this, argNames, args); }; } else { - return this.cannotRun.bind(this); + return this._cannotRun.bind(this); } } toString() { return `nonce-${this.nonce} ${this.script}`; } - cannotRun() { + _cannotRun() { throw new Error(`Your Content Security Policy disallows inline JavaScript (${this.script}). See https://unpoly.com/csp for solutions.`); } - runAsNoncedFunction(thisArg, argNames, args) { + _runAsNoncedFunction(thisArg, argNames, args) { let wrappedScript = ` try { - up.noncedEval.value = (function(${argNames.join(',')}) { + up.noncedEval.value = (function(${argNames.join()}) { ${this.script} }).apply(up.noncedEval.thisArg, up.noncedEval.args) } catch (error) { @@ -6424,7 +6688,7 @@ createCommonjsModule(function (module) { } } } - allowedBy(allowedNonces) { + _allowedBy(allowedNonces) { return this.nonce && u.contains(allowedNonces, this.nonce); } static adoptNonces(element, allowedNonces) { @@ -6432,13 +6696,13 @@ createCommonjsModule(function (module) { return; } const getPageNonce = u.memoize(up.protocol.cspNonce); - u.each(up.protocol.config.nonceableAttributes, attribute => { + u.each(up.script.config.nonceableAttributes, attribute => { let matches = e.subtree(element, `[${attribute}^="nonce-"]`); u.each(matches, match => { let attributeValue = match.getAttribute(attribute); let callback = this.fromString(attributeValue); let warn = (message, ...args) => up.log.warn('up.render()', `Cannot use callback [${attribute}="${attributeValue}"]: ${message}`, ...args); - if (!callback.allowedBy(allowedNonces)) { + if (!callback._allowedBy(allowedNonces)) { return warn("Callback's CSP nonce (%o) does not match response header (%o)", callback.nonce, allowedNonces); } let pageNonce = getPageNonce(); @@ -6453,142 +6717,66 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 64 */ - /***/() => { - const u = up.util; - const e = up.element; - up.OptionsParser = class OptionsParser { - constructor(element, options, parserOptions = {}) { - this.options = options; - this.element = element; - this.fail = parserOptions.fail; - this.closest = parserOptions.closest; - this.attrPrefix = parserOptions.attrPrefix || 'up-'; - this.defaults = parserOptions.defaults || {}; - } - string(key, keyOptions) { - this.parse(e.attr, key, keyOptions); - } - boolean(key, keyOptions) { - this.parse(e.booleanAttr, key, keyOptions); - } - number(key, keyOptions) { - this.parse(e.numberAttr, key, keyOptions); - } - booleanOrString(key, keyOptions) { - this.parse(e.booleanOrStringAttr, key, keyOptions); - } - json(key, keyOptions) { - this.parse(e.jsonAttr, key, keyOptions); - } - callback(key, keyOptions = {}) { - let parser = (link, attr) => e.callbackAttr(link, attr, keyOptions); - this.parse(parser, key, keyOptions); - } - parse(attrValueFn, key, keyOptions = {}) { - const attrNames = u.wrapList(keyOptions.attr ?? this.attrNameForKey(key)); - let value = this.options[key]; - for (let attrName of attrNames) { - value ?? (value = this.parseFromAttr(attrValueFn, this.element, attrName)); - } - value ?? (value = keyOptions.default ?? this.defaults[key]); - let normalizeFn = keyOptions.normalize; - if (normalizeFn) { - value = normalizeFn(value); - } - if (u.isDefined(value)) { - this.options[key] = value; - } - let failKey; - if (this.fail && (failKey = up.fragment.failKey(key))) { - const failAttrNames = u.compact(u.map(attrNames, attrName => this.deriveFailAttrName(attrName))); - this.parse(attrValueFn, failKey, { - ...keyOptions, - attr: failAttrNames - }); - } - } - parseFromAttr(attrValueFn, element, attrName) { - if (this.closest) { - return e.closestAttr(element, attrName, attrValueFn); - } else { - return attrValueFn(element, attrName); - } - } - deriveFailAttrName(attr) { - return this.deriveFailAttrNameForPrefix(attr, this.attrPrefix + 'on-') || this.deriveFailAttrNameForPrefix(attr, this.attrPrefix); - } - deriveFailAttrNameForPrefix(attr, prefix) { - if (attr.startsWith(prefix)) { - return `${prefix}fail-${attr.substring(prefix.length)}`; - } - } - attrNameForKey(option) { - return `${this.attrPrefix}${u.camelToKebabCase(option)}`; - } - }; - - /***/ - }, /* 65 */ + }), ( /* 64 */ /***/() => { const e = up.element; const u = up.util; up.OverlayFocus = class OverlayFocus { constructor(layer) { - this.layer = layer; - this.focusElement = this.layer.getFocusElement(); + this._layer = layer; + this._focusElement = this._layer.getFocusElement(); } moveToFront() { - if (this.enabled) { + if (this._enabled) { return; } - this.enabled = true; - this.untrapFocus = up.on('focusin', event => this.onFocus(event)); - this.unsetAttrs = e.setTemporaryAttrs(this.focusElement, { + this._enabled = true; + this._untrapFocus = up.on('focusin', event => this._onFocus(event)); + this._unsetAttrs = e.setTemporaryAttrs(this._focusElement, { 'tabindex': '0', 'role': 'dialog', 'aria-modal': 'true' }); - this.focusTrapBefore = e.affix(this.focusElement, 'beforebegin', 'up-focus-trap[tabindex=0]'); - this.focusTrapAfter = e.affix(this.focusElement, 'afterend', 'up-focus-trap[tabindex=0]'); + this._focusTrapBefore = e.affix(this._focusElement, 'beforebegin', 'up-focus-trap[tabindex=0]'); + this._focusTrapAfter = e.affix(this._focusElement, 'afterend', 'up-focus-trap[tabindex=0]'); } moveToBack() { this.teardown(); } teardown() { - if (!this.enabled) { + if (!this._enabled) { return; } - this.enabled = false; - this.untrapFocus(); - this.unsetAttrs(); - this.focusTrapBefore.remove(); - this.focusTrapAfter.remove(); + this._enabled = false; + this._untrapFocus(); + this._unsetAttrs(); + this._focusTrapBefore.remove(); + this._focusTrapAfter.remove(); } - onFocus(event) { + _onFocus(event) { const { target } = event; - if (this.processingFocusEvent || up.layer.isWithinForeignOverlay(target)) { + if (this._processingFocusEvent || up.layer.isWithinForeignOverlay(target)) { return; } - this.processingFocusEvent = true; - if (target === this.focusTrapBefore) { - this.focusEnd(); - } else if (target === this.focusTrapAfter || !this.layer.contains(target)) { - this.focusStart(); + this._processingFocusEvent = true; + if (target === this._focusTrapBefore) { + this._focusEnd(); + } else if (target === this._focusTrapAfter || !this._layer.contains(target)) { + this._focusStart(); } - this.processingFocusEvent = false; + this._processingFocusEvent = false; } - focusStart(focusOptions) { - up.focus(this.focusElement, focusOptions); + _focusStart(focusOptions) { + up.focus(this._focusElement, focusOptions); } - focusEnd() { - this.focusLastDescendant(this.layer.getBoxElement()) || this.focusStart(); + _focusEnd() { + this._focusLastDescendant(this._layer.getBoxElement()) || this._focusStart(); } - focusLastDescendant(element) { + _focusLastDescendant(element) { for (let child of u.reverse(element.children)) { - if (up.viewport.tryFocus(child) || this.focusLastDescendant(child)) { + if (up.viewport.tryFocus(child) || this._focusLastDescendant(child)) { return true; } } @@ -6596,7 +6784,7 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 66 */ + }), ( /* 65 */ /***/() => { const u = up.util; const e = up.element; @@ -6619,8 +6807,8 @@ createCommonjsModule(function (module) { value } = entry; if (!u.isBasicObjectProperty(name)) { - if (this.isArrayKey(name)) { - obj[name] || (obj[name] = []); + if (this._isArrayKey(name)) { + obj[name] ||= []; obj[name].push(value); } else { obj[name] = value; @@ -6643,15 +6831,15 @@ createCommonjsModule(function (module) { return formData; } toQuery() { - let parts = u.map(this.entries, this.arrayEntryToQuery.bind(this)); + let parts = u.map(this.entries, this._arrayEntryToQuery.bind(this)); parts = u.compact(parts); return parts.join('&'); } - arrayEntryToQuery(entry) { + _arrayEntryToQuery(entry) { const { value } = entry; - if (this.isBinaryValue(value)) { + if (this._isBinaryValue(value)) { return; } let query = encodeURIComponent(entry.name); @@ -6661,12 +6849,12 @@ createCommonjsModule(function (module) { } return query; } - isBinaryValue(value) { + _isBinaryValue(value) { return value instanceof Blob; } hasBinaryValues() { const values = u.map(this.entries, 'value'); - return u.some(values, this.isBinaryValue); + return u.some(values, this._isBinaryValue); } toURL(base) { let parts = [base, this.toQuery()]; @@ -6686,16 +6874,16 @@ createCommonjsModule(function (module) { } else if (u.isArray(raw)) { this.entries.push(...raw); } else if (u.isString(raw)) { - this.addAllFromQuery(raw); + this._addAllFromQuery(raw); } else if (u.isFormData(raw)) { - this.addAllFromFormData(raw); + this._addAllFromFormData(raw); } else if (u.isObject(raw)) { - this.addAllFromObject(raw); + this._addAllFromObject(raw); } else { up.fail("Unsupport params type: %o", raw); } } - addAllFromObject(object) { + _addAllFromObject(object) { for (let key in object) { const value = object[key]; const valueElements = u.isArray(value) ? value : [value]; @@ -6704,7 +6892,7 @@ createCommonjsModule(function (module) { } } } - addAllFromQuery(query) { + _addAllFromQuery(query) { for (let part of query.split('&')) { if (part) { let [name, value] = part.split('='); @@ -6718,7 +6906,7 @@ createCommonjsModule(function (module) { } } } - addAllFromFormData(formData) { + _addAllFromFormData(formData) { for (let value of formData.entries()) { this.add(...value); } @@ -6728,31 +6916,31 @@ createCommonjsModule(function (module) { this.add(name, value); } delete(name) { - this.entries = u.reject(this.entries, this.matchEntryFn(name)); + this.entries = u.reject(this.entries, this._matchEntryFn(name)); } - matchEntryFn(name) { + _matchEntryFn(name) { return entry => entry.name === name; } get(name) { - if (this.isArrayKey(name)) { + if (this._isArrayKey(name)) { return this.getAll(name); } else { return this.getFirst(name); } } getFirst(name) { - const entry = u.find(this.entries, this.matchEntryFn(name)); + const entry = u.find(this.entries, this._matchEntryFn(name)); return entry?.value; } getAll(name) { - if (this.isArrayKey(name)) { + if (this._isArrayKey(name)) { return this.getAll(name); } else { - const entries = u.map(this.entries, this.matchEntryFn(name)); + const entries = u.map(this.entries, this._matchEntryFn(name)); return u.map(entries, 'value'); } } - isArrayKey(key) { + _isArrayKey(key) { return key.endsWith('[]'); } [u.isBlank.key]() { @@ -6825,60 +7013,59 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 67 */ + }), ( /* 66 */ /***/() => { const e = up.element; const TRANSITION_DELAY = 300; up.ProgressBar = class ProgressBar { constructor() { - this.step = 0; - this.element = e.affix(document.body, 'up-progress-bar'); - this.element.style.transition = `width ${TRANSITION_DELAY}ms ease-out`; - this.moveTo(0); - up.element.paint(this.element); - this.width = 31; - this.nextStep(); - } - nextStep() { + this._step = 0; + this._element = e.affix(document.body, 'up-progress-bar'); + this._element.style.transition = `width ${TRANSITION_DELAY}ms ease-out`; + this._moveTo(0); + up.element.paint(this._element); + this._width = 31; + this._nextStep(); + } + _nextStep() { let diff; - if (this.width < 80) { + if (this._width < 80) { if (Math.random() < 0.15) { diff = 7 + 5 * Math.random(); } else { diff = 1.5 + 0.5 * Math.random(); } } else { - diff = 0.13 * (100 - this.width) * Math.random(); + diff = 0.13 * (100 - this._width) * Math.random(); } - this.moveTo(this.width + diff); - this.step++; - const nextStepDelay = TRANSITION_DELAY + this.step * 40; - this.timeout = setTimeout(this.nextStep.bind(this), nextStepDelay); + this._moveTo(this._width + diff); + this._step++; + const nextStepDelay = TRANSITION_DELAY + this._step * 40; + this.timeout = setTimeout(this._nextStep.bind(this), nextStepDelay); } - moveTo(width) { - this.width = width; - this.element.style.width = `${width}vw`; + _moveTo(width) { + this._width = width; + this._element.style.width = `${width}vw`; } destroy() { clearTimeout(this.timeout); - this.element.remove(); + this._element.remove(); } conclude() { clearTimeout(this.timeout); - this.moveTo(100); + this._moveTo(100); setTimeout(this.destroy.bind(this), TRANSITION_DELAY); } }; /***/ - }, /* 68 */ + }), ( /* 67 */ /***/() => { const u = up.util; up.RenderOptions = function () { const GLOBAL_DEFAULTS = { useHungry: true, useKeep: true, - source: true, saveScroll: true, saveFocus: true, focus: 'keep', @@ -6962,7 +7149,7 @@ createCommonjsModule(function (module) { }(); /***/ - }, /* 69 */ + }), ( /* 68 */ /***/() => { up.RenderResult = class RenderResult extends up.Record { keys() { @@ -6979,6 +7166,19 @@ createCommonjsModule(function (module) { get fragment() { return this.fragments[0]; } + static both(main, extension, mergeFinished = true) { + if (!extension) return main; + return new this({ + target: main.target, + layer: main.layer, + options: main.options, + fragments: main.fragments.concat(extension.fragments), + finished: mergeFinished && this.mergeFinished(main, extension) + }); + } + static async mergeFinished(main, extension) { + return this.both(await main.finished, await extension.finished, false); + } static buildNone() { return new this({ target: ':none', @@ -6988,7 +7188,7 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 70 */ + }), ( /* 69 */ /***/() => { var _a; const u = up.util; @@ -7011,24 +7211,24 @@ createCommonjsModule(function (module) { if (this.wrapMethod == null) { this.wrapMethod = up.network.config.wrapMethod; } - this.normalize(); + this._normalize(); if ((this.target || this.layer || this.origin) && !options.basic) { const layerLookupOptions = { origin: this.origin }; this.layer = up.layer.get(this.layer, layerLookupOptions); - this.failLayer = up.layer.get(this.failLayer || this.layer, layerLookupOptions); - this.context || (this.context = this.layer.context || {}); - this.failContext || (this.failContext = this.failLayer.context || {}); - this.mode || (this.mode = this.layer.mode); - this.failMode || (this.failMode = this.failLayer.mode); + this.failLayer = up.layer.get(this.failLayer, layerLookupOptions); + this.context ||= this.layer.context || {}; + this.failContext ||= this.failLayer?.context || {}; + this.mode ||= this.layer.mode; + this.failMode ||= this.failLayer?.mode; } this.deferred = u.newDeferred(); - this.badResponseTime ?? (this.badResponseTime = u.evalOption(up.network.config.badResponseTime, this)); - this.addAutoHeaders(); + this.badResponseTime ??= u.evalOption(up.network.config.badResponseTime, this); + this._addAutoHeaders(); } get xhr() { - return this._xhr ?? (this._xhr = new XMLHttpRequest()); + return this._xhr ??= new XMLHttpRequest(); } get fragments() { if (this._fragments) { @@ -7049,13 +7249,13 @@ createCommonjsModule(function (module) { get fragment() { return this.fragments?.[0]; } - normalize() { + _normalize() { this.method = u.normalizeMethod(this.method); - this.extractHashFromURL(); - this.transferParamsToURL(); + this._extractHashFromURL(); + this._transferParamsToURL(); this.url = u.normalizeURL(this.url); } - evictExpensiveAttrs() { + _evictExpensiveAttrs() { u.task(() => { this.layer = undefined; this.failLayer = undefined; @@ -7063,14 +7263,14 @@ createCommonjsModule(function (module) { this.fragments = undefined; }); } - extractHashFromURL() { + _extractHashFromURL() { let match = this.url?.match(/^([^#]*)(#.+)$/); if (match) { this.url = match[1]; return this.hash = match[2]; } } - transferParamsToURL() { + _transferParamsToURL() { if (!this.url || this.allowsPayload() || u.isBlank(this.params)) { return; } @@ -7090,21 +7290,21 @@ createCommonjsModule(function (module) { return u.evalAutoOption(this.cache, up.network.config.autoCache, this); } runQueuedCallbacks() { - u.always(this, () => this.evictExpensiveAttrs()); + u.always(this, () => this._evictExpensiveAttrs()); this.onQueued?.(this); } load() { if (this.state !== 'new') return; - if (this.emitLoad()) { + if (this._emitLoad()) { this.state = 'loading'; - this.normalize(); + this._normalize(); this.onLoading?.(); this.expired = false; new up.Request.XHRRenderer(this).buildAndSend({ - onload: () => this.onXHRLoad(), - onerror: () => this.onXHRError(), - ontimeout: () => this.onXHRTimeout(), - onabort: () => this.onXHRAbort() + onload: () => this._onXHRLoad(), + onerror: () => this._onXHRError(), + ontimeout: () => this._onXHRTimeout(), + onabort: () => this._onXHRAbort() }); return true; } else { @@ -7113,7 +7313,7 @@ createCommonjsModule(function (module) { }); } } - emitLoad() { + _emitLoad() { let event = this.emit('up:request:load', { log: ['Loading %s', this.description] }); @@ -7123,8 +7323,8 @@ createCommonjsModule(function (module) { up.network.abort(); new up.Request.FormRenderer(this).buildAndSubmit(); } - onXHRLoad() { - const response = this.extractResponseFromXHR(); + _onXHRLoad() { + const response = this._extractResponseFromXHR(); const log = 'Loaded ' + response.description; this.emit('up:request:loaded', { request: response.request, @@ -7133,24 +7333,24 @@ createCommonjsModule(function (module) { }); this.respondWith(response); } - onXHRError() { - this.setOfflineState('Network error'); + _onXHRError() { + this._setOfflineState('Network error'); } - onXHRTimeout() { - this.setOfflineState('Timeout'); + _onXHRTimeout() { + this._setOfflineState('Timeout'); } - onXHRAbort() { - this.setAbortedState(); + _onXHRAbort() { + this._setAbortedState(); } abort({ reason } = {}) { - if (this.setAbortedState(reason) && this._xhr) { + if (this._setAbortedState(reason) && this._xhr) { this._xhr.abort(); } } - setAbortedState(reason) { - if (this.isSettled()) return; + _setAbortedState(reason) { + if (this._isSettled()) return; let message = 'Aborted request to ' + this.description + (reason ? ': ' + reason : ''); this.state = 'aborted'; this.deferred.reject(new up.Aborted(message)); @@ -7159,18 +7359,18 @@ createCommonjsModule(function (module) { }); return true; } - setOfflineState(reason) { - if (this.isSettled()) return; + _setOfflineState(reason) { + if (this._isSettled()) return; let message = 'Cannot load request to ' + this.description + (reason ? ': ' + reason : ''); this.state = 'offline'; - this.deferred.reject(new up.Offline(message)); this.emit('up:request:offline', { log: message }); + this.deferred.reject(new up.Offline(message)); } respondWith(response) { this.response = response; - if (this.isSettled()) return; + if (this._isSettled()) return; this.state = 'loaded'; if (response.ok) { this.deferred.resolve(response); @@ -7178,7 +7378,7 @@ createCommonjsModule(function (module) { this.deferred.reject(response); } } - isSettled() { + _isSettled() { return this.state !== 'new' && this.state !== 'loading' && this.state !== 'tracking'; } csrfHeader() { @@ -7195,7 +7395,7 @@ createCommonjsModule(function (module) { isCrossOrigin() { return u.isCrossOrigin(this.url); } - extractResponseFromXHR() { + _extractResponseFromXHR() { const responseAttrs = { method: this.method, url: this.url, @@ -7217,7 +7417,7 @@ createCommonjsModule(function (module) { let urlFromResponse = up.protocol.locationFromXHR(this.xhr); if (urlFromResponse) { if (!u.matchURLs(this.url, urlFromResponse)) { - methodFromResponse || (methodFromResponse = 'GET'); + methodFromResponse ||= 'GET'; } responseAttrs.url = urlFromResponse; } @@ -7226,7 +7426,7 @@ createCommonjsModule(function (module) { } return new up.Response(responseAttrs); } - buildEventEmitter(args) { + _buildEventEmitter(args) { return up.EventEmitter.fromEmitArgs(args, { layer: this.layer, request: this, @@ -7234,10 +7434,10 @@ createCommonjsModule(function (module) { }); } emit(...args) { - return this.buildEventEmitter(args).emit(); + return this._buildEventEmitter(args).emit(); } assertEmitted(...args) { - this.buildEventEmitter(args).assertEmitted(); + this._buildEventEmitter(args).assertEmitted(); } get description() { return this.method + ' ' + this.url; @@ -7257,17 +7457,17 @@ createCommonjsModule(function (module) { header(name) { return this.headers[name]; } - addAutoHeaders() { + _addAutoHeaders() { for (let key of ['target', 'failTarget', 'mode', 'failMode', 'context', 'failContext']) { - this.addAutoHeader(up.protocol.headerize(key), this[key]); + this._addAutoHeader(up.protocol.headerize(key), this[key]); } let csrfHeader, csrfToken; if ((csrfHeader = this.csrfHeader()) && (csrfToken = this.csrfToken())) { - this.addAutoHeader(csrfHeader, csrfToken); + this._addAutoHeader(csrfHeader, csrfToken); } - this.addAutoHeader(up.protocol.headerize('version'), up.version); + this._addAutoHeader(up.protocol.headerize('version'), up.version); } - addAutoHeader(name, value) { + _addAutoHeader(name, value) { if (u.isMissing(value)) { return; } @@ -7303,7 +7503,7 @@ createCommonjsModule(function (module) { })(), _a); /***/ - }, /* 71 */ + }), ( /* 70 */ /***/() => { const u = up.util; up.Request.Cache = class Cache { @@ -7311,66 +7511,65 @@ createCommonjsModule(function (module) { this.reset(); } reset() { - this.varyInfo = {}; - this.map = new Map(); + this._varyInfo = {}; + this._map = new Map(); } - cacheKey(request) { - let influencingHeaders = this.getPreviousInfluencingHeaders(request); + _cacheKey(request) { + let influencingHeaders = this._getPreviousInfluencingHeaders(request); let varyPart = u.flatMap(influencingHeaders, headerName => [headerName, request.header(headerName)]); return [request.description, ...varyPart].join(':'); } - getPreviousInfluencingHeaders(request) { - var _a, _b; - return (_a = this.varyInfo)[_b = request.description] || (_a[_b] = new Set()); + _getPreviousInfluencingHeaders(request) { + return this._varyInfo[request.description] ||= new Set(); } get(request) { - request = this.wrap(request); - let cacheKey = this.cacheKey(request); - let cachedRequest = this.map.get(cacheKey); + request = this._wrap(request); + let cacheKey = this._cacheKey(request); + let cachedRequest = this._map.get(cacheKey); if (cachedRequest) { - if (this.isUsable(cachedRequest)) { + if (this._isUsable(cachedRequest)) { return cachedRequest; } else { - this.map.delete(cacheKey); + this._map.delete(cacheKey); } } } - get capacity() { + get _capacity() { return up.network.config.cacheSize; } - isUsable(request) { + _isUsable(request) { return request.age < up.network.config.cacheEvictAge; } async put(request) { - request = this.wrap(request); - this.makeRoom(); - let cacheKey = this.updateCacheKey(request); - this.map.set(cacheKey, request); + request = this._wrap(request); + this._makeRoom(); + let cacheKey = this._updateCacheKey(request); + this._map.set(cacheKey, request); } - updateCacheKey(request) { - let oldCacheKey = this.cacheKey(request); + _updateCacheKey(request) { + let oldCacheKey = this._cacheKey(request); let { response } = request; if (response) { - this.mergePreviousHeaderNames(request, response); - let newCacheKey = this.cacheKey(request); - this.renameMapKey(oldCacheKey, newCacheKey); + this._mergePreviousHeaderNames(request, response); + let newCacheKey = this._cacheKey(request); + this._renameMapKey(oldCacheKey, newCacheKey); return newCacheKey; } else { return oldCacheKey; } } - renameMapKey(oldKey, newKey) { - if (oldKey !== newKey && this.map.has(oldKey)) { - this.map.set(newKey, this.map.get(oldKey)); - this.map.delete(oldKey); + _renameMapKey(oldKey, newKey) { + if (oldKey !== newKey && this._map.has(oldKey)) { + this._map.set(newKey, this._map.get(oldKey)); + this._map.delete(oldKey); } } - mergePreviousHeaderNames(request, response) { + _mergePreviousHeaderNames(request, response) { let headersInfluencingResponse = response.ownInfluncingHeaders; if (headersInfluencingResponse.length) { - let previousInfluencingHeaders = this.getPreviousInfluencingHeaders(request); + let previousInfluencingHeaders = this._getPreviousInfluencingHeaders(request); for (let headerName of headersInfluencingResponse) { previousInfluencingHeaders.add(headerName); } @@ -7379,7 +7578,7 @@ createCommonjsModule(function (module) { alias(existingCachedRequest, newRequest) { existingCachedRequest = this.get(existingCachedRequest); if (!existingCachedRequest) return; - newRequest = this.wrap(newRequest); + newRequest = this._wrap(newRequest); this.track(existingCachedRequest, newRequest, { force: true }); @@ -7391,7 +7590,7 @@ createCommonjsModule(function (module) { newRequest.state = 'tracking'; let value = await u.always(existingRequest); if (value instanceof up.Response) { - if (options.force || this.isCacheCompatible(existingRequest, newRequest)) { + if (options.force || this._isCacheCompatible(existingRequest, newRequest)) { newRequest.fromCache = true; value = u.variant(value, { request: newRequest @@ -7411,38 +7610,38 @@ createCommonjsModule(function (module) { willHaveSameResponse(existingRequest, newRequest) { return existingRequest === newRequest || existingRequest === newRequest.trackedRequest; } - delete(request) { - request = this.wrap(request); - let cacheKey = this.cacheKey(request); - this.map.delete(cacheKey); + _delete(request) { + request = this._wrap(request); + let cacheKey = this._cacheKey(request); + this._map.delete(cacheKey); } evict(condition = true, testerOptions) { - this.eachMatch(condition, testerOptions, request => this.delete(request)); + this._eachMatch(condition, testerOptions, request => this._delete(request)); } expire(condition = true, testerOptions) { - this.eachMatch(condition, testerOptions, request => request.expired = true); + this._eachMatch(condition, testerOptions, request => request.expired = true); } - makeRoom() { - while (this.map.size >= this.capacity) { - let oldestKey = this.map.keys().next().value; - this.map.delete(oldestKey); + _makeRoom() { + while (this._map.size >= this._capacity) { + let oldestKey = this._map.keys().next().value; + this._map.delete(oldestKey); } } - eachMatch(condition = true, testerOptions, fn) { + _eachMatch(condition = true, testerOptions, fn) { let tester = up.Request.tester(condition, testerOptions); - let results = u.filter(this.map.values(), tester); + let results = u.filter(this._map.values(), tester); u.each(results, fn); } - isCacheCompatible(request1, request2) { - return this.cacheKey(request1) === this.cacheKey(request2); + _isCacheCompatible(request1, request2) { + return this._cacheKey(request1) === this._cacheKey(request2); } - wrap(requestOrOptions) { + _wrap(requestOrOptions) { return u.wrapValue(up.Request, requestOrOptions); } }; /***/ - }, /* 72 */ + }), ( /* 71 */ /***/() => { const u = up.util; up.Request.Queue = class Queue { @@ -7450,65 +7649,65 @@ createCommonjsModule(function (module) { this.reset(); } reset() { - this.queuedRequests = []; - this.currentRequests = []; - this.emittedLate = false; + this._queuedRequests = []; + this._currentRequests = []; + this._emittedLate = false; } get allRequests() { - return this.currentRequests.concat(this.queuedRequests); + return this._currentRequests.concat(this._queuedRequests); } asap(request) { request.runQueuedCallbacks(); - u.always(request, responseOrError => this.onRequestSettled(request, responseOrError)); - this.scheduleSlowTimer(request); - this.queueRequest(request); - u.microtask(() => this.poke()); + u.always(request, responseOrError => this._onRequestSettled(request, responseOrError)); + this._scheduleSlowTimer(request); + this._queueRequest(request); + u.microtask(() => this._poke()); } promoteToForeground(request) { if (request.background) { request.background = false; - this.scheduleSlowTimer(request); + this._scheduleSlowTimer(request); } } - scheduleSlowTimer(request) { + _scheduleSlowTimer(request) { let timeUntilLate = Math.max(request.badResponseTime - request.age, 0); - u.timer(timeUntilLate, () => this.checkLate()); + u.timer(timeUntilLate, () => this._checkLate()); } - getMaxConcurrency() { + _getMaxConcurrency() { return u.evalOption(up.network.config.concurrency); } - hasConcurrencyLeft() { - const maxConcurrency = this.getMaxConcurrency(); - return maxConcurrency === -1 || this.currentRequests.length < maxConcurrency; + _hasConcurrencyLeft() { + const maxConcurrency = this._getMaxConcurrency(); + return maxConcurrency === -1 || this._currentRequests.length < maxConcurrency; } isBusy() { - return this.currentRequests.length > 0 || this.queuedRequests.length > 0; + return this._currentRequests.length > 0 || this._queuedRequests.length > 0; } - queueRequest(request) { - this.queuedRequests.push(request); + _queueRequest(request) { + this._queuedRequests.push(request); } - pluckNextRequest() { - let request = u.find(this.queuedRequests, request => !request.background); - request || (request = this.queuedRequests[0]); - return u.remove(this.queuedRequests, request); + _pluckNextRequest() { + let request = u.find(this._queuedRequests, request => !request.background); + request ||= this._queuedRequests[0]; + return u.remove(this._queuedRequests, request); } - sendRequestNow(request) { + _sendRequestNow(request) { if (request.load()) { - this.currentRequests.push(request); + this._currentRequests.push(request); } } - onRequestSettled(request, responseOrError) { - u.remove(this.currentRequests, request) || u.remove(this.queuedRequests, request); + _onRequestSettled(request, responseOrError) { + u.remove(this._currentRequests, request) || u.remove(this._queuedRequests, request); if (responseOrError instanceof up.Response && responseOrError.ok) { up.network.registerAliasForRedirect(request, responseOrError); } - this.checkLate(); - u.microtask(() => this.poke()); + this._checkLate(); + u.microtask(() => this._poke()); } - poke() { + _poke() { let request; - if (this.hasConcurrencyLeft() && (request = this.pluckNextRequest())) { - return this.sendRequestNow(request); + if (this._hasConcurrencyLeft() && (request = this._pluckNextRequest())) { + return this._sendRequestNow(request); } } abort(...args) { @@ -7522,7 +7721,7 @@ createCommonjsModule(function (module) { let tester = up.Request.tester(conditions, { except }); - for (let list of [this.currentRequests, this.queuedRequests]) { + for (let list of [this._currentRequests, this._queuedRequests]) { const abortableRequests = u.filter(list, tester); for (let abortableRequest of abortableRequests) { if (logOnce) { @@ -7536,10 +7735,10 @@ createCommonjsModule(function (module) { } } } - checkLate() { - const currentLate = this.isLate(); - if (this.emittedLate !== currentLate) { - this.emittedLate = currentLate; + _checkLate() { + const currentLate = this._isLate(); + if (this._emittedLate !== currentLate) { + this._emittedLate = currentLate; if (currentLate) { up.emit('up:network:late', { log: 'Server is slow to respond' @@ -7551,7 +7750,7 @@ createCommonjsModule(function (module) { } } } - isLate() { + _isLate() { const allForegroundRequests = u.reject(this.allRequests, 'background'); const timerTolerance = 1; return u.some(allForegroundRequests, request => request.age >= request.badResponseTime - timerTolerance); @@ -7559,49 +7758,49 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 73 */ + }), ( /* 72 */ /***/() => { const u = up.util; const e = up.element; const HTML_FORM_METHODS = ['GET', 'POST']; up.Request.FormRenderer = class FormRenderer { constructor(request) { - this.request = request; + this._request = request; } buildAndSubmit() { - this.params = u.copy(this.request.params); - let action = this.request.url; + this.params = u.copy(this._request.params); + let action = this._request.url; let { method - } = this.request; + } = this._request; const paramsFromQuery = up.Params.fromURL(action); this.params.addAll(paramsFromQuery); action = up.Params.stripURL(action); if (!u.contains(HTML_FORM_METHODS, method)) { method = up.protocol.wrapMethod(method, this.params); } - this.form = e.affix(document.body, 'form.up-request-loader', { + this._form = e.affix(document.body, 'form.up-request-loader', { method, action }); - let contentType = this.request.contentType; + let contentType = this._request.contentType; if (contentType) { - this.form.setAttribute('enctype', contentType); + this._form.setAttribute('enctype', contentType); } let csrfParam, csrfToken; - if ((csrfParam = this.request.csrfParam()) && (csrfToken = this.request.csrfToken())) { + if ((csrfParam = this._request.csrfParam()) && (csrfToken = this._request.csrfToken())) { this.params.add(csrfParam, csrfToken); } - u.each(this.params.toArray(), this.addField.bind(this)); - up.browser.submitForm(this.form); + u.each(this.params.toArray(), this._addField.bind(this)); + up.browser.submitForm(this._form); } - addField(attrs) { - e.affix(this.form, 'input[type=hidden]', attrs); + _addField(attrs) { + e.affix(this._form, 'input[type=hidden]', attrs); } }; /***/ - }, /* 74 */ + }), ( /* 73 */ /***/() => { var _a; const CONTENT_TYPE_URL_ENCODED = 'application/x-www-form-urlencoded'; @@ -7609,64 +7808,65 @@ createCommonjsModule(function (module) { const u = up.util; up.Request.XHRRenderer = (_a = class XHRRenderer { constructor(request) { - this.request = request; + this._request = request; } buildAndSend(handlers) { - const xhr = this.request.xhr; - this.params = u.copy(this.request.params); - if (this.request.timeout) { - xhr.timeout = this.request.timeout; + const xhr = this._request.xhr; + this._params = u.copy(this._request.params); + if (this._request.timeout) { + xhr.timeout = this._request.timeout; } - xhr.open(this.getMethod(), this.request.url); - let contentType = this.getContentType(); + xhr.open(this._getMethod(), this._request.url); + let contentType = this._getContentType(); if (contentType) { xhr.setRequestHeader('Content-Type', contentType); } - for (let headerName in this.request.headers) { - let headerValue = this.request.headers[headerName]; + for (let headerName in this._request.headers) { + let headerValue = this._request.headers[headerName]; xhr.setRequestHeader(headerName, headerValue); } Object.assign(xhr, handlers); - xhr.send(this.getPayload()); + xhr.send(this._getPayload()); } - getMethod() { - if (!this.method) { - this.method = this.request.method; - if (this.request.wrapMethod && !this.request.will302RedirectWithGET()) { - this.method = up.protocol.wrapMethod(this.method, this.params); - } + _getMethod() { + let method = this._request.method; + if (this._request.wrapMethod && !this._request.will302RedirectWithGET()) { + method = up.protocol.wrapMethod(method, this._params); } - return this.method; + return method; } - getContentType() { - this.finalizePayload(); - return this.contentType; + _getContentType() { + this._finalizePayload(); + return this._contentType; } - getPayload() { - this.finalizePayload(); - return this.payload; + _getPayload() { + this._finalizePayload(); + return this._payload; } - finalizePayload() { - this.payload = this.request.payload; - this.contentType = this.request.contentType; - if (!this.payload && this.request.allowsPayload()) { - if (!this.contentType) { - this.contentType = this.params.hasBinaryValues() ? CONTENT_TYPE_FORM_DATA : CONTENT_TYPE_URL_ENCODED; + _finalizePayload() { + this._payload = this._request.payload; + this._contentType = this._request.contentType; + if (!this._payload && this._request.allowsPayload()) { + if (!this._contentType) { + this._contentType = this._params.hasBinaryValues() ? CONTENT_TYPE_FORM_DATA : CONTENT_TYPE_URL_ENCODED; } - if (this.contentType === CONTENT_TYPE_FORM_DATA) { - this.contentType = null; - this.payload = this.params.toFormData(); + if (this._contentType === CONTENT_TYPE_FORM_DATA) { + this._contentType = null; + this._payload = this._params.toFormData(); } else { - this.payload = this.params.toQuery().replace(/%20/g, '+'); + this._payload = this._params.toQuery().replace(/%20/g, '+'); } } } }, (() => { - u.memoizeMethod(_a.prototype, ['finalizePayload']); + u.memoizeMethod(_a.prototype, { + _finalizePayload: true, + _getMethod: true + }); })(), _a); /***/ - }, /* 75 */ + }), ( /* 74 */ /***/() => { const u = up.util; up.Response = class Response extends up.Record { @@ -7711,7 +7911,7 @@ createCommonjsModule(function (module) { return this.header('ETag'); } get json() { - return this.parsedJSON || (this.parsedJSON = JSON.parse(this.text)); + return this.parsedJSON ||= JSON.parse(this.text); } get age() { let now = new Date(); @@ -7726,121 +7926,200 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 76 */ + }), ( /* 75 */ /***/() => { var _a; const u = up.util; const e = up.element; up.ResponseDoc = (_a = class ResponseDoc { - constructor(options) { - this.root = this.parseDocument(options) || this.parseFragment(options) || this.parseContent(options); + constructor({ + document, + fragment, + content, + target, + origin, + cspNonces, + match + }) { + if (document) { + this._parseDocument(document); + } else if (fragment) { + this._parseFragment(fragment); + } else { + this._parseContent(content || '', target); + } if (!up.fragment.config.runScripts) { - this.root.querySelectorAll('script').forEach(e => e.remove()); + this._document.querySelectorAll('script').forEach(e => e.remove()); } - this.cspNonces = options.cspNonces; - if (options.origin) { - let originSelector = up.fragment.tryToTarget(options.origin); + this._cspNonces = cspNonces; + if (origin) { + let originSelector = up.fragment.tryToTarget(origin); if (originSelector) { - this.rediscoveredOrigin = this.select(originSelector); + this._rediscoveredOrigin = this.select(originSelector); } } + this._match = match; } - parseDocument(options) { - let document = this.parse(options.document, e.createBrokenDocumentFromHTML); - if (document) { - this.scriptishNeedFix = true; - return document; - } + _parseDocument(document) { + document = this._parse(document, e.createBrokenDocumentFromHTML); + this._isDocumentBroken = true; + this._useParseResult(document); } - parseContent(options) { - let content = options.content || ''; - let target = options.target || up.fail("must pass a { target } when passing { content }"); - target = u.map(up.fragment.parseTargetSteps(target), 'selector').join(','); + _parseFragment(fragment) { + fragment = this._parse(fragment, e.createFromHTML); + this._useParseResult(fragment); + } + _parseContent(content, target) { + if (!target) up.fail("must pass a { target } when passing { content }"); + target = u.map(up.fragment.parseTargetSteps(target), 'selector').join(); const matchingElement = e.createFromSelector(target); if (u.isString(content)) { matchingElement.innerHTML = content; } else { matchingElement.appendChild(content); } - return matchingElement; - } - parseFragment(options) { - return this.parse(options.fragment); + this._useParseResult(matchingElement); } - parse(value, parseFn = e.createFromHTML) { + _parse(value, parseFn) { if (u.isString(value)) { value = parseFn(value); } return value; } + _useParseResult(node) { + if (node instanceof Document) { + this._document = node; + } else { + this._document = document.createElement('up-document'); + this._document.append(node); + this._document.documentElement = node; + } + } rootSelector() { - return up.fragment.toTarget(this.root); + return up.fragment.toTarget(this._document.documentElement); + } + get title() { + return this._fromHead(this._getTitleText); + } + _getHead() { + let { + head + } = this._document; + if (head && head.childNodes.length > 0) { + return head; + } } - getTitle() { - return this.root.querySelector('head title')?.textContent; + _fromHead(fn) { + let head = this._getHead(); + return head && fn(head); + } + get metaTags() { + return this._fromHead(up.history.findMetaTags); + } + get assets() { + return this._fromHead(up.script.findAssets); + } + _getTitleText(head) { + return head.querySelector('title')?.textContent; } select(selector) { let finder = new up.FragmentFinder({ selector: selector, - origin: this.rediscoveredOrigin, - externalRoot: this.root + origin: this._rediscoveredOrigin, + document: this._document, + match: this._match }); return finder.find(); } selectSteps(steps) { return steps.filter(step => { - step.newElement || (step.newElement = this.select(step.selector)); - if (step.newElement) { + return this._trySelectStep(step) || this._cannotMatchStep(step); + }); + } + commitSteps(steps) { + return steps.filter(step => { + if (this._document.contains(step.newElement)) { + step.newElement.remove(); return true; - } else if (!step.maybe) { - throw new up.CannotMatch(); } }); } + _trySelectStep(step) { + if (step.newElement) { + return true; + } + let newElement = this.select(step.selector); + if (!newElement) { + return; + } + let { + selectEvent + } = step; + if (selectEvent) { + selectEvent.newFragment = newElement; + selectEvent.renderOptions = step.originalRenderOptions; + up.emit(step.oldElement, selectEvent, { + callback: step.selectCallback + }); + if (selectEvent.defaultPrevented) { + return; + } + } + step.newElement = newElement; + return true; + } + _cannotMatchStep(step) { + if (!step.maybe) { + throw new up.CannotMatch(); + } + } finalizeElement(element) { - up.NonceableCallback.adoptNonces(element, this.cspNonces); - if (this.scriptishNeedFix) { - element.querySelectorAll('noscript, script').forEach(e.fixScriptish); + up.NonceableCallback.adoptNonces(element, this._cspNonces); + if (this._isDocumentBroken) { + let brokenElements = e.subtree(element, ':is(noscript,script,audio,video):not(.up-keeping, .up-keeping *)'); + u.each(brokenElements, e.fixParserDamage); } } }, (() => { - u.memoizeMethod(_a.prototype, 'getTitle'); + u.memoizeMethod(_a.prototype, { + _getHead: true + }); })(), _a); /***/ - }, /* 77 */ + }), ( /* 76 */ /***/() => { const e = up.element; const u = up.util; up.RevealMotion = class RevealMotion { constructor(element, options = {}) { - this.element = element; - this.options = options; - this.viewport = e.get(this.options.viewport) || up.viewport.get(this.element); - this.obstructionsLayer = up.layer.get(this.viewport); + this._element = element; + this._options = options; + this._viewport = e.get(this._options.viewport) || up.viewport.get(this._element); + this._obstructionsLayer = up.layer.get(this._viewport); const viewportConfig = up.viewport.config; - this.snap = this.options.snap ?? this.options.revealSnap ?? viewportConfig.revealSnap; - this.padding = this.options.padding ?? this.options.revealPadding ?? viewportConfig.revealPadding; - this.top = this.options.top ?? this.options.revealTop ?? viewportConfig.revealTop; - this.max = this.options.max ?? this.options.revealMax ?? viewportConfig.revealMax; - this.topObstructions = viewportConfig.fixedTop; - this.bottomObstructions = viewportConfig.fixedBottom; + this._snap = this._options.snap ?? this._options.revealSnap ?? viewportConfig.revealSnap; + this._padding = this._options.padding ?? this._options.revealPadding ?? viewportConfig.revealPadding; + this._top = this._options.top ?? this._options.revealTop ?? viewportConfig.revealTop; + this._max = this._options.max ?? this._options.revealMax ?? viewportConfig.revealMax; + this._topObstructions = viewportConfig.fixedTopSelectors; + this._bottomObstructions = viewportConfig.fixedBottomSelectors; } start() { - const viewportRect = this.getViewportRect(this.viewport); - const elementRect = up.Rect.fromElement(this.element); - if (this.max) { - const maxPixels = u.evalOption(this.max, this.element); + const viewportRect = this._getViewportRect(this._viewport); + const elementRect = up.Rect.fromElement(this._element); + if (this._max) { + const maxPixels = u.evalOption(this._max, this._element); elementRect.height = Math.min(elementRect.height, maxPixels); } - this.addPadding(elementRect); - this.substractObstructions(viewportRect); + this._addPadding(elementRect); + this._substractObstructions(viewportRect); if (viewportRect.height < 0) { up.fail('Viewport has no visible area'); } - const originalScrollTop = this.viewport.scrollTop; + const originalScrollTop = this._viewport.scrollTop; let newScrollTop = originalScrollTop; - if (this.top || elementRect.height > viewportRect.height) { + if (this._top || elementRect.height > viewportRect.height) { const diff = elementRect.top - viewportRect.top; newScrollTop += diff; } else if (elementRect.top < viewportRect.top) { @@ -7848,18 +8127,18 @@ createCommonjsModule(function (module) { } else if (elementRect.bottom > viewportRect.bottom) { newScrollTop += elementRect.bottom - viewportRect.bottom; } else ; - if (u.isNumber(this.snap) && newScrollTop < this.snap && elementRect.top < 0.5 * viewportRect.height) { + if (u.isNumber(this._snap) && newScrollTop < this._snap && elementRect.top < 0.5 * viewportRect.height) { newScrollTop = 0; } if (newScrollTop !== originalScrollTop) { - this.viewport.scrollTo({ - ...this.options, + this._viewport.scrollTo({ + ...this._options, top: newScrollTop }); } } - getViewportRect() { - if (up.viewport.isRoot(this.viewport)) { + _getViewportRect() { + if (up.viewport.isRoot(this._viewport)) { return new up.Rect({ left: 0, top: 0, @@ -7867,21 +8146,21 @@ createCommonjsModule(function (module) { height: up.viewport.rootHeight() }); } else { - return up.Rect.fromElement(this.viewport); + return up.Rect.fromElement(this._viewport); } } - addPadding(elementRect) { - elementRect.top -= this.padding; - elementRect.height += 2 * this.padding; + _addPadding(elementRect) { + elementRect.top -= this._padding; + elementRect.height += 2 * this._padding; } - selectObstructions(selectors) { - let elements = up.fragment.all(selectors.join(','), { - layer: this.obstructionsLayer + _selectObstructions(selectors) { + let elements = up.fragment.all(selectors.join(), { + layer: this._obstructionsLayer }); return u.filter(elements, e.isVisible); } - substractObstructions(viewportRect) { - for (let obstruction of this.selectObstructions(this.topObstructions)) { + _substractObstructions(viewportRect) { + for (let obstruction of this._selectObstructions(this._topObstructions)) { let obstructionRect = up.Rect.fromElement(obstruction); let diff = obstructionRect.bottom - viewportRect.top; if (diff > 0) { @@ -7889,7 +8168,7 @@ createCommonjsModule(function (module) { viewportRect.height -= diff; } } - for (let obstruction of this.selectObstructions(this.bottomObstructions)) { + for (let obstruction of this._selectObstructions(this._bottomObstructions)) { let obstructionRect = up.Rect.fromElement(obstruction); let diff = viewportRect.bottom - obstructionRect.top; if (diff > 0) { @@ -7900,17 +8179,42 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 78 */ + }), ( /* 77 */ /***/() => { const u = up.util; + const CSS_HAS_SUFFIX_PATTERN = /:has\(([^)]+)\)$/; up.Selector = class Selector { - constructor(selectors, filters = []) { - this.selectors = selectors; - this.filters = filters; - this.unionSelector = this.selectors.join(',') || 'match-none'; + constructor(selector, elementOrDocument, options = {}) { + this._filters = []; + if (!options.destroying) { + this._filters.push(up.fragment.isNotDestroying); + } + let matchingInExternalDocument = elementOrDocument && !document.contains(elementOrDocument); + let expandTargetLayer; + if (matchingInExternalDocument || options.layer === 'any') { + expandTargetLayer = up.layer.root; + } else { + options.layer ??= u.presence(elementOrDocument, u.isElement); + this._layers = up.layer.getAll(options); + if (!this._layers.length) throw new up.CannotMatch(["Unknown layer: %o", options.layer]); + this._filters.push(match => u.some(this._layers, layer => layer.contains(match))); + expandTargetLayer = this._layers[0]; + } + let expandedTargets = up.fragment.expandTargets(selector, { + ...options, + layer: expandTargetLayer + }); + this._selectors = expandedTargets.map(target => { + target = target.replace(CSS_HAS_SUFFIX_PATTERN, (match, descendantSelector) => { + this._filters.push(element => element.querySelector(descendantSelector)); + return ''; + }); + return target || '*'; + }); + this._unionSelector = this._selectors.join() || 'match-none'; } matches(element) { - return element.matches(this.unionSelector) && this.passesFilter(element); + return element.matches(this._unionSelector) && this._passesFilter(element); } closest(element) { let parentElement; @@ -7920,12 +8224,12 @@ createCommonjsModule(function (module) { return this.closest(parentElement); } } - passesFilter(element) { - return u.every(this.filters, filter => filter(element)); + _passesFilter(element) { + return u.every(this._filters, filter => filter(element)); } - descendants(root) { - const results = u.flatMap(this.selectors, selector => root.querySelectorAll(selector)); - return u.filter(results, element => this.passesFilter(element)); + descendants(root = document) { + const results = u.flatMap(this._selectors, selector => root.querySelectorAll(selector)); + return u.filter(results, element => this._passesFilter(element)); } subtree(root) { const results = []; @@ -7938,60 +8242,60 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 79 */ + }), ( /* 78 */ /***/() => { const u = up.util; const e = up.element; up.Tether = class Tether { constructor(options) { up.migrate.handleTetherOptions?.(options); - this.anchor = options.anchor; - this.align = options.align; - this.position = options.position; - this.alignAxis = this.position === 'top' || this.position === 'bottom' ? 'horizontal' : 'vertical'; - this.viewport = up.viewport.get(this.anchor); - this.parent = this.viewport === e.root ? document.body : this.viewport; - this.syncOnScroll = !this.viewport.contains(this.anchor.offsetParent); + this._anchor = options.anchor; + this._align = options.align; + this._position = options.position; + this._alignAxis = this._position === 'top' || this._position === 'bottom' ? 'horizontal' : 'vertical'; + this._viewport = up.viewport.get(this._anchor); + this.parent = this._viewport === e.root ? document.body : this._viewport; + this._syncOnScroll = !this._viewport.contains(this._anchor.offsetParent); } start(element) { - this.element = element; - this.element.style.position = 'absolute'; - this.setOffset(0, 0); + this._element = element; + this._element.style.position = 'absolute'; + this._setOffset(0, 0); this.sync(); - this.changeEventSubscription('on'); + this._changeEventSubscription('on'); } stop() { - this.changeEventSubscription('off'); + this._changeEventSubscription('off'); } - changeEventSubscription(fn) { - let doScheduleSync = this.scheduleSync.bind(this); + _changeEventSubscription(fn) { + let doScheduleSync = this._scheduleSync.bind(this); up[fn](window, 'resize', doScheduleSync); - if (this.syncOnScroll) { - up[fn](this.viewport, 'scroll', doScheduleSync); + if (this._syncOnScroll) { + up[fn](this._viewport, 'scroll', doScheduleSync); } } - scheduleSync() { + _scheduleSync() { clearTimeout(this.syncTimer); return this.syncTimer = u.task(this.sync.bind(this)); } isDetached() { - return !this.parent.isConnected || !this.anchor.isConnected; + return !this.parent.isConnected || !this._anchor.isConnected; } sync() { - const elementBox = this.element.getBoundingClientRect(); + const elementBox = this._element.getBoundingClientRect(); const elementMargin = { - top: e.styleNumber(this.element, 'marginTop'), - right: e.styleNumber(this.element, 'marginRight'), - bottom: e.styleNumber(this.element, 'marginBottom'), - left: e.styleNumber(this.element, 'marginLeft') + top: e.styleNumber(this._element, 'marginTop'), + right: e.styleNumber(this._element, 'marginRight'), + bottom: e.styleNumber(this._element, 'marginBottom'), + left: e.styleNumber(this._element, 'marginLeft') }; - const anchorBox = this.anchor.getBoundingClientRect(); + const anchorBox = this._anchor.getBoundingClientRect(); let left; let top; - switch (this.alignAxis) { + switch (this._alignAxis) { case 'horizontal': { - switch (this.position) { + switch (this._position) { case 'top': top = anchorBox.top - elementMargin.bottom - elementBox.height; break; @@ -7999,7 +8303,7 @@ createCommonjsModule(function (module) { top = anchorBox.top + anchorBox.height + elementMargin.top; break; } - switch (this.align) { + switch (this._align) { case 'left': left = anchorBox.left + elementMargin.left; break; @@ -8014,7 +8318,7 @@ createCommonjsModule(function (module) { } case 'vertical': { - switch (this.align) { + switch (this._align) { case 'top': top = anchorBox.top + elementMargin.top; break; @@ -8025,7 +8329,7 @@ createCommonjsModule(function (module) { top = anchorBox.top + anchorBox.height - elementBox.height - elementMargin.bottom; break; } - switch (this.position) { + switch (this._position) { case 'left': left = anchorBox.left - elementMargin.right - elementBox.width; break; @@ -8037,25 +8341,25 @@ createCommonjsModule(function (module) { } } if (u.isDefined(left) || u.isDefined(top)) { - this.moveTo(left, top); + this._moveTo(left, top); } else { - up.fail('Invalid tether constraints: %o', this.describeConstraints()); + up.fail('Invalid tether constraints: %o', this._describeConstraints()); } } - describeConstraints() { + _describeConstraints() { return { - position: this.position, - align: this.align + position: this._position, + align: this._align }; } - moveTo(targetLeft, targetTop) { - const elementBox = this.element.getBoundingClientRect(); - this.setOffset(targetLeft - elementBox.left + this.offsetLeft, targetTop - elementBox.top + this.offsetTop); + _moveTo(targetLeft, targetTop) { + const elementBox = this._element.getBoundingClientRect(); + this._setOffset(targetLeft - elementBox.left + this.offsetLeft, targetTop - elementBox.top + this.offsetTop); } - setOffset(left, top) { + _setOffset(left, top) { this.offsetLeft = left; this.offsetTop = top; - e.setStyle(this.element, { + e.setStyle(this._element, { left, top }); @@ -8063,13 +8367,13 @@ createCommonjsModule(function (module) { }; /***/ - }, /* 80 */ + }), ( /* 79 */ /***/() => { const u = up.util; up.URLPattern = class URLPattern { constructor(fullPattern, normalizeURL = u.normalizeURL) { - this.normalizeURL = normalizeURL; - this.groups = []; + this._normalizeURL = normalizeURL; + this._groups = []; const positiveList = []; const negativeList = []; for (let pattern of u.parseTokens(fullPattern)) { @@ -8079,10 +8383,10 @@ createCommonjsModule(function (module) { positiveList.push(pattern); } } - this.positiveRegexp = this.buildRegexp(positiveList, true); - this.negativeRegexp = this.buildRegexp(negativeList, false); + this._positiveRegexp = this._buildRegexp(positiveList, true); + this._negativeRegexp = this._buildRegexp(negativeList, false); } - buildRegexp(list, capture) { + _buildRegexp(list, capture) { if (!list.length) { return; } @@ -8090,7 +8394,7 @@ createCommonjsModule(function (module) { if (url[0] === '*') { url = '/' + url; } - url = this.normalizeURL(url); + url = this._normalizeURL(url); url = u.escapeRegExp(url); return url; }); @@ -8099,7 +8403,7 @@ createCommonjsModule(function (module) { reCode = reCode.replace(/(:|\\\$)([a-z][\w-]*)/ig, (match, type, name) => { if (type === '\\$') { if (capture) { - this.groups.push({ + this._groups.push({ name, cast: Number }); @@ -8107,7 +8411,7 @@ createCommonjsModule(function (module) { return '(\\d+)'; } else { if (capture) { - this.groups.push({ + this._groups.push({ name, cast: String }); @@ -8119,18 +8423,18 @@ createCommonjsModule(function (module) { } test(url, doNormalize = true) { if (doNormalize) { - url = this.normalizeURL(url); + url = this._normalizeURL(url); } - return this.positiveRegexp.test(url) && !this.isExcluded(url); + return this._positiveRegexp.test(url) && !this._isExcluded(url); } recognize(url, doNormalize = true) { if (doNormalize) { - url = this.normalizeURL(url); + url = this._normalizeURL(url); } - let match = this.positiveRegexp.exec(url); - if (match && !this.isExcluded(url)) { + let match = this._positiveRegexp.exec(url); + if (match && !this._isExcluded(url)) { const resolution = {}; - this.groups.forEach((group, groupIndex) => { + this._groups.forEach((group, groupIndex) => { let value = match[groupIndex + 1]; if (value) { return resolution[group.name] = group.cast(value); @@ -8139,13 +8443,13 @@ createCommonjsModule(function (module) { return resolution; } } - isExcluded(url) { - return this.negativeRegexp?.test(url); + _isExcluded(url) { + return this._negativeRegexp?.test(url); } }; /***/ - }, /* 81 */ + }), ( /* 80 */ /***/() => { up.framework = function () { let readyState = 'evaling'; @@ -8239,7 +8543,7 @@ createCommonjsModule(function (module) { up.boot = up.framework.boot; /***/ - }, /* 82 */ + }), ( /* 81 */ /***/() => { up.event = function () { const u = up.util; @@ -8338,7 +8642,7 @@ createCommonjsModule(function (module) { up.emit = up.event.emit; /***/ - }, /* 83 */ + }), ( /* 82 */ /***/() => { up.protocol = function () { const u = up.util; @@ -8410,8 +8714,7 @@ createCommonjsModule(function (module) { cspNonce() { return e.metaContent('csp-nonce'); }, - csrfHeader: 'X-CSRF-Token', - nonceableAttributes: ['up-watch', 'up-on-accepted', 'up-on-dismissed', 'up-on-loaded', 'up-on-rendered', 'up-on-finished', 'up-on-error', 'up-on-offlne'] + csrfHeader: 'X-CSRF-Token' })); function csrfHeader() { return u.evalOption(config.csrfHeader); @@ -8475,7 +8778,7 @@ createCommonjsModule(function (module) { }(); /***/ - }, /* 84 */ + }), ( /* 83 */ /***/() => { up.log = function () { const u = up.util; @@ -8516,7 +8819,7 @@ createCommonjsModule(function (module) { const logo = " __ _____ ___ ___ / /_ __\n" + `/ // / _ \\/ _ \\/ _ \\/ / // / ${up.version}\n` + "\\___/_//_/ .__/\\___/_/\\_. / \n" + " / / / /\n\n"; let text = ""; if (!up.migrate.loaded) { - text += "Load unpoly-migrate.js to enable deprecated APIs.\n\n"; + text += "Load unpoly-migrate.js to polyfill deprecated APIs.\n\n"; } if (config.enabled) { text += "Call `up.log.disable()` to disable logging for this session."; @@ -8552,10 +8855,16 @@ createCommonjsModule(function (module) { up.warn = up.log.warn; /***/ - }, /* 85 */ + }), ( /* 84 */ /***/() => { - up.syntax = function () { + up.script = function () { const u = up.util; + const e = up.element; + const config = new up.Config(() => ({ + assetSelectors: ['link[rel=stylesheet]', 'script[src]', '[up-asset]'], + noAssetSelectors: ['[up-asset=false]'], + nonceableAttributes: ['up-watch', 'up-on-accepted', 'up-on-dismissed', 'up-on-loaded', 'up-on-rendered', 'up-on-finished', 'up-on-error', 'up-on-offline'] + })); const SYSTEM_MACRO_PRIORITIES = { '[up-back]': -100, '[up-content]': -200, @@ -8565,6 +8874,7 @@ createCommonjsModule(function (module) { '[up-popup]': -200, '[up-tooltip]': -200, '[up-dash]': -200, + '[up-flashes]': -200, '[up-expand]': -300, '[data-method]': -400, '[data-confirm]': -400 @@ -8578,7 +8888,7 @@ createCommonjsModule(function (module) { function registerMacro(...args) { const macro = buildCompiler(args); if (up.framework.evaling) { - macro.priority || (macro.priority = detectSystemMacroPriority(macro.selector) || up.fail('Unregistered priority for system macro %o', macro.selector)); + macro.priority ||= detectSystemMacroPriority(macro.selector) || up.fail('Unregistered priority for system macro %o', macro.selector); } return insertCompiler(registeredMacros, macro); } @@ -8633,6 +8943,9 @@ createCommonjsModule(function (module) { return newCompiler; } function compile(fragment, options) { + up.emit(fragment, 'up:fragment:compile', { + log: false + }); let compilers = options.compilers || registeredMacros.concat(registeredCompilers); const pass = new up.CompilerPass(fragment, compilers, options); pass.run(); @@ -8662,7 +8975,7 @@ createCommonjsModule(function (module) { } function readData(element) { element = up.fragment.get(element); - return element.upData || (element.upData = buildData(element)); + return element.upData ||= buildData(element); } function buildData(element) { if (!element.getAttribute) { @@ -8682,35 +8995,57 @@ createCommonjsModule(function (module) { ...element.upCompileData }; } + function findAssets(head = document.head) { + return e.filteredQuery(head, config.assetSelectors, config.noAssetSelectors); + } + function assertAssetsOK(newAssets, renderOptions) { + let oldAssets = findAssets(); + let oldHTML = u.map(oldAssets, 'outerHTML').join(); + let newHTML = u.map(newAssets, 'outerHTML').join(); + if (oldHTML !== newHTML) { + up.event.assertEmitted('up:assets:changed', { + oldAssets, + newAssets, + renderOptions + }); + } + } function reset() { registeredCompilers = u.filter(registeredCompilers, 'isDefault'); registeredMacros = u.filter(registeredMacros, 'isDefault'); + config.reset(); } up.on('up:framework:reset', reset); return { + config, compiler: registerCompiler, macro: registerMacro, destructor: registerDestructor, hello, clean, - data: readData + data: readData, + findAssets, + assertAssetsOK }; }(); - up.compiler = up.syntax.compiler; - up.destructor = up.syntax.destructor; - up.macro = up.syntax.macro; - up.data = up.syntax.data; - up.hello = up.syntax.hello; + up.compiler = up.script.compiler; + up.destructor = up.script.destructor; + up.macro = up.script.macro; + up.data = up.script.data; + up.hello = up.script.hello; /***/ - }, /* 86 */ + }), ( /* 85 */ /***/() => { up.history = function () { const u = up.util; const e = up.element; const config = new up.Config(() => ({ enabled: true, - restoreTargets: ['body'] + updateMetaTags: true, + restoreTargets: ['body'], + metaTagSelectors: ['meta', 'link[rel=alternate]', 'link[rel=canonical]', 'link[rel=icon]', '[up-meta]'], + noMetaTagSelectors: ['meta[http-equiv]', '[up-meta=false]', 'meta[name=csp-nonce]'] })); let previousLocation; let nextPreviousLocation; @@ -8841,6 +9176,18 @@ createCommonjsModule(function (module) { setTimeout(register, 100); } }); + function findMetaTags(head = document.head) { + return e.filteredQuery(head, config.metaTagSelectors, config.noMetaTagSelectors); + } + function updateMetaTags(newMetaTags) { + let oldMetaTags = findMetaTags(); + for (let oldMetaTag of oldMetaTags) { + oldMetaTag.remove(); + } + for (let newMetaTag of newMetaTags) { + document.head.append(newMetaTag); + } + } up.macro('a[up-back], [up-href][up-back]', function (link) { if (previousLocation) { e.setMissingAttrs(link, { @@ -8863,14 +9210,16 @@ createCommonjsModule(function (module) { return previousLocation; }, normalizeURL, - isLocation + isLocation, + findMetaTags, + updateMetaTags }; }(); /***/ - }, /* 87 */ + }), ( /* 86 */ /***/(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - __webpack_require__(88); + __webpack_require__(87); const u = up.util; const e = up.element; up.fragment = function () { @@ -8882,7 +9231,7 @@ createCommonjsModule(function (module) { } const config = new up.Config(() => ({ badTargetClasses: [/^up-/], - targetDerivers: ['[up-id]', '[id]', 'html', 'head', 'body', 'main', '[up-main]', upTagName, 'link[rel][type]', 'link[rel=preload][href]', 'link[rel=preconnect][href]', 'link[rel=prefetch][href]', 'link[rel]', 'meta[property]', '*[name]', 'form[action]', 'a[href]', '[class]', 'form'], + targetDerivers: ['[up-id]', '[id]', 'html', 'head', 'body', 'main', '[up-main]', upTagName, 'link[rel][type]', 'link[rel=preload][href]', 'link[rel=preconnect][href]', 'link[rel=prefetch][href]', 'link[rel]', 'meta[property]', '*[name]', 'form[action]', 'a[href]', '[class]', '[up-flashes]', 'form'], verifyDerivedTarget: true, navigateOptions: { cache: 'auto', @@ -8894,7 +9243,7 @@ createCommonjsModule(function (module) { history: 'auto', peel: true }, - matchAroundOrigin: true, + match: 'region', runScripts: true, autoHistoryTargets: [':main'], autoFocus: ['hash', 'autofocus', 'main-if-main', 'keep', 'target-if-lost'], @@ -8948,23 +9297,24 @@ createCommonjsModule(function (module) { }); } function emitFragmentKeep(keepPlan) { - const log = ['Keeping fragment %o', keepPlan.oldElement]; - const callback = e.callbackAttr(keepPlan.oldElement, 'up-on-keep', { + let { + oldElement, + newElement: newFragment, + newData, + renderOptions + } = keepPlan; + const log = ['Keeping fragment %o', oldElement]; + const callback = e.callbackAttr(oldElement, 'up-on-keep', { exposedKeys: ['newFragment', 'newData'] }); - return emitFromKeepPlan(keepPlan, 'up:fragment:keep', { + return up.emit(oldElement, 'up:fragment:keep', { + newFragment, + newData, + renderOptions, log, callback }); } - function emitFromKeepPlan(keepPlan, eventType, emitDetails) { - const keepable = keepPlan.oldElement; - const event = up.event.build(eventType, { - newFragment: keepPlan.newElement, - newData: keepPlan.newData - }); - return up.emit(keepable, event, emitDetails); - } function emitFragmentDestroyed(fragment, options) { const log = options.log ?? ['Destroyed fragment %o', fragment]; const parent = options.parent || document; @@ -8993,13 +9343,13 @@ createCommonjsModule(function (module) { return new up.FragmentFinder({ selector, origin: options.origin, - layer: options.layer + layer: options.layer, + match: options.match }).find(); } function getDumb(...args) { return getAll(...args)[0]; } - const CSS_HAS_SUFFIX_PATTERN = /:has\(([^)]+)\)$/; function getAll(...args) { const options = u.extractOptions(args); let selectorString = args.pop(); @@ -9010,12 +9360,11 @@ createCommonjsModule(function (module) { if (u.isList(selectorString)) { return selectorString; } - let selector = buildSelector(selectorString, root, options); - return selector.descendants(root || document); + let selector = new up.Selector(selectorString, root, options); + return selector.descendants(root); } function getSubtree(element, selector, options = {}) { - selector = buildSelector(selector, element, options); - return selector.subtree(element); + return new up.Selector(selector, element, options).subtree(element); } function contains(root, selectorOrElement) { if (u.isElement(selectorOrElement)) { @@ -9025,9 +9374,7 @@ createCommonjsModule(function (module) { } } function closest(element, selector, options) { - element = e.get(element); - selector = buildSelector(selector, element, options); - return selector.closest(element); + return new up.Selector(selector, element, options).closest(element); } function destroy(...args) { const options = parseTargetAndOptions(args); @@ -9039,7 +9386,7 @@ createCommonjsModule(function (module) { function parseTargetAndOptions(args) { const options = u.parseArgIntoOptions(args, 'target'); if (u.isElement(options.target)) { - options.origin || (options.origin = options.target); + options.origin ||= options.target; } return options; } @@ -9049,9 +9396,9 @@ createCommonjsModule(function (module) { } function reload(...args) { const options = parseTargetAndOptions(args); - options.target || (options.target = ':main'); + options.target ||= ':main'; const element = getSmart(options.target, options); - options.url || (options.url = sourceOf(element)); + options.url ||= sourceOf(element); options.headers = u.merge(options.headers, conditionalHeaders(element)); if (options.keepData || e.booleanAttr(element, 'up-keep-data')) { options.data = up.data(element); @@ -9181,7 +9528,7 @@ createCommonjsModule(function (module) { return result; } function isGoodTarget(target, element, options = {}) { - return !element.isConnected || !config.verifyDerivedTarget || up.fragment.get(target, { + return !isAlive(element) || !config.verifyDerivedTarget || up.fragment.get(target, { layer: element, ...options }) === element; @@ -9223,7 +9570,12 @@ createCommonjsModule(function (module) { while (targets.length) { const target = targets.shift(); if (target === ':main' || target === true) { - const mode = layer === 'new' ? options.mode : layer.mode; + let mode; + if (layer === 'new') { + mode = options.mode || up.fail('Must pass a { mode } option together with { layer: "new" }'); + } else { + mode = layer.mode; + } targets.unshift(...up.layer.mainTargets(mode)); } else if (target === ':layer') { if (layer !== 'new' && !layer.opening) { @@ -9237,34 +9589,6 @@ createCommonjsModule(function (module) { } return u.uniq(expanded); } - function buildSelector(selector, element, options = {}) { - const filters = []; - if (!options.destroying) { - filters.push(isNotDestroying); - } - let elementOutsideDocumentGiven = element && !document.contains(element); - let expandTargetLayer; - if (elementOutsideDocumentGiven || options.layer === 'any') { - expandTargetLayer = up.layer.root; - } else { - options.layer ?? (options.layer = element); - const layers = up.layer.getAll(options); - filters.push(match => u.some(layers, layer => layer.contains(match))); - expandTargetLayer = layers[0]; - } - let expandedTargets = up.fragment.expandTargets(selector, { - ...options, - layer: expandTargetLayer - }); - expandedTargets = expandedTargets.map(function (target) { - target = target.replace(CSS_HAS_SUFFIX_PATTERN, function (match, descendantSelector) { - filters.push(element => element.querySelector(descendantSelector)); - return ''; - }); - return target || '*'; - }); - return new up.Selector(expandedTargets, filters); - } function splitTarget(target) { return u.parseTokens(target, { separator: 'comma' @@ -9290,7 +9614,8 @@ createCommonjsModule(function (module) { ...options, selector, placement, - maybe + maybe, + originalRenderOptions: options }; steps.push(step); } @@ -9310,15 +9635,16 @@ createCommonjsModule(function (module) { let target = tryToTarget(selector); return target && element.matches(target); } else { - selector = buildSelector(selector, element, options); - return selector.matches(element); + return new up.Selector(selector, element, options).matches(element); } } function shouldRevalidate(request, response, options = {}) { return request.fromCache && u.evalAutoOption(options.revalidate, config.autoRevalidate, response); } function targetForSteps(steps) { - return u.map(steps, 'selector').join(', ') || ':none'; + let requiredSteps = u.reject(steps, 'maybe'); + let selectors = u.map(requiredSteps, 'selector'); + return selectors.join(', ') || ':none'; } function isContainedByRivalStep(steps, candidateStep) { return u.some(steps, function (rivalStep) { @@ -9326,6 +9652,7 @@ createCommonjsModule(function (module) { }); } function compressNestedSteps(steps) { + if (steps.length < 2) return steps; let compressed = u.uniqBy(steps, 'oldElement'); compressed = u.reject(compressed, step => isContainedByRivalStep(compressed, step)); return compressed; @@ -9334,18 +9661,19 @@ createCommonjsModule(function (module) { let options = parseTargetAndOptions(args); let testFn; let { - reason + reason, + newLayer } = options; let elements; if (options.target) { elements = getAll(options.target, options); testFn = request => request.isPartOfSubtree(elements); - reason || (reason = 'Aborting requests within fragment'); + reason ||= 'Aborting requests within fragment'; } else { let layers = up.layer.getAll(options); elements = u.map(layers, 'element'); testFn = request => u.contains(layers, request.layer); - reason || (reason = 'Aborting requests within ' + layers.join(', ')); + reason ||= 'Aborting requests within ' + layers.join(', '); } let testFnWithAbortable = request => request.abortable && testFn(request); up.network.abort(testFnWithAbortable, { @@ -9354,6 +9682,7 @@ createCommonjsModule(function (module) { }); for (let element of elements) { up.emit(element, 'up:fragment:aborted', { + newLayer, log: false }); } @@ -9416,6 +9745,7 @@ createCommonjsModule(function (module) { splitTarget, parseTargetSteps, isAlive, + isNotDestroying, targetForSteps, compressNestedSteps }; @@ -9428,25 +9758,25 @@ createCommonjsModule(function (module) { u.delegate(up, ['context'], () => up.layer.current); /***/ - }, /* 88 */ + }), ( /* 87 */ /***/(__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ - }, /* 89 */ + }), ( /* 88 */ /***/(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - __webpack_require__(90); + __webpack_require__(89); up.viewport = function () { const u = up.util; const e = up.element; const f = up.fragment; const config = new up.Config(() => ({ viewportSelectors: ['[up-viewport]', '[up-fixed]'], - fixedTop: ['[up-fixed~=top]'], - fixedBottom: ['[up-fixed~=bottom]'], - anchoredRight: ['[up-anchored~=right]', '[up-fixed~=top]', '[up-fixed~=bottom]', '[up-fixed~=right]'], + fixedTopSelectors: ['[up-fixed~=top]'], + fixedBottomSelectors: ['[up-fixed~=bottom]'], + anchoredRightSelectors: ['[up-anchored~=right]', '[up-fixed~=top]', '[up-fixed~=bottom]', '[up-fixed~=right]'], revealSnap: 200, revealPadding: 0, revealTop: false, @@ -9454,15 +9784,16 @@ createCommonjsModule(function (module) { return 0.5 * window.innerHeight; } })); + const bodyShifter = new up.BodyShifter(); function reset() { config.reset(); } - function anchoredRight() { - const selector = config.anchoredRight.join(','); - return f.all(selector, { - layer: 'root' - }); + function fullAnchoredRightSelector() { + return config.anchoredRightSelectors.join(); } + up.compiler(fullAnchoredRightSelector, function (element) { + return bodyShifter.onAnchoredElementInserted(element); + }); function reveal(element, options) { options = u.options(options); element = f.get(element, options); @@ -9506,7 +9837,7 @@ createCommonjsModule(function (module) { } } function allSelector() { - return [rootSelector(), ...config.viewportSelectors].join(','); + return [rootSelector(), ...config.viewportSelectors].join(); } function closest(target, options = {}) { const element = f.get(target, options); @@ -9573,8 +9904,8 @@ createCommonjsModule(function (module) { return up.fragment.tryToTarget(viewport); } function fixedElements(root = document) { - const queryParts = ['[up-fixed]'].concat(config.fixedTop).concat(config.fixedBottom); - return root.querySelectorAll(queryParts.join(',')); + const queryParts = ['[up-fixed]'].concat(config.fixedTopSelectors).concat(config.fixedBottomSelectors); + return root.querySelectorAll(queryParts.join()); } function saveScroll(...args) { const [viewports, options] = parseOptions(args); @@ -9697,7 +10028,7 @@ createCommonjsModule(function (module) { } function firstHashTarget(hash, options = {}) { if (hash = pureHash(hash)) { - const selector = [e.attrSelector('id', hash), 'a' + e.attrSelector('name', hash)].join(','); + const selector = [e.attrSelector('id', hash), 'a' + e.attrSelector('name', hash)].join(); return f.get(selector, options); } } @@ -9755,27 +10086,27 @@ createCommonjsModule(function (module) { resetScroll, saveFocus, restoreFocus, - anchoredRight, absolutize, focus: doFocus, tryFocus, newStateCache, focusedElementWithin, - copyCursorProps + copyCursorProps, + bodyShifter }; }(); up.focus = up.viewport.focus; up.reveal = up.viewport.reveal; /***/ - }, /* 90 */ + }), ( /* 89 */ /***/(__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ - }, /* 91 */ + }), ( /* 90 */ /***/() => { up.motion = function () { const u = up.util; @@ -9789,7 +10120,7 @@ createCommonjsModule(function (module) { enabled: !matchMedia('(prefers-reduced-motion: reduce)').matches })); function pickDefault(registry) { - return u.pickBy(registry, value => value.isDefault); + return u.pickBy(registry, 'isDefault'); } function reset() { motionController.reset(); @@ -9803,8 +10134,9 @@ createCommonjsModule(function (module) { function animate(element, animation, options) { element = up.fragment.get(element); options = u.options(options); - const animationFn = findAnimationFn(animation); + let animationFn = findAnimationFn(animation); const willRun = willAnimate(element, animation, options); + animationFn = up.error.guardFn(animationFn); if (willRun) { const runNow = () => animationFn(element, options); return motionController.startFunction(element, runNow, options); @@ -9831,8 +10163,8 @@ createCommonjsModule(function (module) { return cssTransition.start(); } function applyConfig(options) { - options.easing || (options.easing = config.easing); - options.duration || (options.duration = config.duration); + options.easing ||= config.easing; + options.duration ||= config.duration; } function findNamedAnimation(name) { return namedAnimations[name] || up.fail("Unknown animation %o", name); @@ -9845,8 +10177,9 @@ createCommonjsModule(function (module) { applyConfig(options); oldElement = up.fragment.get(oldElement); newElement = up.fragment.get(newElement); - const transitionFn = findTransitionFn(transitionObject); + let transitionFn = findTransitionFn(transitionObject); const willMorph = willAnimate(oldElement, transitionFn, options); + transitionFn = up.error.guardFn(transitionFn); const beforeStart = u.pluckKey(options, 'beforeStart') || u.noop; const afterInsert = u.pluckKey(options, 'afterInsert') || u.noop; const beforeDetach = u.pluckKey(options, 'beforeDetach') || u.noop; @@ -9857,7 +10190,7 @@ createCommonjsModule(function (module) { if (motionController.isActive(oldElement) && options.trackMotion === false) { return transitionFn(oldElement, newElement, options); } - up.puts('up.morph()', 'Morphing %o to %o with transition %O', oldElement, newElement, transitionObject); + up.puts('up.morph()', 'Morphing %o to %o with transition %O over %d ms', oldElement, newElement, transitionObject, options.duration); const viewport = up.viewport.get(oldElement); const scrollTopBeforeReveal = viewport.scrollTop; const oldRemote = up.viewport.absolutize(oldElement, { @@ -9900,7 +10233,7 @@ createCommonjsModule(function (module) { return findTransitionFn(namedTransition); } } else { - return up.fail("Unknown transition %o", object); + up.fail("Unknown transition %o", object); } } function composeTransitionFn(oldAnimation, newAnimation) { @@ -9920,12 +10253,21 @@ createCommonjsModule(function (module) { } else if (u.isOptions(object)) { return (element, options) => animateNow(element, object, options); } else { - return up.fail('Unknown animation %o', object); + up.fail('Unknown animation %o', object); } } const swapElementsDirectly = up.mockable(function (oldElement, newElement) { oldElement.replaceWith(newElement); }); + function motionOptions(element, options, parserOptions) { + options = u.options(options); + let parser = new up.OptionsParser(element, options, parserOptions); + parser.booleanOrString('animation'); + parser.booleanOrString('transition'); + parser.string('easing'); + parser.number('duration'); + return options; + } function registerTransition(name, transition) { const fn = findTransitionFn(transition); fn.isDefault = up.framework.evaling; @@ -10021,7 +10363,8 @@ createCommonjsModule(function (module) { isEnabled, isNone, willAnimate, - swapElementsDirectly + swapElementsDirectly, + motionOptions }; }(); up.transition = up.motion.transition; @@ -10030,21 +10373,17 @@ createCommonjsModule(function (module) { up.animate = up.motion.animate; /***/ - }, /* 92 */ + }), ( /* 91 */ /***/(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - __webpack_require__(93); + __webpack_require__(92); const u = up.util; up.network = function () { const config = new up.Config(() => ({ - concurrency() { - return shouldReduceRequests() ? 3 : 6; - }, + concurrency: 6, wrapMethod: true, cacheSize: 70, cacheExpireAge: 15 * 1000, cacheEvictAge: 90 * 60 * 1000, - badDownlink: 0.6, - badRTT: 750, badResponseTime: 400, fail(response) { return (response.status < 200 || response.status > 299) && response.status !== 304; @@ -10137,12 +10476,6 @@ createCommonjsModule(function (module) { function loadPage(requestsAttrs) { new up.Request(requestsAttrs).loadPage(); } - function shouldReduceRequests() { - let netInfo = navigator.connection; - if (netInfo) { - return netInfo.rtt && netInfo.rtt > config.badRTT || netInfo.downlink && netInfo.downlink < config.badDownlink; - } - } function abortRequests(...args) { up.migrate.preprocessAbortArgs?.(args); queue.abort(...args); @@ -10179,7 +10512,6 @@ createCommonjsModule(function (module) { abort: abortRequests, registerAliasForRedirect, queue, - shouldReduceRequests, loadPage }; }(); @@ -10187,16 +10519,16 @@ createCommonjsModule(function (module) { up.cache = up.network.cache; /***/ - }, /* 93 */ + }), ( /* 92 */ /***/(__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ - }, /* 94 */ + }), ( /* 93 */ /***/(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - __webpack_require__(95); + __webpack_require__(94); const u = up.util; const e = up.element; up.layer = function () { @@ -10284,7 +10616,7 @@ createCommonjsModule(function (module) { options.layer = 'new'; const openMethod = match[1]; const shorthandMode = match[3]; - options.mode || (options.mode = shorthandMode || config.mode); + options.mode ||= shorthandMode || config.mode; if (openMethod === 'swap') { if (up.layer.isOverlay()) { options.baseLayer = 'parent'; @@ -10326,7 +10658,7 @@ createCommonjsModule(function (module) { if (handleDeprecatedConfig) { configs.forEach(handleDeprecatedConfig); } - options.openAnimation ?? (options.openAnimation = u.pluckKey(options, 'animation')); + options.openAnimation ??= u.pluckKey(options, 'animation'); options = u.mergeDefined(...configs, { mode, stack @@ -10371,7 +10703,7 @@ createCommonjsModule(function (module) { }); } function anySelector() { - return u.map(LAYER_CLASSES, Class => Class.selector()).join(','); + return u.map(LAYER_CLASSES, Class => Class.selector()).join(); } function optionToString(option) { if (u.isString(option)) { @@ -10381,7 +10713,7 @@ createCommonjsModule(function (module) { } } function isWithinForeignOverlay(element) { - let selector = config.foreignOverlaySelectors.join(','); + let selector = config.foreignOverlaySelectors.join(); return !!(selector && element.closest(selector)); } up.on('up:fragment:destroyed', function () { @@ -10403,7 +10735,7 @@ createCommonjsModule(function (module) { anySelector, optionToString, get stack() { - return stack; + return stack.layers; }, isWithinForeignOverlay }; @@ -10413,16 +10745,16 @@ createCommonjsModule(function (module) { }(); /***/ - }, /* 95 */ + }), ( /* 94 */ /***/(__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ - }, /* 96 */ + }), ( /* 95 */ /***/(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - __webpack_require__(97); + __webpack_require__(96); up.link = function () { const u = up.util; const e = up.element; @@ -10442,26 +10774,25 @@ createCommonjsModule(function (module) { preloadSelectors: combineFollowableSelectors(LINKS_WITH_REMOTE_HTML, ['[up-preload]']), noPreloadSelectors: ['[up-preload=false]'], clickableSelectors: LINKS_WITH_LOCAL_HTML.concat(['[up-emit]', '[up-accept]', '[up-dismiss]', '[up-clickable]']), - preloadDelay: 90, - preloadEnabled: 'auto' + preloadDelay: 90 })); function fullFollowSelector() { - return config.followSelectors.join(','); + return config.followSelectors.join(); } function fullPreloadSelector() { - return config.preloadSelectors.join(','); + return config.preloadSelectors.join(); } function fullInstantSelector() { - return config.instantSelectors.join(','); + return config.instantSelectors.join(); } function fullClickableSelector() { - return config.clickableSelectors.join(','); + return config.clickableSelectors.join(); } function isFollowDisabled(link) { - return link.matches(config.noFollowSelectors.join(',')) || u.isCrossOrigin(link); + return link.matches(config.noFollowSelectors.join()) || u.isCrossOrigin(link); } function isPreloadDisabled(link) { - return !up.browser.canPushState() || link.matches(config.noPreloadSelectors.join(',')) || isFollowDisabled(link) || !willCache(link); + return !up.browser.canPushState() || link.matches(config.noPreloadSelectors.join()) || isFollowDisabled(link) || !willCache(link); } function willCache(link) { const options = parseRequestOptions(link); @@ -10475,7 +10806,7 @@ createCommonjsModule(function (module) { } } function isInstantDisabled(link) { - return link.matches(config.noInstantSelectors.join(',')) || isFollowDisabled(link); + return link.matches(config.noInstantSelectors.join()) || isFollowDisabled(link); } function reset() { lastMousedownTarget = null; @@ -10487,7 +10818,10 @@ createCommonjsModule(function (module) { }); function parseRequestOptions(link, options, parserOptions) { options = u.options(options); - const parser = new up.OptionsParser(link, options, parserOptions); + const parser = new up.OptionsParser(link, options, { + ...parserOptions, + fail: false + }); options.url = followURL(link, options); options.method = followMethod(link, options); parser.json('headers'); @@ -10506,14 +10840,15 @@ createCommonjsModule(function (module) { } function followOptions(link, options, parserOptions) { link = up.fragment.get(link); - options = parseRequestOptions(link, options, parserOptions); + options = u.options(options); const parser = new up.OptionsParser(link, options, { fail: true, ...parserOptions }); + parser.include(parseRequestOptions); parser.boolean('feedback'); + options.origin ||= link; parser.boolean('fail'); - options.origin || (options.origin = link); parser.boolean('navigate', { default: true }); @@ -10522,6 +10857,7 @@ createCommonjsModule(function (module) { }); parser.string('target'); parser.booleanOrString('fallback'); + parser.string('match'); parser.string('content'); parser.string('fragment'); parser.string('document'); @@ -10570,10 +10906,8 @@ createCommonjsModule(function (module) { parser.booleanOrString('history'); parser.booleanOrString('location'); parser.booleanOrString('title'); - parser.booleanOrString('animation'); - parser.booleanOrString('transition'); - parser.string('easing'); - parser.number('duration'); + parser.boolean('metaTags'); + parser.include(up.motion.motionOptions); if (!options.guardEvent) { options.guardEvent = up.event.build('up:link:follow', { log: 'Following link' @@ -10598,13 +10932,10 @@ createCommonjsModule(function (module) { }); } function preloadIssue(link) { - if (!u.evalAutoOption(config.preloadEnabled, autoPreloadEnabled, link)) { - return 'Preloading is disabled'; - } else if (!isSafe(link)) { + if (!isSafe(link)) { return 'Will not preload an unsafe link'; } } - const autoPreloadEnabled = u.negate(up.network.shouldReduceRequests); function followMethod(link, options = {}) { return u.normalizeMethod(options.method || link.getAttribute('up-method') || link.getAttribute('data-method')); } @@ -10703,10 +11034,10 @@ createCommonjsModule(function (module) { let childLink = e.get(area, selector); if (childLink) { const areaAttrs = e.upAttrs(childLink); - if (!areaAttrs['up-href']) { - areaAttrs['up-href'] = childLink.getAttribute('href'); - } + areaAttrs['up-href'] ||= childLink.getAttribute('href'); e.setMissingAttrs(area, areaAttrs); + const areaClasses = e.upClasses(childLink); + area.classList.add(...areaClasses); makeFollowable(area); } }); @@ -10730,20 +11061,21 @@ createCommonjsModule(function (module) { config, combineFollowableSelectors, preloadSelector: fullPreloadSelector, - followSelector: fullFollowSelector + followSelector: fullFollowSelector, + preloadIssue }; }(); up.follow = up.link.follow; /***/ - }, /* 97 */ + }), ( /* 96 */ /***/(__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ - }, /* 98 */ + }), ( /* 97 */ /***/() => { up.form = function () { const u = up.util; @@ -10760,13 +11092,13 @@ createCommonjsModule(function (module) { watchChangeEvents: ['change'] })); function fullSubmitSelector() { - return config.submitSelectors.join(','); + return config.submitSelectors.join(); } function reset() { config.reset(); } function fieldSelector(suffix = '') { - return config.fieldSelectors.map(field => field + suffix).join(','); + return config.fieldSelectors.map(field => field + suffix).join(); } function isField(element) { return element.matches(fieldSelector()); @@ -10798,26 +11130,27 @@ createCommonjsModule(function (module) { return e.get(form, selector); } function submitButtonSelector() { - return config.submitButtonSelectors.join(','); + return config.submitButtonSelectors.join(); } const submit = up.mockable((form, options) => { return up.render(submitOptions(form, options)); }); function submitOptions(form, options, parserOptions) { form = getForm(form); - options = destinationOptions(form, options, parserOptions); + options = u.options(options); let parser = new up.OptionsParser(form, options, parserOptions); + parser.include(destinationOptions); parser.string('failTarget', { default: up.fragment.tryToTarget(form) }); parser.booleanOrString('disable'); - options.guardEvent || (options.guardEvent = up.event.build('up:form:submit', { + options.guardEvent ||= up.event.build('up:form:submit', { submitButton: options.submitButton, log: 'Submitting form', params: options.params - })); - options.origin || (options.origin = up.viewport.focusedElementWithin(form) || options.submitButton || form); - Object.assign(options, up.link.followOptions(form, options, parserOptions)); + }); + options.origin ||= up.viewport.focusedElementWithin(form) || options.submitButton || form; + parser.include(up.link.followOptions); return options; } function watchOptions(field, options, parserOptions = {}) { @@ -10834,11 +11167,11 @@ createCommonjsModule(function (module) { let config = up.form.config; if (options.event === 'input') { options.event = u.evalOption(config.watchInputEvents, field); - options.delay ?? (options.delay = config.watchInputDelay); + options.delay ??= config.watchInputDelay; } else if (options.event === 'change') { options.event = u.evalOption(config.watchChangeEvents, field); } - options.origin || (options.origin = field); + options.origin ||= field; return options; } function disableContainer(container) { @@ -10863,7 +11196,7 @@ createCommonjsModule(function (module) { } function raiseDisableStack(control) { if (!control.upDisableCount) { - control.upDisableCount || (control.upDisableCount = 0); + control.upDisableCount ||= 0; control.upOriginalDisabled = control.disabled; } control.upDisableCount++; @@ -10910,7 +11243,7 @@ createCommonjsModule(function (module) { form = getForm(form); const parser = new up.OptionsParser(form, options, parserOptions); parser.string('contentType', { - attr: ['enctype', 'up-content-type'] + attr: 'enctype' }); parser.json('headers'); const params = up.Params.fromForm(form); @@ -10918,8 +11251,8 @@ createCommonjsModule(function (module) { if (submitButton) { options.submitButton = submitButton; params.addField(submitButton); - options.method || (options.method = submitButton.getAttribute('formmethod')); - options.url || (options.url = submitButton.getAttribute('formaction')); + options.method ||= submitButton.getAttribute('formmethod'); + options.url ||= submitButton.getAttribute('formaction'); } params.addAll(options.params); options.params = params; @@ -10944,7 +11277,6 @@ createCommonjsModule(function (module) { } }); function watch(container, ...args) { - let form = getForm(container); const fields = findFields(container); const unnamedFields = u.reject(fields, 'name'); if (unnamedFields.length) { @@ -10952,7 +11284,7 @@ createCommonjsModule(function (module) { } const callback = u.extractCallback(args) || watchCallbackFromElement(container) || up.fail('No callback given for up.watch()'); let options = u.extractOptions(args); - const watch = new up.FieldWatcher(form, fields, options, callback); + const watch = new up.FieldWatcher(fields, options, callback); watch.start(); return () => watch.stop(); } @@ -10997,9 +11329,9 @@ createCommonjsModule(function (module) { function parseValidateArgs(originOrTarget, ...args) { const options = u.extractOptions(args); if (options.origin) { - options.target || (options.target = up.fragment.toTarget(originOrTarget)); + options.target ||= up.fragment.toTarget(originOrTarget); } else { - options.origin || (options.origin = up.fragment.get(originOrTarget)); + options.origin ||= up.fragment.get(originOrTarget); } return options; } @@ -11049,7 +11381,7 @@ createCommonjsModule(function (module) { } const switchTarget = up.mockable(function (target, fieldValues) { let show; - fieldValues || (fieldValues = switcherValues(findSwitcherForTarget(target))); + fieldValues ||= switcherValues(findSwitcherForTarget(target)); let hideValues = target.getAttribute('up-hide-for'); if (hideValues) { hideValues = parseSwitchTokens(hideValues); @@ -11091,7 +11423,7 @@ createCommonjsModule(function (module) { return form.matches(fullSubmitSelector()) && !isSubmitDisabled(form); } function isSubmitDisabled(form) { - return form.matches(config.noSubmitSelectors.join(',')); + return form.matches(config.noSubmitSelectors.join()); } up.on('submit', fullSubmitSelector, function (event, form) { if (event.defaultPrevented || isSubmitDisabled(form)) { @@ -11151,7 +11483,7 @@ createCommonjsModule(function (module) { up.validate = up.form.validate; /***/ - }, /* 99 */ + }), ( /* 98 */ /***/() => { up.feedback = function () { const u = up.util; @@ -11168,7 +11500,7 @@ createCommonjsModule(function (module) { const CLASS_LOADING = 'up-loading'; const SELECTOR_LINK = 'a, [up-href]'; function navSelector() { - return config.navSelectors.join(','); + return config.navSelectors.join(); } function normalizeURL(url) { if (url) { @@ -11179,7 +11511,7 @@ createCommonjsModule(function (module) { } } function linkURLs(link) { - return link.upFeedbackURLs || (link.upFeedbackURLs = new up.LinkFeedbackURLs(link)); + return link.upFeedbackURLs ||= new up.LinkFeedbackURLs(link); } function updateFragment(fragment) { const layerOption = { @@ -11257,7 +11589,7 @@ createCommonjsModule(function (module) { up.on('up:location:changed', _event => { onBrowserLocationChanged(); }); - up.on('up:fragment:inserted', (_event, newFragment) => { + up.on('up:fragment:compile', (_event, newFragment) => { updateFragment(newFragment); }); up.on('up:layer:location:changed', event => { @@ -11272,58 +11604,74 @@ createCommonjsModule(function (module) { }(); /***/ - }, /* 100 */ + }), ( /* 99 */ /***/() => { up.radio = function () { - const u = up.util; const e = up.element; const config = new up.Config(() => ({ hungrySelectors: ['[up-hungry]'], - pollInterval: 30000, - stretchPollInterval: interval => interval * (up.network.shouldReduceRequests() ? 2 : 1), - pollEnabled: 'auto' + pollInterval: 30000 })); function reset() { config.reset(); } - function hungrySteps({ - layer, - history, - origin - }) { - let hungrySelector = config.hungrySelectors.join(', '); - let hungries = up.fragment.all(hungrySelector, { - layer: 'any' - }); - return u.filterMap(hungries, element => { - let target = up.fragment.tryToTarget(element, { - origin + function hungrySteps(renderOptions) { + let { + useHungry, + origin, + layer: renderLayer + } = renderOptions; + let steps = { + current: [], + other: [] + }; + if (!useHungry) return steps; + let hungrySelector = config.hungrySelectors.join(); + const layerPreference = [renderLayer, ...renderLayer.ancestors, ...renderLayer.descendants]; + for (let elementLayer of layerPreference) { + let hungries = up.fragment.all(elementLayer.element, hungrySelector, { + layer: elementLayer }); - if (!target) { - up.warn('[up-hungry]', 'Ignoring untargetable fragment %o', element); - return; - } - let ifHistory = e.booleanAttr(element, 'up-if-history'); - if (ifHistory && !history) { - return; - } - let ifLayer = e.attr(element, 'up-if-layer'); - let elementLayer = up.layer.get(element); - if (ifLayer !== 'any' && layer !== elementLayer) { - return; + for (let element of hungries) { + let selector = up.fragment.tryToTarget(element, { + origin + }); + if (!selector) { + up.warn('[up-hungry]', 'Ignoring untargetable fragment %o', element); + continue; + } + let ifLayer = e.attr(element, 'up-if-layer'); + let applicableLayers = ifLayer ? up.layer.getAll(ifLayer, { + baseLayer: elementLayer + }) : [elementLayer]; + let motionOptions = up.motion.motionOptions(element); + let selectEvent = up.event.build('up:fragment:hungry', { + log: false + }); + let selectCallback = e.callbackAttr(element, 'up-on-hungry', { + exposedKeys: ['newFragment', 'renderOptions'] + }); + let step = { + selector, + oldElement: element, + layer: elementLayer, + origin, + ...motionOptions, + placement: 'swap', + useKeep: true, + maybe: true, + selectEvent, + selectCallback, + originalRenderOptions: renderOptions + }; + if (applicableLayers.includes(renderLayer)) { + let list = renderLayer === elementLayer ? steps.current : steps.other; + list.push(step); + } } - let transition = e.booleanOrStringAttr(element, 'up-transition'); - return { - selector: target, - oldElement: element, - layer: elementLayer, - origin, - transition, - placement: 'swap', - useKeep: true, - maybe: true - }; - }); + } + steps.other = up.fragment.compressNestedSteps(steps.other); + return steps; } function startPolling(fragment, options = {}) { up.FragmentPolling.forFragment(fragment).forceStart(options); @@ -11331,44 +11679,42 @@ createCommonjsModule(function (module) { function stopPolling(element) { up.FragmentPolling.forFragment(element).forceStop(); } - function pollIssue(fragment) { - let enabled = config.pollEnabled; - if (enabled === false) { - return 'User has disabled polling'; - } - if (enabled === 'auto') { - if (document.hidden) { - return 'Tab is hidden'; - } - if (!up.layer.get(fragment)?.isFront?.()) { - return 'Fragment is on a background layer'; - } - } - if (up.emit(fragment, 'up:fragment:poll', { - log: ['Polling fragment', fragment] - }).defaultPrevented) { - return 'User prevented up:fragment:poll event'; - } + function pollOptions(fragment, options = {}) { + const parser = new up.OptionsParser(fragment, options); + parser.number('interval', { + default: config.pollInterval + }); + parser.string('ifLayer', { + default: 'front' + }); + return options; } - up.compiler('[up-poll]', function (fragment) { - if (!up.fragment.isTargetable(fragment)) { - up.warn('[up-poll]', 'Ignoring untargetable fragment %o', fragment); - return; - } + up.compiler('[up-poll]:not([up-poll=false])', function (fragment) { up.FragmentPolling.forFragment(fragment).onPollAttributeObserved(); }); + up.macro('[up-flashes]', function (fragment) { + e.setMissingAttrs(fragment, { + 'up-hungry': '', + 'up-if-layer': 'subtree', + 'up-keep': '', + 'role': 'alert' + }); + fragment.addEventListener('up:fragment:keep', function (event) { + if (!e.isEmpty(event.newFragment)) event.preventDefault(); + }); + }); up.on('up:framework:reset', reset); return { config, hungrySteps, startPolling, stopPolling, - pollIssue + pollOptions }; }(); /***/ - }, /* 101 */ + }), ( /* 100 */ /***/() => { (function () { const e = up.element; @@ -11389,7 +11735,7 @@ createCommonjsModule(function (module) { /***/ } - /******/]; + /******/)]; /************************************************************************/ /******/ // The module cache /******/ @@ -11531,22 +11877,21 @@ createCommonjsModule(function (module) { __webpack_require__(84); __webpack_require__(85); __webpack_require__(86); - __webpack_require__(87); - __webpack_require__(89); + __webpack_require__(88); + __webpack_require__(90); __webpack_require__(91); - __webpack_require__(92); - __webpack_require__(94); - __webpack_require__(96); + __webpack_require__(93); + __webpack_require__(95); + __webpack_require__(97); __webpack_require__(98); __webpack_require__(99); __webpack_require__(100); - __webpack_require__(101); up.framework.onEvaled(); })(); /******/ })(); -}); +})(); up.compiler(".up-batch", function (element, data, meta) { var directMethods = ["get", "post"]; diff --git a/frontend/super-frontend/source/package.json b/frontend/super-frontend/source/package.json index 84d87db..4d79ed1 100644 --- a/frontend/super-frontend/source/package.json +++ b/frontend/super-frontend/source/package.json @@ -8,22 +8,22 @@ "unpoly": "^3.3.0" }, "devDependencies": { - "@babel/core": "^7.0.0", - "@babel/preset-env": "^7.13.15", - "@rollup/plugin-babel": "^5.3.0", - "@rollup/plugin-commonjs": "^18.0.0", - "@rollup/plugin-node-resolve": "^11.2.1", + "@babel/core": "^7.23.3", + "@babel/preset-env": "^7.23.3", + "@rollup/plugin-babel": "^6.0.4", + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-node-resolve": "^15.2.3", "autoprefixer": "^10.4.15", "postcss": "^8.4.29", - "postcss-import": "^14.0.1", - "postcss-inline-svg": "^5.0.0", + "postcss-import": "^15.1.0", + "postcss-inline-svg": "^6.0.0", "prettier": "1.19.1", - "rollup": "^2.45.2", + "rollup": "^4.5.0", "rollup-plugin-postcss": "^4.0.0" }, "scripts": { - "build": "rollup --config", - "watch": "rollup --config --watch", + "build": "rollup --config --bundleConfigAsCjs", + "watch": "rollup --config --bundleConfigAsCjs --watch", "lint": "prettier --write 'src/**/*.js' '*.js'", "lintci": "prettier --check 'src/**/*.js' '*.js'" }, diff --git a/frontend/super-frontend/source/yarn.lock b/frontend/super-frontend/source/yarn.lock index 3ebdd08..d23d069 100644 --- a/frontend/super-frontend/source/yarn.lock +++ b/frontend/super-frontend/source/yarn.lock @@ -15,411 +15,281 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.18.6", "@babel/code-frame@^7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.21.4.tgz#d0fa9e4413aca81f2b23b9442797bda1826edb39" - integrity sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g== +"@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.4.tgz#03ae5af150be94392cb5c7ccd97db5a19a5da6aa" + integrity sha512-r1IONyb6Ia+jYR2vvIDhdWdlTGhqbBoFqLTQidzZ4kepUFH15ejXvFHxCVbtl7BOXIudsIubf4E81xeA3h3IXA== dependencies: - "@babel/highlight" "^7.18.6" + "@babel/highlight" "^7.23.4" + chalk "^2.4.2" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.4.tgz#457ffe647c480dff59c2be092fc3acf71195c87f" - integrity sha512-/DYyDpeCfaVinT40FPGdkkb+lYSKvsVuMjDAG7jPOWWiM1ibOaB9CXJAlc4d1QpP/U2q2P9jbrSlClKSErd55g== +"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9", "@babel/compat-data@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.3.tgz#3febd552541e62b5e883a25eb3effd7c7379db11" + integrity sha512-BmR4bWbDIoFJmJ9z2cZ8Gmm2MXgEDgjdWgpKmKWUt54UGFJdlj31ECtbaDvCG/qVdG3AQ1SfpZEs01lUFbzLOQ== -"@babel/core@^7.0.0": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.4.tgz#c6dc73242507b8e2a27fd13a9c1814f9fa34a659" - integrity sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA== +"@babel/core@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.3.tgz#5ec09c8803b91f51cc887dedc2654a35852849c9" + integrity sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.21.4" - "@babel/generator" "^7.21.4" - "@babel/helper-compilation-targets" "^7.21.4" - "@babel/helper-module-transforms" "^7.21.2" - "@babel/helpers" "^7.21.0" - "@babel/parser" "^7.21.4" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.4" - "@babel/types" "^7.21.4" - convert-source-map "^1.7.0" + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.23.3" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-module-transforms" "^7.23.3" + "@babel/helpers" "^7.23.2" + "@babel/parser" "^7.23.3" + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.23.3" + "@babel/types" "^7.23.3" + convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" - json5 "^2.2.2" - semver "^6.3.0" + json5 "^2.2.3" + semver "^6.3.1" -"@babel/generator@^7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.4.tgz#64a94b7448989f421f919d5239ef553b37bb26bc" - integrity sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA== +"@babel/generator@^7.23.3", "@babel/generator@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.4.tgz#4a41377d8566ec18f807f42962a7f3551de83d1c" + integrity sha512-esuS49Cga3HcThFNebGhlgsrVLkvhqvYDTzgjfFFlHJcIfLe5jFmRRfCQ1KuBfc4Jrtn3ndLgKWAKjBE+IraYQ== dependencies: - "@babel/types" "^7.21.4" + "@babel/types" "^7.23.4" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-annotate-as-pure@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" - integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== +"@babel/helper-annotate-as-pure@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" + integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== dependencies: - "@babel/types" "^7.18.6" + "@babel/types" "^7.22.5" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz#acd4edfd7a566d1d51ea975dff38fd52906981bb" - integrity sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.15.tgz#5426b109cf3ad47b91120f8328d8ab1be8b0b956" + integrity sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw== dependencies: - "@babel/helper-explode-assignable-expression" "^7.18.6" - "@babel/types" "^7.18.9" + "@babel/types" "^7.22.15" -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.4.tgz#770cd1ce0889097ceacb99418ee6934ef0572656" - integrity sha512-Fa0tTuOXZ1iL8IeDFUWCzjZcn+sJGd9RZdH9esYVjEejGmzf+FFYQpMi/kZUk2kPy/q1H3/GPw7np8qar/stfg== +"@babel/helper-compilation-targets@^7.22.15", "@babel/helper-compilation-targets@^7.22.6": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz#0698fc44551a26cf29f18d4662d5bf545a6cfc52" + integrity sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw== dependencies: - "@babel/compat-data" "^7.21.4" - "@babel/helper-validator-option" "^7.21.0" - browserslist "^4.21.3" + "@babel/compat-data" "^7.22.9" + "@babel/helper-validator-option" "^7.22.15" + browserslist "^4.21.9" lru-cache "^5.1.1" - semver "^6.3.0" - -"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.21.0": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.21.4.tgz#3a017163dc3c2ba7deb9a7950849a9586ea24c18" - integrity sha512-46QrX2CQlaFRF4TkwfTt6nJD7IHq8539cCL7SDpqWSDeJKY1xylKKY5F/33mJhLZ3mFvKv2gGrVS6NkyF6qs+Q== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.21.0" - "@babel/helper-member-expression-to-functions" "^7.21.0" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-replace-supers" "^7.20.7" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" - "@babel/helper-split-export-declaration" "^7.18.6" - -"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.20.5": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.21.4.tgz#40411a8ab134258ad2cf3a3d987ec6aa0723cee5" - integrity sha512-M00OuhU+0GyZ5iBBN9czjugzWrEq2vDpf/zCYHxxf93ul/Q5rv+a5h+/+0WnI1AebHNVtl5bFV0qsJoH23DbfA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" + semver "^6.3.1" + +"@babel/helper-create-class-features-plugin@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz#97a61b385e57fe458496fad19f8e63b63c867de4" + integrity sha512-jKkwA59IXcvSaiK2UN45kKwSC9o+KuoXsBDvHvU/7BecYIp8GQ2UwrVvFgJASUT+hBnwJx6MhvMCuMzwZZ7jlg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-member-expression-to-functions" "^7.22.15" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + semver "^6.3.1" + +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.15", "@babel/helper-create-regexp-features-plugin@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz#5ee90093914ea09639b01c711db0d6775e558be1" + integrity sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" regexpu-core "^5.3.1" + semver "^6.3.1" -"@babel/helper-define-polyfill-provider@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz#8612e55be5d51f0cd1f36b4a5a83924e89884b7a" - integrity sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww== +"@babel/helper-define-polyfill-provider@^0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.3.tgz#a71c10f7146d809f4a256c373f462d9bba8cf6ba" + integrity sha512-WBrLmuPP47n7PNwsZ57pqam6G/RGo1vw/87b0Blc53tZNGZ4x7YvZ6HgQe2vo1W/FR20OgjeZuGXzudPiXHFug== dependencies: - "@babel/helper-compilation-targets" "^7.17.7" - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-compilation-targets" "^7.22.6" + "@babel/helper-plugin-utils" "^7.22.5" debug "^4.1.1" lodash.debounce "^4.0.8" resolve "^1.14.2" - semver "^6.1.2" - -"@babel/helper-environment-visitor@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" - integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== - -"@babel/helper-explode-assignable-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096" - integrity sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0", "@babel/helper-function-name@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz#d552829b10ea9f120969304023cd0645fa00b1b4" - integrity sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg== - dependencies: - "@babel/template" "^7.20.7" - "@babel/types" "^7.21.0" - -"@babel/helper-hoist-variables@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" - integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== - dependencies: - "@babel/types" "^7.18.6" -"@babel/helper-member-expression-to-functions@^7.20.7", "@babel/helper-member-expression-to-functions@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.21.0.tgz#319c6a940431a133897148515877d2f3269c3ba5" - integrity sha512-Muu8cdZwNN6mRRNG6lAYErJ5X3bRevgYR2O8wN0yn7jJSnGDu6eG59RfT29JHxGUovyfrh6Pj0XzmR7drNVL3Q== - dependencies: - "@babel/types" "^7.21.0" - -"@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.18.6": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz#ac88b2f76093637489e718a90cec6cf8a9b029af" - integrity sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg== - dependencies: - "@babel/types" "^7.21.4" +"@babel/helper-environment-visitor@^7.22.20", "@babel/helper-environment-visitor@^7.22.5": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== -"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.20.11", "@babel/helper-module-transforms@^7.21.2": - version "7.21.2" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz#160caafa4978ac8c00ac66636cb0fa37b024e2d2" - integrity sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ== +"@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.20.2" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.19.1" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.2" - "@babel/types" "^7.21.2" - -"@babel/helper-optimise-call-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe" - integrity sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" - integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" -"@babel/helper-remap-async-to-generator@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz#997458a0e3357080e54e1d79ec347f8a8cd28519" - integrity sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA== +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-wrap-function" "^7.18.9" - "@babel/types" "^7.18.9" + "@babel/types" "^7.22.5" -"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz#243ecd2724d2071532b2c8ad2f0f9f083bcae331" - integrity sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A== +"@babel/helper-member-expression-to-functions@^7.22.15": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz#9263e88cc5e41d39ec18c9a3e0eced59a3e7d366" + integrity sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA== dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-member-expression-to-functions" "^7.20.7" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.7" - "@babel/types" "^7.20.7" + "@babel/types" "^7.23.0" + +"@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" + integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== + dependencies: + "@babel/types" "^7.22.15" -"@babel/helper-simple-access@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" - integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== - dependencies: - "@babel/types" "^7.20.2" - -"@babel/helper-skip-transparent-expression-wrappers@^7.20.0": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz#fbe4c52f60518cab8140d77101f0e63a8a230684" - integrity sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg== - dependencies: - "@babel/types" "^7.20.0" - -"@babel/helper-split-export-declaration@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" - integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-string-parser@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" - integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== - -"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== - -"@babel/helper-validator-option@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" - integrity sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ== - -"@babel/helper-wrap-function@^7.18.9": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz#75e2d84d499a0ab3b31c33bcfe59d6b8a45f62e3" - integrity sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q== - dependencies: - "@babel/helper-function-name" "^7.19.0" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.20.5" - "@babel/types" "^7.20.5" - -"@babel/helpers@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.21.0.tgz#9dd184fb5599862037917cdc9eecb84577dc4e7e" - integrity sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA== - dependencies: - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.0" - "@babel/types" "^7.21.0" - -"@babel/highlight@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" - integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" - chalk "^2.0.0" +"@babel/helper-module-transforms@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" + integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-module-imports" "^7.22.15" + "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/helper-validator-identifier" "^7.22.20" + +"@babel/helper-optimise-call-expression@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" + integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" + integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== + +"@babel/helper-remap-async-to-generator@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz#7b68e1cb4fa964d2996fd063723fb48eca8498e0" + integrity sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-wrap-function" "^7.22.20" + +"@babel/helper-replace-supers@^7.22.20", "@babel/helper-replace-supers@^7.22.9": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz#e37d367123ca98fe455a9887734ed2e16eb7a793" + integrity sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-member-expression-to-functions" "^7.22.15" + "@babel/helper-optimise-call-expression" "^7.22.5" + +"@babel/helper-simple-access@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" + integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-skip-transparent-expression-wrappers@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" + integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" + integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== + +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + +"@babel/helper-validator-option@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040" + integrity sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA== + +"@babel/helper-wrap-function@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz#15352b0b9bfb10fc9c76f79f6342c00e3411a569" + integrity sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw== + dependencies: + "@babel/helper-function-name" "^7.22.5" + "@babel/template" "^7.22.15" + "@babel/types" "^7.22.19" + +"@babel/helpers@^7.23.2": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.4.tgz#7d2cfb969aa43222032193accd7329851facf3c1" + integrity sha512-HfcMizYz10cr3h29VqyfGL6ZWIjTwWfvYBMsBVGwpcbhNGe3wQ1ZXZRPzZoAHhd9OqHadHqjQ89iVKINXnbzuw== + dependencies: + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.23.4" + "@babel/types" "^7.23.4" + +"@babel/highlight@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" + integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.20.7", "@babel/parser@^7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.4.tgz#94003fdfc520bbe2875d4ae557b43ddb6d880f17" - integrity sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw== - -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" - integrity sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.20.7.tgz#d9c85589258539a22a901033853101a6198d4ef1" - integrity sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" - "@babel/plugin-proposal-optional-chaining" "^7.20.7" - -"@babel/plugin-proposal-async-generator-functions@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz#bfb7276d2d573cb67ba379984a2334e262ba5326" - integrity sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-remap-async-to-generator" "^7.18.9" - "@babel/plugin-syntax-async-generators" "^7.8.4" - -"@babel/plugin-proposal-class-properties@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" - integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" +"@babel/parser@^7.22.15", "@babel/parser@^7.23.3", "@babel/parser@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.4.tgz#409fbe690c333bb70187e2de4021e1e47a026661" + integrity sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ== -"@babel/plugin-proposal-class-static-block@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.21.0.tgz#77bdd66fb7b605f3a61302d224bdfacf5547977d" - integrity sha512-XP5G9MWNUskFuP30IfFSEFB0Z6HzLIUcjYM4bYOPHXl7eiJ9HFv8tWj6TXTN5QODiEhDZAeI4hLok2iHFFV4hw== +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.23.3.tgz#5cd1c87ba9380d0afb78469292c954fee5d2411a" + integrity sha512-iRkKcCqb7iGnq9+3G6rZ+Ciz5VywC4XNRHe57lKM+jOeYAoR0lVqdeeDRfh0tQcTfw/+vBhHn926FmQhLtlFLQ== dependencies: - "@babel/helper-create-class-features-plugin" "^7.21.0" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - -"@babel/plugin-proposal-dynamic-import@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz#72bcf8d408799f547d759298c3c27c7e7faa4d94" - integrity sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-proposal-export-namespace-from@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz#5f7313ab348cdb19d590145f9247540e94761203" - integrity sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.23.3.tgz#f6652bb16b94f8f9c20c50941e16e9756898dc5d" + integrity sha512-WwlxbfMNdVEpQjZmK5mhm7oSwD3dS6eU+Iwsi4Knl9wAletWem7kaRsGOG+8UEbRyqxY4SS5zvtfXwX+jMxUwQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-transform-optional-chaining" "^7.23.3" -"@babel/plugin-proposal-json-strings@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz#7e8788c1811c393aff762817e7dbf1ebd0c05f0b" - integrity sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ== +"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.23.3.tgz#20c60d4639d18f7da8602548512e9d3a4c8d7098" + integrity sha512-XaJak1qcityzrX0/IU5nKHb34VaibwP3saKqG6a/tppelgllOH13LUann4ZCIBcVOeE6H18K4Vx9QKkVww3z/w== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-proposal-logical-assignment-operators@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz#dfbcaa8f7b4d37b51e8bfb46d94a5aea2bb89d83" - integrity sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - -"@babel/plugin-proposal-nullish-coalescing-operator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1" - integrity sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - -"@babel/plugin-proposal-numeric-separator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz#899b14fbafe87f053d2c5ff05b36029c62e13c75" - integrity sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - -"@babel/plugin-proposal-object-rest-spread@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" - integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== - dependencies: - "@babel/compat-data" "^7.20.5" - "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.20.7" - -"@babel/plugin-proposal-optional-catch-binding@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz#f9400d0e6a3ea93ba9ef70b09e72dd6da638a2cb" - integrity sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - -"@babel/plugin-proposal-optional-chaining@^7.20.7", "@babel/plugin-proposal-optional-chaining@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz#886f5c8978deb7d30f678b2e24346b287234d3ea" - integrity sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - -"@babel/plugin-proposal-private-methods@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz#5209de7d213457548a98436fa2882f52f4be6bea" - integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-proposal-private-property-in-object@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0.tgz#19496bd9883dd83c23c7d7fc45dcd9ad02dfa1dc" - integrity sha512-ha4zfehbJjc5MmXBlHec1igel5TJXXLDDRbuJ4+XT2TJcyD9/V1919BA8gMvsdHcNMBy4WBUBiRb3nw/EQUtBw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-create-class-features-plugin" "^7.21.0" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - -"@babel/plugin-proposal-unicode-property-regex@^7.18.6", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz#af613d2cd5e643643b65cded64207b15c85cb78e" - integrity sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" +"@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": + version "7.21.0-placeholder-for-preset-env.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" + integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -456,12 +326,26 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-import-assertions@^7.20.0": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz#bb50e0d4bea0957235390641209394e87bdb9cc4" - integrity sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ== +"@babel/plugin-syntax-import-assertions@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.23.3.tgz#9c05a7f592982aff1a2768260ad84bcd3f0c77fc" + integrity sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw== dependencies: - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-syntax-import-attributes@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.23.3.tgz#992aee922cf04512461d7dae3ff6951b90a2dc06" + integrity sha512-pawnE0P9g10xgoP7yKr6CK63K2FMsTE+FZidZO/1PwRdzmAPVs+HS1mAURUsgaoxammTJvULUdIkEK0gOcU2tA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-syntax-import-meta@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" + integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-json-strings@^7.8.3": version "7.8.3" @@ -526,289 +410,423 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-arrow-functions@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.20.7.tgz#bea332b0e8b2dab3dafe55a163d8227531ab0551" - integrity sha512-3poA5E7dzDomxj9WXWwuD6A5F3kc7VXwIJO+E+J8qtDtS+pXPAhrgEyh+9GBwBgPq1Z+bB+/JD60lp5jsN7JPQ== +"@babel/plugin-syntax-unicode-sets-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" + integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-async-to-generator@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.20.7.tgz#dfee18623c8cb31deb796aa3ca84dda9cea94354" - integrity sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q== +"@babel/plugin-transform-arrow-functions@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.23.3.tgz#94c6dcfd731af90f27a79509f9ab7fb2120fc38b" + integrity sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ== dependencies: - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-remap-async-to-generator" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-block-scoped-functions@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz#9187bf4ba302635b9d70d986ad70f038726216a8" - integrity sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ== +"@babel/plugin-transform-async-generator-functions@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.4.tgz#93ac8e3531f347fba519b4703f9ff2a75c6ae27a" + integrity sha512-efdkfPhHYTtn0G6n2ddrESE91fgXxjlqLsnUtPWnJs4a4mZIbUaK7ffqKIIUKXSHwcDvaCVX6GXkaJJFqtX7jw== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-remap-async-to-generator" "^7.22.20" + "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-transform-block-scoping@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.21.0.tgz#e737b91037e5186ee16b76e7ae093358a5634f02" - integrity sha512-Mdrbunoh9SxwFZapeHVrwFmri16+oYotcZysSzhNIVDwIAb1UV+kvnxULSYq9J3/q5MDG+4X6w8QVgD1zhBXNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - -"@babel/plugin-transform-classes@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.21.0.tgz#f469d0b07a4c5a7dbb21afad9e27e57b47031665" - integrity sha512-RZhbYTCEUAe6ntPehC4hlslPWosNHDox+vAs4On/mCLRLfoDVHf6hVEd7kuxr1RnHwJmxFfUM3cZiZRmPxJPXQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.21.0" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-replace-supers" "^7.20.7" - "@babel/helper-split-export-declaration" "^7.18.6" +"@babel/plugin-transform-async-to-generator@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.23.3.tgz#d1f513c7a8a506d43f47df2bf25f9254b0b051fa" + integrity sha512-A7LFsKi4U4fomjqXJlZg/u0ft/n8/7n7lpffUP/ZULx/DtV9SGlNKZolHH6PE8Xl1ngCc0M11OaeZptXVkfKSw== + dependencies: + "@babel/helper-module-imports" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-remap-async-to-generator" "^7.22.20" + +"@babel/plugin-transform-block-scoped-functions@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.23.3.tgz#fe1177d715fb569663095e04f3598525d98e8c77" + integrity sha512-vI+0sIaPIO6CNuM9Kk5VmXcMVRiOpDh7w2zZt9GXzmE/9KD70CUEVhvPR/etAeNK/FAEkhxQtXOzVF3EuRL41A== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-block-scoping@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.4.tgz#b2d38589531c6c80fbe25e6b58e763622d2d3cf5" + integrity sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-class-properties@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.23.3.tgz#35c377db11ca92a785a718b6aa4e3ed1eb65dc48" + integrity sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-class-static-block@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.23.4.tgz#2a202c8787a8964dd11dfcedf994d36bfc844ab5" + integrity sha512-nsWu/1M+ggti1SOALj3hfx5FXzAY06fwPJsUZD4/A5e1bWi46VUIWtD+kOX6/IdhXGsXBWllLFDSnqSCdUNydQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + +"@babel/plugin-transform-classes@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.3.tgz#73380c632c095b03e8503c24fd38f95ad41ffacb" + integrity sha512-FGEQmugvAEu2QtgtU0uTASXevfLMFfBeVCIIdcQhn/uBQsMTjBajdnAtanQlOcuihWh10PZ7+HWvc7NtBwP74w== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.20" + "@babel/helper-split-export-declaration" "^7.22.6" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.20.7.tgz#704cc2fd155d1c996551db8276d55b9d46e4d0aa" - integrity sha512-Lz7MvBK6DTjElHAmfu6bfANzKcxpyNPeYBGEafyA6E5HtRpjpZwU+u7Qrgz/2OR0z+5TvKYbPdphfSaAcZBrYQ== +"@babel/plugin-transform-computed-properties@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz#652e69561fcc9d2b50ba4f7ac7f60dcf65e86474" + integrity sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/template" "^7.20.7" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/template" "^7.22.15" -"@babel/plugin-transform-destructuring@^7.21.3": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.21.3.tgz#73b46d0fd11cd6ef57dea8a381b1215f4959d401" - integrity sha512-bp6hwMFzuiE4HqYEyoGJ/V2LeIWn+hLVKc4pnj++E5XQptwhtcGmSayM029d/j2X1bPKGTlsyPwAubuU22KhMA== +"@babel/plugin-transform-destructuring@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.3.tgz#8c9ee68228b12ae3dff986e56ed1ba4f3c446311" + integrity sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz#b286b3e7aae6c7b861e45bed0a2fafd6b1a4fef8" - integrity sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg== +"@babel/plugin-transform-dotall-regex@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.23.3.tgz#3f7af6054882ede89c378d0cf889b854a993da50" + integrity sha512-vgnFYDHAKzFaTVp+mneDsIEbnJ2Np/9ng9iviHw3P/KVcgONxpNULEW/51Z/BaFojG2GI2GwwXck5uV1+1NOYQ== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-regexp-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-duplicate-keys@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz#687f15ee3cdad6d85191eb2a372c4528eaa0ae0e" - integrity sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw== +"@babel/plugin-transform-duplicate-keys@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.23.3.tgz#664706ca0a5dfe8d066537f99032fc1dc8b720ce" + integrity sha512-RrqQ+BQmU3Oyav3J+7/myfvRCq7Tbz+kKLLshUmMwNlDHExbGL7ARhajvoBJEvc+fCguPPu887N+3RRXBVKZUA== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-exponentiation-operator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz#421c705f4521888c65e91fdd1af951bfefd4dacd" - integrity sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw== +"@babel/plugin-transform-dynamic-import@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.23.4.tgz#c7629e7254011ac3630d47d7f34ddd40ca535143" + integrity sha512-V6jIbLhdJK86MaLh4Jpghi8ho5fGzt3imHOBu/x0jlBaPYqDoWz4RDXjmMOfnh+JWNaQleEAByZLV0QzBT4YQQ== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-transform-for-of@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.21.0.tgz#964108c9988de1a60b4be2354a7d7e245f36e86e" - integrity sha512-LlUYlydgDkKpIY7mcBWvyPPmMcOphEyYA27Ef4xpbh1IiDNLr0kZsos2nf92vz3IccvJI25QUwp86Eo5s6HmBQ== +"@babel/plugin-transform-exponentiation-operator@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.23.3.tgz#ea0d978f6b9232ba4722f3dbecdd18f450babd18" + integrity sha512-5fhCsl1odX96u7ILKHBj4/Y8vipoqwsJMh4csSA8qFfxrZDEA4Ssku2DyNvMJSmZNOEBT750LfFPbtrnTP90BQ== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-function-name@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz#cc354f8234e62968946c61a46d6365440fc764e0" - integrity sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ== +"@babel/plugin-transform-export-namespace-from@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.23.4.tgz#084c7b25e9a5c8271e987a08cf85807b80283191" + integrity sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ== dependencies: - "@babel/helper-compilation-targets" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-transform-literals@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz#72796fdbef80e56fba3c6a699d54f0de557444bc" - integrity sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg== +"@babel/plugin-transform-for-of@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.23.3.tgz#afe115ff0fbce735e02868d41489093c63e15559" + integrity sha512-X8jSm8X1CMwxmK878qsUGJRmbysKNbdpTv/O1/v0LuY/ZkZrng5WYiekYSdg9m09OTmDDUWeEDsTE+17WYbAZw== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-member-expression-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz#ac9fdc1a118620ac49b7e7a5d2dc177a1bfee88e" - integrity sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA== +"@babel/plugin-transform-function-name@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.23.3.tgz#8f424fcd862bf84cb9a1a6b42bc2f47ed630f8dc" + integrity sha512-I1QXp1LxIvt8yLaib49dRW5Okt7Q4oaxao6tFVKS/anCdEOMtYwWVKoiOA1p34GOWIZjUK0E+zCp7+l1pfQyiw== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-amd@^7.20.11": - version "7.20.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.20.11.tgz#3daccca8e4cc309f03c3a0c4b41dc4b26f55214a" - integrity sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g== +"@babel/plugin-transform-json-strings@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.23.4.tgz#a871d9b6bd171976efad2e43e694c961ffa3714d" + integrity sha512-81nTOqM1dMwZ/aRXQ59zVubN9wHGqk6UtqRK+/q+ciXmRy8fSolhGVvG09HHRGo4l6fr/c4ZhXUQH0uFW7PZbg== dependencies: - "@babel/helper-module-transforms" "^7.20.11" - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-transform-modules-commonjs@^7.21.2": - version "7.21.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.21.2.tgz#6ff5070e71e3192ef2b7e39820a06fb78e3058e7" - integrity sha512-Cln+Yy04Gxua7iPdj6nOV96smLGjpElir5YwzF0LBPKoPlLDNJePNlrGGaybAJkd0zKRnOVXOgizSqPYMNYkzA== +"@babel/plugin-transform-literals@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.23.3.tgz#8214665f00506ead73de157eba233e7381f3beb4" + integrity sha512-wZ0PIXRxnwZvl9AYpqNUxpZ5BiTGrYt7kueGQ+N5FiQ7RCOD4cm8iShd6S6ggfVIWaJf2EMk8eRzAh52RfP4rQ== dependencies: - "@babel/helper-module-transforms" "^7.21.2" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-simple-access" "^7.20.2" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-systemjs@^7.20.11": - version "7.20.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.20.11.tgz#467ec6bba6b6a50634eea61c9c232654d8a4696e" - integrity sha512-vVu5g9BPQKSFEmvt2TA4Da5N+QVS66EX21d8uoOihC+OCpUoGvzVsXeqFdtAEfVa5BILAeFt+U7yVmLbQnAJmw== +"@babel/plugin-transform-logical-assignment-operators@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.23.4.tgz#e599f82c51d55fac725f62ce55d3a0886279ecb5" + integrity sha512-Mc/ALf1rmZTP4JKKEhUwiORU+vcfarFVLfcFiolKUo6sewoxSEgl36ak5t+4WamRsNr6nzjZXQjM35WsU+9vbg== dependencies: - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-module-transforms" "^7.20.11" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-validator-identifier" "^7.19.1" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-transform-modules-umd@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz#81d3832d6034b75b54e62821ba58f28ed0aab4b9" - integrity sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ== +"@babel/plugin-transform-member-expression-literals@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.23.3.tgz#e37b3f0502289f477ac0e776b05a833d853cabcc" + integrity sha512-sC3LdDBDi5x96LA+Ytekz2ZPk8i/Ck+DEuDbRAll5rknJ5XRTSaPKEYwomLcs1AA8wg9b3KjIQRsnApj+q51Ag== dependencies: - "@babel/helper-module-transforms" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-named-capturing-groups-regex@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz#626298dd62ea51d452c3be58b285d23195ba69a8" - integrity sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA== +"@babel/plugin-transform-modules-amd@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.23.3.tgz#e19b55436a1416829df0a1afc495deedfae17f7d" + integrity sha512-vJYQGxeKM4t8hYCKVBlZX/gtIY2I7mRGFNcm85sgXGMTBcoV3QdVtdpbcWEbzbfUIUZKwvgFT82mRvaQIebZzw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.20.5" - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-module-transforms" "^7.23.3" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-new-target@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz#d128f376ae200477f37c4ddfcc722a8a1b3246a8" - integrity sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw== +"@babel/plugin-transform-modules-commonjs@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.3.tgz#661ae831b9577e52be57dd8356b734f9700b53b4" + integrity sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-module-transforms" "^7.23.3" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-simple-access" "^7.22.5" -"@babel/plugin-transform-object-super@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz#fb3c6ccdd15939b6ff7939944b51971ddc35912c" - integrity sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA== +"@babel/plugin-transform-modules-systemjs@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.3.tgz#fa7e62248931cb15b9404f8052581c302dd9de81" + integrity sha512-ZxyKGTkF9xT9YJuKQRo19ewf3pXpopuYQd8cDXqNzc3mUNbOME0RKMoZxviQk74hwzfQsEe66dE92MaZbdHKNQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-replace-supers" "^7.18.6" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-module-transforms" "^7.23.3" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" -"@babel/plugin-transform-parameters@^7.20.7", "@babel/plugin-transform-parameters@^7.21.3": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.21.3.tgz#18fc4e797cf6d6d972cb8c411dbe8a809fa157db" - integrity sha512-Wxc+TvppQG9xWFYatvCGPvZ6+SIUxQ2ZdiBP+PHYMIjnPXD+uThCshaz4NZOnODAtBjjcVQQ/3OKs9LW28purQ== +"@babel/plugin-transform-modules-umd@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.23.3.tgz#5d4395fccd071dfefe6585a4411aa7d6b7d769e9" + integrity sha512-zHsy9iXX2nIsCBFPud3jKn1IRPWg3Ing1qOZgeKV39m1ZgIdpJqvlWVeiHBZC6ITRG0MfskhYe9cLgntfSFPIg== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-module-transforms" "^7.23.3" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-property-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz#e22498903a483448e94e032e9bbb9c5ccbfc93a3" - integrity sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg== +"@babel/plugin-transform-named-capturing-groups-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz#67fe18ee8ce02d57c855185e27e3dc959b2e991f" + integrity sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-regenerator@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz#57cda588c7ffb7f4f8483cc83bdcea02a907f04d" - integrity sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ== +"@babel/plugin-transform-new-target@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.23.3.tgz#5491bb78ed6ac87e990957cea367eab781c4d980" + integrity sha512-YJ3xKqtJMAT5/TIZnpAR3I+K+WaDowYbN3xyxI8zxx/Gsypwf9B9h0VB+1Nh6ACAAPRS5NSRje0uVv5i79HYGQ== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - regenerator-transform "^0.15.1" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-reserved-words@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz#b1abd8ebf8edaa5f7fe6bbb8d2133d23b6a6f76a" - integrity sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA== +"@babel/plugin-transform-nullish-coalescing-operator@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.4.tgz#45556aad123fc6e52189ea749e33ce090637346e" + integrity sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-transform-shorthand-properties@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz#6d6df7983d67b195289be24909e3f12a8f664dc9" - integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw== +"@babel/plugin-transform-numeric-separator@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.23.4.tgz#03d08e3691e405804ecdd19dd278a40cca531f29" + integrity sha512-mps6auzgwjRrwKEZA05cOwuDc9FAzoyFS4ZsG/8F43bTLf/TgkJg7QXOrPO1JO599iA3qgK9MXdMGOEC8O1h6Q== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-transform-spread@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.20.7.tgz#c2d83e0b99d3bf83e07b11995ee24bf7ca09401e" - integrity sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw== +"@babel/plugin-transform-object-rest-spread@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.23.4.tgz#2b9c2d26bf62710460bdc0d1730d4f1048361b83" + integrity sha512-9x9K1YyeQVw0iOXJlIzwm8ltobIIv7j2iLyP2jIhEbqPRQ7ScNgwQufU2I0Gq11VjyG4gI4yMXt2VFags+1N3g== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + "@babel/compat-data" "^7.23.3" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.23.3" -"@babel/plugin-transform-sticky-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz#c6706eb2b1524028e317720339583ad0f444adcc" - integrity sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q== +"@babel/plugin-transform-object-super@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.23.3.tgz#81fdb636dcb306dd2e4e8fd80db5b2362ed2ebcd" + integrity sha512-BwQ8q0x2JG+3lxCVFohg+KbQM7plfpBwThdW9A6TMtWwLsbDA01Ek2Zb/AgDN39BiZsExm4qrXxjk+P1/fzGrA== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.20" -"@babel/plugin-transform-template-literals@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz#04ec6f10acdaa81846689d63fae117dd9c243a5e" - integrity sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA== +"@babel/plugin-transform-optional-catch-binding@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.23.4.tgz#318066de6dacce7d92fa244ae475aa8d91778017" + integrity sha512-XIq8t0rJPHf6Wvmbn9nFxU6ao4c7WhghTR5WyV8SrJfUFzyxhCm4nhC+iAp3HFhbAKLfYpgzhJ6t4XCtVwqO5A== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-transform-typeof-symbol@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz#c8cea68263e45addcd6afc9091429f80925762c0" - integrity sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw== +"@babel/plugin-transform-optional-chaining@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.4.tgz#6acf61203bdfc4de9d4e52e64490aeb3e52bd017" + integrity sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-transform-unicode-escapes@^7.18.10": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz#1ecfb0eda83d09bbcb77c09970c2dd55832aa246" - integrity sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ== +"@babel/plugin-transform-parameters@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.23.3.tgz#83ef5d1baf4b1072fa6e54b2b0999a7b2527e2af" + integrity sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-unicode-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz#194317225d8c201bbae103364ffe9e2cea36cdca" - integrity sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA== +"@babel/plugin-transform-private-methods@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.23.3.tgz#b2d7a3c97e278bfe59137a978d53b2c2e038c0e4" + integrity sha512-UzqRcRtWsDMTLrRWFvUBDwmw06tCQH9Rl1uAjfh6ijMSmGYQ+fpdB+cnqRC8EMh5tuuxSv0/TejGL+7vyj+50g== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-private-property-in-object@^7.23.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.23.4.tgz#3ec711d05d6608fd173d9b8de39872d8dbf68bf5" + integrity sha512-9G3K1YqTq3F4Vt88Djx1UZ79PDyj+yKRnUy7cZGSMe+a7jkwD259uKKuUzQlPkGam7R+8RJwh5z4xO27fA1o2A== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + +"@babel/plugin-transform-property-literals@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.23.3.tgz#54518f14ac4755d22b92162e4a852d308a560875" + integrity sha512-jR3Jn3y7cZp4oEWPFAlRsSWjxKe4PZILGBSd4nis1TsC5qeSpb+nrtihJuDhNI7QHiVbUaiXa0X2RZY3/TI6Nw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-regenerator@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.23.3.tgz#141afd4a2057298602069fce7f2dc5173e6c561c" + integrity sha512-KP+75h0KghBMcVpuKisx3XTu9Ncut8Q8TuvGO4IhY+9D5DFEckQefOuIsB/gQ2tG71lCke4NMrtIPS8pOj18BQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + regenerator-transform "^0.15.2" + +"@babel/plugin-transform-reserved-words@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.23.3.tgz#4130dcee12bd3dd5705c587947eb715da12efac8" + integrity sha512-QnNTazY54YqgGxwIexMZva9gqbPa15t/x9VS+0fsEFWplwVpXYZivtgl43Z1vMpc1bdPP2PP8siFeVcnFvA3Cg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-shorthand-properties@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.23.3.tgz#97d82a39b0e0c24f8a981568a8ed851745f59210" + integrity sha512-ED2fgqZLmexWiN+YNFX26fx4gh5qHDhn1O2gvEhreLW2iI63Sqm4llRLCXALKrCnbN4Jy0VcMQZl/SAzqug/jg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-spread@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.23.3.tgz#41d17aacb12bde55168403c6f2d6bdca563d362c" + integrity sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + +"@babel/plugin-transform-sticky-regex@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.23.3.tgz#dec45588ab4a723cb579c609b294a3d1bd22ff04" + integrity sha512-HZOyN9g+rtvnOU3Yh7kSxXrKbzgrm5X4GncPY1QOquu7epga5MxKHVpYu2hvQnry/H+JjckSYRb93iNfsioAGg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-template-literals@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.23.3.tgz#5f0f028eb14e50b5d0f76be57f90045757539d07" + integrity sha512-Flok06AYNp7GV2oJPZZcP9vZdszev6vPBkHLwxwSpaIqx75wn6mUd3UFWsSsA0l8nXAKkyCmL/sR02m8RYGeHg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/preset-env@^7.13.15": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.21.4.tgz#a952482e634a8dd8271a3fe5459a16eb10739c58" - integrity sha512-2W57zHs2yDLm6GD5ZpvNn71lZ0B/iypSdIeq25OurDKji6AdzV07qp4s3n1/x5BqtiGaTrPN3nerlSCaC5qNTw== - dependencies: - "@babel/compat-data" "^7.21.4" - "@babel/helper-compilation-targets" "^7.21.4" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-validator-option" "^7.21.0" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.20.7" - "@babel/plugin-proposal-async-generator-functions" "^7.20.7" - "@babel/plugin-proposal-class-properties" "^7.18.6" - "@babel/plugin-proposal-class-static-block" "^7.21.0" - "@babel/plugin-proposal-dynamic-import" "^7.18.6" - "@babel/plugin-proposal-export-namespace-from" "^7.18.9" - "@babel/plugin-proposal-json-strings" "^7.18.6" - "@babel/plugin-proposal-logical-assignment-operators" "^7.20.7" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" - "@babel/plugin-proposal-numeric-separator" "^7.18.6" - "@babel/plugin-proposal-object-rest-spread" "^7.20.7" - "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" - "@babel/plugin-proposal-optional-chaining" "^7.21.0" - "@babel/plugin-proposal-private-methods" "^7.18.6" - "@babel/plugin-proposal-private-property-in-object" "^7.21.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.18.6" +"@babel/plugin-transform-typeof-symbol@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.23.3.tgz#9dfab97acc87495c0c449014eb9c547d8966bca4" + integrity sha512-4t15ViVnaFdrPC74be1gXBSMzXk3B4Us9lP7uLRQHTFpV5Dvt33pn+2MyyNxmN3VTTm3oTrZVMUmuw3oBnQ2oQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-escapes@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.23.3.tgz#1f66d16cab01fab98d784867d24f70c1ca65b925" + integrity sha512-OMCUx/bU6ChE3r4+ZdylEqAjaQgHAgipgW8nsCfu5pGqDcFytVd91AwRvUJSBZDz0exPGgnjoqhgRYLRjFZc9Q== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-property-regex@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.23.3.tgz#19e234129e5ffa7205010feec0d94c251083d7ad" + integrity sha512-KcLIm+pDZkWZQAFJ9pdfmh89EwVfmNovFBcXko8szpBeF8z68kWIPeKlmSOkT9BXJxs2C0uk+5LxoxIv62MROA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-regex@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.23.3.tgz#26897708d8f42654ca4ce1b73e96140fbad879dc" + integrity sha512-wMHpNA4x2cIA32b/ci3AfwNgheiva2W0WUKWTK7vBHBhDKfPsc5cFGNWm69WBqpwd86u1qwZ9PWevKqm1A3yAw== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-sets-regex@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.23.3.tgz#4fb6f0a719c2c5859d11f6b55a050cc987f3799e" + integrity sha512-W7lliA/v9bNR83Qc3q1ip9CQMZ09CcHDbHfbLRDNuAhn1Mvkr1ZNF7hPmztMQvtTGVLJ9m8IZqWsTkXOml8dbw== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/preset-env@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.23.3.tgz#d299e0140a7650684b95c62be2db0ef8c975143e" + integrity sha512-ovzGc2uuyNfNAs/jyjIGxS8arOHS5FENZaNn4rtE7UdKMMkqHCvboHfcuhWLZNX5cB44QfcGNWjaevxMzzMf+Q== + dependencies: + "@babel/compat-data" "^7.23.3" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-option" "^7.22.15" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.23.3" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.23.3" + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.23.3" + "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.20.0" + "@babel/plugin-syntax-import-assertions" "^7.23.3" + "@babel/plugin-syntax-import-attributes" "^7.23.3" + "@babel/plugin-syntax-import-meta" "^7.10.4" "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" @@ -818,54 +836,68 @@ "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.20.7" - "@babel/plugin-transform-async-to-generator" "^7.20.7" - "@babel/plugin-transform-block-scoped-functions" "^7.18.6" - "@babel/plugin-transform-block-scoping" "^7.21.0" - "@babel/plugin-transform-classes" "^7.21.0" - "@babel/plugin-transform-computed-properties" "^7.20.7" - "@babel/plugin-transform-destructuring" "^7.21.3" - "@babel/plugin-transform-dotall-regex" "^7.18.6" - "@babel/plugin-transform-duplicate-keys" "^7.18.9" - "@babel/plugin-transform-exponentiation-operator" "^7.18.6" - "@babel/plugin-transform-for-of" "^7.21.0" - "@babel/plugin-transform-function-name" "^7.18.9" - "@babel/plugin-transform-literals" "^7.18.9" - "@babel/plugin-transform-member-expression-literals" "^7.18.6" - "@babel/plugin-transform-modules-amd" "^7.20.11" - "@babel/plugin-transform-modules-commonjs" "^7.21.2" - "@babel/plugin-transform-modules-systemjs" "^7.20.11" - "@babel/plugin-transform-modules-umd" "^7.18.6" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.20.5" - "@babel/plugin-transform-new-target" "^7.18.6" - "@babel/plugin-transform-object-super" "^7.18.6" - "@babel/plugin-transform-parameters" "^7.21.3" - "@babel/plugin-transform-property-literals" "^7.18.6" - "@babel/plugin-transform-regenerator" "^7.20.5" - "@babel/plugin-transform-reserved-words" "^7.18.6" - "@babel/plugin-transform-shorthand-properties" "^7.18.6" - "@babel/plugin-transform-spread" "^7.20.7" - "@babel/plugin-transform-sticky-regex" "^7.18.6" - "@babel/plugin-transform-template-literals" "^7.18.9" - "@babel/plugin-transform-typeof-symbol" "^7.18.9" - "@babel/plugin-transform-unicode-escapes" "^7.18.10" - "@babel/plugin-transform-unicode-regex" "^7.18.6" - "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.21.4" - babel-plugin-polyfill-corejs2 "^0.3.3" - babel-plugin-polyfill-corejs3 "^0.6.0" - babel-plugin-polyfill-regenerator "^0.4.1" - core-js-compat "^3.25.1" - semver "^6.3.0" - -"@babel/preset-modules@^0.1.5": - version "0.1.5" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9" - integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== + "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" + "@babel/plugin-transform-arrow-functions" "^7.23.3" + "@babel/plugin-transform-async-generator-functions" "^7.23.3" + "@babel/plugin-transform-async-to-generator" "^7.23.3" + "@babel/plugin-transform-block-scoped-functions" "^7.23.3" + "@babel/plugin-transform-block-scoping" "^7.23.3" + "@babel/plugin-transform-class-properties" "^7.23.3" + "@babel/plugin-transform-class-static-block" "^7.23.3" + "@babel/plugin-transform-classes" "^7.23.3" + "@babel/plugin-transform-computed-properties" "^7.23.3" + "@babel/plugin-transform-destructuring" "^7.23.3" + "@babel/plugin-transform-dotall-regex" "^7.23.3" + "@babel/plugin-transform-duplicate-keys" "^7.23.3" + "@babel/plugin-transform-dynamic-import" "^7.23.3" + "@babel/plugin-transform-exponentiation-operator" "^7.23.3" + "@babel/plugin-transform-export-namespace-from" "^7.23.3" + "@babel/plugin-transform-for-of" "^7.23.3" + "@babel/plugin-transform-function-name" "^7.23.3" + "@babel/plugin-transform-json-strings" "^7.23.3" + "@babel/plugin-transform-literals" "^7.23.3" + "@babel/plugin-transform-logical-assignment-operators" "^7.23.3" + "@babel/plugin-transform-member-expression-literals" "^7.23.3" + "@babel/plugin-transform-modules-amd" "^7.23.3" + "@babel/plugin-transform-modules-commonjs" "^7.23.3" + "@babel/plugin-transform-modules-systemjs" "^7.23.3" + "@babel/plugin-transform-modules-umd" "^7.23.3" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.22.5" + "@babel/plugin-transform-new-target" "^7.23.3" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.23.3" + "@babel/plugin-transform-numeric-separator" "^7.23.3" + "@babel/plugin-transform-object-rest-spread" "^7.23.3" + "@babel/plugin-transform-object-super" "^7.23.3" + "@babel/plugin-transform-optional-catch-binding" "^7.23.3" + "@babel/plugin-transform-optional-chaining" "^7.23.3" + "@babel/plugin-transform-parameters" "^7.23.3" + "@babel/plugin-transform-private-methods" "^7.23.3" + "@babel/plugin-transform-private-property-in-object" "^7.23.3" + "@babel/plugin-transform-property-literals" "^7.23.3" + "@babel/plugin-transform-regenerator" "^7.23.3" + "@babel/plugin-transform-reserved-words" "^7.23.3" + "@babel/plugin-transform-shorthand-properties" "^7.23.3" + "@babel/plugin-transform-spread" "^7.23.3" + "@babel/plugin-transform-sticky-regex" "^7.23.3" + "@babel/plugin-transform-template-literals" "^7.23.3" + "@babel/plugin-transform-typeof-symbol" "^7.23.3" + "@babel/plugin-transform-unicode-escapes" "^7.23.3" + "@babel/plugin-transform-unicode-property-regex" "^7.23.3" + "@babel/plugin-transform-unicode-regex" "^7.23.3" + "@babel/plugin-transform-unicode-sets-regex" "^7.23.3" + "@babel/preset-modules" "0.1.6-no-external-plugins" + babel-plugin-polyfill-corejs2 "^0.4.6" + babel-plugin-polyfill-corejs3 "^0.8.5" + babel-plugin-polyfill-regenerator "^0.5.3" + core-js-compat "^3.31.0" + semver "^6.3.1" + +"@babel/preset-modules@0.1.6-no-external-plugins": + version "0.1.6-no-external-plugins" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz#ccb88a2c49c817236861fee7826080573b8a923a" + integrity sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" - "@babel/plugin-transform-dotall-regex" "^7.4.4" "@babel/types" "^7.4.4" esutils "^2.0.2" @@ -875,44 +907,44 @@ integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== "@babel/runtime@^7.8.4": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673" - integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw== - dependencies: - regenerator-runtime "^0.13.11" - -"@babel/template@^7.18.10", "@babel/template@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" - integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" - -"@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7", "@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.4.tgz#a836aca7b116634e97a6ed99976236b3282c9d36" - integrity sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q== - dependencies: - "@babel/code-frame" "^7.21.4" - "@babel/generator" "^7.21.4" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.21.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.21.4" - "@babel/types" "^7.21.4" + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.4.tgz#36fa1d2b36db873d25ec631dcc4923fdc1cf2e2e" + integrity sha512-2Yv65nlWnWlSpe3fXEyX5i7fx5kIKo4Qbcj+hMO0odwaneFjfXw5fdum+4yL20O0QiaHpia0cYQ9xpNMqrBwHg== + dependencies: + regenerator-runtime "^0.14.0" + +"@babel/template@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" + integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== + dependencies: + "@babel/code-frame" "^7.22.13" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" + +"@babel/traverse@^7.23.3", "@babel/traverse@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.4.tgz#c2790f7edf106d059a0098770fe70801417f3f85" + integrity sha512-IYM8wSUwunWTB6tFC2dkKZhxbIjHoWemdK+3f8/wq8aKhbUscxD5MX72ubd90fxvFknaLPeGw5ycU84V1obHJg== + dependencies: + "@babel/code-frame" "^7.23.4" + "@babel/generator" "^7.23.4" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.23.4" + "@babel/types" "^7.23.4" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.2", "@babel/types@^7.21.4", "@babel/types@^7.4.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.4.tgz#2d5d6bb7908699b3b416409ffd3b5daa25b030d4" - integrity sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA== +"@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.3", "@babel/types@^7.23.4", "@babel/types@^7.4.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.4.tgz#7206a1810fc512a7f7f7d4dace4cb4c1c9dbfb8e" + integrity sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ== dependencies: - "@babel/helper-string-parser" "^7.19.4" - "@babel/helper-validator-identifier" "^7.19.1" + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" "@github/details-dialog-element@^3.1.3": @@ -929,33 +961,28 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" - integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/sourcemap-codec@1.4.14": - version "1.4.14" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" - integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== - -"@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.18" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6" - integrity sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA== + version "0.3.20" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" + integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== dependencies: - "@jridgewell/resolve-uri" "3.1.0" - "@jridgewell/sourcemap-codec" "1.4.14" + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -978,74 +1005,121 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@rollup/plugin-babel@^5.3.0": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz#04bc0608f4aa4b2e4b1aebf284344d0f68fda283" - integrity sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q== +"@rollup/plugin-babel@^6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-6.0.4.tgz#bd698e351fa9aa9619fcae780aea2a603d98e4c4" + integrity sha512-YF7Y52kFdFT/xVSuVdjkV5ZdX/3YtmX0QulG+x0taQOtJdHYzVU61aSSkAgVJ7NOv6qPkIYiJSgSWWN/DM5sGw== dependencies: - "@babel/helper-module-imports" "^7.10.4" - "@rollup/pluginutils" "^3.1.0" + "@babel/helper-module-imports" "^7.18.6" + "@rollup/pluginutils" "^5.0.1" -"@rollup/plugin-commonjs@^18.0.0": - version "18.1.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-18.1.0.tgz#5a760d757af168a50727c0ae080251fbfcc5eb02" - integrity sha512-h3e6T9rUxVMAQswpDIobfUHn/doMzM9sgkMrsMWCFLmB84PSoC8mV8tOloAJjSRwdqhXBqstlX2BwBpHJvbhxg== +"@rollup/plugin-commonjs@^25.0.7": + version "25.0.7" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.7.tgz#145cec7589ad952171aeb6a585bbeabd0fd3b4cf" + integrity sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ== dependencies: - "@rollup/pluginutils" "^3.1.0" + "@rollup/pluginutils" "^5.0.1" commondir "^1.0.1" - estree-walker "^2.0.1" - glob "^7.1.6" - is-reference "^1.2.1" - magic-string "^0.25.7" - resolve "^1.17.0" - -"@rollup/plugin-node-resolve@^11.2.1": - version "11.2.1" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" - integrity sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg== - dependencies: - "@rollup/pluginutils" "^3.1.0" - "@types/resolve" "1.17.1" - builtin-modules "^3.1.0" + estree-walker "^2.0.2" + glob "^8.0.3" + is-reference "1.2.1" + magic-string "^0.30.3" + +"@rollup/plugin-node-resolve@^15.2.3": + version "15.2.3" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz#e5e0b059bd85ca57489492f295ce88c2d4b0daf9" + integrity sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ== + dependencies: + "@rollup/pluginutils" "^5.0.1" + "@types/resolve" "1.20.2" deepmerge "^4.2.2" + is-builtin-module "^3.2.1" is-module "^1.0.0" - resolve "^1.19.0" + resolve "^1.22.1" -"@rollup/pluginutils@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" - integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== +"@rollup/pluginutils@^5.0.1": + version "5.0.5" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.0.5.tgz#bbb4c175e19ebfeeb8c132c2eea0ecb89941a66c" + integrity sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q== dependencies: - "@types/estree" "0.0.39" - estree-walker "^1.0.1" - picomatch "^2.2.2" + "@types/estree" "^1.0.0" + estree-walker "^2.0.2" + picomatch "^2.3.1" + +"@rollup/rollup-android-arm-eabi@4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.5.0.tgz#5984f98288150a2c34928de023bbd122d61ce754" + integrity sha512-OINaBGY+Wc++U0rdr7BLuFClxcoWaVW3vQYqmQq6B3bqQ/2olkaoz+K8+af/Mmka/C2yN5j+L9scBkv4BtKsDA== + +"@rollup/rollup-android-arm64@4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.5.0.tgz#8456a8c623cca4042ae4bf2ce03d875a02433191" + integrity sha512-UdMf1pOQc4ZmUA/NTmKhgJTBimbSKnhPS2zJqucqFyBRFPnPDtwA8MzrGNTjDeQbIAWfpJVAlxejw+/lQyBK/w== + +"@rollup/rollup-darwin-arm64@4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.5.0.tgz#76be6832eee21dabc28f84f9f54fbfcc66615992" + integrity sha512-L0/CA5p/idVKI+c9PcAPGorH6CwXn6+J0Ys7Gg1axCbTPgI8MeMlhA6fLM9fK+ssFhqogMHFC8HDvZuetOii7w== + +"@rollup/rollup-darwin-x64@4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.5.0.tgz#66bd162a3fea48cb1cef50cedccfbeee5685b444" + integrity sha512-QZCbVqU26mNlLn8zi/XDDquNmvcr4ON5FYAHQQsyhrHx8q+sQi/6xduoznYXwk/KmKIXG5dLfR0CvY+NAWpFYQ== + +"@rollup/rollup-linux-arm-gnueabihf@4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.5.0.tgz#a0e6b2a1d67a4ba0c2a61985175f65c05abc5f73" + integrity sha512-VpSQ+xm93AeV33QbYslgf44wc5eJGYfYitlQzAi3OObu9iwrGXEnmu5S3ilkqE3Pr/FkgOiJKV/2p0ewf4Hrtg== + +"@rollup/rollup-linux-arm64-gnu@4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.5.0.tgz#5434b844a47ba4e35602ee312de9f39b38b1777b" + integrity sha512-OrEyIfpxSsMal44JpEVx9AEcGpdBQG1ZuWISAanaQTSMeStBW+oHWwOkoqR54bw3x8heP8gBOyoJiGg+fLY8qQ== + +"@rollup/rollup-linux-arm64-musl@4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.5.0.tgz#149cab95107821fe4ae46d5f2c0658c5b0e56b9c" + integrity sha512-1H7wBbQuE6igQdxMSTjtFfD+DGAudcYWhp106z/9zBA8OQhsJRnemO4XGavdzHpGhRtRxbgmUGdO3YQgrWf2RA== + +"@rollup/rollup-linux-x64-gnu@4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.5.0.tgz#6929bf3013e9d599605953ea1bc51f35376bfff7" + integrity sha512-FVyFI13tXw5aE65sZdBpNjPVIi4Q5mARnL/39UIkxvSgRAIqCo5sCpCELk0JtXHGee2owZz5aNLbWNfBHzr71Q== + +"@rollup/rollup-linux-x64-musl@4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.5.0.tgz#a17f5decabf05b74aad684de56cf43a72a289a0b" + integrity sha512-eBPYl2sLpH/o8qbSz6vPwWlDyThnQjJfcDOGFbNjmjb44XKC1F5dQfakOsADRVrXCNzM6ZsSIPDG5dc6HHLNFg== + +"@rollup/rollup-win32-arm64-msvc@4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.5.0.tgz#f145f10c33aa187a11fd60933465be46667e6e42" + integrity sha512-xaOHIfLOZypoQ5U2I6rEaugS4IYtTgP030xzvrBf5js7p9WI9wik07iHmsKaej8Z83ZDxN5GyypfoyKV5O5TJA== + +"@rollup/rollup-win32-ia32-msvc@4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.5.0.tgz#798614b191f9ce1dc58079d1dfbc234c71df9e0e" + integrity sha512-Al6quztQUrHwcOoU2TuFblUQ5L+/AmPBXFR6dUvyo4nRj2yQRK0WIUaGMF/uwKulvRcXkpHe3k9A8Vf93VDktA== + +"@rollup/rollup-win32-x64-msvc@4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.5.0.tgz#748970e066839e33ed8c935061e370c4ab050517" + integrity sha512-8kdW+brNhI/NzJ4fxDufuJUjepzINqJKLGHuxyAtpPG9bMbn8P5mtaCcbOm0EzLJ+atg+kF9dwg8jpclkVqx5w== "@trysound/sax@0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== -"@types/estree@*": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194" - integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA== - -"@types/estree@0.0.39": - version "0.0.39" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" - integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== - -"@types/node@*": - version "18.16.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.0.tgz#4668bc392bb6938637b47e98b1f2ed5426f33316" - integrity sha512-BsAaKhB+7X+H4GnSjGhJG9Qi8Tw+inU9nJDwmD5CgOmBLEI6ArdhikpLX7DjbjDRDTbqZzU2LSQNZg8WGPiSZQ== +"@types/estree@*", "@types/estree@^1.0.0": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== -"@types/resolve@1.17.1": - version "1.17.1" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" - integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== - dependencies: - "@types/node" "*" +"@types/resolve@1.20.2": + version "1.20.2" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975" + integrity sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q== "@webcomponents/custom-elements@^1.5.0": version "1.6.0" @@ -1085,40 +1159,40 @@ arg@^5.0.2: integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg== autoprefixer@^10.4.15: - version "10.4.15" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.15.tgz#a1230f4aeb3636b89120b34a1f513e2f6834d530" - integrity sha512-KCuPB8ZCIqFdA4HwKXsvz7j6gvSDNhDP7WnUjBleRkKjPdvCmHFuQ77ocavI8FT6NdvlBnE2UFr2H4Mycn8Vew== + version "10.4.16" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.16.tgz#fad1411024d8670880bdece3970aa72e3572feb8" + integrity sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ== dependencies: browserslist "^4.21.10" - caniuse-lite "^1.0.30001520" - fraction.js "^4.2.0" + caniuse-lite "^1.0.30001538" + fraction.js "^4.3.6" normalize-range "^0.1.2" picocolors "^1.0.0" postcss-value-parser "^4.2.0" -babel-plugin-polyfill-corejs2@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" - integrity sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q== +babel-plugin-polyfill-corejs2@^0.4.6: + version "0.4.6" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.6.tgz#b2df0251d8e99f229a8e60fc4efa9a68b41c8313" + integrity sha512-jhHiWVZIlnPbEUKSSNb9YoWcQGdlTLq7z1GHL4AjFxaoOUMuuEVJ+Y4pAaQUGOGk93YsVCKPbqbfw3m0SM6H8Q== dependencies: - "@babel/compat-data" "^7.17.7" - "@babel/helper-define-polyfill-provider" "^0.3.3" - semver "^6.1.1" + "@babel/compat-data" "^7.22.6" + "@babel/helper-define-polyfill-provider" "^0.4.3" + semver "^6.3.1" -babel-plugin-polyfill-corejs3@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz#56ad88237137eade485a71b52f72dbed57c6230a" - integrity sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA== +babel-plugin-polyfill-corejs3@^0.8.5: + version "0.8.6" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.6.tgz#25c2d20002da91fe328ff89095c85a391d6856cf" + integrity sha512-leDIc4l4tUgU7str5BWLS2h8q2N4Nf6lGZP6UrNDxdtfF2g69eJ5L0H7S8A5Ln/arfFAfHor5InAdZuIOwZdgQ== dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.3" - core-js-compat "^3.25.1" + "@babel/helper-define-polyfill-provider" "^0.4.3" + core-js-compat "^3.33.1" -babel-plugin-polyfill-regenerator@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz#390f91c38d90473592ed43351e801a9d3e0fd747" - integrity sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw== +babel-plugin-polyfill-regenerator@^0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.3.tgz#d4c49e4b44614607c13fb769bcd85c72bb26a4a5" + integrity sha512-8sHeDOmXC8csczMrYEOf0UTNa4yE2SxV5JGeT/LP1n0OYVDUUFPxG9vdk2AlDlIit4t+Kf0xCtpgXPBwnn/9pw== dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.3" + "@babel/helper-define-polyfill-provider" "^0.4.3" balanced-match@^1.0.0: version "1.0.2" @@ -1143,6 +1217,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -1150,27 +1231,17 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.0.0, browserslist@^4.21.3, browserslist@^4.21.4, browserslist@^4.21.5: - version "4.21.5" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.5.tgz#75c5dae60063ee641f977e00edd3cfb2fb7af6a7" - integrity sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w== - dependencies: - caniuse-lite "^1.0.30001449" - electron-to-chromium "^1.4.284" - node-releases "^2.0.8" - update-browserslist-db "^1.0.10" - -browserslist@^4.21.10: - version "4.21.10" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.10.tgz#dbbac576628c13d3b2231332cb2ec5a46e015bb0" - integrity sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ== +browserslist@^4.0.0, browserslist@^4.21.10, browserslist@^4.21.4, browserslist@^4.21.9, browserslist@^4.22.1: + version "4.22.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.1.tgz#ba91958d1a59b87dab6fed8dfbcb3da5e2e9c619" + integrity sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ== dependencies: - caniuse-lite "^1.0.30001517" - electron-to-chromium "^1.4.477" + caniuse-lite "^1.0.30001541" + electron-to-chromium "^1.4.535" node-releases "^2.0.13" - update-browserslist-db "^1.0.11" + update-browserslist-db "^1.0.13" -builtin-modules@^3.1.0: +builtin-modules@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== @@ -1190,17 +1261,12 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001449: - version "1.0.30001481" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001481.tgz#f58a717afe92f9e69d0e35ff64df596bfad93912" - integrity sha512-KCqHwRnaa1InZBtqXzP98LPg0ajCVujMKjqKDhZEthIpAsJl/YEIa3YvXjGXPVqzZVguccuu7ga9KOE1J9rKPQ== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001538, caniuse-lite@^1.0.30001541: + version "1.0.30001563" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001563.tgz#aa68a64188903e98f36eb9c56e48fba0c1fe2a32" + integrity sha512-na2WUmOxnwIZtwnFI2CZ/3er0wdNzU7hN+cPYz/z2ajHThnkWjNBOpEPP4n+4r2WPM847JaMotaJE3bnfzjyKw== -caniuse-lite@^1.0.30001517, caniuse-lite@^1.0.30001520: - version "1.0.30001534" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001534.tgz#f24a9b2a6d39630bac5c132b5dff89b39a12e7dd" - integrity sha512-vlPVrhsCS7XaSh2VvWluIQEzVhefrUQcEsQWSS5A5V+dM07uv1qHeQzAOTGIMy9i3e9bH15+muvI/UHojVgS/Q== - -chalk@^2.0.0: +chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1288,33 +1354,22 @@ concat-with-sourcemaps@^1.1.0: dependencies: source-map "^0.6.1" -convert-source-map@^1.7.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" - integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -core-js-compat@^3.25.1: - version "3.30.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.30.1.tgz#961541e22db9c27fc48bfc13a3cafa8734171dfe" - integrity sha512-d690npR7MC6P0gq4npTl5n2VQeNAmUrJ90n+MHiKS7W2+xno4o3F5GDEuylSdi6EJ3VssibSGXOa1r3YXD3Mhw== +core-js-compat@^3.31.0, core-js-compat@^3.33.1: + version "3.33.3" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.33.3.tgz#ec678b772c5a2d8a7c60a91c3a81869aa704ae01" + integrity sha512-cNzGqFsh3Ot+529GIXacjTJ7kegdt5fPXxCBVS1G0iaZpuo/tBz399ymceLJveQhFFZ8qThHiP3fzuoQjKN2ow== dependencies: - browserslist "^4.21.5" + browserslist "^4.22.1" css-declaration-sorter@^6.3.1: - version "6.4.0" - resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-6.4.0.tgz#630618adc21724484b3e9505bce812def44000ad" - integrity sha512-jDfsatwWMWN0MODAFuHszfjphEXfNw9JUAhmY4pLu3TyTU+ohUpsbVtbU+1MZn4a47D9kqh03i4eyOm+74+zew== - -css-select@^3.1.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-3.1.2.tgz#d52cbdc6fee379fba97fb0d3925abbd18af2d9d8" - integrity sha512-qmss1EihSuBNWNNhHjxzxSfJoFBM/lERB/Q4EnsJQQC62R2evJDW481091oAdOr9uh46/0n4nrg0It5cAnj1RA== - dependencies: - boolbase "^1.0.0" - css-what "^4.0.0" - domhandler "^4.0.0" - domutils "^2.4.3" - nth-check "^2.0.0" + version "6.4.1" + resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-6.4.1.tgz#28beac7c20bad7f1775be3a7129d7eae409a3a71" + integrity sha512-rtdthzxKuyq6IzqX6jEcIzQF/YqccluefyCYheovBOLhFT/drQA9zj/UbRAa9J7C0o6EG6u3E6g+vKkay7/k3g== css-select@^4.1.3: version "4.3.0" @@ -1327,6 +1382,17 @@ css-select@^4.1.3: domutils "^2.8.0" nth-check "^2.0.1" +css-select@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-5.1.0.tgz#b8ebd6554c3637ccc76688804ad3f6a6fdaea8a6" + integrity sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg== + dependencies: + boolbase "^1.0.0" + css-what "^6.1.0" + domhandler "^5.0.2" + domutils "^3.0.1" + nth-check "^2.0.1" + css-tree@^1.1.2, css-tree@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d" @@ -1335,12 +1401,7 @@ css-tree@^1.1.2, css-tree@^1.1.3: mdn-data "2.0.14" source-map "^0.6.1" -css-what@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-4.0.0.tgz#35e73761cab2eeb3d3661126b23d7aa0e8432233" - integrity sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A== - -css-what@^6.0.1: +css-what@^6.0.1, css-what@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== @@ -1433,7 +1494,7 @@ dlv@^1.1.3: resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79" integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA== -dom-serializer@^1.0.1, dom-serializer@^1.1.0: +dom-serializer@^1.0.1: version "1.4.1" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.4.1.tgz#de5d41b1aea290215dc45a6dae8adcf1d32e2d30" integrity sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag== @@ -1442,26 +1503,35 @@ dom-serializer@^1.0.1, dom-serializer@^1.1.0: domhandler "^4.2.0" entities "^2.0.0" -domelementtype@^2.0.1, domelementtype@^2.2.0: +dom-serializer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" + integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.2" + entities "^4.2.0" + +domelementtype@^2.0.1, domelementtype@^2.2.0, domelementtype@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== -domhandler@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-3.3.0.tgz#6db7ea46e4617eb15cf875df68b2b8524ce0037a" - integrity sha512-J1C5rIANUbuYK+FuFL98650rihynUOEzRLxW+90bKZRWB6A1X1Tf82GxR1qAWLyfNPRvjqfip3Q5tdYlmAa9lA== - dependencies: - domelementtype "^2.0.1" - -domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.3.1: +domhandler@^4.2.0, domhandler@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ== dependencies: domelementtype "^2.2.0" -domutils@^2.4.2, domutils@^2.4.3, domutils@^2.8.0: +domhandler@^5.0.2, domhandler@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" + integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== + dependencies: + domelementtype "^2.3.0" + +domutils@^2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== @@ -1470,21 +1540,30 @@ domutils@^2.4.2, domutils@^2.4.3, domutils@^2.8.0: domelementtype "^2.2.0" domhandler "^4.2.0" -electron-to-chromium@^1.4.284: - version "1.4.371" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.371.tgz#393983ef087268a20c926a89be30e9f0bfc803b0" - integrity sha512-jlBzY4tFcJaiUjzhRTCWAqRvTO/fWzjA3Bls0mykzGZ7zvcMP7h05W6UcgzfT9Ca1SW2xyKDOFRyI0pQeRNZGw== +domutils@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.1.0.tgz#c47f551278d3dc4b0b1ab8cbb42d751a6f0d824e" + integrity sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA== + dependencies: + dom-serializer "^2.0.0" + domelementtype "^2.3.0" + domhandler "^5.0.3" -electron-to-chromium@^1.4.477: - version "1.4.519" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.519.tgz#01b9bc3f1bb50c4971bdd1eeca6d9a73575bd581" - integrity sha512-kqs9oGYL4UFVkLKhqCTgBCYZv+wZ374yABDMqlDda9HvlkQxvSr7kgf4hfWVjMieDbX+1MwPHFBsOGCMIBaFKg== +electron-to-chromium@^1.4.535: + version "1.4.589" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.589.tgz#3fc83c284ed8f1f58e0cb3c664c8ebcb4d0b42fb" + integrity sha512-zF6y5v/YfoFIgwf2dDfAqVlPPsyQeWNpEWXbAlDUS8Ax4Z2VoiiZpAPC0Jm9hXEkJm2vIZpwB6rc4KnLTQffbQ== entities@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== +entities@^4.2.0, entities@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -1500,12 +1579,7 @@ estree-walker@^0.6.1: resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== -estree-walker@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" - integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== - -estree-walker@^2.0.1: +estree-walker@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== @@ -1520,10 +1594,10 @@ eventemitter3@^4.0.4: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== -fast-glob@^3.2.12: - version "3.3.1" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" - integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== +fast-glob@^3.3.0: + version "3.3.2" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" + integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -1550,10 +1624,10 @@ flatpickr@^4.6.9: resolved "https://registry.yarnpkg.com/flatpickr/-/flatpickr-4.6.13.tgz#8a029548187fd6e0d670908471e43abe9ad18d94" integrity sha512-97PMG/aywoYpB4IvbvUJi0RQi8vearvU0oov1WW3k0WZPBMrTQVqekSX5CjSG/M4Q3i6A/0FKXC7RyAoAUUSPw== -fraction.js@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.2.0.tgz#448e5109a313a3527f5a3ab2119ec4cf0e0e2950" - integrity sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA== +fraction.js@^4.3.6: + version "4.3.7" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.7.tgz#06ca0085157e42fda7f9e726e79fefc4068840f7" + integrity sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew== fs.realpath@^1.0.0: version "1.0.0" @@ -1561,14 +1635,14 @@ fs.realpath@^1.0.0: integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== generic-names@^4.0.0: version "4.0.0" @@ -1608,17 +1682,16 @@ glob@7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.6: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== +glob@^8.0.3: + version "8.1.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.1.1" + minimatch "^5.0.1" once "^1.3.0" - path-is-absolute "^1.0.0" globals@^11.1.0: version "11.12.0" @@ -1635,22 +1708,22 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== +hasown@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" + integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== dependencies: - function-bind "^1.1.1" + function-bind "^1.1.2" -htmlparser2@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-5.0.1.tgz#7daa6fc3e35d6107ac95a4fc08781f091664f6e7" - integrity sha512-vKZZra6CSe9qsJzh0BjBGXo8dvzNsq/oGvsjfRdOrrryfeD9UOBEEQdeoqCRmKZchF5h2zOBMQ6YuQ0uRUmdbQ== +htmlparser2@^8.0.1: + version "8.0.2" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-8.0.2.tgz#f002151705b383e62433b5cf466f5b716edaec21" + integrity sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA== dependencies: - domelementtype "^2.0.1" - domhandler "^3.3.0" - domutils "^2.4.2" - entities "^2.0.0" + domelementtype "^2.3.0" + domhandler "^5.0.3" + domutils "^3.0.1" + entities "^4.4.0" icss-replace-symbols@^1.1.0: version "1.1.0" @@ -1696,19 +1769,19 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-core-module@^2.11.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.0.tgz#36ad62f6f73c8253fd6472517a12483cf03e7ec4" - integrity sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ== +is-builtin-module@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" + integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== dependencies: - has "^1.0.3" + builtin-modules "^3.3.0" is-core-module@^2.13.0: - version "2.13.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db" - integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== + version "2.13.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" + integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== dependencies: - has "^1.0.3" + hasown "^2.0.0" is-extglob@^2.1.1: version "2.1.1" @@ -1732,17 +1805,17 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-reference@^1.2.1: +is-reference@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== dependencies: "@types/estree" "*" -jiti@^1.18.2: - version "1.20.0" - resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.20.0.tgz#2d823b5852ee8963585c8dd8b7992ffc1ae83b42" - integrity sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA== +jiti@^1.19.1: + version "1.21.0" + resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.0.tgz#7c97f8fe045724e136a397f7340475244156105d" + integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q== js-tokens@^4.0.0: version "4.0.0" @@ -1759,7 +1832,7 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== -json5@^2.2.2: +json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -1769,6 +1842,11 @@ lilconfig@^2.0.3, lilconfig@^2.0.5, lilconfig@^2.1.0: resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== +lilconfig@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.0.0.tgz#f8067feb033b5b74dab4602a5f5029420be749bc" + integrity sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g== + lines-and-columns@^1.1.6: version "1.2.4" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" @@ -1806,12 +1884,12 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" -magic-string@^0.25.7: - version "0.25.9" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" - integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== +magic-string@^0.30.3: + version "0.30.5" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.5.tgz#1994d980bd1c8835dc6e78db7cbd4ae4f24746f9" + integrity sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA== dependencies: - sourcemap-codec "^1.4.8" + "@jridgewell/sourcemap-codec" "^1.4.15" mdn-data@2.0.14: version "2.0.14" @@ -1831,13 +1909,20 @@ micromatch@^4.0.4, micromatch@^4.0.5: braces "^3.0.2" picomatch "^2.3.1" -minimatch@^3.0.4, minimatch@^3.1.1: +minimatch@^3.0.4: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" +minimatch@^5.0.1: + version "5.1.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -1853,20 +1938,15 @@ mz@^2.7.0: thenify-all "^1.0.0" nanoid@^3.3.6: - version "3.3.6" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" - integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== + version "3.3.7" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" + integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== node-releases@^2.0.13: version "2.0.13" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== -node-releases@^2.0.8: - version "2.0.10" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.10.tgz#c311ebae3b6a148c89b1813fd7c4d3c024ef537f" - integrity sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w== - normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -1882,7 +1962,7 @@ normalize-url@^6.0.1: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== -nth-check@^2.0.0, nth-check@^2.0.1: +nth-check@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== @@ -1941,7 +2021,7 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.3.1: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -2007,15 +2087,6 @@ postcss-discard-overridden@^5.1.0: resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-5.1.0.tgz#7e8c5b53325747e9d90131bb88635282fb4a276e" integrity sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw== -postcss-import@^14.0.1: - version "14.1.0" - resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-14.1.0.tgz#a7333ffe32f0b8795303ee9e40215dac922781f0" - integrity sha512-flwI+Vgm4SElObFVPpTIT7SU7R3qk2L7PyduMcokiaVKuWv9d/U+Gm/QAd8NDLuykTWTkcrjOeD2Pp1rMeBTGw== - dependencies: - postcss-value-parser "^4.0.0" - read-cache "^1.0.0" - resolve "^1.1.7" - postcss-import@^15.1.0: version "15.1.0" resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-15.1.0.tgz#41c64ed8cc0e23735a9698b3249ffdbf704adc70" @@ -2025,15 +2096,15 @@ postcss-import@^15.1.0: read-cache "^1.0.0" resolve "^1.1.7" -postcss-inline-svg@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/postcss-inline-svg/-/postcss-inline-svg-5.0.0.tgz#ab8d1cd14defcbf5655fd618f7789993c70f5297" - integrity sha512-Agqkrn91Qgi+KAO+cTvUS1IAZbHPD4sryPoG0q5U0ThokL4UGoMcmwvNV6tDoRp69B5tgD1VNkn9P09E+xpQAg== +postcss-inline-svg@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/postcss-inline-svg/-/postcss-inline-svg-6.0.0.tgz#8fef43627d7616c84d13408363d01f4869e1b22c" + integrity sha512-ok5j0Iqsn8mS/5U1W+Im6qkQjm6nBxdwwJU+BSnBaDhLjC06h1xvy9MA+tefxhfZP/ARTRwARSozzYGf/sqEGg== dependencies: - css-select "^3.1.0" - dom-serializer "^1.1.0" - htmlparser2 "^5.0.1" - postcss-value-parser "^4.0.0" + css-select "^5.1.0" + dom-serializer "^2.0.0" + htmlparser2 "^8.0.1" + postcss-value-parser "^4.2.0" postcss-js@^4.0.1: version "4.0.1" @@ -2051,12 +2122,12 @@ postcss-load-config@^3.0.0: yaml "^1.10.2" postcss-load-config@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-4.0.1.tgz#152383f481c2758274404e4962743191d73875bd" - integrity sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA== + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-4.0.2.tgz#7159dcf626118d33e299f485d6afe4aff7c4a3e3" + integrity sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ== dependencies: - lilconfig "^2.0.5" - yaml "^2.1.1" + lilconfig "^3.0.0" + yaml "^2.3.4" postcss-merge-longhand@^5.1.7: version "5.1.7" @@ -2114,9 +2185,9 @@ postcss-modules-extract-imports@^3.0.0: integrity sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw== postcss-modules-local-by-default@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz#ebbb54fae1598eecfdf691a02b3ff3b390a5a51c" - integrity sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ== + version "4.0.3" + resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.3.tgz#b08eb4f083050708998ba2c6061b50c2870ca524" + integrity sha512-2/u2zraspoACtrbFRnTijMiQtb4GW4BvatjaG/bCjYQo8kLTdevCUlwuBHx2sCnSyrI3x3qj4ZK1j5LQBgzmwA== dependencies: icss-utils "^5.0.0" postcss-selector-parser "^6.0.2" @@ -2243,7 +2314,7 @@ postcss-reduce-transforms@^5.1.0: dependencies: postcss-value-parser "^4.2.0" -postcss-selector-parser@^6.0.11: +postcss-selector-parser@^6.0.11, postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.5, postcss-selector-parser@^6.0.9: version "6.0.13" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz#d05d8d76b1e8e173257ef9d60b706a8e5e99bf1b" integrity sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ== @@ -2251,14 +2322,6 @@ postcss-selector-parser@^6.0.11: cssesc "^3.0.0" util-deprecate "^1.0.2" -postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.5, postcss-selector-parser@^6.0.9: - version "6.0.11" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz#2e41dc39b7ad74046e1615185185cd0b17d0c8dc" - integrity sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g== - dependencies: - cssesc "^3.0.0" - util-deprecate "^1.0.2" - postcss-svgo@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-5.1.0.tgz#0a317400ced789f233a28826e77523f15857d80d" @@ -2280,9 +2343,9 @@ postcss-value-parser@^4.0.0, postcss-value-parser@^4.1.0, postcss-value-parser@^ integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== postcss@^8.4.23, postcss@^8.4.29: - version "8.4.29" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.29.tgz#33bc121cf3b3688d4ddef50be869b2a54185a1dd" - integrity sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw== + version "8.4.31" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d" + integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ== dependencies: nanoid "^3.3.6" picocolors "^1.0.0" @@ -2318,9 +2381,9 @@ readdirp@~3.6.0: picomatch "^2.2.1" regenerate-unicode-properties@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c" - integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ== + version "10.1.1" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz#6b0e05489d9076b04c436f318d9b067bba459480" + integrity sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q== dependencies: regenerate "^1.4.2" @@ -2329,15 +2392,15 @@ regenerate@^1.4.2: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.13.11: - version "0.13.11" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" - integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== -regenerator-transform@^0.15.1: - version "0.15.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56" - integrity sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg== +regenerator-transform@^0.15.2: + version "0.15.2" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" + integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== dependencies: "@babel/runtime" "^7.8.4" @@ -2365,19 +2428,10 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve@^1.1.7, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0: - version "1.22.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" - integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== - dependencies: - is-core-module "^2.11.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -resolve@^1.22.2: - version "1.22.4" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.4.tgz#1dc40df46554cdaf8948a486a10f6ba1e2026c34" - integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg== +resolve@^1.1.7, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.22.1, resolve@^1.22.2: + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== dependencies: is-core-module "^2.13.0" path-parse "^1.0.7" @@ -2414,11 +2468,23 @@ rollup-pluginutils@^2.8.2: dependencies: estree-walker "^0.6.1" -rollup@^2.45.2: - version "2.79.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" - integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw== +rollup@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.5.0.tgz#358ee6947fe0e4c8bacdae6896539cade3107655" + integrity sha512-41xsWhzxqjMDASCxH5ibw1mXk+3c4TNI2UjKbLxe6iEzrSQnqOzmmK8/3mufCPbzHNJ2e04Fc1ddI35hHy+8zg== optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.5.0" + "@rollup/rollup-android-arm64" "4.5.0" + "@rollup/rollup-darwin-arm64" "4.5.0" + "@rollup/rollup-darwin-x64" "4.5.0" + "@rollup/rollup-linux-arm-gnueabihf" "4.5.0" + "@rollup/rollup-linux-arm64-gnu" "4.5.0" + "@rollup/rollup-linux-arm64-musl" "4.5.0" + "@rollup/rollup-linux-x64-gnu" "4.5.0" + "@rollup/rollup-linux-x64-musl" "4.5.0" + "@rollup/rollup-win32-arm64-msvc" "4.5.0" + "@rollup/rollup-win32-ia32-msvc" "4.5.0" + "@rollup/rollup-win32-x64-msvc" "4.5.0" fsevents "~2.3.2" run-parallel@^1.1.9: @@ -2433,10 +2499,10 @@ safe-identifier@^0.4.2: resolved "https://registry.yarnpkg.com/safe-identifier/-/safe-identifier-0.4.2.tgz#cf6bfca31c2897c588092d1750d30ef501d59fcb" integrity sha512-6pNbSMW6OhAi9j+N8V+U715yBQsaWJ7eyEUaOrawX+isg5ZxhUlV1NipNtgaKHmFGiABwt+ZF04Ii+3Xjkg+8w== -semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== source-map-js@^1.0.2: version "1.0.2" @@ -2448,11 +2514,6 @@ source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -sourcemap-codec@^1.4.8: - version "1.4.8" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" - integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== - stable@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" @@ -2522,19 +2583,19 @@ svgo@^2.7.0: stable "^0.1.8" tailwindcss@^3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.3.3.tgz#90da807393a2859189e48e9e7000e6880a736daf" - integrity sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w== + version "3.3.5" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.3.5.tgz#22a59e2fbe0ecb6660809d9cc5f3976b077be3b8" + integrity sha512-5SEZU4J7pxZgSkv7FP1zY8i2TIAOooNZ1e/OGtxIEv6GltpoiXUqWvLy89+a10qYTB1N5Ifkuw9lqQkN9sscvA== dependencies: "@alloc/quick-lru" "^5.2.0" arg "^5.0.2" chokidar "^3.5.3" didyoumean "^1.2.2" dlv "^1.1.3" - fast-glob "^3.2.12" + fast-glob "^3.3.0" glob-parent "^6.0.2" is-glob "^4.0.3" - jiti "^1.18.2" + jiti "^1.19.1" lilconfig "^2.1.0" micromatch "^4.0.5" normalize-path "^3.0.0" @@ -2604,14 +2665,14 @@ unicode-property-aliases-ecmascript@^2.0.0: integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== unpoly@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/unpoly/-/unpoly-3.3.0.tgz#44fb25aa344b1bc3c14426656d11f1a71b97b080" - integrity sha512-OYFi2AtCmeTwhH8RPvz+7+Gaz+nCMJ3Ezx0kfqEoKyBdN1BffbU/vtR4IbsiprRoKrsO4gywchdsPjXdwCY/Sg== + version "3.5.2" + resolved "https://registry.yarnpkg.com/unpoly/-/unpoly-3.5.2.tgz#bdcdc6b9f1052d50016e120e6a26366a76bd8371" + integrity sha512-CVszxq9murlBRqBMGOZJrmQwN51edqEX3GrEFF47GHhVxI+6e1K6Gh6eHDfN6YQRPNk4lpMoVxhURXKGUUU9Mw== -update-browserslist-db@^1.0.10, update-browserslist-db@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" - integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== +update-browserslist-db@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" + integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -2636,7 +2697,7 @@ yaml@^1.10.2: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yaml@^2.1.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.2.tgz#f522db4313c671a0ca963a75670f1c12ea909144" - integrity sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg== +yaml@^2.3.4: + version "2.3.4" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2" + integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==