@microsoft/fast-element
Advanced tools
Comparing version 2.0.0-beta.1 to 2.0.0-beta.2
@@ -5,2 +5,53 @@ { | ||
{ | ||
"date": "Wed, 15 Jun 2022 17:41:10 GMT", | ||
"tag": "@microsoft/fast-element_v2.0.0-beta.2", | ||
"version": "2.0.0-beta.2", | ||
"comments": { | ||
"prerelease": [ | ||
{ | ||
"comment": "doc: add note to FASTElement.metadata API", | ||
"author": "roeisenb@microsoft.com", | ||
"commit": "359467f9ae67c46a33dfc28ce86dfd908072695d", | ||
"package": "@microsoft/fast-element" | ||
}, | ||
{ | ||
"comment": "when recycle is set to false while itemBinding stays the same, views should be recreated", | ||
"author": "wendy.hsu@microsoft.com", | ||
"commit": "9c92b9bb5bc9bf221b439c0a776b3621fdd9d9aa", | ||
"package": "@microsoft/fast-element" | ||
}, | ||
{ | ||
"comment": "feat: simplify execution context to align closer with v1", | ||
"author": "roeisenb@microsoft.com", | ||
"commit": "488d051999c43b93a0beef4db30a2bddd6bbdc64", | ||
"package": "@microsoft/fast-element" | ||
}, | ||
{ | ||
"comment": "feat: ergo improvements to context, array length, and metadata", | ||
"author": "roeisenb@microsoft.com", | ||
"commit": "12f5671e215ebd2b95c9cc83f856e233e01e9c4a", | ||
"package": "@microsoft/fast-element" | ||
}, | ||
{ | ||
"comment": "feat: move optional bindings out of rollup and list as exports", | ||
"author": "roeisenb@microsoft.com", | ||
"commit": "e86a638b9e84cbf36d950025889742944e68e512", | ||
"package": "@microsoft/fast-element" | ||
}, | ||
{ | ||
"comment": "fix: make SyntheticViewTemplate type a string so it is generally usable", | ||
"author": "roeisenb@microsoft.com", | ||
"commit": "de7f234ef871204fcac2b5df59433d919809341d", | ||
"package": "@microsoft/fast-element" | ||
}, | ||
{ | ||
"comment": "feat: implement W3C WC community context protocol and integrate with DI", | ||
"author": "roeisenb@microsoft.com", | ||
"commit": "c45297c0ca48b7e5f4343ba48e5183f2bccdb946", | ||
"package": "@microsoft/fast-element" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Wed, 01 Jun 2022 17:53:14 GMT", | ||
@@ -7,0 +58,0 @@ "tag": "@microsoft/fast-element_v2.0.0-beta.1", |
# Change Log - @microsoft/fast-element | ||
This log was last generated on Wed, 01 Jun 2022 17:53:14 GMT and should not be manually modified. | ||
This log was last generated on Wed, 15 Jun 2022 17:41:10 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## 2.0.0-beta.2 | ||
Wed, 15 Jun 2022 17:41:10 GMT | ||
### Changes | ||
- doc: add note to FASTElement.metadata API (roeisenb@microsoft.com) | ||
- when recycle is set to false while itemBinding stays the same, views should be recreated (wendy.hsu@microsoft.com) | ||
- feat: simplify execution context to align closer with v1 (roeisenb@microsoft.com) | ||
- feat: ergo improvements to context, array length, and metadata (roeisenb@microsoft.com) | ||
- feat: move optional bindings out of rollup and list as exports (roeisenb@microsoft.com) | ||
- fix: make SyntheticViewTemplate type a string so it is generally usable (roeisenb@microsoft.com) | ||
- feat: implement W3C WC community context protocol and integrate with DI (roeisenb@microsoft.com) | ||
## 2.0.0-beta.1 | ||
@@ -8,0 +22,0 @@ |
@@ -91,2 +91,4 @@ import { Constructable } from "../interfaces.js"; | ||
* @param registry - The element registry to define the element in. | ||
* @remarks | ||
* This operation is idempotent per registry. | ||
*/ | ||
@@ -93,0 +95,0 @@ define(registry?: CustomElementRegistry): this; |
import type { Constructable } from "../interfaces.js"; | ||
import { Controller } from "./controller.js"; | ||
import { PartialFASTElementDefinition } from "./fast-definitions.js"; | ||
import { FASTElementDefinition, PartialFASTElementDefinition } from "./fast-definitions.js"; | ||
/** | ||
@@ -70,2 +70,8 @@ * Represents a custom element based on the FASTElement infrastructure. | ||
define<TType extends Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType; | ||
/** | ||
* Defines metadata for a FASTElement which can be used to later define the element. | ||
* IMPORTANT: This API will be renamed to "compose" in a future beta. | ||
* @public | ||
*/ | ||
metadata<TType_1 extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType_1, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType_1>; | ||
}; | ||
@@ -72,0 +78,0 @@ /** |
@@ -207,2 +207,2 @@ import { Subscriber, SubscriberSet } from "./notifier.js"; | ||
*/ | ||
export declare function length<T>(array: readonly T[]): number; | ||
export declare function lengthOf<T>(array: readonly T[]): number; |
@@ -1,2 +0,2 @@ | ||
import type { ExecutionContext, RootContext } from "./observable.js"; | ||
import type { ExecutionContext } from "./observable.js"; | ||
/** | ||
@@ -7,3 +7,3 @@ * Represents an object that can contribute behavior to a view or | ||
*/ | ||
export interface Behavior<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = RootContext> { | ||
export interface Behavior<TSource = any, TParent = any> { | ||
/** | ||
@@ -14,3 +14,3 @@ * Bind this behavior to the source. | ||
*/ | ||
bind(source: TSource, context: TContext): void; | ||
bind(source: TSource, context: ExecutionContext<TParent>): void; | ||
/** | ||
@@ -20,3 +20,3 @@ * Unbinds this behavior from the source. | ||
*/ | ||
unbind(source: TSource, context: TContext): void; | ||
unbind(source: TSource, context: ExecutionContext<TParent>): void; | ||
} |
@@ -29,3 +29,3 @@ import { Disposable } from "../interfaces.js"; | ||
*/ | ||
export declare type Binding<TSource = any, TReturn = any, TContext extends ExecutionContext = ExecutionContext> = (source: TSource, context: TContext) => TReturn; | ||
export declare type Binding<TSource = any, TReturn = any, TParent = any> = (source: TSource, context: ExecutionContext<TParent>) => TReturn; | ||
/** | ||
@@ -124,3 +124,3 @@ * A record of observable property access. | ||
*/ | ||
binding<TSource = any, TReturn = any>(binding: Binding<TSource, TReturn, ExecutionContext<any>>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): BindingObserver<TSource, TReturn, any>; | ||
binding<TSource = any, TReturn = any>(binding: Binding<TSource, TReturn, any>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): BindingObserver<TSource, TReturn, any>; | ||
/** | ||
@@ -131,3 +131,3 @@ * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated | ||
*/ | ||
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(binding: Binding<TSource_1, TReturn_1, ExecutionContext<any>>): boolean; | ||
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(binding: Binding<TSource_1, TReturn_1, any>): boolean; | ||
}>; | ||
@@ -153,28 +153,16 @@ /** | ||
*/ | ||
export interface RootContext { | ||
export declare class ExecutionContext<TParentSource = any> { | ||
/** | ||
* The current event within an event handler. | ||
* The default execution context. | ||
*/ | ||
readonly event: Event; | ||
static readonly default: ExecutionContext<any>; | ||
/** | ||
* Returns the typed event detail of a custom event. | ||
* The index of the current item within a repeat context. | ||
*/ | ||
eventDetail<TDetail = any>(): TDetail; | ||
index: number; | ||
/** | ||
* Returns the typed event target of the event. | ||
* The length of the current collection within a repeat context. | ||
*/ | ||
eventTarget<TTarget extends EventTarget = EventTarget>(): TTarget; | ||
length: number; | ||
/** | ||
* Creates a new execution context descendent from the current context. | ||
* @param source - The source for the context if different than the parent. | ||
* @returns A child execution context. | ||
*/ | ||
createChildContext<TParentSource>(source: TParentSource): ChildContext<TParentSource>; | ||
} | ||
/** | ||
* Provides additional contextual information when inside a child template. | ||
* @public | ||
*/ | ||
export interface ChildContext<TParentSource = any> extends RootContext { | ||
/** | ||
* The parent data source within a nested context. | ||
@@ -186,29 +174,13 @@ */ | ||
*/ | ||
readonly parentContext: ChildContext<TParentSource>; | ||
readonly parentContext: ExecutionContext<TParentSource>; | ||
private constructor(); | ||
/** | ||
* Creates a new execution context descent suitable for use in list rendering. | ||
* @param item - The list item to serve as the source. | ||
* @param index - The index of the item in the list. | ||
* @param length - The length of the list. | ||
* The current event within an event handler. | ||
*/ | ||
createItemContext(index: number, length: number): ItemContext<TParentSource>; | ||
} | ||
/** | ||
* Provides additional contextual information when inside a repeat item template.s | ||
* @public | ||
*/ | ||
export interface ItemContext<TParentSource = any> extends ChildContext<TParentSource> { | ||
get event(): Event; | ||
/** | ||
* The index of the current item within a repeat context. | ||
*/ | ||
readonly index: number; | ||
/** | ||
* The length of the current collection within a repeat context. | ||
*/ | ||
readonly length: number; | ||
/** | ||
* Indicates whether the current item within a repeat context | ||
* has an even index. | ||
*/ | ||
readonly isEven: boolean; | ||
get isEven(): boolean; | ||
/** | ||
@@ -218,3 +190,3 @@ * Indicates whether the current item within a repeat context | ||
*/ | ||
readonly isOdd: boolean; | ||
get isOdd(): boolean; | ||
/** | ||
@@ -224,3 +196,3 @@ * Indicates whether the current item within a repeat context | ||
*/ | ||
readonly isFirst: boolean; | ||
get isFirst(): boolean; | ||
/** | ||
@@ -230,3 +202,3 @@ * Indicates whether the current item within a repeat context | ||
*/ | ||
readonly isInMiddle: boolean; | ||
get isInMiddle(): boolean; | ||
/** | ||
@@ -236,4 +208,12 @@ * Indicates whether the current item within a repeat context | ||
*/ | ||
readonly isLast: boolean; | ||
get isLast(): boolean; | ||
/** | ||
* Returns the typed event detail of a custom event. | ||
*/ | ||
eventDetail<TDetail>(): TDetail; | ||
/** | ||
* Returns the typed event target of the event. | ||
*/ | ||
eventTarget<TTarget extends EventTarget>(): TTarget; | ||
/** | ||
* Updates the position/size on a context associated with a list item. | ||
@@ -244,10 +224,16 @@ * @param index - The new index of the item. | ||
updatePosition(index: number, length: number): void; | ||
} | ||
/** | ||
* The common execution context APIs. | ||
* @public | ||
*/ | ||
export declare const ExecutionContext: Readonly<{ | ||
default: RootContext; | ||
/** | ||
* Creates a new execution context descendent from the current context. | ||
* @param source - The source for the context if different than the parent. | ||
* @returns A child execution context. | ||
*/ | ||
createChildContext<TParentSource>(parentSource: TParentSource): ExecutionContext<TParentSource>; | ||
/** | ||
* Creates a new execution context descent suitable for use in list rendering. | ||
* @param item - The list item to serve as the source. | ||
* @param index - The index of the item in the list. | ||
* @param length - The length of the list. | ||
*/ | ||
createItemContext(index: number, length: number): ExecutionContext<TParentSource>; | ||
/** | ||
* Sets the event for the current execution context. | ||
@@ -257,3 +243,3 @@ * @param event - The event to set. | ||
*/ | ||
setEvent(event: Event | null): void; | ||
static setEvent(event: Event | null): void; | ||
/** | ||
@@ -263,8 +249,3 @@ * Creates a new root execution context. | ||
*/ | ||
create(): RootContext; | ||
}>; | ||
/** | ||
* Represents some sort of execution context. | ||
* @public | ||
*/ | ||
export declare type ExecutionContext<TParentSource = any> = RootContext | ChildContext<TParentSource> | ItemContext<TParentSource>; | ||
static create(): ExecutionContext; | ||
} |
@@ -122,30 +122,2 @@ import { Binding, BindingObserver, ExecutionContext } from "../observation/observable.js"; | ||
/** | ||
* A binding behavior for signal bindings. | ||
* @public | ||
*/ | ||
export declare class SignalBinding extends UpdateBinding { | ||
private handlerProperty; | ||
/** | ||
* Bind this behavior to the source. | ||
* @param source - The source to bind to. | ||
* @param context - The execution context that the binding is operating within. | ||
* @param targets - The targets that behaviors in a view can attach to. | ||
*/ | ||
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void; | ||
/** | ||
* Unbinds this behavior from the source. | ||
* @param source - The source to unbind from. | ||
* @param context - The execution context that the binding is operating within. | ||
* @param targets - The targets that behaviors in a view can attach to. | ||
*/ | ||
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void; | ||
private getSignal; | ||
/** | ||
* Sends the specified signal to signaled bindings. | ||
* @param signal - The signal to send. | ||
* @public | ||
*/ | ||
static send(signal: string): void; | ||
} | ||
/** | ||
* A binding behavior for bindings that change. | ||
@@ -224,42 +196,2 @@ * @public | ||
/** | ||
* The settings required to enable two-way binding. | ||
* @public | ||
*/ | ||
export interface TwoWaySettings { | ||
/** | ||
* Determines which event to listen to, to detect changes in the view. | ||
* @param directive - The directive to determine the change event for. | ||
* @param target - The target element to determine the change event for. | ||
*/ | ||
determineChangeEvent(directive: HTMLBindingDirective, target: HTMLElement): string; | ||
} | ||
/** | ||
* A binding behavior for bindings that update in two directions. | ||
* @public | ||
*/ | ||
export declare class TwoWayBinding extends ChangeBinding { | ||
private changeEvent; | ||
/** | ||
* Bind this behavior to the source. | ||
* @param source - The source to bind to. | ||
* @param context - The execution context that the binding is operating within. | ||
* @param targets - The targets that behaviors in a view can attach to. | ||
*/ | ||
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void; | ||
/** | ||
* Unbinds this behavior from the source. | ||
* @param source - The source to unbind from. | ||
* @param context - The execution context that the binding is operating within. | ||
* @param targets - The targets that behaviors in a view can attach to. | ||
*/ | ||
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void; | ||
/** @internal */ | ||
handleEvent(event: Event): void; | ||
/** | ||
* Configures two-way binding. | ||
* @param settings - The settings to use for the two-way binding system. | ||
*/ | ||
static configure(settings: TwoWaySettings): void; | ||
} | ||
/** | ||
* The default binding options. | ||
@@ -275,15 +207,2 @@ * @public | ||
/** | ||
* The default twoWay binding options. | ||
* @public | ||
*/ | ||
export declare type DefaultTwoWayBindingOptions = DefaultBindingOptions & { | ||
changeEvent?: string; | ||
fromView?: (value: any) => any; | ||
}; | ||
/** | ||
* The default twoWay binding configuration. | ||
* @public | ||
*/ | ||
export declare const twoWay: BindingConfig<DefaultTwoWayBindingOptions> & BindingConfigResolver<DefaultTwoWayBindingOptions>; | ||
/** | ||
* The default onTime binding configuration. | ||
@@ -294,9 +213,2 @@ * @public | ||
/** | ||
* Creates a signal binding configuration with the supplied options. | ||
* @param options - The signal name or a binding to use to retrieve the signal name. | ||
* @returns A binding configuration. | ||
* @public | ||
*/ | ||
export declare const signal: <T = any>(options: string | Binding<T, any, ExecutionContext<any>>) => BindingConfig<string | Binding<T, any, ExecutionContext<any>>>; | ||
/** | ||
* A directive that applies bindings. | ||
@@ -303,0 +215,0 @@ * @public |
import { TrustedTypesPolicy } from "../interfaces.js"; | ||
import type { ExecutionContext } from "../observation/observable.js"; | ||
import { ViewBehaviorFactory } from "./html-directive.js"; | ||
@@ -43,3 +42,3 @@ import type { HTMLTemplateCompilationResult as TemplateCompilationResult } from "./template.js"; | ||
*/ | ||
compile<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): TemplateCompilationResult<TSource, TParent, TContext>; | ||
compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): TemplateCompilationResult<TSource, TParent>; | ||
/** | ||
@@ -46,0 +45,0 @@ * Sets the default compilation strategy that will be used by the ViewTemplate whenever |
import type { Behavior } from "../observation/behavior.js"; | ||
import type { Subscriber } from "../observation/notifier.js"; | ||
import { Binding, ChildContext, ExecutionContext, ItemContext, RootContext } from "../observation/observable.js"; | ||
import { Binding, ExecutionContext } from "../observation/observable.js"; | ||
import { Splice } from "../observation/arrays.js"; | ||
import { AddViewBehaviorFactory, HTMLDirective, ViewBehaviorFactory, ViewBehaviorTargets } from "./html-directive.js"; | ||
import type { CaptureType, ChildViewTemplate, ItemViewTemplate, SyntheticViewTemplate, ViewTemplate } from "./template.js"; | ||
import type { CaptureType, SyntheticViewTemplate, ViewTemplate } from "./template.js"; | ||
/** | ||
@@ -116,48 +116,2 @@ * Options for configuring repeat behavior. | ||
*/ | ||
export declare function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ViewTemplate | Binding<TSource, ViewTemplate, RootContext>, options?: { | ||
positioning: false; | ||
} | { | ||
recycle: true; | ||
} | { | ||
positioning: false; | ||
recycle: false; | ||
} | { | ||
positioning: false; | ||
recycle: true; | ||
}): CaptureType<TSource>; | ||
/** | ||
* A directive that enables list rendering. | ||
* @param itemsBinding - The array to render. | ||
* @param templateOrTemplateBinding - The template or a template binding used obtain a template | ||
* to render for each item in the array. | ||
* @param options - Options used to turn on special repeat features. | ||
* @public | ||
*/ | ||
export declare function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ChildViewTemplate | Binding<TSource, ChildViewTemplate, ChildContext>, options?: { | ||
positioning: false; | ||
} | { | ||
recycle: true; | ||
} | { | ||
positioning: false; | ||
recycle: false; | ||
} | { | ||
positioning: false; | ||
recycle: true; | ||
}): CaptureType<TSource>; | ||
/** | ||
* A directive that enables list rendering. | ||
* @param itemsBinding - The array to render. | ||
* @param templateOrTemplateBinding - The template or a template binding used obtain a template | ||
* to render for each item in the array. | ||
* @param options - Options used to turn on special repeat features. | ||
* @public | ||
*/ | ||
export declare function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ItemViewTemplate | Binding<TSource, ItemViewTemplate, ItemContext>, options: { | ||
positioning: true; | ||
} | { | ||
positioning: true; | ||
recycle: true; | ||
} | { | ||
positioning: true; | ||
recycle: false; | ||
}): CaptureType<TSource>; | ||
export declare function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ViewTemplate | Binding<TSource, ViewTemplate>, options?: RepeatOptions): CaptureType<TSource>; |
@@ -1,2 +0,2 @@ | ||
import { Binding, ChildContext, ExecutionContext, ItemContext } from "../observation/observable.js"; | ||
import { Binding, ExecutionContext } from "../observation/observable.js"; | ||
import { HTMLDirective, ViewBehaviorFactory } from "./html-directive.js"; | ||
@@ -9,3 +9,2 @@ import type { ElementView, HTMLView, SyntheticView } from "./view.js"; | ||
export interface ElementViewTemplate<TSource = any, TParent = any> { | ||
type: "element"; | ||
/** | ||
@@ -29,36 +28,13 @@ * Creates an ElementView instance based on this template definition. | ||
*/ | ||
export interface SyntheticViewTemplate<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> { | ||
type: "synthetic"; | ||
export interface SyntheticViewTemplate<TSource = any, TParent = any> { | ||
/** | ||
* Creates a SyntheticView instance based on this template definition. | ||
*/ | ||
create(): SyntheticView<TSource, TParent, TContext>; | ||
create(): SyntheticView<TSource, TParent>; | ||
} | ||
/** | ||
* A template capable of rendering child views not specifically connected to custom elements. | ||
* @public | ||
*/ | ||
export interface ChildViewTemplate<TSource = any, TParent = any> { | ||
type: "child"; | ||
/** | ||
* Creates a SyntheticView instance based on this template definition. | ||
*/ | ||
create(): SyntheticView<TSource, TParent, ChildContext<TParent>>; | ||
} | ||
/** | ||
* A template capable of rendering item views not specifically connected to custom elements. | ||
* @public | ||
*/ | ||
export interface ItemViewTemplate<TSource = any, TParent = any> { | ||
type: "item"; | ||
/** | ||
* Creates a SyntheticView instance based on this template definition. | ||
*/ | ||
create(): SyntheticView<TSource, TParent, ItemContext<TParent>>; | ||
} | ||
/** | ||
* The result of a template compilation operation. | ||
* @public | ||
*/ | ||
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> { | ||
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> { | ||
/** | ||
@@ -68,3 +44,3 @@ * Creates a view instance. | ||
*/ | ||
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent, TContext>; | ||
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent>; | ||
} | ||
@@ -75,10 +51,5 @@ /** | ||
*/ | ||
export declare class ViewTemplate<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent, TContext> { | ||
export declare class ViewTemplate<TSource = any, TParent = any> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent> { | ||
private result; | ||
/** | ||
* Used for TypeScript purposes only. | ||
* Do not use. | ||
*/ | ||
type: any; | ||
/** | ||
* The html representing what this template will | ||
@@ -102,3 +73,3 @@ * instantiate, including placeholders for directives. | ||
*/ | ||
create(hostBindingTarget?: Element): HTMLView<TSource, TParent, TContext>; | ||
create(hostBindingTarget?: Element): HTMLView<TSource, TParent>; | ||
/** | ||
@@ -111,3 +82,3 @@ * Creates an HTMLView from this template, binds it to the source, and then appends it to the host. | ||
*/ | ||
render(source: TSource, host: Node, hostBindingTarget?: Element, context?: TContext): HTMLView<TSource, TParent, TContext>; | ||
render(source: TSource, host: Node, hostBindingTarget?: Element, context?: ExecutionContext): HTMLView<TSource, TParent>; | ||
} | ||
@@ -125,3 +96,3 @@ /** | ||
*/ | ||
export declare type TemplateValue<TSource, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> = Binding<TSource, any, TContext> | HTMLDirective | CaptureType<TSource>; | ||
export declare type TemplateValue<TSource, TParent = any> = Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource>; | ||
/** | ||
@@ -136,22 +107,2 @@ * Transforms a template literal string into a ViewTemplate. | ||
*/ | ||
export declare function html<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent, TContext>[]): ViewTemplate<TSource, TParent>; | ||
/** | ||
* Transforms a template literal string into a ChildViewTemplate. | ||
* @param strings - The string fragments that are interpolated with the values. | ||
* @param values - The values that are interpolated with the string fragments. | ||
* @remarks | ||
* The html helper supports interpolation of strings, numbers, binding expressions, | ||
* other template instances, and Directive instances. | ||
* @public | ||
*/ | ||
export declare const child: <TChild = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TChild, TParent, ChildContext<TParent>>[]) => ChildViewTemplate<TChild, TParent>; | ||
/** | ||
* Transforms a template literal string into an ItemViewTemplate. | ||
* @param strings - The string fragments that are interpolated with the values. | ||
* @param values - The values that are interpolated with the string fragments. | ||
* @remarks | ||
* The html helper supports interpolation of strings, numbers, binding expressions, | ||
* other template instances, and Directive instances. | ||
* @public | ||
*/ | ||
export declare const item: <TItem = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TItem, TParent, ItemContext<TParent>>[]) => ItemViewTemplate<TItem, TParent>; | ||
export declare function html<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]): ViewTemplate<TSource, TParent>; |
import type { Disposable } from "../interfaces.js"; | ||
import type { ExecutionContext, RootContext } from "../observation/observable.js"; | ||
import type { ExecutionContext } from "../observation/observable.js"; | ||
import type { ViewBehaviorFactory, ViewBehaviorTargets } from "./html-directive.js"; | ||
@@ -8,7 +8,7 @@ /** | ||
*/ | ||
export interface View<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> extends Disposable { | ||
export interface View<TSource = any, TParent = any> extends Disposable { | ||
/** | ||
* The execution context the view is running within. | ||
*/ | ||
readonly context: TContext | null; | ||
readonly context: ExecutionContext<TParent> | null; | ||
/** | ||
@@ -23,3 +23,3 @@ * The data that the view is bound to. | ||
*/ | ||
bind(source: TSource, context: TContext): void; | ||
bind(source: TSource, context: ExecutionContext<TParent>): void; | ||
/** | ||
@@ -34,3 +34,3 @@ * Unbinds a view's behaviors from its binding source and context. | ||
*/ | ||
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent, RootContext> { | ||
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent> { | ||
/** | ||
@@ -46,3 +46,3 @@ * Appends the view's DOM nodes to the referenced node. | ||
*/ | ||
export interface SyntheticView<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> extends View<TSource, TParent, TContext> { | ||
export interface SyntheticView<TSource = any, TParent = any> extends View<TSource, TParent> { | ||
/** | ||
@@ -71,3 +71,3 @@ * The first DOM node in the range of nodes that make up the view. | ||
*/ | ||
export declare class HTMLView<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent, TContext> { | ||
export declare class HTMLView<TSource = any, TParent = any> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent> { | ||
private fragment; | ||
@@ -84,3 +84,3 @@ private factories; | ||
*/ | ||
context: TContext | null; | ||
context: ExecutionContext<TParent> | null; | ||
/** | ||
@@ -125,3 +125,3 @@ * The first DOM node in the range of nodes that make up the view. | ||
*/ | ||
bind(source: TSource, context: TContext): void; | ||
bind(source: TSource, context: ExecutionContext<TParent>): void; | ||
/** | ||
@@ -128,0 +128,0 @@ * Unbinds a view's behaviors from its binding source. |
@@ -69,2 +69,4 @@ import { isString } from "../interfaces.js"; | ||
* @param registry - The element registry to define the element in. | ||
* @remarks | ||
* This operation is idempotent per registry. | ||
*/ | ||
@@ -71,0 +73,0 @@ define(registry = customElements) { |
@@ -46,4 +46,12 @@ import { Controller } from "./controller.js"; | ||
define(type, nameOrDef) { | ||
return new FASTElementDefinition(type, nameOrDef).define().type; | ||
return this.metadata(type, nameOrDef).define().type; | ||
}, | ||
/** | ||
* Defines metadata for a FASTElement which can be used to later define the element. | ||
* IMPORTANT: This API will be renamed to "compose" in a future beta. | ||
* @public | ||
*/ | ||
metadata(type, nameOrDef) { | ||
return new FASTElementDefinition(type, nameOrDef); | ||
}, | ||
}); | ||
@@ -59,4 +67,4 @@ /** | ||
return function (type) { | ||
new FASTElementDefinition(type, nameOrDef).define(); | ||
FASTElement.define(type, nameOrDef); | ||
}; | ||
} |
@@ -258,3 +258,3 @@ import { emptyArray } from "../platform.js"; | ||
*/ | ||
export function length(array) { | ||
export function lengthOf(array) { | ||
if (!array) { | ||
@@ -261,0 +261,0 @@ return 0; |
@@ -275,5 +275,15 @@ import { isFunction, isString, } from "../interfaces.js"; | ||
}); | ||
class DefaultExecutionContext { | ||
/** | ||
* Provides additional contextual information available to behaviors and expressions. | ||
* @public | ||
*/ | ||
export class ExecutionContext { | ||
constructor(parentSource = null, parentContext = null) { | ||
/** | ||
* The index of the current item within a repeat context. | ||
*/ | ||
this.index = 0; | ||
/** | ||
* The length of the current collection within a repeat context. | ||
*/ | ||
this.length = 0; | ||
@@ -283,26 +293,60 @@ this.parent = parentSource; | ||
} | ||
/** | ||
* The current event within an event handler. | ||
*/ | ||
get event() { | ||
return contextEvent.get(); | ||
} | ||
/** | ||
* Indicates whether the current item within a repeat context | ||
* has an even index. | ||
*/ | ||
get isEven() { | ||
return this.index % 2 === 0; | ||
} | ||
/** | ||
* Indicates whether the current item within a repeat context | ||
* has an odd index. | ||
*/ | ||
get isOdd() { | ||
return this.index % 2 !== 0; | ||
} | ||
/** | ||
* Indicates whether the current item within a repeat context | ||
* is the first item in the collection. | ||
*/ | ||
get isFirst() { | ||
return this.index === 0; | ||
} | ||
/** | ||
* Indicates whether the current item within a repeat context | ||
* is somewhere in the middle of the collection. | ||
*/ | ||
get isInMiddle() { | ||
return !this.isFirst && !this.isLast; | ||
} | ||
/** | ||
* Indicates whether the current item within a repeat context | ||
* is the last item in the collection. | ||
*/ | ||
get isLast() { | ||
return this.index === this.length - 1; | ||
} | ||
/** | ||
* Returns the typed event detail of a custom event. | ||
*/ | ||
eventDetail() { | ||
return this.event.detail; | ||
} | ||
/** | ||
* Returns the typed event target of the event. | ||
*/ | ||
eventTarget() { | ||
return this.event.target; | ||
} | ||
/** | ||
* Updates the position/size on a context associated with a list item. | ||
* @param index - The new index of the item. | ||
* @param length - The new length of the list. | ||
*/ | ||
updatePosition(index, length) { | ||
@@ -312,5 +356,16 @@ this.index = index; | ||
} | ||
/** | ||
* Creates a new execution context descendent from the current context. | ||
* @param source - The source for the context if different than the parent. | ||
* @returns A child execution context. | ||
*/ | ||
createChildContext(parentSource) { | ||
return new DefaultExecutionContext(parentSource, this); | ||
return new ExecutionContext(parentSource, this); | ||
} | ||
/** | ||
* Creates a new execution context descent suitable for use in list rendering. | ||
* @param item - The list item to serve as the source. | ||
* @param index - The index of the item in the list. | ||
* @param length - The length of the list. | ||
*/ | ||
createItemContext(index, length) { | ||
@@ -322,11 +377,2 @@ const childContext = Object.create(this); | ||
} | ||
} | ||
Observable.defineProperty(DefaultExecutionContext.prototype, "index"); | ||
Observable.defineProperty(DefaultExecutionContext.prototype, "length"); | ||
/** | ||
* The common execution context APIs. | ||
* @public | ||
*/ | ||
export const ExecutionContext = Object.freeze({ | ||
default: new DefaultExecutionContext(), | ||
/** | ||
@@ -337,5 +383,5 @@ * Sets the event for the current execution context. | ||
*/ | ||
setEvent(event) { | ||
static setEvent(event) { | ||
contextEvent.set(event); | ||
}, | ||
} | ||
/** | ||
@@ -345,5 +391,11 @@ * Creates a new root execution context. | ||
*/ | ||
create() { | ||
return new DefaultExecutionContext(); | ||
}, | ||
}); | ||
static create() { | ||
return new ExecutionContext(); | ||
} | ||
} | ||
/** | ||
* The default execution context. | ||
*/ | ||
ExecutionContext.default = new ExecutionContext(); | ||
Observable.defineProperty(ExecutionContext.prototype, "index"); | ||
Observable.defineProperty(ExecutionContext.prototype, "length"); |
@@ -1,2 +0,2 @@ | ||
import { isString } from "../interfaces.js"; | ||
import "../interfaces.js"; | ||
import { ExecutionContext, Observable, } from "../observation/observable.js"; | ||
@@ -218,75 +218,3 @@ import { FAST } from "../platform.js"; | ||
} | ||
const signals = Object.create(null); | ||
/** | ||
* A binding behavior for signal bindings. | ||
* @public | ||
*/ | ||
export class SignalBinding extends UpdateBinding { | ||
constructor() { | ||
super(...arguments); | ||
this.handlerProperty = `${this.directive.id}-h`; | ||
} | ||
/** | ||
* Bind this behavior to the source. | ||
* @param source - The source to bind to. | ||
* @param context - The execution context that the binding is operating within. | ||
* @param targets - The targets that behaviors in a view can attach to. | ||
*/ | ||
bind(source, context, targets) { | ||
const directive = this.directive; | ||
const target = targets[directive.nodeId]; | ||
const signal = this.getSignal(source, context); | ||
const handler = (target[this.handlerProperty] = () => { | ||
this.updateTarget(target, directive.targetAspect, directive.binding(source, context), source, context); | ||
}); | ||
handler(); | ||
const found = signals[signal]; | ||
if (found) { | ||
Array.isArray(found) | ||
? found.push(handler) | ||
: (signals[signal] = [found, handler]); | ||
} | ||
else { | ||
signals[signal] = handler; | ||
} | ||
} | ||
/** | ||
* Unbinds this behavior from the source. | ||
* @param source - The source to unbind from. | ||
* @param context - The execution context that the binding is operating within. | ||
* @param targets - The targets that behaviors in a view can attach to. | ||
*/ | ||
unbind(source, context, targets) { | ||
const signal = this.getSignal(source, context); | ||
const found = signals[signal]; | ||
if (found && Array.isArray(found)) { | ||
const directive = this.directive; | ||
const target = targets[directive.nodeId]; | ||
const handler = target[this.handlerProperty]; | ||
const index = found.indexOf(handler); | ||
if (index !== -1) { | ||
found.splice(index, 1); | ||
} | ||
} | ||
else { | ||
signals[signal] = void 0; | ||
} | ||
} | ||
getSignal(source, context) { | ||
const options = this.directive.options; | ||
return isString(options) ? options : options(source, context); | ||
} | ||
/** | ||
* Sends the specified signal to signaled bindings. | ||
* @param signal - The signal to send. | ||
* @public | ||
*/ | ||
static send(signal) { | ||
const found = signals[signal]; | ||
if (found) { | ||
Array.isArray(found) ? found.forEach(x => x()) : found(); | ||
} | ||
} | ||
} | ||
/** | ||
* A binding behavior for bindings that change. | ||
@@ -411,71 +339,3 @@ * @public | ||
} | ||
let twoWaySettings = { | ||
determineChangeEvent() { | ||
return "change"; | ||
}, | ||
}; | ||
/** | ||
* A binding behavior for bindings that update in two directions. | ||
* @public | ||
*/ | ||
export class TwoWayBinding extends ChangeBinding { | ||
/** | ||
* Bind this behavior to the source. | ||
* @param source - The source to bind to. | ||
* @param context - The execution context that the binding is operating within. | ||
* @param targets - The targets that behaviors in a view can attach to. | ||
*/ | ||
bind(source, context, targets) { | ||
var _a; | ||
super.bind(source, context, targets); | ||
const directive = this.directive; | ||
const target = targets[directive.nodeId]; | ||
if (!this.changeEvent) { | ||
this.changeEvent = | ||
(_a = directive.options.changeEvent) !== null && _a !== void 0 ? _a : twoWaySettings.determineChangeEvent(directive, target); | ||
} | ||
target.addEventListener(this.changeEvent, this); | ||
} | ||
/** | ||
* Unbinds this behavior from the source. | ||
* @param source - The source to unbind from. | ||
* @param context - The execution context that the binding is operating within. | ||
* @param targets - The targets that behaviors in a view can attach to. | ||
*/ | ||
unbind(source, context, targets) { | ||
super.unbind(source, context, targets); | ||
targets[this.directive.nodeId].removeEventListener(this.changeEvent, this); | ||
} | ||
/** @internal */ | ||
handleEvent(event) { | ||
const directive = this.directive; | ||
const target = event.currentTarget; | ||
let value; | ||
switch (directive.aspectType) { | ||
case 1: | ||
value = target.getAttribute(directive.targetAspect); | ||
break; | ||
case 2: | ||
value = target.hasAttribute(directive.targetAspect); | ||
break; | ||
case 4: | ||
value = target.innerText; | ||
break; | ||
default: | ||
value = target[directive.targetAspect]; | ||
break; | ||
} | ||
const observer = this.getObserver(target); | ||
const last = observer.last; // using internal API!!! | ||
last.propertySource[last.propertyName] = directive.options.fromView(value); | ||
} | ||
/** | ||
* Configures two-way binding. | ||
* @param settings - The settings to use for the two-way binding system. | ||
*/ | ||
static configure(settings) { | ||
twoWaySettings = settings; | ||
} | ||
} | ||
/** | ||
* The default onChange binding configuration. | ||
@@ -486,9 +346,2 @@ * @public | ||
/** | ||
* The default twoWay binding configuration. | ||
* @public | ||
*/ | ||
export const twoWay = BindingConfig.define(BindingMode.define(TwoWayBinding), { | ||
fromView: v => v, | ||
}); | ||
/** | ||
* The default onTime binding configuration. | ||
@@ -500,13 +353,3 @@ * @public | ||
}); | ||
const signalMode = BindingMode.define(SignalBinding); | ||
/** | ||
* Creates a signal binding configuration with the supplied options. | ||
* @param options - The signal name or a binding to use to retrieve the signal name. | ||
* @returns A binding configuration. | ||
* @public | ||
*/ | ||
export const signal = (options) => { | ||
return { mode: signalMode, options }; | ||
}; | ||
/** | ||
* A directive that applies bindings. | ||
@@ -513,0 +356,0 @@ * @public |
@@ -162,3 +162,3 @@ import { isFunction } from "../interfaces.js"; | ||
let viewsLength = views.length; | ||
if (itemsLength === 0 || templateChanged) { | ||
if (itemsLength === 0 || templateChanged || !this.options.recycle) { | ||
// all views need to be removed | ||
@@ -241,2 +241,10 @@ HTMLView.disposeContiguousBatch(views); | ||
HTMLDirective.define(RepeatDirective); | ||
/** | ||
* A directive that enables list rendering. | ||
* @param itemsBinding - The array to render. | ||
* @param templateOrTemplateBinding - The template or a template binding used obtain a template | ||
* to render for each item in the array. | ||
* @param options - Options used to turn on special repeat features. | ||
* @public | ||
*/ | ||
export function repeat(itemsBinding, templateOrTemplateBinding, options = defaultRepeatOptions) { | ||
@@ -243,0 +251,0 @@ const templateBinding = isFunction(templateOrTemplateBinding) |
import { isFunction, isString } from "../interfaces.js"; | ||
import { ExecutionContext, } from "../observation/observable.js"; | ||
import { ExecutionContext } from "../observation/observable.js"; | ||
import { bind, oneTime } from "./binding.js"; | ||
@@ -108,21 +108,1 @@ import { Compiler } from "./compiler.js"; | ||
} | ||
/** | ||
* Transforms a template literal string into a ChildViewTemplate. | ||
* @param strings - The string fragments that are interpolated with the values. | ||
* @param values - The values that are interpolated with the string fragments. | ||
* @remarks | ||
* The html helper supports interpolation of strings, numbers, binding expressions, | ||
* other template instances, and Directive instances. | ||
* @public | ||
*/ | ||
export const child = html; | ||
/** | ||
* Transforms a template literal string into an ItemViewTemplate. | ||
* @param strings - The string fragments that are interpolated with the values. | ||
* @param values - The values that are interpolated with the string fragments. | ||
* @remarks | ||
* The html helper supports interpolation of strings, numbers, binding expressions, | ||
* other template instances, and Directive instances. | ||
* @public | ||
*/ | ||
export const item = html; |
@@ -1,1 +0,1 @@ | ||
!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}(),globalThis.trustedTypes||(globalThis.trustedTypes={createPolicy:(e,t)=>t});const e={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},e));const t=globalThis.FAST;if(void 0===t.getById){const s=Object.create(null);Reflect.defineProperty(t,"getById",Object.assign({value(e,t){let i=s[e];return void 0===i&&(i=t?s[e]=t():null),i}},e))}const s=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;function i(e){return e===document?document.body:e}let n=0;class r{constructor(e){this.styles=e,this.styleClass="fast-"+ ++n}addStylesTo(e){e=i(e);const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=e.querySelectorAll(`.${this.styleClass}`);e=i(e);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}s||t.getById(5,(()=>r)),void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const o=globalThis.FAST,l={1101:"Must call enableArrayObservation before observing arrays.",1201:"The HTML policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1401:"Missing FASTElement definition."};Object.assign(o,{addMessages(e){Object.assign(l,e)},warn(e,...t){var s;console.warn(null!==(s=l[e])&&void 0!==s?s:"Unknown Warning")},error(e,...t){var s;return new Error(null!==(s=l[e])&&void 0!==s?s:"Unknown Error")}});const h={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},h));const c=globalThis.FAST;if(void 0===c.getById){const e=Object.create(null);Reflect.defineProperty(c,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},h))}void 0===c.error&&Object.assign(c,{warn(){},error:e=>new Error(`Code ${e}`),addMessages(){}});const a=Object.freeze([]);function d(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance:t=>e.get(t.constructor)})}const u=e=>"function"==typeof e,f=e=>"string"==typeof e,p=c.getById(1,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function l(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:e=>i=e})}));class b{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class g{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new b(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new b(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const v=c.getById(2,(()=>{const e=p.enqueue,t=/(:|&&|\|\||if)/,s=new WeakMap,i=new WeakMap;let n,r=e=>{throw c.error(1101)};function o(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=r(e):s.set(e,i=new g(e))),i}function l(e){let t=i.get(e);if(void 0===t){let s=Reflect.getPrototypeOf(e);for(;void 0===t&&null!==s;)t=i.get(s),s=Reflect.getPrototypeOf(s);t=void 0===t?[]:t.slice(0),i.set(e,t)}return t}class h{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==n&&n.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const n=e[this.callback];u(n)&&n.call(e,i,t),o(e).notify(this.name)}}}class a extends b{constructor(e,t,s=!1){super(e,t),this.binding=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=n;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const i=this.binding(e,null!=t?t:T.default);return n=s,i}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,i=o(e),r=null===s?this.first:{};if(r.propertySource=e,r.propertyName=t,r.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;n=void 0,t=s.propertySource[s.propertyName],n=this,e===t&&(this.needsRefresh=!0)}s.next=r}this.last=r}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return Object.freeze({setArrayObserverFactory(e){r=e},getNotifier:o,track(e,t){n&&n.watch(e,t)},trackVolatile(){n&&(n.needsRefresh=!0)},notify(e,t){o(e).notify(t)},defineProperty(e,t){f(t)&&(t=new h(t)),l(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:l,binding(e,t,s=this.isVolatileBinding(e)){return new a(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function y(e,t){v.defineProperty(e,t)}function m(e,t,s){return Object.assign({},s,{get(){return v.trackVolatile(),s.get.apply(this)}})}const w=c.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}}));class C{constructor(e=null,t=null){this.index=0,this.length=0,this.parent=e,this.parentContext=t}get event(){return w.get()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}updatePosition(e,t){this.index=e,this.length=t}createChildContext(e){return new C(e,this)}createItemContext(e,t){const s=Object.create(this);return s.index=e,s.length=t,s}}v.defineProperty(C.prototype,"index"),v.defineProperty(C.prototype,"length");const T=Object.freeze({default:new C,setEvent(e){w.set(e)},create:()=>new C});class S{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}const x=Object.freeze({reset:1,splice:2,optimized:3}),O=new S(0,a,0);O.reset=!0;const A=[O];let B=Object.freeze({support:x.splice,normalize:(e,t,s)=>void 0===e?null!=s?s:a:A,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new S(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new S(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new S(0,[r],0)),r},sort(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new S(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new S(0,[],i.length).adjustTo(e)),n}});const j=Object.freeze({reset:A,setDefaultStrategy(e){B=e}});function I(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class $ extends b{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,I(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,v.notify(e,"length"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.oldCollection;void 0===t&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(e=this._strategy)&&void 0!==e?e:B).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,p.enqueue(this))}}let V=!1;const k=Object.freeze({enable(){if(V)return;V=!0,v.setArrayObserverFactory((e=>new $(e)));const e=Array.prototype;e.$fastPatch||(I(e,"$fastPatch",1),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:B)[t.name](this,i,t,e)}})))}});function E(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(k.enable(),t=v.getNotifier(e)),v.track(t.lengthObserver,"length"),e.length}const P=new Map;let N;function F(e){return e.map((e=>e instanceof L?F(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class L{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof L?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(N),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(F(this.styles)),this}static setDefaultStrategy(e){N=e}}L.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;class _{constructor(e){this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let t=P.get(e);return void 0===t&&(t=new CSSStyleSheet,t.replaceSync(e),P.set(e,t)),t}))}addStylesTo(e){e.adoptedStyleSheets=[...e.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=this.sheets;e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))}}L.setDefaultStrategy(c.getById(5,(()=>_)));const M=d(),z=Object.freeze({getForInstance:M.getForInstance,getByType:M.getByType,define:e=>(M.register({type:e}),e)});function R(){return function(e){z.define(e)}}function H(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];void 0!==z.getForInstance(o)&&(o=o.createCSS(r)),o instanceof L||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const q=(e,...t)=>{const{styles:s,behaviors:i}=H(e,t),n=new L(s);return i.length?n.withBehaviors(...i):n};class D{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(f(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new L(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}bind(e){e.$fastController.addStyles(this.styles)}unbind(e){e.$fastController.removeStyles(this.styles)}}z.define(D);const Q=q.partial=(e,...t)=>{const{styles:s,behaviors:i}=H(e,t);return new D(s,i)},U=Object.freeze({queueUpdate:p.enqueue,nextUpdate:p.next,processUpdates:p.process,setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}}),W=`fast-${Math.random().toString(36).substring(2,8)}`,G=`${W}{`,J=`}${W}`,K=J.length;let X=0;const Y=()=>`${W}-${++X}`,Z=Object.freeze({interpolation:e=>`${G}${e}${J}`,attribute:e=>`${Y()}="${G}${e}${J}"`,comment:e=>`\x3c!--${G}${e}${J}--\x3e`}),ee=Object.freeze({parse(e,t){const s=e.split(G);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(J);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+K)}""!==o&&i.push(o)}return i}}),te=d(),se=Object.freeze({getForInstance:te.getForInstance,getByType:te.getByType,define:(e,t)=>((t=t||{}).type=e,te.register(t),e)});function ie(e){return function(t){se.define(t,e)}}const ne=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6,assign(e,t){if(e.sourceAspect=t,t)switch(t[0]){case":":switch(e.targetAspect=t.substring(1),e.targetAspect){case"innerHTML":default:e.aspectType=ne.property;break;case"classList":e.aspectType=ne.tokenList}break;case"?":e.targetAspect=t.substring(1),e.aspectType=ne.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=ne.event;break;default:"class"===t?(e.targetAspect="className",e.aspectType=ne.property):(e.targetAspect=t,e.aspectType=ne.attribute)}}});class re{constructor(e){this.options=e}createBehavior(e){return this}createHTML(e){return Z.attribute(e(this))}}const oe=globalThis.TrustedHTML?e=>(t,s)=>{const i=e(t,s);if(i instanceof TrustedHTML)return i;throw c.error(1202)}:e=>e,le=Object.freeze({define:(e,t=ge)=>Object.freeze({1:t=>new e(t,U.setAttribute),2:t=>new e(t,U.setBooleanAttribute),3:t=>new e(t,((e,t,s)=>e[t]=s)),4:t=>{return new(s=e,class extends s{unbind(e,t,s){super.unbind(e,t,s);const i=s[this.directive.nodeId].$fastView;void 0!==i&&i.isComposed&&(i.unbind(),i.needsBindOnly=!0)}})(t,ae);var s},5:t=>new e(t,de),6:e=>new t(e)})}),he=Object.freeze({define(e,t){const s=e=>({mode:s.mode,options:Object.assign({},t,e)});return s.options=t,s.mode=e,s}});class ce{constructor(e,t){this.directive=e,this.updateTarget=t}bind(e,t,s){}unbind(e,t,s){}createBehavior(e){return this}}function ae(e,t,s,i,n){if(null==s&&(s=""),s.create){e.textContent="";let t=e.$fastView;void 0===t?t=s.create():e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create()),t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i,n)):(t.isComposed=!0,t.bind(i,n),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}}function de(e,t,s){var i;const n=`${this.directive.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={c:0,v:Object.create(null)},o=r.v;let l=r.c;const h=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=l,h.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const e in o)o[e]===l&&h.remove(e)}}class ue extends ce{bind(e,t,s){const i=this.directive;this.updateTarget(s[i.nodeId],i.targetAspect,i.binding(e,t),e,t)}}const fe=Object.create(null);class pe extends ce{constructor(){super(...arguments),this.handlerProperty=`${this.directive.id}-h`}bind(e,t,s){const i=this.directive,n=s[i.nodeId],r=this.getSignal(e,t),o=n[this.handlerProperty]=()=>{this.updateTarget(n,i.targetAspect,i.binding(e,t),e,t)};o();const l=fe[r];l?Array.isArray(l)?l.push(o):fe[r]=[l,o]:fe[r]=o}unbind(e,t,s){const i=this.getSignal(e,t),n=fe[i];if(n&&Array.isArray(n)){const e=s[this.directive.nodeId][this.handlerProperty],t=n.indexOf(e);-1!==t&&n.splice(t,1)}else fe[i]=void 0}getSignal(e,t){const s=this.directive.options;return f(s)?s:s(e,t)}static send(e){const t=fe[e];t&&(Array.isArray(t)?t.forEach((e=>e())):t())}}class be extends ce{constructor(e,t){super(e,t),this.isBindingVolatile=v.isVolatileBinding(e.binding),this.observerProperty=`${e.id}-o`}getObserver(e){var t;return null!==(t=e[this.observerProperty])&&void 0!==t?t:e[this.observerProperty]=v.binding(this.directive.binding,this,this.isBindingVolatile)}bind(e,t,s){const i=this.directive,n=s[i.nodeId],r=this.getObserver(n);r.target=n,r.source=e,r.context=t,this.updateTarget(n,i.targetAspect,r.observe(e,t),e,t)}unbind(e,t,s){const i=s[this.directive.nodeId],n=this.getObserver(i);n.dispose(),n.target=null,n.source=null,n.context=null}handleChange(e,t){const s=t.target,i=t.source,n=t.context;this.updateTarget(s,this.directive.targetAspect,t.observe(i,n),i,n)}}class ge{constructor(e){this.directive=e,this.sourceProperty=`${e.id}-s`,this.contextProperty=`${e.id}-c`}bind(e,t,s){const i=this.directive,n=s[i.nodeId];n[this.sourceProperty]=e,n[this.contextProperty]=t,n.addEventListener(i.targetAspect,this,i.options)}unbind(e,t,s){const i=this.directive,n=s[i.nodeId];n[this.sourceProperty]=n[this.contextProperty]=null,n.removeEventListener(i.targetAspect,this,i.options)}createBehavior(e){return this}handleEvent(e){const t=e.currentTarget;T.setEvent(e);const s=this.directive.binding(t[this.sourceProperty],t[this.contextProperty]);T.setEvent(null),!0!==s&&e.preventDefault()}}let ve={determineChangeEvent:()=>"change"};class ye extends be{bind(e,t,s){var i;super.bind(e,t,s);const n=this.directive,r=s[n.nodeId];this.changeEvent||(this.changeEvent=null!==(i=n.options.changeEvent)&&void 0!==i?i:ve.determineChangeEvent(n,r)),r.addEventListener(this.changeEvent,this)}unbind(e,t,s){super.unbind(e,t,s),s[this.directive.nodeId].removeEventListener(this.changeEvent,this)}handleEvent(e){const t=this.directive,s=e.currentTarget;let i;switch(t.aspectType){case 1:i=s.getAttribute(t.targetAspect);break;case 2:i=s.hasAttribute(t.targetAspect);break;case 4:i=s.innerText;break;default:i=s[t.targetAspect]}const n=this.getObserver(s).last;n.propertySource[n.propertyName]=t.options.fromView(i)}static configure(e){ve=e}}const me=he.define(le.define(be),{}),we=he.define(le.define(ye),{fromView:e=>e}),Ce=he.define(le.define(ue),{once:!0}),Te=le.define(pe),Se=e=>({mode:Te,options:e});class xe{constructor(e,t,s){this.binding=e,this.mode=t,this.options=s,this.factory=null,this.aspectType=ne.content}createHTML(e){return Z.interpolation(e(this))}createBehavior(e){return null==this.factory&&("innerHTML"===this.targetAspect&&(this.binding=oe(this.binding)),this.factory=this.mode[this.aspectType](this)),this.factory.createBehavior(e)}}function Oe(e,t=me){return"mode"in t||(t=me(t)),new xe(e,t.mode,t.options)}function Ae(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}se.define(xe,{aspected:!0});class Be{constructor(e,t,s){this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.source=null,this.context=null,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=e.parentNode,s=this.lastChild;let i,n=this.firstChild;for(;n!==s;)i=n.nextSibling,t.insertBefore(n,e),n=i;t.insertBefore(s,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){Ae(this.firstChild,this.lastChild),this.unbind()}bind(e,t){let s=this.behaviors;const i=this.source;if(i===e)return;this.source=e,this.context=t;const n=this.targets;if(null!==i)for(let r=0,o=s.length;r<o;++r){const o=s[r];o.unbind(i,t,n),o.bind(e,t,n)}else if(null===s){this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let r=0,o=i.length;r<o;++r){const o=i[r].createBehavior(n);o.bind(e,t,n),s[r]=o}}else for(let i=0,r=s.length;i<r;++i)s[i].bind(e,t,n)}unbind(){const e=this.source;if(null===e)return;const t=this.targets,s=this.context,i=this.behaviors;for(let n=0,r=i.length;n<r;++n)i[n].unbind(e,s,t);this.source=null,this.context=null}static disposeContiguousBatch(e){if(0!==e.length){Ae(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}const je=(e,t)=>`${e}.${t}`,Ie={},$e={index:0,node:null};class Ve{constructor(e,t){this.fragment=e,this.directives=t,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i){this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.nodeId=s,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=Ie[t];if(!n){const i=`_${t}`;Ie[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:t;for(const e of this.nodeIds)s[e];return new Be(t,this.factories,s)}}function ke(e,t,s,i,n,r=!1){const o=s.attributes,l=e.directives;for(let h=0,c=o.length;h<c;++h){const a=o[h],d=a.value,u=ee.parse(d,l);let f=null;null===u?r&&(f=Oe((()=>d),Ce),ne.assign(f,a.name)):f=_e.aggregate(u),null!==f&&(s.removeAttributeNode(a),h--,c--,e.addFactory(f,t,i,n))}}function Ee(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=Pe(e,s,n,i);n=t.node,i=t.index}}function Pe(e,t,s,i){const n=je(t,i);switch(s.nodeType){case 1:ke(e,t,s,n,i),Ee(e,s,n);break;case 3:return function(e,t,s,i,n){const r=ee.parse(t.textContent,e.directives);if(null===r)return $e.node=t.nextSibling,$e.index=n+1,$e;let o,l=o=t;for(let t=0,h=r.length;t<h;++t){const h=r[t];0!==t&&(n++,i=je(s,n),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),f(h)?o.textContent=h:(o.textContent=" ",e.addFactory(h,s,i,n)),l=o}return $e.index=n+1,$e.node=l.nextSibling,$e}(e,s,t,n,i);case 8:const r=ee.parse(s.data,e.directives);null!==r&&e.addFactory(_e.aggregate(r),t,n,i)}return $e.index=i+1,$e.node=s.nextSibling,$e}const Ne={createHTML:e=>e};let Fe=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",Ne):Ne;const Le=Fe,_e={setHTMLPolicy(e){if(Fe!==Le)throw c.error(1201);Fe=e},compile(e,t){let s;if(f(e)){s=document.createElement("TEMPLATE"),s.innerHTML=Fe.createHTML(e);const t=s.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(s=t)}else s=e;const i=document.adoptNode(s.content),n=new Ve(i,t);return ke(n,"",s,"h",0,!0),(function(e,t){return e&&8==e.nodeType&&null!==ee.parse(e.data,t)}(i.firstChild,t)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Ee(n,i,"r"),$e.node=null,n.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e){if(1===e.length)return e[0];let t;const s=e.length,i=e.map((e=>f(e)?()=>e:(t=e.sourceAspect||t,e.binding))),n=Oe(((e,t)=>{let n="";for(let r=0;r<s;++r)n+=i[r](e,t);return n}));return ne.assign(n,t),n}};class Me{constructor(e,t){this.result=null,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=_e.compile(this.html,this.factories)),this.result.createView(e)}render(e,t,s,i){const n=this.create(null!=s?s:t);return n.bind(e,null!=i?i:T.default),n.appendTo(t),n}}const ze=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Re(e,t,s){const i=ze.exec(t);return null!==i&&ne.assign(e,i[2]),e.createHTML(s)}function He(e,...t){let s="";const i=Object.create(null),n=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Y();return i[s]=e,s};for(let i=0,r=e.length-1;i<r;++i){const r=e[i],o=t[i];let l;if(s+=r,u(o))s+=Re(Oe(o),r,n);else if(f(o)){const e=ze.exec(r);if(null!==e){const t=Oe((()=>o),Ce);ne.assign(t,e[2]),s+=t.createHTML(n)}else s+=o}else void 0===(l=se.getForInstance(o))?s+=Re(Oe((()=>o),Ce),r,n):l.aspected?s+=Re(o,r,n):s+=o.createHTML(n)}return new Me(s+e[e.length-1],i)}const qe=He,De=He;class Qe extends re{bind(e,t,s){e[this.options]=s[this.nodeId]}unbind(){}}se.define(Qe);const Ue=e=>new Qe(e);function We(e,t){const s=u(t)?t:()=>t;return(t,i)=>e(t,i)?s(t,i):null}const Ge=Object.freeze({positioning:!1,recycle:!0});function Je(e,t,s,i){e.bind(t[s],i)}function Ke(e,t,s,i){e.bind(t[s],i.createItemContext(s,t.length))}class Xe{constructor(e,t,s,i,n,r){this.location=e,this.itemsBinding=t,this.templateBinding=i,this.options=r,this.source=null,this.views=[],this.items=null,this.itemsObserver=null,this.context=void 0,this.childContext=void 0,this.bindView=Je,this.itemsBindingObserver=v.binding(t,this,s),this.templateBindingObserver=v.binding(i,this,n),r.positioning&&(this.bindView=Ke)}bind(e,t){this.source=e,this.context=t,this.childContext=t.createChildContext(e),this.items=this.itemsBindingObserver.observe(e,this.context),this.template=this.templateBindingObserver.observe(e,this.context),this.observeItems(!0),this.refreshAllViews()}unbind(){this.source=null,this.items=null,null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews(),this.itemsBindingObserver.dispose(),this.templateBindingObserver.dispose()}handleChange(e,t){e===this.itemsBinding?(this.items=this.itemsBindingObserver.observe(this.source,this.context),this.observeItems(),this.refreshAllViews()):e===this.templateBinding?(this.template=this.templateBindingObserver.observe(this.source,this.context),this.refreshAllViews(!0)):t[0].reset?this.refreshAllViews():this.updateViews(t)}observeItems(e=!1){if(!this.items)return void(this.items=a);const t=this.itemsObserver,s=this.itemsObserver=v.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateViews(e){const t=this.views,s=this.childContext,i=[],n=this.bindView;let r=0;for(let s=0,n=e.length;s<n;++s){const n=e[s],o=n.removed;i.push(...t.splice(n.index+r,o.length)),r-=n.addedCount}const o=this.items,l=this.template;for(let r=0,h=e.length;r<h;++r){const h=e[r];let c=h.index;const a=c+h.addedCount;for(;c<a;++c){const e=t[c],r=e?e.firstChild:this.location,h=this.options.recycle&&i.length>0?i.shift():l.create();t.splice(c,0,h),n(h,o,c,s),h.insertBefore(r)}}for(let e=0,t=i.length;e<t;++e)i[e].dispose();if(this.options.positioning)for(let e=0,s=t.length;e<s;++e)t[e].context.updatePosition(e,s)}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.childContext;let o=t.length,l=this.views,h=l.length;if((0===o||e)&&(Be.disposeContiguousBatch(l),h=0),0===h){this.views=l=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),l[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<h){n(l[e],t,e,r)}else{const o=s.create();n(o,t,e,r),l.push(o),o.insertBefore(i)}const c=l.splice(e,h-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}class Ye{constructor(e,t,s){this.itemsBinding=e,this.templateBinding=t,this.options=s,k.enable(),this.isItemsBindingVolatile=v.isVolatileBinding(e),this.isTemplateBindingVolatile=v.isVolatileBinding(t)}createHTML(e){return Z.comment(e(this))}createBehavior(e){return new Xe(e[this.nodeId],this.itemsBinding,this.isItemsBindingVolatile,this.templateBinding,this.isTemplateBindingVolatile,this.options)}}function Ze(e,t,s=Ge){const i=u(t)?t:()=>t;return new Ye(e,i,s)}se.define(Ye);const et=e=>1===e.nodeType,tt=e=>e?t=>1===t.nodeType&&t.matches(e):et;class st extends re{constructor(){super(...arguments),this.sourceProperty=`${this.id}-s`}bind(e,t,s){const i=s[this.nodeId];i[this.sourceProperty]=e,this.updateTarget(e,this.computeNodes(i)),this.observe(i)}unbind(e,t,s){const i=s[this.nodeId];this.updateTarget(e,a),this.disconnect(i),i[this.sourceProperty]=null}getSource(e){return e[this.sourceProperty]}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}class it extends st{observe(e){e.addEventListener("slotchange",this)}disconnect(e){e.removeEventListener("slotchange",this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function nt(e){return f(e)&&(e={property:e}),new it(e)}se.define(it);class rt extends st{constructor(e){super(e),this.observerProperty=`${this.id}-o`,this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){var t;const s=null!==(t=e[this.observerProperty])&&void 0!==t?t:e[this.observerProperty]=new MutationObserver(this.handleEvent);s.target=e,s.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function ot(e){return f(e)&&(e={property:e}),new rt(e)}se.define(rt);const lt={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};function ht(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const ct={toView(e){const t=ht(e);return t?t.toString():t},fromView:ht};class at{constructor(e,t,s=t.toLowerCase(),i="reflect",n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,"boolean"===i&&void 0===n&&(this.converter=lt)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return v.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||p.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;U.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":U.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(e.attributes);for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];f(i)?s.push(new at(e,i)):s.push(new at(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function dt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t);const i=e.constructor.attributes||(e.constructor.attributes=[]);i.push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const ut={mode:"open"},ft={},pt=c.getById(4,(()=>d()));class bt{constructor(e,t=e.definition){f(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template;const s=at.collect(e,t.attributes),i=new Array(s.length),n={},r={};for(let e=0,t=s.length;e<t;++e){const t=s[e];i[e]=t.attribute,n[t.name]=t,r[t.attribute]=t}this.attributes=s,this.observedAttributes=i,this.propertyLookup=n,this.attributeLookup=r,this.shadowOptions=void 0===t.shadowOptions?ut:null===t.shadowOptions?void 0:Object.assign(Object.assign({},ut),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?ft:Object.assign(Object.assign({},ft),t.elementOptions),this.styles=void 0===t.styles?void 0:Array.isArray(t.styles)?new L(t.styles):t.styles instanceof L?t.styles:new L([t.styles])}get isDefined(){return!!pt.getByType(this.type)}define(e=customElements){const t=this.type;if(pt.register(this)){const e=this.attributes,s=t.prototype;for(let t=0,i=e.length;t<i;++t)v.defineProperty(s,e[t]);Reflect.defineProperty(t,"observedAttributes",{value:this.observedAttributes,enumerable:!0})}return e.get(this.name)||e.define(this.name,t,this.elementOptions),this}}bt.getByType=pt.getByType,bt.getForInstance=pt.getForInstance;const gt=new WeakMap,vt={bubbles:!0,composed:!0,cancelable:!0};function yt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:gt.get(e))&&void 0!==s?s:null}class mt extends g{constructor(e,t){super(e),this.boundObservables=null,this.behaviors=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this._styles=null,this._isConnected=!1,this.$fastController=this,this.view=null,this.element=e,this.definition=t;const s=t.shadowOptions;if(void 0!==s){let t=e.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=e.attachShadow(s),"closed"===s.mode&>.set(e,t))}const i=v.getAccessors(e);if(i.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,n=i.length;s<n;++s){const n=i[s].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return v.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,v.notify(this,"isConnected")}get template(){var e;if(null===this._template){const t=this.definition;this.element.resolveTemplate?this._template=this.element.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get styles(){var e;if(null===this._styles){const t=this.definition;this.element.resolveStyles?this._styles=this.element.resolveStyles():t.styles&&(this._styles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._styles}set styles(e){this._styles!==e&&(null!==this._styles&&this.removeStyles(this._styles),this._styles=e,this.needsInitialization||this.addStyles(e))}addStyles(e){if(!e)return;const t=yt(this.element)||this.element.getRootNode();if(e instanceof HTMLElement)t.append(e);else if(!e.isAttachedTo(t)){const s=e.behaviors;e.addStylesTo(t),null!==s&&this.addBehaviors(s)}}removeStyles(e){if(!e)return;const t=yt(this.element)||this.element.getRootNode();if(e instanceof HTMLElement)t.removeChild(e);else if(e.isAttachedTo(t)){const s=e.behaviors;e.removeStylesFrom(t),null!==s&&this.removeBehaviors(s)}}addBehaviors(e){var t;const s=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,i=e.length,n=[];for(let t=0;t<i;++t){const i=e[t];s.has(i)?s.set(i,s.get(i)+1):(s.set(i,1),n.push(i))}if(this._isConnected){const e=this.element,t=T.default;for(let s=0;s<n.length;++s)n[s].bind(e,t)}}removeBehaviors(e,t=!1){const s=this.behaviors;if(null===s)return;const i=e.length,n=[];for(let r=0;r<i;++r){const i=e[r];if(s.has(i)){const e=s.get(i)-1;0===e||t?s.delete(i)&&n.push(i):s.set(i,e)}}if(this._isConnected){const e=this.element,t=T.default;for(let s=0;s<n.length;++s)n[s].unbind(e,t)}}onConnectedCallback(){if(this._isConnected)return;const e=this.element,t=T.default;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(e,t);const s=this.behaviors;if(null!==s)for(const i of s.keys())i.bind(e,t);this.setIsConnected(!0)}onDisconnectedCallback(){if(!this._isConnected)return;this.setIsConnected(!1);const e=this.view;null!==e&&e.unbind();const t=this.behaviors;if(null!==t){const e=this.element,s=T.default;for(const i of t.keys())i.unbind(e,s)}}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.element,s)}emit(e,t,s){return!!this._isConnected&&this.element.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},vt),s)))}finishInitialization(){const e=this.element,t=this.boundObservables;if(null!==t){const s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}this.renderTemplate(this.template),this.addStyles(this.styles),this.needsInitialization=!1}renderTemplate(e){var t;const s=this.element,i=null!==(t=yt(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s))}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=bt.getForInstance(e);if(void 0===s)throw c.error(1401);return e.$fastController=new mt(e,s)}}function wt(e){return class extends e{constructor(){super(),mt.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.onConnectedCallback()}disconnectedCallback(){this.$fastController.onDisconnectedCallback()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}}}const Ct=Object.assign(wt(HTMLElement),{from:e=>wt(e),define:(e,t)=>new bt(e,t).define().type});function Tt(e){return function(t){new bt(t,e).define()}}export{_ as AdoptedStyleSheetsStrategy,k as ArrayObserver,ne as Aspect,at as AttributeDefinition,he as BindingConfig,le as BindingMode,z as CSSDirective,be as ChangeBinding,rt as ChildrenDirective,_e as Compiler,mt as Controller,U as DOM,L as ElementStyles,ge as EventBinding,T as ExecutionContext,c as FAST,Ct as FASTElement,bt as FASTElementDefinition,xe as HTMLBindingDirective,se as HTMLDirective,Be as HTMLView,Z as Markup,st as NodeObservationDirective,v as Observable,ue as OneTimeBinding,ee as Parser,g as PropertyChangeNotifier,Qe as RefDirective,Xe as RepeatBehavior,Ye as RepeatDirective,pe as SignalBinding,it as SlottedDirective,S as Splice,j as SpliceStrategy,x as SpliceStrategySupport,re as StatelessAttachedAttributeDirective,b as SubscriberSet,ye as TwoWayBinding,ce as UpdateBinding,p as Updates,Me as ViewTemplate,dt as attr,Oe as bind,lt as booleanConverter,qe as child,ot as children,d as createTypeRegistry,q as css,R as cssDirective,Q as cssPartial,Tt as customElement,tt as elements,a as emptyArray,He as html,ie as htmlDirective,De as item,E as length,ct as nullableNumberConverter,y as observable,me as onChange,Ce as oneTime,Ue as ref,Ze as repeat,Se as signal,nt as slotted,we as twoWay,m as volatile,We as when}; | ||
!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const t=new Function("return this")();t.globalThis=t}}(),globalThis.trustedTypes||(globalThis.trustedTypes={createPolicy:(t,e)=>e});const t={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},t));const e=globalThis.FAST;if(void 0===e.getById){const s=Object.create(null);Reflect.defineProperty(e,"getById",Object.assign({value(t,e){let i=s[t];return void 0===i&&(i=e?s[t]=e():null),i}},t))}const s=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;function i(t){return t===document?document.body:t}let n=0;class r{constructor(t){this.styles=t,this.styleClass="fast-"+ ++n}addStylesTo(t){t=i(t);const e=this.styles,s=this.styleClass;for(let i=0;i<e.length;i++){const n=document.createElement("style");n.innerHTML=e[i],n.className=s,t.append(n)}}removeStylesFrom(t){const e=t.querySelectorAll(`.${this.styleClass}`);t=i(t);for(let s=0,i=e.length;s<i;++s)t.removeChild(e[s])}}s||e.getById(5,(()=>r)),void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const o=globalThis.FAST,l={1101:"Must call enableArrayObservation before observing arrays.",1201:"The HTML policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1401:"Missing FASTElement definition."};Object.assign(o,{addMessages(t){Object.assign(l,t)},warn(t,...e){var s;console.warn(null!==(s=l[t])&&void 0!==s?s:"Unknown Warning")},error(t,...e){var s;return new Error(null!==(s=l[t])&&void 0!==s?s:"Unknown Error")}});const h={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},h));const c=globalThis.FAST;if(void 0===c.getById){const t=Object.create(null);Reflect.defineProperty(c,"getById",Object.assign({value(e,s){let i=t[e];return void 0===i&&(i=s?t[e]=s():null),i}},h))}void 0===c.error&&Object.assign(c,{warn(){},error:t=>new Error(`Code ${t}`),addMessages(){}});const a=Object.freeze([]);function d(){const t=new Map;return Object.freeze({register:e=>!t.has(e.type)&&(t.set(e.type,e),!0),getByType:e=>t.get(e),getForInstance:e=>t.get(e.constructor)})}const u=t=>"function"==typeof t,f=t=>"string"==typeof t,p=c.getById(1,(()=>{const t=[],e=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(e.length)throw e.shift()}function r(s){try{s.call()}catch(s){if(!i)throw t.length=0,s;e.push(s),setTimeout(n,0)}}function o(){let e=0;for(;e<t.length;)if(r(t[e]),e++,e>1024){for(let s=0,i=t.length-e;s<i;s++)t[s]=t[s+e];t.length-=e,e=0}t.length=0}function l(e){t.push(e),t.length<2&&(i?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:t=>i=t})}));class b{constructor(t,e){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=t,this.sub1=e}has(t){return void 0===this.spillover?this.sub1===t||this.sub2===t:-1!==this.spillover.indexOf(t)}subscribe(t){const e=this.spillover;if(void 0===e){if(this.has(t))return;if(void 0===this.sub1)return void(this.sub1=t);if(void 0===this.sub2)return void(this.sub2=t);this.spillover=[this.sub1,this.sub2,t],this.sub1=void 0,this.sub2=void 0}else{-1===e.indexOf(t)&&e.push(t)}}unsubscribe(t){const e=this.spillover;if(void 0===e)this.sub1===t?this.sub1=void 0:this.sub2===t&&(this.sub2=void 0);else{const s=e.indexOf(t);-1!==s&&e.splice(s,1)}}notify(t){const e=this.spillover,s=this.subject;if(void 0===e){const e=this.sub1,i=this.sub2;void 0!==e&&e.handleChange(s,t),void 0!==i&&i.handleChange(s,t)}else for(let i=0,n=e.length;i<n;++i)e[i].handleChange(s,t)}}class g{constructor(t){this.subscribers={},this.subjectSubscribers=null,this.subject=t}notify(t){var e,s;null===(e=this.subscribers[t])||void 0===e||e.notify(t),null===(s=this.subjectSubscribers)||void 0===s||s.notify(t)}subscribe(t,e){var s,i;let n;n=e?null!==(s=this.subscribers[e])&&void 0!==s?s:this.subscribers[e]=new b(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new b(this.subject),n.subscribe(t)}unsubscribe(t,e){var s,i;e?null===(s=this.subscribers[e])||void 0===s||s.unsubscribe(t):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(t)}}const v=c.getById(2,(()=>{const t=p.enqueue,e=/(:|&&|\|\||if)/,s=new WeakMap,i=new WeakMap;let n,r=t=>{throw c.error(1101)};function o(t){var e;let i=null!==(e=t.$fastController)&&void 0!==e?e:s.get(t);return void 0===i&&(Array.isArray(t)?i=r(t):s.set(t,i=new g(t))),i}function l(t){let e=i.get(t);if(void 0===e){let s=Reflect.getPrototypeOf(t);for(;void 0===e&&null!==s;)e=i.get(s),s=Reflect.getPrototypeOf(s);e=void 0===e?[]:e.slice(0),i.set(t,e)}return e}class h{constructor(t){this.name=t,this.field=`_${t}`,this.callback=`${t}Changed`}getValue(t){return void 0!==n&&n.watch(t,this.name),t[this.field]}setValue(t,e){const s=this.field,i=t[s];if(i!==e){t[s]=e;const n=t[this.callback];u(n)&&n.call(t,i,e),o(t).notify(this.name)}}}class a extends b{constructor(t,e,s=!1){super(t,e),this.binding=t,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(t){this.isAsync=this.needsQueue=t}observe(t,e){this.needsRefresh&&null!==this.last&&this.dispose();const s=n;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const i=this.binding(t,null!=e?e:C.default);return n=s,i}dispose(){if(null!==this.last){let t=this.first;for(;void 0!==t;)t.notifier.unsubscribe(this,t.propertyName),t=t.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(t,e){const s=this.last,i=o(t),r=null===s?this.first:{};if(r.propertySource=t,r.propertyName=e,r.notifier=i,i.subscribe(this,e),null!==s){if(!this.needsRefresh){let e;n=void 0,e=s.propertySource[s.propertyName],n=this,t===e&&(this.needsRefresh=!0)}s.next=r}this.last=r}handleChange(){this.needsQueue?(this.needsQueue=!1,t(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let t=this.first;for(;void 0!==t;)yield t,t=t.next}}return Object.freeze({setArrayObserverFactory(t){r=t},getNotifier:o,track(t,e){n&&n.watch(t,e)},trackVolatile(){n&&(n.needsRefresh=!0)},notify(t,e){o(t).notify(e)},defineProperty(t,e){f(e)&&(e=new h(e)),l(t).push(e),Reflect.defineProperty(t,e.name,{enumerable:!0,get(){return e.getValue(this)},set(t){e.setValue(this,t)}})},getAccessors:l,binding(t,e,s=this.isVolatileBinding(t)){return new a(t,e,s)},isVolatileBinding:t=>e.test(t.toString())})}));function y(t,e){v.defineProperty(t,e)}function m(t,e,s){return Object.assign({},s,{get(){return v.trackVolatile(),s.get.apply(this)}})}const w=c.getById(3,(()=>{let t=null;return{get:()=>t,set(e){t=e}}}));class C{constructor(t=null,e=null){this.index=0,this.length=0,this.parent=t,this.parentContext=e}get event(){return w.get()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}updatePosition(t,e){this.index=t,this.length=e}createChildContext(t){return new C(t,this)}createItemContext(t,e){const s=Object.create(this);return s.index=t,s.length=e,s}static setEvent(t){w.set(t)}static create(){return new C}}C.default=new C,v.defineProperty(C.prototype,"index"),v.defineProperty(C.prototype,"length");class T{constructor(t,e,s){this.index=t,this.removed=e,this.addedCount=s}adjustTo(t){let e=this.index;const s=t.length;return e>s?e=s-this.addedCount:e<0&&(e=s+this.removed.length+e-this.addedCount),this.index=e<0?0:e,this}}const S=Object.freeze({reset:1,splice:2,optimized:3}),x=new T(0,a,0);x.reset=!0;const O=[x];let A=Object.freeze({support:S.splice,normalize:(t,e,s)=>void 0===t?null!=s?s:a:O,pop(t,e,s,i){const n=t.length>0,r=s.apply(t,i);return n&&e.addSplice(new T(t.length,[r],0)),r},push(t,e,s,i){const n=s.apply(t,i);return e.addSplice(new T(t.length-i.length,[],i.length).adjustTo(t)),n},reverse(t,e,s,i){const n=s.apply(t,i);return e.reset(t),n},shift(t,e,s,i){const n=t.length>0,r=s.apply(t,i);return n&&e.addSplice(new T(0,[r],0)),r},sort(t,e,s,i){const n=s.apply(t,i);return e.reset(t),n},splice(t,e,s,i){const n=s.apply(t,i);return e.addSplice(new T(+i[0],n,i.length>2?i.length-2:0).adjustTo(t)),n},unshift(t,e,s,i){const n=s.apply(t,i);return e.addSplice(new T(0,[],i.length).adjustTo(t)),n}});const B=Object.freeze({reset:O,setDefaultStrategy(t){A=t}});function j(t,e,s){Reflect.defineProperty(t,e,{value:s,enumerable:!1})}class I extends b{constructor(t){super(t),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,j(t,"$fastController",this)}get strategy(){return this._strategy}set strategy(t){this._strategy=t}get lengthObserver(){let t=this._lengthObserver;if(void 0===t){const e=this.subject;this._lengthObserver=t={length:e.length,handleChange(){this.length!==e.length&&(this.length=e.length,v.notify(t,"length"))}},this.subscribe(t)}return t}subscribe(t){this.flush(),super.subscribe(t)}addSplice(t){void 0===this.splices?this.splices=[t]:this.splices.push(t),this.enqueue()}reset(t){this.oldCollection=t,this.enqueue()}flush(){var t;const e=this.splices,s=this.oldCollection;void 0===e&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(t=this._strategy)&&void 0!==t?t:A).normalize(s,this.subject,e)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,p.enqueue(this))}}let $=!1;const V=Object.freeze({enable(){if($)return;$=!0,v.setArrayObserverFactory((t=>new I(t)));const t=Array.prototype;t.$fastPatch||(j(t,"$fastPatch",1),[t.pop,t.push,t.reverse,t.shift,t.sort,t.splice,t.unshift].forEach((e=>{t[e.name]=function(...t){var s;const i=this.$fastController;return void 0===i?e.apply(this,t):(null!==(s=i.strategy)&&void 0!==s?s:A)[e.name](this,i,e,t)}})))}});function k(t){if(!t)return 0;let e=t.$fastController;return void 0===e&&(V.enable(),e=v.getNotifier(t)),v.track(e.lengthObserver,"length"),t.length}const P=new Map;let N;function F(t){return t.map((t=>t instanceof _?F(t.styles):[t])).reduce(((t,e)=>t.concat(e)),[])}class _{constructor(t){this.styles=t,this.targets=new WeakSet,this._strategy=null,this.behaviors=t.map((t=>t instanceof _?t.behaviors:null)).reduce(((t,e)=>null===e?t:null===t?e:t.concat(e)),null)}get strategy(){return null===this._strategy&&this.withStrategy(N),this._strategy}addStylesTo(t){this.strategy.addStylesTo(t),this.targets.add(t)}removeStylesFrom(t){this.strategy.removeStylesFrom(t),this.targets.delete(t)}isAttachedTo(t){return this.targets.has(t)}withBehaviors(...t){return this.behaviors=null===this.behaviors?t:this.behaviors.concat(t),this}withStrategy(t){return this._strategy=new t(F(this.styles)),this}static setDefaultStrategy(t){N=t}}_.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;class E{constructor(t){this.sheets=t.map((t=>{if(t instanceof CSSStyleSheet)return t;let e=P.get(t);return void 0===e&&(e=new CSSStyleSheet,e.replaceSync(t),P.set(t,e)),e}))}addStylesTo(t){t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(t){const e=this.sheets;t.adoptedStyleSheets=t.adoptedStyleSheets.filter((t=>-1===e.indexOf(t)))}}_.setDefaultStrategy(c.getById(5,(()=>E)));const M=d(),L=Object.freeze({getForInstance:M.getForInstance,getByType:M.getByType,define:t=>(M.register({type:t}),t)});function z(){return function(t){L.define(t)}}function R(t,e){const s=[];let i="";const n=[],r=t=>{n.push(t)};for(let n=0,o=t.length-1;n<o;++n){i+=t[n];let o=e[n];void 0!==L.getForInstance(o)&&(o=o.createCSS(r)),o instanceof _||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=t[t.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const H=(t,...e)=>{const{styles:s,behaviors:i}=R(t,e),n=new _(s);return i.length?n.withBehaviors(...i):n};class q{constructor(t,e){this.behaviors=e,this.css="";const s=t.reduce(((t,e)=>(f(e)?this.css+=e:t.push(e),t)),[]);s.length&&(this.styles=new _(s))}createCSS(t){return this.behaviors.forEach(t),this.styles&&t(this),this.css}bind(t){t.$fastController.addStyles(this.styles)}unbind(t){t.$fastController.removeStyles(this.styles)}}L.define(q);const D=H.partial=(t,...e)=>{const{styles:s,behaviors:i}=R(t,e);return new q(s,i)},Q=Object.freeze({queueUpdate:p.enqueue,nextUpdate:p.next,processUpdates:p.process,setAttribute(t,e,s){null==s?t.removeAttribute(e):t.setAttribute(e,s)},setBooleanAttribute(t,e,s){s?t.setAttribute(e,""):t.removeAttribute(e)}}),U=`fast-${Math.random().toString(36).substring(2,8)}`,W=`${U}{`,G=`}${U}`,J=G.length;let K=0;const X=()=>`${U}-${++K}`,Y=Object.freeze({interpolation:t=>`${W}${t}${G}`,attribute:t=>`${X()}="${W}${t}${G}"`,comment:t=>`\x3c!--${W}${t}${G}--\x3e`}),Z=Object.freeze({parse(t,e){const s=t.split(W);if(1===s.length)return null;const i=[];for(let t=0,n=s.length;t<n;++t){const n=s[t],r=n.indexOf(G);let o;if(-1===r)o=n;else{const t=n.substring(0,r);i.push(e[t]),o=n.substring(r+J)}""!==o&&i.push(o)}return i}}),tt=d(),et=Object.freeze({getForInstance:tt.getForInstance,getByType:tt.getByType,define:(t,e)=>((e=e||{}).type=t,tt.register(e),t)});function st(t){return function(e){et.define(e,t)}}const it=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6,assign(t,e){if(t.sourceAspect=e,e)switch(e[0]){case":":switch(t.targetAspect=e.substring(1),t.targetAspect){case"innerHTML":default:t.aspectType=it.property;break;case"classList":t.aspectType=it.tokenList}break;case"?":t.targetAspect=e.substring(1),t.aspectType=it.booleanAttribute;break;case"@":t.targetAspect=e.substring(1),t.aspectType=it.event;break;default:"class"===e?(t.targetAspect="className",t.aspectType=it.property):(t.targetAspect=e,t.aspectType=it.attribute)}}});class nt{constructor(t){this.options=t}createBehavior(t){return this}createHTML(t){return Y.attribute(t(this))}}const rt=globalThis.TrustedHTML?t=>(e,s)=>{const i=t(e,s);if(i instanceof TrustedHTML)return i;throw c.error(1202)}:t=>t,ot=Object.freeze({define:(t,e=ft)=>Object.freeze({1:e=>new t(e,Q.setAttribute),2:e=>new t(e,Q.setBooleanAttribute),3:e=>new t(e,((t,e,s)=>t[e]=s)),4:e=>{return new(s=t,class extends s{unbind(t,e,s){super.unbind(t,e,s);const i=s[this.directive.nodeId].$fastView;void 0!==i&&i.isComposed&&(i.unbind(),i.needsBindOnly=!0)}})(e,ct);var s},5:e=>new t(e,at),6:t=>new e(t)})}),lt=Object.freeze({define(t,e){const s=t=>({mode:s.mode,options:Object.assign({},e,t)});return s.options=e,s.mode=t,s}});class ht{constructor(t,e){this.directive=t,this.updateTarget=e}bind(t,e,s){}unbind(t,e,s){}createBehavior(t){return this}}function ct(t,e,s,i,n){if(null==s&&(s=""),s.create){t.textContent="";let e=t.$fastView;void 0===e?e=s.create():t.$fastTemplate!==s&&(e.isComposed&&(e.remove(),e.unbind()),e=s.create()),e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(i,n)):(e.isComposed=!0,e.bind(i,n),e.insertBefore(t),t.$fastView=e,t.$fastTemplate=s)}else{const e=t.$fastView;void 0!==e&&e.isComposed&&(e.isComposed=!1,e.remove(),e.needsBindOnly?e.needsBindOnly=!1:e.unbind()),t.textContent=s}}function at(t,e,s){var i;const n=`${this.directive.id}-t`,r=null!==(i=t[n])&&void 0!==i?i:t[n]={c:0,v:Object.create(null)},o=r.v;let l=r.c;const h=t[e];if(null!=s&&s.length){const t=s.split(/\s+/);for(let e=0,s=t.length;e<s;++e){const s=t[e];""!==s&&(o[s]=l,h.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const t in o)o[t]===l&&h.remove(t)}}class dt extends ht{bind(t,e,s){const i=this.directive;this.updateTarget(s[i.nodeId],i.targetAspect,i.binding(t,e),t,e)}}class ut extends ht{constructor(t,e){super(t,e),this.isBindingVolatile=v.isVolatileBinding(t.binding),this.observerProperty=`${t.id}-o`}getObserver(t){var e;return null!==(e=t[this.observerProperty])&&void 0!==e?e:t[this.observerProperty]=v.binding(this.directive.binding,this,this.isBindingVolatile)}bind(t,e,s){const i=this.directive,n=s[i.nodeId],r=this.getObserver(n);r.target=n,r.source=t,r.context=e,this.updateTarget(n,i.targetAspect,r.observe(t,e),t,e)}unbind(t,e,s){const i=s[this.directive.nodeId],n=this.getObserver(i);n.dispose(),n.target=null,n.source=null,n.context=null}handleChange(t,e){const s=e.target,i=e.source,n=e.context;this.updateTarget(s,this.directive.targetAspect,e.observe(i,n),i,n)}}class ft{constructor(t){this.directive=t,this.sourceProperty=`${t.id}-s`,this.contextProperty=`${t.id}-c`}bind(t,e,s){const i=this.directive,n=s[i.nodeId];n[this.sourceProperty]=t,n[this.contextProperty]=e,n.addEventListener(i.targetAspect,this,i.options)}unbind(t,e,s){const i=this.directive,n=s[i.nodeId];n[this.sourceProperty]=n[this.contextProperty]=null,n.removeEventListener(i.targetAspect,this,i.options)}createBehavior(t){return this}handleEvent(t){const e=t.currentTarget;C.setEvent(t);const s=this.directive.binding(e[this.sourceProperty],e[this.contextProperty]);C.setEvent(null),!0!==s&&t.preventDefault()}}const pt=lt.define(ot.define(ut),{}),bt=lt.define(ot.define(dt),{once:!0});class gt{constructor(t,e,s){this.binding=t,this.mode=e,this.options=s,this.factory=null,this.aspectType=it.content}createHTML(t){return Y.interpolation(t(this))}createBehavior(t){return null==this.factory&&("innerHTML"===this.targetAspect&&(this.binding=rt(this.binding)),this.factory=this.mode[this.aspectType](this)),this.factory.createBehavior(t)}}function vt(t,e=pt){return"mode"in e||(e=pt(e)),new gt(t,e.mode,e.options)}function yt(t,e){const s=t.parentNode;let i,n=t;for(;n!==e;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(e)}et.define(gt,{aspected:!0});class mt{constructor(t,e,s){this.fragment=t,this.factories=e,this.targets=s,this.behaviors=null,this.source=null,this.context=null,this.firstChild=t.firstChild,this.lastChild=t.lastChild}appendTo(t){t.appendChild(this.fragment)}insertBefore(t){if(this.fragment.hasChildNodes())t.parentNode.insertBefore(this.fragment,t);else{const e=t.parentNode,s=this.lastChild;let i,n=this.firstChild;for(;n!==s;)i=n.nextSibling,e.insertBefore(n,t),n=i;e.insertBefore(s,t)}}remove(){const t=this.fragment,e=this.lastChild;let s,i=this.firstChild;for(;i!==e;)s=i.nextSibling,t.appendChild(i),i=s;t.appendChild(e)}dispose(){yt(this.firstChild,this.lastChild),this.unbind()}bind(t,e){let s=this.behaviors;const i=this.source;if(i===t)return;this.source=t,this.context=e;const n=this.targets;if(null!==i)for(let r=0,o=s.length;r<o;++r){const o=s[r];o.unbind(i,e,n),o.bind(t,e,n)}else if(null===s){this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let r=0,o=i.length;r<o;++r){const o=i[r].createBehavior(n);o.bind(t,e,n),s[r]=o}}else for(let i=0,r=s.length;i<r;++i)s[i].bind(t,e,n)}unbind(){const t=this.source;if(null===t)return;const e=this.targets,s=this.context,i=this.behaviors;for(let n=0,r=i.length;n<r;++n)i[n].unbind(t,s,e);this.source=null,this.context=null}static disposeContiguousBatch(t){if(0!==t.length){yt(t[0].firstChild,t[t.length-1].lastChild);for(let e=0,s=t.length;e<s;++e)t[e].unbind()}}}const wt=(t,e)=>`${t}.${e}`,Ct={},Tt={index:0,node:null};class St{constructor(t,e){this.fragment=t,this.directives=e,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(t,e,s,i){this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(e,s,i)),t.nodeId=s,this.factories.push(t)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(t,e,s){const i=this.descriptors;if("r"===e||"h"===e||i[e])return;if(!i[t]){const e=t.lastIndexOf("."),s=t.substring(0,e),i=parseInt(t.substring(e+1));this.addTargetDescriptor(s,t,i)}let n=Ct[e];if(!n){const i=`_${e}`;Ct[e]=n={get(){var e;return null!==(e=this[i])&&void 0!==e?e:this[i]=this[t].childNodes[s]}}}i[e]=n}createView(t){const e=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=e,s.h=null!=t?t:e;for(const t of this.nodeIds)s[t];return new mt(e,this.factories,s)}}function xt(t,e,s,i,n,r=!1){const o=s.attributes,l=t.directives;for(let h=0,c=o.length;h<c;++h){const a=o[h],d=a.value,u=Z.parse(d,l);let f=null;null===u?r&&(f=vt((()=>d),bt),it.assign(f,a.name)):f=$t.aggregate(u),null!==f&&(s.removeAttributeNode(a),h--,c--,t.addFactory(f,e,i,n))}}function Ot(t,e,s){let i=0,n=e.firstChild;for(;n;){const e=At(t,s,n,i);n=e.node,i=e.index}}function At(t,e,s,i){const n=wt(e,i);switch(s.nodeType){case 1:xt(t,e,s,n,i),Ot(t,s,n);break;case 3:return function(t,e,s,i,n){const r=Z.parse(e.textContent,t.directives);if(null===r)return Tt.node=e.nextSibling,Tt.index=n+1,Tt;let o,l=o=e;for(let e=0,h=r.length;e<h;++e){const h=r[e];0!==e&&(n++,i=wt(s,n),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),f(h)?o.textContent=h:(o.textContent=" ",t.addFactory(h,s,i,n)),l=o}return Tt.index=n+1,Tt.node=l.nextSibling,Tt}(t,s,e,n,i);case 8:const r=Z.parse(s.data,t.directives);null!==r&&t.addFactory($t.aggregate(r),e,n,i)}return Tt.index=i+1,Tt.node=s.nextSibling,Tt}const Bt={createHTML:t=>t};let jt=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",Bt):Bt;const It=jt,$t={setHTMLPolicy(t){if(jt!==It)throw c.error(1201);jt=t},compile(t,e){let s;if(f(t)){s=document.createElement("TEMPLATE"),s.innerHTML=jt.createHTML(t);const e=s.content.firstElementChild;null!==e&&"TEMPLATE"===e.tagName&&(s=e)}else s=t;const i=document.adoptNode(s.content),n=new St(i,e);return xt(n,"",s,"h",0,!0),(function(t,e){return t&&8==t.nodeType&&null!==Z.parse(t.data,e)}(i.firstChild,e)||1===i.childNodes.length&&Object.keys(e).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Ot(n,i,"r"),Tt.node=null,n.freeze()},setDefaultStrategy(t){this.compile=t},aggregate(t){if(1===t.length)return t[0];let e;const s=t.length,i=t.map((t=>f(t)?()=>t:(e=t.sourceAspect||e,t.binding))),n=vt(((t,e)=>{let n="";for(let r=0;r<s;++r)n+=i[r](t,e);return n}));return it.assign(n,e),n}};class Vt{constructor(t,e){this.result=null,this.html=t,this.factories=e}create(t){return null===this.result&&(this.result=$t.compile(this.html,this.factories)),this.result.createView(t)}render(t,e,s,i){const n=this.create(null!=s?s:e);return n.bind(t,null!=i?i:C.default),n.appendTo(e),n}}const kt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Pt(t,e,s){const i=kt.exec(e);return null!==i&&it.assign(t,i[2]),t.createHTML(s)}function Nt(t,...e){let s="";const i=Object.create(null),n=t=>{var e;const s=null!==(e=t.id)&&void 0!==e?e:t.id=X();return i[s]=t,s};for(let i=0,r=t.length-1;i<r;++i){const r=t[i],o=e[i];let l;if(s+=r,u(o))s+=Pt(vt(o),r,n);else if(f(o)){const t=kt.exec(r);if(null!==t){const e=vt((()=>o),bt);it.assign(e,t[2]),s+=e.createHTML(n)}else s+=o}else void 0===(l=et.getForInstance(o))?s+=Pt(vt((()=>o),bt),r,n):l.aspected?s+=Pt(o,r,n):s+=o.createHTML(n)}return new Vt(s+t[t.length-1],i)}class Ft extends nt{bind(t,e,s){t[this.options]=s[this.nodeId]}unbind(){}}et.define(Ft);const _t=t=>new Ft(t);function Et(t,e){const s=u(e)?e:()=>e;return(e,i)=>t(e,i)?s(e,i):null}const Mt=Object.freeze({positioning:!1,recycle:!0});function Lt(t,e,s,i){t.bind(e[s],i)}function zt(t,e,s,i){t.bind(e[s],i.createItemContext(s,e.length))}class Rt{constructor(t,e,s,i,n,r){this.location=t,this.itemsBinding=e,this.templateBinding=i,this.options=r,this.source=null,this.views=[],this.items=null,this.itemsObserver=null,this.context=void 0,this.childContext=void 0,this.bindView=Lt,this.itemsBindingObserver=v.binding(e,this,s),this.templateBindingObserver=v.binding(i,this,n),r.positioning&&(this.bindView=zt)}bind(t,e){this.source=t,this.context=e,this.childContext=e.createChildContext(t),this.items=this.itemsBindingObserver.observe(t,this.context),this.template=this.templateBindingObserver.observe(t,this.context),this.observeItems(!0),this.refreshAllViews()}unbind(){this.source=null,this.items=null,null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews(),this.itemsBindingObserver.dispose(),this.templateBindingObserver.dispose()}handleChange(t,e){t===this.itemsBinding?(this.items=this.itemsBindingObserver.observe(this.source,this.context),this.observeItems(),this.refreshAllViews()):t===this.templateBinding?(this.template=this.templateBindingObserver.observe(this.source,this.context),this.refreshAllViews(!0)):e[0].reset?this.refreshAllViews():this.updateViews(e)}observeItems(t=!1){if(!this.items)return void(this.items=a);const e=this.itemsObserver,s=this.itemsObserver=v.getNotifier(this.items),i=e!==s;i&&null!==e&&e.unsubscribe(this),(i||t)&&s.subscribe(this)}updateViews(t){const e=this.views,s=this.childContext,i=[],n=this.bindView;let r=0;for(let s=0,n=t.length;s<n;++s){const n=t[s],o=n.removed;i.push(...e.splice(n.index+r,o.length)),r-=n.addedCount}const o=this.items,l=this.template;for(let r=0,h=t.length;r<h;++r){const h=t[r];let c=h.index;const a=c+h.addedCount;for(;c<a;++c){const t=e[c],r=t?t.firstChild:this.location,h=this.options.recycle&&i.length>0?i.shift():l.create();e.splice(c,0,h),n(h,o,c,s),h.insertBefore(r)}}for(let t=0,e=i.length;t<e;++t)i[t].dispose();if(this.options.positioning)for(let t=0,s=e.length;t<s;++t)e[t].context.updatePosition(t,s)}refreshAllViews(t=!1){const e=this.items,s=this.template,i=this.location,n=this.bindView,r=this.childContext;let o=e.length,l=this.views,h=l.length;if(0!==o&&!t&&this.options.recycle||(mt.disposeContiguousBatch(l),h=0),0===h){this.views=l=new Array(o);for(let t=0;t<o;++t){const o=s.create();n(o,e,t,r),l[t]=o,o.insertBefore(i)}}else{let t=0;for(;t<o;++t)if(t<h){n(l[t],e,t,r)}else{const o=s.create();n(o,e,t,r),l.push(o),o.insertBefore(i)}const c=l.splice(t,h-t);for(t=0,o=c.length;t<o;++t)c[t].dispose()}}unbindAllViews(){const t=this.views;for(let e=0,s=t.length;e<s;++e)t[e].unbind()}}class Ht{constructor(t,e,s){this.itemsBinding=t,this.templateBinding=e,this.options=s,V.enable(),this.isItemsBindingVolatile=v.isVolatileBinding(t),this.isTemplateBindingVolatile=v.isVolatileBinding(e)}createHTML(t){return Y.comment(t(this))}createBehavior(t){return new Rt(t[this.nodeId],this.itemsBinding,this.isItemsBindingVolatile,this.templateBinding,this.isTemplateBindingVolatile,this.options)}}function qt(t,e,s=Mt){const i=u(e)?e:()=>e;return new Ht(t,i,s)}et.define(Ht);const Dt=t=>1===t.nodeType,Qt=t=>t?e=>1===e.nodeType&&e.matches(t):Dt;class Ut extends nt{constructor(){super(...arguments),this.sourceProperty=`${this.id}-s`}bind(t,e,s){const i=s[this.nodeId];i[this.sourceProperty]=t,this.updateTarget(t,this.computeNodes(i)),this.observe(i)}unbind(t,e,s){const i=s[this.nodeId];this.updateTarget(t,a),this.disconnect(i),i[this.sourceProperty]=null}getSource(t){return t[this.sourceProperty]}updateTarget(t,e){t[this.options.property]=e}computeNodes(t){let e=this.getNodes(t);return"filter"in this.options&&(e=e.filter(this.options.filter)),e}}class Wt extends Ut{observe(t){t.addEventListener("slotchange",this)}disconnect(t){t.removeEventListener("slotchange",this)}getNodes(t){return t.assignedNodes(this.options)}handleEvent(t){const e=t.currentTarget;this.updateTarget(this.getSource(e),this.computeNodes(e))}}function Gt(t){return f(t)&&(t={property:t}),new Wt(t)}et.define(Wt);class Jt extends Ut{constructor(t){super(t),this.observerProperty=`${this.id}-o`,this.handleEvent=(t,e)=>{const s=e.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},t.childList=!0}observe(t){var e;const s=null!==(e=t[this.observerProperty])&&void 0!==e?e:t[this.observerProperty]=new MutationObserver(this.handleEvent);s.target=t,s.observe(t,this.options)}disconnect(t){const e=t[this.observerProperty];e.target=null,e.disconnect()}getNodes(t){return"selector"in this.options?Array.from(t.querySelectorAll(this.options.selector)):Array.from(t.childNodes)}}function Kt(t){return f(t)&&(t={property:t}),new Jt(t)}et.define(Jt);const Xt={toView:t=>t?"true":"false",fromView:t=>null!=t&&"false"!==t&&!1!==t&&0!==t};function Yt(t){if(null==t)return null;const e=1*t;return isNaN(e)?null:e}const Zt={toView(t){const e=Yt(t);return e?e.toString():e},fromView:Yt};class te{constructor(t,e,s=e.toLowerCase(),i="reflect",n){this.guards=new Set,this.Owner=t,this.name=e,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${e}`,this.callbackName=`${e}Changed`,this.hasCallback=this.callbackName in t.prototype,"boolean"===i&&void 0===n&&(this.converter=Xt)}setValue(t,e){const s=t[this.fieldName],i=this.converter;void 0!==i&&(e=i.fromView(e)),s!==e&&(t[this.fieldName]=e,this.tryReflectToAttribute(t),this.hasCallback&&t[this.callbackName](s,e),t.$fastController.notify(this.name))}getValue(t){return v.track(t,this.name),t[this.fieldName]}onAttributeChangedCallback(t,e){this.guards.has(t)||(this.guards.add(t),this.setValue(t,e),this.guards.delete(t))}tryReflectToAttribute(t){const e=this.mode,s=this.guards;s.has(t)||"fromView"===e||p.enqueue((()=>{s.add(t);const i=t[this.fieldName];switch(e){case"reflect":const e=this.converter;Q.setAttribute(t,this.attribute,void 0!==e?e.toView(i):i);break;case"boolean":Q.setBooleanAttribute(t,this.attribute,i)}s.delete(t)}))}static collect(t,...e){const s=[];e.push(t.attributes);for(let i=0,n=e.length;i<n;++i){const n=e[i];if(void 0!==n)for(let e=0,i=n.length;e<i;++e){const i=n[e];f(i)?s.push(new te(t,i)):s.push(new te(t,i.property,i.attribute,i.mode,i.converter))}}return s}}function ee(t,e){let s;function i(t,e){arguments.length>1&&(s.property=e);const i=t.constructor.attributes||(t.constructor.attributes=[]);i.push(s)}return arguments.length>1?(s={},void i(t,e)):(s=void 0===t?{}:t,i)}const se={mode:"open"},ie={},ne=c.getById(4,(()=>d()));class re{constructor(t,e=t.definition){f(e)&&(e={name:e}),this.type=t,this.name=e.name,this.template=e.template;const s=te.collect(t,e.attributes),i=new Array(s.length),n={},r={};for(let t=0,e=s.length;t<e;++t){const e=s[t];i[t]=e.attribute,n[e.name]=e,r[e.attribute]=e}this.attributes=s,this.observedAttributes=i,this.propertyLookup=n,this.attributeLookup=r,this.shadowOptions=void 0===e.shadowOptions?se:null===e.shadowOptions?void 0:Object.assign(Object.assign({},se),e.shadowOptions),this.elementOptions=void 0===e.elementOptions?ie:Object.assign(Object.assign({},ie),e.elementOptions),this.styles=void 0===e.styles?void 0:Array.isArray(e.styles)?new _(e.styles):e.styles instanceof _?e.styles:new _([e.styles])}get isDefined(){return!!ne.getByType(this.type)}define(t=customElements){const e=this.type;if(ne.register(this)){const t=this.attributes,s=e.prototype;for(let e=0,i=t.length;e<i;++e)v.defineProperty(s,t[e]);Reflect.defineProperty(e,"observedAttributes",{value:this.observedAttributes,enumerable:!0})}return t.get(this.name)||t.define(this.name,e,this.elementOptions),this}}re.getByType=ne.getByType,re.getForInstance=ne.getForInstance;const oe=new WeakMap,le={bubbles:!0,composed:!0,cancelable:!0};function he(t){var e,s;return null!==(s=null!==(e=t.shadowRoot)&&void 0!==e?e:oe.get(t))&&void 0!==s?s:null}class ce extends g{constructor(t,e){super(t),this.boundObservables=null,this.behaviors=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this._styles=null,this._isConnected=!1,this.$fastController=this,this.view=null,this.element=t,this.definition=e;const s=e.shadowOptions;if(void 0!==s){let e=t.shadowRoot;e?this.hasExistingShadowRoot=!0:(e=t.attachShadow(s),"closed"===s.mode&&oe.set(t,e))}const i=v.getAccessors(t);if(i.length>0){const e=this.boundObservables=Object.create(null);for(let s=0,n=i.length;s<n;++s){const n=i[s].name,r=t[n];void 0!==r&&(delete t[n],e[n]=r)}}}get isConnected(){return v.track(this,"isConnected"),this._isConnected}setIsConnected(t){this._isConnected=t,v.notify(this,"isConnected")}get template(){var t;if(null===this._template){const e=this.definition;this.element.resolveTemplate?this._template=this.element.resolveTemplate():e.template&&(this._template=null!==(t=e.template)&&void 0!==t?t:null)}return this._template}set template(t){this._template!==t&&(this._template=t,this.needsInitialization||this.renderTemplate(t))}get styles(){var t;if(null===this._styles){const e=this.definition;this.element.resolveStyles?this._styles=this.element.resolveStyles():e.styles&&(this._styles=null!==(t=e.styles)&&void 0!==t?t:null)}return this._styles}set styles(t){this._styles!==t&&(null!==this._styles&&this.removeStyles(this._styles),this._styles=t,this.needsInitialization||this.addStyles(t))}addStyles(t){if(!t)return;const e=he(this.element)||this.element.getRootNode();if(t instanceof HTMLElement)e.append(t);else if(!t.isAttachedTo(e)){const s=t.behaviors;t.addStylesTo(e),null!==s&&this.addBehaviors(s)}}removeStyles(t){if(!t)return;const e=he(this.element)||this.element.getRootNode();if(t instanceof HTMLElement)e.removeChild(t);else if(t.isAttachedTo(e)){const s=t.behaviors;t.removeStylesFrom(e),null!==s&&this.removeBehaviors(s)}}addBehaviors(t){var e;const s=null!==(e=this.behaviors)&&void 0!==e?e:this.behaviors=new Map,i=t.length,n=[];for(let e=0;e<i;++e){const i=t[e];s.has(i)?s.set(i,s.get(i)+1):(s.set(i,1),n.push(i))}if(this._isConnected){const t=this.element,e=C.default;for(let s=0;s<n.length;++s)n[s].bind(t,e)}}removeBehaviors(t,e=!1){const s=this.behaviors;if(null===s)return;const i=t.length,n=[];for(let r=0;r<i;++r){const i=t[r];if(s.has(i)){const t=s.get(i)-1;0===t||e?s.delete(i)&&n.push(i):s.set(i,t)}}if(this._isConnected){const t=this.element,e=C.default;for(let s=0;s<n.length;++s)n[s].unbind(t,e)}}onConnectedCallback(){if(this._isConnected)return;const t=this.element,e=C.default;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(t,e);const s=this.behaviors;if(null!==s)for(const i of s.keys())i.bind(t,e);this.setIsConnected(!0)}onDisconnectedCallback(){if(!this._isConnected)return;this.setIsConnected(!1);const t=this.view;null!==t&&t.unbind();const e=this.behaviors;if(null!==e){const t=this.element,s=C.default;for(const i of e.keys())i.unbind(t,s)}}onAttributeChangedCallback(t,e,s){const i=this.definition.attributeLookup[t];void 0!==i&&i.onAttributeChangedCallback(this.element,s)}emit(t,e,s){return!!this._isConnected&&this.element.dispatchEvent(new CustomEvent(t,Object.assign(Object.assign({detail:e},le),s)))}finishInitialization(){const t=this.element,e=this.boundObservables;if(null!==e){const s=Object.keys(e);for(let i=0,n=s.length;i<n;++i){const n=s[i];t[n]=e[n]}this.boundObservables=null}this.renderTemplate(this.template),this.addStyles(this.styles),this.needsInitialization=!1}renderTemplate(t){var e;const s=this.element,i=null!==(e=he(s))&&void 0!==e?e:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let t=i.firstChild;null!==t;t=i.firstChild)i.removeChild(t)}t&&(this.view=t.render(s,i,s))}static forCustomElement(t){const e=t.$fastController;if(void 0!==e)return e;const s=re.getForInstance(t);if(void 0===s)throw c.error(1401);return t.$fastController=new ce(t,s)}}function ae(t){return class extends t{constructor(){super(),ce.forCustomElement(this)}$emit(t,e,s){return this.$fastController.emit(t,e,s)}connectedCallback(){this.$fastController.onConnectedCallback()}disconnectedCallback(){this.$fastController.onDisconnectedCallback()}attributeChangedCallback(t,e,s){this.$fastController.onAttributeChangedCallback(t,e,s)}}}const de=Object.assign(ae(HTMLElement),{from:t=>ae(t),define(t,e){return this.metadata(t,e).define().type},metadata:(t,e)=>new re(t,e)});function ue(t){return function(e){de.define(e,t)}}export{E as AdoptedStyleSheetsStrategy,V as ArrayObserver,it as Aspect,te as AttributeDefinition,lt as BindingConfig,ot as BindingMode,L as CSSDirective,ut as ChangeBinding,Jt as ChildrenDirective,$t as Compiler,ce as Controller,Q as DOM,_ as ElementStyles,ft as EventBinding,C as ExecutionContext,c as FAST,de as FASTElement,re as FASTElementDefinition,gt as HTMLBindingDirective,et as HTMLDirective,mt as HTMLView,Y as Markup,Ut as NodeObservationDirective,v as Observable,dt as OneTimeBinding,Z as Parser,g as PropertyChangeNotifier,Ft as RefDirective,Rt as RepeatBehavior,Ht as RepeatDirective,Wt as SlottedDirective,T as Splice,B as SpliceStrategy,S as SpliceStrategySupport,nt as StatelessAttachedAttributeDirective,b as SubscriberSet,ht as UpdateBinding,p as Updates,Vt as ViewTemplate,ee as attr,vt as bind,Xt as booleanConverter,Kt as children,d as createTypeRegistry,H as css,z as cssDirective,D as cssPartial,ue as customElement,Qt as elements,a as emptyArray,Nt as html,st as htmlDirective,k as lengthOf,Zt as nullableNumberConverter,y as observable,pt as onChange,bt as oneTime,_t as ref,qt as repeat,Gt as slotted,m as volatile,Et as when}; |
@@ -1,1 +0,1 @@ | ||
!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const t=new Function("return this")();t.globalThis=t}}(),globalThis.trustedTypes||(globalThis.trustedTypes={createPolicy:(t,e)=>e});const t={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},t));const e=globalThis.FAST;if(void 0===e.getById){const s=Object.create(null);Reflect.defineProperty(e,"getById",Object.assign({value(t,e){let i=s[t];return void 0===i&&(i=e?s[t]=e():null),i}},t))}const s=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;function i(t){return t===document?document.body:t}let n=0;class r{constructor(t){this.styles=t,this.styleClass="fast-"+ ++n}addStylesTo(t){t=i(t);const e=this.styles,s=this.styleClass;for(let i=0;i<e.length;i++){const n=document.createElement("style");n.innerHTML=e[i],n.className=s,t.append(n)}}removeStylesFrom(t){const e=t.querySelectorAll(`.${this.styleClass}`);t=i(t);for(let s=0,i=e.length;s<i;++s)t.removeChild(e[s])}}s||e.getById(5,(()=>r));const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const l=globalThis.FAST;if(void 0===l.getById){const t=Object.create(null);Reflect.defineProperty(l,"getById",Object.assign({value(e,s){let i=t[e];return void 0===i&&(i=s?t[e]=s():null),i}},o))}void 0===l.error&&Object.assign(l,{warn(){},error:t=>new Error(`Code ${t}`),addMessages(){}});const h=Object.freeze([]);function c(){const t=new Map;return Object.freeze({register:e=>!t.has(e.type)&&(t.set(e.type,e),!0),getByType:e=>t.get(e),getForInstance:e=>t.get(e.constructor)})}const a=t=>"function"==typeof t,d=t=>"string"==typeof t,u=l.getById(1,(()=>{const t=[],e=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(e.length)throw e.shift()}function r(s){try{s.call()}catch(s){if(!i)throw t.length=0,s;e.push(s),setTimeout(n,0)}}function o(){let e=0;for(;e<t.length;)if(r(t[e]),e++,e>1024){for(let s=0,i=t.length-e;s<i;s++)t[s]=t[s+e];t.length-=e,e=0}t.length=0}function l(e){t.push(e),t.length<2&&(i?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:t=>i=t})}));class f{constructor(t,e){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=t,this.sub1=e}has(t){return void 0===this.spillover?this.sub1===t||this.sub2===t:-1!==this.spillover.indexOf(t)}subscribe(t){const e=this.spillover;if(void 0===e){if(this.has(t))return;if(void 0===this.sub1)return void(this.sub1=t);if(void 0===this.sub2)return void(this.sub2=t);this.spillover=[this.sub1,this.sub2,t],this.sub1=void 0,this.sub2=void 0}else{-1===e.indexOf(t)&&e.push(t)}}unsubscribe(t){const e=this.spillover;if(void 0===e)this.sub1===t?this.sub1=void 0:this.sub2===t&&(this.sub2=void 0);else{const s=e.indexOf(t);-1!==s&&e.splice(s,1)}}notify(t){const e=this.spillover,s=this.subject;if(void 0===e){const e=this.sub1,i=this.sub2;void 0!==e&&e.handleChange(s,t),void 0!==i&&i.handleChange(s,t)}else for(let i=0,n=e.length;i<n;++i)e[i].handleChange(s,t)}}class p{constructor(t){this.subscribers={},this.subjectSubscribers=null,this.subject=t}notify(t){var e,s;null===(e=this.subscribers[t])||void 0===e||e.notify(t),null===(s=this.subjectSubscribers)||void 0===s||s.notify(t)}subscribe(t,e){var s,i;let n;n=e?null!==(s=this.subscribers[e])&&void 0!==s?s:this.subscribers[e]=new f(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new f(this.subject),n.subscribe(t)}unsubscribe(t,e){var s,i;e?null===(s=this.subscribers[e])||void 0===s||s.unsubscribe(t):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(t)}}const g=l.getById(2,(()=>{const t=u.enqueue,e=/(:|&&|\|\||if)/,s=new WeakMap,i=new WeakMap;let n,r=t=>{throw l.error(1101)};function o(t){var e;let i=null!==(e=t.$fastController)&&void 0!==e?e:s.get(t);return void 0===i&&(Array.isArray(t)?i=r(t):s.set(t,i=new p(t))),i}function h(t){let e=i.get(t);if(void 0===e){let s=Reflect.getPrototypeOf(t);for(;void 0===e&&null!==s;)e=i.get(s),s=Reflect.getPrototypeOf(s);e=void 0===e?[]:e.slice(0),i.set(t,e)}return e}class c{constructor(t){this.name=t,this.field=`_${t}`,this.callback=`${t}Changed`}getValue(t){return void 0!==n&&n.watch(t,this.name),t[this.field]}setValue(t,e){const s=this.field,i=t[s];if(i!==e){t[s]=e;const n=t[this.callback];a(n)&&n.call(t,i,e),o(t).notify(this.name)}}}class g extends f{constructor(t,e,s=!1){super(t,e),this.binding=t,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(t){this.isAsync=this.needsQueue=t}observe(t,e){this.needsRefresh&&null!==this.last&&this.dispose();const s=n;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const i=this.binding(t,null!=e?e:w.default);return n=s,i}dispose(){if(null!==this.last){let t=this.first;for(;void 0!==t;)t.notifier.unsubscribe(this,t.propertyName),t=t.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(t,e){const s=this.last,i=o(t),r=null===s?this.first:{};if(r.propertySource=t,r.propertyName=e,r.notifier=i,i.subscribe(this,e),null!==s){if(!this.needsRefresh){let e;n=void 0,e=s.propertySource[s.propertyName],n=this,t===e&&(this.needsRefresh=!0)}s.next=r}this.last=r}handleChange(){this.needsQueue?(this.needsQueue=!1,t(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let t=this.first;for(;void 0!==t;)yield t,t=t.next}}return Object.freeze({setArrayObserverFactory(t){r=t},getNotifier:o,track(t,e){n&&n.watch(t,e)},trackVolatile(){n&&(n.needsRefresh=!0)},notify(t,e){o(t).notify(e)},defineProperty(t,e){d(e)&&(e=new c(e)),h(t).push(e),Reflect.defineProperty(t,e.name,{enumerable:!0,get(){return e.getValue(this)},set(t){e.setValue(this,t)}})},getAccessors:h,binding(t,e,s=this.isVolatileBinding(t)){return new g(t,e,s)},isVolatileBinding:t=>e.test(t.toString())})}));function b(t,e){g.defineProperty(t,e)}function v(t,e,s){return Object.assign({},s,{get(){return g.trackVolatile(),s.get.apply(this)}})}const y=l.getById(3,(()=>{let t=null;return{get:()=>t,set(e){t=e}}}));class m{constructor(t=null,e=null){this.index=0,this.length=0,this.parent=t,this.parentContext=e}get event(){return y.get()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}updatePosition(t,e){this.index=t,this.length=e}createChildContext(t){return new m(t,this)}createItemContext(t,e){const s=Object.create(this);return s.index=t,s.length=e,s}}g.defineProperty(m.prototype,"index"),g.defineProperty(m.prototype,"length");const w=Object.freeze({default:new m,setEvent(t){y.set(t)},create:()=>new m});class C{constructor(t,e,s){this.index=t,this.removed=e,this.addedCount=s}adjustTo(t){let e=this.index;const s=t.length;return e>s?e=s-this.addedCount:e<0&&(e=s+this.removed.length+e-this.addedCount),this.index=e<0?0:e,this}}const T=Object.freeze({reset:1,splice:2,optimized:3}),x=new C(0,h,0);x.reset=!0;const S=[x];let O=Object.freeze({support:T.splice,normalize:(t,e,s)=>void 0===t?null!=s?s:h:S,pop(t,e,s,i){const n=t.length>0,r=s.apply(t,i);return n&&e.addSplice(new C(t.length,[r],0)),r},push(t,e,s,i){const n=s.apply(t,i);return e.addSplice(new C(t.length-i.length,[],i.length).adjustTo(t)),n},reverse(t,e,s,i){const n=s.apply(t,i);return e.reset(t),n},shift(t,e,s,i){const n=t.length>0,r=s.apply(t,i);return n&&e.addSplice(new C(0,[r],0)),r},sort(t,e,s,i){const n=s.apply(t,i);return e.reset(t),n},splice(t,e,s,i){const n=s.apply(t,i);return e.addSplice(new C(+i[0],n,i.length>2?i.length-2:0).adjustTo(t)),n},unshift(t,e,s,i){const n=s.apply(t,i);return e.addSplice(new C(0,[],i.length).adjustTo(t)),n}});const A=Object.freeze({reset:S,setDefaultStrategy(t){O=t}});function B(t,e,s){Reflect.defineProperty(t,e,{value:s,enumerable:!1})}class j extends f{constructor(t){super(t),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,B(t,"$fastController",this)}get strategy(){return this._strategy}set strategy(t){this._strategy=t}get lengthObserver(){let t=this._lengthObserver;if(void 0===t){const e=this.subject;this._lengthObserver=t={length:e.length,handleChange(){this.length!==e.length&&(this.length=e.length,g.notify(t,"length"))}},this.subscribe(t)}return t}subscribe(t){this.flush(),super.subscribe(t)}addSplice(t){void 0===this.splices?this.splices=[t]:this.splices.push(t),this.enqueue()}reset(t){this.oldCollection=t,this.enqueue()}flush(){var t;const e=this.splices,s=this.oldCollection;void 0===e&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(t=this._strategy)&&void 0!==t?t:O).normalize(s,this.subject,e)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,u.enqueue(this))}}let I=!1;const $=Object.freeze({enable(){if(I)return;I=!0,g.setArrayObserverFactory((t=>new j(t)));const t=Array.prototype;t.$fastPatch||(B(t,"$fastPatch",1),[t.pop,t.push,t.reverse,t.shift,t.sort,t.splice,t.unshift].forEach((e=>{t[e.name]=function(...t){var s;const i=this.$fastController;return void 0===i?e.apply(this,t):(null!==(s=i.strategy)&&void 0!==s?s:O)[e.name](this,i,e,t)}})))}});function V(t){if(!t)return 0;let e=t.$fastController;return void 0===e&&($.enable(),e=g.getNotifier(t)),g.track(e.lengthObserver,"length"),t.length}const k=new Map;let P;function E(t){return t.map((t=>t instanceof N?E(t.styles):[t])).reduce(((t,e)=>t.concat(e)),[])}class N{constructor(t){this.styles=t,this.targets=new WeakSet,this._strategy=null,this.behaviors=t.map((t=>t instanceof N?t.behaviors:null)).reduce(((t,e)=>null===e?t:null===t?e:t.concat(e)),null)}get strategy(){return null===this._strategy&&this.withStrategy(P),this._strategy}addStylesTo(t){this.strategy.addStylesTo(t),this.targets.add(t)}removeStylesFrom(t){this.strategy.removeStylesFrom(t),this.targets.delete(t)}isAttachedTo(t){return this.targets.has(t)}withBehaviors(...t){return this.behaviors=null===this.behaviors?t:this.behaviors.concat(t),this}withStrategy(t){return this._strategy=new t(E(this.styles)),this}static setDefaultStrategy(t){P=t}}N.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;class _{constructor(t){this.sheets=t.map((t=>{if(t instanceof CSSStyleSheet)return t;let e=k.get(t);return void 0===e&&(e=new CSSStyleSheet,e.replaceSync(t),k.set(t,e)),e}))}addStylesTo(t){t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(t){const e=this.sheets;t.adoptedStyleSheets=t.adoptedStyleSheets.filter((t=>-1===e.indexOf(t)))}}N.setDefaultStrategy(l.getById(5,(()=>_)));const L=c(),F=Object.freeze({getForInstance:L.getForInstance,getByType:L.getByType,define:t=>(L.register({type:t}),t)});function z(){return function(t){F.define(t)}}function M(t,e){const s=[];let i="";const n=[],r=t=>{n.push(t)};for(let n=0,o=t.length-1;n<o;++n){i+=t[n];let o=e[n];void 0!==F.getForInstance(o)&&(o=o.createCSS(r)),o instanceof N||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=t[t.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const R=(t,...e)=>{const{styles:s,behaviors:i}=M(t,e),n=new N(s);return i.length?n.withBehaviors(...i):n};class H{constructor(t,e){this.behaviors=e,this.css="";const s=t.reduce(((t,e)=>(d(e)?this.css+=e:t.push(e),t)),[]);s.length&&(this.styles=new N(s))}createCSS(t){return this.behaviors.forEach(t),this.styles&&t(this),this.css}bind(t){t.$fastController.addStyles(this.styles)}unbind(t){t.$fastController.removeStyles(this.styles)}}F.define(H);const q=R.partial=(t,...e)=>{const{styles:s,behaviors:i}=M(t,e);return new H(s,i)},D=Object.freeze({queueUpdate:u.enqueue,nextUpdate:u.next,processUpdates:u.process,setAttribute(t,e,s){null==s?t.removeAttribute(e):t.setAttribute(e,s)},setBooleanAttribute(t,e,s){s?t.setAttribute(e,""):t.removeAttribute(e)}}),Q=`fast-${Math.random().toString(36).substring(2,8)}`,W=`${Q}{`,U=`}${Q}`,G=U.length;let J=0;const K=()=>`${Q}-${++J}`,X=Object.freeze({interpolation:t=>`${W}${t}${U}`,attribute:t=>`${K()}="${W}${t}${U}"`,comment:t=>`\x3c!--${W}${t}${U}--\x3e`}),Y=Object.freeze({parse(t,e){const s=t.split(W);if(1===s.length)return null;const i=[];for(let t=0,n=s.length;t<n;++t){const n=s[t],r=n.indexOf(U);let o;if(-1===r)o=n;else{const t=n.substring(0,r);i.push(e[t]),o=n.substring(r+G)}""!==o&&i.push(o)}return i}}),Z=c(),tt=Object.freeze({getForInstance:Z.getForInstance,getByType:Z.getByType,define:(t,e)=>((e=e||{}).type=t,Z.register(e),t)});function et(t){return function(e){tt.define(e,t)}}const st=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6,assign(t,e){if(t.sourceAspect=e,e)switch(e[0]){case":":switch(t.targetAspect=e.substring(1),t.targetAspect){case"innerHTML":default:t.aspectType=st.property;break;case"classList":t.aspectType=st.tokenList}break;case"?":t.targetAspect=e.substring(1),t.aspectType=st.booleanAttribute;break;case"@":t.targetAspect=e.substring(1),t.aspectType=st.event;break;default:"class"===e?(t.targetAspect="className",t.aspectType=st.property):(t.targetAspect=e,t.aspectType=st.attribute)}}});class it{constructor(t){this.options=t}createBehavior(t){return this}createHTML(t){return X.attribute(t(this))}}const nt=globalThis.TrustedHTML?t=>(e,s)=>{const i=t(e,s);if(i instanceof TrustedHTML)return i;throw l.error(1202)}:t=>t,rt=Object.freeze({define:(t,e=pt)=>Object.freeze({1:e=>new t(e,D.setAttribute),2:e=>new t(e,D.setBooleanAttribute),3:e=>new t(e,((t,e,s)=>t[e]=s)),4:e=>{return new(s=t,class extends s{unbind(t,e,s){super.unbind(t,e,s);const i=s[this.directive.nodeId].$fastView;void 0!==i&&i.isComposed&&(i.unbind(),i.needsBindOnly=!0)}})(e,ht);var s},5:e=>new t(e,ct),6:t=>new e(t)})}),ot=Object.freeze({define(t,e){const s=t=>({mode:s.mode,options:Object.assign({},e,t)});return s.options=e,s.mode=t,s}});class lt{constructor(t,e){this.directive=t,this.updateTarget=e}bind(t,e,s){}unbind(t,e,s){}createBehavior(t){return this}}function ht(t,e,s,i,n){if(null==s&&(s=""),s.create){t.textContent="";let e=t.$fastView;void 0===e?e=s.create():t.$fastTemplate!==s&&(e.isComposed&&(e.remove(),e.unbind()),e=s.create()),e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(i,n)):(e.isComposed=!0,e.bind(i,n),e.insertBefore(t),t.$fastView=e,t.$fastTemplate=s)}else{const e=t.$fastView;void 0!==e&&e.isComposed&&(e.isComposed=!1,e.remove(),e.needsBindOnly?e.needsBindOnly=!1:e.unbind()),t.textContent=s}}function ct(t,e,s){var i;const n=`${this.directive.id}-t`,r=null!==(i=t[n])&&void 0!==i?i:t[n]={c:0,v:Object.create(null)},o=r.v;let l=r.c;const h=t[e];if(null!=s&&s.length){const t=s.split(/\s+/);for(let e=0,s=t.length;e<s;++e){const s=t[e];""!==s&&(o[s]=l,h.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const t in o)o[t]===l&&h.remove(t)}}class at extends lt{bind(t,e,s){const i=this.directive;this.updateTarget(s[i.nodeId],i.targetAspect,i.binding(t,e),t,e)}}const dt=Object.create(null);class ut extends lt{constructor(){super(...arguments),this.handlerProperty=`${this.directive.id}-h`}bind(t,e,s){const i=this.directive,n=s[i.nodeId],r=this.getSignal(t,e),o=n[this.handlerProperty]=()=>{this.updateTarget(n,i.targetAspect,i.binding(t,e),t,e)};o();const l=dt[r];l?Array.isArray(l)?l.push(o):dt[r]=[l,o]:dt[r]=o}unbind(t,e,s){const i=this.getSignal(t,e),n=dt[i];if(n&&Array.isArray(n)){const t=s[this.directive.nodeId][this.handlerProperty],e=n.indexOf(t);-1!==e&&n.splice(e,1)}else dt[i]=void 0}getSignal(t,e){const s=this.directive.options;return d(s)?s:s(t,e)}static send(t){const e=dt[t];e&&(Array.isArray(e)?e.forEach((t=>t())):e())}}class ft extends lt{constructor(t,e){super(t,e),this.isBindingVolatile=g.isVolatileBinding(t.binding),this.observerProperty=`${t.id}-o`}getObserver(t){var e;return null!==(e=t[this.observerProperty])&&void 0!==e?e:t[this.observerProperty]=g.binding(this.directive.binding,this,this.isBindingVolatile)}bind(t,e,s){const i=this.directive,n=s[i.nodeId],r=this.getObserver(n);r.target=n,r.source=t,r.context=e,this.updateTarget(n,i.targetAspect,r.observe(t,e),t,e)}unbind(t,e,s){const i=s[this.directive.nodeId],n=this.getObserver(i);n.dispose(),n.target=null,n.source=null,n.context=null}handleChange(t,e){const s=e.target,i=e.source,n=e.context;this.updateTarget(s,this.directive.targetAspect,e.observe(i,n),i,n)}}class pt{constructor(t){this.directive=t,this.sourceProperty=`${t.id}-s`,this.contextProperty=`${t.id}-c`}bind(t,e,s){const i=this.directive,n=s[i.nodeId];n[this.sourceProperty]=t,n[this.contextProperty]=e,n.addEventListener(i.targetAspect,this,i.options)}unbind(t,e,s){const i=this.directive,n=s[i.nodeId];n[this.sourceProperty]=n[this.contextProperty]=null,n.removeEventListener(i.targetAspect,this,i.options)}createBehavior(t){return this}handleEvent(t){const e=t.currentTarget;w.setEvent(t);const s=this.directive.binding(e[this.sourceProperty],e[this.contextProperty]);w.setEvent(null),!0!==s&&t.preventDefault()}}let gt={determineChangeEvent:()=>"change"};class bt extends ft{bind(t,e,s){var i;super.bind(t,e,s);const n=this.directive,r=s[n.nodeId];this.changeEvent||(this.changeEvent=null!==(i=n.options.changeEvent)&&void 0!==i?i:gt.determineChangeEvent(n,r)),r.addEventListener(this.changeEvent,this)}unbind(t,e,s){super.unbind(t,e,s),s[this.directive.nodeId].removeEventListener(this.changeEvent,this)}handleEvent(t){const e=this.directive,s=t.currentTarget;let i;switch(e.aspectType){case 1:i=s.getAttribute(e.targetAspect);break;case 2:i=s.hasAttribute(e.targetAspect);break;case 4:i=s.innerText;break;default:i=s[e.targetAspect]}const n=this.getObserver(s).last;n.propertySource[n.propertyName]=e.options.fromView(i)}static configure(t){gt=t}}const vt=ot.define(rt.define(ft),{}),yt=ot.define(rt.define(bt),{fromView:t=>t}),mt=ot.define(rt.define(at),{once:!0}),wt=rt.define(ut),Ct=t=>({mode:wt,options:t});class Tt{constructor(t,e,s){this.binding=t,this.mode=e,this.options=s,this.factory=null,this.aspectType=st.content}createHTML(t){return X.interpolation(t(this))}createBehavior(t){return null==this.factory&&("innerHTML"===this.targetAspect&&(this.binding=nt(this.binding)),this.factory=this.mode[this.aspectType](this)),this.factory.createBehavior(t)}}function xt(t,e=vt){return"mode"in e||(e=vt(e)),new Tt(t,e.mode,e.options)}function St(t,e){const s=t.parentNode;let i,n=t;for(;n!==e;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(e)}tt.define(Tt,{aspected:!0});class Ot{constructor(t,e,s){this.fragment=t,this.factories=e,this.targets=s,this.behaviors=null,this.source=null,this.context=null,this.firstChild=t.firstChild,this.lastChild=t.lastChild}appendTo(t){t.appendChild(this.fragment)}insertBefore(t){if(this.fragment.hasChildNodes())t.parentNode.insertBefore(this.fragment,t);else{const e=t.parentNode,s=this.lastChild;let i,n=this.firstChild;for(;n!==s;)i=n.nextSibling,e.insertBefore(n,t),n=i;e.insertBefore(s,t)}}remove(){const t=this.fragment,e=this.lastChild;let s,i=this.firstChild;for(;i!==e;)s=i.nextSibling,t.appendChild(i),i=s;t.appendChild(e)}dispose(){St(this.firstChild,this.lastChild),this.unbind()}bind(t,e){let s=this.behaviors;const i=this.source;if(i===t)return;this.source=t,this.context=e;const n=this.targets;if(null!==i)for(let r=0,o=s.length;r<o;++r){const o=s[r];o.unbind(i,e,n),o.bind(t,e,n)}else if(null===s){this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let r=0,o=i.length;r<o;++r){const o=i[r].createBehavior(n);o.bind(t,e,n),s[r]=o}}else for(let i=0,r=s.length;i<r;++i)s[i].bind(t,e,n)}unbind(){const t=this.source;if(null===t)return;const e=this.targets,s=this.context,i=this.behaviors;for(let n=0,r=i.length;n<r;++n)i[n].unbind(t,s,e);this.source=null,this.context=null}static disposeContiguousBatch(t){if(0!==t.length){St(t[0].firstChild,t[t.length-1].lastChild);for(let e=0,s=t.length;e<s;++e)t[e].unbind()}}}const At=(t,e)=>`${t}.${e}`,Bt={},jt={index:0,node:null};class It{constructor(t,e){this.fragment=t,this.directives=e,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(t,e,s,i){this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(e,s,i)),t.nodeId=s,this.factories.push(t)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(t,e,s){const i=this.descriptors;if("r"===e||"h"===e||i[e])return;if(!i[t]){const e=t.lastIndexOf("."),s=t.substring(0,e),i=parseInt(t.substring(e+1));this.addTargetDescriptor(s,t,i)}let n=Bt[e];if(!n){const i=`_${e}`;Bt[e]=n={get(){var e;return null!==(e=this[i])&&void 0!==e?e:this[i]=this[t].childNodes[s]}}}i[e]=n}createView(t){const e=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=e,s.h=null!=t?t:e;for(const t of this.nodeIds)s[t];return new Ot(e,this.factories,s)}}function $t(t,e,s,i,n,r=!1){const o=s.attributes,l=t.directives;for(let h=0,c=o.length;h<c;++h){const a=o[h],d=a.value,u=Y.parse(d,l);let f=null;null===u?r&&(f=xt((()=>d),mt),st.assign(f,a.name)):f=_t.aggregate(u),null!==f&&(s.removeAttributeNode(a),h--,c--,t.addFactory(f,e,i,n))}}function Vt(t,e,s){let i=0,n=e.firstChild;for(;n;){const e=kt(t,s,n,i);n=e.node,i=e.index}}function kt(t,e,s,i){const n=At(e,i);switch(s.nodeType){case 1:$t(t,e,s,n,i),Vt(t,s,n);break;case 3:return function(t,e,s,i,n){const r=Y.parse(e.textContent,t.directives);if(null===r)return jt.node=e.nextSibling,jt.index=n+1,jt;let o,l=o=e;for(let e=0,h=r.length;e<h;++e){const h=r[e];0!==e&&(n++,i=At(s,n),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),d(h)?o.textContent=h:(o.textContent=" ",t.addFactory(h,s,i,n)),l=o}return jt.index=n+1,jt.node=l.nextSibling,jt}(t,s,e,n,i);case 8:const r=Y.parse(s.data,t.directives);null!==r&&t.addFactory(_t.aggregate(r),e,n,i)}return jt.index=i+1,jt.node=s.nextSibling,jt}const Pt={createHTML:t=>t};let Et=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",Pt):Pt;const Nt=Et,_t={setHTMLPolicy(t){if(Et!==Nt)throw l.error(1201);Et=t},compile(t,e){let s;if(d(t)){s=document.createElement("TEMPLATE"),s.innerHTML=Et.createHTML(t);const e=s.content.firstElementChild;null!==e&&"TEMPLATE"===e.tagName&&(s=e)}else s=t;const i=document.adoptNode(s.content),n=new It(i,e);return $t(n,"",s,"h",0,!0),(function(t,e){return t&&8==t.nodeType&&null!==Y.parse(t.data,e)}(i.firstChild,e)||1===i.childNodes.length&&Object.keys(e).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Vt(n,i,"r"),jt.node=null,n.freeze()},setDefaultStrategy(t){this.compile=t},aggregate(t){if(1===t.length)return t[0];let e;const s=t.length,i=t.map((t=>d(t)?()=>t:(e=t.sourceAspect||e,t.binding))),n=xt(((t,e)=>{let n="";for(let r=0;r<s;++r)n+=i[r](t,e);return n}));return st.assign(n,e),n}};class Lt{constructor(t,e){this.result=null,this.html=t,this.factories=e}create(t){return null===this.result&&(this.result=_t.compile(this.html,this.factories)),this.result.createView(t)}render(t,e,s,i){const n=this.create(null!=s?s:e);return n.bind(t,null!=i?i:w.default),n.appendTo(e),n}}const Ft=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function zt(t,e,s){const i=Ft.exec(e);return null!==i&&st.assign(t,i[2]),t.createHTML(s)}function Mt(t,...e){let s="";const i=Object.create(null),n=t=>{var e;const s=null!==(e=t.id)&&void 0!==e?e:t.id=K();return i[s]=t,s};for(let i=0,r=t.length-1;i<r;++i){const r=t[i],o=e[i];let l;if(s+=r,a(o))s+=zt(xt(o),r,n);else if(d(o)){const t=Ft.exec(r);if(null!==t){const e=xt((()=>o),mt);st.assign(e,t[2]),s+=e.createHTML(n)}else s+=o}else void 0===(l=tt.getForInstance(o))?s+=zt(xt((()=>o),mt),r,n):l.aspected?s+=zt(o,r,n):s+=o.createHTML(n)}return new Lt(s+t[t.length-1],i)}const Rt=Mt,Ht=Mt;class qt extends it{bind(t,e,s){t[this.options]=s[this.nodeId]}unbind(){}}tt.define(qt);const Dt=t=>new qt(t);function Qt(t,e){const s=a(e)?e:()=>e;return(e,i)=>t(e,i)?s(e,i):null}const Wt=Object.freeze({positioning:!1,recycle:!0});function Ut(t,e,s,i){t.bind(e[s],i)}function Gt(t,e,s,i){t.bind(e[s],i.createItemContext(s,e.length))}class Jt{constructor(t,e,s,i,n,r){this.location=t,this.itemsBinding=e,this.templateBinding=i,this.options=r,this.source=null,this.views=[],this.items=null,this.itemsObserver=null,this.context=void 0,this.childContext=void 0,this.bindView=Ut,this.itemsBindingObserver=g.binding(e,this,s),this.templateBindingObserver=g.binding(i,this,n),r.positioning&&(this.bindView=Gt)}bind(t,e){this.source=t,this.context=e,this.childContext=e.createChildContext(t),this.items=this.itemsBindingObserver.observe(t,this.context),this.template=this.templateBindingObserver.observe(t,this.context),this.observeItems(!0),this.refreshAllViews()}unbind(){this.source=null,this.items=null,null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews(),this.itemsBindingObserver.dispose(),this.templateBindingObserver.dispose()}handleChange(t,e){t===this.itemsBinding?(this.items=this.itemsBindingObserver.observe(this.source,this.context),this.observeItems(),this.refreshAllViews()):t===this.templateBinding?(this.template=this.templateBindingObserver.observe(this.source,this.context),this.refreshAllViews(!0)):e[0].reset?this.refreshAllViews():this.updateViews(e)}observeItems(t=!1){if(!this.items)return void(this.items=h);const e=this.itemsObserver,s=this.itemsObserver=g.getNotifier(this.items),i=e!==s;i&&null!==e&&e.unsubscribe(this),(i||t)&&s.subscribe(this)}updateViews(t){const e=this.views,s=this.childContext,i=[],n=this.bindView;let r=0;for(let s=0,n=t.length;s<n;++s){const n=t[s],o=n.removed;i.push(...e.splice(n.index+r,o.length)),r-=n.addedCount}const o=this.items,l=this.template;for(let r=0,h=t.length;r<h;++r){const h=t[r];let c=h.index;const a=c+h.addedCount;for(;c<a;++c){const t=e[c],r=t?t.firstChild:this.location,h=this.options.recycle&&i.length>0?i.shift():l.create();e.splice(c,0,h),n(h,o,c,s),h.insertBefore(r)}}for(let t=0,e=i.length;t<e;++t)i[t].dispose();if(this.options.positioning)for(let t=0,s=e.length;t<s;++t)e[t].context.updatePosition(t,s)}refreshAllViews(t=!1){const e=this.items,s=this.template,i=this.location,n=this.bindView,r=this.childContext;let o=e.length,l=this.views,h=l.length;if((0===o||t)&&(Ot.disposeContiguousBatch(l),h=0),0===h){this.views=l=new Array(o);for(let t=0;t<o;++t){const o=s.create();n(o,e,t,r),l[t]=o,o.insertBefore(i)}}else{let t=0;for(;t<o;++t)if(t<h){n(l[t],e,t,r)}else{const o=s.create();n(o,e,t,r),l.push(o),o.insertBefore(i)}const c=l.splice(t,h-t);for(t=0,o=c.length;t<o;++t)c[t].dispose()}}unbindAllViews(){const t=this.views;for(let e=0,s=t.length;e<s;++e)t[e].unbind()}}class Kt{constructor(t,e,s){this.itemsBinding=t,this.templateBinding=e,this.options=s,$.enable(),this.isItemsBindingVolatile=g.isVolatileBinding(t),this.isTemplateBindingVolatile=g.isVolatileBinding(e)}createHTML(t){return X.comment(t(this))}createBehavior(t){return new Jt(t[this.nodeId],this.itemsBinding,this.isItemsBindingVolatile,this.templateBinding,this.isTemplateBindingVolatile,this.options)}}function Xt(t,e,s=Wt){const i=a(e)?e:()=>e;return new Kt(t,i,s)}tt.define(Kt);const Yt=t=>1===t.nodeType,Zt=t=>t?e=>1===e.nodeType&&e.matches(t):Yt;class te extends it{constructor(){super(...arguments),this.sourceProperty=`${this.id}-s`}bind(t,e,s){const i=s[this.nodeId];i[this.sourceProperty]=t,this.updateTarget(t,this.computeNodes(i)),this.observe(i)}unbind(t,e,s){const i=s[this.nodeId];this.updateTarget(t,h),this.disconnect(i),i[this.sourceProperty]=null}getSource(t){return t[this.sourceProperty]}updateTarget(t,e){t[this.options.property]=e}computeNodes(t){let e=this.getNodes(t);return"filter"in this.options&&(e=e.filter(this.options.filter)),e}}class ee extends te{observe(t){t.addEventListener("slotchange",this)}disconnect(t){t.removeEventListener("slotchange",this)}getNodes(t){return t.assignedNodes(this.options)}handleEvent(t){const e=t.currentTarget;this.updateTarget(this.getSource(e),this.computeNodes(e))}}function se(t){return d(t)&&(t={property:t}),new ee(t)}tt.define(ee);class ie extends te{constructor(t){super(t),this.observerProperty=`${this.id}-o`,this.handleEvent=(t,e)=>{const s=e.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},t.childList=!0}observe(t){var e;const s=null!==(e=t[this.observerProperty])&&void 0!==e?e:t[this.observerProperty]=new MutationObserver(this.handleEvent);s.target=t,s.observe(t,this.options)}disconnect(t){const e=t[this.observerProperty];e.target=null,e.disconnect()}getNodes(t){return"selector"in this.options?Array.from(t.querySelectorAll(this.options.selector)):Array.from(t.childNodes)}}function ne(t){return d(t)&&(t={property:t}),new ie(t)}tt.define(ie);const re={toView:t=>t?"true":"false",fromView:t=>null!=t&&"false"!==t&&!1!==t&&0!==t};function oe(t){if(null==t)return null;const e=1*t;return isNaN(e)?null:e}const le={toView(t){const e=oe(t);return e?e.toString():e},fromView:oe};class he{constructor(t,e,s=e.toLowerCase(),i="reflect",n){this.guards=new Set,this.Owner=t,this.name=e,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${e}`,this.callbackName=`${e}Changed`,this.hasCallback=this.callbackName in t.prototype,"boolean"===i&&void 0===n&&(this.converter=re)}setValue(t,e){const s=t[this.fieldName],i=this.converter;void 0!==i&&(e=i.fromView(e)),s!==e&&(t[this.fieldName]=e,this.tryReflectToAttribute(t),this.hasCallback&&t[this.callbackName](s,e),t.$fastController.notify(this.name))}getValue(t){return g.track(t,this.name),t[this.fieldName]}onAttributeChangedCallback(t,e){this.guards.has(t)||(this.guards.add(t),this.setValue(t,e),this.guards.delete(t))}tryReflectToAttribute(t){const e=this.mode,s=this.guards;s.has(t)||"fromView"===e||u.enqueue((()=>{s.add(t);const i=t[this.fieldName];switch(e){case"reflect":const e=this.converter;D.setAttribute(t,this.attribute,void 0!==e?e.toView(i):i);break;case"boolean":D.setBooleanAttribute(t,this.attribute,i)}s.delete(t)}))}static collect(t,...e){const s=[];e.push(t.attributes);for(let i=0,n=e.length;i<n;++i){const n=e[i];if(void 0!==n)for(let e=0,i=n.length;e<i;++e){const i=n[e];d(i)?s.push(new he(t,i)):s.push(new he(t,i.property,i.attribute,i.mode,i.converter))}}return s}}function ce(t,e){let s;function i(t,e){arguments.length>1&&(s.property=e);const i=t.constructor.attributes||(t.constructor.attributes=[]);i.push(s)}return arguments.length>1?(s={},void i(t,e)):(s=void 0===t?{}:t,i)}const ae={mode:"open"},de={},ue=l.getById(4,(()=>c()));class fe{constructor(t,e=t.definition){d(e)&&(e={name:e}),this.type=t,this.name=e.name,this.template=e.template;const s=he.collect(t,e.attributes),i=new Array(s.length),n={},r={};for(let t=0,e=s.length;t<e;++t){const e=s[t];i[t]=e.attribute,n[e.name]=e,r[e.attribute]=e}this.attributes=s,this.observedAttributes=i,this.propertyLookup=n,this.attributeLookup=r,this.shadowOptions=void 0===e.shadowOptions?ae:null===e.shadowOptions?void 0:Object.assign(Object.assign({},ae),e.shadowOptions),this.elementOptions=void 0===e.elementOptions?de:Object.assign(Object.assign({},de),e.elementOptions),this.styles=void 0===e.styles?void 0:Array.isArray(e.styles)?new N(e.styles):e.styles instanceof N?e.styles:new N([e.styles])}get isDefined(){return!!ue.getByType(this.type)}define(t=customElements){const e=this.type;if(ue.register(this)){const t=this.attributes,s=e.prototype;for(let e=0,i=t.length;e<i;++e)g.defineProperty(s,t[e]);Reflect.defineProperty(e,"observedAttributes",{value:this.observedAttributes,enumerable:!0})}return t.get(this.name)||t.define(this.name,e,this.elementOptions),this}}fe.getByType=ue.getByType,fe.getForInstance=ue.getForInstance;const pe=new WeakMap,ge={bubbles:!0,composed:!0,cancelable:!0};function be(t){var e,s;return null!==(s=null!==(e=t.shadowRoot)&&void 0!==e?e:pe.get(t))&&void 0!==s?s:null}class ve extends p{constructor(t,e){super(t),this.boundObservables=null,this.behaviors=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this._styles=null,this._isConnected=!1,this.$fastController=this,this.view=null,this.element=t,this.definition=e;const s=e.shadowOptions;if(void 0!==s){let e=t.shadowRoot;e?this.hasExistingShadowRoot=!0:(e=t.attachShadow(s),"closed"===s.mode&&pe.set(t,e))}const i=g.getAccessors(t);if(i.length>0){const e=this.boundObservables=Object.create(null);for(let s=0,n=i.length;s<n;++s){const n=i[s].name,r=t[n];void 0!==r&&(delete t[n],e[n]=r)}}}get isConnected(){return g.track(this,"isConnected"),this._isConnected}setIsConnected(t){this._isConnected=t,g.notify(this,"isConnected")}get template(){var t;if(null===this._template){const e=this.definition;this.element.resolveTemplate?this._template=this.element.resolveTemplate():e.template&&(this._template=null!==(t=e.template)&&void 0!==t?t:null)}return this._template}set template(t){this._template!==t&&(this._template=t,this.needsInitialization||this.renderTemplate(t))}get styles(){var t;if(null===this._styles){const e=this.definition;this.element.resolveStyles?this._styles=this.element.resolveStyles():e.styles&&(this._styles=null!==(t=e.styles)&&void 0!==t?t:null)}return this._styles}set styles(t){this._styles!==t&&(null!==this._styles&&this.removeStyles(this._styles),this._styles=t,this.needsInitialization||this.addStyles(t))}addStyles(t){if(!t)return;const e=be(this.element)||this.element.getRootNode();if(t instanceof HTMLElement)e.append(t);else if(!t.isAttachedTo(e)){const s=t.behaviors;t.addStylesTo(e),null!==s&&this.addBehaviors(s)}}removeStyles(t){if(!t)return;const e=be(this.element)||this.element.getRootNode();if(t instanceof HTMLElement)e.removeChild(t);else if(t.isAttachedTo(e)){const s=t.behaviors;t.removeStylesFrom(e),null!==s&&this.removeBehaviors(s)}}addBehaviors(t){var e;const s=null!==(e=this.behaviors)&&void 0!==e?e:this.behaviors=new Map,i=t.length,n=[];for(let e=0;e<i;++e){const i=t[e];s.has(i)?s.set(i,s.get(i)+1):(s.set(i,1),n.push(i))}if(this._isConnected){const t=this.element,e=w.default;for(let s=0;s<n.length;++s)n[s].bind(t,e)}}removeBehaviors(t,e=!1){const s=this.behaviors;if(null===s)return;const i=t.length,n=[];for(let r=0;r<i;++r){const i=t[r];if(s.has(i)){const t=s.get(i)-1;0===t||e?s.delete(i)&&n.push(i):s.set(i,t)}}if(this._isConnected){const t=this.element,e=w.default;for(let s=0;s<n.length;++s)n[s].unbind(t,e)}}onConnectedCallback(){if(this._isConnected)return;const t=this.element,e=w.default;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(t,e);const s=this.behaviors;if(null!==s)for(const i of s.keys())i.bind(t,e);this.setIsConnected(!0)}onDisconnectedCallback(){if(!this._isConnected)return;this.setIsConnected(!1);const t=this.view;null!==t&&t.unbind();const e=this.behaviors;if(null!==e){const t=this.element,s=w.default;for(const i of e.keys())i.unbind(t,s)}}onAttributeChangedCallback(t,e,s){const i=this.definition.attributeLookup[t];void 0!==i&&i.onAttributeChangedCallback(this.element,s)}emit(t,e,s){return!!this._isConnected&&this.element.dispatchEvent(new CustomEvent(t,Object.assign(Object.assign({detail:e},ge),s)))}finishInitialization(){const t=this.element,e=this.boundObservables;if(null!==e){const s=Object.keys(e);for(let i=0,n=s.length;i<n;++i){const n=s[i];t[n]=e[n]}this.boundObservables=null}this.renderTemplate(this.template),this.addStyles(this.styles),this.needsInitialization=!1}renderTemplate(t){var e;const s=this.element,i=null!==(e=be(s))&&void 0!==e?e:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let t=i.firstChild;null!==t;t=i.firstChild)i.removeChild(t)}t&&(this.view=t.render(s,i,s))}static forCustomElement(t){const e=t.$fastController;if(void 0!==e)return e;const s=fe.getForInstance(t);if(void 0===s)throw l.error(1401);return t.$fastController=new ve(t,s)}}function ye(t){return class extends t{constructor(){super(),ve.forCustomElement(this)}$emit(t,e,s){return this.$fastController.emit(t,e,s)}connectedCallback(){this.$fastController.onConnectedCallback()}disconnectedCallback(){this.$fastController.onDisconnectedCallback()}attributeChangedCallback(t,e,s){this.$fastController.onAttributeChangedCallback(t,e,s)}}}const me=Object.assign(ye(HTMLElement),{from:t=>ye(t),define:(t,e)=>new fe(t,e).define().type});function we(t){return function(e){new fe(e,t).define()}}export{_ as AdoptedStyleSheetsStrategy,$ as ArrayObserver,st as Aspect,he as AttributeDefinition,ot as BindingConfig,rt as BindingMode,F as CSSDirective,ft as ChangeBinding,ie as ChildrenDirective,_t as Compiler,ve as Controller,D as DOM,N as ElementStyles,pt as EventBinding,w as ExecutionContext,l as FAST,me as FASTElement,fe as FASTElementDefinition,Tt as HTMLBindingDirective,tt as HTMLDirective,Ot as HTMLView,X as Markup,te as NodeObservationDirective,g as Observable,at as OneTimeBinding,Y as Parser,p as PropertyChangeNotifier,qt as RefDirective,Jt as RepeatBehavior,Kt as RepeatDirective,ut as SignalBinding,ee as SlottedDirective,C as Splice,A as SpliceStrategy,T as SpliceStrategySupport,it as StatelessAttachedAttributeDirective,f as SubscriberSet,bt as TwoWayBinding,lt as UpdateBinding,u as Updates,Lt as ViewTemplate,ce as attr,xt as bind,re as booleanConverter,Rt as child,ne as children,c as createTypeRegistry,R as css,z as cssDirective,q as cssPartial,we as customElement,Zt as elements,h as emptyArray,Mt as html,et as htmlDirective,Ht as item,V as length,le as nullableNumberConverter,b as observable,vt as onChange,mt as oneTime,Dt as ref,Xt as repeat,Ct as signal,se as slotted,yt as twoWay,v as volatile,Qt as when}; | ||
!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const t=new Function("return this")();t.globalThis=t}}(),globalThis.trustedTypes||(globalThis.trustedTypes={createPolicy:(t,e)=>e});const t={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},t));const e=globalThis.FAST;if(void 0===e.getById){const s=Object.create(null);Reflect.defineProperty(e,"getById",Object.assign({value(t,e){let i=s[t];return void 0===i&&(i=e?s[t]=e():null),i}},t))}const s=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;function i(t){return t===document?document.body:t}let n=0;class r{constructor(t){this.styles=t,this.styleClass="fast-"+ ++n}addStylesTo(t){t=i(t);const e=this.styles,s=this.styleClass;for(let i=0;i<e.length;i++){const n=document.createElement("style");n.innerHTML=e[i],n.className=s,t.append(n)}}removeStylesFrom(t){const e=t.querySelectorAll(`.${this.styleClass}`);t=i(t);for(let s=0,i=e.length;s<i;++s)t.removeChild(e[s])}}s||e.getById(5,(()=>r));const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const l=globalThis.FAST;if(void 0===l.getById){const t=Object.create(null);Reflect.defineProperty(l,"getById",Object.assign({value(e,s){let i=t[e];return void 0===i&&(i=s?t[e]=s():null),i}},o))}void 0===l.error&&Object.assign(l,{warn(){},error:t=>new Error(`Code ${t}`),addMessages(){}});const h=Object.freeze([]);function c(){const t=new Map;return Object.freeze({register:e=>!t.has(e.type)&&(t.set(e.type,e),!0),getByType:e=>t.get(e),getForInstance:e=>t.get(e.constructor)})}const a=t=>"function"==typeof t,d=t=>"string"==typeof t,u=l.getById(1,(()=>{const t=[],e=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(e.length)throw e.shift()}function r(s){try{s.call()}catch(s){if(!i)throw t.length=0,s;e.push(s),setTimeout(n,0)}}function o(){let e=0;for(;e<t.length;)if(r(t[e]),e++,e>1024){for(let s=0,i=t.length-e;s<i;s++)t[s]=t[s+e];t.length-=e,e=0}t.length=0}function l(e){t.push(e),t.length<2&&(i?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:t=>i=t})}));class f{constructor(t,e){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=t,this.sub1=e}has(t){return void 0===this.spillover?this.sub1===t||this.sub2===t:-1!==this.spillover.indexOf(t)}subscribe(t){const e=this.spillover;if(void 0===e){if(this.has(t))return;if(void 0===this.sub1)return void(this.sub1=t);if(void 0===this.sub2)return void(this.sub2=t);this.spillover=[this.sub1,this.sub2,t],this.sub1=void 0,this.sub2=void 0}else{-1===e.indexOf(t)&&e.push(t)}}unsubscribe(t){const e=this.spillover;if(void 0===e)this.sub1===t?this.sub1=void 0:this.sub2===t&&(this.sub2=void 0);else{const s=e.indexOf(t);-1!==s&&e.splice(s,1)}}notify(t){const e=this.spillover,s=this.subject;if(void 0===e){const e=this.sub1,i=this.sub2;void 0!==e&&e.handleChange(s,t),void 0!==i&&i.handleChange(s,t)}else for(let i=0,n=e.length;i<n;++i)e[i].handleChange(s,t)}}class p{constructor(t){this.subscribers={},this.subjectSubscribers=null,this.subject=t}notify(t){var e,s;null===(e=this.subscribers[t])||void 0===e||e.notify(t),null===(s=this.subjectSubscribers)||void 0===s||s.notify(t)}subscribe(t,e){var s,i;let n;n=e?null!==(s=this.subscribers[e])&&void 0!==s?s:this.subscribers[e]=new f(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new f(this.subject),n.subscribe(t)}unsubscribe(t,e){var s,i;e?null===(s=this.subscribers[e])||void 0===s||s.unsubscribe(t):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(t)}}const b=l.getById(2,(()=>{const t=u.enqueue,e=/(:|&&|\|\||if)/,s=new WeakMap,i=new WeakMap;let n,r=t=>{throw l.error(1101)};function o(t){var e;let i=null!==(e=t.$fastController)&&void 0!==e?e:s.get(t);return void 0===i&&(Array.isArray(t)?i=r(t):s.set(t,i=new p(t))),i}function h(t){let e=i.get(t);if(void 0===e){let s=Reflect.getPrototypeOf(t);for(;void 0===e&&null!==s;)e=i.get(s),s=Reflect.getPrototypeOf(s);e=void 0===e?[]:e.slice(0),i.set(t,e)}return e}class c{constructor(t){this.name=t,this.field=`_${t}`,this.callback=`${t}Changed`}getValue(t){return void 0!==n&&n.watch(t,this.name),t[this.field]}setValue(t,e){const s=this.field,i=t[s];if(i!==e){t[s]=e;const n=t[this.callback];a(n)&&n.call(t,i,e),o(t).notify(this.name)}}}class b extends f{constructor(t,e,s=!1){super(t,e),this.binding=t,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(t){this.isAsync=this.needsQueue=t}observe(t,e){this.needsRefresh&&null!==this.last&&this.dispose();const s=n;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const i=this.binding(t,null!=e?e:m.default);return n=s,i}dispose(){if(null!==this.last){let t=this.first;for(;void 0!==t;)t.notifier.unsubscribe(this,t.propertyName),t=t.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(t,e){const s=this.last,i=o(t),r=null===s?this.first:{};if(r.propertySource=t,r.propertyName=e,r.notifier=i,i.subscribe(this,e),null!==s){if(!this.needsRefresh){let e;n=void 0,e=s.propertySource[s.propertyName],n=this,t===e&&(this.needsRefresh=!0)}s.next=r}this.last=r}handleChange(){this.needsQueue?(this.needsQueue=!1,t(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let t=this.first;for(;void 0!==t;)yield t,t=t.next}}return Object.freeze({setArrayObserverFactory(t){r=t},getNotifier:o,track(t,e){n&&n.watch(t,e)},trackVolatile(){n&&(n.needsRefresh=!0)},notify(t,e){o(t).notify(e)},defineProperty(t,e){d(e)&&(e=new c(e)),h(t).push(e),Reflect.defineProperty(t,e.name,{enumerable:!0,get(){return e.getValue(this)},set(t){e.setValue(this,t)}})},getAccessors:h,binding(t,e,s=this.isVolatileBinding(t)){return new b(t,e,s)},isVolatileBinding:t=>e.test(t.toString())})}));function g(t,e){b.defineProperty(t,e)}function v(t,e,s){return Object.assign({},s,{get(){return b.trackVolatile(),s.get.apply(this)}})}const y=l.getById(3,(()=>{let t=null;return{get:()=>t,set(e){t=e}}}));class m{constructor(t=null,e=null){this.index=0,this.length=0,this.parent=t,this.parentContext=e}get event(){return y.get()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}updatePosition(t,e){this.index=t,this.length=e}createChildContext(t){return new m(t,this)}createItemContext(t,e){const s=Object.create(this);return s.index=t,s.length=e,s}static setEvent(t){y.set(t)}static create(){return new m}}m.default=new m,b.defineProperty(m.prototype,"index"),b.defineProperty(m.prototype,"length");class w{constructor(t,e,s){this.index=t,this.removed=e,this.addedCount=s}adjustTo(t){let e=this.index;const s=t.length;return e>s?e=s-this.addedCount:e<0&&(e=s+this.removed.length+e-this.addedCount),this.index=e<0?0:e,this}}const C=Object.freeze({reset:1,splice:2,optimized:3}),T=new w(0,h,0);T.reset=!0;const x=[T];let S=Object.freeze({support:C.splice,normalize:(t,e,s)=>void 0===t?null!=s?s:h:x,pop(t,e,s,i){const n=t.length>0,r=s.apply(t,i);return n&&e.addSplice(new w(t.length,[r],0)),r},push(t,e,s,i){const n=s.apply(t,i);return e.addSplice(new w(t.length-i.length,[],i.length).adjustTo(t)),n},reverse(t,e,s,i){const n=s.apply(t,i);return e.reset(t),n},shift(t,e,s,i){const n=t.length>0,r=s.apply(t,i);return n&&e.addSplice(new w(0,[r],0)),r},sort(t,e,s,i){const n=s.apply(t,i);return e.reset(t),n},splice(t,e,s,i){const n=s.apply(t,i);return e.addSplice(new w(+i[0],n,i.length>2?i.length-2:0).adjustTo(t)),n},unshift(t,e,s,i){const n=s.apply(t,i);return e.addSplice(new w(0,[],i.length).adjustTo(t)),n}});const O=Object.freeze({reset:x,setDefaultStrategy(t){S=t}});function A(t,e,s){Reflect.defineProperty(t,e,{value:s,enumerable:!1})}class B extends f{constructor(t){super(t),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,A(t,"$fastController",this)}get strategy(){return this._strategy}set strategy(t){this._strategy=t}get lengthObserver(){let t=this._lengthObserver;if(void 0===t){const e=this.subject;this._lengthObserver=t={length:e.length,handleChange(){this.length!==e.length&&(this.length=e.length,b.notify(t,"length"))}},this.subscribe(t)}return t}subscribe(t){this.flush(),super.subscribe(t)}addSplice(t){void 0===this.splices?this.splices=[t]:this.splices.push(t),this.enqueue()}reset(t){this.oldCollection=t,this.enqueue()}flush(){var t;const e=this.splices,s=this.oldCollection;void 0===e&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(t=this._strategy)&&void 0!==t?t:S).normalize(s,this.subject,e)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,u.enqueue(this))}}let j=!1;const I=Object.freeze({enable(){if(j)return;j=!0,b.setArrayObserverFactory((t=>new B(t)));const t=Array.prototype;t.$fastPatch||(A(t,"$fastPatch",1),[t.pop,t.push,t.reverse,t.shift,t.sort,t.splice,t.unshift].forEach((e=>{t[e.name]=function(...t){var s;const i=this.$fastController;return void 0===i?e.apply(this,t):(null!==(s=i.strategy)&&void 0!==s?s:S)[e.name](this,i,e,t)}})))}});function $(t){if(!t)return 0;let e=t.$fastController;return void 0===e&&(I.enable(),e=b.getNotifier(t)),b.track(e.lengthObserver,"length"),t.length}const V=new Map;let k;function P(t){return t.map((t=>t instanceof N?P(t.styles):[t])).reduce(((t,e)=>t.concat(e)),[])}class N{constructor(t){this.styles=t,this.targets=new WeakSet,this._strategy=null,this.behaviors=t.map((t=>t instanceof N?t.behaviors:null)).reduce(((t,e)=>null===e?t:null===t?e:t.concat(e)),null)}get strategy(){return null===this._strategy&&this.withStrategy(k),this._strategy}addStylesTo(t){this.strategy.addStylesTo(t),this.targets.add(t)}removeStylesFrom(t){this.strategy.removeStylesFrom(t),this.targets.delete(t)}isAttachedTo(t){return this.targets.has(t)}withBehaviors(...t){return this.behaviors=null===this.behaviors?t:this.behaviors.concat(t),this}withStrategy(t){return this._strategy=new t(P(this.styles)),this}static setDefaultStrategy(t){k=t}}N.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;class _{constructor(t){this.sheets=t.map((t=>{if(t instanceof CSSStyleSheet)return t;let e=V.get(t);return void 0===e&&(e=new CSSStyleSheet,e.replaceSync(t),V.set(t,e)),e}))}addStylesTo(t){t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(t){const e=this.sheets;t.adoptedStyleSheets=t.adoptedStyleSheets.filter((t=>-1===e.indexOf(t)))}}N.setDefaultStrategy(l.getById(5,(()=>_)));const E=c(),F=Object.freeze({getForInstance:E.getForInstance,getByType:E.getByType,define:t=>(E.register({type:t}),t)});function L(){return function(t){F.define(t)}}function M(t,e){const s=[];let i="";const n=[],r=t=>{n.push(t)};for(let n=0,o=t.length-1;n<o;++n){i+=t[n];let o=e[n];void 0!==F.getForInstance(o)&&(o=o.createCSS(r)),o instanceof N||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=t[t.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const z=(t,...e)=>{const{styles:s,behaviors:i}=M(t,e),n=new N(s);return i.length?n.withBehaviors(...i):n};class R{constructor(t,e){this.behaviors=e,this.css="";const s=t.reduce(((t,e)=>(d(e)?this.css+=e:t.push(e),t)),[]);s.length&&(this.styles=new N(s))}createCSS(t){return this.behaviors.forEach(t),this.styles&&t(this),this.css}bind(t){t.$fastController.addStyles(this.styles)}unbind(t){t.$fastController.removeStyles(this.styles)}}F.define(R);const H=z.partial=(t,...e)=>{const{styles:s,behaviors:i}=M(t,e);return new R(s,i)},q=Object.freeze({queueUpdate:u.enqueue,nextUpdate:u.next,processUpdates:u.process,setAttribute(t,e,s){null==s?t.removeAttribute(e):t.setAttribute(e,s)},setBooleanAttribute(t,e,s){s?t.setAttribute(e,""):t.removeAttribute(e)}}),D=`fast-${Math.random().toString(36).substring(2,8)}`,Q=`${D}{`,W=`}${D}`,U=W.length;let G=0;const J=()=>`${D}-${++G}`,K=Object.freeze({interpolation:t=>`${Q}${t}${W}`,attribute:t=>`${J()}="${Q}${t}${W}"`,comment:t=>`\x3c!--${Q}${t}${W}--\x3e`}),X=Object.freeze({parse(t,e){const s=t.split(Q);if(1===s.length)return null;const i=[];for(let t=0,n=s.length;t<n;++t){const n=s[t],r=n.indexOf(W);let o;if(-1===r)o=n;else{const t=n.substring(0,r);i.push(e[t]),o=n.substring(r+U)}""!==o&&i.push(o)}return i}}),Y=c(),Z=Object.freeze({getForInstance:Y.getForInstance,getByType:Y.getByType,define:(t,e)=>((e=e||{}).type=t,Y.register(e),t)});function tt(t){return function(e){Z.define(e,t)}}const et=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6,assign(t,e){if(t.sourceAspect=e,e)switch(e[0]){case":":switch(t.targetAspect=e.substring(1),t.targetAspect){case"innerHTML":default:t.aspectType=et.property;break;case"classList":t.aspectType=et.tokenList}break;case"?":t.targetAspect=e.substring(1),t.aspectType=et.booleanAttribute;break;case"@":t.targetAspect=e.substring(1),t.aspectType=et.event;break;default:"class"===e?(t.targetAspect="className",t.aspectType=et.property):(t.targetAspect=e,t.aspectType=et.attribute)}}});class st{constructor(t){this.options=t}createBehavior(t){return this}createHTML(t){return K.attribute(t(this))}}const it=globalThis.TrustedHTML?t=>(e,s)=>{const i=t(e,s);if(i instanceof TrustedHTML)return i;throw l.error(1202)}:t=>t,nt=Object.freeze({define:(t,e=dt)=>Object.freeze({1:e=>new t(e,q.setAttribute),2:e=>new t(e,q.setBooleanAttribute),3:e=>new t(e,((t,e,s)=>t[e]=s)),4:e=>{return new(s=t,class extends s{unbind(t,e,s){super.unbind(t,e,s);const i=s[this.directive.nodeId].$fastView;void 0!==i&&i.isComposed&&(i.unbind(),i.needsBindOnly=!0)}})(e,lt);var s},5:e=>new t(e,ht),6:t=>new e(t)})}),rt=Object.freeze({define(t,e){const s=t=>({mode:s.mode,options:Object.assign({},e,t)});return s.options=e,s.mode=t,s}});class ot{constructor(t,e){this.directive=t,this.updateTarget=e}bind(t,e,s){}unbind(t,e,s){}createBehavior(t){return this}}function lt(t,e,s,i,n){if(null==s&&(s=""),s.create){t.textContent="";let e=t.$fastView;void 0===e?e=s.create():t.$fastTemplate!==s&&(e.isComposed&&(e.remove(),e.unbind()),e=s.create()),e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(i,n)):(e.isComposed=!0,e.bind(i,n),e.insertBefore(t),t.$fastView=e,t.$fastTemplate=s)}else{const e=t.$fastView;void 0!==e&&e.isComposed&&(e.isComposed=!1,e.remove(),e.needsBindOnly?e.needsBindOnly=!1:e.unbind()),t.textContent=s}}function ht(t,e,s){var i;const n=`${this.directive.id}-t`,r=null!==(i=t[n])&&void 0!==i?i:t[n]={c:0,v:Object.create(null)},o=r.v;let l=r.c;const h=t[e];if(null!=s&&s.length){const t=s.split(/\s+/);for(let e=0,s=t.length;e<s;++e){const s=t[e];""!==s&&(o[s]=l,h.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const t in o)o[t]===l&&h.remove(t)}}class ct extends ot{bind(t,e,s){const i=this.directive;this.updateTarget(s[i.nodeId],i.targetAspect,i.binding(t,e),t,e)}}class at extends ot{constructor(t,e){super(t,e),this.isBindingVolatile=b.isVolatileBinding(t.binding),this.observerProperty=`${t.id}-o`}getObserver(t){var e;return null!==(e=t[this.observerProperty])&&void 0!==e?e:t[this.observerProperty]=b.binding(this.directive.binding,this,this.isBindingVolatile)}bind(t,e,s){const i=this.directive,n=s[i.nodeId],r=this.getObserver(n);r.target=n,r.source=t,r.context=e,this.updateTarget(n,i.targetAspect,r.observe(t,e),t,e)}unbind(t,e,s){const i=s[this.directive.nodeId],n=this.getObserver(i);n.dispose(),n.target=null,n.source=null,n.context=null}handleChange(t,e){const s=e.target,i=e.source,n=e.context;this.updateTarget(s,this.directive.targetAspect,e.observe(i,n),i,n)}}class dt{constructor(t){this.directive=t,this.sourceProperty=`${t.id}-s`,this.contextProperty=`${t.id}-c`}bind(t,e,s){const i=this.directive,n=s[i.nodeId];n[this.sourceProperty]=t,n[this.contextProperty]=e,n.addEventListener(i.targetAspect,this,i.options)}unbind(t,e,s){const i=this.directive,n=s[i.nodeId];n[this.sourceProperty]=n[this.contextProperty]=null,n.removeEventListener(i.targetAspect,this,i.options)}createBehavior(t){return this}handleEvent(t){const e=t.currentTarget;m.setEvent(t);const s=this.directive.binding(e[this.sourceProperty],e[this.contextProperty]);m.setEvent(null),!0!==s&&t.preventDefault()}}const ut=rt.define(nt.define(at),{}),ft=rt.define(nt.define(ct),{once:!0});class pt{constructor(t,e,s){this.binding=t,this.mode=e,this.options=s,this.factory=null,this.aspectType=et.content}createHTML(t){return K.interpolation(t(this))}createBehavior(t){return null==this.factory&&("innerHTML"===this.targetAspect&&(this.binding=it(this.binding)),this.factory=this.mode[this.aspectType](this)),this.factory.createBehavior(t)}}function bt(t,e=ut){return"mode"in e||(e=ut(e)),new pt(t,e.mode,e.options)}function gt(t,e){const s=t.parentNode;let i,n=t;for(;n!==e;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(e)}Z.define(pt,{aspected:!0});class vt{constructor(t,e,s){this.fragment=t,this.factories=e,this.targets=s,this.behaviors=null,this.source=null,this.context=null,this.firstChild=t.firstChild,this.lastChild=t.lastChild}appendTo(t){t.appendChild(this.fragment)}insertBefore(t){if(this.fragment.hasChildNodes())t.parentNode.insertBefore(this.fragment,t);else{const e=t.parentNode,s=this.lastChild;let i,n=this.firstChild;for(;n!==s;)i=n.nextSibling,e.insertBefore(n,t),n=i;e.insertBefore(s,t)}}remove(){const t=this.fragment,e=this.lastChild;let s,i=this.firstChild;for(;i!==e;)s=i.nextSibling,t.appendChild(i),i=s;t.appendChild(e)}dispose(){gt(this.firstChild,this.lastChild),this.unbind()}bind(t,e){let s=this.behaviors;const i=this.source;if(i===t)return;this.source=t,this.context=e;const n=this.targets;if(null!==i)for(let r=0,o=s.length;r<o;++r){const o=s[r];o.unbind(i,e,n),o.bind(t,e,n)}else if(null===s){this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let r=0,o=i.length;r<o;++r){const o=i[r].createBehavior(n);o.bind(t,e,n),s[r]=o}}else for(let i=0,r=s.length;i<r;++i)s[i].bind(t,e,n)}unbind(){const t=this.source;if(null===t)return;const e=this.targets,s=this.context,i=this.behaviors;for(let n=0,r=i.length;n<r;++n)i[n].unbind(t,s,e);this.source=null,this.context=null}static disposeContiguousBatch(t){if(0!==t.length){gt(t[0].firstChild,t[t.length-1].lastChild);for(let e=0,s=t.length;e<s;++e)t[e].unbind()}}}const yt=(t,e)=>`${t}.${e}`,mt={},wt={index:0,node:null};class Ct{constructor(t,e){this.fragment=t,this.directives=e,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(t,e,s,i){this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(e,s,i)),t.nodeId=s,this.factories.push(t)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(t,e,s){const i=this.descriptors;if("r"===e||"h"===e||i[e])return;if(!i[t]){const e=t.lastIndexOf("."),s=t.substring(0,e),i=parseInt(t.substring(e+1));this.addTargetDescriptor(s,t,i)}let n=mt[e];if(!n){const i=`_${e}`;mt[e]=n={get(){var e;return null!==(e=this[i])&&void 0!==e?e:this[i]=this[t].childNodes[s]}}}i[e]=n}createView(t){const e=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=e,s.h=null!=t?t:e;for(const t of this.nodeIds)s[t];return new vt(e,this.factories,s)}}function Tt(t,e,s,i,n,r=!1){const o=s.attributes,l=t.directives;for(let h=0,c=o.length;h<c;++h){const a=o[h],d=a.value,u=X.parse(d,l);let f=null;null===u?r&&(f=bt((()=>d),ft),et.assign(f,a.name)):f=jt.aggregate(u),null!==f&&(s.removeAttributeNode(a),h--,c--,t.addFactory(f,e,i,n))}}function xt(t,e,s){let i=0,n=e.firstChild;for(;n;){const e=St(t,s,n,i);n=e.node,i=e.index}}function St(t,e,s,i){const n=yt(e,i);switch(s.nodeType){case 1:Tt(t,e,s,n,i),xt(t,s,n);break;case 3:return function(t,e,s,i,n){const r=X.parse(e.textContent,t.directives);if(null===r)return wt.node=e.nextSibling,wt.index=n+1,wt;let o,l=o=e;for(let e=0,h=r.length;e<h;++e){const h=r[e];0!==e&&(n++,i=yt(s,n),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),d(h)?o.textContent=h:(o.textContent=" ",t.addFactory(h,s,i,n)),l=o}return wt.index=n+1,wt.node=l.nextSibling,wt}(t,s,e,n,i);case 8:const r=X.parse(s.data,t.directives);null!==r&&t.addFactory(jt.aggregate(r),e,n,i)}return wt.index=i+1,wt.node=s.nextSibling,wt}const Ot={createHTML:t=>t};let At=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",Ot):Ot;const Bt=At,jt={setHTMLPolicy(t){if(At!==Bt)throw l.error(1201);At=t},compile(t,e){let s;if(d(t)){s=document.createElement("TEMPLATE"),s.innerHTML=At.createHTML(t);const e=s.content.firstElementChild;null!==e&&"TEMPLATE"===e.tagName&&(s=e)}else s=t;const i=document.adoptNode(s.content),n=new Ct(i,e);return Tt(n,"",s,"h",0,!0),(function(t,e){return t&&8==t.nodeType&&null!==X.parse(t.data,e)}(i.firstChild,e)||1===i.childNodes.length&&Object.keys(e).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),xt(n,i,"r"),wt.node=null,n.freeze()},setDefaultStrategy(t){this.compile=t},aggregate(t){if(1===t.length)return t[0];let e;const s=t.length,i=t.map((t=>d(t)?()=>t:(e=t.sourceAspect||e,t.binding))),n=bt(((t,e)=>{let n="";for(let r=0;r<s;++r)n+=i[r](t,e);return n}));return et.assign(n,e),n}};class It{constructor(t,e){this.result=null,this.html=t,this.factories=e}create(t){return null===this.result&&(this.result=jt.compile(this.html,this.factories)),this.result.createView(t)}render(t,e,s,i){const n=this.create(null!=s?s:e);return n.bind(t,null!=i?i:m.default),n.appendTo(e),n}}const $t=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Vt(t,e,s){const i=$t.exec(e);return null!==i&&et.assign(t,i[2]),t.createHTML(s)}function kt(t,...e){let s="";const i=Object.create(null),n=t=>{var e;const s=null!==(e=t.id)&&void 0!==e?e:t.id=J();return i[s]=t,s};for(let i=0,r=t.length-1;i<r;++i){const r=t[i],o=e[i];let l;if(s+=r,a(o))s+=Vt(bt(o),r,n);else if(d(o)){const t=$t.exec(r);if(null!==t){const e=bt((()=>o),ft);et.assign(e,t[2]),s+=e.createHTML(n)}else s+=o}else void 0===(l=Z.getForInstance(o))?s+=Vt(bt((()=>o),ft),r,n):l.aspected?s+=Vt(o,r,n):s+=o.createHTML(n)}return new It(s+t[t.length-1],i)}class Pt extends st{bind(t,e,s){t[this.options]=s[this.nodeId]}unbind(){}}Z.define(Pt);const Nt=t=>new Pt(t);function _t(t,e){const s=a(e)?e:()=>e;return(e,i)=>t(e,i)?s(e,i):null}const Et=Object.freeze({positioning:!1,recycle:!0});function Ft(t,e,s,i){t.bind(e[s],i)}function Lt(t,e,s,i){t.bind(e[s],i.createItemContext(s,e.length))}class Mt{constructor(t,e,s,i,n,r){this.location=t,this.itemsBinding=e,this.templateBinding=i,this.options=r,this.source=null,this.views=[],this.items=null,this.itemsObserver=null,this.context=void 0,this.childContext=void 0,this.bindView=Ft,this.itemsBindingObserver=b.binding(e,this,s),this.templateBindingObserver=b.binding(i,this,n),r.positioning&&(this.bindView=Lt)}bind(t,e){this.source=t,this.context=e,this.childContext=e.createChildContext(t),this.items=this.itemsBindingObserver.observe(t,this.context),this.template=this.templateBindingObserver.observe(t,this.context),this.observeItems(!0),this.refreshAllViews()}unbind(){this.source=null,this.items=null,null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews(),this.itemsBindingObserver.dispose(),this.templateBindingObserver.dispose()}handleChange(t,e){t===this.itemsBinding?(this.items=this.itemsBindingObserver.observe(this.source,this.context),this.observeItems(),this.refreshAllViews()):t===this.templateBinding?(this.template=this.templateBindingObserver.observe(this.source,this.context),this.refreshAllViews(!0)):e[0].reset?this.refreshAllViews():this.updateViews(e)}observeItems(t=!1){if(!this.items)return void(this.items=h);const e=this.itemsObserver,s=this.itemsObserver=b.getNotifier(this.items),i=e!==s;i&&null!==e&&e.unsubscribe(this),(i||t)&&s.subscribe(this)}updateViews(t){const e=this.views,s=this.childContext,i=[],n=this.bindView;let r=0;for(let s=0,n=t.length;s<n;++s){const n=t[s],o=n.removed;i.push(...e.splice(n.index+r,o.length)),r-=n.addedCount}const o=this.items,l=this.template;for(let r=0,h=t.length;r<h;++r){const h=t[r];let c=h.index;const a=c+h.addedCount;for(;c<a;++c){const t=e[c],r=t?t.firstChild:this.location,h=this.options.recycle&&i.length>0?i.shift():l.create();e.splice(c,0,h),n(h,o,c,s),h.insertBefore(r)}}for(let t=0,e=i.length;t<e;++t)i[t].dispose();if(this.options.positioning)for(let t=0,s=e.length;t<s;++t)e[t].context.updatePosition(t,s)}refreshAllViews(t=!1){const e=this.items,s=this.template,i=this.location,n=this.bindView,r=this.childContext;let o=e.length,l=this.views,h=l.length;if(0!==o&&!t&&this.options.recycle||(vt.disposeContiguousBatch(l),h=0),0===h){this.views=l=new Array(o);for(let t=0;t<o;++t){const o=s.create();n(o,e,t,r),l[t]=o,o.insertBefore(i)}}else{let t=0;for(;t<o;++t)if(t<h){n(l[t],e,t,r)}else{const o=s.create();n(o,e,t,r),l.push(o),o.insertBefore(i)}const c=l.splice(t,h-t);for(t=0,o=c.length;t<o;++t)c[t].dispose()}}unbindAllViews(){const t=this.views;for(let e=0,s=t.length;e<s;++e)t[e].unbind()}}class zt{constructor(t,e,s){this.itemsBinding=t,this.templateBinding=e,this.options=s,I.enable(),this.isItemsBindingVolatile=b.isVolatileBinding(t),this.isTemplateBindingVolatile=b.isVolatileBinding(e)}createHTML(t){return K.comment(t(this))}createBehavior(t){return new Mt(t[this.nodeId],this.itemsBinding,this.isItemsBindingVolatile,this.templateBinding,this.isTemplateBindingVolatile,this.options)}}function Rt(t,e,s=Et){const i=a(e)?e:()=>e;return new zt(t,i,s)}Z.define(zt);const Ht=t=>1===t.nodeType,qt=t=>t?e=>1===e.nodeType&&e.matches(t):Ht;class Dt extends st{constructor(){super(...arguments),this.sourceProperty=`${this.id}-s`}bind(t,e,s){const i=s[this.nodeId];i[this.sourceProperty]=t,this.updateTarget(t,this.computeNodes(i)),this.observe(i)}unbind(t,e,s){const i=s[this.nodeId];this.updateTarget(t,h),this.disconnect(i),i[this.sourceProperty]=null}getSource(t){return t[this.sourceProperty]}updateTarget(t,e){t[this.options.property]=e}computeNodes(t){let e=this.getNodes(t);return"filter"in this.options&&(e=e.filter(this.options.filter)),e}}class Qt extends Dt{observe(t){t.addEventListener("slotchange",this)}disconnect(t){t.removeEventListener("slotchange",this)}getNodes(t){return t.assignedNodes(this.options)}handleEvent(t){const e=t.currentTarget;this.updateTarget(this.getSource(e),this.computeNodes(e))}}function Wt(t){return d(t)&&(t={property:t}),new Qt(t)}Z.define(Qt);class Ut extends Dt{constructor(t){super(t),this.observerProperty=`${this.id}-o`,this.handleEvent=(t,e)=>{const s=e.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},t.childList=!0}observe(t){var e;const s=null!==(e=t[this.observerProperty])&&void 0!==e?e:t[this.observerProperty]=new MutationObserver(this.handleEvent);s.target=t,s.observe(t,this.options)}disconnect(t){const e=t[this.observerProperty];e.target=null,e.disconnect()}getNodes(t){return"selector"in this.options?Array.from(t.querySelectorAll(this.options.selector)):Array.from(t.childNodes)}}function Gt(t){return d(t)&&(t={property:t}),new Ut(t)}Z.define(Ut);const Jt={toView:t=>t?"true":"false",fromView:t=>null!=t&&"false"!==t&&!1!==t&&0!==t};function Kt(t){if(null==t)return null;const e=1*t;return isNaN(e)?null:e}const Xt={toView(t){const e=Kt(t);return e?e.toString():e},fromView:Kt};class Yt{constructor(t,e,s=e.toLowerCase(),i="reflect",n){this.guards=new Set,this.Owner=t,this.name=e,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${e}`,this.callbackName=`${e}Changed`,this.hasCallback=this.callbackName in t.prototype,"boolean"===i&&void 0===n&&(this.converter=Jt)}setValue(t,e){const s=t[this.fieldName],i=this.converter;void 0!==i&&(e=i.fromView(e)),s!==e&&(t[this.fieldName]=e,this.tryReflectToAttribute(t),this.hasCallback&&t[this.callbackName](s,e),t.$fastController.notify(this.name))}getValue(t){return b.track(t,this.name),t[this.fieldName]}onAttributeChangedCallback(t,e){this.guards.has(t)||(this.guards.add(t),this.setValue(t,e),this.guards.delete(t))}tryReflectToAttribute(t){const e=this.mode,s=this.guards;s.has(t)||"fromView"===e||u.enqueue((()=>{s.add(t);const i=t[this.fieldName];switch(e){case"reflect":const e=this.converter;q.setAttribute(t,this.attribute,void 0!==e?e.toView(i):i);break;case"boolean":q.setBooleanAttribute(t,this.attribute,i)}s.delete(t)}))}static collect(t,...e){const s=[];e.push(t.attributes);for(let i=0,n=e.length;i<n;++i){const n=e[i];if(void 0!==n)for(let e=0,i=n.length;e<i;++e){const i=n[e];d(i)?s.push(new Yt(t,i)):s.push(new Yt(t,i.property,i.attribute,i.mode,i.converter))}}return s}}function Zt(t,e){let s;function i(t,e){arguments.length>1&&(s.property=e);const i=t.constructor.attributes||(t.constructor.attributes=[]);i.push(s)}return arguments.length>1?(s={},void i(t,e)):(s=void 0===t?{}:t,i)}const te={mode:"open"},ee={},se=l.getById(4,(()=>c()));class ie{constructor(t,e=t.definition){d(e)&&(e={name:e}),this.type=t,this.name=e.name,this.template=e.template;const s=Yt.collect(t,e.attributes),i=new Array(s.length),n={},r={};for(let t=0,e=s.length;t<e;++t){const e=s[t];i[t]=e.attribute,n[e.name]=e,r[e.attribute]=e}this.attributes=s,this.observedAttributes=i,this.propertyLookup=n,this.attributeLookup=r,this.shadowOptions=void 0===e.shadowOptions?te:null===e.shadowOptions?void 0:Object.assign(Object.assign({},te),e.shadowOptions),this.elementOptions=void 0===e.elementOptions?ee:Object.assign(Object.assign({},ee),e.elementOptions),this.styles=void 0===e.styles?void 0:Array.isArray(e.styles)?new N(e.styles):e.styles instanceof N?e.styles:new N([e.styles])}get isDefined(){return!!se.getByType(this.type)}define(t=customElements){const e=this.type;if(se.register(this)){const t=this.attributes,s=e.prototype;for(let e=0,i=t.length;e<i;++e)b.defineProperty(s,t[e]);Reflect.defineProperty(e,"observedAttributes",{value:this.observedAttributes,enumerable:!0})}return t.get(this.name)||t.define(this.name,e,this.elementOptions),this}}ie.getByType=se.getByType,ie.getForInstance=se.getForInstance;const ne=new WeakMap,re={bubbles:!0,composed:!0,cancelable:!0};function oe(t){var e,s;return null!==(s=null!==(e=t.shadowRoot)&&void 0!==e?e:ne.get(t))&&void 0!==s?s:null}class le extends p{constructor(t,e){super(t),this.boundObservables=null,this.behaviors=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this._styles=null,this._isConnected=!1,this.$fastController=this,this.view=null,this.element=t,this.definition=e;const s=e.shadowOptions;if(void 0!==s){let e=t.shadowRoot;e?this.hasExistingShadowRoot=!0:(e=t.attachShadow(s),"closed"===s.mode&&ne.set(t,e))}const i=b.getAccessors(t);if(i.length>0){const e=this.boundObservables=Object.create(null);for(let s=0,n=i.length;s<n;++s){const n=i[s].name,r=t[n];void 0!==r&&(delete t[n],e[n]=r)}}}get isConnected(){return b.track(this,"isConnected"),this._isConnected}setIsConnected(t){this._isConnected=t,b.notify(this,"isConnected")}get template(){var t;if(null===this._template){const e=this.definition;this.element.resolveTemplate?this._template=this.element.resolveTemplate():e.template&&(this._template=null!==(t=e.template)&&void 0!==t?t:null)}return this._template}set template(t){this._template!==t&&(this._template=t,this.needsInitialization||this.renderTemplate(t))}get styles(){var t;if(null===this._styles){const e=this.definition;this.element.resolveStyles?this._styles=this.element.resolveStyles():e.styles&&(this._styles=null!==(t=e.styles)&&void 0!==t?t:null)}return this._styles}set styles(t){this._styles!==t&&(null!==this._styles&&this.removeStyles(this._styles),this._styles=t,this.needsInitialization||this.addStyles(t))}addStyles(t){if(!t)return;const e=oe(this.element)||this.element.getRootNode();if(t instanceof HTMLElement)e.append(t);else if(!t.isAttachedTo(e)){const s=t.behaviors;t.addStylesTo(e),null!==s&&this.addBehaviors(s)}}removeStyles(t){if(!t)return;const e=oe(this.element)||this.element.getRootNode();if(t instanceof HTMLElement)e.removeChild(t);else if(t.isAttachedTo(e)){const s=t.behaviors;t.removeStylesFrom(e),null!==s&&this.removeBehaviors(s)}}addBehaviors(t){var e;const s=null!==(e=this.behaviors)&&void 0!==e?e:this.behaviors=new Map,i=t.length,n=[];for(let e=0;e<i;++e){const i=t[e];s.has(i)?s.set(i,s.get(i)+1):(s.set(i,1),n.push(i))}if(this._isConnected){const t=this.element,e=m.default;for(let s=0;s<n.length;++s)n[s].bind(t,e)}}removeBehaviors(t,e=!1){const s=this.behaviors;if(null===s)return;const i=t.length,n=[];for(let r=0;r<i;++r){const i=t[r];if(s.has(i)){const t=s.get(i)-1;0===t||e?s.delete(i)&&n.push(i):s.set(i,t)}}if(this._isConnected){const t=this.element,e=m.default;for(let s=0;s<n.length;++s)n[s].unbind(t,e)}}onConnectedCallback(){if(this._isConnected)return;const t=this.element,e=m.default;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(t,e);const s=this.behaviors;if(null!==s)for(const i of s.keys())i.bind(t,e);this.setIsConnected(!0)}onDisconnectedCallback(){if(!this._isConnected)return;this.setIsConnected(!1);const t=this.view;null!==t&&t.unbind();const e=this.behaviors;if(null!==e){const t=this.element,s=m.default;for(const i of e.keys())i.unbind(t,s)}}onAttributeChangedCallback(t,e,s){const i=this.definition.attributeLookup[t];void 0!==i&&i.onAttributeChangedCallback(this.element,s)}emit(t,e,s){return!!this._isConnected&&this.element.dispatchEvent(new CustomEvent(t,Object.assign(Object.assign({detail:e},re),s)))}finishInitialization(){const t=this.element,e=this.boundObservables;if(null!==e){const s=Object.keys(e);for(let i=0,n=s.length;i<n;++i){const n=s[i];t[n]=e[n]}this.boundObservables=null}this.renderTemplate(this.template),this.addStyles(this.styles),this.needsInitialization=!1}renderTemplate(t){var e;const s=this.element,i=null!==(e=oe(s))&&void 0!==e?e:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let t=i.firstChild;null!==t;t=i.firstChild)i.removeChild(t)}t&&(this.view=t.render(s,i,s))}static forCustomElement(t){const e=t.$fastController;if(void 0!==e)return e;const s=ie.getForInstance(t);if(void 0===s)throw l.error(1401);return t.$fastController=new le(t,s)}}function he(t){return class extends t{constructor(){super(),le.forCustomElement(this)}$emit(t,e,s){return this.$fastController.emit(t,e,s)}connectedCallback(){this.$fastController.onConnectedCallback()}disconnectedCallback(){this.$fastController.onDisconnectedCallback()}attributeChangedCallback(t,e,s){this.$fastController.onAttributeChangedCallback(t,e,s)}}}const ce=Object.assign(he(HTMLElement),{from:t=>he(t),define(t,e){return this.metadata(t,e).define().type},metadata:(t,e)=>new ie(t,e)});function ae(t){return function(e){ce.define(e,t)}}export{_ as AdoptedStyleSheetsStrategy,I as ArrayObserver,et as Aspect,Yt as AttributeDefinition,rt as BindingConfig,nt as BindingMode,F as CSSDirective,at as ChangeBinding,Ut as ChildrenDirective,jt as Compiler,le as Controller,q as DOM,N as ElementStyles,dt as EventBinding,m as ExecutionContext,l as FAST,ce as FASTElement,ie as FASTElementDefinition,pt as HTMLBindingDirective,Z as HTMLDirective,vt as HTMLView,K as Markup,Dt as NodeObservationDirective,b as Observable,ct as OneTimeBinding,X as Parser,p as PropertyChangeNotifier,Pt as RefDirective,Mt as RepeatBehavior,zt as RepeatDirective,Qt as SlottedDirective,w as Splice,O as SpliceStrategy,C as SpliceStrategySupport,st as StatelessAttachedAttributeDirective,f as SubscriberSet,ot as UpdateBinding,u as Updates,It as ViewTemplate,Zt as attr,bt as bind,Jt as booleanConverter,Gt as children,c as createTypeRegistry,z as css,L as cssDirective,H as cssPartial,ae as customElement,qt as elements,h as emptyArray,kt as html,tt as htmlDirective,$ as lengthOf,Xt as nullableNumberConverter,g as observable,ut as onChange,ft as oneTime,Nt as ref,Rt as repeat,Wt as slotted,v as volatile,_t as when}; |
@@ -107,5 +107,5 @@ ## API Report File for "@microsoft/fast-element" | ||
// @public | ||
export interface Behavior<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = RootContext> { | ||
bind(source: TSource, context: TContext): void; | ||
unbind(source: TSource, context: TContext): void; | ||
export interface Behavior<TSource = any, TParent = any> { | ||
bind(source: TSource, context: ExecutionContext<TParent>): void; | ||
unbind(source: TSource, context: ExecutionContext<TParent>): void; | ||
} | ||
@@ -117,3 +117,3 @@ | ||
// @public | ||
export type Binding<TSource = any, TReturn = any, TContext extends ExecutionContext = ExecutionContext> = (source: TSource, context: TContext) => TReturn; | ||
export type Binding<TSource = any, TReturn = any, TParent = any> = (source: TSource, context: ExecutionContext<TParent>) => TReturn; | ||
@@ -172,12 +172,2 @@ // @public | ||
// @public | ||
export const child: <TChild = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TChild, TParent, ChildContext<TParent>>[]) => ChildViewTemplate<TChild, TParent>; | ||
// @public | ||
export interface ChildContext<TParentSource = any> extends RootContext { | ||
createItemContext(index: number, length: number): ItemContext<TParentSource>; | ||
readonly parent: TParentSource; | ||
readonly parentContext: ChildContext<TParentSource>; | ||
} | ||
// @public | ||
export interface ChildListDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, Omit<MutationObserverInit, "subtree" | "childList"> { | ||
@@ -201,9 +191,2 @@ } | ||
// @public | ||
export interface ChildViewTemplate<TSource = any, TParent = any> { | ||
create(): SyntheticView<TSource, TParent, ChildContext<TParent>>; | ||
// (undocumented) | ||
type: "child"; | ||
} | ||
// @public | ||
export type CompilationStrategy = ( | ||
@@ -216,3 +199,3 @@ html: string | HTMLTemplateElement, | ||
setHTMLPolicy(policy: TrustedTypesPolicy): void; | ||
compile<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): HTMLTemplateCompilationResult<TSource, TParent, TContext>; | ||
compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): HTMLTemplateCompilationResult<TSource, TParent>; | ||
setDefaultStrategy(strategy: CompilationStrategy): void; | ||
@@ -304,8 +287,2 @@ aggregate(parts: (string | ViewBehaviorFactory)[]): ViewBehaviorFactory; | ||
// @public | ||
export type DefaultTwoWayBindingOptions = DefaultBindingOptions & { | ||
changeEvent?: string; | ||
fromView?: (value: any) => any; | ||
}; | ||
// @public | ||
export interface Disposable { | ||
@@ -350,3 +327,3 @@ dispose(): void; | ||
// @public | ||
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent, RootContext> { | ||
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent> { | ||
appendTo(node: Node): void; | ||
@@ -359,4 +336,2 @@ } | ||
render(source: TSource, host: Node, hostBindingTarget?: Element): ElementView<TSource, TParent>; | ||
// (undocumented) | ||
type: "element"; | ||
} | ||
@@ -380,11 +355,24 @@ | ||
// @public | ||
export const ExecutionContext: Readonly<{ | ||
default: RootContext; | ||
setEvent(event: Event | null): void; | ||
create(): RootContext; | ||
}>; | ||
export class ExecutionContext<TParentSource = any> { | ||
static create(): ExecutionContext; | ||
createChildContext<TParentSource>(parentSource: TParentSource): ExecutionContext<TParentSource>; | ||
createItemContext(index: number, length: number): ExecutionContext<TParentSource>; | ||
static readonly default: ExecutionContext<any>; | ||
get event(): Event; | ||
eventDetail<TDetail>(): TDetail; | ||
eventTarget<TTarget extends EventTarget>(): TTarget; | ||
index: number; | ||
get isEven(): boolean; | ||
get isFirst(): boolean; | ||
get isInMiddle(): boolean; | ||
get isLast(): boolean; | ||
get isOdd(): boolean; | ||
length: number; | ||
readonly parent: TParentSource; | ||
readonly parentContext: ExecutionContext<TParentSource>; | ||
// @internal | ||
static setEvent(event: Event | null): void; | ||
updatePosition(index: number, length: number): void; | ||
} | ||
// @public | ||
export type ExecutionContext<TParentSource = any> = RootContext | ChildContext<TParentSource> | ItemContext<TParentSource>; | ||
// Warning: (ae-internal-missing-underscore) The name "FAST" should be prefixed with an underscore because the declaration is marked as @internal | ||
@@ -411,2 +399,3 @@ // | ||
define<TType extends Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType; | ||
metadata<TType_1 extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType_1, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType_1>; | ||
}; | ||
@@ -446,3 +435,3 @@ | ||
// @public | ||
export function html<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent, TContext>[]): ViewTemplate<TSource, TParent>; | ||
export function html<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]): ViewTemplate<TSource, TParent>; | ||
@@ -488,12 +477,12 @@ // @public | ||
// @public | ||
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> { | ||
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent, TContext>; | ||
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> { | ||
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent>; | ||
} | ||
// @public | ||
export class HTMLView<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent, TContext> { | ||
export class HTMLView<TSource = any, TParent = any> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent> { | ||
constructor(fragment: DocumentFragment, factories: ReadonlyArray<ViewBehaviorFactory>, targets: ViewBehaviorTargets); | ||
appendTo(node: Node): void; | ||
bind(source: TSource, context: TContext): void; | ||
context: TContext | null; | ||
bind(source: TSource, context: ExecutionContext<TParent>): void; | ||
context: ExecutionContext<TParent> | null; | ||
dispose(): void; | ||
@@ -510,33 +499,10 @@ static disposeContiguousBatch(views: SyntheticView[]): void; | ||
// @public | ||
export const item: <TItem = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TItem, TParent, ItemContext<TParent>>[]) => ItemViewTemplate<TItem, TParent>; | ||
// @public | ||
export interface ItemContext<TParentSource = any> extends ChildContext<TParentSource> { | ||
readonly index: number; | ||
readonly isEven: boolean; | ||
readonly isFirst: boolean; | ||
readonly isInMiddle: boolean; | ||
readonly isLast: boolean; | ||
readonly isOdd: boolean; | ||
readonly length: number; | ||
updatePosition(index: number, length: number): void; | ||
export interface LengthObserver extends Subscriber { | ||
length: number; | ||
} | ||
// @public | ||
export interface ItemViewTemplate<TSource = any, TParent = any> { | ||
create(): SyntheticView<TSource, TParent, ItemContext<TParent>>; | ||
// (undocumented) | ||
type: "item"; | ||
} | ||
export function lengthOf<T>(array: readonly T[]): number; | ||
// @public | ||
function length_2<T>(array: readonly T[]): number; | ||
export { length_2 as length } | ||
// @public | ||
export interface LengthObserver extends Subscriber { | ||
length: number; | ||
} | ||
// @public | ||
export const Markup: Readonly<{ | ||
@@ -593,4 +559,4 @@ interpolation: (id: string) => string; | ||
getAccessors: (target: {}) => Accessor[]; | ||
binding<TSource = any, TReturn = any>(binding: Binding<TSource, TReturn, ExecutionContext<any>>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): BindingObserver<TSource, TReturn, any>; | ||
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(binding: Binding<TSource_1, TReturn_1, ExecutionContext<any>>): boolean; | ||
binding<TSource = any, TReturn = any>(binding: Binding<TSource, TReturn, any>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): BindingObserver<TSource, TReturn, any>; | ||
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(binding: Binding<TSource_1, TReturn_1, any>): boolean; | ||
}>; | ||
@@ -657,39 +623,5 @@ | ||
// @public | ||
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ViewTemplate | Binding<TSource, ViewTemplate, RootContext>, options?: { | ||
positioning: false; | ||
} | { | ||
recycle: true; | ||
} | { | ||
positioning: false; | ||
recycle: false; | ||
} | { | ||
positioning: false; | ||
recycle: true; | ||
}): CaptureType<TSource>; | ||
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ViewTemplate | Binding<TSource, ViewTemplate>, options?: RepeatOptions): CaptureType<TSource>; | ||
// @public | ||
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ChildViewTemplate | Binding<TSource, ChildViewTemplate, ChildContext>, options?: { | ||
positioning: false; | ||
} | { | ||
recycle: true; | ||
} | { | ||
positioning: false; | ||
recycle: false; | ||
} | { | ||
positioning: false; | ||
recycle: true; | ||
}): CaptureType<TSource>; | ||
// @public | ||
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ItemViewTemplate | Binding<TSource, ItemViewTemplate, ItemContext>, options: { | ||
positioning: true; | ||
} | { | ||
positioning: true; | ||
recycle: true; | ||
} | { | ||
positioning: true; | ||
recycle: false; | ||
}): CaptureType<TSource>; | ||
// @public | ||
export class RepeatBehavior<TSource = any> implements Behavior, Subscriber { | ||
@@ -724,20 +656,2 @@ constructor(location: Node, itemsBinding: Binding<TSource, any[]>, isItemsBindingVolatile: boolean, templateBinding: Binding<TSource, SyntheticViewTemplate>, isTemplateBindingVolatile: boolean, options: RepeatOptions); | ||
// @public | ||
export interface RootContext { | ||
createChildContext<TParentSource>(source: TParentSource): ChildContext<TParentSource>; | ||
readonly event: Event; | ||
eventDetail<TDetail = any>(): TDetail; | ||
eventTarget<TTarget extends EventTarget = EventTarget>(): TTarget; | ||
} | ||
// @public | ||
export const signal: <T = any>(options: string | Binding<T, any, ExecutionContext<any>>) => BindingConfig<string | Binding<T, any, ExecutionContext<any>>>; | ||
// @public | ||
export class SignalBinding extends UpdateBinding { | ||
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void; | ||
static send(signal: string): void; | ||
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void; | ||
} | ||
// @public | ||
export function slotted<T = any>(propertyOrOptions: (keyof T & string) | SlottedDirectiveOptions<keyof T & string>): CaptureType<T>; | ||
@@ -849,3 +763,3 @@ | ||
// @public | ||
export interface SyntheticView<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> extends View<TSource, TParent, TContext> { | ||
export interface SyntheticView<TSource = any, TParent = any> extends View<TSource, TParent> { | ||
readonly firstChild: Node; | ||
@@ -858,10 +772,8 @@ insertBefore(node: Node): void; | ||
// @public | ||
export interface SyntheticViewTemplate<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> { | ||
create(): SyntheticView<TSource, TParent, TContext>; | ||
// (undocumented) | ||
type: "synthetic"; | ||
export interface SyntheticViewTemplate<TSource = any, TParent = any> { | ||
create(): SyntheticView<TSource, TParent>; | ||
} | ||
// @public | ||
export type TemplateValue<TSource, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> = Binding<TSource, any, TContext> | HTMLDirective | CaptureType<TSource>; | ||
export type TemplateValue<TSource, TParent = any> = Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource>; | ||
@@ -878,19 +790,2 @@ // @public | ||
// @public | ||
export const twoWay: BindingConfig<DefaultTwoWayBindingOptions> & BindingConfigResolver<DefaultTwoWayBindingOptions>; | ||
// @public | ||
export class TwoWayBinding extends ChangeBinding { | ||
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void; | ||
static configure(settings: TwoWaySettings): void; | ||
// @internal (undocumented) | ||
handleEvent(event: Event): void; | ||
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void; | ||
} | ||
// @public | ||
export interface TwoWaySettings { | ||
determineChangeEvent(directive: HTMLBindingDirective, target: HTMLElement): string; | ||
} | ||
// Warning: (ae-internal-missing-underscore) The name "TypeDefinition" should be prefixed with an underscore because the declaration is marked as @internal | ||
@@ -954,5 +849,5 @@ // | ||
// @public | ||
export interface View<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> extends Disposable { | ||
bind(source: TSource, context: TContext): void; | ||
readonly context: TContext | null; | ||
export interface View<TSource = any, TParent = any> extends Disposable { | ||
bind(source: TSource, context: ExecutionContext<TParent>): void; | ||
readonly context: ExecutionContext<TParent> | null; | ||
readonly source: TSource | null; | ||
@@ -981,9 +876,8 @@ unbind(): void; | ||
// @public | ||
export class ViewTemplate<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent, TContext> { | ||
export class ViewTemplate<TSource = any, TParent = any> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent> { | ||
constructor(html: string | HTMLTemplateElement, factories: Record<string, ViewBehaviorFactory>); | ||
create(hostBindingTarget?: Element): HTMLView<TSource, TParent, TContext>; | ||
create(hostBindingTarget?: Element): HTMLView<TSource, TParent>; | ||
readonly factories: Record<string, ViewBehaviorFactory>; | ||
readonly html: string | HTMLTemplateElement; | ||
render(source: TSource, host: Node, hostBindingTarget?: Element, context?: TContext): HTMLView<TSource, TParent, TContext>; | ||
type: any; | ||
render(source: TSource, host: Node, hostBindingTarget?: Element, context?: ExecutionContext): HTMLView<TSource, TParent>; | ||
} | ||
@@ -990,0 +884,0 @@ |
{ | ||
"name": "@microsoft/fast-element", | ||
"description": "A library for constructing Web Components", | ||
"version": "2.0.0-beta.1", | ||
"version": "2.0.0-beta.2", | ||
"author": { | ||
@@ -21,6 +21,6 @@ "name": "Microsoft", | ||
"main": "dist/esm/index.js", | ||
"types": "dist/fast-element.d.ts", | ||
"types": "dist/dts/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/fast-element.d.ts", | ||
"types": "./dist/dts/index.d.ts", | ||
"production": "./dist/esm/index.js", | ||
@@ -38,6 +38,14 @@ "development": "./dist/esm/index.debug.js", | ||
}, | ||
"./splice-strategies": { | ||
"./observation/splice-strategies": { | ||
"types": "./dist/dts/observation/splice-strategies.d.ts", | ||
"default": "./dist/esm/observation/splice-strategies.js" | ||
}, | ||
"./binding/two-way": { | ||
"types": "./dist/dts/templating/binding-two-way.d.ts", | ||
"default": "./dist/esm/templating/binding-two-way.js" | ||
}, | ||
"./binding/signal": { | ||
"types": "./dist/dts/templating/binding-signal.d.ts", | ||
"default": "./dist/esm/templating/binding-signal.js" | ||
}, | ||
"./utilities": { | ||
@@ -50,2 +58,10 @@ "types": "./dist/dts/utilities.d.ts", | ||
"default": "./dist/esm/hooks.js" | ||
}, | ||
"./context": { | ||
"types": "./dist/dts/context.d.ts", | ||
"default": "./dist/esm/context.js" | ||
}, | ||
"./metadata": { | ||
"types": "./dist/dts/metadata.d.ts", | ||
"default": "./dist/esm/metadata.js" | ||
} | ||
@@ -52,0 +68,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104
1604994
39195