code-server
Version:
Run VS Code on a remote server.
85 lines • 103 kB
JavaScript
"use strict";(()=>{var it=(function(){if(typeof globalThis<"u")return globalThis;if(typeof global<"u")return global;if(typeof self<"u")return self;if(typeof window<"u")return window;try{return new Function("return this")()}catch{return{}}})();it.trustedTypes===void 0&&(it.trustedTypes={createPolicy:(r,t)=>t});var Dn={configurable:!1,enumerable:!1,writable:!1};it.FAST===void 0&&Reflect.defineProperty(it,"FAST",Object.assign({value:Object.create(null)},Dn));var yt=it.FAST;if(yt.getById===void 0){let r=Object.create(null);Reflect.defineProperty(yt,"getById",Object.assign({value(t,e){let n=r[t];return n===void 0&&(n=e?r[t]=e():null),n}},Dn))}var ct=Object.freeze([]);function Ee(){let r=new WeakMap;return function(t){let e=r.get(t);if(e===void 0){let n=Reflect.getPrototypeOf(t);for(;e===void 0&&n!==null;)e=r.get(n),n=Reflect.getPrototypeOf(n);e=e===void 0?[]:e.slice(0),r.set(t,e)}return e}}var lr=it.FAST.getById(1,()=>{let r=[],t=[];function e(){if(t.length)throw t.shift()}function n(a){try{a.call()}catch(l){t.push(l),setTimeout(e,0)}}function o(){let l=0;for(;l<r.length;)if(n(r[l]),l++,l>1024){for(let f=0,u=r.length-l;f<u;f++)r[f]=r[f+l];r.length-=l,l=0}r.length=0}function i(a){r.length<1&&it.requestAnimationFrame(o),r.push(a)}return Object.freeze({enqueue:i,process:o})}),Pn=it.trustedTypes.createPolicy("fast-html",{createHTML:r=>r}),cr=Pn,qt=`fast-${Math.random().toString(36).substring(2,8)}`,ur=`${qt}{`,_e=`}${qt}`,g=Object.freeze({supportsAdoptedStyleSheets:Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype,setHTMLPolicy(r){if(cr!==Pn)throw new Error("The HTML policy can only be set once.");cr=r},createHTML(r){return cr.createHTML(r)},isMarker(r){return r&&r.nodeType===8&&r.data.startsWith(qt)},extractDirectiveIndexFromMarker(r){return parseInt(r.data.replace(`${qt}:`,""))},createInterpolationPlaceholder(r){return`${ur}${r}${_e}`},createCustomAttributePlaceholder(r,t){return`${r}="${this.createInterpolationPlaceholder(t)}"`},createBlockPlaceholder(r){return`<!--${qt}:${r}-->`},queueUpdate:lr.enqueue,processUpdates:lr.process,nextUpdate(){return new Promise(lr.enqueue)},setAttribute(r,t,e){e==null?r.removeAttribute(t):r.setAttribute(t,e)},setBooleanAttribute(r,t,e){e?r.setAttribute(t,""):r.removeAttribute(t)},removeChildNodes(r){for(let t=r.firstChild;t!==null;t=r.firstChild)r.removeChild(t)},createTemplateWalker(r){return document.createTreeWalker(r,133,null,!1)}});var Pt=class{constructor(t,e){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.source=t,this.sub1=e}has(t){return this.spillover===void 0?this.sub1===t||this.sub2===t:this.spillover.indexOf(t)!==-1}subscribe(t){let e=this.spillover;if(e===void 0){if(this.has(t))return;if(this.sub1===void 0){this.sub1=t;return}if(this.sub2===void 0){this.sub2=t;return}this.spillover=[this.sub1,this.sub2,t],this.sub1=void 0,this.sub2=void 0}else e.indexOf(t)===-1&&e.push(t)}unsubscribe(t){let e=this.spillover;if(e===void 0)this.sub1===t?this.sub1=void 0:this.sub2===t&&(this.sub2=void 0);else{let n=e.indexOf(t);n!==-1&&e.splice(n,1)}}notify(t){let e=this.spillover,n=this.source;if(e===void 0){let o=this.sub1,i=this.sub2;o!==void 0&&o.handleChange(n,t),i!==void 0&&i.handleChange(n,t)}else for(let o=0,i=e.length;o<i;++o)e[o].handleChange(n,t)}},It=class{constructor(t){this.subscribers={},this.sourceSubscribers=null,this.source=t}notify(t){var e;let n=this.subscribers[t];n!==void 0&&n.notify(t),(e=this.sourceSubscribers)===null||e===void 0||e.notify(t)}subscribe(t,e){var n;if(e){let o=this.subscribers[e];o===void 0&&(this.subscribers[e]=o=new Pt(this.source)),o.subscribe(t)}else this.sourceSubscribers=(n=this.sourceSubscribers)!==null&&n!==void 0?n:new Pt(this.source),this.sourceSubscribers.subscribe(t)}unsubscribe(t,e){var n;if(e){let o=this.subscribers[e];o!==void 0&&o.unsubscribe(t)}else(n=this.sourceSubscribers)===null||n===void 0||n.unsubscribe(t)}};var S=yt.getById(2,()=>{let r=/(:|&&|\|\||if)/,t=new WeakMap,e=g.queueUpdate,n,o=u=>{throw new Error("Must call enableArrayObservation before observing arrays.")};function i(u){let d=u.$fastController||t.get(u);return d===void 0&&(Array.isArray(u)?d=o(u):t.set(u,d=new It(u))),d}let a=Ee();class l{constructor(d){this.name=d,this.field=`_${d}`,this.callback=`${d}Changed`}getValue(d){return n!==void 0&&n.watch(d,this.name),d[this.field]}setValue(d,x){let k=this.field,M=d[k];if(M!==x){d[k]=x;let C=d[this.callback];typeof C=="function"&&C.call(d,M,x),i(d).notify(this.name)}}}class f extends Pt{constructor(d,x,k=!1){super(d,x),this.binding=d,this.isVolatileBinding=k,this.needsRefresh=!0,this.needsQueue=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}observe(d,x){this.needsRefresh&&this.last!==null&&this.disconnect();let k=n;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;let M=this.binding(d,x);return n=k,M}disconnect(){if(this.last!==null){let d=this.first;for(;d!==void 0;)d.notifier.unsubscribe(this,d.propertyName),d=d.next;this.last=null,this.needsRefresh=this.needsQueue=!0}}watch(d,x){let k=this.last,M=i(d),C=k===null?this.first:{};if(C.propertySource=d,C.propertyName=x,C.notifier=M,M.subscribe(this,x),k!==null){if(!this.needsRefresh){let W;n=void 0,W=k.propertySource[k.propertyName],n=this,d===W&&(this.needsRefresh=!0)}k.next=C}this.last=C}handleChange(){this.needsQueue&&(this.needsQueue=!1,e(this))}call(){this.last!==null&&(this.needsQueue=!0,this.notify(this))}records(){let d=this.first;return{next:()=>{let x=d;return x===void 0?{value:void 0,done:!0}:(d=d.next,{value:x,done:!1})},[Symbol.iterator]:function(){return this}}}}return Object.freeze({setArrayObserverFactory(u){o=u},getNotifier:i,track(u,d){n!==void 0&&n.watch(u,d)},trackVolatile(){n!==void 0&&(n.needsRefresh=!0)},notify(u,d){i(u).notify(d)},defineProperty(u,d){typeof d=="string"&&(d=new l(d)),a(u).push(d),Reflect.defineProperty(u,d.name,{enumerable:!0,get:function(){return d.getValue(this)},set:function(x){d.setValue(this,x)}})},getAccessors:a,binding(u,d,x=this.isVolatileBinding(u)){return new f(u,d,x)},isVolatileBinding(u){return r.test(u.toString())}})});function X(r,t){S.defineProperty(r,t)}var In=yt.getById(3,()=>{let r=null;return{get(){return r},set(t){r=t}}}),ut=class{constructor(){this.index=0,this.length=0,this.parent=null,this.parentContext=null}get event(){return In.get()}get isEven(){return this.index%2===0}get isOdd(){return this.index%2!==0}get isFirst(){return this.index===0}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}static setEvent(t){In.set(t)}};S.defineProperty(ut.prototype,"index");S.defineProperty(ut.prototype,"length");var ft=Object.seal(new ut);var Lt=class{constructor(){this.targetIndex=0}},Mt=class extends Lt{constructor(){super(...arguments),this.createPlaceholder=g.createInterpolationPlaceholder}},Nt=class extends Lt{constructor(t,e,n){super(),this.name=t,this.behavior=e,this.options=n}createPlaceholder(t){return g.createCustomAttributePlaceholder(this.name,t)}createBehavior(t){return new this.behavior(t,this.options)}};function vi(r,t){this.source=r,this.context=t,this.bindingObserver===null&&(this.bindingObserver=S.binding(this.binding,this,this.isBindingVolatile)),this.updateTarget(this.bindingObserver.observe(r,t))}function xi(r,t){this.source=r,this.context=t,this.target.addEventListener(this.targetName,this)}function wi(){this.bindingObserver.disconnect(),this.source=null,this.context=null}function Si(){this.bindingObserver.disconnect(),this.source=null,this.context=null;let r=this.target.$fastView;r!==void 0&&r.isComposed&&(r.unbind(),r.needsBindOnly=!0)}function Ti(){this.target.removeEventListener(this.targetName,this),this.source=null,this.context=null}function Ci(r){g.setAttribute(this.target,this.targetName,r)}function Ei(r){g.setBooleanAttribute(this.target,this.targetName,r)}function _i(r){if(r==null&&(r=""),r.create){this.target.textContent="";let t=this.target.$fastView;t===void 0?t=r.create():this.target.$fastTemplate!==r&&(t.isComposed&&(t.remove(),t.unbind()),t=r.create()),t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(this.source,this.context)):(t.isComposed=!0,t.bind(this.source,this.context),t.insertBefore(this.target),this.target.$fastView=t,this.target.$fastTemplate=r)}else{let t=this.target.$fastView;t!==void 0&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),this.target.textContent=r}}function Ai(r){this.target[this.targetName]=r}function ki(r){let t=this.classVersions||Object.create(null),e=this.target,n=this.version||0;if(r!=null&&r.length){let o=r.split(/\s+/);for(let i=0,a=o.length;i<a;++i){let l=o[i];l!==""&&(t[l]=n,e.classList.add(l))}}if(this.classVersions=t,this.version=n+1,n!==0){n-=1;for(let o in t)t[o]===n&&e.classList.remove(o)}}var vt=class extends Mt{constructor(t){super(),this.binding=t,this.bind=vi,this.unbind=wi,this.updateTarget=Ci,this.isBindingVolatile=S.isVolatileBinding(this.binding)}get targetName(){return this.originalTargetName}set targetName(t){if(this.originalTargetName=t,t!==void 0)switch(t[0]){case":":if(this.cleanedTargetName=t.substr(1),this.updateTarget=Ai,this.cleanedTargetName==="innerHTML"){let e=this.binding;this.binding=(n,o)=>g.createHTML(e(n,o))}break;case"?":this.cleanedTargetName=t.substr(1),this.updateTarget=Ei;break;case"@":this.cleanedTargetName=t.substr(1),this.bind=xi,this.unbind=Ti;break;default:this.cleanedTargetName=t,t==="class"&&(this.updateTarget=ki);break}}targetAtContent(){this.updateTarget=_i,this.unbind=Si}createBehavior(t){return new fr(t,this.binding,this.isBindingVolatile,this.bind,this.unbind,this.updateTarget,this.cleanedTargetName)}},fr=class{constructor(t,e,n,o,i,a,l){this.source=null,this.context=null,this.bindingObserver=null,this.target=t,this.binding=e,this.isBindingVolatile=n,this.bind=o,this.unbind=i,this.updateTarget=a,this.targetName=l}handleChange(){this.updateTarget(this.bindingObserver.observe(this.source,this.context))}handleEvent(t){ut.setEvent(t);let e=this.binding(this.source,this.context);ut.setEvent(null),e!==!0&&t.preventDefault()}};var dr=null,hr=class r{addFactory(t){t.targetIndex=this.targetIndex,this.behaviorFactories.push(t)}captureContentBinding(t){t.targetAtContent(),this.addFactory(t)}reset(){this.behaviorFactories=[],this.targetIndex=-1}release(){dr=this}static borrow(t){let e=dr||new r;return e.directives=t,e.reset(),dr=null,e}};function Oi(r){if(r.length===1)return r[0];let t,e=r.length,n=r.map(a=>typeof a=="string"?()=>a:(t=a.targetName||t,a.binding)),o=(a,l)=>{let f="";for(let u=0;u<e;++u)f+=n[u](a,l);return f},i=new vt(o);return i.targetName=t,i}var Ri=_e.length;function Mn(r,t){let e=t.split(ur);if(e.length===1)return null;let n=[];for(let o=0,i=e.length;o<i;++o){let a=e[o],l=a.indexOf(_e),f;if(l===-1)f=a;else{let u=parseInt(a.substring(0,l));n.push(r.directives[u]),f=a.substring(l+Ri)}f!==""&&n.push(f)}return n}function Ln(r,t,e=!1){let n=t.attributes;for(let o=0,i=n.length;o<i;++o){let a=n[o],l=a.value,f=Mn(r,l),u=null;f===null?e&&(u=new vt(()=>l),u.targetName=a.name):u=Oi(f),u!==null&&(t.removeAttributeNode(a),o--,i--,r.addFactory(u))}}function Di(r,t,e){let n=Mn(r,t.textContent);if(n!==null){let o=t;for(let i=0,a=n.length;i<a;++i){let l=n[i],f=i===0?t:o.parentNode.insertBefore(document.createTextNode(""),o.nextSibling);typeof l=="string"?f.textContent=l:(f.textContent=" ",r.captureContentBinding(l)),o=f,r.targetIndex++,f!==t&&e.nextNode()}r.targetIndex--}}function Nn(r,t){let e=r.content;document.adoptNode(e);let n=hr.borrow(t);Ln(n,r,!0);let o=n.behaviorFactories;n.reset();let i=g.createTemplateWalker(e),a;for(;a=i.nextNode();)switch(n.targetIndex++,a.nodeType){case 1:Ln(n,a);break;case 3:Di(n,a,i);break;case 8:g.isMarker(a)&&n.addFactory(t[g.extractDirectiveIndexFromMarker(a)])}let l=0;(g.isMarker(e.firstChild)||e.childNodes.length===1&&t.length)&&(e.insertBefore(document.createComment(""),e.firstChild),l=-1);let f=n.behaviorFactories;return n.release(),{fragment:e,viewBehaviorFactories:f,hostBehaviorFactories:o,targetOffset:l}}var pr=document.createRange(),Ae=class{constructor(t,e){this.fragment=t,this.behaviors=e,this.source=null,this.context=null,this.firstChild=t.firstChild,this.lastChild=t.lastChild}appendTo(t){t.appendChild(this.fragment)}insertBefore(t){if(this.fragment.hasChildNodes())t.parentNode.insertBefore(this.fragment,t);else{let e=this.lastChild;if(t.previousSibling===e)return;let n=t.parentNode,o=this.firstChild,i;for(;o!==e;)i=o.nextSibling,n.insertBefore(o,t),o=i;n.insertBefore(e,t)}}remove(){let t=this.fragment,e=this.lastChild,n=this.firstChild,o;for(;n!==e;)o=n.nextSibling,t.appendChild(n),n=o;t.appendChild(e)}dispose(){let t=this.firstChild.parentNode,e=this.lastChild,n=this.firstChild,o;for(;n!==e;)o=n.nextSibling,t.removeChild(n),n=o;t.removeChild(e);let i=this.behaviors,a=this.source;for(let l=0,f=i.length;l<f;++l)i[l].unbind(a)}bind(t,e){let n=this.behaviors;if(this.source!==t)if(this.source!==null){let o=this.source;this.source=t,this.context=e;for(let i=0,a=n.length;i<a;++i){let l=n[i];l.unbind(o),l.bind(t,e)}}else{this.source=t,this.context=e;for(let o=0,i=n.length;o<i;++o)n[o].bind(t,e)}}unbind(){if(this.source===null)return;let t=this.behaviors,e=this.source;for(let n=0,o=t.length;n<o;++n)t[n].unbind(e);this.source=null}static disposeContiguousBatch(t){if(t.length!==0){pr.setStartBefore(t[0].firstChild),pr.setEndAfter(t[t.length-1].lastChild),pr.deleteContents();for(let e=0,n=t.length;e<n;++e){let o=t[e],i=o.behaviors,a=o.source;for(let l=0,f=i.length;l<f;++l)i[l].unbind(a)}}}};var ke=class{constructor(t,e){this.behaviorCount=0,this.hasHostBehaviors=!1,this.fragment=null,this.targetOffset=0,this.viewBehaviorFactories=null,this.hostBehaviorFactories=null,this.html=t,this.directives=e}create(t){if(this.fragment===null){let u,d=this.html;if(typeof d=="string"){u=document.createElement("template"),u.innerHTML=g.createHTML(d);let k=u.content.firstElementChild;k!==null&&k.tagName==="TEMPLATE"&&(u=k)}else u=d;let x=Nn(u,this.directives);this.fragment=x.fragment,this.viewBehaviorFactories=x.viewBehaviorFactories,this.hostBehaviorFactories=x.hostBehaviorFactories,this.targetOffset=x.targetOffset,this.behaviorCount=this.viewBehaviorFactories.length+this.hostBehaviorFactories.length,this.hasHostBehaviors=this.hostBehaviorFactories.length>0}let e=this.fragment.cloneNode(!0),n=this.viewBehaviorFactories,o=new Array(this.behaviorCount),i=g.createTemplateWalker(e),a=0,l=this.targetOffset,f=i.nextNode();for(let u=n.length;a<u;++a){let d=n[a],x=d.targetIndex;for(;f!==null;)if(l===x){o[a]=d.createBehavior(f);break}else f=i.nextNode(),l++}if(this.hasHostBehaviors){let u=this.hostBehaviorFactories;for(let d=0,x=u.length;d<x;++d,++a)o[a]=u[d].createBehavior(t)}return new Ae(e,o)}render(t,e,n){typeof e=="string"&&(e=document.getElementById(e)),n===void 0&&(n=e);let o=this.create(n);return o.bind(t,ft),o.appendTo(e),o}},Pi=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function xt(r,...t){let e=[],n="";for(let o=0,i=r.length-1;o<i;++o){let a=r[o],l=t[o];if(n+=a,l instanceof ke){let f=l;l=()=>f}if(typeof l=="function"&&(l=new vt(l)),l instanceof Mt){let f=Pi.exec(a);f!==null&&(l.targetName=f[2])}l instanceof Lt?(n+=l.createPlaceholder(e.length),e.push(l)):n+=l}return n+=r[r.length-1],new ke(n,e)}var A=class{constructor(){this.targets=new WeakSet}addStylesTo(t){this.targets.add(t)}removeStylesFrom(t){this.targets.delete(t)}isAttachedTo(t){return this.targets.has(t)}withBehaviors(...t){return this.behaviors=this.behaviors===null?t:this.behaviors.concat(t),this}};A.create=(()=>{if(g.supportsAdoptedStyleSheets){let r=new Map;return t=>new mr(t,r)}return r=>new gr(r)})();function br(r){return r.map(t=>t instanceof A?br(t.styles):[t]).reduce((t,e)=>t.concat(e),[])}function Fn(r){return r.map(t=>t instanceof A?t.behaviors:null).reduce((t,e)=>e===null?t:(t===null&&(t=[]),t.concat(e)),null)}var Oe=Symbol("prependToAdoptedStyleSheets");function $n(r){let t=[],e=[];return r.forEach(n=>(n[Oe]?t:e).push(n)),{prepend:t,append:e}}var Bn=(r,t)=>{let{prepend:e,append:n}=$n(t);r.adoptedStyleSheets=[...e,...r.adoptedStyleSheets,...n]},jn=(r,t)=>{r.adoptedStyleSheets=r.adoptedStyleSheets.filter(e=>t.indexOf(e)===-1)};if(g.supportsAdoptedStyleSheets)try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Bn=(r,t)=>{let{prepend:e,append:n}=$n(t);r.adoptedStyleSheets.splice(0,0,...e),r.adoptedStyleSheets.push(...n)},jn=(r,t)=>{for(let e of t){let n=r.adoptedStyleSheets.indexOf(e);n!==-1&&r.adoptedStyleSheets.splice(n,1)}}}catch{}var mr=class extends A{constructor(t,e){super(),this.styles=t,this.styleSheetCache=e,this._styleSheets=void 0,this.behaviors=Fn(t)}get styleSheets(){if(this._styleSheets===void 0){let t=this.styles,e=this.styleSheetCache;this._styleSheets=br(t).map(n=>{if(n instanceof CSSStyleSheet)return n;let o=e.get(n);return o===void 0&&(o=new CSSStyleSheet,o.replaceSync(n),e.set(n,o)),o})}return this._styleSheets}addStylesTo(t){Bn(t,this.styleSheets),super.addStylesTo(t)}removeStylesFrom(t){jn(t,this.styleSheets),super.removeStylesFrom(t)}},Ii=0;function Li(){return`fast-style-class-${++Ii}`}var gr=class extends A{constructor(t){super(),this.styles=t,this.behaviors=null,this.behaviors=Fn(t),this.styleSheets=br(t),this.styleClass=Li()}addStylesTo(t){let e=this.styleSheets,n=this.styleClass;t=this.normalizeTarget(t);for(let o=0;o<e.length;o++){let i=document.createElement("style");i.innerHTML=e[o],i.className=n,t.append(i)}super.addStylesTo(t)}removeStylesFrom(t){t=this.normalizeTarget(t);let e=t.querySelectorAll(`.${this.styleClass}`);for(let n=0,o=e.length;n<o;++n)t.removeChild(e[n]);super.removeStylesFrom(t)}isAttachedTo(t){return super.isAttachedTo(this.normalizeTarget(t))}normalizeTarget(t){return t===document?document.body:t}};var Gt=Object.freeze({locate:Ee()}),Hn={toView(r){return r?"true":"false"},fromView(r){return!(r==null||r==="false"||r===!1||r===0)}};var Re=class r{constructor(t,e,n=e.toLowerCase(),o="reflect",i){this.guards=new Set,this.Owner=t,this.name=e,this.attribute=n,this.mode=o,this.converter=i,this.fieldName=`_${e}`,this.callbackName=`${e}Changed`,this.hasCallback=this.callbackName in t.prototype,o==="boolean"&&i===void 0&&(this.converter=Hn)}setValue(t,e){let n=t[this.fieldName],o=this.converter;o!==void 0&&(e=o.fromView(e)),n!==e&&(t[this.fieldName]=e,this.tryReflectToAttribute(t),this.hasCallback&&t[this.callbackName](n,e),t.$fastController.notify(this.name))}getValue(t){return S.track(t,this.name),t[this.fieldName]}onAttributeChangedCallback(t,e){this.guards.has(t)||(this.guards.add(t),this.setValue(t,e),this.guards.delete(t))}tryReflectToAttribute(t){let e=this.mode,n=this.guards;n.has(t)||e==="fromView"||g.queueUpdate(()=>{n.add(t);let o=t[this.fieldName];switch(e){case"reflect":let i=this.converter;g.setAttribute(t,this.attribute,i!==void 0?i.toView(o):o);break;case"boolean":g.setBooleanAttribute(t,this.attribute,o);break}n.delete(t)})}static collect(t,...e){let n=[];e.push(Gt.locate(t));for(let o=0,i=e.length;o<i;++o){let a=e[o];if(a!==void 0)for(let l=0,f=a.length;l<f;++l){let u=a[l];typeof u=="string"?n.push(new r(t,u)):n.push(new r(t,u.property,u.attribute,u.mode,u.converter))}}return n}};function b(r,t){let e;function n(o,i){arguments.length>1&&(e.property=i),Gt.locate(o.constructor).push(e)}if(arguments.length>1){e={},n(r,t);return}return e=r===void 0?{}:r,n}var Un={mode:"open"},zn={},yr=yt.getById(4,()=>{let r=new Map;return Object.freeze({register(t){return r.has(t.type)?!1:(r.set(t.type,t),!0)},getByType(t){return r.get(t)}})}),et=class{constructor(t,e=t.definition){typeof e=="string"&&(e={name:e}),this.type=t,this.name=e.name,this.template=e.template;let n=Re.collect(t,e.attributes),o=new Array(n.length),i={},a={};for(let l=0,f=n.length;l<f;++l){let u=n[l];o[l]=u.attribute,i[u.name]=u,a[u.attribute]=u}this.attributes=n,this.observedAttributes=o,this.propertyLookup=i,this.attributeLookup=a,this.shadowOptions=e.shadowOptions===void 0?Un:e.shadowOptions===null?void 0:Object.assign(Object.assign({},Un),e.shadowOptions),this.elementOptions=e.elementOptions===void 0?zn:Object.assign(Object.assign({},zn),e.elementOptions),this.styles=e.styles===void 0?void 0:Array.isArray(e.styles)?A.create(e.styles):e.styles instanceof A?e.styles:A.create([e.styles])}get isDefined(){return!!yr.getByType(this.type)}define(t=customElements){let e=this.type;if(yr.register(this)){let n=this.attributes,o=e.prototype;for(let i=0,a=n.length;i<a;++i)S.defineProperty(o,n[i]);Reflect.defineProperty(e,"observedAttributes",{value:this.observedAttributes,enumerable:!0})}return t.get(this.name)||t.define(this.name,e,this.elementOptions),this}};et.forType=yr.getByType;var Vn=new WeakMap,Mi={bubbles:!0,composed:!0,cancelable:!0};function vr(r){return r.shadowRoot||Vn.get(r)||null}var De=class r extends It{constructor(t,e){super(t),this.boundObservables=null,this.behaviors=null,this.needsInitialization=!0,this._template=null,this._styles=null,this._isConnected=!1,this.$fastController=this,this.view=null,this.element=t,this.definition=e;let n=e.shadowOptions;if(n!==void 0){let i=t.attachShadow(n);n.mode==="closed"&&Vn.set(t,i)}let o=S.getAccessors(t);if(o.length>0){let i=this.boundObservables=Object.create(null);for(let a=0,l=o.length;a<l;++a){let f=o[a].name,u=t[f];u!==void 0&&(delete t[f],i[f]=u)}}}get isConnected(){return S.track(this,"isConnected"),this._isConnected}setIsConnected(t){this._isConnected=t,S.notify(this,"isConnected")}get template(){return this._template}set template(t){this._template!==t&&(this._template=t,this.needsInitialization||this.renderTemplate(t))}get styles(){return this._styles}set styles(t){this._styles!==t&&(this._styles!==null&&this.removeStyles(this._styles),this._styles=t,!this.needsInitialization&&t!==null&&this.addStyles(t))}addStyles(t){let e=vr(this.element)||this.element.getRootNode();if(t instanceof HTMLStyleElement)e.append(t);else if(!t.isAttachedTo(e)){let n=t.behaviors;t.addStylesTo(e),n!==null&&this.addBehaviors(n)}}removeStyles(t){let e=vr(this.element)||this.element.getRootNode();if(t instanceof HTMLStyleElement)e.removeChild(t);else if(t.isAttachedTo(e)){let n=t.behaviors;t.removeStylesFrom(e),n!==null&&this.removeBehaviors(n)}}addBehaviors(t){let e=this.behaviors||(this.behaviors=new Map),n=t.length,o=[];for(let i=0;i<n;++i){let a=t[i];e.has(a)?e.set(a,e.get(a)+1):(e.set(a,1),o.push(a))}if(this._isConnected){let i=this.element;for(let a=0;a<o.length;++a)o[a].bind(i,ft)}}removeBehaviors(t,e=!1){let n=this.behaviors;if(n===null)return;let o=t.length,i=[];for(let a=0;a<o;++a){let l=t[a];if(n.has(l)){let f=n.get(l)-1;f===0||e?n.delete(l)&&i.push(l):n.set(l,f)}}if(this._isConnected){let a=this.element;for(let l=0;l<i.length;++l)i[l].unbind(a)}}onConnectedCallback(){if(this._isConnected)return;let t=this.element;this.needsInitialization?this.finishInitialization():this.view!==null&&this.view.bind(t,ft);let e=this.behaviors;if(e!==null)for(let[n]of e)n.bind(t,ft);this.setIsConnected(!0)}onDisconnectedCallback(){if(!this._isConnected)return;this.setIsConnected(!1);let t=this.view;t!==null&&t.unbind();let e=this.behaviors;if(e!==null){let n=this.element;for(let[o]of e)o.unbind(n)}}onAttributeChangedCallback(t,e,n){let o=this.definition.attributeLookup[t];o!==void 0&&o.onAttributeChangedCallback(this.element,n)}emit(t,e,n){return this._isConnected?this.element.dispatchEvent(new CustomEvent(t,Object.assign(Object.assign({detail:e},Mi),n))):!1}finishInitialization(){let t=this.element,e=this.boundObservables;if(e!==null){let o=Object.keys(e);for(let i=0,a=o.length;i<a;++i){let l=o[i];t[l]=e[l]}this.boundObservables=null}let n=this.definition;this._template===null&&(this.element.resolveTemplate?this._template=this.element.resolveTemplate():n.template&&(this._template=n.template||null)),this._template!==null&&this.renderTemplate(this._template),this._styles===null&&(this.element.resolveStyles?this._styles=this.element.resolveStyles():n.styles&&(this._styles=n.styles||null)),this._styles!==null&&this.addStyles(this._styles),this.needsInitialization=!1}renderTemplate(t){let e=this.element,n=vr(e)||e;this.view!==null?(this.view.dispose(),this.view=null):this.needsInitialization||g.removeChildNodes(n),t&&(this.view=t.render(e,n,e))}static forCustomElement(t){let e=t.$fastController;if(e!==void 0)return e;let n=et.forType(t.constructor);if(n===void 0)throw new Error("Missing FASTElement definition.");return t.$fastController=new r(t,n)}};function Wn(r){return class extends r{constructor(){super(),De.forCustomElement(this)}$emit(t,e,n){return this.$fastController.emit(t,e,n)}connectedCallback(){this.$fastController.onConnectedCallback()}disconnectedCallback(){this.$fastController.onDisconnectedCallback()}attributeChangedCallback(t,e,n){this.$fastController.onAttributeChangedCallback(t,e,n)}}}var dt=Object.assign(Wn(HTMLElement),{from(r){return Wn(r)},define(r,t){return new et(r,t).define().type}});var wt=class{createCSS(){return""}createBehavior(){}};function Ni(r,t){let e=[],n="",o=[];for(let i=0,a=r.length-1;i<a;++i){n+=r[i];let l=t[i];if(l instanceof wt){let f=l.createBehavior();l=l.createCSS(),f&&o.push(f)}l instanceof A||l instanceof CSSStyleSheet?(n.trim()!==""&&(e.push(n),n=""),e.push(l)):n+=l}return n+=r[r.length-1],n.trim()!==""&&e.push(n),{styles:e,behaviors:o}}function St(r,...t){let{styles:e,behaviors:n}=Ni(r,t),o=A.create(e);return n.length&&o.withBehaviors(...n),o}var xr=class{constructor(t,e){this.target=t,this.propertyName=e}bind(t){t[this.propertyName]=this.target}unbind(){}};function Q(r){return new Nt("fast-ref",xr,r)}var Pe=class{constructor(t,e){this.target=t,this.options=e,this.source=null}bind(t){let e=this.options.property;this.shouldUpdate=S.getAccessors(t).some(n=>n.name===e),this.source=t,this.updateTarget(this.computeNodes()),this.shouldUpdate&&this.observe()}unbind(){this.updateTarget(ct),this.source=null,this.shouldUpdate&&this.disconnect()}handleEvent(){this.updateTarget(this.computeNodes())}computeNodes(){let t=this.getNodes();return this.options.filter!==void 0&&(t=t.filter(this.options.filter)),t}updateTarget(t){this.source[this.options.property]=t}};var wr=class extends Pe{constructor(t,e){super(t,e)}observe(){this.target.addEventListener("slotchange",this)}disconnect(){this.target.removeEventListener("slotchange",this)}getNodes(){return this.target.assignedNodes(this.options)}};function qn(r){return typeof r=="string"&&(r={property:r}),new Nt("fast-slotted",wr,r)}var Ie=class{handleStartContentChange(){this.startContainer.classList.toggle("start",this.start.assignedNodes().length>0)}handleEndContentChange(){this.endContainer.classList.toggle("end",this.end.assignedNodes().length>0)}},Gn=(r,t)=>xt`
<span
part="end"
${Q("endContainer")}
class=${e=>t.end?"end":void 0}
>
<slot name="end" ${Q("end")} @slotchange="${e=>e.handleEndContentChange()}">
${t.end||""}
</slot>
</span>
`,Yn=(r,t)=>xt`
<span
part="start"
${Q("startContainer")}
class="${e=>t.start?"start":void 0}"
>
<slot
name="start"
${Q("start")}
@slotchange="${e=>e.handleStartContentChange()}"
>
${t.start||""}
</slot>
</span>
`,ol=xt`
<span part="end" ${Q("endContainer")}>
<slot
name="end"
${Q("end")}
@slotchange="${r=>r.handleEndContentChange()}"
></slot>
</span>
`,il=xt`
<span part="start" ${Q("startContainer")}>
<slot
name="start"
${Q("start")}
@slotchange="${r=>r.handleStartContentChange()}"
></slot>
</span>
`;function y(r,t,e,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,n);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(i=(o<3?a(i):o>3?a(t,e,i):a(t,e))||i);return o>3&&i&&Object.defineProperty(t,e,i),i}var Sr=new Map;"metadata"in Reflect||(Reflect.metadata=function(r,t){return function(e){Reflect.defineMetadata(r,t,e)}},Reflect.defineMetadata=function(r,t,e){let n=Sr.get(e);n===void 0&&Sr.set(e,n=new Map),n.set(r,t)},Reflect.getOwnMetadata=function(r,t){let e=Sr.get(t);if(e!==void 0)return e.get(r)});var _r=class{constructor(t,e){this.container=t,this.key=e}instance(t){return this.registerResolver(0,t)}singleton(t){return this.registerResolver(1,t)}transient(t){return this.registerResolver(2,t)}callback(t){return this.registerResolver(3,t)}cachedCallback(t){return this.registerResolver(3,io(t))}aliasTo(t){return this.registerResolver(5,t)}registerResolver(t,e){let{container:n,key:o}=this;return this.container=this.key=void 0,n.registerResolver(o,new $(o,t,e))}};function Yt(r){let t=r.slice(),e=Object.keys(r),n=e.length,o;for(let i=0;i<n;++i)o=e[i],so(o)||(t[o]=r[o]);return t}var Fi=Object.freeze({none(r){throw Error(`${r.toString()} not registered, did you forget to add @singleton()?`)},singleton(r){return new $(r,1,r)},transient(r){return new $(r,2,r)}}),Tr=Object.freeze({default:Object.freeze({parentLocator:()=>null,responsibleForOwnerRequests:!1,defaultResolver:Fi.singleton})}),Xn=new Map;function Qn(r){return t=>Reflect.getOwnMetadata(r,t)}var Zn=null,w=Object.freeze({createContainer(r){return new Xt(null,Object.assign({},Tr.default,r))},findResponsibleContainer(r){let t=r.$$container$$;return t&&t.responsibleForOwnerRequests?t:w.findParentContainer(r)},findParentContainer(r){let t=new CustomEvent(oo,{bubbles:!0,composed:!0,cancelable:!0,detail:{container:void 0}});return r.dispatchEvent(t),t.detail.container||w.getOrCreateDOMContainer()},getOrCreateDOMContainer(r,t){return r?r.$$container$$||new Xt(r,Object.assign({},Tr.default,t,{parentLocator:w.findParentContainer})):Zn||(Zn=new Xt(null,Object.assign({},Tr.default,t,{parentLocator:()=>null})))},getDesignParamtypes:Qn("design:paramtypes"),getAnnotationParamtypes:Qn("di:paramtypes"),getOrCreateAnnotationParamTypes(r){let t=this.getAnnotationParamtypes(r);return t===void 0&&Reflect.defineMetadata("di:paramtypes",t=[],r),t},getDependencies(r){let t=Xn.get(r);if(t===void 0){let e=r.inject;if(e===void 0){let n=w.getDesignParamtypes(r),o=w.getAnnotationParamtypes(r);if(n===void 0)if(o===void 0){let i=Object.getPrototypeOf(r);typeof i=="function"&&i!==Function.prototype?t=Yt(w.getDependencies(i)):t=[]}else t=Yt(o);else if(o===void 0)t=Yt(n);else{t=Yt(n);let i=o.length,a;for(let u=0;u<i;++u)a=o[u],a!==void 0&&(t[u]=a);let l=Object.keys(o);i=l.length;let f;for(let u=0;u<i;++u)f=l[u],so(f)||(t[f]=o[f])}}else t=Yt(e);Xn.set(r,t)}return t},defineProperty(r,t,e,n=!1){let o=`$di_${t}`;Reflect.defineProperty(r,t,{get:function(){let i=this[o];if(i===void 0&&(i=(this instanceof HTMLElement?w.findResponsibleContainer(this):w.getOrCreateDOMContainer()).get(e),this[o]=i,n&&this instanceof dt)){let l=this.$fastController,f=()=>{let d=w.findResponsibleContainer(this).get(e),x=this[o];d!==x&&(this[o]=i,l.notify(t))};l.subscribe({handleChange:f},"isConnected")}return i}})},createInterface(r,t){let e=typeof r=="function"?r:t,n=typeof r=="string"?r:r&&"friendlyName"in r&&r.friendlyName||eo,o=typeof r=="string"?!1:r&&"respectConnection"in r&&r.respectConnection||!1,i=function(a,l,f){if(a==null||new.target!==void 0)throw new Error(`No registration for interface: '${i.friendlyName}'`);if(l)w.defineProperty(a,l,i,o);else{let u=w.getOrCreateAnnotationParamTypes(a);u[f]=i}};return i.$isInterface=!0,i.friendlyName=n??"(anonymous)",e!=null&&(i.register=function(a,l){return e(new _r(a,l??i))}),i.toString=function(){return`InterfaceSymbol<${i.friendlyName}>`},i},inject(...r){return function(t,e,n){if(typeof n=="number"){let o=w.getOrCreateAnnotationParamTypes(t),i=r[0];i!==void 0&&(o[n]=i)}else if(e)w.defineProperty(t,e,r[0]);else{let o=n?w.getOrCreateAnnotationParamTypes(n.value):w.getOrCreateAnnotationParamTypes(t),i;for(let a=0;a<r.length;++a)i=r[a],i!==void 0&&(o[a]=i)}}},transient(r){return r.register=function(e){return Tt.transient(r,r).register(e)},r.registerInRequestor=!1,r},singleton(r,t=Bi){return r.register=function(n){return Tt.singleton(r,r).register(n)},r.registerInRequestor=t.scoped,r}}),$i=w.createInterface("Container");function Fe(r){return function(t){let e=function(n,o,i){w.inject(e)(n,o,i)};return e.$isResolver=!0,e.resolve=function(n,o){return r(t,n,o)},e}}var cl=w.inject;var Bi={scoped:!1};function ji(r){return function(t,e){e=!!e;let n=function(o,i,a){w.inject(n)(o,i,a)};return n.$isResolver=!0,n.resolve=function(o,i){return r(t,o,i,e)},n}}var ul=ji((r,t,e,n)=>e.getAll(r,n)),fl=Fe((r,t,e)=>()=>e.get(r)),dl=Fe((r,t,e)=>{if(e.has(r,!0))return e.get(r)});function kr(r,t,e){w.inject(kr)(r,t,e)}kr.$isResolver=!0;kr.resolve=()=>{};var hl=Fe((r,t,e)=>{let n=no(r,t),o=new $(r,0,n);return e.registerResolver(r,o),n}),pl=Fe((r,t,e)=>no(r,t));function no(r,t){return t.getFactory(r).construct(t)}var $=class{constructor(t,e,n){this.key=t,this.strategy=e,this.state=n,this.resolving=!1}get $isResolver(){return!0}register(t){return t.registerResolver(this.key,this)}resolve(t,e){switch(this.strategy){case 0:return this.state;case 1:{if(this.resolving)throw new Error(`Cyclic dependency found: ${this.state.name}`);return this.resolving=!0,this.state=t.getFactory(this.state).construct(e),this.strategy=0,this.resolving=!1,this.state}case 2:{let n=t.getFactory(this.state);if(n===null)throw new Error(`Resolver for ${String(this.key)} returned a null factory`);return n.construct(e)}case 3:return this.state(t,e,this);case 4:return this.state[0].resolve(t,e);case 5:return e.get(this.state);default:throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`)}}getFactory(t){var e,n,o;switch(this.strategy){case 1:case 2:return t.getFactory(this.state);case 5:return(o=(n=(e=t.getResolver(this.state))===null||e===void 0?void 0:e.getFactory)===null||n===void 0?void 0:n.call(e,t))!==null&&o!==void 0?o:null;default:return null}}};function Jn(r){return this.get(r)}function Hi(r,t){return t(r)}var Ar=class{constructor(t,e){this.Type=t,this.dependencies=e,this.transformers=null}construct(t,e){let n;return e===void 0?n=new this.Type(...this.dependencies.map(Jn,t)):n=new this.Type(...this.dependencies.map(Jn,t),...e),this.transformers==null?n:this.transformers.reduce(Hi,n)}registerTransformer(t){(this.transformers||(this.transformers=[])).push(t)}},Ui={$isResolver:!0,resolve(r,t){return t}};function Ne(r){return typeof r.register=="function"}function zi(r){return Ne(r)&&typeof r.registerInRequestor=="boolean"}function Kn(r){return zi(r)&&r.registerInRequestor}function Vi(r){return r.prototype!==void 0}var Wi=new Set(["Array","ArrayBuffer","Boolean","DataView","Date","Error","EvalError","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Number","Object","Promise","RangeError","ReferenceError","RegExp","Set","SharedArrayBuffer","String","SyntaxError","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakMap","WeakSet"]),oo="__DI_LOCATE_PARENT__",Cr=new Map,Xt=class r{constructor(t,e){this.owner=t,this.config=e,this._parent=void 0,this.registerDepth=0,this.context=null,t!==null&&(t.$$container$$=this),this.resolvers=new Map,this.resolvers.set($i,Ui),t instanceof Node&&t.addEventListener(oo,n=>{n.composedPath()[0]!==this.owner&&(n.detail.container=this,n.stopImmediatePropagation())})}get parent(){return this._parent===void 0&&(this._parent=this.config.parentLocator(this.owner)),this._parent}get depth(){return this.parent===null?0:this.parent.depth+1}get responsibleForOwnerRequests(){return this.config.responsibleForOwnerRequests}registerWithContext(t,...e){return this.context=t,this.register(...e),this.context=null,this}register(...t){if(++this.registerDepth===100)throw new Error("Unable to autoregister dependency");let e,n,o,i,a,l=this.context;for(let f=0,u=t.length;f<u;++f)if(e=t[f],!!ro(e))if(Ne(e))e.register(this,l);else if(Vi(e))Tt.singleton(e,e).register(this);else for(n=Object.keys(e),i=0,a=n.length;i<a;++i)o=e[n[i]],ro(o)&&(Ne(o)?o.register(this,l):this.register(o));return--this.registerDepth,this}registerResolver(t,e){Le(t);let n=this.resolvers,o=n.get(t);return o==null?n.set(t,e):o instanceof $&&o.strategy===4?o.state.push(e):n.set(t,new $(t,4,[o,e])),e}registerTransformer(t,e){let n=this.getResolver(t);if(n==null)return!1;if(n.getFactory){let o=n.getFactory(this);return o==null?!1:(o.registerTransformer(e),!0)}return!1}getResolver(t,e=!0){if(Le(t),t.resolve!==void 0)return t;let n=this,o;for(;n!=null;)if(o=n.resolvers.get(t),o==null){if(n.parent==null){let i=Kn(t)?this:n;return e?this.jitRegister(t,i):null}n=n.parent}else return o;return null}has(t,e=!1){return this.resolvers.has(t)?!0:e&&this.parent!=null?this.parent.has(t,!0):!1}get(t){if(Le(t),t.$isResolver)return t.resolve(this,this);let e=this,n;for(;e!=null;)if(n=e.resolvers.get(t),n==null){if(e.parent==null){let o=Kn(t)?this:e;return n=this.jitRegister(t,o),n.resolve(e,this)}e=e.parent}else return n.resolve(e,this);throw new Error(`Unable to resolve key: ${String(t)}`)}getAll(t,e=!1){Le(t);let n=this,o=n,i;if(e){let a=ct;for(;o!=null;)i=o.resolvers.get(t),i!=null&&(a=a.concat(to(i,o,n))),o=o.parent;return a}else for(;o!=null;)if(i=o.resolvers.get(t),i==null){if(o=o.parent,o==null)return ct}else return to(i,o,n);return ct}getFactory(t){let e=Cr.get(t);if(e===void 0){if(qi(t))throw new Error(`${t.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`);Cr.set(t,e=new Ar(t,w.getDependencies(t)))}return e}registerFactory(t,e){Cr.set(t,e)}createChild(t){return new r(null,Object.assign({},this.config,t,{parentLocator:()=>this}))}jitRegister(t,e){if(typeof t!="function")throw new Error(`Attempted to jitRegister something that is not a constructor: '${t}'. Did you forget to register this dependency?`);if(Wi.has(t.name))throw new Error(`Attempted to jitRegister an intrinsic type: ${t.name}. Did you forget to add @inject(Key)`);if(Ne(t)){let n=t.register(e);if(!(n instanceof Object)||n.resolve==null){let o=e.resolvers.get(t);if(o!=null)return o;throw new Error("A valid resolver was not returned from the static register method")}return n}else{if(t.$isInterface)throw new Error(`Attempted to jitRegister an interface: ${t.friendlyName}`);{let n=this.config.defaultResolver(t,e);return e.resolvers.set(t,n),n}}}},Er=new WeakMap;function io(r){return function(t,e,n){if(Er.has(n))return Er.get(n);let o=r(t,e,n);return Er.set(n,o),o}}var Tt=Object.freeze({instance(r,t){return new $(r,0,t)},singleton(r,t){return new $(r,1,t)},transient(r,t){return new $(r,2,t)},callback(r,t){return new $(r,3,t)},cachedCallback(r,t){return new $(r,3,io(t))},aliasTo(r,t){return new $(t,5,r)}});function Le(r){if(r==null)throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?")}function to(r,t,e){if(r instanceof $&&r.strategy===4){let n=r.state,o=n.length,i=new Array(o);for(;o--;)i[o]=n[o].resolve(t,e);return i}return[r.resolve(t,e)]}var eo="(anonymous)";function ro(r){return typeof r=="object"&&r!==null||typeof r=="function"}var qi=(function(){let r=new WeakMap,t=!1,e="",n=0;return function(o){return t=r.get(o),t===void 0&&(e=o.toString(),n=e.length,t=n>=29&&n<=100&&e.charCodeAt(n-1)===125&&e.charCodeAt(n-2)<=32&&e.charCodeAt(n-3)===93&&e.charCodeAt(n-4)===101&&e.charCodeAt(n-5)===100&&e.charCodeAt(n-6)===111&&e.charCodeAt(n-7)===99&&e.charCodeAt(n-8)===32&&e.charCodeAt(n-9)===101&&e.charCodeAt(n-10)===118&&e.charCodeAt(n-11)===105&&e.charCodeAt(n-12)===116&&e.charCodeAt(n-13)===97&&e.charCodeAt(n-14)===110&&e.charCodeAt(n-15)===88,r.set(o,t)),t}})(),Me={};function so(r){switch(typeof r){case"number":return r>=0&&(r|0)===r;case"string":{let t=Me[r];if(t!==void 0)return t;let e=r.length;if(e===0)return Me[r]=!1;let n=0;for(let o=0;o<e;++o)if(n=r.charCodeAt(o),o===0&&n===48&&e>1||n<48||n>57)return Me[r]=!1;return Me[r]=!0}default:return!1}}function ao(r){return`${r.toLowerCase()}:presentation`}var $e=new Map,je=Object.freeze({define(r,t,e){let n=ao(r);$e.get(n)===void 0?$e.set(n,t):$e.set(n,!1),e.register(Tt.instance(n,t))},forTag(r,t){let e=ao(r),n=$e.get(e);return n===!1?w.findResponsibleContainer(t).get(e):n||null}}),Be=class{constructor(t,e){this.template=t||null,this.styles=e===void 0?null:Array.isArray(e)?A.create(e):e instanceof A?e:A.create([e])}applyTo(t){let e=t.$fastController;e.template===null&&(e.template=this.template),e.styles===null&&(e.styles=this.styles)}};var ht=class r extends dt{constructor(){super(...arguments),this._presentation=void 0}get $presentation(){return this._presentation===void 0&&(this._presentation=je.forTag(this.tagName,this)),this._presentation}templateChanged(){this.template!==void 0&&(this.$fastController.template=this.template)}stylesChanged(){this.styles!==void 0&&(this.$fastController.styles=this.styles)}connectedCallback(){this.$presentation!==null&&this.$presentation.applyTo(this),super.connectedCallback()}static compose(t){return(e={})=>new Or(this===r?class extends r{}:this,t,e)}};y([X],ht.prototype,"template",void 0);y([X],ht.prototype,"styles",void 0);function Qt(r,t,e){return typeof r=="function"?r(t,e):r}var Or=class{constructor(t,e,n){this.type=t,this.elementDefinition=e,this.overrideDefinition=n,this.definition=Object.assign(Object.assign({},this.elementDefinition),this.overrideDefinition)}register(t,e){let n=this.definition,o=this.overrideDefinition,a=`${n.prefix||e.elementPrefix}-${n.baseName}`;e.tryDefineElement({name:a,type:this.type,baseClass:this.elementDefinition.baseClass,callback:l=>{let f=new Be(Qt(n.template,l,n),Qt(n.styles,l,n));l.definePresentation(f);let u=Qt(n.shadowOptions,l,n);l.shadowRootMode&&(u?o.shadowOptions||(u.mode=l.shadowRootMode):u!==null&&(u={mode:l.shadowRootMode})),l.defineElement({elementOptions:Qt(n.elementOptions,l,n),shadowOptions:u,attributes:Qt(n.attributes,l,n)})}})}};function Rr(r,...t){let e=Gt.locate(r);t.forEach(n=>{Object.getOwnPropertyNames(n.prototype).forEach(i=>{i!=="constructor"&&Object.defineProperty(r.prototype,i,Object.getOwnPropertyDescriptor(n.prototype,i))}),Gt.locate(n).forEach(i=>e.push(i))})}function lo(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Gi(){let r=document.querySelector('meta[property="csp-nonce"]');return r?r.getAttribute("content"):null}var Ct;function co(){if(typeof Ct=="boolean")return Ct;if(!lo())return Ct=!1,Ct;let r=document.createElement("style"),t=Gi();t!==null&&r.setAttribute("nonce",t),document.head.appendChild(r);try{r.sheet.insertRule("foo:focus-visible {color:inherit}",0),Ct=!0}catch{Ct=!1}finally{document.head.removeChild(r)}return Ct}var uo;(function(r){r[r.alt=18]="alt",r[r.arrowDown=40]="arrowDown",r[r.arrowLeft=37]="arrowLeft",r[r.arrowRight=39]="arrowRight",r[r.arrowUp=38]="arrowUp",r[r.back=8]="back",r[r.backSlash=220]="backSlash",r[r.break=19]="break",r[r.capsLock=20]="capsLock",r[r.closeBracket=221]="closeBracket",r[r.colon=186]="colon",r[r.colon2=59]="colon2",r[r.comma=188]="comma",r[r.ctrl=17]="ctrl",r[r.delete=46]="delete",r[r.end=35]="end",r[r.enter=13]="enter",r[r.equals=187]="equals",r[r.equals2=61]="equals2",r[r.equals3=107]="equals3",r[r.escape=27]="escape",r[r.forwardSlash=191]="forwardSlash",r[r.function1=112]="function1",r[r.function10=121]="function10",r[r.function11=122]="function11",r[r.function12=123]="function12",r[r.function2=113]="function2",r[r.function3=114]="function3",r[r.function4=115]="function4",r[r.function5=116]="function5",r[r.function6=117]="function6",r[r.function7=118]="function7",r[r.function8=119]="function8",r[r.function9=120]="function9",r[r.home=36]="home",r[r.insert=45]="insert",r[r.menu=93]="menu",r[r.minus=189]="minus",r[r.minus2=109]="minus2",r[r.numLock=144]="numLock",r[r.numPad0=96]="numPad0",r[r.numPad1=97]="numPad1",r[r.numPad2=98]="numPad2",r[r.numPad3=99]="numPad3",r[r.numPad4=100]="numPad4",r[r.numPad5=101]="numPad5",r[r.numPad6=102]="numPad6",r[r.numPad7=103]="numPad7",r[r.numPad8=104]="numPad8",r[r.numPad9=105]="numPad9",r[r.numPadDivide=111]="numPadDivide",r[r.numPadDot=110]="numPadDot",r[r.numPadMinus=109]="numPadMinus",r[r.numPadMultiply=106]="numPadMultiply",r[r.numPadPlus=107]="numPadPlus",r[r.openBracket=219]="openBracket",r[r.pageDown=34]="pageDown",r[r.pageUp=33]="pageUp",r[r.period=190]="period",r[r.print=44]="print",r[r.quote=222]="quote",r[r.scrollLock=145]="scrollLock",r[r.shift=16]="shift",r[r.space=32]="space",r[r.tab=9]="tab",r[r.tilde=192]="tilde",r[r.windowsLeft=91]="windowsLeft",r[r.windowsOpera=219]="windowsOpera",r[r.windowsRight=92]="windowsRight"})(uo||(uo={}));var fo="Enter";var E=class{};y([b({attribute:"aria-atomic"})],E.prototype,"ariaAtomic",void 0);y([b({attribute:"aria-busy"})],E.prototype,"ariaBusy",void 0);y([b({attribute:"aria-controls"})],E.prototype,"ariaControls",void 0);y([b({attribute:"aria-current"})],E.prototype,"ariaCurrent",void 0);y([b({attribute:"aria-describedby"})],E.prototype,"ariaDescribedby",void 0);y([b({attribute:"aria-details"})],E.prototype,"ariaDetails",void 0);y([b({attribute:"aria-disabled"})],E.prototype,"ariaDisabled",void 0);y([b({attribute:"aria-errormessage"})],E.prototype,"ariaErrormessage",void 0);y([b({attribute:"aria-flowto"})],E.prototype,"ariaFlowto",void 0);y([b({attribute:"aria-haspopup"})],E.prototype,"ariaHaspopup",void 0);y([b({attribute:"aria-hidden"})],E.prototype,"ariaHidden",void 0);y([b({attribute:"aria-invalid"})],E.prototype,"ariaInvalid",void 0);y([b({attribute:"aria-keyshortcuts"})],E.prototype,"ariaKeyshortcuts",void 0);y([b({attribute:"aria-label"})],E.prototype,"ariaLabel",void 0);y([b({attribute:"aria-labelledby"})],E.prototype,"ariaLabelledby",void 0);y([b({attribute:"aria-live"})],E.prototype,"ariaLive",void 0);y([b({attribute:"aria-owns"})],E.prototype,"ariaOwns",void 0);y([b({attribute:"aria-relevant"})],E.prototype,"ariaRelevant",void 0);y([b({attribute:"aria-roledescription"})],E.prototype,"ariaRoledescription",void 0);var ho=(r,t)=>xt`
<button
class="control"
part="control"
?autofocus="${e=>e.autofocus}"
?disabled="${e=>e.disabled}"
form="${e=>e.formId}"
formaction="${e=>e.formaction}"
formenctype="${e=>e.formenctype}"
formmethod="${e=>e.formmethod}"
formnovalidate="${e=>e.formnovalidate}"
formtarget="${e=>e.formtarget}"
name="${e=>e.name}"
type="${e=>e.type}"
value="${e=>e.value}"
aria-atomic="${e=>e.ariaAtomic}"
aria-busy="${e=>e.ariaBusy}"
aria-controls="${e=>e.ariaControls}"
aria-current="${e=>e.ariaCurrent}"
aria-describedby="${e=>e.ariaDescribedby}"
aria-details="${e=>e.ariaDetails}"
aria-disabled="${e=>e.ariaDisabled}"
aria-errormessage="${e=>e.ariaErrormessage}"
aria-expanded="${e=>e.ariaExpanded}"
aria-flowto="${e=>e.ariaFlowto}"
aria-haspopup="${e=>e.ariaHaspopup}"
aria-hidden="${e=>e.ariaHidden}"
aria-invalid="${e=>e.ariaInvalid}"
aria-keyshortcuts="${e=>e.ariaKeyshortcuts}"
aria-label="${e=>e.ariaLabel}"
aria-labelledby="${e=>e.ariaLabelledby}"
aria-live="${e=>e.ariaLive}"
aria-owns="${e=>e.ariaOwns}"
aria-pressed="${e=>e.ariaPressed}"
aria-relevant="${e=>e.ariaRelevant}"
aria-roledescription="${e=>e.ariaRoledescription}"
${Q("control")}
>
${Yn(r,t)}
<span class="content" part="content">
<slot ${qn("defaultSlottedContent")}></slot>
</span>
${Gn(r,t)}
</button>
`;var po="form-associated-proxy",mo="ElementInternals",go=mo in window&&"setFormValue"in window[mo].prototype,bo=new WeakMap;function yo(r){let t=class extends r{constructor(...e){super(...e),this.dirtyValue=!1,this.disabled=!1,this.proxyEventsToBlock=["change","click"],this.proxyInitialized=!1,this.required=!1,this.initialValue=this.initialValue||"",this.elementInternals||(this.formResetCallback=this.formResetCallback.bind(this))}static get formAssociated(){return go}get validity(){return this.elementInternals?this.elementInternals.validity:this.proxy.validity}get form(){return this.elementInternals?this.elementInternals.form:this.proxy.form}get validationMessage(){return this.elementInternals?this.elementInternals.validationMessage:this.proxy.validationMessage}get willValidate(){return this.elementInternals?this.elementInternals.willValidate:this.proxy.willValidate}get labels(){if(this.elementInternals)return Object.freeze(Array.from(this.elementInternals.labels));if(this.proxy instanceof HTMLElement&&this.proxy.ownerDocument&&this.id){let e=this.proxy.labels,n=Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)),o=e?n.concat(Array.from(e)):n;return Object.freeze(o)}else return ct}valueChanged(e,n){this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.currentValue=this.value,this.setFormValue(this.value),this.validate()}currentValueChanged(){this.value=this.currentValue}initialValueChanged(e,n){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}disabledChanged(e,n){this.proxy instanceof HTMLElement&&(this.proxy.disabled=this.disabled),g.queueUpdate(()=>this.classList.toggle("disabled",this.disabled))}nameChanged(e,n){this.proxy instanceof HTMLElement&&(this.proxy.name=this.name)}requiredChanged(e,n){this.proxy instanceof HTMLElement&&(this.proxy.required=this.required),g.queueUpdate(()=>this.classList.toggle("required",this.required)),this.validate()}get elementInternals(){if(!go)return null;let e=bo.get(this);return e||(e=this.attachInternals(),bo.set(this,e)),e}connectedCallback(){super.connectedCallback(),this.addEventListener("keypress",this._keypressHandler),this.value||(th