@microsoft/fast-element 2.0.0-beta.19 → 2.0.0-beta.20

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.
@@ -1 +1 @@
1
- let e;try{if(document.currentScript)e=document.currentScript.getAttribute("fast-kernel");else{const t=document.getElementsByTagName("script");e=t[t.length-1].getAttribute("fast-kernel")}}catch(t){e="isolate"}let t;switch(e){case"share":t=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":t=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)}`;t=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const s=e=>"function"==typeof e,n=e=>"string"==typeof e,i=()=>{};!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 r={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},r));const o=globalThis.FAST;if(void 0===o.getById){const e=Object.create(null);Reflect.defineProperty(o,"getById",Object.assign({value(t,s){let n=e[t];return void 0===n&&(n=s?e[t]=s():null),n}},r))}void 0===o.error&&Object.assign(o,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const l=Object.freeze([]);function a(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function c(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let n=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==n;)s=e.get(n),n=Reflect.getPrototypeOf(n);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}const h=o.getById(t.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let n=!0;function i(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!n)throw e.length=0,s;t.push(s),setTimeout(i,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,n=e.length-t;s<n;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function l(t){e.push(t),e.length<2&&(n?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:e=>n=e})})),d=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),u=e=>e,f=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:u}):{createHTML:u};let p=Object.freeze({createHTML:e=>f.createHTML(e),protect:(e,t,s,n)=>n});const g=p,b=Object.freeze({queueUpdate:h.enqueue,nextUpdate:h.next,processUpdates:h.process,get policy(){return p},setPolicy(e){if(p!==g)throw o.error(1201);p=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 v(e,t,s,i){return(e,t,s,...r)=>{n(s)&&(s=s.replace("javascript:","")),i(e,t,s,...r)}}function y(e,t,s,n){throw new Error(`${s} on ${null!=e?e:"text"} is blocked by the current DOMPolicy.`)}const m={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},w={elements:{a:{[d.attribute]:{href:v},[d.property]:{href:v}},area:{[d.attribute]:{href:v},[d.property]:{href:v}},button:{[d.attribute]:{formaction:v},[d.property]:{formAction:v}},embed:{[d.attribute]:{src:y},[d.property]:{src:y}},form:{[d.attribute]:{action:v},[d.property]:{action:v}},frame:{[d.attribute]:{src:v},[d.property]:{src:v}},iframe:{[d.attribute]:{src:v},[d.property]:{src:v,srcdoc:y}},input:{[d.attribute]:{formaction:v},[d.property]:{formAction:v}},link:{[d.attribute]:{href:y},[d.property]:{href:y}},object:{[d.attribute]:{codebase:y,data:y},[d.property]:{codeBase:y,data:y}},script:{[d.attribute]:{src:y,text:y},[d.property]:{src:y,text:y,innerText:y,textContent:y}},style:{[d.property]:{innerText:y,textContent:y}}},aspects:{[d.attribute]:Object.assign({},m),[d.property]:Object.assign({innerHTML:y},m),[d.event]:Object.assign({},m)}};function x(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=r;break;default:s[n]=i}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function C(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=x(r,{});break;default:s[n]=x(i,r)}}for(const t in e)t in s||(s[t]=x(e[t],{}));return Object.freeze(s)}function S(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=C(i,{});break;default:s[n]=C(i,r)}}for(const t in e)t in s||(s[t]=C(e[t],{}));return Object.freeze(s)}function O(e,t,s,n,i){const r=e[s];if(r){const e=r[n];if(e)return e(t,s,n,i)}}const T=Object.freeze({create(e={}){var t,s;const n=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),i=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=w,Object.freeze({elements:r.elements?S(r.elements,o.elements):o.elements,aspects:r.aspects?C(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>n.createHTML(e),protect(e,t,s,n){var r;const o=(null!=e?e:"").toLowerCase(),l=i.elements[o];if(l){const i=O(l,e,t,s,n);if(i)return i}return null!==(r=O(i.aspects,e,t,s,n))&&void 0!==r?r:n}})}});class A{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,n=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==n&&n.handleChange(s,e)}else for(let n=0,i=t.length;n<i;++n)t[n].handleChange(s,e)}}class B{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,n;let i;i=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new A(this.subject):null!==(n=this.subjectSubscribers)&&void 0!==n?n:this.subjectSubscribers=new A(this.subject),i.subscribe(e)}unsubscribe(e,t){var s,n;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(n=this.subjectSubscribers)||void 0===n||n.unsubscribe(e)}}const k=Object.freeze({unknown:void 0,coupled:1}),j=o.getById(t.observable,(()=>{const e=h.enqueue,t=/(:|&&|\|\||if)/,r=new WeakMap;let l,a=e=>{throw o.error(1101)};function d(e){var t;let s=null!==(t=e.$fastController)&&void 0!==t?t:r.get(e);return void 0===s&&(Array.isArray(e)?s=a(e):r.set(e,s=new B(e))),s}const u=c();class f{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==l&&l.watch(e,this.name),e[this.field]}setValue(e,t){const n=this.field,i=e[n];if(i!==t){e[n]=t;const r=e[this.callback];s(r)&&r.call(e,i,t),d(e).notify(this.name)}}}class p extends A{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,this.toJSON=i}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!==k.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=l;let n;l=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.expression(e,t)}finally{l=s}return n}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=d(e),i=null===s?this.first:{};if(i.propertySource=e,i.propertyName=t,i.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;l=void 0,t=s.propertySource[s.propertyName],l=this,e===t&&(this.needsRefresh=!0)}s.next=i}this.last=i}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return Object.freeze({setArrayObserverFactory(e){a=e},getNotifier:d,track(e,t){l&&l.watch(e,t)},trackVolatile(){l&&(l.needsRefresh=!0)},notify(e,t){d(e).notify(t)},defineProperty(e,t){n(t)&&(t=new f(t)),u(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:u,binding(e,t,s=this.isVolatileBinding(e)){return new p(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function N(e,t){j.defineProperty(e,t)}function $(e,t,s){return Object.assign({},s,{get(){return j.trackVolatile(),s.get.apply(this)}})}const E=o.getById(t.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:()=>E.get(),setEvent(e){E.set(e)}});class z{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}}const I=Object.freeze({reset:1,splice:2,optimized:3}),L=new z(0,l,0);L.reset=!0;const M=[L];function _(e,t,s,n,i,r){let o=0,a=0;const c=Math.min(s-t,r-i);if(0===t&&0===i&&(o=function(e,t,s){for(let n=0;n<s;++n)if(e[n]!==t[n])return n;return s}(e,n,c)),s===e.length&&r===n.length&&(a=function(e,t,s){let n=e.length,i=t.length,r=0;for(;r<s&&e[--n]===t[--i];)r++;return r}(e,n,c-o)),i+=o,r-=a,(s-=a)-(t+=o)==0&&r-i==0)return l;if(t===s){const e=new z(t,[],0);for(;i<r;)e.removed.push(n[i++]);return[e]}if(i===r)return[new z(t,[],s-t)];const h=function(e){let t=e.length-1,s=e[0].length-1,n=e[t][s];const i=[];for(;t>0||s>0;){if(0===t){i.push(2),s--;continue}if(0===s){i.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],l=e[t][s-1];let a;a=o<l?o<r?o:r:l<r?l:r,a===r?(r===n?i.push(0):(i.push(1),n=r),t--,s--):a===o?(i.push(3),t--,n=o):(i.push(2),s--,n=l)}return i.reverse()}(function(e,t,s,n,i,r){const o=r-i+1,l=s-t+1,a=new Array(o);let c,h;for(let e=0;e<o;++e)a[e]=new Array(l),a[e][0]=e;for(let e=0;e<l;++e)a[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<l;++r)e[t+r-1]===n[i+s-1]?a[s][r]=a[s-1][r-1]:(c=a[s-1][r]+1,h=a[s][r-1]+1,a[s][r]=c<h?c:h);return a}(e,t,s,n,i,r)),d=[];let u,f=t,p=i;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 z(f,[],0)),u.addedCount++,f++,u.removed.push(n[p]),p++;break;case 2:void 0===u&&(u=new z(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new z(f,[],0)),u.removed.push(n[p]),p++}return void 0!==u&&d.push(u),d}function F(e,t){let s=!1,n=0;for(let a=0;a<t.length;a++){const c=t[a];if(c.index+=n,s)continue;const h=(i=e.index,r=e.index+e.removed.length,o=c.index,l=c.index+c.addedCount,r<o||l<i?-1:r===o||l===i?0:i<o?r<l?r-o:l-o:l<r?l-i:r-i);if(h>=0){t.splice(a,1),a--,n-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-h;const i=e.removed.length+c.removed.length-h;if(e.addedCount||i){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(a,0,e),a++;const i=e.addedCount-e.removed.length;c.index+=i,n+=i}}var i,r,o,l;s||t.push(e)}let P=Object.freeze({support:I.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?l:s.length>1?function(e,t){let s=[];const n=[];for(let e=0,s=t.length;e<s;e++)F(t[e],n);for(let t=0,i=n.length;t<i;++t){const i=n[t];1!==i.addedCount||1!==i.removed.length?s=s.concat(_(e,i.index,i.index+i.addedCount,i.removed,0,i.removed.length)):i.removed[0]!==e[i.index]&&s.push(i)}return s}(t,s):s:M,pop(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new z(e.length,[r],0)),r},push(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new z(e.length-n.length,[],n.length).adjustTo(e)),i},reverse(e,t,s,n){const i=s.apply(e,n);return t.reset(e),i},shift(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new z(0,[r],0)),r},sort(e,t,s,n){const i=s.apply(e,n);return t.reset(e),i},splice(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new z(+n[0],i,n.length>2?n.length-2:0).adjustTo(e)),i},unshift(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new z(0,[],n.length).adjustTo(e)),i}});const R=Object.freeze({reset:M,setDefaultStrategy(e){P=e}});function H(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class D extends A{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,H(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,j.notify(e,"length"))}},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()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.oldCollection;void 0===t&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(e=this._strategy)&&void 0!==e?e:P).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,h.enqueue(this))}}let q=!1;const Q=Object.freeze({enable(){if(q)return;q=!0,j.setArrayObserverFactory((e=>new D(e)));const e=Array.prototype;e.$fastPatch||(H(e,"$fastPatch",1),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const n=this.$fastController;return void 0===n?t.apply(this,e):(null!==(s=n.strategy)&&void 0!==s?s:P)[t.name](this,n,t,e)}})))}});function U(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(Q.enable(),t=j.getNotifier(e)),j.track(t.lengthObserver,"length"),e.length}let J;function W(e){return e.map((e=>e instanceof G?W(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class G{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof G?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(J),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(W(this.styles)),this}static setDefaultStrategy(e){J=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new G(e):e instanceof G?e:new G([e])}}G.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const K=a(),X=Object.freeze({getForInstance:K.getForInstance,getByType:K.getByType,define:e=>(K.register({type:e}),e)});function Y(){return function(e){X.define(e)}}function Z(e,t){const s=[];let n="";const i=[],r=e=>{i.push(e)};for(let i=0,o=e.length-1;i<o;++i){n+=e[i];let o=t[i];void 0!==X.getForInstance(o)&&(o=o.createCSS(r)),o instanceof G||o instanceof CSSStyleSheet?(""!==n.trim()&&(s.push(n),n=""),s.push(o)):n+=o}return n+=e[e.length-1],""!==n.trim()&&s.push(n),{styles:s,behaviors:i}}const ee=(e,...t)=>{const{styles:s,behaviors:n}=Z(e,t),i=new G(s);return n.length?i.withBehaviors(...n):i};class te{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 G(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)}}X.define(te);const se=ee.partial=(e,...t)=>{const{styles:s,behaviors:n}=Z(e,t);return new te(s,n)},ne=`fast-${Math.random().toString(36).substring(2,8)}`,ie=`${ne}{`,re=`}${ne}`,oe=re.length;let le=0;const ae=()=>`${ne}-${++le}`,ce=Object.freeze({interpolation:e=>`${ie}${e}${re}`,attribute:e=>`${ae()}="${ie}${e}${re}"`,comment:e=>`\x3c!--${ie}${e}${re}--\x3e`}),he=Object.freeze({parse(e,t){const s=e.split(ie);if(1===s.length)return null;const n=[];for(let e=0,i=s.length;e<i;++e){const i=s[e],r=i.indexOf(re);let o;if(-1===r)o=i;else{const e=i.substring(0,r);n.push(t[e]),o=i.substring(r+oe)}""!==o&&n.push(o)}return n}}),de=a(),ue=Object.freeze({getForInstance:de.getForInstance,getByType:de.getByType,define:(e,t)=>((t=t||{}).type=e,de.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?d.tokenList:d.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=d.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=d.event;break;default:e.targetAspect=t,e.aspectType=d.attribute}else e.aspectType=d.content}});function fe(e){return function(t){ue.define(t,e)}}class pe{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class ge{constructor(e){this.options=e,this.toJSON=i}createHTML(e){return ce.attribute(e(this))}createBehavior(){return this}}class be extends pe{createObserver(e,t){return j.binding(this.evaluate,t,this.isVolatile)}}class ve extends pe{constructor(){super(...arguments),this.toJSON=i}createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}const ye={[d.attribute]:b.setAttribute,[d.booleanAttribute]:b.setBooleanAttribute,[d.property]:(e,t,s)=>e[t]=s,[d.content]:function(e,t,s,n){if(null==s&&(s=""),s.create){e.textContent="";let t=e.$fastView;void 0===t?t=s.create():e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create()),t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(n.source,n.context)):(t.isComposed=!0,t.bind(n.source,n.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[d.tokenList]:function(e,t,s){var n;const i=`${this.id}-t`,r=null!==(n=e[i])&&void 0!==n?n:e[i]={v:0,cv:Object.create(null)},o=r.cv;let l=r.v;const a=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]=l,a.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const e in o)o[e]===l&&a.remove(e)}},[d.event]:()=>{}};class me{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=d.content}createHTML(e){return ce.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=ye[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw o.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];switch(this.aspectType){case d.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case d.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);n.target=s,n.controller=e,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,n=t.controller;this.updateTarget(s,this.targetAspect,t.bind(n),n)}}function we(e,t,s=j.isVolatileBinding(e)){return new be(e,t,s)}function xe(e,t){return new ve(e,t)}function Ce(e,t){const s=new be(e);return s.options=t,s}function Se(e){return s(e)?we(e):e instanceof pe?e:xe((()=>e))}function Oe(e,t){const s=e.parentNode;let n,i=e;for(;i!==t;)n=i.nextSibling,s.removeChild(i),i=n;s.removeChild(t)}ue.define(me,{aspected:!0});class Te{constructor(e,t,s){this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=k.unknown,this.context=this,this.index=0,this.length=0,this.toJSON=i,this.firstChild=e.firstChild,this.lastChild=e.lastChild}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}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let n,i=this.firstChild;for(;i!==t;)n=i.nextSibling,s.insertBefore(i,e),i=n;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,n=this.firstChild;for(;n!==t;)s=n.nextSibling,e.appendChild(n),n=s;e.appendChild(t)}dispose(){Oe(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const n=this.factories;for(let e=0,t=n.length;e<t;++e){const t=n[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){Oe(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}j.defineProperty(Te.prototype,"index"),j.defineProperty(Te.prototype,"length");const Ae=(e,t)=>`${e}.${t}`,Be={},ke={index:0,node:null};function je(e){e.startsWith("fast-")||o.warn(1204,{name:e})}const Ne=new Proxy(document.createElement("div"),{get(e,t){je(t);const n=Reflect.get(e,t);return s(n)?n.bind(e):n},set:(e,t,s)=>(je(t),Reflect.set(e,t,s))});class $e{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,n,i){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,n)),e.id=null!==(r=e.id)&&void 0!==r?r:ae(),e.targetNodeId=s,e.targetTagName=i,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const n=this.descriptors;if("r"===t||"h"===t||n[t])return;if(!n[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),n=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,n)}let i=Be[t];if(!i){const n=`_${t}`;Be[t]=i={get(){var t;return null!==(t=this[n])&&void 0!==t?t:this[n]=this[e].childNodes[s]}}}n[t]=i}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:Ne;for(const e of this.nodeIds)s[e];return new Te(t,this.factories,s)}}function Ee(e,t,s,n,i,r=!1){const o=s.attributes,l=e.directives;for(let a=0,c=o.length;a<c;++a){const h=o[a],d=h.value,u=he.parse(d,l);let f=null;null===u?r&&(f=new me(xe((()=>d),e.policy)),ue.assignAspect(f,h.name)):f=Ie.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(h),a--,c--,e.addFactory(f,t,n,i,s.tagName))}}function Ve(e,t,s){let n=0,i=t.firstChild;for(;i;){const t=ze(e,s,i,n);i=t.node,n=t.index}}function ze(e,t,s,i){const r=Ae(t,i);switch(s.nodeType){case 1:Ee(e,t,s,r,i),Ve(e,s,r);break;case 3:return function(e,t,s,i,r){const o=he.parse(t.textContent,e.directives);if(null===o)return ke.node=t.nextSibling,ke.index=r+1,ke;let l,a=l=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(r++,i=Ae(s,r),l=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),n(c)?l.textContent=c:(l.textContent=" ",ue.assignAspect(c),e.addFactory(c,s,i,r,null)),a=l}return ke.index=r+1,ke.node=a.nextSibling,ke}(e,s,t,r,i);case 8:const o=he.parse(s.data,e.directives);null!==o&&e.addFactory(Ie.aggregate(o),t,r,i,null)}return ke.index=i+1,ke.node=s.nextSibling,ke}const Ie={compile(e,t,s=b.policy){let i;if(n(e)){i=document.createElement("TEMPLATE"),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(i=t)}else i=e;const r=document.adoptNode(i.content),o=new $e(r,t,s);var l,a;return Ee(o,"",i,"h",0,!0),l=r.firstChild,a=t,(l&&8==l.nodeType&&null!==he.parse(l.data,a)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),Ve(o,r,"r"),ke.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=b.policy){if(1===e.length)return e[0];let s,i,r,o=!1;const l=e.length,a=e.map((e=>n(e)?()=>e:(s=e.sourceAspect||s,i=e.dataBinding||i,o=o||e.dataBinding.isVolatile,r=r||e.dataBinding.policy,e.dataBinding.evaluate)));i.evaluate=(e,t)=>{let s="";for(let n=0;n<l;++n)s+=a[n](e,t);return s},i.isVolatile=o,i.policy=null!=r?r:t;const c=new me(i);return ue.assignAspect(c,s),c}},Le=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Me(e,t,s,n=ue.getForInstance(e)){if(n.aspected){const s=Le.exec(t);null!==s&&ue.assignAspect(e,s[2])}return e.createHTML(s)}class _e{constructor(e,t={},s){this.policy=s,this.result=null,this.toJSON=i,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=Ie.compile(this.html,this.factories,this.policy)),this.result.createView(e)}withPolicy(e){if(this.result)throw o.error(1208);if(this.policy)throw o.error(1207);return this.policy=e,this}render(e,t,s){const n=this.create(s);return n.bind(e),n.appendTo(t),n}static create(e,t,n){let i="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=ae();return r[s]=e,s};for(let n=0,r=e.length-1;n<r;++n){const r=e[n];let l,a=t[n];if(i+=r,s(a))a=new me(we(a));else if(a instanceof pe)a=new me(a);else if(!(l=ue.getForInstance(a))){const e=a;a=new me(xe((()=>e)))}i+=Me(a,r,o,l)}return new _e(i+e[e.length-1],r,n)}}function Fe(e,...t){if(Array.isArray(e)&&Array.isArray(e.raw))return _e.create(e,t);throw o.error(1206)}class Pe extends ge{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}ue.define(Pe);const Re=e=>new Pe(e);function He(e,t){const n=s(e)?e:()=>e,i=s(t)?t:()=>t;return(e,t)=>n(e,t)?i(e,t):null}const De=Object.freeze({positioning:!1,recycle:!0});function qe(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.bind(t[s])}function Qe(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}class Ue{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=qe,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=Qe)}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),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():this.updateViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=l);const t=this.itemsObserver,s=this.itemsObserver=j.getNotifier(this.items),n=t!==s;n&&null!==t&&t.unsubscribe(this),(n||e)&&s.subscribe(this)}updateViews(e){const t=this.views,s=this.bindView,n=this.items,i=this.template,r=this.controller,o=this.directive.options.recycle,l=[];let a=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=l.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=l[a],a++),c--):d=i.create(),t.splice(p,0,d),s(d,n,p,r),d.insertBefore(h)}b[f]&&l.push(...b.slice(f))}for(let e=a,t=l.length;e<t;++e)l[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const n=t[e].context;n.length=s,n.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,n=this.location,i=this.bindView,r=this.controller;let o=t.length,l=this.views,a=l.length;if(0!==o&&!e&&this.directive.options.recycle||(Te.disposeContiguousBatch(l),a=0),0===a){this.views=l=new Array(o);for(let e=0;e<o;++e){const o=s.create();i(o,t,e,r),l[e]=o,o.insertBefore(n)}}else{let e=0;for(;e<o;++e)if(e<a){i(l[e],t,e,r)}else{const o=s.create();i(o,t,e,r),l.push(o),o.insertBefore(n)}const c=l.splice(e,a-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)e[t].unbind()}}class Je{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,Q.enable()}createHTML(e){return ce.comment(e(this))}createBehavior(){return new Ue(this)}}function We(e,t,s=De){const n=Se(e),i=Se(t);return new Je(n,i,Object.assign(Object.assign({},De),s))}ue.define(Je);const Ge=e=>1===e.nodeType,Ke=e=>e?t=>1===t.nodeType&&t.matches(e):Ge;class Xe extends ge{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}}class Ye extends Xe{observe(e){e.addEventListener("slotchange",this)}disconnect(e){e.removeEventListener("slotchange",this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Ze(e){return n(e)&&(e={property:e}),new Ye(e)}ue.define(Ye);class et extends Xe{constructor(e){super(e),this.observerProperty=`${this.id}-o`,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=i,t.target=e,e[this.observerProperty]=t),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 tt(e){return n(e)&&(e={property:e}),new et(e)}ue.define(et);class st{constructor(e){this.html=e}createHTML(){return this.html}}function nt(e){return new st(e)}ue.define(st);const it=Object.freeze({locate:c()}),rt={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};function ot(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const lt={toView(e){const t=ot(e);return t?t.toString():t},fromView:ot};class at{constructor(e,t,s=t.toLowerCase(),n="reflect",i){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=n,this.converter=i,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,"boolean"===n&&void 0===i&&(this.converter=rt)}setValue(e,t){const s=e[this.fieldName],n=this.converter;void 0!==n&&(t=n.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return j.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||h.enqueue((()=>{s.add(e);const n=e[this.fieldName];switch(t){case"reflect":const t=this.converter;b.setAttribute(e,this.attribute,void 0!==t?t.toView(n):n);break;case"boolean":b.setBooleanAttribute(e,this.attribute,n)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(it.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 at(e,i)):s.push(new at(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function ct(e,t){let s;function n(e,t){arguments.length>1&&(s.property=t),it.locate(e.constructor).push(s)}return arguments.length>1?(s={},void n(e,t)):(s=void 0===e?{}:e,n)}const ht={mode:"open"},dt={},ut=new Set,ft=o.getById(t.elementRegistry,(()=>a()));class pt{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.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,r=at.collect(e,t.attributes),o=new Array(r.length),l={},a={};for(let e=0,t=r.length;e<t;++e){const t=r[e];o[e]=t.attribute,l[t.name]=t,a[t.attribute]=t,j.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=r,this.propertyLookup=l,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?ht:null===t.shadowOptions?void 0:Object.assign(Object.assign({},ht),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?dt:Object.assign(Object.assign({},dt),t.elementOptions),this.styles=G.normalize(t.styles),ft.register(this)}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 ut.has(e)||ft.getByType(e)?new pt(class extends e{},t):new pt(e,t)}static registerBaseType(e){ut.add(e)}}pt.getByType=ft.getByType,pt.getForInstance=ft.getForInstance;const gt={bubbles:!0,composed:!0,cancelable:!0},bt=new WeakMap;function vt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:bt.get(e))&&void 0!==s?s:null}let yt;class mt extends B{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._mainStyles=null,this.$fastController=this,this.view=null,this.toJSON=i,this.source=e,this.definition=t;const s=t.shadowOptions;if(void 0!==s){let t=e.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=e.attachShadow(s),"closed"===s.mode&&bt.set(e,t))}const n=j.getAccessors(e);if(n.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,i=n.length;s<i;++s){const i=n[s].name,r=e[i];void 0!==r&&(delete e[i],t[i]=r)}}}get isConnected(){return j.track(this,"isConnected"),1===this.stage}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 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))}addBehavior(e){var t,s;const n=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,i=null!==(s=n.get(e))&&void 0!==s?s:0;0===i?(n.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):n.set(e,i+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const n=s.get(e);void 0!==n&&(1===n||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,n-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=vt(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=vt(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.addBehavior(t[e])}}connect(){if(3!==this.stage)return;if(this.stage=0,null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let n=0,i=s.length;n<i;++n){const i=s[n];e[i]=t[i]}this.boundObservables=null}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.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,j.notify(this,"isConnected")}disconnect(){if(1!==this.stage)return;this.stage=2,j.notify(this,"isConnected"),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.stage=3}onAttributeChangedCallback(e,t,s){const n=this.definition.attributeLookup[e];void 0!==n&&n.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},gt),s)))}renderTemplate(e){var t;const s=this.source,n=null!==(t=vt(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=n.firstChild;null!==e;e=n.firstChild)n.removeChild(e)}e&&(this.view=e.render(s,n,s),this.view.sourceLifetime=k.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=pt.getForInstance(e);if(void 0===s)throw o.error(1401);return e.$fastController=new yt(e,s)}static setStrategy(e){yt=e}}function wt(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=vt(e))&&void 0!==t?t:e.getRootNode()}mt.setStrategy(mt);class xt{constructor(e){const t=xt.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){const t=wt(e);t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=wt(e),s=this.sheets;t.adoptedStyleSheets=t.adoptedStyleSheets.filter((e=>-1===s.indexOf(e)))}}xt.styleSheetCache=new Map;let Ct=0;function St(e){return e===document?document.body:e}function Ot(e){const t=class extends e{constructor(){super(),mt.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return pt.registerBaseType(t),t}function Tt(e,t){return s(e)?pt.compose(e,t).define().type:pt.compose(this,e).define().type}G.setDefaultStrategy(G.supportsAdoptedStyleSheets?xt:class{constructor(e){this.styles=e,this.styleClass="fast-"+ ++Ct}addStylesTo(e){e=St(wt(e));const t=this.styles,s=this.styleClass;for(let n=0;n<t.length;n++){const i=document.createElement("style");i.innerHTML=t[n],i.className=s,e.append(i)}}removeStylesFrom(e){const t=(e=St(wt(e))).querySelectorAll(`.${this.styleClass}`);t[0].parentNode;for(let s=0,n=t.length;s<n;++s)e.removeChild(t[s])}});const At=Object.assign(Ot(HTMLElement),{from:function(e){return Ot(e)},define:Tt,compose:function(e,t){return s(e)?pt.compose(e,t):pt.compose(this,e)}});function Bt(e){return function(t){Tt(t,e)}}b.setPolicy(T.create());export{Q as ArrayObserver,it as AttributeConfiguration,at as AttributeDefinition,pe as Binding,X as CSSDirective,et as ChildrenDirective,Ie as Compiler,b as DOM,d as DOMAspect,st as DangerousHTMLDirective,mt as ElementController,G as ElementStyles,V as ExecutionContext,o as FAST,At as FASTElement,pt as FASTElementDefinition,me as HTMLBindingDirective,ue as HTMLDirective,Te as HTMLView,ce as Markup,Xe as NodeObservationDirective,j as Observable,he as Parser,B as PropertyChangeNotifier,Pe as RefDirective,Ue as RepeatBehavior,Je as RepeatDirective,Ye as SlottedDirective,k as SourceLifetime,z as Splice,R as SpliceStrategy,I as SpliceStrategySupport,ge as StatelessAttachedAttributeDirective,A as SubscriberSet,h as Updates,_e as ViewTemplate,ct as attr,we as bind,rt as booleanConverter,tt as children,c as createMetadataLocator,a as createTypeRegistry,ee as css,Y as cssDirective,se as cssPartial,Bt as customElement,nt as dangerousHTML,Ke as elements,l as emptyArray,Fe as html,fe as htmlDirective,U as lengthOf,Ce as listener,Se as normalizeBinding,lt as nullableNumberConverter,N as observable,xe as oneTime,Re as ref,We as repeat,Ze as slotted,$ as volatile,He as when};
1
+ let e;try{if(document.currentScript)e=document.currentScript.getAttribute("fast-kernel");else{const t=document.getElementsByTagName("script");e=t[t.length-1].getAttribute("fast-kernel")}}catch(t){e="isolate"}let t;switch(e){case"share":t=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":t=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)}`;t=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const s=e=>"function"==typeof e,i=e=>"string"==typeof e,n=()=>{};!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 r={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},r));const o=globalThis.FAST;if(void 0===o.getById){const e=Object.create(null);Reflect.defineProperty(o,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},r))}void 0===o.error&&Object.assign(o,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const l=Object.freeze([]);function a(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function c(){const e=new WeakMap;return function(t){let 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}}const h=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),d=e=>e,u=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:d}):{createHTML:d};let f=Object.freeze({createHTML:e=>u.createHTML(e),protect:(e,t,s,i)=>i});const p=f,g=Object.freeze({get policy(){return f},setPolicy(e){if(f!==p)throw o.error(1201);f=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 b(e,t,s,n){return(e,t,s,...r)=>{i(s)&&(s=s.replace("javascript:","")),n(e,t,s,...r)}}function v(e,t,s,i){throw new Error(`${s} on ${null!=e?e:"text"} is blocked by the current DOMPolicy.`)}const y={onabort:v,onauxclick:v,onbeforeinput:v,onbeforematch:v,onblur:v,oncancel:v,oncanplay:v,oncanplaythrough:v,onchange:v,onclick:v,onclose:v,oncontextlost:v,oncontextmenu:v,oncontextrestored:v,oncopy:v,oncuechange:v,oncut:v,ondblclick:v,ondrag:v,ondragend:v,ondragenter:v,ondragleave:v,ondragover:v,ondragstart:v,ondrop:v,ondurationchange:v,onemptied:v,onended:v,onerror:v,onfocus:v,onformdata:v,oninput:v,oninvalid:v,onkeydown:v,onkeypress:v,onkeyup:v,onload:v,onloadeddata:v,onloadedmetadata:v,onloadstart:v,onmousedown:v,onmouseenter:v,onmouseleave:v,onmousemove:v,onmouseout:v,onmouseover:v,onmouseup:v,onpaste:v,onpause:v,onplay:v,onplaying:v,onprogress:v,onratechange:v,onreset:v,onresize:v,onscroll:v,onsecuritypolicyviolation:v,onseeked:v,onseeking:v,onselect:v,onslotchange:v,onstalled:v,onsubmit:v,onsuspend:v,ontimeupdate:v,ontoggle:v,onvolumechange:v,onwaiting:v,onwebkitanimationend:v,onwebkitanimationiteration:v,onwebkitanimationstart:v,onwebkittransitionend:v,onwheel:v},m={elements:{a:{[h.attribute]:{href:b},[h.property]:{href:b}},area:{[h.attribute]:{href:b},[h.property]:{href:b}},button:{[h.attribute]:{formaction:b},[h.property]:{formAction:b}},embed:{[h.attribute]:{src:v},[h.property]:{src:v}},form:{[h.attribute]:{action:b},[h.property]:{action:b}},frame:{[h.attribute]:{src:b},[h.property]:{src:b}},iframe:{[h.attribute]:{src:b},[h.property]:{src:b,srcdoc:v}},input:{[h.attribute]:{formaction:b},[h.property]:{formAction:b}},link:{[h.attribute]:{href:v},[h.property]:{href:v}},object:{[h.attribute]:{codebase:v,data:v},[h.property]:{codeBase:v,data:v}},script:{[h.attribute]:{src:v,text:v},[h.property]:{src:v,text:v,innerText:v,textContent:v}},style:{[h.property]:{innerText:v,textContent:v}}},aspects:{[h.attribute]:Object.assign({},y),[h.property]:Object.assign({innerHTML:v},y),[h.event]:Object.assign({},y)}};function w(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]=w(r,{});break;default:s[i]=w(n,r)}}for(const t in e)t in s||(s[t]=w(e[t],{}));return Object.freeze(s)}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]=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 S(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const O=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=m,Object.freeze({elements:r.elements?C(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(),l=n.elements[o];if(l){const n=S(l,e,t,s,i);if(n)return n}return null!==(r=S(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),T=o.getById(t.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 l(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:e=>i=e})}));class A{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 B{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 A(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new A(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 k=Object.freeze({unknown:void 0,coupled:1}),j=o.getById(t.observable,(()=>{const e=T.enqueue,t=/(:|&&|\|\||if)/,r=new WeakMap;let l,a=e=>{throw o.error(1101)};function h(e){var t;let s=null!==(t=e.$fastController)&&void 0!==t?t:r.get(e);return void 0===s&&(Array.isArray(e)?s=a(e):r.set(e,s=new B(e))),s}const d=c();class u{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==l&&l.watch(e,this.name),e[this.field]}setValue(e,t){const i=this.field,n=e[i];if(n!==t){e[i]=t;const r=e[this.callback];s(r)&&r.call(e,n,t),h(e).notify(this.name)}}}class f extends A{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,this.toJSON=n}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!==k.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=l;let i;l=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{l=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=h(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;l=void 0,t=s.propertySource[s.propertyName],l=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 Object.freeze({setArrayObserverFactory(e){a=e},getNotifier:h,track(e,t){l&&l.watch(e,t)},trackVolatile(){l&&(l.needsRefresh=!0)},notify(e,t){h(e).notify(t)},defineProperty(e,t){i(t)&&(t=new u(t)),d(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:d,binding(e,t,s=this.isVolatileBinding(e)){return new f(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function N(e,t){j.defineProperty(e,t)}function $(e,t,s){return Object.assign({},s,{get(){return j.trackVolatile(),s.get.apply(this)}})}const V=o.getById(t.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),E=Object.freeze({default:{index:0,length:0,get event(){return E.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>V.get(),setEvent(e){V.set(e)}});class z{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}}const L=Object.freeze({reset:1,splice:2,optimized:3}),I=new z(0,l,0);I.reset=!0;const M=[I];function _(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 z(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new z(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],l=e[t][s-1];let a;a=o<l?o<r?o:r:l<r?l:r,a===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):a===o?(n.push(3),t--,i=o):(n.push(2),s--,i=l)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,l=s-t+1,a=new Array(o);let c,h;for(let e=0;e<o;++e)a[e]=new Array(l),a[e][0]=e;for(let e=0;e<l;++e)a[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<l;++r)e[t+r-1]===i[n+s-1]?a[s][r]=a[s-1][r-1]:(c=a[s-1][r]+1,h=a[s][r-1]+1,a[s][r]=c<h?c:h);return a}(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 z(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new z(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new z(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&d.push(u),d}function F(e,t){let s=!1,i=0;for(let a=0;a<t.length;a++){const c=t[a];if(c.index+=i,s)continue;const h=(n=e.index,r=e.index+e.removed.length,o=c.index,l=c.index+c.addedCount,r<o||l<n?-1:r===o||l===n?0:n<o?r<l?r-o:l-o:l<r?l-n:r-n);if(h>=0){t.splice(a,1),a--,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(a,0,e),a++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,l;s||t.push(e)}let P=Object.freeze({support:L.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?l:s.length>1?function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)F(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(_(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):s:M,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new z(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new z(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new z(0,[r],0)),r},sort(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new z(+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 z(0,[],i.length).adjustTo(e)),n}});const R=Object.freeze({reset:M,setDefaultStrategy(e){P=e}});function H(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class D extends A{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,H(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,j.notify(e,"length"))}},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()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.oldCollection;void 0===t&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(e=this._strategy)&&void 0!==e?e:P).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,T.enqueue(this))}}let Q=!1;const q=Object.freeze({enable(){if(Q)return;Q=!0,j.setArrayObserverFactory((e=>new D(e)));const e=Array.prototype;e.$fastPatch||(H(e,"$fastPatch",1),[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:P)[t.name](this,i,t,e)}})))}});function U(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(q.enable(),t=j.getNotifier(e)),j.track(t.lengthObserver,"length"),e.length}let J;function W(e){return e.map((e=>e instanceof G?W(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class G{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof G?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(J),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(W(this.styles)),this}static setDefaultStrategy(e){J=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new G(e):e instanceof G?e:new G([e])}}G.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const K=a(),X=Object.freeze({getForInstance:K.getForInstance,getByType:K.getByType,define:e=>(K.register({type:e}),e)});function Y(){return function(e){X.define(e)}}function Z(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];void 0!==X.getForInstance(o)&&(o=o.createCSS(r)),o instanceof G||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const ee=(e,...t)=>{const{styles:s,behaviors:i}=Z(e,t),n=new G(s);return i.length?n.withBehaviors(...i):n};class te{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(i(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new G(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)}}X.define(te),ee.partial=(e,...t)=>{const{styles:s,behaviors:i}=Z(e,t);return new te(s,i)};const se=`fast-${Math.random().toString(36).substring(2,8)}`,ie=`${se}{`,ne=`}${se}`,re=ne.length;let oe=0;const le=()=>`${se}-${++oe}`,ae=Object.freeze({interpolation:e=>`${ie}${e}${ne}`,attribute:e=>`${le()}="${ie}${e}${ne}"`,comment:e=>`\x3c!--${ie}${e}${ne}--\x3e`}),ce=Object.freeze({parse(e,t){const s=e.split(ie);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(ne);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+re)}""!==o&&i.push(o)}return i}}),he=a(),de=Object.freeze({getForInstance:he.getForInstance,getByType:he.getByType,define:(e,t)=>((t=t||{}).type=e,he.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?h.tokenList:h.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=h.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=h.event;break;default:e.targetAspect=t,e.aspectType=h.attribute}else e.aspectType=h.content}});function ue(e){return function(t){de.define(t,e)}}class fe{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class pe{constructor(e){this.options=e,this.toJSON=n}createHTML(e){return ae.attribute(e(this))}createBehavior(){return this}}class ge extends fe{createObserver(e,t){return j.binding(this.evaluate,t,this.isVolatile)}}class be extends fe{constructor(){super(...arguments),this.toJSON=n}createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}const ve={[h.attribute]:g.setAttribute,[h.booleanAttribute]:g.setBooleanAttribute,[h.property]:(e,t,s)=>e[t]=s,[h.content]:function(e,t,s,i){if(null==s&&(s=""),s.create){e.textContent="";let t=e.$fastView;void 0===t?t=s.create():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}},[h.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 l=r.v;const a=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]=l,a.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const e in o)o[e]===l&&a.remove(e)}},[h.event]:()=>{}};class ye{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=h.content}createHTML(e){return ae.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=ve[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw o.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];switch(this.aspectType){case h.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case h.content:e.onUnbind(this);default:const i=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);i.target=s,i.controller=e,this.updateTarget(s,this.targetAspect,i.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){E.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);E.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)}}function me(e,t,s=j.isVolatileBinding(e)){return new ge(e,t,s)}function we(e,t){return new be(e,t)}function xe(e,t){const s=new ge(e);return s.options=t,s}function Ce(e){return s(e)?me(e):e instanceof fe?e:we((()=>e))}function Se(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}de.define(ye,{aspected:!0});class Oe{constructor(e,t,s){this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=k.unknown,this.context=this,this.index=0,this.length=0,this.toJSON=n,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get event(){return E.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}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(){Se(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){Se(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}j.defineProperty(Oe.prototype,"index"),j.defineProperty(Oe.prototype,"length");const Te=(e,t)=>`${e}.${t}`,Ae={},Be={index:0,node:null};function ke(e){e.startsWith("fast-")||o.warn(1204,{name:e})}const je=new Proxy(document.createElement("div"),{get(e,t){ke(t);const i=Reflect.get(e,t);return s(i)?i.bind(e):i},set:(e,t,s)=>(ke(t),Reflect.set(e,t,s))});class Ne{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:le(),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=Ae[t];if(!n){const i=`_${t}`;Ae[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:je;for(const e of this.nodeIds)s[e];return new Oe(t,this.factories,s)}}function $e(e,t,s,i,n,r=!1){const o=s.attributes,l=e.directives;for(let a=0,c=o.length;a<c;++a){const h=o[a],d=h.value,u=ce.parse(d,l);let f=null;null===u?r&&(f=new ye(we((()=>d),e.policy)),de.assignAspect(f,h.name)):f=ze.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(h),a--,c--,e.addFactory(f,t,i,n,s.tagName))}}function Ve(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=Ee(e,s,n,i);n=t.node,i=t.index}}function Ee(e,t,s,n){const r=Te(t,n);switch(s.nodeType){case 1:$e(e,t,s,r,n),Ve(e,s,r);break;case 3:return function(e,t,s,n,r){const o=ce.parse(t.textContent,e.directives);if(null===o)return Be.node=t.nextSibling,Be.index=r+1,Be;let l,a=l=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(r++,n=Te(s,r),l=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),i(c)?l.textContent=c:(l.textContent=" ",de.assignAspect(c),e.addFactory(c,s,n,r,null)),a=l}return Be.index=r+1,Be.node=a.nextSibling,Be}(e,s,t,r,n);case 8:const o=ce.parse(s.data,e.directives);null!==o&&e.addFactory(ze.aggregate(o),t,r,n,null)}return Be.index=n+1,Be.node=s.nextSibling,Be}const ze={compile(e,t,s=g.policy){let n;if(i(e)){n=document.createElement("TEMPLATE"),n.innerHTML=s.createHTML(e);const t=n.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(n=t)}else n=e;const r=document.adoptNode(n.content),o=new Ne(r,t,s);var l,a;return $e(o,"",n,"h",0,!0),l=r.firstChild,a=t,(l&&8==l.nodeType&&null!==ce.parse(l.data,a)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),Ve(o,r,"r"),Be.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=g.policy){if(1===e.length)return e[0];let s,n,r,o=!1;const l=e.length,a=e.map((e=>i(e)?()=>e:(s=e.sourceAspect||s,n=e.dataBinding||n,o=o||e.dataBinding.isVolatile,r=r||e.dataBinding.policy,e.dataBinding.evaluate)));n.evaluate=(e,t)=>{let s="";for(let i=0;i<l;++i)s+=a[i](e,t);return s},n.isVolatile=o,n.policy=null!=r?r:t;const c=new ye(n);return de.assignAspect(c,s),c}},Le=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Ie=Object.create(null);class Me{constructor(e,t=Ie){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function _e(e,t,s,i=de.getForInstance(e)){if(i.aspected){const s=Le.exec(t);null!==s&&de.assignAspect(e,s[2])}return e.createHTML(s)}Me.empty=new Me(""),de.define(Me);class Fe{constructor(e,t={},s){this.policy=s,this.result=null,this.toJSON=n,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=ze.compile(this.html,this.factories,this.policy)),this.result.createView(e)}inline(){return new Me(i(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw o.error(1208);if(this.policy)throw o.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,i){let n="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=le();return r[s]=e,s};for(let i=0,r=e.length-1;i<r;++i){const r=e[i];let l,a=t[i];if(n+=r,s(a))a=new ye(me(a));else if(a instanceof fe)a=new ye(a);else if(!(l=de.getForInstance(a))){const e=a;a=new ye(we((()=>e)))}n+=_e(a,r,o,l)}return new Fe(n+e[e.length-1],r,i)}}const Pe=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Fe.create(e,t);throw o.error(1206)};Pe.partial=e=>new Me(e);class Re extends pe{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}de.define(Re);const He=e=>new Re(e);function De(e,t){const i=s(e)?e:()=>e,n=s(t)?t:()=>t;return(e,t)=>i(e,t)?n(e,t):null}const Qe=Object.freeze({positioning:!1,recycle:!0});function qe(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Ue(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])}class Je{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=qe,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=Ue)}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),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():this.updateViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=l);const t=this.itemsObserver,s=this.itemsObserver=j.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,l=[];let a=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=l.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=l[a],a++),c--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(h)}b[f]&&l.push(...b.slice(f))}for(let e=a,t=l.length;e<t;++e)l[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,l=this.views,a=l.length;if(0!==o&&!e&&this.directive.options.recycle||(Oe.disposeContiguousBatch(l),a=0),0===a){this.views=l=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),l[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<a){n(l[e],t,e,r)}else{const o=s.create();n(o,t,e,r),l.push(o),o.insertBefore(i)}const c=l.splice(e,a-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)e[t].unbind()}}class We{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,q.enable()}createHTML(e){return ae.comment(e(this))}createBehavior(){return new Je(this)}}function Ge(e,t,s=Qe){const i=Ce(e),n=Ce(t);return new We(i,n,Object.assign(Object.assign({},Qe),s))}de.define(We);const Ke=e=>1===e.nodeType,Xe=e=>e?t=>1===t.nodeType&&t.matches(e):Ke;class Ye 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}}class Ze extends Ye{observe(e){e.addEventListener("slotchange",this)}disconnect(e){e.removeEventListener("slotchange",this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function et(e){return i(e)&&(e={property:e}),new Ze(e)}de.define(Ze);class tt extends Ye{constructor(e){super(e),this.observerProperty=`${this.id}-o`,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=n,t.target=e,e[this.observerProperty]=t),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 st(e){return i(e)&&(e={property:e}),new tt(e)}de.define(tt);const it=Object.freeze({locate:c()}),nt={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e},rt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:nt.fromView(e)};function ot(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const lt={toView(e){const t=ot(e);return t?t.toString():t},fromView:ot};class at{constructor(e,t,s=t.toLowerCase(),i="reflect",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,"boolean"===i&&void 0===n&&(this.converter=nt)}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 j.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"reflect":const t=this.converter;g.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":g.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(it.locate(e));for(let n=0,r=t.length;n<r;++n){const r=t[n];if(void 0!==r)for(let t=0,n=r.length;t<n;++t){const n=r[t];i(n)?s.push(new at(e,n)):s.push(new at(e,n.property,n.attribute,n.mode,n.converter))}}return s}}function ct(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),it.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const ht={mode:"open"},dt={},ut=new Set,ft=o.getById(t.elementRegistry,(()=>a()));class pt{constructor(e,t=e.definition){var s;this.platformDefined=!1,i(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const n=e.prototype,r=at.collect(e,t.attributes),o=new Array(r.length),l={},a={};for(let e=0,t=r.length;e<t;++e){const t=r[e];o[e]=t.attribute,l[t.name]=t,a[t.attribute]=t,j.defineProperty(n,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=r,this.propertyLookup=l,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?ht:null===t.shadowOptions?void 0:Object.assign(Object.assign({},ht),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?dt:Object.assign(Object.assign({},dt),t.elementOptions),this.styles=G.normalize(t.styles),ft.register(this)}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 ut.has(e)||ft.getByType(e)?new pt(class extends e{},t):new pt(e,t)}static registerBaseType(e){ut.add(e)}}pt.getByType=ft.getByType,pt.getForInstance=ft.getForInstance;const gt={bubbles:!0,composed:!0,cancelable:!0},bt=new WeakMap;function vt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:bt.get(e))&&void 0!==s?s:null}let yt;class mt extends B{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._mainStyles=null,this.$fastController=this,this.view=null,this.toJSON=n,this.source=e,this.definition=t;const s=t.shadowOptions;if(void 0!==s){let t=e.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=e.attachShadow(s),"closed"===s.mode&&bt.set(e,t))}const i=j.getAccessors(e);if(i.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,n=i.length;s<n;++s){const n=i[s].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return j.track(this,"isConnected"),1===this.stage}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 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))}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=vt(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=vt(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.addBehavior(t[e])}}connect(){if(3!==this.stage)return;if(this.stage=0,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}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.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,j.notify(this,"isConnected")}disconnect(){if(1!==this.stage)return;this.stage=2,j.notify(this,"isConnected"),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);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},gt),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=vt(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=k.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=pt.getForInstance(e);if(void 0===s)throw o.error(1401);return e.$fastController=new yt(e,s)}static setStrategy(e){yt=e}}function wt(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=vt(e))&&void 0!==t?t:e.getRootNode()}mt.setStrategy(mt);class xt{constructor(e){const t=xt.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){const t=wt(e);t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=wt(e),s=this.sheets;t.adoptedStyleSheets=t.adoptedStyleSheets.filter((e=>-1===s.indexOf(e)))}}xt.styleSheetCache=new Map;let Ct=0;function St(e){return e===document?document.body:e}function Ot(e){const t=class extends e{constructor(){super(),mt.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return pt.registerBaseType(t),t}function Tt(e,t){return s(e)?pt.compose(e,t).define().type:pt.compose(this,e).define().type}G.setDefaultStrategy(G.supportsAdoptedStyleSheets?xt:class{constructor(e){this.styles=e,this.styleClass="fast-"+ ++Ct}addStylesTo(e){e=St(wt(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=St(wt(e))).querySelectorAll(`.${this.styleClass}`);t[0].parentNode;for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}});const At=Object.assign(Ot(HTMLElement),{from:function(e){return Ot(e)},define:Tt,compose:function(e,t){return s(e)?pt.compose(e,t):pt.compose(this,e)}});function Bt(e){return function(t){Tt(t,e)}}g.setPolicy(O.create());export{q as ArrayObserver,it as AttributeConfiguration,at as AttributeDefinition,fe as Binding,X as CSSDirective,tt as ChildrenDirective,ze as Compiler,g as DOM,h as DOMAspect,mt as ElementController,G as ElementStyles,E as ExecutionContext,o as FAST,At as FASTElement,pt as FASTElementDefinition,ye as HTMLBindingDirective,de as HTMLDirective,Oe as HTMLView,Me as InlineTemplateDirective,ae as Markup,Ye as NodeObservationDirective,j as Observable,ce as Parser,B as PropertyChangeNotifier,Re as RefDirective,Je as RepeatBehavior,We as RepeatDirective,Ze as SlottedDirective,k as SourceLifetime,z as Splice,R as SpliceStrategy,L as SpliceStrategySupport,pe as StatelessAttachedAttributeDirective,A as SubscriberSet,T as Updates,Fe as ViewTemplate,ct as attr,me as bind,nt as booleanConverter,st as children,c as createMetadataLocator,a as createTypeRegistry,ee as css,Y as cssDirective,Bt as customElement,Xe as elements,l as emptyArray,Pe as html,ue as htmlDirective,U as lengthOf,xe as listener,Ce as normalizeBinding,rt as nullableBooleanConverter,lt as nullableNumberConverter,N as observable,we as oneTime,He as ref,Ge as repeat,et as slotted,$ as volatile,De as when};
@@ -328,6 +328,17 @@ export declare class ChildrenDirective extends NodeObservationDirective<Children
328
328
  */
329
329
  export declare type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
330
330
 
331
+ /**
332
+ * Represents a constructable class with a prototype.
333
+ * @public
334
+ */
335
+ export declare type Class<T, C = {}> = C & Constructable<T> & {
336
+ /**
337
+ * The class's prototype;
338
+ */
339
+ readonly prototype: T;
340
+ };
341
+
331
342
  /**
332
343
  * A function capable of compiling a template from the preprocessed form produced
333
344
  * by the html template function into a result that can instantiate views.
@@ -398,7 +409,7 @@ declare function compose<TType extends Constructable<HTMLElement> = Constructabl
398
409
  declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
399
410
 
400
411
  /**
401
- * Allows for the creation of Constructable mixin classes.
412
+ * Represents a type which can be constructed with the new operator.
402
413
  *
403
414
  * @public
404
415
  */
@@ -533,12 +544,6 @@ export declare interface CSSDirectiveDefinition<TType extends Constructable<CSSD
533
544
  readonly type: TType;
534
545
  }
535
546
 
536
- /**
537
- * @deprecated Use css.partial instead.
538
- * @public
539
- */
540
- export declare const cssPartial: (strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]) => CSSDirective;
541
-
542
547
  /**
543
548
  * Transforms a template literal string into styles.
544
549
  * @param strings - The string fragments that are interpolated with the values.
@@ -566,24 +571,6 @@ export declare type CSSTemplateTag = ((strings: TemplateStringsArray, ...values:
566
571
  */
567
572
  export declare function customElement(nameOrDef: string | PartialFASTElementDefinition): (type: Constructable<HTMLElement>) => void;
568
573
 
569
- /**
570
- * Injects static HTML without platform protection.
571
- * @param html - The html to injection.
572
- * @returns A DangerousHTMLDirective.
573
- * @public
574
- */
575
- export declare function dangerousHTML<TSource = any, TParent = any>(html: string): CaptureType<TSource, TParent>;
576
-
577
- /**
578
- * A directive capable of injecting static HTML platform runtime protection.
579
- * @public
580
- */
581
- export declare class DangerousHTMLDirective implements HTMLDirective {
582
- private html;
583
- constructor(html: string);
584
- createHTML(): string;
585
- }
586
-
587
574
  /**
588
575
  * Metadata used to configure a custom attribute's behavior through a decorator.
589
576
  * @public
@@ -610,21 +597,6 @@ export declare interface Disposable {
610
597
  * @public
611
598
  */
612
599
  export declare const DOM: Readonly<{
613
- /**
614
- * @deprecated
615
- * Use Updates.enqueue().
616
- */
617
- queueUpdate: (callable: Callable) => void;
618
- /**
619
- * @deprecated
620
- * Use Updates.next()
621
- */
622
- nextUpdate: () => Promise<void>;
623
- /**
624
- * @deprecated
625
- * Use Updates.process()
626
- */
627
- processUpdates: () => void;
628
600
  /**
629
601
  * Gets the dom policy used by the templating system.
630
602
  */
@@ -1400,7 +1372,7 @@ export declare interface HostController<TSource = any> {
1400
1372
  * other template instances, and Directive instances.
1401
1373
  * @public
1402
1374
  */
1403
- export declare function html<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]): ViewTemplate<TSource, TParent>;
1375
+ export declare const html: HTMLTemplateTag;
1404
1376
 
1405
1377
  /**
1406
1378
  * A directive that applies bindings.
@@ -1535,6 +1507,24 @@ export declare interface HTMLTemplateCompilationResult<TSource = any, TParent =
1535
1507
  createView(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
1536
1508
  }
1537
1509
 
1510
+ /**
1511
+ * Transforms a template literal string into a ViewTemplate.
1512
+ * @param strings - The string fragments that are interpolated with the values.
1513
+ * @param values - The values that are interpolated with the string fragments.
1514
+ * @remarks
1515
+ * The html helper supports interpolation of strings, numbers, binding expressions,
1516
+ * other template instances, and Directive instances.
1517
+ * @public
1518
+ */
1519
+ export declare type HTMLTemplateTag = (<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]) => ViewTemplate<TSource, TParent>) & {
1520
+ /**
1521
+ * Transforms a template literal string into partial HTML.
1522
+ * @param html - The HTML string fragment to interpolate.
1523
+ * @public
1524
+ */
1525
+ partial(html: string): InlineTemplateDirective;
1526
+ };
1527
+
1538
1528
  /**
1539
1529
  * The standard View implementation, which also implements ElementView and SyntheticView.
1540
1530
  * @public
@@ -1674,6 +1664,29 @@ export declare class HTMLView<TSource = any, TParent = any> implements ElementVi
1674
1664
  static disposeContiguousBatch(views: SyntheticView[]): void;
1675
1665
  }
1676
1666
 
1667
+ /**
1668
+ * Inlines a template into another template.
1669
+ * @public
1670
+ */
1671
+ export declare class InlineTemplateDirective implements HTMLDirective {
1672
+ private html;
1673
+ private factories;
1674
+ /**
1675
+ * An empty template partial.
1676
+ */
1677
+ static readonly empty: InlineTemplateDirective;
1678
+ /**
1679
+ * Creates an instance of InlineTemplateDirective.
1680
+ * @param template - The template to inline.
1681
+ */
1682
+ constructor(html: string, factories?: Record<string, ViewBehaviorFactory>);
1683
+ /**
1684
+ * Creates HTML to be used within a template.
1685
+ * @param add - Can be used to add behavior factories to a template.
1686
+ */
1687
+ createHTML(add: AddViewBehaviorFactory): string;
1688
+ }
1689
+
1677
1690
  /**
1678
1691
  * Observes array lengths.
1679
1692
  * @public
@@ -1733,14 +1746,6 @@ export declare const Markup: Readonly<{
1733
1746
  comment: (id: string) => string;
1734
1747
  }>;
1735
1748
 
1736
- /**
1737
- * Reverses all readonly members, making them mutable.
1738
- * @internal
1739
- */
1740
- export declare type Mutable<T> = {
1741
- -readonly [P in keyof T]: T[P];
1742
- };
1743
-
1744
1749
  /**
1745
1750
  * Options for configuring node observation behavior.
1746
1751
  * @public
@@ -1872,6 +1877,12 @@ export declare interface Notifier {
1872
1877
  unsubscribe(subscriber: Subscriber, propertyToUnwatch?: any): void;
1873
1878
  }
1874
1879
 
1880
+ /**
1881
+ * A {@link ValueConverter} that converts to and from `boolean` values. `null`, `undefined`, `""`, and `void` values are converted to `null`.
1882
+ * @public
1883
+ */
1884
+ export declare const nullableBooleanConverter: ValueConverter;
1885
+
1875
1886
  /**
1876
1887
  * A {@link ValueConverter} that converts to and from `number` values.
1877
1888
  * @remarks
@@ -2621,6 +2632,10 @@ export declare interface SyntheticViewTemplate<TSource = any, TParent = any> {
2621
2632
  * Creates a SyntheticView instance based on this template definition.
2622
2633
  */
2623
2634
  create(): SyntheticView<TSource, TParent>;
2635
+ /**
2636
+ * Returns a directive that can inline the template.
2637
+ */
2638
+ inline(): CaptureType<TSource, TParent>;
2624
2639
  }
2625
2640
 
2626
2641
  /**
@@ -2629,6 +2644,18 @@ export declare interface SyntheticViewTemplate<TSource = any, TParent = any> {
2629
2644
  */
2630
2645
  export declare type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
2631
2646
 
2647
+ /**
2648
+ * A policy for use with the standard trustedTypes platform API.
2649
+ * @public
2650
+ */
2651
+ export declare type TrustedTypesPolicy = {
2652
+ /**
2653
+ * Creates trusted HTML.
2654
+ * @param html - The HTML to clear as trustworthy.
2655
+ */
2656
+ createHTML(html: string): string;
2657
+ };
2658
+
2632
2659
  /**
2633
2660
  * Do not change. Part of shared kernel contract.
2634
2661
  * @internal
@@ -2817,6 +2844,10 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
2817
2844
  * @param hostBindingTarget - The element that host behaviors will be bound to.
2818
2845
  */
2819
2846
  create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
2847
+ /**
2848
+ * Returns a directive that can inline the template.
2849
+ */
2850
+ inline(): CaptureType<TSource, TParent>;
2820
2851
  /**
2821
2852
  * Sets the DOMPolicy for this template.
2822
2853
  * @param policy - The policy to associated with this template.
@@ -126,6 +126,11 @@ export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiv
126
126
  // @public
127
127
  export type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
128
128
 
129
+ // @public
130
+ export type Class<T, C = {}> = C & Constructable<T> & {
131
+ readonly prototype: T;
132
+ };
133
+
129
134
  // @public
130
135
  export type CompilationStrategy = (
131
136
  html: string | HTMLTemplateElement,
@@ -203,9 +208,6 @@ export interface CSSDirectiveDefinition<TType extends Constructable<CSSDirective
203
208
  readonly type: TType;
204
209
  }
205
210
 
206
- // @public @deprecated (undocumented)
207
- export const cssPartial: (strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]) => CSSDirective;
208
-
209
211
  // @public
210
212
  export type CSSTemplateTag = ((strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]) => ElementStyles) & {
211
213
  partial(strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]): CSSDirective;
@@ -214,16 +216,6 @@ export type CSSTemplateTag = ((strings: TemplateStringsArray, ...values: (Compos
214
216
  // @public
215
217
  export function customElement(nameOrDef: string | PartialFASTElementDefinition): (type: Constructable<HTMLElement>) => void;
216
218
 
217
- // @public
218
- export function dangerousHTML<TSource = any, TParent = any>(html: string): CaptureType<TSource, TParent>;
219
-
220
- // @public
221
- export class DangerousHTMLDirective implements HTMLDirective {
222
- constructor(html: string);
223
- // (undocumented)
224
- createHTML(): string;
225
- }
226
-
227
219
  // @public
228
220
  export type DecoratorAttributeConfiguration = Omit<AttributeConfiguration, "property">;
229
221
 
@@ -234,9 +226,6 @@ export interface Disposable {
234
226
 
235
227
  // @public
236
228
  export const DOM: Readonly<{
237
- queueUpdate: (callable: Callable) => void;
238
- nextUpdate: () => Promise<void>;
239
- processUpdates: () => void;
240
229
  readonly policy: DOMPolicy;
241
230
  setPolicy(value: DOMPolicy): void;
242
231
  setAttribute(element: HTMLElement, attributeName: string, value: any): void;
@@ -463,7 +452,7 @@ export interface HostController<TSource = any> {
463
452
  }
464
453
 
465
454
  // @public
466
- export function html<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]): ViewTemplate<TSource, TParent>;
455
+ export const html: HTMLTemplateTag;
467
456
 
468
457
  // @public
469
458
  export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, ViewBehavior, Aspected {
@@ -515,6 +504,11 @@ export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> {
515
504
  createView(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
516
505
  }
517
506
 
507
+ // @public
508
+ export type HTMLTemplateTag = (<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]) => ViewTemplate<TSource, TParent>) & {
509
+ partial(html: string): InlineTemplateDirective;
510
+ };
511
+
518
512
  // @public
519
513
  export class HTMLView<TSource = any, TParent = any> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent>, ExecutionContext<TParent> {
520
514
  constructor(fragment: DocumentFragment, factories: ReadonlyArray<CompiledViewBehaviorFactory>, targets: ViewBehaviorTargets);
@@ -553,6 +547,13 @@ export class HTMLView<TSource = any, TParent = any> implements ElementView<TSour
553
547
  unbind(): void;
554
548
  }
555
549
 
550
+ // @public
551
+ export class InlineTemplateDirective implements HTMLDirective {
552
+ constructor(html: string, factories?: Record<string, ViewBehaviorFactory>);
553
+ createHTML(add: AddViewBehaviorFactory): string;
554
+ static readonly empty: InlineTemplateDirective;
555
+ }
556
+
556
557
  // @public
557
558
  export interface LengthObserver extends Subscriber {
558
559
  length: number;
@@ -571,13 +572,6 @@ export const Markup: Readonly<{
571
572
  comment: (id: string) => string;
572
573
  }>;
573
574
 
574
- // Warning: (ae-internal-missing-underscore) The name "Mutable" should be prefixed with an underscore because the declaration is marked as @internal
575
- //
576
- // @internal
577
- export type Mutable<T> = {
578
- -readonly [P in keyof T]: T[P];
579
- };
580
-
581
575
  // @public
582
576
  export interface NodeBehaviorOptions<T = any> {
583
577
  filter?: ElementsFilter;
@@ -610,6 +604,9 @@ export interface Notifier {
610
604
  unsubscribe(subscriber: Subscriber, propertyToUnwatch?: any): void;
611
605
  }
612
606
 
607
+ // @public
608
+ export const nullableBooleanConverter: ValueConverter;
609
+
613
610
  // @public
614
611
  export const nullableNumberConverter: ValueConverter;
615
612
 
@@ -841,11 +838,17 @@ export interface SyntheticView<TSource = any, TParent = any> extends View<TSourc
841
838
  // @public
842
839
  export interface SyntheticViewTemplate<TSource = any, TParent = any> {
843
840
  create(): SyntheticView<TSource, TParent>;
841
+ inline(): CaptureType<TSource, TParent>;
844
842
  }
845
843
 
846
844
  // @public
847
845
  export type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
848
846
 
847
+ // @public
848
+ export type TrustedTypesPolicy = {
849
+ createHTML(html: string): string;
850
+ };
851
+
849
852
  // Warning: (ae-internal-missing-underscore) The name "TypeDefinition" should be prefixed with an underscore because the declaration is marked as @internal
850
853
  //
851
854
  // @internal
@@ -922,6 +925,7 @@ export class ViewTemplate<TSource = any, TParent = any> implements ElementViewTe
922
925
  static create<TSource = any, TParent = any>(strings: string[], values: TemplateValue<TSource, TParent>[], policy?: DOMPolicy): ViewTemplate<TSource, TParent>;
923
926
  readonly factories: Record<string, ViewBehaviorFactory>;
924
927
  readonly html: string | HTMLTemplateElement;
928
+ inline(): CaptureType<TSource, TParent>;
925
929
  render(source: TSource, host: Node, hostBindingTarget?: Element): HTMLView<TSource, TParent>;
926
930
  // @internal
927
931
  toJSON: () => undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@microsoft/fast-element",
3
3
  "description": "A library for constructing Web Components",
4
- "version": "2.0.0-beta.19",
4
+ "version": "2.0.0-beta.20",
5
5
  "author": {
6
6
  "name": "Microsoft",
7
7
  "url": "https://discord.gg/FcSNfg4"
@@ -1,18 +0,0 @@
1
- import { HTMLDirective } from "./html-directive.js";
2
- import type { CaptureType } from "./template.js";
3
- /**
4
- * A directive capable of injecting static HTML platform runtime protection.
5
- * @public
6
- */
7
- export declare class DangerousHTMLDirective implements HTMLDirective {
8
- private html;
9
- constructor(html: string);
10
- createHTML(): string;
11
- }
12
- /**
13
- * Injects static HTML without platform protection.
14
- * @param html - The html to injection.
15
- * @returns A DangerousHTMLDirective.
16
- * @public
17
- */
18
- export declare function dangerousHTML<TSource = any, TParent = any>(html: string): CaptureType<TSource, TParent>;
@@ -1,23 +0,0 @@
1
- import { HTMLDirective } from "./html-directive.js";
2
- /**
3
- * A directive capable of injecting static HTML platform runtime protection.
4
- * @public
5
- */
6
- export class DangerousHTMLDirective {
7
- constructor(html) {
8
- this.html = html;
9
- }
10
- createHTML() {
11
- return this.html;
12
- }
13
- }
14
- HTMLDirective.define(DangerousHTMLDirective);
15
- /**
16
- * Injects static HTML without platform protection.
17
- * @param html - The html to injection.
18
- * @returns A DangerousHTMLDirective.
19
- * @public
20
- */
21
- export function dangerousHTML(html) {
22
- return new DangerousHTMLDirective(html);
23
- }