@microsoft/fast-element 2.7.0 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +31 -1
- package/CHANGELOG.md +18 -2
- package/dist/dts/components/element-controller.d.ts +56 -0
- package/dist/dts/components/fast-definitions.d.ts +31 -2
- package/dist/dts/index.d.ts +2 -2
- package/dist/esm/components/element-controller.js +98 -14
- package/dist/esm/components/fast-definitions.js +17 -12
- package/dist/esm/index.js +1 -1
- package/dist/esm/polyfills.js +33 -0
- package/dist/esm/templating/view.js +23 -2
- package/dist/fast-element.api.json +431 -2
- package/dist/fast-element.debug.js +171 -28
- package/dist/fast-element.debug.min.js +2 -2
- package/dist/fast-element.js +171 -28
- package/dist/fast-element.min.js +2 -2
- package/dist/fast-element.untrimmed.d.ts +90 -2
- package/docs/api-report.api.md +23 -1
- package/package.json +1 -1
package/dist/fast-element.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
let e;const t="fast-kernel";try{if(document.currentScript)e=document.currentScript.getAttribute(t);else{const s=document.getElementsByTagName("script");e=s[s.length-1].getAttribute(t)}}catch(t){e="isolate"}let s;switch(e){case"share":s=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":s=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;s=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const i=e=>"function"==typeof e,n=e=>"string"==typeof e,r=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}();const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const a=globalThis.FAST;if(void 0===a.getById){const e=Object.create(null);Reflect.defineProperty(a,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},o))}void 0===a.error&&Object.assign(a,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const l=Object.freeze([]);function c(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function h(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function d(e){e.prototype.toJSON=r}const u=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),f=e=>e,p=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:f}):{createHTML:f};let g=Object.freeze({createHTML:e=>p.createHTML(e),protect:(e,t,s,i)=>i});const b=g,v=Object.freeze({get policy(){return g},setPolicy(e){if(g!==b)throw a.error(1201);g=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function m(e,t,s,i){return(e,t,s,...r)=>{n(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...r)}}function y(e,t,s,i){throw a.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const w={onabort:y,onauxclick:y,onbeforeinput:y,onbeforematch:y,onblur:y,oncancel:y,oncanplay:y,oncanplaythrough:y,onchange:y,onclick:y,onclose:y,oncontextlost:y,oncontextmenu:y,oncontextrestored:y,oncopy:y,oncuechange:y,oncut:y,ondblclick:y,ondrag:y,ondragend:y,ondragenter:y,ondragleave:y,ondragover:y,ondragstart:y,ondrop:y,ondurationchange:y,onemptied:y,onended:y,onerror:y,onfocus:y,onformdata:y,oninput:y,oninvalid:y,onkeydown:y,onkeypress:y,onkeyup:y,onload:y,onloadeddata:y,onloadedmetadata:y,onloadstart:y,onmousedown:y,onmouseenter:y,onmouseleave:y,onmousemove:y,onmouseout:y,onmouseover:y,onmouseup:y,onpaste:y,onpause:y,onplay:y,onplaying:y,onprogress:y,onratechange:y,onreset:y,onresize:y,onscroll:y,onsecuritypolicyviolation:y,onseeked:y,onseeking:y,onselect:y,onslotchange:y,onstalled:y,onsubmit:y,onsuspend:y,ontimeupdate:y,ontoggle:y,onvolumechange:y,onwaiting:y,onwebkitanimationend:y,onwebkitanimationiteration:y,onwebkitanimationstart:y,onwebkittransitionend:y,onwheel:y},S={elements:{a:{[u.attribute]:{href:m},[u.property]:{href:m}},area:{[u.attribute]:{href:m},[u.property]:{href:m}},button:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},embed:{[u.attribute]:{src:y},[u.property]:{src:y}},form:{[u.attribute]:{action:m},[u.property]:{action:m}},frame:{[u.attribute]:{src:m},[u.property]:{src:m}},iframe:{[u.attribute]:{src:m},[u.property]:{src:m,srcdoc:y}},input:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},link:{[u.attribute]:{href:y},[u.property]:{href:y}},object:{[u.attribute]:{codebase:y,data:y},[u.property]:{codeBase:y,data:y}},script:{[u.attribute]:{src:y,text:y},[u.property]:{src:y,text:y,innerText:y,textContent:y}},style:{[u.property]:{innerText:y,textContent:y}}},aspects:{[u.attribute]:Object.assign({},w),[u.property]:Object.assign({innerHTML:y},w),[u.event]:Object.assign({},w)}};function C(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=r;break;default:s[i]=n}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function x(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=C(r,{});break;default:s[i]=C(n,r)}}for(const t in e)t in s||(s[t]=C(e[t],{}));return Object.freeze(s)}function B(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=x(n,{});break;default:s[i]=x(n,r)}}for(const t in e)t in s||(s[t]=x(e[t],{}));return Object.freeze(s)}function O(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const $=Object.freeze({create(e={}){var t,s;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),n=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=S,Object.freeze({elements:r.elements?B(r.elements,o.elements):o.elements,aspects:r.aspects?x(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,s,i){var r;const o=(null!=e?e:"").toLowerCase(),a=n.elements[o];if(a){const n=O(a,e,t,s,i);if(n)return n}return null!==(r=O(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),T=a.getById(s.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>i=e})}));class N{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class k{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new N(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new N(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const A=Object.freeze({unknown:void 0,coupled:1}),E=a.getById(s.observable,(()=>{const e=T.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let r,o=e=>{throw a.error(1101)};function l(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=o(e):s.set(e,i=new k(e))),i}const c=h();class u{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==r&&r.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,n=e[s];if(n!==t){e[s]=t;const r=e[this.callback];i(r)&&r.call(e,n,t),l(e).notify(this.name)}}}class f extends N{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==A.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=r;let i;r=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{r=s}return i}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,i=l(e),n=null===s?this.first:{};if(n.propertySource=e,n.propertyName=t,n.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;r=void 0,t=s.propertySource[s.propertyName],r=this,e===t&&(this.needsRefresh=!0)}s.next=n}this.last=n}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return d(f),Object.freeze({setArrayObserverFactory(e){o=e},getNotifier:l,track(e,t){r&&r.watch(e,t)},trackVolatile(){r&&(r.needsRefresh=!0)},notify(e,t){l(e).notify(t)},defineProperty(e,t){n(t)&&(t=new u(t)),c(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:c,binding(e,t,s=this.isVolatileBinding(e)){return new f(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function M(e,t){E.defineProperty(e,t)}function j(e,t,s){return Object.assign({},s,{get(){return E.trackVolatile(),s.get.apply(this)}})}const V=a.getById(s.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),R=Object.freeze({default:{index:0,length:0,get event(){return R.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>V.get(),setEvent(e){V.set(e)}});class _{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class I{constructor(e){this.sorted=e}}const z=Object.freeze({reset:1,splice:2,optimized:3}),L=new _(0,l,0);L.reset=!0;const F=[L];function P(e,t,s,i,n,r){let o=0,a=0;const c=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,c)),s===e.length&&r===i.length&&(a=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,c-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return l;if(t===s){const e=new _(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new _(t,[],s-t)];const h=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):l===o?(n.push(3),t--,i=o):(n.push(2),s--,i=a)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,a=s-t+1,l=new Array(o);let c,h;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===i[n+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,h=l[s][r-1]+1,l[s][r]=c<h?c:h);return l}(e,t,s,i,n,r)),d=[];let u,f=t,p=n;for(let e=0;e<h.length;++e)switch(h[e]){case 0:void 0!==u&&(d.push(u),u=void 0),f++,p++;break;case 1:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new _(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&d.push(u),d}function H(e,t){let s=!1,i=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=i,s)continue;const h=(n=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<n?-1:r===o||a===n?0:n<o?r<a?r-o:a-o:a<r?a-n:r-n);if(h>=0){t.splice(l,1),l--,i-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-h;const n=e.removed.length+c.removed.length-h;if(e.addedCount||n){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,a;s||t.push(e)}let D=Object.freeze({support:z.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?l:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)H(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(P(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):F,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new _(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new _(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new I(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new _(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new I(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new _(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new _(0,[],i.length).adjustTo(e)),n}});const U=Object.freeze({reset:F,setDefaultStrategy(e){D=e}});function Q(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}class q extends N{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,Q(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,E.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,E.notify(e,"sorted"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:D).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,T.enqueue(this))}}let W=!1;const X=Object.freeze({sorted:0,enable(){if(W)return;W=!0,E.setArrayObserverFactory((e=>new q(e)));const e=Array.prototype;e.$fastPatch||(Q(e,"$fastPatch",1),Q(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:D)[t.name](this,i,t,e)}})))}});function J(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=E.getNotifier(e)),E.track(t.lengthObserver,"length"),e.length}function G(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=E.getNotifier(e)),E.track(t.sortObserver,"sorted"),e.sorted}class K{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class Y extends K{createObserver(e){return E.binding(this.evaluate,e,this.isVolatile)}}function Z(e,t,s=E.isVolatileBinding(e)){return new Y(e,t,s)}function ee(e,t){const s=new Y(e);return s.options=t,s}class te extends K{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function se(e,t){return new te(e,t)}function ie(e){return i(e)?Z(e):e instanceof K?e:se((()=>e))}let ne;function re(e){return e.map((e=>e instanceof oe?re(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}d(te);class oe{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof oe?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(ne),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(re(this.styles)),this}static setDefaultStrategy(e){ne=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new oe(e):e instanceof oe?e:new oe([e])}}oe.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const ae=c(),le=Object.freeze({getForInstance:ae.getForInstance,getByType:ae.getByType,define:e=>(ae.register({type:e}),e)});function ce(){return function(e){le.define(e)}}function he(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class de{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,i)=>{e.call(s,t,i),"style"===t&&s.$cssBindings.forEach(((e,t)=>he(t,e.controller,e.observer)))}}const i=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);i.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:i})}connectedCallback(e){he(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){he(this,t.controller,t)}}le.define(de);const ue=`${Math.random().toString(36).substring(2,8)}`;let fe=0;const pe=()=>`--v${ue}${++fe}`;function ge(e,t){const s=[];let n="";const r=[],o=e=>{r.push(e)};for(let r=0,a=e.length-1;r<a;++r){n+=e[r];let a=t[r];i(a)?a=new de(Z(a),pe()).createCSS(o):a instanceof K?a=new de(a,pe()).createCSS(o):void 0!==le.getForInstance(a)&&(a=a.createCSS(o)),a instanceof oe||a instanceof CSSStyleSheet?(""!==n.trim()&&(s.push(n),n=""),s.push(a)):n+=a}return n+=e[e.length-1],""!==n.trim()&&s.push(n),{styles:s,behaviors:r}}const be=(e,...t)=>{const{styles:s,behaviors:i}=ge(e,t),n=new oe(s);return i.length?n.withBehaviors(...i):n};class ve{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(n(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new oe(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}le.define(ve),be.partial=(e,...t)=>{const{styles:s,behaviors:i}=ge(e,t);return new ve(s,i)};const me=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,ye=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,we=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Se=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Ce=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,xe=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Be(e){return e&&e.nodeType===Node.COMMENT_NODE}const Oe=Object.freeze({attributeMarkerName:"data-fe-b",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>me.test(e),isContentBindingEndMarker:e=>ye.test(e),isRepeatViewStartMarker:e=>we.test(e),isRepeatViewEndMarker:e=>Se.test(e),isElementBoundaryStartMarker:e=>Be(e)&&Ce.test(e.data.trim()),isElementBoundaryEndMarker:e=>Be(e)&&xe.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[],s=this.attributeMarkerName.length+1,i=`${this.attributeMarkerName}-`;for(const n of e.getAttributeNames())if(n.startsWith(i)){const e=Number(n.slice(s));if(Number.isNaN(e))throw new Error(`Invalid attribute marker name: ${n}. Expected format is ${i}<number>.`);t.push(e)}return 0===t.length?null:t},parseContentBindingStartMarker:e=>Ne(me,e),parseContentBindingEndMarker:e=>Ne(ye,e),parseRepeatStartMarker:e=>$e(we,e),parseRepeatEndMarker:e=>$e(Se,e),parseElementBoundaryStartMarker:e=>Te(Ce,e.trim()),parseElementBoundaryEndMarker:e=>Te(xe,e)});function $e(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Te(e,t){const s=e.exec(t);return null===s?s:s[1]}function Ne(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const ke=Symbol.for("fe-hydration");function Ae(e){return e[ke]===ke}const Ee=`fast-${Math.random().toString(36).substring(2,8)}`,Me=`${Ee}{`,je=`}${Ee}`,Ve=je.length;let Re=0;const _e=()=>`${Ee}-${++Re}`,Ie=Object.freeze({interpolation:e=>`${Me}${e}${je}`,attribute:e=>`${_e()}="${Me}${e}${je}"`,comment:e=>`\x3c!--${Me}${e}${je}--\x3e`}),ze=Object.freeze({parse(e,t){const s=e.split(Me);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(je);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+Ve)}""!==o&&i.push(o)}return i}}),Le=c(),Fe=Object.freeze({getForInstance:Le.getForInstance,getByType:Le.getByType,define:(e,t)=>((t=t||{}).type=e,Le.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?u.tokenList:u.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=u.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=u.event;break;default:e.targetAspect=t,e.aspectType=u.attribute}else e.aspectType=u.content}});function Pe(e){return function(t){Fe.define(t,e)}}class He{constructor(e){this.options=e}createHTML(e){return Ie.attribute(e(this))}createBehavior(){return this}}d(He);class De extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ue(e){return e.nodeType===Node.COMMENT_NODE}function Qe(e){return e.nodeType===Node.TEXT_NODE}function qe(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ue(t)||Qe(t)?t.data.length:t.childNodes.length),s}function We(e,t,s){var i;const n=null!==(i=Oe.parseAttributeBinding(e))&&void 0!==i?i:Oe.parseEnumeratedAttributeBinding(e);if(null!==n){for(const i of n){if(!t[i])throw new De(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);Je(t[i],e,s)}e.removeAttribute(Oe.attributeMarkerName)}}function Xe(e,t,s,i,n){if(Oe.isElementBoundaryStartMarker(e))!function(e,t){const s=Oe.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(Ue(i)){const e=Oe.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(Oe.isContentBindingStartMarker(e.data)){const r=Oe.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],c=[];let h=t.nextSibling();e.data="";const d=h;for(;null!==h;){if(Ue(h)){const e=Oe.parseContentBindingEndMarker(h.data);if(e&&e[1]===a)break}c.push(h),h=t.nextSibling()}if(null===h){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(h.data="",1===c.length&&Qe(c[0]))Je(l,c[0],i);else{h!==d&&null!==h.previousSibling&&(n[l.targetNodeId]={first:d,last:h.previousSibling});Je(l,h.parentNode.insertBefore(document.createTextNode(""),h),i)}}}function Je(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var Ge;function Ke(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;){if(i=n.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(n),n=i}s.removeChild(t)}class Ye{constructor(){this.index=0,this.length=0}get event(){return R.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 Ze extends Ye{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=A.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){Ke(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){Ke(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}d(Ze),E.defineProperty(Ze.prototype,"index"),E.defineProperty(Ze.prototype,"length");const et="unhydrated",tt="hydrating",st="hydrated";class it extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}Ge=ke,d(class extends Ye{constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[Ge]=ke,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=A.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=et,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}insertBefore(e){if(null!==this.fragment)if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,i=this.firstChild;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=s}e.appendChild(t)}bind(e,t=this){var s,i;if(this.hydrationStage!==st&&(this._hydrationStage=tt),this.source===e)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=qe(e,t),n=i.commonAncestorContainer,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===i.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={};let l=r.currentNode=e;for(;null!==l;){switch(l.nodeType){case Node.ELEMENT_NODE:We(l,s,o);break;case Node.COMMENT_NODE:Xe(l,r,s,o,a)}l=r.nextNode()}return i.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof De){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 r=this.factories;for(let e=0,t=r.length;e<t;++e){const t=r[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&Je(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;throw"string"!=typeof e&&(e=e.innerHTML),new it(`HydrationView was unable to successfully target bindings inside "${null===(i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host)||void 0===i?void 0:i.nodeName}".`,t,qe(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),n[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=n.length;e<t;++e)n[e].bind(this)}this.isBound=!0,this._hydrationStage=st}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){Ke(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}});const nt={[u.attribute]:v.setAttribute,[u.booleanAttribute]:v.setBooleanAttribute,[u.property]:(e,t,s)=>e[t]=s,[u.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Ae(i)&&Ae(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==st){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[u.tokenList]:function(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[u.event]:()=>{}};class rt{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=u.content}createHTML(e){return Ie.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=nt[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw a.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],i=Ae(e)&&e.hydrationStage&&e.hydrationStage!==st;switch(this.aspectType){case u.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case u.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(n.target=s,n.controller=e,i&&(this.aspectType===u.attribute||this.aspectType===u.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){R.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);R.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}Fe.define(rt,{aspected:!0});const ot=(e,t)=>`${e}.${t}`,at={},lt={index:0,node:null};function ct(e){e.startsWith("fast-")||a.warn(1204,{name:e})}const ht=new Proxy(document.createElement("div"),{get(e,t){ct(t);const s=Reflect.get(e,t);return i(s)?s.bind(e):s},set:(e,t,s)=>(ct(t),Reflect.set(e,t,s))});class dt{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i,n){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.id=null!==(r=e.id)&&void 0!==r?r:_e(),e.targetNodeId=s,e.targetTagName=n,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=at[t];if(!n){const i=`_${t}`;at[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:ht;for(const e of this.nodeIds)s[e];return new Ze(t,this.factories,s)}}function ut(e,t,s,i,n,r=!1){const o=s.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const h=o[l],d=h.value,u=ze.parse(d,a);let f=null;null===u?r&&(f=new rt(se((()=>d),e.policy)),Fe.assignAspect(f,h.name)):f=bt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(h),l--,c--,e.addFactory(f,t,i,n,s.tagName))}}function ft(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=pt(e,s,n,i);n=t.node,i=t.index}}function pt(e,t,s,i){const r=ot(t,i);switch(s.nodeType){case 1:ut(e,t,s,r,i),ft(e,s,r);break;case 3:return function(e,t,s,i,r){const o=ze.parse(t.textContent,e.directives);if(null===o)return lt.node=t.nextSibling,lt.index=r+1,lt;let a,l=a=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(r++,i=ot(s,r),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),n(c)?a.textContent=c:(a.textContent=" ",Fe.assignAspect(c),e.addFactory(c,s,i,r,null)),l=a}return lt.index=r+1,lt.node=l.nextSibling,lt}(e,s,t,r,i);case 8:const o=ze.parse(s.data,e.directives);null!==o&&e.addFactory(bt.aggregate(o),t,r,i,null)}return lt.index=i+1,lt.node=s.nextSibling,lt}const gt="TEMPLATE",bt={compile(e,t,s=v.policy){let i;if(n(e)){i=document.createElement(gt),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===gt&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const r=document.adoptNode(i.content),o=new dt(r,t,s);var a,l;return ut(o,"",i,"h",0,!0),a=r.firstChild,l=t,(a&&8==a.nodeType&&null!==ze.parse(a.data,l)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),ft(o,r,"r"),lt.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=v.policy){if(1===e.length)return e[0];let s,i,r=!1;const o=e.length,a=e.map((e=>n(e)?()=>e:(s=e.sourceAspect||s,r=r||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),l=new rt(Z(((e,t)=>{let s="";for(let i=0;i<o;++i)s+=a[i](e,t);return s}),null!=i?i:t,r));return Fe.assignAspect(l,s),l}},vt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,mt=Object.create(null);class yt{constructor(e,t=mt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function wt(e,t,s,i=Fe.getForInstance(e)){if(i.aspected){const s=vt.exec(t);null!==s&&Fe.assignAspect(e,s[2])}return e.createHTML(s)}yt.empty=new yt(""),Fe.define(yt);class St{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=bt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new yt(n(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw a.error(1208);if(this.policy)throw a.error(1207);return this.policy=e,this}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}static create(e,t,s){let n="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=_e();return r[s]=e,s};for(let s=0,r=e.length-1;s<r;++s){const r=e[s];let a,l=t[s];if(n+=r,i(l))l=new rt(Z(l));else if(l instanceof K)l=new rt(l);else if(!(a=Fe.getForInstance(l))){const e=l;l=new rt(se((()=>e)))}n+=wt(l,r,o,a)}return new St(n+e[e.length-1],r,s)}}d(St);const Ct=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return St.create(e,t);throw a.error(1206)};Ct.partial=e=>new yt(e);class xt extends He{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}Fe.define(xt);const Bt=e=>new xt(e),Ot=()=>null;function $t(e){return void 0===e?Ot:i(e)?e:()=>e}function Tt(e,t,s){const n=i(e)?e:()=>e,r=$t(t),o=$t(s);return(e,t)=>n(e,t)?r(e,t):o(e,t)}const Nt=Object.freeze({positioning:!1,recycle:!0});function kt(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function At(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function Et(e){return e.nodeType===Node.COMMENT_NODE}class Mt extends Error{constructor(e,t){super(e),this.propertyBag=t}}class jt{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=kt,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=At)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Ae(this.template)&&Ae(e)&&e.hydrationStage!==st?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=l);const t=this.itemsObserver,s=this.itemsObserver=E.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,i=e.length;s<i;++s){const i=e[s].sorted.slice(),n=i.slice().sort();for(let e=0,s=i.length;e<s;++e){const s=i.find((t=>i[e]===n[t]));if(s!==e){const i=n.splice(s,1);n.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let h=0,d=e.length;h<d;++h){const d=e[h],u=d.removed;let f=0,p=d.index;const g=p+d.addedCount,b=t.splice(d.index,u.length),v=c=a.length+b.length;for(;p<g;++p){const e=t[p],h=e?e.firstChild:this.location;let d;o&&c>0?(f<=v&&b.length>0?(d=b[f],f++):(d=a[l],l++),c--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(h)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(Ze.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),a[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<l){const i=a[e];if(!i){const t=new XMLSerializer;throw new Mt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}n(i,t,e,r)}else{const o=s.create();n(o,t,e,r),a.push(o),o.insertBefore(i)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new Mt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:s.serializeToString(this.location.getRootNode())})}s.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!Et(t)){t=t.previousSibling;continue}const s=Oe.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const i=t.previousSibling;if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=i,r=0;for(;null!==n;){if(Et(n))if(Oe.isRepeatViewEndMarker(n.data))r++;else if(Oe.isRepeatViewStartMarker(n.data)){if(!r){if(Oe.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const r=e.hydrate(n,i);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class Vt{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,X.enable()}createHTML(e){return Ie.comment(e(this))}createBehavior(){return new jt(this)}}function Rt(e,t,s=Nt){const i=ie(e),n=ie(t);return new Vt(i,n,Object.assign(Object.assign({},Nt),s))}Fe.define(Vt);const _t=e=>1===e.nodeType,It=e=>e?t=>1===t.nodeType&&t.matches(e):_t;class zt extends He{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,l),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const Lt="slotchange";class Ft extends zt{observe(e){e.addEventListener(Lt,this)}disconnect(e){e.removeEventListener(Lt,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Pt(e){return n(e)&&(e={property:e}),new Ft(e)}Fe.define(Ft);class Ht extends zt{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=r,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Dt(e){return n(e)&&(e={property:e}),new Ht(e)}function Ut(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))}Fe.define(Ht),"function"==typeof SuppressedError&&SuppressedError;const Qt="boolean",qt="reflect",Wt=Object.freeze({locate:h()}),Xt={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Jt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Xt.fromView(e)};function Gt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Kt={toView(e){const t=Gt(e);return t?t.toString():t},fromView:Gt};class Yt{constructor(e,t,s=t.toLowerCase(),i=qt,n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i===Qt&&void 0===n&&(this.converter=Xt)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return E.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||T.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case qt:const t=this.converter;v.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case Qt:v.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(Wt.locate(e));for(let i=0,r=t.length;i<r;++i){const r=t[i];if(void 0!==r)for(let t=0,i=r.length;t<i;++t){const i=r[t];n(i)?s.push(new Yt(e,i)):s.push(new Yt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function Zt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),Wt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const es={mode:"open"},ts={},ss=new Set,is=a.getById(s.elementRegistry,(()=>c()));class ns{constructor(e,t=e.definition){var s;this.platformDefined=!1,n(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.templateOptions=t.templateOptions,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,r=Yt.collect(e,t.attributes),o=new Array(r.length),a={},l={};for(let e=0,t=r.length;e<t;++e){const t=r[e];o[e]=t.attribute,a[t.name]=t,l[t.attribute]=t,E.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=r,this.propertyLookup=a,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?es:null===t.shadowOptions?void 0:Object.assign(Object.assign({},es),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?ts:Object.assign(Object.assign({},ts),t.elementOptions),this.styles=oe.normalize(t.styles),is.register(this),E.defineProperty(ns.isRegistered,this.name),ns.isRegistered[this.name]=this.type}get isDefined(){return this.platformDefined}define(e=this.registry){const t=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,t,this.elementOptions)),this}static compose(e,t){return ss.has(e)||is.getByType(e)?new ns(class extends e{},t):new ns(e,t)}static registerBaseType(e){ss.add(e)}static composeAsync(e,t){return new Promise((s=>{(ss.has(e)||is.getByType(e))&&s(new ns(class extends e{},t));const i=new ns(e,t);Promise.all([new Promise((e=>{E.getNotifier(i).subscribe({handleChange:()=>e()},"template")}))]).then((()=>{s(i)}))}))}}ns.isRegistered={},ns.getByType=is.getByType,ns.getForInstance=is.getForInstance,ns.registerAsync=e=>Ut(void 0,void 0,void 0,(function*(){return new Promise((t=>{ns.isRegistered[e]&&t(ns.isRegistered[e]),E.getNotifier(ns.isRegistered).subscribe({handleChange:()=>t(ns.isRegistered[e])},e)}))})),E.defineProperty(ns.prototype,"template");class rs{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Ae(this.template)&&Ae(e)&&e.hydrationStage!==st&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class os{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Ie.comment(e(this))}createBehavior(){return new rs(this)}}Fe.define(os);const as=new Map,ls={":model":e=>e},cs=Symbol("RenderInstruction"),hs="default-view",ds=Ct`
|
|
1
|
+
let e;const t="fast-kernel";try{if(document.currentScript)e=document.currentScript.getAttribute(t);else{const s=document.getElementsByTagName("script");e=s[s.length-1].getAttribute(t)}}catch(t){e="isolate"}let s;switch(e){case"share":s=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":s=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;s=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const i=e=>"function"==typeof e,n=e=>"string"==typeof e,r=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}(),"requestIdleCallback"in globalThis||(globalThis.requestIdleCallback=function(e,t){const s=Date.now();return setTimeout((()=>{e({didTimeout:!!(null==t?void 0:t.timeout)&&Date.now()-s>=t.timeout,timeRemaining:()=>0})}),1)},globalThis.cancelIdleCallback=function(e){clearTimeout(e)});const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const a=globalThis.FAST;if(void 0===a.getById){const e=Object.create(null);Reflect.defineProperty(a,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},o))}void 0===a.error&&Object.assign(a,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const l=Object.freeze([]);function c(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function d(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function h(e){e.prototype.toJSON=r}const u=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),f=e=>e,p=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:f}):{createHTML:f};let g=Object.freeze({createHTML:e=>p.createHTML(e),protect:(e,t,s,i)=>i});const b=g,v=Object.freeze({get policy(){return g},setPolicy(e){if(g!==b)throw a.error(1201);g=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function m(e,t,s,i){return(e,t,s,...r)=>{n(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...r)}}function y(e,t,s,i){throw a.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const w={onabort:y,onauxclick:y,onbeforeinput:y,onbeforematch:y,onblur:y,oncancel:y,oncanplay:y,oncanplaythrough:y,onchange:y,onclick:y,onclose:y,oncontextlost:y,oncontextmenu:y,oncontextrestored:y,oncopy:y,oncuechange:y,oncut:y,ondblclick:y,ondrag:y,ondragend:y,ondragenter:y,ondragleave:y,ondragover:y,ondragstart:y,ondrop:y,ondurationchange:y,onemptied:y,onended:y,onerror:y,onfocus:y,onformdata:y,oninput:y,oninvalid:y,onkeydown:y,onkeypress:y,onkeyup:y,onload:y,onloadeddata:y,onloadedmetadata:y,onloadstart:y,onmousedown:y,onmouseenter:y,onmouseleave:y,onmousemove:y,onmouseout:y,onmouseover:y,onmouseup:y,onpaste:y,onpause:y,onplay:y,onplaying:y,onprogress:y,onratechange:y,onreset:y,onresize:y,onscroll:y,onsecuritypolicyviolation:y,onseeked:y,onseeking:y,onselect:y,onslotchange:y,onstalled:y,onsubmit:y,onsuspend:y,ontimeupdate:y,ontoggle:y,onvolumechange:y,onwaiting:y,onwebkitanimationend:y,onwebkitanimationiteration:y,onwebkitanimationstart:y,onwebkittransitionend:y,onwheel:y},C={elements:{a:{[u.attribute]:{href:m},[u.property]:{href:m}},area:{[u.attribute]:{href:m},[u.property]:{href:m}},button:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},embed:{[u.attribute]:{src:y},[u.property]:{src:y}},form:{[u.attribute]:{action:m},[u.property]:{action:m}},frame:{[u.attribute]:{src:m},[u.property]:{src:m}},iframe:{[u.attribute]:{src:m},[u.property]:{src:m,srcdoc:y}},input:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},link:{[u.attribute]:{href:y},[u.property]:{href:y}},object:{[u.attribute]:{codebase:y,data:y},[u.property]:{codeBase:y,data:y}},script:{[u.attribute]:{src:y,text:y},[u.property]:{src:y,text:y,innerText:y,textContent:y}},style:{[u.property]:{innerText:y,textContent:y}}},aspects:{[u.attribute]:Object.assign({},w),[u.property]:Object.assign({innerHTML:y},w),[u.event]:Object.assign({},w)}};function S(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=r;break;default:s[i]=n}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function x(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=S(r,{});break;default:s[i]=S(n,r)}}for(const t in e)t in s||(s[t]=S(e[t],{}));return Object.freeze(s)}function T(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=x(n,{});break;default:s[i]=x(n,r)}}for(const t in e)t in s||(s[t]=x(e[t],{}));return Object.freeze(s)}function $(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const B=Object.freeze({create(e={}){var t,s;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),n=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=C,Object.freeze({elements:r.elements?T(r.elements,o.elements):o.elements,aspects:r.aspects?x(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,s,i){var r;const o=(null!=e?e:"").toLowerCase(),a=n.elements[o];if(a){const n=$(a,e,t,s,i);if(n)return n}return null!==(r=$(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),O=a.getById(s.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>i=e})}));class N{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class k{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new N(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new N(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const A=Object.freeze({unknown:void 0,coupled:1}),E=a.getById(s.observable,(()=>{const e=O.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let r,o=e=>{throw a.error(1101)};function l(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=o(e):s.set(e,i=new k(e))),i}const c=d();class u{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==r&&r.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,n=e[s];if(n!==t){e[s]=t;const r=e[this.callback];i(r)&&r.call(e,n,t),l(e).notify(this.name)}}}class f extends N{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==A.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=r;let i;r=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{r=s}return i}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,i=l(e),n=null===s?this.first:{};if(n.propertySource=e,n.propertyName=t,n.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;r=void 0,t=s.propertySource[s.propertyName],r=this,e===t&&(this.needsRefresh=!0)}s.next=n}this.last=n}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return h(f),Object.freeze({setArrayObserverFactory(e){o=e},getNotifier:l,track(e,t){r&&r.watch(e,t)},trackVolatile(){r&&(r.needsRefresh=!0)},notify(e,t){l(e).notify(t)},defineProperty(e,t){n(t)&&(t=new u(t)),c(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:c,binding(e,t,s=this.isVolatileBinding(e)){return new f(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function M(e,t){E.defineProperty(e,t)}function I(e,t,s){return Object.assign({},s,{get(){return E.trackVolatile(),s.get.apply(this)}})}const j=a.getById(s.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),V=Object.freeze({default:{index:0,length:0,get event(){return V.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>j.get(),setEvent(e){j.set(e)}});class R{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class _{constructor(e){this.sorted=e}}const z=Object.freeze({reset:1,splice:2,optimized:3}),L=new R(0,l,0);L.reset=!0;const H=[L];function F(e,t,s,i,n,r){let o=0,a=0;const c=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,c)),s===e.length&&r===i.length&&(a=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,c-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return l;if(t===s){const e=new R(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new R(t,[],s-t)];const d=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):l===o?(n.push(3),t--,i=o):(n.push(2),s--,i=a)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,a=s-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===i[n+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,d=l[s][r-1]+1,l[s][r]=c<d?c:d);return l}(e,t,s,i,n,r)),h=[];let u,f=t,p=n;for(let e=0;e<d.length;++e)switch(d[e]){case 0:void 0!==u&&(h.push(u),u=void 0),f++,p++;break;case 1:void 0===u&&(u=new R(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new R(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new R(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&h.push(u),h}function P(e,t){let s=!1,i=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=i,s)continue;const d=(n=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<n?-1:r===o||a===n?0:n<o?r<a?r-o:a-o:a<r?a-n:r-n);if(d>=0){t.splice(l,1),l--,i-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const n=e.removed.length+c.removed.length-d;if(e.addedCount||n){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,a;s||t.push(e)}let D=Object.freeze({support:z.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?l:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)P(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(F(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):H,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new R(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new R(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new _(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new R(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new _(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new R(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new R(0,[],i.length).adjustTo(e)),n}});const U=Object.freeze({reset:H,setDefaultStrategy(e){D=e}});function q(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}class Q extends N{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,q(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,E.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,E.notify(e,"sorted"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:D).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,O.enqueue(this))}}let W=!1;const X=Object.freeze({sorted:0,enable(){if(W)return;W=!0,E.setArrayObserverFactory((e=>new Q(e)));const e=Array.prototype;e.$fastPatch||(q(e,"$fastPatch",1),q(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:D)[t.name](this,i,t,e)}})))}});function J(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=E.getNotifier(e)),E.track(t.lengthObserver,"length"),e.length}function G(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=E.getNotifier(e)),E.track(t.sortObserver,"sorted"),e.sorted}class K{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class Y extends K{createObserver(e){return E.binding(this.evaluate,e,this.isVolatile)}}function Z(e,t,s=E.isVolatileBinding(e)){return new Y(e,t,s)}function ee(e,t){const s=new Y(e);return s.options=t,s}class te extends K{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function se(e,t){return new te(e,t)}function ie(e){return i(e)?Z(e):e instanceof K?e:se((()=>e))}let ne;function re(e){return e.map((e=>e instanceof oe?re(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}h(te);class oe{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof oe?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(ne),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(re(this.styles)),this}static setDefaultStrategy(e){ne=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new oe(e):e instanceof oe?e:new oe([e])}}oe.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const ae=c(),le=Object.freeze({getForInstance:ae.getForInstance,getByType:ae.getByType,define:e=>(ae.register({type:e}),e)});function ce(){return function(e){le.define(e)}}function de(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class he{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,i)=>{e.call(s,t,i),"style"===t&&s.$cssBindings.forEach(((e,t)=>de(t,e.controller,e.observer)))}}const i=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);i.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:i})}connectedCallback(e){de(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){de(this,t.controller,t)}}le.define(he);const ue=`${Math.random().toString(36).substring(2,8)}`;let fe=0;const pe=()=>`--v${ue}${++fe}`;function ge(e,t){const s=[];let n="";const r=[],o=e=>{r.push(e)};for(let r=0,a=e.length-1;r<a;++r){n+=e[r];let a=t[r];i(a)?a=new he(Z(a),pe()).createCSS(o):a instanceof K?a=new he(a,pe()).createCSS(o):void 0!==le.getForInstance(a)&&(a=a.createCSS(o)),a instanceof oe||a instanceof CSSStyleSheet?(""!==n.trim()&&(s.push(n),n=""),s.push(a)):n+=a}return n+=e[e.length-1],""!==n.trim()&&s.push(n),{styles:s,behaviors:r}}const be=(e,...t)=>{const{styles:s,behaviors:i}=ge(e,t),n=new oe(s);return i.length?n.withBehaviors(...i):n};class ve{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(n(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new oe(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}le.define(ve),be.partial=(e,...t)=>{const{styles:s,behaviors:i}=ge(e,t);return new ve(s,i)};const me=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,ye=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,we=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Ce=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Se=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,xe=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Te(e){return e&&e.nodeType===Node.COMMENT_NODE}const $e=Object.freeze({attributeMarkerName:"data-fe-b",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>me.test(e),isContentBindingEndMarker:e=>ye.test(e),isRepeatViewStartMarker:e=>we.test(e),isRepeatViewEndMarker:e=>Ce.test(e),isElementBoundaryStartMarker:e=>Te(e)&&Se.test(e.data.trim()),isElementBoundaryEndMarker:e=>Te(e)&&xe.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[],s=this.attributeMarkerName.length+1,i=`${this.attributeMarkerName}-`;for(const n of e.getAttributeNames())if(n.startsWith(i)){const e=Number(n.slice(s));if(Number.isNaN(e))throw new Error(`Invalid attribute marker name: ${n}. Expected format is ${i}<number>.`);t.push(e)}return 0===t.length?null:t},parseContentBindingStartMarker:e=>Ne(me,e),parseContentBindingEndMarker:e=>Ne(ye,e),parseRepeatStartMarker:e=>Be(we,e),parseRepeatEndMarker:e=>Be(Ce,e),parseElementBoundaryStartMarker:e=>Oe(Se,e.trim()),parseElementBoundaryEndMarker:e=>Oe(xe,e)});function Be(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Oe(e,t){const s=e.exec(t);return null===s?s:s[1]}function Ne(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const ke=Symbol.for("fe-hydration");function Ae(e){return e[ke]===ke}const Ee=`fast-${Math.random().toString(36).substring(2,8)}`,Me=`${Ee}{`,Ie=`}${Ee}`,je=Ie.length;let Ve=0;const Re=()=>`${Ee}-${++Ve}`,_e=Object.freeze({interpolation:e=>`${Me}${e}${Ie}`,attribute:e=>`${Re()}="${Me}${e}${Ie}"`,comment:e=>`\x3c!--${Me}${e}${Ie}--\x3e`}),ze=Object.freeze({parse(e,t){const s=e.split(Me);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(Ie);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+je)}""!==o&&i.push(o)}return i}}),Le=c(),He=Object.freeze({getForInstance:Le.getForInstance,getByType:Le.getByType,define:(e,t)=>((t=t||{}).type=e,Le.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?u.tokenList:u.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=u.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=u.event;break;default:e.targetAspect=t,e.aspectType=u.attribute}else e.aspectType=u.content}});function Fe(e){return function(t){He.define(t,e)}}class Pe{constructor(e){this.options=e}createHTML(e){return _e.attribute(e(this))}createBehavior(){return this}}h(Pe);class De extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ue(e){return e.nodeType===Node.COMMENT_NODE}function qe(e){return e.nodeType===Node.TEXT_NODE}function Qe(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ue(t)||qe(t)?t.data.length:t.childNodes.length),s}function We(e,t,s){var i;const n=null!==(i=$e.parseAttributeBinding(e))&&void 0!==i?i:$e.parseEnumeratedAttributeBinding(e);if(null!==n){for(const i of n){if(!t[i])throw new De(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);Je(t[i],e,s)}e.removeAttribute($e.attributeMarkerName)}}function Xe(e,t,s,i,n){if($e.isElementBoundaryStartMarker(e))!function(e,t){const s=$e.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(Ue(i)){const e=$e.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if($e.isContentBindingStartMarker(e.data)){const r=$e.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],c=[];let d=t.nextSibling();e.data="";const h=d;for(;null!==d;){if(Ue(d)){const e=$e.parseContentBindingEndMarker(d.data);if(e&&e[1]===a)break}c.push(d),d=t.nextSibling()}if(null===d){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(d.data="",1===c.length&&qe(c[0]))Je(l,c[0],i);else{d!==h&&null!==d.previousSibling&&(n[l.targetNodeId]={first:h,last:d.previousSibling});Je(l,d.parentNode.insertBefore(document.createTextNode(""),d),i)}}}function Je(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var Ge;function Ke(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;){if(i=n.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(n),n=i}s.removeChild(t)}class Ye{constructor(){this.index=0,this.length=0}get event(){return V.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class Ze extends Ye{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=A.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){Ke(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){Ke(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}h(Ze),E.defineProperty(Ze.prototype,"index"),E.defineProperty(Ze.prototype,"length");const et="unhydrated",tt="hydrating",st="hydrated";class it extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}Ge=ke,h(class extends Ye{constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[Ge]=ke,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=A.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=et,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}insertBefore(e){if(null!==this.fragment)if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,i=this.firstChild;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=s}e.appendChild(t)}bind(e,t=this){var s;if(this.hydrationStage!==st&&(this._hydrationStage=tt),this.source===e)return;let i=this.behaviors;if(null===i){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=Qe(e,t),n=i.commonAncestorContainer,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===i.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={};let l=r.currentNode=e;for(;null!==l;){switch(l.nodeType){case Node.ELEMENT_NODE:We(l,s,o);break;case Node.COMMENT_NODE:Xe(l,r,s,o,a)}l=r.nextNode()}return i.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof De){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=i=new Array(this.factories.length);const n=this.factories;for(let e=0,t=n.length;e<t;++e){const t=n[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&Je(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host,n=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==i?void 0:i.nodeName)||"unknown").toLowerCase()}>".`,"\nMismatch Details:",` - Expected target node ID: "${t.targetNodeId}"`,` - Available target IDs: [${Object.keys(this.targets).join(", ")||"none"}]`];throw t.targetTagName&&r.push(` - Expected tag name: "${t.targetTagName}"`),n.sourceAspect&&r.push(` - Source aspect: "${n.sourceAspect}"`),void 0!==n.aspectType&&r.push(` - Aspect type: ${n.aspectType}`),r.push("\nThis usually means:"," 1. The server-rendered HTML doesn't match the client template"," 2. The hydration markers are missing or corrupted"," 3. The DOM structure was modified before hydration",`\nTemplate: ${e.slice(0,200)}${e.length>200?"...":""}`),new it(r.join("\n"),t,Qe(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),i[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=i.length;e<t;++e)i[e].bind(this)}this.isBound=!0,this._hydrationStage=st}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){Ke(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}});const nt={[u.attribute]:v.setAttribute,[u.booleanAttribute]:v.setBooleanAttribute,[u.property]:(e,t,s)=>e[t]=s,[u.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Ae(i)&&Ae(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==st){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[u.tokenList]:function(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[u.event]:()=>{}};class rt{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=u.content}createHTML(e){return _e.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=nt[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw a.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],i=Ae(e)&&e.hydrationStage&&e.hydrationStage!==st;switch(this.aspectType){case u.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case u.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(n.target=s,n.controller=e,i&&(this.aspectType===u.attribute||this.aspectType===u.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){V.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);V.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}He.define(rt,{aspected:!0});const ot=(e,t)=>`${e}.${t}`,at={},lt={index:0,node:null};function ct(e){e.startsWith("fast-")||a.warn(1204,{name:e})}const dt=new Proxy(document.createElement("div"),{get(e,t){ct(t);const s=Reflect.get(e,t);return i(s)?s.bind(e):s},set:(e,t,s)=>(ct(t),Reflect.set(e,t,s))});class ht{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i,n){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.id=null!==(r=e.id)&&void 0!==r?r:Re(),e.targetNodeId=s,e.targetTagName=n,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=at[t];if(!n){const i=`_${t}`;at[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:dt;for(const e of this.nodeIds)s[e];return new Ze(t,this.factories,s)}}function ut(e,t,s,i,n,r=!1){const o=s.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=ze.parse(h,a);let f=null;null===u?r&&(f=new rt(se((()=>h),e.policy)),He.assignAspect(f,d.name)):f=bt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,i,n,s.tagName))}}function ft(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=pt(e,s,n,i);n=t.node,i=t.index}}function pt(e,t,s,i){const r=ot(t,i);switch(s.nodeType){case 1:ut(e,t,s,r,i),ft(e,s,r);break;case 3:return function(e,t,s,i,r){const o=ze.parse(t.textContent,e.directives);if(null===o)return lt.node=t.nextSibling,lt.index=r+1,lt;let a,l=a=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(r++,i=ot(s,r),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),n(c)?a.textContent=c:(a.textContent=" ",He.assignAspect(c),e.addFactory(c,s,i,r,null)),l=a}return lt.index=r+1,lt.node=l.nextSibling,lt}(e,s,t,r,i);case 8:const o=ze.parse(s.data,e.directives);null!==o&&e.addFactory(bt.aggregate(o),t,r,i,null)}return lt.index=i+1,lt.node=s.nextSibling,lt}const gt="TEMPLATE",bt={compile(e,t,s=v.policy){let i;if(n(e)){i=document.createElement(gt),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===gt&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const r=document.adoptNode(i.content),o=new ht(r,t,s);var a,l;return ut(o,"",i,"h",0,!0),a=r.firstChild,l=t,(a&&8==a.nodeType&&null!==ze.parse(a.data,l)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),ft(o,r,"r"),lt.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=v.policy){if(1===e.length)return e[0];let s,i,r=!1;const o=e.length,a=e.map((e=>n(e)?()=>e:(s=e.sourceAspect||s,r=r||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),l=new rt(Z(((e,t)=>{let s="";for(let i=0;i<o;++i)s+=a[i](e,t);return s}),null!=i?i:t,r));return He.assignAspect(l,s),l}},vt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,mt=Object.create(null);class yt{constructor(e,t=mt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function wt(e,t,s,i=He.getForInstance(e)){if(i.aspected){const s=vt.exec(t);null!==s&&He.assignAspect(e,s[2])}return e.createHTML(s)}yt.empty=new yt(""),He.define(yt);class Ct{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=bt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new yt(n(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw a.error(1208);if(this.policy)throw a.error(1207);return this.policy=e,this}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}static create(e,t,s){let n="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Re();return r[s]=e,s};for(let s=0,r=e.length-1;s<r;++s){const r=e[s];let a,l=t[s];if(n+=r,i(l))l=new rt(Z(l));else if(l instanceof K)l=new rt(l);else if(!(a=He.getForInstance(l))){const e=l;l=new rt(se((()=>e)))}n+=wt(l,r,o,a)}return new Ct(n+e[e.length-1],r,s)}}h(Ct);const St=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Ct.create(e,t);throw a.error(1206)};St.partial=e=>new yt(e);class xt extends Pe{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}He.define(xt);const Tt=e=>new xt(e),$t=()=>null;function Bt(e){return void 0===e?$t:i(e)?e:()=>e}function Ot(e,t,s){const n=i(e)?e:()=>e,r=Bt(t),o=Bt(s);return(e,t)=>n(e,t)?r(e,t):o(e,t)}const Nt=Object.freeze({positioning:!1,recycle:!0});function kt(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function At(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function Et(e){return e.nodeType===Node.COMMENT_NODE}class Mt extends Error{constructor(e,t){super(e),this.propertyBag=t}}class It{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=kt,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=At)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Ae(this.template)&&Ae(e)&&e.hydrationStage!==st?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=l);const t=this.itemsObserver,s=this.itemsObserver=E.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,i=e.length;s<i;++s){const i=e[s].sorted.slice(),n=i.slice().sort();for(let e=0,s=i.length;e<s;++e){const s=i.find((t=>i[e]===n[t]));if(s!==e){const i=n.splice(s,1);n.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let f=0,p=h.index;const g=p+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;p<g;++p){const e=t[p],d=e?e.firstChild:this.location;let h;o&&c>0?(f<=v&&b.length>0?(h=b[f],f++):(h=a[l],l++),c--):h=n.create(),t.splice(p,0,h),s(h,i,p,r),h.insertBefore(d)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(Ze.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),a[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<l){const i=a[e];if(!i){const t=new XMLSerializer;throw new Mt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}n(i,t,e,r)}else{const o=s.create();n(o,t,e,r),a.push(o),o.insertBefore(i)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new Mt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:s.serializeToString(this.location.getRootNode())})}s.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!Et(t)){t=t.previousSibling;continue}const s=$e.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const i=t.previousSibling;if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=i,r=0;for(;null!==n;){if(Et(n))if($e.isRepeatViewEndMarker(n.data))r++;else if($e.isRepeatViewStartMarker(n.data)){if(!r){if($e.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const r=e.hydrate(n,i);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class jt{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,X.enable()}createHTML(e){return _e.comment(e(this))}createBehavior(){return new It(this)}}function Vt(e,t,s=Nt){const i=ie(e),n=ie(t);return new jt(i,n,Object.assign(Object.assign({},Nt),s))}He.define(jt);const Rt=e=>1===e.nodeType,_t=e=>e?t=>1===t.nodeType&&t.matches(e):Rt;class zt extends Pe{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,l),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const Lt="slotchange";class Ht extends zt{observe(e){e.addEventListener(Lt,this)}disconnect(e){e.removeEventListener(Lt,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Ft(e){return n(e)&&(e={property:e}),new Ht(e)}He.define(Ht);class Pt extends zt{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=r,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Dt(e){return n(e)&&(e={property:e}),new Pt(e)}function Ut(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))}He.define(Pt),"function"==typeof SuppressedError&&SuppressedError;const qt="boolean",Qt="reflect",Wt=Object.freeze({locate:d()}),Xt={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Jt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Xt.fromView(e)};function Gt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Kt={toView(e){const t=Gt(e);return t?t.toString():t},fromView:Gt};class Yt{constructor(e,t,s=t.toLowerCase(),i=Qt,n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i===qt&&void 0===n&&(this.converter=Xt)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return E.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||O.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case Qt:const t=this.converter;v.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case qt:v.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(Wt.locate(e));for(let i=0,r=t.length;i<r;++i){const r=t[i];if(void 0!==r)for(let t=0,i=r.length;t<i;++t){const i=r[t];n(i)?s.push(new Yt(e,i)):s.push(new Yt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function Zt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),Wt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const es={mode:"open"},ts={},ss=new Set,is=a.getById(s.elementRegistry,(()=>c())),ns={deferAndHydrate:"defer-and-hydrate"};class rs{constructor(e,t=e.definition){var s;this.platformDefined=!1,n(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.templateOptions=t.templateOptions,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,r=Yt.collect(e,t.attributes),o=new Array(r.length),a={},l={};for(let e=0,t=r.length;e<t;++e){const t=r[e];o[e]=t.attribute,a[t.name]=t,l[t.attribute]=t,E.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=r,this.propertyLookup=a,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?es:null===t.shadowOptions?void 0:Object.assign(Object.assign({},es),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?ts:Object.assign(Object.assign({},ts),t.elementOptions),this.styles=oe.normalize(t.styles),is.register(this),E.defineProperty(rs.isRegistered,this.name),rs.isRegistered[this.name]=this.type}get isDefined(){return this.platformDefined}define(e=this.registry){var t,s;const i=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,i,this.elementOptions),null===(s=null===(t=this.lifecycleCallbacks)||void 0===t?void 0:t.elementDidDefine)||void 0===s||s.call(t,this.name)),this}static compose(e,t){return ss.has(e)||is.getByType(e)?new rs(class extends e{},t):new rs(e,t)}static registerBaseType(e){ss.add(e)}static composeAsync(e,t){return new Promise((s=>{(ss.has(e)||is.getByType(e))&&s(new rs(class extends e{},t));const i=new rs(e,t);E.getNotifier(i).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=i.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,i.name),s(i)}},"template")}))}}rs.isRegistered={},rs.getByType=is.getByType,rs.getForInstance=is.getForInstance,rs.registerAsync=e=>Ut(void 0,void 0,void 0,(function*(){return new Promise((t=>{rs.isRegistered[e]&&t(rs.isRegistered[e]),E.getNotifier(rs.isRegistered).subscribe({handleChange:()=>t(rs.isRegistered[e])},e)}))})),E.defineProperty(rs.prototype,"template");class os{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Ae(this.template)&&Ae(e)&&e.hydrationStage!==st&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class as{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return _e.comment(e(this))}createBehavior(){return new os(this)}}He.define(as);const ls=new Map,cs={":model":e=>e},ds=Symbol("RenderInstruction"),hs="default-view",us=St`
|
|
2
2
|
|
|
3
|
-
`;function us(e){return void 0===e?ds:e.template}function fs(e,t){const s=[],n=[],{attributes:r,directives:o,content:a,policy:l}=null!=t?t:{};if(s.push(`<${e}`),r){const e=Object.getOwnPropertyNames(r);for(let t=0,i=e.length;t<i;++t){const i=e[t];0===t?s[0]=`${s[0]} ${i}="`:s.push(`" ${i}="`),n.push(r[i])}s.push('"')}if(o){s[s.length-1]+=" ";for(let e=0,t=o.length;e<t;++e){const t=o[e];s.push(e>0?"":" "),n.push(t)}}if(s[s.length-1]+=">",a&&i(a.create))n.push(a),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=a?a:""}</${e}>`}return St.create(s,n,l)}function ps(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:hs;let i;if((n=e).element||n.tagName){let t=e.tagName;if(!t){const s=ns.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=ls),i=fs(t,e)}else i=e.template;var n;return{brand:cs,type:e.type,name:s,template:i}}function gs(e){return e&&e.brand===cs}function bs(e,t){const s=as.get(e);if(void 0!==s)return s[null!=t?t:hs]}function vs(e,t){if(e)return bs(e.constructor,t)}Object.freeze({instanceOf:gs,create:ps,createElementTemplate:fs,register:function(e){let t=as.get(e.type);void 0===t&&as.set(e.type,t=Object.create(null));const s=gs(e)?e:ps(e);return t[s.name]=s},getByType:bs,getForInstance:vs});class ms{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 ys(e,t){let s,r;s=void 0===e?se((e=>e)):ie(e);let o=!1;if(void 0===t)o=!0,r=se(((e,t)=>{var i;const n=s.evaluate(e,t);return n instanceof Node?null!==(i=n.$fastTemplate)&&void 0!==i?i:new ms(n):us(vs(n))}));else if(i(t))r=Z(((e,i)=>{var r;let o=t(e,i);return n(o)?o=us(vs(s.evaluate(e,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new ms(o)),o}),void 0,!0);else if(n(t))o=!0,r=se(((e,i)=>{var n;const r=s.evaluate(e,i);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new ms(r):us(vs(r,t))}));else if(t instanceof K){const e=t.evaluate;t.evaluate=(t,i)=>{var r;let o=e(t,i);return n(o)?o=us(vs(s.evaluate(t,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new ms(o)),o},r=t}else r=se(((e,s)=>t));return new os(s,r,o)}class ws extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:R.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){var s,i,n,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:_e(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:_e(),o.targetTagName=null!==(n=t.tagName)&&void 0!==n?n:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:v.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}});const Ss={bubbles:!0,composed:!0,cancelable:!0},Cs="isConnected",xs=new WeakMap;function Bs(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:xs.get(e))&&void 0!==s?s:null}let Os;class $s extends k{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const s=E.getAccessors(e);if(s.length>0){const t=this.boundObservables=Object.create(null);for(let i=0,n=s.length;i<n;++i){const n=s[i].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return E.track(this,Cs),1===this.stage}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:R.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&&xs.set(this.source,t))}}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=Bs(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=Bs(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.removeBehavior(t[e])}}connect(){3===this.stage&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,E.notify(this,Cs))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){1===this.stage&&(this.stage=2,E.notify(this,Cs),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},Ss),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=Bs(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=A.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const i=ns.getForInstance(e);if(void 0===i)throw a.error(1401);return E.getNotifier(i).subscribe({handleChange:()=>{$s.forCustomElement(e,!0),e.$fastController.connect()}},"template"),E.getNotifier(i).subscribe({handleChange:()=>{$s.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new Os(e,i)}static setStrategy(e){Os=e}}function Ts(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Bs(e))&&void 0!==t?t:e.getRootNode()}d($s),$s.setStrategy($s);class Ns{constructor(e){const t=Ns.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let s=t.get(e);return void 0===s&&(s=new CSSStyleSheet,s.replaceSync(e),t.set(e,s)),s}))}addStylesTo(e){Ms(Ts(e),this.sheets)}removeStylesFrom(e){js(Ts(e),this.sheets)}}Ns.styleSheetCache=new Map;let ks=0;function As(e){return e===document?document.body:e}class Es{constructor(e){this.styles=e,this.styleClass="fast-"+ ++ks}addStylesTo(e){e=As(Ts(e));const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=(e=As(Ts(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let Ms=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},js=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(oe.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Ms=(e,t)=>{e.adoptedStyleSheets.push(...t)},js=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}oe.setDefaultStrategy(Ns)}else oe.setDefaultStrategy(Es);const Vs="defer-hydration",Rs="needs-hydration";class _s extends $s{static hydrationObserverHandler(e){for(const t of e)_s.hydrationObserver.unobserve(t.target),t.target.$fastController.connect()}static forCustomElement(e,t){const s=ns.getForInstance(e);return void 0===s||"defer-and-hydrate"!==s.templateOptions||s.template||(e.setAttribute(Vs,""),e.setAttribute(Rs,"")),super.forCustomElement(e,t)}connect(){var e,t;if(void 0===this.needsHydration&&(this.needsHydration=null!==this.source.getAttribute(Rs)),this.source.hasAttribute(Vs))return void _s.hydrationObserver.observe(this.source,{attributeFilter:[Vs]});if(!this.needsHydration)return void super.connect();if(3!==this.stage)return;this.stage=0,this.bindObservables(),this.connectBehaviors();const s=this.source,i=null!==(e=Bs(s))&&void 0!==e?e:s;if(this.template)if(Ae(this.template)){let e=i.firstChild,n=i.lastChild;null===s.shadowRoot&&(Oe.isElementBoundaryStartMarker(e)&&(e.data="",e=e.nextSibling),Oe.isElementBoundaryEndMarker(n)&&(n.data="",n=n.previousSibling)),this.view=this.template.hydrate(e,n,s),null===(t=this.view)||void 0===t||t.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(Rs),this.needsInitialization=this.needsHydration=!1,E.notify(this,Cs)}disconnect(){super.disconnect(),_s.hydrationObserver.unobserve(this.source)}static install(){$s.setStrategy(_s)}}function Is(e){const t=class extends e{constructor(){super(),$s.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return ns.registerBaseType(t),t}function zs(e,t){return i(e)?ns.compose(e,t).define().type:ns.compose(this,e).define().type}_s.hydrationObserver=new ws(_s.hydrationObserverHandler);const Ls=Object.assign(Is(HTMLElement),{from:function(e){return Is(e)},define:zs,compose:function(e,t){return i(e)?ns.compose(e,t):ns.compose(this,e)},defineAsync:function(e,t){return i(e)?new Promise((s=>{ns.composeAsync(e,t).then((e=>{s(e)}))})).then((e=>e.define().type)):new Promise((t=>{ns.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});function Fs(e){return function(t){zs(t,e)}}v.setPolicy($.create());export{X as ArrayObserver,Wt as AttributeConfiguration,Yt as AttributeDefinition,K as Binding,de as CSSBindingDirective,le as CSSDirective,Ht as ChildrenDirective,bt as Compiler,v as DOM,u as DOMAspect,$s as ElementController,oe as ElementStyles,R as ExecutionContext,a as FAST,Ls as FASTElement,ns as FASTElementDefinition,rt as HTMLBindingDirective,Fe as HTMLDirective,Ze as HTMLView,_s as HydratableElementController,it as HydrationBindingError,yt as InlineTemplateDirective,Ie as Markup,zt as NodeObservationDirective,E as Observable,ze as Parser,k as PropertyChangeNotifier,xt as RefDirective,rs as RenderBehavior,os as RenderDirective,jt as RepeatBehavior,Vt as RepeatDirective,Ft as SlottedDirective,I as Sort,A as SourceLifetime,_ as Splice,U as SpliceStrategy,z as SpliceStrategySupport,He as StatelessAttachedAttributeDirective,N as SubscriberSet,T as Updates,St as ViewTemplate,Zt as attr,Xt as booleanConverter,Dt as children,be as css,ce as cssDirective,Fs as customElement,It as elements,l as emptyArray,is as fastElementRegistry,Ct as html,Pe as htmlDirective,J as lengthOf,ee as listener,ie as normalizeBinding,Jt as nullableBooleanConverter,Kt as nullableNumberConverter,M as observable,se as oneTime,Z as oneWay,Bt as ref,ys as render,Rt as repeat,Pt as slotted,G as sortedCount,j as volatile,Tt as when};
|
|
3
|
+
`;function fs(e){return void 0===e?us:e.template}function ps(e,t){const s=[],n=[],{attributes:r,directives:o,content:a,policy:l}=null!=t?t:{};if(s.push(`<${e}`),r){const e=Object.getOwnPropertyNames(r);for(let t=0,i=e.length;t<i;++t){const i=e[t];0===t?s[0]=`${s[0]} ${i}="`:s.push(`" ${i}="`),n.push(r[i])}s.push('"')}if(o){s[s.length-1]+=" ";for(let e=0,t=o.length;e<t;++e){const t=o[e];s.push(e>0?"":" "),n.push(t)}}if(s[s.length-1]+=">",a&&i(a.create))n.push(a),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=a?a:""}</${e}>`}return Ct.create(s,n,l)}function gs(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:hs;let i;if((n=e).element||n.tagName){let t=e.tagName;if(!t){const s=rs.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=cs),i=ps(t,e)}else i=e.template;var n;return{brand:ds,type:e.type,name:s,template:i}}function bs(e){return e&&e.brand===ds}function vs(e,t){const s=ls.get(e);if(void 0!==s)return s[null!=t?t:hs]}function ms(e,t){if(e)return vs(e.constructor,t)}Object.freeze({instanceOf:bs,create:gs,createElementTemplate:ps,register:function(e){let t=ls.get(e.type);void 0===t&&ls.set(e.type,t=Object.create(null));const s=bs(e)?e:gs(e);return t[s.name]=s},getByType:vs,getForInstance:ms});class ys{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 ws(e,t){let s,r;s=void 0===e?se((e=>e)):ie(e);let o=!1;if(void 0===t)o=!0,r=se(((e,t)=>{var i;const n=s.evaluate(e,t);return n instanceof Node?null!==(i=n.$fastTemplate)&&void 0!==i?i:new ys(n):fs(ms(n))}));else if(i(t))r=Z(((e,i)=>{var r;let o=t(e,i);return n(o)?o=fs(ms(s.evaluate(e,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new ys(o)),o}),void 0,!0);else if(n(t))o=!0,r=se(((e,i)=>{var n;const r=s.evaluate(e,i);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new ys(r):fs(ms(r,t))}));else if(t instanceof K){const e=t.evaluate;t.evaluate=(t,i)=>{var r;let o=e(t,i);return n(o)?o=fs(ms(s.evaluate(t,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new ys(o)),o},r=t}else r=se(((e,s)=>t));return new as(s,r,o)}class Cs extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:V.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){var s,i,n,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:Re(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:Re(),o.targetTagName=null!==(n=t.tagName)&&void 0!==n?n:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:v.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}});const Ss={bubbles:!0,composed:!0,cancelable:!0},xs="isConnected",Ts=new WeakMap;function $s(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Ts.get(e))&&void 0!==s?s:null}let Bs;class Os extends k{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const s=E.getAccessors(e);if(s.length>0){const t=this.boundObservables=Object.create(null);for(let i=0,n=s.length;i<n;++i){const n=s[i].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return E.track(this,xs),1===this.stage}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:V.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&Ts.set(this.source,t))}}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=$s(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=$s(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.removeBehavior(t[e])}}connect(){3===this.stage&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,E.notify(this,xs))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){1===this.stage&&(this.stage=2,E.notify(this,xs),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},Ss),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=$s(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=A.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const i=rs.getForInstance(e);if(void 0===i)throw a.error(1401);return E.getNotifier(i).subscribe({handleChange:()=>{Os.forCustomElement(e,!0),e.$fastController.connect()}},"template"),E.getNotifier(i).subscribe({handleChange:()=>{Os.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new Bs(e,i)}static setStrategy(e){Bs=e}}function Ns(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=$s(e))&&void 0!==t?t:e.getRootNode()}h(Os),Os.setStrategy(Os);class ks{constructor(e){const t=ks.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let s=t.get(e);return void 0===s&&(s=new CSSStyleSheet,s.replaceSync(e),t.set(e,s)),s}))}addStylesTo(e){Is(Ns(e),this.sheets)}removeStylesFrom(e){js(Ns(e),this.sheets)}}ks.styleSheetCache=new Map;let As=0;function Es(e){return e===document?document.body:e}class Ms{constructor(e){this.styles=e,this.styleClass="fast-"+ ++As}addStylesTo(e){e=Es(Ns(e));const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=(e=Es(Ns(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let Is=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},js=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(oe.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Is=(e,t)=>{e.adoptedStyleSheets.push(...t)},js=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}oe.setDefaultStrategy(ks)}else oe.setDefaultStrategy(Ms);const Vs="defer-hydration",Rs="needs-hydration";class _s extends Os{addHydratingInstance(){if(!_s.hydratingInstances)return;const e=this.definition.name;let t=_s.hydratingInstances.get(e);t||(t=new Set,_s.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return _s.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(Vs)||(_s.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,s,i;e.didTimeout?_s.idleCallbackId=requestIdleCallback(_s.checkHydrationComplete,{timeout:50}):0===(null===(t=_s.hydratingInstances)||void 0===t?void 0:t.size)&&(null===(i=null===(s=_s.lifecycleCallbacks)||void 0===s?void 0:s.hydrationComplete)||void 0===i||i.call(s),Os.setStrategy(Os))}static forCustomElement(e,t){const s=rs.getForInstance(e);return(null==s?void 0:s.templateOptions)!==ns.deferAndHydrate||s.template||(e.toggleAttribute(Vs,!0),e.toggleAttribute(Rs,!0)),super.forCustomElement(e,t)}connect(){var e,t,s,i,n;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:null!==this.source.getAttribute(Rs),this.needsHydration&&(null===(s=null===(t=_s.lifecycleCallbacks)||void 0===t?void 0:t.elementWillHydrate)||void 0===s||s.call(t,this.definition.name)),this.source.hasAttribute(Vs))return this.addHydratingInstance(),void _s.hydrationObserver.observe(this.source,{attributeFilter:[Vs]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(3===this.stage){if(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.template)if(Ae(this.template)){const e=this.source,t=null!==(i=$s(e))&&void 0!==i?i:e;let s=t.firstChild,r=t.lastChild;null===e.shadowRoot&&($e.isElementBoundaryStartMarker(s)&&(s.data="",s=s.nextSibling),$e.isElementBoundaryEndMarker(r)&&(r.data="",r=r.previousSibling)),this.view=this.template.hydrate(s,r,e),null===(n=this.view)||void 0===n||n.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(Rs),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),E.notify(this,xs)}}removeHydratingInstance(){var e,t;if(!_s.hydratingInstances)return;const s=this.definition.name,i=_s.hydratingInstances.get(s);null===(t=null===(e=_s.lifecycleCallbacks)||void 0===e?void 0:e.elementDidHydrate)||void 0===t||t.call(e,this.definition.name),i&&(i.delete(this.source),i.size||_s.hydratingInstances.delete(s),_s.idleCallbackId&&cancelIdleCallback(_s.idleCallbackId),_s.idleCallbackId=requestIdleCallback(_s.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),_s.hydrationObserver.unobserve(this.source)}static install(){Os.setStrategy(_s)}}function zs(e){const t=class extends e{constructor(){super(),Os.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return rs.registerBaseType(t),t}function Ls(e,t){return i(e)?rs.compose(e,t).define().type:rs.compose(this,e).define().type}_s.hydrationObserver=new Cs(_s.hydrationObserverHandler),_s.idleCallbackId=null,_s.hydratingInstances=new Map;const Hs=Object.assign(zs(HTMLElement),{from:function(e){return zs(e)},define:Ls,compose:function(e,t){return i(e)?rs.compose(e,t):rs.compose(this,e)},defineAsync:function(e,t){return i(e)?new Promise((s=>{rs.composeAsync(e,t).then((e=>{s(e)}))})).then((e=>e.define().type)):new Promise((t=>{rs.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});function Fs(e){return function(t){Ls(t,e)}}v.setPolicy(B.create());export{X as ArrayObserver,Wt as AttributeConfiguration,Yt as AttributeDefinition,K as Binding,he as CSSBindingDirective,le as CSSDirective,Pt as ChildrenDirective,bt as Compiler,v as DOM,u as DOMAspect,Os as ElementController,oe as ElementStyles,V as ExecutionContext,a as FAST,Hs as FASTElement,rs as FASTElementDefinition,rt as HTMLBindingDirective,He as HTMLDirective,Ze as HTMLView,_s as HydratableElementController,it as HydrationBindingError,yt as InlineTemplateDirective,_e as Markup,zt as NodeObservationDirective,E as Observable,ze as Parser,k as PropertyChangeNotifier,xt as RefDirective,os as RenderBehavior,as as RenderDirective,It as RepeatBehavior,jt as RepeatDirective,Ht as SlottedDirective,_ as Sort,A as SourceLifetime,R as Splice,U as SpliceStrategy,z as SpliceStrategySupport,Pe as StatelessAttachedAttributeDirective,N as SubscriberSet,ns as TemplateOptions,O as Updates,Ct as ViewTemplate,Zt as attr,Xt as booleanConverter,Dt as children,be as css,ce as cssDirective,Fs as customElement,_t as elements,l as emptyArray,is as fastElementRegistry,St as html,Fe as htmlDirective,J as lengthOf,ee as listener,ie as normalizeBinding,Jt as nullableBooleanConverter,Kt as nullableNumberConverter,M as observable,se as oneTime,Z as oneWay,Tt as ref,ws as render,Vt as repeat,Ft as slotted,G as sortedCount,I as volatile,Ot as when};
|
|
@@ -1392,6 +1392,10 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
|
|
|
1392
1392
|
* The registry to register this component in by default.
|
|
1393
1393
|
*/
|
|
1394
1394
|
readonly registry: CustomElementRegistry;
|
|
1395
|
+
/**
|
|
1396
|
+
* Lifecycle callbacks for template events.
|
|
1397
|
+
*/
|
|
1398
|
+
readonly lifecycleCallbacks?: TemplateLifecycleCallbacks;
|
|
1395
1399
|
/**
|
|
1396
1400
|
* The definition has been registered to the FAST element registry.
|
|
1397
1401
|
*/
|
|
@@ -1819,9 +1823,47 @@ export declare class HydratableElementController<TElement extends HTMLElement =
|
|
|
1819
1823
|
*/
|
|
1820
1824
|
protected needsHydration?: boolean;
|
|
1821
1825
|
private static hydrationObserver;
|
|
1826
|
+
/**
|
|
1827
|
+
* Lifecycle callbacks for hydration events
|
|
1828
|
+
*/
|
|
1829
|
+
static lifecycleCallbacks?: HydrationControllerCallbacks;
|
|
1830
|
+
/**
|
|
1831
|
+
* An idle callback ID used to track hydration completion
|
|
1832
|
+
*/
|
|
1833
|
+
private static idleCallbackId;
|
|
1834
|
+
/**
|
|
1835
|
+
* Adds the current element instance to the hydrating instances map
|
|
1836
|
+
*/
|
|
1837
|
+
private addHydratingInstance;
|
|
1838
|
+
/**
|
|
1839
|
+
* Configure lifecycle callbacks for hydration events
|
|
1840
|
+
*/
|
|
1841
|
+
static config(callbacks: HydrationControllerCallbacks): typeof HydratableElementController;
|
|
1822
1842
|
private static hydrationObserverHandler;
|
|
1843
|
+
/**
|
|
1844
|
+
* Checks to see if hydration is complete and if so, invokes the hydrationComplete callback.
|
|
1845
|
+
* Then resets the ElementController strategy to the default so that future elements
|
|
1846
|
+
* don't use the HydratableElementController.
|
|
1847
|
+
*
|
|
1848
|
+
* @param deadline - the idle deadline object
|
|
1849
|
+
*/
|
|
1850
|
+
private static checkHydrationComplete;
|
|
1823
1851
|
static forCustomElement(element: HTMLElement, override?: boolean): ElementController<HTMLElement>;
|
|
1824
1852
|
connect(): void;
|
|
1853
|
+
/**
|
|
1854
|
+
* A map of element instances by the name of the custom element they are
|
|
1855
|
+
* associated with. The key is the custom element name, and the value is the
|
|
1856
|
+
* instances of hydratable elements which currently need to be hydrated.
|
|
1857
|
+
*
|
|
1858
|
+
* When all of the instances in the set have been hydrated, the set is
|
|
1859
|
+
* cleared and removed from the map. If the map is empty, the
|
|
1860
|
+
* hydrationComplete callback is invoked.
|
|
1861
|
+
*/
|
|
1862
|
+
private static hydratingInstances?;
|
|
1863
|
+
/**
|
|
1864
|
+
* Removes the current element instance from the hydrating instances map
|
|
1865
|
+
*/
|
|
1866
|
+
private removeHydratingInstance;
|
|
1825
1867
|
disconnect(): void;
|
|
1826
1868
|
static install(): void;
|
|
1827
1869
|
}
|
|
@@ -1870,6 +1912,25 @@ export declare class HydrationBindingError extends Error {
|
|
|
1870
1912
|
templateString: string);
|
|
1871
1913
|
}
|
|
1872
1914
|
|
|
1915
|
+
/**
|
|
1916
|
+
* Lifecycle callbacks for element hydration events
|
|
1917
|
+
* @public
|
|
1918
|
+
*/
|
|
1919
|
+
export declare interface HydrationControllerCallbacks {
|
|
1920
|
+
/**
|
|
1921
|
+
* Called before hydration has started
|
|
1922
|
+
*/
|
|
1923
|
+
elementWillHydrate?(name: string): void;
|
|
1924
|
+
/**
|
|
1925
|
+
* Called after hydration has finished
|
|
1926
|
+
*/
|
|
1927
|
+
elementDidHydrate?(name: string): void;
|
|
1928
|
+
/**
|
|
1929
|
+
* Called after all elements have completed hydration
|
|
1930
|
+
*/
|
|
1931
|
+
hydrationComplete?(): void;
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1873
1934
|
declare const HydrationStage: {
|
|
1874
1935
|
readonly unhydrated: "unhydrated";
|
|
1875
1936
|
readonly hydrating: "hydrating";
|
|
@@ -2267,6 +2328,10 @@ export declare interface PartialFASTElementDefinition {
|
|
|
2267
2328
|
* If not provided, defaults to the global registry.
|
|
2268
2329
|
*/
|
|
2269
2330
|
readonly registry?: CustomElementRegistry;
|
|
2331
|
+
/**
|
|
2332
|
+
* Lifecycle callbacks for template events.
|
|
2333
|
+
*/
|
|
2334
|
+
readonly lifecycleCallbacks?: TemplateLifecycleCallbacks;
|
|
2270
2335
|
}
|
|
2271
2336
|
|
|
2272
2337
|
/**
|
|
@@ -2986,10 +3051,33 @@ export declare interface SyntheticViewTemplate<TSource = any, TParent = any> {
|
|
|
2986
3051
|
}
|
|
2987
3052
|
|
|
2988
3053
|
/**
|
|
2989
|
-
*
|
|
3054
|
+
* Lifecycle callbacks for template events.
|
|
3055
|
+
* @public
|
|
3056
|
+
*/
|
|
3057
|
+
export declare interface TemplateLifecycleCallbacks {
|
|
3058
|
+
/**
|
|
3059
|
+
* Called after the template has been assigned to the definition
|
|
3060
|
+
*/
|
|
3061
|
+
templateDidUpdate?(name: string): void;
|
|
3062
|
+
/**
|
|
3063
|
+
* Called after the custom element has been defined
|
|
3064
|
+
*/
|
|
3065
|
+
elementDidDefine?(name: string): void;
|
|
3066
|
+
}
|
|
3067
|
+
|
|
3068
|
+
/**
|
|
3069
|
+
* Values for the `templateOptions` property.
|
|
3070
|
+
* @alpha
|
|
3071
|
+
*/
|
|
3072
|
+
export declare const TemplateOptions: {
|
|
3073
|
+
readonly deferAndHydrate: "defer-and-hydrate";
|
|
3074
|
+
};
|
|
3075
|
+
|
|
3076
|
+
/**
|
|
3077
|
+
* Type for the `TemplateOptions` const enum.
|
|
2990
3078
|
* @alpha
|
|
2991
3079
|
*/
|
|
2992
|
-
export declare type TemplateOptions =
|
|
3080
|
+
export declare type TemplateOptions = (typeof TemplateOptions)[keyof typeof TemplateOptions];
|
|
2993
3081
|
|
|
2994
3082
|
/**
|
|
2995
3083
|
* Represents the types of values that can be interpolated into a template.
|
package/docs/api-report.api.md
CHANGED
|
@@ -458,6 +458,7 @@ export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Co
|
|
|
458
458
|
static readonly getForInstance: (object: any) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
|
|
459
459
|
get isDefined(): boolean;
|
|
460
460
|
static isRegistered: Record<string, Function>;
|
|
461
|
+
readonly lifecycleCallbacks?: TemplateLifecycleCallbacks;
|
|
461
462
|
readonly name: string;
|
|
462
463
|
readonly propertyLookup: Record<string, AttributeDefinition>;
|
|
463
464
|
// @alpha
|
|
@@ -595,6 +596,7 @@ export class HTMLView<TSource = any, TParent = any> extends DefaultExecutionCont
|
|
|
595
596
|
|
|
596
597
|
// @beta
|
|
597
598
|
export class HydratableElementController<TElement extends HTMLElement = HTMLElement> extends ElementController<TElement> {
|
|
599
|
+
static config(callbacks: HydrationControllerCallbacks): typeof HydratableElementController;
|
|
598
600
|
// (undocumented)
|
|
599
601
|
connect(): void;
|
|
600
602
|
// (undocumented)
|
|
@@ -603,6 +605,7 @@ export class HydratableElementController<TElement extends HTMLElement = HTMLElem
|
|
|
603
605
|
static forCustomElement(element: HTMLElement, override?: boolean): ElementController<HTMLElement>;
|
|
604
606
|
// (undocumented)
|
|
605
607
|
static install(): void;
|
|
608
|
+
static lifecycleCallbacks?: HydrationControllerCallbacks;
|
|
606
609
|
protected needsHydration?: boolean;
|
|
607
610
|
}
|
|
608
611
|
|
|
@@ -632,6 +635,13 @@ export class HydrationBindingError extends Error {
|
|
|
632
635
|
readonly templateString: string;
|
|
633
636
|
}
|
|
634
637
|
|
|
638
|
+
// @public
|
|
639
|
+
export interface HydrationControllerCallbacks {
|
|
640
|
+
elementDidHydrate?(name: string): void;
|
|
641
|
+
elementWillHydrate?(name: string): void;
|
|
642
|
+
hydrationComplete?(): void;
|
|
643
|
+
}
|
|
644
|
+
|
|
635
645
|
// @public
|
|
636
646
|
export class InlineTemplateDirective implements HTMLDirective {
|
|
637
647
|
constructor(html: string, factories?: Record<string, ViewBehaviorFactory>);
|
|
@@ -732,6 +742,7 @@ export const Parser: Readonly<{
|
|
|
732
742
|
export interface PartialFASTElementDefinition {
|
|
733
743
|
readonly attributes?: (AttributeConfiguration | string)[];
|
|
734
744
|
readonly elementOptions?: ElementDefinitionOptions;
|
|
745
|
+
readonly lifecycleCallbacks?: TemplateLifecycleCallbacks;
|
|
735
746
|
readonly name: string;
|
|
736
747
|
readonly registry?: CustomElementRegistry;
|
|
737
748
|
readonly shadowOptions?: Partial<ShadowRootOptions> | null;
|
|
@@ -970,8 +981,19 @@ export interface SyntheticViewTemplate<TSource = any, TParent = any> {
|
|
|
970
981
|
inline(): CaptureType<TSource, TParent>;
|
|
971
982
|
}
|
|
972
983
|
|
|
984
|
+
// @public
|
|
985
|
+
export interface TemplateLifecycleCallbacks {
|
|
986
|
+
elementDidDefine?(name: string): void;
|
|
987
|
+
templateDidUpdate?(name: string): void;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
// @alpha
|
|
991
|
+
export const TemplateOptions: {
|
|
992
|
+
readonly deferAndHydrate: "defer-and-hydrate";
|
|
993
|
+
};
|
|
994
|
+
|
|
973
995
|
// @alpha
|
|
974
|
-
export type TemplateOptions =
|
|
996
|
+
export type TemplateOptions = (typeof TemplateOptions)[keyof typeof TemplateOptions];
|
|
975
997
|
|
|
976
998
|
// @public
|
|
977
999
|
export type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
|