@microsoft/fast-element 2.8.5 → 2.9.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/CHANGELOG.json CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "@microsoft/fast-element",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 02 Dec 2025 21:46:27 GMT",
5
+ "date": "Mon, 08 Dec 2025 19:47:27 GMT",
6
+ "version": "2.9.0",
7
+ "tag": "@microsoft/fast-element_v2.9.0",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "author": "863023+radium-v@users.noreply.github.com",
12
+ "package": "@microsoft/fast-element",
13
+ "commit": "1e21fa3cac5f940f639bf76311af291e1a368da1",
14
+ "comment": "feat: add support for compact attribute binding markers"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Tue, 02 Dec 2025 21:46:59 GMT",
6
21
  "version": "2.8.5",
7
22
  "tag": "@microsoft/fast-element_v2.8.5",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # Change Log - @microsoft/fast-element
2
2
 
3
- <!-- This log was last generated on Tue, 02 Dec 2025 21:46:27 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Mon, 08 Dec 2025 19:47:27 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.9.0
8
+
9
+ Mon, 08 Dec 2025 19:47:27 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - feat: add support for compact attribute binding markers (863023+radium-v@users.noreply.github.com)
14
+
7
15
  ## 2.8.5
8
16
 
9
- Tue, 02 Dec 2025 21:46:27 GMT
17
+ Tue, 02 Dec 2025 21:46:59 GMT
10
18
 
11
19
  ### Patches
12
20
 
@@ -8,6 +8,7 @@ import type { HydrationView } from "../templating/view.js";
8
8
  */
9
9
  export declare const HydrationMarkup: Readonly<{
10
10
  attributeMarkerName: "data-fe-b";
11
+ compactAttributeMarkerName: "data-fe-c";
11
12
  attributeBindingSeparator: " ";
12
13
  contentBindingStartMarker(index: number, uniqueId: string): string;
13
14
  contentBindingEndMarker(index: number, uniqueId: string): string;
@@ -22,15 +23,25 @@ export declare const HydrationMarkup: Readonly<{
22
23
  /**
23
24
  * Returns the indexes of the ViewBehaviorFactories affecting
24
25
  * attributes for the element, or null if no factories were found.
26
+ *
27
+ * This method parses the space-separated format: `data-fe-b="0 1 2"`.
25
28
  */
26
29
  parseAttributeBinding(node: Element): null | number[];
27
30
  /**
28
31
  * Returns the indexes of the ViewBehaviorFactories affecting
29
32
  * attributes for the element, or null if no factories were found.
30
33
  *
31
- * Uses the alternative syntax of data-fe-b-<number>
34
+ * This method parses the enumerated format: `data-fe-b-0`, `data-fe-b-1`, `data-fe-b-2`.
35
+ * This is an alternative format that uses separate attributes for each binding index.
32
36
  */
33
37
  parseEnumeratedAttributeBinding(node: Element): null | number[];
38
+ /**
39
+ * Returns the indexes of the ViewBehaviorFactories affecting
40
+ * attributes for the element, or null if no factories were found.
41
+ *
42
+ * This method parses the compact format: `data-fe-c-{index}-{count}`.
43
+ */
44
+ parseCompactAttributeBinding(node: Element): null | number[];
34
45
  /**
35
46
  * Parses the ViewBehaviorFactory index from string data. Returns
36
47
  * the binding index or null if the index cannot be retrieved.
@@ -1,3 +1,4 @@
1
+ import { FAST } from "../platform.js";
1
2
  const bindingStartMarker = /fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/;
2
3
  const bindingEndMarker = /fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/;
3
4
  const repeatViewStartMarker = /fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/;
@@ -13,6 +14,7 @@ function isComment(node) {
13
14
  */
14
15
  export const HydrationMarkup = Object.freeze({
15
16
  attributeMarkerName: "data-fe-b",
17
+ compactAttributeMarkerName: "data-fe-c",
16
18
  attributeBindingSeparator: " ",
17
19
  contentBindingStartMarker(index, uniqueId) {
18
20
  return `fe-b$$start$$${index}$$${uniqueId}$$fe-b`;
@@ -47,6 +49,8 @@ export const HydrationMarkup = Object.freeze({
47
49
  /**
48
50
  * Returns the indexes of the ViewBehaviorFactories affecting
49
51
  * attributes for the element, or null if no factories were found.
52
+ *
53
+ * This method parses the space-separated format: `data-fe-b="0 1 2"`.
50
54
  */
51
55
  parseAttributeBinding(node) {
52
56
  const attr = node.getAttribute(this.attributeMarkerName);
@@ -58,7 +62,8 @@ export const HydrationMarkup = Object.freeze({
58
62
  * Returns the indexes of the ViewBehaviorFactories affecting
59
63
  * attributes for the element, or null if no factories were found.
60
64
  *
61
- * Uses the alternative syntax of data-fe-b-<number>
65
+ * This method parses the enumerated format: `data-fe-b-0`, `data-fe-b-1`, `data-fe-b-2`.
66
+ * This is an alternative format that uses separate attributes for each binding index.
62
67
  */
63
68
  parseEnumeratedAttributeBinding(node) {
64
69
  const attrs = [];
@@ -71,12 +76,47 @@ export const HydrationMarkup = Object.freeze({
71
76
  attrs.push(count);
72
77
  }
73
78
  else {
74
- throw new Error(`Invalid attribute marker name: ${attr}. Expected format is ${prefix}<number>.`);
79
+ throw FAST.error(1601 /* invalidAttributeMarkerName */, {
80
+ name: attr,
81
+ expectedFormat: `${prefix}<number>`,
82
+ });
75
83
  }
76
84
  }
77
85
  }
78
86
  return attrs.length === 0 ? null : attrs;
79
87
  },
88
+ /**
89
+ * Returns the indexes of the ViewBehaviorFactories affecting
90
+ * attributes for the element, or null if no factories were found.
91
+ *
92
+ * This method parses the compact format: `data-fe-c-{index}-{count}`.
93
+ */
94
+ parseCompactAttributeBinding(node) {
95
+ const prefix = `${this.compactAttributeMarkerName}-`;
96
+ const attrName = node.getAttributeNames().find(name => name.startsWith(prefix));
97
+ if (!attrName) {
98
+ return null;
99
+ }
100
+ const suffix = attrName.slice(prefix.length);
101
+ const parts = suffix.split("-");
102
+ const startIndex = parseInt(parts[0], 10);
103
+ const count = parseInt(parts[1], 10);
104
+ if (parts.length !== 2 ||
105
+ Number.isNaN(startIndex) ||
106
+ Number.isNaN(count) ||
107
+ startIndex < 0 ||
108
+ count < 1) {
109
+ throw FAST.error(1604 /* invalidCompactAttributeMarkerName */, {
110
+ name: attrName,
111
+ expectedFormat: `${this.compactAttributeMarkerName}-{index}-{count}`,
112
+ });
113
+ }
114
+ const indexes = [];
115
+ for (let i = 0; i < count; i++) {
116
+ indexes.push(startIndex + i);
117
+ }
118
+ return indexes;
119
+ },
80
120
  /**
81
121
  * Parses the ViewBehaviorFactory index from string data. Returns
82
122
  * the binding index or null if the index cannot be retrieved.
package/dist/esm/debug.js CHANGED
@@ -35,6 +35,9 @@ const debugMessages = {
35
35
  [1512 /* noDefaultResolver */]: "'${key}' not registered. Did you forget to add @singleton()?",
36
36
  [1513 /* cyclicDependency */]: "Cyclic dependency found '${name}'.",
37
37
  [1514 /* connectUpdateRequiresController */]: "Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement.",
38
+ [1601 /* invalidAttributeMarkerName */]: "Invalid attribute marker name: ${name}. Expected format is ${expectedFormat}.",
39
+ [1602 /* invalidCompactAttributeMarkerValues */]: "Invalid compact attribute marker values in ${markerName}. Both index and count must be positive integers.",
40
+ [1604 /* invalidCompactAttributeMarkerName */]: "Invalid compact attribute marker name: ${name}. Expected format is ${expectedFormat}.",
38
41
  };
39
42
  const allPlaceholders = /(\$\{\w+?})/g;
40
43
  const placeholder = /\$\{(\w+?)}/g;
@@ -79,9 +79,9 @@ export function buildViewBindingTargets(firstNode, lastNode, factories) {
79
79
  return { targets, boundaries };
80
80
  }
81
81
  function targetElement(node, factories, targets) {
82
- var _a;
82
+ var _a, _b;
83
83
  // Check for attributes and map any factories.
84
- const attrFactoryIds = (_a = HydrationMarkup.parseAttributeBinding(node)) !== null && _a !== void 0 ? _a : HydrationMarkup.parseEnumeratedAttributeBinding(node);
84
+ const attrFactoryIds = (_b = (_a = HydrationMarkup.parseAttributeBinding(node)) !== null && _a !== void 0 ? _a : HydrationMarkup.parseEnumeratedAttributeBinding(node)) !== null && _b !== void 0 ? _b : HydrationMarkup.parseCompactAttributeBinding(node);
85
85
  if (attrFactoryIds !== null) {
86
86
  for (const id of attrFactoryIds) {
87
87
  if (!factories[id]) {
@@ -35,6 +35,9 @@ const debugMessages = {
35
35
  [1512 /* noDefaultResolver */]: "'${key}' not registered. Did you forget to add @singleton()?",
36
36
  [1513 /* cyclicDependency */]: "Cyclic dependency found '${name}'.",
37
37
  [1514 /* connectUpdateRequiresController */]: "Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement.",
38
+ [1601 /* invalidAttributeMarkerName */]: "Invalid attribute marker name: ${name}. Expected format is ${expectedFormat}.",
39
+ [1602 /* invalidCompactAttributeMarkerValues */]: "Invalid compact attribute marker values in ${markerName}. Both index and count must be positive integers.",
40
+ [1604 /* invalidCompactAttributeMarkerName */]: "Invalid compact attribute marker name: ${name}. Expected format is ${expectedFormat}.",
38
41
  };
39
42
  const allPlaceholders = /(\$\{\w+?})/g;
40
43
  const placeholder = /\$\{(\w+?)}/g;
@@ -2333,6 +2336,7 @@ function isComment$1(node) {
2333
2336
  */
2334
2337
  const HydrationMarkup = Object.freeze({
2335
2338
  attributeMarkerName: "data-fe-b",
2339
+ compactAttributeMarkerName: "data-fe-c",
2336
2340
  attributeBindingSeparator: " ",
2337
2341
  contentBindingStartMarker(index, uniqueId) {
2338
2342
  return `fe-b$$start$$${index}$$${uniqueId}$$fe-b`;
@@ -2367,6 +2371,8 @@ const HydrationMarkup = Object.freeze({
2367
2371
  /**
2368
2372
  * Returns the indexes of the ViewBehaviorFactories affecting
2369
2373
  * attributes for the element, or null if no factories were found.
2374
+ *
2375
+ * This method parses the space-separated format: `data-fe-b="0 1 2"`.
2370
2376
  */
2371
2377
  parseAttributeBinding(node) {
2372
2378
  const attr = node.getAttribute(this.attributeMarkerName);
@@ -2378,7 +2384,8 @@ const HydrationMarkup = Object.freeze({
2378
2384
  * Returns the indexes of the ViewBehaviorFactories affecting
2379
2385
  * attributes for the element, or null if no factories were found.
2380
2386
  *
2381
- * Uses the alternative syntax of data-fe-b-<number>
2387
+ * This method parses the enumerated format: `data-fe-b-0`, `data-fe-b-1`, `data-fe-b-2`.
2388
+ * This is an alternative format that uses separate attributes for each binding index.
2382
2389
  */
2383
2390
  parseEnumeratedAttributeBinding(node) {
2384
2391
  const attrs = [];
@@ -2391,12 +2398,47 @@ const HydrationMarkup = Object.freeze({
2391
2398
  attrs.push(count);
2392
2399
  }
2393
2400
  else {
2394
- throw new Error(`Invalid attribute marker name: ${attr}. Expected format is ${prefix}<number>.`);
2401
+ throw FAST.error(1601 /* invalidAttributeMarkerName */, {
2402
+ name: attr,
2403
+ expectedFormat: `${prefix}<number>`,
2404
+ });
2395
2405
  }
2396
2406
  }
2397
2407
  }
2398
2408
  return attrs.length === 0 ? null : attrs;
2399
2409
  },
2410
+ /**
2411
+ * Returns the indexes of the ViewBehaviorFactories affecting
2412
+ * attributes for the element, or null if no factories were found.
2413
+ *
2414
+ * This method parses the compact format: `data-fe-c-{index}-{count}`.
2415
+ */
2416
+ parseCompactAttributeBinding(node) {
2417
+ const prefix = `${this.compactAttributeMarkerName}-`;
2418
+ const attrName = node.getAttributeNames().find(name => name.startsWith(prefix));
2419
+ if (!attrName) {
2420
+ return null;
2421
+ }
2422
+ const suffix = attrName.slice(prefix.length);
2423
+ const parts = suffix.split("-");
2424
+ const startIndex = parseInt(parts[0], 10);
2425
+ const count = parseInt(parts[1], 10);
2426
+ if (parts.length !== 2 ||
2427
+ Number.isNaN(startIndex) ||
2428
+ Number.isNaN(count) ||
2429
+ startIndex < 0 ||
2430
+ count < 1) {
2431
+ throw FAST.error(1604 /* invalidCompactAttributeMarkerName */, {
2432
+ name: attrName,
2433
+ expectedFormat: `${this.compactAttributeMarkerName}-{index}-{count}`,
2434
+ });
2435
+ }
2436
+ const indexes = [];
2437
+ for (let i = 0; i < count; i++) {
2438
+ indexes.push(startIndex + i);
2439
+ }
2440
+ return indexes;
2441
+ },
2400
2442
  /**
2401
2443
  * Parses the ViewBehaviorFactory index from string data. Returns
2402
2444
  * the binding index or null if the index cannot be retrieved.
@@ -2713,9 +2755,9 @@ function buildViewBindingTargets(firstNode, lastNode, factories) {
2713
2755
  return { targets, boundaries };
2714
2756
  }
2715
2757
  function targetElement(node, factories, targets) {
2716
- var _a;
2758
+ var _a, _b;
2717
2759
  // Check for attributes and map any factories.
2718
- const attrFactoryIds = (_a = HydrationMarkup.parseAttributeBinding(node)) !== null && _a !== void 0 ? _a : HydrationMarkup.parseEnumeratedAttributeBinding(node);
2760
+ const attrFactoryIds = (_b = (_a = HydrationMarkup.parseAttributeBinding(node)) !== null && _a !== void 0 ? _a : HydrationMarkup.parseEnumeratedAttributeBinding(node)) !== null && _b !== void 0 ? _b : HydrationMarkup.parseCompactAttributeBinding(node);
2719
2761
  if (attrFactoryIds !== null) {
2720
2762
  for (const id of attrFactoryIds) {
2721
2763
  if (!factories[id]) {
@@ -1,3 +1,3 @@
1
- void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const e=globalThis.FAST,t={1101:"Must call ArrayObserver.enable() before observing arrays.",1201:"The DOM Policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1206:"Calling html`` as a normal function invalidates the security guarantees provided by FAST.",1207:"The DOM Policy for an HTML template can only be set once.",1208:"The DOM Policy cannot be set after a template is compiled.",1209:"'${aspectName}' on '${tagName}' is blocked by the current DOMPolicy.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement."},s=/(\$\{\w+?})/g,i=/\$\{(\w+?)}/g,n=Object.freeze({});function r(e,t){return e.split(s).map((e=>{var s;const n=e.replace(i,"$1");return String(null!==(s=t[n])&&void 0!==s?s:e)})).join("")}let o;Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,s=n){var i;const o=null!==(i=t[e])&&void 0!==i?i:"Unknown Warning";console.warn(r(o,s))},error(e,s=n){var i;const o=null!==(i=t[e])&&void 0!==i?i:"Unknown Error";return new Error(r(o,s))}});const a="fast-kernel";try{if(document.currentScript)o=document.currentScript.getAttribute(a);else{const e=document.getElementsByTagName("script");o=e[e.length-1].getAttribute(a)}}catch(e){o="isolate"}let l;switch(o){case"share":l=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":l=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;l=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const c=e=>"function"==typeof e,d=e=>"string"==typeof e,h=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}(),"requestIdleCallback"in globalThis||(globalThis.requestIdleCallback=function(e,t){const s=Date.now();return setTimeout((()=>{e({didTimeout:!!(null==t?void 0:t.timeout)&&Date.now()-s>=t.timeout,timeRemaining:()=>0})}),1)},globalThis.cancelIdleCallback=function(e){clearTimeout(e)});const u={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},u));const f=globalThis.FAST;if(void 0===f.getById){const e=Object.create(null);Reflect.defineProperty(f,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},u))}void 0===f.error&&Object.assign(f,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const p=Object.freeze([]);function g(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function b(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function v(e){e.prototype.toJSON=h}const m=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),y=e=>e,w=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:y}):{createHTML:y};let C=Object.freeze({createHTML:e=>w.createHTML(e),protect:(e,t,s,i)=>i});const S=C,T=Object.freeze({get policy(){return C},setPolicy(e){if(C!==S)throw f.error(1201);C=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function $(e,t,s,i){return(e,t,s,...n)=>{d(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...n)}}function x(e,t,s,i){throw f.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const O={onabort:x,onauxclick:x,onbeforeinput:x,onbeforematch:x,onblur:x,oncancel:x,oncanplay:x,oncanplaythrough:x,onchange:x,onclick:x,onclose:x,oncontextlost:x,oncontextmenu:x,oncontextrestored:x,oncopy:x,oncuechange:x,oncut:x,ondblclick:x,ondrag:x,ondragend:x,ondragenter:x,ondragleave:x,ondragover:x,ondragstart:x,ondrop:x,ondurationchange:x,onemptied:x,onended:x,onerror:x,onfocus:x,onformdata:x,oninput:x,oninvalid:x,onkeydown:x,onkeypress:x,onkeyup:x,onload:x,onloadeddata:x,onloadedmetadata:x,onloadstart:x,onmousedown:x,onmouseenter:x,onmouseleave:x,onmousemove:x,onmouseout:x,onmouseover:x,onmouseup:x,onpaste:x,onpause:x,onplay:x,onplaying:x,onprogress:x,onratechange:x,onreset:x,onresize:x,onscroll:x,onsecuritypolicyviolation:x,onseeked:x,onseeking:x,onselect:x,onslotchange:x,onstalled:x,onsubmit:x,onsuspend:x,ontimeupdate:x,ontoggle:x,onvolumechange:x,onwaiting:x,onwebkitanimationend:x,onwebkitanimationiteration:x,onwebkitanimationstart:x,onwebkittransitionend:x,onwheel:x},B={elements:{a:{[m.attribute]:{href:$},[m.property]:{href:$}},area:{[m.attribute]:{href:$},[m.property]:{href:$}},button:{[m.attribute]:{formaction:$},[m.property]:{formAction:$}},embed:{[m.attribute]:{src:x},[m.property]:{src:x}},form:{[m.attribute]:{action:$},[m.property]:{action:$}},frame:{[m.attribute]:{src:$},[m.property]:{src:$}},iframe:{[m.attribute]:{src:$},[m.property]:{src:$,srcdoc:x}},input:{[m.attribute]:{formaction:$},[m.property]:{formAction:$}},link:{[m.attribute]:{href:x},[m.property]:{href:x}},object:{[m.attribute]:{codebase:x,data:x},[m.property]:{codeBase:x,data:x}},script:{[m.attribute]:{src:x,text:x},[m.property]:{src:x,text:x,innerText:x,textContent:x}},style:{[m.property]:{innerText:x,textContent:x}}},aspects:{[m.attribute]:Object.assign({},O),[m.property]:Object.assign({innerHTML:x},O),[m.event]:Object.assign({},O)}};function k(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=r;break;default:s[i]=n}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function N(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=k(r,{});break;default:s[i]=k(n,r)}}for(const t in e)t in s||(s[t]=k(e[t],{}));return Object.freeze(s)}function A(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=N(n,{});break;default:s[i]=N(n,r)}}for(const t in e)t in s||(s[t]=N(e[t],{}));return Object.freeze(s)}function E(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const M=Object.freeze({create(e={}){var t,s;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),n=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=B,Object.freeze({elements:r.elements?A(r.elements,o.elements):o.elements,aspects:r.aspects?N(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,s,i){var r;const o=(null!=e?e:"").toLowerCase(),a=n.elements[o];if(a){const n=E(a,e,t,s,i);if(n)return n}return null!==(r=E(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),j=f.getById(l.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>i=e})}));class I{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class R{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new I(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new I(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const V=Object.freeze({unknown:void 0,coupled:1}),_=f.getById(l.observable,(()=>{const e=j.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let i,n=e=>{throw f.error(1101)};function r(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=n(e):s.set(e,i=new R(e))),i}const o=b();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==i&&i.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const n=e[this.callback];c(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class l extends I{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==V.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.expression(e,t)}finally{i=s}return n}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return v(l),Object.freeze({setArrayObserverFactory(e){n=e},getNotifier:r,track(e,t){i&&i.watch(e,t)},trackVolatile(){i&&(i.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){d(t)&&(t=new a(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new l(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function z(e,t){_.defineProperty(e,t)}function L(e,t,s){return Object.assign({},s,{get(){return _.trackVolatile(),s.get.apply(this)}})}const F=f.getById(l.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),H=Object.freeze({default:{index:0,length:0,get event(){return H.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>F.get(),setEvent(e){F.set(e)}});class D{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class P{constructor(e){this.sorted=e}}const U=Object.freeze({reset:1,splice:2,optimized:3}),q=new D(0,p,0);q.reset=!0;const Q=[q];function W(e,t,s,i,n,r){let o=0,a=0;const l=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,l)),s===e.length&&r===i.length&&(a=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,l-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return p;if(t===s){const e=new D(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new D(t,[],s-t)];const c=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):l===o?(n.push(3),t--,i=o):(n.push(2),s--,i=a)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,a=s-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===i[n+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,d=l[s][r-1]+1,l[s][r]=c<d?c:d);return l}(e,t,s,i,n,r)),d=[];let h,u=t,f=n;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==h&&(d.push(h),h=void 0),u++,f++;break;case 1:void 0===h&&(h=new D(u,[],0)),h.addedCount++,u++,h.removed.push(i[f]),f++;break;case 2:void 0===h&&(h=new D(u,[],0)),h.addedCount++,u++;break;case 3:void 0===h&&(h=new D(u,[],0)),h.removed.push(i[f]),f++}return void 0!==h&&d.push(h),d}function X(e,t){let s=!1,i=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=i,s)continue;const d=(n=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<n?-1:r===o||a===n?0:n<o?r<a?r-o:a-o:a<r?a-n:r-n);if(d>=0){t.splice(l,1),l--,i-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const n=e.removed.length+c.removed.length-d;if(e.addedCount||n){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,a;s||t.push(e)}let J=Object.freeze({support:U.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?p:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)X(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(W(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):Q,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new D(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new D(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new P(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new D(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new P(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new D(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new D(0,[],i.length).adjustTo(e)),n}});const K=Object.freeze({reset:Q,setDefaultStrategy(e){J=e}});function G(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}class Y extends I{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,G(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,_.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,_.notify(e,"sorted"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:J).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,j.enqueue(this))}}let Z=!1;const ee=Object.freeze({sorted:0,enable(){if(Z)return;Z=!0,_.setArrayObserverFactory((e=>new Y(e)));const e=Array.prototype;e.$fastPatch||(G(e,"$fastPatch",1),G(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:J)[t.name](this,i,t,e)}})))}});function te(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ee.enable(),t=_.getNotifier(e)),_.track(t.lengthObserver,"length"),e.length}function se(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ee.enable(),t=_.getNotifier(e)),_.track(t.sortObserver,"sorted"),e.sorted}class ie{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class ne extends ie{createObserver(e){return _.binding(this.evaluate,e,this.isVolatile)}}function re(e,t,s=_.isVolatileBinding(e)){return new ne(e,t,s)}function oe(e,t){const s=new ne(e);return s.options=t,s}class ae extends ie{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function le(e,t){return new ae(e,t)}function ce(e){return c(e)?re(e):e instanceof ie?e:le((()=>e))}let de;function he(e){return e.map((e=>e instanceof ue?he(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}v(ae);class ue{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ue?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(de),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(he(this.styles)),this}static setDefaultStrategy(e){de=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ue(e):e instanceof ue?e:new ue([e])}}ue.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const fe=g(),pe=Object.freeze({getForInstance:fe.getForInstance,getByType:fe.getByType,define:e=>(fe.register({type:e}),e)});function ge(){return function(e){pe.define(e)}}function be(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class ve{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,i)=>{e.call(s,t,i),"style"===t&&s.$cssBindings.forEach(((e,t)=>be(t,e.controller,e.observer)))}}const i=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);i.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:i})}connectedCallback(e){be(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){be(this,t.controller,t)}}pe.define(ve);const me=`${Math.random().toString(36).substring(2,8)}`;let ye=0;const we=()=>`--v${me}${++ye}`;function Ce(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];c(o)?o=new ve(re(o),we()).createCSS(r):o instanceof ie?o=new ve(o,we()).createCSS(r):void 0!==pe.getForInstance(o)&&(o=o.createCSS(r)),o instanceof ue||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const Se=(e,...t)=>{const{styles:s,behaviors:i}=Ce(e,t),n=new ue(s);return i.length?n.withBehaviors(...i):n};class Te{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(d(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new ue(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}pe.define(Te),Se.partial=(e,...t)=>{const{styles:s,behaviors:i}=Ce(e,t);return new Te(s,i)};const $e=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,xe=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,Oe=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Be=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,ke=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,Ne=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Ae(e){return e&&e.nodeType===Node.COMMENT_NODE}const Ee=Object.freeze({attributeMarkerName:"data-fe-b",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>$e.test(e),isContentBindingEndMarker:e=>xe.test(e),isRepeatViewStartMarker:e=>Oe.test(e),isRepeatViewEndMarker:e=>Be.test(e),isElementBoundaryStartMarker:e=>Ae(e)&&ke.test(e.data.trim()),isElementBoundaryEndMarker:e=>Ae(e)&&Ne.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[],s=this.attributeMarkerName.length+1,i=`${this.attributeMarkerName}-`;for(const n of e.getAttributeNames())if(n.startsWith(i)){const e=Number(n.slice(s));if(Number.isNaN(e))throw new Error(`Invalid attribute marker name: ${n}. Expected format is ${i}<number>.`);t.push(e)}return 0===t.length?null:t},parseContentBindingStartMarker:e=>Ie($e,e),parseContentBindingEndMarker:e=>Ie(xe,e),parseRepeatStartMarker:e=>Me(Oe,e),parseRepeatEndMarker:e=>Me(Be,e),parseElementBoundaryStartMarker:e=>je(ke,e.trim()),parseElementBoundaryEndMarker:e=>je(Ne,e)});function Me(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function je(e,t){const s=e.exec(t);return null===s?s:s[1]}function Ie(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const Re=Symbol.for("fe-hydration");function Ve(e){return e[Re]===Re}const _e="defer-hydration",ze=`fast-${Math.random().toString(36).substring(2,8)}`,Le=`${ze}{`,Fe=`}${ze}`,He=Fe.length;let De=0;const Pe=()=>`${ze}-${++De}`,Ue=Object.freeze({interpolation:e=>`${Le}${e}${Fe}`,attribute:e=>`${Pe()}="${Le}${e}${Fe}"`,comment:e=>`\x3c!--${Le}${e}${Fe}--\x3e`}),qe=Object.freeze({parse(e,t){const s=e.split(Le);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(Fe);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+He)}""!==o&&i.push(o)}return i}}),Qe=g(),We=Object.freeze({getForInstance:Qe.getForInstance,getByType:Qe.getByType,define:(e,t)=>((t=t||{}).type=e,Qe.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?m.tokenList:m.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=m.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=m.event;break;default:e.targetAspect=t,e.aspectType=m.attribute}else e.aspectType=m.content}});function Xe(e){return function(t){We.define(t,e)}}class Je{constructor(e){this.options=e}createHTML(e){return Ue.attribute(e(this))}createBehavior(){return this}}v(Je);class Ke extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ge(e){return e.nodeType===Node.COMMENT_NODE}function Ye(e){return e.nodeType===Node.TEXT_NODE}function Ze(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ge(t)||Ye(t)?t.data.length:t.childNodes.length),s}function et(e,t,s){var i;const n=null!==(i=Ee.parseAttributeBinding(e))&&void 0!==i?i:Ee.parseEnumeratedAttributeBinding(e);if(null!==n){for(const i of n){if(!t[i])throw new Ke(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);st(t[i],e,s)}e.removeAttribute(Ee.attributeMarkerName)}}function tt(e,t,s,i,n){if(Ee.isElementBoundaryStartMarker(e))!function(e,t){const s=Ee.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(Ge(i)){const e=Ee.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(Ee.isContentBindingStartMarker(e.data)){const r=Ee.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],c=[];let d=t.nextSibling();e.data="";const h=d;for(;null!==d;){if(Ge(d)){const e=Ee.parseContentBindingEndMarker(d.data);if(e&&e[1]===a)break}c.push(d),d=t.nextSibling()}if(null===d){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(d.data="",1===c.length&&Ye(c[0]))st(l,c[0],i);else{d!==h&&null!==d.previousSibling&&(n[l.targetNodeId]={first:h,last:d.previousSibling});st(l,d.parentNode.insertBefore(document.createTextNode(""),d),i)}}}function st(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var it;function nt(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;){if(i=n.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(n),n=i}s.removeChild(t)}class rt{constructor(){this.index=0,this.length=0}get event(){return H.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class ot extends rt{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=V.unknown,this.context=this,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 i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){nt(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){nt(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}v(ot),_.defineProperty(ot.prototype,"index"),_.defineProperty(ot.prototype,"length");const at="unhydrated",lt="hydrating",ct="hydrated";class dt extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}it=Re,v(class extends rt{constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[it]=Re,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=V.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=at,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}insertBefore(e){if(null!==this.fragment)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 i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,i=this.firstChild;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=s}e.appendChild(t)}bind(e,t=this){var s;if(this.hydrationStage!==ct&&(this._hydrationStage=lt),this.source===e)return;let i=this.behaviors;if(null===i){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=Ze(e,t),n=i.commonAncestorContainer,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===i.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={};let l=r.currentNode=e;for(;null!==l;){switch(l.nodeType){case Node.ELEMENT_NODE:et(l,s,o);break;case Node.COMMENT_NODE:tt(l,r,s,o,a)}l=r.nextNode()}return i.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof Ke){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=i=new Array(this.factories.length);const n=this.factories;for(let e=0,t=n.length;e<t;++e){const t=n[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&st(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host,n=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==i?void 0:i.nodeName)||"unknown").toLowerCase()}>".`,"\nMismatch Details:",` - Expected target node ID: "${t.targetNodeId}"`,` - Available target IDs: [${Object.keys(this.targets).join(", ")||"none"}]`];throw t.targetTagName&&r.push(` - Expected tag name: "${t.targetTagName}"`),n.sourceAspect&&r.push(` - Source aspect: "${n.sourceAspect}"`),void 0!==n.aspectType&&r.push(` - Aspect type: ${n.aspectType}`),r.push("\nThis usually means:"," 1. The server-rendered HTML doesn't match the client template"," 2. The hydration markers are missing or corrupted"," 3. The DOM structure was modified before hydration",`\nTemplate: ${e.slice(0,200)}${e.length>200?"...":""}`),new dt(r.join("\n"),t,Ze(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),i[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=i.length;e<t;++e)i[e].bind(this)}this.isBound=!0,this._hydrationStage=ct}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){nt(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}});const ht={[m.attribute]:T.setAttribute,[m.booleanAttribute]:T.setBooleanAttribute,[m.property]:(e,t,s)=>e[t]=s,[m.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Ve(i)&&Ve(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==ct){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[m.tokenList]:function(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[m.event]:()=>{}};class ut{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=m.content}createHTML(e){return Ue.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=ht[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw f.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],i=Ve(e)&&e.hydrationStage&&e.hydrationStage!==ct;switch(this.aspectType){case m.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case m.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(n.target=s,n.controller=e,i&&(this.aspectType===m.attribute||this.aspectType===m.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){H.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);H.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}We.define(ut,{aspected:!0});const ft=(e,t)=>`${e}.${t}`,pt={},gt={index:0,node:null};function bt(e){e.startsWith("fast-")||f.warn(1204,{name:e})}const vt=new Proxy(document.createElement("div"),{get(e,t){bt(t);const s=Reflect.get(e,t);return c(s)?s.bind(e):s},set:(e,t,s)=>(bt(t),Reflect.set(e,t,s))});class mt{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i,n){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.id=null!==(r=e.id)&&void 0!==r?r:Pe(),e.targetNodeId=s,e.targetTagName=n,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=pt[t];if(!n){const i=`_${t}`;pt[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:vt;for(const e of this.nodeIds)s[e];return new ot(t,this.factories,s)}}function yt(e,t,s,i,n,r=!1){const o=s.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=qe.parse(h,a);let f=null;null===u?r&&(f=new ut(le((()=>h),e.policy)),We.assignAspect(f,d.name)):f=Tt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,i,n,s.tagName))}}function wt(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=Ct(e,s,n,i);n=t.node,i=t.index}}function Ct(e,t,s,i){const n=ft(t,i);switch(s.nodeType){case 1:yt(e,t,s,n,i),wt(e,s,n);break;case 3:return function(e,t,s,i,n){const r=qe.parse(t.textContent,e.directives);if(null===r)return gt.node=t.nextSibling,gt.index=n+1,gt;let o,a=o=t;for(let t=0,l=r.length;t<l;++t){const l=r[t];0!==t&&(n++,i=ft(s,n),o=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),d(l)?o.textContent=l:(o.textContent=" ",We.assignAspect(l),e.addFactory(l,s,i,n,null)),a=o}return gt.index=n+1,gt.node=a.nextSibling,gt}(e,s,t,n,i);case 8:const r=qe.parse(s.data,e.directives);null!==r&&e.addFactory(Tt.aggregate(r),t,n,i,null)}return gt.index=i+1,gt.node=s.nextSibling,gt}const St="TEMPLATE",Tt={compile(e,t,s=T.policy){let i;if(d(e)){i=document.createElement(St),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===St&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const n=document.adoptNode(i.content),r=new mt(n,t,s);var o,a;return yt(r,"",i,"h",0,!0),o=n.firstChild,a=t,(o&&8==o.nodeType&&null!==qe.parse(o.data,a)||1===n.childNodes.length&&Object.keys(t).length>0)&&n.insertBefore(document.createComment(""),n.firstChild),wt(r,n,"r"),gt.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=T.policy){if(1===e.length)return e[0];let s,i,n=!1;const r=e.length,o=e.map((e=>d(e)?()=>e:(s=e.sourceAspect||s,n=n||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),a=new ut(re(((e,t)=>{let s="";for(let i=0;i<r;++i)s+=o[i](e,t);return s}),null!=i?i:t,n));return We.assignAspect(a,s),a}},$t=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,xt=Object.create(null);class Ot{constructor(e,t=xt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Bt(e,t,s,i=We.getForInstance(e)){if(i.aspected){const s=$t.exec(t);null!==s&&We.assignAspect(e,s[2])}return e.createHTML(s)}Ot.empty=new Ot(""),We.define(Ot);class kt{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=Tt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new Ot(d(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw f.error(1208);if(this.policy)throw f.error(1207);return this.policy=e,this}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}static create(e,t,s){let i="";const n=Object.create(null),r=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Pe();return n[s]=e,s};for(let s=0,n=e.length-1;s<n;++s){const n=e[s];let o,a=t[s];if(i+=n,c(a))a=new ut(re(a));else if(a instanceof ie)a=new ut(a);else if(!(o=We.getForInstance(a))){const e=a;a=new ut(le((()=>e)))}i+=Bt(a,n,r,o)}return new kt(i+e[e.length-1],n,s)}}v(kt);const Nt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return kt.create(e,t);throw f.error(1206)};Nt.partial=e=>new Ot(e);class At extends Je{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}We.define(At);const Et=e=>new At(e),Mt=()=>null;function jt(e){return void 0===e?Mt:c(e)?e:()=>e}function It(e,t,s){const i=c(e)?e:()=>e,n=jt(t),r=jt(s);return(e,t)=>i(e,t)?n(e,t):r(e,t)}const Rt=Object.freeze({positioning:!1,recycle:!0});function Vt(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function _t(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function zt(e){return e.nodeType===Node.COMMENT_NODE}class Lt extends Error{constructor(e,t){super(e),this.propertyBag=t}}class Ft{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=Vt,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=_t)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Ve(this.template)&&Ve(e)&&e.hydrationStage!==ct?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=p);const t=this.itemsObserver,s=this.itemsObserver=_.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,i=e.length;s<i;++s){const i=e[s].sorted.slice(),n=i.slice().sort();for(let e=0,s=i.length;e<s;++e){const s=i.find((t=>i[e]===n[t]));if(s!==e){const i=n.splice(s,1);n.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let f=0,p=h.index;const g=p+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;p<g;++p){const e=t[p],d=e?e.firstChild:this.location;let h;o&&c>0?(f<=v&&b.length>0?(h=b[f],f++):(h=a[l],l++),c--):h=n.create(),t.splice(p,0,h),s(h,i,p,r),h.insertBefore(d)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(ot.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),a[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<l){const i=a[e];if(!i){const t=new XMLSerializer;throw new Lt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}n(i,t,e,r)}else{const o=s.create();n(o,t,e,r),a.push(o),o.insertBefore(i)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new Lt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:s.serializeToString(this.location.getRootNode())})}s.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!zt(t)){t=t.previousSibling;continue}const s=Ee.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const i=t.previousSibling;if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=i,r=0;for(;null!==n;){if(zt(n))if(Ee.isRepeatViewEndMarker(n.data))r++;else if(Ee.isRepeatViewStartMarker(n.data)){if(!r){if(Ee.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const r=e.hydrate(n,i);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class Ht{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,ee.enable()}createHTML(e){return Ue.comment(e(this))}createBehavior(){return new Ft(this)}}function Dt(e,t,s=Rt){const i=ce(e),n=ce(t);return new Ht(i,n,Object.assign(Object.assign({},Rt),s))}We.define(Ht);const Pt=e=>1===e.nodeType,Ut=e=>e?t=>1===t.nodeType&&t.matches(e):Pt;class qt extends Je{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,p),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const Qt="slotchange";class Wt extends qt{observe(e){e.addEventListener(Qt,this)}disconnect(e){e.removeEventListener(Qt,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Xt(e){return d(e)&&(e={property:e}),new Wt(e)}We.define(Wt);class Jt extends qt{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=h,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Kt(e){return d(e)&&(e={property:e}),new Jt(e)}function Gt(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))}We.define(Jt),"function"==typeof SuppressedError&&SuppressedError;const Yt="boolean",Zt="reflect",es=Object.freeze({locate:b()}),ts={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},ss={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:ts.fromView(e)};function is(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const ns={toView(e){const t=is(e);return t?t.toString():t},fromView:is};class rs{constructor(e,t,s=t.toLowerCase(),i=Zt,n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i===Yt&&void 0===n&&(this.converter=ts)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return _.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||j.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case Zt:const t=this.converter;T.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case Yt:T.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(es.locate(e));for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];d(i)?s.push(new rs(e,i)):s.push(new rs(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function os(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),es.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const as={mode:"open"},ls={},cs=new Set,ds=f.getById(l.elementRegistry,(()=>g())),hs={deferAndHydrate:"defer-and-hydrate"};class us{constructor(e,t=e.definition){var s;this.platformDefined=!1,d(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.templateOptions=t.templateOptions,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=rs.collect(e,t.attributes),r=new Array(n.length),o={},a={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,a[t.attribute]=t,_.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?as:null===t.shadowOptions?void 0:Object.assign(Object.assign({},as),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?ls:Object.assign(Object.assign({},ls),t.elementOptions),this.styles=ue.normalize(t.styles),ds.register(this),_.defineProperty(us.isRegistered,this.name),us.isRegistered[this.name]=this.type}get isDefined(){return this.platformDefined}define(e=this.registry){var t,s;const i=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,i,this.elementOptions),null===(s=null===(t=this.lifecycleCallbacks)||void 0===t?void 0:t.elementDidDefine)||void 0===s||s.call(t,this.name)),this}static compose(e,t){return cs.has(e)||ds.getByType(e)?new us(class extends e{},t):new us(e,t)}static registerBaseType(e){cs.add(e)}static composeAsync(e,t){return new Promise((s=>{(cs.has(e)||ds.getByType(e))&&s(new us(class extends e{},t));const i=new us(e,t);_.getNotifier(i).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=i.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,i.name),s(i)}},"template")}))}}us.isRegistered={},us.getByType=ds.getByType,us.getForInstance=ds.getForInstance,us.registerAsync=e=>Gt(void 0,void 0,void 0,(function*(){return new Promise((t=>{us.isRegistered[e]&&t(us.isRegistered[e]),_.getNotifier(us.isRegistered).subscribe({handleChange:()=>t(us.isRegistered[e])},e)}))})),_.defineProperty(us.prototype,"template");class fs{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Ve(this.template)&&Ve(e)&&e.hydrationStage!==ct&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class ps{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Ue.comment(e(this))}createBehavior(){return new fs(this)}}We.define(ps);const gs=new Map,bs={":model":e=>e},vs=Symbol("RenderInstruction"),ms="default-view",ys=Nt`
1
+ void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const e=globalThis.FAST,t={1101:"Must call ArrayObserver.enable() before observing arrays.",1201:"The DOM Policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1206:"Calling html`` as a normal function invalidates the security guarantees provided by FAST.",1207:"The DOM Policy for an HTML template can only be set once.",1208:"The DOM Policy cannot be set after a template is compiled.",1209:"'${aspectName}' on '${tagName}' is blocked by the current DOMPolicy.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement.",1601:"Invalid attribute marker name: ${name}. Expected format is ${expectedFormat}.",1602:"Invalid compact attribute marker values in ${markerName}. Both index and count must be positive integers.",1604:"Invalid compact attribute marker name: ${name}. Expected format is ${expectedFormat}."},s=/(\$\{\w+?})/g,i=/\$\{(\w+?)}/g,n=Object.freeze({});function r(e,t){return e.split(s).map((e=>{var s;const n=e.replace(i,"$1");return String(null!==(s=t[n])&&void 0!==s?s:e)})).join("")}let o;Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,s=n){var i;const o=null!==(i=t[e])&&void 0!==i?i:"Unknown Warning";console.warn(r(o,s))},error(e,s=n){var i;const o=null!==(i=t[e])&&void 0!==i?i:"Unknown Error";return new Error(r(o,s))}});const a="fast-kernel";try{if(document.currentScript)o=document.currentScript.getAttribute(a);else{const e=document.getElementsByTagName("script");o=e[e.length-1].getAttribute(a)}}catch(e){o="isolate"}let l;switch(o){case"share":l=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":l=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;l=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const c=e=>"function"==typeof e,d=e=>"string"==typeof e,h=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}(),"requestIdleCallback"in globalThis||(globalThis.requestIdleCallback=function(e,t){const s=Date.now();return setTimeout((()=>{e({didTimeout:!!(null==t?void 0:t.timeout)&&Date.now()-s>=t.timeout,timeRemaining:()=>0})}),1)},globalThis.cancelIdleCallback=function(e){clearTimeout(e)});const u={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},u));const f=globalThis.FAST;if(void 0===f.getById){const e=Object.create(null);Reflect.defineProperty(f,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},u))}void 0===f.error&&Object.assign(f,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const p=Object.freeze([]);function g(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function b(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function v(e){e.prototype.toJSON=h}const m=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),y=e=>e,w=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:y}):{createHTML:y};let C=Object.freeze({createHTML:e=>w.createHTML(e),protect:(e,t,s,i)=>i});const S=C,T=Object.freeze({get policy(){return C},setPolicy(e){if(C!==S)throw f.error(1201);C=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function $(e,t,s,i){return(e,t,s,...n)=>{d(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...n)}}function x(e,t,s,i){throw f.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const O={onabort:x,onauxclick:x,onbeforeinput:x,onbeforematch:x,onblur:x,oncancel:x,oncanplay:x,oncanplaythrough:x,onchange:x,onclick:x,onclose:x,oncontextlost:x,oncontextmenu:x,oncontextrestored:x,oncopy:x,oncuechange:x,oncut:x,ondblclick:x,ondrag:x,ondragend:x,ondragenter:x,ondragleave:x,ondragover:x,ondragstart:x,ondrop:x,ondurationchange:x,onemptied:x,onended:x,onerror:x,onfocus:x,onformdata:x,oninput:x,oninvalid:x,onkeydown:x,onkeypress:x,onkeyup:x,onload:x,onloadeddata:x,onloadedmetadata:x,onloadstart:x,onmousedown:x,onmouseenter:x,onmouseleave:x,onmousemove:x,onmouseout:x,onmouseover:x,onmouseup:x,onpaste:x,onpause:x,onplay:x,onplaying:x,onprogress:x,onratechange:x,onreset:x,onresize:x,onscroll:x,onsecuritypolicyviolation:x,onseeked:x,onseeking:x,onselect:x,onslotchange:x,onstalled:x,onsubmit:x,onsuspend:x,ontimeupdate:x,ontoggle:x,onvolumechange:x,onwaiting:x,onwebkitanimationend:x,onwebkitanimationiteration:x,onwebkitanimationstart:x,onwebkittransitionend:x,onwheel:x},B={elements:{a:{[m.attribute]:{href:$},[m.property]:{href:$}},area:{[m.attribute]:{href:$},[m.property]:{href:$}},button:{[m.attribute]:{formaction:$},[m.property]:{formAction:$}},embed:{[m.attribute]:{src:x},[m.property]:{src:x}},form:{[m.attribute]:{action:$},[m.property]:{action:$}},frame:{[m.attribute]:{src:$},[m.property]:{src:$}},iframe:{[m.attribute]:{src:$},[m.property]:{src:$,srcdoc:x}},input:{[m.attribute]:{formaction:$},[m.property]:{formAction:$}},link:{[m.attribute]:{href:x},[m.property]:{href:x}},object:{[m.attribute]:{codebase:x,data:x},[m.property]:{codeBase:x,data:x}},script:{[m.attribute]:{src:x,text:x},[m.property]:{src:x,text:x,innerText:x,textContent:x}},style:{[m.property]:{innerText:x,textContent:x}}},aspects:{[m.attribute]:Object.assign({},O),[m.property]:Object.assign({innerHTML:x},O),[m.event]:Object.assign({},O)}};function N(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=r;break;default:s[i]=n}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function k(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=N(r,{});break;default:s[i]=N(n,r)}}for(const t in e)t in s||(s[t]=N(e[t],{}));return Object.freeze(s)}function A(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=k(n,{});break;default:s[i]=k(n,r)}}for(const t in e)t in s||(s[t]=k(e[t],{}));return Object.freeze(s)}function E(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const M=Object.freeze({create(e={}){var t,s;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),n=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=B,Object.freeze({elements:r.elements?A(r.elements,o.elements):o.elements,aspects:r.aspects?k(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,s,i){var r;const o=(null!=e?e:"").toLowerCase(),a=n.elements[o];if(a){const n=E(a,e,t,s,i);if(n)return n}return null!==(r=E(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),I=f.getById(l.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>i=e})}));class j{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class R{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new j(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new j(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const V=Object.freeze({unknown:void 0,coupled:1}),_=f.getById(l.observable,(()=>{const e=I.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let i,n=e=>{throw f.error(1101)};function r(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=n(e):s.set(e,i=new R(e))),i}const o=b();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==i&&i.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const n=e[this.callback];c(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class l extends j{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==V.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.expression(e,t)}finally{i=s}return n}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return v(l),Object.freeze({setArrayObserverFactory(e){n=e},getNotifier:r,track(e,t){i&&i.watch(e,t)},trackVolatile(){i&&(i.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){d(t)&&(t=new a(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new l(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function z(e,t){_.defineProperty(e,t)}function L(e,t,s){return Object.assign({},s,{get(){return _.trackVolatile(),s.get.apply(this)}})}const F=f.getById(l.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),H=Object.freeze({default:{index:0,length:0,get event(){return H.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>F.get(),setEvent(e){F.set(e)}});class D{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class P{constructor(e){this.sorted=e}}const U=Object.freeze({reset:1,splice:2,optimized:3}),q=new D(0,p,0);q.reset=!0;const Q=[q];function W(e,t,s,i,n,r){let o=0,a=0;const l=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,l)),s===e.length&&r===i.length&&(a=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,l-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return p;if(t===s){const e=new D(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new D(t,[],s-t)];const c=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):l===o?(n.push(3),t--,i=o):(n.push(2),s--,i=a)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,a=s-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===i[n+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,d=l[s][r-1]+1,l[s][r]=c<d?c:d);return l}(e,t,s,i,n,r)),d=[];let h,u=t,f=n;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==h&&(d.push(h),h=void 0),u++,f++;break;case 1:void 0===h&&(h=new D(u,[],0)),h.addedCount++,u++,h.removed.push(i[f]),f++;break;case 2:void 0===h&&(h=new D(u,[],0)),h.addedCount++,u++;break;case 3:void 0===h&&(h=new D(u,[],0)),h.removed.push(i[f]),f++}return void 0!==h&&d.push(h),d}function X(e,t){let s=!1,i=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=i,s)continue;const d=(n=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<n?-1:r===o||a===n?0:n<o?r<a?r-o:a-o:a<r?a-n:r-n);if(d>=0){t.splice(l,1),l--,i-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const n=e.removed.length+c.removed.length-d;if(e.addedCount||n){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,a;s||t.push(e)}let J=Object.freeze({support:U.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?p:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)X(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(W(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):Q,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new D(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new D(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new P(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new D(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new P(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new D(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new D(0,[],i.length).adjustTo(e)),n}});const K=Object.freeze({reset:Q,setDefaultStrategy(e){J=e}});function G(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}class Y extends j{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,G(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,_.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,_.notify(e,"sorted"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:J).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,I.enqueue(this))}}let Z=!1;const ee=Object.freeze({sorted:0,enable(){if(Z)return;Z=!0,_.setArrayObserverFactory((e=>new Y(e)));const e=Array.prototype;e.$fastPatch||(G(e,"$fastPatch",1),G(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:J)[t.name](this,i,t,e)}})))}});function te(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ee.enable(),t=_.getNotifier(e)),_.track(t.lengthObserver,"length"),e.length}function se(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ee.enable(),t=_.getNotifier(e)),_.track(t.sortObserver,"sorted"),e.sorted}class ie{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class ne extends ie{createObserver(e){return _.binding(this.evaluate,e,this.isVolatile)}}function re(e,t,s=_.isVolatileBinding(e)){return new ne(e,t,s)}function oe(e,t){const s=new ne(e);return s.options=t,s}class ae extends ie{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function le(e,t){return new ae(e,t)}function ce(e){return c(e)?re(e):e instanceof ie?e:le((()=>e))}let de;function he(e){return e.map((e=>e instanceof ue?he(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}v(ae);class ue{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ue?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(de),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(he(this.styles)),this}static setDefaultStrategy(e){de=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ue(e):e instanceof ue?e:new ue([e])}}ue.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const fe=g(),pe=Object.freeze({getForInstance:fe.getForInstance,getByType:fe.getByType,define:e=>(fe.register({type:e}),e)});function ge(){return function(e){pe.define(e)}}function be(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class ve{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,i)=>{e.call(s,t,i),"style"===t&&s.$cssBindings.forEach(((e,t)=>be(t,e.controller,e.observer)))}}const i=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);i.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:i})}connectedCallback(e){be(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){be(this,t.controller,t)}}pe.define(ve);const me=`${Math.random().toString(36).substring(2,8)}`;let ye=0;const we=()=>`--v${me}${++ye}`;function Ce(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];c(o)?o=new ve(re(o),we()).createCSS(r):o instanceof ie?o=new ve(o,we()).createCSS(r):void 0!==pe.getForInstance(o)&&(o=o.createCSS(r)),o instanceof ue||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const Se=(e,...t)=>{const{styles:s,behaviors:i}=Ce(e,t),n=new ue(s);return i.length?n.withBehaviors(...i):n};class Te{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(d(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new ue(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}pe.define(Te),Se.partial=(e,...t)=>{const{styles:s,behaviors:i}=Ce(e,t);return new Te(s,i)};const $e=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,xe=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,Oe=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Be=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Ne=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,ke=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Ae(e){return e&&e.nodeType===Node.COMMENT_NODE}const Ee=Object.freeze({attributeMarkerName:"data-fe-b",compactAttributeMarkerName:"data-fe-c",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>$e.test(e),isContentBindingEndMarker:e=>xe.test(e),isRepeatViewStartMarker:e=>Oe.test(e),isRepeatViewEndMarker:e=>Be.test(e),isElementBoundaryStartMarker:e=>Ae(e)&&Ne.test(e.data.trim()),isElementBoundaryEndMarker:e=>Ae(e)&&ke.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[],s=this.attributeMarkerName.length+1,i=`${this.attributeMarkerName}-`;for(const n of e.getAttributeNames())if(n.startsWith(i)){const e=Number(n.slice(s));if(Number.isNaN(e))throw f.error(1601,{name:n,expectedFormat:`${i}<number>`});t.push(e)}return 0===t.length?null:t},parseCompactAttributeBinding(e){const t=`${this.compactAttributeMarkerName}-`,s=e.getAttributeNames().find((e=>e.startsWith(t)));if(!s)return null;const i=s.slice(t.length).split("-"),n=parseInt(i[0],10),r=parseInt(i[1],10);if(2!==i.length||Number.isNaN(n)||Number.isNaN(r)||n<0||r<1)throw f.error(1604,{name:s,expectedFormat:`${this.compactAttributeMarkerName}-{index}-{count}`});const o=[];for(let e=0;e<r;e++)o.push(n+e);return o},parseContentBindingStartMarker:e=>je($e,e),parseContentBindingEndMarker:e=>je(xe,e),parseRepeatStartMarker:e=>Me(Oe,e),parseRepeatEndMarker:e=>Me(Be,e),parseElementBoundaryStartMarker:e=>Ie(Ne,e.trim()),parseElementBoundaryEndMarker:e=>Ie(ke,e)});function Me(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Ie(e,t){const s=e.exec(t);return null===s?s:s[1]}function je(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const Re=Symbol.for("fe-hydration");function Ve(e){return e[Re]===Re}const _e="defer-hydration",ze=`fast-${Math.random().toString(36).substring(2,8)}`,Le=`${ze}{`,Fe=`}${ze}`,He=Fe.length;let De=0;const Pe=()=>`${ze}-${++De}`,Ue=Object.freeze({interpolation:e=>`${Le}${e}${Fe}`,attribute:e=>`${Pe()}="${Le}${e}${Fe}"`,comment:e=>`\x3c!--${Le}${e}${Fe}--\x3e`}),qe=Object.freeze({parse(e,t){const s=e.split(Le);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(Fe);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+He)}""!==o&&i.push(o)}return i}}),Qe=g(),We=Object.freeze({getForInstance:Qe.getForInstance,getByType:Qe.getByType,define:(e,t)=>((t=t||{}).type=e,Qe.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?m.tokenList:m.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=m.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=m.event;break;default:e.targetAspect=t,e.aspectType=m.attribute}else e.aspectType=m.content}});function Xe(e){return function(t){We.define(t,e)}}class Je{constructor(e){this.options=e}createHTML(e){return Ue.attribute(e(this))}createBehavior(){return this}}v(Je);class Ke extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ge(e){return e.nodeType===Node.COMMENT_NODE}function Ye(e){return e.nodeType===Node.TEXT_NODE}function Ze(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ge(t)||Ye(t)?t.data.length:t.childNodes.length),s}function et(e,t,s){var i,n;const r=null!==(n=null!==(i=Ee.parseAttributeBinding(e))&&void 0!==i?i:Ee.parseEnumeratedAttributeBinding(e))&&void 0!==n?n:Ee.parseCompactAttributeBinding(e);if(null!==r){for(const i of r){if(!t[i])throw new Ke(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);st(t[i],e,s)}e.removeAttribute(Ee.attributeMarkerName)}}function tt(e,t,s,i,n){if(Ee.isElementBoundaryStartMarker(e))!function(e,t){const s=Ee.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(Ge(i)){const e=Ee.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(Ee.isContentBindingStartMarker(e.data)){const r=Ee.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],c=[];let d=t.nextSibling();e.data="";const h=d;for(;null!==d;){if(Ge(d)){const e=Ee.parseContentBindingEndMarker(d.data);if(e&&e[1]===a)break}c.push(d),d=t.nextSibling()}if(null===d){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(d.data="",1===c.length&&Ye(c[0]))st(l,c[0],i);else{d!==h&&null!==d.previousSibling&&(n[l.targetNodeId]={first:h,last:d.previousSibling});st(l,d.parentNode.insertBefore(document.createTextNode(""),d),i)}}}function st(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var it;function nt(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;){if(i=n.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(n),n=i}s.removeChild(t)}class rt{constructor(){this.index=0,this.length=0}get event(){return H.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class ot extends rt{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=V.unknown,this.context=this,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 i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){nt(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){nt(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}v(ot),_.defineProperty(ot.prototype,"index"),_.defineProperty(ot.prototype,"length");const at="unhydrated",lt="hydrating",ct="hydrated";class dt extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}it=Re,v(class extends rt{constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[it]=Re,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=V.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=at,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}insertBefore(e){if(null!==this.fragment)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 i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,i=this.firstChild;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=s}e.appendChild(t)}bind(e,t=this){var s;if(this.hydrationStage!==ct&&(this._hydrationStage=lt),this.source===e)return;let i=this.behaviors;if(null===i){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=Ze(e,t),n=i.commonAncestorContainer,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===i.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={};let l=r.currentNode=e;for(;null!==l;){switch(l.nodeType){case Node.ELEMENT_NODE:et(l,s,o);break;case Node.COMMENT_NODE:tt(l,r,s,o,a)}l=r.nextNode()}return i.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof Ke){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=i=new Array(this.factories.length);const n=this.factories;for(let e=0,t=n.length;e<t;++e){const t=n[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&st(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host,n=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==i?void 0:i.nodeName)||"unknown").toLowerCase()}>".`,"\nMismatch Details:",` - Expected target node ID: "${t.targetNodeId}"`,` - Available target IDs: [${Object.keys(this.targets).join(", ")||"none"}]`];throw t.targetTagName&&r.push(` - Expected tag name: "${t.targetTagName}"`),n.sourceAspect&&r.push(` - Source aspect: "${n.sourceAspect}"`),void 0!==n.aspectType&&r.push(` - Aspect type: ${n.aspectType}`),r.push("\nThis usually means:"," 1. The server-rendered HTML doesn't match the client template"," 2. The hydration markers are missing or corrupted"," 3. The DOM structure was modified before hydration",`\nTemplate: ${e.slice(0,200)}${e.length>200?"...":""}`),new dt(r.join("\n"),t,Ze(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),i[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=i.length;e<t;++e)i[e].bind(this)}this.isBound=!0,this._hydrationStage=ct}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){nt(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}});const ht={[m.attribute]:T.setAttribute,[m.booleanAttribute]:T.setBooleanAttribute,[m.property]:(e,t,s)=>e[t]=s,[m.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Ve(i)&&Ve(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==ct){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[m.tokenList]:function(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[m.event]:()=>{}};class ut{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=m.content}createHTML(e){return Ue.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=ht[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw f.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],i=Ve(e)&&e.hydrationStage&&e.hydrationStage!==ct;switch(this.aspectType){case m.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case m.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(n.target=s,n.controller=e,i&&(this.aspectType===m.attribute||this.aspectType===m.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){H.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);H.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}We.define(ut,{aspected:!0});const ft=(e,t)=>`${e}.${t}`,pt={},gt={index:0,node:null};function bt(e){e.startsWith("fast-")||f.warn(1204,{name:e})}const vt=new Proxy(document.createElement("div"),{get(e,t){bt(t);const s=Reflect.get(e,t);return c(s)?s.bind(e):s},set:(e,t,s)=>(bt(t),Reflect.set(e,t,s))});class mt{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i,n){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.id=null!==(r=e.id)&&void 0!==r?r:Pe(),e.targetNodeId=s,e.targetTagName=n,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=pt[t];if(!n){const i=`_${t}`;pt[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:vt;for(const e of this.nodeIds)s[e];return new ot(t,this.factories,s)}}function yt(e,t,s,i,n,r=!1){const o=s.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=qe.parse(h,a);let f=null;null===u?r&&(f=new ut(le((()=>h),e.policy)),We.assignAspect(f,d.name)):f=Tt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,i,n,s.tagName))}}function wt(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=Ct(e,s,n,i);n=t.node,i=t.index}}function Ct(e,t,s,i){const n=ft(t,i);switch(s.nodeType){case 1:yt(e,t,s,n,i),wt(e,s,n);break;case 3:return function(e,t,s,i,n){const r=qe.parse(t.textContent,e.directives);if(null===r)return gt.node=t.nextSibling,gt.index=n+1,gt;let o,a=o=t;for(let t=0,l=r.length;t<l;++t){const l=r[t];0!==t&&(n++,i=ft(s,n),o=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),d(l)?o.textContent=l:(o.textContent=" ",We.assignAspect(l),e.addFactory(l,s,i,n,null)),a=o}return gt.index=n+1,gt.node=a.nextSibling,gt}(e,s,t,n,i);case 8:const r=qe.parse(s.data,e.directives);null!==r&&e.addFactory(Tt.aggregate(r),t,n,i,null)}return gt.index=i+1,gt.node=s.nextSibling,gt}const St="TEMPLATE",Tt={compile(e,t,s=T.policy){let i;if(d(e)){i=document.createElement(St),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===St&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const n=document.adoptNode(i.content),r=new mt(n,t,s);var o,a;return yt(r,"",i,"h",0,!0),o=n.firstChild,a=t,(o&&8==o.nodeType&&null!==qe.parse(o.data,a)||1===n.childNodes.length&&Object.keys(t).length>0)&&n.insertBefore(document.createComment(""),n.firstChild),wt(r,n,"r"),gt.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=T.policy){if(1===e.length)return e[0];let s,i,n=!1;const r=e.length,o=e.map((e=>d(e)?()=>e:(s=e.sourceAspect||s,n=n||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),a=new ut(re(((e,t)=>{let s="";for(let i=0;i<r;++i)s+=o[i](e,t);return s}),null!=i?i:t,n));return We.assignAspect(a,s),a}},$t=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,xt=Object.create(null);class Ot{constructor(e,t=xt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Bt(e,t,s,i=We.getForInstance(e)){if(i.aspected){const s=$t.exec(t);null!==s&&We.assignAspect(e,s[2])}return e.createHTML(s)}Ot.empty=new Ot(""),We.define(Ot);class Nt{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=Tt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new Ot(d(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw f.error(1208);if(this.policy)throw f.error(1207);return this.policy=e,this}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}static create(e,t,s){let i="";const n=Object.create(null),r=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Pe();return n[s]=e,s};for(let s=0,n=e.length-1;s<n;++s){const n=e[s];let o,a=t[s];if(i+=n,c(a))a=new ut(re(a));else if(a instanceof ie)a=new ut(a);else if(!(o=We.getForInstance(a))){const e=a;a=new ut(le((()=>e)))}i+=Bt(a,n,r,o)}return new Nt(i+e[e.length-1],n,s)}}v(Nt);const kt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Nt.create(e,t);throw f.error(1206)};kt.partial=e=>new Ot(e);class At extends Je{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}We.define(At);const Et=e=>new At(e),Mt=()=>null;function It(e){return void 0===e?Mt:c(e)?e:()=>e}function jt(e,t,s){const i=c(e)?e:()=>e,n=It(t),r=It(s);return(e,t)=>i(e,t)?n(e,t):r(e,t)}const Rt=Object.freeze({positioning:!1,recycle:!0});function Vt(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function _t(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function zt(e){return e.nodeType===Node.COMMENT_NODE}class Lt extends Error{constructor(e,t){super(e),this.propertyBag=t}}class Ft{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=Vt,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=_t)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Ve(this.template)&&Ve(e)&&e.hydrationStage!==ct?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=p);const t=this.itemsObserver,s=this.itemsObserver=_.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,i=e.length;s<i;++s){const i=e[s].sorted.slice(),n=i.slice().sort();for(let e=0,s=i.length;e<s;++e){const s=i.find((t=>i[e]===n[t]));if(s!==e){const i=n.splice(s,1);n.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let f=0,p=h.index;const g=p+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;p<g;++p){const e=t[p],d=e?e.firstChild:this.location;let h;o&&c>0?(f<=v&&b.length>0?(h=b[f],f++):(h=a[l],l++),c--):h=n.create(),t.splice(p,0,h),s(h,i,p,r),h.insertBefore(d)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(ot.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),a[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<l){const i=a[e];if(!i){const t=new XMLSerializer;throw new Lt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}n(i,t,e,r)}else{const o=s.create();n(o,t,e,r),a.push(o),o.insertBefore(i)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new Lt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:s.serializeToString(this.location.getRootNode())})}s.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!zt(t)){t=t.previousSibling;continue}const s=Ee.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const i=t.previousSibling;if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=i,r=0;for(;null!==n;){if(zt(n))if(Ee.isRepeatViewEndMarker(n.data))r++;else if(Ee.isRepeatViewStartMarker(n.data)){if(!r){if(Ee.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const r=e.hydrate(n,i);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class Ht{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,ee.enable()}createHTML(e){return Ue.comment(e(this))}createBehavior(){return new Ft(this)}}function Dt(e,t,s=Rt){const i=ce(e),n=ce(t);return new Ht(i,n,Object.assign(Object.assign({},Rt),s))}We.define(Ht);const Pt=e=>1===e.nodeType,Ut=e=>e?t=>1===t.nodeType&&t.matches(e):Pt;class qt extends Je{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,p),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const Qt="slotchange";class Wt extends qt{observe(e){e.addEventListener(Qt,this)}disconnect(e){e.removeEventListener(Qt,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Xt(e){return d(e)&&(e={property:e}),new Wt(e)}We.define(Wt);class Jt extends qt{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=h,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Kt(e){return d(e)&&(e={property:e}),new Jt(e)}function Gt(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))}We.define(Jt),"function"==typeof SuppressedError&&SuppressedError;const Yt="boolean",Zt="reflect",es=Object.freeze({locate:b()}),ts={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},ss={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:ts.fromView(e)};function is(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const ns={toView(e){const t=is(e);return t?t.toString():t},fromView:is};class rs{constructor(e,t,s=t.toLowerCase(),i=Zt,n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i===Yt&&void 0===n&&(this.converter=ts)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return _.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||I.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case Zt:const t=this.converter;T.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case Yt:T.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(es.locate(e));for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];d(i)?s.push(new rs(e,i)):s.push(new rs(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function os(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),es.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const as={mode:"open"},ls={},cs=new Set,ds=f.getById(l.elementRegistry,(()=>g())),hs={deferAndHydrate:"defer-and-hydrate"};class us{constructor(e,t=e.definition){var s;this.platformDefined=!1,d(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.templateOptions=t.templateOptions,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=rs.collect(e,t.attributes),r=new Array(n.length),o={},a={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,a[t.attribute]=t,_.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?as:null===t.shadowOptions?void 0:Object.assign(Object.assign({},as),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?ls:Object.assign(Object.assign({},ls),t.elementOptions),this.styles=ue.normalize(t.styles),ds.register(this),_.defineProperty(us.isRegistered,this.name),us.isRegistered[this.name]=this.type}get isDefined(){return this.platformDefined}define(e=this.registry){var t,s;const i=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,i,this.elementOptions),null===(s=null===(t=this.lifecycleCallbacks)||void 0===t?void 0:t.elementDidDefine)||void 0===s||s.call(t,this.name)),this}static compose(e,t){return cs.has(e)||ds.getByType(e)?new us(class extends e{},t):new us(e,t)}static registerBaseType(e){cs.add(e)}static composeAsync(e,t){return new Promise((s=>{(cs.has(e)||ds.getByType(e))&&s(new us(class extends e{},t));const i=new us(e,t);_.getNotifier(i).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=i.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,i.name),s(i)}},"template")}))}}us.isRegistered={},us.getByType=ds.getByType,us.getForInstance=ds.getForInstance,us.registerAsync=e=>Gt(void 0,void 0,void 0,(function*(){return new Promise((t=>{us.isRegistered[e]&&t(us.isRegistered[e]),_.getNotifier(us.isRegistered).subscribe({handleChange:()=>t(us.isRegistered[e])},e)}))})),_.defineProperty(us.prototype,"template");class fs{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Ve(this.template)&&Ve(e)&&e.hydrationStage!==ct&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class ps{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Ue.comment(e(this))}createBehavior(){return new fs(this)}}We.define(ps);const gs=new Map,bs={":model":e=>e},vs=Symbol("RenderInstruction"),ms="default-view",ys=kt`
2
2
  &nbsp;
3
- `;function ws(e){return void 0===e?ys:e.template}function Cs(e,t){const s=[],i=[],{attributes:n,directives:r,content:o,policy:a}=null!=t?t:{};if(s.push(`<${e}`),n){const e=Object.getOwnPropertyNames(n);for(let t=0,r=e.length;t<r;++t){const r=e[t];0===t?s[0]=`${s[0]} ${r}="`:s.push(`" ${r}="`),i.push(n[r])}s.push('"')}if(r){s[s.length-1]+=" ";for(let e=0,t=r.length;e<t;++e){const t=r[e];s.push(e>0?"":" "),i.push(t)}}if(s[s.length-1]+=">",o&&c(o.create))i.push(o),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=o?o:""}</${e}>`}return kt.create(s,i,a)}function Ss(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:ms;let i;if((n=e).element||n.tagName){let t=e.tagName;if(!t){const s=us.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=bs),i=Cs(t,e)}else i=e.template;var n;return{brand:vs,type:e.type,name:s,template:i}}function Ts(e){return e&&e.brand===vs}function $s(e,t){const s=gs.get(e);if(void 0!==s)return s[null!=t?t:ms]}function xs(e,t){if(e)return $s(e.constructor,t)}Object.freeze({instanceOf:Ts,create:Ss,createElementTemplate:Cs,register:function(e){let t=gs.get(e.type);void 0===t&&gs.set(e.type,t=Object.create(null));const s=Ts(e)?e:Ss(e);return t[s.name]=s},getByType:$s,getForInstance:xs});class Os{constructor(e){this.node=e,e.$fastTemplate=this}get context(){return this}bind(e){}unbind(){}insertBefore(e){e.parentNode.insertBefore(this.node,e)}remove(){this.node.parentNode.removeChild(this.node)}create(){return this}hydrate(e,t){return this}}function Bs(e,t){let s,i;s=void 0===e?le((e=>e)):ce(e);let n=!1;if(void 0===t)n=!0,i=le(((e,t)=>{var i;const n=s.evaluate(e,t);return n instanceof Node?null!==(i=n.$fastTemplate)&&void 0!==i?i:new Os(n):ws(xs(n))}));else if(c(t))i=re(((e,i)=>{var n;let r=t(e,i);return d(r)?r=ws(xs(s.evaluate(e,i),r)):r instanceof Node&&(r=null!==(n=r.$fastTemplate)&&void 0!==n?n:new Os(r)),r}),void 0,!0);else if(d(t))n=!0,i=le(((e,i)=>{var n;const r=s.evaluate(e,i);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new Os(r):ws(xs(r,t))}));else if(t instanceof ie){const e=t.evaluate;t.evaluate=(t,i)=>{var n;let r=e(t,i);return d(r)?r=ws(xs(s.evaluate(t,i),r)):r instanceof Node&&(r=null!==(n=r.$fastTemplate)&&void 0!==n?n:new Os(r)),r},i=t}else i=le(((e,s)=>t));return new ps(s,i,n)}class ks extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:H.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){var s,i,n,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:Pe(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:Pe(),o.targetTagName=null!==(n=t.tagName)&&void 0!==n?n:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:T.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}});const Ns={bubbles:!0,composed:!0,cancelable:!0},As="isConnected",Es=new WeakMap;function Ms(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Es.get(e))&&void 0!==s?s:null}let js;class Is extends R{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const s=_.getAccessors(e);if(s.length>0){const t=this.boundObservables=Object.create(null);for(let i=0,n=s.length;i<n;++i){const n=s[i].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return _.track(this,As),1===this.stage}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:H.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&Es.set(this.source,t))}}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=Ms(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=Ms(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.removeBehavior(t[e])}}connect(){3===this.stage&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,_.notify(this,As))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){1===this.stage&&(this.stage=2,_.notify(this,As),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},Ns),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=Ms(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=V.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const i=us.getForInstance(e);if(void 0===i)throw f.error(1401);return _.getNotifier(i).subscribe({handleChange:()=>{Is.forCustomElement(e,!0),e.$fastController.connect()}},"template"),_.getNotifier(i).subscribe({handleChange:()=>{Is.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new js(e,i)}static setStrategy(e){js=e}}function Rs(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Ms(e))&&void 0!==t?t:e.getRootNode()}v(Is),Is.setStrategy(Is);class Vs{constructor(e){const t=Vs.styleSheetCache;this.sheets=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}))}addStylesTo(e){Fs(Rs(e),this.sheets)}removeStylesFrom(e){Hs(Rs(e),this.sheets)}}Vs.styleSheetCache=new Map;let _s=0;function zs(e){return e===document?document.body:e}class Ls{constructor(e){this.styles=e,this.styleClass="fast-"+ ++_s}addStylesTo(e){e=zs(Rs(e));const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=(e=zs(Rs(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let Fs=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Hs=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ue.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Fs=(e,t)=>{e.adoptedStyleSheets.push(...t)},Hs=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ue.setDefaultStrategy(Vs)}else ue.setDefaultStrategy(Ls);const Ds="needs-hydration";class Ps extends Is{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,(this.hasExistingShadowRoot||void 0!==e&&!this.template)&&this.definition.templateOptions===hs.deferAndHydrate&&(this.source.toggleAttribute(_e,!0),this.source.toggleAttribute(Ds,!0))}addHydratingInstance(){if(!Ps.hydratingInstances)return;const e=this.definition.name;let t=Ps.hydratingInstances.get(e);t||(t=new Set,Ps.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return Ps.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(_e)||(Ps.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,s,i;e.didTimeout?Ps.idleCallbackId=requestIdleCallback(Ps.checkHydrationComplete,{timeout:50}):0===(null===(t=Ps.hydratingInstances)||void 0===t?void 0:t.size)&&(null===(i=null===(s=Ps.lifecycleCallbacks)||void 0===s?void 0:s.hydrationComplete)||void 0===i||i.call(s),Is.setStrategy(Is))}connect(){var e,t,s,i,n;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(Ds),this.source.hasAttribute(_e))return this.addHydratingInstance(),void Ps.hydrationObserver.observe(this.source,{attributeFilter:[_e]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(3===this.stage){if(null===(s=null===(t=Ps.lifecycleCallbacks)||void 0===t?void 0:t.elementWillHydrate)||void 0===s||s.call(t,this.definition.name),this.stage=0,this.bindObservables(),this.connectBehaviors(),this.template)if(Ve(this.template)){const e=this.source,t=null!==(i=Ms(e))&&void 0!==i?i:e;let s=t.firstChild,r=t.lastChild;null===e.shadowRoot&&(Ee.isElementBoundaryStartMarker(s)&&(s.data="",s=s.nextSibling),Ee.isElementBoundaryEndMarker(r)&&(r.data="",r=r.previousSibling)),this.view=this.template.hydrate(s,r,e),null===(n=this.view)||void 0===n||n.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(Ds),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),_.notify(this,As)}}removeHydratingInstance(){var e,t;if(!Ps.hydratingInstances)return;const s=this.definition.name,i=Ps.hydratingInstances.get(s);null===(t=null===(e=Ps.lifecycleCallbacks)||void 0===e?void 0:e.elementDidHydrate)||void 0===t||t.call(e,this.definition.name),i&&(i.delete(this.source),i.size||Ps.hydratingInstances.delete(s),Ps.idleCallbackId&&cancelIdleCallback(Ps.idleCallbackId),Ps.idleCallbackId=requestIdleCallback(Ps.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),Ps.hydrationObserver.unobserve(this.source)}static install(){Is.setStrategy(Ps)}}function Us(e){const t=class extends e{constructor(){super(),Is.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return us.registerBaseType(t),t}function qs(e,t){return c(e)?us.compose(e,t).define().type:us.compose(this,e).define().type}Ps.hydrationObserver=new ks(Ps.hydrationObserverHandler),Ps.idleCallbackId=null,Ps.hydratingInstances=new Map;const Qs=Object.assign(Us(HTMLElement),{from:function(e){return Us(e)},define:qs,compose:function(e,t){return c(e)?us.compose(e,t):us.compose(this,e)},defineAsync:function(e,t){return c(e)?new Promise((s=>{us.composeAsync(e,t).then((e=>{s(e)}))})).then((e=>e.define().type)):new Promise((t=>{us.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});function Ws(e){return function(t){qs(t,e)}}T.setPolicy(M.create());export{ee as ArrayObserver,es as AttributeConfiguration,rs as AttributeDefinition,ie as Binding,ve as CSSBindingDirective,pe as CSSDirective,Jt as ChildrenDirective,Tt as Compiler,T as DOM,m as DOMAspect,Is as ElementController,ue as ElementStyles,H as ExecutionContext,f as FAST,Qs as FASTElement,us as FASTElementDefinition,ut as HTMLBindingDirective,We as HTMLDirective,ot as HTMLView,Ps as HydratableElementController,dt as HydrationBindingError,Ot as InlineTemplateDirective,Ue as Markup,qt as NodeObservationDirective,_ as Observable,qe as Parser,R as PropertyChangeNotifier,At as RefDirective,fs as RenderBehavior,ps as RenderDirective,Ft as RepeatBehavior,Ht as RepeatDirective,Wt as SlottedDirective,P as Sort,V as SourceLifetime,D as Splice,K as SpliceStrategy,U as SpliceStrategySupport,Je as StatelessAttachedAttributeDirective,I as SubscriberSet,hs as TemplateOptions,j as Updates,kt as ViewTemplate,os as attr,ts as booleanConverter,Kt as children,Se as css,ge as cssDirective,Ws as customElement,_e as deferHydrationAttribute,Ut as elements,p as emptyArray,ds as fastElementRegistry,Nt as html,Xe as htmlDirective,Ve as isHydratable,te as lengthOf,oe as listener,Ds as needsHydrationAttribute,ce as normalizeBinding,ss as nullableBooleanConverter,ns as nullableNumberConverter,z as observable,le as oneTime,re as oneWay,Et as ref,Bs as render,Dt as repeat,Xt as slotted,se as sortedCount,L as volatile,It as when};
3
+ `;function ws(e){return void 0===e?ys:e.template}function Cs(e,t){const s=[],i=[],{attributes:n,directives:r,content:o,policy:a}=null!=t?t:{};if(s.push(`<${e}`),n){const e=Object.getOwnPropertyNames(n);for(let t=0,r=e.length;t<r;++t){const r=e[t];0===t?s[0]=`${s[0]} ${r}="`:s.push(`" ${r}="`),i.push(n[r])}s.push('"')}if(r){s[s.length-1]+=" ";for(let e=0,t=r.length;e<t;++e){const t=r[e];s.push(e>0?"":" "),i.push(t)}}if(s[s.length-1]+=">",o&&c(o.create))i.push(o),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=o?o:""}</${e}>`}return Nt.create(s,i,a)}function Ss(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:ms;let i;if((n=e).element||n.tagName){let t=e.tagName;if(!t){const s=us.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=bs),i=Cs(t,e)}else i=e.template;var n;return{brand:vs,type:e.type,name:s,template:i}}function Ts(e){return e&&e.brand===vs}function $s(e,t){const s=gs.get(e);if(void 0!==s)return s[null!=t?t:ms]}function xs(e,t){if(e)return $s(e.constructor,t)}Object.freeze({instanceOf:Ts,create:Ss,createElementTemplate:Cs,register:function(e){let t=gs.get(e.type);void 0===t&&gs.set(e.type,t=Object.create(null));const s=Ts(e)?e:Ss(e);return t[s.name]=s},getByType:$s,getForInstance:xs});class Os{constructor(e){this.node=e,e.$fastTemplate=this}get context(){return this}bind(e){}unbind(){}insertBefore(e){e.parentNode.insertBefore(this.node,e)}remove(){this.node.parentNode.removeChild(this.node)}create(){return this}hydrate(e,t){return this}}function Bs(e,t){let s,i;s=void 0===e?le((e=>e)):ce(e);let n=!1;if(void 0===t)n=!0,i=le(((e,t)=>{var i;const n=s.evaluate(e,t);return n instanceof Node?null!==(i=n.$fastTemplate)&&void 0!==i?i:new Os(n):ws(xs(n))}));else if(c(t))i=re(((e,i)=>{var n;let r=t(e,i);return d(r)?r=ws(xs(s.evaluate(e,i),r)):r instanceof Node&&(r=null!==(n=r.$fastTemplate)&&void 0!==n?n:new Os(r)),r}),void 0,!0);else if(d(t))n=!0,i=le(((e,i)=>{var n;const r=s.evaluate(e,i);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new Os(r):ws(xs(r,t))}));else if(t instanceof ie){const e=t.evaluate;t.evaluate=(t,i)=>{var n;let r=e(t,i);return d(r)?r=ws(xs(s.evaluate(t,i),r)):r instanceof Node&&(r=null!==(n=r.$fastTemplate)&&void 0!==n?n:new Os(r)),r},i=t}else i=le(((e,s)=>t));return new ps(s,i,n)}class Ns extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:H.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){var s,i,n,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:Pe(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:Pe(),o.targetTagName=null!==(n=t.tagName)&&void 0!==n?n:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:T.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}});const ks={bubbles:!0,composed:!0,cancelable:!0},As="isConnected",Es=new WeakMap;function Ms(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Es.get(e))&&void 0!==s?s:null}let Is;class js extends R{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const s=_.getAccessors(e);if(s.length>0){const t=this.boundObservables=Object.create(null);for(let i=0,n=s.length;i<n;++i){const n=s[i].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return _.track(this,As),1===this.stage}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:H.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&Es.set(this.source,t))}}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=Ms(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=Ms(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.removeBehavior(t[e])}}connect(){3===this.stage&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,_.notify(this,As))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){1===this.stage&&(this.stage=2,_.notify(this,As),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},ks),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=Ms(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=V.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const i=us.getForInstance(e);if(void 0===i)throw f.error(1401);return _.getNotifier(i).subscribe({handleChange:()=>{js.forCustomElement(e,!0),e.$fastController.connect()}},"template"),_.getNotifier(i).subscribe({handleChange:()=>{js.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new Is(e,i)}static setStrategy(e){Is=e}}function Rs(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Ms(e))&&void 0!==t?t:e.getRootNode()}v(js),js.setStrategy(js);class Vs{constructor(e){const t=Vs.styleSheetCache;this.sheets=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}))}addStylesTo(e){Fs(Rs(e),this.sheets)}removeStylesFrom(e){Hs(Rs(e),this.sheets)}}Vs.styleSheetCache=new Map;let _s=0;function zs(e){return e===document?document.body:e}class Ls{constructor(e){this.styles=e,this.styleClass="fast-"+ ++_s}addStylesTo(e){e=zs(Rs(e));const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=(e=zs(Rs(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let Fs=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Hs=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ue.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Fs=(e,t)=>{e.adoptedStyleSheets.push(...t)},Hs=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ue.setDefaultStrategy(Vs)}else ue.setDefaultStrategy(Ls);const Ds="needs-hydration";class Ps extends js{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,(this.hasExistingShadowRoot||void 0!==e&&!this.template)&&this.definition.templateOptions===hs.deferAndHydrate&&(this.source.toggleAttribute(_e,!0),this.source.toggleAttribute(Ds,!0))}addHydratingInstance(){if(!Ps.hydratingInstances)return;const e=this.definition.name;let t=Ps.hydratingInstances.get(e);t||(t=new Set,Ps.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return Ps.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(_e)||(Ps.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,s,i;e.didTimeout?Ps.idleCallbackId=requestIdleCallback(Ps.checkHydrationComplete,{timeout:50}):0===(null===(t=Ps.hydratingInstances)||void 0===t?void 0:t.size)&&(null===(i=null===(s=Ps.lifecycleCallbacks)||void 0===s?void 0:s.hydrationComplete)||void 0===i||i.call(s),js.setStrategy(js))}connect(){var e,t,s,i,n;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(Ds),this.source.hasAttribute(_e))return this.addHydratingInstance(),void Ps.hydrationObserver.observe(this.source,{attributeFilter:[_e]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(3===this.stage){if(null===(s=null===(t=Ps.lifecycleCallbacks)||void 0===t?void 0:t.elementWillHydrate)||void 0===s||s.call(t,this.definition.name),this.stage=0,this.bindObservables(),this.connectBehaviors(),this.template)if(Ve(this.template)){const e=this.source,t=null!==(i=Ms(e))&&void 0!==i?i:e;let s=t.firstChild,r=t.lastChild;null===e.shadowRoot&&(Ee.isElementBoundaryStartMarker(s)&&(s.data="",s=s.nextSibling),Ee.isElementBoundaryEndMarker(r)&&(r.data="",r=r.previousSibling)),this.view=this.template.hydrate(s,r,e),null===(n=this.view)||void 0===n||n.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(Ds),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),_.notify(this,As)}}removeHydratingInstance(){var e,t;if(!Ps.hydratingInstances)return;const s=this.definition.name,i=Ps.hydratingInstances.get(s);null===(t=null===(e=Ps.lifecycleCallbacks)||void 0===e?void 0:e.elementDidHydrate)||void 0===t||t.call(e,this.definition.name),i&&(i.delete(this.source),i.size||Ps.hydratingInstances.delete(s),Ps.idleCallbackId&&cancelIdleCallback(Ps.idleCallbackId),Ps.idleCallbackId=requestIdleCallback(Ps.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),Ps.hydrationObserver.unobserve(this.source)}static install(){js.setStrategy(Ps)}}function Us(e){const t=class extends e{constructor(){super(),js.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return us.registerBaseType(t),t}function qs(e,t){return c(e)?us.compose(e,t).define().type:us.compose(this,e).define().type}Ps.hydrationObserver=new Ns(Ps.hydrationObserverHandler),Ps.idleCallbackId=null,Ps.hydratingInstances=new Map;const Qs=Object.assign(Us(HTMLElement),{from:function(e){return Us(e)},define:qs,compose:function(e,t){return c(e)?us.compose(e,t):us.compose(this,e)},defineAsync:function(e,t){return c(e)?new Promise((s=>{us.composeAsync(e,t).then((e=>{s(e)}))})).then((e=>e.define().type)):new Promise((t=>{us.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});function Ws(e){return function(t){qs(t,e)}}T.setPolicy(M.create());export{ee as ArrayObserver,es as AttributeConfiguration,rs as AttributeDefinition,ie as Binding,ve as CSSBindingDirective,pe as CSSDirective,Jt as ChildrenDirective,Tt as Compiler,T as DOM,m as DOMAspect,js as ElementController,ue as ElementStyles,H as ExecutionContext,f as FAST,Qs as FASTElement,us as FASTElementDefinition,ut as HTMLBindingDirective,We as HTMLDirective,ot as HTMLView,Ps as HydratableElementController,dt as HydrationBindingError,Ot as InlineTemplateDirective,Ue as Markup,qt as NodeObservationDirective,_ as Observable,qe as Parser,R as PropertyChangeNotifier,At as RefDirective,fs as RenderBehavior,ps as RenderDirective,Ft as RepeatBehavior,Ht as RepeatDirective,Wt as SlottedDirective,P as Sort,V as SourceLifetime,D as Splice,K as SpliceStrategy,U as SpliceStrategySupport,Je as StatelessAttachedAttributeDirective,j as SubscriberSet,hs as TemplateOptions,I as Updates,Nt as ViewTemplate,os as attr,ts as booleanConverter,Kt as children,Se as css,ge as cssDirective,Ws as customElement,_e as deferHydrationAttribute,Ut as elements,p as emptyArray,ds as fastElementRegistry,kt as html,Xe as htmlDirective,Ve as isHydratable,te as lengthOf,oe as listener,Ds as needsHydrationAttribute,ce as normalizeBinding,ss as nullableBooleanConverter,ns as nullableNumberConverter,z as observable,le as oneTime,re as oneWay,Et as ref,Bs as render,Dt as repeat,Xt as slotted,se as sortedCount,L as volatile,jt as when};
@@ -2266,6 +2266,7 @@ function isComment$1(node) {
2266
2266
  */
2267
2267
  const HydrationMarkup = Object.freeze({
2268
2268
  attributeMarkerName: "data-fe-b",
2269
+ compactAttributeMarkerName: "data-fe-c",
2269
2270
  attributeBindingSeparator: " ",
2270
2271
  contentBindingStartMarker(index, uniqueId) {
2271
2272
  return `fe-b$$start$$${index}$$${uniqueId}$$fe-b`;
@@ -2300,6 +2301,8 @@ const HydrationMarkup = Object.freeze({
2300
2301
  /**
2301
2302
  * Returns the indexes of the ViewBehaviorFactories affecting
2302
2303
  * attributes for the element, or null if no factories were found.
2304
+ *
2305
+ * This method parses the space-separated format: `data-fe-b="0 1 2"`.
2303
2306
  */
2304
2307
  parseAttributeBinding(node) {
2305
2308
  const attr = node.getAttribute(this.attributeMarkerName);
@@ -2311,7 +2314,8 @@ const HydrationMarkup = Object.freeze({
2311
2314
  * Returns the indexes of the ViewBehaviorFactories affecting
2312
2315
  * attributes for the element, or null if no factories were found.
2313
2316
  *
2314
- * Uses the alternative syntax of data-fe-b-<number>
2317
+ * This method parses the enumerated format: `data-fe-b-0`, `data-fe-b-1`, `data-fe-b-2`.
2318
+ * This is an alternative format that uses separate attributes for each binding index.
2315
2319
  */
2316
2320
  parseEnumeratedAttributeBinding(node) {
2317
2321
  const attrs = [];
@@ -2324,12 +2328,47 @@ const HydrationMarkup = Object.freeze({
2324
2328
  attrs.push(count);
2325
2329
  }
2326
2330
  else {
2327
- throw new Error(`Invalid attribute marker name: ${attr}. Expected format is ${prefix}<number>.`);
2331
+ throw FAST.error(1601 /* invalidAttributeMarkerName */, {
2332
+ name: attr,
2333
+ expectedFormat: `${prefix}<number>`,
2334
+ });
2328
2335
  }
2329
2336
  }
2330
2337
  }
2331
2338
  return attrs.length === 0 ? null : attrs;
2332
2339
  },
2340
+ /**
2341
+ * Returns the indexes of the ViewBehaviorFactories affecting
2342
+ * attributes for the element, or null if no factories were found.
2343
+ *
2344
+ * This method parses the compact format: `data-fe-c-{index}-{count}`.
2345
+ */
2346
+ parseCompactAttributeBinding(node) {
2347
+ const prefix = `${this.compactAttributeMarkerName}-`;
2348
+ const attrName = node.getAttributeNames().find(name => name.startsWith(prefix));
2349
+ if (!attrName) {
2350
+ return null;
2351
+ }
2352
+ const suffix = attrName.slice(prefix.length);
2353
+ const parts = suffix.split("-");
2354
+ const startIndex = parseInt(parts[0], 10);
2355
+ const count = parseInt(parts[1], 10);
2356
+ if (parts.length !== 2 ||
2357
+ Number.isNaN(startIndex) ||
2358
+ Number.isNaN(count) ||
2359
+ startIndex < 0 ||
2360
+ count < 1) {
2361
+ throw FAST.error(1604 /* invalidCompactAttributeMarkerName */, {
2362
+ name: attrName,
2363
+ expectedFormat: `${this.compactAttributeMarkerName}-{index}-{count}`,
2364
+ });
2365
+ }
2366
+ const indexes = [];
2367
+ for (let i = 0; i < count; i++) {
2368
+ indexes.push(startIndex + i);
2369
+ }
2370
+ return indexes;
2371
+ },
2333
2372
  /**
2334
2373
  * Parses the ViewBehaviorFactory index from string data. Returns
2335
2374
  * the binding index or null if the index cannot be retrieved.
@@ -2646,9 +2685,9 @@ function buildViewBindingTargets(firstNode, lastNode, factories) {
2646
2685
  return { targets, boundaries };
2647
2686
  }
2648
2687
  function targetElement(node, factories, targets) {
2649
- var _a;
2688
+ var _a, _b;
2650
2689
  // Check for attributes and map any factories.
2651
- const attrFactoryIds = (_a = HydrationMarkup.parseAttributeBinding(node)) !== null && _a !== void 0 ? _a : HydrationMarkup.parseEnumeratedAttributeBinding(node);
2690
+ const attrFactoryIds = (_b = (_a = HydrationMarkup.parseAttributeBinding(node)) !== null && _a !== void 0 ? _a : HydrationMarkup.parseEnumeratedAttributeBinding(node)) !== null && _b !== void 0 ? _b : HydrationMarkup.parseCompactAttributeBinding(node);
2652
2691
  if (attrFactoryIds !== null) {
2653
2692
  for (const id of attrFactoryIds) {
2654
2693
  if (!factories[id]) {
@@ -1,3 +1,3 @@
1
- let e;const t="fast-kernel";try{if(document.currentScript)e=document.currentScript.getAttribute(t);else{const s=document.getElementsByTagName("script");e=s[s.length-1].getAttribute(t)}}catch(t){e="isolate"}let s;switch(e){case"share":s=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":s=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;s=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const i=e=>"function"==typeof e,n=e=>"string"==typeof e,r=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}(),"requestIdleCallback"in globalThis||(globalThis.requestIdleCallback=function(e,t){const s=Date.now();return setTimeout((()=>{e({didTimeout:!!(null==t?void 0:t.timeout)&&Date.now()-s>=t.timeout,timeRemaining:()=>0})}),1)},globalThis.cancelIdleCallback=function(e){clearTimeout(e)});const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const a=globalThis.FAST;if(void 0===a.getById){const e=Object.create(null);Reflect.defineProperty(a,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},o))}void 0===a.error&&Object.assign(a,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const l=Object.freeze([]);function c(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function d(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function h(e){e.prototype.toJSON=r}const u=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),f=e=>e,p=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:f}):{createHTML:f};let g=Object.freeze({createHTML:e=>p.createHTML(e),protect:(e,t,s,i)=>i});const b=g,v=Object.freeze({get policy(){return g},setPolicy(e){if(g!==b)throw a.error(1201);g=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function m(e,t,s,i){return(e,t,s,...r)=>{n(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...r)}}function y(e,t,s,i){throw a.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const w={onabort:y,onauxclick:y,onbeforeinput:y,onbeforematch:y,onblur:y,oncancel:y,oncanplay:y,oncanplaythrough:y,onchange:y,onclick:y,onclose:y,oncontextlost:y,oncontextmenu:y,oncontextrestored:y,oncopy:y,oncuechange:y,oncut:y,ondblclick:y,ondrag:y,ondragend:y,ondragenter:y,ondragleave:y,ondragover:y,ondragstart:y,ondrop:y,ondurationchange:y,onemptied:y,onended:y,onerror:y,onfocus:y,onformdata:y,oninput:y,oninvalid:y,onkeydown:y,onkeypress:y,onkeyup:y,onload:y,onloadeddata:y,onloadedmetadata:y,onloadstart:y,onmousedown:y,onmouseenter:y,onmouseleave:y,onmousemove:y,onmouseout:y,onmouseover:y,onmouseup:y,onpaste:y,onpause:y,onplay:y,onplaying:y,onprogress:y,onratechange:y,onreset:y,onresize:y,onscroll:y,onsecuritypolicyviolation:y,onseeked:y,onseeking:y,onselect:y,onslotchange:y,onstalled:y,onsubmit:y,onsuspend:y,ontimeupdate:y,ontoggle:y,onvolumechange:y,onwaiting:y,onwebkitanimationend:y,onwebkitanimationiteration:y,onwebkitanimationstart:y,onwebkittransitionend:y,onwheel:y},C={elements:{a:{[u.attribute]:{href:m},[u.property]:{href:m}},area:{[u.attribute]:{href:m},[u.property]:{href:m}},button:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},embed:{[u.attribute]:{src:y},[u.property]:{src:y}},form:{[u.attribute]:{action:m},[u.property]:{action:m}},frame:{[u.attribute]:{src:m},[u.property]:{src:m}},iframe:{[u.attribute]:{src:m},[u.property]:{src:m,srcdoc:y}},input:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},link:{[u.attribute]:{href:y},[u.property]:{href:y}},object:{[u.attribute]:{codebase:y,data:y},[u.property]:{codeBase:y,data:y}},script:{[u.attribute]:{src:y,text:y},[u.property]:{src:y,text:y,innerText:y,textContent:y}},style:{[u.property]:{innerText:y,textContent:y}}},aspects:{[u.attribute]:Object.assign({},w),[u.property]:Object.assign({innerHTML:y},w),[u.event]:Object.assign({},w)}};function S(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=r;break;default:s[i]=n}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function x(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=S(r,{});break;default:s[i]=S(n,r)}}for(const t in e)t in s||(s[t]=S(e[t],{}));return Object.freeze(s)}function T(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=x(n,{});break;default:s[i]=x(n,r)}}for(const t in e)t in s||(s[t]=x(e[t],{}));return Object.freeze(s)}function O(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const $=Object.freeze({create(e={}){var t,s;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),n=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=C,Object.freeze({elements:r.elements?T(r.elements,o.elements):o.elements,aspects:r.aspects?x(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,s,i){var r;const o=(null!=e?e:"").toLowerCase(),a=n.elements[o];if(a){const n=O(a,e,t,s,i);if(n)return n}return null!==(r=O(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),B=a.getById(s.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>i=e})}));class N{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class k{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new N(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new N(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const A=Object.freeze({unknown:void 0,coupled:1}),E=a.getById(s.observable,(()=>{const e=B.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let r,o=e=>{throw a.error(1101)};function l(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=o(e):s.set(e,i=new k(e))),i}const c=d();class u{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==r&&r.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];i(r)&&r.call(e,n,t),l(e).notify(this.name)}}}class f extends N{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==A.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=r;let i;r=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{r=s}return i}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,i=l(e),n=null===s?this.first:{};if(n.propertySource=e,n.propertyName=t,n.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;r=void 0,t=s.propertySource[s.propertyName],r=this,e===t&&(this.needsRefresh=!0)}s.next=n}this.last=n}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return h(f),Object.freeze({setArrayObserverFactory(e){o=e},getNotifier:l,track(e,t){r&&r.watch(e,t)},trackVolatile(){r&&(r.needsRefresh=!0)},notify(e,t){l(e).notify(t)},defineProperty(e,t){n(t)&&(t=new u(t)),c(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:c,binding(e,t,s=this.isVolatileBinding(e)){return new f(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function M(e,t){E.defineProperty(e,t)}function I(e,t,s){return Object.assign({},s,{get(){return E.trackVolatile(),s.get.apply(this)}})}const j=a.getById(s.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),V=Object.freeze({default:{index:0,length:0,get event(){return V.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>j.get(),setEvent(e){j.set(e)}});class R{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class _{constructor(e){this.sorted=e}}const z=Object.freeze({reset:1,splice:2,optimized:3}),L=new R(0,l,0);L.reset=!0;const H=[L];function F(e,t,s,i,n,r){let o=0,a=0;const c=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,c)),s===e.length&&r===i.length&&(a=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,c-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return l;if(t===s){const e=new R(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new R(t,[],s-t)];const d=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):l===o?(n.push(3),t--,i=o):(n.push(2),s--,i=a)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,a=s-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===i[n+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,d=l[s][r-1]+1,l[s][r]=c<d?c:d);return l}(e,t,s,i,n,r)),h=[];let u,f=t,p=n;for(let e=0;e<d.length;++e)switch(d[e]){case 0:void 0!==u&&(h.push(u),u=void 0),f++,p++;break;case 1:void 0===u&&(u=new R(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new R(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new R(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&h.push(u),h}function P(e,t){let s=!1,i=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=i,s)continue;const d=(n=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<n?-1:r===o||a===n?0:n<o?r<a?r-o:a-o:a<r?a-n:r-n);if(d>=0){t.splice(l,1),l--,i-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const n=e.removed.length+c.removed.length-d;if(e.addedCount||n){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,a;s||t.push(e)}let D=Object.freeze({support:z.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?l:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)P(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(F(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):H,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new R(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new R(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new _(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new R(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new _(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new R(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new R(0,[],i.length).adjustTo(e)),n}});const U=Object.freeze({reset:H,setDefaultStrategy(e){D=e}});function q(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}class Q extends N{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,q(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,E.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,E.notify(e,"sorted"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:D).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,B.enqueue(this))}}let W=!1;const X=Object.freeze({sorted:0,enable(){if(W)return;W=!0,E.setArrayObserverFactory((e=>new Q(e)));const e=Array.prototype;e.$fastPatch||(q(e,"$fastPatch",1),q(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:D)[t.name](this,i,t,e)}})))}});function J(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=E.getNotifier(e)),E.track(t.lengthObserver,"length"),e.length}function G(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=E.getNotifier(e)),E.track(t.sortObserver,"sorted"),e.sorted}class K{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class Y extends K{createObserver(e){return E.binding(this.evaluate,e,this.isVolatile)}}function Z(e,t,s=E.isVolatileBinding(e)){return new Y(e,t,s)}function ee(e,t){const s=new Y(e);return s.options=t,s}class te extends K{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function se(e,t){return new te(e,t)}function ie(e){return i(e)?Z(e):e instanceof K?e:se((()=>e))}let ne;function re(e){return e.map((e=>e instanceof oe?re(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}h(te);class oe{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof oe?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(ne),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(re(this.styles)),this}static setDefaultStrategy(e){ne=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new oe(e):e instanceof oe?e:new oe([e])}}oe.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const ae=c(),le=Object.freeze({getForInstance:ae.getForInstance,getByType:ae.getByType,define:e=>(ae.register({type:e}),e)});function ce(){return function(e){le.define(e)}}function de(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class he{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,i)=>{e.call(s,t,i),"style"===t&&s.$cssBindings.forEach(((e,t)=>de(t,e.controller,e.observer)))}}const i=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);i.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:i})}connectedCallback(e){de(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){de(this,t.controller,t)}}le.define(he);const ue=`${Math.random().toString(36).substring(2,8)}`;let fe=0;const pe=()=>`--v${ue}${++fe}`;function ge(e,t){const s=[];let n="";const r=[],o=e=>{r.push(e)};for(let r=0,a=e.length-1;r<a;++r){n+=e[r];let a=t[r];i(a)?a=new he(Z(a),pe()).createCSS(o):a instanceof K?a=new he(a,pe()).createCSS(o):void 0!==le.getForInstance(a)&&(a=a.createCSS(o)),a instanceof oe||a instanceof CSSStyleSheet?(""!==n.trim()&&(s.push(n),n=""),s.push(a)):n+=a}return n+=e[e.length-1],""!==n.trim()&&s.push(n),{styles:s,behaviors:r}}const be=(e,...t)=>{const{styles:s,behaviors:i}=ge(e,t),n=new oe(s);return i.length?n.withBehaviors(...i):n};class ve{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(n(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new oe(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}le.define(ve),be.partial=(e,...t)=>{const{styles:s,behaviors:i}=ge(e,t);return new ve(s,i)};const me=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,ye=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,we=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Ce=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Se=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,xe=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Te(e){return e&&e.nodeType===Node.COMMENT_NODE}const Oe=Object.freeze({attributeMarkerName:"data-fe-b",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>me.test(e),isContentBindingEndMarker:e=>ye.test(e),isRepeatViewStartMarker:e=>we.test(e),isRepeatViewEndMarker:e=>Ce.test(e),isElementBoundaryStartMarker:e=>Te(e)&&Se.test(e.data.trim()),isElementBoundaryEndMarker:e=>Te(e)&&xe.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[],s=this.attributeMarkerName.length+1,i=`${this.attributeMarkerName}-`;for(const n of e.getAttributeNames())if(n.startsWith(i)){const e=Number(n.slice(s));if(Number.isNaN(e))throw new Error(`Invalid attribute marker name: ${n}. Expected format is ${i}<number>.`);t.push(e)}return 0===t.length?null:t},parseContentBindingStartMarker:e=>Ne(me,e),parseContentBindingEndMarker:e=>Ne(ye,e),parseRepeatStartMarker:e=>$e(we,e),parseRepeatEndMarker:e=>$e(Ce,e),parseElementBoundaryStartMarker:e=>Be(Se,e.trim()),parseElementBoundaryEndMarker:e=>Be(xe,e)});function $e(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Be(e,t){const s=e.exec(t);return null===s?s:s[1]}function Ne(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const ke=Symbol.for("fe-hydration");function Ae(e){return e[ke]===ke}const Ee="defer-hydration",Me=`fast-${Math.random().toString(36).substring(2,8)}`,Ie=`${Me}{`,je=`}${Me}`,Ve=je.length;let Re=0;const _e=()=>`${Me}-${++Re}`,ze=Object.freeze({interpolation:e=>`${Ie}${e}${je}`,attribute:e=>`${_e()}="${Ie}${e}${je}"`,comment:e=>`\x3c!--${Ie}${e}${je}--\x3e`}),Le=Object.freeze({parse(e,t){const s=e.split(Ie);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(je);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+Ve)}""!==o&&i.push(o)}return i}}),He=c(),Fe=Object.freeze({getForInstance:He.getForInstance,getByType:He.getByType,define:(e,t)=>((t=t||{}).type=e,He.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?u.tokenList:u.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=u.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=u.event;break;default:e.targetAspect=t,e.aspectType=u.attribute}else e.aspectType=u.content}});function Pe(e){return function(t){Fe.define(t,e)}}class De{constructor(e){this.options=e}createHTML(e){return ze.attribute(e(this))}createBehavior(){return this}}h(De);class Ue extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function qe(e){return e.nodeType===Node.COMMENT_NODE}function Qe(e){return e.nodeType===Node.TEXT_NODE}function We(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,qe(t)||Qe(t)?t.data.length:t.childNodes.length),s}function Xe(e,t,s){var i;const n=null!==(i=Oe.parseAttributeBinding(e))&&void 0!==i?i:Oe.parseEnumeratedAttributeBinding(e);if(null!==n){for(const i of n){if(!t[i])throw new Ue(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);Ge(t[i],e,s)}e.removeAttribute(Oe.attributeMarkerName)}}function Je(e,t,s,i,n){if(Oe.isElementBoundaryStartMarker(e))!function(e,t){const s=Oe.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(qe(i)){const e=Oe.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(Oe.isContentBindingStartMarker(e.data)){const r=Oe.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],c=[];let d=t.nextSibling();e.data="";const h=d;for(;null!==d;){if(qe(d)){const e=Oe.parseContentBindingEndMarker(d.data);if(e&&e[1]===a)break}c.push(d),d=t.nextSibling()}if(null===d){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(d.data="",1===c.length&&Qe(c[0]))Ge(l,c[0],i);else{d!==h&&null!==d.previousSibling&&(n[l.targetNodeId]={first:h,last:d.previousSibling});Ge(l,d.parentNode.insertBefore(document.createTextNode(""),d),i)}}}function Ge(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var Ke;function Ye(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;){if(i=n.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(n),n=i}s.removeChild(t)}class Ze{constructor(){this.index=0,this.length=0}get event(){return V.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class et extends Ze{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=A.unknown,this.context=this,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 i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){Ye(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){Ye(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}h(et),E.defineProperty(et.prototype,"index"),E.defineProperty(et.prototype,"length");const tt="unhydrated",st="hydrating",it="hydrated";class nt extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}Ke=ke,h(class extends Ze{constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[Ke]=ke,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=A.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=tt,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}insertBefore(e){if(null!==this.fragment)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 i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,i=this.firstChild;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=s}e.appendChild(t)}bind(e,t=this){var s;if(this.hydrationStage!==it&&(this._hydrationStage=st),this.source===e)return;let i=this.behaviors;if(null===i){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=We(e,t),n=i.commonAncestorContainer,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===i.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={};let l=r.currentNode=e;for(;null!==l;){switch(l.nodeType){case Node.ELEMENT_NODE:Xe(l,s,o);break;case Node.COMMENT_NODE:Je(l,r,s,o,a)}l=r.nextNode()}return i.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof Ue){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=i=new Array(this.factories.length);const n=this.factories;for(let e=0,t=n.length;e<t;++e){const t=n[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&Ge(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host,n=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==i?void 0:i.nodeName)||"unknown").toLowerCase()}>".`,"\nMismatch Details:",` - Expected target node ID: "${t.targetNodeId}"`,` - Available target IDs: [${Object.keys(this.targets).join(", ")||"none"}]`];throw t.targetTagName&&r.push(` - Expected tag name: "${t.targetTagName}"`),n.sourceAspect&&r.push(` - Source aspect: "${n.sourceAspect}"`),void 0!==n.aspectType&&r.push(` - Aspect type: ${n.aspectType}`),r.push("\nThis usually means:"," 1. The server-rendered HTML doesn't match the client template"," 2. The hydration markers are missing or corrupted"," 3. The DOM structure was modified before hydration",`\nTemplate: ${e.slice(0,200)}${e.length>200?"...":""}`),new nt(r.join("\n"),t,We(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),i[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=i.length;e<t;++e)i[e].bind(this)}this.isBound=!0,this._hydrationStage=it}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){Ye(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}});const rt={[u.attribute]:v.setAttribute,[u.booleanAttribute]:v.setBooleanAttribute,[u.property]:(e,t,s)=>e[t]=s,[u.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Ae(i)&&Ae(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==it){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[u.tokenList]:function(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[u.event]:()=>{}};class ot{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=u.content}createHTML(e){return ze.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=rt[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw a.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],i=Ae(e)&&e.hydrationStage&&e.hydrationStage!==it;switch(this.aspectType){case u.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case u.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(n.target=s,n.controller=e,i&&(this.aspectType===u.attribute||this.aspectType===u.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){V.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);V.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}Fe.define(ot,{aspected:!0});const at=(e,t)=>`${e}.${t}`,lt={},ct={index:0,node:null};function dt(e){e.startsWith("fast-")||a.warn(1204,{name:e})}const ht=new Proxy(document.createElement("div"),{get(e,t){dt(t);const s=Reflect.get(e,t);return i(s)?s.bind(e):s},set:(e,t,s)=>(dt(t),Reflect.set(e,t,s))});class ut{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i,n){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.id=null!==(r=e.id)&&void 0!==r?r:_e(),e.targetNodeId=s,e.targetTagName=n,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=lt[t];if(!n){const i=`_${t}`;lt[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:ht;for(const e of this.nodeIds)s[e];return new et(t,this.factories,s)}}function ft(e,t,s,i,n,r=!1){const o=s.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=Le.parse(h,a);let f=null;null===u?r&&(f=new ot(se((()=>h),e.policy)),Fe.assignAspect(f,d.name)):f=vt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,i,n,s.tagName))}}function pt(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=gt(e,s,n,i);n=t.node,i=t.index}}function gt(e,t,s,i){const r=at(t,i);switch(s.nodeType){case 1:ft(e,t,s,r,i),pt(e,s,r);break;case 3:return function(e,t,s,i,r){const o=Le.parse(t.textContent,e.directives);if(null===o)return ct.node=t.nextSibling,ct.index=r+1,ct;let a,l=a=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(r++,i=at(s,r),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),n(c)?a.textContent=c:(a.textContent=" ",Fe.assignAspect(c),e.addFactory(c,s,i,r,null)),l=a}return ct.index=r+1,ct.node=l.nextSibling,ct}(e,s,t,r,i);case 8:const o=Le.parse(s.data,e.directives);null!==o&&e.addFactory(vt.aggregate(o),t,r,i,null)}return ct.index=i+1,ct.node=s.nextSibling,ct}const bt="TEMPLATE",vt={compile(e,t,s=v.policy){let i;if(n(e)){i=document.createElement(bt),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===bt&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const r=document.adoptNode(i.content),o=new ut(r,t,s);var a,l;return ft(o,"",i,"h",0,!0),a=r.firstChild,l=t,(a&&8==a.nodeType&&null!==Le.parse(a.data,l)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),pt(o,r,"r"),ct.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=v.policy){if(1===e.length)return e[0];let s,i,r=!1;const o=e.length,a=e.map((e=>n(e)?()=>e:(s=e.sourceAspect||s,r=r||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),l=new ot(Z(((e,t)=>{let s="";for(let i=0;i<o;++i)s+=a[i](e,t);return s}),null!=i?i:t,r));return Fe.assignAspect(l,s),l}},mt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,yt=Object.create(null);class wt{constructor(e,t=yt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Ct(e,t,s,i=Fe.getForInstance(e)){if(i.aspected){const s=mt.exec(t);null!==s&&Fe.assignAspect(e,s[2])}return e.createHTML(s)}wt.empty=new wt(""),Fe.define(wt);class St{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=vt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new wt(n(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw a.error(1208);if(this.policy)throw a.error(1207);return this.policy=e,this}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}static create(e,t,s){let n="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=_e();return r[s]=e,s};for(let s=0,r=e.length-1;s<r;++s){const r=e[s];let a,l=t[s];if(n+=r,i(l))l=new ot(Z(l));else if(l instanceof K)l=new ot(l);else if(!(a=Fe.getForInstance(l))){const e=l;l=new ot(se((()=>e)))}n+=Ct(l,r,o,a)}return new St(n+e[e.length-1],r,s)}}h(St);const xt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return St.create(e,t);throw a.error(1206)};xt.partial=e=>new wt(e);class Tt extends De{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}Fe.define(Tt);const Ot=e=>new Tt(e),$t=()=>null;function Bt(e){return void 0===e?$t:i(e)?e:()=>e}function Nt(e,t,s){const n=i(e)?e:()=>e,r=Bt(t),o=Bt(s);return(e,t)=>n(e,t)?r(e,t):o(e,t)}const kt=Object.freeze({positioning:!1,recycle:!0});function At(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Et(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function Mt(e){return e.nodeType===Node.COMMENT_NODE}class It extends Error{constructor(e,t){super(e),this.propertyBag=t}}class jt{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=At,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=Et)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Ae(this.template)&&Ae(e)&&e.hydrationStage!==it?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=l);const t=this.itemsObserver,s=this.itemsObserver=E.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,i=e.length;s<i;++s){const i=e[s].sorted.slice(),n=i.slice().sort();for(let e=0,s=i.length;e<s;++e){const s=i.find((t=>i[e]===n[t]));if(s!==e){const i=n.splice(s,1);n.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let f=0,p=h.index;const g=p+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;p<g;++p){const e=t[p],d=e?e.firstChild:this.location;let h;o&&c>0?(f<=v&&b.length>0?(h=b[f],f++):(h=a[l],l++),c--):h=n.create(),t.splice(p,0,h),s(h,i,p,r),h.insertBefore(d)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(et.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),a[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<l){const i=a[e];if(!i){const t=new XMLSerializer;throw new It(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}n(i,t,e,r)}else{const o=s.create();n(o,t,e,r),a.push(o),o.insertBefore(i)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new It(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:s.serializeToString(this.location.getRootNode())})}s.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!Mt(t)){t=t.previousSibling;continue}const s=Oe.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const i=t.previousSibling;if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=i,r=0;for(;null!==n;){if(Mt(n))if(Oe.isRepeatViewEndMarker(n.data))r++;else if(Oe.isRepeatViewStartMarker(n.data)){if(!r){if(Oe.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const r=e.hydrate(n,i);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class Vt{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,X.enable()}createHTML(e){return ze.comment(e(this))}createBehavior(){return new jt(this)}}function Rt(e,t,s=kt){const i=ie(e),n=ie(t);return new Vt(i,n,Object.assign(Object.assign({},kt),s))}Fe.define(Vt);const _t=e=>1===e.nodeType,zt=e=>e?t=>1===t.nodeType&&t.matches(e):_t;class Lt extends De{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,l),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const Ht="slotchange";class Ft extends Lt{observe(e){e.addEventListener(Ht,this)}disconnect(e){e.removeEventListener(Ht,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Pt(e){return n(e)&&(e={property:e}),new Ft(e)}Fe.define(Ft);class Dt extends Lt{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=r,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Ut(e){return n(e)&&(e={property:e}),new Dt(e)}function qt(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))}Fe.define(Dt),"function"==typeof SuppressedError&&SuppressedError;const Qt="boolean",Wt="reflect",Xt=Object.freeze({locate:d()}),Jt={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Gt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Jt.fromView(e)};function Kt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Yt={toView(e){const t=Kt(e);return t?t.toString():t},fromView:Kt};class Zt{constructor(e,t,s=t.toLowerCase(),i=Wt,n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i===Qt&&void 0===n&&(this.converter=Jt)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return E.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||B.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case Wt:const t=this.converter;v.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case Qt:v.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(Xt.locate(e));for(let i=0,r=t.length;i<r;++i){const r=t[i];if(void 0!==r)for(let t=0,i=r.length;t<i;++t){const i=r[t];n(i)?s.push(new Zt(e,i)):s.push(new Zt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function es(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),Xt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const ts={mode:"open"},ss={},is=new Set,ns=a.getById(s.elementRegistry,(()=>c())),rs={deferAndHydrate:"defer-and-hydrate"};class os{constructor(e,t=e.definition){var s;this.platformDefined=!1,n(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.templateOptions=t.templateOptions,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,r=Zt.collect(e,t.attributes),o=new Array(r.length),a={},l={};for(let e=0,t=r.length;e<t;++e){const t=r[e];o[e]=t.attribute,a[t.name]=t,l[t.attribute]=t,E.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=r,this.propertyLookup=a,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?ts:null===t.shadowOptions?void 0:Object.assign(Object.assign({},ts),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?ss:Object.assign(Object.assign({},ss),t.elementOptions),this.styles=oe.normalize(t.styles),ns.register(this),E.defineProperty(os.isRegistered,this.name),os.isRegistered[this.name]=this.type}get isDefined(){return this.platformDefined}define(e=this.registry){var t,s;const i=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,i,this.elementOptions),null===(s=null===(t=this.lifecycleCallbacks)||void 0===t?void 0:t.elementDidDefine)||void 0===s||s.call(t,this.name)),this}static compose(e,t){return is.has(e)||ns.getByType(e)?new os(class extends e{},t):new os(e,t)}static registerBaseType(e){is.add(e)}static composeAsync(e,t){return new Promise((s=>{(is.has(e)||ns.getByType(e))&&s(new os(class extends e{},t));const i=new os(e,t);E.getNotifier(i).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=i.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,i.name),s(i)}},"template")}))}}os.isRegistered={},os.getByType=ns.getByType,os.getForInstance=ns.getForInstance,os.registerAsync=e=>qt(void 0,void 0,void 0,(function*(){return new Promise((t=>{os.isRegistered[e]&&t(os.isRegistered[e]),E.getNotifier(os.isRegistered).subscribe({handleChange:()=>t(os.isRegistered[e])},e)}))})),E.defineProperty(os.prototype,"template");class as{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Ae(this.template)&&Ae(e)&&e.hydrationStage!==it&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class ls{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return ze.comment(e(this))}createBehavior(){return new as(this)}}Fe.define(ls);const cs=new Map,ds={":model":e=>e},hs=Symbol("RenderInstruction"),us="default-view",fs=xt`
1
+ let e;const t="fast-kernel";try{if(document.currentScript)e=document.currentScript.getAttribute(t);else{const s=document.getElementsByTagName("script");e=s[s.length-1].getAttribute(t)}}catch(t){e="isolate"}let s;switch(e){case"share":s=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":s=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;s=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const i=e=>"function"==typeof e,n=e=>"string"==typeof e,r=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}(),"requestIdleCallback"in globalThis||(globalThis.requestIdleCallback=function(e,t){const s=Date.now();return setTimeout((()=>{e({didTimeout:!!(null==t?void 0:t.timeout)&&Date.now()-s>=t.timeout,timeRemaining:()=>0})}),1)},globalThis.cancelIdleCallback=function(e){clearTimeout(e)});const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const a=globalThis.FAST;if(void 0===a.getById){const e=Object.create(null);Reflect.defineProperty(a,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},o))}void 0===a.error&&Object.assign(a,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const l=Object.freeze([]);function c(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function d(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function h(e){e.prototype.toJSON=r}const u=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),f=e=>e,p=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:f}):{createHTML:f};let g=Object.freeze({createHTML:e=>p.createHTML(e),protect:(e,t,s,i)=>i});const b=g,v=Object.freeze({get policy(){return g},setPolicy(e){if(g!==b)throw a.error(1201);g=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function m(e,t,s,i){return(e,t,s,...r)=>{n(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...r)}}function y(e,t,s,i){throw a.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const w={onabort:y,onauxclick:y,onbeforeinput:y,onbeforematch:y,onblur:y,oncancel:y,oncanplay:y,oncanplaythrough:y,onchange:y,onclick:y,onclose:y,oncontextlost:y,oncontextmenu:y,oncontextrestored:y,oncopy:y,oncuechange:y,oncut:y,ondblclick:y,ondrag:y,ondragend:y,ondragenter:y,ondragleave:y,ondragover:y,ondragstart:y,ondrop:y,ondurationchange:y,onemptied:y,onended:y,onerror:y,onfocus:y,onformdata:y,oninput:y,oninvalid:y,onkeydown:y,onkeypress:y,onkeyup:y,onload:y,onloadeddata:y,onloadedmetadata:y,onloadstart:y,onmousedown:y,onmouseenter:y,onmouseleave:y,onmousemove:y,onmouseout:y,onmouseover:y,onmouseup:y,onpaste:y,onpause:y,onplay:y,onplaying:y,onprogress:y,onratechange:y,onreset:y,onresize:y,onscroll:y,onsecuritypolicyviolation:y,onseeked:y,onseeking:y,onselect:y,onslotchange:y,onstalled:y,onsubmit:y,onsuspend:y,ontimeupdate:y,ontoggle:y,onvolumechange:y,onwaiting:y,onwebkitanimationend:y,onwebkitanimationiteration:y,onwebkitanimationstart:y,onwebkittransitionend:y,onwheel:y},C={elements:{a:{[u.attribute]:{href:m},[u.property]:{href:m}},area:{[u.attribute]:{href:m},[u.property]:{href:m}},button:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},embed:{[u.attribute]:{src:y},[u.property]:{src:y}},form:{[u.attribute]:{action:m},[u.property]:{action:m}},frame:{[u.attribute]:{src:m},[u.property]:{src:m}},iframe:{[u.attribute]:{src:m},[u.property]:{src:m,srcdoc:y}},input:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},link:{[u.attribute]:{href:y},[u.property]:{href:y}},object:{[u.attribute]:{codebase:y,data:y},[u.property]:{codeBase:y,data:y}},script:{[u.attribute]:{src:y,text:y},[u.property]:{src:y,text:y,innerText:y,textContent:y}},style:{[u.property]:{innerText:y,textContent:y}}},aspects:{[u.attribute]:Object.assign({},w),[u.property]:Object.assign({innerHTML:y},w),[u.event]:Object.assign({},w)}};function S(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=r;break;default:s[i]=n}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function x(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=S(r,{});break;default:s[i]=S(n,r)}}for(const t in e)t in s||(s[t]=S(e[t],{}));return Object.freeze(s)}function T(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=x(n,{});break;default:s[i]=x(n,r)}}for(const t in e)t in s||(s[t]=x(e[t],{}));return Object.freeze(s)}function O(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const $=Object.freeze({create(e={}){var t,s;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),n=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=C,Object.freeze({elements:r.elements?T(r.elements,o.elements):o.elements,aspects:r.aspects?x(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,s,i){var r;const o=(null!=e?e:"").toLowerCase(),a=n.elements[o];if(a){const n=O(a,e,t,s,i);if(n)return n}return null!==(r=O(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),B=a.getById(s.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>i=e})}));class N{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class k{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new N(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new N(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const A=Object.freeze({unknown:void 0,coupled:1}),E=a.getById(s.observable,(()=>{const e=B.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let r,o=e=>{throw a.error(1101)};function l(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=o(e):s.set(e,i=new k(e))),i}const c=d();class u{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==r&&r.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];i(r)&&r.call(e,n,t),l(e).notify(this.name)}}}class f extends N{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==A.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=r;let i;r=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{r=s}return i}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,i=l(e),n=null===s?this.first:{};if(n.propertySource=e,n.propertyName=t,n.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;r=void 0,t=s.propertySource[s.propertyName],r=this,e===t&&(this.needsRefresh=!0)}s.next=n}this.last=n}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return h(f),Object.freeze({setArrayObserverFactory(e){o=e},getNotifier:l,track(e,t){r&&r.watch(e,t)},trackVolatile(){r&&(r.needsRefresh=!0)},notify(e,t){l(e).notify(t)},defineProperty(e,t){n(t)&&(t=new u(t)),c(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:c,binding(e,t,s=this.isVolatileBinding(e)){return new f(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function M(e,t){E.defineProperty(e,t)}function I(e,t,s){return Object.assign({},s,{get(){return E.trackVolatile(),s.get.apply(this)}})}const j=a.getById(s.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),V=Object.freeze({default:{index:0,length:0,get event(){return V.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>j.get(),setEvent(e){j.set(e)}});class R{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class _{constructor(e){this.sorted=e}}const z=Object.freeze({reset:1,splice:2,optimized:3}),L=new R(0,l,0);L.reset=!0;const H=[L];function F(e,t,s,i,n,r){let o=0,a=0;const c=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,c)),s===e.length&&r===i.length&&(a=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,c-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return l;if(t===s){const e=new R(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new R(t,[],s-t)];const d=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):l===o?(n.push(3),t--,i=o):(n.push(2),s--,i=a)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,a=s-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===i[n+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,d=l[s][r-1]+1,l[s][r]=c<d?c:d);return l}(e,t,s,i,n,r)),h=[];let u,f=t,p=n;for(let e=0;e<d.length;++e)switch(d[e]){case 0:void 0!==u&&(h.push(u),u=void 0),f++,p++;break;case 1:void 0===u&&(u=new R(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new R(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new R(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&h.push(u),h}function P(e,t){let s=!1,i=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=i,s)continue;const d=(n=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<n?-1:r===o||a===n?0:n<o?r<a?r-o:a-o:a<r?a-n:r-n);if(d>=0){t.splice(l,1),l--,i-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const n=e.removed.length+c.removed.length-d;if(e.addedCount||n){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,a;s||t.push(e)}let D=Object.freeze({support:z.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?l:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)P(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(F(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):H,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new R(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new R(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new _(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new R(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new _(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new R(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new R(0,[],i.length).adjustTo(e)),n}});const U=Object.freeze({reset:H,setDefaultStrategy(e){D=e}});function q(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}class Q extends N{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,q(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,E.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,E.notify(e,"sorted"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:D).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,B.enqueue(this))}}let W=!1;const X=Object.freeze({sorted:0,enable(){if(W)return;W=!0,E.setArrayObserverFactory((e=>new Q(e)));const e=Array.prototype;e.$fastPatch||(q(e,"$fastPatch",1),q(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:D)[t.name](this,i,t,e)}})))}});function J(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=E.getNotifier(e)),E.track(t.lengthObserver,"length"),e.length}function G(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=E.getNotifier(e)),E.track(t.sortObserver,"sorted"),e.sorted}class K{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class Y extends K{createObserver(e){return E.binding(this.evaluate,e,this.isVolatile)}}function Z(e,t,s=E.isVolatileBinding(e)){return new Y(e,t,s)}function ee(e,t){const s=new Y(e);return s.options=t,s}class te extends K{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function se(e,t){return new te(e,t)}function ie(e){return i(e)?Z(e):e instanceof K?e:se((()=>e))}let ne;function re(e){return e.map((e=>e instanceof oe?re(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}h(te);class oe{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof oe?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(ne),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(re(this.styles)),this}static setDefaultStrategy(e){ne=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new oe(e):e instanceof oe?e:new oe([e])}}oe.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const ae=c(),le=Object.freeze({getForInstance:ae.getForInstance,getByType:ae.getByType,define:e=>(ae.register({type:e}),e)});function ce(){return function(e){le.define(e)}}function de(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class he{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,i)=>{e.call(s,t,i),"style"===t&&s.$cssBindings.forEach(((e,t)=>de(t,e.controller,e.observer)))}}const i=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);i.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:i})}connectedCallback(e){de(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){de(this,t.controller,t)}}le.define(he);const ue=`${Math.random().toString(36).substring(2,8)}`;let fe=0;const pe=()=>`--v${ue}${++fe}`;function ge(e,t){const s=[];let n="";const r=[],o=e=>{r.push(e)};for(let r=0,a=e.length-1;r<a;++r){n+=e[r];let a=t[r];i(a)?a=new he(Z(a),pe()).createCSS(o):a instanceof K?a=new he(a,pe()).createCSS(o):void 0!==le.getForInstance(a)&&(a=a.createCSS(o)),a instanceof oe||a instanceof CSSStyleSheet?(""!==n.trim()&&(s.push(n),n=""),s.push(a)):n+=a}return n+=e[e.length-1],""!==n.trim()&&s.push(n),{styles:s,behaviors:r}}const be=(e,...t)=>{const{styles:s,behaviors:i}=ge(e,t),n=new oe(s);return i.length?n.withBehaviors(...i):n};class ve{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(n(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new oe(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}le.define(ve),be.partial=(e,...t)=>{const{styles:s,behaviors:i}=ge(e,t);return new ve(s,i)};const me=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,ye=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,we=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Ce=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Se=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,xe=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Te(e){return e&&e.nodeType===Node.COMMENT_NODE}const Oe=Object.freeze({attributeMarkerName:"data-fe-b",compactAttributeMarkerName:"data-fe-c",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>me.test(e),isContentBindingEndMarker:e=>ye.test(e),isRepeatViewStartMarker:e=>we.test(e),isRepeatViewEndMarker:e=>Ce.test(e),isElementBoundaryStartMarker:e=>Te(e)&&Se.test(e.data.trim()),isElementBoundaryEndMarker:e=>Te(e)&&xe.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[],s=this.attributeMarkerName.length+1,i=`${this.attributeMarkerName}-`;for(const n of e.getAttributeNames())if(n.startsWith(i)){const e=Number(n.slice(s));if(Number.isNaN(e))throw a.error(1601,{name:n,expectedFormat:`${i}<number>`});t.push(e)}return 0===t.length?null:t},parseCompactAttributeBinding(e){const t=`${this.compactAttributeMarkerName}-`,s=e.getAttributeNames().find((e=>e.startsWith(t)));if(!s)return null;const i=s.slice(t.length).split("-"),n=parseInt(i[0],10),r=parseInt(i[1],10);if(2!==i.length||Number.isNaN(n)||Number.isNaN(r)||n<0||r<1)throw a.error(1604,{name:s,expectedFormat:`${this.compactAttributeMarkerName}-{index}-{count}`});const o=[];for(let e=0;e<r;e++)o.push(n+e);return o},parseContentBindingStartMarker:e=>Ne(me,e),parseContentBindingEndMarker:e=>Ne(ye,e),parseRepeatStartMarker:e=>$e(we,e),parseRepeatEndMarker:e=>$e(Ce,e),parseElementBoundaryStartMarker:e=>Be(Se,e.trim()),parseElementBoundaryEndMarker:e=>Be(xe,e)});function $e(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Be(e,t){const s=e.exec(t);return null===s?s:s[1]}function Ne(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const ke=Symbol.for("fe-hydration");function Ae(e){return e[ke]===ke}const Ee="defer-hydration",Me=`fast-${Math.random().toString(36).substring(2,8)}`,Ie=`${Me}{`,je=`}${Me}`,Ve=je.length;let Re=0;const _e=()=>`${Me}-${++Re}`,ze=Object.freeze({interpolation:e=>`${Ie}${e}${je}`,attribute:e=>`${_e()}="${Ie}${e}${je}"`,comment:e=>`\x3c!--${Ie}${e}${je}--\x3e`}),Le=Object.freeze({parse(e,t){const s=e.split(Ie);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(je);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+Ve)}""!==o&&i.push(o)}return i}}),He=c(),Fe=Object.freeze({getForInstance:He.getForInstance,getByType:He.getByType,define:(e,t)=>((t=t||{}).type=e,He.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?u.tokenList:u.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=u.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=u.event;break;default:e.targetAspect=t,e.aspectType=u.attribute}else e.aspectType=u.content}});function Pe(e){return function(t){Fe.define(t,e)}}class De{constructor(e){this.options=e}createHTML(e){return ze.attribute(e(this))}createBehavior(){return this}}h(De);class Ue extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function qe(e){return e.nodeType===Node.COMMENT_NODE}function Qe(e){return e.nodeType===Node.TEXT_NODE}function We(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,qe(t)||Qe(t)?t.data.length:t.childNodes.length),s}function Xe(e,t,s){var i,n;const r=null!==(n=null!==(i=Oe.parseAttributeBinding(e))&&void 0!==i?i:Oe.parseEnumeratedAttributeBinding(e))&&void 0!==n?n:Oe.parseCompactAttributeBinding(e);if(null!==r){for(const i of r){if(!t[i])throw new Ue(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);Ge(t[i],e,s)}e.removeAttribute(Oe.attributeMarkerName)}}function Je(e,t,s,i,n){if(Oe.isElementBoundaryStartMarker(e))!function(e,t){const s=Oe.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(qe(i)){const e=Oe.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(Oe.isContentBindingStartMarker(e.data)){const r=Oe.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],c=[];let d=t.nextSibling();e.data="";const h=d;for(;null!==d;){if(qe(d)){const e=Oe.parseContentBindingEndMarker(d.data);if(e&&e[1]===a)break}c.push(d),d=t.nextSibling()}if(null===d){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(d.data="",1===c.length&&Qe(c[0]))Ge(l,c[0],i);else{d!==h&&null!==d.previousSibling&&(n[l.targetNodeId]={first:h,last:d.previousSibling});Ge(l,d.parentNode.insertBefore(document.createTextNode(""),d),i)}}}function Ge(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var Ke;function Ye(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;){if(i=n.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(n),n=i}s.removeChild(t)}class Ze{constructor(){this.index=0,this.length=0}get event(){return V.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class et extends Ze{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=A.unknown,this.context=this,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 i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){Ye(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){Ye(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}h(et),E.defineProperty(et.prototype,"index"),E.defineProperty(et.prototype,"length");const tt="unhydrated",st="hydrating",it="hydrated";class nt extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}Ke=ke,h(class extends Ze{constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[Ke]=ke,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=A.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=tt,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}insertBefore(e){if(null!==this.fragment)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 i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,i=this.firstChild;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=s}e.appendChild(t)}bind(e,t=this){var s;if(this.hydrationStage!==it&&(this._hydrationStage=st),this.source===e)return;let i=this.behaviors;if(null===i){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=We(e,t),n=i.commonAncestorContainer,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===i.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={};let l=r.currentNode=e;for(;null!==l;){switch(l.nodeType){case Node.ELEMENT_NODE:Xe(l,s,o);break;case Node.COMMENT_NODE:Je(l,r,s,o,a)}l=r.nextNode()}return i.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof Ue){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=i=new Array(this.factories.length);const n=this.factories;for(let e=0,t=n.length;e<t;++e){const t=n[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&Ge(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host,n=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==i?void 0:i.nodeName)||"unknown").toLowerCase()}>".`,"\nMismatch Details:",` - Expected target node ID: "${t.targetNodeId}"`,` - Available target IDs: [${Object.keys(this.targets).join(", ")||"none"}]`];throw t.targetTagName&&r.push(` - Expected tag name: "${t.targetTagName}"`),n.sourceAspect&&r.push(` - Source aspect: "${n.sourceAspect}"`),void 0!==n.aspectType&&r.push(` - Aspect type: ${n.aspectType}`),r.push("\nThis usually means:"," 1. The server-rendered HTML doesn't match the client template"," 2. The hydration markers are missing or corrupted"," 3. The DOM structure was modified before hydration",`\nTemplate: ${e.slice(0,200)}${e.length>200?"...":""}`),new nt(r.join("\n"),t,We(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),i[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=i.length;e<t;++e)i[e].bind(this)}this.isBound=!0,this._hydrationStage=it}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){Ye(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}});const rt={[u.attribute]:v.setAttribute,[u.booleanAttribute]:v.setBooleanAttribute,[u.property]:(e,t,s)=>e[t]=s,[u.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Ae(i)&&Ae(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==it){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[u.tokenList]:function(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[u.event]:()=>{}};class ot{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=u.content}createHTML(e){return ze.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=rt[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw a.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],i=Ae(e)&&e.hydrationStage&&e.hydrationStage!==it;switch(this.aspectType){case u.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case u.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(n.target=s,n.controller=e,i&&(this.aspectType===u.attribute||this.aspectType===u.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){V.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);V.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}Fe.define(ot,{aspected:!0});const at=(e,t)=>`${e}.${t}`,lt={},ct={index:0,node:null};function dt(e){e.startsWith("fast-")||a.warn(1204,{name:e})}const ht=new Proxy(document.createElement("div"),{get(e,t){dt(t);const s=Reflect.get(e,t);return i(s)?s.bind(e):s},set:(e,t,s)=>(dt(t),Reflect.set(e,t,s))});class ut{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i,n){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.id=null!==(r=e.id)&&void 0!==r?r:_e(),e.targetNodeId=s,e.targetTagName=n,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=lt[t];if(!n){const i=`_${t}`;lt[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:ht;for(const e of this.nodeIds)s[e];return new et(t,this.factories,s)}}function ft(e,t,s,i,n,r=!1){const o=s.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=Le.parse(h,a);let f=null;null===u?r&&(f=new ot(se((()=>h),e.policy)),Fe.assignAspect(f,d.name)):f=vt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,i,n,s.tagName))}}function pt(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=gt(e,s,n,i);n=t.node,i=t.index}}function gt(e,t,s,i){const r=at(t,i);switch(s.nodeType){case 1:ft(e,t,s,r,i),pt(e,s,r);break;case 3:return function(e,t,s,i,r){const o=Le.parse(t.textContent,e.directives);if(null===o)return ct.node=t.nextSibling,ct.index=r+1,ct;let a,l=a=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(r++,i=at(s,r),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),n(c)?a.textContent=c:(a.textContent=" ",Fe.assignAspect(c),e.addFactory(c,s,i,r,null)),l=a}return ct.index=r+1,ct.node=l.nextSibling,ct}(e,s,t,r,i);case 8:const o=Le.parse(s.data,e.directives);null!==o&&e.addFactory(vt.aggregate(o),t,r,i,null)}return ct.index=i+1,ct.node=s.nextSibling,ct}const bt="TEMPLATE",vt={compile(e,t,s=v.policy){let i;if(n(e)){i=document.createElement(bt),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===bt&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const r=document.adoptNode(i.content),o=new ut(r,t,s);var a,l;return ft(o,"",i,"h",0,!0),a=r.firstChild,l=t,(a&&8==a.nodeType&&null!==Le.parse(a.data,l)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),pt(o,r,"r"),ct.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=v.policy){if(1===e.length)return e[0];let s,i,r=!1;const o=e.length,a=e.map((e=>n(e)?()=>e:(s=e.sourceAspect||s,r=r||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),l=new ot(Z(((e,t)=>{let s="";for(let i=0;i<o;++i)s+=a[i](e,t);return s}),null!=i?i:t,r));return Fe.assignAspect(l,s),l}},mt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,yt=Object.create(null);class wt{constructor(e,t=yt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Ct(e,t,s,i=Fe.getForInstance(e)){if(i.aspected){const s=mt.exec(t);null!==s&&Fe.assignAspect(e,s[2])}return e.createHTML(s)}wt.empty=new wt(""),Fe.define(wt);class St{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=vt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new wt(n(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw a.error(1208);if(this.policy)throw a.error(1207);return this.policy=e,this}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}static create(e,t,s){let n="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=_e();return r[s]=e,s};for(let s=0,r=e.length-1;s<r;++s){const r=e[s];let a,l=t[s];if(n+=r,i(l))l=new ot(Z(l));else if(l instanceof K)l=new ot(l);else if(!(a=Fe.getForInstance(l))){const e=l;l=new ot(se((()=>e)))}n+=Ct(l,r,o,a)}return new St(n+e[e.length-1],r,s)}}h(St);const xt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return St.create(e,t);throw a.error(1206)};xt.partial=e=>new wt(e);class Tt extends De{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}Fe.define(Tt);const Ot=e=>new Tt(e),$t=()=>null;function Bt(e){return void 0===e?$t:i(e)?e:()=>e}function Nt(e,t,s){const n=i(e)?e:()=>e,r=Bt(t),o=Bt(s);return(e,t)=>n(e,t)?r(e,t):o(e,t)}const kt=Object.freeze({positioning:!1,recycle:!0});function At(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Et(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function Mt(e){return e.nodeType===Node.COMMENT_NODE}class It extends Error{constructor(e,t){super(e),this.propertyBag=t}}class jt{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=At,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=Et)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Ae(this.template)&&Ae(e)&&e.hydrationStage!==it?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=l);const t=this.itemsObserver,s=this.itemsObserver=E.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,i=e.length;s<i;++s){const i=e[s].sorted.slice(),n=i.slice().sort();for(let e=0,s=i.length;e<s;++e){const s=i.find((t=>i[e]===n[t]));if(s!==e){const i=n.splice(s,1);n.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let f=0,p=h.index;const g=p+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;p<g;++p){const e=t[p],d=e?e.firstChild:this.location;let h;o&&c>0?(f<=v&&b.length>0?(h=b[f],f++):(h=a[l],l++),c--):h=n.create(),t.splice(p,0,h),s(h,i,p,r),h.insertBefore(d)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(et.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),a[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<l){const i=a[e];if(!i){const t=new XMLSerializer;throw new It(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}n(i,t,e,r)}else{const o=s.create();n(o,t,e,r),a.push(o),o.insertBefore(i)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new It(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:s.serializeToString(this.location.getRootNode())})}s.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!Mt(t)){t=t.previousSibling;continue}const s=Oe.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const i=t.previousSibling;if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=i,r=0;for(;null!==n;){if(Mt(n))if(Oe.isRepeatViewEndMarker(n.data))r++;else if(Oe.isRepeatViewStartMarker(n.data)){if(!r){if(Oe.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const r=e.hydrate(n,i);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class Vt{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,X.enable()}createHTML(e){return ze.comment(e(this))}createBehavior(){return new jt(this)}}function Rt(e,t,s=kt){const i=ie(e),n=ie(t);return new Vt(i,n,Object.assign(Object.assign({},kt),s))}Fe.define(Vt);const _t=e=>1===e.nodeType,zt=e=>e?t=>1===t.nodeType&&t.matches(e):_t;class Lt extends De{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,l),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const Ht="slotchange";class Ft extends Lt{observe(e){e.addEventListener(Ht,this)}disconnect(e){e.removeEventListener(Ht,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Pt(e){return n(e)&&(e={property:e}),new Ft(e)}Fe.define(Ft);class Dt extends Lt{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=r,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Ut(e){return n(e)&&(e={property:e}),new Dt(e)}function qt(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))}Fe.define(Dt),"function"==typeof SuppressedError&&SuppressedError;const Qt="boolean",Wt="reflect",Xt=Object.freeze({locate:d()}),Jt={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Gt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Jt.fromView(e)};function Kt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Yt={toView(e){const t=Kt(e);return t?t.toString():t},fromView:Kt};class Zt{constructor(e,t,s=t.toLowerCase(),i=Wt,n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i===Qt&&void 0===n&&(this.converter=Jt)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return E.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||B.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case Wt:const t=this.converter;v.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case Qt:v.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(Xt.locate(e));for(let i=0,r=t.length;i<r;++i){const r=t[i];if(void 0!==r)for(let t=0,i=r.length;t<i;++t){const i=r[t];n(i)?s.push(new Zt(e,i)):s.push(new Zt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function es(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),Xt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const ts={mode:"open"},ss={},is=new Set,ns=a.getById(s.elementRegistry,(()=>c())),rs={deferAndHydrate:"defer-and-hydrate"};class os{constructor(e,t=e.definition){var s;this.platformDefined=!1,n(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.templateOptions=t.templateOptions,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,r=Zt.collect(e,t.attributes),o=new Array(r.length),a={},l={};for(let e=0,t=r.length;e<t;++e){const t=r[e];o[e]=t.attribute,a[t.name]=t,l[t.attribute]=t,E.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=r,this.propertyLookup=a,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?ts:null===t.shadowOptions?void 0:Object.assign(Object.assign({},ts),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?ss:Object.assign(Object.assign({},ss),t.elementOptions),this.styles=oe.normalize(t.styles),ns.register(this),E.defineProperty(os.isRegistered,this.name),os.isRegistered[this.name]=this.type}get isDefined(){return this.platformDefined}define(e=this.registry){var t,s;const i=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,i,this.elementOptions),null===(s=null===(t=this.lifecycleCallbacks)||void 0===t?void 0:t.elementDidDefine)||void 0===s||s.call(t,this.name)),this}static compose(e,t){return is.has(e)||ns.getByType(e)?new os(class extends e{},t):new os(e,t)}static registerBaseType(e){is.add(e)}static composeAsync(e,t){return new Promise((s=>{(is.has(e)||ns.getByType(e))&&s(new os(class extends e{},t));const i=new os(e,t);E.getNotifier(i).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=i.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,i.name),s(i)}},"template")}))}}os.isRegistered={},os.getByType=ns.getByType,os.getForInstance=ns.getForInstance,os.registerAsync=e=>qt(void 0,void 0,void 0,(function*(){return new Promise((t=>{os.isRegistered[e]&&t(os.isRegistered[e]),E.getNotifier(os.isRegistered).subscribe({handleChange:()=>t(os.isRegistered[e])},e)}))})),E.defineProperty(os.prototype,"template");class as{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Ae(this.template)&&Ae(e)&&e.hydrationStage!==it&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class ls{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return ze.comment(e(this))}createBehavior(){return new as(this)}}Fe.define(ls);const cs=new Map,ds={":model":e=>e},hs=Symbol("RenderInstruction"),us="default-view",fs=xt`
2
2
  &nbsp;
3
3
  `;function ps(e){return void 0===e?fs:e.template}function gs(e,t){const s=[],n=[],{attributes:r,directives:o,content:a,policy:l}=null!=t?t:{};if(s.push(`<${e}`),r){const e=Object.getOwnPropertyNames(r);for(let t=0,i=e.length;t<i;++t){const i=e[t];0===t?s[0]=`${s[0]} ${i}="`:s.push(`" ${i}="`),n.push(r[i])}s.push('"')}if(o){s[s.length-1]+=" ";for(let e=0,t=o.length;e<t;++e){const t=o[e];s.push(e>0?"":" "),n.push(t)}}if(s[s.length-1]+=">",a&&i(a.create))n.push(a),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=a?a:""}</${e}>`}return St.create(s,n,l)}function bs(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:us;let i;if((n=e).element||n.tagName){let t=e.tagName;if(!t){const s=os.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=ds),i=gs(t,e)}else i=e.template;var n;return{brand:hs,type:e.type,name:s,template:i}}function vs(e){return e&&e.brand===hs}function ms(e,t){const s=cs.get(e);if(void 0!==s)return s[null!=t?t:us]}function ys(e,t){if(e)return ms(e.constructor,t)}Object.freeze({instanceOf:vs,create:bs,createElementTemplate:gs,register:function(e){let t=cs.get(e.type);void 0===t&&cs.set(e.type,t=Object.create(null));const s=vs(e)?e:bs(e);return t[s.name]=s},getByType:ms,getForInstance:ys});class ws{constructor(e){this.node=e,e.$fastTemplate=this}get context(){return this}bind(e){}unbind(){}insertBefore(e){e.parentNode.insertBefore(this.node,e)}remove(){this.node.parentNode.removeChild(this.node)}create(){return this}hydrate(e,t){return this}}function Cs(e,t){let s,r;s=void 0===e?se((e=>e)):ie(e);let o=!1;if(void 0===t)o=!0,r=se(((e,t)=>{var i;const n=s.evaluate(e,t);return n instanceof Node?null!==(i=n.$fastTemplate)&&void 0!==i?i:new ws(n):ps(ys(n))}));else if(i(t))r=Z(((e,i)=>{var r;let o=t(e,i);return n(o)?o=ps(ys(s.evaluate(e,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new ws(o)),o}),void 0,!0);else if(n(t))o=!0,r=se(((e,i)=>{var n;const r=s.evaluate(e,i);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new ws(r):ps(ys(r,t))}));else if(t instanceof K){const e=t.evaluate;t.evaluate=(t,i)=>{var r;let o=e(t,i);return n(o)?o=ps(ys(s.evaluate(t,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new ws(o)),o},r=t}else r=se(((e,s)=>t));return new ls(s,r,o)}class Ss extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:V.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){var s,i,n,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:_e(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:_e(),o.targetTagName=null!==(n=t.tagName)&&void 0!==n?n:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:v.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}});const xs={bubbles:!0,composed:!0,cancelable:!0},Ts="isConnected",Os=new WeakMap;function $s(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Os.get(e))&&void 0!==s?s:null}let Bs;class Ns extends k{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const s=E.getAccessors(e);if(s.length>0){const t=this.boundObservables=Object.create(null);for(let i=0,n=s.length;i<n;++i){const n=s[i].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return E.track(this,Ts),1===this.stage}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:V.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&Os.set(this.source,t))}}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=$s(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=$s(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.removeBehavior(t[e])}}connect(){3===this.stage&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,E.notify(this,Ts))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){1===this.stage&&(this.stage=2,E.notify(this,Ts),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},xs),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=$s(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=A.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const i=os.getForInstance(e);if(void 0===i)throw a.error(1401);return E.getNotifier(i).subscribe({handleChange:()=>{Ns.forCustomElement(e,!0),e.$fastController.connect()}},"template"),E.getNotifier(i).subscribe({handleChange:()=>{Ns.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new Bs(e,i)}static setStrategy(e){Bs=e}}function ks(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=$s(e))&&void 0!==t?t:e.getRootNode()}h(Ns),Ns.setStrategy(Ns);class As{constructor(e){const t=As.styleSheetCache;this.sheets=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}))}addStylesTo(e){js(ks(e),this.sheets)}removeStylesFrom(e){Vs(ks(e),this.sheets)}}As.styleSheetCache=new Map;let Es=0;function Ms(e){return e===document?document.body:e}class Is{constructor(e){this.styles=e,this.styleClass="fast-"+ ++Es}addStylesTo(e){e=Ms(ks(e));const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=(e=Ms(ks(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let js=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Vs=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(oe.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),js=(e,t)=>{e.adoptedStyleSheets.push(...t)},Vs=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}oe.setDefaultStrategy(As)}else oe.setDefaultStrategy(Is);const Rs="needs-hydration";class _s extends Ns{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,(this.hasExistingShadowRoot||void 0!==e&&!this.template)&&this.definition.templateOptions===rs.deferAndHydrate&&(this.source.toggleAttribute(Ee,!0),this.source.toggleAttribute(Rs,!0))}addHydratingInstance(){if(!_s.hydratingInstances)return;const e=this.definition.name;let t=_s.hydratingInstances.get(e);t||(t=new Set,_s.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return _s.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(Ee)||(_s.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,s,i;e.didTimeout?_s.idleCallbackId=requestIdleCallback(_s.checkHydrationComplete,{timeout:50}):0===(null===(t=_s.hydratingInstances)||void 0===t?void 0:t.size)&&(null===(i=null===(s=_s.lifecycleCallbacks)||void 0===s?void 0:s.hydrationComplete)||void 0===i||i.call(s),Ns.setStrategy(Ns))}connect(){var e,t,s,i,n;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(Rs),this.source.hasAttribute(Ee))return this.addHydratingInstance(),void _s.hydrationObserver.observe(this.source,{attributeFilter:[Ee]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(3===this.stage){if(null===(s=null===(t=_s.lifecycleCallbacks)||void 0===t?void 0:t.elementWillHydrate)||void 0===s||s.call(t,this.definition.name),this.stage=0,this.bindObservables(),this.connectBehaviors(),this.template)if(Ae(this.template)){const e=this.source,t=null!==(i=$s(e))&&void 0!==i?i:e;let s=t.firstChild,r=t.lastChild;null===e.shadowRoot&&(Oe.isElementBoundaryStartMarker(s)&&(s.data="",s=s.nextSibling),Oe.isElementBoundaryEndMarker(r)&&(r.data="",r=r.previousSibling)),this.view=this.template.hydrate(s,r,e),null===(n=this.view)||void 0===n||n.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(Rs),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),E.notify(this,Ts)}}removeHydratingInstance(){var e,t;if(!_s.hydratingInstances)return;const s=this.definition.name,i=_s.hydratingInstances.get(s);null===(t=null===(e=_s.lifecycleCallbacks)||void 0===e?void 0:e.elementDidHydrate)||void 0===t||t.call(e,this.definition.name),i&&(i.delete(this.source),i.size||_s.hydratingInstances.delete(s),_s.idleCallbackId&&cancelIdleCallback(_s.idleCallbackId),_s.idleCallbackId=requestIdleCallback(_s.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),_s.hydrationObserver.unobserve(this.source)}static install(){Ns.setStrategy(_s)}}function zs(e){const t=class extends e{constructor(){super(),Ns.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return os.registerBaseType(t),t}function Ls(e,t){return i(e)?os.compose(e,t).define().type:os.compose(this,e).define().type}_s.hydrationObserver=new Ss(_s.hydrationObserverHandler),_s.idleCallbackId=null,_s.hydratingInstances=new Map;const Hs=Object.assign(zs(HTMLElement),{from:function(e){return zs(e)},define:Ls,compose:function(e,t){return i(e)?os.compose(e,t):os.compose(this,e)},defineAsync:function(e,t){return i(e)?new Promise((s=>{os.composeAsync(e,t).then((e=>{s(e)}))})).then((e=>e.define().type)):new Promise((t=>{os.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});function Fs(e){return function(t){Ls(t,e)}}v.setPolicy($.create());export{X as ArrayObserver,Xt as AttributeConfiguration,Zt as AttributeDefinition,K as Binding,he as CSSBindingDirective,le as CSSDirective,Dt as ChildrenDirective,vt as Compiler,v as DOM,u as DOMAspect,Ns as ElementController,oe as ElementStyles,V as ExecutionContext,a as FAST,Hs as FASTElement,os as FASTElementDefinition,ot as HTMLBindingDirective,Fe as HTMLDirective,et as HTMLView,_s as HydratableElementController,nt as HydrationBindingError,wt as InlineTemplateDirective,ze as Markup,Lt as NodeObservationDirective,E as Observable,Le as Parser,k as PropertyChangeNotifier,Tt as RefDirective,as as RenderBehavior,ls as RenderDirective,jt as RepeatBehavior,Vt as RepeatDirective,Ft as SlottedDirective,_ as Sort,A as SourceLifetime,R as Splice,U as SpliceStrategy,z as SpliceStrategySupport,De as StatelessAttachedAttributeDirective,N as SubscriberSet,rs as TemplateOptions,B as Updates,St as ViewTemplate,es as attr,Jt as booleanConverter,Ut as children,be as css,ce as cssDirective,Fs as customElement,Ee as deferHydrationAttribute,zt as elements,l as emptyArray,ns as fastElementRegistry,xt as html,Pe as htmlDirective,Ae as isHydratable,J as lengthOf,ee as listener,Rs as needsHydrationAttribute,ie as normalizeBinding,Gt as nullableBooleanConverter,Yt as nullableNumberConverter,M as observable,se as oneTime,Z as oneWay,Ot as ref,Cs as render,Rt as repeat,Pt as slotted,G as sortedCount,I as volatile,Nt as when};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@microsoft/fast-element",
3
3
  "description": "A library for constructing Web Components",
4
- "version": "2.8.5",
4
+ "version": "2.9.0",
5
5
  "author": {
6
6
  "name": "Microsoft",
7
7
  "url": "https://discord.gg/FcSNfg4"