@lushly-dev/fast-element 3.0.1-preview.0 → 3.0.1-preview.2
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.md +12 -0
- package/dist/command/command.api.json +7857 -0
- package/dist/context/context.api.json +1084 -0
- package/dist/declarative/declarative.api.json +8130 -0
- package/dist/definition-schema/definition-schema.api.json +2689 -0
- package/dist/di/di.api.json +4945 -0
- package/dist/dts/arrays.d.ts +2 -0
- package/dist/dts/binding/binding.d.ts +59 -0
- package/dist/dts/binding/exports.d.ts +9 -0
- package/dist/dts/binding/normalize.d.ts +9 -0
- package/dist/dts/binding/one-time.d.ts +11 -0
- package/dist/dts/binding/one-way.d.ts +20 -0
- package/dist/dts/binding/signal.d.ts +36 -0
- package/dist/dts/binding/two-way.d.ts +44 -0
- package/dist/dts/command/behavior.d.ts +94 -0
- package/dist/dts/command/behaviors/confirm-behavior.d.ts +139 -0
- package/dist/dts/command/behaviors/undo-behavior.d.ts +178 -0
- package/dist/dts/command/command.d.ts +79 -0
- package/dist/dts/command/component-registry.d.ts +50 -0
- package/dist/dts/command/components/confirm-dialog.d.ts +117 -0
- package/dist/dts/command/index.d.ts +21 -0
- package/dist/dts/command/registry.d.ts +201 -0
- package/dist/dts/command/schema-validation.d.ts +45 -0
- package/dist/dts/command/types.d.ts +332 -0
- package/dist/dts/command/validation.d.ts +116 -0
- package/dist/dts/command/weak-ref.d.ts +11 -0
- package/dist/dts/components/attributes.d.ts +153 -0
- package/dist/dts/components/definition-schema-transforms.d.ts +9 -0
- package/dist/dts/components/element-controller.d.ts +349 -0
- package/dist/dts/components/element-hydration.d.ts +2 -0
- package/dist/dts/components/enable-hydration.d.ts +66 -0
- package/dist/dts/components/fast-definitions.d.ts +211 -0
- package/dist/dts/components/fast-element-registry.d.ts +23 -0
- package/dist/dts/components/fast-element.d.ts +91 -0
- package/dist/dts/components/hydration-tracker.d.ts +110 -0
- package/dist/dts/components/hydration.d.ts +52 -0
- package/dist/dts/components/schema.d.ts +205 -0
- package/dist/dts/context.d.ts +171 -0
- package/dist/dts/debug.d.ts +5 -0
- package/dist/dts/declarative/attribute-map.d.ts +58 -0
- package/dist/dts/declarative/debug.d.ts +4 -0
- package/dist/dts/declarative/index.d.ts +14 -0
- package/dist/dts/declarative/interfaces.d.ts +8 -0
- package/dist/dts/declarative/observer-map-utilities.d.ts +58 -0
- package/dist/dts/declarative/observer-map.d.ts +89 -0
- package/dist/dts/declarative/runtime.d.ts +5 -0
- package/dist/dts/declarative/syntax.d.ts +21 -0
- package/dist/dts/declarative/template-bridge.d.ts +33 -0
- package/dist/dts/declarative/template-parser.d.ts +98 -0
- package/dist/dts/declarative/template.d.ts +9 -0
- package/dist/dts/declarative/utilities.d.ts +358 -0
- package/dist/dts/definition-schema/api.d.ts +42 -0
- package/dist/dts/definition-schema/cem.d.ts +78 -0
- package/dist/dts/definition-schema/extension.d.ts +18 -0
- package/dist/dts/definition-schema/extract.d.ts +38 -0
- package/dist/dts/definition-schema/index.d.ts +9 -0
- package/dist/dts/definition-schema/storage.d.ts +35 -0
- package/dist/dts/definition-schema/types.d.ts +176 -0
- package/dist/dts/dev-mode.d.ts +13 -0
- package/dist/dts/di/di.d.ts +894 -0
- package/dist/dts/dom-policy.d.ts +101 -0
- package/dist/dts/dom.d.ts +88 -0
- package/dist/dts/hydration/diagnostics.d.ts +93 -0
- package/dist/dts/hydration/exports.d.ts +18 -0
- package/dist/dts/hydration/hydration-debugger.d.ts +35 -0
- package/dist/dts/hydration/messages.d.ts +62 -0
- package/dist/dts/hydration/runtime.d.ts +7 -0
- package/dist/dts/hydration/target-builder.d.ts +107 -0
- package/dist/dts/index.d.ts +51 -0
- package/dist/dts/index.debug.d.ts +1 -0
- package/dist/dts/index.rollup.d.ts +1 -0
- package/dist/dts/index.rollup.debug.d.ts +1 -0
- package/dist/dts/interfaces.d.ts +106 -0
- package/dist/dts/metadata.d.ts +26 -0
- package/dist/dts/observation/arrays.d.ts +248 -0
- package/dist/dts/observation/notifier.d.ts +127 -0
- package/dist/dts/observation/observable.d.ts +276 -0
- package/dist/dts/observation/update-queue.d.ts +40 -0
- package/dist/dts/observation/volatile.d.ts +9 -0
- package/dist/dts/platform.d.ts +87 -0
- package/dist/dts/registry.d.ts +2 -0
- package/dist/dts/render.d.ts +7 -0
- package/dist/dts/schema.d.ts +1 -0
- package/dist/dts/scoped/detection.d.ts +55 -0
- package/dist/dts/scoped/index.d.ts +68 -0
- package/dist/dts/scoped/mixin.d.ts +118 -0
- package/dist/dts/scoped/registry.d.ts +76 -0
- package/dist/dts/scoped/types.d.ts +48 -0
- package/dist/dts/state/exports.d.ts +3 -0
- package/dist/dts/state/reactive.d.ts +8 -0
- package/dist/dts/state/state.d.ts +141 -0
- package/dist/dts/state/visitor.d.ts +6 -0
- package/dist/dts/state/watch.d.ts +10 -0
- package/dist/dts/styles/css-directive.d.ts +50 -0
- package/dist/dts/styles/css.d.ts +34 -0
- package/dist/dts/styles/element-styles.d.ts +61 -0
- package/dist/dts/styles/host.d.ts +65 -0
- package/dist/dts/styles/style-strategy.d.ts +42 -0
- package/dist/dts/templating/children.d.ts +62 -0
- package/dist/dts/templating/compiler.d.ts +54 -0
- package/dist/dts/templating/html-binding-directive.d.ts +155 -0
- package/dist/dts/templating/html-directive.d.ts +218 -0
- package/dist/dts/templating/html.d.ts +1 -0
- package/dist/dts/templating/hydration-view.d.ts +130 -0
- package/dist/dts/templating/markup.d.ts +48 -0
- package/dist/dts/templating/node-observation.d.ts +99 -0
- package/dist/dts/templating/ref.d.ts +23 -0
- package/dist/dts/templating/render.d.ts +318 -0
- package/dist/dts/templating/repeat.d.ts +131 -0
- package/dist/dts/templating/slotted.d.ts +38 -0
- package/dist/dts/templating/template.d.ts +221 -0
- package/dist/dts/templating/view.d.ts +268 -0
- package/dist/dts/templating/when.d.ts +12 -0
- package/dist/dts/testing/exports.d.ts +3 -0
- package/dist/dts/testing/fakes.d.ts +16 -0
- package/dist/dts/testing/fixture.d.ts +84 -0
- package/dist/dts/testing/models.d.ts +20 -0
- package/dist/dts/testing/timeout.d.ts +7 -0
- package/dist/dts/trust/index.d.ts +8 -0
- package/dist/dts/trust/types.d.ts +48 -0
- package/dist/dts/trust/utils.d.ts +26 -0
- package/dist/dts/tsdoc-metadata.json +11 -0
- package/dist/dts/utilities.d.ts +76 -0
- package/dist/esm/arrays.js +1 -0
- package/dist/esm/binding/binding.js +18 -0
- package/dist/esm/binding/exports.js +6 -0
- package/dist/esm/binding/normalize.js +17 -0
- package/dist/esm/binding/one-time.js +21 -0
- package/dist/esm/binding/one-way.js +30 -0
- package/dist/esm/binding/signal.js +99 -0
- package/dist/esm/binding/two-way.js +109 -0
- package/dist/esm/command/behavior.js +155 -0
- package/dist/esm/command/behaviors/confirm-behavior.js +225 -0
- package/dist/esm/command/behaviors/undo-behavior.js +313 -0
- package/dist/esm/command/command.js +104 -0
- package/dist/esm/command/component-registry.js +107 -0
- package/dist/esm/command/components/confirm-dialog.js +370 -0
- package/dist/esm/command/index.js +22 -0
- package/dist/esm/command/registry.js +755 -0
- package/dist/esm/command/schema-validation.js +194 -0
- package/dist/esm/command/types.js +86 -0
- package/dist/esm/command/validation.js +508 -0
- package/dist/esm/command/weak-ref.js +5 -0
- package/dist/esm/components/attributes.js +219 -0
- package/dist/esm/components/definition-schema-transforms.js +23 -0
- package/dist/esm/components/element-controller.js +840 -0
- package/dist/esm/components/element-hydration.js +2 -0
- package/dist/esm/components/enable-hydration.js +123 -0
- package/dist/esm/components/fast-definitions.js +294 -0
- package/dist/esm/components/fast-element-registry.js +67 -0
- package/dist/esm/components/fast-element.js +82 -0
- package/dist/esm/components/hydration-tracker.js +211 -0
- package/dist/esm/components/hydration.js +187 -0
- package/dist/esm/components/schema.js +253 -0
- package/dist/esm/context.js +185 -0
- package/dist/esm/debug.js +71 -0
- package/dist/esm/declarative/attribute-map.js +122 -0
- package/dist/esm/declarative/debug.js +4 -0
- package/dist/esm/declarative/index.js +10 -0
- package/dist/esm/declarative/interfaces.js +9 -0
- package/dist/esm/declarative/observer-map-utilities.js +565 -0
- package/dist/esm/declarative/observer-map.js +216 -0
- package/dist/esm/declarative/runtime.js +14 -0
- package/dist/esm/declarative/syntax.js +36 -0
- package/dist/esm/declarative/template-bridge.js +160 -0
- package/dist/esm/declarative/template-parser.js +306 -0
- package/dist/esm/declarative/template.js +116 -0
- package/dist/esm/declarative/utilities.js +1069 -0
- package/dist/esm/definition-schema/api.js +129 -0
- package/dist/esm/definition-schema/cem.js +89 -0
- package/dist/esm/definition-schema/extension.js +53 -0
- package/dist/esm/definition-schema/extract.js +167 -0
- package/dist/esm/definition-schema/index.js +8 -0
- package/dist/esm/definition-schema/storage.js +58 -0
- package/dist/esm/definition-schema/types.js +8 -0
- package/dist/esm/dev-mode.js +22 -0
- package/dist/esm/di/di.js +1441 -0
- package/dist/esm/dom-policy.js +374 -0
- package/dist/esm/dom.js +101 -0
- package/dist/esm/hydration/diagnostics.js +50 -0
- package/dist/esm/hydration/exports.js +6 -0
- package/dist/esm/hydration/hydration-debugger.js +112 -0
- package/dist/esm/hydration/messages.js +84 -0
- package/dist/esm/hydration/runtime.js +33 -0
- package/dist/esm/hydration/target-builder.js +264 -0
- package/dist/esm/index.debug.js +3 -0
- package/dist/esm/index.js +49 -0
- package/dist/esm/index.rollup.debug.js +6 -0
- package/dist/esm/index.rollup.js +4 -0
- package/dist/esm/interfaces.js +55 -0
- package/dist/esm/metadata.js +57 -0
- package/dist/esm/observation/arrays.js +661 -0
- package/dist/esm/observation/notifier.js +162 -0
- package/dist/esm/observation/observable.js +324 -0
- package/dist/esm/observation/update-queue.js +56 -0
- package/dist/esm/observation/volatile.js +16 -0
- package/dist/esm/platform.js +98 -0
- package/dist/esm/registry.js +2 -0
- package/dist/esm/render.js +1 -0
- package/dist/esm/schema.js +1 -0
- package/dist/esm/scoped/detection.js +102 -0
- package/dist/esm/scoped/index.js +69 -0
- package/dist/esm/scoped/mixin.js +127 -0
- package/dist/esm/scoped/registry.js +125 -0
- package/dist/esm/scoped/types.js +4 -0
- package/dist/esm/state/exports.js +3 -0
- package/dist/esm/state/reactive.js +34 -0
- package/dist/esm/state/state.js +148 -0
- package/dist/esm/state/visitor.js +28 -0
- package/dist/esm/state/watch.js +36 -0
- package/dist/esm/styles/css-directive.js +36 -0
- package/dist/esm/styles/css.js +56 -0
- package/dist/esm/styles/element-styles.js +144 -0
- package/dist/esm/styles/host.js +1 -0
- package/dist/esm/styles/style-strategy.js +1 -0
- package/dist/esm/templating/children.js +67 -0
- package/dist/esm/templating/compiler.js +359 -0
- package/dist/esm/templating/html-binding-directive.js +288 -0
- package/dist/esm/templating/html-directive.js +113 -0
- package/dist/esm/templating/html.js +1 -0
- package/dist/esm/templating/hydration-view.js +228 -0
- package/dist/esm/templating/markup.js +83 -0
- package/dist/esm/templating/node-observation.js +84 -0
- package/dist/esm/templating/ref.js +21 -0
- package/dist/esm/templating/render.js +468 -0
- package/dist/esm/templating/repeat.js +434 -0
- package/dist/esm/templating/slotted.js +49 -0
- package/dist/esm/templating/template.js +206 -0
- package/dist/esm/templating/view.js +298 -0
- package/dist/esm/templating/when.js +22 -0
- package/dist/esm/testing/exports.js +3 -0
- package/dist/esm/testing/fakes.js +107 -0
- package/dist/esm/testing/fixture.js +86 -0
- package/dist/esm/testing/models.js +58 -0
- package/dist/esm/testing/timeout.js +24 -0
- package/dist/esm/trust/index.js +7 -0
- package/dist/esm/trust/types.js +6 -0
- package/dist/esm/trust/utils.js +126 -0
- package/dist/esm/utilities.js +140 -0
- package/dist/fast-element.api.json +26798 -0
- package/dist/fast-element.d.ts +3985 -0
- package/dist/fast-element.debug.js +7604 -0
- package/dist/fast-element.debug.min.js +3 -0
- package/dist/fast-element.js +7603 -0
- package/dist/fast-element.min.js +3 -0
- package/dist/fast-element.untrimmed.d.ts +4103 -0
- package/dist/observation/arrays/arrays.api.json +2621 -0
- package/dist/scoped/scoped.api.json +891 -0
- package/dist/trust/trust.api.json +629 -0
- package/package.json +21 -23
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var e;!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.invalidHydrationAttributeMarker=1210]="invalidHydrationAttributeMarker",e[e.duplicateRenderInstruction=1211]="duplicateRenderInstruction",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"}(e||(e={}));const t=e=>"function"==typeof e,n=e=>"string"==typeof e,i=()=>{},s=Object.create(null),r={warn(e,t){},error:(e,t)=>new Error(`Error ${e}`),addMessages(e){Object.assign(s,e)}};function o(){return s}const a=Object.freeze([]);function l(){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 c(){const e=new WeakMap;return function(t){let n=e.get(t);if(void 0===n){let i=Reflect.getPrototypeOf(t);for(;void 0===n&&null!==i;)n=e.get(i),i=Reflect.getPrototypeOf(i);n=void 0===n?[]:n.slice(0),e.set(t,n)}return n}}function d(e){e.prototype.toJSON=i}const h=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),u=e=>e,f=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-element",{createHTML:u}):{createHTML:u};let p=Object.freeze({createHTML:e=>f.createHTML(e),protect:(e,t,n,i)=>i});const g=p,b=Object.freeze({get policy(){return p},setPolicy(t){if(p!==g)throw r.error(e.onlySetDOMPolicyOnce);p=t},setAttribute(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)},setBooleanAttribute(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}}),v=/^[\u0000-\u0020\u007F]+|[\u0000-\u0020\u007F]+$/g,m=/[\u0000-\u0020\u007F]+/g,y=/^(?:javascript|vbscript|data):/;function w(e){return e.replace(v,"")}function C(e){try{return decodeURIComponent(e)}catch(t){return e}}function S(e){const t=w(e);return function(e){let t=w(e);for(let e=0;e<3;++e){const e=C(t);if(e===t)break;t=w(e)}return t=t.replace(m,"").toLowerCase(),y.test(t)}(t)?"":t}function O(e,t,i,s){return(e,t,i,...r)=>{n(i)&&(i=S(i)),s(e,t,i,...r)}}function x(t,n,i,s){throw r.error(e.blockedByDOMPolicy,{aspectName:i,tagName:null!=t?t:"text"})}const T={onabort:x,onauxclick:x,onbeforeinput:x,onbeforematch:x,onblur:x,oncancel:x,oncanplay:x,oncanplaythrough:x,onchange:x,onclick:x,onclose:x,oncontextlost:x,oncontextmenu:x,oncontextrestored:x,oncopy:x,oncuechange:x,oncut:x,ondblclick:x,ondrag:x,ondragend:x,ondragenter:x,ondragleave:x,ondragover:x,ondragstart:x,ondrop:x,ondurationchange:x,onemptied:x,onended:x,onerror:x,onfocus:x,onformdata:x,oninput:x,oninvalid:x,onkeydown:x,onkeypress:x,onkeyup:x,onload:x,onloadeddata:x,onloadedmetadata:x,onloadstart:x,onmousedown:x,onmouseenter:x,onmouseleave:x,onmousemove:x,onmouseout:x,onmouseover:x,onmouseup:x,onpaste:x,onpause:x,onplay:x,onplaying:x,onprogress:x,onratechange:x,onreset:x,onresize:x,onscroll:x,onsecuritypolicyviolation:x,onseeked:x,onseeking:x,onselect:x,onslotchange:x,onstalled:x,onsubmit:x,onsuspend:x,ontimeupdate:x,ontoggle:x,onvolumechange:x,onwaiting:x,onwebkitanimationend:x,onwebkitanimationiteration:x,onwebkitanimationstart:x,onwebkittransitionend:x,onwheel:x},B={elements:{a:{[h.attribute]:{href:O},[h.property]:{href:O}},area:{[h.attribute]:{href:O},[h.property]:{href:O}},button:{[h.attribute]:{formaction:O},[h.property]:{formAction:O}},embed:{[h.attribute]:{src:x},[h.property]:{src:x}},form:{[h.attribute]:{action:O},[h.property]:{action:O}},frame:{[h.attribute]:{src:O},[h.property]:{src:O}},iframe:{[h.attribute]:{src:O},[h.property]:{src:O,srcdoc:x}},input:{[h.attribute]:{formaction:O},[h.property]:{formAction:O}},link:{[h.attribute]:{href:x},[h.property]:{href:x}},object:{[h.attribute]:{codebase:x,data:x},[h.property]:{codeBase:x,data:x}},script:{[h.attribute]:{src:x,text:x},[h.property]:{src:x,text:x,innerText:x,textContent:x}},style:{[h.property]:{innerText:x,textContent:x}}},aspects:{[h.attribute]:Object.assign({},T),[h.property]:Object.assign({innerHTML:x},T),[h.event]:Object.assign({},T)}};function N(e,t){const n={};for(const i in t){const s=e[i],r=t[i];switch(s){case null:break;case void 0:n[i]=r;break;default:n[i]=s}}for(const t in e)t in n||(n[t]=e[t]);return Object.freeze(n)}function k(e,t){const n={};for(const i in t){const s=e[i],r=t[i];switch(s){case null:break;case void 0:n[i]=N(r,{});break;default:n[i]=N(s,r)}}for(const t in e)t in n||(n[t]=N(e[t],{}));return Object.freeze(n)}function A(e,t){const n={};for(const i in t){const s=e[i],r=t[i];switch(s){case null:break;case void 0:n[i]=k(r,{});break;default:n[i]=k(s,r)}}for(const t in e)t in n||(n[t]=k(e[t],{}));return Object.freeze(n)}function M(e,t,n,i,s){const r=e[n];if(r){const e=r[i];if(e)return e(t,n,i,s)}}const $=Object.freeze({create(e={}){var t,n;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-element",{createHTML:e}):{createHTML:e}}(),s=(r=null!==(n=e.guards)&&void 0!==n?n:{},o=B,Object.freeze({elements:r.elements?A(r.elements,o.elements):o.elements,aspects:r.aspects?k(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,n,i){var r;const o=(null!=e?e:"").toLowerCase(),a=s.elements[o];if(a){const s=M(a,e,t,n,i);if(s)return s}return null!==(r=M(s.aspects,e,t,n,i))&&void 0!==r?r:i}})}});class j{constructor(e,t,n=!1){this.evaluate=e,this.policy=t,this.isVolatile=n}}class E extends j{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function P(e,t){return new E(e,t)}d(E);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,i=this.sub2;void 0!==t&&t.handleChange(n,e),void 0!==i&&i.handleChange(n,e)}else for(let i=0,s=t.length;i<s;++i)t[i].handleChange(n,e)}}class I{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,i;let s;s=t?null!==(n=this.subscribers[t])&&void 0!==n?n:this.subscribers[t]=new R(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new R(this.subject),s.subscribe(e)}unsubscribe(e,t){var n,i;t?null===(n=this.subscribers[t])||void 0===n||n.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const _=[],V=[],L=globalThis.requestAnimationFrame;let D=!0;function H(){if(V.length)throw V.shift()}function z(e){try{e.call()}catch(e){if(!D)throw _.length=0,e;V.push(e),setTimeout(H,0)}}function F(){let e=0;for(;e<_.length;)if(z(_[e]),e++,e>1024){for(let t=0,n=_.length-e;t<n;t++)_[t]=_[t+e];_.length-=e,e=0}_.length=0}function U(e){_.push(e),_.length<2&&(D?L(F):F())}const W=Object.freeze({enqueue:U,next:()=>new Promise(U),process:F,setMode:e=>D=e}),q=Object.freeze({unknown:void 0,coupled:1}),Q=(()=>{const i=W.enqueue,s=/(:|&&|\|\||if|\?\.)/,o=new WeakMap;let a,l=t=>{throw r.error(e.needsArrayObservation)};function h(e){var t;let n=null!==(t=e.$fastController)&&void 0!==t?t:o.get(e);return void 0===n&&(Array.isArray(e)?n=l(e):o.set(e,n=new I(e))),n}const u=c();class f{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==a&&a.watch(e,this.name),e[this.field]}setValue(e,n){const i=this.field,s=e[i];if(s!==n){e[i]=n;const r=e[this.callback];t(r)&&r.call(e,s,n),h(e).notify(this.name)}}}class p 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){const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==q.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=a;let i;a=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{a=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=!0,this.needsQueue=this.isAsync}}watch(e,t){const n=this.last,i=h(e),s=null===n?this.first:{};if(s.propertySource=e,s.propertyName=t,s.notifier=i,i.subscribe(this,t),null!==n){if(!this.needsRefresh){let t;a=void 0,t=n.propertySource[n.propertyName],a=this,e===t&&(this.needsRefresh=!0)}n.next=s}this.last=s}handleChange(){this.needsQueue?(this.needsQueue=!1,i(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 d(p),Object.freeze({setArrayObserverFactory(e){l=e},getNotifier:h,track(e,t){a&&a.watch(e,t)},trackVolatile(){a&&(a.needsRefresh=!0)},notify(e,t){h(e).notify(t)},defineProperty(e,t){n(t)&&(t=new f(t)),u(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:u,binding(e,t,n=this.isVolatileBinding(e)){return new p(e,t,n)},isVolatileBinding:e=>s.test(e.toString())})})();function J(e,t){Q.defineProperty(e,t)}const K=(()=>{let e=null;return{get:()=>e,set(t){e=t}}})(),X=Object.freeze({default:{index:0,length:0,get event(){return X.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>K.get(),setEvent(e){K.set(e)}});class G extends j{createObserver(e){return Q.binding(this.evaluate,e,this.isVolatile)}}function Y(e,t,n=Q.isVolatileBinding(e)){return new G(e,t,n)}function Z(e,t){const n=new G(e);return n.options=t,n}function ee(e){return t(e)?Y(e):e instanceof j?e:P(()=>e)}const te=Object.create(null),ne=Object.freeze({subscribe(e,t){const n=te[e];n?n instanceof Set?n.add(t):te[e]=new Set([n,t]):te[e]=t},unsubscribe(e,t){const n=te[e];n&&n instanceof Set?n.delete(t):te[e]=void 0},send(e){const t=te[e];t&&(t instanceof Set?t.forEach(n=>n.handleChange(t,e)):t.handleChange(this,e))}});class ie{constructor(e,t){this.dataBinding=e,this.subscriber=t,this.isNotBound=!0}bind(e){return this.isNotBound&&(ne.subscribe(this.getSignal(e),this),e.onUnbind(this),this.isNotBound=!1),this.dataBinding.evaluate(e.source,e.context)}unbind(e){this.isNotBound=!0,ne.unsubscribe(this.getSignal(e),this)}handleChange(){this.subscriber.handleChange(this.dataBinding.evaluate,this)}getSignal(e){const t=this.dataBinding.options;return n(t)?t:t(e.source,e.context)}}d(ie);class se extends j{createObserver(e){return new ie(this,e)}}function re(e,t,n){const i=new se(e,n);return i.options=t,i}const oe={fromView:e=>e};let ae={determineChangeEvent:()=>"change"};const le=Object.freeze({configure(e){ae=e}});class ce{constructor(e,t,n){this.directive=e,this.subscriber=t,this.dataBinding=n,this.isNotBound=!0,this.notifier=Q.binding(n.evaluate,this,n.isVolatile)}bind(e){var t;return this.changeEvent||(this.changeEvent=null!==(t=this.dataBinding.options.changeEvent)&&void 0!==t?t:ae.determineChangeEvent(this.directive,this.target)),this.isNotBound&&(this.target.addEventListener(this.changeEvent,this),e.onUnbind(this),this.isNotBound=!1),this.notifier.bind(e)}unbind(e){this.isNotBound=!0,this.target.removeEventListener(this.changeEvent,this)}handleChange(e,t){this.subscriber.handleChange(this.dataBinding.evaluate,this)}handleEvent(t){const n=this.directive,i=t.currentTarget,s=this.notifier.last;if(!s)return void r.warn(e.twoWayBindingRequiresObservables);let o;switch(n.aspectType){case 1:o=i.getAttribute(n.targetAspect);break;case 2:o=i.hasAttribute(n.targetAspect);break;case 4:o=i.innerText;break;default:o=i[n.targetAspect]}s.propertySource[s.propertyName]=this.dataBinding.options.fromView(o)}}d(ce);class de extends j{createObserver(e,t){return new ce(t,e,this)}}function he(e,t,i,s=Q.isVolatileBinding(e)){n(t)&&(t={changeEvent:t}),t?t.fromView||(t.fromView=oe.fromView):t=oe;const r=new de(e,i,s);return r.options=t,r}const ue="boolean",fe="reflect",pe=Object.freeze({locate:c()}),ge={toView:e=>e?"":null,fromView:e=>!!e},be={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:ge.fromView(e)};function ve(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const me={toView(e){const t=ve(e);return t?t.toString():t},fromView:ve};class ye{constructor(e,t,n=t.toLowerCase(),i=fe,s){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=n,this.mode=i,this.converter=s,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i===ue&&void 0===s&&(this.converter=ge)}setValue(e,t){const n=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.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 Q.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.mode===ue?this.setValue(e,null!==t):this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,n=this.guards;n.has(e)||"fromView"===t||W.enqueue(()=>{n.add(e);const i=e[this.fieldName];switch(t){case fe:{const t=this.converter;b.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break}case ue:b.setBooleanAttribute(e,this.attribute,i)}n.delete(e)})}static collect(e,...t){const i=[];t.push(pe.locate(e));for(let s=0,r=t.length;s<r;++s){const r=t[s];if(void 0!==r)for(let t=0,s=r.length;t<s;++t){const s=r[t];n(s)?i.push(new ye(e,s)):i.push(new ye(e,s.property,s.attribute,s.mode,s.converter))}}return i}}function we(e,t){let n;function i(e,t){arguments.length>1&&(n.property=t),pe.locate(e.constructor).push(n)}return arguments.length>1?(n={},void i(e,t)):(n=void 0===e?{}:e,i)}let Ce;function Se(e){return e.reduce((e,t)=>(t instanceof Oe?e.push(...Se(t.styles)):e.push(t),e),[])}class Oe{get strategy(){return null===this._strategy&&(Ce||Oe.setDefaultStrategy(Oe.supportsAdoptedStyleSheets?function(){const e=new Map;return class{constructor(t){this.sheets=t.map(t=>{if(t instanceof CSSStyleSheet)return t;let n=e.get(t);return void 0===n&&(n=new CSSStyleSheet,n.replaceSync(t),e.set(t,n)),n})}addStylesTo(e){const t=e;t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=e;t.adoptedStyleSheets=t.adoptedStyleSheets.filter(e=>-1===this.sheets.indexOf(e))}}}():class{constructor(e){this.styles=e,this.styleClass="fast-"+ ++xe}addStylesTo(e){const t=e===document?document.body:e;for(let e=0;e<this.styles.length;e++){const n=document.createElement("style");n.innerHTML=this.styles[e],n.className=this.styleClass,t.append(n)}}removeStylesFrom(e){const t=e===document?document.body:e,n=t.querySelectorAll(`.${this.styleClass}`);for(let e=0,i=n.length;e<i;++e)t.removeChild(n[e])}}),this.withStrategy(Ce)),this._strategy}constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=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)}withStrategy(e){return this._strategy=new e(Se(this.styles)),this}static setDefaultStrategy(e){Ce=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new Oe(e):e instanceof Oe?e:new Oe([e])}}Oe.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;let xe=0;const Te="__trust";var Be=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n};function Ne(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}const ke={},Ae=new WeakMap,Me=l(),$e=Object.freeze({register(e){if(!Me.register(e))return!1;const t=je(e.registry);return Object.prototype.hasOwnProperty.call(t,e.name)||Q.defineProperty(t,e.name),t[e.name]=e.type,!0},getByType:Me.getByType,getForInstance:Me.getForInstance,whenRegistered:function(e,t=customElements){const n=je(t);Object.prototype.hasOwnProperty.call(n,e)||Q.defineProperty(n,e);const i=Ee(n[e]);if(void 0!==i)return Promise.resolve(i);return new Promise(t=>{const i=Q.getNotifier(n),s={handleChange:()=>{const r=Ee(n[e]);void 0!==r&&(i.unsubscribe(s,e),t(r))}};i.subscribe(s,e)})}});function je(e=customElements){if(e===customElements)return ke;let t=Ae.get(e);return t||(t={},Ae.set(e,t)),t}function Ee(e){return void 0===e?void 0:$e.getByType(e)}const Pe={mode:"open"},Re={},Ie=new Set;const _e=new WeakMap,Ve=new WeakMap,Le=new WeakMap,De=new WeakMap,He=new Set,ze=new WeakMap;function Fe(e,t){if(Ve.delete(e),void 0===e.template&&void 0!==t&&(e.template=t),void 0!==e.template)return Le.delete(e),_e.delete(e),e.template}function Ue(e,t=e.registry,n){if(0===He.size&&!(null==n?void 0:n.length))return;const i=e;let s=De.get(i);if(!(null==s?void 0:s.has(t))){void 0===s&&(s=new WeakSet,De.set(i,s)),s.add(t);for(const n of He)n(e,t);for(const i of null!=n?n:[])He.has(i)||i(e,t)}}function We(e){var t;return null!==(t=ze.get(e))&&void 0!==t?t:null}function qe(e){if(void 0!==e.template)return Le.delete(e),e.template;const t=Ve.get(e);if(t)return t;const n=_e.get(e);if(!n)return;let i;Le.delete(e);try{i=n(e)}catch(t){throw Le.set(e,t),t}if("function"==typeof(null==(s=i)?void 0:s.then)){const t=Promise.resolve(i).then(t=>Fe(e,t)).catch(t=>{throw Ve.delete(e),Le.set(e,t),t});return Ve.set(e,t),t}var s;return Fe(e,i)}class Qe{get isDefined(){return this.platformDefined}constructor(e,i=e.definition){var s,r;this.platformDefined=!1,n(i)&&(i={name:i}),this.type=e,this.name=i.name,this.registry=null!==(s=i.registry)&&void 0!==s?s:customElements,r=i.template,t(r)?_e.set(this,i.template):this.template=i.template;const o=e.prototype,a=ye.collect(e,i.attributes),l=new Array(a.length),c={},d={};for(let e=0,t=a.length;e<t;++e){const t=a[e];l[e]=t.attribute,c[t.name]=t,d[t.attribute]=t,Q.defineProperty(o,t)}Reflect.defineProperty(e,"observedAttributes",{value:l,enumerable:!0}),this.attributes=a,this.propertyLookup=c,this.attributeLookup=d,this.shadowOptions=function(e){if(null===e)return;const t=Object.assign(Object.assign({},Pe),e);return void 0===t.customElementRegistry&&void 0!==t.registry&&(t.customElementRegistry=t.registry),void 0===t.registry&&void 0!==t.customElementRegistry&&(t.registry=t.customElementRegistry),t}(i.shadowOptions),this.elementOptions=void 0===i.elementOptions?Re:Object.assign(Object.assign({},Re),i.elementOptions),this.styles=Oe.normalize(i.styles),this.schema=i.schema,$e.register(this)}define(e=this.registry,t){const n=this.type;if(!e.get(this.name)){if(Ue(this,e,t),void 0===this.template&&_e.has(this))return Promise.resolve().then(()=>qe(this)).then(t=>{void 0===t||e.get(this.name)||(this.platformDefined=!0,e.define(this.name,n,this.elementOptions))}).catch(e=>{!function(e,t){const n=e;void 0!==t?Le.set(n,t):Le.delete(n)}(this,e),Q.notify(this,"template")}),this;this.platformDefined=!0,e.define(this.name,n,this.elementOptions)}return this}static compose(e,t){const n=Ie.has(e)||$e.getByType(e)?new Qe(class extends e{},t):new Qe(e,t);return Promise.resolve(n)}static registerBaseType(e){Ie.add(e)}}Qe.getByType=$e.getByType,Qe.getForInstance=$e.getForInstance,Q.defineProperty(Qe.prototype,"template");var Je=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n};const Ke={bubbles:!0,composed:!0,cancelable:!0},Xe="isConnected",Ge=new WeakMap,Ye=Symbol("fast-late-attribute-observer"),Ze=new Set;function et(e){var t,n;return null!==(n=null!==(t=e.shadowRoot)&&void 0!==t?t:Ge.get(e))&&void 0!==n?n:null}let tt;var nt;!function(e){e[e.connecting=0]="connecting",e[e.connected=1]="connected",e[e.disconnecting=2]="disconnecting",e[e.disconnected=3]="disconnected"}(nt||(nt={}));class it{get isConnected(){return Q.track(this,Xe),this.stage===nt.connected}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:X.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&&Ge.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){this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this.isPrerendered=new Promise(e=>{this._resolvePrerendered=e}),this.isHydrated=new Promise(e=>{this._resolveHydrated=e}),this._template=null,this.stage=nt.disconnected,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this._notifier=new I(e),this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const n=Reflect.getPrototypeOf(e),i=null===n?[]:Q.getAccessors(n);if(i.length>0){const t=this.boundObservables=Object.create(null);for(let n=0,s=i.length;n<s;++n){const s=i[n].name,r=e[s];void 0!==r&&(delete e[s],t[s]=r)}0===Object.keys(t).length&&(this.boundObservables=null)}this.captureBoundObservables();for(const t of Ze){const n=t(e);void 0!==n&&this.addBehavior(n)}}get subject(){return this._notifier.subject}notify(e){this._notifier.notify(e)}subscribe(e,t){this._notifier.subscribe(e,t)}unsubscribe(e,t){this._notifier.unsubscribe(e,t)}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,n;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,s=null!==(n=i.get(e))&&void 0!==n?n:0;0===s?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||this.stage!==nt.connected&&this.stage!==nt.connecting||e.connectedCallback(this)):i.set(e,s+1)}removeBehavior(e,t=!1){const n=this.behaviors;if(null===n)return;const i=n.get(e);void 0!==i&&(1===i||t?(n.delete(e),e.disconnectedCallback&&this.stage!==nt.disconnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):n.set(e,i-1))}addStyles(e){var t;if(!e)return;const n=this.source;if(e instanceof HTMLElement){(null!==(t=et(n))&&void 0!==t?t:this.source).append(e)}else e.isAttachedTo(n)||e.addStylesTo(n)}removeStyles(e){var t;if(!e)return;const n=this.source;if(e instanceof HTMLElement){(null!==(t=et(n))&&void 0!==t?t:n).removeChild(e)}else e.isAttachedTo(n)&&e.removeStylesFrom(n)}connect(){this.stage===nt.disconnected&&(this.stage=nt.connecting,this.captureBoundObservables(),this.syncLateAttributes(),this.observeLateAttributes(),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=nt.connected,Q.notify(this,Xe))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,n=Object.keys(t);for(let i=0,s=n.length;i<s;++i){const s=n[i];e[s]=t[s]}this.boundObservables=null}}captureBoundObservables(){const e=this.source,t=Object.getOwnPropertyNames(e),n=t=>{let n=Reflect.getPrototypeOf(e);for(;null!==n;){const e=Reflect.getOwnPropertyDescriptor(n,t);if((null==e?void 0:e.get)||(null==e?void 0:e.set))return!0;n=Reflect.getPrototypeOf(n)}return!1};let i=this.boundObservables;for(let s=0,r=t.length;s<r;++s){const r=t[s];if(!n(r))continue;const o=e[r];void 0!==o?(delete e[r],(null!=i?i:i=this.boundObservables=Object.create(null))[r]=o):delete e[r]}}syncLateAttributes(){const e=We(this.definition);if(null!==e)for(const t of Object.keys(e))this.source.hasAttribute(t)&&this.onAttributeChangedCallback(t,null,this.source.getAttribute(t))}observeLateAttributes(){const e=We(this.definition);if(null===e)return;const t=this.source;void 0===t[Ye]&&(t[Ye]=new MutationObserver(e=>{const n=t.$fastController,i=We(n.definition);if(null!==i)for(let s=0,r=e.length;s<r;++s){const r=e[s].attributeName;null!==r&&void 0!==i[r]&&n.onAttributeChangedCallback(r,null,t.getAttribute(r))}}),t[Ye].observe(t,{attributes:!0,attributeFilter:Object.keys(e)}))}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===nt.connected&&(this.stage=nt.disconnecting,Q.notify(this,Xe),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=nt.disconnected)}onAttributeChangedCallback(e,t,n){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,n)}emit(e,t,n){if(this.stage===nt.connected){const i=null!=n?n:{},{confidence:s,reasoning:r,warnings:o}=i,a=Je(i,["confidence","reasoning","warnings"]),l=function(e,t){const{confidence:n,reasoning:i}=null!=t?t:{},s=Array.isArray(null==t?void 0:t.warnings)?t.warnings:void 0;if(void 0===n&&void 0===i&&void 0===s){if(Ne(e)&&Te in e){const t=e,n=Te;return t[n],Be(t,[n+""])}return e}if(void 0!==n&&(!Number.isFinite(n)||n<0||n>1))throw new RangeError("Trust confidence must be a finite number from 0 to 1.");const r={};if(void 0!==n&&(r.confidence=n),void 0!==i&&(r.reasoning=i),void 0!==s&&(r.warnings=s.map(e=>Object.assign({},e))),Ne(e)){const t=e,n=Te;t[n];const i=Be(t,[n+""]);return Object.assign(Object.assign({},i),{[Te]:r})}return{value:e,[Te]:r}}(t,{confidence:s,reasoning:r,warnings:o});return this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign(Object.assign({},Ke),a),{detail:l})))}return!1}renderTemplate(e){var t;const n=this.source,i=null!==(t=et(n))&&void 0!==t?t:n;if(null!==this.view)this.view.dispose(),this.view=null;else if((!this.needsInitialization||this.hasExistingShadowRoot)&&(!this.hasExistingShadowRoot||!this.needsInitialization))for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e);if(e){const t=this.hasExistingShadowRoot&&this.needsInitialization;let s=!1;t&&it.hydrationHook&&(s=it.hydrationHook(this,e,n,i)),s||this.renderClientSide(e,n,i),this._resolvePrerendered(t),this._resolveHydrated(s)}else this.needsInitialization&&(this._resolvePrerendered(!1),this._resolveHydrated(!1))}renderClientSide(e,t,n){var i;if(this.hasExistingShadowRoot){for(let e=n.firstChild;null!==e;e=n.firstChild)n.removeChild(e);this.hasExistingShadowRoot=!1}const s=void 0!==(null===(i=this._shadowRootOptions)||void 0===i?void 0:i.customElementRegistry)?n:void 0;this.view=e.render(t,n,t,s),this.view.sourceLifetime=q.coupled}static forCustomElement(t,n=!1){const i=t.$fastController;if(void 0!==i&&!n)return i;const s=Qe.getForInstance(t);if(void 0===s)throw r.error(e.missingElementDefinition);return Q.getNotifier(s).subscribe({handleChange:()=>{it.forCustomElement(t,!0),t.$fastController.connect()}},"template"),Q.getNotifier(s).subscribe({handleChange:()=>{it.forCustomElement(t,!0),t.$fastController.connect()}},"shadowOptions"),t.$fastController=new tt(t,s)}static setStrategy(e){tt=e}static installHydrationHook(e){it.hydrationHook=e}}function st(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=et(e))&&void 0!==t?t:e.getRootNode()}it.hydrationHook=null,d(it),it.setStrategy(it);class rt{constructor(e){const t=rt.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){ct(st(e),this.sheets)}removeStylesFrom(e){dt(st(e),this.sheets)}}rt.styleSheetCache=new Map;let ot=0;function at(e){return e===document?document.body:e}class lt{constructor(e){this.styles=e,this.styleClass="fast-"+ ++ot}addStylesTo(e){e=at(st(e));const t=this.styles,n=this.styleClass;for(let i=0;i<t.length;i++){const s=document.createElement("style");s.innerHTML=t[i],s.className=n,e.append(s)}}removeStylesFrom(e){const t=(e=at(st(e))).querySelectorAll(`.${this.styleClass}`);for(let n=0,i=t.length;n<i;++n)e.removeChild(t[n])}}let ct=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},dt=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>-1===t.indexOf(e))};if(Oe.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),ct=(e,t)=>{e.adoptedStyleSheets.push(...t)},dt=(e,t)=>{for(const n of t){const t=e.adoptedStyleSheets.indexOf(n);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}Oe.setDefaultStrategy(rt)}else Oe.setDefaultStrategy(lt);function ht(e){const t=class extends e{constructor(){super(),it.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 Qe.registerBaseType(t),t}function ut(e,n,i){Array.isArray(n)&&(i=n,n=void 0);return(t(e)?Qe.compose(e,n):Qe.compose(this,e)).then(e=>{Ue(e,e.registry,i);const t=qe(e);return"function"==typeof(null==(n=t)?void 0:n.then)?t.then(()=>e.define().type):e.define().type;var n})}const ft=Object.assign(ht(HTMLElement),{from:function(e){return ht(e)},define:ut});function pt(e){return function(t){ut(t,e)}}const gt={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.",1210:"Invalid data-fe attribute value '${value}'. Expected a positive integer.",1211:"Replacing existing RenderInstruction for '${type}' with name '${name}'.",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}."},bt=/(\$\{\w+?})/g,vt=/\$\{(\w+?)}/g,mt=Object.freeze({});function yt(e,t){return e.split(bt).map(e=>{var n;const i=e.replace(vt,"$1");return String(null!==(n=t[i])&&void 0!==n?n:e)}).join("")}function wt(){const e=o();Object.assign(e,gt),Object.assign(r,{addMessages(t){Object.assign(e,t)},warn(t,n=mt){var i;const s=null!==(i=e[t])&&void 0!==i?i:"Unknown Warning";console.warn(yt(s,n))},error(t,n=mt){var i;const s=null!==(i=e[t])&&void 0!==i?i:"Unknown Error";return new Error(yt(s,n))}})}class Ct{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 St{constructor(e){this.sorted=e}}const Ot=Object.freeze({reset:1,splice:2,optimized:3}),xt=new Ct(0,a,0);xt.reset=!0;const Tt=[xt];var Bt;function Nt(e,t,n,i){return t<n||i<e?-1:t===n||i===e?0:e<n?t<i?t-n:i-n:i<t?i-e:t-e}function kt(e,t,n,i,s,r){let o=0,l=0;const c=Math.min(n-t,r-s);if(0===t&&0===s&&(o=function(e,t,n){for(let i=0;i<n;++i)if(e[i]!==t[i])return i;return n}(e,i,c)),n===e.length&&r===i.length&&(l=function(e,t,n){let i=e.length,s=t.length,r=0;for(;r<n&&e[--i]===t[--s];)r++;return r}(e,i,c-o)),s+=o,r-=l,(n-=l)-(t+=o)===0&&r-s===0)return a;if(t===n){const e=new Ct(t,[],0);for(;s<r;)e.removed.push(i[s++]);return[e]}if(s===r)return[new Ct(t,[],n-t)];const d=function(e){let t=e.length-1,n=e[0].length-1,i=e[t][n];const s=[];for(;t>0||n>0;){if(0===t){s.push(Bt.add),n--;continue}if(0===n){s.push(Bt.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===i?s.push(Bt.leave):(s.push(Bt.update),i=r),t--,n--):l===o?(s.push(Bt.delete),t--,i=o):(s.push(Bt.add),n--,i=a)}return s.reverse()}(function(e,t,n,i,s,r){const o=r-s+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]===i[s+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,i,s,r)),h=[];let u,f=t,p=s;for(let e=0;e<d.length;++e)switch(d[e]){case Bt.leave:void 0!==u&&(h.push(u),u=void 0),f++,p++;break;case Bt.update:void 0===u&&(u=new Ct(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case Bt.add:void 0===u&&(u=new Ct(f,[],0)),u.addedCount++,f++;break;case Bt.delete:void 0===u&&(u=new Ct(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&h.push(u),h}function At(e,t){let n=!1,i=0;for(let s=0;s<t.length;s++){const r=t[s];if(r.index+=i,n)continue;const o=Nt(e.index,e.index+e.removed.length,r.index,r.index+r.addedCount);if(o>=0){t.splice(s,1),s--,i-=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(s,0,e),s++;const o=e.addedCount-e.removed.length;r.index+=o,i+=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"}(Bt||(Bt={}));let Mt=Object.freeze({support:Ot.optimized,normalize:(e,t,n)=>void 0===e?void 0===n?a:function(e,t){let n=[];const i=[];for(let e=0,n=t.length;e<n;e++)At(t[e],i);for(let t=0,s=i.length;t<s;++t){const s=i[t];1!==s.addedCount||1!==s.removed.length?n=n.concat(kt(e,s.index,s.index+s.addedCount,s.removed,0,s.removed.length)):s.removed[0]!==e[s.index]&&n.push(s)}return n}(t,n):Tt,pop(e,t,n,i){const s=e.length>0,r=n.apply(e,i);return s&&t.addSplice(new Ct(e.length,[r],0)),r},push(e,t,n,i){const s=n.apply(e,i);return t.addSplice(new Ct(e.length-i.length,[],i.length).adjustTo(e)),s},reverse(e,t,n,i){const s=n.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new St(r)),s},shift(e,t,n,i){const s=e.length>0,r=n.apply(e,i);return s&&t.addSplice(new Ct(0,[r],0)),r},sort(e,t,n,i){const s=new Map;for(let t=0,n=e.length;t<n;++t){const n=s.get(e[t])||[];s.set(e[t],[...n,t])}const r=n.apply(e,i);e.sorted++;const o=[];for(let t=0,n=e.length;t<n;++t){const n=s.get(e[t]);o.push(n[0]),s.set(e[t],n.splice(1))}return t.addSort(new St(o)),r},splice(e,t,n,i){const s=n.apply(e,i);return t.addSplice(new Ct(+i[0],s,i.length>2?i.length-2:0).adjustTo(e)),s},unshift(e,t,n,i){const s=n.apply(e,i);return t.addSplice(new Ct(0,[],i.length).adjustTo(e)),s}});const $t=Object.freeze({reset:Tt,setDefaultStrategy(e){Mt=e}});function jt(e,t,n,i=!0){Reflect.defineProperty(e,t,{value:n,enumerable:!1,writable:i})}class Et 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,Q.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,Q.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,jt(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,i=this.oldCollection;void 0===t&&void 0===i&&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:Mt).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,W.enqueue(this))}}let Pt=!1;const Rt=Object.freeze({sorted:0,enable(){if(Pt)return;Pt=!0,Q.setArrayObserverFactory(e=>new Et(e));const e=Array.prototype;e.$fastPatch||(jt(e,"$fastPatch",1),jt(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 i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(n=i.strategy)&&void 0!==n?n:Mt)[t.name](this,i,t,e)}}))}});function It(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(Rt.enable(),t=Q.getNotifier(e)),Q.track(t.lengthObserver,"length"),e.length}function _t(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(Rt.enable(),t=Q.getNotifier(e)),Q.track(t.sortObserver,"sorted"),e.sorted}function Vt(e,t,n){return Object.assign({},n,{get(){return Q.trackVolatile(),n.get.apply(this)}})}const Lt="$fast_context",Dt="$fast_parent_contexts",Ht="$defs",zt="$ref",Ft=new Map;class Ut{constructor(e){this.customElementName=e,this.schemaMap=new Map,Ft.set(e,this.schemaMap)}addPath(e){var t,n,i;const s=this.getSplitPath(e.pathConfig.path);let r=this.schemaMap.get(e.rootPropertyName),o=null;switch(r||(this.addNewSchema(e.rootPropertyName),r=this.schemaMap.get(e.rootPropertyName)),e.childrenMap&&(o=this.getSchemaId(e.childrenMap.customElementName,e.childrenMap.attributeName),1===s.length&&(r.anyOf?r.anyOf.push({[zt]:o}):r.anyOf=[{[zt]:o}])),e.pathConfig.type){case"default":case"access":s.length>1&&(null===e.pathConfig.currentContext?this.addPropertiesToAnObject(r,s.slice(1),e.pathConfig.currentContext,o):((null===(t=r[Ht])||void 0===t?void 0:t[s[0]])||(r[Ht]=Object.assign(Object.assign({},r[Ht]),{[s[0]]:{}})),this.addPropertiesToAContext(r[Ht][s[0]],s.slice(1),e.pathConfig.currentContext,o)));break;case"repeat":if(this.addContext(r,s[s.length-1],e.pathConfig.currentContext,e.pathConfig.parentContext),s.length>2){let t=r;const i=!!e.pathConfig.parentContext;i&&(t=this.addPropertiesToAnObject(null===(n=r[Ht])||void 0===n?void 0:n[e.pathConfig.parentContext],s.slice(1,-1),e.pathConfig.parentContext,o)),this.addPropertiesToAnObject(t,i?s.slice(2):s.slice(1),e.pathConfig.currentContext,o,"array")}else if(s.length>1){let t;e.pathConfig.parentContext&&(t=null===(i=null==r?void 0:r[Ht])||void 0===i?void 0:i[e.pathConfig.parentContext]),this.addPropertiesToAnObject(null!=t?t:r,s.slice(1),e.pathConfig.currentContext,o,"array")}else r.type="array",r[zt]=this.getDefsPath(e.pathConfig.currentContext)}}getSchema(e){var t;return null!==(t=this.schemaMap.get(e))&&void 0!==t?t:null}getRootProperties(){return this.schemaMap.keys()}getSplitPath(e){return e.split(".")}getDefsPath(e){return`#/${Ht}/${e}`}getSchemaId(e,t){return`https://fast.design/schemas/${e}/${t}.json`}addNewSchema(e){this.schemaMap.set(e,{$schema:"https://json-schema.org/draft/2019-09/schema",$id:this.getSchemaId(this.customElementName,e),[Ht]:{}})}addPropertiesToAContext(e,t,n,i){e.type="object",e.properties&&!e.properties[t[0]]?e.properties[t[0]]={}:e.properties||(e.properties={[t[0]]:{}}),t.length>1?this.addPropertiesToAnObject(e.properties[t[0]],t.slice(1),n,i):i&&(e.properties[t[0]].anyOf?e.properties[t[0]].anyOf.push({[zt]:i}):e.properties[t[0]].anyOf=[{[zt]:i}])}addPropertiesToAnObject(e,t,n,i,s="object"){return e.type="object",e.properties&&!e.properties[t[0]]?e.properties[t[0]]={}:e.properties||(e.properties={[t[0]]:{}}),"object"===s&&t.length>1?this.addPropertiesToAnObject(e.properties[t[0]],t.slice(1),n,i,s):"array"===s?t.length>1?this.addPropertiesToAnObject(e.properties[t[0]],t.slice(1),n,i,s):this.addArrayToAnObject(e.properties[t[0]],n):(e.properties[t[0]].anyOf&&i?e.properties[t[0]].anyOf.push({[zt]:i}):i&&(e.properties[t[0]].anyOf=[{[zt]:i}]),e.properties[t[0]])}addArrayToAnObject(e,t){return e.type="array",e.items={[zt]:this.getDefsPath(t)},e.items}addContext(e,t,n,i){e[Ht][n]||(e[Ht][n]={[Lt]:t,[Dt]:this.getParentContexts(e,i)})}getParentContexts(e,t,n=[]){var i;if(null===t)return[null,...n];const s=null===(i=null==e?void 0:e[Ht])||void 0===i?void 0:i[t][Dt];return this.getParentContexts(e,s[s.length-1],[t,...n])}}function Wt(e,t,n,i,s){if(function(e,t){return null!=e&&"object"==typeof e&&!t.has(e)}(e,s))if(s.add(e),Array.isArray(e)){n.visitArray(e,i);for(const r of e)Wt(r,t,n,i,s)}else{n.visitObject(e,i);for(const r in e){const o=e[r];n.visitProperty(e,r,o,i),t&&Wt(o,t,n,i,s)}}}const qt=new WeakSet,Qt={visitObject:i,visitArray:i,visitProperty(e,t,n){Reflect.defineProperty(e,t,{enumerable:!0,get:()=>(Q.track(e,t),n),set(i){n!==i&&(n=i,Q.notify(e,t))}})}};function Jt(e,t=!1){return Wt(e,t,Qt,void 0,qt),e}const Kt={deep:!1};function Xt(e,t=Kt){var i;n(t)&&(t={deep:!1,name:t});const s=Jt({value:e},t.deep),r=()=>s.value;return Object.defineProperty(r,"current",{get:()=>s.value,set:e=>s.value=e}),Object.defineProperty(r,"name",{value:null!==(i=t.name)&&void 0!==i?i:"SharedState"}),r.set=e=>s.value=e,r.asReadonly=()=>{const e=()=>s.value;return Object.defineProperty(e,"current",{get:()=>s.value}),Object.defineProperty(e,"name",{value:`${r.name} (Readonly)`}),Object.freeze(e)},r}function Gt(e,i=Kt){var s;if(n(i)&&(i={deep:!1,name:i}),!t(e)){const t=e;e=()=>t}const r=new WeakMap,o=t=>{let n=r.get(t);return void 0===n&&(n=Jt({value:e()},i.deep),r.set(t,n)),n},a=e=>o(e).value;return Object.defineProperty(a,"name",{value:null!==(s=i.name)&&void 0!==s?s:"OwnedState"}),a.set=(e,t)=>o(e).value=t,a.asReadonly=()=>{const e=e=>o(e).value;return Object.defineProperty(e,"name",{value:`${a.name} (Readonly)`}),Object.freeze(e)},a}function Yt(e,t="ComputedState"){let n=null;const i=e({on:{setup(e){n=e}}}),s=Jt({value:null},!1),r=()=>s.value;let o;Object.defineProperty(r,"current",{get:()=>s.value}),Object.defineProperty(r,"name",{value:t});const a={handleChange(){s.value=o.observe(null)}};let l,c;if(o=Q.binding(i,a),o.setMode(!1),n){const e={handleChange(){l&&l(),l=c.observe(null),s.value=i()}};c=Q.binding(n,e),c.setMode(!1),l=c.observe(null)}return s.value=o.observe(null),r.dispose=()=>{l&&l(),c&&c.dispose(),o.dispose()},r.subscribe=e=>{o.subscribe(e)},r.unsubscribe=e=>{o.unsubscribe(e)},r}function Zt(e,t){const n=Q.getNotifier(e);n.subscribe(t.subscriber),t.notifiers.push(n)}const en={visitProperty:i,visitObject:Zt,visitArray:Zt};function tn(e,n){const i={notifiers:[],subscriber:t(n)?{handleChange:n}:n};return Rt.enable(),Wt(e,!0,en,i,new Set),{dispose(){for(const e of i.notifiers)e.unsubscribe(i.subscriber)}}}const nn=l(),sn=Object.freeze({getForInstance:nn.getForInstance,getByType:nn.getByType,define:e=>(nn.register({type:e}),e)});function rn(){return function(e){sn.define(e)}}function on(e,t){const n=[];let i="";for(let s=0,r=e.length-1;s<r;++s){i+=e[s];let r=t[s];void 0!==sn.getForInstance(r)&&(r=r.createCSS()),r instanceof Oe||r instanceof CSSStyleSheet?(""!==i.trim()&&(n.push(i),i=""),n.push(r)):i+=r}return i+=e[e.length-1],""!==i.trim()&&n.push(i),n}const an=(e,...t)=>new Oe(on(e,t));class ln{constructor(e){this.value=0===e.length?"":1===e.length?e[0]:new Oe(e)}createCSS(){return this.value}}sn.define(ln),an.partial=(e,...t)=>new ln(on(e,t));const cn=`fast-${Math.random().toString(36).substring(2,8)}`,dn=`${cn}{`,hn=`}${cn}`,un=hn.length;let fn=0;const pn=()=>`${cn}-${++fn}`,gn=Object.freeze({interpolation:e=>`${dn}${e}${hn}`,attribute:e=>`${pn()}="${dn}${e}${hn}"`,comment:e=>`\x3c!--${dn}${e}${hn}--\x3e`}),bn=Object.freeze({parse(e,t){const n=e.split(dn);if(1===n.length)return null;const i=[];for(let e=0,s=n.length;e<s;++e){const s=n[e],r=s.indexOf(hn);let o;if(-1===r)o=s;else{const e=s.substring(0,r);i.push(t[e]),o=s.substring(r+un)}""!==o&&i.push(o)}return i}}),vn=l(),mn=Object.freeze({getForInstance:vn.getForInstance,getByType:vn.getByType,define:(e,t)=>((t=t||{}).type=e,vn.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?h.tokenList:h.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=h.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=h.event;break;default:e.targetAspect=t,e.aspectType=h.attribute}else e.aspectType=h.content}});function yn(e){return function(t){mn.define(t,e)}}class wn{constructor(e){this.options=e}createHTML(e){return gn.attribute(e(this))}createBehavior(){return this}}d(wn);const Cn=e=>1===e.nodeType,Sn=e=>e?t=>1===t.nodeType&&t.matches(e):Cn;class On extends wn{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,a),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 xn extends On{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=i,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 Tn(e){return n(e)&&(e={property:e}),new xn(e)}mn.define(xn);const Bn=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,Nn=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,kn=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,An=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Mn=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,$n=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function jn(e){return e&&e.nodeType===Node.COMMENT_NODE}const En=Object.freeze({attributeMarkerName:"data-fe",legacyAttributeMarkerName:"data-fe-b",legacyCompactAttributeMarkerName:"data-fe-c",contentBindingStartMarker:()=>"fe:b",contentBindingEndMarker:()=>"fe:/b",repeatStartMarker:()=>"fe:r",repeatEndMarker:()=>"fe:/r",elementBoundaryStartMarker:()=>"fe:e",elementBoundaryEndMarker:()=>"fe:/e",isContentBindingStartMarker:e=>"fe:b"===e||Bn.test(e),isContentBindingEndMarker:e=>"fe:/b"===e||Nn.test(e),isRepeatViewStartMarker:e=>"fe:r"===e||kn.test(e),isRepeatViewEndMarker:e=>"fe:/r"===e||An.test(e),isElementBoundaryStartMarker:e=>jn(e)&&("fe:e"===e.data||Mn.test(e.data)),isElementBoundaryEndMarker:e=>jn(e)&&("fe:/e"===e.data||$n.test(e.data)),parseAttributeBindingCount(t){const n=t.getAttribute(this.attributeMarkerName);if(null===n)return null;const i=n.trim();if(!/^\d+$/.test(i))throw r.error(e.invalidHydrationAttributeMarker,{value:n});const s=parseInt(i,10);if(s<1)throw r.error(e.invalidHydrationAttributeMarker,{value:n});return s},parseLegacyAttributeBindingIndices(t){const n=[],i=t.getAttribute(this.legacyAttributeMarkerName);if(null!==i)for(const t of i.trim().split(/\s+/)){if(""===t)continue;const s=Number(t);if(!Number.isInteger(s)||s<0)throw r.error(e.invalidHydrationAttributeMarker,{value:i});n.push(s)}const s=`${this.legacyAttributeMarkerName}-`,o=`${this.legacyCompactAttributeMarkerName}-`;for(const i of t.getAttributeNames())if(i.startsWith(s)){const t=Number(i.slice(s.length));if(!Number.isInteger(t)||t<0)throw r.error(e.invalidHydrationAttributeMarker,{value:i});n.push(t)}else if(i.startsWith(o)){const[t,s]=i.slice(o.length).split("-").map(e=>Number(e));if(!Number.isInteger(t)||!Number.isInteger(s)||t<0||s<1)throw r.error(e.invalidHydrationAttributeMarker,{value:i});for(let e=0;e<s;e++)n.push(t+e)}return 0===n.length?null:n},removeLegacyAttributeBindingMarkers(e){e.removeAttribute(this.legacyAttributeMarkerName);for(const t of e.getAttributeNames())(t.startsWith(`${this.legacyAttributeMarkerName}-`)||t.startsWith(`${this.legacyCompactAttributeMarkerName}-`))&&e.removeAttribute(t)},parseLegacyContentBindingStartIndex:e=>function(e,t){const n=e.exec(t);return null===n?null:Number(n[1])}(Bn,e)});const Pn=Symbol.for("fe-hydration");function Rn(e){return e[Pn]===Pn}function In(e){return`no more attribute bindings (template defines ${e})`}function _n(e){return`no more content bindings (template defines ${e})`}function Vn(e,t){return function(e,t){return`Hydration mismatch in <${e}>${t?`: ${t}`:""}. Install hydrationDebugger() from "@lushly-dev/fast-element/hydration.js" and pass it as enableHydration({ debugger: hydrationDebugger() }) for an "Expected / Received" report including the SSR HTML snippet.`}((null!=e?e:"unknown").toLowerCase(),t)}let Ln={formatBindingMismatch:(e,t,n,i)=>({message:Vn(i,void 0)}),formatStructuralError:(e,t,n)=>({message:Vn(t,n)})};function Dn(){return Ln}function Hn(e){var t;if(!e)return;return null===(t=e.getRootNode().host)||void 0===t?void 0:t.nodeName}class zn extends Error{constructor(e,t,n,i,s){super(e),this.factories=t,this.node=n,this.expected=i,this.received=s}}function Fn(e){return e.nodeType===Node.COMMENT_NODE}function Un(e){return e.nodeType===Node.TEXT_NODE}function Wn(e,t){const n=document.createRange();return n.setStart(e,0),n.setEnd(t,Fn(t)||Un(t)?t.data.length:t.childNodes.length),n}function qn(e,t,n,i,s,r){const o=[];let a=t.nextSibling();if(e.data="",null===a){const t="content following `\x3c!--fe:b--\x3e` content binding marker",n=Dn().formatStructuralError(e,Hn(e),t);throw new zn(n.message,i,e,n.expected,n.received)}const l=a;let c=0;for(;null!==a;){if(Fn(a))if(En.isContentBindingStartMarker(a.data))c++;else if(En.isContentBindingEndMarker(a.data)){if(0===c)break;c--}o.push(a),a=t.nextSibling()}if(null===a){const t="matching `\x3c!--fe:/b--\x3e` content binding close marker",n=Dn().formatStructuralError(e,Hn(e),t);throw new zn(n.message,i,e,n.expected,n.received)}if(a.data="",1===o.length&&Un(o[0]))Jn(n,o[0],s);else{a!==l&&null!==a.previousSibling&&(r[n.targetNodeId]={first:l,last:a.previousSibling});Jn(n,a.parentNode.insertBefore(document.createTextNode(""),a),s)}}function Qn(e,t,n){let i=0,s=e.nextSibling();for(;null!==s;){if(Fn(s))if(En.isElementBoundaryStartMarker(s))s.data="",i++;else if(En.isElementBoundaryEndMarker(s)){if(0===i)return void(s.data="");s.data="",i--}s=e.nextSibling()}const r=Dn().formatStructuralError(n,Hn(n),"matching `\x3c!--fe:/e--\x3e` element boundary close marker");throw new zn(r.message,t,n,r.expected,r.received)}function Jn(e,t,n){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");n[e.targetNodeId]=t}function Kn(e,t){const n=t._scope;return void 0===n?e.create():e.create(void 0,n)}function Xn(e,t){const n=e.parentNode;let i,s=e;for(;s!==t;){if(i=s.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);n.removeChild(s),s=i}n.removeChild(t)}class Gn{constructor(){this.index=0,this.length=0}get event(){return X.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 Yn extends Gn{constructor(e,t,n,i){super(),this.fragment=e,this.factories=t,this.targets=n,this._scope=i,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=q.unknown,this._skipAttrUpdates=!1,this.isPrerendered=Promise.resolve(!1),this.isHydrated=Promise.resolve(!1),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 i,s=this.firstChild;for(;s!==t;)i=s.nextSibling,n.insertBefore(s,e),s=i;n.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let n,i=this.firstChild;for(;i!==t;)n=i.nextSibling,e.appendChild(i),i=n;e.appendChild(t)}dispose(){Xn(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e&&this.context===t)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t,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].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){Xn(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,n=e.length;t<n;++t)e[t].unbind()}}}var Zn;d(Yn),Q.defineProperty(Yn.prototype,"index"),Q.defineProperty(Yn.prototype,"length");const ei="unhydrated",ti="hydrating",ni="hydrated";class ii extends Error{constructor(e,t,n,i,s,r){super(e),this.factory=t,this.fragment=n,this.templateString=i,this.expected=s,this.received=r}}Zn=Pn,d(class extends Gn{get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}constructor(e,t,n,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=n,this.hostBindingTarget=i,this[Zn]=Pn,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=q.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=ei,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 i,s=this.firstChild;for(;s!==t;)i=s.nextSibling,n.insertBefore(s,e),s=i;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,i=this.firstChild;for(;i!==t;){if(n=i.nextSibling,!n)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=n}e.appendChild(t)}bind(e,t=this){if(this.source===e&&this.context===t)return;this.hydrationStage!==ni&&(this._hydrationStage=ti);let n=this.behaviors;if(null===n){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,n){const i=Wn(e,t),s=i.commonAncestorContainer,r=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===i.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={},l=function(e){let t=0;for(let n=0,i=e.length;n<i&&"h"===e[n].targetNodeId;++n)t++;return t}(n);let c=l,d=r.currentNode=e;for(;null!==d;){switch(d.nodeType){case Node.ELEMENT_NODE:{const e=d,t=En.parseLegacyAttributeBindingIndices(e);if(null!==t){for(const i of t){const t=i+l,s=n[t];if(!s){const t=In(n.length),i=Dn().formatStructuralError(d,Hn(d),t);throw new zn(i.message,n,e,i.expected,i.received)}Jn(s,d,o),c=Math.max(c,t+1)}En.removeLegacyAttributeBindingMarkers(e);break}const i=En.parseAttributeBindingCount(e);if(null!==i){for(let e=0;e<i;e++){const e=n[c++];if(!e){const e=In(n.length),t=Dn().formatStructuralError(d,Hn(d),e);throw new zn(t.message,n,d,t.expected,t.received)}Jn(e,d,o)}e.removeAttribute(En.attributeMarkerName)}break}case Node.COMMENT_NODE:{const e=d.data;if(En.isElementBoundaryStartMarker(d))d.data="",Qn(r,n,d);else if(En.isContentBindingStartMarker(e)){const t=En.parseLegacyContentBindingStartIndex(e),i=null===t?c++:t+l,s=n[i];if(c=Math.max(c,i+1),!s){const e=_n(n.length),t=Dn().formatStructuralError(d,Hn(d),e);throw new zn(t.message,n,d,t.expected,t.received)}qn(d,r,s,n,o,a)}break}}d=r.nextNode()}return i.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof zn){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&&Jn(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const n=Wn(this.firstChild,this.lastChild).cloneContents(),i=Dn().formatBindingMismatch(t,this.firstChild,this.lastChild,Hn(this.firstChild));throw new ii(i.message,t,n,e,i.expected,i.received)}{const i=t.createBehavior();i.bind(this),n[e]=i}}}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=ni}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){Xn(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 si={[h.attribute]:b.setAttribute,[h.booleanAttribute]:b.setBooleanAttribute,[h.property]:(e,t,n)=>e[t]=n,[h.content]:function(e,t,n,i){if(null==n&&(n=""),function(e){return void 0!==e.create}(n)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Rn(i)&&Rn(n)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==ni){const e=i.bindingViewBoundaries[this.targetNodeId];t=n.hydrate(e.first,e.last)}else t=Kn(n,i);else e.$fastTemplate!==n&&(t.isComposed&&(t.remove(),t.unbind()),t=Kn(n,i));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=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}},[h.tokenList]:function(e,t,n){var i;const s=`${this.id}-t`,r=null!==(i=e[s])&&void 0!==i?i:e[s]={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)}},[h.event]:()=>{}};class ri{constructor(e){this.updateTarget=null,this.aspectType=h.content,this.dataBinding=e}createHTML(e){return gn.interpolation(e(this))}createBehavior(){var t;if(null===this.updateTarget){const n=si[this.aspectType],i=null!==(t=this.dataBinding.policy)&&void 0!==t?t:this.policy;if(!n)throw r.error(e.unsupportedBindingBehavior);this.data=`${this.id}-d`,this.updateTarget=i.protect(this.targetTagName,this.aspectType,this.targetAspect,n)}return this}bind(e){var t;const n=e.targets[this.targetNodeId];switch(this.aspectType){case h.event:n[this.data]=e,n.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case h.content:e.onUnbind(this);default:{const i=null!==(t=n[this.data])&&void 0!==t?t:n[this.data]=this.dataBinding.createObserver(this,this);i.target=n,i.controller=e;const s=i.bind(e);if(e._skipAttrUpdates&&(this.aspectType===h.attribute||this.aspectType===h.booleanAttribute))break;this.updateTarget(n,this.targetAspect,s,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){X.setEvent(e);const n=this.dataBinding.evaluate(t.source,t.context);X.setEvent(null),!0!==n&&e.preventDefault()}}handleChange(e,t){const n=t.controller;if(!n.isBound)return;const i=t.target;this.updateTarget(i,this.targetAspect,t.bind(n),n)}}mn.define(ri,{aspected:!0});const oi=(e,t)=>`${e}.${t}`,ai={},li={index:0,node:null};function ci(t){t.startsWith("fast-")||r.warn(e.hostBindingWithoutHost,{name:t})}const di=new Proxy(document.createElement("div"),{get(e,n){ci(n);const i=Reflect.get(e,n);return t(i)?i.bind(e):i},set:(e,t,n)=>(ci(t),Reflect.set(e,t,n))});class hi{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,i,s){var r,o;this.nodeIds.has(n)||(this.nodeIds.add(n),this.addTargetDescriptor(t,n,i)),e.id=null!==(r=e.id)&&void 0!==r?r:pn(),e.targetNodeId=n,e.targetTagName=s,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 i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),n=e.substring(0,t),i=parseInt(e.substring(t+1),10);this.addTargetDescriptor(n,e,i)}let s=ai[t];if(!s){const i=`_${t}`;ai[t]=s={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[n]}}}i[t]=s}createView(e,t){const n=void 0===t?this.fragment.cloneNode(!0):function(e,t){var n;const i=t,s=null!==(n=i.customElementRegistry)&&void 0!==n?n:i.registry;if(s){if(s!==globalThis.customElements&&"function"==typeof s.initialize)return document.importNode(function(e){let t=fi.get(e);void 0===t&&(null!=ui||(ui=document.implementation.createHTMLDocument("")),t=e.cloneNode(!0),ui.adoptNode(t),fi.set(e,t));return t}(e),{selfOnly:!1,customElementRegistry:s});if("function"==typeof i.importNode)return i.importNode(e,!0)}return e.cloneNode(!0)}(this.fragment,t),i=Object.create(this.proto);i.r=n,i.h=null!=e?e:di;for(const e of this.nodeIds)Reflect.get(i,e);return new Yn(n,this.factories,i,t)}}let ui;const fi=new WeakMap;function pi(e,t,n,i,s,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=bn.parse(h,a);let f=null;null===u?r&&(f=new ri(P(()=>h,e.policy)),mn.assignAspect(f,d.name)):f=mi.aggregate(u,e.policy),null!==f&&(n.removeAttributeNode(d),l--,c--,e.addFactory(f,t,i,s,n.tagName))}}function gi(e,t,n){let i=0,s=t.firstChild;for(;s;){const t=bi(e,n,s,i);s=t.node,i=t.index}}function bi(e,t,i,s){const r=oi(t,s);switch(i.nodeType){case 1:pi(e,t,i,r,s),gi(e,i,r);break;case 3:return function(e,t,i,s,r){const o=bn.parse(t.textContent,e.directives);if(null===o)return li.node=t.nextSibling,li.index=r+1,li;let a,l=a=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(r++,s=oi(i,r),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),n(c)?a.textContent=c:(a.textContent=" ",mn.assignAspect(c),e.addFactory(c,i,s,r,null)),l=a}return li.index=r+1,li.node=l.nextSibling,li}(e,i,t,r,s);case 8:{const n=bn.parse(i.data,e.directives);null!==n&&e.addFactory(mi.aggregate(n),t,r,s,null);break}}return li.index=s+1,li.node=i.nextSibling,li}const vi="TEMPLATE",mi={compile(e,t,i=b.policy){let s;if(n(e)){s=document.createElement(vi),s.innerHTML=i.createHTML(e);const t=s.content.firstElementChild;null!==t&&t.tagName===vi&&(s=t)}else s=e;s.content.firstChild||s.content.lastChild||s.content.appendChild(document.createComment(""));const r=document.adoptNode(s.content),o=new hi(r,t,i);var a,l;return pi(o,"",s,"h",0,!0),a=r.firstChild,l=t,(a&&8===a.nodeType&&null!==bn.parse(a.data,l)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),gi(o,r,"r"),li.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=b.policy){if(1===e.length)return e[0];let i,s,r=!1;const o=e.length,a=e.map(e=>n(e)?()=>e:(i=e.sourceAspect||i,r=r||e.dataBinding.isVolatile,s=s||e.dataBinding.policy,e.dataBinding.evaluate)),l=new ri(Y((e,t)=>{let n="";for(let i=0;i<o;++i)n+=a[i](e,t);return n},null!=s?s:t,r));return mn.assignAspect(l,i),l}};class yi extends wn{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}mn.define(yi);const wi=e=>new yi(e),Ci=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Si=Object.create(null);class Oi{constructor(e,t=Si){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const n in t)e(t[n]);return this.html}}function xi(e,t,n,i=mn.getForInstance(e)){if(i.aspected){const n=Ci.exec(t);null!==n&&mn.assignAspect(e,n[2])}return e.createHTML(n)}Oi.empty=new Oi(""),mn.define(Oi);class Ti{constructor(e,t={},n){this.policy=n,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=mi.compile(this.html,this.factories,this.policy)),this.result}inline(){return new Oi(n(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(t){if(this.result)throw r.error(e.cannotSetTemplatePolicyAfterCompilation);if(this.policy)throw r.error(e.onlySetTemplatePolicyOnce);return this.policy=t,this}render(e,t,n,i){const s=this.create(n,i);return s.bind(e),s.appendTo(t),s}create(e,t){return this.compile().createView(e,t)}static create(e,n,i){let s="";const r=Object.create(null),o=e=>{var t;const n=null!==(t=e.id)&&void 0!==t?t:e.id=pn();return r[n]=e,n};for(let i=0,r=e.length-1;i<r;++i){const r=e[i];let a,l=n[i];if(s+=r,t(l))l=new ri(Y(l));else if(l instanceof j)l=new ri(l);else if(!(a=mn.getForInstance(l))){const e=l;l=new ri(P(()=>e))}s+=xi(l,r,o,a)}return new Ti(s+e[e.length-1],r,i)}}d(Ti);const Bi=(t,...n)=>{if(Array.isArray(t)&&Array.isArray(t.raw))return Ti.create(t,n);throw r.error(e.directCallToHTMLTagNotAllowed)};Bi.partial=e=>new Oi(e);class Ni{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),Rn(this.template)&&Rn(e)&&e.hydrationStage!==ni&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];if(t)return this.view=this.template.hydrate(t.first,t.last),void this.bindView(this.view)}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=Kn(t,this.controller),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=Kn(t,this.controller),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class ki{constructor(e,t,n){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=n}createHTML(e){return gn.comment(e(this))}createBehavior(){return new Ni(this)}}mn.define(ki);const Ai=new Map,Mi=Bi`
|
|
2
|
+
|
|
3
|
+
`;function $i(e){return void 0===e?Mi:e.template}function ji(e,t){const i=e.evaluate,s=Object.create(Object.getPrototypeOf(e));for(const t of Object.getOwnPropertyNames(e))"evaluate"!==t&&Object.defineProperty(s,t,Object.getOwnPropertyDescriptor(e,t));return Object.defineProperty(s,"evaluate",{configurable:!0,enumerable:!0,value:(e,s)=>function(e,t,i,s){var r;return n(e)?$i(Ei(t.evaluate(i,s),e)):e instanceof Node?null!==(r=e.$fastTemplate)&&void 0!==r?r:new Pi(e):e}(i(e,s),t,e,s),writable:!0}),s}function Ei(e,t){if(e)return function(e,t){const n=Ai.get(e);if(void 0!==n)return n[null!=t?t:"default-view"]}(e.constructor,t)}class Pi{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 Ri(e,i){let s,r;s=void 0===e?P(e=>e):ee(e);let o=!1;return void 0===i?(o=!0,r=P((e,t)=>{var n;const i=s.evaluate(e,t);return i instanceof Node?null!==(n=i.$fastTemplate)&&void 0!==n?n:new Pi(i):$i(Ei(i))})):t(i)?r=Y((e,t)=>{var r;let o=i(e,t);return n(o)?o=$i(Ei(s.evaluate(e,t),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new Pi(o)),o},void 0,!0):n(i)?(o=!0,r=P((e,t)=>{var n;const r=s.evaluate(e,t);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new Pi(r):$i(Ei(r,i))})):r=i instanceof j?ji(i,s):P((e,t)=>i),new ki(s,r,o)}const Ii=Object.freeze({positioning:!1,recycle:!0});function _i(e,t,n,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[n])}function Vi(e,t,n,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=n,e.bind(t[n])}function Li(e){return e.nodeType===Node.COMMENT_NODE}function Di(e,t){const n=e.parentNode;if(null===n)return;let i=e;for(;null!==i;){const e=i.nextSibling;if(n.removeChild(i),i===t)break;i=e}}class Hi extends Error{constructor(e,t){super(e),this.propertyBag=t}}class zi{constructor(e){this.directive=e,this.isBound=!1,this.items=null,this.itemsObserver=null,this.bindView=_i,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=Vi)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.isBound=!0,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Rn(this.template)&&Rn(e)&&e.hydrationStage!==ni?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){this.isBound=!1,null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(this.isBound)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=a);const t=this.itemsObserver,n=this.itemsObserver=Q.getNotifier(this.items),i=t!==n;i&&null!==t&&t.unsubscribe(this),(i||e)&&n.subscribe(this)}updateSortedViews(e){const t=this.views;for(let n=0,i=e.length;n<i;++n){const i=e[n].sorted.slice(),s=i.slice().sort();for(let e=0,n=i.length;e<n;++e){const n=i.find(t=>i[e]===s[t]);if(n!==e){const i=s.splice(n,1);s.splice(e,0,...i);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,i=this.items,s=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=Kn(s,r),t.splice(p,0,h),n(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,n=t.length;e<n;++e){const i=t[e].context;i.length=n,i.index=e}}refreshAllViews(e=!1){const t=this.items,n=this.template,i=this.location,s=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(Yn.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=Kn(n,r);s(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 Hi(`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())})}s(i,t,e,r)}else{const o=Kn(n,r);s(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,n=e.length;t<n;++t){const n=e[t];if(!n){const n=new XMLSerializer;throw new Hi(`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){var t;if(!this.items)return;const n=this.items,i=n.length,s=this.views=new Array(i),r=[];let o=this.location.previousSibling;for(;null!==o;){if(!Li(o)||!En.isRepeatViewEndMarker(o.data)){o=o.previousSibling;continue}const e=o;e.data="";const n=e.previousSibling;if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let i=n,s=0;for(;null!==i;){if(Li(i))if(En.isRepeatViewEndMarker(i.data))s++;else if(En.isRepeatViewStartMarker(i.data)){if(0===s){const s=i;s.data="",o=s.previousSibling;const a=null!==(t=s.nextSibling)&&void 0!==t?t:e,l=n===s?a:n;r.push({start:a,end:l,startMarker:s,endMarker:e});break}s--}i=i.previousSibling}if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": repeat start marker not found.`)}r.reverse();const a=Math.min(r.length,i);for(let t=0;t<a;t++){const{start:i,end:o}=r[t],a=e.hydrate(i,o);s[t]=a,this.bindView(a,n,t,this.controller)}for(let t=a;t<i;t++){const i=Kn(e,this.controller);s[t]=i,this.bindView(i,n,t,this.controller),i.insertBefore(this.location)}for(let e=i,t=r.length;e<t;e++){const{startMarker:t,endMarker:n}=r[e];Di(t,n)}}}class Fi{createHTML(e){return gn.comment(e(this))}constructor(e,t,n){this.dataBinding=e,this.templateBinding=t,this.options=n,Rt.enable()}createBehavior(){return new zi(this)}}function Ui(e,t,n=Ii){const i=ee(e),s=ee(t);return new Fi(i,s,Object.assign(Object.assign({},Ii),n))}mn.define(Fi);const Wi="slotchange";class qi extends On{observe(e){e.addEventListener(Wi,this)}disconnect(e){e.removeEventListener(Wi,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Qi(e){return n(e)&&(e={property:e}),new qi(e)}mn.define(qi);const Ji=()=>null;function Ki(e){return void 0===e?Ji:t(e)?e:()=>e}function Xi(e,n,i){const s=t(e)?e:()=>e,r=Ki(n),o=Ki(i);return(e,t)=>s(e,t)?r(e,t):o(e,t)}function Gi(e){const t=e.parentElement;if(t)return t;{const t=e.getRootNode();if(t.host instanceof HTMLElement)return t.host}return null}function Yi(e,t){let n=t;for(;null!==n;){if(n===e)return!0;n=Gi(n)}return!1}class Zi 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 es=Object.freeze({create(e){const t=[],n={};let i=null,s=!1;return{source:e,context:X.default,targets:n,get isBound(){return s},addBehaviorFactory(e,t){var n,i,s,r;const o=e;o.id=null!==(n=o.id)&&void 0!==n?n:pn(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:pn(),o.targetTagName=null!==(s=t.tagName)&&void 0!==s?s:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:b.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){n[e]=t},addBehavior(e){t.push(e),s&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){s||(s=!0,t.forEach(e=>e.bind(this)))},disconnectedCallback(e){s&&(s=!1,null!==i&&i.forEach(e=>e.unbind(this)))}}}});b.setPolicy($.create());export{Rt as ArrayObserver,pe as AttributeConfiguration,ye as AttributeDefinition,j as Binding,sn as CSSDirective,xn as ChildrenDirective,mi as Compiler,b as DOM,h as DOMAspect,$ as DOMPolicy,Gn as DefaultExecutionContext,it as ElementController,Oe as ElementStyles,X as ExecutionContext,r as FAST,ft as FASTElement,Qe as FASTElementDefinition,ri as HTMLBindingDirective,mn as HTMLDirective,Yn as HTMLView,Oi as InlineTemplateDirective,gn as Markup,On as NodeObservationDirective,Q as Observable,bn as Parser,I as PropertyChangeNotifier,yi as RefDirective,Ni as RenderBehavior,ki as RenderDirective,zi as RepeatBehavior,Fi as RepeatDirective,Ut as Schema,ne as Signal,qi as SlottedDirective,St as Sort,q as SourceLifetime,Ct as Splice,$t as SpliceStrategy,Ot as SpliceStrategySupport,nt as Stages,wn as StatelessAttachedAttributeDirective,R as SubscriberSet,le as TwoWaySettings,Zi as UnobservableMutationObserver,W as Updates,es as ViewBehaviorOrchestrator,Ti as ViewTemplate,we as attr,ge as booleanConverter,Tn as children,Yi as composedContains,Gi as composedParent,Yt as computedState,an as css,rn as cssDirective,pt as customElement,Sn as elements,a as emptyArray,wt as enableDebug,$e as fastElementRegistry,Bi as html,yn as htmlDirective,It as lengthOf,Z as listener,ee as normalizeBinding,be as nullableBooleanConverter,me as nullableNumberConverter,J as observable,P as oneTime,Y as oneWay,Gt as ownedState,Jt as reactive,wi as ref,Ri as render,Ui as repeat,Ft as schemaRegistry,re as signal,Qi as slotted,_t as sortedCount,Xt as state,he as twoWay,Vt as volatile,tn as watch,Xi as when};
|