@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
- void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const e=globalThis.FAST,t={1101:"Must call enableArrayObservation before observing arrays.",1201:"The DOM Policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1206:"Calling html`` as a normal function invalidates the security guarantees provided by FAST.",1207:"The DOM Policy for an HTML template can only be set once.",1208:"The DOM Policy cannot be set after a template is compiled.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement."},s=/(\$\{\w+?})/g,n=/\$\{(\w+?)}/g,i=Object.freeze({});function r(e,t){return e.split(s).map((e=>{var s;const i=e.replace(n,"$1");return String(null!==(s=t[i])&&void 0!==s?s:e)})).join("")}let o;Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,s=i){var n;const o=null!==(n=t[e])&&void 0!==n?n:"Unknown Warning";console.warn(r(o,s))},error(e,s=i){var n;const o=null!==(n=t[e])&&void 0!==n?n:"Unknown Error";return new Error(r(o,s))}});try{if(document.currentScript)o=document.currentScript.getAttribute("fast-kernel");else{const e=document.getElementsByTagName("script");o=e[e.length-1].getAttribute("fast-kernel")}}catch(e){o="isolate"}let l;switch(o){case"share":l=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":l=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;l=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const a=e=>"function"==typeof e,c=e=>"string"==typeof e,h=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}();const d={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},d));const u=globalThis.FAST;if(void 0===u.getById){const e=Object.create(null);Reflect.defineProperty(u,"getById",Object.assign({value(t,s){let n=e[t];return void 0===n&&(n=s?e[t]=s():null),n}},d))}void 0===u.error&&Object.assign(u,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const f=Object.freeze([]);function p(){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 g(){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 b=u.getById(l.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})})),v=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),y=e=>e,m=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:y}):{createHTML:y};let w=Object.freeze({createHTML:e=>m.createHTML(e),protect:(e,t,s,n)=>n});const x=w,C=Object.freeze({queueUpdate:b.enqueue,nextUpdate:b.next,processUpdates:b.process,get policy(){return w},setPolicy(e){if(w!==x)throw u.error(1201);w=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 S(e,t,s,n){return(e,t,s,...i)=>{c(s)&&(s=s.replace("javascript:","")),n(e,t,s,...i)}}function T(e,t,s,n){throw new Error(`${s} on ${null!=e?e:"text"} is blocked by the current DOMPolicy.`)}const O={onabort:T,onauxclick:T,onbeforeinput:T,onbeforematch:T,onblur:T,oncancel:T,oncanplay:T,oncanplaythrough:T,onchange:T,onclick:T,onclose:T,oncontextlost:T,oncontextmenu:T,oncontextrestored:T,oncopy:T,oncuechange:T,oncut:T,ondblclick:T,ondrag:T,ondragend:T,ondragenter:T,ondragleave:T,ondragover:T,ondragstart:T,ondrop:T,ondurationchange:T,onemptied:T,onended:T,onerror:T,onfocus:T,onformdata:T,oninput:T,oninvalid:T,onkeydown:T,onkeypress:T,onkeyup:T,onload:T,onloadeddata:T,onloadedmetadata:T,onloadstart:T,onmousedown:T,onmouseenter:T,onmouseleave:T,onmousemove:T,onmouseout:T,onmouseover:T,onmouseup:T,onpaste:T,onpause:T,onplay:T,onplaying:T,onprogress:T,onratechange:T,onreset:T,onresize:T,onscroll:T,onsecuritypolicyviolation:T,onseeked:T,onseeking:T,onselect:T,onslotchange:T,onstalled:T,onsubmit:T,onsuspend:T,ontimeupdate:T,ontoggle:T,onvolumechange:T,onwaiting:T,onwebkitanimationend:T,onwebkitanimationiteration:T,onwebkitanimationstart:T,onwebkittransitionend:T,onwheel:T},A={elements:{a:{[v.attribute]:{href:S},[v.property]:{href:S}},area:{[v.attribute]:{href:S},[v.property]:{href:S}},button:{[v.attribute]:{formaction:S},[v.property]:{formAction:S}},embed:{[v.attribute]:{src:T},[v.property]:{src:T}},form:{[v.attribute]:{action:S},[v.property]:{action:S}},frame:{[v.attribute]:{src:S},[v.property]:{src:S}},iframe:{[v.attribute]:{src:S},[v.property]:{src:S,srcdoc:T}},input:{[v.attribute]:{formaction:S},[v.property]:{formAction:S}},link:{[v.attribute]:{href:T},[v.property]:{href:T}},object:{[v.attribute]:{codebase:T,data:T},[v.property]:{codeBase:T,data:T}},script:{[v.attribute]:{src:T,text:T},[v.property]:{src:T,text:T,innerText:T,textContent:T}},style:{[v.property]:{innerText:T,textContent:T}}},aspects:{[v.attribute]:Object.assign({},O),[v.property]:Object.assign({innerHTML:T},O),[v.event]:Object.assign({},O)}};function k(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 j(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]=k(r,{});break;default:s[n]=k(i,r)}}for(const t in e)t in s||(s[t]=k(e[t],{}));return Object.freeze(s)}function B(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]=j(i,{});break;default:s[n]=j(i,r)}}for(const t in e)t in s||(s[t]=j(e[t],{}));return Object.freeze(s)}function $(e,t,s,n,i){const r=e[s];if(r){const e=r[n];if(e)return e(t,s,n,i)}}const N=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=A,Object.freeze({elements:r.elements?B(r.elements,o.elements):o.elements,aspects:r.aspects?j(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=$(l,e,t,s,n);if(i)return i}return null!==(r=$(i.aspects,e,t,s,n))&&void 0!==r?r:n}})}});class E{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 M{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 E(this.subject):null!==(n=this.subjectSubscribers)&&void 0!==n?n:this.subjectSubscribers=new E(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 I=Object.freeze({unknown:void 0,coupled:1}),V=u.getById(l.observable,(()=>{const e=b.enqueue,t=/(:|&&|\|\||if)/,s=new WeakMap;let n,i=e=>{throw u.error(1101)};function r(e){var t;let n=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===n&&(Array.isArray(e)?n=i(e):s.set(e,n=new M(e))),n}const o=g();class l{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==n&&n.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,n=e[s];if(n!==t){e[s]=t;const i=e[this.callback];a(i)&&i.call(e,n,t),r(e).notify(this.name)}}}class d extends E{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=h}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!==I.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=n;let i;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{n=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=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;n=void 0,t=s.propertySource[s.propertyName],n=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return Object.freeze({setArrayObserverFactory(e){i=e},getNotifier:r,track(e,t){n&&n.watch(e,t)},trackVolatile(){n&&(n.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){c(t)&&(t=new l(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new d(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function z(e,t){V.defineProperty(e,t)}function L(e,t,s){return Object.assign({},s,{get(){return V.trackVolatile(),s.get.apply(this)}})}const F=u.getById(l.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),P=Object.freeze({default:{index:0,length:0,get event(){return P.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>F.get(),setEvent(e){F.set(e)}});class _{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}const R=Object.freeze({reset:1,splice:2,optimized:3}),D=new _(0,f,0);D.reset=!0;const H=[D];function U(e,t,s,n,i,r){let o=0,l=0;const a=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,a)),s===e.length&&r===n.length&&(l=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,a-o)),i+=o,r-=l,(s-=l)-(t+=o)==0&&r-i==0)return f;if(t===s){const e=new _(t,[],0);for(;i<r;)e.removed.push(n[i++]);return[e]}if(i===r)return[new _(t,[],s-t)];const c=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)),h=[];let d,u=t,p=i;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==d&&(h.push(d),d=void 0),u++,p++;break;case 1:void 0===d&&(d=new _(u,[],0)),d.addedCount++,u++,d.removed.push(n[p]),p++;break;case 2:void 0===d&&(d=new _(u,[],0)),d.addedCount++,u++;break;case 3:void 0===d&&(d=new _(u,[],0)),d.removed.push(n[p]),p++}return void 0!==d&&h.push(d),h}function q(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 Q=Object.freeze({support:R.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?f:s.length>1?function(e,t){let s=[];const n=[];for(let e=0,s=t.length;e<s;e++)q(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(U(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:H,pop(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new _(e.length,[r],0)),r},push(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new _(e.length-n.length,[],n.length).adjustTo(e)),i},reverse(e,t,s,n){const i=s.apply(e,n);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 _(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 _(+n[0],i,n.length>2?n.length-2:0).adjustTo(e)),i},unshift(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new _(0,[],n.length).adjustTo(e)),i}});const J=Object.freeze({reset:H,setDefaultStrategy(e){Q=e}});function W(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class K extends E{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,W(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,V.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:Q).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,b.enqueue(this))}}let G=!1;const X=Object.freeze({enable(){if(G)return;G=!0,V.setArrayObserverFactory((e=>new K(e)));const e=Array.prototype;e.$fastPatch||(W(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:Q)[t.name](this,n,t,e)}})))}});function Y(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=V.getNotifier(e)),V.track(t.lengthObserver,"length"),e.length}let Z;function ee(e){return e.map((e=>e instanceof te?ee(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class te{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof te?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(Z),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(ee(this.styles)),this}static setDefaultStrategy(e){Z=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new te(e):e instanceof te?e:new te([e])}}te.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const se=p(),ne=Object.freeze({getForInstance:se.getForInstance,getByType:se.getByType,define:e=>(se.register({type:e}),e)});function ie(){return function(e){ne.define(e)}}function re(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!==ne.getForInstance(o)&&(o=o.createCSS(r)),o instanceof te||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 oe=(e,...t)=>{const{styles:s,behaviors:n}=re(e,t),i=new te(s);return n.length?i.withBehaviors(...n):i};class le{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(c(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new te(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)}}ne.define(le);const ae=oe.partial=(e,...t)=>{const{styles:s,behaviors:n}=re(e,t);return new le(s,n)},ce=`fast-${Math.random().toString(36).substring(2,8)}`,he=`${ce}{`,de=`}${ce}`,ue=de.length;let fe=0;const pe=()=>`${ce}-${++fe}`,ge=Object.freeze({interpolation:e=>`${he}${e}${de}`,attribute:e=>`${pe()}="${he}${e}${de}"`,comment:e=>`\x3c!--${he}${e}${de}--\x3e`}),be=Object.freeze({parse(e,t){const s=e.split(he);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(de);let o;if(-1===r)o=i;else{const e=i.substring(0,r);n.push(t[e]),o=i.substring(r+ue)}""!==o&&n.push(o)}return n}}),ve=p(),ye=Object.freeze({getForInstance:ve.getForInstance,getByType:ve.getByType,define:(e,t)=>((t=t||{}).type=e,ve.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?v.tokenList:v.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=v.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=v.event;break;default:e.targetAspect=t,e.aspectType=v.attribute}else e.aspectType=v.content}});function me(e){return function(t){ye.define(t,e)}}class we{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class xe{constructor(e){this.options=e,this.toJSON=h}createHTML(e){return ge.attribute(e(this))}createBehavior(){return this}}class Ce extends we{createObserver(e,t){return V.binding(this.evaluate,t,this.isVolatile)}}class Se extends we{constructor(){super(...arguments),this.toJSON=h}createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}const Te={[v.attribute]:C.setAttribute,[v.booleanAttribute]:C.setBooleanAttribute,[v.property]:(e,t,s)=>e[t]=s,[v.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}},[v.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)}},[v.event]:()=>{}};class Oe{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=v.content}createHTML(e){return ge.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=Te[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw u.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 v.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case v.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){P.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);P.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 Ae(e,t,s=V.isVolatileBinding(e)){return new Ce(e,t,s)}function ke(e,t){return new Se(e,t)}function je(e,t){const s=new Ce(e);return s.options=t,s}function Be(e){return a(e)?Ae(e):e instanceof we?e:ke((()=>e))}function $e(e,t){const s=e.parentNode;let n,i=e;for(;i!==t;)n=i.nextSibling,s.removeChild(i),i=n;s.removeChild(t)}ye.define(Oe,{aspected:!0});class Ne{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=I.unknown,this.context=this,this.index=0,this.length=0,this.toJSON=h,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get event(){return P.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}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(){$e(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){$e(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}V.defineProperty(Ne.prototype,"index"),V.defineProperty(Ne.prototype,"length");const Ee=(e,t)=>`${e}.${t}`,Me={},Ie={index:0,node:null};function Ve(e){e.startsWith("fast-")||u.warn(1204,{name:e})}const ze=new Proxy(document.createElement("div"),{get(e,t){Ve(t);const s=Reflect.get(e,t);return a(s)?s.bind(e):s},set:(e,t,s)=>(Ve(t),Reflect.set(e,t,s))});class Le{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:pe(),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=Me[t];if(!i){const n=`_${t}`;Me[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:ze;for(const e of this.nodeIds)s[e];return new Ne(t,this.factories,s)}}function Fe(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=be.parse(d,l);let f=null;null===u?r&&(f=new Oe(ke((()=>d),e.policy)),ye.assignAspect(f,h.name)):f=Re.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(h),a--,c--,e.addFactory(f,t,n,i,s.tagName))}}function Pe(e,t,s){let n=0,i=t.firstChild;for(;i;){const t=_e(e,s,i,n);i=t.node,n=t.index}}function _e(e,t,s,n){const i=Ee(t,n);switch(s.nodeType){case 1:Fe(e,t,s,i,n),Pe(e,s,i);break;case 3:return function(e,t,s,n,i){const r=be.parse(t.textContent,e.directives);if(null===r)return Ie.node=t.nextSibling,Ie.index=i+1,Ie;let o,l=o=t;for(let t=0,a=r.length;t<a;++t){const a=r[t];0!==t&&(i++,n=Ee(s,i),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),c(a)?o.textContent=a:(o.textContent=" ",ye.assignAspect(a),e.addFactory(a,s,n,i,null)),l=o}return Ie.index=i+1,Ie.node=l.nextSibling,Ie}(e,s,t,i,n);case 8:const r=be.parse(s.data,e.directives);null!==r&&e.addFactory(Re.aggregate(r),t,i,n,null)}return Ie.index=n+1,Ie.node=s.nextSibling,Ie}const Re={compile(e,t,s=C.policy){let n;if(c(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 i=document.adoptNode(n.content),r=new Le(i,t,s);var o,l;return Fe(r,"",n,"h",0,!0),o=i.firstChild,l=t,(o&&8==o.nodeType&&null!==be.parse(o.data,l)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Pe(r,i,"r"),Ie.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=C.policy){if(1===e.length)return e[0];let s,n,i,r=!1;const o=e.length,l=e.map((e=>c(e)?()=>e:(s=e.sourceAspect||s,n=e.dataBinding||n,r=r||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate)));n.evaluate=(e,t)=>{let s="";for(let n=0;n<o;++n)s+=l[n](e,t);return s},n.isVolatile=r,n.policy=null!=i?i:t;const a=new Oe(n);return ye.assignAspect(a,s),a}},De=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function He(e,t,s,n=ye.getForInstance(e)){if(n.aspected){const s=De.exec(t);null!==s&&ye.assignAspect(e,s[2])}return e.createHTML(s)}class Ue{constructor(e,t={},s){this.policy=s,this.result=null,this.toJSON=h,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=Re.compile(this.html,this.factories,this.policy)),this.result.createView(e)}withPolicy(e){if(this.result)throw u.error(1208);if(this.policy)throw u.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,s){let n="";const i=Object.create(null),r=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=pe();return i[s]=e,s};for(let s=0,i=e.length-1;s<i;++s){const i=e[s];let o,l=t[s];if(n+=i,a(l))l=new Oe(Ae(l));else if(l instanceof we)l=new Oe(l);else if(!(o=ye.getForInstance(l))){const e=l;l=new Oe(ke((()=>e)))}n+=He(l,i,r,o)}return new Ue(n+e[e.length-1],i,s)}}function qe(e,...t){if(Array.isArray(e)&&Array.isArray(e.raw))return Ue.create(e,t);throw u.error(1206)}class Qe extends xe{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}ye.define(Qe);const Je=e=>new Qe(e);function We(e,t){const s=a(e)?e:()=>e,n=a(t)?t:()=>t;return(e,t)=>s(e,t)?n(e,t):null}const Ke=Object.freeze({positioning:!1,recycle:!0});function Ge(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.bind(t[s])}function Xe(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 Ye{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=Ge,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=Xe)}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=f);const t=this.itemsObserver,s=this.itemsObserver=V.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||(Ne.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 Ze{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,X.enable()}createHTML(e){return ge.comment(e(this))}createBehavior(){return new Ye(this)}}function et(e,t,s=Ke){const n=Be(e),i=Be(t);return new Ze(n,i,Object.assign(Object.assign({},Ke),s))}ye.define(Ze);const tt=e=>1===e.nodeType,st=e=>e?t=>1===t.nodeType&&t.matches(e):tt;class nt extends xe{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,f),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 it extends nt{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 rt(e){return c(e)&&(e={property:e}),new it(e)}ye.define(it);class ot extends nt{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=h,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 lt(e){return c(e)&&(e={property:e}),new ot(e)}ye.define(ot);class at{constructor(e){this.html=e}createHTML(){return this.html}}function ct(e){return new at(e)}ye.define(at);const ht=Object.freeze({locate:g()}),dt={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};function ut(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const ft={toView(e){const t=ut(e);return t?t.toString():t},fromView:ut};class pt{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=dt)}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 V.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||b.enqueue((()=>{s.add(e);const n=e[this.fieldName];switch(t){case"reflect":const t=this.converter;C.setAttribute(e,this.attribute,void 0!==t?t.toView(n):n);break;case"boolean":C.setBooleanAttribute(e,this.attribute,n)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(ht.locate(e));for(let n=0,i=t.length;n<i;++n){const i=t[n];if(void 0!==i)for(let t=0,n=i.length;t<n;++t){const n=i[t];c(n)?s.push(new pt(e,n)):s.push(new pt(e,n.property,n.attribute,n.mode,n.converter))}}return s}}function gt(e,t){let s;function n(e,t){arguments.length>1&&(s.property=t),ht.locate(e.constructor).push(s)}return arguments.length>1?(s={},void n(e,t)):(s=void 0===e?{}:e,n)}const bt={mode:"open"},vt={},yt=new Set,mt=u.getById(l.elementRegistry,(()=>p()));class wt{constructor(e,t=e.definition){var s;this.platformDefined=!1,c(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,i=pt.collect(e,t.attributes),r=new Array(i.length),o={},l={};for(let e=0,t=i.length;e<t;++e){const t=i[e];r[e]=t.attribute,o[t.name]=t,l[t.attribute]=t,V.defineProperty(n,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=i,this.propertyLookup=o,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?bt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},bt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?vt:Object.assign(Object.assign({},vt),t.elementOptions),this.styles=te.normalize(t.styles),mt.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 yt.has(e)||mt.getByType(e)?new wt(class extends e{},t):new wt(e,t)}static registerBaseType(e){yt.add(e)}}wt.getByType=mt.getByType,wt.getForInstance=mt.getForInstance;const xt={bubbles:!0,composed:!0,cancelable:!0},Ct=new WeakMap;function St(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Ct.get(e))&&void 0!==s?s:null}let Tt;class Ot extends M{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=h,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&&Ct.set(e,t))}const n=V.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 V.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=St(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=St(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,V.notify(this,"isConnected")}disconnect(){if(1!==this.stage)return;this.stage=2,V.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},xt),s)))}renderTemplate(e){var t;const s=this.source,n=null!==(t=St(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=I.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=wt.getForInstance(e);if(void 0===s)throw u.error(1401);return e.$fastController=new Tt(e,s)}static setStrategy(e){Tt=e}}function At(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=St(e))&&void 0!==t?t:e.getRootNode()}Ot.setStrategy(Ot);class kt{constructor(e){const t=kt.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=At(e);t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=At(e),s=this.sheets;t.adoptedStyleSheets=t.adoptedStyleSheets.filter((e=>-1===s.indexOf(e)))}}kt.styleSheetCache=new Map;let jt=0;function Bt(e){return e===document?document.body:e}function $t(e){const t=class extends e{constructor(){super(),Ot.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 wt.registerBaseType(t),t}function Nt(e,t){return a(e)?wt.compose(e,t).define().type:wt.compose(this,e).define().type}te.setDefaultStrategy(te.supportsAdoptedStyleSheets?kt:class{constructor(e){this.styles=e,this.styleClass="fast-"+ ++jt}addStylesTo(e){e=Bt(At(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=Bt(At(e))).querySelectorAll(`.${this.styleClass}`);t[0].parentNode;for(let s=0,n=t.length;s<n;++s)e.removeChild(t[s])}});const Et=Object.assign($t(HTMLElement),{from:function(e){return $t(e)},define:Nt,compose:function(e,t){return a(e)?wt.compose(e,t):wt.compose(this,e)}});function Mt(e){return function(t){Nt(t,e)}}C.setPolicy(N.create());export{X as ArrayObserver,ht as AttributeConfiguration,pt as AttributeDefinition,we as Binding,ne as CSSDirective,ot as ChildrenDirective,Re as Compiler,C as DOM,v as DOMAspect,at as DangerousHTMLDirective,Ot as ElementController,te as ElementStyles,P as ExecutionContext,u as FAST,Et as FASTElement,wt as FASTElementDefinition,Oe as HTMLBindingDirective,ye as HTMLDirective,Ne as HTMLView,ge as Markup,nt as NodeObservationDirective,V as Observable,be as Parser,M as PropertyChangeNotifier,Qe as RefDirective,Ye as RepeatBehavior,Ze as RepeatDirective,it as SlottedDirective,I as SourceLifetime,_ as Splice,J as SpliceStrategy,R as SpliceStrategySupport,xe as StatelessAttachedAttributeDirective,E as SubscriberSet,b as Updates,Ue as ViewTemplate,gt as attr,Ae as bind,dt as booleanConverter,lt as children,g as createMetadataLocator,p as createTypeRegistry,oe as css,ie as cssDirective,ae as cssPartial,Mt as customElement,ct as dangerousHTML,st as elements,f as emptyArray,qe as html,me as htmlDirective,Y as lengthOf,je as listener,Be as normalizeBinding,ft as nullableNumberConverter,z as observable,ke as oneTime,Je as ref,et as repeat,rt as slotted,L as volatile,We as when};
1
+ void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const e=globalThis.FAST,t={1101:"Must call enableArrayObservation before observing arrays.",1201:"The DOM Policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1206:"Calling html`` as a normal function invalidates the security guarantees provided by FAST.",1207:"The DOM Policy for an HTML template can only be set once.",1208:"The DOM Policy cannot be set after a template is compiled.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement."},s=/(\$\{\w+?})/g,n=/\$\{(\w+?)}/g,i=Object.freeze({});function r(e,t){return e.split(s).map((e=>{var s;const i=e.replace(n,"$1");return String(null!==(s=t[i])&&void 0!==s?s:e)})).join("")}let o;Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,s=i){var n;const o=null!==(n=t[e])&&void 0!==n?n:"Unknown Warning";console.warn(r(o,s))},error(e,s=i){var n;const o=null!==(n=t[e])&&void 0!==n?n:"Unknown Error";return new Error(r(o,s))}});try{if(document.currentScript)o=document.currentScript.getAttribute("fast-kernel");else{const e=document.getElementsByTagName("script");o=e[e.length-1].getAttribute("fast-kernel")}}catch(e){o="isolate"}let l;switch(o){case"share":l=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":l=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;l=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const a=e=>"function"==typeof e,c=e=>"string"==typeof e,h=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}();const d={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},d));const u=globalThis.FAST;if(void 0===u.getById){const e=Object.create(null);Reflect.defineProperty(u,"getById",Object.assign({value(t,s){let n=e[t];return void 0===n&&(n=s?e[t]=s():null),n}},d))}void 0===u.error&&Object.assign(u,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const f=Object.freeze([]);function p(){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 g(){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 b=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),v=e=>e,y=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:v}):{createHTML:v};let m=Object.freeze({createHTML:e=>y.createHTML(e),protect:(e,t,s,n)=>n});const w=m,x=Object.freeze({get policy(){return m},setPolicy(e){if(m!==w)throw u.error(1201);m=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 C(e,t,s,n){return(e,t,s,...i)=>{c(s)&&(s=s.replace("javascript:","")),n(e,t,s,...i)}}function S(e,t,s,n){throw new Error(`${s} on ${null!=e?e:"text"} is blocked by the current DOMPolicy.`)}const T={onabort:S,onauxclick:S,onbeforeinput:S,onbeforematch:S,onblur:S,oncancel:S,oncanplay:S,oncanplaythrough:S,onchange:S,onclick:S,onclose:S,oncontextlost:S,oncontextmenu:S,oncontextrestored:S,oncopy:S,oncuechange:S,oncut:S,ondblclick:S,ondrag:S,ondragend:S,ondragenter:S,ondragleave:S,ondragover:S,ondragstart:S,ondrop:S,ondurationchange:S,onemptied:S,onended:S,onerror:S,onfocus:S,onformdata:S,oninput:S,oninvalid:S,onkeydown:S,onkeypress:S,onkeyup:S,onload:S,onloadeddata:S,onloadedmetadata:S,onloadstart:S,onmousedown:S,onmouseenter:S,onmouseleave:S,onmousemove:S,onmouseout:S,onmouseover:S,onmouseup:S,onpaste:S,onpause:S,onplay:S,onplaying:S,onprogress:S,onratechange:S,onreset:S,onresize:S,onscroll:S,onsecuritypolicyviolation:S,onseeked:S,onseeking:S,onselect:S,onslotchange:S,onstalled:S,onsubmit:S,onsuspend:S,ontimeupdate:S,ontoggle:S,onvolumechange:S,onwaiting:S,onwebkitanimationend:S,onwebkitanimationiteration:S,onwebkitanimationstart:S,onwebkittransitionend:S,onwheel:S},O={elements:{a:{[b.attribute]:{href:C},[b.property]:{href:C}},area:{[b.attribute]:{href:C},[b.property]:{href:C}},button:{[b.attribute]:{formaction:C},[b.property]:{formAction:C}},embed:{[b.attribute]:{src:S},[b.property]:{src:S}},form:{[b.attribute]:{action:C},[b.property]:{action:C}},frame:{[b.attribute]:{src:C},[b.property]:{src:C}},iframe:{[b.attribute]:{src:C},[b.property]:{src:C,srcdoc:S}},input:{[b.attribute]:{formaction:C},[b.property]:{formAction:C}},link:{[b.attribute]:{href:S},[b.property]:{href:S}},object:{[b.attribute]:{codebase:S,data:S},[b.property]:{codeBase:S,data:S}},script:{[b.attribute]:{src:S,text:S},[b.property]:{src:S,text:S,innerText:S,textContent:S}},style:{[b.property]:{innerText:S,textContent:S}}},aspects:{[b.attribute]:Object.assign({},T),[b.property]:Object.assign({innerHTML:S},T),[b.event]:Object.assign({},T)}};function A(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 k(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]=A(r,{});break;default:s[n]=A(i,r)}}for(const t in e)t in s||(s[t]=A(e[t],{}));return Object.freeze(s)}function j(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]=k(i,{});break;default:s[n]=k(i,r)}}for(const t in e)t in s||(s[t]=k(e[t],{}));return Object.freeze(s)}function B(e,t,s,n,i){const r=e[s];if(r){const e=r[n];if(e)return e(t,s,n,i)}}const $=Object.freeze({create(e={}){var t,s;const n=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),i=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=O,Object.freeze({elements:r.elements?j(r.elements,o.elements):o.elements,aspects:r.aspects?k(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=B(l,e,t,s,n);if(i)return i}return null!==(r=B(i.aspects,e,t,s,n))&&void 0!==r?r:n}})}}),N=u.getById(l.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})}));class E{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 M{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 E(this.subject):null!==(n=this.subjectSubscribers)&&void 0!==n?n:this.subjectSubscribers=new E(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 V=Object.freeze({unknown:void 0,coupled:1}),I=u.getById(l.observable,(()=>{const e=N.enqueue,t=/(:|&&|\|\||if)/,s=new WeakMap;let n,i=e=>{throw u.error(1101)};function r(e){var t;let n=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===n&&(Array.isArray(e)?n=i(e):s.set(e,n=new M(e))),n}const o=g();class l{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==n&&n.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,n=e[s];if(n!==t){e[s]=t;const i=e[this.callback];a(i)&&i.call(e,n,t),r(e).notify(this.name)}}}class d extends E{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=h}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==V.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=n;let i;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{n=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=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;n=void 0,t=s.propertySource[s.propertyName],n=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return Object.freeze({setArrayObserverFactory(e){i=e},getNotifier:r,track(e,t){n&&n.watch(e,t)},trackVolatile(){n&&(n.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){c(t)&&(t=new l(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new d(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function z(e,t){I.defineProperty(e,t)}function L(e,t,s){return Object.assign({},s,{get(){return I.trackVolatile(),s.get.apply(this)}})}const F=u.getById(l.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),P=Object.freeze({default:{index:0,length:0,get event(){return P.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>F.get(),setEvent(e){F.set(e)}});class _{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}const R=Object.freeze({reset:1,splice:2,optimized:3}),D=new _(0,f,0);D.reset=!0;const H=[D];function q(e,t,s,n,i,r){let o=0,l=0;const a=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,a)),s===e.length&&r===n.length&&(l=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,a-o)),i+=o,r-=l,(s-=l)-(t+=o)==0&&r-i==0)return f;if(t===s){const e=new _(t,[],0);for(;i<r;)e.removed.push(n[i++]);return[e]}if(i===r)return[new _(t,[],s-t)];const c=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)),h=[];let d,u=t,p=i;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==d&&(h.push(d),d=void 0),u++,p++;break;case 1:void 0===d&&(d=new _(u,[],0)),d.addedCount++,u++,d.removed.push(n[p]),p++;break;case 2:void 0===d&&(d=new _(u,[],0)),d.addedCount++,u++;break;case 3:void 0===d&&(d=new _(u,[],0)),d.removed.push(n[p]),p++}return void 0!==d&&h.push(d),h}function Q(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 U=Object.freeze({support:R.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?f:s.length>1?function(e,t){let s=[];const n=[];for(let e=0,s=t.length;e<s;e++)Q(t[e],n);for(let t=0,i=n.length;t<i;++t){const i=n[t];1!==i.addedCount||1!==i.removed.length?s=s.concat(q(e,i.index,i.index+i.addedCount,i.removed,0,i.removed.length)):i.removed[0]!==e[i.index]&&s.push(i)}return s}(t,s):s:H,pop(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new _(e.length,[r],0)),r},push(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new _(e.length-n.length,[],n.length).adjustTo(e)),i},reverse(e,t,s,n){const i=s.apply(e,n);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 _(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 _(+n[0],i,n.length>2?n.length-2:0).adjustTo(e)),i},unshift(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new _(0,[],n.length).adjustTo(e)),i}});const J=Object.freeze({reset:H,setDefaultStrategy(e){U=e}});function W(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class K extends E{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,W(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,I.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:U).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,N.enqueue(this))}}let G=!1;const X=Object.freeze({enable(){if(G)return;G=!0,I.setArrayObserverFactory((e=>new K(e)));const e=Array.prototype;e.$fastPatch||(W(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:U)[t.name](this,n,t,e)}})))}});function Y(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=I.getNotifier(e)),I.track(t.lengthObserver,"length"),e.length}let Z;function ee(e){return e.map((e=>e instanceof te?ee(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class te{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof te?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(Z),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(ee(this.styles)),this}static setDefaultStrategy(e){Z=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new te(e):e instanceof te?e:new te([e])}}te.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const se=p(),ne=Object.freeze({getForInstance:se.getForInstance,getByType:se.getByType,define:e=>(se.register({type:e}),e)});function ie(){return function(e){ne.define(e)}}function re(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!==ne.getForInstance(o)&&(o=o.createCSS(r)),o instanceof te||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 oe=(e,...t)=>{const{styles:s,behaviors:n}=re(e,t),i=new te(s);return n.length?i.withBehaviors(...n):i};class le{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(c(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new te(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)}}ne.define(le),oe.partial=(e,...t)=>{const{styles:s,behaviors:n}=re(e,t);return new le(s,n)};const ae=`fast-${Math.random().toString(36).substring(2,8)}`,ce=`${ae}{`,he=`}${ae}`,de=he.length;let ue=0;const fe=()=>`${ae}-${++ue}`,pe=Object.freeze({interpolation:e=>`${ce}${e}${he}`,attribute:e=>`${fe()}="${ce}${e}${he}"`,comment:e=>`\x3c!--${ce}${e}${he}--\x3e`}),ge=Object.freeze({parse(e,t){const s=e.split(ce);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(he);let o;if(-1===r)o=i;else{const e=i.substring(0,r);n.push(t[e]),o=i.substring(r+de)}""!==o&&n.push(o)}return n}}),be=p(),ve=Object.freeze({getForInstance:be.getForInstance,getByType:be.getByType,define:(e,t)=>((t=t||{}).type=e,be.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?b.tokenList:b.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=b.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=b.event;break;default:e.targetAspect=t,e.aspectType=b.attribute}else e.aspectType=b.content}});function ye(e){return function(t){ve.define(t,e)}}class me{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class we{constructor(e){this.options=e,this.toJSON=h}createHTML(e){return pe.attribute(e(this))}createBehavior(){return this}}class xe extends me{createObserver(e,t){return I.binding(this.evaluate,t,this.isVolatile)}}class Ce extends me{constructor(){super(...arguments),this.toJSON=h}createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}const Se={[b.attribute]:x.setAttribute,[b.booleanAttribute]:x.setBooleanAttribute,[b.property]:(e,t,s)=>e[t]=s,[b.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}},[b.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)}},[b.event]:()=>{}};class Te{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=b.content}createHTML(e){return pe.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=Se[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw u.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 b.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case b.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){P.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);P.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 Oe(e,t,s=I.isVolatileBinding(e)){return new xe(e,t,s)}function Ae(e,t){return new Ce(e,t)}function ke(e,t){const s=new xe(e);return s.options=t,s}function je(e){return a(e)?Oe(e):e instanceof me?e:Ae((()=>e))}function Be(e,t){const s=e.parentNode;let n,i=e;for(;i!==t;)n=i.nextSibling,s.removeChild(i),i=n;s.removeChild(t)}ve.define(Te,{aspected:!0});class $e{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=V.unknown,this.context=this,this.index=0,this.length=0,this.toJSON=h,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get event(){return P.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}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(){Be(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){Be(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}I.defineProperty($e.prototype,"index"),I.defineProperty($e.prototype,"length");const Ne=(e,t)=>`${e}.${t}`,Ee={},Me={index:0,node:null};function Ve(e){e.startsWith("fast-")||u.warn(1204,{name:e})}const Ie=new Proxy(document.createElement("div"),{get(e,t){Ve(t);const s=Reflect.get(e,t);return a(s)?s.bind(e):s},set:(e,t,s)=>(Ve(t),Reflect.set(e,t,s))});class ze{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:fe(),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=Ee[t];if(!i){const n=`_${t}`;Ee[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:Ie;for(const e of this.nodeIds)s[e];return new $e(t,this.factories,s)}}function Le(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=ge.parse(d,l);let f=null;null===u?r&&(f=new Te(Ae((()=>d),e.policy)),ve.assignAspect(f,h.name)):f=_e.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(h),a--,c--,e.addFactory(f,t,n,i,s.tagName))}}function Fe(e,t,s){let n=0,i=t.firstChild;for(;i;){const t=Pe(e,s,i,n);i=t.node,n=t.index}}function Pe(e,t,s,n){const i=Ne(t,n);switch(s.nodeType){case 1:Le(e,t,s,i,n),Fe(e,s,i);break;case 3:return function(e,t,s,n,i){const r=ge.parse(t.textContent,e.directives);if(null===r)return Me.node=t.nextSibling,Me.index=i+1,Me;let o,l=o=t;for(let t=0,a=r.length;t<a;++t){const a=r[t];0!==t&&(i++,n=Ne(s,i),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),c(a)?o.textContent=a:(o.textContent=" ",ve.assignAspect(a),e.addFactory(a,s,n,i,null)),l=o}return Me.index=i+1,Me.node=l.nextSibling,Me}(e,s,t,i,n);case 8:const r=ge.parse(s.data,e.directives);null!==r&&e.addFactory(_e.aggregate(r),t,i,n,null)}return Me.index=n+1,Me.node=s.nextSibling,Me}const _e={compile(e,t,s=x.policy){let n;if(c(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 i=document.adoptNode(n.content),r=new ze(i,t,s);var o,l;return Le(r,"",n,"h",0,!0),o=i.firstChild,l=t,(o&&8==o.nodeType&&null!==ge.parse(o.data,l)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Fe(r,i,"r"),Me.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=x.policy){if(1===e.length)return e[0];let s,n,i,r=!1;const o=e.length,l=e.map((e=>c(e)?()=>e:(s=e.sourceAspect||s,n=e.dataBinding||n,r=r||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate)));n.evaluate=(e,t)=>{let s="";for(let n=0;n<o;++n)s+=l[n](e,t);return s},n.isVolatile=r,n.policy=null!=i?i:t;const a=new Te(n);return ve.assignAspect(a,s),a}},Re=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,De=Object.create(null);class He{constructor(e,t=De){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function qe(e,t,s,n=ve.getForInstance(e)){if(n.aspected){const s=Re.exec(t);null!==s&&ve.assignAspect(e,s[2])}return e.createHTML(s)}He.empty=new He(""),ve.define(He);class Qe{constructor(e,t={},s){this.policy=s,this.result=null,this.toJSON=h,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=_e.compile(this.html,this.factories,this.policy)),this.result.createView(e)}inline(){return new He(c(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw u.error(1208);if(this.policy)throw u.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,s){let n="";const i=Object.create(null),r=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=fe();return i[s]=e,s};for(let s=0,i=e.length-1;s<i;++s){const i=e[s];let o,l=t[s];if(n+=i,a(l))l=new Te(Oe(l));else if(l instanceof me)l=new Te(l);else if(!(o=ve.getForInstance(l))){const e=l;l=new Te(Ae((()=>e)))}n+=qe(l,i,r,o)}return new Qe(n+e[e.length-1],i,s)}}const Ue=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Qe.create(e,t);throw u.error(1206)};Ue.partial=e=>new He(e);class Je extends we{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}ve.define(Je);const We=e=>new Je(e);function Ke(e,t){const s=a(e)?e:()=>e,n=a(t)?t:()=>t;return(e,t)=>s(e,t)?n(e,t):null}const Ge=Object.freeze({positioning:!1,recycle:!0});function Xe(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.bind(t[s])}function Ye(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 Ze{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=Xe,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=Ye)}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=f);const t=this.itemsObserver,s=this.itemsObserver=I.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||($e.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 et{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,X.enable()}createHTML(e){return pe.comment(e(this))}createBehavior(){return new Ze(this)}}function tt(e,t,s=Ge){const n=je(e),i=je(t);return new et(n,i,Object.assign(Object.assign({},Ge),s))}ve.define(et);const st=e=>1===e.nodeType,nt=e=>e?t=>1===t.nodeType&&t.matches(e):st;class it extends we{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,f),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 rt extends it{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 ot(e){return c(e)&&(e={property:e}),new rt(e)}ve.define(rt);class lt extends it{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=h,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 at(e){return c(e)&&(e={property:e}),new lt(e)}ve.define(lt);const ct=Object.freeze({locate:g()}),ht={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e},dt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:ht.fromView(e)};function ut(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const ft={toView(e){const t=ut(e);return t?t.toString():t},fromView:ut};class pt{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=ht)}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 I.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||N.enqueue((()=>{s.add(e);const n=e[this.fieldName];switch(t){case"reflect":const t=this.converter;x.setAttribute(e,this.attribute,void 0!==t?t.toView(n):n);break;case"boolean":x.setBooleanAttribute(e,this.attribute,n)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(ct.locate(e));for(let n=0,i=t.length;n<i;++n){const i=t[n];if(void 0!==i)for(let t=0,n=i.length;t<n;++t){const n=i[t];c(n)?s.push(new pt(e,n)):s.push(new pt(e,n.property,n.attribute,n.mode,n.converter))}}return s}}function gt(e,t){let s;function n(e,t){arguments.length>1&&(s.property=t),ct.locate(e.constructor).push(s)}return arguments.length>1?(s={},void n(e,t)):(s=void 0===e?{}:e,n)}const bt={mode:"open"},vt={},yt=new Set,mt=u.getById(l.elementRegistry,(()=>p()));class wt{constructor(e,t=e.definition){var s;this.platformDefined=!1,c(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,i=pt.collect(e,t.attributes),r=new Array(i.length),o={},l={};for(let e=0,t=i.length;e<t;++e){const t=i[e];r[e]=t.attribute,o[t.name]=t,l[t.attribute]=t,I.defineProperty(n,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=i,this.propertyLookup=o,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?bt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},bt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?vt:Object.assign(Object.assign({},vt),t.elementOptions),this.styles=te.normalize(t.styles),mt.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 yt.has(e)||mt.getByType(e)?new wt(class extends e{},t):new wt(e,t)}static registerBaseType(e){yt.add(e)}}wt.getByType=mt.getByType,wt.getForInstance=mt.getForInstance;const xt={bubbles:!0,composed:!0,cancelable:!0},Ct=new WeakMap;function St(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Ct.get(e))&&void 0!==s?s:null}let Tt;class Ot extends M{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=h,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&&Ct.set(e,t))}const n=I.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 I.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=St(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=St(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,I.notify(this,"isConnected")}disconnect(){if(1!==this.stage)return;this.stage=2,I.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},xt),s)))}renderTemplate(e){var t;const s=this.source,n=null!==(t=St(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=V.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=wt.getForInstance(e);if(void 0===s)throw u.error(1401);return e.$fastController=new Tt(e,s)}static setStrategy(e){Tt=e}}function At(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=St(e))&&void 0!==t?t:e.getRootNode()}Ot.setStrategy(Ot);class kt{constructor(e){const t=kt.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=At(e);t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=At(e),s=this.sheets;t.adoptedStyleSheets=t.adoptedStyleSheets.filter((e=>-1===s.indexOf(e)))}}kt.styleSheetCache=new Map;let jt=0;function Bt(e){return e===document?document.body:e}function $t(e){const t=class extends e{constructor(){super(),Ot.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 wt.registerBaseType(t),t}function Nt(e,t){return a(e)?wt.compose(e,t).define().type:wt.compose(this,e).define().type}te.setDefaultStrategy(te.supportsAdoptedStyleSheets?kt:class{constructor(e){this.styles=e,this.styleClass="fast-"+ ++jt}addStylesTo(e){e=Bt(At(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=Bt(At(e))).querySelectorAll(`.${this.styleClass}`);t[0].parentNode;for(let s=0,n=t.length;s<n;++s)e.removeChild(t[s])}});const Et=Object.assign($t(HTMLElement),{from:function(e){return $t(e)},define:Nt,compose:function(e,t){return a(e)?wt.compose(e,t):wt.compose(this,e)}});function Mt(e){return function(t){Nt(t,e)}}x.setPolicy($.create());export{X as ArrayObserver,ct as AttributeConfiguration,pt as AttributeDefinition,me as Binding,ne as CSSDirective,lt as ChildrenDirective,_e as Compiler,x as DOM,b as DOMAspect,Ot as ElementController,te as ElementStyles,P as ExecutionContext,u as FAST,Et as FASTElement,wt as FASTElementDefinition,Te as HTMLBindingDirective,ve as HTMLDirective,$e as HTMLView,He as InlineTemplateDirective,pe as Markup,it as NodeObservationDirective,I as Observable,ge as Parser,M as PropertyChangeNotifier,Je as RefDirective,Ze as RepeatBehavior,et as RepeatDirective,rt as SlottedDirective,V as SourceLifetime,_ as Splice,J as SpliceStrategy,R as SpliceStrategySupport,we as StatelessAttachedAttributeDirective,E as SubscriberSet,N as Updates,Qe as ViewTemplate,gt as attr,Oe as bind,ht as booleanConverter,at as children,g as createMetadataLocator,p as createTypeRegistry,oe as css,ie as cssDirective,Mt as customElement,nt as elements,f as emptyArray,Ue as html,ye as htmlDirective,Y as lengthOf,ke as listener,je as normalizeBinding,dt as nullableBooleanConverter,ft as nullableNumberConverter,z as observable,Ae as oneTime,We as ref,tt as repeat,ot as slotted,L as volatile,Ke as when};
@@ -43,14 +43,17 @@ switch (kernelMode) {
43
43
  break;
44
44
  }
45
45
  /**
46
+ * Determines whether or not an object is a function.
46
47
  * @internal
47
48
  */
48
49
  const isFunction = (object) => typeof object === "function";
49
50
  /**
51
+ * Determines whether or not an object is a string.
50
52
  * @internal
51
53
  */
52
54
  const isString = (object) => typeof object === "string";
53
55
  /**
56
+ * A function which does nothing.
54
57
  * @internal
55
58
  */
56
59
  const noop = () => void 0;
@@ -171,72 +174,6 @@ function createMetadataLocator() {
171
174
  };
172
175
  }
173
176
 
174
- /**
175
- * The default UpdateQueue.
176
- * @public
177
- */
178
- const Updates = FAST.getById(KernelServiceId.updateQueue, () => {
179
- const tasks = [];
180
- const pendingErrors = [];
181
- const rAF = globalThis.requestAnimationFrame;
182
- let updateAsync = true;
183
- function throwFirstError() {
184
- if (pendingErrors.length) {
185
- throw pendingErrors.shift();
186
- }
187
- }
188
- function tryRunTask(task) {
189
- try {
190
- task.call();
191
- }
192
- catch (error) {
193
- if (updateAsync) {
194
- pendingErrors.push(error);
195
- setTimeout(throwFirstError, 0);
196
- }
197
- else {
198
- tasks.length = 0;
199
- throw error;
200
- }
201
- }
202
- }
203
- function process() {
204
- const capacity = 1024;
205
- let index = 0;
206
- while (index < tasks.length) {
207
- tryRunTask(tasks[index]);
208
- index++;
209
- // Prevent leaking memory for long chains of recursive calls to `enqueue`.
210
- // If we call `enqueue` within a task scheduled by `enqueue`, the queue will
211
- // grow, but to avoid an O(n) walk for every task we execute, we don't
212
- // shift tasks off the queue after they have been executed.
213
- // Instead, we periodically shift 1024 tasks off the queue.
214
- if (index > capacity) {
215
- // Manually shift all values starting at the index back to the
216
- // beginning of the queue.
217
- for (let scan = 0, newLength = tasks.length - index; scan < newLength; scan++) {
218
- tasks[scan] = tasks[scan + index];
219
- }
220
- tasks.length -= index;
221
- index = 0;
222
- }
223
- }
224
- tasks.length = 0;
225
- }
226
- function enqueue(callable) {
227
- tasks.push(callable);
228
- if (tasks.length < 2) {
229
- updateAsync ? rAF(process) : process();
230
- }
231
- }
232
- return Object.freeze({
233
- enqueue,
234
- next: () => new Promise(enqueue),
235
- process,
236
- setMode: (isAsync) => (updateAsync = isAsync),
237
- });
238
- });
239
-
240
177
  /**
241
178
  * The type of HTML aspect to target.
242
179
  * @public
@@ -289,21 +226,6 @@ const fastPolicy = defaultPolicy;
289
226
  * @public
290
227
  */
291
228
  const DOM = Object.freeze({
292
- /**
293
- * @deprecated
294
- * Use Updates.enqueue().
295
- */
296
- queueUpdate: Updates.enqueue,
297
- /**
298
- * @deprecated
299
- * Use Updates.next()
300
- */
301
- nextUpdate: Updates.next,
302
- /**
303
- * @deprecated
304
- * Use Updates.process()
305
- */
306
- processUpdates: Updates.process,
307
229
  /**
308
230
  * Gets the dom policy used by the templating system.
309
231
  */
@@ -687,6 +609,72 @@ const DOMPolicy = Object.freeze({
687
609
  },
688
610
  });
689
611
 
612
+ /**
613
+ * The default UpdateQueue.
614
+ * @public
615
+ */
616
+ const Updates = FAST.getById(KernelServiceId.updateQueue, () => {
617
+ const tasks = [];
618
+ const pendingErrors = [];
619
+ const rAF = globalThis.requestAnimationFrame;
620
+ let updateAsync = true;
621
+ function throwFirstError() {
622
+ if (pendingErrors.length) {
623
+ throw pendingErrors.shift();
624
+ }
625
+ }
626
+ function tryRunTask(task) {
627
+ try {
628
+ task.call();
629
+ }
630
+ catch (error) {
631
+ if (updateAsync) {
632
+ pendingErrors.push(error);
633
+ setTimeout(throwFirstError, 0);
634
+ }
635
+ else {
636
+ tasks.length = 0;
637
+ throw error;
638
+ }
639
+ }
640
+ }
641
+ function process() {
642
+ const capacity = 1024;
643
+ let index = 0;
644
+ while (index < tasks.length) {
645
+ tryRunTask(tasks[index]);
646
+ index++;
647
+ // Prevent leaking memory for long chains of recursive calls to `enqueue`.
648
+ // If we call `enqueue` within a task scheduled by `enqueue`, the queue will
649
+ // grow, but to avoid an O(n) walk for every task we execute, we don't
650
+ // shift tasks off the queue after they have been executed.
651
+ // Instead, we periodically shift 1024 tasks off the queue.
652
+ if (index > capacity) {
653
+ // Manually shift all values starting at the index back to the
654
+ // beginning of the queue.
655
+ for (let scan = 0, newLength = tasks.length - index; scan < newLength; scan++) {
656
+ tasks[scan] = tasks[scan + index];
657
+ }
658
+ tasks.length -= index;
659
+ index = 0;
660
+ }
661
+ }
662
+ tasks.length = 0;
663
+ }
664
+ function enqueue(callable) {
665
+ tasks.push(callable);
666
+ if (tasks.length < 2) {
667
+ updateAsync ? rAF(process) : process();
668
+ }
669
+ }
670
+ return Object.freeze({
671
+ enqueue,
672
+ next: () => new Promise(enqueue),
673
+ process,
674
+ setMode: (isAsync) => (updateAsync = isAsync),
675
+ });
676
+ });
677
+
690
678
  /**
691
679
  * An implementation of {@link Notifier} that efficiently keeps track of
692
680
  * subscribers interested in a specific change notification on an
@@ -1967,11 +1955,6 @@ css.partial = (strings, ...values) => {
1967
1955
  const { styles, behaviors } = collectStyles(strings, values);
1968
1956
  return new CSSPartial(styles, behaviors);
1969
1957
  };
1970
- /**
1971
- * @deprecated Use css.partial instead.
1972
- * @public
1973
- */
1974
- const cssPartial = css.partial;
1975
1958
 
1976
1959
  const marker = `fast-${Math.random().toString(36).substring(2, 8)}`;
1977
1960
  const interpolationStart = `${marker}{`;
@@ -2954,6 +2937,37 @@ const Compiler = {
2954
2937
  const lastAttributeNameRegex =
2955
2938
  /* eslint-disable-next-line no-control-regex */
2956
2939
  /([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;
2940
+ const noFactories = Object.create(null);
2941
+ /**
2942
+ * Inlines a template into another template.
2943
+ * @public
2944
+ */
2945
+ class InlineTemplateDirective {
2946
+ /**
2947
+ * Creates an instance of InlineTemplateDirective.
2948
+ * @param template - The template to inline.
2949
+ */
2950
+ constructor(html, factories = noFactories) {
2951
+ this.html = html;
2952
+ this.factories = factories;
2953
+ }
2954
+ /**
2955
+ * Creates HTML to be used within a template.
2956
+ * @param add - Can be used to add behavior factories to a template.
2957
+ */
2958
+ createHTML(add) {
2959
+ const factories = this.factories;
2960
+ for (const key in factories) {
2961
+ add(factories[key]);
2962
+ }
2963
+ return this.html;
2964
+ }
2965
+ }
2966
+ /**
2967
+ * An empty template partial.
2968
+ */
2969
+ InlineTemplateDirective.empty = new InlineTemplateDirective("");
2970
+ HTMLDirective.define(InlineTemplateDirective);
2957
2971
  function createHTML(value, prevString, add, definition = HTMLDirective.getForInstance(value)) {
2958
2972
  if (definition.aspected) {
2959
2973
  const match = lastAttributeNameRegex.exec(prevString);
@@ -2995,6 +3009,12 @@ class ViewTemplate {
2995
3009
  }
2996
3010
  return this.result.createView(hostBindingTarget);
2997
3011
  }
3012
+ /**
3013
+ * Returns a directive that can inline the template.
3014
+ */
3015
+ inline() {
3016
+ return new InlineTemplateDirective(isString(this.html) ? this.html : this.html.innerHTML, this.factories);
3017
+ }
2998
3018
  /**
2999
3019
  * Sets the DOMPolicy for this template.
3000
3020
  * @param policy - The policy to associated with this template.
@@ -3077,12 +3097,15 @@ class ViewTemplate {
3077
3097
  * other template instances, and Directive instances.
3078
3098
  * @public
3079
3099
  */
3080
- function html(strings, ...values) {
3100
+ const html = ((strings, ...values) => {
3081
3101
  if (Array.isArray(strings) && Array.isArray(strings.raw)) {
3082
3102
  return ViewTemplate.create(strings, values);
3083
3103
  }
3084
3104
  throw FAST.error(1206 /* Message.directCallToHTMLTagNotAllowed */);
3085
- }
3105
+ });
3106
+ html.partial = (html) => {
3107
+ return new InlineTemplateDirective(html);
3108
+ };
3086
3109
 
3087
3110
  /**
3088
3111
  * The runtime behavior for template references.
@@ -3578,29 +3601,6 @@ function children(propertyOrOptions) {
3578
3601
  return new ChildrenDirective(propertyOrOptions);
3579
3602
  }
3580
3603
 
3581
- /**
3582
- * A directive capable of injecting static HTML platform runtime protection.
3583
- * @public
3584
- */
3585
- class DangerousHTMLDirective {
3586
- constructor(html) {
3587
- this.html = html;
3588
- }
3589
- createHTML() {
3590
- return this.html;
3591
- }
3592
- }
3593
- HTMLDirective.define(DangerousHTMLDirective);
3594
- /**
3595
- * Injects static HTML without platform protection.
3596
- * @param html - The html to injection.
3597
- * @returns A DangerousHTMLDirective.
3598
- * @public
3599
- */
3600
- function dangerousHTML(html) {
3601
- return new DangerousHTMLDirective(html);
3602
- }
3603
-
3604
3604
  const booleanMode = "boolean";
3605
3605
  const reflectMode = "reflect";
3606
3606
  /**
@@ -3633,6 +3633,20 @@ const booleanConverter = {
3633
3633
  : true;
3634
3634
  },
3635
3635
  };
3636
+ /**
3637
+ * A {@link ValueConverter} that converts to and from `boolean` values. `null`, `undefined`, `""`, and `void` values are converted to `null`.
3638
+ * @public
3639
+ */
3640
+ const nullableBooleanConverter = {
3641
+ toView(value) {
3642
+ return typeof value === "boolean" ? value.toString() : "";
3643
+ },
3644
+ fromView(value) {
3645
+ return [null, undefined, void 0].includes(value)
3646
+ ? null
3647
+ : booleanConverter.fromView(value);
3648
+ },
3649
+ };
3636
3650
  function toNumber(value) {
3637
3651
  if (value === null || value === undefined) {
3638
3652
  return null;
@@ -4463,4 +4477,4 @@ function customElement(nameOrDef) {
4463
4477
 
4464
4478
  DOM.setPolicy(DOMPolicy.create());
4465
4479
 
4466
- export { ArrayObserver, AttributeConfiguration, AttributeDefinition, Binding, CSSDirective, ChildrenDirective, Compiler, DOM, DOMAspect, DangerousHTMLDirective, ElementController, ElementStyles, ExecutionContext, FAST, FASTElement, FASTElementDefinition, HTMLBindingDirective, HTMLDirective, HTMLView, Markup, NodeObservationDirective, Observable, Parser, PropertyChangeNotifier, RefDirective, RepeatBehavior, RepeatDirective, SlottedDirective, SourceLifetime, Splice, SpliceStrategy, SpliceStrategySupport, StatelessAttachedAttributeDirective, SubscriberSet, Updates, ViewTemplate, attr, bind, booleanConverter, children, createMetadataLocator, createTypeRegistry, css, cssDirective, cssPartial, customElement, dangerousHTML, elements, emptyArray, html, htmlDirective, lengthOf, listener, normalizeBinding, nullableNumberConverter, observable, oneTime, ref, repeat, slotted, volatile, when };
4480
+ export { ArrayObserver, AttributeConfiguration, AttributeDefinition, Binding, CSSDirective, ChildrenDirective, Compiler, DOM, DOMAspect, ElementController, ElementStyles, ExecutionContext, FAST, FASTElement, FASTElementDefinition, HTMLBindingDirective, HTMLDirective, HTMLView, InlineTemplateDirective, Markup, NodeObservationDirective, Observable, Parser, PropertyChangeNotifier, RefDirective, RepeatBehavior, RepeatDirective, SlottedDirective, SourceLifetime, Splice, SpliceStrategy, SpliceStrategySupport, StatelessAttachedAttributeDirective, SubscriberSet, Updates, ViewTemplate, attr, bind, booleanConverter, children, createMetadataLocator, createTypeRegistry, css, cssDirective, customElement, elements, emptyArray, html, htmlDirective, lengthOf, listener, normalizeBinding, nullableBooleanConverter, nullableNumberConverter, observable, oneTime, ref, repeat, slotted, volatile, when };