first commit
This commit is contained in:
7
node_modules/lit-html/node/async-directive.js
generated
vendored
Normal file
7
node_modules/lit-html/node/async-directive.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import{isSingleExpression as i}from"./directive-helpers.js";import{Directive as t,PartType as e}from"./directive.js";export{Directive,PartType,directive}from"./directive.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const s=(i,t)=>{var e,o;const r=i._$AN;if(void 0===r)return!1;for(const i of r)null===(o=(e=i)._$AO)||void 0===o||o.call(e,t,!1),s(i,t);return!0},o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===(null==e?void 0:e.size))},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),l(t)}};function n(i){void 0!==this._$AN?(o(this),this._$AM=i,r(this)):this._$AM=i}function h(i,t=!1,e=0){const r=this._$AH,n=this._$AN;if(void 0!==n&&0!==n.size)if(t)if(Array.isArray(r))for(let i=e;i<r.length;i++)s(r[i],!1),o(r[i]);else null!=r&&(s(r,!1),o(r));else s(this,i)}const l=i=>{var t,s,o,r;i.type==e.CHILD&&(null!==(t=(o=i)._$AP)&&void 0!==t||(o._$AP=h),null!==(s=(r=i)._$AQ)&&void 0!==s||(r._$AQ=n))};class c extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU}_$AO(i,t=!0){var e,r;i!==this.isConnected&&(this.isConnected=i,i?null===(e=this.reconnected)||void 0===e||e.call(this):null===(r=this.disconnected)||void 0===r||r.call(this)),t&&(s(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{c as AsyncDirective};
|
||||
//# sourceMappingURL=async-directive.js.map
|
1
node_modules/lit-html/node/async-directive.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/async-directive.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
248
node_modules/lit-html/node/development/async-directive.js
generated
vendored
Normal file
248
node_modules/lit-html/node/development/async-directive.js
generated
vendored
Normal file
@@ -0,0 +1,248 @@
|
||||
import { isSingleExpression } from './directive-helpers.js';
|
||||
import { Directive, PartType } from './directive.js';
|
||||
export { Directive, PartType, directive } from './directive.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
/**
|
||||
* Recursively walks down the tree of Parts/TemplateInstances/Directives to set
|
||||
* the connected state of directives and run `disconnected`/ `reconnected`
|
||||
* callbacks.
|
||||
*
|
||||
* @return True if there were children to disconnect; false otherwise
|
||||
*/
|
||||
const notifyChildrenConnectedChanged = (parent, isConnected) => {
|
||||
var _a, _b;
|
||||
const children = parent._$disconnectableChildren;
|
||||
if (children === undefined) {
|
||||
return false;
|
||||
}
|
||||
for (const obj of children) {
|
||||
// The existence of `_$notifyDirectiveConnectionChanged` is used as a "brand" to
|
||||
// disambiguate AsyncDirectives from other DisconnectableChildren
|
||||
// (as opposed to using an instanceof check to know when to call it); the
|
||||
// redundancy of "Directive" in the API name is to avoid conflicting with
|
||||
// `_$notifyConnectionChanged`, which exists `ChildParts` which are also in
|
||||
// this list
|
||||
// Disconnect Directive (and any nested directives contained within)
|
||||
// This property needs to remain unminified.
|
||||
(_b = (_a = obj)['_$notifyDirectiveConnectionChanged']) === null || _b === void 0 ? void 0 : _b.call(_a, isConnected, false);
|
||||
// Disconnect Part/TemplateInstance
|
||||
notifyChildrenConnectedChanged(obj, isConnected);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
/**
|
||||
* Removes the given child from its parent list of disconnectable children, and
|
||||
* if the parent list becomes empty as a result, removes the parent from its
|
||||
* parent, and so forth up the tree when that causes subsequent parent lists to
|
||||
* become empty.
|
||||
*/
|
||||
const removeDisconnectableFromParent = (obj) => {
|
||||
let parent, children;
|
||||
do {
|
||||
if ((parent = obj._$parent) === undefined) {
|
||||
break;
|
||||
}
|
||||
children = parent._$disconnectableChildren;
|
||||
children.delete(obj);
|
||||
obj = parent;
|
||||
} while ((children === null || children === void 0 ? void 0 : children.size) === 0);
|
||||
};
|
||||
const addDisconnectableToParent = (obj) => {
|
||||
// Climb the parent tree, creating a sparse tree of children needing
|
||||
// disconnection
|
||||
for (let parent; (parent = obj._$parent); obj = parent) {
|
||||
let children = parent._$disconnectableChildren;
|
||||
if (children === undefined) {
|
||||
parent._$disconnectableChildren = children = new Set();
|
||||
}
|
||||
else if (children.has(obj)) {
|
||||
// Once we've reached a parent that already contains this child, we
|
||||
// can short-circuit
|
||||
break;
|
||||
}
|
||||
children.add(obj);
|
||||
installDisconnectAPI(parent);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Changes the parent reference of the ChildPart, and updates the sparse tree of
|
||||
* Disconnectable children accordingly.
|
||||
*
|
||||
* Note, this method will be patched onto ChildPart instances and called from
|
||||
* the core code when parts are moved between different parents.
|
||||
*/
|
||||
function reparentDisconnectables(newParent) {
|
||||
if (this._$disconnectableChildren !== undefined) {
|
||||
removeDisconnectableFromParent(this);
|
||||
this._$parent = newParent;
|
||||
addDisconnectableToParent(this);
|
||||
}
|
||||
else {
|
||||
this._$parent = newParent;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets the connected state on any directives contained within the committed
|
||||
* value of this part (i.e. within a TemplateInstance or iterable of
|
||||
* ChildParts) and runs their `disconnected`/`reconnected`s, as well as within
|
||||
* any directives stored on the ChildPart (when `valueOnly` is false).
|
||||
*
|
||||
* `isClearingValue` should be passed as `true` on a top-level part that is
|
||||
* clearing itself, and not as a result of recursively disconnecting directives
|
||||
* as part of a `clear` operation higher up the tree. This both ensures that any
|
||||
* directive on this ChildPart that produced a value that caused the clear
|
||||
* operation is not disconnected, and also serves as a performance optimization
|
||||
* to avoid needless bookkeeping when a subtree is going away; when clearing a
|
||||
* subtree, only the top-most part need to remove itself from the parent.
|
||||
*
|
||||
* `fromPartIndex` is passed only in the case of a partial `_clear` running as a
|
||||
* result of truncating an iterable.
|
||||
*
|
||||
* Note, this method will be patched onto ChildPart instances and called from the
|
||||
* core code when parts are cleared or the connection state is changed by the
|
||||
* user.
|
||||
*/
|
||||
function notifyChildPartConnectedChanged(isConnected, isClearingValue = false, fromPartIndex = 0) {
|
||||
const value = this._$committedValue;
|
||||
const children = this._$disconnectableChildren;
|
||||
if (children === undefined || children.size === 0) {
|
||||
return;
|
||||
}
|
||||
if (isClearingValue) {
|
||||
if (Array.isArray(value)) {
|
||||
// Iterable case: Any ChildParts created by the iterable should be
|
||||
// disconnected and removed from this ChildPart's disconnectable
|
||||
// children (starting at `fromPartIndex` in the case of truncation)
|
||||
for (let i = fromPartIndex; i < value.length; i++) {
|
||||
notifyChildrenConnectedChanged(value[i], false);
|
||||
removeDisconnectableFromParent(value[i]);
|
||||
}
|
||||
}
|
||||
else if (value != null) {
|
||||
// TemplateInstance case: If the value has disconnectable children (will
|
||||
// only be in the case that it is a TemplateInstance), we disconnect it
|
||||
// and remove it from this ChildPart's disconnectable children
|
||||
notifyChildrenConnectedChanged(value, false);
|
||||
removeDisconnectableFromParent(value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
notifyChildrenConnectedChanged(this, isConnected);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Patches disconnection API onto ChildParts.
|
||||
*/
|
||||
const installDisconnectAPI = (obj) => {
|
||||
var _a, _b;
|
||||
var _c, _d;
|
||||
if (obj.type == PartType.CHILD) {
|
||||
(_a = (_c = obj)._$notifyConnectionChanged) !== null && _a !== void 0 ? _a : (_c._$notifyConnectionChanged = notifyChildPartConnectedChanged);
|
||||
(_b = (_d = obj)._$reparentDisconnectables) !== null && _b !== void 0 ? _b : (_d._$reparentDisconnectables = reparentDisconnectables);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* An abstract `Directive` base class whose `disconnected` method will be
|
||||
* called when the part containing the directive is cleared as a result of
|
||||
* re-rendering, or when the user calls `part.setConnected(false)` on
|
||||
* a part that was previously rendered containing the directive (as happens
|
||||
* when e.g. a LitElement disconnects from the DOM).
|
||||
*
|
||||
* If `part.setConnected(true)` is subsequently called on a
|
||||
* containing part, the directive's `reconnected` method will be called prior
|
||||
* to its next `update`/`render` callbacks. When implementing `disconnected`,
|
||||
* `reconnected` should also be implemented to be compatible with reconnection.
|
||||
*
|
||||
* Note that updates may occur while the directive is disconnected. As such,
|
||||
* directives should generally check the `this.isConnected` flag during
|
||||
* render/update to determine whether it is safe to subscribe to resources
|
||||
* that may prevent garbage collection.
|
||||
*/
|
||||
class AsyncDirective extends Directive {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
// @internal
|
||||
this._$disconnectableChildren = undefined;
|
||||
}
|
||||
/**
|
||||
* Initialize the part with internal fields
|
||||
* @param part
|
||||
* @param parent
|
||||
* @param attributeIndex
|
||||
*/
|
||||
_$initialize(part, parent, attributeIndex) {
|
||||
super._$initialize(part, parent, attributeIndex);
|
||||
addDisconnectableToParent(this);
|
||||
this.isConnected = part._$isConnected;
|
||||
}
|
||||
// This property needs to remain unminified.
|
||||
/**
|
||||
* Called from the core code when a directive is going away from a part (in
|
||||
* which case `shouldRemoveFromParent` should be true), and from the
|
||||
* `setChildrenConnected` helper function when recursively changing the
|
||||
* connection state of a tree (in which case `shouldRemoveFromParent` should
|
||||
* be false).
|
||||
*
|
||||
* @param isConnected
|
||||
* @param isClearingDirective - True when the directive itself is being
|
||||
* removed; false when the tree is being disconnected
|
||||
* @internal
|
||||
*/
|
||||
['_$notifyDirectiveConnectionChanged'](isConnected, isClearingDirective = true) {
|
||||
var _a, _b;
|
||||
if (isConnected !== this.isConnected) {
|
||||
this.isConnected = isConnected;
|
||||
if (isConnected) {
|
||||
(_a = this.reconnected) === null || _a === void 0 ? void 0 : _a.call(this);
|
||||
}
|
||||
else {
|
||||
(_b = this.disconnected) === null || _b === void 0 ? void 0 : _b.call(this);
|
||||
}
|
||||
}
|
||||
if (isClearingDirective) {
|
||||
notifyChildrenConnectedChanged(this, isConnected);
|
||||
removeDisconnectableFromParent(this);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets the value of the directive's Part outside the normal `update`/`render`
|
||||
* lifecycle of a directive.
|
||||
*
|
||||
* This method should not be called synchronously from a directive's `update`
|
||||
* or `render`.
|
||||
*
|
||||
* @param directive The directive to update
|
||||
* @param value The value to set
|
||||
*/
|
||||
setValue(value) {
|
||||
if (isSingleExpression(this.__part)) {
|
||||
this.__part._$setValue(value, this);
|
||||
}
|
||||
else {
|
||||
// this.__attributeIndex will be defined in this case, but
|
||||
// assert it in dev mode
|
||||
if (this.__attributeIndex === undefined) {
|
||||
throw new Error(`Expected this.__attributeIndex to be a number`);
|
||||
}
|
||||
const newValues = [...this.__part._$committedValue];
|
||||
newValues[this.__attributeIndex] = value;
|
||||
this.__part._$setValue(newValues, this, 0);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* User callbacks for implementing logic to release any resources/subscriptions
|
||||
* that may have been retained by this directive. Since directives may also be
|
||||
* re-connected, `reconnected` should also be implemented to restore the
|
||||
* working state of the directive prior to the next render.
|
||||
*/
|
||||
disconnected() { }
|
||||
reconnected() { }
|
||||
}
|
||||
|
||||
export { AsyncDirective };
|
||||
//# sourceMappingURL=async-directive.js.map
|
1
node_modules/lit-html/node/development/async-directive.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/async-directive.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
180
node_modules/lit-html/node/development/directive-helpers.js
generated
vendored
Normal file
180
node_modules/lit-html/node/development/directive-helpers.js
generated
vendored
Normal file
@@ -0,0 +1,180 @@
|
||||
import { _$LH } from './lit-html.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const { _ChildPart: ChildPart } = _$LH;
|
||||
const wrap = (node) => node;
|
||||
/**
|
||||
* Tests if a value is a primitive value.
|
||||
*
|
||||
* See https://tc39.github.io/ecma262/#sec-typeof-operator
|
||||
*/
|
||||
const isPrimitive = (value) => value === null || (typeof value != 'object' && typeof value != 'function');
|
||||
const TemplateResultType = {
|
||||
HTML: 1,
|
||||
SVG: 2,
|
||||
};
|
||||
/**
|
||||
* Tests if a value is a TemplateResult or a CompiledTemplateResult.
|
||||
*/
|
||||
const isTemplateResult = (value, type) => type === undefined
|
||||
? // This property needs to remain unminified.
|
||||
(value === null || value === void 0 ? void 0 : value['_$litType$']) !== undefined
|
||||
: (value === null || value === void 0 ? void 0 : value['_$litType$']) === type;
|
||||
/**
|
||||
* Tests if a value is a CompiledTemplateResult.
|
||||
*/
|
||||
const isCompiledTemplateResult = (value) => {
|
||||
var _a;
|
||||
return ((_a = value === null || value === void 0 ? void 0 : value['_$litType$']) === null || _a === void 0 ? void 0 : _a.h) != null;
|
||||
};
|
||||
/**
|
||||
* Tests if a value is a DirectiveResult.
|
||||
*/
|
||||
const isDirectiveResult = (value) =>
|
||||
// This property needs to remain unminified.
|
||||
(value === null || value === void 0 ? void 0 : value['_$litDirective$']) !== undefined;
|
||||
/**
|
||||
* Retrieves the Directive class for a DirectiveResult
|
||||
*/
|
||||
const getDirectiveClass = (value) =>
|
||||
// This property needs to remain unminified.
|
||||
value === null || value === void 0 ? void 0 : value['_$litDirective$'];
|
||||
/**
|
||||
* Tests whether a part has only a single-expression with no strings to
|
||||
* interpolate between.
|
||||
*
|
||||
* Only AttributePart and PropertyPart can have multiple expressions.
|
||||
* Multi-expression parts have a `strings` property and single-expression
|
||||
* parts do not.
|
||||
*/
|
||||
const isSingleExpression = (part) => part.strings === undefined;
|
||||
const createMarker = () => document.createComment('');
|
||||
/**
|
||||
* Inserts a ChildPart into the given container ChildPart's DOM, either at the
|
||||
* end of the container ChildPart, or before the optional `refPart`.
|
||||
*
|
||||
* This does not add the part to the containerPart's committed value. That must
|
||||
* be done by callers.
|
||||
*
|
||||
* @param containerPart Part within which to add the new ChildPart
|
||||
* @param refPart Part before which to add the new ChildPart; when omitted the
|
||||
* part added to the end of the `containerPart`
|
||||
* @param part Part to insert, or undefined to create a new part
|
||||
*/
|
||||
const insertPart = (containerPart, refPart, part) => {
|
||||
var _a;
|
||||
const container = wrap(containerPart._$startNode).parentNode;
|
||||
const refNode = refPart === undefined ? containerPart._$endNode : refPart._$startNode;
|
||||
if (part === undefined) {
|
||||
const startNode = wrap(container).insertBefore(createMarker(), refNode);
|
||||
const endNode = wrap(container).insertBefore(createMarker(), refNode);
|
||||
part = new ChildPart(startNode, endNode, containerPart, containerPart.options);
|
||||
}
|
||||
else {
|
||||
const endNode = wrap(part._$endNode).nextSibling;
|
||||
const oldParent = part._$parent;
|
||||
const parentChanged = oldParent !== containerPart;
|
||||
if (parentChanged) {
|
||||
(_a = part._$reparentDisconnectables) === null || _a === void 0 ? void 0 : _a.call(part, containerPart);
|
||||
// Note that although `_$reparentDisconnectables` updates the part's
|
||||
// `_$parent` reference after unlinking from its current parent, that
|
||||
// method only exists if Disconnectables are present, so we need to
|
||||
// unconditionally set it here
|
||||
part._$parent = containerPart;
|
||||
// Since the _$isConnected getter is somewhat costly, only
|
||||
// read it once we know the subtree has directives that need
|
||||
// to be notified
|
||||
let newConnectionState;
|
||||
if (part._$notifyConnectionChanged !== undefined &&
|
||||
(newConnectionState = containerPart._$isConnected) !==
|
||||
oldParent._$isConnected) {
|
||||
part._$notifyConnectionChanged(newConnectionState);
|
||||
}
|
||||
}
|
||||
if (endNode !== refNode || parentChanged) {
|
||||
let start = part._$startNode;
|
||||
while (start !== endNode) {
|
||||
const n = wrap(start).nextSibling;
|
||||
wrap(container).insertBefore(start, refNode);
|
||||
start = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
return part;
|
||||
};
|
||||
/**
|
||||
* Sets the value of a Part.
|
||||
*
|
||||
* Note that this should only be used to set/update the value of user-created
|
||||
* parts (i.e. those created using `insertPart`); it should not be used
|
||||
* by directives to set the value of the directive's container part. Directives
|
||||
* should return a value from `update`/`render` to update their part state.
|
||||
*
|
||||
* For directives that require setting their part value asynchronously, they
|
||||
* should extend `AsyncDirective` and call `this.setValue()`.
|
||||
*
|
||||
* @param part Part to set
|
||||
* @param value Value to set
|
||||
* @param index For `AttributePart`s, the index to set
|
||||
* @param directiveParent Used internally; should not be set by user
|
||||
*/
|
||||
const setChildPartValue = (part, value, directiveParent = part) => {
|
||||
part._$setValue(value, directiveParent);
|
||||
return part;
|
||||
};
|
||||
// A sentinel value that can never appear as a part value except when set by
|
||||
// live(). Used to force a dirty-check to fail and cause a re-render.
|
||||
const RESET_VALUE = {};
|
||||
/**
|
||||
* Sets the committed value of a ChildPart directly without triggering the
|
||||
* commit stage of the part.
|
||||
*
|
||||
* This is useful in cases where a directive needs to update the part such
|
||||
* that the next update detects a value change or not. When value is omitted,
|
||||
* the next update will be guaranteed to be detected as a change.
|
||||
*
|
||||
* @param part
|
||||
* @param value
|
||||
*/
|
||||
const setCommittedValue = (part, value = RESET_VALUE) => (part._$committedValue = value);
|
||||
/**
|
||||
* Returns the committed value of a ChildPart.
|
||||
*
|
||||
* The committed value is used for change detection and efficient updates of
|
||||
* the part. It can differ from the value set by the template or directive in
|
||||
* cases where the template value is transformed before being committed.
|
||||
*
|
||||
* - `TemplateResult`s are committed as a `TemplateInstance`
|
||||
* - Iterables are committed as `Array<ChildPart>`
|
||||
* - All other types are committed as the template value or value returned or
|
||||
* set by a directive.
|
||||
*
|
||||
* @param part
|
||||
*/
|
||||
const getCommittedValue = (part) => part._$committedValue;
|
||||
/**
|
||||
* Removes a ChildPart from the DOM, including any of its content.
|
||||
*
|
||||
* @param part The Part to remove
|
||||
*/
|
||||
const removePart = (part) => {
|
||||
var _a;
|
||||
(_a = part._$notifyConnectionChanged) === null || _a === void 0 ? void 0 : _a.call(part, false, true);
|
||||
let start = part._$startNode;
|
||||
const end = wrap(part._$endNode).nextSibling;
|
||||
while (start !== end) {
|
||||
const n = wrap(start).nextSibling;
|
||||
wrap(start).remove();
|
||||
start = n;
|
||||
}
|
||||
};
|
||||
const clearPart = (part) => {
|
||||
part._$clear();
|
||||
};
|
||||
|
||||
export { TemplateResultType, clearPart, getCommittedValue, getDirectiveClass, insertPart, isCompiledTemplateResult, isDirectiveResult, isPrimitive, isSingleExpression, isTemplateResult, removePart, setChildPartValue, setCommittedValue };
|
||||
//# sourceMappingURL=directive-helpers.js.map
|
1
node_modules/lit-html/node/development/directive-helpers.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directive-helpers.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
50
node_modules/lit-html/node/development/directive.js
generated
vendored
Normal file
50
node_modules/lit-html/node/development/directive.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const PartType = {
|
||||
ATTRIBUTE: 1,
|
||||
CHILD: 2,
|
||||
PROPERTY: 3,
|
||||
BOOLEAN_ATTRIBUTE: 4,
|
||||
EVENT: 5,
|
||||
ELEMENT: 6,
|
||||
};
|
||||
/**
|
||||
* Creates a user-facing directive function from a Directive class. This
|
||||
* function has the same parameters as the directive's render() method.
|
||||
*/
|
||||
const directive = (c) => (...values) => ({
|
||||
// This property needs to remain unminified.
|
||||
['_$litDirective$']: c,
|
||||
values,
|
||||
});
|
||||
/**
|
||||
* Base class for creating custom directives. Users should extend this class,
|
||||
* implement `render` and/or `update`, and then pass their subclass to
|
||||
* `directive`.
|
||||
*/
|
||||
class Directive {
|
||||
constructor(_partInfo) { }
|
||||
// See comment in Disconnectable interface for why this is a getter
|
||||
get _$isConnected() {
|
||||
return this._$parent._$isConnected;
|
||||
}
|
||||
/** @internal */
|
||||
_$initialize(part, parent, attributeIndex) {
|
||||
this.__part = part;
|
||||
this._$parent = parent;
|
||||
this.__attributeIndex = attributeIndex;
|
||||
}
|
||||
/** @internal */
|
||||
_$resolve(part, props) {
|
||||
return this.update(part, props);
|
||||
}
|
||||
update(_part, props) {
|
||||
return this.render(...props);
|
||||
}
|
||||
}
|
||||
|
||||
export { Directive, PartType, directive };
|
||||
//# sourceMappingURL=directive.js.map
|
1
node_modules/lit-html/node/development/directive.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directive.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"directive.js","sources":["../../src/directive.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Disconnectable, Part} from './lit-html.js';\n\nexport {\n AttributePart,\n BooleanAttributePart,\n ChildPart,\n ElementPart,\n EventPart,\n Part,\n PropertyPart,\n} from './lit-html.js';\n\nexport interface DirectiveClass {\n new (part: PartInfo): Directive;\n}\n\n/**\n * This utility type extracts the signature of a directive class's render()\n * method so we can use it for the type of the generated directive function.\n */\nexport type DirectiveParameters<C extends Directive> = Parameters<C['render']>;\n\n/**\n * A generated directive function doesn't evaluate the directive, but just\n * returns a DirectiveResult object that captures the arguments.\n */\nexport interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {\n /**\n * This property needs to remain unminified.\n * @internal */\n ['_$litDirective$']: C;\n /** @internal */\n values: DirectiveParameters<InstanceType<C>>;\n}\n\nexport const PartType = {\n ATTRIBUTE: 1,\n CHILD: 2,\n PROPERTY: 3,\n BOOLEAN_ATTRIBUTE: 4,\n EVENT: 5,\n ELEMENT: 6,\n} as const;\n\nexport type PartType = (typeof PartType)[keyof typeof PartType];\n\nexport interface ChildPartInfo {\n readonly type: typeof PartType.CHILD;\n}\n\nexport interface AttributePartInfo {\n readonly type:\n | typeof PartType.ATTRIBUTE\n | typeof PartType.PROPERTY\n | typeof PartType.BOOLEAN_ATTRIBUTE\n | typeof PartType.EVENT;\n readonly strings?: ReadonlyArray<string>;\n readonly name: string;\n readonly tagName: string;\n}\n\nexport interface ElementPartInfo {\n readonly type: typeof PartType.ELEMENT;\n}\n\n/**\n * Information about the part a directive is bound to.\n *\n * This is useful for checking that a directive is attached to a valid part,\n * such as with directive that can only be used on attribute bindings.\n */\nexport type PartInfo = ChildPartInfo | AttributePartInfo | ElementPartInfo;\n\n/**\n * Creates a user-facing directive function from a Directive class. This\n * function has the same parameters as the directive's render() method.\n */\nexport const directive =\n <C extends DirectiveClass>(c: C) =>\n (...values: DirectiveParameters<InstanceType<C>>): DirectiveResult<C> => ({\n // This property needs to remain unminified.\n ['_$litDirective$']: c,\n values,\n });\n\n/**\n * Base class for creating custom directives. Users should extend this class,\n * implement `render` and/or `update`, and then pass their subclass to\n * `directive`.\n */\nexport abstract class Directive implements Disconnectable {\n //@internal\n __part!: Part;\n //@internal\n __attributeIndex: number | undefined;\n //@internal\n __directive?: Directive;\n\n //@internal\n _$parent!: Disconnectable;\n\n // These will only exist on the AsyncDirective subclass\n //@internal\n _$disconnectableChildren?: Set<Disconnectable>;\n // This property needs to remain unminified.\n //@internal\n ['_$notifyDirectiveConnectionChanged']?(isConnected: boolean): void;\n\n constructor(_partInfo: PartInfo) {}\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n /** @internal */\n _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n this.__part = part;\n this._$parent = parent;\n this.__attributeIndex = attributeIndex;\n }\n /** @internal */\n _$resolve(part: Part, props: Array<unknown>): unknown {\n return this.update(part, props);\n }\n\n abstract render(...props: Array<unknown>): unknown;\n\n update(_part: Part, props: Array<unknown>): unknown {\n return this.render(...props);\n }\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;AAqCU,MAAA,QAAQ,GAAG;AACtB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,QAAQ,EAAE,CAAC;AACX,IAAA,iBAAiB,EAAE,CAAC;AACpB,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,OAAO,EAAE,CAAC;EACD;AA+BX;;;AAGG;AACI,MAAM,SAAS,GACpB,CAA2B,CAAI,KAC/B,CAAC,GAAG,MAA4C,MAA0B;;IAExE,CAAC,iBAAiB,GAAG,CAAC;IACtB,MAAM;AACP,CAAA,EAAE;AAEL;;;;AAIG;MACmB,SAAS,CAAA;IAkB7B,WAAY,CAAA,SAAmB,KAAI;;AAGnC,IAAA,IAAI,aAAa,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;KACpC;;AAGD,IAAA,YAAY,CACV,IAAU,EACV,MAAsB,EACtB,cAAkC,EAAA;AAElC,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;AACnB,QAAA,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;AACvB,QAAA,IAAI,CAAC,gBAAgB,GAAG,cAAc,CAAC;KACxC;;IAED,SAAS,CAAC,IAAU,EAAE,KAAqB,EAAA;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;KACjC;IAID,MAAM,CAAC,KAAW,EAAE,KAAqB,EAAA;AACvC,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;KAC9B;AACF;;;;"}
|
56
node_modules/lit-html/node/development/directives/async-append.js
generated
vendored
Normal file
56
node_modules/lit-html/node/development/directives/async-append.js
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
import { directive, PartType } from '../directive.js';
|
||||
import { AsyncReplaceDirective } from './async-replace.js';
|
||||
import { clearPart, insertPart, setChildPartValue } from '../directive-helpers.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
class AsyncAppendDirective extends AsyncReplaceDirective {
|
||||
// Override AsyncReplace to narrow the allowed part type to ChildPart only
|
||||
constructor(partInfo) {
|
||||
super(partInfo);
|
||||
if (partInfo.type !== PartType.CHILD) {
|
||||
throw new Error('asyncAppend can only be used in child expressions');
|
||||
}
|
||||
}
|
||||
// Override AsyncReplace to save the part since we need to append into it
|
||||
update(part, params) {
|
||||
this.__childPart = part;
|
||||
return super.update(part, params);
|
||||
}
|
||||
// Override AsyncReplace to append rather than replace
|
||||
commitValue(value, index) {
|
||||
// When we get the first value, clear the part. This lets the
|
||||
// previous value display until we can replace it.
|
||||
if (index === 0) {
|
||||
clearPart(this.__childPart);
|
||||
}
|
||||
// Create and insert a new part and set its value to the next value
|
||||
const newPart = insertPart(this.__childPart);
|
||||
setChildPartValue(newPart, value);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A directive that renders the items of an async iterable[1], appending new
|
||||
* values after previous values, similar to the built-in support for iterables.
|
||||
* This directive is usable only in child expressions.
|
||||
*
|
||||
* Async iterables are objects with a [Symbol.asyncIterator] method, which
|
||||
* returns an iterator who's `next()` method returns a Promise. When a new
|
||||
* value is available, the Promise resolves and the value is appended to the
|
||||
* Part controlled by the directive. If another value other than this
|
||||
* directive has been set on the Part, the iterable will no longer be listened
|
||||
* to and new values won't be written to the Part.
|
||||
*
|
||||
* [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
|
||||
*
|
||||
* @param value An async iterable
|
||||
* @param mapper An optional function that maps from (value, index) to another
|
||||
* value. Useful for generating templates for each item in the iterable.
|
||||
*/
|
||||
const asyncAppend = directive(AsyncAppendDirective);
|
||||
|
||||
export { asyncAppend };
|
||||
//# sourceMappingURL=async-append.js.map
|
1
node_modules/lit-html/node/development/directives/async-append.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/async-append.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"async-append.js","sources":["../../../src/directives/async-append.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {ChildPart} from '../lit-html.js';\nimport {\n directive,\n DirectiveParameters,\n PartInfo,\n PartType,\n} from '../directive.js';\nimport {AsyncReplaceDirective} from './async-replace.js';\nimport {\n clearPart,\n insertPart,\n setChildPartValue,\n} from '../directive-helpers.js';\n\nclass AsyncAppendDirective extends AsyncReplaceDirective {\n private __childPart!: ChildPart;\n\n // Override AsyncReplace to narrow the allowed part type to ChildPart only\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.CHILD) {\n throw new Error('asyncAppend can only be used in child expressions');\n }\n }\n\n // Override AsyncReplace to save the part since we need to append into it\n override update(part: ChildPart, params: DirectiveParameters<this>) {\n this.__childPart = part;\n return super.update(part, params);\n }\n\n // Override AsyncReplace to append rather than replace\n protected override commitValue(value: unknown, index: number) {\n // When we get the first value, clear the part. This lets the\n // previous value display until we can replace it.\n if (index === 0) {\n clearPart(this.__childPart);\n }\n // Create and insert a new part and set its value to the next value\n const newPart = insertPart(this.__childPart);\n setChildPartValue(newPart, value);\n }\n}\n\n/**\n * A directive that renders the items of an async iterable[1], appending new\n * values after previous values, similar to the built-in support for iterables.\n * This directive is usable only in child expressions.\n *\n * Async iterables are objects with a [Symbol.asyncIterator] method, which\n * returns an iterator who's `next()` method returns a Promise. When a new\n * value is available, the Promise resolves and the value is appended to the\n * Part controlled by the directive. If another value other than this\n * directive has been set on the Part, the iterable will no longer be listened\n * to and new values won't be written to the Part.\n *\n * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of\n *\n * @param value An async iterable\n * @param mapper An optional function that maps from (value, index) to another\n * value. Useful for generating templates for each item in the iterable.\n */\nexport const asyncAppend = directive(AsyncAppendDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {AsyncAppendDirective};\n"],"names":[],"mappings":";;;;AAAA;;;;AAIG;AAgBH,MAAM,oBAAqB,SAAQ,qBAAqB,CAAA;;AAItD,IAAA,WAAA,CAAY,QAAkB,EAAA;QAC5B,KAAK,CAAC,QAAQ,CAAC,CAAC;AAChB,QAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,KAAK,EAAE;AACpC,YAAA,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;AACtE,SAAA;KACF;;IAGQ,MAAM,CAAC,IAAe,EAAE,MAAiC,EAAA;AAChE,QAAA,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KACnC;;IAGkB,WAAW,CAAC,KAAc,EAAE,KAAa,EAAA;;;QAG1D,IAAI,KAAK,KAAK,CAAC,EAAE;AACf,YAAA,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC7B,SAAA;;QAED,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC7C,QAAA,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACnC;AACF,CAAA;AAED;;;;;;;;;;;;;;;;;AAiBG;MACU,WAAW,GAAG,SAAS,CAAC,oBAAoB;;;;"}
|
104
node_modules/lit-html/node/development/directives/async-replace.js
generated
vendored
Normal file
104
node_modules/lit-html/node/development/directives/async-replace.js
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
import { noChange } from '../lit-html.js';
|
||||
import { AsyncDirective } from '../async-directive.js';
|
||||
import { PseudoWeakRef, Pauser, forAwaitOf } from './private-async-helpers.js';
|
||||
import { directive } from '../directive.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
class AsyncReplaceDirective extends AsyncDirective {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.__weakThis = new PseudoWeakRef(this);
|
||||
this.__pauser = new Pauser();
|
||||
}
|
||||
// @ts-expect-error value not used, but we want a nice parameter for docs
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
render(value, _mapper) {
|
||||
return noChange;
|
||||
}
|
||||
update(_part, [value, mapper]) {
|
||||
// If our initial render occurs while disconnected, ensure that the pauser
|
||||
// and weakThis are in the disconnected state
|
||||
if (!this.isConnected) {
|
||||
this.disconnected();
|
||||
}
|
||||
// If we've already set up this particular iterable, we don't need
|
||||
// to do anything.
|
||||
if (value === this.__value) {
|
||||
return;
|
||||
}
|
||||
this.__value = value;
|
||||
let i = 0;
|
||||
const { __weakThis: weakThis, __pauser: pauser } = this;
|
||||
// Note, the callback avoids closing over `this` so that the directive
|
||||
// can be gc'ed before the promise resolves; instead `this` is retrieved
|
||||
// from `weakThis`, which can break the hard reference in the closure when
|
||||
// the directive disconnects
|
||||
forAwaitOf(value, async (v) => {
|
||||
// The while loop here handles the case that the connection state
|
||||
// thrashes, causing the pauser to resume and then get re-paused
|
||||
while (pauser.get()) {
|
||||
await pauser.get();
|
||||
}
|
||||
// If the callback gets here and there is no `this`, it means that the
|
||||
// directive has been disconnected and garbage collected and we don't
|
||||
// need to do anything else
|
||||
const _this = weakThis.deref();
|
||||
if (_this !== undefined) {
|
||||
// Check to make sure that value is the still the current value of
|
||||
// the part, and if not bail because a new value owns this part
|
||||
if (_this.__value !== value) {
|
||||
return false;
|
||||
}
|
||||
// As a convenience, because functional-programming-style
|
||||
// transforms of iterables and async iterables requires a library,
|
||||
// we accept a mapper function. This is especially convenient for
|
||||
// rendering a template for each item.
|
||||
if (mapper !== undefined) {
|
||||
v = mapper(v, i);
|
||||
}
|
||||
_this.commitValue(v, i);
|
||||
i++;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
return noChange;
|
||||
}
|
||||
// Override point for AsyncAppend to append rather than replace
|
||||
commitValue(value, _index) {
|
||||
this.setValue(value);
|
||||
}
|
||||
disconnected() {
|
||||
this.__weakThis.disconnect();
|
||||
this.__pauser.pause();
|
||||
}
|
||||
reconnected() {
|
||||
this.__weakThis.reconnect(this);
|
||||
this.__pauser.resume();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A directive that renders the items of an async iterable[1], replacing
|
||||
* previous values with new values, so that only one value is ever rendered
|
||||
* at a time. This directive may be used in any expression type.
|
||||
*
|
||||
* Async iterables are objects with a `[Symbol.asyncIterator]` method, which
|
||||
* returns an iterator who's `next()` method returns a Promise. When a new
|
||||
* value is available, the Promise resolves and the value is rendered to the
|
||||
* Part controlled by the directive. If another value other than this
|
||||
* directive has been set on the Part, the iterable will no longer be listened
|
||||
* to and new values won't be written to the Part.
|
||||
*
|
||||
* [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
|
||||
*
|
||||
* @param value An async iterable
|
||||
* @param mapper An optional function that maps from (value, index) to another
|
||||
* value. Useful for generating templates for each item in the iterable.
|
||||
*/
|
||||
const asyncReplace = directive(AsyncReplaceDirective);
|
||||
|
||||
export { AsyncReplaceDirective, asyncReplace };
|
||||
//# sourceMappingURL=async-replace.js.map
|
1
node_modules/lit-html/node/development/directives/async-replace.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/async-replace.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
91
node_modules/lit-html/node/development/directives/cache.js
generated
vendored
Normal file
91
node_modules/lit-html/node/development/directives/cache.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
import { render, nothing } from '../lit-html.js';
|
||||
import { directive, Directive } from '../directive.js';
|
||||
import { isTemplateResult, getCommittedValue, setCommittedValue, insertPart, clearPart, isCompiledTemplateResult } from '../directive-helpers.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
/**
|
||||
* The template strings array contents are not compatible between the two
|
||||
* template result types as the compiled template contains a prepared string;
|
||||
* only use the returned template strings array as a cache key.
|
||||
*/
|
||||
const getStringsFromTemplateResult = (result) => isCompiledTemplateResult(result) ? result['_$litType$'].h : result.strings;
|
||||
class CacheDirective extends Directive {
|
||||
constructor(partInfo) {
|
||||
super(partInfo);
|
||||
this._templateCache = new WeakMap();
|
||||
}
|
||||
render(v) {
|
||||
// Return an array of the value to induce lit-html to create a ChildPart
|
||||
// for the value that we can move into the cache.
|
||||
return [v];
|
||||
}
|
||||
update(containerPart, [v]) {
|
||||
const _valueKey = isTemplateResult(this._value)
|
||||
? getStringsFromTemplateResult(this._value)
|
||||
: null;
|
||||
const vKey = isTemplateResult(v) ? getStringsFromTemplateResult(v) : null;
|
||||
// If the previous value is a TemplateResult and the new value is not,
|
||||
// or is a different Template as the previous value, move the child part
|
||||
// into the cache.
|
||||
if (_valueKey !== null && (vKey === null || _valueKey !== vKey)) {
|
||||
// This is always an array because we return [v] in render()
|
||||
const partValue = getCommittedValue(containerPart);
|
||||
const childPart = partValue.pop();
|
||||
let cachedContainerPart = this._templateCache.get(_valueKey);
|
||||
if (cachedContainerPart === undefined) {
|
||||
const fragment = document.createDocumentFragment();
|
||||
cachedContainerPart = render(nothing, fragment);
|
||||
cachedContainerPart.setConnected(false);
|
||||
this._templateCache.set(_valueKey, cachedContainerPart);
|
||||
}
|
||||
// Move into cache
|
||||
setCommittedValue(cachedContainerPart, [childPart]);
|
||||
insertPart(cachedContainerPart, undefined, childPart);
|
||||
}
|
||||
// If the new value is a TemplateResult and the previous value is not,
|
||||
// or is a different Template as the previous value, restore the child
|
||||
// part from the cache.
|
||||
if (vKey !== null) {
|
||||
if (_valueKey === null || _valueKey !== vKey) {
|
||||
const cachedContainerPart = this._templateCache.get(vKey);
|
||||
if (cachedContainerPart !== undefined) {
|
||||
// Move the cached part back into the container part value
|
||||
const partValue = getCommittedValue(cachedContainerPart);
|
||||
const cachedPart = partValue.pop();
|
||||
// Move cached part back into DOM
|
||||
clearPart(containerPart);
|
||||
insertPart(containerPart, undefined, cachedPart);
|
||||
setCommittedValue(containerPart, [cachedPart]);
|
||||
}
|
||||
}
|
||||
// Because vKey is non null, v must be a TemplateResult.
|
||||
this._value = v;
|
||||
}
|
||||
else {
|
||||
this._value = undefined;
|
||||
}
|
||||
return this.render(v);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Enables fast switching between multiple templates by caching the DOM nodes
|
||||
* and TemplateInstances produced by the templates.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```js
|
||||
* let checked = false;
|
||||
*
|
||||
* html`
|
||||
* ${cache(checked ? html`input is checked` : html`input is not checked`)}
|
||||
* `
|
||||
* ```
|
||||
*/
|
||||
const cache = directive(CacheDirective);
|
||||
|
||||
export { cache };
|
||||
//# sourceMappingURL=cache.js.map
|
1
node_modules/lit-html/node/development/directives/cache.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/cache.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
43
node_modules/lit-html/node/development/directives/choose.js
generated
vendored
Normal file
43
node_modules/lit-html/node/development/directives/choose.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
/**
|
||||
* Chooses and evaluates a template function from a list based on matching
|
||||
* the given `value` to a case.
|
||||
*
|
||||
* Cases are structured as `[caseValue, func]`. `value` is matched to
|
||||
* `caseValue` by strict equality. The first match is selected. Case values
|
||||
* can be of any type including primitives, objects, and symbols.
|
||||
*
|
||||
* This is similar to a switch statement, but as an expression and without
|
||||
* fallthrough.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```ts
|
||||
* render() {
|
||||
* return html`
|
||||
* ${choose(this.section, [
|
||||
* ['home', () => html`<h1>Home</h1>`],
|
||||
* ['about', () => html`<h1>About</h1>`]
|
||||
* ],
|
||||
* () => html`<h1>Error</h1>`)}
|
||||
* `;
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
const choose = (value, cases, defaultCase) => {
|
||||
for (const c of cases) {
|
||||
const caseValue = c[0];
|
||||
if (caseValue === value) {
|
||||
const fn = c[1];
|
||||
return fn();
|
||||
}
|
||||
}
|
||||
return defaultCase === null || defaultCase === void 0 ? void 0 : defaultCase();
|
||||
};
|
||||
|
||||
export { choose };
|
||||
//# sourceMappingURL=choose.js.map
|
1
node_modules/lit-html/node/development/directives/choose.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/choose.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"choose.js","sources":["../../../src/directives/choose.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Chooses and evaluates a template function from a list based on matching\n * the given `value` to a case.\n *\n * Cases are structured as `[caseValue, func]`. `value` is matched to\n * `caseValue` by strict equality. The first match is selected. Case values\n * can be of any type including primitives, objects, and symbols.\n *\n * This is similar to a switch statement, but as an expression and without\n * fallthrough.\n *\n * @example\n *\n * ```ts\n * render() {\n * return html`\n * ${choose(this.section, [\n * ['home', () => html`<h1>Home</h1>`],\n * ['about', () => html`<h1>About</h1>`]\n * ],\n * () => html`<h1>Error</h1>`)}\n * `;\n * }\n * ```\n */\nexport const choose = <T, V>(\n value: T,\n cases: Array<[T, () => V]>,\n defaultCase?: () => V\n) => {\n for (const c of cases) {\n const caseValue = c[0];\n if (caseValue === value) {\n const fn = c[1];\n return fn();\n }\n }\n return defaultCase?.();\n};\n"],"names":[],"mappings":"AAAA;;;;AAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACU,MAAA,MAAM,GAAG,CACpB,KAAQ,EACR,KAA0B,EAC1B,WAAqB,KACnB;AACF,IAAA,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE;AACrB,QAAA,MAAM,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,SAAS,KAAK,KAAK,EAAE;AACvB,YAAA,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAChB,OAAO,EAAE,EAAE,CAAC;AACb,SAAA;AACF,KAAA;AACD,IAAA,OAAO,WAAW,KAAX,IAAA,IAAA,WAAW,KAAX,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,WAAW,EAAI,CAAC;AACzB;;;;"}
|
93
node_modules/lit-html/node/development/directives/class-map.js
generated
vendored
Normal file
93
node_modules/lit-html/node/development/directives/class-map.js
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
import { noChange } from '../lit-html.js';
|
||||
import { directive, Directive, PartType } from '../directive.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
class ClassMapDirective extends Directive {
|
||||
constructor(partInfo) {
|
||||
var _a;
|
||||
super(partInfo);
|
||||
if (partInfo.type !== PartType.ATTRIBUTE ||
|
||||
partInfo.name !== 'class' ||
|
||||
((_a = partInfo.strings) === null || _a === void 0 ? void 0 : _a.length) > 2) {
|
||||
throw new Error('`classMap()` can only be used in the `class` attribute ' +
|
||||
'and must be the only part in the attribute.');
|
||||
}
|
||||
}
|
||||
render(classInfo) {
|
||||
// Add spaces to ensure separation from static classes
|
||||
return (' ' +
|
||||
Object.keys(classInfo)
|
||||
.filter((key) => classInfo[key])
|
||||
.join(' ') +
|
||||
' ');
|
||||
}
|
||||
update(part, [classInfo]) {
|
||||
var _a, _b;
|
||||
// Remember dynamic classes on the first render
|
||||
if (this._previousClasses === undefined) {
|
||||
this._previousClasses = new Set();
|
||||
if (part.strings !== undefined) {
|
||||
this._staticClasses = new Set(part.strings
|
||||
.join(' ')
|
||||
.split(/\s/)
|
||||
.filter((s) => s !== ''));
|
||||
}
|
||||
for (const name in classInfo) {
|
||||
if (classInfo[name] && !((_a = this._staticClasses) === null || _a === void 0 ? void 0 : _a.has(name))) {
|
||||
this._previousClasses.add(name);
|
||||
}
|
||||
}
|
||||
return this.render(classInfo);
|
||||
}
|
||||
const classList = part.element.classList;
|
||||
// Remove old classes that no longer apply
|
||||
// We use forEach() instead of for-of so that we don't require down-level
|
||||
// iteration.
|
||||
this._previousClasses.forEach((name) => {
|
||||
if (!(name in classInfo)) {
|
||||
classList.remove(name);
|
||||
this._previousClasses.delete(name);
|
||||
}
|
||||
});
|
||||
// Add or remove classes based on their classMap value
|
||||
for (const name in classInfo) {
|
||||
// We explicitly want a loose truthy check of `value` because it seems
|
||||
// more convenient that '' and 0 are skipped.
|
||||
const value = !!classInfo[name];
|
||||
if (value !== this._previousClasses.has(name) &&
|
||||
!((_b = this._staticClasses) === null || _b === void 0 ? void 0 : _b.has(name))) {
|
||||
if (value) {
|
||||
classList.add(name);
|
||||
this._previousClasses.add(name);
|
||||
}
|
||||
else {
|
||||
classList.remove(name);
|
||||
this._previousClasses.delete(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return noChange;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A directive that applies dynamic CSS classes.
|
||||
*
|
||||
* This must be used in the `class` attribute and must be the only part used in
|
||||
* the attribute. It takes each property in the `classInfo` argument and adds
|
||||
* the property name to the element's `classList` if the property value is
|
||||
* truthy; if the property value is falsey, the property name is removed from
|
||||
* the element's `class`.
|
||||
*
|
||||
* For example `{foo: bar}` applies the class `foo` if the value of `bar` is
|
||||
* truthy.
|
||||
*
|
||||
* @param classInfo
|
||||
*/
|
||||
const classMap = directive(ClassMapDirective);
|
||||
|
||||
export { classMap };
|
||||
//# sourceMappingURL=class-map.js.map
|
1
node_modules/lit-html/node/development/directives/class-map.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/class-map.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
83
node_modules/lit-html/node/development/directives/guard.js
generated
vendored
Normal file
83
node_modules/lit-html/node/development/directives/guard.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
import { noChange } from '../lit-html.js';
|
||||
import { directive, Directive } from '../directive.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
// A sentinel that indicates guard() hasn't rendered anything yet
|
||||
const initialValue = {};
|
||||
class GuardDirective extends Directive {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this._previousValue = initialValue;
|
||||
}
|
||||
render(_value, f) {
|
||||
return f();
|
||||
}
|
||||
update(_part, [value, f]) {
|
||||
if (Array.isArray(value)) {
|
||||
// Dirty-check arrays by item
|
||||
if (Array.isArray(this._previousValue) &&
|
||||
this._previousValue.length === value.length &&
|
||||
value.every((v, i) => v === this._previousValue[i])) {
|
||||
return noChange;
|
||||
}
|
||||
}
|
||||
else if (this._previousValue === value) {
|
||||
// Dirty-check non-arrays by identity
|
||||
return noChange;
|
||||
}
|
||||
// Copy the value if it's an array so that if it's mutated we don't forget
|
||||
// what the previous values were.
|
||||
this._previousValue = Array.isArray(value) ? Array.from(value) : value;
|
||||
const r = this.render(value, f);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Prevents re-render of a template function until a single value or an array of
|
||||
* values changes.
|
||||
*
|
||||
* Values are checked against previous values with strict equality (`===`), and
|
||||
* so the check won't detect nested property changes inside objects or arrays.
|
||||
* Arrays values have each item checked against the previous value at the same
|
||||
* index with strict equality. Nested arrays are also checked only by strict
|
||||
* equality.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```js
|
||||
* html`
|
||||
* <div>
|
||||
* ${guard([user.id, company.id], () => html`...`)}
|
||||
* </div>
|
||||
* `
|
||||
* ```
|
||||
*
|
||||
* In this case, the template only rerenders if either `user.id` or `company.id`
|
||||
* changes.
|
||||
*
|
||||
* guard() is useful with immutable data patterns, by preventing expensive work
|
||||
* until data updates.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```js
|
||||
* html`
|
||||
* <div>
|
||||
* ${guard([immutableItems], () => immutableItems.map(i => html`${i}`))}
|
||||
* </div>
|
||||
* `
|
||||
* ```
|
||||
*
|
||||
* In this case, items are mapped over only when the array reference changes.
|
||||
*
|
||||
* @param value the value to check before re-rendering
|
||||
* @param f the template function
|
||||
*/
|
||||
const guard = directive(GuardDirective);
|
||||
|
||||
export { guard };
|
||||
//# sourceMappingURL=guard.js.map
|
1
node_modules/lit-html/node/development/directives/guard.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/guard.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"guard.js","sources":["../../../src/directives/guard.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {noChange, Part} from '../lit-html.js';\nimport {directive, Directive, DirectiveParameters} from '../directive.js';\n\n// A sentinel that indicates guard() hasn't rendered anything yet\nconst initialValue = {};\n\nclass GuardDirective extends Directive {\n private _previousValue: unknown = initialValue;\n\n render(_value: unknown, f: () => unknown) {\n return f();\n }\n\n override update(_part: Part, [value, f]: DirectiveParameters<this>) {\n if (Array.isArray(value)) {\n // Dirty-check arrays by item\n if (\n Array.isArray(this._previousValue) &&\n this._previousValue.length === value.length &&\n value.every((v, i) => v === (this._previousValue as Array<unknown>)[i])\n ) {\n return noChange;\n }\n } else if (this._previousValue === value) {\n // Dirty-check non-arrays by identity\n return noChange;\n }\n\n // Copy the value if it's an array so that if it's mutated we don't forget\n // what the previous values were.\n this._previousValue = Array.isArray(value) ? Array.from(value) : value;\n const r = this.render(value, f);\n return r;\n }\n}\n\n/**\n * Prevents re-render of a template function until a single value or an array of\n * values changes.\n *\n * Values are checked against previous values with strict equality (`===`), and\n * so the check won't detect nested property changes inside objects or arrays.\n * Arrays values have each item checked against the previous value at the same\n * index with strict equality. Nested arrays are also checked only by strict\n * equality.\n *\n * Example:\n *\n * ```js\n * html`\n * <div>\n * ${guard([user.id, company.id], () => html`...`)}\n * </div>\n * `\n * ```\n *\n * In this case, the template only rerenders if either `user.id` or `company.id`\n * changes.\n *\n * guard() is useful with immutable data patterns, by preventing expensive work\n * until data updates.\n *\n * Example:\n *\n * ```js\n * html`\n * <div>\n * ${guard([immutableItems], () => immutableItems.map(i => html`${i}`))}\n * </div>\n * `\n * ```\n *\n * In this case, items are mapped over only when the array reference changes.\n *\n * @param value the value to check before re-rendering\n * @param f the template function\n */\nexport const guard = directive(GuardDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {GuardDirective};\n"],"names":[],"mappings":";;;AAAA;;;;AAIG;AAKH;AACA,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,MAAM,cAAe,SAAQ,SAAS,CAAA;AAAtC,IAAA,WAAA,GAAA;;QACU,IAAc,CAAA,cAAA,GAAY,YAAY,CAAC;KA2BhD;IAzBC,MAAM,CAAC,MAAe,EAAE,CAAgB,EAAA;QACtC,OAAO,CAAC,EAAE,CAAC;KACZ;AAEQ,IAAA,MAAM,CAAC,KAAW,EAAE,CAAC,KAAK,EAAE,CAAC,CAA4B,EAAA;AAChE,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;;AAExB,YAAA,IACE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC;AAClC,gBAAA,IAAI,CAAC,cAAc,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;AAC3C,gBAAA,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAM,IAAI,CAAC,cAAiC,CAAC,CAAC,CAAC,CAAC,EACvE;AACA,gBAAA,OAAO,QAAQ,CAAC;AACjB,aAAA;AACF,SAAA;AAAM,aAAA,IAAI,IAAI,CAAC,cAAc,KAAK,KAAK,EAAE;;AAExC,YAAA,OAAO,QAAQ,CAAC;AACjB,SAAA;;;QAID,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QACvE,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AAChC,QAAA,OAAO,CAAC,CAAC;KACV;AACF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;MACU,KAAK,GAAG,SAAS,CAAC,cAAc;;;;"}
|
17
node_modules/lit-html/node/development/directives/if-defined.js
generated
vendored
Normal file
17
node_modules/lit-html/node/development/directives/if-defined.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { nothing } from '../lit-html.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
/**
|
||||
* For AttributeParts, sets the attribute if the value is defined and removes
|
||||
* the attribute if the value is undefined.
|
||||
*
|
||||
* For other part types, this directive is a no-op.
|
||||
*/
|
||||
const ifDefined = (value) => value !== null && value !== void 0 ? value : nothing;
|
||||
|
||||
export { ifDefined };
|
||||
//# sourceMappingURL=if-defined.js.map
|
1
node_modules/lit-html/node/development/directives/if-defined.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/if-defined.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"if-defined.js","sources":["../../../src/directives/if-defined.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {nothing} from '../lit-html.js';\n\n/**\n * For AttributeParts, sets the attribute if the value is defined and removes\n * the attribute if the value is undefined.\n *\n * For other part types, this directive is a no-op.\n */\nexport const ifDefined = <T>(value: T) => value ?? nothing;\n"],"names":[],"mappings":";;AAAA;;;;AAIG;AAIH;;;;;AAKG;AACU,MAAA,SAAS,GAAG,CAAI,KAAQ,KAAK,KAAK,aAAL,KAAK,KAAA,KAAA,CAAA,GAAL,KAAK,GAAI;;;;"}
|
21
node_modules/lit-html/node/development/directives/join.js
generated
vendored
Normal file
21
node_modules/lit-html/node/development/directives/join.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
function* join(items, joiner) {
|
||||
const isFunction = typeof joiner === 'function';
|
||||
if (items !== undefined) {
|
||||
let i = -1;
|
||||
for (const value of items) {
|
||||
if (i > -1) {
|
||||
yield isFunction ? joiner(i) : joiner;
|
||||
}
|
||||
i++;
|
||||
yield value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { join };
|
||||
//# sourceMappingURL=join.js.map
|
1
node_modules/lit-html/node/development/directives/join.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/join.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"join.js","sources":["../../../src/directives/join.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Returns an iterable containing the values in `items` interleaved with the\n * `joiner` value.\n *\n * @example\n *\n * ```ts\n * render() {\n * return html`\n * ${join(items, html`<span class=\"separator\">|</span>`)}\n * `;\n * }\n */\nexport function join<I, J>(\n items: Iterable<I> | undefined,\n joiner: (index: number) => J\n): Iterable<I | J>;\nexport function join<I, J>(\n items: Iterable<I> | undefined,\n joiner: J\n): Iterable<I | J>;\nexport function* join<I, J>(items: Iterable<I> | undefined, joiner: J) {\n const isFunction = typeof joiner === 'function';\n if (items !== undefined) {\n let i = -1;\n for (const value of items) {\n if (i > -1) {\n yield isFunction ? joiner(i) : joiner;\n }\n i++;\n yield value;\n }\n }\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;UAuBc,IAAI,CAAO,KAA8B,EAAE,MAAS,EAAA;AACnE,IAAA,MAAM,UAAU,GAAG,OAAO,MAAM,KAAK,UAAU,CAAC;IAChD,IAAI,KAAK,KAAK,SAAS,EAAE;AACvB,QAAA,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACX,QAAA,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE;AACzB,YAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;AACV,gBAAA,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AACvC,aAAA;AACD,YAAA,CAAC,EAAE,CAAC;AACJ,YAAA,MAAM,KAAK,CAAC;AACb,SAAA;AACF,KAAA;AACH;;;;"}
|
42
node_modules/lit-html/node/development/directives/keyed.js
generated
vendored
Normal file
42
node_modules/lit-html/node/development/directives/keyed.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import { nothing } from '../lit-html.js';
|
||||
import { directive, Directive } from '../directive.js';
|
||||
import { setCommittedValue } from '../directive-helpers.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
class Keyed extends Directive {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.key = nothing;
|
||||
}
|
||||
render(k, v) {
|
||||
this.key = k;
|
||||
return v;
|
||||
}
|
||||
update(part, [k, v]) {
|
||||
if (k !== this.key) {
|
||||
// Clear the part before returning a value. The one-arg form of
|
||||
// setCommittedValue sets the value to a sentinel which forces a
|
||||
// commit the next render.
|
||||
setCommittedValue(part);
|
||||
this.key = k;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Associates a renderable value with a unique key. When the key changes, the
|
||||
* previous DOM is removed and disposed before rendering the next value, even
|
||||
* if the value - such as a template - is the same.
|
||||
*
|
||||
* This is useful for forcing re-renders of stateful components, or working
|
||||
* with code that expects new data to generate new HTML elements, such as some
|
||||
* animation techniques.
|
||||
*/
|
||||
const keyed = directive(Keyed);
|
||||
|
||||
export { keyed };
|
||||
//# sourceMappingURL=keyed.js.map
|
1
node_modules/lit-html/node/development/directives/keyed.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/keyed.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"keyed.js","sources":["../../../src/directives/keyed.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {nothing} from '../lit-html.js';\nimport {\n directive,\n Directive,\n ChildPart,\n DirectiveParameters,\n} from '../directive.js';\nimport {setCommittedValue} from '../directive-helpers.js';\n\nclass Keyed extends Directive {\n key: unknown = nothing;\n\n render(k: unknown, v: unknown) {\n this.key = k;\n return v;\n }\n\n override update(part: ChildPart, [k, v]: DirectiveParameters<this>) {\n if (k !== this.key) {\n // Clear the part before returning a value. The one-arg form of\n // setCommittedValue sets the value to a sentinel which forces a\n // commit the next render.\n setCommittedValue(part);\n this.key = k;\n }\n return v;\n }\n}\n\n/**\n * Associates a renderable value with a unique key. When the key changes, the\n * previous DOM is removed and disposed before rendering the next value, even\n * if the value - such as a template - is the same.\n *\n * This is useful for forcing re-renders of stateful components, or working\n * with code that expects new data to generate new HTML elements, such as some\n * animation techniques.\n */\nexport const keyed = directive(Keyed);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {Keyed};\n"],"names":[],"mappings":";;;;AAAA;;;;AAIG;AAWH,MAAM,KAAM,SAAQ,SAAS,CAAA;AAA7B,IAAA,WAAA,GAAA;;QACE,IAAG,CAAA,GAAA,GAAY,OAAO,CAAC;KAiBxB;IAfC,MAAM,CAAC,CAAU,EAAE,CAAU,EAAA;AAC3B,QAAA,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;AACb,QAAA,OAAO,CAAC,CAAC;KACV;AAEQ,IAAA,MAAM,CAAC,IAAe,EAAE,CAAC,CAAC,EAAE,CAAC,CAA4B,EAAA;AAChE,QAAA,IAAI,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE;;;;YAIlB,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACxB,YAAA,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;AACd,SAAA;AACD,QAAA,OAAO,CAAC,CAAC;KACV;AACF,CAAA;AAED;;;;;;;;AAQG;MACU,KAAK,GAAG,SAAS,CAAC,KAAK;;;;"}
|
80
node_modules/lit-html/node/development/directives/live.js
generated
vendored
Normal file
80
node_modules/lit-html/node/development/directives/live.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
import { noChange, nothing } from '../lit-html.js';
|
||||
import { directive, Directive, PartType } from '../directive.js';
|
||||
import { isSingleExpression, setCommittedValue } from '../directive-helpers.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
class LiveDirective extends Directive {
|
||||
constructor(partInfo) {
|
||||
super(partInfo);
|
||||
if (!(partInfo.type === PartType.PROPERTY ||
|
||||
partInfo.type === PartType.ATTRIBUTE ||
|
||||
partInfo.type === PartType.BOOLEAN_ATTRIBUTE)) {
|
||||
throw new Error('The `live` directive is not allowed on child or event bindings');
|
||||
}
|
||||
if (!isSingleExpression(partInfo)) {
|
||||
throw new Error('`live` bindings can only contain a single expression');
|
||||
}
|
||||
}
|
||||
render(value) {
|
||||
return value;
|
||||
}
|
||||
update(part, [value]) {
|
||||
if (value === noChange || value === nothing) {
|
||||
return value;
|
||||
}
|
||||
const element = part.element;
|
||||
const name = part.name;
|
||||
if (part.type === PartType.PROPERTY) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (value === element[name]) {
|
||||
return noChange;
|
||||
}
|
||||
}
|
||||
else if (part.type === PartType.BOOLEAN_ATTRIBUTE) {
|
||||
if (!!value === element.hasAttribute(name)) {
|
||||
return noChange;
|
||||
}
|
||||
}
|
||||
else if (part.type === PartType.ATTRIBUTE) {
|
||||
if (element.getAttribute(name) === String(value)) {
|
||||
return noChange;
|
||||
}
|
||||
}
|
||||
// Resets the part's value, causing its dirty-check to fail so that it
|
||||
// always sets the value.
|
||||
setCommittedValue(part);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Checks binding values against live DOM values, instead of previously bound
|
||||
* values, when determining whether to update the value.
|
||||
*
|
||||
* This is useful for cases where the DOM value may change from outside of
|
||||
* lit-html, such as with a binding to an `<input>` element's `value` property,
|
||||
* a content editable elements text, or to a custom element that changes it's
|
||||
* own properties or attributes.
|
||||
*
|
||||
* In these cases if the DOM value changes, but the value set through lit-html
|
||||
* bindings hasn't, lit-html won't know to update the DOM value and will leave
|
||||
* it alone. If this is not what you want--if you want to overwrite the DOM
|
||||
* value with the bound value no matter what--use the `live()` directive:
|
||||
*
|
||||
* ```js
|
||||
* html`<input .value=${live(x)}>`
|
||||
* ```
|
||||
*
|
||||
* `live()` performs a strict equality check against the live DOM value, and if
|
||||
* the new value is equal to the live value, does nothing. This means that
|
||||
* `live()` should not be used when the binding will cause a type conversion. If
|
||||
* you use `live()` with an attribute binding, make sure that only strings are
|
||||
* passed in, or the binding will update every render.
|
||||
*/
|
||||
const live = directive(LiveDirective);
|
||||
|
||||
export { live };
|
||||
//# sourceMappingURL=live.js.map
|
1
node_modules/lit-html/node/development/directives/live.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/live.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"live.js","sources":["../../../src/directives/live.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {AttributePart, noChange, nothing} from '../lit-html.js';\nimport {\n directive,\n Directive,\n DirectiveParameters,\n PartInfo,\n PartType,\n} from '../directive.js';\nimport {isSingleExpression, setCommittedValue} from '../directive-helpers.js';\n\nclass LiveDirective extends Directive {\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (\n !(\n partInfo.type === PartType.PROPERTY ||\n partInfo.type === PartType.ATTRIBUTE ||\n partInfo.type === PartType.BOOLEAN_ATTRIBUTE\n )\n ) {\n throw new Error(\n 'The `live` directive is not allowed on child or event bindings'\n );\n }\n if (!isSingleExpression(partInfo)) {\n throw new Error('`live` bindings can only contain a single expression');\n }\n }\n\n render(value: unknown) {\n return value;\n }\n\n override update(part: AttributePart, [value]: DirectiveParameters<this>) {\n if (value === noChange || value === nothing) {\n return value;\n }\n const element = part.element;\n const name = part.name;\n\n if (part.type === PartType.PROPERTY) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (value === (element as any)[name]) {\n return noChange;\n }\n } else if (part.type === PartType.BOOLEAN_ATTRIBUTE) {\n if (!!value === element.hasAttribute(name)) {\n return noChange;\n }\n } else if (part.type === PartType.ATTRIBUTE) {\n if (element.getAttribute(name) === String(value)) {\n return noChange;\n }\n }\n // Resets the part's value, causing its dirty-check to fail so that it\n // always sets the value.\n setCommittedValue(part);\n return value;\n }\n}\n\n/**\n * Checks binding values against live DOM values, instead of previously bound\n * values, when determining whether to update the value.\n *\n * This is useful for cases where the DOM value may change from outside of\n * lit-html, such as with a binding to an `<input>` element's `value` property,\n * a content editable elements text, or to a custom element that changes it's\n * own properties or attributes.\n *\n * In these cases if the DOM value changes, but the value set through lit-html\n * bindings hasn't, lit-html won't know to update the DOM value and will leave\n * it alone. If this is not what you want--if you want to overwrite the DOM\n * value with the bound value no matter what--use the `live()` directive:\n *\n * ```js\n * html`<input .value=${live(x)}>`\n * ```\n *\n * `live()` performs a strict equality check against the live DOM value, and if\n * the new value is equal to the live value, does nothing. This means that\n * `live()` should not be used when the binding will cause a type conversion. If\n * you use `live()` with an attribute binding, make sure that only strings are\n * passed in, or the binding will update every render.\n */\nexport const live = directive(LiveDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {LiveDirective};\n"],"names":[],"mappings":";;;;AAAA;;;;AAIG;AAYH,MAAM,aAAc,SAAQ,SAAS,CAAA;AACnC,IAAA,WAAA,CAAY,QAAkB,EAAA;QAC5B,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IACE,EACE,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,QAAQ;AACnC,YAAA,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,SAAS;AACpC,YAAA,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,iBAAiB,CAC7C,EACD;AACA,YAAA,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;AACH,SAAA;AACD,QAAA,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE;AACjC,YAAA,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;AACzE,SAAA;KACF;AAED,IAAA,MAAM,CAAC,KAAc,EAAA;AACnB,QAAA,OAAO,KAAK,CAAC;KACd;AAEQ,IAAA,MAAM,CAAC,IAAmB,EAAE,CAAC,KAAK,CAA4B,EAAA;AACrE,QAAA,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,OAAO,EAAE;AAC3C,YAAA,OAAO,KAAK,CAAC;AACd,SAAA;AACD,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;AAC7B,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;AAEvB,QAAA,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,QAAQ,EAAE;;AAEnC,YAAA,IAAI,KAAK,KAAM,OAAe,CAAC,IAAI,CAAC,EAAE;AACpC,gBAAA,OAAO,QAAQ,CAAC;AACjB,aAAA;AACF,SAAA;AAAM,aAAA,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,iBAAiB,EAAE;YACnD,IAAI,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;AAC1C,gBAAA,OAAO,QAAQ,CAAC;AACjB,aAAA;AACF,SAAA;AAAM,aAAA,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,SAAS,EAAE;YAC3C,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE;AAChD,gBAAA,OAAO,QAAQ,CAAC;AACjB,aAAA;AACF,SAAA;;;QAGD,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACxB,QAAA,OAAO,KAAK,CAAC;KACd;AACF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;AAuBG;MACU,IAAI,GAAG,SAAS,CAAC,aAAa;;;;"}
|
32
node_modules/lit-html/node/development/directives/map.js
generated
vendored
Normal file
32
node_modules/lit-html/node/development/directives/map.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
/**
|
||||
* Returns an iterable containing the result of calling `f(value)` on each
|
||||
* value in `items`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```ts
|
||||
* render() {
|
||||
* return html`
|
||||
* <ul>
|
||||
* ${map(items, (i) => html`<li>${i}</li>`)}
|
||||
* </ul>
|
||||
* `;
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
function* map(items, f) {
|
||||
if (items !== undefined) {
|
||||
let i = 0;
|
||||
for (const value of items) {
|
||||
yield f(value, i++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { map };
|
||||
//# sourceMappingURL=map.js.map
|
1
node_modules/lit-html/node/development/directives/map.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/map.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"map.js","sources":["../../../src/directives/map.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Returns an iterable containing the result of calling `f(value)` on each\n * value in `items`.\n *\n * @example\n *\n * ```ts\n * render() {\n * return html`\n * <ul>\n * ${map(items, (i) => html`<li>${i}</li>`)}\n * </ul>\n * `;\n * }\n * ```\n */\nexport function* map<T>(\n items: Iterable<T> | undefined,\n f: (value: T, index: number) => unknown\n) {\n if (items !== undefined) {\n let i = 0;\n for (const value of items) {\n yield f(value, i++);\n }\n }\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;AAEH;;;;;;;;;;;;;;;AAeG;UACc,GAAG,CAClB,KAA8B,EAC9B,CAAuC,EAAA;IAEvC,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,QAAA,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE;AACzB,YAAA,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AACrB,SAAA;AACF,KAAA;AACH;;;;"}
|
87
node_modules/lit-html/node/development/directives/private-async-helpers.js
generated
vendored
Normal file
87
node_modules/lit-html/node/development/directives/private-async-helpers.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
// Note, this module is not included in package exports so that it's private to
|
||||
// our first-party directives. If it ends up being useful, we can open it up and
|
||||
// export it.
|
||||
/**
|
||||
* Helper to iterate an AsyncIterable in its own closure.
|
||||
* @param iterable The iterable to iterate
|
||||
* @param callback The callback to call for each value. If the callback returns
|
||||
* `false`, the loop will be broken.
|
||||
*/
|
||||
const forAwaitOf = async (iterable, callback) => {
|
||||
for await (const v of iterable) {
|
||||
if ((await callback(v)) === false) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Holds a reference to an instance that can be disconnected and reconnected,
|
||||
* so that a closure over the ref (e.g. in a then function to a promise) does
|
||||
* not strongly hold a ref to the instance. Approximates a WeakRef but must
|
||||
* be manually connected & disconnected to the backing instance.
|
||||
*/
|
||||
class PseudoWeakRef {
|
||||
constructor(ref) {
|
||||
this._ref = ref;
|
||||
}
|
||||
/**
|
||||
* Disassociates the ref with the backing instance.
|
||||
*/
|
||||
disconnect() {
|
||||
this._ref = undefined;
|
||||
}
|
||||
/**
|
||||
* Reassociates the ref with the backing instance.
|
||||
*/
|
||||
reconnect(ref) {
|
||||
this._ref = ref;
|
||||
}
|
||||
/**
|
||||
* Retrieves the backing instance (will be undefined when disconnected)
|
||||
*/
|
||||
deref() {
|
||||
return this._ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A helper to pause and resume waiting on a condition in an async function
|
||||
*/
|
||||
class Pauser {
|
||||
constructor() {
|
||||
this._promise = undefined;
|
||||
this._resolve = undefined;
|
||||
}
|
||||
/**
|
||||
* When paused, returns a promise to be awaited; when unpaused, returns
|
||||
* undefined. Note that in the microtask between the pauser being resumed
|
||||
* an an await of this promise resolving, the pauser could be paused again,
|
||||
* hence callers should check the promise in a loop when awaiting.
|
||||
* @returns A promise to be awaited when paused or undefined
|
||||
*/
|
||||
get() {
|
||||
return this._promise;
|
||||
}
|
||||
/**
|
||||
* Creates a promise to be awaited
|
||||
*/
|
||||
pause() {
|
||||
var _a;
|
||||
(_a = this._promise) !== null && _a !== void 0 ? _a : (this._promise = new Promise((resolve) => (this._resolve = resolve)));
|
||||
}
|
||||
/**
|
||||
* Resolves the promise which may be awaited
|
||||
*/
|
||||
resume() {
|
||||
var _a;
|
||||
(_a = this._resolve) === null || _a === void 0 ? void 0 : _a.call(this);
|
||||
this._promise = this._resolve = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export { Pauser, PseudoWeakRef, forAwaitOf };
|
||||
//# sourceMappingURL=private-async-helpers.js.map
|
1
node_modules/lit-html/node/development/directives/private-async-helpers.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/private-async-helpers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"private-async-helpers.js","sources":["../../../src/directives/private-async-helpers.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// Note, this module is not included in package exports so that it's private to\n// our first-party directives. If it ends up being useful, we can open it up and\n// export it.\n\n/**\n * Helper to iterate an AsyncIterable in its own closure.\n * @param iterable The iterable to iterate\n * @param callback The callback to call for each value. If the callback returns\n * `false`, the loop will be broken.\n */\nexport const forAwaitOf = async <T>(\n iterable: AsyncIterable<T>,\n callback: (value: T) => Promise<boolean>\n) => {\n for await (const v of iterable) {\n if ((await callback(v)) === false) {\n return;\n }\n }\n};\n\n/**\n * Holds a reference to an instance that can be disconnected and reconnected,\n * so that a closure over the ref (e.g. in a then function to a promise) does\n * not strongly hold a ref to the instance. Approximates a WeakRef but must\n * be manually connected & disconnected to the backing instance.\n */\nexport class PseudoWeakRef<T> {\n private _ref?: T;\n constructor(ref: T) {\n this._ref = ref;\n }\n /**\n * Disassociates the ref with the backing instance.\n */\n disconnect() {\n this._ref = undefined;\n }\n /**\n * Reassociates the ref with the backing instance.\n */\n reconnect(ref: T) {\n this._ref = ref;\n }\n /**\n * Retrieves the backing instance (will be undefined when disconnected)\n */\n deref() {\n return this._ref;\n }\n}\n\n/**\n * A helper to pause and resume waiting on a condition in an async function\n */\nexport class Pauser {\n private _promise?: Promise<void> = undefined;\n private _resolve?: () => void = undefined;\n /**\n * When paused, returns a promise to be awaited; when unpaused, returns\n * undefined. Note that in the microtask between the pauser being resumed\n * an an await of this promise resolving, the pauser could be paused again,\n * hence callers should check the promise in a loop when awaiting.\n * @returns A promise to be awaited when paused or undefined\n */\n get() {\n return this._promise;\n }\n /**\n * Creates a promise to be awaited\n */\n pause() {\n this._promise ??= new Promise((resolve) => (this._resolve = resolve));\n }\n /**\n * Resolves the promise which may be awaited\n */\n resume() {\n this._resolve?.();\n this._promise = this._resolve = undefined;\n }\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;AAEH;AACA;AACA;AAEA;;;;;AAKG;AACU,MAAA,UAAU,GAAG,OACxB,QAA0B,EAC1B,QAAwC,KACtC;AACF,IAAA,WAAW,MAAM,CAAC,IAAI,QAAQ,EAAE;QAC9B,IAAI,CAAC,MAAM,QAAQ,CAAC,CAAC,CAAC,MAAM,KAAK,EAAE;YACjC,OAAO;AACR,SAAA;AACF,KAAA;AACH,EAAE;AAEF;;;;;AAKG;MACU,aAAa,CAAA;AAExB,IAAA,WAAA,CAAY,GAAM,EAAA;AAChB,QAAA,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;KACjB;AACD;;AAEG;IACH,UAAU,GAAA;AACR,QAAA,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;KACvB;AACD;;AAEG;AACH,IAAA,SAAS,CAAC,GAAM,EAAA;AACd,QAAA,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;KACjB;AACD;;AAEG;IACH,KAAK,GAAA;QACH,OAAO,IAAI,CAAC,IAAI,CAAC;KAClB;AACF,CAAA;AAED;;AAEG;MACU,MAAM,CAAA;AAAnB,IAAA,WAAA,GAAA;QACU,IAAQ,CAAA,QAAA,GAAmB,SAAS,CAAC;QACrC,IAAQ,CAAA,QAAA,GAAgB,SAAS,CAAC;KAwB3C;AAvBC;;;;;;AAMG;IACH,GAAG,GAAA;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;KACtB;AACD;;AAEG;IACH,KAAK,GAAA;;QACH,CAAA,EAAA,GAAA,IAAI,CAAC,QAAQ,MAAb,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,IAAA,IAAI,CAAC,QAAQ,GAAK,IAAI,OAAO,CAAC,CAAC,OAAO,MAAM,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;KACvE;AACD;;AAEG;IACH,MAAM,GAAA;;AACJ,QAAA,CAAA,EAAA,GAAA,IAAI,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,IAAA,CAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;KAC3C;AACF;;;;"}
|
15
node_modules/lit-html/node/development/directives/range.js
generated
vendored
Normal file
15
node_modules/lit-html/node/development/directives/range.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
function* range(startOrEnd, end, step = 1) {
|
||||
const start = end === undefined ? 0 : startOrEnd;
|
||||
end !== null && end !== void 0 ? end : (end = startOrEnd);
|
||||
for (let i = start; step > 0 ? i < end : end < i; i += step) {
|
||||
yield i;
|
||||
}
|
||||
}
|
||||
|
||||
export { range };
|
||||
//# sourceMappingURL=range.js.map
|
1
node_modules/lit-html/node/development/directives/range.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/range.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"range.js","sources":["../../../src/directives/range.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Returns an iterable of integers from `start` to `end` (exclusive)\n * incrementing by `step`.\n *\n * If `start` is omitted, the range starts at `0`. `step` defaults to `1`.\n *\n * @example\n *\n * ```ts\n * render() {\n * return html`\n * ${map(range(8), () => html`<div class=\"cell\"></div>`)}\n * `;\n * }\n * ```\n */\nexport function range(end: number): Iterable<number>;\nexport function range(\n start: number,\n end: number,\n step?: number\n): Iterable<number>;\nexport function* range(startOrEnd: number, end?: number, step = 1) {\n const start = end === undefined ? 0 : startOrEnd;\n end ??= startOrEnd;\n for (let i = start; step > 0 ? i < end : end < i; i += step) {\n yield i;\n }\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;AAwBG,UAAW,KAAK,CAAC,UAAkB,EAAE,GAAY,EAAE,IAAI,GAAG,CAAC,EAAA;AAC/D,IAAA,MAAM,KAAK,GAAG,GAAG,KAAK,SAAS,GAAG,CAAC,GAAG,UAAU,CAAC;IACjD,GAAG,KAAA,IAAA,IAAH,GAAG,KAAH,KAAA,CAAA,GAAA,GAAG,IAAH,GAAG,GAAK,UAAU,CAAC,CAAA;IACnB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE;AAC3D,QAAA,MAAM,CAAC,CAAC;AACT,KAAA;AACH;;;;"}
|
127
node_modules/lit-html/node/development/directives/ref.js
generated
vendored
Normal file
127
node_modules/lit-html/node/development/directives/ref.js
generated
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
import { nothing } from '../lit-html.js';
|
||||
import { AsyncDirective } from '../async-directive.js';
|
||||
import { directive } from '../directive.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
/**
|
||||
* Creates a new Ref object, which is container for a reference to an element.
|
||||
*/
|
||||
const createRef = () => new Ref();
|
||||
/**
|
||||
* An object that holds a ref value.
|
||||
*/
|
||||
class Ref {
|
||||
}
|
||||
// When callbacks are used for refs, this map tracks the last value the callback
|
||||
// was called with, for ensuring a directive doesn't clear the ref if the ref
|
||||
// has already been rendered to a new spot. It is double-keyed on both the
|
||||
// context (`options.host`) and the callback, since we auto-bind class methods
|
||||
// to `options.host`.
|
||||
const lastElementForContextAndCallback = new WeakMap();
|
||||
class RefDirective extends AsyncDirective {
|
||||
render(_ref) {
|
||||
return nothing;
|
||||
}
|
||||
update(part, [ref]) {
|
||||
var _a;
|
||||
const refChanged = ref !== this._ref;
|
||||
if (refChanged && this._ref !== undefined) {
|
||||
// The ref passed to the directive has changed;
|
||||
// unset the previous ref's value
|
||||
this._updateRefValue(undefined);
|
||||
}
|
||||
if (refChanged || this._lastElementForRef !== this._element) {
|
||||
// We either got a new ref or this is the first render;
|
||||
// store the ref/element & update the ref value
|
||||
this._ref = ref;
|
||||
this._context = (_a = part.options) === null || _a === void 0 ? void 0 : _a.host;
|
||||
this._updateRefValue((this._element = part.element));
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
_updateRefValue(element) {
|
||||
var _a;
|
||||
if (typeof this._ref === 'function') {
|
||||
// If the current ref was called with a previous value, call with
|
||||
// `undefined`; We do this to ensure callbacks are called in a consistent
|
||||
// way regardless of whether a ref might be moving up in the tree (in
|
||||
// which case it would otherwise be called with the new value before the
|
||||
// previous one unsets it) and down in the tree (where it would be unset
|
||||
// before being set). Note that element lookup is keyed by
|
||||
// both the context and the callback, since we allow passing unbound
|
||||
// functions that are called on options.host, and we want to treat
|
||||
// these as unique "instances" of a function.
|
||||
const context = (_a = this._context) !== null && _a !== void 0 ? _a : globalThis;
|
||||
let lastElementForCallback = lastElementForContextAndCallback.get(context);
|
||||
if (lastElementForCallback === undefined) {
|
||||
lastElementForCallback = new WeakMap();
|
||||
lastElementForContextAndCallback.set(context, lastElementForCallback);
|
||||
}
|
||||
if (lastElementForCallback.get(this._ref) !== undefined) {
|
||||
this._ref.call(this._context, undefined);
|
||||
}
|
||||
lastElementForCallback.set(this._ref, element);
|
||||
// Call the ref with the new element value
|
||||
if (element !== undefined) {
|
||||
this._ref.call(this._context, element);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this._ref.value = element;
|
||||
}
|
||||
}
|
||||
get _lastElementForRef() {
|
||||
var _a, _b, _c;
|
||||
return typeof this._ref === 'function'
|
||||
? (_b = lastElementForContextAndCallback
|
||||
.get((_a = this._context) !== null && _a !== void 0 ? _a : globalThis)) === null || _b === void 0 ? void 0 : _b.get(this._ref)
|
||||
: (_c = this._ref) === null || _c === void 0 ? void 0 : _c.value;
|
||||
}
|
||||
disconnected() {
|
||||
// Only clear the box if our element is still the one in it (i.e. another
|
||||
// directive instance hasn't rendered its element to it before us); that
|
||||
// only happens in the event of the directive being cleared (not via manual
|
||||
// disconnection)
|
||||
if (this._lastElementForRef === this._element) {
|
||||
this._updateRefValue(undefined);
|
||||
}
|
||||
}
|
||||
reconnected() {
|
||||
// If we were manually disconnected, we can safely put our element back in
|
||||
// the box, since no rendering could have occurred to change its state
|
||||
this._updateRefValue(this._element);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets the value of a Ref object or calls a ref callback with the element it's
|
||||
* bound to.
|
||||
*
|
||||
* A Ref object acts as a container for a reference to an element. A ref
|
||||
* callback is a function that takes an element as its only argument.
|
||||
*
|
||||
* The ref directive sets the value of the Ref object or calls the ref callback
|
||||
* during rendering, if the referenced element changed.
|
||||
*
|
||||
* Note: If a ref callback is rendered to a different element position or is
|
||||
* removed in a subsequent render, it will first be called with `undefined`,
|
||||
* followed by another call with the new element it was rendered to (if any).
|
||||
*
|
||||
* ```js
|
||||
* // Using Ref object
|
||||
* const inputRef = createRef();
|
||||
* render(html`<input ${ref(inputRef)}>`, container);
|
||||
* inputRef.value.focus();
|
||||
*
|
||||
* // Using callback
|
||||
* const callback = (inputElement) => inputElement.focus();
|
||||
* render(html`<input ${ref(callback)}>`, container);
|
||||
* ```
|
||||
*/
|
||||
const ref = directive(RefDirective);
|
||||
|
||||
export { createRef, ref };
|
||||
//# sourceMappingURL=ref.js.map
|
1
node_modules/lit-html/node/development/directives/ref.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/ref.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
417
node_modules/lit-html/node/development/directives/repeat.js
generated
vendored
Normal file
417
node_modules/lit-html/node/development/directives/repeat.js
generated
vendored
Normal file
@@ -0,0 +1,417 @@
|
||||
import { noChange } from '../lit-html.js';
|
||||
import { directive, Directive, PartType } from '../directive.js';
|
||||
import { getCommittedValue, setChildPartValue, insertPart, removePart, setCommittedValue } from '../directive-helpers.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
// Helper for generating a map of array item to its index over a subset
|
||||
// of an array (used to lazily generate `newKeyToIndexMap` and
|
||||
// `oldKeyToIndexMap`)
|
||||
const generateMap = (list, start, end) => {
|
||||
const map = new Map();
|
||||
for (let i = start; i <= end; i++) {
|
||||
map.set(list[i], i);
|
||||
}
|
||||
return map;
|
||||
};
|
||||
class RepeatDirective extends Directive {
|
||||
constructor(partInfo) {
|
||||
super(partInfo);
|
||||
if (partInfo.type !== PartType.CHILD) {
|
||||
throw new Error('repeat() can only be used in text expressions');
|
||||
}
|
||||
}
|
||||
_getValuesAndKeys(items, keyFnOrTemplate, template) {
|
||||
let keyFn;
|
||||
if (template === undefined) {
|
||||
template = keyFnOrTemplate;
|
||||
}
|
||||
else if (keyFnOrTemplate !== undefined) {
|
||||
keyFn = keyFnOrTemplate;
|
||||
}
|
||||
const keys = [];
|
||||
const values = [];
|
||||
let index = 0;
|
||||
for (const item of items) {
|
||||
keys[index] = keyFn ? keyFn(item, index) : index;
|
||||
values[index] = template(item, index);
|
||||
index++;
|
||||
}
|
||||
return {
|
||||
values,
|
||||
keys,
|
||||
};
|
||||
}
|
||||
render(items, keyFnOrTemplate, template) {
|
||||
return this._getValuesAndKeys(items, keyFnOrTemplate, template).values;
|
||||
}
|
||||
update(containerPart, [items, keyFnOrTemplate, template]) {
|
||||
var _a;
|
||||
// Old part & key lists are retrieved from the last update (which may
|
||||
// be primed by hydration)
|
||||
const oldParts = getCommittedValue(containerPart);
|
||||
const { values: newValues, keys: newKeys } = this._getValuesAndKeys(items, keyFnOrTemplate, template);
|
||||
// We check that oldParts, the committed value, is an Array as an
|
||||
// indicator that the previous value came from a repeat() call. If
|
||||
// oldParts is not an Array then this is the first render and we return
|
||||
// an array for lit-html's array handling to render, and remember the
|
||||
// keys.
|
||||
if (!Array.isArray(oldParts)) {
|
||||
this._itemKeys = newKeys;
|
||||
return newValues;
|
||||
}
|
||||
// In SSR hydration it's possible for oldParts to be an array but for us
|
||||
// to not have item keys because the update() hasn't run yet. We set the
|
||||
// keys to an empty array. This will cause all oldKey/newKey comparisons
|
||||
// to fail and execution to fall to the last nested brach below which
|
||||
// reuses the oldPart.
|
||||
const oldKeys = ((_a = this._itemKeys) !== null && _a !== void 0 ? _a : (this._itemKeys = []));
|
||||
// New part list will be built up as we go (either reused from
|
||||
// old parts or created for new keys in this update). This is
|
||||
// saved in the above cache at the end of the update.
|
||||
const newParts = [];
|
||||
// Maps from key to index for current and previous update; these
|
||||
// are generated lazily only when needed as a performance
|
||||
// optimization, since they are only required for multiple
|
||||
// non-contiguous changes in the list, which are less common.
|
||||
let newKeyToIndexMap;
|
||||
let oldKeyToIndexMap;
|
||||
// Head and tail pointers to old parts and new values
|
||||
let oldHead = 0;
|
||||
let oldTail = oldParts.length - 1;
|
||||
let newHead = 0;
|
||||
let newTail = newValues.length - 1;
|
||||
// Overview of O(n) reconciliation algorithm (general approach
|
||||
// based on ideas found in ivi, vue, snabbdom, etc.):
|
||||
//
|
||||
// * We start with the list of old parts and new values (and
|
||||
// arrays of their respective keys), head/tail pointers into
|
||||
// each, and we build up the new list of parts by updating
|
||||
// (and when needed, moving) old parts or creating new ones.
|
||||
// The initial scenario might look like this (for brevity of
|
||||
// the diagrams, the numbers in the array reflect keys
|
||||
// associated with the old parts or new values, although keys
|
||||
// and parts/values are actually stored in parallel arrays
|
||||
// indexed using the same head/tail pointers):
|
||||
//
|
||||
// oldHead v v oldTail
|
||||
// oldKeys: [0, 1, 2, 3, 4, 5, 6]
|
||||
// newParts: [ , , , , , , ]
|
||||
// newKeys: [0, 2, 1, 4, 3, 7, 6] <- reflects the user's new
|
||||
// item order
|
||||
// newHead ^ ^ newTail
|
||||
//
|
||||
// * Iterate old & new lists from both sides, updating,
|
||||
// swapping, or removing parts at the head/tail locations
|
||||
// until neither head nor tail can move.
|
||||
//
|
||||
// * Example below: keys at head pointers match, so update old
|
||||
// part 0 in-place (no need to move it) and record part 0 in
|
||||
// the `newParts` list. The last thing we do is advance the
|
||||
// `oldHead` and `newHead` pointers (will be reflected in the
|
||||
// next diagram).
|
||||
//
|
||||
// oldHead v v oldTail
|
||||
// oldKeys: [0, 1, 2, 3, 4, 5, 6]
|
||||
// newParts: [0, , , , , , ] <- heads matched: update 0
|
||||
// newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldHead
|
||||
// & newHead
|
||||
// newHead ^ ^ newTail
|
||||
//
|
||||
// * Example below: head pointers don't match, but tail
|
||||
// pointers do, so update part 6 in place (no need to move
|
||||
// it), and record part 6 in the `newParts` list. Last,
|
||||
// advance the `oldTail` and `oldHead` pointers.
|
||||
//
|
||||
// oldHead v v oldTail
|
||||
// oldKeys: [0, 1, 2, 3, 4, 5, 6]
|
||||
// newParts: [0, , , , , , 6] <- tails matched: update 6
|
||||
// newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldTail
|
||||
// & newTail
|
||||
// newHead ^ ^ newTail
|
||||
//
|
||||
// * If neither head nor tail match; next check if one of the
|
||||
// old head/tail items was removed. We first need to generate
|
||||
// the reverse map of new keys to index (`newKeyToIndexMap`),
|
||||
// which is done once lazily as a performance optimization,
|
||||
// since we only hit this case if multiple non-contiguous
|
||||
// changes were made. Note that for contiguous removal
|
||||
// anywhere in the list, the head and tails would advance
|
||||
// from either end and pass each other before we get to this
|
||||
// case and removals would be handled in the final while loop
|
||||
// without needing to generate the map.
|
||||
//
|
||||
// * Example below: The key at `oldTail` was removed (no longer
|
||||
// in the `newKeyToIndexMap`), so remove that part from the
|
||||
// DOM and advance just the `oldTail` pointer.
|
||||
//
|
||||
// oldHead v v oldTail
|
||||
// oldKeys: [0, 1, 2, 3, 4, 5, 6]
|
||||
// newParts: [0, , , , , , 6] <- 5 not in new map: remove
|
||||
// newKeys: [0, 2, 1, 4, 3, 7, 6] 5 and advance oldTail
|
||||
// newHead ^ ^ newTail
|
||||
//
|
||||
// * Once head and tail cannot move, any mismatches are due to
|
||||
// either new or moved items; if a new key is in the previous
|
||||
// "old key to old index" map, move the old part to the new
|
||||
// location, otherwise create and insert a new part. Note
|
||||
// that when moving an old part we null its position in the
|
||||
// oldParts array if it lies between the head and tail so we
|
||||
// know to skip it when the pointers get there.
|
||||
//
|
||||
// * Example below: neither head nor tail match, and neither
|
||||
// were removed; so find the `newHead` key in the
|
||||
// `oldKeyToIndexMap`, and move that old part's DOM into the
|
||||
// next head position (before `oldParts[oldHead]`). Last,
|
||||
// null the part in the `oldPart` array since it was
|
||||
// somewhere in the remaining oldParts still to be scanned
|
||||
// (between the head and tail pointers) so that we know to
|
||||
// skip that old part on future iterations.
|
||||
//
|
||||
// oldHead v v oldTail
|
||||
// oldKeys: [0, 1, -, 3, 4, 5, 6]
|
||||
// newParts: [0, 2, , , , , 6] <- stuck: update & move 2
|
||||
// newKeys: [0, 2, 1, 4, 3, 7, 6] into place and advance
|
||||
// newHead
|
||||
// newHead ^ ^ newTail
|
||||
//
|
||||
// * Note that for moves/insertions like the one above, a part
|
||||
// inserted at the head pointer is inserted before the
|
||||
// current `oldParts[oldHead]`, and a part inserted at the
|
||||
// tail pointer is inserted before `newParts[newTail+1]`. The
|
||||
// seeming asymmetry lies in the fact that new parts are
|
||||
// moved into place outside in, so to the right of the head
|
||||
// pointer are old parts, and to the right of the tail
|
||||
// pointer are new parts.
|
||||
//
|
||||
// * We always restart back from the top of the algorithm,
|
||||
// allowing matching and simple updates in place to
|
||||
// continue...
|
||||
//
|
||||
// * Example below: the head pointers once again match, so
|
||||
// simply update part 1 and record it in the `newParts`
|
||||
// array. Last, advance both head pointers.
|
||||
//
|
||||
// oldHead v v oldTail
|
||||
// oldKeys: [0, 1, -, 3, 4, 5, 6]
|
||||
// newParts: [0, 2, 1, , , , 6] <- heads matched: update 1
|
||||
// newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldHead
|
||||
// & newHead
|
||||
// newHead ^ ^ newTail
|
||||
//
|
||||
// * As mentioned above, items that were moved as a result of
|
||||
// being stuck (the final else clause in the code below) are
|
||||
// marked with null, so we always advance old pointers over
|
||||
// these so we're comparing the next actual old value on
|
||||
// either end.
|
||||
//
|
||||
// * Example below: `oldHead` is null (already placed in
|
||||
// newParts), so advance `oldHead`.
|
||||
//
|
||||
// oldHead v v oldTail
|
||||
// oldKeys: [0, 1, -, 3, 4, 5, 6] <- old head already used:
|
||||
// newParts: [0, 2, 1, , , , 6] advance oldHead
|
||||
// newKeys: [0, 2, 1, 4, 3, 7, 6]
|
||||
// newHead ^ ^ newTail
|
||||
//
|
||||
// * Note it's not critical to mark old parts as null when they
|
||||
// are moved from head to tail or tail to head, since they
|
||||
// will be outside the pointer range and never visited again.
|
||||
//
|
||||
// * Example below: Here the old tail key matches the new head
|
||||
// key, so the part at the `oldTail` position and move its
|
||||
// DOM to the new head position (before `oldParts[oldHead]`).
|
||||
// Last, advance `oldTail` and `newHead` pointers.
|
||||
//
|
||||
// oldHead v v oldTail
|
||||
// oldKeys: [0, 1, -, 3, 4, 5, 6]
|
||||
// newParts: [0, 2, 1, 4, , , 6] <- old tail matches new
|
||||
// newKeys: [0, 2, 1, 4, 3, 7, 6] head: update & move 4,
|
||||
// advance oldTail & newHead
|
||||
// newHead ^ ^ newTail
|
||||
//
|
||||
// * Example below: Old and new head keys match, so update the
|
||||
// old head part in place, and advance the `oldHead` and
|
||||
// `newHead` pointers.
|
||||
//
|
||||
// oldHead v oldTail
|
||||
// oldKeys: [0, 1, -, 3, 4, 5, 6]
|
||||
// newParts: [0, 2, 1, 4, 3, ,6] <- heads match: update 3
|
||||
// newKeys: [0, 2, 1, 4, 3, 7, 6] and advance oldHead &
|
||||
// newHead
|
||||
// newHead ^ ^ newTail
|
||||
//
|
||||
// * Once the new or old pointers move past each other then all
|
||||
// we have left is additions (if old list exhausted) or
|
||||
// removals (if new list exhausted). Those are handled in the
|
||||
// final while loops at the end.
|
||||
//
|
||||
// * Example below: `oldHead` exceeded `oldTail`, so we're done
|
||||
// with the main loop. Create the remaining part and insert
|
||||
// it at the new head position, and the update is complete.
|
||||
//
|
||||
// (oldHead > oldTail)
|
||||
// oldKeys: [0, 1, -, 3, 4, 5, 6]
|
||||
// newParts: [0, 2, 1, 4, 3, 7 ,6] <- create and insert 7
|
||||
// newKeys: [0, 2, 1, 4, 3, 7, 6]
|
||||
// newHead ^ newTail
|
||||
//
|
||||
// * Note that the order of the if/else clauses is not
|
||||
// important to the algorithm, as long as the null checks
|
||||
// come first (to ensure we're always working on valid old
|
||||
// parts) and that the final else clause comes last (since
|
||||
// that's where the expensive moves occur). The order of
|
||||
// remaining clauses is is just a simple guess at which cases
|
||||
// will be most common.
|
||||
//
|
||||
// * Note, we could calculate the longest
|
||||
// increasing subsequence (LIS) of old items in new position,
|
||||
// and only move those not in the LIS set. However that costs
|
||||
// O(nlogn) time and adds a bit more code, and only helps
|
||||
// make rare types of mutations require fewer moves. The
|
||||
// above handles removes, adds, reversal, swaps, and single
|
||||
// moves of contiguous items in linear time, in the minimum
|
||||
// number of moves. As the number of multiple moves where LIS
|
||||
// might help approaches a random shuffle, the LIS
|
||||
// optimization becomes less helpful, so it seems not worth
|
||||
// the code at this point. Could reconsider if a compelling
|
||||
// case arises.
|
||||
while (oldHead <= oldTail && newHead <= newTail) {
|
||||
if (oldParts[oldHead] === null) {
|
||||
// `null` means old part at head has already been used
|
||||
// below; skip
|
||||
oldHead++;
|
||||
}
|
||||
else if (oldParts[oldTail] === null) {
|
||||
// `null` means old part at tail has already been used
|
||||
// below; skip
|
||||
oldTail--;
|
||||
}
|
||||
else if (oldKeys[oldHead] === newKeys[newHead]) {
|
||||
// Old head matches new head; update in place
|
||||
newParts[newHead] = setChildPartValue(oldParts[oldHead], newValues[newHead]);
|
||||
oldHead++;
|
||||
newHead++;
|
||||
}
|
||||
else if (oldKeys[oldTail] === newKeys[newTail]) {
|
||||
// Old tail matches new tail; update in place
|
||||
newParts[newTail] = setChildPartValue(oldParts[oldTail], newValues[newTail]);
|
||||
oldTail--;
|
||||
newTail--;
|
||||
}
|
||||
else if (oldKeys[oldHead] === newKeys[newTail]) {
|
||||
// Old head matches new tail; update and move to new tail
|
||||
newParts[newTail] = setChildPartValue(oldParts[oldHead], newValues[newTail]);
|
||||
insertPart(containerPart, newParts[newTail + 1], oldParts[oldHead]);
|
||||
oldHead++;
|
||||
newTail--;
|
||||
}
|
||||
else if (oldKeys[oldTail] === newKeys[newHead]) {
|
||||
// Old tail matches new head; update and move to new head
|
||||
newParts[newHead] = setChildPartValue(oldParts[oldTail], newValues[newHead]);
|
||||
insertPart(containerPart, oldParts[oldHead], oldParts[oldTail]);
|
||||
oldTail--;
|
||||
newHead++;
|
||||
}
|
||||
else {
|
||||
if (newKeyToIndexMap === undefined) {
|
||||
// Lazily generate key-to-index maps, used for removals &
|
||||
// moves below
|
||||
newKeyToIndexMap = generateMap(newKeys, newHead, newTail);
|
||||
oldKeyToIndexMap = generateMap(oldKeys, oldHead, oldTail);
|
||||
}
|
||||
if (!newKeyToIndexMap.has(oldKeys[oldHead])) {
|
||||
// Old head is no longer in new list; remove
|
||||
removePart(oldParts[oldHead]);
|
||||
oldHead++;
|
||||
}
|
||||
else if (!newKeyToIndexMap.has(oldKeys[oldTail])) {
|
||||
// Old tail is no longer in new list; remove
|
||||
removePart(oldParts[oldTail]);
|
||||
oldTail--;
|
||||
}
|
||||
else {
|
||||
// Any mismatches at this point are due to additions or
|
||||
// moves; see if we have an old part we can reuse and move
|
||||
// into place
|
||||
const oldIndex = oldKeyToIndexMap.get(newKeys[newHead]);
|
||||
const oldPart = oldIndex !== undefined ? oldParts[oldIndex] : null;
|
||||
if (oldPart === null) {
|
||||
// No old part for this value; create a new one and
|
||||
// insert it
|
||||
const newPart = insertPart(containerPart, oldParts[oldHead]);
|
||||
setChildPartValue(newPart, newValues[newHead]);
|
||||
newParts[newHead] = newPart;
|
||||
}
|
||||
else {
|
||||
// Reuse old part
|
||||
newParts[newHead] = setChildPartValue(oldPart, newValues[newHead]);
|
||||
insertPart(containerPart, oldParts[oldHead], oldPart);
|
||||
// This marks the old part as having been used, so that
|
||||
// it will be skipped in the first two checks above
|
||||
oldParts[oldIndex] = null;
|
||||
}
|
||||
newHead++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add parts for any remaining new values
|
||||
while (newHead <= newTail) {
|
||||
// For all remaining additions, we insert before last new
|
||||
// tail, since old pointers are no longer valid
|
||||
const newPart = insertPart(containerPart, newParts[newTail + 1]);
|
||||
setChildPartValue(newPart, newValues[newHead]);
|
||||
newParts[newHead++] = newPart;
|
||||
}
|
||||
// Remove any remaining unused old parts
|
||||
while (oldHead <= oldTail) {
|
||||
const oldPart = oldParts[oldHead++];
|
||||
if (oldPart !== null) {
|
||||
removePart(oldPart);
|
||||
}
|
||||
}
|
||||
// Save order of new parts for next round
|
||||
this._itemKeys = newKeys;
|
||||
// Directly set part value, bypassing it's dirty-checking
|
||||
setCommittedValue(containerPart, newParts);
|
||||
return noChange;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A directive that repeats a series of values (usually `TemplateResults`)
|
||||
* generated from an iterable, and updates those items efficiently when the
|
||||
* iterable changes based on user-provided `keys` associated with each item.
|
||||
*
|
||||
* Note that if a `keyFn` is provided, strict key-to-DOM mapping is maintained,
|
||||
* meaning previous DOM for a given key is moved into the new position if
|
||||
* needed, and DOM will never be reused with values for different keys (new DOM
|
||||
* will always be created for new keys). This is generally the most efficient
|
||||
* way to use `repeat` since it performs minimum unnecessary work for insertions
|
||||
* and removals.
|
||||
*
|
||||
* The `keyFn` takes two parameters, the item and its index, and returns a unique key value.
|
||||
*
|
||||
* ```js
|
||||
* html`
|
||||
* <ol>
|
||||
* ${repeat(this.items, (item) => item.id, (item, index) => {
|
||||
* return html`<li>${index}: ${item.name}</li>`;
|
||||
* })}
|
||||
* </ol>
|
||||
* `
|
||||
* ```
|
||||
*
|
||||
* **Important**: If providing a `keyFn`, keys *must* be unique for all items in a
|
||||
* given call to `repeat`. The behavior when two or more items have the same key
|
||||
* is undefined.
|
||||
*
|
||||
* If no `keyFn` is provided, this directive will perform similar to mapping
|
||||
* items to values, and DOM will be reused against potentially different items.
|
||||
*/
|
||||
const repeat = directive(RepeatDirective);
|
||||
|
||||
export { repeat };
|
||||
//# sourceMappingURL=repeat.js.map
|
1
node_modules/lit-html/node/development/directives/repeat.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/repeat.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
116
node_modules/lit-html/node/development/directives/style-map.js
generated
vendored
Normal file
116
node_modules/lit-html/node/development/directives/style-map.js
generated
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
import { noChange } from '../lit-html.js';
|
||||
import { directive, Directive, PartType } from '../directive.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const important = 'important';
|
||||
// The leading space is important
|
||||
const importantFlag = ' !' + important;
|
||||
// How many characters to remove from a value, as a negative number
|
||||
const flagTrim = 0 - importantFlag.length;
|
||||
class StyleMapDirective extends Directive {
|
||||
constructor(partInfo) {
|
||||
var _a;
|
||||
super(partInfo);
|
||||
if (partInfo.type !== PartType.ATTRIBUTE ||
|
||||
partInfo.name !== 'style' ||
|
||||
((_a = partInfo.strings) === null || _a === void 0 ? void 0 : _a.length) > 2) {
|
||||
throw new Error('The `styleMap` directive must be used in the `style` attribute ' +
|
||||
'and must be the only part in the attribute.');
|
||||
}
|
||||
}
|
||||
render(styleInfo) {
|
||||
return Object.keys(styleInfo).reduce((style, prop) => {
|
||||
const value = styleInfo[prop];
|
||||
if (value == null) {
|
||||
return style;
|
||||
}
|
||||
// Convert property names from camel-case to dash-case, i.e.:
|
||||
// `backgroundColor` -> `background-color`
|
||||
// Vendor-prefixed names need an extra `-` appended to front:
|
||||
// `webkitAppearance` -> `-webkit-appearance`
|
||||
// Exception is any property name containing a dash, including
|
||||
// custom properties; we assume these are already dash-cased i.e.:
|
||||
// `--my-button-color` --> `--my-button-color`
|
||||
prop = prop.includes('-')
|
||||
? prop
|
||||
: prop
|
||||
.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, '-$&')
|
||||
.toLowerCase();
|
||||
return style + `${prop}:${value};`;
|
||||
}, '');
|
||||
}
|
||||
update(part, [styleInfo]) {
|
||||
const { style } = part.element;
|
||||
if (this._previousStyleProperties === undefined) {
|
||||
this._previousStyleProperties = new Set();
|
||||
for (const name in styleInfo) {
|
||||
this._previousStyleProperties.add(name);
|
||||
}
|
||||
return this.render(styleInfo);
|
||||
}
|
||||
// Remove old properties that no longer exist in styleInfo
|
||||
// We use forEach() instead of for-of so that re don't require down-level
|
||||
// iteration.
|
||||
this._previousStyleProperties.forEach((name) => {
|
||||
// If the name isn't in styleInfo or it's null/undefined
|
||||
if (styleInfo[name] == null) {
|
||||
this._previousStyleProperties.delete(name);
|
||||
if (name.includes('-')) {
|
||||
style.removeProperty(name);
|
||||
}
|
||||
else {
|
||||
// Note reset using empty string (vs null) as IE11 does not always
|
||||
// reset via null (https://developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style#setting_styles)
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
style[name] = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
// Add or update properties
|
||||
for (const name in styleInfo) {
|
||||
const value = styleInfo[name];
|
||||
if (value != null) {
|
||||
this._previousStyleProperties.add(name);
|
||||
const isImportant = typeof value === 'string' && value.endsWith(importantFlag);
|
||||
if (name.includes('-') || isImportant) {
|
||||
style.setProperty(name, isImportant
|
||||
? value.slice(0, flagTrim)
|
||||
: value, isImportant ? important : '');
|
||||
}
|
||||
else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
style[name] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return noChange;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A directive that applies CSS properties to an element.
|
||||
*
|
||||
* `styleMap` can only be used in the `style` attribute and must be the only
|
||||
* expression in the attribute. It takes the property names in the
|
||||
* {@link StyleInfo styleInfo} object and adds the properties to the inline
|
||||
* style of the element.
|
||||
*
|
||||
* Property names with dashes (`-`) are assumed to be valid CSS
|
||||
* property names and set on the element's style object using `setProperty()`.
|
||||
* Names without dashes are assumed to be camelCased JavaScript property names
|
||||
* and set on the element's style object using property assignment, allowing the
|
||||
* style object to translate JavaScript-style names to CSS property names.
|
||||
*
|
||||
* For example `styleMap({backgroundColor: 'red', 'border-top': '5px', '--size':
|
||||
* '0'})` sets the `background-color`, `border-top` and `--size` properties.
|
||||
*
|
||||
* @param styleInfo
|
||||
* @see {@link https://lit.dev/docs/templates/directives/#stylemap styleMap code samples on Lit.dev}
|
||||
*/
|
||||
const styleMap = directive(StyleMapDirective);
|
||||
|
||||
export { styleMap };
|
||||
//# sourceMappingURL=style-map.js.map
|
1
node_modules/lit-html/node/development/directives/style-map.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/style-map.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
34
node_modules/lit-html/node/development/directives/template-content.js
generated
vendored
Normal file
34
node_modules/lit-html/node/development/directives/template-content.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import { noChange } from '../lit-html.js';
|
||||
import { directive, Directive, PartType } from '../directive.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
class TemplateContentDirective extends Directive {
|
||||
constructor(partInfo) {
|
||||
super(partInfo);
|
||||
if (partInfo.type !== PartType.CHILD) {
|
||||
throw new Error('templateContent can only be used in child bindings');
|
||||
}
|
||||
}
|
||||
render(template) {
|
||||
if (this._previousTemplate === template) {
|
||||
return noChange;
|
||||
}
|
||||
this._previousTemplate = template;
|
||||
return document.importNode(template.content, true);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Renders the content of a template element as HTML.
|
||||
*
|
||||
* Note, the template should be developer controlled and not user controlled.
|
||||
* Rendering a user-controlled template with this directive
|
||||
* could lead to cross-site-scripting vulnerabilities.
|
||||
*/
|
||||
const templateContent = directive(TemplateContentDirective);
|
||||
|
||||
export { templateContent };
|
||||
//# sourceMappingURL=template-content.js.map
|
1
node_modules/lit-html/node/development/directives/template-content.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/template-content.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"template-content.js","sources":["../../../src/directives/template-content.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {noChange} from '../lit-html.js';\nimport {directive, Directive, PartInfo, PartType} from '../directive.js';\n\nclass TemplateContentDirective extends Directive {\n private _previousTemplate?: HTMLTemplateElement;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.CHILD) {\n throw new Error('templateContent can only be used in child bindings');\n }\n }\n\n render(template: HTMLTemplateElement) {\n if (this._previousTemplate === template) {\n return noChange;\n }\n this._previousTemplate = template;\n return document.importNode(template.content, true);\n }\n}\n\n/**\n * Renders the content of a template element as HTML.\n *\n * Note, the template should be developer controlled and not user controlled.\n * Rendering a user-controlled template with this directive\n * could lead to cross-site-scripting vulnerabilities.\n */\nexport const templateContent = directive(TemplateContentDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {TemplateContentDirective};\n"],"names":[],"mappings":";;;AAAA;;;;AAIG;AAKH,MAAM,wBAAyB,SAAQ,SAAS,CAAA;AAG9C,IAAA,WAAA,CAAY,QAAkB,EAAA;QAC5B,KAAK,CAAC,QAAQ,CAAC,CAAC;AAChB,QAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,KAAK,EAAE;AACpC,YAAA,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;AACvE,SAAA;KACF;AAED,IAAA,MAAM,CAAC,QAA6B,EAAA;AAClC,QAAA,IAAI,IAAI,CAAC,iBAAiB,KAAK,QAAQ,EAAE;AACvC,YAAA,OAAO,QAAQ,CAAC;AACjB,SAAA;AACD,QAAA,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC;QAClC,OAAO,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;KACpD;AACF,CAAA;AAED;;;;;;AAMG;MACU,eAAe,GAAG,SAAS,CAAC,wBAAwB;;;;"}
|
64
node_modules/lit-html/node/development/directives/unsafe-html.js
generated
vendored
Normal file
64
node_modules/lit-html/node/development/directives/unsafe-html.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
import { nothing, noChange } from '../lit-html.js';
|
||||
import { Directive, PartType, directive } from '../directive.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const HTML_RESULT = 1;
|
||||
class UnsafeHTMLDirective extends Directive {
|
||||
constructor(partInfo) {
|
||||
super(partInfo);
|
||||
this._value = nothing;
|
||||
if (partInfo.type !== PartType.CHILD) {
|
||||
throw new Error(`${this.constructor.directiveName}() can only be used in child bindings`);
|
||||
}
|
||||
}
|
||||
render(value) {
|
||||
if (value === nothing || value == null) {
|
||||
this._templateResult = undefined;
|
||||
return (this._value = value);
|
||||
}
|
||||
if (value === noChange) {
|
||||
return value;
|
||||
}
|
||||
if (typeof value != 'string') {
|
||||
throw new Error(`${this.constructor.directiveName}() called with a non-string value`);
|
||||
}
|
||||
if (value === this._value) {
|
||||
return this._templateResult;
|
||||
}
|
||||
this._value = value;
|
||||
const strings = [value];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
strings.raw = strings;
|
||||
// WARNING: impersonating a TemplateResult like this is extremely
|
||||
// dangerous. Third-party directives should not do this.
|
||||
return (this._templateResult = {
|
||||
// Cast to a known set of integers that satisfy ResultType so that we
|
||||
// don't have to export ResultType and possibly encourage this pattern.
|
||||
// This property needs to remain unminified.
|
||||
['_$litType$']: this.constructor
|
||||
.resultType,
|
||||
strings,
|
||||
values: [],
|
||||
});
|
||||
}
|
||||
}
|
||||
UnsafeHTMLDirective.directiveName = 'unsafeHTML';
|
||||
UnsafeHTMLDirective.resultType = HTML_RESULT;
|
||||
/**
|
||||
* Renders the result as HTML, rather than text.
|
||||
*
|
||||
* The values `undefined`, `null`, and `nothing`, will all result in no content
|
||||
* (empty string) being rendered.
|
||||
*
|
||||
* Note, this is unsafe to use with any user-provided input that hasn't been
|
||||
* sanitized or escaped, as it may lead to cross-site-scripting
|
||||
* vulnerabilities.
|
||||
*/
|
||||
const unsafeHTML = directive(UnsafeHTMLDirective);
|
||||
|
||||
export { UnsafeHTMLDirective, unsafeHTML };
|
||||
//# sourceMappingURL=unsafe-html.js.map
|
1
node_modules/lit-html/node/development/directives/unsafe-html.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/unsafe-html.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"unsafe-html.js","sources":["../../../src/directives/unsafe-html.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {nothing, TemplateResult, noChange} from '../lit-html.js';\nimport {directive, Directive, PartInfo, PartType} from '../directive.js';\n\nconst HTML_RESULT = 1;\n\nexport class UnsafeHTMLDirective extends Directive {\n static directiveName = 'unsafeHTML';\n static resultType = HTML_RESULT;\n\n private _value: unknown = nothing;\n private _templateResult?: TemplateResult;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.CHILD) {\n throw new Error(\n `${\n (this.constructor as typeof UnsafeHTMLDirective).directiveName\n }() can only be used in child bindings`\n );\n }\n }\n\n render(value: string | typeof nothing | typeof noChange | undefined | null) {\n if (value === nothing || value == null) {\n this._templateResult = undefined;\n return (this._value = value);\n }\n if (value === noChange) {\n return value;\n }\n if (typeof value != 'string') {\n throw new Error(\n `${\n (this.constructor as typeof UnsafeHTMLDirective).directiveName\n }() called with a non-string value`\n );\n }\n if (value === this._value) {\n return this._templateResult;\n }\n this._value = value;\n const strings = [value] as unknown as TemplateStringsArray;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (strings as any).raw = strings;\n // WARNING: impersonating a TemplateResult like this is extremely\n // dangerous. Third-party directives should not do this.\n return (this._templateResult = {\n // Cast to a known set of integers that satisfy ResultType so that we\n // don't have to export ResultType and possibly encourage this pattern.\n // This property needs to remain unminified.\n ['_$litType$']: (this.constructor as typeof UnsafeHTMLDirective)\n .resultType as 1 | 2,\n strings,\n values: [],\n });\n }\n}\n\n/**\n * Renders the result as HTML, rather than text.\n *\n * The values `undefined`, `null`, and `nothing`, will all result in no content\n * (empty string) being rendered.\n *\n * Note, this is unsafe to use with any user-provided input that hasn't been\n * sanitized or escaped, as it may lead to cross-site-scripting\n * vulnerabilities.\n */\nexport const unsafeHTML = directive(UnsafeHTMLDirective);\n"],"names":[],"mappings":";;;AAAA;;;;AAIG;AAKH,MAAM,WAAW,GAAG,CAAC,CAAC;AAEhB,MAAO,mBAAoB,SAAQ,SAAS,CAAA;AAOhD,IAAA,WAAA,CAAY,QAAkB,EAAA;QAC5B,KAAK,CAAC,QAAQ,CAAC,CAAC;QAJV,IAAM,CAAA,MAAA,GAAY,OAAO,CAAC;AAKhC,QAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,KAAK,EAAE;YACpC,MAAM,IAAI,KAAK,CACb,CACG,EAAA,IAAI,CAAC,WAA0C,CAAC,aACnD,CAAuC,qCAAA,CAAA,CACxC,CAAC;AACH,SAAA;KACF;AAED,IAAA,MAAM,CAAC,KAAmE,EAAA;AACxE,QAAA,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,IAAI,IAAI,EAAE;AACtC,YAAA,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;AACjC,YAAA,QAAQ,IAAI,CAAC,MAAM,GAAG,KAAK,EAAE;AAC9B,SAAA;QACD,IAAI,KAAK,KAAK,QAAQ,EAAE;AACtB,YAAA,OAAO,KAAK,CAAC;AACd,SAAA;AACD,QAAA,IAAI,OAAO,KAAK,IAAI,QAAQ,EAAE;YAC5B,MAAM,IAAI,KAAK,CACb,CACG,EAAA,IAAI,CAAC,WAA0C,CAAC,aACnD,CAAmC,iCAAA,CAAA,CACpC,CAAC;AACH,SAAA;AACD,QAAA,IAAI,KAAK,KAAK,IAAI,CAAC,MAAM,EAAE;YACzB,OAAO,IAAI,CAAC,eAAe,CAAC;AAC7B,SAAA;AACD,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;AACpB,QAAA,MAAM,OAAO,GAAG,CAAC,KAAK,CAAoC,CAAC;;AAE1D,QAAA,OAAe,CAAC,GAAG,GAAG,OAAO,CAAC;;;AAG/B,QAAA,QAAQ,IAAI,CAAC,eAAe,GAAG;;;;AAI7B,YAAA,CAAC,YAAY,GAAI,IAAI,CAAC,WAA0C;iBAC7D,UAAmB;YACtB,OAAO;AACP,YAAA,MAAM,EAAE,EAAE;AACX,SAAA,EAAE;KACJ;;AAlDM,mBAAa,CAAA,aAAA,GAAG,YAAY,CAAC;AAC7B,mBAAU,CAAA,UAAA,GAAG,WAAW,CAAC;AAoDlC;;;;;;;;;AASG;MACU,UAAU,GAAG,SAAS,CAAC,mBAAmB;;;;"}
|
27
node_modules/lit-html/node/development/directives/unsafe-svg.js
generated
vendored
Normal file
27
node_modules/lit-html/node/development/directives/unsafe-svg.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { directive } from '../directive.js';
|
||||
import { UnsafeHTMLDirective } from './unsafe-html.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const SVG_RESULT = 2;
|
||||
class UnsafeSVGDirective extends UnsafeHTMLDirective {
|
||||
}
|
||||
UnsafeSVGDirective.directiveName = 'unsafeSVG';
|
||||
UnsafeSVGDirective.resultType = SVG_RESULT;
|
||||
/**
|
||||
* Renders the result as SVG, rather than text.
|
||||
*
|
||||
* The values `undefined`, `null`, and `nothing`, will all result in no content
|
||||
* (empty string) being rendered.
|
||||
*
|
||||
* Note, this is unsafe to use with any user-provided input that hasn't been
|
||||
* sanitized or escaped, as it may lead to cross-site-scripting
|
||||
* vulnerabilities.
|
||||
*/
|
||||
const unsafeSVG = directive(UnsafeSVGDirective);
|
||||
|
||||
export { unsafeSVG };
|
||||
//# sourceMappingURL=unsafe-svg.js.map
|
1
node_modules/lit-html/node/development/directives/unsafe-svg.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/unsafe-svg.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"unsafe-svg.js","sources":["../../../src/directives/unsafe-svg.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {directive} from '../directive.js';\nimport {UnsafeHTMLDirective} from './unsafe-html.js';\n\nconst SVG_RESULT = 2;\n\nclass UnsafeSVGDirective extends UnsafeHTMLDirective {\n static override directiveName = 'unsafeSVG';\n static override resultType = SVG_RESULT;\n}\n\n/**\n * Renders the result as SVG, rather than text.\n *\n * The values `undefined`, `null`, and `nothing`, will all result in no content\n * (empty string) being rendered.\n *\n * Note, this is unsafe to use with any user-provided input that hasn't been\n * sanitized or escaped, as it may lead to cross-site-scripting\n * vulnerabilities.\n */\nexport const unsafeSVG = directive(UnsafeSVGDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {UnsafeSVGDirective};\n"],"names":[],"mappings":";;;AAAA;;;;AAIG;AAKH,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB,MAAM,kBAAmB,SAAQ,mBAAmB,CAAA;;AAClC,kBAAa,CAAA,aAAA,GAAG,WAAW,CAAC;AAC5B,kBAAU,CAAA,UAAA,GAAG,UAAU,CAAC;AAG1C;;;;;;;;;AASG;MACU,SAAS,GAAG,SAAS,CAAC,kBAAkB;;;;"}
|
128
node_modules/lit-html/node/development/directives/until.js
generated
vendored
Normal file
128
node_modules/lit-html/node/development/directives/until.js
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
import { noChange } from '../lit-html.js';
|
||||
import { isPrimitive } from '../directive-helpers.js';
|
||||
import { AsyncDirective } from '../async-directive.js';
|
||||
import { PseudoWeakRef, Pauser } from './private-async-helpers.js';
|
||||
import { directive } from '../directive.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const isPromise = (x) => {
|
||||
return !isPrimitive(x) && typeof x.then === 'function';
|
||||
};
|
||||
// Effectively infinity, but a SMI.
|
||||
const _infinity = 0x3fffffff;
|
||||
class UntilDirective extends AsyncDirective {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.__lastRenderedIndex = _infinity;
|
||||
this.__values = [];
|
||||
this.__weakThis = new PseudoWeakRef(this);
|
||||
this.__pauser = new Pauser();
|
||||
}
|
||||
render(...args) {
|
||||
var _a;
|
||||
return (_a = args.find((x) => !isPromise(x))) !== null && _a !== void 0 ? _a : noChange;
|
||||
}
|
||||
update(_part, args) {
|
||||
const previousValues = this.__values;
|
||||
let previousLength = previousValues.length;
|
||||
this.__values = args;
|
||||
const weakThis = this.__weakThis;
|
||||
const pauser = this.__pauser;
|
||||
// If our initial render occurs while disconnected, ensure that the pauser
|
||||
// and weakThis are in the disconnected state
|
||||
if (!this.isConnected) {
|
||||
this.disconnected();
|
||||
}
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
// If we've rendered a higher-priority value already, stop.
|
||||
if (i > this.__lastRenderedIndex) {
|
||||
break;
|
||||
}
|
||||
const value = args[i];
|
||||
// Render non-Promise values immediately
|
||||
if (!isPromise(value)) {
|
||||
this.__lastRenderedIndex = i;
|
||||
// Since a lower-priority value will never overwrite a higher-priority
|
||||
// synchronous value, we can stop processing now.
|
||||
return value;
|
||||
}
|
||||
// If this is a Promise we've already handled, skip it.
|
||||
if (i < previousLength && value === previousValues[i]) {
|
||||
continue;
|
||||
}
|
||||
// We have a Promise that we haven't seen before, so priorities may have
|
||||
// changed. Forget what we rendered before.
|
||||
this.__lastRenderedIndex = _infinity;
|
||||
previousLength = 0;
|
||||
// Note, the callback avoids closing over `this` so that the directive
|
||||
// can be gc'ed before the promise resolves; instead `this` is retrieved
|
||||
// from `weakThis`, which can break the hard reference in the closure when
|
||||
// the directive disconnects
|
||||
Promise.resolve(value).then(async (result) => {
|
||||
// If we're disconnected, wait until we're (maybe) reconnected
|
||||
// The while loop here handles the case that the connection state
|
||||
// thrashes, causing the pauser to resume and then get re-paused
|
||||
while (pauser.get()) {
|
||||
await pauser.get();
|
||||
}
|
||||
// If the callback gets here and there is no `this`, it means that the
|
||||
// directive has been disconnected and garbage collected and we don't
|
||||
// need to do anything else
|
||||
const _this = weakThis.deref();
|
||||
if (_this !== undefined) {
|
||||
const index = _this.__values.indexOf(value);
|
||||
// If state.values doesn't contain the value, we've re-rendered without
|
||||
// the value, so don't render it. Then, only render if the value is
|
||||
// higher-priority than what's already been rendered.
|
||||
if (index > -1 && index < _this.__lastRenderedIndex) {
|
||||
_this.__lastRenderedIndex = index;
|
||||
_this.setValue(result);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return noChange;
|
||||
}
|
||||
disconnected() {
|
||||
this.__weakThis.disconnect();
|
||||
this.__pauser.pause();
|
||||
}
|
||||
reconnected() {
|
||||
this.__weakThis.reconnect(this);
|
||||
this.__pauser.resume();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Renders one of a series of values, including Promises, to a Part.
|
||||
*
|
||||
* Values are rendered in priority order, with the first argument having the
|
||||
* highest priority and the last argument having the lowest priority. If a
|
||||
* value is a Promise, low-priority values will be rendered until it resolves.
|
||||
*
|
||||
* The priority of values can be used to create placeholder content for async
|
||||
* data. For example, a Promise with pending content can be the first,
|
||||
* highest-priority, argument, and a non_promise loading indicator template can
|
||||
* be used as the second, lower-priority, argument. The loading indicator will
|
||||
* render immediately, and the primary content will render when the Promise
|
||||
* resolves.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```js
|
||||
* const content = fetch('./content.txt').then(r => r.text());
|
||||
* html`${until(content, html`<span>Loading...</span>`)}`
|
||||
* ```
|
||||
*/
|
||||
const until = directive(UntilDirective);
|
||||
/**
|
||||
* The type of the class that powers this directive. Necessary for naming the
|
||||
* directive's return type.
|
||||
*/
|
||||
// export type {UntilDirective};
|
||||
|
||||
export { UntilDirective, until };
|
||||
//# sourceMappingURL=until.js.map
|
1
node_modules/lit-html/node/development/directives/until.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/until.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
11
node_modules/lit-html/node/development/directives/when.js
generated
vendored
Normal file
11
node_modules/lit-html/node/development/directives/when.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
function when(condition, trueCase, falseCase) {
|
||||
return condition ? trueCase() : falseCase === null || falseCase === void 0 ? void 0 : falseCase();
|
||||
}
|
||||
|
||||
export { when };
|
||||
//# sourceMappingURL=when.js.map
|
1
node_modules/lit-html/node/development/directives/when.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/directives/when.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"when.js","sources":["../../../src/directives/when.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * When `condition` is true, returns the result of calling `trueCase()`, else\n * returns the result of calling `falseCase()` if `falseCase` is defined.\n *\n * This is a convenience wrapper around a ternary expression that makes it a\n * little nicer to write an inline conditional without an else.\n *\n * @example\n *\n * ```ts\n * render() {\n * return html`\n * ${when(this.user, () => html`User: ${this.user.username}`, () => html`Sign In...`)}\n * `;\n * }\n * ```\n */\nexport function when<T, F>(\n condition: true,\n trueCase: () => T,\n falseCase?: () => F\n): T;\nexport function when<T, F = undefined>(\n condition: false,\n trueCase: () => T,\n falseCase?: () => F\n): F;\nexport function when<T, F = undefined>(\n condition: unknown,\n trueCase: () => T,\n falseCase?: () => F\n): T | F;\nexport function when(\n condition: unknown,\n trueCase: () => unknown,\n falseCase?: () => unknown\n): unknown {\n return condition ? trueCase() : falseCase?.();\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;SAkCa,IAAI,CAClB,SAAkB,EAClB,QAAuB,EACvB,SAAyB,EAAA;AAEzB,IAAA,OAAO,SAAS,GAAG,QAAQ,EAAE,GAAG,SAAS,KAAT,IAAA,IAAA,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,EAAI,CAAC;AAChD;;;;"}
|
345
node_modules/lit-html/node/development/experimental-hydrate.js
generated
vendored
Normal file
345
node_modules/lit-html/node/development/experimental-hydrate.js
generated
vendored
Normal file
@@ -0,0 +1,345 @@
|
||||
import { Buffer } from 'buffer';
|
||||
import { noChange, _$LH } from './lit-html.js';
|
||||
import { PartType } from './directive.js';
|
||||
import { isPrimitive, isTemplateResult, isCompiledTemplateResult, isSingleExpression } from './directive-helpers.js';
|
||||
|
||||
const { _TemplateInstance: TemplateInstance, _isIterable: isIterable, _resolveDirective: resolveDirective, _ChildPart: ChildPart, _ElementPart: ElementPart, } = _$LH;
|
||||
/**
|
||||
* hydrate() operates on a container with server-side rendered content and
|
||||
* restores the client side data structures needed for lit-html updates such as
|
||||
* TemplateInstances and Parts. After calling `hydrate`, lit-html will behave as
|
||||
* if it initially rendered the DOM, and any subsequent updates will update
|
||||
* efficiently, the same as if lit-html had rendered the DOM on the client.
|
||||
*
|
||||
* hydrate() must be called on DOM that adheres the to lit-ssr structure for
|
||||
* parts. ChildParts must be represented with both a start and end comment
|
||||
* marker, and ChildParts that contain a TemplateInstance must have the template
|
||||
* digest written into the comment data.
|
||||
*
|
||||
* Since render() encloses its output in a ChildPart, there must always be a root
|
||||
* ChildPart.
|
||||
*
|
||||
* Example (using for # ... for annotations in HTML)
|
||||
*
|
||||
* Given this input:
|
||||
*
|
||||
* html`<div class=${x}>${y}</div>`
|
||||
*
|
||||
* The SSR DOM is:
|
||||
*
|
||||
* <!--lit-part AEmR7W+R0Ak=--> # Start marker for the root ChildPart created
|
||||
* # by render(). Includes the digest of the
|
||||
* # template
|
||||
* <div class="TEST_X">
|
||||
* <!--lit-node 0--> # Indicates there are attribute bindings here
|
||||
* # The number is the depth-first index of the parent
|
||||
* # node in the template.
|
||||
* <!--lit-part--> # Start marker for the ${x} expression
|
||||
* TEST_Y
|
||||
* <!--/lit-part--> # End marker for the ${x} expression
|
||||
* </div>
|
||||
*
|
||||
* <!--/lit-part--> # End marker for the root ChildPart
|
||||
*
|
||||
* @param rootValue
|
||||
* @param container
|
||||
* @param userOptions
|
||||
*
|
||||
* @deprecated This has been moved to `@lit-labs/ssr-client` and will be removed
|
||||
* in a future release.
|
||||
*/
|
||||
const hydrate = (rootValue, container, options = {}) => {
|
||||
console.warn('Importing `hydrate()` from `lit-html/experimental-hydrate.js` is deprecated.' +
|
||||
'Import from `@lit-labs/ssr-client` instead.');
|
||||
// TODO(kschaaf): Do we need a helper for _$litPart$ ("part for node")?
|
||||
// This property needs to remain unminified.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (container['_$litPart$'] !== undefined) {
|
||||
throw new Error('container already contains a live render');
|
||||
}
|
||||
// Since render() creates a ChildPart to render into, we'll always have
|
||||
// exactly one root part. We need to hold a reference to it so we can set
|
||||
// it in the parts cache.
|
||||
let rootPart = undefined;
|
||||
// Used for error messages
|
||||
let rootPartMarker = undefined;
|
||||
// When we are in-between ChildPart markers, this is the current ChildPart.
|
||||
// It's needed to be able to set the ChildPart's endNode when we see a
|
||||
// close marker
|
||||
let currentChildPart = undefined;
|
||||
// Used to remember parent template state as we recurse into nested
|
||||
// templates
|
||||
const stack = [];
|
||||
const walker = document.createTreeWalker(container, NodeFilter.SHOW_COMMENT, null, false);
|
||||
let marker;
|
||||
// Walk the DOM looking for part marker comments
|
||||
while ((marker = walker.nextNode()) !== null) {
|
||||
const markerText = marker.data;
|
||||
if (markerText.startsWith('lit-part')) {
|
||||
if (stack.length === 0 && rootPart !== undefined) {
|
||||
throw new Error(`There must be only one root part per container. ` +
|
||||
`Found a part marker (${marker}) when we already have a root ` +
|
||||
`part marker (${rootPartMarker})`);
|
||||
}
|
||||
// Create a new ChildPart and push it onto the stack
|
||||
currentChildPart = openChildPart(rootValue, marker, stack, options);
|
||||
rootPart !== null && rootPart !== void 0 ? rootPart : (rootPart = currentChildPart);
|
||||
rootPartMarker !== null && rootPartMarker !== void 0 ? rootPartMarker : (rootPartMarker = marker);
|
||||
}
|
||||
else if (markerText.startsWith('lit-node')) {
|
||||
// Create and hydrate attribute parts into the current ChildPart on the
|
||||
// stack
|
||||
createAttributeParts(marker, stack, options);
|
||||
}
|
||||
else if (markerText.startsWith('/lit-part')) {
|
||||
// Close the current ChildPart, and pop the previous one off the stack
|
||||
if (stack.length === 1 && currentChildPart !== rootPart) {
|
||||
throw new Error('internal error');
|
||||
}
|
||||
currentChildPart = closeChildPart(marker, currentChildPart, stack);
|
||||
}
|
||||
}
|
||||
if (rootPart === undefined) {
|
||||
const elementMessage = container instanceof ShadowRoot
|
||||
? `{container.host.localName}'s shadow root`
|
||||
: container instanceof DocumentFragment
|
||||
? 'DocumentFragment'
|
||||
: container.localName;
|
||||
console.error(`There should be exactly one root part in a render container, ` +
|
||||
`but we didn't find any in ${elementMessage}.`);
|
||||
} // This property needs to remain unminified.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
container['_$litPart$'] = rootPart;
|
||||
};
|
||||
const openChildPart = (rootValue, marker, stack, options) => {
|
||||
let value;
|
||||
// We know the startNode now. We'll know the endNode when we get to
|
||||
// the matching marker and set it in closeChildPart()
|
||||
// TODO(kschaaf): Current constructor takes both nodes
|
||||
let part;
|
||||
if (stack.length === 0) {
|
||||
part = new ChildPart(marker, null, undefined, options);
|
||||
value = rootValue;
|
||||
}
|
||||
else {
|
||||
const state = stack[stack.length - 1];
|
||||
if (state.type === 'template-instance') {
|
||||
part = new ChildPart(marker, null, state.instance, options);
|
||||
state.instance._$parts.push(part);
|
||||
value = state.result.values[state.instancePartIndex++];
|
||||
state.templatePartIndex++;
|
||||
}
|
||||
else if (state.type === 'iterable') {
|
||||
part = new ChildPart(marker, null, state.part, options);
|
||||
const result = state.iterator.next();
|
||||
if (result.done) {
|
||||
value = undefined;
|
||||
state.done = true;
|
||||
throw new Error('Unhandled shorter than expected iterable');
|
||||
}
|
||||
else {
|
||||
value = result.value;
|
||||
}
|
||||
state.part._$committedValue.push(part);
|
||||
}
|
||||
else {
|
||||
// state.type === 'leaf'
|
||||
// TODO(kschaaf): This is unexpected, and likely a result of a primitive
|
||||
// been rendered on the client when a TemplateResult was rendered on the
|
||||
// server; this part will be hydrated but not used. We can detect it, but
|
||||
// we need to decide what to do in this case. Note that this part won't be
|
||||
// retained by any parent TemplateInstance, since a primitive had been
|
||||
// rendered in its place.
|
||||
// https://github.com/lit/lit/issues/1434
|
||||
// throw new Error('Hydration value mismatch: Found a TemplateInstance' +
|
||||
// 'where a leaf value was expected');
|
||||
part = new ChildPart(marker, null, state.part, options);
|
||||
}
|
||||
}
|
||||
// Initialize the ChildPart state depending on the type of value and push
|
||||
// it onto the stack. This logic closely follows the ChildPart commit()
|
||||
// cascade order:
|
||||
// 1. directive
|
||||
// 2. noChange
|
||||
// 3. primitive (note strings must be handled before iterables, since they
|
||||
// are iterable)
|
||||
// 4. TemplateResult
|
||||
// 5. Node (not yet implemented, but fallback handling is fine)
|
||||
// 6. Iterable
|
||||
// 7. nothing (handled in fallback)
|
||||
// 8. Fallback for everything else
|
||||
value = resolveDirective(part, value);
|
||||
if (value === noChange) {
|
||||
stack.push({ part, type: 'leaf' });
|
||||
}
|
||||
else if (isPrimitive(value)) {
|
||||
stack.push({ part, type: 'leaf' });
|
||||
part._$committedValue = value;
|
||||
// TODO(kschaaf): We can detect when a primitive is being hydrated on the
|
||||
// client where a TemplateResult was rendered on the server, but we need to
|
||||
// decide on a strategy for what to do next.
|
||||
// https://github.com/lit/lit/issues/1434
|
||||
// if (marker.data !== 'lit-part') {
|
||||
// throw new Error('Hydration value mismatch: Primitive found where TemplateResult expected');
|
||||
// }
|
||||
}
|
||||
else if (isTemplateResult(value)) {
|
||||
if (isCompiledTemplateResult(value)) {
|
||||
throw new Error('compiled templates are not supported');
|
||||
}
|
||||
// Check for a template result digest
|
||||
const markerWithDigest = `lit-part ${digestForTemplateResult(value)}`;
|
||||
if (marker.data === markerWithDigest) {
|
||||
const template = ChildPart.prototype._$getTemplate(value);
|
||||
const instance = new TemplateInstance(template, part);
|
||||
stack.push({
|
||||
type: 'template-instance',
|
||||
instance,
|
||||
part,
|
||||
templatePartIndex: 0,
|
||||
instancePartIndex: 0,
|
||||
result: value,
|
||||
});
|
||||
// For TemplateResult values, we set the part value to the
|
||||
// generated TemplateInstance
|
||||
part._$committedValue = instance;
|
||||
}
|
||||
else {
|
||||
// TODO: if this isn't the server-rendered template, do we
|
||||
// need to stop hydrating this subtree? Clear it? Add tests.
|
||||
throw new Error('Hydration value mismatch: Unexpected TemplateResult rendered to part');
|
||||
}
|
||||
}
|
||||
else if (isIterable(value)) {
|
||||
// currentChildPart.value will contain an array of ChildParts
|
||||
stack.push({
|
||||
part: part,
|
||||
type: 'iterable',
|
||||
value,
|
||||
iterator: value[Symbol.iterator](),
|
||||
done: false,
|
||||
});
|
||||
part._$committedValue = [];
|
||||
}
|
||||
else {
|
||||
// Fallback for everything else (nothing, Objects, Functions,
|
||||
// etc.): we just initialize the part's value
|
||||
// Note that `Node` value types are not currently supported during
|
||||
// SSR, so that part of the cascade is missing.
|
||||
stack.push({ part: part, type: 'leaf' });
|
||||
part._$committedValue = value == null ? '' : value;
|
||||
}
|
||||
return part;
|
||||
};
|
||||
const closeChildPart = (marker, part, stack) => {
|
||||
if (part === undefined) {
|
||||
throw new Error('unbalanced part marker');
|
||||
}
|
||||
part._$endNode = marker;
|
||||
const currentState = stack.pop();
|
||||
if (currentState.type === 'iterable') {
|
||||
if (!currentState.iterator.next().done) {
|
||||
throw new Error('unexpected longer than expected iterable');
|
||||
}
|
||||
}
|
||||
if (stack.length > 0) {
|
||||
const state = stack[stack.length - 1];
|
||||
return state.part;
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
const createAttributeParts = (comment, stack, options) => {
|
||||
// Get the nodeIndex from DOM. We're only using this for an integrity
|
||||
// check right now, we might not need it.
|
||||
const match = /lit-node (\d+)/.exec(comment.data);
|
||||
const nodeIndex = parseInt(match[1]);
|
||||
// Node markers are added as a previous sibling to identify elements
|
||||
// with attribute/property/element/event bindings or custom elements
|
||||
// whose `defer-hydration` attribute needs to be removed
|
||||
const node = comment.nextElementSibling;
|
||||
if (node === null) {
|
||||
throw new Error('could not find node for attribute parts');
|
||||
}
|
||||
// Remove `defer-hydration` attribute, if any
|
||||
node.removeAttribute('defer-hydration');
|
||||
const state = stack[stack.length - 1];
|
||||
if (state.type === 'template-instance') {
|
||||
const instance = state.instance;
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
// If the next template part is in attribute-position on the current node,
|
||||
// create the instance part for it and prime its state
|
||||
const templatePart = instance._$template.parts[state.templatePartIndex];
|
||||
if (templatePart === undefined ||
|
||||
(templatePart.type !== PartType.ATTRIBUTE &&
|
||||
templatePart.type !== PartType.ELEMENT) ||
|
||||
templatePart.index !== nodeIndex) {
|
||||
break;
|
||||
}
|
||||
if (templatePart.type === PartType.ATTRIBUTE) {
|
||||
// The instance part is created based on the constructor saved in the
|
||||
// template part
|
||||
const instancePart = new templatePart.ctor(node, templatePart.name, templatePart.strings, state.instance, options);
|
||||
const value = isSingleExpression(instancePart)
|
||||
? state.result.values[state.instancePartIndex]
|
||||
: state.result.values;
|
||||
// Setting the attribute value primes committed value with the resolved
|
||||
// directive value; we only then commit that value for event/property
|
||||
// parts since those were not serialized, and pass `noCommit` for the
|
||||
// others to avoid perf impact of touching the DOM unnecessarily
|
||||
const noCommit = !(instancePart.type === PartType.EVENT ||
|
||||
instancePart.type === PartType.PROPERTY);
|
||||
instancePart._$setValue(value, instancePart, state.instancePartIndex, noCommit);
|
||||
state.instancePartIndex += templatePart.strings.length - 1;
|
||||
instance._$parts.push(instancePart);
|
||||
}
|
||||
else {
|
||||
// templatePart.type === PartType.ELEMENT
|
||||
const instancePart = new ElementPart(node, state.instance, options);
|
||||
resolveDirective(instancePart, state.result.values[state.instancePartIndex++]);
|
||||
instance._$parts.push(instancePart);
|
||||
}
|
||||
state.templatePartIndex++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new Error('internal error');
|
||||
}
|
||||
};
|
||||
// Number of 32 bit elements to use to create template digests
|
||||
const digestSize = 2;
|
||||
// We need to specify a digest to use across rendering environments. This is a
|
||||
// simple digest build from a DJB2-ish hash modified from:
|
||||
// https://github.com/darkskyapp/string-hash/blob/master/index.js
|
||||
// It has been changed to an array of hashes to add additional bits.
|
||||
// Goals:
|
||||
// - Extremely low collision rate. We may not be able to detect collisions.
|
||||
// - Extremely fast.
|
||||
// - Extremely small code size.
|
||||
// - Safe to include in HTML comment text or attribute value.
|
||||
// - Easily specifiable and implementable in multiple languages.
|
||||
// We don't care about cryptographic suitability.
|
||||
const digestForTemplateResult = (templateResult) => {
|
||||
const hashes = new Uint32Array(digestSize).fill(5381);
|
||||
for (const s of templateResult.strings) {
|
||||
for (let i = 0; i < s.length; i++) {
|
||||
hashes[i % digestSize] = (hashes[i % digestSize] * 33) ^ s.charCodeAt(i);
|
||||
}
|
||||
}
|
||||
const str = String.fromCharCode(...new Uint8Array(hashes.buffer));
|
||||
// Use `btoa` in browsers because it is supported universally.
|
||||
//
|
||||
// In Node, we are sometimes executing in an isolated VM context, which means
|
||||
// neither `btoa` nor `Buffer` will be globally available by default (also
|
||||
// note that `btoa` is only supported in Node 16+ anyway, and we still support
|
||||
// Node 14). Instead of requiring users to always provide an implementation
|
||||
// for `btoa` when they set up their VM context, we instead inject an import
|
||||
// for `Buffer` from Node's built-in `buffer` module in our Rollup config (see
|
||||
// note at the top of this file), and use that.
|
||||
return Buffer.from(str, 'binary').toString('base64') ;
|
||||
};
|
||||
|
||||
export { digestForTemplateResult, hydrate };
|
||||
//# sourceMappingURL=experimental-hydrate.js.map
|
1
node_modules/lit-html/node/development/experimental-hydrate.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/experimental-hydrate.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
24
node_modules/lit-html/node/development/is-server.js
generated
vendored
Normal file
24
node_modules/lit-html/node/development/is-server.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
/**
|
||||
* @fileoverview
|
||||
*
|
||||
* This file exports a boolean const whose value will depend on what environment
|
||||
* the module is being imported from.
|
||||
*/
|
||||
const NODE_MODE = true;
|
||||
/**
|
||||
* A boolean that will be `true` in server environments like Node, and `false`
|
||||
* in browser environments. Note that your server environment or toolchain must
|
||||
* support the `"node"` export condition for this to be `true`.
|
||||
*
|
||||
* This can be used when authoring components to change behavior based on
|
||||
* whether or not the component is executing in an SSR context.
|
||||
*/
|
||||
const isServer = NODE_MODE;
|
||||
|
||||
export { isServer };
|
||||
//# sourceMappingURL=is-server.js.map
|
1
node_modules/lit-html/node/development/is-server.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/is-server.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"is-server.js","sources":["../../src/is-server.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * @fileoverview\n *\n * This file exports a boolean const whose value will depend on what environment\n * the module is being imported from.\n */\n\nconst NODE_MODE = false;\n\n/**\n * A boolean that will be `true` in server environments like Node, and `false`\n * in browser environments. Note that your server environment or toolchain must\n * support the `\"node\"` export condition for this to be `true`.\n *\n * This can be used when authoring components to change behavior based on\n * whether or not the component is executing in an SSR context.\n */\nexport const isServer = NODE_MODE;\n"],"names":[],"mappings":"AAAA;;;;AAIG;AAEH;;;;;AAKG;AAEH,MAAA,SAAA,GAAA,IAAuB,CAAC;AAExB;;;;;;;AAOG;AACI,MAAM,QAAQ,GAAG;;;;"}
|
1459
node_modules/lit-html/node/development/lit-html.js
generated
vendored
Normal file
1459
node_modules/lit-html/node/development/lit-html.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/lit-html/node/development/lit-html.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/lit-html.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
186
node_modules/lit-html/node/development/polyfill-support.js
generated
vendored
Normal file
186
node_modules/lit-html/node/development/polyfill-support.js
generated
vendored
Normal file
@@ -0,0 +1,186 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
var _a;
|
||||
// Scopes that have had styling prepared. Note, must only be done once per
|
||||
// scope.
|
||||
var styledScopes = new Set();
|
||||
// Map of css per scope. This is collected during first scope render, used when
|
||||
// styling is prepared, and then discarded.
|
||||
var scopeCssStore = new Map();
|
||||
var ENABLE_SHADYDOM_NOPATCH = true;
|
||||
/**
|
||||
* lit-html patches. These properties cannot be renamed.
|
||||
* * ChildPart.prototype._$getTemplate
|
||||
* * ChildPart.prototype._$setValue
|
||||
*/
|
||||
var polyfillSupport = function (Template, ChildPart) {
|
||||
var _a, _b;
|
||||
// polyfill-support is only needed if ShadyCSS or the ApplyShim is in use
|
||||
// We test at the point of patching, which makes it safe to load
|
||||
// webcomponentsjs and polyfill-support in either order
|
||||
if (window.ShadyCSS === undefined ||
|
||||
(window.ShadyCSS.nativeShadow && !window.ShadyCSS.ApplyShim)) {
|
||||
return;
|
||||
}
|
||||
// console.log(
|
||||
// '%c Making lit-html compatible with ShadyDOM/CSS.',
|
||||
// 'color: lightgreen; font-style: italic'
|
||||
// );
|
||||
var wrap = ((_a = window.ShadyDOM) === null || _a === void 0 ? void 0 : _a.inUse) &&
|
||||
((_b = window.ShadyDOM) === null || _b === void 0 ? void 0 : _b.noPatch) === true
|
||||
? window.ShadyDOM.wrap
|
||||
: function (node) { return node; };
|
||||
var needsPrepareStyles = function (name) {
|
||||
return name !== undefined && !styledScopes.has(name);
|
||||
};
|
||||
var cssForScope = function (name) {
|
||||
var scopeCss = scopeCssStore.get(name);
|
||||
if (scopeCss === undefined) {
|
||||
scopeCssStore.set(name, (scopeCss = []));
|
||||
}
|
||||
return scopeCss;
|
||||
};
|
||||
var prepareStyles = function (name, template) {
|
||||
// Get styles
|
||||
var scopeCss = cssForScope(name);
|
||||
var hasScopeCss = scopeCss.length !== 0;
|
||||
if (hasScopeCss) {
|
||||
var style = document.createElement('style');
|
||||
style.textContent = scopeCss.join('\n');
|
||||
// Note, it's important to add the style to the *end* of the template so
|
||||
// it doesn't mess up part indices.
|
||||
template.content.appendChild(style);
|
||||
}
|
||||
// Mark this scope as styled.
|
||||
styledScopes.add(name);
|
||||
// Remove stored data since it's no longer needed.
|
||||
scopeCssStore.delete(name);
|
||||
// ShadyCSS removes scopes and removes the style under ShadyDOM and leaves
|
||||
// it under native Shadow DOM
|
||||
window.ShadyCSS.prepareTemplateStyles(template, name);
|
||||
// Note, under native Shadow DOM, the style is added to the beginning of the
|
||||
// template. It must be moved to the *end* of the template so it doesn't
|
||||
// mess up part indices.
|
||||
if (hasScopeCss && window.ShadyCSS.nativeShadow) {
|
||||
// If there were styles but the CSS text was empty, ShadyCSS will
|
||||
// eliminate the style altogether, so the style here could be null
|
||||
var style = template.content.querySelector('style');
|
||||
if (style !== null) {
|
||||
template.content.appendChild(style);
|
||||
}
|
||||
}
|
||||
};
|
||||
var scopedTemplateCache = new Map();
|
||||
/**
|
||||
* Override to extract style elements from the template
|
||||
* and store all style.textContent in the shady scope data.
|
||||
* Note, it's ok to patch Template since it's only used via ChildPart.
|
||||
*/
|
||||
var originalCreateElement = Template.createElement;
|
||||
Template.createElement = function (html, options) {
|
||||
var element = originalCreateElement.call(Template, html, options);
|
||||
var scope = options === null || options === void 0 ? void 0 : options.scope;
|
||||
if (scope !== undefined) {
|
||||
if (!window.ShadyCSS.nativeShadow) {
|
||||
window.ShadyCSS.prepareTemplateDom(element, scope);
|
||||
}
|
||||
// Process styles only if this scope is being prepared. Otherwise,
|
||||
// leave styles as is for back compat with Lit1.
|
||||
if (needsPrepareStyles(scope)) {
|
||||
var scopeCss = cssForScope(scope);
|
||||
// Remove styles and store textContent.
|
||||
var styles = element.content.querySelectorAll('style');
|
||||
// Store the css in this template in the scope css and remove the <style>
|
||||
// from the template _before_ the node-walk captures part indices
|
||||
scopeCss.push.apply(scopeCss, Array.from(styles).map(function (style) {
|
||||
var _a;
|
||||
(_a = style.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(style);
|
||||
return style.textContent;
|
||||
}));
|
||||
}
|
||||
}
|
||||
return element;
|
||||
};
|
||||
var renderContainer = document.createDocumentFragment();
|
||||
var renderContainerMarker = document.createComment('');
|
||||
var childPartProto = ChildPart.prototype;
|
||||
/**
|
||||
* Patch to apply gathered css via ShadyCSS. This is done only once per scope.
|
||||
*/
|
||||
var setValue = childPartProto._$setValue;
|
||||
childPartProto._$setValue = function (value, directiveParent) {
|
||||
var _a, _b;
|
||||
if (directiveParent === void 0) { directiveParent = this; }
|
||||
var container = wrap(this._$startNode).parentNode;
|
||||
var scope = (_a = this.options) === null || _a === void 0 ? void 0 : _a.scope;
|
||||
if (container instanceof ShadowRoot && needsPrepareStyles(scope)) {
|
||||
// Note, @apply requires outer => inner scope rendering on initial
|
||||
// scope renders to apply property values correctly. Style preparation
|
||||
// is tied to rendering into `shadowRoot`'s and this is typically done by
|
||||
// custom elements. If this is done in `connectedCallback`, as is typical,
|
||||
// the code below ensures the right order since content is rendered
|
||||
// into a fragment first so the hosting element can prepare styles first.
|
||||
// If rendering is done in the constructor, this won't work, but that's
|
||||
// not supported in ShadyDOM anyway.
|
||||
var startNode = this._$startNode;
|
||||
var endNode = this._$endNode;
|
||||
// Temporarily move this part into the renderContainer.
|
||||
renderContainer.appendChild(renderContainerMarker);
|
||||
this._$startNode = renderContainerMarker;
|
||||
this._$endNode = null;
|
||||
// Note, any nested template results render here and their styles will
|
||||
// be extracted and collected.
|
||||
setValue.call(this, value, directiveParent);
|
||||
// Get the template for this result or create a dummy one if a result
|
||||
// is not being rendered.
|
||||
// This property needs to remain unminified.
|
||||
var template = (value === null || value === void 0 ? void 0 : value['_$litType$'])
|
||||
? this._$committedValue._$template.el
|
||||
: document.createElement('template');
|
||||
prepareStyles(scope, template);
|
||||
// Note, this is the temporary startNode.
|
||||
renderContainer.removeChild(renderContainerMarker);
|
||||
// When using native Shadow DOM, include prepared style in shadowRoot.
|
||||
if ((_b = window.ShadyCSS) === null || _b === void 0 ? void 0 : _b.nativeShadow) {
|
||||
var style = template.content.querySelector('style');
|
||||
if (style !== null) {
|
||||
renderContainer.appendChild(style.cloneNode(true));
|
||||
}
|
||||
}
|
||||
container.insertBefore(renderContainer, endNode);
|
||||
// Move part back to original container.
|
||||
this._$startNode = startNode;
|
||||
this._$endNode = endNode;
|
||||
}
|
||||
else {
|
||||
setValue.call(this, value, directiveParent);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Patch ChildPart._$getTemplate to look up templates in a cache bucketed
|
||||
* by element name.
|
||||
*/
|
||||
childPartProto._$getTemplate = function (result) {
|
||||
var _a;
|
||||
var scope = (_a = this.options) === null || _a === void 0 ? void 0 : _a.scope;
|
||||
var templateCache = scopedTemplateCache.get(scope);
|
||||
if (templateCache === undefined) {
|
||||
scopedTemplateCache.set(scope, (templateCache = new Map()));
|
||||
}
|
||||
var template = templateCache.get(result.strings);
|
||||
if (template === undefined) {
|
||||
templateCache.set(result.strings, (template = new Template(result, this.options)));
|
||||
}
|
||||
return template;
|
||||
};
|
||||
};
|
||||
{
|
||||
polyfillSupport.noPatchSupported = ENABLE_SHADYDOM_NOPATCH;
|
||||
}
|
||||
{
|
||||
(_a = globalThis.litHtmlPolyfillSupportDevMode) !== null && _a !== void 0 ? _a : (globalThis.litHtmlPolyfillSupportDevMode = polyfillSupport);
|
||||
}
|
||||
//# sourceMappingURL=polyfill-support.js.map
|
1
node_modules/lit-html/node/development/polyfill-support.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/polyfill-support.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
61
node_modules/lit-html/node/development/private-ssr-support.js
generated
vendored
Normal file
61
node_modules/lit-html/node/development/private-ssr-support.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
import { _$LH as _$LH$1, noChange } from './lit-html.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
/**
|
||||
* END USERS SHOULD NOT RELY ON THIS OBJECT.
|
||||
*
|
||||
* We currently do not make a mangled rollup build of the lit-ssr code. In order
|
||||
* to keep a number of (otherwise private) top-level exports mangled in the
|
||||
* client side code, we export a _$LH object containing those members (or
|
||||
* helper methods for accessing private fields of those members), and then
|
||||
* re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the
|
||||
* client-side code is being used in `dev` mode or `prod` mode.
|
||||
* @private
|
||||
*/
|
||||
const _$LH = {
|
||||
boundAttributeSuffix: _$LH$1._boundAttributeSuffix,
|
||||
marker: _$LH$1._marker,
|
||||
markerMatch: _$LH$1._markerMatch,
|
||||
HTML_RESULT: _$LH$1._HTML_RESULT,
|
||||
getTemplateHtml: _$LH$1._getTemplateHtml,
|
||||
overrideDirectiveResolve: (directiveClass, resolveOverrideFn) => class extends directiveClass {
|
||||
_$resolve(_part, values) {
|
||||
return resolveOverrideFn(this, values);
|
||||
}
|
||||
},
|
||||
setDirectiveClass(value, directiveClass) {
|
||||
// This property needs to remain unminified.
|
||||
value['_$litDirective$'] = directiveClass;
|
||||
},
|
||||
getAttributePartCommittedValue: (part, value, index) => {
|
||||
// Use the part setter to resolve directives/concatenate multiple parts
|
||||
// into a final value (captured by passing in a commitValue override)
|
||||
let committedValue = noChange;
|
||||
// Note that _commitValue need not be in `stableProperties` because this
|
||||
// method is only run on `AttributePart`s created by lit-ssr using the same
|
||||
// version of the library as this file
|
||||
part._commitValue = (value) => (committedValue = value);
|
||||
part._$setValue(value, part, index);
|
||||
return committedValue;
|
||||
},
|
||||
connectedDisconnectable: (props) => ({
|
||||
...props,
|
||||
_$isConnected: true,
|
||||
}),
|
||||
resolveDirective: _$LH$1._resolveDirective,
|
||||
AttributePart: _$LH$1._AttributePart,
|
||||
PropertyPart: _$LH$1._PropertyPart,
|
||||
BooleanAttributePart: _$LH$1._BooleanAttributePart,
|
||||
EventPart: _$LH$1._EventPart,
|
||||
ElementPart: _$LH$1._ElementPart,
|
||||
TemplateInstance: _$LH$1._TemplateInstance,
|
||||
isIterable: _$LH$1._isIterable,
|
||||
ChildPart: _$LH$1._ChildPart,
|
||||
};
|
||||
|
||||
export { _$LH };
|
||||
//# sourceMappingURL=private-ssr-support.js.map
|
1
node_modules/lit-html/node/development/private-ssr-support.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/private-ssr-support.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"private-ssr-support.js","sources":["../../src/private-ssr-support.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {\n Directive,\n PartInfo,\n DirectiveClass,\n DirectiveResult,\n} from './directive.js';\nimport {\n _$LH as p,\n AttributePart,\n noChange,\n Part,\n Disconnectable,\n} from './lit-html.js';\n\nimport type {\n PropertyPart,\n ChildPart,\n BooleanAttributePart,\n EventPart,\n ElementPart,\n TemplateInstance,\n} from './lit-html.js';\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n * @private\n */\nexport const _$LH = {\n boundAttributeSuffix: p._boundAttributeSuffix,\n marker: p._marker,\n markerMatch: p._markerMatch,\n HTML_RESULT: p._HTML_RESULT,\n getTemplateHtml: p._getTemplateHtml,\n overrideDirectiveResolve: (\n directiveClass: new (part: PartInfo) => Directive & {render(): unknown},\n resolveOverrideFn: (directive: Directive, values: unknown[]) => unknown\n ) =>\n class extends directiveClass {\n override _$resolve(\n this: Directive,\n _part: Part,\n values: unknown[]\n ): unknown {\n return resolveOverrideFn(this, values);\n }\n },\n setDirectiveClass(value: DirectiveResult, directiveClass: DirectiveClass) {\n // This property needs to remain unminified.\n value['_$litDirective$'] = directiveClass;\n },\n getAttributePartCommittedValue: (\n part: AttributePart,\n value: unknown,\n index: number | undefined\n ) => {\n // Use the part setter to resolve directives/concatenate multiple parts\n // into a final value (captured by passing in a commitValue override)\n let committedValue: unknown = noChange;\n // Note that _commitValue need not be in `stableProperties` because this\n // method is only run on `AttributePart`s created by lit-ssr using the same\n // version of the library as this file\n part._commitValue = (value: unknown) => (committedValue = value);\n part._$setValue(value, part, index);\n return committedValue;\n },\n connectedDisconnectable: (props?: object): Disconnectable => ({\n ...props,\n _$isConnected: true,\n }),\n resolveDirective: p._resolveDirective,\n AttributePart: p._AttributePart,\n PropertyPart: p._PropertyPart as typeof PropertyPart,\n BooleanAttributePart: p._BooleanAttributePart as typeof BooleanAttributePart,\n EventPart: p._EventPart as typeof EventPart,\n ElementPart: p._ElementPart as typeof ElementPart,\n TemplateInstance: p._TemplateInstance as typeof TemplateInstance,\n isIterable: p._isIterable,\n ChildPart: p._ChildPart as typeof ChildPart,\n};\n"],"names":["p"],"mappings":";;AAAA;;;;AAIG;AAyBH;;;;;;;;;;AAUG;AACU,MAAA,IAAI,GAAG;IAClB,oBAAoB,EAAEA,MAAC,CAAC,qBAAqB;IAC7C,MAAM,EAAEA,MAAC,CAAC,OAAO;IACjB,WAAW,EAAEA,MAAC,CAAC,YAAY;IAC3B,WAAW,EAAEA,MAAC,CAAC,YAAY;IAC3B,eAAe,EAAEA,MAAC,CAAC,gBAAgB;IACnC,wBAAwB,EAAE,CACxB,cAAuE,EACvE,iBAAuE,KAEvE,cAAc,cAAc,CAAA;QACjB,SAAS,CAEhB,KAAW,EACX,MAAiB,EAAA;AAEjB,YAAA,OAAO,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SACxC;AACF,KAAA;IACH,iBAAiB,CAAC,KAAsB,EAAE,cAA8B,EAAA;;AAEtE,QAAA,KAAK,CAAC,iBAAiB,CAAC,GAAG,cAAc,CAAC;KAC3C;IACD,8BAA8B,EAAE,CAC9B,IAAmB,EACnB,KAAc,EACd,KAAyB,KACvB;;;QAGF,IAAI,cAAc,GAAY,QAAQ,CAAC;;;;AAIvC,QAAA,IAAI,CAAC,YAAY,GAAG,CAAC,KAAc,MAAM,cAAc,GAAG,KAAK,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AACpC,QAAA,OAAO,cAAc,CAAC;KACvB;AACD,IAAA,uBAAuB,EAAE,CAAC,KAAc,MAAsB;AAC5D,QAAA,GAAG,KAAK;AACR,QAAA,aAAa,EAAE,IAAI;KACpB,CAAC;IACF,gBAAgB,EAAEA,MAAC,CAAC,iBAAiB;IACrC,aAAa,EAAEA,MAAC,CAAC,cAAc;IAC/B,YAAY,EAAEA,MAAC,CAAC,aAAoC;IACpD,oBAAoB,EAAEA,MAAC,CAAC,qBAAoD;IAC5E,SAAS,EAAEA,MAAC,CAAC,UAA8B;IAC3C,WAAW,EAAEA,MAAC,CAAC,YAAkC;IACjD,gBAAgB,EAAEA,MAAC,CAAC,iBAA4C;IAChE,UAAU,EAAEA,MAAC,CAAC,WAAW;IACzB,SAAS,EAAEA,MAAC,CAAC,UAA8B;;;;;"}
|
143
node_modules/lit-html/node/development/static.js
generated
vendored
Normal file
143
node_modules/lit-html/node/development/static.js
generated
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
import { html as html$1, svg as svg$1 } from './lit-html.js';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
/**
|
||||
* Prevents JSON injection attacks.
|
||||
*
|
||||
* The goals of this brand:
|
||||
* 1) fast to check
|
||||
* 2) code is small on the wire
|
||||
* 3) multiple versions of Lit in a single page will all produce mutually
|
||||
* interoperable StaticValues
|
||||
* 4) normal JSON.parse (without an unusual reviver) can not produce a
|
||||
* StaticValue
|
||||
*
|
||||
* Symbols satisfy (1), (2), and (4). We use Symbol.for to satisfy (3), but
|
||||
* we don't care about the key, so we break ties via (2) and use the empty
|
||||
* string.
|
||||
*/
|
||||
const brand = Symbol.for('');
|
||||
/** Safely extracts the string part of a StaticValue. */
|
||||
const unwrapStaticValue = (value) => {
|
||||
if ((value === null || value === void 0 ? void 0 : value.r) !== brand) {
|
||||
return undefined;
|
||||
}
|
||||
return value === null || value === void 0 ? void 0 : value['_$litStatic$'];
|
||||
};
|
||||
/**
|
||||
* Wraps a string so that it behaves like part of the static template
|
||||
* strings instead of a dynamic value.
|
||||
*
|
||||
* Users must take care to ensure that adding the static string to the template
|
||||
* results in well-formed HTML, or else templates may break unexpectedly.
|
||||
*
|
||||
* Note that this function is unsafe to use on untrusted content, as it will be
|
||||
* directly parsed into HTML. Do not pass user input to this function
|
||||
* without sanitizing it.
|
||||
*
|
||||
* Static values can be changed, but they will cause a complete re-render
|
||||
* since they effectively create a new template.
|
||||
*/
|
||||
const unsafeStatic = (value) => ({
|
||||
['_$litStatic$']: value,
|
||||
r: brand,
|
||||
});
|
||||
const textFromStatic = (value) => {
|
||||
if (value['_$litStatic$'] !== undefined) {
|
||||
return value['_$litStatic$'];
|
||||
}
|
||||
else {
|
||||
throw new Error(`Value passed to 'literal' function must be a 'literal' result: ${value}. Use 'unsafeStatic' to pass non-literal values, but
|
||||
take care to ensure page security.`);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Tags a string literal so that it behaves like part of the static template
|
||||
* strings instead of a dynamic value.
|
||||
*
|
||||
* The only values that may be used in template expressions are other tagged
|
||||
* `literal` results or `unsafeStatic` values (note that untrusted content
|
||||
* should never be passed to `unsafeStatic`).
|
||||
*
|
||||
* Users must take care to ensure that adding the static string to the template
|
||||
* results in well-formed HTML, or else templates may break unexpectedly.
|
||||
*
|
||||
* Static values can be changed, but they will cause a complete re-render since
|
||||
* they effectively create a new template.
|
||||
*/
|
||||
const literal = (strings, ...values) => ({
|
||||
['_$litStatic$']: values.reduce((acc, v, idx) => acc + textFromStatic(v) + strings[idx + 1], strings[0]),
|
||||
r: brand,
|
||||
});
|
||||
const stringsCache = new Map();
|
||||
/**
|
||||
* Wraps a lit-html template tag (`html` or `svg`) to add static value support.
|
||||
*/
|
||||
const withStatic = (coreTag) => (strings, ...values) => {
|
||||
const l = values.length;
|
||||
let staticValue;
|
||||
let dynamicValue;
|
||||
const staticStrings = [];
|
||||
const dynamicValues = [];
|
||||
let i = 0;
|
||||
let hasStatics = false;
|
||||
let s;
|
||||
while (i < l) {
|
||||
s = strings[i];
|
||||
// Collect any unsafeStatic values, and their following template strings
|
||||
// so that we treat a run of template strings and unsafe static values as
|
||||
// a single template string.
|
||||
while (i < l &&
|
||||
((dynamicValue = values[i]),
|
||||
(staticValue = unwrapStaticValue(dynamicValue))) !== undefined) {
|
||||
s += staticValue + strings[++i];
|
||||
hasStatics = true;
|
||||
}
|
||||
// If the last value is static, we don't need to push it.
|
||||
if (i !== l) {
|
||||
dynamicValues.push(dynamicValue);
|
||||
}
|
||||
staticStrings.push(s);
|
||||
i++;
|
||||
}
|
||||
// If the last value isn't static (which would have consumed the last
|
||||
// string), then we need to add the last string.
|
||||
if (i === l) {
|
||||
staticStrings.push(strings[l]);
|
||||
}
|
||||
if (hasStatics) {
|
||||
const key = staticStrings.join('$$lit$$');
|
||||
strings = stringsCache.get(key);
|
||||
if (strings === undefined) {
|
||||
// Beware: in general this pattern is unsafe, and doing so may bypass
|
||||
// lit's security checks and allow an attacker to execute arbitrary
|
||||
// code and inject arbitrary content.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
staticStrings.raw = staticStrings;
|
||||
stringsCache.set(key, (strings = staticStrings));
|
||||
}
|
||||
values = dynamicValues;
|
||||
}
|
||||
return coreTag(strings, ...values);
|
||||
};
|
||||
/**
|
||||
* Interprets a template literal as an HTML template that can efficiently
|
||||
* render to and update a container.
|
||||
*
|
||||
* Includes static value support from `lit-html/static.js`.
|
||||
*/
|
||||
const html = withStatic(html$1);
|
||||
/**
|
||||
* Interprets a template literal as an SVG template that can efficiently
|
||||
* render to and update a container.
|
||||
*
|
||||
* Includes static value support from `lit-html/static.js`.
|
||||
*/
|
||||
const svg = withStatic(svg$1);
|
||||
|
||||
export { html, literal, svg, unsafeStatic, withStatic };
|
||||
//# sourceMappingURL=static.js.map
|
1
node_modules/lit-html/node/development/static.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/development/static.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/lit-html/node/directive-helpers.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directive-helpers.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import{_$LH as o}from"./lit-html.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const{I:l}=o,i=o=>null===o||"object"!=typeof o&&"function"!=typeof o,n={HTML:1,SVG:2},t=(o,l)=>void 0===l?void 0!==(null==o?void 0:o._$litType$):(null==o?void 0:o._$litType$)===l,v=o=>{var l;return null!=(null===(l=null==o?void 0:o._$litType$)||void 0===l?void 0:l.h)},d=o=>void 0!==(null==o?void 0:o._$litDirective$),u=o=>null==o?void 0:o._$litDirective$,e=o=>void 0===o.strings,r=()=>document.createComment(""),c=(o,i,n)=>{var t;const v=o._$AA.parentNode,d=void 0===i?o._$AB:i._$AA;if(void 0===n){const i=v.insertBefore(r(),d),t=v.insertBefore(r(),d);n=new l(i,t,o,o.options)}else{const l=n._$AB.nextSibling,i=n._$AM,u=i!==o;if(u){let l;null===(t=n._$AQ)||void 0===t||t.call(n,o),n._$AM=o,void 0!==n._$AP&&(l=o._$AU)!==i._$AU&&n._$AP(l)}if(l!==d||u){let o=n._$AA;for(;o!==l;){const l=o.nextSibling;v.insertBefore(o,d),o=l}}}return n},f=(o,l,i=o)=>(o._$AI(l,i),o),s={},a=(o,l=s)=>o._$AH=l,m=o=>o._$AH,p=o=>{var l;null===(l=o._$AP)||void 0===l||l.call(o,!1,!0);let i=o._$AA;const n=o._$AB.nextSibling;for(;i!==n;){const o=i.nextSibling;i.remove(),i=o}},h=o=>{o._$AR()};export{n as TemplateResultType,h as clearPart,m as getCommittedValue,u as getDirectiveClass,c as insertPart,v as isCompiledTemplateResult,d as isDirectiveResult,i as isPrimitive,e as isSingleExpression,t as isTemplateResult,p as removePart,f as setChildPartValue,a as setCommittedValue};
|
||||
//# sourceMappingURL=directive-helpers.js.map
|
1
node_modules/lit-html/node/directive-helpers.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directive-helpers.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/lit-html/node/directive.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directive.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};
|
||||
//# sourceMappingURL=directive.js.map
|
1
node_modules/lit-html/node/directive.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directive.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"directive.js","sources":["../src/directive.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Disconnectable, Part} from './lit-html.js';\n\nexport {\n AttributePart,\n BooleanAttributePart,\n ChildPart,\n ElementPart,\n EventPart,\n Part,\n PropertyPart,\n} from './lit-html.js';\n\nexport interface DirectiveClass {\n new (part: PartInfo): Directive;\n}\n\n/**\n * This utility type extracts the signature of a directive class's render()\n * method so we can use it for the type of the generated directive function.\n */\nexport type DirectiveParameters<C extends Directive> = Parameters<C['render']>;\n\n/**\n * A generated directive function doesn't evaluate the directive, but just\n * returns a DirectiveResult object that captures the arguments.\n */\nexport interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {\n /**\n * This property needs to remain unminified.\n * @internal */\n ['_$litDirective$']: C;\n /** @internal */\n values: DirectiveParameters<InstanceType<C>>;\n}\n\nexport const PartType = {\n ATTRIBUTE: 1,\n CHILD: 2,\n PROPERTY: 3,\n BOOLEAN_ATTRIBUTE: 4,\n EVENT: 5,\n ELEMENT: 6,\n} as const;\n\nexport type PartType = (typeof PartType)[keyof typeof PartType];\n\nexport interface ChildPartInfo {\n readonly type: typeof PartType.CHILD;\n}\n\nexport interface AttributePartInfo {\n readonly type:\n | typeof PartType.ATTRIBUTE\n | typeof PartType.PROPERTY\n | typeof PartType.BOOLEAN_ATTRIBUTE\n | typeof PartType.EVENT;\n readonly strings?: ReadonlyArray<string>;\n readonly name: string;\n readonly tagName: string;\n}\n\nexport interface ElementPartInfo {\n readonly type: typeof PartType.ELEMENT;\n}\n\n/**\n * Information about the part a directive is bound to.\n *\n * This is useful for checking that a directive is attached to a valid part,\n * such as with directive that can only be used on attribute bindings.\n */\nexport type PartInfo = ChildPartInfo | AttributePartInfo | ElementPartInfo;\n\n/**\n * Creates a user-facing directive function from a Directive class. This\n * function has the same parameters as the directive's render() method.\n */\nexport const directive =\n <C extends DirectiveClass>(c: C) =>\n (...values: DirectiveParameters<InstanceType<C>>): DirectiveResult<C> => ({\n // This property needs to remain unminified.\n ['_$litDirective$']: c,\n values,\n });\n\n/**\n * Base class for creating custom directives. Users should extend this class,\n * implement `render` and/or `update`, and then pass their subclass to\n * `directive`.\n */\nexport abstract class Directive implements Disconnectable {\n //@internal\n __part!: Part;\n //@internal\n __attributeIndex: number | undefined;\n //@internal\n __directive?: Directive;\n\n //@internal\n _$parent!: Disconnectable;\n\n // These will only exist on the AsyncDirective subclass\n //@internal\n _$disconnectableChildren?: Set<Disconnectable>;\n // This property needs to remain unminified.\n //@internal\n ['_$notifyDirectiveConnectionChanged']?(isConnected: boolean): void;\n\n constructor(_partInfo: PartInfo) {}\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n /** @internal */\n _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n this.__part = part;\n this._$parent = parent;\n this.__attributeIndex = attributeIndex;\n }\n /** @internal */\n _$resolve(part: Part, props: Array<unknown>): unknown {\n return this.update(part, props);\n }\n\n abstract render(...props: Array<unknown>): unknown;\n\n update(_part: Part, props: Array<unknown>): unknown {\n return this.render(...props);\n }\n}\n"],"names":["PartType","ATTRIBUTE","CHILD","PROPERTY","BOOLEAN_ATTRIBUTE","EVENT","ELEMENT","directive","c","values","_$litDirective$","Directive","constructor","_partInfo","_$isConnected","this","_$parent","_$initialize","part","parent","attributeIndex","__part","__attributeIndex","_$resolve","props","update","_part","render"],"mappings":";;;;;AAyCa,MAAAA,EAAW,CACtBC,UAAW,EACXC,MAAO,EACPC,SAAU,EACVC,kBAAmB,EACnBC,MAAO,EACPC,QAAS,GAoCEC,EACgBC,GAC3B,IAAIC,KAAsE,CAExEC,gBAAqBF,EACrBC,iBAQkBE,EAkBpBC,YAAYC,GAAuB,CAG/BC,WACF,OAAOC,KAAKC,KAASF,IACtB,CAGDG,KACEC,EACAC,EACAC,GAEAL,KAAKM,KAASH,EACdH,KAAKC,KAAWG,EAChBJ,KAAKO,KAAmBF,CACzB,CAEDG,KAAUL,EAAYM,GACpB,OAAOT,KAAKU,OAAOP,EAAMM,EAC1B,CAIDC,OAAOC,EAAaF,GAClB,OAAOT,KAAKY,UAAUH,EACvB"}
|
7
node_modules/lit-html/node/directives/async-append.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/async-append.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import{directive as r,PartType as e}from"../directive.js";import{AsyncReplaceDirective as s}from"./async-replace.js";import{clearPart as t,insertPart as o,setChildPartValue as i}from"../directive-helpers.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const c=r(class extends s{constructor(r){if(super(r),r.type!==e.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(r,e){return this._$CJ=r,super.update(r,e)}commitValue(r,e){0===e&&t(this._$CJ);const s=o(this._$CJ);i(s,r)}});export{c as asyncAppend};
|
||||
//# sourceMappingURL=async-append.js.map
|
1
node_modules/lit-html/node/directives/async-append.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/async-append.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"async-append.js","sources":["../../src/directives/async-append.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {ChildPart} from '../lit-html.js';\nimport {\n directive,\n DirectiveParameters,\n PartInfo,\n PartType,\n} from '../directive.js';\nimport {AsyncReplaceDirective} from './async-replace.js';\nimport {\n clearPart,\n insertPart,\n setChildPartValue,\n} from '../directive-helpers.js';\n\nclass AsyncAppendDirective extends AsyncReplaceDirective {\n private __childPart!: ChildPart;\n\n // Override AsyncReplace to narrow the allowed part type to ChildPart only\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.CHILD) {\n throw new Error('asyncAppend can only be used in child expressions');\n }\n }\n\n // Override AsyncReplace to save the part since we need to append into it\n override update(part: ChildPart, params: DirectiveParameters<this>) {\n this.__childPart = part;\n return super.update(part, params);\n }\n\n // Override AsyncReplace to append rather than replace\n protected override commitValue(value: unknown, index: number) {\n // When we get the first value, clear the part. This lets the\n // previous value display until we can replace it.\n if (index === 0) {\n clearPart(this.__childPart);\n }\n // Create and insert a new part and set its value to the next value\n const newPart = insertPart(this.__childPart);\n setChildPartValue(newPart, value);\n }\n}\n\n/**\n * A directive that renders the items of an async iterable[1], appending new\n * values after previous values, similar to the built-in support for iterables.\n * This directive is usable only in child expressions.\n *\n * Async iterables are objects with a [Symbol.asyncIterator] method, which\n * returns an iterator who's `next()` method returns a Promise. When a new\n * value is available, the Promise resolves and the value is appended to the\n * Part controlled by the directive. If another value other than this\n * directive has been set on the Part, the iterable will no longer be listened\n * to and new values won't be written to the Part.\n *\n * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of\n *\n * @param value An async iterable\n * @param mapper An optional function that maps from (value, index) to another\n * value. Useful for generating templates for each item in the iterable.\n */\nexport const asyncAppend = directive(AsyncAppendDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {AsyncAppendDirective};\n"],"names":["asyncAppend","directive","AsyncReplaceDirective","constructor","partInfo","super","type","PartType","CHILD","Error","update","part","params","this","__childPart","commitValue","value","index","clearPart","newPart","insertPart","setChildPartValue"],"mappings":";;;;;SAoEaA,EAAcC,EAhD3B,cAAmCC,EAIjCC,YAAYC,GAEV,GADAC,MAAMD,GACFA,EAASE,OAASC,EAASC,MAC7B,MAAUC,MAAM,oDAEnB,CAGQC,OAAOC,EAAiBC,GAE/B,OADAC,KAAKC,KAAcH,EACZN,MAAMK,OAAOC,EAAMC,EAC3B,CAGkBG,YAAYC,EAAgBC,GAG/B,IAAVA,GACFC,EAAUL,KAAKC,MAGjB,MAAMK,EAAUC,EAAWP,KAAKC,MAChCO,EAAkBF,EAASH,EAC5B"}
|
7
node_modules/lit-html/node/directives/async-replace.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/async-replace.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import{noChange as t}from"../lit-html.js";import{AsyncDirective as i}from"../async-directive.js";import{PseudoWeakRef as s,Pauser as r,forAwaitOf as e}from"./private-async-helpers.js";import{directive as n}from"../directive.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/class o extends i{constructor(){super(...arguments),this._$Cq=new s(this),this._$CK=new r}render(i,s){return t}update(i,[s,r]){if(this.isConnected||this.disconnected(),s===this._$CX)return;this._$CX=s;let n=0;const{_$Cq:o,_$CK:h}=this;return e(s,(async t=>{for(;h.get();)await h.get();const i=o.deref();if(void 0!==i){if(i._$CX!==s)return!1;void 0!==r&&(t=r(t,n)),i.commitValue(t,n),n++}return!0})),t}commitValue(t,i){this.setValue(t)}disconnected(){this._$Cq.disconnect(),this._$CK.pause()}reconnected(){this._$Cq.reconnect(this),this._$CK.resume()}}const h=n(o);export{o as AsyncReplaceDirective,h as asyncReplace};
|
||||
//# sourceMappingURL=async-replace.js.map
|
1
node_modules/lit-html/node/directives/async-replace.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/async-replace.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/lit-html/node/directives/cache.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/cache.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import{render as t,nothing as i}from"../lit-html.js";import{directive as s,Directive as e}from"../directive.js";import{isTemplateResult as o,getCommittedValue as n,setCommittedValue as r,insertPart as l,clearPart as c,isCompiledTemplateResult as u}from"../directive-helpers.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const d=t=>u(t)?t._$litType$.h:t.strings,h=s(class extends e{constructor(t){super(t),this.tt=new WeakMap}render(t){return[t]}update(s,[e]){const u=o(this.et)?d(this.et):null,h=o(e)?d(e):null;if(null!==u&&(null===h||u!==h)){const e=n(s).pop();let o=this.tt.get(u);if(void 0===o){const s=document.createDocumentFragment();o=t(i,s),o.setConnected(!1),this.tt.set(u,o)}r(o,[e]),l(o,void 0,e)}if(null!==h){if(null===u||u!==h){const t=this.tt.get(h);if(void 0!==t){const i=n(t).pop();c(s),l(s,void 0,i),r(s,[i])}}this.et=e}else this.et=void 0;return this.render(e)}});export{h as cache};
|
||||
//# sourceMappingURL=cache.js.map
|
1
node_modules/lit-html/node/directives/cache.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/cache.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/lit-html/node/directives/choose.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/choose.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const o=(o,r,n)=>{for(const n of r)if(n[0]===o)return(0,n[1])();return null==n?void 0:n()};export{o as choose};
|
||||
//# sourceMappingURL=choose.js.map
|
1
node_modules/lit-html/node/directives/choose.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/choose.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"choose.js","sources":["../../src/directives/choose.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Chooses and evaluates a template function from a list based on matching\n * the given `value` to a case.\n *\n * Cases are structured as `[caseValue, func]`. `value` is matched to\n * `caseValue` by strict equality. The first match is selected. Case values\n * can be of any type including primitives, objects, and symbols.\n *\n * This is similar to a switch statement, but as an expression and without\n * fallthrough.\n *\n * @example\n *\n * ```ts\n * render() {\n * return html`\n * ${choose(this.section, [\n * ['home', () => html`<h1>Home</h1>`],\n * ['about', () => html`<h1>About</h1>`]\n * ],\n * () => html`<h1>Error</h1>`)}\n * `;\n * }\n * ```\n */\nexport const choose = <T, V>(\n value: T,\n cases: Array<[T, () => V]>,\n defaultCase?: () => V\n) => {\n for (const c of cases) {\n const caseValue = c[0];\n if (caseValue === value) {\n const fn = c[1];\n return fn();\n }\n }\n return defaultCase?.();\n};\n"],"names":["choose","value","cases","defaultCase","c","fn"],"mappings":";;;;;AA+Ba,MAAAA,EAAS,CACpBC,EACAC,EACAC,KAEA,IAAK,MAAMC,KAAKF,EAEd,GADkBE,EAAE,KACFH,EAEhB,OAAOI,EADID,EAAE,MAIjB,OAAOD,aAAA,EAAAA,GAAe"}
|
7
node_modules/lit-html/node/directives/class-map.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/class-map.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import{noChange as t}from"../lit-html.js";import{directive as i,Directive as s,PartType as r}from"../directive.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const o=i(class extends s{constructor(t){var i;if(super(t),t.type!==r.ATTRIBUTE||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(i,[s]){var r,o;if(void 0===this.it){this.it=new Set,void 0!==i.strings&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in s)s[t]&&!(null===(r=this.nt)||void 0===r?void 0:r.has(t))&&this.it.add(t);return this.render(s)}const e=i.element.classList;this.it.forEach((t=>{t in s||(e.remove(t),this.it.delete(t))}));for(const t in s){const i=!!s[t];i===this.it.has(t)||(null===(o=this.nt)||void 0===o?void 0:o.has(t))||(i?(e.add(t),this.it.add(t)):(e.remove(t),this.it.delete(t)))}return t}});export{o as classMap};
|
||||
//# sourceMappingURL=class-map.js.map
|
1
node_modules/lit-html/node/directives/class-map.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/class-map.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
8
node_modules/lit-html/node/directives/guard.js
generated
vendored
Normal file
8
node_modules/lit-html/node/directives/guard.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import{noChange as r}from"../lit-html.js";import{directive as t,Directive as s}from"../directive.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const e={},i=t(class extends s{constructor(){super(...arguments),this.st=e}render(r,t){return t()}update(t,[s,e]){if(Array.isArray(s)){if(Array.isArray(this.st)&&this.st.length===s.length&&s.every(((r,t)=>r===this.st[t])))return r}else if(this.st===s)return r;return this.st=Array.isArray(s)?Array.from(s):s,this.render(s,e)}});export{i as guard};
|
||||
//# sourceMappingURL=guard.js.map
|
1
node_modules/lit-html/node/directives/guard.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/guard.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"guard.js","sources":["../../src/directives/guard.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {noChange, Part} from '../lit-html.js';\nimport {directive, Directive, DirectiveParameters} from '../directive.js';\n\n// A sentinel that indicates guard() hasn't rendered anything yet\nconst initialValue = {};\n\nclass GuardDirective extends Directive {\n private _previousValue: unknown = initialValue;\n\n render(_value: unknown, f: () => unknown) {\n return f();\n }\n\n override update(_part: Part, [value, f]: DirectiveParameters<this>) {\n if (Array.isArray(value)) {\n // Dirty-check arrays by item\n if (\n Array.isArray(this._previousValue) &&\n this._previousValue.length === value.length &&\n value.every((v, i) => v === (this._previousValue as Array<unknown>)[i])\n ) {\n return noChange;\n }\n } else if (this._previousValue === value) {\n // Dirty-check non-arrays by identity\n return noChange;\n }\n\n // Copy the value if it's an array so that if it's mutated we don't forget\n // what the previous values were.\n this._previousValue = Array.isArray(value) ? Array.from(value) : value;\n const r = this.render(value, f);\n return r;\n }\n}\n\n/**\n * Prevents re-render of a template function until a single value or an array of\n * values changes.\n *\n * Values are checked against previous values with strict equality (`===`), and\n * so the check won't detect nested property changes inside objects or arrays.\n * Arrays values have each item checked against the previous value at the same\n * index with strict equality. Nested arrays are also checked only by strict\n * equality.\n *\n * Example:\n *\n * ```js\n * html`\n * <div>\n * ${guard([user.id, company.id], () => html`...`)}\n * </div>\n * `\n * ```\n *\n * In this case, the template only rerenders if either `user.id` or `company.id`\n * changes.\n *\n * guard() is useful with immutable data patterns, by preventing expensive work\n * until data updates.\n *\n * Example:\n *\n * ```js\n * html`\n * <div>\n * ${guard([immutableItems], () => immutableItems.map(i => html`${i}`))}\n * </div>\n * `\n * ```\n *\n * In this case, items are mapped over only when the array reference changes.\n *\n * @param value the value to check before re-rendering\n * @param f the template function\n */\nexport const guard = directive(GuardDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {GuardDirective};\n"],"names":["initialValue","guard","directive","Directive","constructor","this","_previousValue","render","_value","f","update","_part","value","Array","isArray","length","every","v","i","noChange","from"],"mappings":";;;;;;AAUA,MAAMA,EAAe,CAAA,EAyERC,EAAQC,EAvErB,cAA6BC,EAA7BC,kCACUC,KAAcC,GAAYN,CA2BnC,CAzBCO,OAAOC,EAAiBC,GACtB,OAAOA,GACR,CAEQC,OAAOC,GAAcC,EAAOH,IACnC,GAAII,MAAMC,QAAQF,IAEhB,GACEC,MAAMC,QAAQT,KAAKC,KACnBD,KAAKC,GAAeS,SAAWH,EAAMG,QACrCH,EAAMI,OAAM,CAACC,EAAGC,IAAMD,IAAOZ,KAAKC,GAAkCY,KAEpE,OAAOC,OAEJ,GAAId,KAAKC,KAAmBM,EAEjC,OAAOO,EAOT,OAFAd,KAAKC,GAAiBO,MAAMC,QAAQF,GAASC,MAAMO,KAAKR,GAASA,EACvDP,KAAKE,OAAOK,EAAOH,EAE9B"}
|
7
node_modules/lit-html/node/directives/if-defined.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/if-defined.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import{nothing as t}from"../lit-html.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const l=l=>null!=l?l:t;export{l as ifDefined};
|
||||
//# sourceMappingURL=if-defined.js.map
|
1
node_modules/lit-html/node/directives/if-defined.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/if-defined.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"if-defined.js","sources":["../../src/directives/if-defined.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {nothing} from '../lit-html.js';\n\n/**\n * For AttributeParts, sets the attribute if the value is defined and removes\n * the attribute if the value is undefined.\n *\n * For other part types, this directive is a no-op.\n */\nexport const ifDefined = <T>(value: T) => value ?? nothing;\n"],"names":["ifDefined","value","nothing"],"mappings":";;;;;GAca,MAAAA,EAAgBC,GAAaA,QAAAA,EAASC"}
|
7
node_modules/lit-html/node/directives/join.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/join.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
function*o(o,t){const f="function"==typeof t;if(void 0!==o){let i=-1;for(const n of o)i>-1&&(yield f?t(i):t),i++,yield n}}export{o as join};
|
||||
//# sourceMappingURL=join.js.map
|
1
node_modules/lit-html/node/directives/join.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/join.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"join.js","sources":["../../src/directives/join.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Returns an iterable containing the values in `items` interleaved with the\n * `joiner` value.\n *\n * @example\n *\n * ```ts\n * render() {\n * return html`\n * ${join(items, html`<span class=\"separator\">|</span>`)}\n * `;\n * }\n */\nexport function join<I, J>(\n items: Iterable<I> | undefined,\n joiner: (index: number) => J\n): Iterable<I | J>;\nexport function join<I, J>(\n items: Iterable<I> | undefined,\n joiner: J\n): Iterable<I | J>;\nexport function* join<I, J>(items: Iterable<I> | undefined, joiner: J) {\n const isFunction = typeof joiner === 'function';\n if (items !== undefined) {\n let i = -1;\n for (const value of items) {\n if (i > -1) {\n yield isFunction ? joiner(i) : joiner;\n }\n i++;\n yield value;\n }\n }\n}\n"],"names":["join","items","joiner","isFunction","undefined","i","value"],"mappings":";;;;;SA2BiBA,EAAWC,EAAgCC,GAC1D,MAAMC,EAA+B,mBAAXD,EAC1B,QAAcE,IAAVH,EAAqB,CACvB,IAAII,GAAK,EACT,IAAK,MAAMC,KAASL,EACdI,GAAK,UACDF,EAAaD,EAAOG,GAAKH,GAEjCG,UACMC,CAET,CACH"}
|
7
node_modules/lit-html/node/directives/keyed.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/keyed.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import{nothing as r}from"../lit-html.js";import{directive as t,Directive as e}from"../directive.js";import{setCommittedValue as s}from"../directive-helpers.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const i=t(class extends e{constructor(){super(...arguments),this.key=r}render(r,t){return this.key=r,t}update(r,[t,e]){return t!==this.key&&(s(r),this.key=t),e}});export{i as keyed};
|
||||
//# sourceMappingURL=keyed.js.map
|
1
node_modules/lit-html/node/directives/keyed.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/keyed.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"keyed.js","sources":["../../src/directives/keyed.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {nothing} from '../lit-html.js';\nimport {\n directive,\n Directive,\n ChildPart,\n DirectiveParameters,\n} from '../directive.js';\nimport {setCommittedValue} from '../directive-helpers.js';\n\nclass Keyed extends Directive {\n key: unknown = nothing;\n\n render(k: unknown, v: unknown) {\n this.key = k;\n return v;\n }\n\n override update(part: ChildPart, [k, v]: DirectiveParameters<this>) {\n if (k !== this.key) {\n // Clear the part before returning a value. The one-arg form of\n // setCommittedValue sets the value to a sentinel which forces a\n // commit the next render.\n setCommittedValue(part);\n this.key = k;\n }\n return v;\n }\n}\n\n/**\n * Associates a renderable value with a unique key. When the key changes, the\n * previous DOM is removed and disposed before rendering the next value, even\n * if the value - such as a template - is the same.\n *\n * This is useful for forcing re-renders of stateful components, or working\n * with code that expects new data to generate new HTML elements, such as some\n * animation techniques.\n */\nexport const keyed = directive(Keyed);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {Keyed};\n"],"names":["keyed","directive","Directive","constructor","this","key","nothing","render","k","v","update","part","setCommittedValue"],"mappings":";;;;;SA4CaA,EAAQC,EA7BrB,cAAoBC,EAApBC,kCACEC,KAAGC,IAAYC,CAiBhB,CAfCC,OAAOC,EAAYC,GAEjB,OADAL,KAAKC,IAAMG,EACJC,CACR,CAEQC,OAAOC,GAAkBH,EAAGC,IAQnC,OAPID,IAAMJ,KAAKC,MAIbO,EAAkBD,GAClBP,KAAKC,IAAMG,GAENC,CACR"}
|
7
node_modules/lit-html/node/directives/live.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/live.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import{noChange as r,nothing as e}from"../lit-html.js";import{directive as i,Directive as t,PartType as n}from"../directive.js";import{isSingleExpression as o,setCommittedValue as s}from"../directive-helpers.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const l=i(class extends t{constructor(r){if(super(r),r.type!==n.PROPERTY&&r.type!==n.ATTRIBUTE&&r.type!==n.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!o(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(i,[t]){if(t===r||t===e)return t;const o=i.element,l=i.name;if(i.type===n.PROPERTY){if(t===o[l])return r}else if(i.type===n.BOOLEAN_ATTRIBUTE){if(!!t===o.hasAttribute(l))return r}else if(i.type===n.ATTRIBUTE&&o.getAttribute(l)===t+"")return r;return s(i),t}});export{l as live};
|
||||
//# sourceMappingURL=live.js.map
|
1
node_modules/lit-html/node/directives/live.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/live.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"live.js","sources":["../../src/directives/live.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {AttributePart, noChange, nothing} from '../lit-html.js';\nimport {\n directive,\n Directive,\n DirectiveParameters,\n PartInfo,\n PartType,\n} from '../directive.js';\nimport {isSingleExpression, setCommittedValue} from '../directive-helpers.js';\n\nclass LiveDirective extends Directive {\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (\n !(\n partInfo.type === PartType.PROPERTY ||\n partInfo.type === PartType.ATTRIBUTE ||\n partInfo.type === PartType.BOOLEAN_ATTRIBUTE\n )\n ) {\n throw new Error(\n 'The `live` directive is not allowed on child or event bindings'\n );\n }\n if (!isSingleExpression(partInfo)) {\n throw new Error('`live` bindings can only contain a single expression');\n }\n }\n\n render(value: unknown) {\n return value;\n }\n\n override update(part: AttributePart, [value]: DirectiveParameters<this>) {\n if (value === noChange || value === nothing) {\n return value;\n }\n const element = part.element;\n const name = part.name;\n\n if (part.type === PartType.PROPERTY) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (value === (element as any)[name]) {\n return noChange;\n }\n } else if (part.type === PartType.BOOLEAN_ATTRIBUTE) {\n if (!!value === element.hasAttribute(name)) {\n return noChange;\n }\n } else if (part.type === PartType.ATTRIBUTE) {\n if (element.getAttribute(name) === String(value)) {\n return noChange;\n }\n }\n // Resets the part's value, causing its dirty-check to fail so that it\n // always sets the value.\n setCommittedValue(part);\n return value;\n }\n}\n\n/**\n * Checks binding values against live DOM values, instead of previously bound\n * values, when determining whether to update the value.\n *\n * This is useful for cases where the DOM value may change from outside of\n * lit-html, such as with a binding to an `<input>` element's `value` property,\n * a content editable elements text, or to a custom element that changes it's\n * own properties or attributes.\n *\n * In these cases if the DOM value changes, but the value set through lit-html\n * bindings hasn't, lit-html won't know to update the DOM value and will leave\n * it alone. If this is not what you want--if you want to overwrite the DOM\n * value with the bound value no matter what--use the `live()` directive:\n *\n * ```js\n * html`<input .value=${live(x)}>`\n * ```\n *\n * `live()` performs a strict equality check against the live DOM value, and if\n * the new value is equal to the live value, does nothing. This means that\n * `live()` should not be used when the binding will cause a type conversion. If\n * you use `live()` with an attribute binding, make sure that only strings are\n * passed in, or the binding will update every render.\n */\nexport const live = directive(LiveDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {LiveDirective};\n"],"names":["live","directive","Directive","constructor","partInfo","super","type","PartType","PROPERTY","ATTRIBUTE","BOOLEAN_ATTRIBUTE","Error","isSingleExpression","render","value","update","part","noChange","nothing","element","name","hasAttribute","getAttribute","String","setCommittedValue"],"mappings":";;;;;SA2FaA,EAAOC,EA3EpB,cAA4BC,EAC1BC,YAAYC,GAEV,GADAC,MAAMD,GAGFA,EAASE,OAASC,EAASC,UAC3BJ,EAASE,OAASC,EAASE,WAC3BL,EAASE,OAASC,EAASG,kBAG7B,MAAUC,MACR,kEAGJ,IAAKC,EAAmBR,GACtB,MAAUO,MAAM,uDAEnB,CAEDE,OAAOC,GACL,OAAOA,CACR,CAEQC,OAAOC,GAAsBF,IACpC,GAAIA,IAAUG,GAAYH,IAAUI,EAClC,OAAOJ,EAET,MAAMK,EAAUH,EAAKG,QACfC,EAAOJ,EAAKI,KAElB,GAAIJ,EAAKV,OAASC,EAASC,UAEzB,GAAIM,IAAWK,EAAgBC,GAC7B,OAAOH,OAEJ,GAAID,EAAKV,OAASC,EAASG,mBAChC,KAAMI,IAAUK,EAAQE,aAAaD,GACnC,OAAOH,OAEJ,GAAID,EAAKV,OAASC,EAASE,WAC5BU,EAAQG,aAAaF,KAAiBN,EAAPS,GACjC,OAAON,EAMX,OADAO,EAAkBR,GACXF,CACR"}
|
7
node_modules/lit-html/node/directives/map.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/map.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
function*o(o,f){if(void 0!==o){let i=0;for(const t of o)yield f(t,i++)}}export{o as map};
|
||||
//# sourceMappingURL=map.js.map
|
1
node_modules/lit-html/node/directives/map.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/map.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"map.js","sources":["../../src/directives/map.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Returns an iterable containing the result of calling `f(value)` on each\n * value in `items`.\n *\n * @example\n *\n * ```ts\n * render() {\n * return html`\n * <ul>\n * ${map(items, (i) => html`<li>${i}</li>`)}\n * </ul>\n * `;\n * }\n * ```\n */\nexport function* map<T>(\n items: Iterable<T> | undefined,\n f: (value: T, index: number) => unknown\n) {\n if (items !== undefined) {\n let i = 0;\n for (const value of items) {\n yield f(value, i++);\n }\n }\n}\n"],"names":["map","items","f","undefined","i","value"],"mappings":";;;;;SAsBiBA,EACfC,EACAC,GAEA,QAAcC,IAAVF,EAAqB,CACvB,IAAIG,EAAI,EACR,IAAK,MAAMC,KAASJ,QACZC,EAAEG,EAAOD,IAElB,CACH"}
|
7
node_modules/lit-html/node/directives/private-async-helpers.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/private-async-helpers.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const t=async(t,s)=>{for await(const i of t)if(!1===await s(i))return};class s{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class i{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){var t;null!==(t=this.Y)&&void 0!==t||(this.Y=new Promise((t=>this.Z=t)))}resume(){var t;null===(t=this.Z)||void 0===t||t.call(this),this.Y=this.Z=void 0}}export{i as Pauser,s as PseudoWeakRef,t as forAwaitOf};
|
||||
//# sourceMappingURL=private-async-helpers.js.map
|
1
node_modules/lit-html/node/directives/private-async-helpers.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/private-async-helpers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"private-async-helpers.js","sources":["../../src/directives/private-async-helpers.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// Note, this module is not included in package exports so that it's private to\n// our first-party directives. If it ends up being useful, we can open it up and\n// export it.\n\n/**\n * Helper to iterate an AsyncIterable in its own closure.\n * @param iterable The iterable to iterate\n * @param callback The callback to call for each value. If the callback returns\n * `false`, the loop will be broken.\n */\nexport const forAwaitOf = async <T>(\n iterable: AsyncIterable<T>,\n callback: (value: T) => Promise<boolean>\n) => {\n for await (const v of iterable) {\n if ((await callback(v)) === false) {\n return;\n }\n }\n};\n\n/**\n * Holds a reference to an instance that can be disconnected and reconnected,\n * so that a closure over the ref (e.g. in a then function to a promise) does\n * not strongly hold a ref to the instance. Approximates a WeakRef but must\n * be manually connected & disconnected to the backing instance.\n */\nexport class PseudoWeakRef<T> {\n private _ref?: T;\n constructor(ref: T) {\n this._ref = ref;\n }\n /**\n * Disassociates the ref with the backing instance.\n */\n disconnect() {\n this._ref = undefined;\n }\n /**\n * Reassociates the ref with the backing instance.\n */\n reconnect(ref: T) {\n this._ref = ref;\n }\n /**\n * Retrieves the backing instance (will be undefined when disconnected)\n */\n deref() {\n return this._ref;\n }\n}\n\n/**\n * A helper to pause and resume waiting on a condition in an async function\n */\nexport class Pauser {\n private _promise?: Promise<void> = undefined;\n private _resolve?: () => void = undefined;\n /**\n * When paused, returns a promise to be awaited; when unpaused, returns\n * undefined. Note that in the microtask between the pauser being resumed\n * an an await of this promise resolving, the pauser could be paused again,\n * hence callers should check the promise in a loop when awaiting.\n * @returns A promise to be awaited when paused or undefined\n */\n get() {\n return this._promise;\n }\n /**\n * Creates a promise to be awaited\n */\n pause() {\n this._promise ??= new Promise((resolve) => (this._resolve = resolve));\n }\n /**\n * Resolves the promise which may be awaited\n */\n resume() {\n this._resolve?.();\n this._promise = this._resolve = undefined;\n }\n}\n"],"names":["forAwaitOf","async","iterable","callback","v","PseudoWeakRef","constructor","ref","this","_ref","disconnect","undefined","reconnect","deref","Pauser","_promise","_resolve","get","pause","_a","Promise","resolve","resume","call"],"mappings":";;;;;AAgBa,MAAAA,EAAaC,MACxBC,EACAC,KAEA,UAAW,MAAMC,KAAKF,EACpB,IAA4B,UAAjBC,EAASC,GAClB,MAEH,QASUC,EAEXC,YAAYC,GACVC,KAAKC,EAAOF,CACb,CAIDG,aACEF,KAAKC,OAAOE,CACb,CAIDC,UAAUL,GACRC,KAAKC,EAAOF,CACb,CAIDM,QACE,OAAOL,KAAKC,CACb,QAMUK,EAAbR,cACUE,KAAQO,OAAmBJ,EAC3BH,KAAQQ,OAAgBL,CAwBjC,CAhBCM,MACE,OAAOT,KAAKO,CACb,CAIDG,cACE,QAAAC,EAAAX,KAAKO,SAAL,IAAAI,IAAAX,KAAKO,EAAa,IAAIK,SAASC,GAAab,KAAKQ,EAAWK,IAC7D,CAIDC,eACe,QAAbH,EAAAX,KAAKQ,SAAQ,IAAAG,GAAAA,EAAAI,KAAAf,MACbA,KAAKO,EAAWP,KAAKQ,OAAWL,CACjC"}
|
7
node_modules/lit-html/node/directives/range.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/range.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
function*o(o,l,n=1){const t=void 0===l?0:o;null!=l||(l=o);for(let o=t;n>0?o<l:l<o;o+=n)yield o}export{o as range};
|
||||
//# sourceMappingURL=range.js.map
|
1
node_modules/lit-html/node/directives/range.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/range.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"range.js","sources":["../../src/directives/range.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Returns an iterable of integers from `start` to `end` (exclusive)\n * incrementing by `step`.\n *\n * If `start` is omitted, the range starts at `0`. `step` defaults to `1`.\n *\n * @example\n *\n * ```ts\n * render() {\n * return html`\n * ${map(range(8), () => html`<div class=\"cell\"></div>`)}\n * `;\n * }\n * ```\n */\nexport function range(end: number): Iterable<number>;\nexport function range(\n start: number,\n end: number,\n step?: number\n): Iterable<number>;\nexport function* range(startOrEnd: number, end?: number, step = 1) {\n const start = end === undefined ? 0 : startOrEnd;\n end ??= startOrEnd;\n for (let i = start; step > 0 ? i < end : end < i; i += step) {\n yield i;\n }\n}\n"],"names":["range","startOrEnd","end","step","start","undefined","i"],"mappings":";;;;;AA4BM,SAAWA,EAAMC,EAAoBC,EAAcC,EAAO,GAC9D,MAAMC,OAAgBC,IAARH,EAAoB,EAAID,EACtCC,UAAAA,EAAQD,GACR,IAAK,IAAIK,EAAIF,EAAOD,EAAO,EAAIG,EAAIJ,EAAMA,EAAMI,EAAGA,GAAKH,QAC/CG,CAEV"}
|
7
node_modules/lit-html/node/directives/ref.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/ref.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import{nothing as i}from"../lit-html.js";import{AsyncDirective as t}from"../async-directive.js";import{directive as s}from"../directive.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const e=()=>new o;class o{}const h=new WeakMap,n=s(class extends t{render(t){return i}update(t,[s]){var e;const o=s!==this.G;return o&&void 0!==this.G&&this.ot(void 0),(o||this.rt!==this.lt)&&(this.G=s,this.dt=null===(e=t.options)||void 0===e?void 0:e.host,this.ot(this.lt=t.element)),i}ot(i){var t;if("function"==typeof this.G){const s=null!==(t=this.dt)&&void 0!==t?t:globalThis;let e=h.get(s);void 0===e&&(e=new WeakMap,h.set(s,e)),void 0!==e.get(this.G)&&this.G.call(this.dt,void 0),e.set(this.G,i),void 0!==i&&this.G.call(this.dt,i)}else this.G.value=i}get rt(){var i,t,s;return"function"==typeof this.G?null===(t=h.get(null!==(i=this.dt)&&void 0!==i?i:globalThis))||void 0===t?void 0:t.get(this.G):null===(s=this.G)||void 0===s?void 0:s.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});export{e as createRef,n as ref};
|
||||
//# sourceMappingURL=ref.js.map
|
1
node_modules/lit-html/node/directives/ref.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/ref.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
8
node_modules/lit-html/node/directives/repeat.js
generated
vendored
Normal file
8
node_modules/lit-html/node/directives/repeat.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import{noChange as e}from"../lit-html.js";import{directive as s,Directive as t,PartType as r}from"../directive.js";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from"../directive-helpers.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error("repeat() can only be used in text expressions")}ct(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.ct(e,s,t).values}update(s,[t,r,c]){var d;const a=l(s),{values:p,keys:v}=this.ct(t,r,c);if(!Array.isArray(a))return this.ut=v,p;const h=null!==(d=this.ut)&&void 0!==d?d:this.ut=[],m=[];let y,x,j=0,k=a.length-1,w=0,A=p.length-1;for(;j<=k&&w<=A;)if(null===a[j])j++;else if(null===a[k])k--;else if(h[j]===v[w])m[w]=o(a[j],p[w]),j++,w++;else if(h[k]===v[A])m[A]=o(a[k],p[A]),k--,A--;else if(h[j]===v[A])m[A]=o(a[j],p[A]),i(s,m[A+1],a[j]),j++,A--;else if(h[k]===v[w])m[w]=o(a[k],p[w]),i(s,a[j],a[k]),k--,w++;else if(void 0===y&&(y=u(v,w,A),x=u(h,j,k)),y.has(h[j]))if(y.has(h[k])){const e=x.get(v[w]),t=void 0!==e?a[e]:null;if(null===t){const e=i(s,a[j]);o(e,p[w]),m[w]=e}else m[w]=o(t,p[w]),i(s,a[j],t),a[e]=null;w++}else n(a[k]),k--;else n(a[j]),j++;for(;w<=A;){const e=i(s,m[A+1]);o(e,p[w]),m[w++]=e}for(;j<=k;){const e=a[j++];null!==e&&n(e)}return this.ut=v,f(s,m),e}});export{c as repeat};
|
||||
//# sourceMappingURL=repeat.js.map
|
1
node_modules/lit-html/node/directives/repeat.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/repeat.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/lit-html/node/directives/style-map.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/style-map.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import{noChange as t}from"../lit-html.js";import{directive as e,Directive as r,PartType as s}from"../directive.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const i="important",n=" !"+i,o=e(class extends r{constructor(t){var e;if(super(t),t.type!==s.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ht){this.ht=new Set;for(const t in r)this.ht.add(t);return this.render(r)}this.ht.forEach((t=>{null==r[t]&&(this.ht.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")}));for(const t in r){const e=r[t];if(null!=e){this.ht.add(t);const r="string"==typeof e&&e.endsWith(n);t.includes("-")||r?s.setProperty(t,r?e.slice(0,-11):e,r?i:""):s[t]=e}}return t}});export{o as styleMap};
|
||||
//# sourceMappingURL=style-map.js.map
|
1
node_modules/lit-html/node/directives/style-map.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/style-map.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/lit-html/node/directives/template-content.js
generated
vendored
Normal file
7
node_modules/lit-html/node/directives/template-content.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import{noChange as t}from"../lit-html.js";import{directive as r,Directive as e,PartType as n}from"../directive.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const o=r(class extends e{constructor(t){if(super(t),t.type!==n.CHILD)throw Error("templateContent can only be used in child bindings")}render(r){return this.vt===r?t:(this.vt=r,document.importNode(r.content,!0))}});export{o as templateContent};
|
||||
//# sourceMappingURL=template-content.js.map
|
1
node_modules/lit-html/node/directives/template-content.js.map
generated
vendored
Normal file
1
node_modules/lit-html/node/directives/template-content.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"template-content.js","sources":["../../src/directives/template-content.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {noChange} from '../lit-html.js';\nimport {directive, Directive, PartInfo, PartType} from '../directive.js';\n\nclass TemplateContentDirective extends Directive {\n private _previousTemplate?: HTMLTemplateElement;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.CHILD) {\n throw new Error('templateContent can only be used in child bindings');\n }\n }\n\n render(template: HTMLTemplateElement) {\n if (this._previousTemplate === template) {\n return noChange;\n }\n this._previousTemplate = template;\n return document.importNode(template.content, true);\n }\n}\n\n/**\n * Renders the content of a template element as HTML.\n *\n * Note, the template should be developer controlled and not user controlled.\n * Rendering a user-controlled template with this directive\n * could lead to cross-site-scripting vulnerabilities.\n */\nexport const templateContent = directive(TemplateContentDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {TemplateContentDirective};\n"],"names":["templateContent","directive","Directive","constructor","partInfo","super","type","PartType","CHILD","Error","render","template","this","_previousTemplate","noChange","document","importNode","content"],"mappings":";;;;;SAmCaA,EAAkBC,EA1B/B,cAAuCC,EAGrCC,YAAYC,GAEV,GADAC,MAAMD,GACFA,EAASE,OAASC,EAASC,MAC7B,MAAUC,MAAM,qDAEnB,CAEDC,OAAOC,GACL,OAAIC,KAAKC,KAAsBF,EACtBG,GAETF,KAAKC,GAAoBF,EAClBI,SAASC,WAAWL,EAASM,SAAS,GAC9C"}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user