@genesislcap/foundation-testing 9.0.1-alpha-b5c5eb7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MODULE_FEDERATION.md +11 -0
- package/README.md +255 -0
- package/dist/1.0.0.remoteEntry.js +1 -0
- package/dist/191.0099ca6c24422254d51d36c222dc6023.js.map +1 -0
- package/dist/191.191.613504f8a55556ba573c.js +2 -0
- package/dist/259.1ff0e7689abdc0527a57f2eb20369ada.js.map +1 -0
- package/dist/259.259.724449a74ba114ef0d82.js +2 -0
- package/dist/415.32cf4cabeed75f5d759d12434a4de5c7.js.map +1 -0
- package/dist/415.415.ee8e35767118401bccab.js +3 -0
- package/dist/415.415.ee8e35767118401bccab.js.LICENSE.txt +4 -0
- package/dist/623.1b885cabcffad0807eeb0de7ad5dd497.js.map +1 -0
- package/dist/623.623.148af50848667bfda381.js +3 -0
- package/dist/623.623.148af50848667bfda381.js.LICENSE.txt +4 -0
- package/dist/755.497b49c90948bc3e157823cb2632c52a.js.map +1 -0
- package/dist/755.755.5f9603173373118bd373.js +2 -0
- package/dist/772.772.6fed5dfc27e91bebaacc.js +2 -0
- package/dist/772.8116969a190f5c8bc076b1604d507de7.js.map +1 -0
- package/dist/dashboard.json +1 -0
- package/dist/dts/component/fixture.d.ts +93 -0
- package/dist/dts/component/fixture.d.ts.map +1 -0
- package/dist/dts/component/index.d.ts +2 -0
- package/dist/dts/component/index.d.ts.map +1 -0
- package/dist/dts/index.d.ts +11 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/index.federated.d.ts +1 -0
- package/dist/dts/index.federated.d.ts.map +1 -0
- package/dist/dts/jsdom/setup.d.ts +14 -0
- package/dist/dts/jsdom/setup.d.ts.map +1 -0
- package/dist/dts/playwright/index.d.ts +5 -0
- package/dist/dts/playwright/index.d.ts.map +1 -0
- package/dist/dts/playwright/setup.d.ts +13 -0
- package/dist/dts/playwright/setup.d.ts.map +1 -0
- package/dist/dts/playwright/test.d.ts +16 -0
- package/dist/dts/playwright/test.d.ts.map +1 -0
- package/dist/dts/suite/index.d.ts +2 -0
- package/dist/dts/suite/index.d.ts.map +1 -0
- package/dist/dts/suite/suite.d.ts +127 -0
- package/dist/dts/suite/suite.d.ts.map +1 -0
- package/dist/dts/utils/index.d.ts +2 -0
- package/dist/dts/utils/index.d.ts.map +1 -0
- package/dist/dts/utils/logger.d.ts +8 -0
- package/dist/dts/utils/logger.d.ts.map +1 -0
- package/dist/dts/uvu/index.d.ts +2 -0
- package/dist/dts/uvu/index.d.ts.map +1 -0
- package/dist/dts/uvu/uvu.d.ts +8 -0
- package/dist/dts/uvu/uvu.d.ts.map +1 -0
- package/dist/esm/component/fixture.js +87 -0
- package/dist/esm/component/fixture.js.map +1 -0
- package/dist/esm/component/index.js +2 -0
- package/dist/esm/component/index.js.map +1 -0
- package/dist/esm/index.federated.js +2 -0
- package/dist/esm/index.federated.js.map +1 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/jsdom/setup.js +92 -0
- package/dist/esm/jsdom/setup.js.map +1 -0
- package/dist/esm/playwright/index.js +5 -0
- package/dist/esm/playwright/index.js.map +1 -0
- package/dist/esm/playwright/setup.js +24 -0
- package/dist/esm/playwright/setup.js.map +1 -0
- package/dist/esm/playwright/test.js +22 -0
- package/dist/esm/playwright/test.js.map +1 -0
- package/dist/esm/suite/index.js +2 -0
- package/dist/esm/suite/index.js.map +1 -0
- package/dist/esm/suite/suite.js +144 -0
- package/dist/esm/suite/suite.js.map +1 -0
- package/dist/esm/utils/index.js +2 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/logger.js +9 -0
- package/dist/esm/utils/logger.js.map +1 -0
- package/dist/esm/uvu/index.js +2 -0
- package/dist/esm/uvu/index.js.map +1 -0
- package/dist/esm/uvu/uvu.js +8 -0
- package/dist/esm/uvu/uvu.js.map +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/foundation-testing.api.json +1288 -0
- package/dist/foundation-testing.d.ts +255 -0
- package/dist/foundation-testing.iife.min.js +15 -0
- package/dist/foundation-testing.js +6991 -0
- package/dist/foundation-testing.min.js +15 -0
- package/dist/foundationTesting.db8dd99e6cb1a53c58d5d48831729dc0.js.map +1 -0
- package/dist/index.ejs +23 -0
- package/dist/index.html +14 -0
- package/dist/info.ejs +13 -0
- package/dist/main.c5f312e26acb28a2836d58614701899c.js.map +1 -0
- package/dist/main.ce9669d02474786f9fdc.js +2 -0
- package/dist/npm.consola.713.2f64f3cac7864c3b4057.js +2 -0
- package/dist/npm.consola.8813a44257414a02ed3be5608793f087.js.map +1 -0
- package/dist/npm.diff.83d06b572c2ee1bd4957fc9f121bf65a.js.map +1 -0
- package/dist/npm.diff.852.9166591dbfda57fefcc7.js +2 -0
- package/dist/npm.microsoft.127.8c2d0309b2c5ee49f9ed.js +1469 -0
- package/dist/npm.microsoft.127.8c2d0309b2c5ee49f9ed.js.LICENSE.txt +14 -0
- package/dist/npm.microsoft.53571229b0cfc6a6b1b069cfe9a8483d.js.map +1 -0
- package/dist/remoteEntry.js +2 -0
- package/dist/serve.json +3 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/docs/api/foundation-testing.componentcontext.container.md +11 -0
- package/docs/api/foundation-testing.componentcontext.designsystem.md +11 -0
- package/docs/api/foundation-testing.componentcontext.md +22 -0
- package/docs/api/foundation-testing.createcomponentsuite.md +93 -0
- package/docs/api/foundation-testing.createlogicsuite.md +54 -0
- package/docs/api/foundation-testing.elementgetter.md +12 -0
- package/docs/api/foundation-testing.fixture.connect.md +21 -0
- package/docs/api/foundation-testing.fixture.disconnect.md +21 -0
- package/docs/api/foundation-testing.fixture.document.md +13 -0
- package/docs/api/foundation-testing.fixture.element.md +13 -0
- package/docs/api/foundation-testing.fixture.md +31 -0
- package/docs/api/foundation-testing.fixture.parent.md +18 -0
- package/docs/api/foundation-testing.fixture.template.md +13 -0
- package/docs/api/foundation-testing.fixture.view.md +13 -0
- package/docs/api/foundation-testing.fixtureoptions.context.md +13 -0
- package/docs/api/foundation-testing.fixtureoptions.designsystem.md +13 -0
- package/docs/api/foundation-testing.fixtureoptions.document.md +13 -0
- package/docs/api/foundation-testing.fixtureoptions.md +24 -0
- package/docs/api/foundation-testing.fixtureoptions.parent.md +13 -0
- package/docs/api/foundation-testing.fixtureoptions.source.md +13 -0
- package/docs/api/foundation-testing.logger.md +18 -0
- package/docs/api/foundation-testing.logiccontext.md +20 -0
- package/docs/api/foundation-testing.logiccontext.runcases.md +23 -0
- package/docs/api/foundation-testing.md +35 -0
- package/docs/api/index.md +12 -0
- package/docs/api-report.md +87 -0
- package/license.txt +46 -0
- package/package.json +116 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import * as assert from 'uvu/assert';
|
|
2
|
+
import { Constructable } from '@microsoft/fast-element';
|
|
3
|
+
import { Container } from '@microsoft/fast-foundation';
|
|
4
|
+
import { DesignSystem } from '@microsoft/fast-foundation';
|
|
5
|
+
import { ExecutionContext } from '@microsoft/fast-element';
|
|
6
|
+
import type { FoundationElement } from '@microsoft/fast-foundation';
|
|
7
|
+
import { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
8
|
+
import { FoundationElementRegistry } from '@microsoft/fast-foundation';
|
|
9
|
+
import { HTMLView } from '@microsoft/fast-element';
|
|
10
|
+
import { Logger } from '@genesislcap/foundation-utils';
|
|
11
|
+
import { Registration } from '@microsoft/fast-foundation';
|
|
12
|
+
import { suite as suite_2 } from 'uvu';
|
|
13
|
+
import { test as test_2 } from 'uvu';
|
|
14
|
+
import { uvu } from 'uvu';
|
|
15
|
+
import { ViewTemplate } from '@microsoft/fast-element';
|
|
16
|
+
|
|
17
|
+
export { assert }
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Component suite context interface
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export declare interface ComponentContext<TElement = HTMLElement> extends Pick<Fixture<TElement>, 'element' | 'disconnect'> {
|
|
24
|
+
designSystem: DesignSystem;
|
|
25
|
+
container: Container;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Create component test suite.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* Simple suite using the tag name of the component.
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { createComponentSuite } from '@genesislcap/foundation-testing';
|
|
35
|
+
* import { Component } from './component';
|
|
36
|
+
* Component; // < As we're using tag name in the Suite, we hold a reference to avoid tree shaking.
|
|
37
|
+
* const Suite = createComponentSuite<Component>('Component', 'my-component');
|
|
38
|
+
* // test cases...
|
|
39
|
+
* Suite.run();
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* Mocking a DI dependency for a composable component.
|
|
44
|
+
* ```ts
|
|
45
|
+
* const connectMock = new ConnectMock();
|
|
46
|
+
* const mocks = [Registration.instance(Connect, connectMock)];
|
|
47
|
+
* const Suite = createComponentSuite<ConnectionIndicator>('ConnectionIndicator Component', () => connectionIndicator(), null, mocks);
|
|
48
|
+
* // test cases...
|
|
49
|
+
* Suite.run();
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* An element will be required to test anything that directly or in-directly makes use of the DI container, for example,
|
|
54
|
+
* a service that can be injected into components, or has its own injected dependencies.
|
|
55
|
+
* ```ts
|
|
56
|
+
* import { Service } from './service';
|
|
57
|
+
* @customElement({
|
|
58
|
+
* name: 'test-element',
|
|
59
|
+
* template: html`<slot></slot>`,
|
|
60
|
+
* })
|
|
61
|
+
* class TestElement extends FASTElement {}
|
|
62
|
+
* const mocks = [...];
|
|
63
|
+
* const Suite = createComponentSuite<TestElement>('Service', 'test-element', null, mocks);
|
|
64
|
+
* // test cases...
|
|
65
|
+
* Suite.run();
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* Importing the service should invoke the Service's DI registration, so in your test cases you can simply query the
|
|
69
|
+
* container to get a reference to your service.
|
|
70
|
+
* ```ts
|
|
71
|
+
* Suite('Service.x does something expected', async ({ container }) => {
|
|
72
|
+
* const myService = container.get(Service);
|
|
73
|
+
* // assert
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* You can optionally add the service to the test element for lookup convenience, but this is not required.
|
|
78
|
+
* ```ts
|
|
79
|
+
* class TestElement extends FASTElement {
|
|
80
|
+
* @Service service: Service;
|
|
81
|
+
* }
|
|
82
|
+
* Suite('Element has service injected', async ({ element }) => {
|
|
83
|
+
* assert.ok(element.service);
|
|
84
|
+
* });
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @typeParam TElement - The element interface.
|
|
88
|
+
* @param title - Title of the test suite
|
|
89
|
+
* @param elementNameOrGetter - Element tag name or getter which is used to create the element within the fixture
|
|
90
|
+
* @param context - Optional component context {@link ComponentContext}
|
|
91
|
+
* @param registrations - Optional array of DI container registrations
|
|
92
|
+
* @returns The test suite
|
|
93
|
+
* @public
|
|
94
|
+
* @remarks
|
|
95
|
+
* Used to test function output given certain input arguments.
|
|
96
|
+
*/
|
|
97
|
+
export declare function createComponentSuite<TElement = HTMLElement>(title: string, elementNameOrGetter: string | ElementGetter, context?: ComponentContext<TElement>, registrations?: Registration<any>[]): uvu.Test<ComponentContext<TElement>>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Create logic test suite.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* import { createLogicSuite } from '@genesislcap/foundation-testing';
|
|
105
|
+
* import { myFunction } from './logic';
|
|
106
|
+
* const Suite = createLogicSuite('myFunction');
|
|
107
|
+
* Suite('myFunction should provide expected results', ({ runCases }) => {
|
|
108
|
+
* runCases(myFunction, [
|
|
109
|
+
* [['1'], true],
|
|
110
|
+
* [[123], true],
|
|
111
|
+
* [['60%'], true],
|
|
112
|
+
* [['$60'], false],
|
|
113
|
+
* [['1.1'], false],
|
|
114
|
+
* [[''], false],
|
|
115
|
+
* [[true], false],
|
|
116
|
+
* [[null], false],
|
|
117
|
+
* [[undefined], false],
|
|
118
|
+
* ]);
|
|
119
|
+
* });
|
|
120
|
+
* Suite.run();
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @typeParam TContext - The context interface.
|
|
124
|
+
* @param title - Title of the test suite
|
|
125
|
+
* @param context - Optional context which extends {@link LogicContext}
|
|
126
|
+
* @returns The test suite
|
|
127
|
+
* @public
|
|
128
|
+
* @remarks
|
|
129
|
+
* Used to test function output given certain input arguments.
|
|
130
|
+
*/
|
|
131
|
+
export declare function createLogicSuite<TContext = LogicContext>(title: string, context?: TContext): uvu.Test<TContext>;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
export declare type ElementGetter = () => FoundationElementRegistry<FoundationElementDefinition, FoundationElement>;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Unit test fixture.
|
|
140
|
+
* @public
|
|
141
|
+
*/
|
|
142
|
+
export declare interface Fixture<TElement = HTMLElement> {
|
|
143
|
+
/**
|
|
144
|
+
* The document the fixture is running in.
|
|
145
|
+
*/
|
|
146
|
+
document: Document;
|
|
147
|
+
/**
|
|
148
|
+
* The template the fixture was created from.
|
|
149
|
+
*/
|
|
150
|
+
template: ViewTemplate;
|
|
151
|
+
/**
|
|
152
|
+
* The view that was created from the fixture's template.
|
|
153
|
+
*/
|
|
154
|
+
view: HTMLView;
|
|
155
|
+
/**
|
|
156
|
+
* The parent element that the view was appended to.
|
|
157
|
+
* @remarks
|
|
158
|
+
* This element will be appended to the DOM only
|
|
159
|
+
* after {@link Fixture.connect} has been called.
|
|
160
|
+
*/
|
|
161
|
+
parent: HTMLElement;
|
|
162
|
+
/**
|
|
163
|
+
* The first element in the {@link Fixture.view}.
|
|
164
|
+
*/
|
|
165
|
+
element: TElement;
|
|
166
|
+
/**
|
|
167
|
+
* Adds the {@link Fixture.parent} to the DOM, causing the
|
|
168
|
+
* connect lifecycle to begin.
|
|
169
|
+
* @remarks
|
|
170
|
+
* Yields control to the caller one Microtask later, in order to
|
|
171
|
+
* ensure that the DOM has settled.
|
|
172
|
+
*/
|
|
173
|
+
connect(): Promise<void>;
|
|
174
|
+
/**
|
|
175
|
+
* Removes the {@link Fixture.parent} from the DOM, causing the
|
|
176
|
+
* disconnect lifecycle to begin.
|
|
177
|
+
* @remarks
|
|
178
|
+
* Yields control to the caller one Microtask later, in order to
|
|
179
|
+
* ensure that the DOM has settled.
|
|
180
|
+
*/
|
|
181
|
+
disconnect(): Promise<void>;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Creates a test fixture suitable for testing custom elements, templates, and bindings.
|
|
186
|
+
* @param templateNameOrRegistry - An HTML template or single element name to create the fixture for.
|
|
187
|
+
* @param options - Enables customizing fixture creation behavior.
|
|
188
|
+
* @returns A promise of the test fixture {@link Fixture}.
|
|
189
|
+
*
|
|
190
|
+
* @public
|
|
191
|
+
* @remarks
|
|
192
|
+
* Yields control to the caller one Microtask later, in order to
|
|
193
|
+
* ensure that the DOM has settled. This has changed in the latest version of FAST!
|
|
194
|
+
*/
|
|
195
|
+
export declare function fixture<TElement = HTMLElement>(templateNameOrRegistry: ViewTemplate | string | FoundationElementRegistry<FoundationElementDefinition, Constructable<TElement>> | [
|
|
196
|
+
FoundationElementRegistry<FoundationElementDefinition, Constructable<TElement>>,
|
|
197
|
+
...FoundationElementRegistry<FoundationElementDefinition, Constructable>[]
|
|
198
|
+
], options?: FixtureOptions): Promise<Fixture<TElement>>;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Options used to customize the creation of the unit test fixture.
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
export declare interface FixtureOptions {
|
|
205
|
+
/**
|
|
206
|
+
* The document to run the fixture in.
|
|
207
|
+
* @defaultValue `globalThis.document`
|
|
208
|
+
*/
|
|
209
|
+
document?: Document;
|
|
210
|
+
/**
|
|
211
|
+
* The parent element to append the fixture to.
|
|
212
|
+
* @defaultValue An instance of `HTMLDivElement`.
|
|
213
|
+
*/
|
|
214
|
+
parent?: HTMLElement;
|
|
215
|
+
/**
|
|
216
|
+
* The data source to bind the HTML to.
|
|
217
|
+
* @defaultValue An empty object.
|
|
218
|
+
*/
|
|
219
|
+
source?: any;
|
|
220
|
+
/**
|
|
221
|
+
* The execution context to use during binding.
|
|
222
|
+
* @defaultValue {@link @microsoft/fast-element#defaultExecutionContext}
|
|
223
|
+
*/
|
|
224
|
+
context?: ExecutionContext;
|
|
225
|
+
/**
|
|
226
|
+
* A pre-configured design system instance used in setting up the fixture.
|
|
227
|
+
*/
|
|
228
|
+
designSystem?: DesignSystem;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Test logger
|
|
233
|
+
* @public
|
|
234
|
+
* @remarks
|
|
235
|
+
* Exported so you can set log levels differently across packages when needed.
|
|
236
|
+
*/
|
|
237
|
+
export declare const logger: Logger;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Logic suite context interface
|
|
241
|
+
* @public
|
|
242
|
+
*/
|
|
243
|
+
export declare interface LogicContext {
|
|
244
|
+
runCases?(fn: (value: any) => any, cases: [any, any, assert.Message?][]): void;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export { Registration }
|
|
248
|
+
|
|
249
|
+
export { suite_2 as suite }
|
|
250
|
+
|
|
251
|
+
export { test_2 as test }
|
|
252
|
+
|
|
253
|
+
export { uvu }
|
|
254
|
+
|
|
255
|
+
export { }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
!function(e){"use strict";const t=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;try{return new Function("return this")()}catch(e){return{}}}();void 0===t.trustedTypes&&(t.trustedTypes={createPolicy:(e,t)=>t});const s={configurable:!1,enumerable:!1,writable:!1};void 0===t.FAST&&Reflect.defineProperty(t,"FAST",Object.assign({value:Object.create(null)},s));const n=t.FAST;if(void 0===n.getById){const e=Object.create(null);Reflect.defineProperty(n,"getById",Object.assign({value(t,s){let n=e[t];return void 0===n&&(n=s?e[t]=s():null),n}},s))}const r=Object.freeze([]);function i(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let n=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==n;)s=e.get(n),n=Reflect.getPrototypeOf(n);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}const o=t.FAST.getById(1,(()=>{const e=[],s=[];function n(){if(s.length)throw s.shift()}function r(e){try{e.call()}catch(e){s.push(e),setTimeout(n,0)}}function i(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,n=e.length-t;s<n;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}return Object.freeze({enqueue:function(s){e.length<1&&t.requestAnimationFrame(i),e.push(s)},process:i})})),a=t.trustedTypes.createPolicy("fast-html",{createHTML:e=>e});let l=a;const c=`fast-${Math.random().toString(36).substring(2,8)}`,h=`${c}{`,u=`}${c}`,d=Object.freeze({supportsAdoptedStyleSheets:Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype,setHTMLPolicy(e){if(l!==a)throw new Error("The HTML policy can only be set once.");l=e},createHTML:e=>l.createHTML(e),isMarker:e=>e&&8===e.nodeType&&e.data.startsWith(c),extractDirectiveIndexFromMarker:e=>parseInt(e.data.replace(`${c}:`,"")),createInterpolationPlaceholder:e=>`${h}${e}${u}`,createCustomAttributePlaceholder(e,t){return`${e}="${this.createInterpolationPlaceholder(t)}"`},createBlockPlaceholder:e=>`\x3c!--${c}:${e}--\x3e`,queueUpdate:o.enqueue,processUpdates:o.process,nextUpdate:()=>new Promise(o.enqueue),setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)},removeChildNodes(e){for(let t=e.firstChild;null!==t;t=e.firstChild)e.removeChild(t)},createTemplateWalker:e=>document.createTreeWalker(e,133,null,!1)});class f{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.source=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.source;if(void 0===t){const t=this.sub1,n=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==n&&n.handleChange(s,e)}else for(let n=0,r=t.length;n<r;++n)t[n].handleChange(s,e)}}class g{constructor(e){this.subscribers={},this.sourceSubscribers=null,this.source=e}notify(e){var t;const s=this.subscribers[e];void 0!==s&&s.notify(e),null===(t=this.sourceSubscribers)||void 0===t||t.notify(e)}subscribe(e,t){var s;if(t){let s=this.subscribers[t];void 0===s&&(this.subscribers[t]=s=new f(this.source)),s.subscribe(e)}else this.sourceSubscribers=null!==(s=this.sourceSubscribers)&&void 0!==s?s:new f(this.source),this.sourceSubscribers.subscribe(e)}unsubscribe(e,t){var s;if(t){const s=this.subscribers[t];void 0!==s&&s.unsubscribe(e)}else null===(s=this.sourceSubscribers)||void 0===s||s.unsubscribe(e)}}const p=n.getById(2,(()=>{const e=/(:|&&|\|\||if)/,t=new WeakMap,s=d.queueUpdate;let n,r=e=>{throw new Error("Must call enableArrayObservation before observing arrays.")};function o(e){let s=e.$fastController||t.get(e);return void 0===s&&(Array.isArray(e)?s=r(e):t.set(e,s=new g(e))),s}const a=i();class l{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,n=e[s];if(n!==t){e[s]=t;const r=e[this.callback];"function"==typeof r&&r.call(e,n,t),o(e).notify(this.name)}}}class c extends f{constructor(e,t,s=!1){super(e,t),this.binding=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}observe(e,t){this.needsRefresh&&null!==this.last&&this.disconnect();const s=n;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const r=this.binding(e,t);return n=s,r}disconnect(){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=!0}}watch(e,t){const s=this.last,r=o(e),i=null===s?this.first:{};if(i.propertySource=e,i.propertyName=t,i.notifier=r,r.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=i}this.last=i}handleChange(){this.needsQueue&&(this.needsQueue=!1,s(this))}call(){null!==this.last&&(this.needsQueue=!0,this.notify(this))}records(){let e=this.first;return{next:()=>{const t=e;return void 0===t?{value:void 0,done:!0}:(e=e.next,{value:t,done:!1})},[Symbol.iterator]:function(){return this}}}}return Object.freeze({setArrayObserverFactory(e){r=e},getNotifier:o,track(e,t){void 0!==n&&n.watch(e,t)},trackVolatile(){void 0!==n&&(n.needsRefresh=!0)},notify(e,t){o(e).notify(t)},defineProperty(e,t){"string"==typeof t&&(t=new l(t)),a(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get:function(){return t.getValue(this)},set:function(e){t.setValue(this,e)}})},getAccessors:a,binding(e,t,s=this.isVolatileBinding(e)){return new c(e,t,s)},isVolatileBinding:t=>e.test(t.toString())})}));function y(e,t){p.defineProperty(e,t)}const v=n.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}}));class b{constructor(){this.index=0,this.length=0,this.parent=null,this.parentContext=null}get event(){return v.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}static setEvent(e){v.set(e)}}p.defineProperty(b.prototype,"index"),p.defineProperty(b.prototype,"length");const m=Object.seal(new b);class w{constructor(){this.targetIndex=0}}class C extends w{constructor(){super(...arguments),this.createPlaceholder=d.createInterpolationPlaceholder}}function _(e,t){this.source=e,this.context=t,null===this.bindingObserver&&(this.bindingObserver=p.binding(this.binding,this,this.isBindingVolatile)),this.updateTarget(this.bindingObserver.observe(e,t))}function S(e,t){this.source=e,this.context=t,this.target.addEventListener(this.targetName,this)}function O(){this.bindingObserver.disconnect(),this.source=null,this.context=null}function k(){this.bindingObserver.disconnect(),this.source=null,this.context=null;const e=this.target.$fastView;void 0!==e&&e.isComposed&&(e.unbind(),e.needsBindOnly=!0)}function T(){this.target.removeEventListener(this.targetName,this),this.source=null,this.context=null}function x(e){d.setAttribute(this.target,this.targetName,e)}function R(e){d.setBooleanAttribute(this.target,this.targetName,e)}function A(e){if(null==e&&(e=""),e.create){this.target.textContent="";let t=this.target.$fastView;void 0===t?t=e.create():this.target.$fastTemplate!==e&&(t.isComposed&&(t.remove(),t.unbind()),t=e.create()),t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(this.source,this.context)):(t.isComposed=!0,t.bind(this.source,this.context),t.insertBefore(this.target),this.target.$fastView=t,this.target.$fastTemplate=e)}else{const t=this.target.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),this.target.textContent=e}}function E(e){this.target[this.targetName]=e}function $(e){const t=this.classVersions||Object.create(null),s=this.target;let n=this.version||0;if(null!=e&&e.length){const r=e.split(/\s+/);for(let e=0,i=r.length;e<i;++e){const i=r[e];""!==i&&(t[i]=n,s.classList.add(i))}}if(this.classVersions=t,this.version=n+1,0!==n){n-=1;for(const e in t)t[e]===n&&s.classList.remove(e)}}class j extends C{constructor(e){super(),this.binding=e,this.bind=_,this.unbind=O,this.updateTarget=x,this.isBindingVolatile=p.isVolatileBinding(this.binding)}get targetName(){return this.originalTargetName}set targetName(e){if(this.originalTargetName=e,void 0!==e)switch(e[0]){case":":if(this.cleanedTargetName=e.substr(1),this.updateTarget=E,"innerHTML"===this.cleanedTargetName){const e=this.binding;this.binding=(t,s)=>d.createHTML(e(t,s))}break;case"?":this.cleanedTargetName=e.substr(1),this.updateTarget=R;break;case"@":this.cleanedTargetName=e.substr(1),this.bind=S,this.unbind=T;break;default:this.cleanedTargetName=e,"class"===e&&(this.updateTarget=$)}}targetAtContent(){this.updateTarget=A,this.unbind=k}createBehavior(e){return new P(e,this.binding,this.isBindingVolatile,this.bind,this.unbind,this.updateTarget,this.cleanedTargetName)}}class P{constructor(e,t,s,n,r,i,o){this.source=null,this.context=null,this.bindingObserver=null,this.target=e,this.binding=t,this.isBindingVolatile=s,this.bind=n,this.unbind=r,this.updateTarget=i,this.targetName=o}handleChange(){this.updateTarget(this.bindingObserver.observe(this.source,this.context))}handleEvent(e){b.setEvent(e);const t=this.binding(this.source,this.context);b.setEvent(null),!0!==t&&e.preventDefault()}}let F=null;class L{addFactory(e){e.targetIndex=this.targetIndex,this.behaviorFactories.push(e)}captureContentBinding(e){e.targetAtContent(),this.addFactory(e)}reset(){this.behaviorFactories=[],this.targetIndex=-1}release(){F=this}static borrow(e){const t=F||new L;return t.directives=e,t.reset(),F=null,t}}function M(e){if(1===e.length)return e[0];let t;const s=e.length,n=e.map((e=>"string"==typeof e?()=>e:(t=e.targetName||t,e.binding))),r=new j(((e,t)=>{let r="";for(let i=0;i<s;++i)r+=n[i](e,t);return r}));return r.targetName=t,r}const B=u.length;function N(e,t){const s=t.split(h);if(1===s.length)return null;const n=[];for(let t=0,r=s.length;t<r;++t){const r=s[t],i=r.indexOf(u);let o;if(-1===i)o=r;else{const t=parseInt(r.substring(0,i));n.push(e.directives[t]),o=r.substring(i+B)}""!==o&&n.push(o)}return n}function I(e,t,s=!1){const n=t.attributes;for(let r=0,i=n.length;r<i;++r){const o=n[r],a=o.value,l=N(e,a);let c=null;null===l?s&&(c=new j((()=>a)),c.targetName=o.name):c=M(l),null!==c&&(t.removeAttributeNode(o),r--,i--,e.addFactory(c))}}function D(e,t,s){const n=N(e,t.textContent);if(null!==n){let r=t;for(let i=0,o=n.length;i<o;++i){const o=n[i],a=0===i?t:r.parentNode.insertBefore(document.createTextNode(""),r.nextSibling);"string"==typeof o?a.textContent=o:(a.textContent=" ",e.captureContentBinding(o)),r=a,e.targetIndex++,a!==t&&s.nextNode()}e.targetIndex--}}const V=document.createRange();class z{constructor(e,t){this.fragment=e,this.behaviors=t,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=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let n,r=this.firstChild;for(;r!==t;)n=r.nextSibling,s.insertBefore(r,e),r=n;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,n=this.firstChild;for(;n!==t;)s=n.nextSibling,e.appendChild(n),n=s;e.appendChild(t)}dispose(){const e=this.firstChild.parentNode,t=this.lastChild;let s,n=this.firstChild;for(;n!==t;)s=n.nextSibling,e.removeChild(n),n=s;e.removeChild(t);const r=this.behaviors,i=this.source;for(let e=0,t=r.length;e<t;++e)r[e].unbind(i)}bind(e,t){const s=this.behaviors;if(this.source!==e)if(null!==this.source){const n=this.source;this.source=e,this.context=t;for(let r=0,i=s.length;r<i;++r){const i=s[r];i.unbind(n),i.bind(e,t)}}else{this.source=e,this.context=t;for(let n=0,r=s.length;n<r;++n)s[n].bind(e,t)}}unbind(){if(null===this.source)return;const e=this.behaviors,t=this.source;for(let s=0,n=e.length;s<n;++s)e[s].unbind(t);this.source=null}static disposeContiguousBatch(e){if(0!==e.length){V.setStartBefore(e[0].firstChild),V.setEndAfter(e[e.length-1].lastChild),V.deleteContents();for(let t=0,s=e.length;t<s;++t){const s=e[t],n=s.behaviors,r=s.source;for(let e=0,t=n.length;e<t;++e)n[e].unbind(r)}}}}class U{constructor(e,t){this.behaviorCount=0,this.hasHostBehaviors=!1,this.fragment=null,this.targetOffset=0,this.viewBehaviorFactories=null,this.hostBehaviorFactories=null,this.html=e,this.directives=t}create(e){if(null===this.fragment){let e;const t=this.html;if("string"==typeof t){e=document.createElement("template"),e.innerHTML=d.createHTML(t);const s=e.content.firstElementChild;null!==s&&"TEMPLATE"===s.tagName&&(e=s)}else e=t;const s=function(e,t){const s=e.content;document.adoptNode(s);const n=L.borrow(t);I(n,e,!0);const r=n.behaviorFactories;n.reset();const i=d.createTemplateWalker(s);let o;for(;o=i.nextNode();)switch(n.targetIndex++,o.nodeType){case 1:I(n,o);break;case 3:D(n,o,i);break;case 8:d.isMarker(o)&&n.addFactory(t[d.extractDirectiveIndexFromMarker(o)])}let a=0;(d.isMarker(s.firstChild)||1===s.childNodes.length&&t.length)&&(s.insertBefore(document.createComment(""),s.firstChild),a=-1);const l=n.behaviorFactories;return n.release(),{fragment:s,viewBehaviorFactories:l,hostBehaviorFactories:r,targetOffset:a}}(e,this.directives);this.fragment=s.fragment,this.viewBehaviorFactories=s.viewBehaviorFactories,this.hostBehaviorFactories=s.hostBehaviorFactories,this.targetOffset=s.targetOffset,this.behaviorCount=this.viewBehaviorFactories.length+this.hostBehaviorFactories.length,this.hasHostBehaviors=this.hostBehaviorFactories.length>0}const t=this.fragment.cloneNode(!0),s=this.viewBehaviorFactories,n=new Array(this.behaviorCount),r=d.createTemplateWalker(t);let i=0,o=this.targetOffset,a=r.nextNode();for(let e=s.length;i<e;++i){const e=s[i],t=e.targetIndex;for(;null!==a;){if(o===t){n[i]=e.createBehavior(a);break}a=r.nextNode(),o++}}if(this.hasHostBehaviors){const t=this.hostBehaviorFactories;for(let s=0,r=t.length;s<r;++s,++i)n[i]=t[s].createBehavior(e)}return new z(t,n)}render(e,t,s){"string"==typeof t&&(t=document.getElementById(t)),void 0===s&&(s=t);const n=this.create(s);return n.bind(e,m),n.appendTo(t),n}}class q{constructor(){this.targets=new WeakSet}addStylesTo(e){this.targets.add(e)}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}}function W(e){return e.map((e=>e instanceof q?W(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}function H(e){return e.map((e=>e instanceof q?e.behaviors:null)).reduce(((e,t)=>null===t?e:(null===e&&(e=[]),e.concat(t))),null)}q.create=(()=>{if(d.supportsAdoptedStyleSheets){const e=new Map;return t=>new Q(t,e)}return e=>new Y(e)})();class Q extends q{constructor(e,t){super(),this.styles=e,this.styleSheetCache=t,this._styleSheets=void 0,this.behaviors=H(e)}get styleSheets(){if(void 0===this._styleSheets){const e=this.styles,t=this.styleSheetCache;this._styleSheets=W(e).map((e=>{if(e instanceof CSSStyleSheet)return e;let s=t.get(e);return void 0===s&&(s=new CSSStyleSheet,s.replaceSync(e),t.set(e,s)),s}))}return this._styleSheets}addStylesTo(e){e.adoptedStyleSheets=[...e.adoptedStyleSheets,...this.styleSheets],super.addStylesTo(e)}removeStylesFrom(e){const t=this.styleSheets;e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e))),super.removeStylesFrom(e)}}let J=0;class Y extends q{constructor(e){super(),this.styles=e,this.behaviors=null,this.behaviors=H(e),this.styleSheets=W(e),this.styleClass="fast-style-class-"+ ++J}addStylesTo(e){const t=this.styleSheets,s=this.styleClass;e=this.normalizeTarget(e);for(let n=0;n<t.length;n++){const r=document.createElement("style");r.innerHTML=t[n],r.className=s,e.append(r)}super.addStylesTo(e)}removeStylesFrom(e){const t=(e=this.normalizeTarget(e)).querySelectorAll(`.${this.styleClass}`);for(let s=0,n=t.length;s<n;++s)e.removeChild(t[s]);super.removeStylesFrom(e)}isAttachedTo(e){return super.isAttachedTo(this.normalizeTarget(e))}normalizeTarget(e){return e===document?document.body:e}}const G=Object.freeze({locate:i()}),K={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};class X{constructor(e,t,s=t.toLowerCase(),n="reflect",r){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=n,this.converter=r,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,"boolean"===n&&void 0===r&&(this.converter=K)}setValue(e,t){const s=e[this.fieldName],n=this.converter;void 0!==n&&(t=n.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 p.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||d.queueUpdate((()=>{s.add(e);const n=e[this.fieldName];switch(t){case"reflect":const t=this.converter;d.setAttribute(e,this.attribute,void 0!==t?t.toView(n):n);break;case"boolean":d.setBooleanAttribute(e,this.attribute,n)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(G.locate(e));for(let n=0,r=t.length;n<r;++n){const r=t[n];if(void 0!==r)for(let t=0,n=r.length;t<n;++t){const n=r[t];"string"==typeof n?s.push(new X(e,n)):s.push(new X(e,n.property,n.attribute,n.mode,n.converter))}}return s}}const Z={mode:"open"},ee={},te=n.getById(4,(()=>{const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t)})}));class se{constructor(e,t=e.definition){"string"==typeof t&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template;const s=X.collect(e,t.attributes),n=new Array(s.length),r={},i={};for(let e=0,t=s.length;e<t;++e){const t=s[e];n[e]=t.attribute,r[t.name]=t,i[t.attribute]=t}this.attributes=s,this.observedAttributes=n,this.propertyLookup=r,this.attributeLookup=i,this.shadowOptions=void 0===t.shadowOptions?Z:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Z),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?ee:Object.assign(Object.assign({},ee),t.elementOptions),this.styles=void 0===t.styles?void 0:Array.isArray(t.styles)?q.create(t.styles):t.styles instanceof q?t.styles:q.create([t.styles])}get isDefined(){return!!te.getByType(this.type)}define(e=customElements){const t=this.type;if(te.register(this)){const e=this.attributes,s=t.prototype;for(let t=0,n=e.length;t<n;++t)p.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}}se.forType=te.getByType;const ne=new WeakMap,re={bubbles:!0,composed:!0,cancelable:!0};function ie(e){return e.shadowRoot||ne.get(e)||null}class oe extends g{constructor(e,t){super(e),this.boundObservables=null,this.behaviors=null,this.needsInitialization=!0,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){const t=e.attachShadow(s);"closed"===s.mode&&ne.set(e,t)}const n=p.getAccessors(e);if(n.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,r=n.length;s<r;++s){const r=n[s].name,i=e[r];void 0!==i&&(delete e[r],t[r]=i)}}}get isConnected(){return p.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,p.notify(this,"isConnected")}get template(){return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get styles(){return this._styles}set styles(e){this._styles!==e&&(null!==this._styles&&this.removeStyles(this._styles),this._styles=e,this.needsInitialization||null===e||this.addStyles(e))}addStyles(e){const t=ie(this.element)||this.element.getRootNode();if(e instanceof HTMLStyleElement)t.append(e);else if(!e.isAttachedTo(t)){const s=e.behaviors;e.addStylesTo(t),null!==s&&this.addBehaviors(s)}}removeStyles(e){const t=ie(this.element)||this.element.getRootNode();if(e instanceof HTMLStyleElement)t.removeChild(e);else if(e.isAttachedTo(t)){const s=e.behaviors;e.removeStylesFrom(t),null!==s&&this.removeBehaviors(s)}}addBehaviors(e){const t=this.behaviors||(this.behaviors=new Map),s=e.length,n=[];for(let r=0;r<s;++r){const s=e[r];t.has(s)?t.set(s,t.get(s)+1):(t.set(s,1),n.push(s))}if(this._isConnected){const e=this.element;for(let t=0;t<n.length;++t)n[t].bind(e,m)}}removeBehaviors(e,t=!1){const s=this.behaviors;if(null===s)return;const n=e.length,r=[];for(let i=0;i<n;++i){const n=e[i];if(s.has(n)){const e=s.get(n)-1;0===e||t?s.delete(n)&&r.push(n):s.set(n,e)}}if(this._isConnected){const e=this.element;for(let t=0;t<r.length;++t)r[t].unbind(e)}}onConnectedCallback(){if(this._isConnected)return;const e=this.element;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(e,m);const t=this.behaviors;if(null!==t)for(const[s]of t)s.bind(e,m);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;for(const[s]of t)s.unbind(e)}}onAttributeChangedCallback(e,t,s){const n=this.definition.attributeLookup[e];void 0!==n&&n.onAttributeChangedCallback(this.element,s)}emit(e,t,s){return!!this._isConnected&&this.element.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},re),s)))}finishInitialization(){const e=this.element,t=this.boundObservables;if(null!==t){const s=Object.keys(t);for(let n=0,r=s.length;n<r;++n){const r=s[n];e[r]=t[r]}this.boundObservables=null}const s=this.definition;null===this._template&&(this.element.resolveTemplate?this._template=this.element.resolveTemplate():s.template&&(this._template=s.template||null)),null!==this._template&&this.renderTemplate(this._template),null===this._styles&&(this.element.resolveStyles?this._styles=this.element.resolveStyles():s.styles&&(this._styles=s.styles||null)),null!==this._styles&&this.addStyles(this._styles),this.needsInitialization=!1}renderTemplate(e){const t=this.element,s=ie(t)||t;null!==this.view?(this.view.dispose(),this.view=null):this.needsInitialization||d.removeChildNodes(s),e&&(this.view=e.render(t,s,t))}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=se.forType(e.constructor);if(void 0===s)throw new Error("Missing FASTElement definition.");return e.$fastController=new oe(e,s)}}function ae(e){return class extends e{constructor(){super(),oe.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 le=Object.assign(ae(HTMLElement),{from:e=>ae(e),define:(e,t)=>new se(e,t).define().type});class ce{createCSS(){return""}createBehavior(){}}
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */function he(e,t,s,n){var r,i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(i<3?r(o):i>3?r(t,s,o):r(t,s))||o);return i>3&&o&&Object.defineProperty(t,s,o),o}const ue=new Map;"metadata"in Reflect||(Reflect.metadata=function(e,t){return function(s){Reflect.defineMetadata(e,t,s)}},Reflect.defineMetadata=function(e,t,s){let n=ue.get(s);void 0===n&&ue.set(s,n=new Map),n.set(e,t)},Reflect.getOwnMetadata=function(e,t){const s=ue.get(t);if(void 0!==s)return s.get(e)});class de{constructor(e,t){this.container=e,this.key=t}instance(e){return this.registerResolver(0,e)}singleton(e){return this.registerResolver(1,e)}transient(e){return this.registerResolver(2,e)}callback(e){return this.registerResolver(3,e)}cachedCallback(e){return this.registerResolver(3,Fe(e))}aliasTo(e){return this.registerResolver(5,e)}registerResolver(e,t){const{container:s,key:n}=this;return this.container=this.key=void 0,s.registerResolver(n,new _e(n,e,t))}}function fe(e){const t=e.slice(),s=Object.keys(e),n=s.length;let r;for(let i=0;i<n;++i)r=s[i],ze(r)||(t[r]=e[r]);return t}const ge=Object.freeze({none(e){throw Error(`${e.toString()} not registered, did you forget to add @singleton()?`)},singleton:e=>new _e(e,1,e),transient:e=>new _e(e,2,e)}),pe=Object.freeze({default:Object.freeze({parentLocator:()=>null,responsibleForOwnerRequests:!1,defaultResolver:ge.singleton})}),ye=new Map;function ve(e){return t=>Reflect.getOwnMetadata(e,t)}let be=null;const me=Object.freeze({createContainer:e=>new je(null,Object.assign({},pe.default,e)),findResponsibleContainer(e){const t=e.$$container$$;return t&&t.responsibleForOwnerRequests?t:me.findParentContainer(e)},findParentContainer(e){const t=new CustomEvent(Ee,{bubbles:!0,composed:!0,cancelable:!0,detail:{container:void 0}});return e.dispatchEvent(t),t.detail.container||me.getOrCreateDOMContainer()},getOrCreateDOMContainer:(e,t)=>e?e.$$container$$||new je(e,Object.assign({},pe.default,t,{parentLocator:me.findParentContainer})):be||(be=new je(null,Object.assign({},pe.default,t,{parentLocator:()=>null}))),getDesignParamtypes:ve("design:paramtypes"),getAnnotationParamtypes:ve("di:paramtypes"),getOrCreateAnnotationParamTypes(e){let t=this.getAnnotationParamtypes(e);return void 0===t&&Reflect.defineMetadata("di:paramtypes",t=[],e),t},getDependencies(e){let t=ye.get(e);if(void 0===t){const s=e.inject;if(void 0===s){const s=me.getDesignParamtypes(e),n=me.getAnnotationParamtypes(e);if(void 0===s)if(void 0===n){const s=Object.getPrototypeOf(e);t="function"==typeof s&&s!==Function.prototype?fe(me.getDependencies(s)):[]}else t=fe(n);else if(void 0===n)t=fe(s);else{t=fe(s);let e,r=n.length;for(let s=0;s<r;++s)e=n[s],void 0!==e&&(t[s]=e);const i=Object.keys(n);let o;r=i.length;for(let e=0;e<r;++e)o=i[e],ze(o)||(t[o]=n[o])}}else t=fe(s);ye.set(e,t)}return t},defineProperty(e,t,s,n=!1){const r=`$di_${t}`;Reflect.defineProperty(e,t,{get:function(){let e=this[r];if(void 0===e){const i=this instanceof HTMLElement?me.findResponsibleContainer(this):me.getOrCreateDOMContainer();if(e=i.get(s),this[r]=e,n&&this instanceof le){const n=this.$fastController,i=()=>{me.findResponsibleContainer(this).get(s)!==this[r]&&(this[r]=e,n.notify(t))};n.subscribe({handleChange:i},"isConnected")}}return e}})},createInterface(e,t){const s="function"==typeof e?e:t,n="string"==typeof e?e:e&&"friendlyName"in e&&e.friendlyName||Ne,r="string"!=typeof e&&(e&&"respectConnection"in e&&e.respectConnection||!1),i=function(e,t,s){if(null==e||void 0!==new.target)throw new Error(`No registration for interface: '${i.friendlyName}'`);if(t)me.defineProperty(e,t,i,r);else{me.getOrCreateAnnotationParamTypes(e)[s]=i}};return i.$isInterface=!0,i.friendlyName=null==n?"(anonymous)":n,null!=s&&(i.register=function(e,t){return s(new de(e,null!=t?t:i))}),i.toString=function(){return`InterfaceSymbol<${i.friendlyName}>`},i},inject:(...e)=>function(t,s,n){if("number"==typeof n){const s=me.getOrCreateAnnotationParamTypes(t),r=e[0];void 0!==r&&(s[n]=r)}else if(s)me.defineProperty(t,s,e[0]);else{const s=n?me.getOrCreateAnnotationParamTypes(n.value):me.getOrCreateAnnotationParamTypes(t);let r;for(let t=0;t<e.length;++t)r=e[t],void 0!==r&&(s[t]=r)}},transient:e=>(e.register=function(t){return Le.transient(e,e).register(t)},e.registerInRequestor=!1,e),singleton:(e,t=Ce)=>(e.register=function(t){return Le.singleton(e,e).register(t)},e.registerInRequestor=t.scoped,e)}),we=me.createInterface("Container");me.inject;const Ce={scoped:!1};class _e{constructor(e,t,s){this.key=e,this.strategy=t,this.state=s,this.resolving=!1}get $isResolver(){return!0}register(e){return e.registerResolver(this.key,this)}resolve(e,t){switch(this.strategy){case 0:return this.state;case 1:if(this.resolving)throw new Error(`Cyclic dependency found: ${this.state.name}`);return this.resolving=!0,this.state=e.getFactory(this.state).construct(t),this.strategy=0,this.resolving=!1,this.state;case 2:{const s=e.getFactory(this.state);if(null===s)throw new Error(`Resolver for ${String(this.key)} returned a null factory`);return s.construct(t)}case 3:return this.state(e,t,this);case 4:return this.state[0].resolve(e,t);case 5:return t.get(this.state);default:throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`)}}getFactory(e){var t,s,n;switch(this.strategy){case 1:case 2:return e.getFactory(this.state);case 5:return null!==(n=null===(s=null===(t=e.getResolver(this.state))||void 0===t?void 0:t.getFactory)||void 0===s?void 0:s.call(t,e))&&void 0!==n?n:null;default:return null}}}function Se(e){return this.get(e)}function Oe(e,t){return t(e)}class ke{constructor(e,t){this.Type=e,this.dependencies=t,this.transformers=null}construct(e,t){let s;return s=void 0===t?new this.Type(...this.dependencies.map(Se,e)):new this.Type(...this.dependencies.map(Se,e),...t),null==this.transformers?s:this.transformers.reduce(Oe,s)}registerTransformer(e){(this.transformers||(this.transformers=[])).push(e)}}const Te={$isResolver:!0,resolve:(e,t)=>t};function xe(e){return"function"==typeof e.register}function Re(e){return function(e){return xe(e)&&"boolean"==typeof e.registerInRequestor}(e)&&e.registerInRequestor}const Ae=new Set(["Array","ArrayBuffer","Boolean","DataView","Date","Error","EvalError","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Number","Object","Promise","RangeError","ReferenceError","RegExp","Set","SharedArrayBuffer","String","SyntaxError","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakMap","WeakSet"]),Ee="__DI_LOCATE_PARENT__",$e=new Map;class je{constructor(e,t){this.owner=e,this.config=t,this._parent=void 0,this.registerDepth=0,this.context=null,null!==e&&(e.$$container$$=this),this.resolvers=new Map,this.resolvers.set(we,Te),e instanceof Node&&e.addEventListener(Ee,(e=>{e.composedPath()[0]!==this.owner&&(e.detail.container=this,e.stopImmediatePropagation())}))}get parent(){return void 0===this._parent&&(this._parent=this.config.parentLocator(this.owner)),this._parent}get depth(){return null===this.parent?0:this.parent.depth+1}get responsibleForOwnerRequests(){return this.config.responsibleForOwnerRequests}registerWithContext(e,...t){return this.context=e,this.register(...t),this.context=null,this}register(...e){if(100==++this.registerDepth)throw new Error("Unable to autoregister dependency");let t,s,n,r,i;const o=this.context;for(let a=0,l=e.length;a<l;++a)if(t=e[a],Ie(t))if(xe(t))t.register(this,o);else if(void 0!==t.prototype)Le.singleton(t,t).register(this);else for(s=Object.keys(t),r=0,i=s.length;r<i;++r)n=t[s[r]],Ie(n)&&(xe(n)?n.register(this,o):this.register(n));return--this.registerDepth,this}registerResolver(e,t){Me(e);const s=this.resolvers,n=s.get(e);return null==n?s.set(e,t):n instanceof _e&&4===n.strategy?n.state.push(t):s.set(e,new _e(e,4,[n,t])),t}registerTransformer(e,t){const s=this.getResolver(e);if(null==s)return!1;if(s.getFactory){const e=s.getFactory(this);return null!=e&&(e.registerTransformer(t),!0)}return!1}getResolver(e,t=!0){if(Me(e),void 0!==e.resolve)return e;let s,n=this;for(;null!=n;){if(s=n.resolvers.get(e),null!=s)return s;if(null==n.parent){const s=Re(e)?this:n;return t?this.jitRegister(e,s):null}n=n.parent}return null}has(e,t=!1){return!!this.resolvers.has(e)||!(!t||null==this.parent)&&this.parent.has(e,!0)}get(e){if(Me(e),e.$isResolver)return e.resolve(this,this);let t,s=this;for(;null!=s;){if(t=s.resolvers.get(e),null!=t)return t.resolve(s,this);if(null==s.parent){const n=Re(e)?this:s;return t=this.jitRegister(e,n),t.resolve(s,this)}s=s.parent}throw new Error(`Unable to resolve key: ${e}`)}getAll(e,t=!1){Me(e);const s=this;let n,i=s;if(t){let t=r;for(;null!=i;)n=i.resolvers.get(e),null!=n&&(t=t.concat(Be(n,i,s))),i=i.parent;return t}for(;null!=i;){if(n=i.resolvers.get(e),null!=n)return Be(n,i,s);if(i=i.parent,null==i)return r}return r}getFactory(e){let t=$e.get(e);if(void 0===t){if(De(e))throw new Error(`${e.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`);$e.set(e,t=new ke(e,me.getDependencies(e)))}return t}registerFactory(e,t){$e.set(e,t)}createChild(e){return new je(null,Object.assign({},this.config,e,{parentLocator:()=>this}))}jitRegister(e,t){if("function"!=typeof e)throw new Error(`Attempted to jitRegister something that is not a constructor: '${e}'. Did you forget to register this dependency?`);if(Ae.has(e.name))throw new Error(`Attempted to jitRegister an intrinsic type: ${e.name}. Did you forget to add @inject(Key)`);if(xe(e)){const s=e.register(t);if(!(s instanceof Object)||null==s.resolve){const s=t.resolvers.get(e);if(null!=s)return s;throw new Error("A valid resolver was not returned from the static register method")}return s}if(e.$isInterface)throw new Error(`Attempted to jitRegister an interface: ${e.friendlyName}`);{const s=this.config.defaultResolver(e,t);return t.resolvers.set(e,s),s}}}const Pe=new WeakMap;function Fe(e){return function(t,s,n){if(Pe.has(n))return Pe.get(n);const r=e(t,s,n);return Pe.set(n,r),r}}const Le=Object.freeze({instance:(e,t)=>new _e(e,0,t),singleton:(e,t)=>new _e(e,1,t),transient:(e,t)=>new _e(e,2,t),callback:(e,t)=>new _e(e,3,t),cachedCallback:(e,t)=>new _e(e,3,Fe(t)),aliasTo:(e,t)=>new _e(t,5,e)});function Me(e){if(null==e)throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?")}function Be(e,t,s){if(e instanceof _e&&4===e.strategy){const n=e.state;let r=n.length;const i=new Array(r);for(;r--;)i[r]=n[r].resolve(t,s);return i}return[e.resolve(t,s)]}const Ne="(anonymous)";function Ie(e){return"object"==typeof e&&null!==e||"function"==typeof e}const De=function(){const e=new WeakMap;let t=!1,s="",n=0;return function(r){return t=e.get(r),void 0===t&&(s=r.toString(),n=s.length,t=n>=29&&n<=100&&125===s.charCodeAt(n-1)&&s.charCodeAt(n-2)<=32&&93===s.charCodeAt(n-3)&&101===s.charCodeAt(n-4)&&100===s.charCodeAt(n-5)&&111===s.charCodeAt(n-6)&&99===s.charCodeAt(n-7)&&32===s.charCodeAt(n-8)&&101===s.charCodeAt(n-9)&&118===s.charCodeAt(n-10)&&105===s.charCodeAt(n-11)&&116===s.charCodeAt(n-12)&&97===s.charCodeAt(n-13)&&110===s.charCodeAt(n-14)&&88===s.charCodeAt(n-15),e.set(r,t)),t}}(),Ve={};function ze(e){switch(typeof e){case"number":return e>=0&&(0|e)===e;case"string":{const t=Ve[e];if(void 0!==t)return t;const s=e.length;if(0===s)return Ve[e]=!1;let n=0;for(let t=0;t<s;++t)if(n=e.charCodeAt(t),0===t&&48===n&&s>1||n<48||n>57)return Ve[e]=!1;return Ve[e]=!0}default:return!1}}function Ue(e){return`${e.toLowerCase()}:presentation`}const qe=new Map,We=Object.freeze({define(e,t,s){const n=Ue(e);void 0===qe.get(n)?qe.set(n,t):qe.set(n,!1),s.register(Le.instance(n,t))},forTag(e,t){const s=Ue(e),n=qe.get(s);if(!1===n){return me.findResponsibleContainer(t).get(s)}return n||null}});class He{constructor(e,t){this.template=e||null,this.styles=void 0===t?null:Array.isArray(t)?q.create(t):t instanceof q?t:q.create([t])}applyTo(e){const t=e.$fastController;null===t.template&&(t.template=this.template),null===t.styles&&(t.styles=this.styles)}}class Qe extends le{constructor(){super(...arguments),this._presentation=void 0}get $presentation(){return void 0===this._presentation&&(this._presentation=We.forTag(this.tagName,this)),this._presentation}templateChanged(){void 0!==this.template&&(this.$fastController.template=this.template)}stylesChanged(){void 0!==this.styles&&(this.$fastController.styles=this.styles)}connectedCallback(){null!==this.$presentation&&this.$presentation.applyTo(this),super.connectedCallback()}static compose(e){return(t={})=>new Ye(this===Qe?class extends Qe{}:this,e,t)}}function Je(e,t,s){return"function"==typeof e?e(t,s):e}he([y],Qe.prototype,"template",void 0),he([y],Qe.prototype,"styles",void 0);class Ye{constructor(e,t,s){this.type=e,this.elementDefinition=t,this.overrideDefinition=s,this.definition=Object.assign(Object.assign({},this.elementDefinition),this.overrideDefinition)}register(e,t){const s=this.definition,n=this.overrideDefinition,r=`${s.prefix||t.elementPrefix}-${s.baseName}`;t.tryDefineElement({name:r,type:this.type,baseClass:this.elementDefinition.baseClass,callback:e=>{const t=new He(Je(s.template,e,s),Je(s.styles,e,s));e.definePresentation(t);let r=Je(s.shadowOptions,e,s);e.shadowRootMode&&(r?n.shadowOptions||(r.mode=e.shadowRootMode):null!==r&&(r={mode:e.shadowRootMode})),e.defineElement({elementOptions:Je(s.elementOptions,e,s),shadowOptions:r,attributes:Je(s.attributes,e,s)})}})}}function Ge(e){const t=e.parentElement;if(t)return t;{const t=e.getRootNode();if(t.host instanceof HTMLElement)return t.host}return null}const Ke=document.createElement("div");class Xe{setProperty(e,t){d.queueUpdate((()=>this.target.setProperty(e,t)))}removeProperty(e){d.queueUpdate((()=>this.target.removeProperty(e)))}}class Ze extends Xe{constructor(){super();const e=new CSSStyleSheet;this.target=e.cssRules[e.insertRule(":root{}")].style,document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}}class et extends Xe{constructor(){super(),this.style=document.createElement("style"),document.head.appendChild(this.style);const{sheet:e}=this.style;if(e){const t=e.insertRule(":root{}",e.cssRules.length);this.target=e.cssRules[t].style}}}class tt{constructor(e){this.store=new Map,this.target=null;const t=e.$fastController;this.style=document.createElement("style"),t.addStyles(this.style),p.getNotifier(t).subscribe(this,"isConnected"),this.handleChange(t,"isConnected")}targetChanged(){if(null!==this.target)for(const[e,t]of this.store.entries())this.target.setProperty(e,t)}setProperty(e,t){this.store.set(e,t),d.queueUpdate((()=>{null!==this.target&&this.target.setProperty(e,t)}))}removeProperty(e){this.store.delete(e),d.queueUpdate((()=>{null!==this.target&&this.target.removeProperty(e)}))}handleChange(e,t){const{sheet:s}=this.style;if(s){const e=s.insertRule(":host{}",s.cssRules.length);this.target=s.cssRules[e].style}else this.target=null}}he([y],tt.prototype,"target",void 0);class st{constructor(e){this.target=e.style}setProperty(e,t){d.queueUpdate((()=>this.target.setProperty(e,t)))}removeProperty(e){d.queueUpdate((()=>this.target.removeProperty(e)))}}class nt{setProperty(e,t){nt.properties[e]=t;for(const s of nt.roots.values())ot.getOrCreate(nt.normalizeRoot(s)).setProperty(e,t)}removeProperty(e){delete nt.properties[e];for(const t of nt.roots.values())ot.getOrCreate(nt.normalizeRoot(t)).removeProperty(e)}static registerRoot(e){const{roots:t}=nt;if(!t.has(e)){t.add(e);const s=ot.getOrCreate(this.normalizeRoot(e));for(const e in nt.properties)s.setProperty(e,nt.properties[e])}}static unregisterRoot(e){const{roots:t}=nt;if(t.has(e)){t.delete(e);const s=ot.getOrCreate(nt.normalizeRoot(e));for(const e in nt.properties)s.removeProperty(e)}}static normalizeRoot(e){return e===Ke?document:e}}nt.roots=new Set,nt.properties={};const rt=new WeakMap,it=d.supportsAdoptedStyleSheets?class extends Xe{constructor(e){super();const t=new CSSStyleSheet;this.target=t.cssRules[t.insertRule(":host{}")].style,e.$fastController.addStyles(q.create([t]))}}:tt,ot=Object.freeze({getOrCreate(e){if(rt.has(e))return rt.get(e);let t;return e===Ke?t=new nt:e instanceof Document?t=d.supportsAdoptedStyleSheets?new Ze:new et:t=e instanceof le?new it(e):new st(e),rt.set(e,t),t}});class at extends ce{constructor(e){super(),this.subscribers=new WeakMap,this._appliedTo=new Set,this.name=e.name,null!==e.cssCustomPropertyName&&(this.cssCustomProperty=`--${e.cssCustomPropertyName}`,this.cssVar=`var(${this.cssCustomProperty})`),this.id=at.uniqueId(),at.tokensById.set(this.id,this)}get appliedTo(){return[...this._appliedTo]}static from(e){return new at({name:"string"==typeof e?e:e.name,cssCustomPropertyName:"string"==typeof e?e:void 0===e.cssCustomPropertyName?e.name:e.cssCustomPropertyName})}static isCSSDesignToken(e){return"string"==typeof e.cssCustomProperty}static isDerivedDesignTokenValue(e){return"function"==typeof e}static getTokenById(e){return at.tokensById.get(e)}getOrCreateSubscriberSet(e=this){return this.subscribers.get(e)||this.subscribers.set(e,new Set)&&this.subscribers.get(e)}createCSS(){return this.cssVar||""}getValueFor(e){const t=dt.getOrCreate(e).get(this);if(void 0!==t)return t;throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${e} or an ancestor of ${e}.`)}setValueFor(e,t){return this._appliedTo.add(e),t instanceof at&&(t=this.alias(t)),dt.getOrCreate(e).set(this,t),this}deleteValueFor(e){return this._appliedTo.delete(e),dt.existsFor(e)&&dt.getOrCreate(e).delete(this),this}withDefault(e){return this.setValueFor(Ke,e),this}subscribe(e,t){const s=this.getOrCreateSubscriberSet(t);t&&!dt.existsFor(t)&&dt.getOrCreate(t),s.has(e)||s.add(e)}unsubscribe(e,t){const s=this.subscribers.get(t||this);s&&s.has(e)&&s.delete(e)}notify(e){const t=Object.freeze({token:this,target:e});this.subscribers.has(this)&&this.subscribers.get(this).forEach((e=>e.handleChange(t))),this.subscribers.has(e)&&this.subscribers.get(e).forEach((e=>e.handleChange(t)))}alias(e){return t=>e.getValueFor(t)}}at.uniqueId=(()=>{let e=0;return()=>(e++,e.toString(16))})(),at.tokensById=new Map;class lt{constructor(e,t,s){this.source=e,this.token=t,this.node=s,this.dependencies=new Set,this.observer=p.binding(e,this,!1),this.observer.handleChange=this.observer.call,this.handleChange()}disconnect(){this.observer.disconnect()}handleChange(){this.node.store.set(this.token,this.observer.observe(this.node.target,m))}}class ct{constructor(){this.values=new Map}set(e,t){this.values.get(e)!==t&&(this.values.set(e,t),p.getNotifier(this).notify(e.id))}get(e){return p.track(this,e.id),this.values.get(e)}delete(e){this.values.delete(e)}all(){return this.values.entries()}}const ht=new WeakMap,ut=new WeakMap;class dt{constructor(e){this.target=e,this.store=new ct,this.children=[],this.assignedValues=new Map,this.reflecting=new Set,this.bindingObservers=new Map,this.tokenValueChangeHandler={handleChange:(e,t)=>{const s=at.getTokenById(t);if(s&&(s.notify(this.target),at.isCSSDesignToken(s))){const t=this.parent,n=this.isReflecting(s);if(t){const r=t.get(s),i=e.get(s);r===i||n?r===i&&n&&this.stopReflectToCSS(s):this.reflectToCSS(s)}else n||this.reflectToCSS(s)}}},ht.set(e,this),p.getNotifier(this.store).subscribe(this.tokenValueChangeHandler),e instanceof le?e.$fastController.addBehaviors([this]):e.isConnected&&this.bind()}static getOrCreate(e){return ht.get(e)||new dt(e)}static existsFor(e){return ht.has(e)}static findParent(e){if(Ke!==e.target){let t=Ge(e.target);for(;null!==t;){if(ht.has(t))return ht.get(t);t=Ge(t)}return dt.getOrCreate(Ke)}return null}static findClosestAssignedNode(e,t){let s=t;do{if(s.has(e))return s;s=s.parent?s.parent:s.target!==Ke?dt.getOrCreate(Ke):null}while(null!==s);return null}get parent(){return ut.get(this)||null}has(e){return this.assignedValues.has(e)}get(e){const t=this.store.get(e);if(void 0!==t)return t;const s=this.getRaw(e);return void 0!==s?(this.hydrate(e,s),this.get(e)):void 0}getRaw(e){var t;return this.assignedValues.has(e)?this.assignedValues.get(e):null===(t=dt.findClosestAssignedNode(e,this))||void 0===t?void 0:t.getRaw(e)}set(e,t){at.isDerivedDesignTokenValue(this.assignedValues.get(e))&&this.tearDownBindingObserver(e),this.assignedValues.set(e,t),at.isDerivedDesignTokenValue(t)?this.setupBindingObserver(e,t):this.store.set(e,t)}delete(e){this.assignedValues.delete(e),this.tearDownBindingObserver(e);const t=this.getRaw(e);t?this.hydrate(e,t):this.store.delete(e)}bind(){const e=dt.findParent(this);e&&e.appendChild(this);for(const e of this.assignedValues.keys())e.notify(this.target)}unbind(){if(this.parent){ut.get(this).removeChild(this)}}appendChild(e){e.parent&&ut.get(e).removeChild(e);const t=this.children.filter((t=>e.contains(t)));ut.set(e,this),this.children.push(e),t.forEach((t=>e.appendChild(t))),p.getNotifier(this.store).subscribe(e);for(const[t,s]of this.store.all())e.hydrate(t,this.bindingObservers.has(t)?this.getRaw(t):s)}removeChild(e){const t=this.children.indexOf(e);return-1!==t&&this.children.splice(t,1),p.getNotifier(this.store).unsubscribe(e),e.parent===this&&ut.delete(e)}contains(e){return function(e,t){let s=t;for(;null!==s;){if(s===e)return!0;s=Ge(s)}return!1}(this.target,e.target)}reflectToCSS(e){this.isReflecting(e)||(this.reflecting.add(e),dt.cssCustomPropertyReflector.startReflection(e,this.target))}stopReflectToCSS(e){this.isReflecting(e)&&(this.reflecting.delete(e),dt.cssCustomPropertyReflector.stopReflection(e,this.target))}isReflecting(e){return this.reflecting.has(e)}handleChange(e,t){const s=at.getTokenById(t);s&&this.hydrate(s,this.getRaw(s))}hydrate(e,t){if(!this.has(e)){const s=this.bindingObservers.get(e);at.isDerivedDesignTokenValue(t)?s?s.source!==t&&(this.tearDownBindingObserver(e),this.setupBindingObserver(e,t)):this.setupBindingObserver(e,t):(s&&this.tearDownBindingObserver(e),this.store.set(e,t))}}setupBindingObserver(e,t){const s=new lt(t,e,this);return this.bindingObservers.set(e,s),s}tearDownBindingObserver(e){return!!this.bindingObservers.has(e)&&(this.bindingObservers.get(e).disconnect(),this.bindingObservers.delete(e),!0)}}dt.cssCustomPropertyReflector=new class{startReflection(e,t){e.subscribe(this,t),this.handleChange({token:e,target:t})}stopReflection(e,t){e.unsubscribe(this,t),this.remove(e,t)}handleChange(e){const{token:t,target:s}=e;this.add(t,s)}add(e,t){ot.getOrCreate(t).setProperty(e.cssCustomProperty,this.resolveCSSValue(dt.getOrCreate(t).get(e)))}remove(e,t){ot.getOrCreate(t).removeProperty(e.cssCustomProperty)}resolveCSSValue(e){return e&&"function"==typeof e.createCSS?e.createCSS():e}},he([y],dt.prototype,"children",void 0);const ft=Object.freeze({create:function(e){return at.from(e)},notifyConnection:e=>!(!e.isConnected||!dt.existsFor(e))&&(dt.getOrCreate(e).bind(),!0),notifyDisconnection:e=>!(e.isConnected||!dt.existsFor(e))&&(dt.getOrCreate(e).unbind(),!0),registerRoot(e=Ke){nt.registerRoot(e)},unregisterRoot(e=Ke){nt.unregisterRoot(e)}}),gt=Object.freeze({definitionCallbackOnly:null,ignoreDuplicate:Symbol()}),pt=new Map,yt=new Map;let vt=null;const bt=me.createInterface((e=>e.cachedCallback((e=>(null===vt&&(vt=new wt(null,e)),vt))))),mt=Object.freeze({tagFor:e=>yt.get(e),responsibleFor(e){const t=e.$$designSystem$$;if(t)return t;return me.findResponsibleContainer(e).get(bt)},getOrCreate(e){if(!e)return null===vt&&(vt=me.getOrCreateDOMContainer().get(bt)),vt;const t=e.$$designSystem$$;if(t)return t;const s=me.getOrCreateDOMContainer(e);if(s.has(bt,!1))return s.get(bt);{const t=new wt(e,s);return s.register(Le.instance(bt,t)),t}}});class wt{constructor(e,t){this.owner=e,this.container=t,this.designTokensInitialized=!1,this.prefix="fast",this.shadowRootMode=void 0,this.disambiguate=()=>gt.definitionCallbackOnly,null!==e&&(e.$$designSystem$$=this)}withPrefix(e){return this.prefix=e,this}withShadowRootMode(e){return this.shadowRootMode=e,this}withElementDisambiguation(e){return this.disambiguate=e,this}withDesignTokenRoot(e){return this.designTokenRoot=e,this}register(...e){const t=this.container,s=[],n=this.disambiguate,r=this.shadowRootMode,i={elementPrefix:this.prefix,tryDefineElement(e,i,o){const a=function(e,t,s){return"string"==typeof e?{name:e,type:t,callback:s}:e}(e,i,o),{name:l,callback:c,baseClass:h}=a;let{type:u}=a,d=l,f=pt.get(d),g=!0;for(;f;){const e=n(d,u,f);switch(e){case gt.ignoreDuplicate:return;case gt.definitionCallbackOnly:g=!1,f=void 0;break;default:d=e,f=pt.get(d)}}g&&((yt.has(u)||u===Qe)&&(u=class extends u{}),pt.set(d,u),yt.set(u,d),h&&yt.set(h,d)),s.push(new Ct(t,d,u,r,c,g))}};this.designTokensInitialized||(this.designTokensInitialized=!0,null!==this.designTokenRoot&&ft.registerRoot(this.designTokenRoot)),t.registerWithContext(i,...e);for(const e of s)e.callback(e),e.willDefine&&null!==e.definition&&e.definition.define();return this}}class Ct{constructor(e,t,s,n,r,i){this.container=e,this.name=t,this.type=s,this.shadowRootMode=n,this.callback=r,this.willDefine=i,this.definition=null}definePresentation(e){We.define(this.name,e,this.container)}defineElement(e){this.definition=new se(this.type,Object.assign(Object.assign({},e),{name:this.name}))}tagFor(e){return mt.tagFor(e)}}function _t(e,t,s,n){return new(s||(s=Promise))((function(r,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))}function St(e,t={}){return _t(this,void 0,void 0,(function*(){const s=t.document||globalThis.document,n=t.parent||s.createElement("div"),r=t.source||{},i=t.context||m;if("string"==typeof e){e=new U(`<${e}></${e}>`,[])}else"function"==typeof e.register&&(e=[e]);if(Array.isArray(e)){const s=e[0],r=t.designSystem||mt.getOrCreate(n);let i="";r.register(e,{register(e,t){i=t.elementPrefix}});const o=`${i}-${s.definition.baseName}`;e=new U(`<${o}></${o}>`,[])}const o=e.create(),a=function(e){let t=e.firstChild;for(;null!==t&&1!==t.nodeType;)t=t.nextSibling;return t}(o);let l=!1;o.bind(r,i),o.appendTo(n),customElements.upgrade(n),yield Promise.resolve();return{document:s,template:e,view:o,parent:n,element:a,connect:()=>_t(this,void 0,void 0,(function*(){l||(l=!0,s.body.appendChild(n),yield Promise.resolve())})),disconnect:()=>_t(this,void 0,void 0,(function*(){l&&(l=!1,s.body.removeChild(n),yield Promise.resolve())}))}}))}let Ot,kt,Tt,xt,Rt=!0;"undefined"!=typeof process&&(({FORCE_COLOR:Ot,NODE_DISABLE_COLORS:kt,NO_COLOR:Tt,TERM:xt}=process.env||{}),Rt=process.stdout&&process.stdout.isTTY);const At={enabled:!kt&&null==Tt&&"dumb"!==xt&&(null!=Ot&&"0"!==Ot||Rt),reset:$t(0,0),bold:$t(1,22),dim:$t(2,22),italic:$t(3,23),underline:$t(4,24),inverse:$t(7,27),hidden:$t(8,28),strikethrough:$t(9,29),black:$t(30,39),red:$t(31,39),green:$t(32,39),yellow:$t(33,39),blue:$t(34,39),magenta:$t(35,39),cyan:$t(36,39),white:$t(37,39),gray:$t(90,39),grey:$t(90,39),bgBlack:$t(40,49),bgRed:$t(41,49),bgGreen:$t(42,49),bgYellow:$t(43,49),bgBlue:$t(44,49),bgMagenta:$t(45,49),bgCyan:$t(46,49),bgWhite:$t(47,49)};function Et(e,t){let s,n=0,r="",i="";for(;n<e.length;n++)s=e[n],r+=s.open,i+=s.close,~t.indexOf(s.close)&&(t=t.replace(s.rgx,s.close+s.open));return r+t+i}function $t(e,t){let s={open:`[${e}m`,close:`[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(t){return void 0!==this&&void 0!==this.has?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(s)),void 0===t?this:At.enabled?Et(this.keys,t+""):t+""):void 0===t?function(e,t){let s={has:e,keys:t};return s.reset=At.reset.bind(s),s.bold=At.bold.bind(s),s.dim=At.dim.bind(s),s.italic=At.italic.bind(s),s.underline=At.underline.bind(s),s.inverse=At.inverse.bind(s),s.hidden=At.hidden.bind(s),s.strikethrough=At.strikethrough.bind(s),s.black=At.black.bind(s),s.red=At.red.bind(s),s.green=At.green.bind(s),s.yellow=At.yellow.bind(s),s.blue=At.blue.bind(s),s.magenta=At.magenta.bind(s),s.cyan=At.cyan.bind(s),s.white=At.white.bind(s),s.gray=At.gray.bind(s),s.grey=At.grey.bind(s),s.bgBlack=At.bgBlack.bind(s),s.bgRed=At.bgRed.bind(s),s.bgGreen=At.bgGreen.bind(s),s.bgYellow=At.bgYellow.bind(s),s.bgBlue=At.bgBlue.bind(s),s.bgMagenta=At.bgMagenta.bind(s),s.bgCyan=At.bgCyan.bind(s),s.bgWhite=At.bgWhite.bind(s),s}([e],[s]):At.enabled?Et([s],t+""):t+""}}function jt(){}function Pt(e,t,s,n,r){for(var i=0,o=t.length,a=0,l=0;i<o;i++){var c=t[i];if(c.removed){if(c.value=e.join(n.slice(l,l+c.count)),l+=c.count,i&&t[i-1].added){var h=t[i-1];t[i-1]=t[i],t[i]=h}}else{if(!c.added&&r){var u=s.slice(a,a+c.count);u=u.map((function(e,t){var s=n[l+t];return s.length>e.length?s:e})),c.value=e.join(u)}else c.value=e.join(s.slice(a,a+c.count));a+=c.count,c.added||(l+=c.count)}}var d=t[o-1];return o>1&&"string"==typeof d.value&&(d.added||d.removed)&&e.equals("",d.value)&&(t[o-2].value+=d.value,t.pop()),t}jt.prototype={diff:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=s.callback;"function"==typeof s&&(n=s,s={}),this.options=s;var r=this;function i(e){return n?(setTimeout((function(){n(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var o=(t=this.removeEmpty(this.tokenize(t))).length,a=e.length,l=1,c=o+a;s.maxEditLength&&(c=Math.min(c,s.maxEditLength));var h=[{newPos:-1,components:[]}],u=this.extractCommon(h[0],t,e,0);if(h[0].newPos+1>=o&&u+1>=a)return i([{value:this.join(t),count:t.length}]);function d(){for(var s=-1*l;s<=l;s+=2){var n=void 0,c=h[s-1],u=h[s+1],d=(u?u.newPos:0)-s;c&&(h[s-1]=void 0);var f=c&&c.newPos+1<o,g=u&&0<=d&&d<a;if(f||g){if(!f||g&&c.newPos<u.newPos?(n={newPos:(p=u).newPos,components:p.components.slice(0)},r.pushComponent(n.components,void 0,!0)):((n=c).newPos++,r.pushComponent(n.components,!0,void 0)),d=r.extractCommon(n,t,e,s),n.newPos+1>=o&&d+1>=a)return i(Pt(r,n.components,t,e,r.useLongestToken));h[s]=n}else h[s]=void 0}var p;l++}if(n)!function e(){setTimeout((function(){if(l>c)return n();d()||e()}),0)}();else for(;l<=c;){var f=d();if(f)return f}},pushComponent:function(e,t,s){var n=e[e.length-1];n&&n.added===t&&n.removed===s?e[e.length-1]={count:n.count+1,added:t,removed:s}:e.push({count:1,added:t,removed:s})},extractCommon:function(e,t,s,n){for(var r=t.length,i=s.length,o=e.newPos,a=o-n,l=0;o+1<r&&a+1<i&&this.equals(t[o+1],s[a+1]);)o++,a++,l++;return l&&e.components.push({count:l}),e.newPos=o,a},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],s=0;s<e.length;s++)e[s]&&t.push(e[s]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};var Ft=new jt;var Lt=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Mt=/\S/,Bt=new jt;Bt.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Mt.test(e)&&!Mt.test(t)},Bt.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),s=0;s<t.length-1;s++)!t[s+1]&&t[s+2]&&Lt.test(t[s])&&Lt.test(t[s+2])&&(t[s]+=t[s+2],t.splice(s+1,2),s--);return t};var Nt=new jt;function It(e){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(e)}Nt.tokenize=function(e){var t=[],s=e.split(/(\n|\r\n)/);s[s.length-1]||s.pop();for(var n=0;n<s.length;n++){var r=s[n];n%2&&!this.options.newlineIsToken?t[t.length-1]+=r:(this.options.ignoreWhitespace&&(r=r.trim()),t.push(r))}return t},(new jt).tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)},(new jt).tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};var Dt=Object.prototype.toString,Vt=new jt;function zt(e,t,s,n,r){var i,o;for(t=t||[],s=s||[],n&&(e=n(r,e)),i=0;i<t.length;i+=1)if(t[i]===e)return s[i];if("[object Array]"===Dt.call(e)){for(t.push(e),o=new Array(e.length),s.push(o),i=0;i<e.length;i+=1)o[i]=zt(e[i],t,s,n,r);return t.pop(),s.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),"object"===It(e)&&null!==e){t.push(e),o={},s.push(o);var a,l=[];for(a in e)e.hasOwnProperty(a)&&l.push(a);for(l.sort(),i=0;i<l.length;i+=1)o[a=l[i]]=zt(e[a],t,s,n,a);t.pop(),s.pop()}else o=e;return o}Vt.useLongestToken=!0,Vt.tokenize=Nt.tokenize,Vt.castInput=function(e){var t=this.options,s=t.undefinedReplacement,n=t.stringifyReplacer,r=void 0===n?function(e,t){return void 0===t?s:t}:n;return"string"==typeof e?e:JSON.stringify(zt(e,null,null,r),r," ")},Vt.equals=function(e,t){return jt.prototype.equals.call(Vt,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};var Ut=new jt;Ut.tokenize=function(e){return e.slice()},Ut.join=Ut.removeEmpty=function(e){return e};const qt={"--":At.red,"··":At.grey,"++":At.green},Wt=At.dim().italic,Ht=At.dim("→"),Qt=At.dim("·"),Jt=At.dim("↵"),Yt=(e,t)=>qt[e](e+Kt(t))+"\n",Gt=(e,t)=>At.dim("L"+String(e).padStart(t,"0")+" "),Kt=e=>e.replace(/[ ]/g,Qt).replace(/\t/g,Ht).replace(/(\r?\n)/g,Jt);function Xt(e,t,s){let n,r=e.removed?"--":e.added?"++":"··",i=e.value.replace(/\r?\n$/,"").split("\n"),o=0,a="";for(e.added?a+=qt[r]().underline(Wt("Expected:"))+"\n":e.removed&&(a+=qt[r]().underline(Wt("Actual:"))+"\n");o<i.length;o++)n=i[o],null!=n&&(t&&(a+=Gt(t+o,s)),a+=Yt(r,n||"\n"));return a}function Zt(e,t){let s=(n=e,r=t,Ut.diff(n,r,i));var n,r,i;let o,a,l,c,h,u=0,d=0,f=0,g=Yt("··","[");for(;u<s.length;u++)for(l=(o=s[u]).removed?"--":o.added?"++":"··",o.added?g+=qt[l]().underline(Wt("Expected:"))+"\n":o.removed&&(g+=qt[l]().underline(Wt("Actual:"))+"\n"),d=0;d<o.value.length;d++)for(c=o.value[d]&&"object"==typeof o.value[d],a=rs(o.value[d]).split(/\r?\n/g),f=0;f<a.length;)h=" "+a[f++]+(c?"":","),c&&f===a.length&&d+1<o.value.length&&(h+=","),g+=Yt(l,h);return g+Yt("··","]")}function es(e,t,s=0){let n,r=0,i="",o=(a=e,l=t,Nt.diff(a,l,c));var a,l,c;let h=String(t.split(/\r?\n/g).length-s).length;for(;r<o.length;r++)i+=Xt(n=o[r],s,h),s&&!n.removed&&(s+=n.count);return i}function ts(e,t){let s=(n=e,r=t,Ft.diff(n,r,i));var n,r,i;let o,a=0,l="",c=e.length,h=t.length,u=Kt(e),d=Kt(t);if(o=s[a],c===h);else if(o.removed&&s[a+1]){let n=o.count-s[a+1].count;0==n||(n>0?(t=" ".repeat(n)+t,d=" ".repeat(n)+d,h+=n):n<0&&(e=" ".repeat(-n)+e,u=" ".repeat(-n)+u,c+=-n))}if(l+=ss(u,d,c,h),c===h)for(o=" ";a<c;a++)o+=e[a]===t[a]?" ":"^";else for(o=" ";a<s.length;a++)o+=(s[a].added||s[a].removed?"^":" ").repeat(Math.max(s[a].count,0)),a+1<s.length&&(s[a].added&&s[a+1].removed||s[a].removed&&s[a+1].added)&&(s[a+1].count-=s[a].count);return l+At.red(o)}function ss(e,t,s=String(e).length,n=String(t).length){let r=4,i=Math.max(s,n),o=typeof e,a=typeof t;if(o!==a){r=2;let l=r+i-s,c=r+i-n;e+=" ".repeat(l)+At.dim(`[${o}]`),t+=" ".repeat(c)+At.dim(`[${a}]`),s+=l+o.length+2,n+=c+a.length+2,i=Math.max(s,n)}return qt["++"]("++"+t+" ".repeat(r+i-n)+Wt("(Expected)"))+"\n"+qt["--"]("--"+e+" ".repeat(r+i-s)+Wt("(Actual)"))+"\n"}function ns(e,t){var s,n,r=0,i=Array.isArray(e),o=[],a=i?Array(e.length):{};if(i)for(r=0;r<a.length;r++)n=e[r],a[r]=n&&"object"==typeof n?ns(n,t[r]):n;else{for(s in t)o.push(s);for(;r<o.length;r++)Object.prototype.hasOwnProperty.call(e,s=o[r])&&((n=e[s])&&"object"==typeof n?a[s]=ns(n,t[s]):a[s]=n);for(s in e)a.hasOwnProperty(s)||(a[s]=e[s])}return a}function rs(e){return JSON.stringify(e,function(){var e=new Set;return function(t,s){return void 0===s?"[__VOID__]":"number"==typeof s&&s!=s?"[__NAN__]":s&&"object"==typeof s?e.has(s)?"[Circular]":(e.add(s),s):s}}(),2).replace(/"\[__NAN__\]"/g,"NaN").replace(/"\[__VOID__\]"/g,"undefined")}function is(e,t){if(Array.isArray(t)&&Array.isArray(e))return Zt(e,t);if(t instanceof RegExp)return ts(""+e,""+t);let s=e&&"object"==typeof e,n=t&&"object"==typeof t;return s&&n&&(e=ns(e,t)),n&&(t=rs(t)),s&&(e=rs(e)),t&&"object"==typeof t&&(e=rs(ns(e,t)),t=rs(t)),s="string"==typeof e,n="string"==typeof t,s&&/\r?\n/.test(e)?es(e,""+t):n&&/\r?\n/.test(t)?es(""+e,t):s&&n?ts(e,t):ss(e,t)}let os=!1,as=!1,ls=(e=Date.now())=>()=>(Date.now()-e).toFixed(2)+"ms",cs=console.log;const hs=(e,t)=>(s,n)=>e[t].push({name:s,handler:n}),us=e=>({tests:[],before:[],after:[],bEach:[],aEach:[],only:[],skips:0,state:e}),ds=(e,t)=>s=>e[t].push(s);if(as=typeof process<"u"&&typeof process.stdout<"u"){"object"!=typeof globalThis&&Object.defineProperty(global,"globalThis",{get:function(){return this}});let e=/(\.bin[\\+\/]uvu$|uvu[\\+\/]bin\.js)/i;os=process.argv.some((t=>e.test(t))),cs=e=>process.stdout.write(e),ls=(e=process.hrtime())=>()=>{return(1e3*(t=process.hrtime(e))[0]+t[1]/1e6).toFixed(2)+"ms";var t}}else typeof performance<"u"&&(ls=(e=performance.now())=>()=>(performance.now()-e).toFixed(2)+"ms");globalThis.UVU_QUEUE=globalThis.UVU_QUEUE||[],os||UVU_QUEUE.push([null]);const fs=At.dim('"'),gs="\n ",ps=At.red("✘ "),ys=At.gray("• "),vs=/^\s*at.*(?:\(|\s)(?:node|(internal\/[\w/]*))/,bs=At.bold().bgRed(" FAIL "),ms=At.bold().underline().white,ws=At.bgWhite().bold;function Cs(e,t,s=""){let{details:n,operator:r=""}=t,i=t.stack&&t.stack.indexOf("\n");t.name.startsWith("AssertionError")&&!r.includes("not")&&(n=is(t.actual,t.expected));let o=" "+bs+(s?At.red(ws(` ${s} `)):"")+" "+fs+At.red().bold(e)+fs;return o+="\n "+t.message+(r?At.italic().dim(` (${r})`):"")+"\n",n&&(o+=gs+n.split("\n").join(gs)),~i&&(o+=function(e,t){let s,n=0,r="",i=e.substring(t).replace(/\\/g,"/").split("\n");for(;n<i.length;n++)s=i[n].trim(),s.length&&!vs.test(s)&&(r+="\n "+s);return At.grey(r)+"\n"}(t.stack,i)),o+"\n"}async function _s(e,t){let s,n,{only:r,tests:i,before:o,after:a,bEach:l,aEach:c,state:h}=e,u=r.length?r:i,d=0,f="",g=u.length;try{for(s of(t&&cs(ws(At.black(` ${t} `))+" "),o))await s(h);for(n of u){h.__test__=n.name;try{for(s of l)await s(h);for(s of(await n.handler(h),c))await s(h);cs(ys),d++}catch(e){for(s of c)await s(h);f.length&&(f+="\n"),f+=Cs(n.name,e,t),cs(ps)}}}finally{for(s of(h.__test__="",a))await s(h);let t=` (${d} / ${g})\n`,n=(r.length?i.length:0)+e.skips;return cs(f.length?At.red(t):At.green(t)),[f||!0,d,n,g]}}let Ss;function Os(e,t=""){e.state.__test__="",e.state.__suite__=t;const s=hs(e,"tests");return s.before=ds(e,"before"),s.before.each=ds(e,"bEach"),s.after=ds(e,"after"),s.after.each=ds(e,"aEach"),s.only=hs(e,"only"),s.skip=()=>{e.skips++},s.run=()=>{let s={...e},n=_s.bind(0,s,t);Object.assign(e,us(s.state)),UVU_QUEUE[globalThis.UVU_INDEX||0].push(n),os||(clearTimeout(Ss),Ss=setTimeout(xs))},s}const ks=(e="",t={})=>Os(us(t),e),Ts=ks();async function xs(e){let t=ls(),s=0,n=0,r=0,i=0;for(let t of UVU_QUEUE){n&&cs("\n");let o=t.shift();null!=o&&cs(ms(o)+"\n");for(let o of t){let[t,a,l,c]=await o();if(n+=c,s+=a,r+=l,t.length&&(cs("\n"+t+"\n"),i=1,e))return as&&process.exit(1)}}cs("\n Total: "+n),cs((i?At.red:At.green)("\n Passed: "+s)),cs("\n Skipped: "+(r?At.yellow(r):r)),cs("\n Duration: "+t()+"\n\n"),as&&(process.exitCode=i)}var Rs=Object.prototype.hasOwnProperty;function As(e,t,s){for(s of e.keys())if(Es(s,t))return s}function Es(e,t){var s,n,r;if(e===t)return!0;if(e&&t&&(s=e.constructor)===t.constructor){if(s===Date)return e.getTime()===t.getTime();if(s===RegExp)return e.toString()===t.toString();if(s===Array){if((n=e.length)===t.length)for(;n--&&Es(e[n],t[n]););return-1===n}if(s===Set){if(e.size!==t.size)return!1;for(n of e){if((r=n)&&"object"==typeof r&&!(r=As(t,r)))return!1;if(!t.has(r))return!1}return!0}if(s===Map){if(e.size!==t.size)return!1;for(n of e){if((r=n[0])&&"object"==typeof r&&!(r=As(t,r)))return!1;if(!Es(n[1],t.get(r)))return!1}return!0}if(s===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(s===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return-1===n}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}if(!s||"object"==typeof e){for(s in n=0,e){if(Rs.call(e,s)&&++n&&!Rs.call(t,s))return!1;if(!(s in t)||!Es(e[s],t[s]))return!1}return Object.keys(t).length===n}}return e!=e&&t!=t}function $s(e){let t=(e=e.replace(/\r?\n/g,"\n")).match(/^[ \t]*(?=\S)/gm),s=0,n=1/0,r=(t||[]).length;for(;s<r;s++)n=Math.min(n,t[s].length);return r&&n?e.replace(new RegExp(`^[ \\t]{${n}}`,"gm"),""):e}class js extends Error{constructor(e={}){super(e.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}}function Ps(e,t,s,n,r,i,o){if(e)return;let a=o||i;if(o instanceof Error)throw o;let l=r&&r(t,s);throw new js({actual:t,expects:s,operator:n,message:a,details:l,generated:!o})}function Fs(e,t,s){Ps(e===t,e,t,"is",is,"Expected values to be strictly equal:",s)}function Ls(e,t,s){let n=typeof e;Ps(n===t,n,t,"type",!1,`Expected "${n}" to be "${t}"`,s)}const Ms=(e,t)=>es(e,t,1);function Bs(e,t){Ps(!e,!0,!1,"not",!1,"Expected value to be falsey",t)}Bs.ok=Bs,Fs.not=function(e,t,s){Ps(e!==t,e,t,"is.not",!1,"Expected values not to be strictly equal",s)},Bs.equal=function(e,t,s){Ps(!Es(e,t),e,t,"not.equal",!1,"Expected values not to be deeply equal",s)},Bs.type=function(e,t,s){let n=typeof e;Ps(n!==t,n,t,"not.type",!1,`Expected "${n}" not to be "${t}"`,s)},Bs.instance=function(e,t,s){Ps(!(e instanceof t),e,t,"not.instance",!1,`Expected value not to be an instance of ${"`"+(t.name||t.constructor.name)+"`"}`,s)},Bs.snapshot=function(e,t,s){Ps((e=$s(e))!==(t=$s(t)),e,t,"not.snapshot",!1,"Expected value not to match snapshot",s)},Bs.fixture=function(e,t,s){Ps((e=$s(e))!==(t=$s(t)),e,t,"not.fixture",!1,"Expected value not to match fixture",s)},Bs.match=function(e,t,s){"string"==typeof t?Ps(!e.includes(t),e,t,"not.match",!1,`Expected value not to include "${t}" substring`,s):Ps(!t.test(e),e,t,"not.match",!1,`Expected value not to match \`${String(t)}\` pattern`,s)},Bs.throws=function(e,t,s){s||"string"!=typeof t||(s=t,t=null);try{e()}catch(e){"function"==typeof t?Ps(!t(e),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",s):t instanceof RegExp?Ps(!t.test(e.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,s):t||Ps(!1,!0,!1,"not.throws",!1,"Expected function not to throw",s)}};var Ns=Object.freeze({__proto__:null,Assertion:js,ok:function(e,t){Ps(!!e,!1,!0,"ok",!1,"Expected value to be truthy",t)},is:Fs,equal:function(e,t,s){Ps(Es(e,t),e,t,"equal",is,"Expected values to be deeply equal:",s)},unreachable:function(e){Ps(!1,!0,!1,"unreachable",!1,"Expected not to be reached!",e)},type:Ls,instance:function(e,t,s){Ps(e instanceof t,e,t,"instance",!1,`Expected value to be an instance of ${"`"+(t.name||t.constructor.name)+"`"}`,s)},match:function(e,t,s){"string"==typeof t?Ps(e.includes(t),e,t,"match",!1,`Expected value to include "${t}" substring`,s):Ps(t.test(e),e,t,"match",!1,`Expected value to match \`${String(t)}\` pattern`,s)},snapshot:function(e,t,s){Ps((e=$s(e))===(t=$s(t)),e,t,"snapshot",es,"Expected value to match snapshot:",s)},fixture:function(e,t,s){Ps((e=$s(e))===(t=$s(t)),e,t,"fixture",Ms,"Expected value to match fixture:",s)},throws:function(e,t,s){s||"string"!=typeof t||(s=t,t=null);try{e(),Ps(!1,!1,!0,"throws",!1,"Expected function to throw",s)}catch(e){if(e instanceof js)throw e;"function"==typeof t?Ps(t(e),!1,!0,"throws",!1,"Expected function to throw matching exception",s):t instanceof RegExp&&Ps(t.test(e.message),!1,!0,"throws",!1,`Expected function to throw exception matching \`${String(t)}\` pattern`,s)}},not:Bs});const Is={};Is[Is.Fatal=0]="Fatal",Is[Is.Error=0]="Error",Is[Is.Warn=1]="Warn",Is[Is.Log=2]="Log",Is[Is.Info=3]="Info",Is[Is.Success=3]="Success",Is[Is.Debug=4]="Debug",Is[Is.Trace=5]="Trace",Is[Is.Silent=-1/0]="Silent",Is[Is.Verbose=1/0]="Verbose";var Ds={silent:{level:-1},fatal:{level:Is.Fatal},error:{level:Is.Error},warn:{level:Is.Warn},log:{level:Is.Log},info:{level:Is.Info},success:{level:Is.Success},debug:{level:Is.Debug},trace:{level:Is.Trace},verbose:{level:Is.Trace},ready:{level:Is.Info},start:{level:Is.Info}};function Vs(e){return t=e,"[object Object]"===Object.prototype.toString.call(t)&&(!(!e.message&&!e.args)&&!e.stack);var t}let zs=!1;const Us=[];class qs{constructor(e={}){this._reporters=e.reporters||[],this._types=e.types||Ds,this.level=void 0!==e.level?e.level:3,this._defaults=e.defaults||{},this._async=void 0!==e.async?e.async:void 0,this._stdout=e.stdout,this._stderr=e.stderr,this._mockFn=e.mockFn,this._throttle=e.throttle||1e3,this._throttleMin=e.throttleMin||5;for(const e in this._types){const t={type:e,...this._types[e],...this._defaults};this[e]=this._wrapLogFn(t),this[e].raw=this._wrapLogFn(t,!0)}this._mockFn&&this.mockTypes(),this._lastLogSerialized=void 0,this._lastLog=void 0,this._lastLogTime=void 0,this._lastLogCount=0,this._throttleTimeout=void 0}get stdout(){return this._stdout||console._stdout}get stderr(){return this._stderr||console._stderr}create(e){return new qs(Object.assign({reporters:this._reporters,level:this.level,types:this._types,defaults:this._defaults,stdout:this._stdout,stderr:this._stderr,mockFn:this._mockFn},e))}withDefaults(e){return this.create({defaults:Object.assign({},this._defaults,e)})}withTag(e){return this.withDefaults({tag:this._defaults.tag?this._defaults.tag+":"+e:e})}addReporter(e){return this._reporters.push(e),this}removeReporter(e){if(e){const t=this._reporters.indexOf(e);if(t>=0)return this._reporters.splice(t,1)}else this._reporters.splice(0);return this}setReporters(e){return this._reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this._types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this._types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}_wrapStream(e,t){e&&(e.__write||(e.__write=e.write),e.write=e=>{this[t].raw(String(e).trim())})}restoreStd(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){zs=!0}resumeLogs(){zs=!1;const e=Us.splice(0);for(const t of e)t[0]._logFn(t[1],t[2])}mockTypes(e){if(this._mockFn=e||this._mockFn,"function"==typeof this._mockFn)for(const e in this._types)this[e]=this._mockFn(e,this._types[e])||this[e],this[e].raw=this[e]}_wrapLogFn(e,t){return(...s)=>{if(!zs)return this._logFn(e,s,t);Us.push([this,e,s,t])}}_logFn(e,t,s){if(e.level>this.level)return!!this._async&&Promise.resolve(!1);const n=Object.assign({date:new Date,args:[]},e);!s&&1===t.length&&Vs(t[0])?Object.assign(n,t[0]):n.args=Array.from(t),n.message&&(n.args.unshift(n.message),delete n.message),n.additional&&(Array.isArray(n.additional)||(n.additional=n.additional.split("\n")),n.args.push("\n"+n.additional.join("\n")),delete n.additional),n.type="string"==typeof n.type?n.type.toLowerCase():"",n.tag="string"==typeof n.tag?n.tag.toLowerCase():"";const r=(e=!1)=>{const t=this._lastLogCount-this._throttleMin;if(this._lastLog&&t>0){const e=[...this._lastLog.args];t>1&&e.push(`(repeated ${t} times)`),this._log({...this._lastLog,args:e}),this._lastLogCount=1}if(e){if(this._lastLog=n,this._async)return this._logAsync(n);this._log(n)}};clearTimeout(this._throttleTimeout);const i=this._lastLogTime?n.date-this._lastLogTime:0;if(this._lastLogTime=n.date,i<this._throttle)try{const e=JSON.stringify([n.type,n.tag,n.args]),t=this._lastLogSerialized===e;if(this._lastLogSerialized=e,t&&(this._lastLogCount++,this._lastLogCount>this._throttleMin))return void(this._throttleTimeout=setTimeout(r,this._throttle))}catch(e){}r(!0)}_log(e){for(const t of this._reporters)t.log(e,{async:!1,stdout:this.stdout,stderr:this.stderr})}_logAsync(e){return Promise.all(this._reporters.map((t=>t.log(e,{async:!0,stdout:this.stdout,stderr:this.stderr}))))}}qs.prototype.add=qs.prototype.addReporter,qs.prototype.remove=qs.prototype.removeReporter,qs.prototype.clear=qs.prototype.removeReporter,qs.prototype.withScope=qs.prototype.withTag,qs.prototype.mock=qs.prototype.mockTypes,qs.prototype.pause=qs.prototype.pauseLogs,qs.prototype.resume=qs.prototype.resumeLogs;class Ws{constructor(e){this.options=Object.assign({},e),this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}log(e){const t=e.level<1?console.__error||console.error:1===e.level&&console.warn?console.__warn||console.warn:console.__log||console.log,s="log"!==e.type?e.type:"",n=e.tag?e.tag:"",r=`\n background: ${this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor};\n border-radius: 0.5em;\n color: white;\n font-weight: bold;\n padding: 2px 0.5em;\n `,i=`%c${[n,s].filter(Boolean).join(":")}`;"string"==typeof e.args[0]?t(`${i}%c ${e.args[0]}`,r,"",...e.args.slice(1)):t(i,r,...e.args)}}var Hs="undefined"!=typeof window&&window.consola||function(){const e=new qs({reporters:[new Ws]});return e.Consola=qs,e.LogLevel=Is,e.BrowserReporter=Ws,e}();"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;(function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var s=0;s<t.length;s++){var n=t[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,s,n){return s&&t(e.prototype,s),n&&t(e,n),e}function n(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function r(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function i(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?r(Object(s),!0).forEach((function(t){n(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):r(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}function o(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return l(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);return"Object"===s&&e.constructor&&(s=e.constructor.name),"Map"===s||"Set"===s?Array.from(e):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s<t;s++)n[s]=e[s];return n}function c(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=a(e))){var t=0,s=function(){};return{s:s,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,r,i=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){o=!0,r=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw r}}}}var h={};h[h.Fatal=0]="Fatal",h[h.Error=0]="Error",h[h.Warn=1]="Warn",h[h.Log=2]="Log",h[h.Info=3]="Info",h[h.Success=3]="Success",h[h.Debug=4]="Debug",h[h.Trace=5]="Trace",h[h.Silent=-1/0]="Silent",h[h.Verbose=1/0]="Verbose";var u={silent:{level:-1},fatal:{level:h.Fatal},error:{level:h.Error},warn:{level:h.Warn},log:{level:h.Log},info:{level:h.Info},success:{level:h.Success},debug:{level:h.Debug},trace:{level:h.Trace},verbose:{level:h.Trace},ready:{level:h.Info},start:{level:h.Info}};function d(e){return t=e,!("[object Object]"!==Object.prototype.toString.call(t)||!e.message&&!e.args||e.stack);var t}var f=!1,g=[],p=function(){function t(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var n in e(this,t),this._reporters=s.reporters||[],this._types=s.types||u,this.level=void 0!==s.level?s.level:3,this._defaults=s.defaults||{},this._async=void 0!==s.async?s.async:void 0,this._stdout=s.stdout,this._stderr=s.stderr,this._mockFn=s.mockFn,this._throttle=s.throttle||1e3,this._throttleMin=s.throttleMin||5,this._types){var r=i(i({type:n},this._types[n]),this._defaults);this[n]=this._wrapLogFn(r),this[n].raw=this._wrapLogFn(r,!0)}this._mockFn&&this.mockTypes(),this._lastLogSerialized=void 0,this._lastLog=void 0,this._lastLogTime=void 0,this._lastLogCount=0,this._throttleTimeout=void 0}return s(t,[{key:"create",value:function(e){return new t(Object.assign({reporters:this._reporters,level:this.level,types:this._types,defaults:this._defaults,stdout:this._stdout,stderr:this._stderr,mockFn:this._mockFn},e))}},{key:"withDefaults",value:function(e){return this.create({defaults:Object.assign({},this._defaults,e)})}},{key:"withTag",value:function(e){return this.withDefaults({tag:this._defaults.tag?this._defaults.tag+":"+e:e})}},{key:"addReporter",value:function(e){return this._reporters.push(e),this}},{key:"removeReporter",value:function(e){if(e){var t=this._reporters.indexOf(e);if(t>=0)return this._reporters.splice(t,1)}else this._reporters.splice(0);return this}},{key:"setReporters",value:function(e){return this._reporters=Array.isArray(e)?e:[e],this}},{key:"wrapAll",value:function(){this.wrapConsole(),this.wrapStd()}},{key:"restoreAll",value:function(){this.restoreConsole(),this.restoreStd()}},{key:"wrapConsole",value:function(){for(var e in this._types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}},{key:"restoreConsole",value:function(){for(var e in this._types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}},{key:"wrapStd",value:function(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}},{key:"_wrapStream",value:function(e,t){var s=this;e&&(e.__write||(e.__write=e.write),e.write=function(e){s[t].raw(String(e).trim())})}},{key:"restoreStd",value:function(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}},{key:"_restoreStream",value:function(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}},{key:"pauseLogs",value:function(){f=!0}},{key:"resumeLogs",value:function(){f=!1;var e,t=c(g.splice(0));try{for(t.s();!(e=t.n()).done;){var s=e.value;s[0]._logFn(s[1],s[2])}}catch(e){t.e(e)}finally{t.f()}}},{key:"mockTypes",value:function(e){if(this._mockFn=e||this._mockFn,"function"==typeof this._mockFn)for(var t in this._types)this[t]=this._mockFn(t,this._types[t])||this[t],this[t].raw=this[t]}},{key:"_wrapLogFn",value:function(e,t){var s=this;return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(!f)return s._logFn(e,r,t);g.push([s,e,r,t])}}},{key:"_logFn",value:function(e,t,s){var n=this;if(e.level>this.level)return!!this._async&&Promise.resolve(!1);var r=Object.assign({date:new Date,args:[]},e);!s&&1===t.length&&d(t[0])?Object.assign(r,t[0]):r.args=Array.from(t),r.message&&(r.args.unshift(r.message),delete r.message),r.additional&&(Array.isArray(r.additional)||(r.additional=r.additional.split("\n")),r.args.push("\n"+r.additional.join("\n")),delete r.additional),r.type="string"==typeof r.type?r.type.toLowerCase():"",r.tag="string"==typeof r.tag?r.tag.toLowerCase():"";var a=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=n._lastLogCount-n._throttleMin;if(n._lastLog&&t>0){var s=o(n._lastLog.args);t>1&&s.push("(repeated ".concat(t," times)")),n._log(i(i({},n._lastLog),{},{args:s})),n._lastLogCount=1}if(e){if(n._lastLog=r,n._async)return n._logAsync(r);n._log(r)}};clearTimeout(this._throttleTimeout);var l=this._lastLogTime?r.date-this._lastLogTime:0;if(this._lastLogTime=r.date,l<this._throttle)try{var c=JSON.stringify([r.type,r.tag,r.args]),h=this._lastLogSerialized===c;if(this._lastLogSerialized=c,h&&(this._lastLogCount++,this._lastLogCount>this._throttleMin))return void(this._throttleTimeout=setTimeout(a,this._throttle))}catch(e){}a(!0)}},{key:"_log",value:function(e){var t,s=c(this._reporters);try{for(s.s();!(t=s.n()).done;)t.value.log(e,{async:!1,stdout:this.stdout,stderr:this.stderr})}catch(e){s.e(e)}finally{s.f()}}},{key:"_logAsync",value:function(e){var t=this;return Promise.all(this._reporters.map((function(s){return s.log(e,{async:!0,stdout:t.stdout,stderr:t.stderr})})))}},{key:"stdout",get:function(){return this._stdout||console._stdout}},{key:"stderr",get:function(){return this._stderr||console._stderr}}]),t}();p.prototype.add=p.prototype.addReporter,p.prototype.remove=p.prototype.removeReporter,p.prototype.clear=p.prototype.removeReporter,p.prototype.withScope=p.prototype.withTag,p.prototype.mock=p.prototype.mockTypes,p.prototype.pause=p.prototype.pauseLogs,p.prototype.resume=p.prototype.resumeLogs;var y,v=function(){function t(s){e(this,t),this.options=Object.assign({},s),this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}return s(t,[{key:"log",value:function(e){var t=e.level<1?console.__error||console.error:1===e.level&&console.warn?console.__warn||console.warn:console.__log||console.log,s="log"!==e.type?e.type:"",n=e.tag?e.tag:"",r=this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor,i="\n background: ".concat(r,";\n border-radius: 0.5em;\n color: white;\n font-weight: bold;\n padding: 2px 0.5em;\n "),a="%c".concat([n,s].filter(Boolean).join(":"));"string"==typeof e.args[0]?t.apply(void 0,["".concat(a,"%c ").concat(e.args[0]),i,""].concat(o(e.args.slice(1)))):t.apply(void 0,[a,i].concat(o(e.args)))}}]),t}();"undefined"!=typeof window&&window.consola||((y=new p({reporters:[new v]})).Consola=p,y.LogLevel=h,y.BrowserReporter=v)})();const Qs={level:4};const Js=function(e,t=Qs){return Hs.create(t).withTag(e)}("foundation-testing");e.Registration=Le,e.assert=Ns,e.createComponentSuite=function(e,t,s,n=[]){const r=ks(e,Object.assign({element:void 0,disconnect:void 0,designSystem:void 0,container:void 0},s));return r.before.each((e=>_t(this,void 0,void 0,(function*(){const s=document.createElement("div"),r=mt.getOrCreate(s).register(...n),i=me.getOrCreateDOMContainer(s),o={parent:s,designSystem:r},{element:a,connect:l,disconnect:c}=yield St("string"==typeof t?t:t(),o);e.element=a,e.disconnect=c,e.designSystem=r,e.container=i,yield l()})))),r.after.each((e=>_t(this,void 0,void 0,(function*(){yield e.disconnect(),e.element=void 0,e.disconnect=void 0,e.designSystem=void 0,e.container=void 0})))),r},e.createLogicSuite=function(e,t){return ks(e,Object.assign({runCases:(e,t)=>{Ls(e,"function"),t.forEach((([t,s,n])=>Fs(e(...t),s,n)))}},t))},e.fixture=St,e.logger=Js,e.suite=ks,e.test=Ts,Object.defineProperty(e,"__esModule",{value:!0})}({});
|