@microsoft/fast-element 2.10.3 → 2.10.4

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,37 @@
2
2
  "name": "@microsoft/fast-element",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 08 Apr 2026 00:19:52 GMT",
5
+ "date": "Fri, 17 Apr 2026 00:26:33 GMT",
6
+ "version": "2.10.4",
7
+ "tag": "@microsoft/fast-element_v2.10.4",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "7559015+janechu@users.noreply.github.com",
12
+ "package": "@microsoft/fast-element",
13
+ "commit": "c687b2e83ef43fa1170012d29d4bee38e7f97f5a",
14
+ "comment": "fix: guard binding updates against stale notifications after view unbind"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Tue, 14 Apr 2026 00:15:09 GMT",
21
+ "version": "2.10.3",
22
+ "tag": "@microsoft/fast-element_v2.10.3",
23
+ "comments": {
24
+ "none": [
25
+ {
26
+ "author": "7559015+janechu@users.noreply.github.com",
27
+ "package": "@microsoft/fast-element",
28
+ "commit": "e8ce63d65a17c94baf03f271b9fa269b7f27d3e1",
29
+ "comment": "Add test:chromium script for Chromium-only Playwright test runs"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Wed, 08 Apr 2026 00:19:56 GMT",
6
36
  "version": "2.10.3",
7
37
  "tag": "@microsoft/fast-element_v2.10.3",
8
38
  "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 Wed, 08 Apr 2026 00:19:52 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Fri, 17 Apr 2026 00:26:33 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.10.4
8
+
9
+ Fri, 17 Apr 2026 00:26:33 GMT
10
+
11
+ ### Patches
12
+
13
+ - fix: guard binding updates against stale notifications after view unbind (7559015+janechu@users.noreply.github.com)
14
+
7
15
  ## 2.10.3
8
16
 
9
- Wed, 08 Apr 2026 00:19:52 GMT
17
+ Wed, 08 Apr 2026 00:19:56 GMT
10
18
 
11
19
  ### Patches
12
20
 
package/DESIGN.md CHANGED
@@ -371,9 +371,13 @@ flowchart TD
371
371
  SUBS --> ENQ
372
372
  ENQ --> RAF
373
373
  RAF --> EVAL
374
- EVAL --> DOM
374
+ EVAL --> GUARD{"Controller still bound?"}
375
+ GUARD -->|yes| DOM
376
+ GUARD -->|no| DROP["Notification dropped\n(stale observer)"]
375
377
  ```
376
378
 
379
+ > **Stale notification guard**: When a view is unbound (e.g., after a parent `when` directive tears down a child element), the coupled source lifetime optimisation may leave expression observers subscribed to the child element's properties. If a property change fires while the view is inactive, `HTMLBindingDirective.handleChange` and `RenderBehavior.handleChange` check `controller.isBound` and skip the update to prevent evaluating expressions against a null source.
380
+
377
381
  ---
378
382
 
379
383
  ## How the Pieces Fit Together
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "metadata": {
3
3
  "toolPackage": "@microsoft/api-extractor",
4
- "toolVersion": "7.57.7",
4
+ "toolVersion": "7.58.1",
5
5
  "schemaVersion": 1011,
6
6
  "oldestForwardsCompatibleVersion": 1001,
7
7
  "tsdocConfig": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "metadata": {
3
3
  "toolPackage": "@microsoft/api-extractor",
4
- "toolVersion": "7.57.7",
4
+ "toolVersion": "7.58.1",
5
5
  "schemaVersion": 1011,
6
6
  "oldestForwardsCompatibleVersion": 1001,
7
7
  "tsdocConfig": {
@@ -135,6 +135,12 @@ export declare class HTMLBindingDirective implements HTMLDirective, ViewBehavior
135
135
  * Re-evaluates the binding expression via observer.bind() and pushes
136
136
  * the new value to the DOM through the updateTarget sink function.
137
137
  * This is the reactive update path that keeps the DOM in sync with data.
138
+ *
139
+ * Guards against stale notifications: when a view is unbound (e.g., after
140
+ * a parent `when` directive tears down a child element), coupled-lifetime
141
+ * observers may still hold active subscriptions. If a property change fires
142
+ * on the source element while the view is inactive, this guard prevents
143
+ * the binding expression from evaluating with a null source.
138
144
  * @internal
139
145
  */
140
146
  handleChange(binding: Expression, observer: ExpressionObserver): void;
@@ -35,7 +35,13 @@ export declare class RenderBehavior<TSource = any> implements ViewBehavior, Subs
35
35
  * @param controller - The view controller that manages the lifecycle of this behavior.
36
36
  */
37
37
  unbind(controller: ViewController): void;
38
- /** @internal */
38
+ /**
39
+ * Handles changes from data or template binding observers.
40
+ * Guards against stale notifications that may arrive after the
41
+ * controller's view has been unbound (e.g., when a parent `when`
42
+ * directive tears down and later recreates a child element).
43
+ * @internal
44
+ */
39
45
  handleChange(source: any, observer: ExpressionObserver): void;
40
46
  private bindView;
41
47
  private refreshView;
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.57.7"
8
+ "packageVersion": "7.58.1"
9
9
  }
10
10
  ]
11
11
  }
@@ -214,7 +214,7 @@ export class HTMLBindingDirective {
214
214
  case DOMAspect.content:
215
215
  controller.onUnbind(this);
216
216
  // intentional fall through
217
- default:
217
+ default: {
218
218
  const observer = (_a = target[this.data]) !== null && _a !== void 0 ? _a : (target[this.data] = this.dataBinding.createObserver(this, this));
219
219
  observer.target = target;
220
220
  observer.controller = controller;
@@ -227,6 +227,7 @@ export class HTMLBindingDirective {
227
227
  }
228
228
  this.updateTarget(target, this.targetAspect, observer.bind(controller), controller);
229
229
  break;
230
+ }
230
231
  }
231
232
  }
232
233
  /** @internal */
@@ -262,11 +263,22 @@ export class HTMLBindingDirective {
262
263
  * Re-evaluates the binding expression via observer.bind() and pushes
263
264
  * the new value to the DOM through the updateTarget sink function.
264
265
  * This is the reactive update path that keeps the DOM in sync with data.
266
+ *
267
+ * Guards against stale notifications: when a view is unbound (e.g., after
268
+ * a parent `when` directive tears down a child element), coupled-lifetime
269
+ * observers may still hold active subscriptions. If a property change fires
270
+ * on the source element while the view is inactive, this guard prevents
271
+ * the binding expression from evaluating with a null source.
265
272
  * @internal
266
273
  */
267
274
  handleChange(binding, observer) {
268
- const target = observer.target;
269
275
  const controller = observer.controller;
276
+ // https://github.com/microsoft/fast/issues/7444
277
+ // This guard will be reconsidered in the next major version.
278
+ if (!controller.isBound) {
279
+ return;
280
+ }
281
+ const target = observer.target;
270
282
  this.updateTarget(target, this.targetAspect, observer.bind(controller), controller);
271
283
  }
272
284
  }
@@ -62,8 +62,19 @@ export class RenderBehavior {
62
62
  view.needsBindOnly = true;
63
63
  }
64
64
  }
65
- /** @internal */
65
+ /**
66
+ * Handles changes from data or template binding observers.
67
+ * Guards against stale notifications that may arrive after the
68
+ * controller's view has been unbound (e.g., when a parent `when`
69
+ * directive tears down and later recreates a child element).
70
+ * @internal
71
+ */
66
72
  handleChange(source, observer) {
73
+ // https://github.com/microsoft/fast/issues/7444
74
+ // This guard will be reconsidered in the next major version.
75
+ if (!this.controller.isBound) {
76
+ return;
77
+ }
67
78
  if (observer === this.dataBindingObserver) {
68
79
  this.data = this.dataBindingObserver.bind(this.controller);
69
80
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "metadata": {
3
3
  "toolPackage": "@microsoft/api-extractor",
4
- "toolVersion": "7.57.7",
4
+ "toolVersion": "7.58.1",
5
5
  "schemaVersion": 1011,
6
6
  "oldestForwardsCompatibleVersion": 1001,
7
7
  "tsdocConfig": {
@@ -3803,7 +3803,7 @@ class HTMLBindingDirective {
3803
3803
  case DOMAspect.content:
3804
3804
  controller.onUnbind(this);
3805
3805
  // intentional fall through
3806
- default:
3806
+ default: {
3807
3807
  const observer = (_a = target[this.data]) !== null && _a !== void 0 ? _a : (target[this.data] = this.dataBinding.createObserver(this, this));
3808
3808
  observer.target = target;
3809
3809
  observer.controller = controller;
@@ -3816,6 +3816,7 @@ class HTMLBindingDirective {
3816
3816
  }
3817
3817
  this.updateTarget(target, this.targetAspect, observer.bind(controller), controller);
3818
3818
  break;
3819
+ }
3819
3820
  }
3820
3821
  }
3821
3822
  /** @internal */
@@ -3851,11 +3852,22 @@ class HTMLBindingDirective {
3851
3852
  * Re-evaluates the binding expression via observer.bind() and pushes
3852
3853
  * the new value to the DOM through the updateTarget sink function.
3853
3854
  * This is the reactive update path that keeps the DOM in sync with data.
3855
+ *
3856
+ * Guards against stale notifications: when a view is unbound (e.g., after
3857
+ * a parent `when` directive tears down a child element), coupled-lifetime
3858
+ * observers may still hold active subscriptions. If a property change fires
3859
+ * on the source element while the view is inactive, this guard prevents
3860
+ * the binding expression from evaluating with a null source.
3854
3861
  * @internal
3855
3862
  */
3856
3863
  handleChange(binding, observer) {
3857
- const target = observer.target;
3858
3864
  const controller = observer.controller;
3865
+ // https://github.com/microsoft/fast/issues/7444
3866
+ // This guard will be reconsidered in the next major version.
3867
+ if (!controller.isBound) {
3868
+ return;
3869
+ }
3870
+ const target = observer.target;
3859
3871
  this.updateTarget(target, this.targetAspect, observer.bind(controller), controller);
3860
3872
  }
3861
3873
  }
@@ -4191,7 +4203,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
4191
4203
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4192
4204
  PERFORMANCE OF THIS SOFTWARE.
4193
4205
  ***************************************************************************** */
4194
- /* global Reflect, Promise, SuppressedError, Symbol */
4206
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
4195
4207
 
4196
4208
 
4197
4209
  function __awaiter(thisArg, _arguments, P, generator) {
@@ -4829,8 +4841,19 @@ class RenderBehavior {
4829
4841
  view.needsBindOnly = true;
4830
4842
  }
4831
4843
  }
4832
- /** @internal */
4844
+ /**
4845
+ * Handles changes from data or template binding observers.
4846
+ * Guards against stale notifications that may arrive after the
4847
+ * controller's view has been unbound (e.g., when a parent `when`
4848
+ * directive tears down and later recreates a child element).
4849
+ * @internal
4850
+ */
4833
4851
  handleChange(source, observer) {
4852
+ // https://github.com/microsoft/fast/issues/7444
4853
+ // This guard will be reconsidered in the next major version.
4854
+ if (!this.controller.isBound) {
4855
+ return;
4856
+ }
4834
4857
  if (observer === this.dataBindingObserver) {
4835
4858
  this.data = this.dataBindingObserver.bind(this.controller);
4836
4859
  }
@@ -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.",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}."},n=/(\$\{\w+?})/g,s=/\$\{(\w+?)}/g,i=Object.freeze({});function r(e,t){return e.split(n).map((e=>{var n;const i=e.replace(s,"$1");return String(null!==(n=t[i])&&void 0!==n?n:e)})).join("")}let o;Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,n=i){var s;const o=null!==(s=t[e])&&void 0!==s?s:"Unknown Warning";console.warn(r(o,n))},error(e,n=i){var s;const o=null!==(s=t[e])&&void 0!==s?s:"Unknown Error";return new Error(r(o,n))}});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}`})}var c;!function(e){e[e.needsArrayObservation=1101]="needsArrayObservation",e[e.onlySetDOMPolicyOnce=1201]="onlySetDOMPolicyOnce",e[e.bindingInnerHTMLRequiresTrustedTypes=1202]="bindingInnerHTMLRequiresTrustedTypes",e[e.twoWayBindingRequiresObservables=1203]="twoWayBindingRequiresObservables",e[e.hostBindingWithoutHost=1204]="hostBindingWithoutHost",e[e.unsupportedBindingBehavior=1205]="unsupportedBindingBehavior",e[e.directCallToHTMLTagNotAllowed=1206]="directCallToHTMLTagNotAllowed",e[e.onlySetTemplatePolicyOnce=1207]="onlySetTemplatePolicyOnce",e[e.cannotSetTemplatePolicyAfterCompilation=1208]="cannotSetTemplatePolicyAfterCompilation",e[e.blockedByDOMPolicy=1209]="blockedByDOMPolicy",e[e.missingElementDefinition=1401]="missingElementDefinition",e[e.noRegistrationForContext=1501]="noRegistrationForContext",e[e.noFactoryForResolver=1502]="noFactoryForResolver",e[e.invalidResolverStrategy=1503]="invalidResolverStrategy",e[e.cannotAutoregisterDependency=1504]="cannotAutoregisterDependency",e[e.cannotResolveKey=1505]="cannotResolveKey",e[e.cannotConstructNativeFunction=1506]="cannotConstructNativeFunction",e[e.cannotJITRegisterNonConstructor=1507]="cannotJITRegisterNonConstructor",e[e.cannotJITRegisterIntrinsic=1508]="cannotJITRegisterIntrinsic",e[e.cannotJITRegisterInterface=1509]="cannotJITRegisterInterface",e[e.invalidResolver=1510]="invalidResolver",e[e.invalidKey=1511]="invalidKey",e[e.noDefaultResolver=1512]="noDefaultResolver",e[e.cyclicDependency=1513]="cyclicDependency",e[e.connectUpdateRequiresController=1514]="connectUpdateRequiresController"}(c||(c={}));const d=e=>"function"==typeof e,h=e=>"string"==typeof e,u=()=>{};!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 n=Date.now();return setTimeout((()=>{e({didTimeout:!!(null==t?void 0:t.timeout)&&Date.now()-n>=t.timeout,timeRemaining:()=>0})}),1)},globalThis.cancelIdleCallback=function(e){clearTimeout(e)});const p={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},p));const f=globalThis.FAST;if(void 0===f.getById){const e=Object.create(null);Reflect.defineProperty(f,"getById",Object.assign({value(t,n){let s=e[t];return void 0===s&&(s=n?e[t]=n():null),s}},p))}void 0===f.error&&Object.assign(f,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const g=Object.freeze([]);function b(){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 v(){const e=new WeakMap;return function(t){let n=e.get(t);if(void 0===n){let s=Reflect.getPrototypeOf(t);for(;void 0===n&&null!==s;)n=e.get(s),s=Reflect.getPrototypeOf(s);n=void 0===n?[]:n.slice(0),e.set(t,n)}return n}}function m(e){e.prototype.toJSON=u}const y=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),w=e=>e,C=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:w}):{createHTML:w};let S=Object.freeze({createHTML:e=>C.createHTML(e),protect:(e,t,n,s)=>s});const T=S,O=Object.freeze({get policy(){return S},setPolicy(e){if(S!==T)throw f.error(c.onlySetDOMPolicyOnce);S=e},setAttribute(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)},setBooleanAttribute(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}});function x(e,t,n,s){return(e,t,n,...i)=>{h(n)&&(n=n.replace(/(javascript:|vbscript:|data:)/,"")),s(e,t,n,...i)}}function $(e,t,n,s){throw f.error(c.blockedByDOMPolicy,{aspectName:n,tagName:null!=e?e:"text"})}const B={onabort:$,onauxclick:$,onbeforeinput:$,onbeforematch:$,onblur:$,oncancel:$,oncanplay:$,oncanplaythrough:$,onchange:$,onclick:$,onclose:$,oncontextlost:$,oncontextmenu:$,oncontextrestored:$,oncopy:$,oncuechange:$,oncut:$,ondblclick:$,ondrag:$,ondragend:$,ondragenter:$,ondragleave:$,ondragover:$,ondragstart:$,ondrop:$,ondurationchange:$,onemptied:$,onended:$,onerror:$,onfocus:$,onformdata:$,oninput:$,oninvalid:$,onkeydown:$,onkeypress:$,onkeyup:$,onload:$,onloadeddata:$,onloadedmetadata:$,onloadstart:$,onmousedown:$,onmouseenter:$,onmouseleave:$,onmousemove:$,onmouseout:$,onmouseover:$,onmouseup:$,onpaste:$,onpause:$,onplay:$,onplaying:$,onprogress:$,onratechange:$,onreset:$,onresize:$,onscroll:$,onsecuritypolicyviolation:$,onseeked:$,onseeking:$,onselect:$,onslotchange:$,onstalled:$,onsubmit:$,onsuspend:$,ontimeupdate:$,ontoggle:$,onvolumechange:$,onwaiting:$,onwebkitanimationend:$,onwebkitanimationiteration:$,onwebkitanimationstart:$,onwebkittransitionend:$,onwheel:$},k={elements:{a:{[y.attribute]:{href:x},[y.property]:{href:x}},area:{[y.attribute]:{href:x},[y.property]:{href:x}},button:{[y.attribute]:{formaction:x},[y.property]:{formAction:x}},embed:{[y.attribute]:{src:$},[y.property]:{src:$}},form:{[y.attribute]:{action:x},[y.property]:{action:x}},frame:{[y.attribute]:{src:x},[y.property]:{src:x}},iframe:{[y.attribute]:{src:x},[y.property]:{src:x,srcdoc:$}},input:{[y.attribute]:{formaction:x},[y.property]:{formAction:x}},link:{[y.attribute]:{href:$},[y.property]:{href:$}},object:{[y.attribute]:{codebase:$,data:$},[y.property]:{codeBase:$,data:$}},script:{[y.attribute]:{src:$,text:$},[y.property]:{src:$,text:$,innerText:$,textContent:$}},style:{[y.property]:{innerText:$,textContent:$}}},aspects:{[y.attribute]:Object.assign({},B),[y.property]:Object.assign({innerHTML:$},B),[y.event]:Object.assign({},B)}};function N(e,t){const n={};for(const s in t){const i=e[s],r=t[s];switch(i){case null:break;case void 0:n[s]=r;break;default:n[s]=i}}for(const t in e)t in n||(n[t]=e[t]);return Object.freeze(n)}function A(e,t){const n={};for(const s in t){const i=e[s],r=t[s];switch(i){case null:break;case void 0:n[s]=N(r,{});break;default:n[s]=N(i,r)}}for(const t in e)t in n||(n[t]=N(e[t],{}));return Object.freeze(n)}function M(e,t){const n={};for(const s in t){const i=e[s],r=t[s];switch(i){case null:break;case void 0:n[s]=A(i,{});break;default:n[s]=A(i,r)}}for(const t in e)t in n||(n[t]=A(e[t],{}));return Object.freeze(n)}function E(e,t,n,s,i){const r=e[n];if(r){const e=r[s];if(e)return e(t,n,s,i)}}const I=Object.freeze({create(e={}){var t,n;const s=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}}(),i=(r=null!==(n=e.guards)&&void 0!==n?n:{},o=k,Object.freeze({elements:r.elements?M(r.elements,o.elements):o.elements,aspects:r.aspects?A(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>s.createHTML(e),protect(e,t,n,s){var r;const o=(null!=e?e:"").toLowerCase(),a=i.elements[o];if(a){const i=E(a,e,t,n,s);if(i)return i}return null!==(r=E(i.aspects,e,t,n,s))&&void 0!==r?r:s}})}});class R{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 n=t.indexOf(e);-1!==n&&t.splice(n,1)}}notify(e){const t=this.spillover,n=this.subject;if(void 0===t){const t=this.sub1,s=this.sub2;void 0!==t&&t.handleChange(n,e),void 0!==s&&s.handleChange(n,e)}else for(let s=0,i=t.length;s<i;++s)t[s].handleChange(n,e)}}class j{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,n;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(n=this.subjectSubscribers)||void 0===n||n.notify(e)}subscribe(e,t){var n,s;let i;i=t?null!==(n=this.subscribers[t])&&void 0!==n?n:this.subscribers[t]=new R(this.subject):null!==(s=this.subjectSubscribers)&&void 0!==s?s:this.subjectSubscribers=new R(this.subject),i.subscribe(e)}unsubscribe(e,t){var n,s;t?null===(n=this.subscribers[t])||void 0===n||n.unsubscribe(e):null===(s=this.subjectSubscribers)||void 0===s||s.unsubscribe(e)}}const V=f.getById(l.updateQueue,(()=>{const e=[],t=[],n=globalThis.requestAnimationFrame;let s=!0;function i(){if(t.length)throw t.shift()}function r(n){try{n.call()}catch(n){if(!s)throw e.length=0,n;t.push(n),setTimeout(i,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let n=0,s=e.length-t;n<s;n++)e[n]=e[n+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(s?n(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>s=e})})),_=Object.freeze({unknown:void 0,coupled:1}),D=f.getById(l.observable,(()=>{const e=V.enqueue,t=/(:|&&|\|\||if|\?\.)/,n=new WeakMap;let s,i=e=>{throw f.error(c.needsArrayObservation)};function r(e){var t;let s=null!==(t=e.$fastController)&&void 0!==t?t:n.get(e);return void 0===s&&(Array.isArray(e)?s=i(e):n.set(e,s=new j(e))),s}const o=v();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==s&&s.watch(e,this.name),e[this.field]}setValue(e,t){const n=this.field,s=e[n];if(s!==t){e[n]=t;const i=e[this.callback];d(i)&&i.call(e,s,t),r(e).notify(this.name)}}}class l extends R{constructor(e,t,n=!1){super(e,t),this.expression=e,this.isVolatileBinding=n,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!==_.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 n=s;let i;s=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{s=n}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 n=this.last,i=r(e),o=null===n?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=i,i.subscribe(this,t),null!==n){if(!this.needsRefresh){let t;s=void 0,t=n.propertySource[n.propertyName],s=this,e===t&&(this.needsRefresh=!0)}n.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 m(l),Object.freeze({setArrayObserverFactory(e){i=e},getNotifier:r,track(e,t){s&&s.watch(e,t)},trackVolatile(){s&&(s.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){h(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,n=this.isVolatileBinding(e)){return new l(e,t,n)},isVolatileBinding:e=>t.test(e.toString())})}));function L(e,t){D.defineProperty(e,t)}function F(e,t,n){return Object.assign({},n,{get(){return D.trackVolatile(),n.get.apply(this)}})}const H=f.getById(l.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),P=Object.freeze({default:{index:0,length:0,get event(){return P.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>H.get(),setEvent(e){H.set(e)}});class z{constructor(e,t,n){this.index=e,this.removed=t,this.addedCount=n}adjustTo(e){let t=this.index;const n=e.length;return t>n?t=n-this.addedCount:t<0&&(t=n+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class U{constructor(e){this.sorted=e}}const q=Object.freeze({reset:1,splice:2,optimized:3}),W=new z(0,g,0);W.reset=!0;const Q=[W];var J;function K(e,t,n,s,i,r){let o=0,a=0;const l=Math.min(n-t,r-i);if(0===t&&0===i&&(o=function(e,t,n){for(let s=0;s<n;++s)if(e[s]!==t[s])return s;return n}(e,s,l)),n===e.length&&r===s.length&&(a=function(e,t,n){let s=e.length,i=t.length,r=0;for(;r<n&&e[--s]===t[--i];)r++;return r}(e,s,l-o)),i+=o,r-=a,(n-=a)-(t+=o)==0&&r-i==0)return g;if(t===n){const e=new z(t,[],0);for(;i<r;)e.removed.push(s[i++]);return[e]}if(i===r)return[new z(t,[],n-t)];const c=function(e){let t=e.length-1,n=e[0].length-1,s=e[t][n];const i=[];for(;t>0||n>0;){if(0===t){i.push(J.add),n--;continue}if(0===n){i.push(J.delete),t--;continue}const r=e[t-1][n-1],o=e[t-1][n],a=e[t][n-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===s?i.push(J.leave):(i.push(J.update),s=r),t--,n--):l===o?(i.push(J.delete),t--,s=o):(i.push(J.add),n--,s=a)}return i.reverse()}(function(e,t,n,s,i,r){const o=r-i+1,a=n-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 n=1;n<o;++n)for(let r=1;r<a;++r)e[t+r-1]===s[i+n-1]?l[n][r]=l[n-1][r-1]:(c=l[n-1][r]+1,d=l[n][r-1]+1,l[n][r]=c<d?c:d);return l}(e,t,n,s,i,r)),d=[];let h,u=t,p=i;for(let e=0;e<c.length;++e)switch(c[e]){case J.leave:void 0!==h&&(d.push(h),h=void 0),u++,p++;break;case J.update:void 0===h&&(h=new z(u,[],0)),h.addedCount++,u++,h.removed.push(s[p]),p++;break;case J.add:void 0===h&&(h=new z(u,[],0)),h.addedCount++,u++;break;case J.delete:void 0===h&&(h=new z(u,[],0)),h.removed.push(s[p]),p++}return void 0!==h&&d.push(h),d}function X(e,t){let n=!1,s=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=s,n)continue;const d=(i=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<i?-1:r===o||a===i?0:i<o?r<a?r-o:a-o:a<r?a-i:r-i);if(d>=0){t.splice(l,1),l--,s-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const i=e.removed.length+c.removed.length-d;if(e.addedCount||i){let t=c.removed;if(e.index<c.index){const n=e.removed.slice(0,c.index-e.index);n.push(...t),t=n}if(e.index+e.removed.length>c.index+c.addedCount){const n=e.removed.slice(c.index+c.addedCount-e.index);t.push(...n)}e.removed=t,c.index<e.index&&(e.index=c.index)}else n=!0}else if(e.index<c.index){n=!0,t.splice(l,0,e),l++;const i=e.addedCount-e.removed.length;c.index+=i,s+=i}}var i,r,o,a;n||t.push(e)}!function(e){e[e.leave=0]="leave",e[e.update=1]="update",e[e.add=2]="add",e[e.delete=3]="delete"}(J||(J={}));let G=Object.freeze({support:q.optimized,normalize:(e,t,n)=>void 0===e?void 0===n?g:function(e,t){let n=[];const s=[];for(let e=0,n=t.length;e<n;e++)X(t[e],s);for(let t=0,i=s.length;t<i;++t){const i=s[t];1!==i.addedCount||1!==i.removed.length?n=n.concat(K(e,i.index,i.index+i.addedCount,i.removed,0,i.removed.length)):i.removed[0]!==e[i.index]&&n.push(i)}return n}(t,n):Q,pop(e,t,n,s){const i=e.length>0,r=n.apply(e,s);return i&&t.addSplice(new z(e.length,[r],0)),r},push(e,t,n,s){const i=n.apply(e,s);return t.addSplice(new z(e.length-s.length,[],s.length).adjustTo(e)),i},reverse(e,t,n,s){const i=n.apply(e,s);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new U(r)),i},shift(e,t,n,s){const i=e.length>0,r=n.apply(e,s);return i&&t.addSplice(new z(0,[r],0)),r},sort(e,t,n,s){const i=new Map;for(let t=0,n=e.length;t<n;++t){const n=i.get(e[t])||[];i.set(e[t],[...n,t])}const r=n.apply(e,s);e.sorted++;const o=[];for(let t=0,n=e.length;t<n;++t){const n=i.get(e[t]);o.push(n[0]),i.set(e[t],n.splice(1))}return t.addSort(new U(o)),r},splice(e,t,n,s){const i=n.apply(e,s);return t.addSplice(new z(+s[0],i,s.length>2?s.length-2:0).adjustTo(e)),i},unshift(e,t,n,s){const i=n.apply(e,s);return t.addSplice(new z(0,[],s.length).adjustTo(e)),i}});const Y=Object.freeze({reset:Q,setDefaultStrategy(e){G=e}});function Z(e,t,n,s=!0){Reflect.defineProperty(e,t,{value:n,enumerable:!1,writable:s})}class ee extends R{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,D.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,D.notify(e,"sorted"))}},this.subscribe(e)}return e}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,Z(e,"$fastController",this)}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,n=this.sorts,s=this.oldCollection;void 0===t&&void 0===s&&void 0===n||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==n?this.notify(n):this.notify((null!==(e=this._strategy)&&void 0!==e?e:G).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,V.enqueue(this))}}let te=!1;const ne=Object.freeze({sorted:0,enable(){if(te)return;te=!0,D.setArrayObserverFactory((e=>new ee(e)));const e=Array.prototype;e.$fastPatch||(Z(e,"$fastPatch",1),Z(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 n;const s=this.$fastController;return void 0===s?t.apply(this,e):(null!==(n=s.strategy)&&void 0!==n?n:G)[t.name](this,s,t,e)}})))}});function se(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ne.enable(),t=D.getNotifier(e)),D.track(t.lengthObserver,"length"),e.length}function ie(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ne.enable(),t=D.getNotifier(e)),D.track(t.sortObserver,"sorted"),e.sorted}class re{constructor(e,t,n=!1){this.evaluate=e,this.policy=t,this.isVolatile=n}}class oe extends re{createObserver(e){return D.binding(this.evaluate,e,this.isVolatile)}}function ae(e,t,n=D.isVolatileBinding(e)){return new oe(e,t,n)}function le(e,t){const n=new oe(e);return n.options=t,n}class ce extends re{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function de(e,t){return new ce(e,t)}function he(e){return d(e)?ae(e):e instanceof re?e:de((()=>e))}m(ce);const ue=b(),pe=Object.freeze({getForInstance:ue.getForInstance,getByType:ue.getByType,define:e=>(ue.register({type:e}),e)});function fe(){return function(e){pe.define(e)}}function ge(e,t,n){t.source.style.setProperty(e.targetAspect,n.bind(t))}class be{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const n=e.source;if(!n.$cssBindings){n.$cssBindings=new Map;const e=n.setAttribute;n.setAttribute=(t,s)=>{e.call(n,t,s),"style"===t&&n.$cssBindings.forEach(((e,t)=>ge(t,e.controller,e.observer)))}}const s=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);s.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:s})}connectedCallback(e){ge(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){ge(this,t.controller,t)}}let ve;function me(e){return e.map((e=>e instanceof ye?me(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}pe.define(be);class ye{get strategy(){return null===this._strategy&&this.withStrategy(ve),this._strategy}constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ye?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}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(me(this.styles)),this}static setDefaultStrategy(e){ve=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ye(e):e instanceof ye?e:new ye([e])}}ye.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const we=`${Math.random().toString(36).substring(2,8)}`;let Ce=0;const Se=()=>`--v${we}${++Ce}`;function Te(e,t){const n=[];let s="";const i=[],r=e=>{i.push(e)};for(let i=0,o=e.length-1;i<o;++i){s+=e[i];let o=t[i];d(o)?o=new be(ae(o),Se()).createCSS(r):o instanceof re?o=new be(o,Se()).createCSS(r):void 0!==pe.getForInstance(o)&&(o=o.createCSS(r)),o instanceof ye||o instanceof CSSStyleSheet?(""!==s.trim()&&(n.push(s),s=""),n.push(o)):s+=o}return s+=e[e.length-1],""!==s.trim()&&n.push(s),{styles:n,behaviors:i}}const Oe=(e,...t)=>{const{styles:n,behaviors:s}=Te(e,t),i=new ye(n);return s.length?i.withBehaviors(...s):i};class xe{constructor(e,t){this.behaviors=t,this.css="";const n=e.reduce(((e,t)=>(h(t)?this.css+=t:e.push(t),e)),[]);n.length&&(this.styles=new ye(n))}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(xe),Oe.partial=(e,...t)=>{const{styles:n,behaviors:s}=Te(e,t);return new xe(n,s)};const $e=`fast-${Math.random().toString(36).substring(2,8)}`,Be=`${$e}{`,ke=`}${$e}`,Ne=ke.length;let Ae=0;const Me=()=>`${$e}-${++Ae}`,Ee=Object.freeze({interpolation:e=>`${Be}${e}${ke}`,attribute:e=>`${Me()}="${Be}${e}${ke}"`,comment:e=>`\x3c!--${Be}${e}${ke}--\x3e`}),Ie=Object.freeze({parse(e,t){const n=e.split(Be);if(1===n.length)return null;const s=[];for(let e=0,i=n.length;e<i;++e){const i=n[e],r=i.indexOf(ke);let o;if(-1===r)o=i;else{const e=i.substring(0,r);s.push(t[e]),o=i.substring(r+Ne)}""!==o&&s.push(o)}return s}}),Re=b(),je=Object.freeze({getForInstance:Re.getForInstance,getByType:Re.getByType,define:(e,t)=>((t=t||{}).type=e,Re.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?y.tokenList:y.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=y.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=y.event;break;default:e.targetAspect=t,e.aspectType=y.attribute}else e.aspectType=y.content}});function Ve(e){return function(t){je.define(t,e)}}class _e{constructor(e){this.options=e}createHTML(e){return Ee.attribute(e(this))}createBehavior(){return this}}m(_e);const De=e=>1===e.nodeType,Le=e=>e?t=>1===t.nodeType&&t.matches(e):De;class Fe extends _e{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,g),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}}class He extends Fe{constructor(e){super(e),this.observerProperty=Symbol(),e.childList=!0}observe(e){let t=e[this.observerProperty];if(!t){t=new MutationObserver(((t,n)=>{this.updateTarget(this.getSource(e),this.computeNodes(e))})),t.toJSON=u,e[this.observerProperty]=t}t.observe(e,this.options)}disconnect(e){e[this.observerProperty].disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Pe(e){return h(e)&&(e={property:e}),new He(e)}je.define(He);const ze=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,Ue=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,qe=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,We=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Qe=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,Je=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Ke(e){return e&&e.nodeType===Node.COMMENT_NODE}const Xe=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=>ze.test(e),isContentBindingEndMarker:e=>Ue.test(e),isRepeatViewStartMarker:e=>qe.test(e),isRepeatViewEndMarker:e=>We.test(e),isElementBoundaryStartMarker:e=>Ke(e)&&Qe.test(e.data.trim()),isElementBoundaryEndMarker:e=>Ke(e)&&Je.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=[],n=this.attributeMarkerName.length+1,s=`${this.attributeMarkerName}-`;for(const i of e.getAttributeNames())if(i.startsWith(s)){const e=Number(i.slice(n));if(Number.isNaN(e))throw f.error(1601,{name:i,expectedFormat:`${s}<number>`});t.push(e)}return 0===t.length?null:t},parseCompactAttributeBinding(e){const t=`${this.compactAttributeMarkerName}-`,n=e.getAttributeNames().find((e=>e.startsWith(t)));if(!n)return null;const s=n.slice(t.length).split("-"),i=parseInt(s[0],10),r=parseInt(s[1],10);if(2!==s.length||Number.isNaN(i)||Number.isNaN(r)||i<0||r<1)throw f.error(1604,{name:n,expectedFormat:`${this.compactAttributeMarkerName}-{index}-{count}`});const o=[];for(let e=0;e<r;e++)o.push(i+e);return o},parseContentBindingStartMarker:e=>Ze(ze,e),parseContentBindingEndMarker:e=>Ze(Ue,e),parseRepeatStartMarker:e=>Ge(qe,e),parseRepeatEndMarker:e=>Ge(We,e),parseElementBoundaryStartMarker:e=>Ye(Qe,e.trim()),parseElementBoundaryEndMarker:e=>Ye(Je,e)});function Ge(e,t){const n=e.exec(t);return null===n?n:parseInt(n[1])}function Ye(e,t){const n=e.exec(t);return null===n?n:n[1]}function Ze(e,t){const n=e.exec(t);return null===n?n:[parseInt(n[1]),n[2]]}const et=Symbol.for("fe-hydration");function tt(e){return e[et]===et}const nt="defer-hydration";class st extends Error{constructor(e,t,n){super(e),this.factories=t,this.node=n}}function it(e){return e.nodeType===Node.COMMENT_NODE}function rt(e){return e.nodeType===Node.TEXT_NODE}function ot(e,t){const n=document.createRange();return n.setStart(e,0),n.setEnd(t,it(t)||rt(t)?t.data.length:t.childNodes.length),n}function at(e,t,n,s){var i,r;const o=null!==(r=null!==(i=Xe.parseAttributeBinding(e))&&void 0!==i?i:Xe.parseEnumeratedAttributeBinding(e))&&void 0!==r?r:Xe.parseCompactAttributeBinding(e);if(null!==o){for(const i of o){const r=t[i+s];if(!r)throw new st(`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);ct(r,e,n)}e.removeAttribute(Xe.attributeMarkerName)}}function lt(e,t,n,s,i,r){if(Xe.isElementBoundaryStartMarker(e))!function(e,t){const n=Xe.parseElementBoundaryStartMarker(e.data);let s=t.nextSibling();for(;null!==s;){if(it(s)){const e=Xe.parseElementBoundaryEndMarker(s.data);if(e&&e===n)break}s=t.nextSibling()}}(e,t);else if(Xe.isContentBindingStartMarker(e.data)){const o=Xe.parseContentBindingStartMarker(e.data);if(null===o)return;const[a,l]=o,c=n[a+r],d=[];let h=t.nextSibling();e.data="";const u=h;for(;null!==h;){if(it(h)){const e=Xe.parseContentBindingEndMarker(h.data);if(e&&e[1]===l)break}d.push(h),h=t.nextSibling()}if(null===h){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(h.data="",1===d.length&&rt(d[0]))ct(c,d[0],s);else{h!==u&&null!==h.previousSibling&&(i[c.targetNodeId]={first:u,last:h.previousSibling});ct(c,h.parentNode.insertBefore(document.createTextNode(""),h),s)}}}function ct(e,t,n){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");n[e.targetNodeId]=t}var dt;function ht(e,t){const n=e.parentNode;let s,i=e;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);n.removeChild(i),i=s}n.removeChild(t)}class ut{constructor(){this.index=0,this.length=0}get event(){return P.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 pt extends ut{constructor(e,t,n){super(),this.fragment=e,this.factories=t,this.targets=n,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=_.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 n=e.parentNode;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,n.insertBefore(i,e),i=s;n.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let n,s=this.firstChild;for(;s!==t;)n=s.nextSibling,e.appendChild(s),s=n;e.appendChild(t)}dispose(){ht(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t,this.behaviors=n=new Array(this.factories.length);const s=this.factories;for(let e=0,t=s.length;e<t;++e){const t=s[e].createBehavior();t.bind(this),n[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=n.length;e<t;++e)n[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,n=e.length;t<n;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){ht(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,n=e.length;t<n;++t)e[t].unbind()}}}m(pt),D.defineProperty(pt.prototype,"index"),D.defineProperty(pt.prototype,"length");const ft="unhydrated",gt="hydrating",bt="hydrated";class vt extends Error{constructor(e,t,n,s){super(e),this.factory=t,this.fragment=n,this.templateString=s}}dt=et,m(class extends ut{get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}constructor(e,t,n,s){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=n,this.hostBindingTarget=s,this[dt]=et,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=_.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=ft,this._bindingViewBoundaries={},this._targets={},this.factories=n.compile().factories}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 n=e.parentNode;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,n.insertBefore(i,e),i=s;n.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 n,s=this.firstChild;for(;s!==t;){if(n=s.nextSibling,!n)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(s),s=n}e.appendChild(t)}bind(e,t=this){var n;if(this.hydrationStage!==bt&&(this._hydrationStage=gt),this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,n){const s=ot(e,t),i=s.commonAncestorContainer,r=function(e){let t=0;for(let n=0,s=e.length;n<s&&"h"===e[n].targetNodeId;++n)t++;return t}(n),o=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===s.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),a={},l={};let c=o.currentNode=e;for(;null!==c;){switch(c.nodeType){case Node.ELEMENT_NODE:at(c,n,a,r);break;case Node.COMMENT_NODE:lt(c,o,n,a,l,r)}c=o.nextNode()}return s.detach(),{targets:a,boundaries:l}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof st){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}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];if("h"===t.targetNodeId&&this.hostBindingTarget&&ct(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const s=(null===(n=this.firstChild)||void 0===n?void 0:n.getRootNode()).host,i=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==s?void 0:s.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}"`),i.sourceAspect&&r.push(` - Source aspect: "${i.sourceAspect}"`),void 0!==i.aspectType&&r.push(` - Aspect type: ${i.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 vt(r.join("\n"),t,ot(this.firstChild,this.lastChild).cloneContents(),e)}{const n=t.createBehavior();n.bind(this),s[e]=n}}}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,this._hydrationStage=bt}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){ht(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,n=e.length;t<n;++t)e[t].unbind(this);e.length=0}});const mt={[y.attribute]:O.setAttribute,[y.booleanAttribute]:O.setBooleanAttribute,[y.property]:(e,t,n)=>e[t]=n,[y.content]:function(e,t,n,s){if(null==n&&(n=""),function(e){return void 0!==e.create}(n)){e.textContent="";let t=e.$fastView;if(void 0===t)if(tt(s)&&tt(n)&&void 0!==s.bindingViewBoundaries[this.targetNodeId]&&s.hydrationStage!==bt){const e=s.bindingViewBoundaries[this.targetNodeId];t=n.hydrate(e.first,e.last)}else t=n.create();else e.$fastTemplate!==n&&(t.isComposed&&(t.remove(),t.unbind()),t=n.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(s.source,s.context)):(t.isComposed=!0,t.bind(s.source,s.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=n)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=n}},[y.tokenList]:function(e,t,n){var s;const i=`${this.id}-t`,r=null!==(s=e[i])&&void 0!==s?s:e[i]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=n&&n.length){const e=n.split(/\s+/);for(let t=0,n=e.length;t<n;++t){const n=e[t];""!==n&&(o[n]=a,l.add(n))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[y.event]:()=>{}};class yt{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=y.content}createHTML(e){return Ee.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=mt[this.aspectType],n=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw f.error(c.unsupportedBindingBehavior);this.data=`${this.id}-d`,this.updateTarget=n.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const n=e.targets[this.targetNodeId],s=tt(e)&&e.hydrationStage&&e.hydrationStage!==bt;switch(this.aspectType){case y.event:n[this.data]=e,n.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case y.content:e.onUnbind(this);default:const i=null!==(t=n[this.data])&&void 0!==t?t:n[this.data]=this.dataBinding.createObserver(this,this);if(i.target=n,i.controller=e,s&&(this.aspectType===y.attribute||this.aspectType===y.booleanAttribute)){i.bind(e);break}this.updateTarget(n,this.targetAspect,i.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){P.setEvent(e);const n=this.dataBinding.evaluate(t.source,t.context);P.setEvent(null),!0!==n&&e.preventDefault()}}handleChange(e,t){const n=t.target,s=t.controller;this.updateTarget(n,this.targetAspect,t.bind(s),s)}}je.define(yt,{aspected:!0});const wt=(e,t)=>`${e}.${t}`,Ct={},St={index:0,node:null};function Tt(e){e.startsWith("fast-")||f.warn(c.hostBindingWithoutHost,{name:e})}const Ot=new Proxy(document.createElement("div"),{get(e,t){Tt(t);const n=Reflect.get(e,t);return d(n)?n.bind(e):n},set:(e,t,n)=>(Tt(t),Reflect.set(e,t,n))});class xt{constructor(e,t,n){this.fragment=e,this.directives=t,this.policy=n,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,n,s,i){var r,o;this.nodeIds.has(n)||(this.nodeIds.add(n),this.addTargetDescriptor(t,n,s)),e.id=null!==(r=e.id)&&void 0!==r?r:Me(),e.targetNodeId=n,e.targetTagName=i,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,n){const s=this.descriptors;if("r"===t||"h"===t||s[t])return;if(!s[e]){const t=e.lastIndexOf("."),n=e.substring(0,t),s=parseInt(e.substring(t+1),10);this.addTargetDescriptor(n,e,s)}let i=Ct[t];if(!i){const s=`_${t}`;Ct[t]=i={get(){var t;return null!==(t=this[s])&&void 0!==t?t:this[s]=this[e].childNodes[n]}}}s[t]=i}createView(e){const t=this.fragment.cloneNode(!0),n=Object.create(this.proto);n.r=t,n.h=null!=e?e:Ot;for(const e of this.nodeIds)Reflect.get(n,e);return new pt(t,this.factories,n)}}function $t(e,t,n,s,i,r=!1){const o=n.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=Ie.parse(h,a);let p=null;null===u?r&&(p=new yt(de((()=>h),e.policy)),je.assignAspect(p,d.name)):p=At.aggregate(u,e.policy),null!==p&&(n.removeAttributeNode(d),l--,c--,e.addFactory(p,t,s,i,n.tagName))}}function Bt(e,t,n){let s=0,i=t.firstChild;for(;i;){const t=kt(e,n,i,s);i=t.node,s=t.index}}function kt(e,t,n,s){const i=wt(t,s);switch(n.nodeType){case 1:$t(e,t,n,i,s),Bt(e,n,i);break;case 3:return function(e,t,n,s,i){const r=Ie.parse(t.textContent,e.directives);if(null===r)return St.node=t.nextSibling,St.index=i+1,St;let o,a=o=t;for(let t=0,l=r.length;t<l;++t){const l=r[t];0!==t&&(i++,s=wt(n,i),o=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),h(l)?o.textContent=l:(o.textContent=" ",je.assignAspect(l),e.addFactory(l,n,s,i,null)),a=o}return St.index=i+1,St.node=a.nextSibling,St}(e,n,t,i,s);case 8:{const r=Ie.parse(n.data,e.directives);null!==r&&e.addFactory(At.aggregate(r),t,i,s,null);break}}return St.index=s+1,St.node=n.nextSibling,St}const Nt="TEMPLATE",At={compile(e,t,n=O.policy){let s;if(h(e)){s=document.createElement(Nt),s.innerHTML=n.createHTML(e);const t=s.content.firstElementChild;null!==t&&t.tagName===Nt&&(s=t)}else s=e;s.content.firstChild||s.content.lastChild||s.content.appendChild(document.createComment(""));const i=document.adoptNode(s.content),r=new xt(i,t,n);var o,a;return $t(r,"",s,"h",0,!0),o=i.firstChild,a=t,(o&&8===o.nodeType&&null!==Ie.parse(o.data,a)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Bt(r,i,"r"),St.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=O.policy){if(1===e.length)return e[0];let n,s,i=!1;const r=e.length,o=e.map((e=>h(e)?()=>e:(n=e.sourceAspect||n,i=i||e.dataBinding.isVolatile,s=s||e.dataBinding.policy,e.dataBinding.evaluate))),a=new yt(ae(((e,t)=>{let n="";for(let s=0;s<r;++s)n+=o[s](e,t);return n}),null!=s?s:t,i));return je.assignAspect(a,n),a}};class Mt extends _e{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}je.define(Mt);const Et=e=>new Mt(e);function It(e,t,n,s){return new(n||(n=Promise))((function(i,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Rt="boolean",jt="reflect",Vt=Object.freeze({locate:v()}),_t={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Dt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:_t.fromView(e)};function Lt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Ft={toView(e){const t=Lt(e);return t?t.toString():t},fromView:Lt};class Ht{constructor(e,t,n=t.toLowerCase(),s=jt,i){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=n,this.mode=s,this.converter=i,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,s===Rt&&void 0===i&&(this.converter=_t)}setValue(e,t){const n=e[this.fieldName],s=this.converter;void 0!==s&&(t=s.fromView(t)),n!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](n,t),e.$fastController.notify(this.name))}getValue(e){return D.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,n=this.guards;n.has(e)||"fromView"===t||V.enqueue((()=>{n.add(e);const s=e[this.fieldName];switch(t){case jt:const t=this.converter;O.setAttribute(e,this.attribute,void 0!==t?t.toView(s):s);break;case Rt:O.setBooleanAttribute(e,this.attribute,s)}n.delete(e)}))}static collect(e,...t){const n=[];t.push(Vt.locate(e));for(let s=0,i=t.length;s<i;++s){const i=t[s];if(void 0!==i)for(let t=0,s=i.length;t<s;++t){const s=i[t];h(s)?n.push(new Ht(e,s)):n.push(new Ht(e,s.property,s.attribute,s.mode,s.converter))}}return n}}function Pt(e,t){let n;function s(e,t){arguments.length>1&&(n.property=t),Vt.locate(e.constructor).push(n)}return arguments.length>1?(n={},void s(e,t)):(n=void 0===e?{}:e,s)}var zt;const Ut={mode:"open"},qt={},Wt=new Set,Qt=f.getById(l.elementRegistry,(()=>b())),Jt={deferAndHydrate:"defer-and-hydrate"};class Kt{get isDefined(){return this.platformDefined}constructor(e,t=e.definition){var n;this.platformDefined=!1,h(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.templateOptions=t.templateOptions,this.registry=null!==(n=t.registry)&&void 0!==n?n:customElements;const s=e.prototype,i=Ht.collect(e,t.attributes),r=new Array(i.length),o={},a={};for(let e=0,t=i.length;e<t;++e){const t=i[e];r[e]=t.attribute,o[t.name]=t,a[t.attribute]=t,D.defineProperty(s,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=i,this.propertyLookup=o,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?Ut:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Ut),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?qt:Object.assign(Object.assign({},qt),t.elementOptions),this.styles=ye.normalize(t.styles),Qt.register(this),D.defineProperty(zt.isRegistered,this.name),zt.isRegistered[this.name]=this.type}define(e=this.registry){var t,n;const s=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,s,this.elementOptions),null===(n=null===(t=this.lifecycleCallbacks)||void 0===t?void 0:t.elementDidDefine)||void 0===n||n.call(t,this.name)),this}static compose(e,t){return Wt.has(e)||Qt.getByType(e)?new zt(class extends e{},t):new zt(e,t)}static registerBaseType(e){Wt.add(e)}static composeAsync(e,t){return new Promise((n=>{(Wt.has(e)||Qt.getByType(e))&&n(new zt(class extends e{},t));const s=new zt(e,t);D.getNotifier(s).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=s.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,s.name),n(s)}},"template")}))}}zt=Kt,Kt.isRegistered={},Kt.getByType=Qt.getByType,Kt.getForInstance=Qt.getForInstance,Kt.registerAsync=e=>It(void 0,void 0,void 0,(function*(){return new Promise((t=>{zt.isRegistered[e]&&t(zt.isRegistered[e]),D.getNotifier(zt.isRegistered).subscribe({handleChange:()=>t(zt.isRegistered[e])},e)}))})),D.defineProperty(Kt.prototype,"template");const Xt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Gt=Object.create(null);class Yt{constructor(e,t=Gt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const n in t)e(t[n]);return this.html}}function Zt(e,t,n,s=je.getForInstance(e)){if(s.aspected){const n=Xt.exec(t);null!==n&&je.assignAspect(e,n[2])}return e.createHTML(n)}Yt.empty=new Yt(""),je.define(Yt);class en{constructor(e,t={},n){this.policy=n,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=At.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new Yt(h(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw f.error(c.cannotSetTemplatePolicyAfterCompilation);if(this.policy)throw f.error(c.onlySetTemplatePolicyOnce);return this.policy=e,this}render(e,t,n){const s=this.create(n);return s.bind(e),s.appendTo(t),s}static create(e,t,n){let s="";const i=Object.create(null),r=e=>{var t;const n=null!==(t=e.id)&&void 0!==t?t:e.id=Me();return i[n]=e,n};for(let n=0,i=e.length-1;n<i;++n){const i=e[n];let o,a=t[n];if(s+=i,d(a))a=new yt(ae(a));else if(a instanceof re)a=new yt(a);else if(!(o=je.getForInstance(a))){const e=a;a=new yt(de((()=>e)))}s+=Zt(a,i,r,o)}return new en(s+e[e.length-1],i,n)}}m(en);const tn=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return en.create(e,t);throw f.error(c.directCallToHTMLTagNotAllowed)};tn.partial=e=>new Yt(e);class nn{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),tt(this.template)&&tt(e)&&e.hydrationStage!==bt&&!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 sn{constructor(e,t,n){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=n}createHTML(e){return Ee.comment(e(this))}createBehavior(){return new nn(this)}}je.define(sn);const rn=new Map,on="default-view",an=tn`
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}."},n=/(\$\{\w+?})/g,s=/\$\{(\w+?)}/g,i=Object.freeze({});function r(e,t){return e.split(n).map(e=>{var n;const i=e.replace(s,"$1");return String(null!==(n=t[i])&&void 0!==n?n:e)}).join("")}let o;Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,n=i){var s;const o=null!==(s=t[e])&&void 0!==s?s:"Unknown Warning";console.warn(r(o,n))},error(e,n=i){var s;const o=null!==(s=t[e])&&void 0!==s?s:"Unknown Error";return new Error(r(o,n))}});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}`})}var c;!function(e){e[e.needsArrayObservation=1101]="needsArrayObservation",e[e.onlySetDOMPolicyOnce=1201]="onlySetDOMPolicyOnce",e[e.bindingInnerHTMLRequiresTrustedTypes=1202]="bindingInnerHTMLRequiresTrustedTypes",e[e.twoWayBindingRequiresObservables=1203]="twoWayBindingRequiresObservables",e[e.hostBindingWithoutHost=1204]="hostBindingWithoutHost",e[e.unsupportedBindingBehavior=1205]="unsupportedBindingBehavior",e[e.directCallToHTMLTagNotAllowed=1206]="directCallToHTMLTagNotAllowed",e[e.onlySetTemplatePolicyOnce=1207]="onlySetTemplatePolicyOnce",e[e.cannotSetTemplatePolicyAfterCompilation=1208]="cannotSetTemplatePolicyAfterCompilation",e[e.blockedByDOMPolicy=1209]="blockedByDOMPolicy",e[e.missingElementDefinition=1401]="missingElementDefinition",e[e.noRegistrationForContext=1501]="noRegistrationForContext",e[e.noFactoryForResolver=1502]="noFactoryForResolver",e[e.invalidResolverStrategy=1503]="invalidResolverStrategy",e[e.cannotAutoregisterDependency=1504]="cannotAutoregisterDependency",e[e.cannotResolveKey=1505]="cannotResolveKey",e[e.cannotConstructNativeFunction=1506]="cannotConstructNativeFunction",e[e.cannotJITRegisterNonConstructor=1507]="cannotJITRegisterNonConstructor",e[e.cannotJITRegisterIntrinsic=1508]="cannotJITRegisterIntrinsic",e[e.cannotJITRegisterInterface=1509]="cannotJITRegisterInterface",e[e.invalidResolver=1510]="invalidResolver",e[e.invalidKey=1511]="invalidKey",e[e.noDefaultResolver=1512]="noDefaultResolver",e[e.cyclicDependency=1513]="cyclicDependency",e[e.connectUpdateRequiresController=1514]="connectUpdateRequiresController"}(c||(c={}));const d=e=>"function"==typeof e,h=e=>"string"==typeof e,u=()=>{};!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 n=Date.now();return setTimeout(()=>{e({didTimeout:!!(null==t?void 0:t.timeout)&&Date.now()-n>=t.timeout,timeRemaining:()=>0})},1)},globalThis.cancelIdleCallback=function(e){clearTimeout(e)});const f={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},f));const p=globalThis.FAST;if(void 0===p.getById){const e=Object.create(null);Reflect.defineProperty(p,"getById",Object.assign({value(t,n){let s=e[t];return void 0===s&&(s=n?e[t]=n():null),s}},f))}void 0===p.error&&Object.assign(p,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const g=Object.freeze([]);function b(){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 v(){const e=new WeakMap;return function(t){let n=e.get(t);if(void 0===n){let s=Reflect.getPrototypeOf(t);for(;void 0===n&&null!==s;)n=e.get(s),s=Reflect.getPrototypeOf(s);n=void 0===n?[]:n.slice(0),e.set(t,n)}return n}}function m(e){e.prototype.toJSON=u}const y=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),w=e=>e,C=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:w}):{createHTML:w};let S=Object.freeze({createHTML:e=>C.createHTML(e),protect:(e,t,n,s)=>s});const T=S,O=Object.freeze({get policy(){return S},setPolicy(e){if(S!==T)throw p.error(c.onlySetDOMPolicyOnce);S=e},setAttribute(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)},setBooleanAttribute(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}});function x(e,t,n,s){return(e,t,n,...i)=>{h(n)&&(n=n.replace(/(javascript:|vbscript:|data:)/,"")),s(e,t,n,...i)}}function $(e,t,n,s){throw p.error(c.blockedByDOMPolicy,{aspectName:n,tagName:null!=e?e:"text"})}const B={onabort:$,onauxclick:$,onbeforeinput:$,onbeforematch:$,onblur:$,oncancel:$,oncanplay:$,oncanplaythrough:$,onchange:$,onclick:$,onclose:$,oncontextlost:$,oncontextmenu:$,oncontextrestored:$,oncopy:$,oncuechange:$,oncut:$,ondblclick:$,ondrag:$,ondragend:$,ondragenter:$,ondragleave:$,ondragover:$,ondragstart:$,ondrop:$,ondurationchange:$,onemptied:$,onended:$,onerror:$,onfocus:$,onformdata:$,oninput:$,oninvalid:$,onkeydown:$,onkeypress:$,onkeyup:$,onload:$,onloadeddata:$,onloadedmetadata:$,onloadstart:$,onmousedown:$,onmouseenter:$,onmouseleave:$,onmousemove:$,onmouseout:$,onmouseover:$,onmouseup:$,onpaste:$,onpause:$,onplay:$,onplaying:$,onprogress:$,onratechange:$,onreset:$,onresize:$,onscroll:$,onsecuritypolicyviolation:$,onseeked:$,onseeking:$,onselect:$,onslotchange:$,onstalled:$,onsubmit:$,onsuspend:$,ontimeupdate:$,ontoggle:$,onvolumechange:$,onwaiting:$,onwebkitanimationend:$,onwebkitanimationiteration:$,onwebkitanimationstart:$,onwebkittransitionend:$,onwheel:$},k={elements:{a:{[y.attribute]:{href:x},[y.property]:{href:x}},area:{[y.attribute]:{href:x},[y.property]:{href:x}},button:{[y.attribute]:{formaction:x},[y.property]:{formAction:x}},embed:{[y.attribute]:{src:$},[y.property]:{src:$}},form:{[y.attribute]:{action:x},[y.property]:{action:x}},frame:{[y.attribute]:{src:x},[y.property]:{src:x}},iframe:{[y.attribute]:{src:x},[y.property]:{src:x,srcdoc:$}},input:{[y.attribute]:{formaction:x},[y.property]:{formAction:x}},link:{[y.attribute]:{href:$},[y.property]:{href:$}},object:{[y.attribute]:{codebase:$,data:$},[y.property]:{codeBase:$,data:$}},script:{[y.attribute]:{src:$,text:$},[y.property]:{src:$,text:$,innerText:$,textContent:$}},style:{[y.property]:{innerText:$,textContent:$}}},aspects:{[y.attribute]:Object.assign({},B),[y.property]:Object.assign({innerHTML:$},B),[y.event]:Object.assign({},B)}};function N(e,t){const n={};for(const s in t){const i=e[s],r=t[s];switch(i){case null:break;case void 0:n[s]=r;break;default:n[s]=i}}for(const t in e)t in n||(n[t]=e[t]);return Object.freeze(n)}function A(e,t){const n={};for(const s in t){const i=e[s],r=t[s];switch(i){case null:break;case void 0:n[s]=N(r,{});break;default:n[s]=N(i,r)}}for(const t in e)t in n||(n[t]=N(e[t],{}));return Object.freeze(n)}function M(e,t){const n={};for(const s in t){const i=e[s],r=t[s];switch(i){case null:break;case void 0:n[s]=A(i,{});break;default:n[s]=A(i,r)}}for(const t in e)t in n||(n[t]=A(e[t],{}));return Object.freeze(n)}function E(e,t,n,s,i){const r=e[n];if(r){const e=r[s];if(e)return e(t,n,s,i)}}const I=Object.freeze({create(e={}){var t,n;const s=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}}(),i=(r=null!==(n=e.guards)&&void 0!==n?n:{},o=k,Object.freeze({elements:r.elements?M(r.elements,o.elements):o.elements,aspects:r.aspects?A(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>s.createHTML(e),protect(e,t,n,s){var r;const o=(null!=e?e:"").toLowerCase(),a=i.elements[o];if(a){const i=E(a,e,t,n,s);if(i)return i}return null!==(r=E(i.aspects,e,t,n,s))&&void 0!==r?r:s}})}});class R{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 n=t.indexOf(e);-1!==n&&t.splice(n,1)}}notify(e){const t=this.spillover,n=this.subject;if(void 0===t){const t=this.sub1,s=this.sub2;void 0!==t&&t.handleChange(n,e),void 0!==s&&s.handleChange(n,e)}else for(let s=0,i=t.length;s<i;++s)t[s].handleChange(n,e)}}class j{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,n;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(n=this.subjectSubscribers)||void 0===n||n.notify(e)}subscribe(e,t){var n,s;let i;i=t?null!==(n=this.subscribers[t])&&void 0!==n?n:this.subscribers[t]=new R(this.subject):null!==(s=this.subjectSubscribers)&&void 0!==s?s:this.subjectSubscribers=new R(this.subject),i.subscribe(e)}unsubscribe(e,t){var n,s;t?null===(n=this.subscribers[t])||void 0===n||n.unsubscribe(e):null===(s=this.subjectSubscribers)||void 0===s||s.unsubscribe(e)}}const V=p.getById(l.updateQueue,()=>{const e=[],t=[],n=globalThis.requestAnimationFrame;let s=!0;function i(){if(t.length)throw t.shift()}function r(n){try{n.call()}catch(n){if(!s)throw e.length=0,n;t.push(n),setTimeout(i,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let n=0,s=e.length-t;n<s;n++)e[n]=e[n+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(s?n(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>s=e})}),_=Object.freeze({unknown:void 0,coupled:1}),D=p.getById(l.observable,()=>{const e=V.enqueue,t=/(:|&&|\|\||if|\?\.)/,n=new WeakMap;let s,i=e=>{throw p.error(c.needsArrayObservation)};function r(e){var t;let s=null!==(t=e.$fastController)&&void 0!==t?t:n.get(e);return void 0===s&&(Array.isArray(e)?s=i(e):n.set(e,s=new j(e))),s}const o=v();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==s&&s.watch(e,this.name),e[this.field]}setValue(e,t){const n=this.field,s=e[n];if(s!==t){e[n]=t;const i=e[this.callback];d(i)&&i.call(e,s,t),r(e).notify(this.name)}}}class l extends R{constructor(e,t,n=!1){super(e,t),this.expression=e,this.isVolatileBinding=n,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!==_.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 n=s;let i;s=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{s=n}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 n=this.last,i=r(e),o=null===n?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=i,i.subscribe(this,t),null!==n){if(!this.needsRefresh){let t;s=void 0,t=n.propertySource[n.propertyName],s=this,e===t&&(this.needsRefresh=!0)}n.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 m(l),Object.freeze({setArrayObserverFactory(e){i=e},getNotifier:r,track(e,t){s&&s.watch(e,t)},trackVolatile(){s&&(s.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){h(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,n=this.isVolatileBinding(e)){return new l(e,t,n)},isVolatileBinding:e=>t.test(e.toString())})});function L(e,t){D.defineProperty(e,t)}function F(e,t,n){return Object.assign({},n,{get(){return D.trackVolatile(),n.get.apply(this)}})}const H=p.getById(l.contextEvent,()=>{let e=null;return{get:()=>e,set(t){e=t}}}),P=Object.freeze({default:{index:0,length:0,get event(){return P.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>H.get(),setEvent(e){H.set(e)}});class z{constructor(e,t,n){this.index=e,this.removed=t,this.addedCount=n}adjustTo(e){let t=this.index;const n=e.length;return t>n?t=n-this.addedCount:t<0&&(t=n+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class U{constructor(e){this.sorted=e}}const q=Object.freeze({reset:1,splice:2,optimized:3}),W=new z(0,g,0);W.reset=!0;const Q=[W];var J;function K(e,t,n,s){return t<n||s<e?-1:t===n||s===e?0:e<n?t<s?t-n:s-n:s<t?s-e:t-e}function X(e,t,n,s,i,r){let o=0,a=0;const l=Math.min(n-t,r-i);if(0===t&&0===i&&(o=function(e,t,n){for(let s=0;s<n;++s)if(e[s]!==t[s])return s;return n}(e,s,l)),n===e.length&&r===s.length&&(a=function(e,t,n){let s=e.length,i=t.length,r=0;for(;r<n&&e[--s]===t[--i];)r++;return r}(e,s,l-o)),i+=o,r-=a,(n-=a)-(t+=o)===0&&r-i===0)return g;if(t===n){const e=new z(t,[],0);for(;i<r;)e.removed.push(s[i++]);return[e]}if(i===r)return[new z(t,[],n-t)];const c=function(e){let t=e.length-1,n=e[0].length-1,s=e[t][n];const i=[];for(;t>0||n>0;){if(0===t){i.push(J.add),n--;continue}if(0===n){i.push(J.delete),t--;continue}const r=e[t-1][n-1],o=e[t-1][n],a=e[t][n-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===s?i.push(J.leave):(i.push(J.update),s=r),t--,n--):l===o?(i.push(J.delete),t--,s=o):(i.push(J.add),n--,s=a)}return i.reverse()}(function(e,t,n,s,i,r){const o=r-i+1,a=n-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 n=1;n<o;++n)for(let r=1;r<a;++r)e[t+r-1]===s[i+n-1]?l[n][r]=l[n-1][r-1]:(c=l[n-1][r]+1,d=l[n][r-1]+1,l[n][r]=c<d?c:d);return l}(e,t,n,s,i,r)),d=[];let h,u=t,f=i;for(let e=0;e<c.length;++e)switch(c[e]){case J.leave:void 0!==h&&(d.push(h),h=void 0),u++,f++;break;case J.update:void 0===h&&(h=new z(u,[],0)),h.addedCount++,u++,h.removed.push(s[f]),f++;break;case J.add:void 0===h&&(h=new z(u,[],0)),h.addedCount++,u++;break;case J.delete:void 0===h&&(h=new z(u,[],0)),h.removed.push(s[f]),f++}return void 0!==h&&d.push(h),d}function G(e,t){let n=!1,s=0;for(let i=0;i<t.length;i++){const r=t[i];if(r.index+=s,n)continue;const o=K(e.index,e.index+e.removed.length,r.index,r.index+r.addedCount);if(o>=0){t.splice(i,1),i--,s-=r.addedCount-r.removed.length,e.addedCount+=r.addedCount-o;const a=e.removed.length+r.removed.length-o;if(e.addedCount||a){let t=r.removed;if(e.index<r.index){const n=e.removed.slice(0,r.index-e.index);n.push(...t),t=n}if(e.index+e.removed.length>r.index+r.addedCount){const n=e.removed.slice(r.index+r.addedCount-e.index);t.push(...n)}e.removed=t,r.index<e.index&&(e.index=r.index)}else n=!0}else if(e.index<r.index){n=!0,t.splice(i,0,e),i++;const o=e.addedCount-e.removed.length;r.index+=o,s+=o}}n||t.push(e)}!function(e){e[e.leave=0]="leave",e[e.update=1]="update",e[e.add=2]="add",e[e.delete=3]="delete"}(J||(J={}));let Y=Object.freeze({support:q.optimized,normalize:(e,t,n)=>void 0===e?void 0===n?g:function(e,t){let n=[];const s=[];for(let e=0,n=t.length;e<n;e++)G(t[e],s);for(let t=0,i=s.length;t<i;++t){const i=s[t];1!==i.addedCount||1!==i.removed.length?n=n.concat(X(e,i.index,i.index+i.addedCount,i.removed,0,i.removed.length)):i.removed[0]!==e[i.index]&&n.push(i)}return n}(t,n):Q,pop(e,t,n,s){const i=e.length>0,r=n.apply(e,s);return i&&t.addSplice(new z(e.length,[r],0)),r},push(e,t,n,s){const i=n.apply(e,s);return t.addSplice(new z(e.length-s.length,[],s.length).adjustTo(e)),i},reverse(e,t,n,s){const i=n.apply(e,s);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new U(r)),i},shift(e,t,n,s){const i=e.length>0,r=n.apply(e,s);return i&&t.addSplice(new z(0,[r],0)),r},sort(e,t,n,s){const i=new Map;for(let t=0,n=e.length;t<n;++t){const n=i.get(e[t])||[];i.set(e[t],[...n,t])}const r=n.apply(e,s);e.sorted++;const o=[];for(let t=0,n=e.length;t<n;++t){const n=i.get(e[t]);o.push(n[0]),i.set(e[t],n.splice(1))}return t.addSort(new U(o)),r},splice(e,t,n,s){const i=n.apply(e,s);return t.addSplice(new z(+s[0],i,s.length>2?s.length-2:0).adjustTo(e)),i},unshift(e,t,n,s){const i=n.apply(e,s);return t.addSplice(new z(0,[],s.length).adjustTo(e)),i}});const Z=Object.freeze({reset:Q,setDefaultStrategy(e){Y=e}});function ee(e,t,n,s=!0){Reflect.defineProperty(e,t,{value:n,enumerable:!1,writable:s})}class te extends R{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,D.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,D.notify(e,"sorted"))}},this.subscribe(e)}return e}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,ee(e,"$fastController",this)}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,n=this.sorts,s=this.oldCollection;void 0===t&&void 0===s&&void 0===n||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==n?this.notify(n):this.notify((null!==(e=this._strategy)&&void 0!==e?e:Y).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,V.enqueue(this))}}let ne=!1;const se=Object.freeze({sorted:0,enable(){if(ne)return;ne=!0,D.setArrayObserverFactory(e=>new te(e));const e=Array.prototype;e.$fastPatch||(ee(e,"$fastPatch",1),ee(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 n;const s=this.$fastController;return void 0===s?t.apply(this,e):(null!==(n=s.strategy)&&void 0!==n?n:Y)[t.name](this,s,t,e)}}))}});function ie(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(se.enable(),t=D.getNotifier(e)),D.track(t.lengthObserver,"length"),e.length}function re(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(se.enable(),t=D.getNotifier(e)),D.track(t.sortObserver,"sorted"),e.sorted}class oe{constructor(e,t,n=!1){this.evaluate=e,this.policy=t,this.isVolatile=n}}class ae extends oe{createObserver(e){return D.binding(this.evaluate,e,this.isVolatile)}}function le(e,t,n=D.isVolatileBinding(e)){return new ae(e,t,n)}function ce(e,t){const n=new ae(e);return n.options=t,n}class de extends oe{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function he(e,t){return new de(e,t)}function ue(e){return d(e)?le(e):e instanceof oe?e:he(()=>e)}m(de);const fe=b(),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,n){t.source.style.setProperty(e.targetAspect,n.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 n=e.source;if(!n.$cssBindings){n.$cssBindings=new Map;const e=n.setAttribute;n.setAttribute=(t,s)=>{e.call(n,t,s),"style"===t&&n.$cssBindings.forEach((e,t)=>be(t,e.controller,e.observer))}}const s=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);s.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:s})}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)}}let me;function ye(e){return e.map(e=>e instanceof we?ye(e.styles):[e]).reduce((e,t)=>e.concat(t),[])}pe.define(ve);class we{get strategy(){return null===this._strategy&&this.withStrategy(me),this._strategy}constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map(e=>e instanceof we?e.behaviors:null).reduce((e,t)=>null===t?e:null===e?t:e.concat(t),null)}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(ye(this.styles)),this}static setDefaultStrategy(e){me=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new we(e):e instanceof we?e:new we([e])}}we.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const Ce=`${Math.random().toString(36).substring(2,8)}`;let Se=0;const Te=()=>`--v${Ce}${++Se}`;function Oe(e,t){const n=[];let s="";const i=[],r=e=>{i.push(e)};for(let i=0,o=e.length-1;i<o;++i){s+=e[i];let o=t[i];d(o)?o=new ve(le(o),Te()).createCSS(r):o instanceof oe?o=new ve(o,Te()).createCSS(r):void 0!==pe.getForInstance(o)&&(o=o.createCSS(r)),o instanceof we||o instanceof CSSStyleSheet?(""!==s.trim()&&(n.push(s),s=""),n.push(o)):s+=o}return s+=e[e.length-1],""!==s.trim()&&n.push(s),{styles:n,behaviors:i}}const xe=(e,...t)=>{const{styles:n,behaviors:s}=Oe(e,t),i=new we(n);return s.length?i.withBehaviors(...s):i};class $e{constructor(e,t){this.behaviors=t,this.css="";const n=e.reduce((e,t)=>(h(t)?this.css+=t:e.push(t),e),[]);n.length&&(this.styles=new we(n))}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($e),xe.partial=(e,...t)=>{const{styles:n,behaviors:s}=Oe(e,t);return new $e(n,s)};const Be=`fast-${Math.random().toString(36).substring(2,8)}`,ke=`${Be}{`,Ne=`}${Be}`,Ae=Ne.length;let Me=0;const Ee=()=>`${Be}-${++Me}`,Ie=Object.freeze({interpolation:e=>`${ke}${e}${Ne}`,attribute:e=>`${Ee()}="${ke}${e}${Ne}"`,comment:e=>`\x3c!--${ke}${e}${Ne}--\x3e`}),Re=Object.freeze({parse(e,t){const n=e.split(ke);if(1===n.length)return null;const s=[];for(let e=0,i=n.length;e<i;++e){const i=n[e],r=i.indexOf(Ne);let o;if(-1===r)o=i;else{const e=i.substring(0,r);s.push(t[e]),o=i.substring(r+Ae)}""!==o&&s.push(o)}return s}}),je=b(),Ve=Object.freeze({getForInstance:je.getForInstance,getByType:je.getByType,define:(e,t)=>((t=t||{}).type=e,je.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?y.tokenList:y.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=y.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=y.event;break;default:e.targetAspect=t,e.aspectType=y.attribute}else e.aspectType=y.content}});function _e(e){return function(t){Ve.define(t,e)}}class De{constructor(e){this.options=e}createHTML(e){return Ie.attribute(e(this))}createBehavior(){return this}}m(De);const Le=e=>1===e.nodeType,Fe=e=>e?t=>1===t.nodeType&&t.matches(e):Le;class He 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,g),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}}class Pe extends He{constructor(e){super(e),this.observerProperty=Symbol(),e.childList=!0}observe(e){let t=e[this.observerProperty];if(!t){t=new MutationObserver((t,n)=>{this.updateTarget(this.getSource(e),this.computeNodes(e))}),t.toJSON=u,e[this.observerProperty]=t}t.observe(e,this.options)}disconnect(e){e[this.observerProperty].disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function ze(e){return h(e)&&(e={property:e}),new Pe(e)}Ve.define(Pe);const Ue=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,qe=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,We=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Qe=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Je=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,Ke=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Xe(e){return e&&e.nodeType===Node.COMMENT_NODE}const Ge=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=>Ue.test(e),isContentBindingEndMarker:e=>qe.test(e),isRepeatViewStartMarker:e=>We.test(e),isRepeatViewEndMarker:e=>Qe.test(e),isElementBoundaryStartMarker:e=>Xe(e)&&Je.test(e.data.trim()),isElementBoundaryEndMarker:e=>Xe(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=[],n=this.attributeMarkerName.length+1,s=`${this.attributeMarkerName}-`;for(const i of e.getAttributeNames())if(i.startsWith(s)){const e=Number(i.slice(n));if(Number.isNaN(e))throw p.error(1601,{name:i,expectedFormat:`${s}<number>`});t.push(e)}return 0===t.length?null:t},parseCompactAttributeBinding(e){const t=`${this.compactAttributeMarkerName}-`,n=e.getAttributeNames().find(e=>e.startsWith(t));if(!n)return null;const s=n.slice(t.length).split("-"),i=parseInt(s[0],10),r=parseInt(s[1],10);if(2!==s.length||Number.isNaN(i)||Number.isNaN(r)||i<0||r<1)throw p.error(1604,{name:n,expectedFormat:`${this.compactAttributeMarkerName}-{index}-{count}`});const o=[];for(let e=0;e<r;e++)o.push(i+e);return o},parseContentBindingStartMarker:e=>et(Ue,e),parseContentBindingEndMarker:e=>et(qe,e),parseRepeatStartMarker:e=>Ye(We,e),parseRepeatEndMarker:e=>Ye(Qe,e),parseElementBoundaryStartMarker:e=>Ze(Je,e.trim()),parseElementBoundaryEndMarker:e=>Ze(Ke,e)});function Ye(e,t){const n=e.exec(t);return null===n?n:parseInt(n[1])}function Ze(e,t){const n=e.exec(t);return null===n?n:n[1]}function et(e,t){const n=e.exec(t);return null===n?n:[parseInt(n[1]),n[2]]}const tt=Symbol.for("fe-hydration");function nt(e){return e[tt]===tt}const st="defer-hydration";class it extends Error{constructor(e,t,n){super(e),this.factories=t,this.node=n}}function rt(e){return e.nodeType===Node.COMMENT_NODE}function ot(e){return e.nodeType===Node.TEXT_NODE}function at(e,t){const n=document.createRange();return n.setStart(e,0),n.setEnd(t,rt(t)||ot(t)?t.data.length:t.childNodes.length),n}function lt(e,t,n,s){var i,r;const o=null!==(r=null!==(i=Ge.parseAttributeBinding(e))&&void 0!==i?i:Ge.parseEnumeratedAttributeBinding(e))&&void 0!==r?r:Ge.parseCompactAttributeBinding(e);if(null!==o){for(const i of o){const r=t[i+s];if(!r)throw new it(`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);dt(r,e,n)}e.removeAttribute(Ge.attributeMarkerName)}}function ct(e,t,n,s,i,r){if(Ge.isElementBoundaryStartMarker(e))!function(e,t){const n=Ge.parseElementBoundaryStartMarker(e.data);let s=t.nextSibling();for(;null!==s;){if(rt(s)){const e=Ge.parseElementBoundaryEndMarker(s.data);if(e&&e===n)break}s=t.nextSibling()}}(e,t);else if(Ge.isContentBindingStartMarker(e.data)){const o=Ge.parseContentBindingStartMarker(e.data);if(null===o)return;const[a,l]=o,c=n[a+r],d=[];let h=t.nextSibling();e.data="";const u=h;for(;null!==h;){if(rt(h)){const e=Ge.parseContentBindingEndMarker(h.data);if(e&&e[1]===l)break}d.push(h),h=t.nextSibling()}if(null===h){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(h.data="",1===d.length&&ot(d[0]))dt(c,d[0],s);else{h!==u&&null!==h.previousSibling&&(i[c.targetNodeId]={first:u,last:h.previousSibling});dt(c,h.parentNode.insertBefore(document.createTextNode(""),h),s)}}}function dt(e,t,n){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");n[e.targetNodeId]=t}var ht;function ut(e,t){const n=e.parentNode;let s,i=e;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);n.removeChild(i),i=s}n.removeChild(t)}class ft{constructor(){this.index=0,this.length=0}get event(){return P.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 pt extends ft{constructor(e,t,n){super(),this.fragment=e,this.factories=t,this.targets=n,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=_.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 n=e.parentNode;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,n.insertBefore(i,e),i=s;n.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let n,s=this.firstChild;for(;s!==t;)n=s.nextSibling,e.appendChild(s),s=n;e.appendChild(t)}dispose(){ut(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t,this.behaviors=n=new Array(this.factories.length);const s=this.factories;for(let e=0,t=s.length;e<t;++e){const t=s[e].createBehavior();t.bind(this),n[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=n.length;e<t;++e)n[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,n=e.length;t<n;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){ut(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,n=e.length;t<n;++t)e[t].unbind()}}}m(pt),D.defineProperty(pt.prototype,"index"),D.defineProperty(pt.prototype,"length");const gt="unhydrated",bt="hydrating",vt="hydrated";class mt extends Error{constructor(e,t,n,s){super(e),this.factory=t,this.fragment=n,this.templateString=s}}ht=tt,m(class extends ft{get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}constructor(e,t,n,s){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=n,this.hostBindingTarget=s,this[ht]=tt,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=_.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=gt,this._bindingViewBoundaries={},this._targets={},this.factories=n.compile().factories}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 n=e.parentNode;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,n.insertBefore(i,e),i=s;n.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 n,s=this.firstChild;for(;s!==t;){if(n=s.nextSibling,!n)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(s),s=n}e.appendChild(t)}bind(e,t=this){var n;if(this.hydrationStage!==vt&&(this._hydrationStage=bt),this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,n){const s=at(e,t),i=s.commonAncestorContainer,r=function(e){let t=0;for(let n=0,s=e.length;n<s&&"h"===e[n].targetNodeId;++n)t++;return t}(n),o=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===s.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),a={},l={};let c=o.currentNode=e;for(;null!==c;){switch(c.nodeType){case Node.ELEMENT_NODE:lt(c,n,a,r);break;case Node.COMMENT_NODE:ct(c,o,n,a,l,r)}c=o.nextNode()}return s.detach(),{targets:a,boundaries:l}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof it){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}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];if("h"===t.targetNodeId&&this.hostBindingTarget&&dt(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const s=(null===(n=this.firstChild)||void 0===n?void 0:n.getRootNode()).host,i=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==s?void 0:s.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}"`),i.sourceAspect&&r.push(` - Source aspect: "${i.sourceAspect}"`),void 0!==i.aspectType&&r.push(` - Aspect type: ${i.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 mt(r.join("\n"),t,at(this.firstChild,this.lastChild).cloneContents(),e)}{const n=t.createBehavior();n.bind(this),s[e]=n}}}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,this._hydrationStage=vt}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){ut(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,n=e.length;t<n;++t)e[t].unbind(this);e.length=0}});const yt={[y.attribute]:O.setAttribute,[y.booleanAttribute]:O.setBooleanAttribute,[y.property]:(e,t,n)=>e[t]=n,[y.content]:function(e,t,n,s){if(null==n&&(n=""),function(e){return void 0!==e.create}(n)){e.textContent="";let t=e.$fastView;if(void 0===t)if(nt(s)&&nt(n)&&void 0!==s.bindingViewBoundaries[this.targetNodeId]&&s.hydrationStage!==vt){const e=s.bindingViewBoundaries[this.targetNodeId];t=n.hydrate(e.first,e.last)}else t=n.create();else e.$fastTemplate!==n&&(t.isComposed&&(t.remove(),t.unbind()),t=n.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(s.source,s.context)):(t.isComposed=!0,t.bind(s.source,s.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=n)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=n}},[y.tokenList]:function(e,t,n){var s;const i=`${this.id}-t`,r=null!==(s=e[i])&&void 0!==s?s:e[i]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=n&&n.length){const e=n.split(/\s+/);for(let t=0,n=e.length;t<n;++t){const n=e[t];""!==n&&(o[n]=a,l.add(n))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[y.event]:()=>{}};class wt{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=y.content}createHTML(e){return Ie.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=yt[this.aspectType],n=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw p.error(c.unsupportedBindingBehavior);this.data=`${this.id}-d`,this.updateTarget=n.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const n=e.targets[this.targetNodeId],s=nt(e)&&e.hydrationStage&&e.hydrationStage!==vt;switch(this.aspectType){case y.event:n[this.data]=e,n.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case y.content:e.onUnbind(this);default:{const i=null!==(t=n[this.data])&&void 0!==t?t:n[this.data]=this.dataBinding.createObserver(this,this);if(i.target=n,i.controller=e,s&&(this.aspectType===y.attribute||this.aspectType===y.booleanAttribute)){i.bind(e);break}this.updateTarget(n,this.targetAspect,i.bind(e),e);break}}}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){P.setEvent(e);const n=this.dataBinding.evaluate(t.source,t.context);P.setEvent(null),!0!==n&&e.preventDefault()}}handleChange(e,t){const n=t.controller;if(!n.isBound)return;const s=t.target;this.updateTarget(s,this.targetAspect,t.bind(n),n)}}Ve.define(wt,{aspected:!0});const Ct=(e,t)=>`${e}.${t}`,St={},Tt={index:0,node:null};function Ot(e){e.startsWith("fast-")||p.warn(c.hostBindingWithoutHost,{name:e})}const xt=new Proxy(document.createElement("div"),{get(e,t){Ot(t);const n=Reflect.get(e,t);return d(n)?n.bind(e):n},set:(e,t,n)=>(Ot(t),Reflect.set(e,t,n))});class $t{constructor(e,t,n){this.fragment=e,this.directives=t,this.policy=n,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,n,s,i){var r,o;this.nodeIds.has(n)||(this.nodeIds.add(n),this.addTargetDescriptor(t,n,s)),e.id=null!==(r=e.id)&&void 0!==r?r:Ee(),e.targetNodeId=n,e.targetTagName=i,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,n){const s=this.descriptors;if("r"===t||"h"===t||s[t])return;if(!s[e]){const t=e.lastIndexOf("."),n=e.substring(0,t),s=parseInt(e.substring(t+1),10);this.addTargetDescriptor(n,e,s)}let i=St[t];if(!i){const s=`_${t}`;St[t]=i={get(){var t;return null!==(t=this[s])&&void 0!==t?t:this[s]=this[e].childNodes[n]}}}s[t]=i}createView(e){const t=this.fragment.cloneNode(!0),n=Object.create(this.proto);n.r=t,n.h=null!=e?e:xt;for(const e of this.nodeIds)Reflect.get(n,e);return new pt(t,this.factories,n)}}function Bt(e,t,n,s,i,r=!1){const o=n.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=Re.parse(h,a);let f=null;null===u?r&&(f=new wt(he(()=>h,e.policy)),Ve.assignAspect(f,d.name)):f=Mt.aggregate(u,e.policy),null!==f&&(n.removeAttributeNode(d),l--,c--,e.addFactory(f,t,s,i,n.tagName))}}function kt(e,t,n){let s=0,i=t.firstChild;for(;i;){const t=Nt(e,n,i,s);i=t.node,s=t.index}}function Nt(e,t,n,s){const i=Ct(t,s);switch(n.nodeType){case 1:Bt(e,t,n,i,s),kt(e,n,i);break;case 3:return function(e,t,n,s,i){const r=Re.parse(t.textContent,e.directives);if(null===r)return Tt.node=t.nextSibling,Tt.index=i+1,Tt;let o,a=o=t;for(let t=0,l=r.length;t<l;++t){const l=r[t];0!==t&&(i++,s=Ct(n,i),o=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),h(l)?o.textContent=l:(o.textContent=" ",Ve.assignAspect(l),e.addFactory(l,n,s,i,null)),a=o}return Tt.index=i+1,Tt.node=a.nextSibling,Tt}(e,n,t,i,s);case 8:{const r=Re.parse(n.data,e.directives);null!==r&&e.addFactory(Mt.aggregate(r),t,i,s,null);break}}return Tt.index=s+1,Tt.node=n.nextSibling,Tt}const At="TEMPLATE",Mt={compile(e,t,n=O.policy){let s;if(h(e)){s=document.createElement(At),s.innerHTML=n.createHTML(e);const t=s.content.firstElementChild;null!==t&&t.tagName===At&&(s=t)}else s=e;s.content.firstChild||s.content.lastChild||s.content.appendChild(document.createComment(""));const i=document.adoptNode(s.content),r=new $t(i,t,n);var o,a;return Bt(r,"",s,"h",0,!0),o=i.firstChild,a=t,(o&&8===o.nodeType&&null!==Re.parse(o.data,a)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),kt(r,i,"r"),Tt.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=O.policy){if(1===e.length)return e[0];let n,s,i=!1;const r=e.length,o=e.map(e=>h(e)?()=>e:(n=e.sourceAspect||n,i=i||e.dataBinding.isVolatile,s=s||e.dataBinding.policy,e.dataBinding.evaluate)),a=new wt(le((e,t)=>{let n="";for(let s=0;s<r;++s)n+=o[s](e,t);return n},null!=s?s:t,i));return Ve.assignAspect(a,n),a}};class Et extends De{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}Ve.define(Et);const It=e=>new Et(e);function Rt(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const jt="boolean",Vt="reflect",_t=Object.freeze({locate:v()}),Dt={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Lt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Dt.fromView(e)};function Ft(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Ht={toView(e){const t=Ft(e);return t?t.toString():t},fromView:Ft};class Pt{constructor(e,t,n=t.toLowerCase(),s=Vt,i){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=n,this.mode=s,this.converter=i,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,s===jt&&void 0===i&&(this.converter=Dt)}setValue(e,t){const n=e[this.fieldName],s=this.converter;void 0!==s&&(t=s.fromView(t)),n!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](n,t),e.$fastController.notify(this.name))}getValue(e){return D.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,n=this.guards;n.has(e)||"fromView"===t||V.enqueue(()=>{n.add(e);const s=e[this.fieldName];switch(t){case Vt:const t=this.converter;O.setAttribute(e,this.attribute,void 0!==t?t.toView(s):s);break;case jt:O.setBooleanAttribute(e,this.attribute,s)}n.delete(e)})}static collect(e,...t){const n=[];t.push(_t.locate(e));for(let s=0,i=t.length;s<i;++s){const i=t[s];if(void 0!==i)for(let t=0,s=i.length;t<s;++t){const s=i[t];h(s)?n.push(new Pt(e,s)):n.push(new Pt(e,s.property,s.attribute,s.mode,s.converter))}}return n}}function zt(e,t){let n;function s(e,t){arguments.length>1&&(n.property=t),_t.locate(e.constructor).push(n)}return arguments.length>1?(n={},void s(e,t)):(n=void 0===e?{}:e,s)}var Ut;const qt={mode:"open"},Wt={},Qt=new Set,Jt=p.getById(l.elementRegistry,()=>b()),Kt={deferAndHydrate:"defer-and-hydrate"};class Xt{get isDefined(){return this.platformDefined}constructor(e,t=e.definition){var n;this.platformDefined=!1,h(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.templateOptions=t.templateOptions,this.registry=null!==(n=t.registry)&&void 0!==n?n:customElements;const s=e.prototype,i=Pt.collect(e,t.attributes),r=new Array(i.length),o={},a={};for(let e=0,t=i.length;e<t;++e){const t=i[e];r[e]=t.attribute,o[t.name]=t,a[t.attribute]=t,D.defineProperty(s,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=i,this.propertyLookup=o,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?qt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},qt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?Wt:Object.assign(Object.assign({},Wt),t.elementOptions),this.styles=we.normalize(t.styles),Jt.register(this),D.defineProperty(Ut.isRegistered,this.name),Ut.isRegistered[this.name]=this.type}define(e=this.registry){var t,n;const s=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,s,this.elementOptions),null===(n=null===(t=this.lifecycleCallbacks)||void 0===t?void 0:t.elementDidDefine)||void 0===n||n.call(t,this.name)),this}static compose(e,t){return Qt.has(e)||Jt.getByType(e)?new Ut(class extends e{},t):new Ut(e,t)}static registerBaseType(e){Qt.add(e)}static composeAsync(e,t){return new Promise(n=>{(Qt.has(e)||Jt.getByType(e))&&n(new Ut(class extends e{},t));const s=new Ut(e,t);D.getNotifier(s).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=s.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,s.name),n(s)}},"template")})}}Ut=Xt,Xt.isRegistered={},Xt.getByType=Jt.getByType,Xt.getForInstance=Jt.getForInstance,Xt.registerAsync=e=>Rt(void 0,void 0,void 0,function*(){return new Promise(t=>{Ut.isRegistered[e]&&t(Ut.isRegistered[e]),D.getNotifier(Ut.isRegistered).subscribe({handleChange:()=>t(Ut.isRegistered[e])},e)})}),D.defineProperty(Xt.prototype,"template");const Gt=/([ \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 Zt{constructor(e,t=Yt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const n in t)e(t[n]);return this.html}}function en(e,t,n,s=Ve.getForInstance(e)){if(s.aspected){const n=Gt.exec(t);null!==n&&Ve.assignAspect(e,n[2])}return e.createHTML(n)}Zt.empty=new Zt(""),Ve.define(Zt);class tn{constructor(e,t={},n){this.policy=n,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=Mt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new Zt(h(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw p.error(c.cannotSetTemplatePolicyAfterCompilation);if(this.policy)throw p.error(c.onlySetTemplatePolicyOnce);return this.policy=e,this}render(e,t,n){const s=this.create(n);return s.bind(e),s.appendTo(t),s}static create(e,t,n){let s="";const i=Object.create(null),r=e=>{var t;const n=null!==(t=e.id)&&void 0!==t?t:e.id=Ee();return i[n]=e,n};for(let n=0,i=e.length-1;n<i;++n){const i=e[n];let o,a=t[n];if(s+=i,d(a))a=new wt(le(a));else if(a instanceof oe)a=new wt(a);else if(!(o=Ve.getForInstance(a))){const e=a;a=new wt(he(()=>e))}s+=en(a,i,r,o)}return new tn(s+e[e.length-1],i,n)}}m(tn);const nn=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return tn.create(e,t);throw p.error(c.directCallToHTMLTagNotAllowed)};nn.partial=e=>new Zt(e);class sn{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),nt(this.template)&&nt(e)&&e.hydrationStage!==vt&&!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){this.controller.isBound&&(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 rn{constructor(e,t,n){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=n}createHTML(e){return Ie.comment(e(this))}createBehavior(){return new sn(this)}}Ve.define(rn);const on=new Map,an=nn`
2
2
  &nbsp;
3
- `;function ln(e){return void 0===e?an:e.template}function cn(e,t){if(e)return function(e,t){const n=rn.get(e);if(void 0!==n)return n[null!=t?t:on]}(e.constructor,t)}class dn{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 hn(e,t){let n,s;n=void 0===e?de((e=>e)):he(e);let i=!1;if(void 0===t)i=!0,s=de(((e,t)=>{var s;const i=n.evaluate(e,t);return i instanceof Node?null!==(s=i.$fastTemplate)&&void 0!==s?s:new dn(i):ln(cn(i))}));else if(d(t))s=ae(((e,s)=>{var i;let r=t(e,s);return h(r)?r=ln(cn(n.evaluate(e,s),r)):r instanceof Node&&(r=null!==(i=r.$fastTemplate)&&void 0!==i?i:new dn(r)),r}),void 0,!0);else if(h(t))i=!0,s=de(((e,s)=>{var i;const r=n.evaluate(e,s);return r instanceof Node?null!==(i=r.$fastTemplate)&&void 0!==i?i:new dn(r):ln(cn(r,t))}));else if(t instanceof re){const e=t.evaluate;t.evaluate=(t,s)=>{var i;let r=e(t,s);return h(r)?r=ln(cn(n.evaluate(t,s),r)):r instanceof Node&&(r=null!==(i=r.$fastTemplate)&&void 0!==i?i:new dn(r)),r},s=t}else s=de(((e,n)=>t));return new sn(n,s,i)}const un=Object.freeze({positioning:!1,recycle:!0});function pn(e,t,n,s){e.context.parent=s.source,e.context.parentContext=s.context,e.bind(t[n])}function fn(e,t,n,s){e.context.parent=s.source,e.context.parentContext=s.context,e.context.length=t.length,e.context.index=n,e.bind(t[n])}function gn(e){return e.nodeType===Node.COMMENT_NODE}class bn extends Error{constructor(e,t){super(e),this.propertyBag=t}}class vn{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=pn,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=fn)}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),tt(this.template)&&tt(e)&&e.hydrationStage!==bt?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=g);const t=this.itemsObserver,n=this.itemsObserver=D.getNotifier(this.items),s=t!==n;s&&null!==t&&t.unsubscribe(this),(s||e)&&n.subscribe(this)}updateSortedViews(e){const t=this.views;for(let n=0,s=e.length;n<s;++n){const s=e[n].sorted.slice(),i=s.slice().sort();for(let e=0,n=s.length;e<n;++e){const n=s.find((t=>s[e]===i[t]));if(n!==e){const s=i.splice(n,1);i.splice(e,0,...s);const r=t[e],o=r?r.firstChild:this.location;t[n].remove(),t[n].insertBefore(o);const a=t.splice(n,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,n=this.bindView,s=this.items,i=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 p=0,f=h.index;const g=f+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;f<g;++f){const e=t[f],d=e?e.firstChild:this.location;let h;o&&c>0?(p<=v&&b.length>0?(h=b[p],p++):(h=a[l],l++),c--):h=i.create(),t.splice(f,0,h),n(h,s,f,r),h.insertBefore(d)}b[p]&&a.push(...b.slice(p))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,n=t.length;e<n;++e){const s=t[e].context;s.length=n,s.index=e}}refreshAllViews(e=!1){const t=this.items,n=this.template,s=this.location,i=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(pt.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=n.create();i(o,t,e,r),a[e]=o,o.insertBefore(s)}}else{let e=0;for(;e<o;++e)if(e<l){const s=a[e];if(!s){const t=new XMLSerializer;throw new bn(`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(n.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}i(s,t,e,r)}else{const o=n.create();i(o,t,e,r),a.push(o),o.insertBefore(s)}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,n=e.length;t<n;++t){const n=e[t];if(!n){const n=new XMLSerializer;throw new bn(`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:n.serializeToString(this.location.getRootNode())})}n.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!gn(t)){t=t.previousSibling;continue}const n=Xe.parseRepeatEndMarker(t.data);if(null===n){t=t.previousSibling;continue}t.data="";const s=t.previousSibling;if(!s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let i=s,r=0;for(;null!==i;){if(gn(i))if(Xe.isRepeatViewEndMarker(i.data))r++;else if(Xe.isRepeatViewStartMarker(i.data)){if(!r){if(Xe.parseRepeatStartMarker(i.data)!==n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);i.data="",t=i.previousSibling,i=i.nextSibling;const r=e.hydrate(i,s);this.views[n]=r,this.bindView(r,this.items,n,this.controller);break}r--}i=i.previousSibling}if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class mn{createHTML(e){return Ee.comment(e(this))}constructor(e,t,n){this.dataBinding=e,this.templateBinding=t,this.options=n,ne.enable()}createBehavior(){return new vn(this)}}function yn(e,t,n=un){const s=he(e),i=he(t);return new mn(s,i,Object.assign(Object.assign({},un),n))}je.define(mn);const wn="slotchange";class Cn extends Fe{observe(e){e.addEventListener(wn,this)}disconnect(e){e.removeEventListener(wn,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Sn(e){return h(e)&&(e={property:e}),new Cn(e)}je.define(Cn);const Tn=()=>null;function On(e){return void 0===e?Tn:d(e)?e:()=>e}function xn(e,t,n){const s=d(e)?e:()=>e,i=On(t),r=On(n);return(e,t)=>s(e,t)?i(e,t):r(e,t)}class $n 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()}}const Bn={bubbles:!0,composed:!0,cancelable:!0},kn="isConnected",Nn=new WeakMap;function An(e){var t,n;return null!==(n=null!==(t=e.shadowRoot)&&void 0!==t?t:Nn.get(e))&&void 0!==n?n:null}let Mn;var En;!function(e){e[e.connecting=0]="connecting",e[e.connected=1]="connected",e[e.disconnecting=2]="disconnecting",e[e.disconnected=3]="disconnected"}(En||(En={}));class In extends j{get isConnected(){return D.track(this,kn),this.stage===En.connected}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:P.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&&Nn.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))}constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=En.disconnected,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 n=D.getAccessors(e);if(n.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,i=n.length;s<i;++s){const i=n[s].name,r=e[i];void 0!==r&&(delete e[i],t[i]=r)}}}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,n;const s=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,i=null!==(n=s.get(e))&&void 0!==n?n:0;0===i?(s.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||this.stage!==En.connected&&this.stage!==En.connecting||e.connectedCallback(this)):s.set(e,i+1)}removeBehavior(e,t=!1){const n=this.behaviors;if(null===n)return;const s=n.get(e);void 0!==s&&(1===s||t?(n.delete(e),e.disconnectedCallback&&this.stage!==En.disconnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):n.set(e,s-1))}addStyles(e){var t;if(!e)return;const n=this.source;if(e instanceof HTMLElement){(null!==(t=An(n))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(n)){const t=e.behaviors;if(e.addStylesTo(n),null!==t)for(let e=0,n=t.length;e<n;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const n=this.source;if(e instanceof HTMLElement){(null!==(t=An(n))&&void 0!==t?t:n).removeChild(e)}else if(e.isAttachedTo(n)){const t=e.behaviors;if(e.removeStylesFrom(n),null!==t)for(let e=0,n=t.length;e<n;++e)this.removeBehavior(t[e])}}connect(){this.stage===En.disconnected&&(this.stage=En.connecting,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=En.connected,D.notify(this,kn))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,n=Object.keys(t);for(let s=0,i=n.length;s<i;++s){const i=n[s];e[i]=t[i]}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(){this.stage===En.connected&&(this.stage=En.disconnecting,D.notify(this,kn),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=En.disconnected)}onAttributeChangedCallback(e,t,n){const s=this.definition.attributeLookup[e];void 0!==s&&s.onAttributeChangedCallback(this.source,n)}emit(e,t,n){return this.stage===En.connected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},Bn),n)))}renderTemplate(e){var t;const n=this.source,s=null!==(t=An(n))&&void 0!==t?t:n;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=s.firstChild;null!==e;e=s.firstChild)s.removeChild(e)}e&&(this.view=e.render(n,s,n),this.view.sourceLifetime=_.coupled)}static forCustomElement(e,t=!1){const n=e.$fastController;if(void 0!==n&&!t)return n;const s=Kt.getForInstance(e);if(void 0===s)throw f.error(c.missingElementDefinition);return D.getNotifier(s).subscribe({handleChange:()=>{In.forCustomElement(e,!0),e.$fastController.connect()}},"template"),D.getNotifier(s).subscribe({handleChange:()=>{In.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new Mn(e,s)}static setStrategy(e){Mn=e}}function Rn(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=An(e))&&void 0!==t?t:e.getRootNode()}m(In),In.setStrategy(In);class jn{constructor(e){const t=jn.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let n=t.get(e);return void 0===n&&(n=new CSSStyleSheet,n.replaceSync(e),t.set(e,n)),n}))}addStylesTo(e){Ln(Rn(e),this.sheets)}removeStylesFrom(e){Fn(Rn(e),this.sheets)}}jn.styleSheetCache=new Map;let Vn=0;function _n(e){return e===document?document.body:e}class Dn{constructor(e){this.styles=e,this.styleClass="fast-"+ ++Vn}addStylesTo(e){e=_n(Rn(e));const t=this.styles,n=this.styleClass;for(let s=0;s<t.length;s++){const i=document.createElement("style");i.innerHTML=t[s],i.className=n,e.append(i)}}removeStylesFrom(e){const t=(e=_n(Rn(e))).querySelectorAll(`.${this.styleClass}`);for(let n=0,s=t.length;n<s;++n)e.removeChild(t[n])}}let Ln=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Fn=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ye.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Ln=(e,t)=>{e.adoptedStyleSheets.push(...t)},Fn=(e,t)=>{for(const n of t){const t=e.adoptedStyleSheets.indexOf(n);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ye.setDefaultStrategy(jn)}else ye.setDefaultStrategy(Dn);const Hn="needs-hydration";class Pn extends In{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,(this.hasExistingShadowRoot||void 0!==e&&!this.template)&&this.definition.templateOptions===Jt.deferAndHydrate&&(this.source.toggleAttribute(nt,!0),this.source.toggleAttribute(Hn,!0))}addHydratingInstance(){if(!Pn.hydratingInstances)return;const e=this.definition.name;let t=Pn.hydratingInstances.get(e);t||(t=new Set,Pn.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return Pn.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(nt)||(Pn.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,n,s;if(e.didTimeout)Pn.idleCallbackId=requestIdleCallback(Pn.checkHydrationComplete,{timeout:50});else if(0===(null===(t=Pn.hydratingInstances)||void 0===t?void 0:t.size)){try{null===(s=(n=Pn.lifecycleCallbacks).hydrationComplete)||void 0===s||s.call(n)}catch(e){}In.setStrategy(In)}}connect(){var e,t,n,s,i,r,o;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(Hn),this.needsHydration&&this.addHydratingInstance(),this.source.hasAttribute(nt))return this.addHydratingInstance(),void Pn.hydrationObserver.observe(this.source,{attributeFilter:[nt]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(this.stage===En.disconnected){if(!Pn.hydrationStarted){Pn.hydrationStarted=!0;try{null===(n=(t=Pn.lifecycleCallbacks).hydrationStarted)||void 0===n||n.call(t)}catch(e){}}try{null===(i=(s=Pn.lifecycleCallbacks).elementWillHydrate)||void 0===i||i.call(s,this.source)}catch(e){}if(this.stage=En.connecting,this.bindObservables(),this.connectBehaviors(),this.template)if(tt(this.template)){const e=this.source,t=null!==(r=An(e))&&void 0!==r?r:e;let n=t.firstChild,s=t.lastChild;null===e.shadowRoot&&(Xe.isElementBoundaryStartMarker(n)&&(n.data="",n=n.nextSibling),Xe.isElementBoundaryEndMarker(s)&&(s.data="",s=s.previousSibling)),this.view=this.template.hydrate(n,s,e),null===(o=this.view)||void 0===o||o.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=En.connected,this.source.removeAttribute(Hn),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),D.notify(this,kn)}}removeHydratingInstance(){var e,t;if(!Pn.hydratingInstances)return;try{null===(t=(e=Pn.lifecycleCallbacks).elementDidHydrate)||void 0===t||t.call(e,this.source)}catch(e){}const n=this.definition.name,s=Pn.hydratingInstances.get(n);s&&(s.delete(this.source),s.size||Pn.hydratingInstances.delete(n),Pn.idleCallbackId&&cancelIdleCallback(Pn.idleCallbackId),Pn.idleCallbackId=requestIdleCallback(Pn.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),Pn.hydrationObserver.unobserve(this.source)}static install(){In.setStrategy(Pn)}}function zn(e){const t=class extends e{constructor(){super(),In.forCustomElement(this)}$emit(e,t,n){return this.$fastController.emit(e,t,n)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,n){this.$fastController.onAttributeChangedCallback(e,t,n)}};return Kt.registerBaseType(t),t}function Un(e,t){return d(e)?Kt.compose(e,t).define().type:Kt.compose(this,e).define().type}Pn.hydrationObserver=new $n(Pn.hydrationObserverHandler),Pn.lifecycleCallbacks={},Pn.hydrationStarted=!1,Pn.idleCallbackId=null,Pn.hydratingInstances=new Map;const qn=Object.assign(zn(HTMLElement),{from:function(e){return zn(e)},define:Un,compose:function(e,t){return d(e)?Kt.compose(e,t):Kt.compose(this,e)},defineAsync:function(e,t){return d(e)?new Promise((n=>{Kt.composeAsync(e,t).then((e=>{n(e)}))})).then((e=>e.define().type)):new Promise((t=>{Kt.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});function Wn(e){return function(t){Un(t,e)}}O.setPolicy(I.create());export{ne as ArrayObserver,Vt as AttributeConfiguration,Ht as AttributeDefinition,re as Binding,be as CSSBindingDirective,pe as CSSDirective,He as ChildrenDirective,At as Compiler,O as DOM,y as DOMAspect,In as ElementController,ye as ElementStyles,P as ExecutionContext,f as FAST,qn as FASTElement,Kt as FASTElementDefinition,yt as HTMLBindingDirective,je as HTMLDirective,pt as HTMLView,Pn as HydratableElementController,vt as HydrationBindingError,Yt as InlineTemplateDirective,Ee as Markup,Fe as NodeObservationDirective,D as Observable,Ie as Parser,j as PropertyChangeNotifier,Mt as RefDirective,nn as RenderBehavior,sn as RenderDirective,vn as RepeatBehavior,mn as RepeatDirective,Cn as SlottedDirective,U as Sort,_ as SourceLifetime,z as Splice,Y as SpliceStrategy,q as SpliceStrategySupport,En as Stages,_e as StatelessAttachedAttributeDirective,R as SubscriberSet,Jt as TemplateOptions,V as Updates,en as ViewTemplate,Pt as attr,_t as booleanConverter,Pe as children,Oe as css,fe as cssDirective,Wn as customElement,nt as deferHydrationAttribute,Le as elements,g as emptyArray,Qt as fastElementRegistry,tn as html,Ve as htmlDirective,tt as isHydratable,se as lengthOf,le as listener,Hn as needsHydrationAttribute,he as normalizeBinding,Dt as nullableBooleanConverter,Ft as nullableNumberConverter,L as observable,de as oneTime,ae as oneWay,Et as ref,hn as render,yn as repeat,Sn as slotted,ie as sortedCount,F as volatile,xn as when};
3
+ `;function ln(e){return void 0===e?an:e.template}function cn(e,t){if(e)return function(e,t){const n=on.get(e);if(void 0!==n)return n[null!=t?t:"default-view"]}(e.constructor,t)}class dn{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 hn(e,t){let n,s;n=void 0===e?he(e=>e):ue(e);let i=!1;if(void 0===t)i=!0,s=he((e,t)=>{var s;const i=n.evaluate(e,t);return i instanceof Node?null!==(s=i.$fastTemplate)&&void 0!==s?s:new dn(i):ln(cn(i))});else if(d(t))s=le((e,s)=>{var i;let r=t(e,s);return h(r)?r=ln(cn(n.evaluate(e,s),r)):r instanceof Node&&(r=null!==(i=r.$fastTemplate)&&void 0!==i?i:new dn(r)),r},void 0,!0);else if(h(t))i=!0,s=he((e,s)=>{var i;const r=n.evaluate(e,s);return r instanceof Node?null!==(i=r.$fastTemplate)&&void 0!==i?i:new dn(r):ln(cn(r,t))});else if(t instanceof oe){const e=t.evaluate;t.evaluate=(t,s)=>{var i;let r=e(t,s);return h(r)?r=ln(cn(n.evaluate(t,s),r)):r instanceof Node&&(r=null!==(i=r.$fastTemplate)&&void 0!==i?i:new dn(r)),r},s=t}else s=he((e,n)=>t);return new rn(n,s,i)}const un=Object.freeze({positioning:!1,recycle:!0});function fn(e,t,n,s){e.context.parent=s.source,e.context.parentContext=s.context,e.bind(t[n])}function pn(e,t,n,s){e.context.parent=s.source,e.context.parentContext=s.context,e.context.length=t.length,e.context.index=n,e.bind(t[n])}function gn(e){return e.nodeType===Node.COMMENT_NODE}class bn extends Error{constructor(e,t){super(e),this.propertyBag=t}}class vn{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=fn,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=pn)}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),nt(this.template)&&nt(e)&&e.hydrationStage!==vt?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=g);const t=this.itemsObserver,n=this.itemsObserver=D.getNotifier(this.items),s=t!==n;s&&null!==t&&t.unsubscribe(this),(s||e)&&n.subscribe(this)}updateSortedViews(e){const t=this.views;for(let n=0,s=e.length;n<s;++n){const s=e[n].sorted.slice(),i=s.slice().sort();for(let e=0,n=s.length;e<n;++e){const n=s.find(t=>s[e]===i[t]);if(n!==e){const s=i.splice(n,1);i.splice(e,0,...s);const r=t[e],o=r?r.firstChild:this.location;t[n].remove(),t[n].insertBefore(o);const a=t.splice(n,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,n=this.bindView,s=this.items,i=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=i.create(),t.splice(p,0,h),n(h,s,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,n=t.length;e<n;++e){const s=t[e].context;s.length=n,s.index=e}}refreshAllViews(e=!1){const t=this.items,n=this.template,s=this.location,i=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(pt.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=n.create();i(o,t,e,r),a[e]=o,o.insertBefore(s)}}else{let e=0;for(;e<o;++e)if(e<l){const s=a[e];if(!s){const t=new XMLSerializer;throw new bn(`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(n.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}i(s,t,e,r)}else{const o=n.create();i(o,t,e,r),a.push(o),o.insertBefore(s)}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,n=e.length;t<n;++t){const n=e[t];if(!n){const n=new XMLSerializer;throw new bn(`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:n.serializeToString(this.location.getRootNode())})}n.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!gn(t)){t=t.previousSibling;continue}const n=Ge.parseRepeatEndMarker(t.data);if(null===n){t=t.previousSibling;continue}t.data="";const s=t.previousSibling;if(!s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let i=s,r=0;for(;null!==i;){if(gn(i))if(Ge.isRepeatViewEndMarker(i.data))r++;else if(Ge.isRepeatViewStartMarker(i.data)){if(!r){if(Ge.parseRepeatStartMarker(i.data)!==n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);i.data="",t=i.previousSibling,i=i.nextSibling;const r=e.hydrate(i,s);this.views[n]=r,this.bindView(r,this.items,n,this.controller);break}r--}i=i.previousSibling}if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class mn{createHTML(e){return Ie.comment(e(this))}constructor(e,t,n){this.dataBinding=e,this.templateBinding=t,this.options=n,se.enable()}createBehavior(){return new vn(this)}}function yn(e,t,n=un){const s=ue(e),i=ue(t);return new mn(s,i,Object.assign(Object.assign({},un),n))}Ve.define(mn);const wn="slotchange";class Cn extends He{observe(e){e.addEventListener(wn,this)}disconnect(e){e.removeEventListener(wn,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Sn(e){return h(e)&&(e={property:e}),new Cn(e)}Ve.define(Cn);const Tn=()=>null;function On(e){return void 0===e?Tn:d(e)?e:()=>e}function xn(e,t,n){const s=d(e)?e:()=>e,i=On(t),r=On(n);return(e,t)=>s(e,t)?i(e,t):r(e,t)}class $n 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()}}const Bn={bubbles:!0,composed:!0,cancelable:!0},kn="isConnected",Nn=new WeakMap;function An(e){var t,n;return null!==(n=null!==(t=e.shadowRoot)&&void 0!==t?t:Nn.get(e))&&void 0!==n?n:null}let Mn;var En;!function(e){e[e.connecting=0]="connecting",e[e.connected=1]="connected",e[e.disconnecting=2]="disconnecting",e[e.disconnected=3]="disconnected"}(En||(En={}));class In extends j{get isConnected(){return D.track(this,kn),this.stage===En.connected}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:P.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&&Nn.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))}constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=En.disconnected,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 n=D.getAccessors(e);if(n.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,i=n.length;s<i;++s){const i=n[s].name,r=e[i];void 0!==r&&(delete e[i],t[i]=r)}}}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,n;const s=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,i=null!==(n=s.get(e))&&void 0!==n?n:0;0===i?(s.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||this.stage!==En.connected&&this.stage!==En.connecting||e.connectedCallback(this)):s.set(e,i+1)}removeBehavior(e,t=!1){const n=this.behaviors;if(null===n)return;const s=n.get(e);void 0!==s&&(1===s||t?(n.delete(e),e.disconnectedCallback&&this.stage!==En.disconnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):n.set(e,s-1))}addStyles(e){var t;if(!e)return;const n=this.source;if(e instanceof HTMLElement){(null!==(t=An(n))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(n)){const t=e.behaviors;if(e.addStylesTo(n),null!==t)for(let e=0,n=t.length;e<n;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const n=this.source;if(e instanceof HTMLElement){(null!==(t=An(n))&&void 0!==t?t:n).removeChild(e)}else if(e.isAttachedTo(n)){const t=e.behaviors;if(e.removeStylesFrom(n),null!==t)for(let e=0,n=t.length;e<n;++e)this.removeBehavior(t[e])}}connect(){this.stage===En.disconnected&&(this.stage=En.connecting,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=En.connected,D.notify(this,kn))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,n=Object.keys(t);for(let s=0,i=n.length;s<i;++s){const i=n[s];e[i]=t[i]}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(){this.stage===En.connected&&(this.stage=En.disconnecting,D.notify(this,kn),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=En.disconnected)}onAttributeChangedCallback(e,t,n){const s=this.definition.attributeLookup[e];void 0!==s&&s.onAttributeChangedCallback(this.source,n)}emit(e,t,n){return this.stage===En.connected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},Bn),n)))}renderTemplate(e){var t;const n=this.source,s=null!==(t=An(n))&&void 0!==t?t:n;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=s.firstChild;null!==e;e=s.firstChild)s.removeChild(e)}e&&(this.view=e.render(n,s,n),this.view.sourceLifetime=_.coupled)}static forCustomElement(e,t=!1){const n=e.$fastController;if(void 0!==n&&!t)return n;const s=Xt.getForInstance(e);if(void 0===s)throw p.error(c.missingElementDefinition);return D.getNotifier(s).subscribe({handleChange:()=>{In.forCustomElement(e,!0),e.$fastController.connect()}},"template"),D.getNotifier(s).subscribe({handleChange:()=>{In.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new Mn(e,s)}static setStrategy(e){Mn=e}}function Rn(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=An(e))&&void 0!==t?t:e.getRootNode()}m(In),In.setStrategy(In);class jn{constructor(e){const t=jn.styleSheetCache;this.sheets=e.map(e=>{if(e instanceof CSSStyleSheet)return e;let n=t.get(e);return void 0===n&&(n=new CSSStyleSheet,n.replaceSync(e),t.set(e,n)),n})}addStylesTo(e){Ln(Rn(e),this.sheets)}removeStylesFrom(e){Fn(Rn(e),this.sheets)}}jn.styleSheetCache=new Map;let Vn=0;function _n(e){return e===document?document.body:e}class Dn{constructor(e){this.styles=e,this.styleClass="fast-"+ ++Vn}addStylesTo(e){e=_n(Rn(e));const t=this.styles,n=this.styleClass;for(let s=0;s<t.length;s++){const i=document.createElement("style");i.innerHTML=t[s],i.className=n,e.append(i)}}removeStylesFrom(e){const t=(e=_n(Rn(e))).querySelectorAll(`.${this.styleClass}`);for(let n=0,s=t.length;n<s;++n)e.removeChild(t[n])}}let Ln=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Fn=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>-1===t.indexOf(e))};if(we.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Ln=(e,t)=>{e.adoptedStyleSheets.push(...t)},Fn=(e,t)=>{for(const n of t){const t=e.adoptedStyleSheets.indexOf(n);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}we.setDefaultStrategy(jn)}else we.setDefaultStrategy(Dn);const Hn="needs-hydration";class Pn extends In{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,(this.hasExistingShadowRoot||void 0!==e&&!this.template)&&this.definition.templateOptions===Kt.deferAndHydrate&&(this.source.toggleAttribute(st,!0),this.source.toggleAttribute(Hn,!0))}addHydratingInstance(){if(!Pn.hydratingInstances)return;const e=this.definition.name;let t=Pn.hydratingInstances.get(e);t||(t=new Set,Pn.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return Pn.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(st)||(Pn.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,n,s;if(e.didTimeout)Pn.idleCallbackId=requestIdleCallback(Pn.checkHydrationComplete,{timeout:50});else if(0===(null===(t=Pn.hydratingInstances)||void 0===t?void 0:t.size)){try{null===(s=(n=Pn.lifecycleCallbacks).hydrationComplete)||void 0===s||s.call(n)}catch(e){}In.setStrategy(In)}}connect(){var e,t,n,s,i,r,o;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(Hn),this.needsHydration&&this.addHydratingInstance(),this.source.hasAttribute(st))return this.addHydratingInstance(),void Pn.hydrationObserver.observe(this.source,{attributeFilter:[st]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(this.stage===En.disconnected){if(!Pn.hydrationStarted){Pn.hydrationStarted=!0;try{null===(n=(t=Pn.lifecycleCallbacks).hydrationStarted)||void 0===n||n.call(t)}catch(e){}}try{null===(i=(s=Pn.lifecycleCallbacks).elementWillHydrate)||void 0===i||i.call(s,this.source)}catch(e){}if(this.stage=En.connecting,this.bindObservables(),this.connectBehaviors(),this.template)if(nt(this.template)){const e=this.source,t=null!==(r=An(e))&&void 0!==r?r:e;let n=t.firstChild,s=t.lastChild;null===e.shadowRoot&&(Ge.isElementBoundaryStartMarker(n)&&(n.data="",n=n.nextSibling),Ge.isElementBoundaryEndMarker(s)&&(s.data="",s=s.previousSibling)),this.view=this.template.hydrate(n,s,e),null===(o=this.view)||void 0===o||o.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=En.connected,this.source.removeAttribute(Hn),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),D.notify(this,kn)}}removeHydratingInstance(){var e,t;if(!Pn.hydratingInstances)return;try{null===(t=(e=Pn.lifecycleCallbacks).elementDidHydrate)||void 0===t||t.call(e,this.source)}catch(e){}const n=this.definition.name,s=Pn.hydratingInstances.get(n);s&&(s.delete(this.source),s.size||Pn.hydratingInstances.delete(n),Pn.idleCallbackId&&cancelIdleCallback(Pn.idleCallbackId),Pn.idleCallbackId=requestIdleCallback(Pn.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),Pn.hydrationObserver.unobserve(this.source)}static install(){In.setStrategy(Pn)}}function zn(e){const t=class extends e{constructor(){super(),In.forCustomElement(this)}$emit(e,t,n){return this.$fastController.emit(e,t,n)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,n){this.$fastController.onAttributeChangedCallback(e,t,n)}};return Xt.registerBaseType(t),t}function Un(e,t){return d(e)?Xt.compose(e,t).define().type:Xt.compose(this,e).define().type}Pn.hydrationObserver=new $n(Pn.hydrationObserverHandler),Pn.lifecycleCallbacks={},Pn.hydrationStarted=!1,Pn.idleCallbackId=null,Pn.hydratingInstances=new Map;const qn=Object.assign(zn(HTMLElement),{from:function(e){return zn(e)},define:Un,compose:function(e,t){return d(e)?Xt.compose(e,t):Xt.compose(this,e)},defineAsync:function(e,t){return d(e)?new Promise(n=>{Xt.composeAsync(e,t).then(e=>{n(e)})}).then(e=>e.define().type):new Promise(t=>{Xt.composeAsync(this,e).then(e=>{t(e)})}).then(e=>e.define().type)}});function Wn(e){return function(t){Un(t,e)}}O.setPolicy(I.create());export{se as ArrayObserver,_t as AttributeConfiguration,Pt as AttributeDefinition,oe as Binding,ve as CSSBindingDirective,pe as CSSDirective,Pe as ChildrenDirective,Mt as Compiler,O as DOM,y as DOMAspect,In as ElementController,we as ElementStyles,P as ExecutionContext,p as FAST,qn as FASTElement,Xt as FASTElementDefinition,wt as HTMLBindingDirective,Ve as HTMLDirective,pt as HTMLView,Pn as HydratableElementController,mt as HydrationBindingError,Zt as InlineTemplateDirective,Ie as Markup,He as NodeObservationDirective,D as Observable,Re as Parser,j as PropertyChangeNotifier,Et as RefDirective,sn as RenderBehavior,rn as RenderDirective,vn as RepeatBehavior,mn as RepeatDirective,Cn as SlottedDirective,U as Sort,_ as SourceLifetime,z as Splice,Z as SpliceStrategy,q as SpliceStrategySupport,En as Stages,De as StatelessAttachedAttributeDirective,R as SubscriberSet,Kt as TemplateOptions,V as Updates,tn as ViewTemplate,zt as attr,Dt as booleanConverter,ze as children,xe as css,ge as cssDirective,Wn as customElement,st as deferHydrationAttribute,Fe as elements,g as emptyArray,Jt as fastElementRegistry,nn as html,_e as htmlDirective,nt as isHydratable,ie as lengthOf,ce as listener,Hn as needsHydrationAttribute,ue as normalizeBinding,Lt as nullableBooleanConverter,Ht as nullableNumberConverter,L as observable,he as oneTime,le as oneWay,It as ref,hn as render,yn as repeat,Sn as slotted,re as sortedCount,F as volatile,xn as when};
@@ -3733,7 +3733,7 @@ class HTMLBindingDirective {
3733
3733
  case DOMAspect.content:
3734
3734
  controller.onUnbind(this);
3735
3735
  // intentional fall through
3736
- default:
3736
+ default: {
3737
3737
  const observer = (_a = target[this.data]) !== null && _a !== void 0 ? _a : (target[this.data] = this.dataBinding.createObserver(this, this));
3738
3738
  observer.target = target;
3739
3739
  observer.controller = controller;
@@ -3746,6 +3746,7 @@ class HTMLBindingDirective {
3746
3746
  }
3747
3747
  this.updateTarget(target, this.targetAspect, observer.bind(controller), controller);
3748
3748
  break;
3749
+ }
3749
3750
  }
3750
3751
  }
3751
3752
  /** @internal */
@@ -3781,11 +3782,22 @@ class HTMLBindingDirective {
3781
3782
  * Re-evaluates the binding expression via observer.bind() and pushes
3782
3783
  * the new value to the DOM through the updateTarget sink function.
3783
3784
  * This is the reactive update path that keeps the DOM in sync with data.
3785
+ *
3786
+ * Guards against stale notifications: when a view is unbound (e.g., after
3787
+ * a parent `when` directive tears down a child element), coupled-lifetime
3788
+ * observers may still hold active subscriptions. If a property change fires
3789
+ * on the source element while the view is inactive, this guard prevents
3790
+ * the binding expression from evaluating with a null source.
3784
3791
  * @internal
3785
3792
  */
3786
3793
  handleChange(binding, observer) {
3787
- const target = observer.target;
3788
3794
  const controller = observer.controller;
3795
+ // https://github.com/microsoft/fast/issues/7444
3796
+ // This guard will be reconsidered in the next major version.
3797
+ if (!controller.isBound) {
3798
+ return;
3799
+ }
3800
+ const target = observer.target;
3789
3801
  this.updateTarget(target, this.targetAspect, observer.bind(controller), controller);
3790
3802
  }
3791
3803
  }
@@ -4121,7 +4133,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
4121
4133
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4122
4134
  PERFORMANCE OF THIS SOFTWARE.
4123
4135
  ***************************************************************************** */
4124
- /* global Reflect, Promise, SuppressedError, Symbol */
4136
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
4125
4137
 
4126
4138
 
4127
4139
  function __awaiter(thisArg, _arguments, P, generator) {
@@ -4759,8 +4771,19 @@ class RenderBehavior {
4759
4771
  view.needsBindOnly = true;
4760
4772
  }
4761
4773
  }
4762
- /** @internal */
4774
+ /**
4775
+ * Handles changes from data or template binding observers.
4776
+ * Guards against stale notifications that may arrive after the
4777
+ * controller's view has been unbound (e.g., when a parent `when`
4778
+ * directive tears down and later recreates a child element).
4779
+ * @internal
4780
+ */
4763
4781
  handleChange(source, observer) {
4782
+ // https://github.com/microsoft/fast/issues/7444
4783
+ // This guard will be reconsidered in the next major version.
4784
+ if (!this.controller.isBound) {
4785
+ return;
4786
+ }
4764
4787
  if (observer === this.dataBindingObserver) {
4765
4788
  this.data = this.dataBindingObserver.bind(this.controller);
4766
4789
  }
@@ -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}`})}var i;!function(e){e[e.needsArrayObservation=1101]="needsArrayObservation",e[e.onlySetDOMPolicyOnce=1201]="onlySetDOMPolicyOnce",e[e.bindingInnerHTMLRequiresTrustedTypes=1202]="bindingInnerHTMLRequiresTrustedTypes",e[e.twoWayBindingRequiresObservables=1203]="twoWayBindingRequiresObservables",e[e.hostBindingWithoutHost=1204]="hostBindingWithoutHost",e[e.unsupportedBindingBehavior=1205]="unsupportedBindingBehavior",e[e.directCallToHTMLTagNotAllowed=1206]="directCallToHTMLTagNotAllowed",e[e.onlySetTemplatePolicyOnce=1207]="onlySetTemplatePolicyOnce",e[e.cannotSetTemplatePolicyAfterCompilation=1208]="cannotSetTemplatePolicyAfterCompilation",e[e.blockedByDOMPolicy=1209]="blockedByDOMPolicy",e[e.missingElementDefinition=1401]="missingElementDefinition",e[e.noRegistrationForContext=1501]="noRegistrationForContext",e[e.noFactoryForResolver=1502]="noFactoryForResolver",e[e.invalidResolverStrategy=1503]="invalidResolverStrategy",e[e.cannotAutoregisterDependency=1504]="cannotAutoregisterDependency",e[e.cannotResolveKey=1505]="cannotResolveKey",e[e.cannotConstructNativeFunction=1506]="cannotConstructNativeFunction",e[e.cannotJITRegisterNonConstructor=1507]="cannotJITRegisterNonConstructor",e[e.cannotJITRegisterIntrinsic=1508]="cannotJITRegisterIntrinsic",e[e.cannotJITRegisterInterface=1509]="cannotJITRegisterInterface",e[e.invalidResolver=1510]="invalidResolver",e[e.invalidKey=1511]="invalidKey",e[e.noDefaultResolver=1512]="noDefaultResolver",e[e.cyclicDependency=1513]="cyclicDependency",e[e.connectUpdateRequiresController=1514]="connectUpdateRequiresController"}(i||(i={}));const n=e=>"function"==typeof e,r=e=>"string"==typeof e,o=()=>{};!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 a={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},a));const l=globalThis.FAST;if(void 0===l.getById){const e=Object.create(null);Reflect.defineProperty(l,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},a))}void 0===l.error&&Object.assign(l,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const c=Object.freeze([]);function d(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function h(){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 u(e){e.prototype.toJSON=o}const f=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),p=e=>e,g=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:p}):{createHTML:p};let b=Object.freeze({createHTML:e=>g.createHTML(e),protect:(e,t,s,i)=>i});const v=b,m=Object.freeze({get policy(){return b},setPolicy(e){if(b!==v)throw l.error(i.onlySetDOMPolicyOnce);b=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 y(e,t,s,i){return(e,t,s,...n)=>{r(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...n)}}function w(e,t,s,n){throw l.error(i.blockedByDOMPolicy,{aspectName:s,tagName:null!=e?e:"text"})}const C={onabort:w,onauxclick:w,onbeforeinput:w,onbeforematch:w,onblur:w,oncancel:w,oncanplay:w,oncanplaythrough:w,onchange:w,onclick:w,onclose:w,oncontextlost:w,oncontextmenu:w,oncontextrestored:w,oncopy:w,oncuechange:w,oncut:w,ondblclick:w,ondrag:w,ondragend:w,ondragenter:w,ondragleave:w,ondragover:w,ondragstart:w,ondrop:w,ondurationchange:w,onemptied:w,onended:w,onerror:w,onfocus:w,onformdata:w,oninput:w,oninvalid:w,onkeydown:w,onkeypress:w,onkeyup:w,onload:w,onloadeddata:w,onloadedmetadata:w,onloadstart:w,onmousedown:w,onmouseenter:w,onmouseleave:w,onmousemove:w,onmouseout:w,onmouseover:w,onmouseup:w,onpaste:w,onpause:w,onplay:w,onplaying:w,onprogress:w,onratechange:w,onreset:w,onresize:w,onscroll:w,onsecuritypolicyviolation:w,onseeked:w,onseeking:w,onselect:w,onslotchange:w,onstalled:w,onsubmit:w,onsuspend:w,ontimeupdate:w,ontoggle:w,onvolumechange:w,onwaiting:w,onwebkitanimationend:w,onwebkitanimationiteration:w,onwebkitanimationstart:w,onwebkittransitionend:w,onwheel:w},S={elements:{a:{[f.attribute]:{href:y},[f.property]:{href:y}},area:{[f.attribute]:{href:y},[f.property]:{href:y}},button:{[f.attribute]:{formaction:y},[f.property]:{formAction:y}},embed:{[f.attribute]:{src:w},[f.property]:{src:w}},form:{[f.attribute]:{action:y},[f.property]:{action:y}},frame:{[f.attribute]:{src:y},[f.property]:{src:y}},iframe:{[f.attribute]:{src:y},[f.property]:{src:y,srcdoc:w}},input:{[f.attribute]:{formaction:y},[f.property]:{formAction:y}},link:{[f.attribute]:{href:w},[f.property]:{href:w}},object:{[f.attribute]:{codebase:w,data:w},[f.property]:{codeBase:w,data:w}},script:{[f.attribute]:{src:w,text:w},[f.property]:{src:w,text:w,innerText:w,textContent:w}},style:{[f.property]:{innerText:w,textContent:w}}},aspects:{[f.attribute]:Object.assign({},C),[f.property]:Object.assign({innerHTML:w},C),[f.event]:Object.assign({},C)}};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]=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]=T(r,{});break;default:s[i]=T(n,r)}}for(const t in e)t in s||(s[t]=T(e[t],{}));return Object.freeze(s)}function O(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 B(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=S,Object.freeze({elements:r.elements?O(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=B(a,e,t,s,i);if(n)return n}return null!==(r=B(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}});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=l.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})})),E=Object.freeze({unknown:void 0,coupled:1}),M=l.getById(s.observable,(()=>{const e=A.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let o,a=e=>{throw l.error(i.needsArrayObservation)};function c(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=a(e):s.set(e,i=new k(e))),i}const d=h();class f{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==o&&o.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const r=e[this.callback];n(r)&&r.call(e,i,t),c(e).notify(this.name)}}}class p 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!==E.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=o;let i;o=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{o=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=c(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;o=void 0,t=s.propertySource[s.propertyName],o=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 u(p),Object.freeze({setArrayObserverFactory(e){a=e},getNotifier:c,track(e,t){o&&o.watch(e,t)},trackVolatile(){o&&(o.needsRefresh=!0)},notify(e,t){c(e).notify(t)},defineProperty(e,t){r(t)&&(t=new f(t)),d(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:d,binding(e,t,s=this.isVolatileBinding(e)){return new p(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function I(e,t){M.defineProperty(e,t)}function R(e,t,s){return Object.assign({},s,{get(){return M.trackVolatile(),s.get.apply(this)}})}const j=l.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 _{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 L{constructor(e){this.sorted=e}}const H=Object.freeze({reset:1,splice:2,optimized:3}),z=new _(0,c,0);z.reset=!0;const F=[z];var D;function P(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 c;if(t===s){const e=new _(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new _(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(D.add),s--;continue}if(0===s){n.push(D.delete),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(D.leave):(n.push(D.update),i=r),t--,s--):l===o?(n.push(D.delete),t--,i=o):(n.push(D.add),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 D.leave:void 0!==u&&(h.push(u),u=void 0),f++,p++;break;case D.update:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case D.add:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++;break;case D.delete:void 0===u&&(u=new _(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&h.push(u),h}function q(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)}!function(e){e[e.leave=0]="leave",e[e.update=1]="update",e[e.add=2]="add",e[e.delete=3]="delete"}(D||(D={}));let U=Object.freeze({support:H.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?c:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)q(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(P(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):F,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new _(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new _(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 L(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new _(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 L(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new _(+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 _(0,[],i.length).adjustTo(e)),n}});const W=Object.freeze({reset:F,setDefaultStrategy(e){U=e}});function Q(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}class J extends N{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,M.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,M.notify(e,"sorted"))}},this.subscribe(e)}return e}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)}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:U).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,A.enqueue(this))}}let K=!1;const X=Object.freeze({sorted:0,enable(){if(K)return;K=!0,M.setArrayObserverFactory((e=>new J(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:U)[t.name](this,i,t,e)}})))}});function G(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=M.getNotifier(e)),M.track(t.lengthObserver,"length"),e.length}function Y(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=M.getNotifier(e)),M.track(t.sortObserver,"sorted"),e.sorted}class Z{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class ee extends Z{createObserver(e){return M.binding(this.evaluate,e,this.isVolatile)}}function te(e,t,s=M.isVolatileBinding(e)){return new ee(e,t,s)}function se(e,t){const s=new ee(e);return s.options=t,s}class ie extends Z{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ne(e,t){return new ie(e,t)}function re(e){return n(e)?te(e):e instanceof Z?e:ne((()=>e))}u(ie);const oe=d(),ae=Object.freeze({getForInstance:oe.getForInstance,getByType:oe.getByType,define:e=>(oe.register({type:e}),e)});function le(){return function(e){ae.define(e)}}function ce(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class de{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)=>ce(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){ce(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){ce(this,t.controller,t)}}let he;function ue(e){return e.map((e=>e instanceof fe?ue(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}ae.define(de);class fe{get strategy(){return null===this._strategy&&this.withStrategy(he),this._strategy}constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof fe?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}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(ue(this.styles)),this}static setDefaultStrategy(e){he=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new fe(e):e instanceof fe?e:new fe([e])}}fe.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const pe=`${Math.random().toString(36).substring(2,8)}`;let ge=0;const be=()=>`--v${pe}${++ge}`;function ve(e,t){const s=[];let i="";const r=[],o=e=>{r.push(e)};for(let r=0,a=e.length-1;r<a;++r){i+=e[r];let a=t[r];n(a)?a=new de(te(a),be()).createCSS(o):a instanceof Z?a=new de(a,be()).createCSS(o):void 0!==ae.getForInstance(a)&&(a=a.createCSS(o)),a instanceof fe||a instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(a)):i+=a}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:r}}const me=(e,...t)=>{const{styles:s,behaviors:i}=ve(e,t),n=new fe(s);return i.length?n.withBehaviors(...i):n};class ye{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(r(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new fe(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)}}ae.define(ye),me.partial=(e,...t)=>{const{styles:s,behaviors:i}=ve(e,t);return new ye(s,i)};const we=`fast-${Math.random().toString(36).substring(2,8)}`,Ce=`${we}{`,Se=`}${we}`,Te=Se.length;let xe=0;const Oe=()=>`${we}-${++xe}`,Be=Object.freeze({interpolation:e=>`${Ce}${e}${Se}`,attribute:e=>`${Oe()}="${Ce}${e}${Se}"`,comment:e=>`\x3c!--${Ce}${e}${Se}--\x3e`}),$e=Object.freeze({parse(e,t){const s=e.split(Ce);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(Se);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+Te)}""!==o&&i.push(o)}return i}}),Ne=d(),ke=Object.freeze({getForInstance:Ne.getForInstance,getByType:Ne.getByType,define:(e,t)=>((t=t||{}).type=e,Ne.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?f.tokenList:f.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=f.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=f.event;break;default:e.targetAspect=t,e.aspectType=f.attribute}else e.aspectType=f.content}});function Ae(e){return function(t){ke.define(t,e)}}class Ee{constructor(e){this.options=e}createHTML(e){return Be.attribute(e(this))}createBehavior(){return this}}u(Ee);const Me=e=>1===e.nodeType,Ie=e=>e?t=>1===t.nodeType&&t.matches(e):Me;class Re extends Ee{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,c),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}}class je extends Re{constructor(e){super(e),this.observerProperty=Symbol(),e.childList=!0}observe(e){let t=e[this.observerProperty];if(!t){t=new MutationObserver(((t,s)=>{this.updateTarget(this.getSource(e),this.computeNodes(e))})),t.toJSON=o,e[this.observerProperty]=t}t.observe(e,this.options)}disconnect(e){e[this.observerProperty].disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Ve(e){return r(e)&&(e={property:e}),new je(e)}ke.define(je);const _e=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,Le=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,He=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,ze=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Fe=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,De=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Pe(e){return e&&e.nodeType===Node.COMMENT_NODE}const qe=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=>Le.test(e),isRepeatViewStartMarker:e=>He.test(e),isRepeatViewEndMarker:e=>ze.test(e),isElementBoundaryStartMarker:e=>Pe(e)&&Fe.test(e.data.trim()),isElementBoundaryEndMarker:e=>Pe(e)&&De.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 l.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 l.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=>Qe(_e,e),parseContentBindingEndMarker:e=>Qe(Le,e),parseRepeatStartMarker:e=>Ue(He,e),parseRepeatEndMarker:e=>Ue(ze,e),parseElementBoundaryStartMarker:e=>We(Fe,e.trim()),parseElementBoundaryEndMarker:e=>We(De,e)});function Ue(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function We(e,t){const s=e.exec(t);return null===s?s:s[1]}function Qe(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const Je=Symbol.for("fe-hydration");function Ke(e){return e[Je]===Je}const Xe="defer-hydration";class Ge extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ye(e){return e.nodeType===Node.COMMENT_NODE}function Ze(e){return e.nodeType===Node.TEXT_NODE}function et(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ye(t)||Ze(t)?t.data.length:t.childNodes.length),s}function tt(e,t,s,i){var n,r;const o=null!==(r=null!==(n=qe.parseAttributeBinding(e))&&void 0!==n?n:qe.parseEnumeratedAttributeBinding(e))&&void 0!==r?r:qe.parseCompactAttributeBinding(e);if(null!==o){for(const n of o){const r=t[n+i];if(!r)throw new Ge(`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);it(r,e,s)}e.removeAttribute(qe.attributeMarkerName)}}function st(e,t,s,i,n,r){if(qe.isElementBoundaryStartMarker(e))!function(e,t){const s=qe.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(Ye(i)){const e=qe.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(qe.isContentBindingStartMarker(e.data)){const o=qe.parseContentBindingStartMarker(e.data);if(null===o)return;const[a,l]=o,c=s[a+r],d=[];let h=t.nextSibling();e.data="";const u=h;for(;null!==h;){if(Ye(h)){const e=qe.parseContentBindingEndMarker(h.data);if(e&&e[1]===l)break}d.push(h),h=t.nextSibling()}if(null===h){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(h.data="",1===d.length&&Ze(d[0]))it(c,d[0],i);else{h!==u&&null!==h.previousSibling&&(n[c.targetNodeId]={first:u,last:h.previousSibling});it(c,h.parentNode.insertBefore(document.createTextNode(""),h),i)}}}function it(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var nt;function rt(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 ot{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 at extends ot{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=E.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(){rt(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){rt(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}u(at),M.defineProperty(at.prototype,"index"),M.defineProperty(at.prototype,"length");const lt="unhydrated",ct="hydrating",dt="hydrated";class ht extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}nt=Je,u(class extends ot{get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[nt]=Je,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=E.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=lt,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}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!==dt&&(this._hydrationStage=ct),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=et(e,t),n=i.commonAncestorContainer,r=function(e){let t=0;for(let s=0,i=e.length;s<i&&"h"===e[s].targetNodeId;++s)t++;return t}(s),o=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}),a={},l={};let c=o.currentNode=e;for(;null!==c;){switch(c.nodeType){case Node.ELEMENT_NODE:tt(c,s,a,r);break;case Node.COMMENT_NODE:st(c,o,s,a,l,r)}c=o.nextNode()}return i.detach(),{targets:a,boundaries:l}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof Ge){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&&it(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 ht(r.join("\n"),t,et(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=dt}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){rt(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 ut={[f.attribute]:m.setAttribute,[f.booleanAttribute]:m.setBooleanAttribute,[f.property]:(e,t,s)=>e[t]=s,[f.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(Ke(i)&&Ke(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==dt){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}},[f.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)}},[f.event]:()=>{}};class ft{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=f.content}createHTML(e){return Be.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=ut[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw l.error(i.unsupportedBindingBehavior);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=Ke(e)&&e.hydrationStage&&e.hydrationStage!==dt;switch(this.aspectType){case f.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case f.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===f.attribute||this.aspectType===f.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)}}ke.define(ft,{aspected:!0});const pt=(e,t)=>`${e}.${t}`,gt={},bt={index:0,node:null};function vt(e){e.startsWith("fast-")||l.warn(i.hostBindingWithoutHost,{name:e})}const mt=new Proxy(document.createElement("div"),{get(e,t){vt(t);const s=Reflect.get(e,t);return n(s)?s.bind(e):s},set:(e,t,s)=>(vt(t),Reflect.set(e,t,s))});class yt{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:Oe(),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),10);this.addTargetDescriptor(s,e,i)}let n=gt[t];if(!n){const i=`_${t}`;gt[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:mt;for(const e of this.nodeIds)Reflect.get(s,e);return new at(t,this.factories,s)}}function wt(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=$e.parse(h,a);let f=null;null===u?r&&(f=new ft(ne((()=>h),e.policy)),ke.assignAspect(f,d.name)):f=xt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,i,n,s.tagName))}}function Ct(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=St(e,s,n,i);n=t.node,i=t.index}}function St(e,t,s,i){const n=pt(t,i);switch(s.nodeType){case 1:wt(e,t,s,n,i),Ct(e,s,n);break;case 3:return function(e,t,s,i,n){const o=$e.parse(t.textContent,e.directives);if(null===o)return bt.node=t.nextSibling,bt.index=n+1,bt;let a,l=a=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(n++,i=pt(s,n),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),r(c)?a.textContent=c:(a.textContent=" ",ke.assignAspect(c),e.addFactory(c,s,i,n,null)),l=a}return bt.index=n+1,bt.node=l.nextSibling,bt}(e,s,t,n,i);case 8:{const r=$e.parse(s.data,e.directives);null!==r&&e.addFactory(xt.aggregate(r),t,n,i,null);break}}return bt.index=i+1,bt.node=s.nextSibling,bt}const Tt="TEMPLATE",xt={compile(e,t,s=m.policy){let i;if(r(e)){i=document.createElement(Tt),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===Tt&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const n=document.adoptNode(i.content),o=new yt(n,t,s);var a,l;return wt(o,"",i,"h",0,!0),a=n.firstChild,l=t,(a&&8===a.nodeType&&null!==$e.parse(a.data,l)||1===n.childNodes.length&&Object.keys(t).length>0)&&n.insertBefore(document.createComment(""),n.firstChild),Ct(o,n,"r"),bt.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=m.policy){if(1===e.length)return e[0];let s,i,n=!1;const o=e.length,a=e.map((e=>r(e)?()=>e:(s=e.sourceAspect||s,n=n||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),l=new ft(te(((e,t)=>{let s="";for(let i=0;i<o;++i)s+=a[i](e,t);return s}),null!=i?i:t,n));return ke.assignAspect(l,s),l}};class Ot extends Ee{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}ke.define(Ot);const Bt=e=>new Ot(e);function $t(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())}))}"function"==typeof SuppressedError&&SuppressedError;const Nt="boolean",kt="reflect",At=Object.freeze({locate:h()}),Et={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Mt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Et.fromView(e)};function It(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Rt={toView(e){const t=It(e);return t?t.toString():t},fromView:It};class jt{constructor(e,t,s=t.toLowerCase(),i=kt,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===Nt&&void 0===n&&(this.converter=Et)}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 M.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||A.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case kt:const t=this.converter;m.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case Nt:m.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(At.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];r(i)?s.push(new jt(e,i)):s.push(new jt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function Vt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),At.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}var _t;const Lt={mode:"open"},Ht={},zt=new Set,Ft=l.getById(s.elementRegistry,(()=>d())),Dt={deferAndHydrate:"defer-and-hydrate"};class Pt{get isDefined(){return this.platformDefined}constructor(e,t=e.definition){var s;this.platformDefined=!1,r(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=jt.collect(e,t.attributes),o=new Array(n.length),a={},l={};for(let e=0,t=n.length;e<t;++e){const t=n[e];o[e]=t.attribute,a[t.name]=t,l[t.attribute]=t,M.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=n,this.propertyLookup=a,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?Lt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Lt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?Ht:Object.assign(Object.assign({},Ht),t.elementOptions),this.styles=fe.normalize(t.styles),Ft.register(this),M.defineProperty(_t.isRegistered,this.name),_t.isRegistered[this.name]=this.type}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 zt.has(e)||Ft.getByType(e)?new _t(class extends e{},t):new _t(e,t)}static registerBaseType(e){zt.add(e)}static composeAsync(e,t){return new Promise((s=>{(zt.has(e)||Ft.getByType(e))&&s(new _t(class extends e{},t));const i=new _t(e,t);M.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")}))}}_t=Pt,Pt.isRegistered={},Pt.getByType=Ft.getByType,Pt.getForInstance=Ft.getForInstance,Pt.registerAsync=e=>$t(void 0,void 0,void 0,(function*(){return new Promise((t=>{_t.isRegistered[e]&&t(_t.isRegistered[e]),M.getNotifier(_t.isRegistered).subscribe({handleChange:()=>t(_t.isRegistered[e])},e)}))})),M.defineProperty(Pt.prototype,"template");const qt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Ut=Object.create(null);class Wt{constructor(e,t=Ut){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Qt(e,t,s,i=ke.getForInstance(e)){if(i.aspected){const s=qt.exec(t);null!==s&&ke.assignAspect(e,s[2])}return e.createHTML(s)}Wt.empty=new Wt(""),ke.define(Wt);class Jt{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=xt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new Wt(r(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw l.error(i.cannotSetTemplatePolicyAfterCompilation);if(this.policy)throw l.error(i.onlySetTemplatePolicyOnce);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 r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Oe();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(i+=r,n(l))l=new ft(te(l));else if(l instanceof Z)l=new ft(l);else if(!(a=ke.getForInstance(l))){const e=l;l=new ft(ne((()=>e)))}i+=Qt(l,r,o,a)}return new Jt(i+e[e.length-1],r,s)}}u(Jt);const Kt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Jt.create(e,t);throw l.error(i.directCallToHTMLTagNotAllowed)};Kt.partial=e=>new Wt(e);class Xt{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),Ke(this.template)&&Ke(e)&&e.hydrationStage!==dt&&!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 Gt{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Be.comment(e(this))}createBehavior(){return new Xt(this)}}ke.define(Gt);const Yt=new Map,Zt="default-view",es=Kt`
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}`})}var n;!function(e){e[e.needsArrayObservation=1101]="needsArrayObservation",e[e.onlySetDOMPolicyOnce=1201]="onlySetDOMPolicyOnce",e[e.bindingInnerHTMLRequiresTrustedTypes=1202]="bindingInnerHTMLRequiresTrustedTypes",e[e.twoWayBindingRequiresObservables=1203]="twoWayBindingRequiresObservables",e[e.hostBindingWithoutHost=1204]="hostBindingWithoutHost",e[e.unsupportedBindingBehavior=1205]="unsupportedBindingBehavior",e[e.directCallToHTMLTagNotAllowed=1206]="directCallToHTMLTagNotAllowed",e[e.onlySetTemplatePolicyOnce=1207]="onlySetTemplatePolicyOnce",e[e.cannotSetTemplatePolicyAfterCompilation=1208]="cannotSetTemplatePolicyAfterCompilation",e[e.blockedByDOMPolicy=1209]="blockedByDOMPolicy",e[e.missingElementDefinition=1401]="missingElementDefinition",e[e.noRegistrationForContext=1501]="noRegistrationForContext",e[e.noFactoryForResolver=1502]="noFactoryForResolver",e[e.invalidResolverStrategy=1503]="invalidResolverStrategy",e[e.cannotAutoregisterDependency=1504]="cannotAutoregisterDependency",e[e.cannotResolveKey=1505]="cannotResolveKey",e[e.cannotConstructNativeFunction=1506]="cannotConstructNativeFunction",e[e.cannotJITRegisterNonConstructor=1507]="cannotJITRegisterNonConstructor",e[e.cannotJITRegisterIntrinsic=1508]="cannotJITRegisterIntrinsic",e[e.cannotJITRegisterInterface=1509]="cannotJITRegisterInterface",e[e.invalidResolver=1510]="invalidResolver",e[e.invalidKey=1511]="invalidKey",e[e.noDefaultResolver=1512]="noDefaultResolver",e[e.cyclicDependency=1513]="cyclicDependency",e[e.connectUpdateRequiresController=1514]="connectUpdateRequiresController"}(n||(n={}));const i=e=>"function"==typeof e,r=e=>"string"==typeof e,o=()=>{};!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 a={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},a));const l=globalThis.FAST;if(void 0===l.getById){const e=Object.create(null);Reflect.defineProperty(l,"getById",Object.assign({value(t,s){let n=e[t];return void 0===n&&(n=s?e[t]=s():null),n}},a))}void 0===l.error&&Object.assign(l,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const c=Object.freeze([]);function d(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function h(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let n=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==n;)s=e.get(n),n=Reflect.getPrototypeOf(n);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function u(e){e.prototype.toJSON=o}const f=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),p=e=>e,g=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:p}):{createHTML:p};let b=Object.freeze({createHTML:e=>g.createHTML(e),protect:(e,t,s,n)=>n});const v=b,m=Object.freeze({get policy(){return b},setPolicy(e){if(b!==v)throw l.error(n.onlySetDOMPolicyOnce);b=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 y(e,t,s,n){return(e,t,s,...i)=>{r(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),n(e,t,s,...i)}}function w(e,t,s,i){throw l.error(n.blockedByDOMPolicy,{aspectName:s,tagName:null!=e?e:"text"})}const C={onabort:w,onauxclick:w,onbeforeinput:w,onbeforematch:w,onblur:w,oncancel:w,oncanplay:w,oncanplaythrough:w,onchange:w,onclick:w,onclose:w,oncontextlost:w,oncontextmenu:w,oncontextrestored:w,oncopy:w,oncuechange:w,oncut:w,ondblclick:w,ondrag:w,ondragend:w,ondragenter:w,ondragleave:w,ondragover:w,ondragstart:w,ondrop:w,ondurationchange:w,onemptied:w,onended:w,onerror:w,onfocus:w,onformdata:w,oninput:w,oninvalid:w,onkeydown:w,onkeypress:w,onkeyup:w,onload:w,onloadeddata:w,onloadedmetadata:w,onloadstart:w,onmousedown:w,onmouseenter:w,onmouseleave:w,onmousemove:w,onmouseout:w,onmouseover:w,onmouseup:w,onpaste:w,onpause:w,onplay:w,onplaying:w,onprogress:w,onratechange:w,onreset:w,onresize:w,onscroll:w,onsecuritypolicyviolation:w,onseeked:w,onseeking:w,onselect:w,onslotchange:w,onstalled:w,onsubmit:w,onsuspend:w,ontimeupdate:w,ontoggle:w,onvolumechange:w,onwaiting:w,onwebkitanimationend:w,onwebkitanimationiteration:w,onwebkitanimationstart:w,onwebkittransitionend:w,onwheel:w},S={elements:{a:{[f.attribute]:{href:y},[f.property]:{href:y}},area:{[f.attribute]:{href:y},[f.property]:{href:y}},button:{[f.attribute]:{formaction:y},[f.property]:{formAction:y}},embed:{[f.attribute]:{src:w},[f.property]:{src:w}},form:{[f.attribute]:{action:y},[f.property]:{action:y}},frame:{[f.attribute]:{src:y},[f.property]:{src:y}},iframe:{[f.attribute]:{src:y},[f.property]:{src:y,srcdoc:w}},input:{[f.attribute]:{formaction:y},[f.property]:{formAction:y}},link:{[f.attribute]:{href:w},[f.property]:{href:w}},object:{[f.attribute]:{codebase:w,data:w},[f.property]:{codeBase:w,data:w}},script:{[f.attribute]:{src:w,text:w},[f.property]:{src:w,text:w,innerText:w,textContent:w}},style:{[f.property]:{innerText:w,textContent:w}}},aspects:{[f.attribute]:Object.assign({},C),[f.property]:Object.assign({innerHTML:w},C),[f.event]:Object.assign({},C)}};function T(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=r;break;default:s[n]=i}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function x(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=T(r,{});break;default:s[n]=T(i,r)}}for(const t in e)t in s||(s[t]=T(e[t],{}));return Object.freeze(s)}function O(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=x(i,{});break;default:s[n]=x(i,r)}}for(const t in e)t in s||(s[t]=x(e[t],{}));return Object.freeze(s)}function B(e,t,s,n,i){const r=e[s];if(r){const e=r[n];if(e)return e(t,s,n,i)}}const $=Object.freeze({create(e={}){var t,s;const n=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}}(),i=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=S,Object.freeze({elements:r.elements?O(r.elements,o.elements):o.elements,aspects:r.aspects?x(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>n.createHTML(e),protect(e,t,s,n){var r;const o=(null!=e?e:"").toLowerCase(),a=i.elements[o];if(a){const i=B(a,e,t,s,n);if(i)return i}return null!==(r=B(i.aspects,e,t,s,n))&&void 0!==r?r:n}})}});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,n=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==n&&n.handleChange(s,e)}else for(let n=0,i=t.length;n<i;++n)t[n].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,n;let i;i=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new N(this.subject):null!==(n=this.subjectSubscribers)&&void 0!==n?n:this.subjectSubscribers=new N(this.subject),i.subscribe(e)}unsubscribe(e,t){var s,n;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(n=this.subjectSubscribers)||void 0===n||n.unsubscribe(e)}}const A=l.getById(s.updateQueue,()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let n=!0;function i(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!n)throw e.length=0,s;t.push(s),setTimeout(i,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,n=e.length-t;s<n;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(n?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>n=e})}),E=Object.freeze({unknown:void 0,coupled:1}),M=l.getById(s.observable,()=>{const e=A.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let o,a=e=>{throw l.error(n.needsArrayObservation)};function c(e){var t;let n=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===n&&(Array.isArray(e)?n=a(e):s.set(e,n=new k(e))),n}const d=h();class f{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==o&&o.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),c(e).notify(this.name)}}}class p 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!==E.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=o;let n;o=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.expression(e,t)}finally{o=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=c(e),i=null===s?this.first:{};if(i.propertySource=e,i.propertyName=t,i.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;o=void 0,t=s.propertySource[s.propertyName],o=this,e===t&&(this.needsRefresh=!0)}s.next=i}this.last=i}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 u(p),Object.freeze({setArrayObserverFactory(e){a=e},getNotifier:c,track(e,t){o&&o.watch(e,t)},trackVolatile(){o&&(o.needsRefresh=!0)},notify(e,t){c(e).notify(t)},defineProperty(e,t){r(t)&&(t=new f(t)),d(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:d,binding(e,t,s=this.isVolatileBinding(e)){return new p(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})});function I(e,t){M.defineProperty(e,t)}function R(e,t,s){return Object.assign({},s,{get(){return M.trackVolatile(),s.get.apply(this)}})}const j=l.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 _{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 L{constructor(e){this.sorted=e}}const H=Object.freeze({reset:1,splice:2,optimized:3}),z=new _(0,c,0);z.reset=!0;const F=[z];var D;function P(e,t,s,n){return t<s||n<e?-1:t===s||n===e?0:e<s?t<n?t-s:n-s:n<t?n-e:t-e}function q(e,t,s,n,i,r){let o=0,a=0;const l=Math.min(s-t,r-i);if(0===t&&0===i&&(o=function(e,t,s){for(let n=0;n<s;++n)if(e[n]!==t[n])return n;return s}(e,n,l)),s===e.length&&r===n.length&&(a=function(e,t,s){let n=e.length,i=t.length,r=0;for(;r<s&&e[--n]===t[--i];)r++;return r}(e,n,l-o)),i+=o,r-=a,(s-=a)-(t+=o)===0&&r-i===0)return c;if(t===s){const e=new _(t,[],0);for(;i<r;)e.removed.push(n[i++]);return[e]}if(i===r)return[new _(t,[],s-t)];const d=function(e){let t=e.length-1,s=e[0].length-1,n=e[t][s];const i=[];for(;t>0||s>0;){if(0===t){i.push(D.add),s--;continue}if(0===s){i.push(D.delete),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===n?i.push(D.leave):(i.push(D.update),n=r),t--,s--):l===o?(i.push(D.delete),t--,n=o):(i.push(D.add),s--,n=a)}return i.reverse()}(function(e,t,s,n,i,r){const o=r-i+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]===n[i+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,n,i,r)),h=[];let u,f=t,p=i;for(let e=0;e<d.length;++e)switch(d[e]){case D.leave:void 0!==u&&(h.push(u),u=void 0),f++,p++;break;case D.update:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++,u.removed.push(n[p]),p++;break;case D.add:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++;break;case D.delete:void 0===u&&(u=new _(f,[],0)),u.removed.push(n[p]),p++}return void 0!==u&&h.push(u),h}function U(e,t){let s=!1,n=0;for(let i=0;i<t.length;i++){const r=t[i];if(r.index+=n,s)continue;const o=P(e.index,e.index+e.removed.length,r.index,r.index+r.addedCount);if(o>=0){t.splice(i,1),i--,n-=r.addedCount-r.removed.length,e.addedCount+=r.addedCount-o;const a=e.removed.length+r.removed.length-o;if(e.addedCount||a){let t=r.removed;if(e.index<r.index){const s=e.removed.slice(0,r.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>r.index+r.addedCount){const s=e.removed.slice(r.index+r.addedCount-e.index);t.push(...s)}e.removed=t,r.index<e.index&&(e.index=r.index)}else s=!0}else if(e.index<r.index){s=!0,t.splice(i,0,e),i++;const o=e.addedCount-e.removed.length;r.index+=o,n+=o}}s||t.push(e)}!function(e){e[e.leave=0]="leave",e[e.update=1]="update",e[e.add=2]="add",e[e.delete=3]="delete"}(D||(D={}));let W=Object.freeze({support:H.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?c:function(e,t){let s=[];const n=[];for(let e=0,s=t.length;e<s;e++)U(t[e],n);for(let t=0,i=n.length;t<i;++t){const i=n[t];1!==i.addedCount||1!==i.removed.length?s=s.concat(q(e,i.index,i.index+i.addedCount,i.removed,0,i.removed.length)):i.removed[0]!==e[i.index]&&s.push(i)}return s}(t,s):F,pop(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new _(e.length,[r],0)),r},push(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new _(e.length-n.length,[],n.length).adjustTo(e)),i},reverse(e,t,s,n){const i=s.apply(e,n);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new L(r)),i},shift(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new _(0,[r],0)),r},sort(e,t,s,n){const i=new Map;for(let t=0,s=e.length;t<s;++t){const s=i.get(e[t])||[];i.set(e[t],[...s,t])}const r=s.apply(e,n);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=i.get(e[t]);o.push(s[0]),i.set(e[t],s.splice(1))}return t.addSort(new L(o)),r},splice(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new _(+n[0],i,n.length>2?n.length-2:0).adjustTo(e)),i},unshift(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new _(0,[],n.length).adjustTo(e)),i}});const Q=Object.freeze({reset:F,setDefaultStrategy(e){W=e}});function J(e,t,s,n=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:n})}class K extends N{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,M.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,M.notify(e,"sorted"))}},this.subscribe(e)}return e}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,J(e,"$fastController",this)}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,n=this.oldCollection;void 0===t&&void 0===n&&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:W).normalize(n,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,A.enqueue(this))}}let X=!1;const G=Object.freeze({sorted:0,enable(){if(X)return;X=!0,M.setArrayObserverFactory(e=>new K(e));const e=Array.prototype;e.$fastPatch||(J(e,"$fastPatch",1),J(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 n=this.$fastController;return void 0===n?t.apply(this,e):(null!==(s=n.strategy)&&void 0!==s?s:W)[t.name](this,n,t,e)}}))}});function Y(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(G.enable(),t=M.getNotifier(e)),M.track(t.lengthObserver,"length"),e.length}function Z(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(G.enable(),t=M.getNotifier(e)),M.track(t.sortObserver,"sorted"),e.sorted}class ee{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class te extends ee{createObserver(e){return M.binding(this.evaluate,e,this.isVolatile)}}function se(e,t,s=M.isVolatileBinding(e)){return new te(e,t,s)}function ne(e,t){const s=new te(e);return s.options=t,s}class ie extends ee{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function re(e,t){return new ie(e,t)}function oe(e){return i(e)?se(e):e instanceof ee?e:re(()=>e)}u(ie);const ae=d(),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,n)=>{e.call(s,t,n),"style"===t&&s.$cssBindings.forEach((e,t)=>de(t,e.controller,e.observer))}}const n=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);n.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:n})}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)}}let ue;function fe(e){return e.map(e=>e instanceof pe?fe(e.styles):[e]).reduce((e,t)=>e.concat(t),[])}le.define(he);class pe{get strategy(){return null===this._strategy&&this.withStrategy(ue),this._strategy}constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map(e=>e instanceof pe?e.behaviors:null).reduce((e,t)=>null===t?e:null===e?t:e.concat(t),null)}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(fe(this.styles)),this}static setDefaultStrategy(e){ue=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new pe(e):e instanceof pe?e:new pe([e])}}pe.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const ge=`${Math.random().toString(36).substring(2,8)}`;let be=0;const ve=()=>`--v${ge}${++be}`;function me(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(se(a),ve()).createCSS(o):a instanceof ee?a=new he(a,ve()).createCSS(o):void 0!==le.getForInstance(a)&&(a=a.createCSS(o)),a instanceof pe||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 ye=(e,...t)=>{const{styles:s,behaviors:n}=me(e,t),i=new pe(s);return n.length?i.withBehaviors(...n):i};class we{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce((e,t)=>(r(t)?this.css+=t:e.push(t),e),[]);s.length&&(this.styles=new pe(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(we),ye.partial=(e,...t)=>{const{styles:s,behaviors:n}=me(e,t);return new we(s,n)};const Ce=`fast-${Math.random().toString(36).substring(2,8)}`,Se=`${Ce}{`,Te=`}${Ce}`,xe=Te.length;let Oe=0;const Be=()=>`${Ce}-${++Oe}`,$e=Object.freeze({interpolation:e=>`${Se}${e}${Te}`,attribute:e=>`${Be()}="${Se}${e}${Te}"`,comment:e=>`\x3c!--${Se}${e}${Te}--\x3e`}),Ne=Object.freeze({parse(e,t){const s=e.split(Se);if(1===s.length)return null;const n=[];for(let e=0,i=s.length;e<i;++e){const i=s[e],r=i.indexOf(Te);let o;if(-1===r)o=i;else{const e=i.substring(0,r);n.push(t[e]),o=i.substring(r+xe)}""!==o&&n.push(o)}return n}}),ke=d(),Ae=Object.freeze({getForInstance:ke.getForInstance,getByType:ke.getByType,define:(e,t)=>((t=t||{}).type=e,ke.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?f.tokenList:f.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=f.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=f.event;break;default:e.targetAspect=t,e.aspectType=f.attribute}else e.aspectType=f.content}});function Ee(e){return function(t){Ae.define(t,e)}}class Me{constructor(e){this.options=e}createHTML(e){return $e.attribute(e(this))}createBehavior(){return this}}u(Me);const Ie=e=>1===e.nodeType,Re=e=>e?t=>1===t.nodeType&&t.matches(e):Ie;class je extends Me{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,c),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}}class Ve extends je{constructor(e){super(e),this.observerProperty=Symbol(),e.childList=!0}observe(e){let t=e[this.observerProperty];if(!t){t=new MutationObserver((t,s)=>{this.updateTarget(this.getSource(e),this.computeNodes(e))}),t.toJSON=o,e[this.observerProperty]=t}t.observe(e,this.options)}disconnect(e){e[this.observerProperty].disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function _e(e){return r(e)&&(e={property:e}),new Ve(e)}Ae.define(Ve);const Le=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,He=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,ze=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Fe=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,De=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,Pe=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function qe(e){return e&&e.nodeType===Node.COMMENT_NODE}const Ue=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=>Le.test(e),isContentBindingEndMarker:e=>He.test(e),isRepeatViewStartMarker:e=>ze.test(e),isRepeatViewEndMarker:e=>Fe.test(e),isElementBoundaryStartMarker:e=>qe(e)&&De.test(e.data.trim()),isElementBoundaryEndMarker:e=>qe(e)&&Pe.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,n=`${this.attributeMarkerName}-`;for(const i of e.getAttributeNames())if(i.startsWith(n)){const e=Number(i.slice(s));if(Number.isNaN(e))throw l.error(1601,{name:i,expectedFormat:`${n}<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 n=s.slice(t.length).split("-"),i=parseInt(n[0],10),r=parseInt(n[1],10);if(2!==n.length||Number.isNaN(i)||Number.isNaN(r)||i<0||r<1)throw l.error(1604,{name:s,expectedFormat:`${this.compactAttributeMarkerName}-{index}-{count}`});const o=[];for(let e=0;e<r;e++)o.push(i+e);return o},parseContentBindingStartMarker:e=>Je(Le,e),parseContentBindingEndMarker:e=>Je(He,e),parseRepeatStartMarker:e=>We(ze,e),parseRepeatEndMarker:e=>We(Fe,e),parseElementBoundaryStartMarker:e=>Qe(De,e.trim()),parseElementBoundaryEndMarker:e=>Qe(Pe,e)});function We(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Qe(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 Ke=Symbol.for("fe-hydration");function Xe(e){return e[Ke]===Ke}const Ge="defer-hydration";class Ye extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ze(e){return e.nodeType===Node.COMMENT_NODE}function et(e){return e.nodeType===Node.TEXT_NODE}function tt(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ze(t)||et(t)?t.data.length:t.childNodes.length),s}function st(e,t,s,n){var i,r;const o=null!==(r=null!==(i=Ue.parseAttributeBinding(e))&&void 0!==i?i:Ue.parseEnumeratedAttributeBinding(e))&&void 0!==r?r:Ue.parseCompactAttributeBinding(e);if(null!==o){for(const i of o){const r=t[i+n];if(!r)throw new Ye(`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);it(r,e,s)}e.removeAttribute(Ue.attributeMarkerName)}}function nt(e,t,s,n,i,r){if(Ue.isElementBoundaryStartMarker(e))!function(e,t){const s=Ue.parseElementBoundaryStartMarker(e.data);let n=t.nextSibling();for(;null!==n;){if(Ze(n)){const e=Ue.parseElementBoundaryEndMarker(n.data);if(e&&e===s)break}n=t.nextSibling()}}(e,t);else if(Ue.isContentBindingStartMarker(e.data)){const o=Ue.parseContentBindingStartMarker(e.data);if(null===o)return;const[a,l]=o,c=s[a+r],d=[];let h=t.nextSibling();e.data="";const u=h;for(;null!==h;){if(Ze(h)){const e=Ue.parseContentBindingEndMarker(h.data);if(e&&e[1]===l)break}d.push(h),h=t.nextSibling()}if(null===h){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(h.data="",1===d.length&&et(d[0]))it(c,d[0],n);else{h!==u&&null!==h.previousSibling&&(i[c.targetNodeId]={first:u,last:h.previousSibling});it(c,h.parentNode.insertBefore(document.createTextNode(""),h),n)}}}function it(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var rt;function ot(e,t){const s=e.parentNode;let n,i=e;for(;i!==t;){if(n=i.nextSibling,!n)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(i),i=n}s.removeChild(t)}class at{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 lt extends at{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=E.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 n,i=this.firstChild;for(;i!==t;)n=i.nextSibling,s.insertBefore(i,e),i=n;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,n=this.firstChild;for(;n!==t;)s=n.nextSibling,e.appendChild(n),n=s;e.appendChild(t)}dispose(){ot(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 n=this.factories;for(let e=0,t=n.length;e<t;++e){const t=n[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){ot(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}u(lt),M.defineProperty(lt.prototype,"index"),M.defineProperty(lt.prototype,"length");const ct="unhydrated",dt="hydrating",ht="hydrated";class ut extends Error{constructor(e,t,s,n){super(e),this.factory=t,this.fragment=s,this.templateString=n}}rt=Ke,u(class extends at{get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}constructor(e,t,s,n){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=n,this[rt]=Ke,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=E.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=ct,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}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 n,i=this.firstChild;for(;i!==t;)n=i.nextSibling,s.insertBefore(i,e),i=n;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,n=this.firstChild;for(;n!==t;){if(s=n.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(n),n=s}e.appendChild(t)}bind(e,t=this){var s;if(this.hydrationStage!==ht&&(this._hydrationStage=dt),this.source===e)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const n=tt(e,t),i=n.commonAncestorContainer,r=function(e){let t=0;for(let s=0,n=e.length;s<n&&"h"===e[s].targetNodeId;++s)t++;return t}(s),o=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===n.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),a={},l={};let c=o.currentNode=e;for(;null!==c;){switch(c.nodeType){case Node.ELEMENT_NODE:st(c,s,a,r);break;case Node.COMMENT_NODE:nt(c,o,s,a,l,r)}c=o.nextNode()}return n.detach(),{targets:a,boundaries:l}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof Ye){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=n=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&it(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const n=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host,i=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==n?void 0:n.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}"`),i.sourceAspect&&r.push(` - Source aspect: "${i.sourceAspect}"`),void 0!==i.aspectType&&r.push(` - Aspect type: ${i.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 ut(r.join("\n"),t,tt(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),n[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=n.length;e<t;++e)n[e].bind(this)}this.isBound=!0,this._hydrationStage=ht}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){ot(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 ft={[f.attribute]:m.setAttribute,[f.booleanAttribute]:m.setBooleanAttribute,[f.property]:(e,t,s)=>e[t]=s,[f.content]:function(e,t,s,n){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Xe(n)&&Xe(s)&&void 0!==n.bindingViewBoundaries[this.targetNodeId]&&n.hydrationStage!==ht){const e=n.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(n.source,n.context)):(t.isComposed=!0,t.bind(n.source,n.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}},[f.tokenList]:function(e,t,s){var n;const i=`${this.id}-t`,r=null!==(n=e[i])&&void 0!==n?n:e[i]={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)}},[f.event]:()=>{}};class pt{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=f.content}createHTML(e){return $e.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=ft[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw l.error(n.unsupportedBindingBehavior);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],n=Xe(e)&&e.hydrationStage&&e.hydrationStage!==ht;switch(this.aspectType){case f.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case f.content:e.onUnbind(this);default:{const i=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(i.target=s,i.controller=e,n&&(this.aspectType===f.attribute||this.aspectType===f.booleanAttribute)){i.bind(e);break}this.updateTarget(s,this.targetAspect,i.bind(e),e);break}}}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.controller;if(!s.isBound)return;const n=t.target;this.updateTarget(n,this.targetAspect,t.bind(s),s)}}Ae.define(pt,{aspected:!0});const gt=(e,t)=>`${e}.${t}`,bt={},vt={index:0,node:null};function mt(e){e.startsWith("fast-")||l.warn(n.hostBindingWithoutHost,{name:e})}const yt=new Proxy(document.createElement("div"),{get(e,t){mt(t);const s=Reflect.get(e,t);return i(s)?s.bind(e):s},set:(e,t,s)=>(mt(t),Reflect.set(e,t,s))});class wt{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,n,i){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,n)),e.id=null!==(r=e.id)&&void 0!==r?r:Be(),e.targetNodeId=s,e.targetTagName=i,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 n=this.descriptors;if("r"===t||"h"===t||n[t])return;if(!n[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),n=parseInt(e.substring(t+1),10);this.addTargetDescriptor(s,e,n)}let i=bt[t];if(!i){const n=`_${t}`;bt[t]=i={get(){var t;return null!==(t=this[n])&&void 0!==t?t:this[n]=this[e].childNodes[s]}}}n[t]=i}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:yt;for(const e of this.nodeIds)Reflect.get(s,e);return new lt(t,this.factories,s)}}function Ct(e,t,s,n,i,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=Ne.parse(h,a);let f=null;null===u?r&&(f=new pt(re(()=>h,e.policy)),Ae.assignAspect(f,d.name)):f=Ot.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,n,i,s.tagName))}}function St(e,t,s){let n=0,i=t.firstChild;for(;i;){const t=Tt(e,s,i,n);i=t.node,n=t.index}}function Tt(e,t,s,n){const i=gt(t,n);switch(s.nodeType){case 1:Ct(e,t,s,i,n),St(e,s,i);break;case 3:return function(e,t,s,n,i){const o=Ne.parse(t.textContent,e.directives);if(null===o)return vt.node=t.nextSibling,vt.index=i+1,vt;let a,l=a=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(i++,n=gt(s,i),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),r(c)?a.textContent=c:(a.textContent=" ",Ae.assignAspect(c),e.addFactory(c,s,n,i,null)),l=a}return vt.index=i+1,vt.node=l.nextSibling,vt}(e,s,t,i,n);case 8:{const r=Ne.parse(s.data,e.directives);null!==r&&e.addFactory(Ot.aggregate(r),t,i,n,null);break}}return vt.index=n+1,vt.node=s.nextSibling,vt}const xt="TEMPLATE",Ot={compile(e,t,s=m.policy){let n;if(r(e)){n=document.createElement(xt),n.innerHTML=s.createHTML(e);const t=n.content.firstElementChild;null!==t&&t.tagName===xt&&(n=t)}else n=e;n.content.firstChild||n.content.lastChild||n.content.appendChild(document.createComment(""));const i=document.adoptNode(n.content),o=new wt(i,t,s);var a,l;return Ct(o,"",n,"h",0,!0),a=i.firstChild,l=t,(a&&8===a.nodeType&&null!==Ne.parse(a.data,l)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),St(o,i,"r"),vt.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=m.policy){if(1===e.length)return e[0];let s,n,i=!1;const o=e.length,a=e.map(e=>r(e)?()=>e:(s=e.sourceAspect||s,i=i||e.dataBinding.isVolatile,n=n||e.dataBinding.policy,e.dataBinding.evaluate)),l=new pt(se((e,t)=>{let s="";for(let n=0;n<o;++n)s+=a[n](e,t);return s},null!=n?n:t,i));return Ae.assignAspect(l,s),l}};class Bt extends Me{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}Ae.define(Bt);const $t=e=>new Bt(e);function Nt(e,t,s,n){return new(s||(s=Promise))(function(i,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const kt="boolean",At="reflect",Et=Object.freeze({locate:h()}),Mt={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},It={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Mt.fromView(e)};function Rt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const jt={toView(e){const t=Rt(e);return t?t.toString():t},fromView:Rt};class Vt{constructor(e,t,s=t.toLowerCase(),n=At,i){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=n,this.converter=i,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,n===kt&&void 0===i&&(this.converter=Mt)}setValue(e,t){const s=e[this.fieldName],n=this.converter;void 0!==n&&(t=n.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return M.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||A.enqueue(()=>{s.add(e);const n=e[this.fieldName];switch(t){case At:const t=this.converter;m.setAttribute(e,this.attribute,void 0!==t?t.toView(n):n);break;case kt:m.setBooleanAttribute(e,this.attribute,n)}s.delete(e)})}static collect(e,...t){const s=[];t.push(Et.locate(e));for(let n=0,i=t.length;n<i;++n){const i=t[n];if(void 0!==i)for(let t=0,n=i.length;t<n;++t){const n=i[t];r(n)?s.push(new Vt(e,n)):s.push(new Vt(e,n.property,n.attribute,n.mode,n.converter))}}return s}}function _t(e,t){let s;function n(e,t){arguments.length>1&&(s.property=t),Et.locate(e.constructor).push(s)}return arguments.length>1?(s={},void n(e,t)):(s=void 0===e?{}:e,n)}var Lt;const Ht={mode:"open"},zt={},Ft=new Set,Dt=l.getById(s.elementRegistry,()=>d()),Pt={deferAndHydrate:"defer-and-hydrate"};class qt{get isDefined(){return this.platformDefined}constructor(e,t=e.definition){var s;this.platformDefined=!1,r(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 n=e.prototype,i=Vt.collect(e,t.attributes),o=new Array(i.length),a={},l={};for(let e=0,t=i.length;e<t;++e){const t=i[e];o[e]=t.attribute,a[t.name]=t,l[t.attribute]=t,M.defineProperty(n,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=i,this.propertyLookup=a,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?Ht:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Ht),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?zt:Object.assign(Object.assign({},zt),t.elementOptions),this.styles=pe.normalize(t.styles),Dt.register(this),M.defineProperty(Lt.isRegistered,this.name),Lt.isRegistered[this.name]=this.type}define(e=this.registry){var t,s;const n=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,n,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 Ft.has(e)||Dt.getByType(e)?new Lt(class extends e{},t):new Lt(e,t)}static registerBaseType(e){Ft.add(e)}static composeAsync(e,t){return new Promise(s=>{(Ft.has(e)||Dt.getByType(e))&&s(new Lt(class extends e{},t));const n=new Lt(e,t);M.getNotifier(n).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=n.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,n.name),s(n)}},"template")})}}Lt=qt,qt.isRegistered={},qt.getByType=Dt.getByType,qt.getForInstance=Dt.getForInstance,qt.registerAsync=e=>Nt(void 0,void 0,void 0,function*(){return new Promise(t=>{Lt.isRegistered[e]&&t(Lt.isRegistered[e]),M.getNotifier(Lt.isRegistered).subscribe({handleChange:()=>t(Lt.isRegistered[e])},e)})}),M.defineProperty(qt.prototype,"template");const Ut=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Wt=Object.create(null);class Qt{constructor(e,t=Wt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Jt(e,t,s,n=Ae.getForInstance(e)){if(n.aspected){const s=Ut.exec(t);null!==s&&Ae.assignAspect(e,s[2])}return e.createHTML(s)}Qt.empty=new Qt(""),Ae.define(Qt);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=Ot.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new Qt(r(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw l.error(n.cannotSetTemplatePolicyAfterCompilation);if(this.policy)throw l.error(n.onlySetTemplatePolicyOnce);return this.policy=e,this}render(e,t,s){const n=this.create(s);return n.bind(e),n.appendTo(t),n}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=Be();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 pt(se(l));else if(l instanceof ee)l=new pt(l);else if(!(a=Ae.getForInstance(l))){const e=l;l=new pt(re(()=>e))}n+=Jt(l,r,o,a)}return new Kt(n+e[e.length-1],r,s)}}u(Kt);const Xt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Kt.create(e,t);throw l.error(n.directCallToHTMLTagNotAllowed)};Xt.partial=e=>new Qt(e);class Gt{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),Xe(this.template)&&Xe(e)&&e.hydrationStage!==ht&&!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){this.controller.isBound&&(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 Yt{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return $e.comment(e(this))}createBehavior(){return new Gt(this)}}Ae.define(Yt);const Zt=new Map,es=Xt`
2
2
  &nbsp;
3
- `;function ts(e){return void 0===e?es:e.template}function ss(e,t){if(e)return function(e,t){const s=Yt.get(e);if(void 0!==s)return s[null!=t?t:Zt]}(e.constructor,t)}class is{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 ns(e,t){let s,i;s=void 0===e?ne((e=>e)):re(e);let o=!1;if(void 0===t)o=!0,i=ne(((e,t)=>{var i;const n=s.evaluate(e,t);return n instanceof Node?null!==(i=n.$fastTemplate)&&void 0!==i?i:new is(n):ts(ss(n))}));else if(n(t))i=te(((e,i)=>{var n;let o=t(e,i);return r(o)?o=ts(ss(s.evaluate(e,i),o)):o instanceof Node&&(o=null!==(n=o.$fastTemplate)&&void 0!==n?n:new is(o)),o}),void 0,!0);else if(r(t))o=!0,i=ne(((e,i)=>{var n;const r=s.evaluate(e,i);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new is(r):ts(ss(r,t))}));else if(t instanceof Z){const e=t.evaluate;t.evaluate=(t,i)=>{var n;let o=e(t,i);return r(o)?o=ts(ss(s.evaluate(t,i),o)):o instanceof Node&&(o=null!==(n=o.$fastTemplate)&&void 0!==n?n:new is(o)),o},i=t}else i=ne(((e,s)=>t));return new Gt(s,i,o)}const rs=Object.freeze({positioning:!1,recycle:!0});function os(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function as(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 ls(e){return e.nodeType===Node.COMMENT_NODE}class cs extends Error{constructor(e,t){super(e),this.propertyBag=t}}class ds{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=os,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=as)}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),Ke(this.template)&&Ke(e)&&e.hydrationStage!==dt?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=c);const t=this.itemsObserver,s=this.itemsObserver=M.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||(at.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 cs(`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 cs(`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(!ls(t)){t=t.previousSibling;continue}const s=qe.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(ls(n))if(qe.isRepeatViewEndMarker(n.data))r++;else if(qe.isRepeatViewStartMarker(n.data)){if(!r){if(qe.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 hs{createHTML(e){return Be.comment(e(this))}constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,X.enable()}createBehavior(){return new ds(this)}}function us(e,t,s=rs){const i=re(e),n=re(t);return new hs(i,n,Object.assign(Object.assign({},rs),s))}ke.define(hs);const fs="slotchange";class ps extends Re{observe(e){e.addEventListener(fs,this)}disconnect(e){e.removeEventListener(fs,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function gs(e){return r(e)&&(e={property:e}),new ps(e)}ke.define(ps);const bs=()=>null;function vs(e){return void 0===e?bs:n(e)?e:()=>e}function ms(e,t,s){const i=n(e)?e:()=>e,r=vs(t),o=vs(s);return(e,t)=>i(e,t)?r(e,t):o(e,t)}class ys 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()}}const ws={bubbles:!0,composed:!0,cancelable:!0},Cs="isConnected",Ss=new WeakMap;function Ts(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Ss.get(e))&&void 0!==s?s:null}let xs;var Os;!function(e){e[e.connecting=0]="connecting",e[e.connected=1]="connected",e[e.disconnecting=2]="disconnecting",e[e.disconnected=3]="disconnected"}(Os||(Os={}));class Bs extends k{get isConnected(){return M.track(this,Cs),this.stage===Os.connected}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&&Ss.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))}constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=Os.disconnected,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=M.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)}}}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||this.stage!==Os.connected&&this.stage!==Os.connecting||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&&this.stage!==Os.disconnected&&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=Ts(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=Ts(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(){this.stage===Os.disconnected&&(this.stage=Os.connecting,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=Os.connected,M.notify(this,Cs))}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(){this.stage===Os.connected&&(this.stage=Os.disconnecting,M.notify(this,Cs),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=Os.disconnected)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return this.stage===Os.connected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},ws),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=Ts(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=E.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const n=Pt.getForInstance(e);if(void 0===n)throw l.error(i.missingElementDefinition);return M.getNotifier(n).subscribe({handleChange:()=>{Bs.forCustomElement(e,!0),e.$fastController.connect()}},"template"),M.getNotifier(n).subscribe({handleChange:()=>{Bs.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new xs(e,n)}static setStrategy(e){xs=e}}function $s(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Ts(e))&&void 0!==t?t:e.getRootNode()}u(Bs),Bs.setStrategy(Bs);class Ns{constructor(e){const t=Ns.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){Ms($s(e),this.sheets)}removeStylesFrom(e){Is($s(e),this.sheets)}}Ns.styleSheetCache=new Map;let ks=0;function As(e){return e===document?document.body:e}class Es{constructor(e){this.styles=e,this.styleClass="fast-"+ ++ks}addStylesTo(e){e=As($s(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=As($s(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let Ms=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Is=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(fe.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Ms=(e,t)=>{e.adoptedStyleSheets.push(...t)},Is=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}fe.setDefaultStrategy(Ns)}else fe.setDefaultStrategy(Es);const Rs="needs-hydration";class js extends Bs{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,(this.hasExistingShadowRoot||void 0!==e&&!this.template)&&this.definition.templateOptions===Dt.deferAndHydrate&&(this.source.toggleAttribute(Xe,!0),this.source.toggleAttribute(Rs,!0))}addHydratingInstance(){if(!js.hydratingInstances)return;const e=this.definition.name;let t=js.hydratingInstances.get(e);t||(t=new Set,js.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return js.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(Xe)||(js.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,s,i;if(e.didTimeout)js.idleCallbackId=requestIdleCallback(js.checkHydrationComplete,{timeout:50});else if(0===(null===(t=js.hydratingInstances)||void 0===t?void 0:t.size)){try{null===(i=(s=js.lifecycleCallbacks).hydrationComplete)||void 0===i||i.call(s)}catch(e){}Bs.setStrategy(Bs)}}connect(){var e,t,s,i,n,r,o;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(Rs),this.needsHydration&&this.addHydratingInstance(),this.source.hasAttribute(Xe))return this.addHydratingInstance(),void js.hydrationObserver.observe(this.source,{attributeFilter:[Xe]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(this.stage===Os.disconnected){if(!js.hydrationStarted){js.hydrationStarted=!0;try{null===(s=(t=js.lifecycleCallbacks).hydrationStarted)||void 0===s||s.call(t)}catch(e){}}try{null===(n=(i=js.lifecycleCallbacks).elementWillHydrate)||void 0===n||n.call(i,this.source)}catch(e){}if(this.stage=Os.connecting,this.bindObservables(),this.connectBehaviors(),this.template)if(Ke(this.template)){const e=this.source,t=null!==(r=Ts(e))&&void 0!==r?r:e;let s=t.firstChild,i=t.lastChild;null===e.shadowRoot&&(qe.isElementBoundaryStartMarker(s)&&(s.data="",s=s.nextSibling),qe.isElementBoundaryEndMarker(i)&&(i.data="",i=i.previousSibling)),this.view=this.template.hydrate(s,i,e),null===(o=this.view)||void 0===o||o.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=Os.connected,this.source.removeAttribute(Rs),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),M.notify(this,Cs)}}removeHydratingInstance(){var e,t;if(!js.hydratingInstances)return;try{null===(t=(e=js.lifecycleCallbacks).elementDidHydrate)||void 0===t||t.call(e,this.source)}catch(e){}const s=this.definition.name,i=js.hydratingInstances.get(s);i&&(i.delete(this.source),i.size||js.hydratingInstances.delete(s),js.idleCallbackId&&cancelIdleCallback(js.idleCallbackId),js.idleCallbackId=requestIdleCallback(js.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),js.hydrationObserver.unobserve(this.source)}static install(){Bs.setStrategy(js)}}function Vs(e){const t=class extends e{constructor(){super(),Bs.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 Pt.registerBaseType(t),t}function _s(e,t){return n(e)?Pt.compose(e,t).define().type:Pt.compose(this,e).define().type}js.hydrationObserver=new ys(js.hydrationObserverHandler),js.lifecycleCallbacks={},js.hydrationStarted=!1,js.idleCallbackId=null,js.hydratingInstances=new Map;const Ls=Object.assign(Vs(HTMLElement),{from:function(e){return Vs(e)},define:_s,compose:function(e,t){return n(e)?Pt.compose(e,t):Pt.compose(this,e)},defineAsync:function(e,t){return n(e)?new Promise((s=>{Pt.composeAsync(e,t).then((e=>{s(e)}))})).then((e=>e.define().type)):new Promise((t=>{Pt.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});function Hs(e){return function(t){_s(t,e)}}m.setPolicy($.create());export{X as ArrayObserver,At as AttributeConfiguration,jt as AttributeDefinition,Z as Binding,de as CSSBindingDirective,ae as CSSDirective,je as ChildrenDirective,xt as Compiler,m as DOM,f as DOMAspect,Bs as ElementController,fe as ElementStyles,V as ExecutionContext,l as FAST,Ls as FASTElement,Pt as FASTElementDefinition,ft as HTMLBindingDirective,ke as HTMLDirective,at as HTMLView,js as HydratableElementController,ht as HydrationBindingError,Wt as InlineTemplateDirective,Be as Markup,Re as NodeObservationDirective,M as Observable,$e as Parser,k as PropertyChangeNotifier,Ot as RefDirective,Xt as RenderBehavior,Gt as RenderDirective,ds as RepeatBehavior,hs as RepeatDirective,ps as SlottedDirective,L as Sort,E as SourceLifetime,_ as Splice,W as SpliceStrategy,H as SpliceStrategySupport,Os as Stages,Ee as StatelessAttachedAttributeDirective,N as SubscriberSet,Dt as TemplateOptions,A as Updates,Jt as ViewTemplate,Vt as attr,Et as booleanConverter,Ve as children,me as css,le as cssDirective,Hs as customElement,Xe as deferHydrationAttribute,Ie as elements,c as emptyArray,Ft as fastElementRegistry,Kt as html,Ae as htmlDirective,Ke as isHydratable,G as lengthOf,se as listener,Rs as needsHydrationAttribute,re as normalizeBinding,Mt as nullableBooleanConverter,Rt as nullableNumberConverter,I as observable,ne as oneTime,te as oneWay,Bt as ref,ns as render,us as repeat,gs as slotted,Y as sortedCount,R as volatile,ms as when};
3
+ `;function ts(e){return void 0===e?es:e.template}function ss(e,t){if(e)return function(e,t){const s=Zt.get(e);if(void 0!==s)return s[null!=t?t:"default-view"]}(e.constructor,t)}class ns{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 is(e,t){let s,n;s=void 0===e?re(e=>e):oe(e);let o=!1;if(void 0===t)o=!0,n=re((e,t)=>{var n;const i=s.evaluate(e,t);return i instanceof Node?null!==(n=i.$fastTemplate)&&void 0!==n?n:new ns(i):ts(ss(i))});else if(i(t))n=se((e,n)=>{var i;let o=t(e,n);return r(o)?o=ts(ss(s.evaluate(e,n),o)):o instanceof Node&&(o=null!==(i=o.$fastTemplate)&&void 0!==i?i:new ns(o)),o},void 0,!0);else if(r(t))o=!0,n=re((e,n)=>{var i;const r=s.evaluate(e,n);return r instanceof Node?null!==(i=r.$fastTemplate)&&void 0!==i?i:new ns(r):ts(ss(r,t))});else if(t instanceof ee){const e=t.evaluate;t.evaluate=(t,n)=>{var i;let o=e(t,n);return r(o)?o=ts(ss(s.evaluate(t,n),o)):o instanceof Node&&(o=null!==(i=o.$fastTemplate)&&void 0!==i?i:new ns(o)),o},n=t}else n=re((e,s)=>t);return new Yt(s,n,o)}const rs=Object.freeze({positioning:!1,recycle:!0});function os(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.bind(t[s])}function as(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function ls(e){return e.nodeType===Node.COMMENT_NODE}class cs extends Error{constructor(e,t){super(e),this.propertyBag=t}}class ds{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=os,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=as)}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),Xe(this.template)&&Xe(e)&&e.hydrationStage!==ht?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=c);const t=this.itemsObserver,s=this.itemsObserver=M.getNotifier(this.items),n=t!==s;n&&null!==t&&t.unsubscribe(this),(n||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,n=e.length;s<n;++s){const n=e[s].sorted.slice(),i=n.slice().sort();for(let e=0,s=n.length;e<s;++e){const s=n.find(t=>n[e]===i[t]);if(s!==e){const n=i.splice(s,1);i.splice(e,0,...n);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,n=this.items,i=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=i.create(),t.splice(p,0,h),s(h,n,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 n=t[e].context;n.length=s,n.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,n=this.location,i=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(lt.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();i(o,t,e,r),a[e]=o,o.insertBefore(n)}}else{let e=0;for(;e<o;++e)if(e<l){const n=a[e];if(!n){const t=new XMLSerializer;throw new cs(`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())})}i(n,t,e,r)}else{const o=s.create();i(o,t,e,r),a.push(o),o.insertBefore(n)}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 cs(`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(!ls(t)){t=t.previousSibling;continue}const s=Ue.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const n=t.previousSibling;if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let i=n,r=0;for(;null!==i;){if(ls(i))if(Ue.isRepeatViewEndMarker(i.data))r++;else if(Ue.isRepeatViewStartMarker(i.data)){if(!r){if(Ue.parseRepeatStartMarker(i.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);i.data="",t=i.previousSibling,i=i.nextSibling;const r=e.hydrate(i,n);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}i=i.previousSibling}if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class hs{createHTML(e){return $e.comment(e(this))}constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,G.enable()}createBehavior(){return new ds(this)}}function us(e,t,s=rs){const n=oe(e),i=oe(t);return new hs(n,i,Object.assign(Object.assign({},rs),s))}Ae.define(hs);const fs="slotchange";class ps extends je{observe(e){e.addEventListener(fs,this)}disconnect(e){e.removeEventListener(fs,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function gs(e){return r(e)&&(e={property:e}),new ps(e)}Ae.define(ps);const bs=()=>null;function vs(e){return void 0===e?bs:i(e)?e:()=>e}function ms(e,t,s){const n=i(e)?e:()=>e,r=vs(t),o=vs(s);return(e,t)=>n(e,t)?r(e,t):o(e,t)}class ys 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()}}const ws={bubbles:!0,composed:!0,cancelable:!0},Cs="isConnected",Ss=new WeakMap;function Ts(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Ss.get(e))&&void 0!==s?s:null}let xs;var Os;!function(e){e[e.connecting=0]="connecting",e[e.connected=1]="connected",e[e.disconnecting=2]="disconnecting",e[e.disconnected=3]="disconnected"}(Os||(Os={}));class Bs extends k{get isConnected(){return M.track(this,Cs),this.stage===Os.connected}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&&Ss.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))}constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=Os.disconnected,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=M.getAccessors(e);if(s.length>0){const t=this.boundObservables=Object.create(null);for(let n=0,i=s.length;n<i;++n){const i=s[n].name,r=e[i];void 0!==r&&(delete e[i],t[i]=r)}}}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,s;const n=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,i=null!==(s=n.get(e))&&void 0!==s?s:0;0===i?(n.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||this.stage!==Os.connected&&this.stage!==Os.connecting||e.connectedCallback(this)):n.set(e,i+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const n=s.get(e);void 0!==n&&(1===n||t?(s.delete(e),e.disconnectedCallback&&this.stage!==Os.disconnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,n-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=Ts(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=Ts(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(){this.stage===Os.disconnected&&(this.stage=Os.connecting,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=Os.connected,M.notify(this,Cs))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let n=0,i=s.length;n<i;++n){const i=s[n];e[i]=t[i]}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(){this.stage===Os.connected&&(this.stage=Os.disconnecting,M.notify(this,Cs),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=Os.disconnected)}onAttributeChangedCallback(e,t,s){const n=this.definition.attributeLookup[e];void 0!==n&&n.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return this.stage===Os.connected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},ws),s)))}renderTemplate(e){var t;const s=this.source,n=null!==(t=Ts(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=n.firstChild;null!==e;e=n.firstChild)n.removeChild(e)}e&&(this.view=e.render(s,n,s),this.view.sourceLifetime=E.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const i=qt.getForInstance(e);if(void 0===i)throw l.error(n.missingElementDefinition);return M.getNotifier(i).subscribe({handleChange:()=>{Bs.forCustomElement(e,!0),e.$fastController.connect()}},"template"),M.getNotifier(i).subscribe({handleChange:()=>{Bs.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new xs(e,i)}static setStrategy(e){xs=e}}function $s(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Ts(e))&&void 0!==t?t:e.getRootNode()}u(Bs),Bs.setStrategy(Bs);class Ns{constructor(e){const t=Ns.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){Ms($s(e),this.sheets)}removeStylesFrom(e){Is($s(e),this.sheets)}}Ns.styleSheetCache=new Map;let ks=0;function As(e){return e===document?document.body:e}class Es{constructor(e){this.styles=e,this.styleClass="fast-"+ ++ks}addStylesTo(e){e=As($s(e));const t=this.styles,s=this.styleClass;for(let n=0;n<t.length;n++){const i=document.createElement("style");i.innerHTML=t[n],i.className=s,e.append(i)}}removeStylesFrom(e){const t=(e=As($s(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,n=t.length;s<n;++s)e.removeChild(t[s])}}let Ms=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Is=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>-1===t.indexOf(e))};if(pe.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Ms=(e,t)=>{e.adoptedStyleSheets.push(...t)},Is=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}pe.setDefaultStrategy(Ns)}else pe.setDefaultStrategy(Es);const Rs="needs-hydration";class js extends Bs{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,(this.hasExistingShadowRoot||void 0!==e&&!this.template)&&this.definition.templateOptions===Pt.deferAndHydrate&&(this.source.toggleAttribute(Ge,!0),this.source.toggleAttribute(Rs,!0))}addHydratingInstance(){if(!js.hydratingInstances)return;const e=this.definition.name;let t=js.hydratingInstances.get(e);t||(t=new Set,js.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return js.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(Ge)||(js.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,s,n;if(e.didTimeout)js.idleCallbackId=requestIdleCallback(js.checkHydrationComplete,{timeout:50});else if(0===(null===(t=js.hydratingInstances)||void 0===t?void 0:t.size)){try{null===(n=(s=js.lifecycleCallbacks).hydrationComplete)||void 0===n||n.call(s)}catch(e){}Bs.setStrategy(Bs)}}connect(){var e,t,s,n,i,r,o;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(Rs),this.needsHydration&&this.addHydratingInstance(),this.source.hasAttribute(Ge))return this.addHydratingInstance(),void js.hydrationObserver.observe(this.source,{attributeFilter:[Ge]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(this.stage===Os.disconnected){if(!js.hydrationStarted){js.hydrationStarted=!0;try{null===(s=(t=js.lifecycleCallbacks).hydrationStarted)||void 0===s||s.call(t)}catch(e){}}try{null===(i=(n=js.lifecycleCallbacks).elementWillHydrate)||void 0===i||i.call(n,this.source)}catch(e){}if(this.stage=Os.connecting,this.bindObservables(),this.connectBehaviors(),this.template)if(Xe(this.template)){const e=this.source,t=null!==(r=Ts(e))&&void 0!==r?r:e;let s=t.firstChild,n=t.lastChild;null===e.shadowRoot&&(Ue.isElementBoundaryStartMarker(s)&&(s.data="",s=s.nextSibling),Ue.isElementBoundaryEndMarker(n)&&(n.data="",n=n.previousSibling)),this.view=this.template.hydrate(s,n,e),null===(o=this.view)||void 0===o||o.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=Os.connected,this.source.removeAttribute(Rs),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),M.notify(this,Cs)}}removeHydratingInstance(){var e,t;if(!js.hydratingInstances)return;try{null===(t=(e=js.lifecycleCallbacks).elementDidHydrate)||void 0===t||t.call(e,this.source)}catch(e){}const s=this.definition.name,n=js.hydratingInstances.get(s);n&&(n.delete(this.source),n.size||js.hydratingInstances.delete(s),js.idleCallbackId&&cancelIdleCallback(js.idleCallbackId),js.idleCallbackId=requestIdleCallback(js.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),js.hydrationObserver.unobserve(this.source)}static install(){Bs.setStrategy(js)}}function Vs(e){const t=class extends e{constructor(){super(),Bs.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 qt.registerBaseType(t),t}function _s(e,t){return i(e)?qt.compose(e,t).define().type:qt.compose(this,e).define().type}js.hydrationObserver=new ys(js.hydrationObserverHandler),js.lifecycleCallbacks={},js.hydrationStarted=!1,js.idleCallbackId=null,js.hydratingInstances=new Map;const Ls=Object.assign(Vs(HTMLElement),{from:function(e){return Vs(e)},define:_s,compose:function(e,t){return i(e)?qt.compose(e,t):qt.compose(this,e)},defineAsync:function(e,t){return i(e)?new Promise(s=>{qt.composeAsync(e,t).then(e=>{s(e)})}).then(e=>e.define().type):new Promise(t=>{qt.composeAsync(this,e).then(e=>{t(e)})}).then(e=>e.define().type)}});function Hs(e){return function(t){_s(t,e)}}m.setPolicy($.create());export{G as ArrayObserver,Et as AttributeConfiguration,Vt as AttributeDefinition,ee as Binding,he as CSSBindingDirective,le as CSSDirective,Ve as ChildrenDirective,Ot as Compiler,m as DOM,f as DOMAspect,Bs as ElementController,pe as ElementStyles,V as ExecutionContext,l as FAST,Ls as FASTElement,qt as FASTElementDefinition,pt as HTMLBindingDirective,Ae as HTMLDirective,lt as HTMLView,js as HydratableElementController,ut as HydrationBindingError,Qt as InlineTemplateDirective,$e as Markup,je as NodeObservationDirective,M as Observable,Ne as Parser,k as PropertyChangeNotifier,Bt as RefDirective,Gt as RenderBehavior,Yt as RenderDirective,ds as RepeatBehavior,hs as RepeatDirective,ps as SlottedDirective,L as Sort,E as SourceLifetime,_ as Splice,Q as SpliceStrategy,H as SpliceStrategySupport,Os as Stages,Me as StatelessAttachedAttributeDirective,N as SubscriberSet,Pt as TemplateOptions,A as Updates,Kt as ViewTemplate,_t as attr,Mt as booleanConverter,_e as children,ye as css,ce as cssDirective,Hs as customElement,Ge as deferHydrationAttribute,Re as elements,c as emptyArray,Dt as fastElementRegistry,Xt as html,Ee as htmlDirective,Xe as isHydratable,Y as lengthOf,ne as listener,Rs as needsHydrationAttribute,oe as normalizeBinding,It as nullableBooleanConverter,jt as nullableNumberConverter,I as observable,re as oneTime,se as oneWay,$t as ref,is as render,us as repeat,gs as slotted,Z as sortedCount,R as volatile,ms as when};
@@ -1710,6 +1710,12 @@ export declare class HTMLBindingDirective implements HTMLDirective, ViewBehavior
1710
1710
  * Re-evaluates the binding expression via observer.bind() and pushes
1711
1711
  * the new value to the DOM through the updateTarget sink function.
1712
1712
  * This is the reactive update path that keeps the DOM in sync with data.
1713
+ *
1714
+ * Guards against stale notifications: when a view is unbound (e.g., after
1715
+ * a parent `when` directive tears down a child element), coupled-lifetime
1716
+ * observers may still hold active subscriptions. If a property change fires
1717
+ * on the source element while the view is inactive, this guard prevents
1718
+ * the binding expression from evaluating with a null source.
1713
1719
  * @internal
1714
1720
  */
1715
1721
  handleChange(binding: Expression, observer: ExpressionObserver): void;
@@ -2664,7 +2670,13 @@ export declare class RenderBehavior<TSource = any> implements ViewBehavior, Subs
2664
2670
  * @param controller - The view controller that manages the lifecycle of this behavior.
2665
2671
  */
2666
2672
  unbind(controller: ViewController): void;
2667
- /** @internal */
2673
+ /**
2674
+ * Handles changes from data or template binding observers.
2675
+ * Guards against stale notifications that may arrive after the
2676
+ * controller's view has been unbound (e.g., when a parent `when`
2677
+ * directive tears down and later recreates a child element).
2678
+ * @internal
2679
+ */
2668
2680
  handleChange(source: any, observer: ExpressionObserver): void;
2669
2681
  private bindView;
2670
2682
  private refreshView;
@@ -797,7 +797,7 @@ export function render<TSource = any, TItem = any, TParent = any>(value?: Expres
797
797
  export class RenderBehavior<TSource = any> implements ViewBehavior, Subscriber {
798
798
  constructor(directive: RenderDirective);
799
799
  bind(controller: ViewController): void;
800
- // @internal (undocumented)
800
+ // @internal
801
801
  handleChange(source: any, observer: ExpressionObserver): void;
802
802
  unbind(controller: ViewController): void;
803
803
  }
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.10.3",
4
+ "version": "2.10.4",
5
5
  "author": {
6
6
  "name": "Microsoft",
7
7
  "url": "https://discord.gg/FcSNfg4"
@@ -114,6 +114,7 @@
114
114
  "lint": "biome-changed",
115
115
  "lint:fix": "biome-changed -- --fix",
116
116
  "test:playwright": "playwright test",
117
+ "test:chromium": "playwright test --project=chromium",
117
118
  "test-server": "npx vite test/ --clearScreen false",
118
119
  "test": "npm run lint && npm run doc:ci && npm run doc:exports:ci && npm run test:playwright",
119
120
  "test:ci": "npm run doc:ci && npm run doc:exports:ci && npm run test:playwright"