{"version":3,"sources":["webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js","webpack:///../src/index.ts","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js","webpack:///./node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js","webpack:///./node_modules/@microsoft/fast-web-utilities/dist/localization.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js","webpack:///./node_modules/@microsoft/fast-web-utilities/dist/system-colors.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js","webpack:///./node_modules/@microsoft/fast-foundation/node_modules/@microsoft/fast-web-utilities/dist/dom.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/di/di.js"],"names":["__webpack_require__","d","__webpack_exports__","ComponentPresentation","DefaultComponentPresentation","_microsoft_fast_element__WEBPACK_IMPORTED_MODULE_0__","_di_di_js__WEBPACK_IMPORTED_MODULE_1__","presentationKeyFromTag","tagName","toLowerCase","presentationRegistry","Map","Object","freeze","[object Object]","presentation","container","key","get","set","register","instance","element","existing","findResponsibleContainer","template","styles","this","Array","isArray","create","controller","$fastController","FoundationElement","tslib__WEBPACK_IMPORTED_MODULE_0__","_microsoft_fast_element__WEBPACK_IMPORTED_MODULE_1__","_microsoft_fast_element__WEBPACK_IMPORTED_MODULE_2__","_design_system_component_presentation_js__WEBPACK_IMPORTED_MODULE_3__","super","arguments","_presentation","$presentation","forTag","undefined","applyTo","connectedCallback","elementDefinition","overrideDefinition","FoundationElementRegistry","resolveOption","option","context","definition","prototype","type","assign","name","prefix","elementPrefix","baseName","tryDefineElement","baseClass","callback","x","definePresentation","shadowOptions","shadowRootMode","mode","defineElement","elementOptions","attributes","global","loadTheme","_root","window","_styleNonce","CSPSettings","nonce","_themeState","state","__themeState__","theme","lastStyleElement","registeredStyles","runState","__assign","perf","count","duration","flushTimer","buffer","registeredThemableStyles","initializeThemeState","applyThemableStyles","stylesArray","styleRecord","loadStyles","resolveThemableArray","styleString","styleArray","document","head","getElementsByTagName","styleElement","createElement","_a","themable","setAttribute","appendChild","createTextNode","ev","createEvent","initEvent","args","newStyle","dispatchEvent","record","themableStyle","push","registerStyles","themableStyles","_i","length","clearStylesInternal","clearStyles","concat","apply","reloadStyles","records","forEach","parentElement","removeChild","splitStyleArray","map","currentValue","themeSlot","themedValue","defaultValue","console","DEBUG","warn","rawString","join","composedParent","parentNode","rootNode","getRootNode","host","HTMLElement","defaultElement","custom_property_manager_QueuedStyleSheetTarget","value","dom","queueUpdate","target","setProperty","removeProperty","DocumentStyleSheetTarget","sheet","CSSStyleSheet","cssRules","insertRule","style","adoptedStyleSheets","HeadStyleElementStyleSheetTarget","index","custom_property_manager_StyleElementStyleSheetTarget","store","addStyles","observable","getNotifier","subscribe","handleChange","entries","delete","source","tslib_es6","custom_property_manager_ElementStyleSheetTarget","RootStyleSheetTarget","properties","roots","values","PropertyTargetManager","getOrCreate","normalizeRoot","root","has","add","Set","propertyTargetCache","WeakMap","propertyTargetCtor","supportsAdoptedStyleSheets","element_styles","Document","fast_element","DesignToken","design_token_DesignTokenImpl","css_directive","configuration","subscribers","_appliedTo","cssCustomPropertyName","cssCustomProperty","cssVar","id","uniqueId","tokensById","appliedTo","nameOrConfig","token","design_token_DesignTokenNode","Error","alias","existsFor","setValueFor","subscriber","subscriberSet","getOrCreateSubscriberSet","list","sub","getValueFor","toString","design_token_DesignTokenBindingObserver","node","dependencies","observer","binding","call","disconnect","observe","design_token_Store","notify","track","nodeCache","childToParent","children","assignedValues","reflecting","bindingObservers","tokenValueChangeHandler","arg","getTokenById","isCSSDesignToken","parent","isReflecting","parentValue","sourceValue","stopReflectToCSS","reflectToCSS","addBehaviors","isConnected","bind","start","current","raw","getRaw","hydrate","findClosestAssignedNode","isDerivedDesignTokenValue","tearDownBindingObserver","setupBindingObserver","upstream","findParent","keys","child","reParent","filter","contains","all","childIndex","indexOf","splice","unsubscribe","test","reference","composedContains","cssCustomPropertyReflector","startReflection","stopReflection","property","remove","resolveCSSValue","createCSS","from","notifyConnection","notifyDisconnection","unbind","registerRoot","unregisterRoot","DesignSystem","_foundation_element_foundation_element_js__WEBPACK_IMPORTED_MODULE_1__","_di_di_js__WEBPACK_IMPORTED_MODULE_2__","_design_token_design_token_js__WEBPACK_IMPORTED_MODULE_3__","_component_presentation_js__WEBPACK_IMPORTED_MODULE_4__","ElementDisambiguation","definitionCallbackOnly","ignoreDuplicate","Symbol","elementTypesByTag","elementTagsByType","rootDesignSystem","designSystemKey","createInterface","cachedCallback","handler","DefaultDesignSystem","tagFor","owned","$$designSystem$$","getOrCreateDOMContainer","system","owner","designTokensInitialized","disambiguate","designTokenRoot","registrations","elementDefinitionEntries","params","elementDefinitionType","elementDefinitionCallback","extractedParams","extractTryDefineElementParams","elementName","typeFoundByName","needsDefine","result","ElementDefinitionEntry","registerWithContext","entry","willDefine","define","__decorate","decorators","desc","c","r","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","Direction","forcedColorsStylesheetBehavior","MatchMediaBehavior","query","listenerCache","listener","constructListener","addListener","removeListener","MatchMediaStyleSheetBehavior","attached","matches","removeStyles","with","matchMedia","SystemColors","display","hidden","displayValue","BaseProgress","_foundation_element_foundation_element_js__WEBPACK_IMPORTED_MODULE_3__","percentComplete","updatePercentComplete","min","max","range","Math","fround","converter","progressRingTemplate","paused","indeterminateIndicator","_canUseFocusVisible","focusVisible","can_use_dom","styleNonce","querySelector","getAttribute","getNonce","e","canUseFocusVisible","DI","Registration","metadataByTarget","metadata","defineMetadata","getOwnMetadata","ResolverBuilder","registerResolver","cacheCallbackResult","destinationKey","strategy","ResolverImpl","cloneArrayWithPossibleProps","clone","slice","len","isArrayIndex","DefaultResolver","singleton","transient","ContainerConfiguration","default","parentLocator","responsibleForOwnerRequests","defaultResolver","dependencyLookup","getParamTypes","Type","rootDOMContainer","createContainer","config","ContainerImpl","$$container$$","findParentContainer","event","CustomEvent","DILocateParentEventType","bubbles","composed","cancelable","detail","getDesignParamtypes","getAnnotationParamtypes","annotationParamtypes","inject","designParamtypes","Proto","getPrototypeOf","Function","getDependencies","auAnnotationParamtype","propertyName","respectConnection","diPropertyKey","notifier","nameConfigOrCallback","configuror","configure","friendlyName","defaultFriendlyName","Interface","getOrCreateAnnotationParamTypes","$isInterface","descriptor","dep","registerInRequestor","options","defaultSingletonOptions","scoped","Container","createResolver","getter","resolver","$isResolver","resolve","requestor","searchAncestors","getAll","ignore","createNewInstance","_requestor","getFactory","construct","resolving","factory","String","_b","_c","getResolver","containerGetKey","transformInstance","inst","transform","FactoryImpl","transformers","dynamicDependencies","reduce","transformer","containerResolver","isRegistry","obj","isRegisterInRequester","isSelfRegistry","InstrinsicTypeNames","factories","_parent","registerDepth","resolvers","Node","addEventListener","composedPath","stopImmediatePropagation","depth","j","jj","ii","isObject","validateKey","registerTransformer","autoRegister","jitRegister","resolutions","buildAllResponse","isNativeFunction","keyAsValue","registrationResolver","newResolver","cache","fun","t","aliasTo","originalKey","aliasKey","results","lookup","isNative","sourceText","fn","charCodeAt","isNumericLookup","ch"],"mappings":";2FAAAA,EAAAC,EAAAC,EAAA,sBAAAC,IAAAH,EAAAC,EAAAC,EAAA,sBAAAE,IAAA,IAAAC,EAAAL,EAAA,IAAAM,EAAAN,EAAA,IAEA,SAAAO,EAAAC,GACA,SAAcA,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AAmL,EAAAE,WAAArL,EAAA,KACA,KAAAmL,EAAAE,WAAArL,EAAA,IACAiL,EAAAlf,IAAAqf,EAAAF,IAEAA,GAnCA,GAsCAI,EAAA,GACA,SAAA3H,EAAAxP,GACA,cAAAA,GACA,aACA,OAAAA,GAAA,MAAAA,OACA,cACA,MAAA+K,EAAAoM,EAAAnX,GACA,YAAA+K,EACA,OAAAA,EAEA,MAAA5M,EAAA6B,EAAA7B,OACA,OAAAA,EACA,OAAAgZ,EAAAnX,IAAA,EAEA,IAAAoX,EAAA,EACA,QAAAvL,EAAA,EAA2BA,EAAA1N,IAAY0N,EAEvC,GADAuL,EAAApX,EAAAkX,WAAArL,GACA,IAAAA,GAAA,KAAAuL,GAAAjZ,EAAA,GACAiZ,EAAA,IACAA,EAAA,GACA,OAAAD,EAAAnX,IAAA,EAGA,OAAAmX,EAAAnX,IAAA,EAEA,QACA","file":"38.9450a9c976adac8268dd.js","sourcesContent":["import { ElementStyles, } from \"@microsoft/fast-element\";\nimport { DI, Registration } from \"../di/di.js\";\nfunction presentationKeyFromTag(tagName) {\n    return `${tagName.toLowerCase()}:presentation`;\n}\nconst presentationRegistry = new Map();\n/**\n * An API gateway to component presentation features.\n * @public\n */\nexport const ComponentPresentation = Object.freeze({\n    /**\n     * Defines a component presentation for an element.\n     * @param tagName - The element name to define the presentation for.\n     * @param presentation - The presentation that will be applied to matching elements.\n     * @param container - The dependency injection container to register the configuration in.\n     * @public\n     */\n    define(tagName, presentation, container) {\n        const key = presentationKeyFromTag(tagName);\n        const existing = presentationRegistry.get(key);\n        if (existing === void 0) {\n            presentationRegistry.set(key, presentation);\n        }\n        else {\n            // false indicates that we have more than one presentation\n            // registered for a tagName and we must resolve through DI\n            presentationRegistry.set(key, false);\n        }\n        container.register(Registration.instance(key, presentation));\n    },\n    /**\n     * Finds a component presentation for the specified element name,\n     * searching the DOM hierarchy starting from the provided element.\n     * @param tagName - The name of the element to locate the presentation for.\n     * @param element - The element to begin the search from.\n     * @returns The component presentation or null if none is found.\n     * @public\n     */\n    forTag(tagName, element) {\n        const key = presentationKeyFromTag(tagName);\n        const existing = presentationRegistry.get(key);\n        if (existing === false) {\n            const container = DI.findResponsibleContainer(element);\n            return container.get(key);\n        }\n        return existing || null;\n    },\n});\n/**\n * The default implementation of ComponentPresentation, used by FoundationElement.\n * @public\n */\nexport class DefaultComponentPresentation {\n    /**\n     * Creates an instance of DefaultComponentPresentation.\n     * @param template - The template to apply to the element.\n     * @param styles - The styles to apply to the element.\n     * @public\n     */\n    constructor(template, styles) {\n        this.template = template || null;\n        this.styles =\n            styles === void 0\n                ? null\n                : Array.isArray(styles)\n                    ? ElementStyles.create(styles)\n                    : styles instanceof ElementStyles\n                        ? styles\n                        : ElementStyles.create([styles]);\n    }\n    /**\n     * Applies the presentation details to the specified element.\n     * @param element - The element to apply the presentation details to.\n     * @public\n     */\n    applyTo(element) {\n        const controller = element.$fastController;\n        if (controller.template === null) {\n            controller.template = this.template;\n        }\n        if (controller.styles === null) {\n            controller.styles = this.styles;\n        }\n    }\n}\n","import { __decorate } from \"tslib\";\nimport { FASTElement, observable } from \"@microsoft/fast-element\";\nimport { ComponentPresentation, DefaultComponentPresentation, } from \"../design-system/component-presentation.js\";\n/**\n * Defines a foundation element class that:\n * 1. Connects the element to its ComponentPresentation\n * 2. Allows resolving the element template from the instance or ComponentPresentation\n * 3. Allows resolving the element styles from the instance or ComponentPresentation\n *\n * @public\n */\nexport class FoundationElement extends FASTElement {\n    constructor() {\n        super(...arguments);\n        this._presentation = void 0;\n    }\n    /**\n     * A property which resolves the ComponentPresentation instance\n     * for the current component.\n     * @public\n     */\n    get $presentation() {\n        if (this._presentation === void 0) {\n            this._presentation = ComponentPresentation.forTag(this.tagName, this);\n        }\n        return this._presentation;\n    }\n    templateChanged() {\n        if (this.template !== undefined) {\n            this.$fastController.template = this.template;\n        }\n    }\n    stylesChanged() {\n        if (this.styles !== undefined) {\n            this.$fastController.styles = this.styles;\n        }\n    }\n    /**\n     * The connected callback for this FASTElement.\n     * @remarks\n     * This method is invoked by the platform whenever this FoundationElement\n     * becomes connected to the document.\n     * @public\n     */\n    connectedCallback() {\n        if (this.$presentation !== null) {\n            this.$presentation.applyTo(this);\n        }\n        super.connectedCallback();\n    }\n    /**\n     * Defines an element registry function with a set of element definition defaults.\n     * @param elementDefinition - The definition of the element to create the registry\n     * function for.\n     * @public\n     */\n    static compose(elementDefinition) {\n        return (overrideDefinition = {}) => new FoundationElementRegistry(this === FoundationElement\n            ? class extends FoundationElement {\n            }\n            : this, elementDefinition, overrideDefinition);\n    }\n}\n__decorate([\n    observable\n], FoundationElement.prototype, \"template\", void 0);\n__decorate([\n    observable\n], FoundationElement.prototype, \"styles\", void 0);\nfunction resolveOption(option, context, definition) {\n    if (typeof option === \"function\") {\n        return option(context, definition);\n    }\n    return option;\n}\n/**\n * Registry capable of defining presentation properties for a DOM Container hierarchy.\n *\n * @internal\n */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport class FoundationElementRegistry {\n    constructor(type, elementDefinition, overrideDefinition) {\n        this.type = type;\n        this.elementDefinition = elementDefinition;\n        this.overrideDefinition = overrideDefinition;\n        this.definition = Object.assign(Object.assign({}, this.elementDefinition), this.overrideDefinition);\n    }\n    register(container, context) {\n        const definition = this.definition;\n        const overrideDefinition = this.overrideDefinition;\n        const prefix = definition.prefix || context.elementPrefix;\n        const name = `${prefix}-${definition.baseName}`;\n        context.tryDefineElement({\n            name,\n            type: this.type,\n            baseClass: this.elementDefinition.baseClass,\n            callback: x => {\n                const presentation = new DefaultComponentPresentation(resolveOption(definition.template, x, definition), resolveOption(definition.styles, x, definition));\n                x.definePresentation(presentation);\n                let shadowOptions = resolveOption(definition.shadowOptions, x, definition);\n                if (x.shadowRootMode) {\n                    // If the design system has overridden the shadow root mode, we need special handling.\n                    if (shadowOptions) {\n                        // If there are shadow options present in the definition, then\n                        // either the component itself has specified an option or the\n                        // registry function has overridden it.\n                        if (!overrideDefinition.shadowOptions) {\n                            // There were shadow options provided by the component and not overridden by\n                            // the registry.\n                            shadowOptions.mode = x.shadowRootMode;\n                        }\n                    }\n                    else if (shadowOptions !== null) {\n                        // If the component author did not provide shadow options,\n                        // and did not null them out (light dom opt-in) then they\n                        // were relying on the FASTElement default. So, if the\n                        // design system provides a mode, we need to create the options\n                        // to override the default.\n                        shadowOptions = { mode: x.shadowRootMode };\n                    }\n                }\n                x.defineElement({\n                    elementOptions: resolveOption(definition.elementOptions, x, definition),\n                    shadowOptions,\n                    attributes: resolveOption(definition.attributes, x, definition),\n                });\n            },\n        });\n    }\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n","// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * An IThemingInstruction can specify a rawString to be preserved or a theme slot and a default value\n * to use if that slot is not specified by the theme.\n */\n\n/* eslint-disable @typescript-eslint/no-use-before-define */\n\n// Declaring a global here in case that the execution environment is Node.js (without importing the\n// entire node.js d.ts for now)\ndeclare let global: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n\nexport interface IThemingInstruction {\n  theme?: string;\n  defaultValue?: string;\n  rawString?: string;\n}\n\nexport type ThemableArray = IThemingInstruction[];\n\nexport interface ITheme {\n  [key: string]: string;\n}\n\ninterface IStyleSheet {\n  cssText: string;\n}\n\ninterface IExtendedHtmlStyleElement extends HTMLStyleElement {\n  styleSheet: IStyleSheet;\n}\n\n/**\n * Performance Measurement of loading styles\n */\ninterface IMeasurement {\n  /**\n   * Count of style element injected, which is the slow operation in IE\n   */\n  count: number;\n  /**\n   * Total duration of all loadStyles exections\n   */\n  duration: number;\n}\n\ninterface IRunState {\n  mode: Mode;\n  buffer: ThemableArray[];\n  flushTimer: number;\n}\n\ninterface IThemeState {\n  theme: ITheme | undefined;\n  lastStyleElement: IExtendedHtmlStyleElement;\n  registeredStyles: IStyleRecord[]; // records of already registered non-themable styles\n  registeredThemableStyles: IStyleRecord[]; // records of already registered themable styles\n  loadStyles: ((processedStyles: string, rawStyles?: string | ThemableArray) => void) | undefined;\n  perf: IMeasurement;\n  runState: IRunState;\n}\n\ninterface IStyleRecord {\n  styleElement: Element;\n  themableStyle: ThemableArray;\n}\n\ninterface ICustomEvent<T> extends Event {\n  args?: T;\n}\n\n/**\n * object returned from resolveThemableArray function\n */\ninterface IThemableArrayResolveResult {\n  /** this string is the processed styles in string */\n  styleString: string;\n\n  /** this boolean indicates if this style array is themable */\n  themable: boolean;\n}\n\n/**\n * In sync mode, styles are registered as style elements synchronously with loadStyles() call.\n * In async mode, styles are buffered and registered as batch in async timer for performance purpose.\n */\nexport const enum Mode {\n  sync,\n  async\n}\n\n/**\n * Themable styles and non-themable styles are tracked separately\n * Specify ClearStyleOptions when calling clearStyles API to specify which group of registered styles should be cleared.\n */\nexport const enum ClearStyleOptions {\n  /** only themable styles will be cleared */\n  onlyThemable = 1,\n  /** only non-themable styles will be cleared */\n  onlyNonThemable = 2,\n  /** both themable and non-themable styles will be cleared */\n  all = 3\n}\n\n// Store the theming state in __themeState__ global scope for reuse in the case of duplicate\n// load-themed-styles hosted on the page.\nconst _root: any = typeof window === 'undefined' ? global : window; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n// Nonce string to inject into script tag if one provided. This is used in CSP (Content Security Policy).\nconst _styleNonce: string = _root && _root.CSPSettings && _root.CSPSettings.nonce;\n\nconst _themeState: IThemeState = initializeThemeState();\n\n/**\n * Matches theming tokens. For example, \"[theme: themeSlotName, default: #FFF]\" (including the quotes).\n */\nconst _themeTokenRegex: RegExp =\n  /[\\'\\\"]\\[theme:\\s*(\\w+)\\s*(?:\\,\\s*default:\\s*([\\\\\"\\']?[\\.\\,\\(\\)\\#\\-\\s\\w]*[\\.\\,\\(\\)\\#\\-\\w][\\\"\\']?))?\\s*\\][\\'\\\"]/g;\n\nconst now: () => number = () =>\n  typeof performance !== 'undefined' && !!performance.now ? performance.now() : Date.now();\n\nfunction measure(func: () => void): void {\n  const start: number = now();\n  func();\n  const end: number = now();\n  _themeState.perf.duration += end - start;\n}\n\n/**\n * initialize global state object\n */\nfunction initializeThemeState(): IThemeState {\n  let state: IThemeState = _root.__themeState__ || {\n    theme: undefined,\n    lastStyleElement: undefined,\n    registeredStyles: []\n  };\n\n  if (!state.runState) {\n    state = {\n      ...state,\n      perf: {\n        count: 0,\n        duration: 0\n      },\n      runState: {\n        flushTimer: 0,\n        mode: Mode.sync,\n        buffer: []\n      }\n    };\n  }\n  if (!state.registeredThemableStyles) {\n    state = {\n      ...state,\n      registeredThemableStyles: []\n    };\n  }\n  _root.__themeState__ = state;\n  return state;\n}\n\n/**\n * Loads a set of style text. If it is registered too early, we will register it when the window.load\n * event is fired.\n * @param {string | ThemableArray} styles Themable style text to register.\n * @param {boolean} loadAsync When true, always load styles in async mode, irrespective of current sync mode.\n */\nexport function loadStyles(styles: string | ThemableArray, loadAsync: boolean = false): void {\n  measure(() => {\n    const styleParts: ThemableArray = Array.isArray(styles) ? styles : splitStyles(styles);\n    const { mode, buffer, flushTimer } = _themeState.runState;\n    if (loadAsync || mode === Mode.async) {\n      buffer.push(styleParts);\n      if (!flushTimer) {\n        _themeState.runState.flushTimer = asyncLoadStyles();\n      }\n    } else {\n      applyThemableStyles(styleParts);\n    }\n  });\n}\n\n/**\n * Allows for customizable loadStyles logic. e.g. for server side rendering application\n * @param {(processedStyles: string, rawStyles?: string | ThemableArray) => void}\n * a loadStyles callback that gets called when styles are loaded or reloaded\n */\nexport function configureLoadStyles(\n  loadStylesFn: ((processedStyles: string, rawStyles?: string | ThemableArray) => void) | undefined\n): void {\n  _themeState.loadStyles = loadStylesFn;\n}\n\n/**\n * Configure run mode of load-themable-styles\n * @param mode load-themable-styles run mode, async or sync\n */\nexport function configureRunMode(mode: Mode): void {\n  _themeState.runState.mode = mode;\n}\n\n/**\n * external code can call flush to synchronously force processing of currently buffered styles\n */\nexport function flush(): void {\n  measure(() => {\n    const styleArrays: ThemableArray[] = _themeState.runState.buffer.slice();\n    _themeState.runState.buffer = [];\n    const mergedStyleArray: ThemableArray = ([] as ThemableArray).concat.apply([], styleArrays);\n    if (mergedStyleArray.length > 0) {\n      applyThemableStyles(mergedStyleArray);\n    }\n  });\n}\n\n/**\n * register async loadStyles\n */\nfunction asyncLoadStyles(): number {\n  return setTimeout(() => {\n    _themeState.runState.flushTimer = 0;\n    flush();\n  }, 0);\n}\n\n/**\n * Loads a set of style text. If it is registered too early, we will register it when the window.load event\n * is fired.\n * @param {string} styleText Style to register.\n * @param {IStyleRecord} styleRecord Existing style record to re-apply.\n */\nfunction applyThemableStyles(stylesArray: ThemableArray, styleRecord?: IStyleRecord): void {\n  if (_themeState.loadStyles) {\n    _themeState.loadStyles(resolveThemableArray(stylesArray).styleString, stylesArray);\n  } else {\n    registerStyles(stylesArray);\n  }\n}\n\n/**\n * Registers a set theme tokens to find and replace. If styles were already registered, they will be\n * replaced.\n * @param {theme} theme JSON object of theme tokens to values.\n */\nexport function loadTheme(theme: ITheme | undefined): void {\n  _themeState.theme = theme;\n\n  // reload styles.\n  reloadStyles();\n}\n\n/**\n * Clear already registered style elements and style records in theme_State object\n * @param option - specify which group of registered styles should be cleared.\n * Default to be both themable and non-themable styles will be cleared\n */\nexport function clearStyles(option: ClearStyleOptions = ClearStyleOptions.all): void {\n  if (option === ClearStyleOptions.all || option === ClearStyleOptions.onlyNonThemable) {\n    clearStylesInternal(_themeState.registeredStyles);\n    _themeState.registeredStyles = [];\n  }\n  if (option === ClearStyleOptions.all || option === ClearStyleOptions.onlyThemable) {\n    clearStylesInternal(_themeState.registeredThemableStyles);\n    _themeState.registeredThemableStyles = [];\n  }\n}\n\nfunction clearStylesInternal(records: IStyleRecord[]): void {\n  records.forEach((styleRecord: IStyleRecord) => {\n    const styleElement: HTMLStyleElement = styleRecord && (styleRecord.styleElement as HTMLStyleElement);\n    if (styleElement && styleElement.parentElement) {\n      styleElement.parentElement.removeChild(styleElement);\n    }\n  });\n}\n\n/**\n * Reloads styles.\n */\nfunction reloadStyles(): void {\n  if (_themeState.theme) {\n    const themableStyles: ThemableArray[] = [];\n    for (const styleRecord of _themeState.registeredThemableStyles) {\n      themableStyles.push(styleRecord.themableStyle);\n    }\n    if (themableStyles.length > 0) {\n      clearStyles(ClearStyleOptions.onlyThemable);\n      applyThemableStyles(([] as ThemableArray).concat.apply([], themableStyles));\n    }\n  }\n}\n\n/**\n * Find theme tokens and replaces them with provided theme values.\n * @param {string} styles Tokenized styles to fix.\n */\nexport function detokenize(styles: string | undefined): string | undefined {\n  if (styles) {\n    styles = resolveThemableArray(splitStyles(styles)).styleString;\n  }\n\n  return styles;\n}\n\n/**\n * Resolves ThemingInstruction objects in an array and joins the result into a string.\n * @param {ThemableArray} splitStyleArray ThemableArray to resolve and join.\n */\nfunction resolveThemableArray(splitStyleArray: ThemableArray): IThemableArrayResolveResult {\n  const { theme }: IThemeState = _themeState;\n  let themable: boolean = false;\n  // Resolve the array of theming instructions to an array of strings.\n  // Then join the array to produce the final CSS string.\n  const resolvedArray: (string | undefined)[] = (splitStyleArray || []).map(\n    (currentValue: IThemingInstruction) => {\n      const themeSlot: string | undefined = currentValue.theme;\n      if (themeSlot) {\n        themable = true;\n        // A theming annotation. Resolve it.\n        const themedValue: string | undefined = theme ? theme[themeSlot] : undefined;\n        const defaultValue: string = currentValue.defaultValue || 'inherit';\n\n        // Warn to console if we hit an unthemed value even when themes are provided, but only if \"DEBUG\" is true.\n        // Allow the themedValue to be undefined to explicitly request the default value.\n        if (\n          theme &&\n          !themedValue &&\n          console &&\n          !(themeSlot in theme) &&\n          typeof DEBUG !== 'undefined' &&\n          DEBUG\n        ) {\n          console.warn(`Theming value not provided for \"${themeSlot}\". Falling back to \"${defaultValue}\".`);\n        }\n\n        return themedValue || defaultValue;\n      } else {\n        // A non-themable string. Preserve it.\n        return currentValue.rawString;\n      }\n    }\n  );\n\n  return {\n    styleString: resolvedArray.join(''),\n    themable: themable\n  };\n}\n\n/**\n * Split tokenized CSS into an array of strings and theme specification objects\n * @param {string} styles Tokenized styles to split.\n */\nexport function splitStyles(styles: string): ThemableArray {\n  const result: ThemableArray = [];\n  if (styles) {\n    let pos: number = 0; // Current position in styles.\n    let tokenMatch: RegExpExecArray | null;\n    while ((tokenMatch = _themeTokenRegex.exec(styles))) {\n      const matchIndex: number = tokenMatch.index;\n      if (matchIndex > pos) {\n        result.push({\n          rawString: styles.substring(pos, matchIndex)\n        });\n      }\n\n      result.push({\n        theme: tokenMatch[1],\n        defaultValue: tokenMatch[2] // May be undefined\n      });\n\n      // index of the first character after the current match\n      pos = _themeTokenRegex.lastIndex;\n    }\n\n    // Push the rest of the string after the last match.\n    result.push({\n      rawString: styles.substring(pos)\n    });\n  }\n\n  return result;\n}\n\n/**\n * Registers a set of style text. If it is registered too early, we will register it when the\n * window.load event is fired.\n * @param {ThemableArray} styleArray Array of IThemingInstruction objects to register.\n * @param {IStyleRecord} styleRecord May specify a style Element to update.\n */\nfunction registerStyles(styleArray: ThemableArray): void {\n  if (typeof document === 'undefined') {\n    return;\n  }\n  const head: HTMLHeadElement = document.getElementsByTagName('head')[0];\n  const styleElement: HTMLStyleElement = document.createElement('style');\n  const { styleString, themable } = resolveThemableArray(styleArray);\n\n  styleElement.setAttribute('data-load-themed-styles', 'true');\n  if (_styleNonce) {\n    styleElement.setAttribute('nonce', _styleNonce);\n  }\n  styleElement.appendChild(document.createTextNode(styleString));\n  _themeState.perf.count++;\n  head.appendChild(styleElement);\n\n  const ev: ICustomEvent<{ newStyle: HTMLStyleElement }> = document.createEvent('HTMLEvents');\n  ev.initEvent('styleinsert', true /* bubbleEvent */, false /* cancelable */);\n  ev.args = {\n    newStyle: styleElement\n  };\n  document.dispatchEvent(ev);\n\n  const record: IStyleRecord = {\n    styleElement: styleElement,\n    themableStyle: styleArray\n  };\n\n  if (themable) {\n    _themeState.registeredThemableStyles.push(record);\n  } else {\n    _themeState.registeredStyles.push(record);\n  }\n}\n","/**\n * Retrieves the \"composed parent\" element of a node, ignoring DOM tree boundaries.\n * When the parent of a node is a shadow-root, it will return the host\n * element of the shadow root. Otherwise it will return the parent node or null if\n * no parent node exists.\n * @param element - The element for which to retrieve the composed parent\n *\n * @public\n */\nexport function composedParent(element) {\n    const parentNode = element.parentElement;\n    if (parentNode) {\n        return parentNode;\n    }\n    else {\n        const rootNode = element.getRootNode();\n        if (rootNode.host instanceof HTMLElement) {\n            // this is shadow-root\n            return rootNode.host;\n        }\n    }\n    return null;\n}\n","import { __decorate } from \"tslib\";\nimport { DOM, ElementStyles, FASTElement, observable, Observable, } from \"@microsoft/fast-element\";\nexport const defaultElement = document.createElement(\"div\");\nfunction isFastElement(element) {\n    return element instanceof FASTElement;\n}\nclass QueuedStyleSheetTarget {\n    setProperty(name, value) {\n        DOM.queueUpdate(() => this.target.setProperty(name, value));\n    }\n    removeProperty(name) {\n        DOM.queueUpdate(() => this.target.removeProperty(name));\n    }\n}\n/**\n * Handles setting properties for a FASTElement using Constructable Stylesheets\n */\nclass ConstructableStyleSheetTarget extends QueuedStyleSheetTarget {\n    constructor(source) {\n        super();\n        const sheet = new CSSStyleSheet();\n        this.target = sheet.cssRules[sheet.insertRule(\":host{}\")].style;\n        source.$fastController.addStyles(ElementStyles.create([sheet]));\n    }\n}\nclass DocumentStyleSheetTarget extends QueuedStyleSheetTarget {\n    constructor() {\n        super();\n        const sheet = new CSSStyleSheet();\n        this.target = sheet.cssRules[sheet.insertRule(\":root{}\")].style;\n        document.adoptedStyleSheets = [\n            ...document.adoptedStyleSheets,\n            sheet,\n        ];\n    }\n}\nclass HeadStyleElementStyleSheetTarget extends QueuedStyleSheetTarget {\n    constructor() {\n        super();\n        this.style = document.createElement(\"style\");\n        document.head.appendChild(this.style);\n        const { sheet } = this.style;\n        // Because the HTMLStyleElement has been appended,\n        // there shouldn't exist a case where `sheet` is null,\n        // but if-check it just in case.\n        if (sheet) {\n            // https://github.com/jsdom/jsdom uses https://github.com/NV/CSSOM for it's CSSOM implementation,\n            // which implements the DOM Level 2 spec for CSSStyleSheet where insertRule() requires an index argument.\n            const index = sheet.insertRule(\":root{}\", sheet.cssRules.length);\n            this.target = sheet.cssRules[index].style;\n        }\n    }\n}\n/**\n * Handles setting properties for a FASTElement using an HTMLStyleElement\n */\nclass StyleElementStyleSheetTarget {\n    constructor(target) {\n        this.store = new Map();\n        this.target = null;\n        const controller = target.$fastController;\n        this.style = document.createElement(\"style\");\n        controller.addStyles(this.style);\n        Observable.getNotifier(controller).subscribe(this, \"isConnected\");\n        this.handleChange(controller, \"isConnected\");\n    }\n    targetChanged() {\n        if (this.target !== null) {\n            for (const [key, value] of this.store.entries()) {\n                this.target.setProperty(key, value);\n            }\n        }\n    }\n    setProperty(name, value) {\n        this.store.set(name, value);\n        DOM.queueUpdate(() => {\n            if (this.target !== null) {\n                this.target.setProperty(name, value);\n            }\n        });\n    }\n    removeProperty(name) {\n        this.store.delete(name);\n        DOM.queueUpdate(() => {\n            if (this.target !== null) {\n                this.target.removeProperty(name);\n            }\n        });\n    }\n    handleChange(source, key) {\n        // HTMLStyleElement.sheet is null if the element isn't connected to the DOM,\n        // so this method reacts to changes in DOM connection for the element hosting\n        // the HTMLStyleElement.\n        //\n        // All rules applied via the CSSOM also get cleared when the element disconnects,\n        // so we need to add a new rule each time and populate it with the stored properties\n        const { sheet } = this.style;\n        if (sheet) {\n            // Safari will throw if we try to use the return result of insertRule()\n            // to index the rule inline, so store as a const prior to indexing.\n            // https://github.com/jsdom/jsdom uses https://github.com/NV/CSSOM for it's CSSOM implementation,\n            // which implements the DOM Level 2 spec for CSSStyleSheet where insertRule() requires an index argument.\n            const index = sheet.insertRule(\":host{}\", sheet.cssRules.length);\n            this.target = sheet.cssRules[index].style;\n        }\n        else {\n            this.target = null;\n        }\n    }\n}\n__decorate([\n    observable\n], StyleElementStyleSheetTarget.prototype, \"target\", void 0);\n/**\n * Handles setting properties for a normal HTMLElement\n */\nclass ElementStyleSheetTarget {\n    constructor(source) {\n        this.target = source.style;\n    }\n    setProperty(name, value) {\n        DOM.queueUpdate(() => this.target.setProperty(name, value));\n    }\n    removeProperty(name) {\n        DOM.queueUpdate(() => this.target.removeProperty(name));\n    }\n}\n/**\n * Controls emission for default values. This control is capable\n * of emitting to multiple {@link PropertyTarget | PropertyTargets},\n * and only emits if it has at least one root.\n *\n * @internal\n */\nexport class RootStyleSheetTarget {\n    setProperty(name, value) {\n        RootStyleSheetTarget.properties[name] = value;\n        for (const target of RootStyleSheetTarget.roots.values()) {\n            PropertyTargetManager.getOrCreate(RootStyleSheetTarget.normalizeRoot(target)).setProperty(name, value);\n        }\n    }\n    removeProperty(name) {\n        delete RootStyleSheetTarget.properties[name];\n        for (const target of RootStyleSheetTarget.roots.values()) {\n            PropertyTargetManager.getOrCreate(RootStyleSheetTarget.normalizeRoot(target)).removeProperty(name);\n        }\n    }\n    static registerRoot(root) {\n        const { roots } = RootStyleSheetTarget;\n        if (!roots.has(root)) {\n            roots.add(root);\n            const target = PropertyTargetManager.getOrCreate(this.normalizeRoot(root));\n            for (const key in RootStyleSheetTarget.properties) {\n                target.setProperty(key, RootStyleSheetTarget.properties[key]);\n            }\n        }\n    }\n    static unregisterRoot(root) {\n        const { roots } = RootStyleSheetTarget;\n        if (roots.has(root)) {\n            roots.delete(root);\n            const target = PropertyTargetManager.getOrCreate(RootStyleSheetTarget.normalizeRoot(root));\n            for (const key in RootStyleSheetTarget.properties) {\n                target.removeProperty(key);\n            }\n        }\n    }\n    /**\n     * Returns the document when provided the default element,\n     * otherwise is a no-op\n     * @param root - the root to normalize\n     */\n    static normalizeRoot(root) {\n        return root === defaultElement ? document : root;\n    }\n}\nRootStyleSheetTarget.roots = new Set();\nRootStyleSheetTarget.properties = {};\n// Caches PropertyTarget instances\nconst propertyTargetCache = new WeakMap();\n// Use Constructable StyleSheets for FAST elements when supported, otherwise use\n// HTMLStyleElement instances\nconst propertyTargetCtor = DOM.supportsAdoptedStyleSheets\n    ? ConstructableStyleSheetTarget\n    : StyleElementStyleSheetTarget;\n/**\n * Manages creation and caching of PropertyTarget instances.\n *\n * @internal\n */\nexport const PropertyTargetManager = Object.freeze({\n    getOrCreate(source) {\n        if (propertyTargetCache.has(source)) {\n            /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n            return propertyTargetCache.get(source);\n        }\n        let target;\n        if (source === defaultElement) {\n            target = new RootStyleSheetTarget();\n        }\n        else if (source instanceof Document) {\n            target = DOM.supportsAdoptedStyleSheets\n                ? new DocumentStyleSheetTarget()\n                : new HeadStyleElementStyleSheetTarget();\n        }\n        else if (isFastElement(source)) {\n            target = new propertyTargetCtor(source);\n        }\n        else {\n            target = new ElementStyleSheetTarget(source);\n        }\n        propertyTargetCache.set(source, target);\n        return target;\n    },\n});\n","import { __decorate } from \"tslib\";\nimport { CSSDirective, defaultExecutionContext, FASTElement, observable, Observable, } from \"@microsoft/fast-element\";\nimport { composedParent } from \"../utilities/composed-parent.js\";\nimport { composedContains } from \"../utilities/composed-contains.js\";\nimport { PropertyTargetManager, RootStyleSheetTarget, } from \"./custom-property-manager.js\";\nimport { defaultElement } from \"./custom-property-manager.js\";\n/**\n * Implementation of {@link (DesignToken:interface)}\n */\nclass DesignTokenImpl extends CSSDirective {\n    constructor(configuration) {\n        super();\n        this.subscribers = new WeakMap();\n        this._appliedTo = new Set();\n        this.name = configuration.name;\n        if (configuration.cssCustomPropertyName !== null) {\n            this.cssCustomProperty = `--${configuration.cssCustomPropertyName}`;\n            this.cssVar = `var(${this.cssCustomProperty})`;\n        }\n        this.id = DesignTokenImpl.uniqueId();\n        DesignTokenImpl.tokensById.set(this.id, this);\n    }\n    get appliedTo() {\n        return [...this._appliedTo];\n    }\n    static from(nameOrConfig) {\n        return new DesignTokenImpl({\n            name: typeof nameOrConfig === \"string\" ? nameOrConfig : nameOrConfig.name,\n            cssCustomPropertyName: typeof nameOrConfig === \"string\"\n                ? nameOrConfig\n                : nameOrConfig.cssCustomPropertyName === void 0\n                    ? nameOrConfig.name\n                    : nameOrConfig.cssCustomPropertyName,\n        });\n    }\n    static isCSSDesignToken(token) {\n        return typeof token.cssCustomProperty === \"string\";\n    }\n    static isDerivedDesignTokenValue(value) {\n        return typeof value === \"function\";\n    }\n    /**\n     * Gets a token by ID. Returns undefined if the token was not found.\n     * @param id - The ID of the token\n     * @returns\n     */\n    static getTokenById(id) {\n        return DesignTokenImpl.tokensById.get(id);\n    }\n    getOrCreateSubscriberSet(target = this) {\n        return (this.subscribers.get(target) ||\n            (this.subscribers.set(target, new Set()) && this.subscribers.get(target)));\n    }\n    createCSS() {\n        return this.cssVar || \"\";\n    }\n    getValueFor(element) {\n        const value = DesignTokenNode.getOrCreate(element).get(this);\n        if (value !== undefined) {\n            return value;\n        }\n        throw new Error(`Value could not be retrieved for token named \"${this.name}\". Ensure the value is set for ${element} or an ancestor of ${element}.`);\n    }\n    setValueFor(element, value) {\n        this._appliedTo.add(element);\n        if (value instanceof DesignTokenImpl) {\n            value = this.alias(value);\n        }\n        DesignTokenNode.getOrCreate(element).set(this, value);\n        return this;\n    }\n    deleteValueFor(element) {\n        this._appliedTo.delete(element);\n        if (DesignTokenNode.existsFor(element)) {\n            DesignTokenNode.getOrCreate(element).delete(this);\n        }\n        return this;\n    }\n    withDefault(value) {\n        this.setValueFor(defaultElement, value);\n        return this;\n    }\n    subscribe(subscriber, target) {\n        const subscriberSet = this.getOrCreateSubscriberSet(target);\n        if (target && !DesignTokenNode.existsFor(target)) {\n            DesignTokenNode.getOrCreate(target);\n        }\n        if (!subscriberSet.has(subscriber)) {\n            subscriberSet.add(subscriber);\n        }\n    }\n    unsubscribe(subscriber, target) {\n        const list = this.subscribers.get(target || this);\n        if (list && list.has(subscriber)) {\n            list.delete(subscriber);\n        }\n    }\n    /**\n     * Notifies subscribers that the value for an element has changed.\n     * @param element - The element to emit a notification for\n     */\n    notify(element) {\n        const record = Object.freeze({ token: this, target: element });\n        if (this.subscribers.has(this)) {\n            this.subscribers.get(this).forEach(sub => sub.handleChange(record));\n        }\n        if (this.subscribers.has(element)) {\n            this.subscribers.get(element).forEach(sub => sub.handleChange(record));\n        }\n    }\n    /**\n     * Alias the token to the provided token.\n     * @param token - the token to alias to\n     */\n    alias(token) {\n        return ((target) => token.getValueFor(target));\n    }\n}\nDesignTokenImpl.uniqueId = (() => {\n    let id = 0;\n    return () => {\n        id++;\n        return id.toString(16);\n    };\n})();\n/**\n * Token storage by token ID\n */\nDesignTokenImpl.tokensById = new Map();\nclass CustomPropertyReflector {\n    startReflection(token, target) {\n        token.subscribe(this, target);\n        this.handleChange({ token, target });\n    }\n    stopReflection(token, target) {\n        token.unsubscribe(this, target);\n        this.remove(token, target);\n    }\n    handleChange(record) {\n        const { token, target } = record;\n        this.add(token, target);\n    }\n    add(token, target) {\n        PropertyTargetManager.getOrCreate(target).setProperty(token.cssCustomProperty, this.resolveCSSValue(DesignTokenNode.getOrCreate(target).get(token)));\n    }\n    remove(token, target) {\n        PropertyTargetManager.getOrCreate(target).removeProperty(token.cssCustomProperty);\n    }\n    resolveCSSValue(value) {\n        return value && typeof value.createCSS === \"function\" ? value.createCSS() : value;\n    }\n}\n/**\n * A light wrapper around BindingObserver to handle value caching and\n * token notification\n */\nclass DesignTokenBindingObserver {\n    constructor(source, token, node) {\n        this.source = source;\n        this.token = token;\n        this.node = node;\n        this.dependencies = new Set();\n        this.observer = Observable.binding(source, this, false);\n        // This is a little bit hacky because it's using internal APIs of BindingObserverImpl.\n        // BindingObserverImpl queues updates to batch it's notifications which doesn't work for this\n        // scenario because the DesignToken.getValueFor API is not async. Without this, using DesignToken.getValueFor()\n        // after DesignToken.setValueFor() when setting a dependency of the value being retrieved can return a stale\n        // value. Assigning .handleChange to .call forces immediate invocation of this classes handleChange() method,\n        // allowing resolution of values synchronously.\n        // TODO: https://github.com/microsoft/fast/issues/5110\n        this.observer.handleChange = this.observer.call;\n        this.handleChange();\n    }\n    disconnect() {\n        this.observer.disconnect();\n    }\n    /**\n     * @internal\n     */\n    handleChange() {\n        this.node.store.set(this.token, this.observer.observe(this.node.target, defaultExecutionContext));\n    }\n}\n/**\n * Stores resolved token/value pairs and notifies on changes\n */\nclass Store {\n    constructor() {\n        this.values = new Map();\n    }\n    set(token, value) {\n        if (this.values.get(token) !== value) {\n            this.values.set(token, value);\n            Observable.getNotifier(this).notify(token.id);\n        }\n    }\n    get(token) {\n        Observable.track(this, token.id);\n        return this.values.get(token);\n    }\n    delete(token) {\n        this.values.delete(token);\n    }\n    all() {\n        return this.values.entries();\n    }\n}\nconst nodeCache = new WeakMap();\nconst childToParent = new WeakMap();\n/**\n * A node responsible for setting and getting token values,\n * emitting values to CSS custom properties, and maintaining\n * inheritance structures.\n */\nclass DesignTokenNode {\n    constructor(target) {\n        this.target = target;\n        /**\n         * Stores all resolved token values for a node\n         */\n        this.store = new Store();\n        /**\n         * All children assigned to the node\n         */\n        this.children = [];\n        /**\n         * All values explicitly assigned to the node in their raw form\n         */\n        this.assignedValues = new Map();\n        /**\n         * Tokens currently being reflected to CSS custom properties\n         */\n        this.reflecting = new Set();\n        /**\n         * Binding observers for assigned and inherited derived values.\n         */\n        this.bindingObservers = new Map();\n        /**\n         * Emits notifications to token when token values\n         * change the DesignTokenNode\n         */\n        this.tokenValueChangeHandler = {\n            handleChange: (source, arg) => {\n                const token = DesignTokenImpl.getTokenById(arg);\n                if (token) {\n                    // Notify any token subscribers\n                    token.notify(this.target);\n                    if (DesignTokenImpl.isCSSDesignToken(token)) {\n                        const parent = this.parent;\n                        const reflecting = this.isReflecting(token);\n                        if (parent) {\n                            const parentValue = parent.get(token);\n                            const sourceValue = source.get(token);\n                            if (parentValue !== sourceValue && !reflecting) {\n                                this.reflectToCSS(token);\n                            }\n                            else if (parentValue === sourceValue && reflecting) {\n                                this.stopReflectToCSS(token);\n                            }\n                        }\n                        else if (!reflecting) {\n                            this.reflectToCSS(token);\n                        }\n                    }\n                }\n            },\n        };\n        nodeCache.set(target, this);\n        // Map store change notifications to token change notifications\n        Observable.getNotifier(this.store).subscribe(this.tokenValueChangeHandler);\n        if (target instanceof FASTElement) {\n            target.$fastController.addBehaviors([this]);\n        }\n        else if (target.isConnected) {\n            this.bind();\n        }\n    }\n    /**\n     * Returns a DesignTokenNode for an element.\n     * Creates a new instance if one does not already exist for a node,\n     * otherwise returns the cached instance\n     *\n     * @param target - The HTML element to retrieve a DesignTokenNode for\n     */\n    static getOrCreate(target) {\n        return nodeCache.get(target) || new DesignTokenNode(target);\n    }\n    /**\n     * Determines if a DesignTokenNode has been created for a target\n     * @param target - The element to test\n     */\n    static existsFor(target) {\n        return nodeCache.has(target);\n    }\n    /**\n     * Searches for and return the nearest parent DesignTokenNode.\n     * Null is returned if no node is found or the node provided is for a default element.\n     */\n    static findParent(node) {\n        if (!(defaultElement === node.target)) {\n            let parent = composedParent(node.target);\n            while (parent !== null) {\n                if (nodeCache.has(parent)) {\n                    return nodeCache.get(parent);\n                }\n                parent = composedParent(parent);\n            }\n            return DesignTokenNode.getOrCreate(defaultElement);\n        }\n        return null;\n    }\n    /**\n     * Finds the closest node with a value explicitly assigned for a token, otherwise null.\n     * @param token - The token to look for\n     * @param start - The node to start looking for value assignment\n     * @returns\n     */\n    static findClosestAssignedNode(token, start) {\n        let current = start;\n        do {\n            if (current.has(token)) {\n                return current;\n            }\n            current = current.parent\n                ? current.parent\n                : current.target !== defaultElement\n                    ? DesignTokenNode.getOrCreate(defaultElement)\n                    : null;\n        } while (current !== null);\n        return null;\n    }\n    /**\n     * The parent DesignTokenNode, or null.\n     */\n    get parent() {\n        return childToParent.get(this) || null;\n    }\n    /**\n     * Checks if a token has been assigned an explicit value the node.\n     * @param token - the token to check.\n     */\n    has(token) {\n        return this.assignedValues.has(token);\n    }\n    /**\n     * Gets the value of a token for a node\n     * @param token - The token to retrieve the value for\n     * @returns\n     */\n    get(token) {\n        const value = this.store.get(token);\n        if (value !== undefined) {\n            return value;\n        }\n        const raw = this.getRaw(token);\n        if (raw !== undefined) {\n            this.hydrate(token, raw);\n            return this.get(token);\n        }\n    }\n    /**\n     * Retrieves the raw assigned value of a token from the nearest assigned node.\n     * @param token - The token to retrieve a raw value for\n     * @returns\n     */\n    getRaw(token) {\n        var _a;\n        if (this.assignedValues.has(token)) {\n            return this.assignedValues.get(token);\n        }\n        return (_a = DesignTokenNode.findClosestAssignedNode(token, this)) === null || _a === void 0 ? void 0 : _a.getRaw(token);\n    }\n    /**\n     * Sets a token to a value for a node\n     * @param token - The token to set\n     * @param value - The value to set the token to\n     */\n    set(token, value) {\n        if (DesignTokenImpl.isDerivedDesignTokenValue(this.assignedValues.get(token))) {\n            this.tearDownBindingObserver(token);\n        }\n        this.assignedValues.set(token, value);\n        if (DesignTokenImpl.isDerivedDesignTokenValue(value)) {\n            this.setupBindingObserver(token, value);\n        }\n        else {\n            this.store.set(token, value);\n        }\n    }\n    /**\n     * Deletes a token value for the node.\n     * @param token - The token to delete the value for\n     */\n    delete(token) {\n        this.assignedValues.delete(token);\n        this.tearDownBindingObserver(token);\n        const upstream = this.getRaw(token);\n        if (upstream) {\n            this.hydrate(token, upstream);\n        }\n        else {\n            this.store.delete(token);\n        }\n    }\n    /**\n     * Invoked when the DesignTokenNode.target is attached to the document\n     */\n    bind() {\n        const parent = DesignTokenNode.findParent(this);\n        if (parent) {\n            parent.appendChild(this);\n        }\n        for (const key of this.assignedValues.keys()) {\n            key.notify(this.target);\n        }\n    }\n    /**\n     * Invoked when the DesignTokenNode.target is detached from the document\n     */\n    unbind() {\n        if (this.parent) {\n            const parent = childToParent.get(this);\n            parent.removeChild(this);\n        }\n    }\n    /**\n     * Appends a child to a parent DesignTokenNode.\n     * @param child - The child to append to the node\n     */\n    appendChild(child) {\n        if (child.parent) {\n            childToParent.get(child).removeChild(child);\n        }\n        const reParent = this.children.filter(x => child.contains(x));\n        childToParent.set(child, this);\n        this.children.push(child);\n        reParent.forEach(x => child.appendChild(x));\n        Observable.getNotifier(this.store).subscribe(child);\n        // How can we not notify *every* subscriber?\n        for (const [token, value] of this.store.all()) {\n            child.hydrate(token, this.bindingObservers.has(token) ? this.getRaw(token) : value);\n        }\n    }\n    /**\n     * Removes a child from a node.\n     * @param child - The child to remove.\n     */\n    removeChild(child) {\n        const childIndex = this.children.indexOf(child);\n        if (childIndex !== -1) {\n            this.children.splice(childIndex, 1);\n        }\n        Observable.getNotifier(this.store).unsubscribe(child);\n        return child.parent === this ? childToParent.delete(child) : false;\n    }\n    /**\n     * Tests whether a provided node is contained by\n     * the calling node.\n     * @param test - The node to test\n     */\n    contains(test) {\n        return composedContains(this.target, test.target);\n    }\n    /**\n     * Instructs the node to reflect a design token for the provided token.\n     * @param token - The design token to reflect\n     */\n    reflectToCSS(token) {\n        if (!this.isReflecting(token)) {\n            this.reflecting.add(token);\n            DesignTokenNode.cssCustomPropertyReflector.startReflection(token, this.target);\n        }\n    }\n    /**\n     * Stops reflecting a DesignToken to CSS\n     * @param token - The design token to stop reflecting\n     */\n    stopReflectToCSS(token) {\n        if (this.isReflecting(token)) {\n            this.reflecting.delete(token);\n            DesignTokenNode.cssCustomPropertyReflector.stopReflection(token, this.target);\n        }\n    }\n    /**\n     * Determines if a token is being reflected to CSS for a node.\n     * @param token - The token to check for reflection\n     * @returns\n     */\n    isReflecting(token) {\n        return this.reflecting.has(token);\n    }\n    /**\n     * Handle changes to upstream tokens\n     * @param source - The parent DesignTokenNode\n     * @param property - The token ID that changed\n     */\n    handleChange(source, property) {\n        const token = DesignTokenImpl.getTokenById(property);\n        if (!token) {\n            return;\n        }\n        this.hydrate(token, this.getRaw(token));\n    }\n    /**\n     * Hydrates a token with a DesignTokenValue, making retrieval available.\n     * @param token - The token to hydrate\n     * @param value - The value to hydrate\n     */\n    hydrate(token, value) {\n        if (!this.has(token)) {\n            const observer = this.bindingObservers.get(token);\n            if (DesignTokenImpl.isDerivedDesignTokenValue(value)) {\n                if (observer) {\n                    // If the binding source doesn't match, we need\n                    // to update the binding\n                    if (observer.source !== value) {\n                        this.tearDownBindingObserver(token);\n                        this.setupBindingObserver(token, value);\n                    }\n                }\n                else {\n                    this.setupBindingObserver(token, value);\n                }\n            }\n            else {\n                if (observer) {\n                    this.tearDownBindingObserver(token);\n                }\n                this.store.set(token, value);\n            }\n        }\n    }\n    /**\n     * Sets up a binding observer for a derived token value that notifies token\n     * subscribers on change.\n     *\n     * @param token - The token to notify when the binding updates\n     * @param source - The binding source\n     */\n    setupBindingObserver(token, source) {\n        const binding = new DesignTokenBindingObserver(source, token, this);\n        this.bindingObservers.set(token, binding);\n        return binding;\n    }\n    /**\n     * Tear down a binding observer for a token.\n     */\n    tearDownBindingObserver(token) {\n        if (this.bindingObservers.has(token)) {\n            this.bindingObservers.get(token).disconnect();\n            this.bindingObservers.delete(token);\n            return true;\n        }\n        return false;\n    }\n}\n/**\n * Responsible for reflecting tokens to CSS custom properties\n */\nDesignTokenNode.cssCustomPropertyReflector = new CustomPropertyReflector();\n__decorate([\n    observable\n], DesignTokenNode.prototype, \"children\", void 0);\nfunction create(nameOrConfig) {\n    return DesignTokenImpl.from(nameOrConfig);\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n/**\n * Factory object for creating {@link (DesignToken:interface)} instances.\n * @public\n */\nexport const DesignToken = Object.freeze({\n    create,\n    /**\n     * Informs DesignToken that an HTMLElement for which tokens have\n     * been set has been connected to the document.\n     *\n     * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness\n     * in all scenarios, so invoking this method manually is necessary when:\n     *\n     * 1. Token values are set for an HTMLElement.\n     * 2. The HTMLElement does not inherit from FASTElement.\n     * 3. The HTMLElement is not connected to the document when token values are set.\n     *\n     * @param element - The element to notify\n     * @returns - true if notification was successful, otherwise false.\n     */\n    notifyConnection(element) {\n        if (!element.isConnected || !DesignTokenNode.existsFor(element)) {\n            return false;\n        }\n        DesignTokenNode.getOrCreate(element).bind();\n        return true;\n    },\n    /**\n     * Informs DesignToken that an HTMLElement for which tokens have\n     * been set has been disconnected to the document.\n     *\n     * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness\n     * in all scenarios, so invoking this method manually is necessary when:\n     *\n     * 1. Token values are set for an HTMLElement.\n     * 2. The HTMLElement does not inherit from FASTElement.\n     *\n     * @param element - The element to notify\n     * @returns - true if notification was successful, otherwise false.\n     */\n    notifyDisconnection(element) {\n        if (element.isConnected || !DesignTokenNode.existsFor(element)) {\n            return false;\n        }\n        DesignTokenNode.getOrCreate(element).unbind();\n        return true;\n    },\n    /**\n     * Registers and element or document as a DesignToken root.\n     * {@link CSSDesignToken | CSSDesignTokens} with default values assigned via\n     * {@link (DesignToken:interface).withDefault} will emit CSS custom properties to all\n     * registered roots.\n     * @param target - The root to register\n     */\n    registerRoot(target = defaultElement) {\n        RootStyleSheetTarget.registerRoot(target);\n    },\n    /**\n     * Unregister an element or document as a DesignToken root.\n     * @param target - The root to deregister\n     */\n    unregisterRoot(target = defaultElement) {\n        RootStyleSheetTarget.unregisterRoot(target);\n    },\n});\n/* eslint-enable @typescript-eslint/no-non-null-assertion */\n","import { composedParent } from \"./composed-parent.js\";\n/**\n * Determines if the reference element contains the test element in a \"composed\" DOM tree that\n * ignores shadow DOM boundaries.\n *\n * Returns true of the test element is a descendent of the reference, or exist in\n * a shadow DOM that is a logical descendent of the reference. Otherwise returns false.\n * @param reference - The element to test for containment against.\n * @param test - The element being tested for containment.\n *\n * @public\n */\nexport function composedContains(reference, test) {\n    let current = test;\n    while (current !== null) {\n        if (current === reference) {\n            return true;\n        }\n        current = composedParent(current);\n    }\n    return false;\n}\n","import { FASTElementDefinition } from \"@microsoft/fast-element\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nimport { DI, Registration } from \"../di/di.js\";\nimport { DesignToken } from \"../design-token/design-token.js\";\nimport { ComponentPresentation } from \"./component-presentation.js\";\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/**\n * Indicates what to do with an ambiguous (duplicate) element.\n * @public\n */\nexport const ElementDisambiguation = Object.freeze({\n    /**\n     * Skip defining the element but still call the provided callback passed\n     * to DesignSystemRegistrationContext.tryDefineElement\n     */\n    definitionCallbackOnly: null,\n    /**\n     * Ignore the duplicate element entirely.\n     */\n    ignoreDuplicate: Symbol(),\n});\nconst elementTypesByTag = new Map();\nconst elementTagsByType = new Map();\nlet rootDesignSystem = null;\nconst designSystemKey = DI.createInterface(x => x.cachedCallback(handler => {\n    if (rootDesignSystem === null) {\n        rootDesignSystem = new DefaultDesignSystem(null, handler);\n    }\n    return rootDesignSystem;\n}));\n/**\n * An API gateway to design system features.\n * @public\n */\nexport const DesignSystem = Object.freeze({\n    /**\n     * Returns the HTML element name that the type is defined as.\n     * @param type - The type to lookup.\n     * @public\n     */\n    tagFor(type) {\n        return elementTagsByType.get(type);\n    },\n    /**\n     * Searches the DOM hierarchy for the design system that is responsible\n     * for the provided element.\n     * @param element - The element to locate the design system for.\n     * @returns The located design system.\n     * @public\n     */\n    responsibleFor(element) {\n        const owned = element.$$designSystem$$;\n        if (owned) {\n            return owned;\n        }\n        const container = DI.findResponsibleContainer(element);\n        return container.get(designSystemKey);\n    },\n    /**\n     * Gets the DesignSystem if one is explicitly defined on the provided element;\n     * otherwise creates a design system defined directly on the element.\n     * @param element - The element to get or create a design system for.\n     * @returns The design system.\n     * @public\n     */\n    getOrCreate(node) {\n        if (!node) {\n            if (rootDesignSystem === null) {\n                rootDesignSystem = DI.getOrCreateDOMContainer().get(designSystemKey);\n            }\n            return rootDesignSystem;\n        }\n        const owned = node.$$designSystem$$;\n        if (owned) {\n            return owned;\n        }\n        const container = DI.getOrCreateDOMContainer(node);\n        if (container.has(designSystemKey, false)) {\n            return container.get(designSystemKey);\n        }\n        else {\n            const system = new DefaultDesignSystem(node, container);\n            container.register(Registration.instance(designSystemKey, system));\n            return system;\n        }\n    },\n});\nfunction extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback) {\n    if (typeof params === \"string\") {\n        return {\n            name: params,\n            type: elementDefinitionType,\n            callback: elementDefinitionCallback,\n        };\n    }\n    else {\n        return params;\n    }\n}\nclass DefaultDesignSystem {\n    constructor(owner, container) {\n        this.owner = owner;\n        this.container = container;\n        this.designTokensInitialized = false;\n        this.prefix = \"fast\";\n        this.shadowRootMode = undefined;\n        this.disambiguate = () => ElementDisambiguation.definitionCallbackOnly;\n        if (owner !== null) {\n            owner.$$designSystem$$ = this;\n        }\n    }\n    withPrefix(prefix) {\n        this.prefix = prefix;\n        return this;\n    }\n    withShadowRootMode(mode) {\n        this.shadowRootMode = mode;\n        return this;\n    }\n    withElementDisambiguation(callback) {\n        this.disambiguate = callback;\n        return this;\n    }\n    withDesignTokenRoot(root) {\n        this.designTokenRoot = root;\n        return this;\n    }\n    register(...registrations) {\n        const container = this.container;\n        const elementDefinitionEntries = [];\n        const disambiguate = this.disambiguate;\n        const shadowRootMode = this.shadowRootMode;\n        const context = {\n            elementPrefix: this.prefix,\n            tryDefineElement(params, elementDefinitionType, elementDefinitionCallback) {\n                const extractedParams = extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback);\n                const { name, callback, baseClass } = extractedParams;\n                let { type } = extractedParams;\n                let elementName = name;\n                let typeFoundByName = elementTypesByTag.get(elementName);\n                let needsDefine = true;\n                while (typeFoundByName) {\n                    const result = disambiguate(elementName, type, typeFoundByName);\n                    switch (result) {\n                        case ElementDisambiguation.ignoreDuplicate:\n                            return;\n                        case ElementDisambiguation.definitionCallbackOnly:\n                            needsDefine = false;\n                            typeFoundByName = void 0;\n                            break;\n                        default:\n                            elementName = result;\n                            typeFoundByName = elementTypesByTag.get(elementName);\n                            break;\n                    }\n                }\n                if (needsDefine) {\n                    if (elementTagsByType.has(type) || type === FoundationElement) {\n                        type = class extends type {\n                        };\n                    }\n                    elementTypesByTag.set(elementName, type);\n                    elementTagsByType.set(type, elementName);\n                    if (baseClass) {\n                        elementTagsByType.set(baseClass, elementName);\n                    }\n                }\n                elementDefinitionEntries.push(new ElementDefinitionEntry(container, elementName, type, shadowRootMode, callback, needsDefine));\n            },\n        };\n        if (!this.designTokensInitialized) {\n            this.designTokensInitialized = true;\n            if (this.designTokenRoot !== null) {\n                DesignToken.registerRoot(this.designTokenRoot);\n            }\n        }\n        container.registerWithContext(context, ...registrations);\n        for (const entry of elementDefinitionEntries) {\n            entry.callback(entry);\n            if (entry.willDefine && entry.definition !== null) {\n                entry.definition.define();\n            }\n        }\n        return this;\n    }\n}\nclass ElementDefinitionEntry {\n    constructor(container, name, type, shadowRootMode, callback, willDefine) {\n        this.container = container;\n        this.name = name;\n        this.type = type;\n        this.shadowRootMode = shadowRootMode;\n        this.callback = callback;\n        this.willDefine = willDefine;\n        this.definition = null;\n    }\n    definePresentation(presentation) {\n        ComponentPresentation.define(this.name, presentation, this.container);\n    }\n    defineElement(definition) {\n        this.definition = new FASTElementDefinition(this.type, Object.assign(Object.assign({}, definition), { name: this.name }));\n    }\n    tagFor(type) {\n        return DesignSystem.tagFor(type);\n    }\n}\n/* eslint-enable @typescript-eslint/no-non-null-assertion */\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n    extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n    return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n    extendStatics(d, b);\r\n    function __() { this.constructor = d; }\r\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n    __assign = Object.assign || function __assign(t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    }\r\n    return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n    var t = {};\r\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n        t[p] = s[p];\r\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                t[p[i]] = s[p[i]];\r\n        }\r\n    return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n    return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n    });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n    return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n    function verb(n) { return function (v) { return step([n, v]); }; }\r\n    function step(op) {\r\n        if (f) throw new TypeError(\"Generator is already executing.\");\r\n        while (_) try {\r\n            if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n            if (y = 0, t) op = [op[0] & 2, t.value];\r\n            switch (op[0]) {\r\n                case 0: case 1: t = op; break;\r\n                case 4: _.label++; return { value: op[1], done: false };\r\n                case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                default:\r\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                    if (t[2]) _.ops.pop();\r\n                    _.trys.pop(); continue;\r\n            }\r\n            op = body.call(thisArg, _);\r\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n    }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n    if (k2 === undefined) k2 = k;\r\n    o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n    for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n    var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n    if (m) return m.call(o);\r\n    if (o && typeof o.length === \"number\") return {\r\n        next: function () {\r\n            if (o && i >= o.length) o = void 0;\r\n            return { value: o && o[i++], done: !o };\r\n        }\r\n    };\r\n    throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n    if (!m) return o;\r\n    var i = m.call(o), r, ar = [], e;\r\n    try {\r\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n    }\r\n    catch (error) { e = { error: error }; }\r\n    finally {\r\n        try {\r\n            if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n        }\r\n        finally { if (e) throw e.error; }\r\n    }\r\n    return ar;\r\n}\r\n\r\nexport function __spread() {\r\n    for (var ar = [], i = 0; i < arguments.length; i++)\r\n        ar = ar.concat(__read(arguments[i]));\r\n    return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n    for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n            r[k] = a[j];\r\n    return r;\r\n};\r\n\r\nexport function __await(v) {\r\n    return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n    return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n    function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n    function fulfill(value) { resume(\"next\", value); }\r\n    function reject(value) { resume(\"throw\", value); }\r\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n    var i, p;\r\n    return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var m = o[Symbol.asyncIterator], i;\r\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n    if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n    return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n    if (mod && mod.__esModule) return mod;\r\n    var result = {};\r\n    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n    result.default = mod;\r\n    return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n    return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n    if (!privateMap.has(receiver)) {\r\n        throw new TypeError(\"attempted to get private field on non-instance\");\r\n    }\r\n    return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n    if (!privateMap.has(receiver)) {\r\n        throw new TypeError(\"attempted to set private field on non-instance\");\r\n    }\r\n    privateMap.set(receiver, value);\r\n    return value;\r\n}\r\n","/**\n * Expose ltr and rtl strings\n */\nexport var Direction;\n(function (Direction) {\n    Direction[\"ltr\"] = \"ltr\";\n    Direction[\"rtl\"] = \"rtl\";\n})(Direction || (Direction = {}));\n","/**\n * An abstract behavior to react to media queries. Implementations should implement\n * the `constructListener` method to perform some action based on media query changes.\n *\n * @public\n */\nexport class MatchMediaBehavior {\n    /**\n     *\n     * @param query - The media query to operate from.\n     */\n    constructor(query) {\n        /**\n         * The behavior needs to operate on element instances but elements might share a behavior instance.\n         * To ensure proper attachment / detachment per instance, we construct a listener for\n         * each bind invocation and cache the listeners by element reference.\n         */\n        this.listenerCache = new WeakMap();\n        this.query = query;\n    }\n    /**\n     * Binds the behavior to the element.\n     * @param source - The element for which the behavior is bound.\n     */\n    bind(source) {\n        const { query } = this;\n        const listener = this.constructListener(source);\n        // Invoke immediately to add if the query currently matches\n        listener.bind(query)();\n        query.addListener(listener);\n        this.listenerCache.set(source, listener);\n    }\n    /**\n     * Unbinds the behavior from the element.\n     * @param source - The element for which the behavior is unbinding.\n     */\n    unbind(source) {\n        const listener = this.listenerCache.get(source);\n        if (listener) {\n            this.query.removeListener(listener);\n            this.listenerCache.delete(source);\n        }\n    }\n}\n/**\n * A behavior to add or remove a stylesheet from an element based on a media query. The behavior ensures that\n * styles are applied while the a query matches the environment and that styles are not applied if the query does\n * not match the environment.\n *\n * @public\n */\nexport class MatchMediaStyleSheetBehavior extends MatchMediaBehavior {\n    /**\n     * Constructs a {@link MatchMediaStyleSheetBehavior} instance.\n     * @param query - The media query to operate from.\n     * @param styles - The styles to coordinate with the query.\n     */\n    constructor(query, styles) {\n        super(query);\n        this.styles = styles;\n    }\n    /**\n     * Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for\n     * a provided query.\n     * @param query - The media query to operate from.\n     *\n     * @public\n     * @example\n     *\n     * ```ts\n     * import { css } from \"@microsoft/fast-element\";\n     * import { MatchMediaStyleSheetBehavior } from \"@microsoft/fast-foundation\";\n     *\n     * const landscapeBehavior = MatchMediaStyleSheetBehavior.with(\n     *   window.matchMedia(\"(orientation: landscape)\")\n     * );\n     * const styles = css`\n     *   :host {\n     *     width: 200px;\n     *     height: 400px;\n     *   }\n     * `\n     * .withBehaviors(landscapeBehavior(css`\n     *   :host {\n     *     width: 400px;\n     *     height: 200px;\n     *   }\n     * `))\n     * ```\n     */\n    static with(query) {\n        return (styles) => {\n            return new MatchMediaStyleSheetBehavior(query, styles);\n        };\n    }\n    /**\n     * Constructs a match-media listener for a provided element.\n     * @param source - the element for which to attach or detach styles.\n     * @internal\n     */\n    constructListener(source) {\n        let attached = false;\n        const styles = this.styles;\n        return function listener() {\n            const { matches } = this;\n            if (matches && !attached) {\n                source.$fastController.addStyles(styles);\n                attached = matches;\n            }\n            else if (!matches && attached) {\n                source.$fastController.removeStyles(styles);\n                attached = matches;\n            }\n        };\n    }\n    /**\n     * Unbinds the behavior from the element.\n     * @param source - The element for which the behavior is unbinding.\n     * @internal\n     */\n    unbind(source) {\n        super.unbind(source);\n        source.$fastController.removeStyles(this.styles);\n    }\n}\n/**\n * This can be used to construct a behavior to apply a forced-colors only stylesheet.\n * @public\n */\nexport const forcedColorsStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia(\"(forced-colors)\"));\n/**\n * This can be used to construct a behavior to apply a prefers color scheme: dark only stylesheet.\n * @public\n */\nexport const darkModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia(\"(prefers-color-scheme: dark)\"));\n/**\n * This can be used to construct a behavior to apply a prefers color scheme: light only stylesheet.\n * @public\n */\nexport const lightModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia(\"(prefers-color-scheme: light)\"));\n","/**\n * Define system colors for use in CSS stylesheets.\n *\n * https://drafts.csswg.org/css-color/#css-system-colors\n */\nexport var SystemColors;\n(function (SystemColors) {\n    SystemColors[\"Canvas\"] = \"Canvas\";\n    SystemColors[\"CanvasText\"] = \"CanvasText\";\n    SystemColors[\"LinkText\"] = \"LinkText\";\n    SystemColors[\"VisitedText\"] = \"VisitedText\";\n    SystemColors[\"ActiveText\"] = \"ActiveText\";\n    SystemColors[\"ButtonFace\"] = \"ButtonFace\";\n    SystemColors[\"ButtonText\"] = \"ButtonText\";\n    SystemColors[\"Field\"] = \"Field\";\n    SystemColors[\"FieldText\"] = \"FieldText\";\n    SystemColors[\"Highlight\"] = \"Highlight\";\n    SystemColors[\"HighlightText\"] = \"HighlightText\";\n    SystemColors[\"GrayText\"] = \"GrayText\";\n})(SystemColors || (SystemColors = {}));\n","/**\n * A CSS fragment to set `display: none;` when the host is hidden using the [hidden] attribute.\n * @public\n */\nexport const hidden = `:host([hidden]){display:none}`;\n/**\n * Applies a CSS display property.\n * Also adds CSS rules to not display the element when the [hidden] attribute is applied to the element.\n * @param display - The CSS display property value\n * @public\n */\nexport function display(displayValue) {\n    return `${hidden}:host{display:${displayValue}}`;\n}\n","import { __decorate } from \"tslib\";\nimport { attr, nullableNumberConverter, observable, } from \"@microsoft/fast-element\";\nimport { FoundationElement, } from \"../foundation-element/foundation-element.js\";\n/**\n * An Progress HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#progressbar | ARIA progressbar }.\n *\n * @slot indeterminate - The slot for a custom indeterminate indicator\n * @csspart progress - Represents the progress element\n * @csspart determinate - The determinate indicator\n * @csspart indeterminate - The indeterminate indicator\n *\n * @public\n */\nexport class BaseProgress extends FoundationElement {\n    constructor() {\n        super(...arguments);\n        /**\n         * Indicates progress in %\n         * @internal\n         */\n        this.percentComplete = 0;\n    }\n    valueChanged() {\n        if (this.$fastController.isConnected) {\n            this.updatePercentComplete();\n        }\n    }\n    minChanged() {\n        if (this.$fastController.isConnected) {\n            this.updatePercentComplete();\n        }\n    }\n    maxChanged() {\n        if (this.$fastController.isConnected) {\n            this.updatePercentComplete();\n        }\n    }\n    /**\n     * @internal\n     */\n    connectedCallback() {\n        super.connectedCallback();\n        this.updatePercentComplete();\n    }\n    updatePercentComplete() {\n        const min = typeof this.min === \"number\" ? this.min : 0;\n        const max = typeof this.max === \"number\" ? this.max : 100;\n        const value = typeof this.value === \"number\" ? this.value : 0;\n        const range = max - min;\n        this.percentComplete =\n            range === 0 ? 0 : Math.fround(((value - min) / range) * 100);\n    }\n}\n__decorate([\n    attr({ converter: nullableNumberConverter })\n], BaseProgress.prototype, \"value\", void 0);\n__decorate([\n    attr({ converter: nullableNumberConverter })\n], BaseProgress.prototype, \"min\", void 0);\n__decorate([\n    attr({ converter: nullableNumberConverter })\n], BaseProgress.prototype, \"max\", void 0);\n__decorate([\n    attr({ mode: \"boolean\" })\n], BaseProgress.prototype, \"paused\", void 0);\n__decorate([\n    observable\n], BaseProgress.prototype, \"percentComplete\", void 0);\n","import { html, when } from \"@microsoft/fast-element\";\nconst progressSegments = 44;\n/**\n * The template for the {@link @microsoft/fast-foundation#BaseProgress} component.\n * @public\n */\nexport const progressRingTemplate = (context, definition) => html `\n    <template\n        role=\"progressbar\"\n        aria-valuenow=\"${x => x.value}\"\n        aria-valuemin=\"${x => x.min}\"\n        aria-valuemax=\"${x => x.max}\"\n        class=\"${x => (x.paused ? \"paused\" : \"\")}\"\n    >\n        ${when(x => typeof x.value === \"number\", html `\n                <svg\n                    class=\"progress\"\n                    part=\"progress\"\n                    viewBox=\"0 0 16 16\"\n                    slot=\"determinate\"\n                >\n                    <circle\n                        class=\"background\"\n                        part=\"background\"\n                        cx=\"8px\"\n                        cy=\"8px\"\n                        r=\"7px\"\n                    ></circle>\n                    <circle\n                        class=\"determinate\"\n                        part=\"determinate\"\n                        style=\"stroke-dasharray: ${x => (progressSegments * x.percentComplete) /\n    100}px ${progressSegments}px\"\n                        cx=\"8px\"\n                        cy=\"8px\"\n                        r=\"7px\"\n                    ></circle>\n                </svg>\n            `)}\n        ${when(x => typeof x.value !== \"number\", html `\n                <slot name=\"indeterminate\" slot=\"indeterminate\">\n                    ${definition.indeterminateIndicator || \"\"}\n                </slot>\n            `)}\n    </template>\n`;\n","import { canUseDOM } from \"exenv-es6\";\n/**\n * A test that ensures that all arguments are HTML Elements\n */\nexport function isHTMLElement(...args) {\n    return args.every((arg) => arg instanceof HTMLElement);\n}\n/**\n * Returns all displayed elements inside of a root node that match a provided selector\n */\nexport function getDisplayedNodes(rootNode, selector) {\n    if (!rootNode || !selector || !isHTMLElement(rootNode)) {\n        return;\n    }\n    const nodes = Array.from(rootNode.querySelectorAll(selector));\n    // offsetParent will be null if the element isn't currently displayed,\n    // so this will allow us to operate only on visible nodes\n    return nodes.filter((node) => node.offsetParent !== null);\n}\n/**\n * Gets the numeric key code associated with a keyboard event. This method is for use with DOM level 3 events\n * that still use the deprecated keyCode property.\n */\nexport function getKeyCode(event) {\n    return event === null ? null : event.which || event.keyCode || event.charCode;\n}\n/**\n * Returns the nonce used in the page, if any.\n *\n * Based on https://github.com/cssinjs/jss/blob/master/packages/jss/src/DomRenderer.js\n */\nfunction getNonce() {\n    const node = document.querySelector('meta[property=\"csp-nonce\"]');\n    if (node) {\n        return node.getAttribute(\"content\");\n    }\n    else {\n        return null;\n    }\n}\n/**\n * Test if the document supports :focus-visible\n */\nlet _canUseFocusVisible;\nexport function canUseFocusVisible() {\n    if (typeof _canUseFocusVisible === \"boolean\") {\n        return _canUseFocusVisible;\n    }\n    if (!canUseDOM()) {\n        _canUseFocusVisible = false;\n        return _canUseFocusVisible;\n    }\n    // Check to see if the document supports the focus-visible element\n    const styleElement = document.createElement(\"style\");\n    // If nonces are present on the page, use it when creating the style element\n    // to test focus-visible support.\n    const styleNonce = getNonce();\n    if (styleNonce !== null) {\n        styleElement.setAttribute(\"nonce\", styleNonce);\n    }\n    document.head.appendChild(styleElement);\n    try {\n        styleElement.sheet.insertRule(\"foo:focus-visible {color:inherit}\", 0);\n        _canUseFocusVisible = true;\n    }\n    catch (e) {\n        _canUseFocusVisible = false;\n    }\n    finally {\n        document.head.removeChild(styleElement);\n    }\n    return _canUseFocusVisible;\n}\nlet _canUseCssGrid;\nexport function canUseCssGrid() {\n    if (typeof _canUseCssGrid === \"boolean\") {\n        return _canUseCssGrid;\n    }\n    try {\n        _canUseCssGrid = CSS.supports(\"display\", \"grid\");\n    }\n    catch (_a) {\n        _canUseCssGrid = false;\n    }\n    return _canUseCssGrid;\n}\nexport function canUseForcedColors() {\n    return (canUseDOM() &&\n        (window.matchMedia(\"(forced-colors: none)\").matches ||\n            window.matchMedia(\"(forced-colors: active)\").matches));\n}\nexport function resetDocumentCache() {\n    _canUseCssGrid = undefined;\n    _canUseFocusVisible = undefined;\n}\n/**\n * @deprecated Use 'canUseForcedColors' instead\n */\nexport const canUsedForcedColors = canUseForcedColors;\n","import { canUseFocusVisible } from \"@microsoft/fast-web-utilities\";\n/**\n * The string representing the focus selector to be used. Value\n * will be \"focus-visible\" when https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo\n * is supported and \"focus\" when it is not.\n *\n * @public\n */\nexport const focusVisible = canUseFocusVisible() ? \"focus-visible\" : \"focus\";\n","/**\n * Big thanks to https://github.com/fkleuver and the https://github.com/aurelia/aurelia project\n * for the bulk of this code and many of the associated tests.\n */\nimport { emptyArray, FASTElement } from \"@microsoft/fast-element\";\n// Tiny polyfill for TypeScript's Reflect metadata API.\nconst metadataByTarget = new Map();\nif (!(\"metadata\" in Reflect)) {\n    Reflect.metadata = function (key, value) {\n        return function (target) {\n            Reflect.defineMetadata(key, value, target);\n        };\n    };\n    Reflect.defineMetadata = function (key, value, target) {\n        let metadata = metadataByTarget.get(target);\n        if (metadata === void 0) {\n            metadataByTarget.set(target, (metadata = new Map()));\n        }\n        metadata.set(key, value);\n    };\n    Reflect.getOwnMetadata = function (key, target) {\n        const metadata = metadataByTarget.get(target);\n        if (metadata !== void 0) {\n            return metadata.get(key);\n        }\n        return void 0;\n    };\n}\n/**\n * A utility class used that constructs and registers resolvers for a dependency\n * injection container. Supports a standard set of object lifetimes.\n * @public\n */\nexport class ResolverBuilder {\n    /**\n     *\n     * @param container - The container to create resolvers for.\n     * @param key - The key to register resolvers under.\n     */\n    constructor(container, key) {\n        this.container = container;\n        this.key = key;\n    }\n    /**\n     * Creates a resolver for an existing object instance.\n     * @param value - The instance to resolve.\n     * @returns The resolver.\n     */\n    instance(value) {\n        return this.registerResolver(0 /* instance */, value);\n    }\n    /**\n     * Creates a resolver that enforces a singleton lifetime.\n     * @param value - The type to create and cache the singleton for.\n     * @returns The resolver.\n     */\n    singleton(value) {\n        return this.registerResolver(1 /* singleton */, value);\n    }\n    /**\n     * Creates a resolver that creates a new instance for every dependency request.\n     * @param value - The type to create instances of.\n     * @returns - The resolver.\n     */\n    transient(value) {\n        return this.registerResolver(2 /* transient */, value);\n    }\n    /**\n     * Creates a resolver that invokes a callback function for every dependency resolution\n     * request, allowing custom logic to return the dependency.\n     * @param value - The callback to call during resolution.\n     * @returns The resolver.\n     */\n    callback(value) {\n        return this.registerResolver(3 /* callback */, value);\n    }\n    /**\n     * Creates a resolver that invokes a callback function the first time that a dependency\n     * resolution is requested. The returned value is then cached and provided for all\n     * subsequent requests.\n     * @param value - The callback to call during the first resolution.\n     * @returns The resolver.\n     */\n    cachedCallback(value) {\n        return this.registerResolver(3 /* callback */, cacheCallbackResult(value));\n    }\n    /**\n     * Aliases the current key to a different key.\n     * @param destinationKey - The key to point the alias to.\n     * @returns The resolver.\n     */\n    aliasTo(destinationKey) {\n        return this.registerResolver(5 /* alias */, destinationKey);\n    }\n    registerResolver(strategy, state) {\n        const { container, key } = this;\n        /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n        this.container = this.key = (void 0);\n        return container.registerResolver(key, new ResolverImpl(key, strategy, state));\n    }\n}\nfunction cloneArrayWithPossibleProps(source) {\n    const clone = source.slice();\n    const keys = Object.keys(source);\n    const len = keys.length;\n    let key;\n    for (let i = 0; i < len; ++i) {\n        key = keys[i];\n        if (!isArrayIndex(key)) {\n            clone[key] = source[key];\n        }\n    }\n    return clone;\n}\n/**\n * A set of default resolvers useful in configuring a container.\n * @public\n */\nexport const DefaultResolver = Object.freeze({\n    /**\n     * Disables auto-registration and throws for all un-registered dependencies.\n     * @param key - The key to create the resolver for.\n     */\n    none(key) {\n        throw Error(`${key.toString()} not registered, did you forget to add @singleton()?`);\n    },\n    /**\n     * Provides default singleton resolution behavior during auto-registration.\n     * @param key - The key to create the resolver for.\n     * @returns The resolver.\n     */\n    singleton(key) {\n        return new ResolverImpl(key, 1 /* singleton */, key);\n    },\n    /**\n     * Provides default transient resolution behavior during auto-registration.\n     * @param key - The key to create the resolver for.\n     * @returns The resolver.\n     */\n    transient(key) {\n        return new ResolverImpl(key, 2 /* transient */, key);\n    },\n});\n/**\n * Configuration for a dependency injection container.\n * @public\n */\nexport const ContainerConfiguration = Object.freeze({\n    /**\n     * The default configuration used when creating a DOM-disconnected container.\n     * @remarks\n     * The default creates a root container, with no parent container. It does not handle\n     * owner requests and it uses singleton resolution behavior for auto-registration.\n     */\n    default: Object.freeze({\n        parentLocator: () => null,\n        responsibleForOwnerRequests: false,\n        defaultResolver: DefaultResolver.singleton,\n    }),\n});\nconst dependencyLookup = new Map();\nfunction getParamTypes(key) {\n    return (Type) => {\n        return Reflect.getOwnMetadata(key, Type);\n    };\n}\nlet rootDOMContainer = null;\n/**\n * The gateway to dependency injection APIs.\n * @public\n */\nexport const DI = Object.freeze({\n    /**\n     * Creates a new dependency injection container.\n     * @param config - The configuration for the container.\n     * @returns A newly created dependency injection container.\n     */\n    createContainer(config) {\n        return new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config));\n    },\n    /**\n     * Finds the dependency injection container responsible for providing dependencies\n     * to the specified node.\n     * @param node - The node to find the responsible container for.\n     * @returns The container responsible for providing dependencies to the node.\n     * @remarks\n     * This will be the same as the parent container if the specified node\n     * does not itself host a container configured with responsibleForOwnerRequests.\n     */\n    findResponsibleContainer(node) {\n        const owned = node.$$container$$;\n        if (owned && owned.responsibleForOwnerRequests) {\n            return owned;\n        }\n        return DI.findParentContainer(node);\n    },\n    /**\n     * Find the dependency injection container up the DOM tree from this node.\n     * @param node - The node to find the parent container for.\n     * @returns The parent container of this node.\n     * @remarks\n     * This will be the same as the responsible container if the specified node\n     * does not itself host a container configured with responsibleForOwnerRequests.\n     */\n    findParentContainer(node) {\n        const event = new CustomEvent(DILocateParentEventType, {\n            bubbles: true,\n            composed: true,\n            cancelable: true,\n            detail: { container: void 0 },\n        });\n        node.dispatchEvent(event);\n        return event.detail.container || DI.getOrCreateDOMContainer();\n    },\n    /**\n     * Returns a dependency injection container if one is explicitly owned by the specified\n     * node. If one is not owned, then a new container is created and assigned to the node.\n     * @param node - The node to find or create the container for.\n     * @param config - The configuration for the container if one needs to be created.\n     * @returns The located or created container.\n     * @remarks\n     * This API does not search for a responsible or parent container. It looks only for a container\n     * directly defined on the specified node and creates one at that location if one does not\n     * already exist.\n     */\n    getOrCreateDOMContainer(node, config) {\n        if (!node) {\n            return (rootDOMContainer ||\n                (rootDOMContainer = new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config, {\n                    parentLocator: () => null,\n                }))));\n        }\n        return (node.$$container$$ ||\n            new ContainerImpl(node, Object.assign({}, ContainerConfiguration.default, config, {\n                parentLocator: DI.findParentContainer,\n            })));\n    },\n    /**\n     * Gets the \"design:paramtypes\" metadata for the specified type.\n     * @param Type - The type to get the metadata for.\n     * @returns The metadata array or undefined if no metadata is found.\n     */\n    getDesignParamtypes: getParamTypes(\"design:paramtypes\"),\n    /**\n     * Gets the \"di:paramtypes\" metadata for the specified type.\n     * @param Type - The type to get the metadata for.\n     * @returns The metadata array or undefined if no metadata is found.\n     */\n    getAnnotationParamtypes: getParamTypes(\"di:paramtypes\"),\n    /**\n     *\n     * @param Type - Gets the \"di:paramtypes\" metadata for the specified type. If none is found,\n     * an empty metadata array is created and added.\n     * @returns The metadata array.\n     */\n    getOrCreateAnnotationParamTypes(Type) {\n        let annotationParamtypes = this.getAnnotationParamtypes(Type);\n        if (annotationParamtypes === void 0) {\n            Reflect.defineMetadata(\"di:paramtypes\", (annotationParamtypes = []), Type);\n        }\n        return annotationParamtypes;\n    },\n    /**\n     * Gets the dependency keys representing what is needed to instantiate the specified type.\n     * @param Type - The type to get the dependencies for.\n     * @returns An array of dependency keys.\n     */\n    getDependencies(Type) {\n        // Note: Every detail of this getDependencies method is pretty deliberate at the moment, and probably not yet 100% tested from every possible angle,\n        // so be careful with making changes here as it can have a huge impact on complex end user apps.\n        // Preferably, only make changes to the dependency resolution process via a RFC.\n        let dependencies = dependencyLookup.get(Type);\n        if (dependencies === void 0) {\n            // Type.length is the number of constructor parameters. If this is 0, it could mean the class has an empty constructor\n            // but it could also mean the class has no constructor at all (in which case it inherits the constructor from the prototype).\n            // Non-zero constructor length + no paramtypes means emitDecoratorMetadata is off, or the class has no decorator.\n            // We're not doing anything with the above right now, but it's good to keep in mind for any future issues.\n            const inject = Type.inject;\n            if (inject === void 0) {\n                // design:paramtypes is set by tsc when emitDecoratorMetadata is enabled.\n                const designParamtypes = DI.getDesignParamtypes(Type);\n                // di:paramtypes is set by the parameter decorator from DI.createInterface or by @inject\n                const annotationParamtypes = DI.getAnnotationParamtypes(Type);\n                if (designParamtypes === void 0) {\n                    if (annotationParamtypes === void 0) {\n                        // Only go up the prototype if neither static inject nor any of the paramtypes is defined, as\n                        // there is no sound way to merge a type's deps with its prototype's deps\n                        const Proto = Object.getPrototypeOf(Type);\n                        if (typeof Proto === \"function\" && Proto !== Function.prototype) {\n                            dependencies = cloneArrayWithPossibleProps(DI.getDependencies(Proto));\n                        }\n                        else {\n                            dependencies = [];\n                        }\n                    }\n                    else {\n                        // No design:paramtypes so just use the di:paramtypes\n                        dependencies = cloneArrayWithPossibleProps(annotationParamtypes);\n                    }\n                }\n                else if (annotationParamtypes === void 0) {\n                    // No di:paramtypes so just use the design:paramtypes\n                    dependencies = cloneArrayWithPossibleProps(designParamtypes);\n                }\n                else {\n                    // We've got both, so merge them (in case of conflict on same index, di:paramtypes take precedence)\n                    dependencies = cloneArrayWithPossibleProps(designParamtypes);\n                    let len = annotationParamtypes.length;\n                    let auAnnotationParamtype;\n                    for (let i = 0; i < len; ++i) {\n                        auAnnotationParamtype = annotationParamtypes[i];\n                        if (auAnnotationParamtype !== void 0) {\n                            dependencies[i] = auAnnotationParamtype;\n                        }\n                    }\n                    const keys = Object.keys(annotationParamtypes);\n                    len = keys.length;\n                    let key;\n                    for (let i = 0; i < len; ++i) {\n                        key = keys[i];\n                        if (!isArrayIndex(key)) {\n                            dependencies[key] = annotationParamtypes[key];\n                        }\n                    }\n                }\n            }\n            else {\n                // Ignore paramtypes if we have static inject\n                dependencies = cloneArrayWithPossibleProps(inject);\n            }\n            dependencyLookup.set(Type, dependencies);\n        }\n        return dependencies;\n    },\n    /**\n     * Defines a property on a web component class. The value of this property will\n     * be resolved from the dependency injection container responsible for the element\n     * instance, based on where it is connected in the DOM.\n     * @param target - The target to define the property on.\n     * @param propertyName - The name of the property to define.\n     * @param key - The dependency injection key.\n     * @param respectConnection - Indicates whether or not to update the property value if the\n     * hosting component is disconnected and then re-connected at a different location in the DOM.\n     * @remarks\n     * The respectConnection option is only applicable to elements that descend from FASTElement.\n     */\n    defineProperty(target, propertyName, key, respectConnection = false) {\n        const diPropertyKey = `$di_${propertyName}`;\n        Reflect.defineProperty(target, propertyName, {\n            get: function () {\n                let value = this[diPropertyKey];\n                if (value === void 0) {\n                    const container = this instanceof HTMLElement\n                        ? DI.findResponsibleContainer(this)\n                        : DI.getOrCreateDOMContainer();\n                    value = container.get(key);\n                    this[diPropertyKey] = value;\n                    if (respectConnection && this instanceof FASTElement) {\n                        const notifier = this.$fastController;\n                        const handleChange = () => {\n                            const newContainer = DI.findResponsibleContainer(this);\n                            const newValue = newContainer.get(key);\n                            const oldValue = this[diPropertyKey];\n                            if (newValue !== oldValue) {\n                                this[diPropertyKey] = value;\n                                notifier.notify(propertyName);\n                            }\n                        };\n                        notifier.subscribe({ handleChange }, \"isConnected\");\n                    }\n                }\n                return value;\n            },\n        });\n    },\n    /**\n     * Creates a dependency injection key.\n     * @param nameConfigOrCallback - A friendly name for the key or a lambda that configures a\n     * default resolution for the dependency.\n     * @param configuror - If a friendly name was provided for the first parameter, then an optional\n     * lambda that configures a default resolution for the dependency can be provided second.\n     * @returns The created key.\n     * @remarks\n     * The created key can be used as a property decorator or constructor parameter decorator,\n     * in addition to its standard use in an inject array or through direct container APIs.\n     */\n    createInterface(nameConfigOrCallback, configuror) {\n        const configure = typeof nameConfigOrCallback === \"function\"\n            ? nameConfigOrCallback\n            : configuror;\n        const friendlyName = typeof nameConfigOrCallback === \"string\"\n            ? nameConfigOrCallback\n            : nameConfigOrCallback && \"friendlyName\" in nameConfigOrCallback\n                ? nameConfigOrCallback.friendlyName || defaultFriendlyName\n                : defaultFriendlyName;\n        const respectConnection = typeof nameConfigOrCallback === \"string\"\n            ? false\n            : nameConfigOrCallback && \"respectConnection\" in nameConfigOrCallback\n                ? nameConfigOrCallback.respectConnection || false\n                : false;\n        const Interface = function (target, property, index) {\n            if (target == null || new.target !== undefined) {\n                throw new Error(`No registration for interface: '${Interface.friendlyName}'`);\n            }\n            if (property) {\n                DI.defineProperty(target, property, Interface, respectConnection);\n            }\n            else {\n                const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target);\n                annotationParamtypes[index] = Interface;\n            }\n        };\n        Interface.$isInterface = true;\n        Interface.friendlyName = friendlyName == null ? \"(anonymous)\" : friendlyName;\n        if (configure != null) {\n            Interface.register = function (container, key) {\n                return configure(new ResolverBuilder(container, key !== null && key !== void 0 ? key : Interface));\n            };\n        }\n        Interface.toString = function toString() {\n            return `InterfaceSymbol<${Interface.friendlyName}>`;\n        };\n        return Interface;\n    },\n    /**\n     * A decorator that specifies what to inject into its target.\n     * @param dependencies - The dependencies to inject.\n     * @returns The decorator to be applied to the target class.\n     * @remarks\n     * The decorator can be used to decorate a class, listing all of the classes dependencies.\n     * Or it can be used to decorate a constructor paramter, indicating what to inject for that\n     * parameter.\n     * Or it can be used for a web component property, indicating what that property should resolve to.\n     */\n    inject(...dependencies) {\n        return function (target, key, descriptor) {\n            if (typeof descriptor === \"number\") {\n                // It's a parameter decorator.\n                const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target);\n                const dep = dependencies[0];\n                if (dep !== void 0) {\n                    annotationParamtypes[descriptor] = dep;\n                }\n            }\n            else if (key) {\n                DI.defineProperty(target, key, dependencies[0]);\n            }\n            else {\n                const annotationParamtypes = descriptor\n                    ? DI.getOrCreateAnnotationParamTypes(descriptor.value)\n                    : DI.getOrCreateAnnotationParamTypes(target);\n                let dep;\n                for (let i = 0; i < dependencies.length; ++i) {\n                    dep = dependencies[i];\n                    if (dep !== void 0) {\n                        annotationParamtypes[i] = dep;\n                    }\n                }\n            }\n        };\n    },\n    /**\n     * Registers the `target` class as a transient dependency; each time the dependency is resolved\n     * a new instance will be created.\n     *\n     * @param target - The class / constructor function to register as transient.\n     * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver.\n     *\n     * @example\n     * On an existing class\n     * ```ts\n     * class Foo { }\n     * DI.transient(Foo);\n     * ```\n     *\n     * @example\n     * Inline declaration\n     *\n     * ```ts\n     * const Foo = DI.transient(class { });\n     * // Foo is now strongly typed with register\n     * Foo.register(container);\n     * ```\n     *\n     * @public\n     */\n    transient(target) {\n        target.register = function register(container) {\n            const registration = Registration.transient(target, target);\n            return registration.register(container);\n        };\n        target.registerInRequestor = false;\n        return target;\n    },\n    /**\n     * Registers the `target` class as a singleton dependency; the class will only be created once. Each\n     * consecutive time the dependency is resolved, the same instance will be returned.\n     *\n     * @param target - The class / constructor function to register as a singleton.\n     * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver.\n     * @example\n     * On an existing class\n     * ```ts\n     * class Foo { }\n     * DI.singleton(Foo);\n     * ```\n     *\n     * @example\n     * Inline declaration\n     * ```ts\n     * const Foo = DI.singleton(class { });\n     * // Foo is now strongly typed with register\n     * Foo.register(container);\n     * ```\n     *\n     * @public\n     */\n    singleton(target, options = defaultSingletonOptions) {\n        target.register = function register(container) {\n            const registration = Registration.singleton(target, target);\n            return registration.register(container);\n        };\n        target.registerInRequestor = options.scoped;\n        return target;\n    },\n});\n/**\n * The interface key that resolves the dependency injection container itself.\n * @public\n */\nexport const Container = DI.createInterface(\"Container\");\n/**\n * The interface key that resolves the service locator itself.\n * @public\n */\nexport const ServiceLocator = Container;\nfunction createResolver(getter) {\n    return function (key) {\n        const resolver = function (target, property, descriptor) {\n            DI.inject(resolver)(target, property, descriptor);\n        };\n        resolver.$isResolver = true;\n        resolver.resolve = function (handler, requestor) {\n            return getter(key, handler, requestor);\n        };\n        return resolver;\n    };\n}\n/**\n * A decorator that specifies what to inject into its target.\n * @param dependencies - The dependencies to inject.\n * @returns The decorator to be applied to the target class.\n * @remarks\n * The decorator can be used to decorate a class, listing all of the classes dependencies.\n * Or it can be used to decorate a constructor paramter, indicating what to inject for that\n * parameter.\n * Or it can be used for a web component property, indicating what that property should resolve to.\n *\n * @public\n */\nexport const inject = DI.inject;\nfunction transientDecorator(target) {\n    return DI.transient(target);\n}\nexport function transient(target) {\n    return target == null ? transientDecorator : transientDecorator(target);\n}\nconst defaultSingletonOptions = { scoped: false };\nfunction singletonDecorator(target) {\n    return DI.singleton(target);\n}\n/**\n * @public\n */\nexport function singleton(targetOrOptions) {\n    if (typeof targetOrOptions === \"function\") {\n        return DI.singleton(targetOrOptions);\n    }\n    return function ($target) {\n        return DI.singleton($target, targetOrOptions);\n    };\n}\nfunction createAllResolver(getter) {\n    return function (key, searchAncestors) {\n        searchAncestors = !!searchAncestors;\n        const resolver = function (target, property, descriptor) {\n            DI.inject(resolver)(target, property, descriptor);\n        };\n        resolver.$isResolver = true;\n        resolver.resolve = function (handler, requestor) {\n            /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n            return getter(key, handler, requestor, searchAncestors);\n        };\n        return resolver;\n    };\n}\n/**\n * A decorator and DI resolver that will resolve an array of all dependencies\n * registered with the specified key.\n * @param key - The key to resolve all dependencies for.\n * @param searchAncestors - [optional] Indicates whether to search ancestor containers.\n * @public\n */\nexport const all = createAllResolver((key, handler, requestor, searchAncestors) => requestor.getAll(key, searchAncestors));\n/**\n * A decorator that lazily injects a dependency depending on whether the `Key` is present at the time of function call.\n *\n * @example\n * You need to make your argument a function that returns the type, for example\n * ```ts\n * class Foo {\n *   constructor( @lazy('random') public random: () => number )\n * }\n * const foo = container.get(Foo); // instanceof Foo\n * foo.random(); // throws\n * ```\n * would throw an exception because you haven't registered `'random'` before calling the method.\n * @example\n * This, would give you a new 'Math.random()' number each time.\n * ```ts\n * class Foo {\n *   constructor( @lazy('random') public random: () => random )\n * }\n * container.register(Registration.callback('random', Math.random ));\n * container.get(Foo).random(); // some random number\n * container.get(Foo).random(); // another random number\n * ```\n *\n * `@lazy` does not manage the lifecycle of the underlying key. If you want a singleton, you have to register as a\n * `singleton`, `transient` would also behave as you would expect, providing you a new instance each time.\n *\n * @param key - The key to lazily resolve.\n * see {@link DI.createInterface} on interactions with interfaces\n *\n * @public\n */\nexport const lazy = createResolver((key, handler, requestor) => {\n    return () => requestor.get(key);\n});\n/**\n * A decorator that allows you to optionally inject a dependency depending on whether the [[`Key`]] is present, for example:\n * @example\n * ```ts\n * class Foo {\n *   constructor( @inject('mystring') public str: string = 'somestring' )\n * }\n * container.get(Foo); // throws\n * ```\n * would fail\n *\n * @example\n * ```ts\n * class Foo {\n *   constructor( @optional('mystring') public str: string = 'somestring' )\n * }\n * container.get(Foo).str // somestring\n * ```\n * if you use it without a default it will inject `undefined`, so remember to mark your input type as\n * possibly `undefined`!\n *\n * @param key - The key to optionally resolve.\n * see {@link DI.createInterface} on interactions with interfaces\n *\n * @public\n */\nexport const optional = createResolver((key, handler, requestor) => {\n    if (requestor.has(key, true)) {\n        return requestor.get(key);\n    }\n    else {\n        return undefined;\n    }\n});\n/**\n * A decorator that tells the container not to try to inject a dependency.\n *\n * @public\n */\nexport function ignore(target, property, descriptor) {\n    DI.inject(ignore)(target, property, descriptor);\n}\n// Hack: casting below used to prevent TS from generate a namespace which can't be commented\n// and results in documentation validation errors.\nignore.$isResolver = true;\nignore.resolve = () => undefined;\n/**\n * A decorator that indicates that a new instance should be injected scoped to the\n * container that requested the instance.\n * @param key - The dependency key for the new instance.\n * @remarks\n * This creates a resolver with an instance strategy pointing to the new instance, effectively\n * making this a singleton, scoped to the container or DOM's subtree.\n *\n * @public\n */\nexport const newInstanceForScope = createResolver((key, handler, requestor) => {\n    const instance = createNewInstance(key, handler);\n    const resolver = new ResolverImpl(key, 0 /* instance */, instance);\n    requestor.registerResolver(key, resolver);\n    return instance;\n});\n/**\n * A decorator that indicates that a new instance should be injected.\n * @param key - The dependency key for the new instance.\n * @remarks\n * The instance is not internally cached with a resolver as newInstanceForScope does.\n *\n * @public\n */\nexport const newInstanceOf = createResolver((key, handler, _requestor) => createNewInstance(key, handler));\nfunction createNewInstance(key, handler) {\n    /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n    return handler.getFactory(key).construct(handler);\n}\n/** @internal */\nexport class ResolverImpl {\n    constructor(key, strategy, state) {\n        this.key = key;\n        this.strategy = strategy;\n        this.state = state;\n        this.resolving = false;\n    }\n    get $isResolver() {\n        return true;\n    }\n    register(container) {\n        return container.registerResolver(this.key, this);\n    }\n    resolve(handler, requestor) {\n        switch (this.strategy) {\n            case 0 /* instance */:\n                return this.state;\n            case 1 /* singleton */: {\n                if (this.resolving) {\n                    throw new Error(`Cyclic dependency found: ${this.state.name}`);\n                }\n                this.resolving = true;\n                this.state = handler\n                    .getFactory(this.state)\n                    .construct(requestor);\n                this.strategy = 0 /* instance */;\n                this.resolving = false;\n                return this.state;\n            }\n            case 2 /* transient */: {\n                // Always create transients from the requesting container\n                const factory = handler.getFactory(this.state);\n                if (factory === null) {\n                    throw new Error(`Resolver for ${String(this.key)} returned a null factory`);\n                }\n                return factory.construct(requestor);\n            }\n            case 3 /* callback */:\n                return this.state(handler, requestor, this);\n            case 4 /* array */:\n                return this.state[0].resolve(handler, requestor);\n            case 5 /* alias */:\n                return requestor.get(this.state);\n            default:\n                throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`);\n        }\n    }\n    getFactory(container) {\n        var _a, _b, _c;\n        switch (this.strategy) {\n            case 1 /* singleton */:\n            case 2 /* transient */:\n                return container.getFactory(this.state);\n            case 5 /* alias */:\n                return (_c = (_b = (_a = container.getResolver(this.state)) === null || _a === void 0 ? void 0 : _a.getFactory) === null || _b === void 0 ? void 0 : _b.call(_a, container)) !== null && _c !== void 0 ? _c : null;\n            default:\n                return null;\n        }\n    }\n}\nfunction containerGetKey(d) {\n    return this.get(d);\n}\nfunction transformInstance(inst, transform) {\n    return transform(inst);\n}\n/** @internal */\nexport class FactoryImpl {\n    constructor(Type, dependencies) {\n        this.Type = Type;\n        this.dependencies = dependencies;\n        this.transformers = null;\n    }\n    construct(container, dynamicDependencies) {\n        let instance;\n        if (dynamicDependencies === void 0) {\n            instance = new this.Type(...this.dependencies.map(containerGetKey, container));\n        }\n        else {\n            instance = new this.Type(...this.dependencies.map(containerGetKey, container), ...dynamicDependencies);\n        }\n        if (this.transformers == null) {\n            return instance;\n        }\n        return this.transformers.reduce(transformInstance, instance);\n    }\n    registerTransformer(transformer) {\n        (this.transformers || (this.transformers = [])).push(transformer);\n    }\n}\nconst containerResolver = {\n    $isResolver: true,\n    resolve(handler, requestor) {\n        return requestor;\n    },\n};\nfunction isRegistry(obj) {\n    return typeof obj.register === \"function\";\n}\nfunction isSelfRegistry(obj) {\n    return isRegistry(obj) && typeof obj.registerInRequestor === \"boolean\";\n}\nfunction isRegisterInRequester(obj) {\n    return isSelfRegistry(obj) && obj.registerInRequestor;\n}\nfunction isClass(obj) {\n    return obj.prototype !== void 0;\n}\nconst InstrinsicTypeNames = new Set([\n    \"Array\",\n    \"ArrayBuffer\",\n    \"Boolean\",\n    \"DataView\",\n    \"Date\",\n    \"Error\",\n    \"EvalError\",\n    \"Float32Array\",\n    \"Float64Array\",\n    \"Function\",\n    \"Int8Array\",\n    \"Int16Array\",\n    \"Int32Array\",\n    \"Map\",\n    \"Number\",\n    \"Object\",\n    \"Promise\",\n    \"RangeError\",\n    \"ReferenceError\",\n    \"RegExp\",\n    \"Set\",\n    \"SharedArrayBuffer\",\n    \"String\",\n    \"SyntaxError\",\n    \"TypeError\",\n    \"Uint8Array\",\n    \"Uint8ClampedArray\",\n    \"Uint16Array\",\n    \"Uint32Array\",\n    \"URIError\",\n    \"WeakMap\",\n    \"WeakSet\",\n]);\nconst DILocateParentEventType = \"__DI_LOCATE_PARENT__\";\nconst factories = new Map();\n/**\n * @internal\n */\nexport class ContainerImpl {\n    constructor(owner, config) {\n        this.owner = owner;\n        this.config = config;\n        this._parent = void 0;\n        this.registerDepth = 0;\n        this.context = null;\n        if (owner !== null) {\n            owner.$$container$$ = this;\n        }\n        this.resolvers = new Map();\n        this.resolvers.set(Container, containerResolver);\n        if (owner instanceof Node) {\n            owner.addEventListener(DILocateParentEventType, (e) => {\n                if (e.composedPath()[0] !== this.owner) {\n                    e.detail.container = this;\n                    e.stopImmediatePropagation();\n                }\n            });\n        }\n    }\n    get parent() {\n        if (this._parent === void 0) {\n            this._parent = this.config.parentLocator(this.owner);\n        }\n        return this._parent;\n    }\n    get depth() {\n        return this.parent === null ? 0 : this.parent.depth + 1;\n    }\n    get responsibleForOwnerRequests() {\n        return this.config.responsibleForOwnerRequests;\n    }\n    registerWithContext(context, ...params) {\n        this.context = context;\n        this.register(...params);\n        this.context = null;\n        return this;\n    }\n    register(...params) {\n        if (++this.registerDepth === 100) {\n            throw new Error(\"Unable to autoregister dependency\");\n            // Most likely cause is trying to register a plain object that does not have a\n            // register method and is not a class constructor\n        }\n        let current;\n        let keys;\n        let value;\n        let j;\n        let jj;\n        const context = this.context;\n        for (let i = 0, ii = params.length; i < ii; ++i) {\n            current = params[i];\n            if (!isObject(current)) {\n                continue;\n            }\n            if (isRegistry(current)) {\n                current.register(this, context);\n            }\n            else if (isClass(current)) {\n                Registration.singleton(current, current).register(this);\n            }\n            else {\n                keys = Object.keys(current);\n                j = 0;\n                jj = keys.length;\n                for (; j < jj; ++j) {\n                    value = current[keys[j]];\n                    if (!isObject(value)) {\n                        continue;\n                    }\n                    // note: we could remove this if-branch and call this.register directly\n                    // - the extra check is just a perf tweak to create fewer unnecessary arrays by the spread operator\n                    if (isRegistry(value)) {\n                        value.register(this, context);\n                    }\n                    else {\n                        this.register(value);\n                    }\n                }\n            }\n        }\n        --this.registerDepth;\n        return this;\n    }\n    registerResolver(key, resolver) {\n        validateKey(key);\n        const resolvers = this.resolvers;\n        const result = resolvers.get(key);\n        if (result == null) {\n            resolvers.set(key, resolver);\n        }\n        else if (result instanceof ResolverImpl &&\n            result.strategy === 4 /* array */) {\n            result.state.push(resolver);\n        }\n        else {\n            resolvers.set(key, new ResolverImpl(key, 4 /* array */, [result, resolver]));\n        }\n        return resolver;\n    }\n    registerTransformer(key, transformer) {\n        const resolver = this.getResolver(key);\n        if (resolver == null) {\n            return false;\n        }\n        if (resolver.getFactory) {\n            const factory = resolver.getFactory(this);\n            if (factory == null) {\n                return false;\n            }\n            // This type cast is a bit of a hacky one, necessary due to the duplicity of IResolverLike.\n            // Problem is that that interface's type arg can be of type Key, but the getFactory method only works on\n            // type Constructable. So the return type of that optional method has this additional constraint, which\n            // seems to confuse the type checker.\n            factory.registerTransformer(transformer);\n            return true;\n        }\n        return false;\n    }\n    getResolver(key, autoRegister = true) {\n        validateKey(key);\n        if (key.resolve !== void 0) {\n            return key;\n        }\n        /* eslint-disable-next-line @typescript-eslint/no-this-alias */\n        let current = this;\n        let resolver;\n        while (current != null) {\n            resolver = current.resolvers.get(key);\n            if (resolver == null) {\n                if (current.parent == null) {\n                    const handler = isRegisterInRequester(key)\n                        ? this\n                        : current;\n                    return autoRegister ? this.jitRegister(key, handler) : null;\n                }\n                current = current.parent;\n            }\n            else {\n                return resolver;\n            }\n        }\n        return null;\n    }\n    has(key, searchAncestors = false) {\n        return this.resolvers.has(key)\n            ? true\n            : searchAncestors && this.parent != null\n                ? this.parent.has(key, true)\n                : false;\n    }\n    get(key) {\n        validateKey(key);\n        if (key.$isResolver) {\n            return key.resolve(this, this);\n        }\n        /* eslint-disable-next-line @typescript-eslint/no-this-alias */\n        let current = this;\n        let resolver;\n        while (current != null) {\n            resolver = current.resolvers.get(key);\n            if (resolver == null) {\n                if (current.parent == null) {\n                    const handler = isRegisterInRequester(key)\n                        ? this\n                        : current;\n                    resolver = this.jitRegister(key, handler);\n                    return resolver.resolve(current, this);\n                }\n                current = current.parent;\n            }\n            else {\n                return resolver.resolve(current, this);\n            }\n        }\n        throw new Error(`Unable to resolve key: ${key}`);\n    }\n    getAll(key, searchAncestors = false) {\n        validateKey(key);\n        /* eslint-disable-next-line @typescript-eslint/no-this-alias */\n        const requestor = this;\n        let current = requestor;\n        let resolver;\n        if (searchAncestors) {\n            let resolutions = emptyArray;\n            while (current != null) {\n                resolver = current.resolvers.get(key);\n                if (resolver != null) {\n                    resolutions = resolutions.concat(\n                    /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n                    buildAllResponse(resolver, current, requestor));\n                }\n                current = current.parent;\n            }\n            return resolutions;\n        }\n        else {\n            while (current != null) {\n                resolver = current.resolvers.get(key);\n                if (resolver == null) {\n                    current = current.parent;\n                    if (current == null) {\n                        return emptyArray;\n                    }\n                }\n                else {\n                    return buildAllResponse(resolver, current, requestor);\n                }\n            }\n        }\n        return emptyArray;\n    }\n    getFactory(Type) {\n        let factory = factories.get(Type);\n        if (factory === void 0) {\n            if (isNativeFunction(Type)) {\n                throw new Error(`${Type.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`);\n            }\n            factories.set(Type, (factory = new FactoryImpl(Type, DI.getDependencies(Type))));\n        }\n        return factory;\n    }\n    registerFactory(key, factory) {\n        factories.set(key, factory);\n    }\n    createChild(config) {\n        return new ContainerImpl(null, Object.assign({}, this.config, config, { parentLocator: () => this }));\n    }\n    jitRegister(keyAsValue, handler) {\n        if (typeof keyAsValue !== \"function\") {\n            throw new Error(`Attempted to jitRegister something that is not a constructor: '${keyAsValue}'. Did you forget to register this dependency?`);\n        }\n        if (InstrinsicTypeNames.has(keyAsValue.name)) {\n            throw new Error(`Attempted to jitRegister an intrinsic type: ${keyAsValue.name}. Did you forget to add @inject(Key)`);\n        }\n        if (isRegistry(keyAsValue)) {\n            const registrationResolver = keyAsValue.register(handler);\n            if (!(registrationResolver instanceof Object) ||\n                registrationResolver.resolve == null) {\n                const newResolver = handler.resolvers.get(keyAsValue);\n                if (newResolver != void 0) {\n                    return newResolver;\n                }\n                throw new Error(\"A valid resolver was not returned from the static register method\");\n            }\n            return registrationResolver;\n        }\n        else if (keyAsValue.$isInterface) {\n            throw new Error(`Attempted to jitRegister an interface: ${keyAsValue.friendlyName}`);\n        }\n        else {\n            const resolver = this.config.defaultResolver(keyAsValue, handler);\n            handler.resolvers.set(keyAsValue, resolver);\n            return resolver;\n        }\n    }\n}\nconst cache = new WeakMap();\nfunction cacheCallbackResult(fun) {\n    return function (handler, requestor, resolver) {\n        if (cache.has(resolver)) {\n            return cache.get(resolver);\n        }\n        const t = fun(handler, requestor, resolver);\n        cache.set(resolver, t);\n        return t;\n    };\n}\n/**\n * You can use the resulting Registration of any of the factory methods\n * to register with the container.\n *\n * @example\n * ```\n * class Foo {}\n * const container = DI.createContainer();\n * container.register(Registration.instance(Foo, new Foo()));\n * container.get(Foo);\n * ```\n *\n * @public\n */\nexport const Registration = Object.freeze({\n    /**\n     * Allows you to pass an instance.\n     * Every time you request this {@link Key} you will get this instance back.\n     *\n     * @example\n     * ```\n     * Registration.instance(Foo, new Foo()));\n     * ```\n     *\n     * @param key - The key to register the instance under.\n     * @param value - The instance to return when the key is requested.\n     */\n    instance(key, value) {\n        return new ResolverImpl(key, 0 /* instance */, value);\n    },\n    /**\n     * Creates an instance from the class.\n     * Every time you request this {@link Key} you will get the same one back.\n     *\n     * @example\n     * ```\n     * Registration.singleton(Foo, Foo);\n     * ```\n     *\n     * @param key - The key to register the singleton under.\n     * @param value - The class to instantiate as a singleton when first requested.\n     */\n    singleton(key, value) {\n        return new ResolverImpl(key, 1 /* singleton */, value);\n    },\n    /**\n     * Creates an instance from a class.\n     * Every time you request this {@link Key} you will get a new instance.\n     *\n     * @example\n     * ```\n     * Registration.instance(Foo, Foo);\n     * ```\n     *\n     * @param key - The key to register the instance type under.\n     * @param value - The class to instantiate each time the key is requested.\n     */\n    transient(key, value) {\n        return new ResolverImpl(key, 2 /* transient */, value);\n    },\n    /**\n     * Delegates to a callback function to provide the dependency.\n     * Every time you request this {@link Key} the callback will be invoked to provide\n     * the dependency.\n     *\n     * @example\n     * ```\n     * Registration.callback(Foo, () => new Foo());\n     * Registration.callback(Bar, (c: Container) => new Bar(c.get(Foo)));\n     * ```\n     *\n     * @param key - The key to register the callback for.\n     * @param callback - The function that is expected to return the dependency.\n     */\n    callback(key, callback) {\n        return new ResolverImpl(key, 3 /* callback */, callback);\n    },\n    /**\n     * Delegates to a callback function to provide the dependency and then caches the\n     * dependency for future requests.\n     *\n     * @example\n     * ```\n     * Registration.cachedCallback(Foo, () => new Foo());\n     * Registration.cachedCallback(Bar, (c: Container) => new Bar(c.get(Foo)));\n     * ```\n     *\n     * @param key - The key to register the callback for.\n     * @param callback - The function that is expected to return the dependency.\n     * @remarks\n     * If you pass the same Registration to another container, the same cached value will be used.\n     * Should all references to the resolver returned be removed, the cache will expire.\n     */\n    cachedCallback(key, callback) {\n        return new ResolverImpl(key, 3 /* callback */, cacheCallbackResult(callback));\n    },\n    /**\n     * Creates an alternate {@link Key} to retrieve an instance by.\n     *\n     * @example\n     * ```\n     * Register.singleton(Foo, Foo)\n     * Register.aliasTo(Foo, MyFoos);\n     *\n     * container.getAll(MyFoos) // contains an instance of Foo\n     * ```\n     *\n     * @param originalKey - The original key that has been registered.\n     * @param aliasKey - The alias to the original key.\n     */\n    aliasTo(originalKey, aliasKey) {\n        return new ResolverImpl(aliasKey, 5 /* alias */, originalKey);\n    },\n});\n/** @internal */\nexport function validateKey(key) {\n    if (key === null || key === void 0) {\n        throw new Error(\"key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?\");\n    }\n}\nfunction buildAllResponse(resolver, handler, requestor) {\n    if (resolver instanceof ResolverImpl &&\n        resolver.strategy === 4 /* array */) {\n        const state = resolver.state;\n        let i = state.length;\n        const results = new Array(i);\n        while (i--) {\n            results[i] = state[i].resolve(handler, requestor);\n        }\n        return results;\n    }\n    return [resolver.resolve(handler, requestor)];\n}\nconst defaultFriendlyName = \"(anonymous)\";\nfunction isObject(value) {\n    return (typeof value === \"object\" && value !== null) || typeof value === \"function\";\n}\n/**\n * Determine whether the value is a native function.\n *\n * @param fn - The function to check.\n * @returns `true` is the function is a native function, otherwise `false`\n */\nconst isNativeFunction = (function () {\n    const lookup = new WeakMap();\n    let isNative = false;\n    let sourceText = \"\";\n    let i = 0;\n    return function (fn) {\n        isNative = lookup.get(fn);\n        if (isNative === void 0) {\n            sourceText = fn.toString();\n            i = sourceText.length;\n            // http://www.ecma-international.org/ecma-262/#prod-NativeFunction\n            isNative =\n                // 29 is the length of 'function () { [native code] }' which is the smallest length of a native function string\n                i >= 29 &&\n                    // 100 seems to be a safe upper bound of the max length of a native function. In Chrome and FF it's 56, in Edge it's 61.\n                    i <= 100 &&\n                    // This whole heuristic *could* be tricked by a comment. Do we need to care about that?\n                    sourceText.charCodeAt(i - 1) === 0x7d && // }\n                    // TODO: the spec is a little vague about the precise constraints, so we do need to test this across various browsers to make sure just one whitespace is a safe assumption.\n                    sourceText.charCodeAt(i - 2) <= 0x20 && // whitespace\n                    sourceText.charCodeAt(i - 3) === 0x5d && // ]\n                    sourceText.charCodeAt(i - 4) === 0x65 && // e\n                    sourceText.charCodeAt(i - 5) === 0x64 && // d\n                    sourceText.charCodeAt(i - 6) === 0x6f && // o\n                    sourceText.charCodeAt(i - 7) === 0x63 && // c\n                    sourceText.charCodeAt(i - 8) === 0x20 && //\n                    sourceText.charCodeAt(i - 9) === 0x65 && // e\n                    sourceText.charCodeAt(i - 10) === 0x76 && // v\n                    sourceText.charCodeAt(i - 11) === 0x69 && // i\n                    sourceText.charCodeAt(i - 12) === 0x74 && // t\n                    sourceText.charCodeAt(i - 13) === 0x61 && // a\n                    sourceText.charCodeAt(i - 14) === 0x6e && // n\n                    sourceText.charCodeAt(i - 15) === 0x58; // [\n            lookup.set(fn, isNative);\n        }\n        return isNative;\n    };\n})();\nconst isNumericLookup = {};\nfunction isArrayIndex(value) {\n    switch (typeof value) {\n        case \"number\":\n            return value >= 0 && (value | 0) === value;\n        case \"string\": {\n            const result = isNumericLookup[value];\n            if (result !== void 0) {\n                return result;\n            }\n            const length = value.length;\n            if (length === 0) {\n                return (isNumericLookup[value] = false);\n            }\n            let ch = 0;\n            for (let i = 0; i < length; ++i) {\n                ch = value.charCodeAt(i);\n                if ((i === 0 && ch === 0x30 && length > 1) /* must not start with 0 */ ||\n                    ch < 0x30 /* 0 */ ||\n                    ch > 0x39 /* 9 */) {\n                    return (isNumericLookup[value] = false);\n                }\n            }\n            return (isNumericLookup[value] = true);\n        }\n        default:\n            return false;\n    }\n}\n"],"sourceRoot":"","x_microsoft_symbol_client_key":"a681595825e30da1ed31658df78076a00fbe1489ceda901007a733dc5b34c5dd"}