@shortfuse/materialdesignweb 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../core/css.js", "../core/identify.js", "../utils/jsonMergePatch.js", "../core/dom.js", "../core/observe.js", "../core/template.js", "../core/Composition.js", "../core/ICustomElement.js", "../core/CustomElement.js", "../mixins/DensityMixin.js", "../mixins/ShapeMixin.js", "../mixins/ThemableMixin.js", "../components/Badge.js", "../mixins/FlexableMixin.js", "../components/Box.js", "../components/Body.js", "../mixins/AriaReflectorMixin.js", "../mixins/KeyboardNavMixin.js", "../mixins/AriaToolbarMixin.js", "../mixins/SurfaceMixin.js", "../components/Surface.js", "../components/BottomAppBar.js", "../components/Icon.js", "../mixins/FormAssociatedMixin.js", "../mixins/ControlMixin.js", "../mixins/InputMixin.js", "../core/customTypes.js", "../components/Ripple.js", "../mixins/RippleMixin.js", "../mixins/StateMixin.js", "../components/Button.js", "../components/Card.js", "../components/CheckboxIcon.js", "../mixins/TouchTargetMixin.js", "../components/Checkbox.js", "../components/Chip.js", "../components/Divider.js", "../components/DialogActions.js", "../aria/modal.js", "../components/Dialog.js", "../components/ExtendedFab.js", "../components/Tooltip.js", "../utils/popup.js", "../mixins/TooltipTriggerMixin.js", "../components/Fab.js", "../components/FilterChip.js", "../components/Headline.js", "../components/IconButton.js", "../mixins/TextFieldMixin.js", "../components/Input.js", "../components/Label.js", "../components/Layout.js", "../components/List.js", "../components/RadioIcon.js", "../components/ListItem.js", "../components/ListOption.js", "../dom/ HTMLOptionsCollectionProxy.js", "../components/ListSelect.js", "../components/Menu.js", "../components/MenuItem.js", "../mixins/ScrollListenerMixin.js", "../components/NavItem.js", "../components/Nav.js", "../components/NavBar.js", "../components/NavBarItem.js", "../components/NavRail.js", "../components/NavDrawer.js", "../components/NavDrawerItem.js", "../components/NavRailItem.js", "../components/Pane.js", "../components/Progress.js", "../components/Radio.js", "../components/SegmentedButton.js", "../components/SegmentedButtonGroup.js", "../components/Select.js", "../components/Slider.js", "../components/Snackbar.js", "../components/Shape.js", "../components/SwitchIcon.js", "../components/Switch.js", "../components/Tab.js", "../mixins/RTLObserverMixin.js", "../mixins/ResizeObserverMixin.js", "../components/TabList.js", "../components/TabPanel.js", "../components/TabContent.js", "../components/TextArea.js", "../components/Title.js", "../components/TopAppBar.js", "../theming/loader.js", "../theming/index.js", "../utils/color_keywords.js", "../utils/hct/mathUtils.js", "../utils/hct/colorUtils.js", "../utils/hct/ViewingConditions.js", "../utils/hct/Cam16.js", "../utils/hct/hctSolver.js", "../utils/hct/Hct.js", "../utils/hct/TonalPalette.js", "../utils/hct/CorePalette.js", "../utils/hct/Scheme.js", "../utils/hct/blend.js", "../utils/hct/helper.js", "../utils/svg.js"],
4
- "sourcesContent": ["/**\n * @param {Iterable<HTMLStyleElement|CSSStyleSheet>} styles\n * @yields composed CSSStyleSheet\n * @return {Generator<CSSStyleSheet>} composed CSSStyleSheet\n */\nexport function* generateCSSStyleSheets(styles) {\n for (const style of styles) {\n if (style instanceof HTMLStyleElement) {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(style.textContent);\n yield sheet;\n } else if (style.ownerNode) {\n console.warn('Stylesheet is part of style');\n const sheet = new CSSStyleSheet();\n sheet.replaceSync([...style.cssRules].map((r) => r.cssText).join(''));\n yield sheet;\n } else {\n yield style;\n }\n }\n}\n\n/** @type {WeakMap<CSSStyleSheet, HTMLStyleElement>} */\nconst styleElementWrappers = new WeakMap();\n\n/**\n * @param {Iterable<HTMLStyleElement|CSSStyleSheet>} styles\n * @yields composed HTMLStyleElement\n * @return {Generator<HTMLStyleElement>} composed CSSStyleSheet\n */\nexport function* generateHTMLStyleElements(styles) {\n for (const style of styles) {\n if (style instanceof HTMLStyleElement) {\n yield style;\n } else if (style.ownerNode instanceof HTMLStyleElement) {\n // console.log('Cloning parent HTMLStyleElement instead');\n // @ts-ignore Skip cast\n yield style.ownerNode.cloneNode(true);\n } else {\n let styleElement = styleElementWrappers.get(style);\n if (!styleElement) {\n console.warn('Manually constructing HTMLStyleElement', [...style.cssRules].map((r) => r.cssText).join('\\n'));\n styleElement = document.createElement('style');\n styleElement.textContent = [...style.cssRules].map((r) => r.cssText).join('');\n styleElementWrappers.set(style, styleElement);\n }\n // @ts-ignore Skip cast\n yield styleElement.cloneNode(true);\n }\n }\n}\n", "const PREFIX = '_mdw-';\n\n/** @type {Set<string>} */\nconst generatedUIDs = new Set();\n\n/** @return {string} */\nexport function generateUID() {\n const id = Math.random().toString(36).slice(2, 10);\n if (generatedUIDs.has(id)) {\n return generateUID();\n }\n generatedUIDs.add(id);\n return id;\n}\n\n/**\n * @param {Element} element\n * @param {boolean} [mutate=false]\n * @return {string}\n */\nexport function identifierFromElement(element, mutate) {\n if (element.id) {\n return element.id;\n }\n if (!mutate) {\n return null;\n }\n const id = PREFIX + generateUID();\n element.id = id;\n return id;\n}\n\n/**\n * @param {string} identifier\n * @param {Element} element\n * @return {boolean}\n */\nexport function identifierMatchesElement(identifier, element) {\n return element.id === identifier;\n}\n", "/** @link https://www.rfc-editor.org/rfc/rfc7396 */\n\n/**\n * @template T1\n * @template T2\n * @param {T1} target\n * @param {T2} patch\n * @return {T1|T2|(T1 & T2)}\n */\nexport function applyMergePatch(target, patch) {\n if (target === patch) return target;\n if (patch == null || typeof patch !== 'object') return patch;\n if (target != null && typeof target !== 'object') {\n target = {};\n }\n for (const [key, value] of Object.entries(patch)) {\n if (value == null) {\n if (key in target) {\n delete target[key];\n }\n } else {\n target[key] = applyMergePatch(target[key], value);\n }\n }\n return target;\n}\n\n/**\n * Creates a JSON Merge patch based\n * Allows different strategies for arrays\n * - `clone`: Per spec, clones all entries with no inspection.\n * - `object`: Convert to flattened, array-like objects. Requires\n * consumer of patch to be aware of the schema beforehand.\n * @param {object|number|string|boolean} previous\n * @param {object|number|string|boolean} current\n * @param {'clone'|'object'} [arrayStrategy='clone']\n * @return {any} Patch\n */\nexport function buildMergePatch(previous, current, arrayStrategy = 'clone') {\n if (previous === current) return null;\n if (current == null || typeof current !== 'object') return current;\n if (previous == null || typeof previous !== 'object') {\n return structuredClone(current);\n }\n const isArray = Array.isArray(current);\n if (isArray && arrayStrategy === 'clone') {\n return structuredClone(current);\n }\n\n const patch = {};\n const previousKeys = new Set(Object.keys(previous));\n for (const [key, value] of Object.entries(current)) {\n previousKeys.delete(key);\n if (value == null) {\n console.warn('Nullish value found at', key);\n continue;\n }\n const changes = buildMergePatch(previous[key], value, arrayStrategy);\n if (changes === null) {\n console.log('keeping', key);\n } else {\n patch[key] = changes;\n }\n }\n for (const key of previousKeys) {\n patch[key] = null;\n console.log('removing', key);\n }\n\n if (isArray && arrayStrategy === 'object' && current.length !== previous.length) {\n patch.length = current.length;\n }\n\n return patch;\n}\n\n/**\n * Short-circuited JSON Merge Patch evaluation\n * @template T\n * @param {T} target\n * @param {Partial<T>} patch\n * @return {boolean}\n */\nexport function hasMergePatch(target, patch) {\n if (target === patch) return false;\n if (patch == null || typeof patch !== 'object') return true;\n if (target != null && typeof target !== 'object') {\n return true;\n }\n for (const [key, value] of Object.entries(patch)) {\n if (value == null) {\n if (key in target) {\n return true;\n }\n } else if (hasMergePatch(target[key], value)) {\n return true;\n }\n }\n return false;\n}\n", "/* eslint-disable no-bitwise */\n\n/**\n * @param {any} value\n * @return {?string}\n */\nexport function attrValueFromDataValue(value) {\n switch (value) {\n case undefined:\n case null:\n case false:\n return null;\n case true:\n return '';\n default:\n return `${value}`;\n }\n}\n\n/**\n * Converts property name to attribute name\n * (Similar to DOMStringMap)\n * @param {string} name\n * @return {string}\n */\nexport function attrNameFromPropName(name) {\n const attrNameWords = name.split(/([A-Z])/);\n if (attrNameWords.length === 1) return name;\n return attrNameWords.reduce((prev, curr) => {\n if (prev == null) return curr;\n if (curr.length === 1 && curr.toUpperCase() === curr) {\n return `${prev}-${curr.toLowerCase()}`;\n }\n return prev + curr;\n });\n}\n\nconst IS_FIREFOX = globalThis?.navigator?.userAgent.includes('Firefox');\n\n/**\n * @param {Element} element\n * @return {boolean}\n */\nexport function isFocused(element) {\n if (!element) return false;\n if (IS_FIREFOX && element.constructor.formAssociated && element.hasAttribute('disabled')) {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1818287\n console.warn('Firefox bug 1818287: Disabled form associated custom element cannot receive focus.');\n return false;\n }\n if (document.activeElement === element) return true;\n if (!element.isConnected) return false;\n if (element?.getRootNode() === document) return false; // isInLightDOM\n // console.debug('checking shadowdom', element, element.matches(':focus'));\n return element.matches(':focus');\n}\n\n/**\n * @param {HTMLElement|Element} element\n * @param {Parameters<HTMLElement['focus']>} [options]\n * @return {boolean} Focus was successful\n */\nexport function attemptFocus(element, ...options) {\n if (!element) return false;\n try {\n // @ts-expect-error Use catch if not HTMLElement\n element.focus(...options);\n } catch (e) {\n console.error(e);\n return false;\n // Ignore error.\n }\n return isFocused(element);\n}\n\n/**\n * @param {Element} element\n * @return {boolean}\n */\nexport function isRtl(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n", "import { buildMergePatch, hasMergePatch } from '../utils/jsonMergePatch.js';\n\nimport { attrNameFromPropName } from './dom.js';\n\n/** @typedef {import('./typings.js').ObserverPropertyType} ObserverPropertyType */\n\n/** @return {null} */\nconst DEFAULT_NULL_PARSER = () => null;\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion\n * @param {any} v\n * @return {boolean}\n */\nconst DEFAULT_BOOLEAN_PARSER = (v) => !!v;\n\n/**\n * Doesn't support `BigInt` types\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion\n * @param {any} v\n * @return {number}\n */\nconst DEFAULT_NUMBER_PARSER = (v) => +v;\n\n/**\n * Doesn't support `Symbol` types\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion\n * @param {any} v\n * @return {string}\n */\nconst DEFAULT_STRING_PARSER = (v) => `${v}`;\n\n/**\n * @template T\n * @param {T} o\n * @return {T}\n */\nconst DEFAULT_OBJECT_PARSER = (o) => o;\n\n/**\n * @template T\n * @param {T} a\n * @param {T} b\n * @return {boolean} true if equal\n */\nexport const DEFAULT_OBJECT_COMPARATOR = (a, b) => !hasMergePatch(a, b);\n\n/**\n * @template T\n * @param {T} a\n * @param {T} b\n * @return {boolean} true if equal\n */\nexport const DEFAULT_OBJECT_DIFF = (a, b) => buildMergePatch(a, b, 'object');\n\n/**\n * @param {ObserverPropertyType} type\n * @return {any}\n */\nfunction emptyFromType(type) {\n switch (type) {\n case 'boolean':\n return false;\n case 'integer':\n case 'float':\n return 0;\n case 'map':\n return new Map();\n case 'set':\n return new Set();\n case 'array':\n return [];\n case 'object':\n return null;\n default:\n case 'string':\n return '';\n }\n}\n\n/**\n * @param {ObserverPropertyType} type\n * @return {any}\n */\nfunction defaultParserFromType(type) {\n switch (type) {\n case 'boolean':\n return DEFAULT_BOOLEAN_PARSER;\n case 'integer':\n // Calls ToNumber(x)\n return Math.round;\n case 'float':\n return DEFAULT_NUMBER_PARSER;\n case 'map':\n return Map;\n case 'set':\n return Set;\n case 'object':\n return DEFAULT_OBJECT_PARSER;\n case 'array':\n return Array.from;\n default:\n case 'string':\n return DEFAULT_STRING_PARSER;\n }\n}\n\n/**\n * @template {string} K\n * @template {ObserverPropertyType} [T1=any]\n * @template {any} [T2=import('./typings.js').ParsedObserverPropertyType<T1>]\n * @param {K} name\n * @param {T1|import('./typings.js').ObserverOptions<T1,T2>} [typeOrOptions='string']\n * @param {any} object\n * @return {import('./typings.js').ObserverConfiguration<T1,T2,K> & import('./typings.js').ObserverOptions<T1,T2>}\n */\nexport function parseObserverOptions(name, typeOrOptions, object) {\n /** @type {Partial<import('./typings.js').ObserverOptions<T1,T2>>} */\n const options = {\n ...((typeof typeOrOptions === 'string') ? { type: typeOrOptions } : typeOrOptions),\n };\n\n let { enumerable, attr, reflect } = options;\n const { type, empty, changedCallback } = options;\n\n /** @type {ObserverPropertyType} */\n let parsedType = type;\n if (parsedType == null) {\n // Use .value or .get() to parse type\n const value = options.value ?? empty ?? options.get?.call(object ?? {}, object ?? {});\n if (value == null) {\n parsedType = 'string';\n } else {\n const parsed = typeof value;\n parsedType = (parsed === 'number')\n ? (Number.isInteger(value) ? 'integer' : 'number')\n : parsed;\n }\n }\n\n enumerable ??= name[0] !== '_';\n reflect ??= enumerable ? parsedType !== 'object' : (attr ? 'write' : false);\n attr ??= (reflect ? attrNameFromPropName(name) : null);\n\n // if defined ? value\n // else if boolean ? false\n // else if onNullish ? false\n // else if empty == null\n const parser = options.parser ?? defaultParserFromType(parsedType);\n let nullParser = options.nullParser;\n let parsedEmpty = empty ?? null;\n if (!nullParser) {\n const nullable = options.nullable ?? (\n parsedType === 'boolean'\n ? false\n : (empty == null));\n if (nullable) {\n nullParser = DEFAULT_NULL_PARSER;\n } else {\n parsedEmpty ??= emptyFromType(parsedType);\n nullParser = parsedEmpty === null ? () => emptyFromType(parsedType) : () => parsedEmpty;\n }\n }\n\n let isFn = options.is;\n if (!isFn) {\n isFn = parsedType === 'object'\n ? DEFAULT_OBJECT_COMPARATOR\n : Object.is;\n }\n\n const diff = 'diff' in options\n ? options.diff\n : ((parsedType === 'object') ? DEFAULT_OBJECT_DIFF : null);\n\n return {\n ...options,\n type: parsedType,\n is: isFn,\n diff,\n attr,\n reflect,\n readonly: options.readonly ?? false,\n enumerable,\n value: options.value ?? parsedEmpty,\n parser,\n nullParser,\n key: name,\n changedCallback,\n watchers: options.watchers ?? [],\n values: options.values ?? new WeakMap(),\n validValues: options.validValues ?? new WeakMap(),\n attributeChangedCallback: options.attributeChangedCallback,\n };\n}\n\nconst INIT_SYMBOL = Symbol('PROP_INIT');\n\n/** @type {Partial<import('./typings.js').ObserverConfiguration<?,?,?>>} */\nconst DEFAULT_OBSERVER_CONFIGURATION = {\n nullParser: DEFAULT_NULL_PARSER,\n is: Object.is,\n INIT_SYMBOL,\n};\n\n/**\n * @this {import('./typings.js').ObserverConfiguration<?,?,?>}\n * @param {*} value\n */\nexport function parsePropertyValue(value) {\n let newValue = value;\n newValue = value == null\n ? this.nullParser.call(this, value)\n : this.parser.call(this, newValue);\n}\n\n/**\n * @param {(data: Partial<any>) => any} fn\n * @param {any} arg0\n * @param {any} args[]\n * @param {...any} args\n * @this {any}\n * @return {{props:Set<string>, defaultValue:any, reusable: boolean}}\n */\nexport function observeFunction(fn, arg0, ...args) {\n const argPoked = new Set();\n const thisPoked = new Set();\n\n /**\n * @template {Object} T\n * @param {T} proxyTarget\n * @param {Set<string>} set\n * @param {string} [prefix]\n * @return {T}\n */\n function buildProxy(proxyTarget, set, prefix) {\n return new Proxy(proxyTarget, {\n get(target, p) {\n const arg = prefix ? `${prefix}.${p}` : p;\n set.add(arg);\n const value = Reflect.get(target, p);\n if (typeof value === 'object' && value != null) {\n console.debug('tried to arg poke object get', p, value);\n return buildProxy(value, set, arg);\n }\n return value;\n },\n has(target, p) {\n const arg = prefix ? `${prefix}.p` : p;\n set.add(arg);\n const value = Reflect.has(target, p);\n return value;\n },\n });\n }\n\n const argProxy = buildProxy(arg0, argPoked);\n const thisProxy = buildProxy(this ?? arg0, thisPoked);\n const defaultValue = fn.call(thisProxy, argProxy, ...args);\n /* Arrow functions can reused if they don't poke `this` */\n const reusable = fn.name ? true : !thisPoked.size;\n\n const props = new Set([\n ...argPoked,\n ...thisPoked,\n ]);\n\n return {\n props,\n defaultValue,\n reusable,\n };\n}\n\n/**\n * @template {ObserverPropertyType} T1\n * @template {any} T2\n * @template {string} K\n * @template [C=any]\n * @param {C} object\n * @param {K} key\n * @param {import('./typings.js').ObserverOptions<T1, T2, C>} options\n * @return {import('./typings.js').ObserverConfiguration<T1,T2,K,C>}\n */\nexport function defineObservableProperty(object, key, options) {\n /** @type {import('./typings.js').ObserverConfiguration<T1,T2,K,C>} */\n const config = {\n ...DEFAULT_OBSERVER_CONFIGURATION,\n ...parseObserverOptions(key, options, object),\n changedCallback: options.changedCallback,\n };\n\n /**\n * @param {T2} oldValue\n * @param {T2} value\n * @param {boolean} [commit=false]\n * @return {boolean} changed\n */\n function detectChange(oldValue, value, commit) {\n if (oldValue === value) return false;\n if (config.get) {\n // TODO: Custom getter vs parser\n }\n let newValue = value;\n newValue = (value == null)\n ? config.nullParser.call(this, value)\n : config.parser.call(this, newValue);\n\n let changes = newValue;\n if (oldValue == null) {\n if (newValue == null) return false; // Both nullish\n } else if (newValue != null) {\n if (oldValue === newValue) return false;\n if (config.diff) {\n changes = config.diff.call(this, oldValue, newValue);\n if (changes == null) return false;\n }\n if (config.is.call(this, oldValue, newValue)) return false;\n }\n\n // Before changing, store old values of properties that will invalidate;\n\n // Do no set if transient (getter)\n\n config.values.set(this, newValue);\n // console.log(key, 'value.set', newValue);\n config.propChangedCallback?.call(this, key, oldValue, newValue, changes);\n config.changedCallback?.call(this, oldValue, newValue, changes);\n return true;\n }\n /**\n * @this {C}\n * @return {T2}\n */\n function internalGet() {\n return config.values.has(this) ? config.values.get(this) : config.value;\n }\n\n /**\n * @this {C}\n * @param {T2} value\n * @return {void}\n */\n function internalSet(value) {\n const oldValue = this[key];\n // console.log(key, 'internalSet', oldValue, '=>', value);\n detectChange.call(this, oldValue, value, true);\n }\n\n /**\n *\n */\n function onInvalidate() {\n // console.log(key, 'onInvalidate', '???');\n const oldValue = config.validValues.get(this);\n const newValue = this[key];\n // console.log(key, 'onInvalidate', oldValue, '=>', newValue);\n detectChange.call(this, oldValue, newValue);\n }\n\n if (config.get) {\n const { props } = observeFunction(config.get.bind(object), object, internalGet.bind(object));\n // Set of watchers needed\n // console.log(key, 'invalidates with', props);\n config.watchers.push(\n ...[...props].map((prop) => [prop, onInvalidate]),\n );\n }\n /** @type {Partial<PropertyDescriptor>} */\n const descriptor = {\n enumerable: config.enumerable,\n /**\n * @this {C}\n * @return {T2}\n */\n get() {\n if (config.get) {\n const newValue = config.get.call(this, this, internalGet.bind(this));\n // Store value internally. Used by onInvalidate to get previous value\n config.validValues.set(this, newValue);\n return newValue;\n }\n return internalGet.call(this);\n },\n /**\n * @this {C}\n * @param {T2} value\n * @return {void}\n */\n set(value) {\n if (value === INIT_SYMBOL) {\n // console.log(key, 'returning due to INIT');\n return;\n }\n if (config.set) {\n const oldValue = this[key];\n config.set.call(this, value, internalSet.bind(this));\n const newValue = this[key];\n // Invalidate self\n detectChange.call(this, oldValue, newValue);\n } else {\n internalSet.call(this, value);\n }\n },\n };\n\n Object.defineProperty(object, key, descriptor);\n\n return config;\n}\n", "import { generateUID } from './identify.js';\n\n/**\n * Property are bound to an ID+Node\n * Values are either getter or via an function\n * @template {any} T\n * @typedef {Object} InlineFunctionEntry\n * @prop {(data:T) => any} fn\n * @prop {Set<keyof T & string>} [props]\n * @prop {T} [defaultValue]\n */\n\n/** @type {Document} */\nlet _inactiveDocument;\n\n/** @type {boolean} */\nlet _cssStyleSheetConstructable;\n\n/**\n * @param {string} [fromString]\n * @return {DocumentFragment}\n */\nexport function generateFragment(fromString) {\n _inactiveDocument ??= document.implementation.createHTMLDocument();\n if (fromString == null) {\n return _inactiveDocument.createDocumentFragment();\n }\n return _inactiveDocument.createRange().createContextualFragment(fromString);\n}\n\n/** @type {Map<string, InlineFunctionEntry<?>>} */\nexport const inlineFunctions = new Map();\n\n/**\n * @template T\n * @typedef {Object} RenderOptions\n * @prop {Object} context\n * @prop {ParentNode} root\n * @prop {Object<string, HTMLElement>} refs\n */\n\n/**\n * @param {(data: Partial<any>) => any} fn\n * @return {string}\n */\nexport function addInlineFunction(fn) {\n const internalName = `#${generateUID()}`;\n inlineFunctions.set(internalName, { fn });\n return `{${internalName}}`;\n}\n\n/** @type {Map<string, CSSStyleSheet>} */\nconst cssStyleSheetsCache = new Map();\n\n/** @type {Map<string, HTMLStyleElement>} */\nconst styleElementCache = new Map();\n\n/**\n * @param {TemplateStringsArray} array\n * @param {...(string)} substitutions\n * @return {HTMLStyleElement|CSSStyleSheet}\n */\nexport function css(array, ...substitutions) {\n const content = String.raw({ raw: array }, ...substitutions);\n\n if (_cssStyleSheetConstructable == null) {\n try {\n const sheet = new CSSStyleSheet();\n _cssStyleSheetConstructable = true;\n sheet.replaceSync(content);\n cssStyleSheetsCache.set(content, sheet);\n return sheet;\n } catch {\n _cssStyleSheetConstructable = false;\n }\n }\n\n if (_cssStyleSheetConstructable) {\n let sheet = cssStyleSheetsCache.get(content);\n if (!sheet) {\n sheet = new CSSStyleSheet();\n _cssStyleSheetConstructable = true;\n sheet.replaceSync(content);\n cssStyleSheetsCache.set(content, sheet);\n }\n return sheet;\n }\n\n let style = styleElementCache.get(content);\n if (!style) {\n _inactiveDocument ??= document.implementation.createHTMLDocument();\n style = _inactiveDocument.createElement('style');\n style.textContent = content;\n styleElementCache.set(content, style);\n }\n return /** @type {HTMLStyleElement} */ (style.cloneNode(true));\n}\n\n/** @type {Map<string, DocumentFragment>} */\nconst fragmentCache = new Map();\n/**\n * @template T1\n * @template T2\n * @param {TemplateStringsArray} strings\n * @param {...(string|DocumentFragment|Element|((this:T1, data:T2) => any))} substitutions\n * @return {DocumentFragment}\n */\nexport function html(strings, ...substitutions) {\n /** @type {Map<string, DocumentFragment|Element>} */\n let tempSlots;\n const replacements = substitutions.map((sub) => {\n switch (typeof sub) {\n case 'string': return sub;\n case 'function': return addInlineFunction(sub);\n case 'object': {\n if (sub == null) {\n console.warn(sub, 'is null', strings);\n return '';\n }\n // Assume Element\n const tempId = generateUID();\n tempSlots ??= new Map();\n tempSlots.set(tempId, sub);\n return `<div id=\"${tempId}\"></div>`;\n }\n default:\n throw new Error(`Unexpected substitution: ${sub}`);\n }\n });\n const compiledString = String.raw({ raw: strings }, ...replacements);\n\n if (tempSlots) {\n const fragment = generateFragment(compiledString);\n for (const [id, element] of tempSlots) {\n const slot = fragment.getElementById(id);\n slot.replaceWith(element);\n }\n return fragment;\n }\n\n let fragment = fragmentCache.get(compiledString);\n if (!fragment) {\n fragment = generateFragment(compiledString);\n fragmentCache.set(compiledString, fragment);\n }\n\n return /** @type {DocumentFragment} */ (fragment.cloneNode(true));\n}\n", "/* eslint-disable sort-class-members/sort-class-members */\nimport { generateCSSStyleSheets, generateHTMLStyleElements } from './css.js';\nimport { identifierFromElement } from './identify.js';\nimport { observeFunction } from './observe.js';\nimport { generateFragment, inlineFunctions } from './template.js';\n\n/**\n * @template T\n * @typedef {Composition<?>|HTMLStyleElement|CSSStyleSheet|DocumentFragment|((this:T, changes:T) => any)|string} CompositionPart\n */\n\n/**\n * @template {any} T\n * @callback Compositor\n * @param {...(CompositionPart<T>)} parts source for interpolation (not mutated)\n * @return {Composition<T>}\n */\n\n/**\n * @template T\n * @typedef {Object} WatcherBindEntry\n * @prop {Function} fn\n * @prop {Set<keyof T & string>} props\n */\n\n/**\n * @template {any} T\n * @typedef {Object} NodeBindEntry\n * @prop {string} id\n * @prop {number} nodeType\n * @prop {string} node\n * @prop {boolean} [negate]\n * @prop {boolean} [doubleNegate]\n * @prop {Function} [fn]\n * @prop {Set<keyof T & string>} props\n * @prop {T} defaultValue\n */\n\n/** Splits: `{template}text{template}` as `['', 'template', 'text', 'template', '']` */\nconst STRING_INTERPOLATION_REGEX = /{([^}]*)}/g;\n\n/**\n * Returns event listener bound to shadow root host.\n * Use this function to avoid generating extra closures\n * @this {HTMLElement}\n * @param {Function} fn\n */\nfunction buildShadowRootChildListener(fn) {\n /** @param {Event & {currentTarget:{getRootNode: () => ShadowRoot}}} event */\n return function onShadowRootChildEvent(event) {\n const host = event.currentTarget.getRootNode().host;\n fn.call(host, event);\n };\n}\n\n/**\n *\n * @param {Object} object\n * @param {'dot'|'bracket'} [syntax]\n * @param {Object} [target]\n * @param {string} [scope]\n * @return {Object}\n */\nfunction flattenObject(object, syntax = 'dot', target = {}, scope = '') {\n for (const [key, value] of Object.entries(object)) {\n if (!key) continue; // Blank keys are not supported;\n const scopedKey = scope ? `${scope}.${key}` : key;\n target[scopedKey] = value;\n if (value != null && typeof value === 'object') {\n flattenObject(value, syntax, target, scopedKey);\n }\n }\n if (Array.isArray(object)) {\n const scopedKey = scope ? `${scope}.length` : 'length';\n target[scopedKey] = object.length;\n }\n return target;\n}\n\n/**\n * @example\n * entryFromPropName(\n * 'address.home.houseNumber',\n * {\n * address: {\n * home: {\n * houseNumber:35,\n * },\n * }\n * }\n * ) === {value:35}\n * @param {string} prop\n * @param {any} source\n * @return {null|[string, any]}\n */\nfunction entryFromPropName(prop, source) {\n let value = source;\n let child;\n for (child of prop.split('.')) {\n if (!child) throw new Error(`Invalid property: ${prop}`);\n if (child in value === false) return null;\n // @ts-ignore Skip cast\n value = value[child];\n }\n if (value === source) return null;\n return [child, value];\n}\n\n/**\n * @param {string} prop\n * @param {any} source\n * @return {any}\n */\nfunction valueFromPropName(prop, source) {\n let value = source;\n for (const child of prop.split('.')) {\n if (!child) return null;\n // @ts-ignore Skip cast\n value = value[child];\n if (value == null) return null;\n }\n if (value === source) return null;\n return value;\n}\n\n/** @template T */\nexport default class Composition {\n /**\n * Collection of property bindings.\n * @type {Map<keyof T & string, Set<NodeBindEntry<?>>>}\n */\n bindings = new Map();\n\n /**\n * Data of arrays used in templates\n * Usage of a [_for] will create an ArrayLike expectation based on key\n * Only store metadata, not actual data. Currently only needs length.\n * TBD if more is needed later\n * Referenced by property key (string)\n * @type {Map<keyof T & string, ArrayMetadata<T>}\n */\n arrayMetadata = new Map();\n\n /**\n * Collection of events to bind.\n * Indexed by ID\n * @type {Map<string, Set<import('./typings.js').CompositionEventListener<any>>>}\n */\n events = new Map();\n\n /**\n * Snapshot of composition at initial state.\n * This fragment can be cloned for first rendering, instead of calling\n * of using `render()` to construct the initial DOM tree.\n * @type {DocumentFragment}\n */\n cloneable;\n\n /**\n * Result of interpolation of the composition template.\n * Includes all DOM elements, which is used to reference for adding and\n * removing DOM elements during render.\n * @type {DocumentFragment}\n */\n interpolation;\n\n /** @type {(HTMLStyleElement|CSSStyleSheet)[]} */\n styles = [];\n\n /** @type {CSSStyleSheet[]} */\n adoptedStyleSheets = [];\n\n /** @type {DocumentFragment} */\n stylesFragment;\n\n /** @type {((this:T, changes:T) => any)[]} */\n watchers = [];\n\n /**\n * Maintains a reference list of elements used by render target (root).\n * When root is garbage collected, references are released.\n * This includes disconnected elements.\n * @type {WeakMap<Element|DocumentFragment, Map<string,HTMLElement>>}\n */\n referenceCache = new WeakMap();\n\n /**\n * Part of interpolation phase.\n * Maintains a reference list of conditional elements that were removed from\n * `cloneable` due to default state. Used to reconstruct conditional elements\n * with conditional children in default state as well (unlike `interpolation`).\n * @type {Map<string, {element: Element, id: string, parentId: string, commentCache: WeakMap<Element|DocumentFragment,Comment>}>}\n */\n conditionalElementMetadata = new Map();\n\n /** Flag set when template and styles have been interpolated */\n interpolated = false;\n\n /**\n * @param {(CompositionPart<T>)[]} parts\n */\n constructor(...parts) {\n /**\n * Template used to build interpolation and cloneable\n */\n this.template = generateFragment();\n this.append(...parts);\n }\n\n * [Symbol.iterator]() {\n for (const part of this.styles) {\n yield part;\n }\n yield this.template;\n for (const part of this.watchers) {\n yield part;\n }\n }\n\n /**\n * @param {CompositionPart<T>[]} parts\n */\n append(...parts) {\n for (const part of parts) {\n if (typeof part === 'string') {\n this.append(generateFragment(part.trim()));\n } else if (typeof part === 'function') {\n this.watchers.push(part);\n } else if (part instanceof Composition) {\n this.append(...part);\n } else if (part instanceof DocumentFragment) {\n this.template.append(part);\n } else if (part instanceof CSSStyleSheet || part instanceof HTMLStyleElement) {\n this.styles.push(part);\n }\n }\n // Allow chaining\n return this;\n }\n\n /** @param {import('./typings.js').CompositionEventListener<T>} listener */\n addCompositionEventListener(listener) {\n const key = listener.id ?? '';\n let set = this.events.get(key);\n if (!set) {\n set = new Set();\n this.events.set(key, set);\n }\n set.add(listener);\n return this;\n }\n\n /**\n * Updates component nodes based on data.\n * Expects data in JSON Merge Patch format\n * @see https://www.rfc-editor.org/rfc/rfc7386\n * @param {DocumentFragment|ShadowRoot} root where\n * @param {Partial<?>} changes what\n * @param {any} [context] who\n * @param {Partial<?>} [store] If needed, where to grab extra props\n * @return {void}\n */\n render(root, changes, context, store) {\n if (!this.initiallyRendered) this.initialRender(root, changes);\n\n if (!changes) return;\n\n const fnResults = new WeakMap();\n /** @type {WeakMap<Element, Set<string>>} */\n const modifiedNodes = new WeakMap();\n\n // Iterate data instead of bindings.\n // TODO: Avoid double iteration and flatten on-the-fly\n const flattened = flattenObject(changes);\n\n for (const [key, rawValue] of Object.entries(flattened)) {\n const entries = this.bindings.get(key);\n if (!entries) continue;\n for (const { id, node, nodeType, fn, props, negate, doubleNegate } of entries) {\n /* 1. Find Element */\n\n // TODO: Avoid unnecessary element creation.\n // If element can be fully reconstructed with internal properties,\n // skip recreation of element unless it actually needs to added to DOM.\n // Requires tracing of all properties used by conditional elements.\n const ref = this.getElement(root, id);\n if (!ref) {\n console.warn('Non existent id', id);\n continue;\n }\n if (!ref) continue;\n if (modifiedNodes.get(ref)?.has(node)) {\n // console.warn('Node already modified. Skipping', id, node);\n continue;\n }\n\n // if (!ref.parentElement && node !== '_if') {\n // if (ref.parentNode === root) {\n // console.debug('Offscreen? root? rendering', ref, node, ref.id, root.host.outerHTML);\n // } else {\n // console.debug('Offscreen rendering', ref, node, ref.id, root.host.outerHTML);\n // }\n // }\n\n /* 2. Compute value */\n let value;\n if (fn) {\n if (fnResults.has(fn)) {\n value = fnResults.get(fn);\n } else {\n const args = structuredClone(changes);\n for (const prop of props) {\n if (prop in flattened) continue;\n let lastIndexOfDot = prop.lastIndexOf('.');\n if (lastIndexOfDot === -1) {\n // console.debug('injected shallow', prop);\n args[prop] = store[prop];\n } else {\n // Relying on props being sorted...\n console.debug('need deep', prop);\n let entry;\n let propSearchKey = prop;\n let lastPropSearchKey = prop;\n while (!entry) {\n entry = entryFromPropName(propSearchKey, args);\n if (entry) {\n const propName = lastPropSearchKey.slice(propSearchKey.length + 1);\n entry[1][propName] = valueFromPropName(lastPropSearchKey, store);\n break;\n }\n if (lastIndexOfDot === -1) break;\n lastPropSearchKey = prop;\n propSearchKey = prop.slice(0, lastIndexOfDot);\n lastIndexOfDot = propSearchKey.lastIndexOf(',');\n }\n if (!entry) {\n console.warn('what do?');\n }\n }\n }\n value = fn.call(context, args);\n fnResults.set(fn, value);\n }\n } else {\n value = rawValue;\n }\n\n /* 3. Operate on value */\n if (doubleNegate) {\n value = !!value;\n } else if (negate) {\n value = !value;\n }\n\n /* 4. Find Target Node */\n if (nodeType === Node.TEXT_NODE) {\n const index = (node === '#text')\n ? 0\n : Number.parseInt(node.slice('#text'.length), 10);\n let nodesFound = 0;\n for (const childNode of ref.childNodes) {\n if (childNode.nodeType !== Node.TEXT_NODE) continue;\n if (index !== nodesFound++) continue;\n childNode.nodeValue = value ?? '';\n break;\n }\n if (index > nodesFound) {\n console.warn('Node not found, adding?');\n ref.append(value);\n }\n } else if (node === '_if') {\n const attached = root.contains(ref);\n const orphaned = ref.parentElement == null && ref.parentNode !== root;\n const shouldShow = value !== null && value !== false;\n if (orphaned && ref.parentNode) {\n console.warn('Orphaned with parent node?', id, { attached, orphaned, shouldShow }, ref.parentNode);\n }\n if (attached !== !orphaned) {\n console.warn('Conditional state', id, { attached, orphaned, shouldShow });\n console.warn('Not attached and not orphaned. Should do nothing?', ref, ref.parentElement);\n }\n if (shouldShow) {\n if (orphaned) {\n const metadata = this.conditionalElementMetadata.get(id);\n if (!metadata) {\n console.error(id);\n throw new Error('Could not find conditional element metadata');\n }\n\n let comment = metadata.commentCache.get(root);\n if (!comment) {\n console.debug('Composition: Comment not cached, building first time');\n const parent = metadata.parentId\n ? this.getElement(root, metadata.parentId)\n : root;\n if (!parent) {\n console.error(id);\n throw new Error('Could not find reference parent!');\n }\n\n const commentText = `{#${id}}`;\n for (const child of parent.childNodes) {\n if (child.nodeType !== Node.COMMENT_NODE) continue;\n if ((/** @type {Comment} */child).nodeValue === commentText) {\n comment = child;\n break;\n }\n }\n metadata.commentCache.set(this, comment);\n }\n if (comment) {\n console.debug('Composition: Add', id, 'back', ref.outerHTML);\n comment.replaceWith(ref);\n } else {\n console.warn('Could not add', id, 'back to parent');\n }\n }\n } else if (!orphaned) {\n const metadata = this.conditionalElementMetadata.get(id);\n if (!metadata) {\n console.error(id);\n throw new Error(`Could not find conditional element metadata for ${id}`);\n }\n let comment = metadata.commentCache.get(root);\n if (!comment) {\n comment = new Comment(`{#${id}}`);\n metadata.commentCache.set(this, comment);\n }\n console.debug('Composition: Remove', id, ref.outerHTML);\n ref.replaceWith(comment);\n }\n } else if (value === false || value == null) {\n ref.removeAttribute(node);\n } else {\n ref.setAttribute(node, value === true ? '' : value);\n }\n\n /* 5. Mark Node as modified */\n let set = modifiedNodes.get(ref);\n if (!set) {\n set = new Set();\n modifiedNodes.set(ref, set);\n }\n set.add(node);\n }\n }\n }\n\n /**\n * @param {Attr|Text} node\n * @param {Element} element\n * @param {Object} [defaults]\n * @param {string} [parsedValue]\n * @return {boolean} Remove node\n */\n #interpolateNode(node, element, defaults, parsedValue) {\n const { nodeValue, nodeName, nodeType } = node;\n\n if (parsedValue == null) {\n if (!nodeValue) return false;\n const trimmed = nodeValue.trim();\n if (!trimmed) return false;\n if (nodeType === Node.ATTRIBUTE_NODE) {\n if (trimmed[0] !== '{') return false;\n const { length } = trimmed;\n if (trimmed[length - 1] !== '}') return false;\n parsedValue = trimmed.slice(1, -1);\n } else {\n // Split text node into segments\n // TODO: Benchmark indexOf pre-check vs regex\n\n const segments = trimmed.split(STRING_INTERPOLATION_REGEX);\n if (segments.length < 3) return false;\n if (segments.length === 3 && !segments[0] && !segments[2]) {\n parsedValue = segments[1];\n } else {\n segments.forEach((segment, index) => {\n // is even = is template string\n if (index % 2) {\n const newNode = new Text();\n node.before(newNode);\n this.#interpolateNode(newNode, element, defaults, segment);\n } else {\n if (!segment) return; // blank\n node.before(segment);\n }\n });\n // node.remove();\n return true;\n }\n }\n }\n\n const negate = parsedValue[0] === '!';\n let doubleNegate = false;\n if (negate) {\n parsedValue = parsedValue.slice(1);\n doubleNegate = parsedValue[0] === '!';\n if (doubleNegate) {\n parsedValue = parsedValue.slice(1);\n }\n }\n\n let isEvent;\n let textNodeIndex;\n\n if (nodeType === Node.TEXT_NODE) {\n // eslint-disable-next-line unicorn/consistent-destructuring\n if (element !== node.parentElement) {\n console.warn('mismatch?');\n element = node.parentElement;\n }\n textNodeIndex = 0;\n let prev = node;\n while ((prev = prev.previousSibling)) {\n if (prev.nodeType === Node.TEXT_NODE) {\n textNodeIndex++;\n }\n }\n } else {\n // @ts-ignore Skip cast\n // eslint-disable-next-line unicorn/consistent-destructuring\n if (element !== node.ownerElement) {\n console.warn('mismatch?');\n element = node.ownerElement;\n }\n if (nodeName.startsWith('on')) {\n // Do not interpolate inline event listeners\n if (nodeName[2] !== '-') return false;\n isEvent = true;\n }\n }\n\n const id = identifierFromElement(element, true);\n\n if (isEvent) {\n const eventType = nodeName.slice(3);\n const [, flags, type] = eventType.match(/^([*1~]+)?(.*)$/);\n const options = {\n once: flags?.includes('1'),\n passive: flags?.includes('~'),\n capture: flags?.includes('*'),\n };\n\n element.removeAttribute(nodeName);\n\n let set = this.events.get(id);\n if (!set) {\n set = new Set();\n this.events.set(id, set);\n }\n if (parsedValue.startsWith('#')) {\n set.add({ type, handleEvent: inlineFunctions.get(parsedValue).fn, ...options });\n } else {\n set.add({ type, prop: parsedValue, ...options });\n }\n return false;\n }\n\n /** @type {Function} */\n let fn;\n /** @type {Set<string>} */\n let props;\n\n /** @type {any} */\n let defaultValue;\n let inlineFunctionOptions;\n // Is Inline Function?\n if (parsedValue.startsWith('#')) {\n inlineFunctionOptions = inlineFunctions.get(parsedValue);\n if (!inlineFunctionOptions) {\n console.warn(`Invalid interpolation value: ${parsedValue}`);\n return false;\n }\n if (inlineFunctionOptions.props) {\n console.log('This function has already been called. Reuse props', inlineFunctionOptions, this);\n props = inlineFunctionOptions.props;\n defaultValue = inlineFunctionOptions.defaultValue ?? null;\n } else {\n defaultValue = inlineFunctionOptions.fn;\n }\n } else {\n defaultValue = valueFromPropName(parsedValue, defaults);\n }\n\n if (!props) {\n if (typeof defaultValue === 'function') {\n // Value must be reinterpolated and function observed\n const observeResult = observeFunction.call(this, defaultValue, defaults);\n fn = defaultValue;\n defaultValue = observeResult.defaultValue;\n props = observeResult.props;\n // console.log(this.static.name, fn.name || parsedValue, combinedSet);\n } else {\n props = new Set([parsedValue]);\n }\n }\n\n if (typeof defaultValue === 'symbol') {\n console.warn(': Invalid binding:', parsedValue);\n defaultValue = null;\n }\n\n if (doubleNegate) {\n defaultValue = !!defaultValue;\n } else if (negate) {\n defaultValue = !defaultValue;\n }\n\n if (inlineFunctionOptions) {\n inlineFunctionOptions.defaultValue = defaultValue;\n inlineFunctionOptions.props = props;\n }\n\n // Bind\n const parsedNodeName = textNodeIndex ? nodeName + textNodeIndex : nodeName;\n const entry = { id, node: parsedNodeName, fn, props, nodeType, defaultValue, negate, doubleNegate };\n for (const prop of props) {\n let set = this.bindings.get(prop);\n if (!set) {\n set = new Set();\n this.bindings.set(prop, set);\n }\n set.add(entry);\n }\n\n // Mutate\n\n if (nodeType === Node.TEXT_NODE) {\n node.nodeValue = defaultValue ?? '';\n } else if (nodeName === '_if') {\n element.removeAttribute(nodeName);\n if (defaultValue == null || defaultValue === false) {\n // If default state is removed, mark for removal\n return true;\n }\n } else if (defaultValue == null || defaultValue === false) {\n element.removeAttribute(nodeName);\n } else {\n element.setAttribute(nodeName, defaultValue === true ? '' : defaultValue);\n }\n return false;\n }\n\n /**\n * @param {Object} [defaults]\n */\n interpolate(defaults) {\n // console.log('Template', [...this.template.children].map((child) => child.outerHTML).join('\\n'));\n\n // Copy template before working on it\n // Store into `cloneable` to split later into `interpolation`\n this.cloneable = /** @type {DocumentFragment} */ (this.template.cloneNode(true));\n\n /**\n * Track elements to be removed before using for cloning\n * @type {Element[]}\n */\n const removalList = [];\n\n const TREE_WALKER_FILTER = 5; /* NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT */\n\n const treeWalker = document.createTreeWalker(this.cloneable, TREE_WALKER_FILTER);\n let node = treeWalker.nextNode();\n while (node) {\n /** @type {Element} */\n let element = null;\n let removeElement = false;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n element = node;\n if (element instanceof HTMLTemplateElement) {\n node = treeWalker.nextSibling();\n continue;\n }\n if (node instanceof HTMLStyleElement) {\n // Move style elements out of cloneable\n if (node.parentNode === this.cloneable) {\n this.styles.push(node);\n node.remove();\n node = treeWalker.nextSibling();\n continue;\n }\n console.warn('<style> element not moved');\n }\n if (node instanceof HTMLScriptElement) {\n console.warn('<script> element found.');\n node.remove();\n node = treeWalker.nextSibling();\n continue;\n }\n for (const attr of [...element.attributes].reverse()) {\n if (attr.nodeName === '_if') {\n // Ensure elements to be removed has identifiable parent\n const id = identifierFromElement(element, true);\n const parentId = element.parentElement\n ? identifierFromElement(element.parentElement, true)\n : null;\n this.conditionalElementMetadata.set(id, {\n element,\n id,\n parentId,\n commentCache: new WeakMap(),\n });\n }\n removeElement ||= this.#interpolateNode(attr, element, defaults);\n }\n\n break;\n case Node.TEXT_NODE:\n element = node.parentNode;\n if (this.#interpolateNode(/** @type {Text} */ (node), element, defaults)) {\n const nextNode = treeWalker.nextNode();\n node.remove();\n node = nextNode;\n continue;\n }\n\n break;\n default:\n throw new Error(`Unexpected node type: ${node.nodeType}`);\n }\n if (removeElement) {\n removalList.push(element);\n }\n node = treeWalker.nextNode();\n }\n\n // Split into `interpolation` before removing elements\n /** @type {DocumentFragment} */\n this.interpolation = /** @type {DocumentFragment} */ (this.cloneable.cloneNode(true));\n\n // console.debug('Interpolated', [...this.interpolation.children].map((child) => child.outerHTML).join('\\n'));\n\n // Remove elements from `cloneable` and place comment placeholders\n // Remove in reverse so conditionals within conditionals are properly isolated\n for (const element of [...removalList].reverse()) {\n const { id } = element;\n element.replaceWith(new Comment(`{#${id}}`));\n }\n\n for (const watcher of this.watchers) {\n this.bindWatcher(watcher, defaults);\n }\n\n if ('adoptedStyleSheets' in document) {\n this.adoptedStyleSheets = [\n ...generateCSSStyleSheets(this.styles),\n ];\n } else {\n this.stylesFragment = generateFragment();\n this.stylesFragment.append(\n ...generateHTMLStyleElements(this.styles),\n );\n }\n\n this.interpolated = true;\n\n // console.log('Cloneable', [...this.cloneable.children].map((child) => child.outerHTML).join('\\n'));\n }\n\n /**\n * Updates component nodes based on data\n * Expects data in JSON Merge Patch format\n * @see https://www.rfc-editor.org/rfc/rfc7386\n * @param {DocumentFragment|ShadowRoot} root where\n * @param {Partial<?>} data what\n * @return {void}\n */\n initialRender(root, data) {\n if (!this.interpolated) this.interpolate(data);\n\n if ('adoptedStyleSheets' in root) {\n root.adoptedStyleSheets = [\n ...root.adoptedStyleSheets,\n ...this.adoptedStyleSheets,\n ];\n } else if (root instanceof ShadowRoot) {\n root.append(this.stylesFragment.cloneNode(true));\n } else {\n // TODO: Support document styles\n // console.warn('Cannot apply styles to singular element');\n }\n\n root.append(this.cloneable.cloneNode(true));\n\n // console.log('Initial render', [...root.children].map((child) => child.outerHTML).join('\\n'));\n\n /** @type {EventTarget} */\n const rootEventTarget = root instanceof ShadowRoot ? root.host : root;\n // Bind events in reverse order to support stopImmediatePropagation\n for (const [id, events] of [...this.events].reverse()) {\n // Prepare all event listeners first\n for (const entry of [...events].reverse()) {\n let listener = entry.listener;\n if (!listener) {\n if (root instanceof ShadowRoot) {\n listener = entry.handleEvent ?? valueFromPropName(entry.prop, data);\n if (id) {\n // Wrap to retarget this\n listener = buildShadowRootChildListener(listener);\n }\n // Cache and reuse\n entry.listener = listener;\n // console.log('caching listener', entry);\n } else {\n throw new TypeError('Anonymous event listeners cannot be used in templates');\n // console.warn('creating new listener', entry);\n // listener = entry.handleEvent ?? ((event) => {\n // valueFromPropName(entry.prop, data)(event);\n // });\n }\n }\n const eventTarget = id ? root.getElementById(id) : rootEventTarget;\n if (!eventTarget) {\n // Element is not available yet. Bind on reference\n console.debug('Composition: Skip bind events for', id);\n continue;\n }\n eventTarget.addEventListener(entry.type, listener, entry);\n }\n }\n\n this.initiallyRendered = true;\n }\n\n /**\n * @param {string} id\n * @param {Element} element\n */\n attachEventListeners(id, element) {\n const events = this.events.get(id);\n if (events) {\n console.debug('attaching events for', id);\n } else {\n // console.log('no events for', id);\n return;\n }\n for (const entry of [...this.events.get(id)].reverse()) {\n const { listener } = entry;\n if (!listener) {\n throw new Error('Template must be interpolated before attaching events');\n }\n element.addEventListener(entry.type, listener, entry);\n }\n }\n\n /**\n * @param {Element|DocumentFragment} root\n * @return {Map<string,Element>}\n */\n getReferences(root) {\n let references = this.referenceCache.get(root);\n if (!references) {\n references = new Map();\n this.referenceCache.set(root, references);\n }\n return references;\n }\n\n /**\n * @param {ShadowRoot|DocumentFragment} root\n * @param {string} id\n * @return {Element}\n */\n getElement(root, id) {\n const references = this.getReferences(root);\n let element = references.get(id);\n if (element) {\n // console.log('Returning from cache', id);\n return element;\n }\n if (element === null) return null; // Cached null response\n\n // Undefined\n\n // console.log('Search in DOM', id);\n element = root.getElementById(id);\n\n if (element) {\n // console.log('Found in DOM', id);\n references.set(id, element);\n return element;\n }\n\n // Element not in DOM means child of conditional element\n /** @type {Element} */\n let anchorElement;\n\n // Check if element is conditional\n let cloneTarget = this.conditionalElementMetadata.get(id)?.element;\n\n if (!cloneTarget) {\n // Check if element even exists in interpolation\n // Check interpolation (full-tree) first\n const interpolatedElement = this.interpolation.getElementById(id);\n if (!interpolatedElement) {\n console.warn('Not in full-tree', id);\n // Cache not in full composition\n references.set(id, null);\n return null;\n }\n // Iterate backgrounds until closest conditional element\n // const anchorElementId = this.template.getElementById(id).closest('[_if]').id;\n // anchorElement = this.references.get(anchorElementId) this.interpolation.getElementById(anchorElementId).cloneNode(true);\n let parentElement = interpolatedElement;\n while ((parentElement = parentElement.parentElement) != null) {\n const parentId = parentElement.id;\n if (!parentId) {\n console.warn('Parent does not have ID!');\n cloneTarget = parentElement;\n continue;\n }\n\n // Parent already referenced\n const referencedParent = references.get(parentId);\n if (referencedParent) {\n // Element may have been removed without ever tree-walking\n console.debug('Parent already referenced', parentId, '>', id);\n anchorElement = referencedParent;\n break;\n }\n\n const liveElement = root.getElementById(parentId);\n if (liveElement) {\n console.warn('Parent in DOM and not referenced', parentId, '>', id);\n // Parent already in DOM. Cache reference\n references.set(parentId, liveElement);\n anchorElement = referencedParent;\n break;\n }\n\n const conditionalParent = this.conditionalElementMetadata.get(parentId)?.element;\n if (conditionalParent) {\n console.debug('Found parent conditional element', parentId, '>', id);\n cloneTarget = conditionalParent;\n break;\n }\n\n cloneTarget = parentElement;\n }\n }\n\n anchorElement ??= /** @type {Element} */ (cloneTarget.cloneNode(true));\n\n // Iterate downwards and cache all references\n let node = anchorElement;\n const iterator = document.createTreeWalker(anchorElement, NodeFilter.SHOW_ELEMENT);\n do {\n const nodeIdentifier = node.id;\n if (!element && nodeIdentifier === id) {\n element = node;\n }\n\n if (nodeIdentifier) {\n // console.debug('Caching element', nodeIdentifier);\n references.set(nodeIdentifier, node);\n if (cloneTarget) {\n // Attach events regardless of DOM state.\n // EventTargets should still fire even if not part of live document\n this.attachEventListeners(id, element);\n }\n } else {\n console.warn('Could not cache node', node);\n }\n } while ((node = iterator.nextNode()));\n return element;\n }\n\n /**\n * @param {*} fn\n * @param {any} defaults\n * @return {boolean} reusable\n */\n bindWatcher(fn, defaults) {\n const { props, defaultValue, reusable } = observeFunction(fn, defaults);\n const entry = { fn, props, defaultValue };\n for (const prop of props) {\n let set = this.bindings.get(prop);\n if (!set) {\n set = new Set();\n this.bindings.set(prop, set);\n }\n set.add(entry);\n }\n return reusable;\n }\n}\n", "export class ICustomElement extends HTMLElement {}\n", "/* eslint-disable max-classes-per-file */\n\nimport Composition from './Composition.js';\nimport { ICustomElement } from './ICustomElement.js';\nimport { attrNameFromPropName, attrValueFromDataValue } from './dom.js';\nimport { defineObservableProperty } from './observe.js';\nimport { addInlineFunction, css, html } from './template.js';\n\n/**\n * @template {abstract new (...args: any) => unknown} T\n * @param {InstanceType<T>} instance\n */\nfunction superOf(instance) {\n const staticContext = instance.constructor;\n const superOfStatic = Object.getPrototypeOf(staticContext);\n return superOfStatic.prototype;\n}\n\nconst EVENT_PREFIX_REGEX = /^([*1~]+)?(.*)$/;\n\n/**\n * Web Component that can cache templates for minification or performance\n */\nexport default class CustomElement extends ICustomElement {\n /** @type {string} */\n static elementName;\n\n /** @return {Iterable<string>} */\n static get observedAttributes() {\n const s = new Set();\n for (const config of this.propList.values()) {\n if (config.reflect === true || config.reflect === 'read') {\n s.add(config.attr);\n }\n }\n return s;\n }\n\n /** @type {import('./Composition.js').Compositor<?>} */\n compose() {\n if (this.#composition) {\n console.warn('Already composed. Generating *new* composition...');\n }\n this.#composition = new Composition();\n return this.#composition;\n }\n\n /** @type {Composition<?>} */\n static _composition = null;\n\n /** @type {Map<string, import('./typings.js').ObserverConfiguration<?,?,?>>} */\n static _props = new Map();\n\n /** @type {Map<string, Function[]>} */\n static _propChangedCallbacks = new Map();\n\n /** @type {Map<string, Function[]>} */\n static _attributeChangedCallbacks = new Map();\n\n /** @type {typeof ICustomElement._onComposeCallbacks} */\n static _onComposeCallbacks = [];\n\n /** @type {typeof ICustomElement._onConnectedCallbacks} */\n static _onConnectedCallbacks = [];\n\n /** @type {typeof ICustomElement._onDisconnectedCallbacks} */\n static _onDisconnectedCallbacks = [];\n\n /** @type {typeof ICustomElement._onConstructedCallbacks} */\n static _onConstructedCallbacks = [];\n\n static interpolatesTemplate = true;\n\n static supportsElementInternals = 'attachInternals' in HTMLElement.prototype;\n\n static supportsElementInternalsRole = CustomElement.supportsElementInternals\n && 'role' in ElementInternals.prototype;\n\n /** @type {boolean} */\n static templatable = null;\n\n static defined = false;\n\n static autoRegistration = true;\n\n /** @type {Map<string, typeof CustomElement>} */\n static registrations = new Map();\n\n /** @type {typeof ICustomElement.expressions} */\n static expressions = this.set;\n\n /** @type {typeof ICustomElement.methods} */\n static methods = this.set;\n\n /** @type {typeof ICustomElement.overrides} */\n static overrides = this.set;\n\n /** @type {typeof ICustomElement.props} */\n static props = this.observe;\n\n /**\n * @template {typeof CustomElement} T\n * @this T\n * @template {keyof T} K\n * @param {K} collection\n * @param {T[K] extends (infer R)[] ? R : never} callback\n */\n static _addCallback(collection, callback) {\n if (!this.hasOwnProperty(collection)) {\n this[collection] = [\n ...this[collection],\n ];\n }\n this[collection].push(callback);\n }\n\n /**\n * Append parts to composition\n * @type {typeof ICustomElement.append}\n */\n static append(...parts) {\n this.on({\n composed({ composition }) {\n // console.debug('onComposed:append', ...parts);\n composition.append(...parts);\n },\n });\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Appends styles to composition\n * @type {typeof ICustomElement.css}\n */\n static css(array, ...substitutions) {\n if (Array.isArray(array)) {\n // @ts-expect-error Complex cast\n this.append(css(array, ...substitutions));\n } else {\n // @ts-expect-error Complex cast\n this.append(array, ...substitutions);\n }\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement['setSchema']} */\n static setSchema(schema) {\n this.schema = schema;\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Registers class asynchronously at end of current event loop cycle\n * via `queueMicrotask`. If class is registered before then,\n * does nothing.\n * @type {typeof ICustomElement['autoRegister']}\n */\n static autoRegister(elementName) {\n if (elementName) {\n this.elementName = elementName;\n }\n queueMicrotask(() => {\n if (this.autoRegistration) {\n this.register();\n }\n });\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Appends DocumentFragment to composition\n * @type {typeof ICustomElement.html}\n */\n static html(strings, ...substitutions) {\n this.on({\n composed({ composition }) {\n // console.log('onComposed:html', strings);\n composition.append(html(strings, ...substitutions));\n },\n });\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Extends base class into a new class.\n * Use to avoid mutating base class.\n * TODO: Add constructor arguments typing\n * @type {typeof ICustomElement.extend}\n */\n static extend() {\n // @ts-expect-error Can't cast T\n return class extends this {};\n }\n\n /**\n * Extends base class into a new class.\n * Use to avoid mutating base class.\n * TODO: Add constructor arguments typing\n * @type {typeof ICustomElement.tsClassFix}\n */\n static tsClassFix() {\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Assigns static values to class\n * @type {typeof ICustomElement.setStatic}\n */\n static setStatic(source) {\n Object.assign(this, source);\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Assigns values directly to all instances (via prototype)\n * @type {typeof ICustomElement.set}\n */\n static readonly(source, options) {\n // @ts-expect-error Can't cast T\n return this.set(source, { ...options, writable: false });\n }\n\n /**\n * Assigns values directly to all instances (via prototype)\n * @type {typeof ICustomElement.set}\n */\n static set(source, options) {\n Object.defineProperties(\n this.prototype,\n Object.fromEntries(\n Object.entries(source).map(([name, value]) => {\n // Tap into .map() to avoid double iteration\n // Property may be redefined observable\n this.undefine(name);\n return [\n name,\n {\n enumerable: name[0] !== '_',\n configurable: true,\n value,\n writable: true,\n ...options,\n },\n ];\n }),\n ),\n );\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Returns result of calling mixin with current class\n * @type {typeof ICustomElement.mixin}\n */\n static mixin(mixin) {\n return mixin(this);\n }\n\n /**\n * Registers class with window.customElements synchronously\n * @type {typeof ICustomElement['register']}\n */\n static register(elementName, force = false) {\n if (this.hasOwnProperty('defined') && this.defined && !force) {\n console.warn(this.elementName, 'already registered.');\n // @ts-expect-error Can't cast T\n return this;\n }\n\n if (elementName) {\n this.elementName = elementName;\n }\n\n customElements.define(this.elementName, this);\n CustomElement.registrations.set(this.elementName, this);\n this.defined = true;\n // @ts-expect-error Can't cast T\n return this;\n }\n\n static get propList() {\n if (!this.hasOwnProperty('_props')) {\n this._props = new Map(this._props);\n }\n return this._props;\n }\n\n static get propChangedCallbacks() {\n if (!this.hasOwnProperty('_propChangedCallbacks')) {\n // structuredClone()\n this._propChangedCallbacks = new Map(\n [\n ...this._propChangedCallbacks,\n ].map(([name, array]) => [name, array.slice()]),\n );\n }\n return this._propChangedCallbacks;\n }\n\n static get attributeChangedCallbacks() {\n if (!this.hasOwnProperty('_attributeChangedCallbacks')) {\n this._attributeChangedCallbacks = new Map(\n [\n ...this._attributeChangedCallbacks,\n ].map(([name, array]) => [name, array.slice()]),\n );\n }\n return this._attributeChangedCallbacks;\n }\n\n /**\n * Creates observable property on instances (via prototype)\n * @template {import('./typings.js').ObserverPropertyType} [T1=null]\n * @template {import('./typings.js').ObserverPropertyType} [T2=null]\n * @template {any} [T3=null]\n * @param {string} name\n * @param {T1|import('./typings.js').ObserverOptions<T2,T3>} [typeOrOptions='string']\n * @return {(\n * T3 extends null ?\n * T2 extends null ?\n * T1 extends null ?\n * string\n * : import('./typings.js').ParsedObserverPropertyType<T1>\n * : import('./typings.js').ParsedObserverPropertyType<T2>\n * : T3\n * )}\n */\n static prop(name, typeOrOptions) {\n // TODO: Cache and save configuration for reuse (mixins)\n /** @type {import('./typings.js').ObserverOptions<?,?>} */\n const options = {\n ...((typeof typeOrOptions === 'string') ? { type: typeOrOptions } : typeOrOptions),\n };\n\n const customCallback = options.changedCallback;\n\n if (customCallback) {\n // Move callback to later in stack for attribute-based changes as well\n this.onPropChanged({ [name]: customCallback });\n }\n\n // TODO: Inspect possible closure bloat\n options.changedCallback = function wrappedChangedCallback(oldValue, newValue, changes) {\n this._onObserverPropertyChanged.call(this, name, oldValue, newValue, changes);\n };\n\n const config = defineObservableProperty(this.prototype, name, options);\n\n this.propList.set(name, config);\n for (const [prop, callback] of config.watchers) {\n this.on(`${prop}Changed`, callback);\n }\n\n return config.INIT_SYMBOL;\n }\n\n /**\n * Define properties on instances via Object.defineProperties().\n * Automatically sets property non-enumerable if name begins with `_`.\n * @type {typeof ICustomElement.define}\n */\n static define(props) {\n Object.defineProperties(\n this.prototype,\n Object.fromEntries(\n Object.entries(props).map(([name, options]) => {\n // Tap into .map() to avoid double iteration\n // Property may be redefined observable\n this.undefine(name);\n return [\n name,\n {\n enumerable: name[0] !== '_',\n configurable: true,\n ...(\n typeof options === 'function'\n ? { get: options }\n : options\n ),\n },\n ];\n }),\n ),\n );\n\n // @ts-expect-error Can't cast T\n return this;\n }\n\n static undefine(name) {\n Reflect.deleteProperty(this.prototype, name);\n const config = this.propList.get(name);\n if (config && config.watchers.length) {\n const propWatchers = this.propChangedCallbacks.get(name);\n if (propWatchers) {\n for (const watcher of config.watchers) {\n const index = propWatchers.indexOf(watcher);\n if (index !== -1) {\n console.warn('Unwatching', name);\n propWatchers.splice(index, 1);\n }\n }\n }\n }\n this.propList.delete(name);\n return this;\n }\n\n /**\n * Creates observable properties on instances\n * @type {typeof ICustomElement.observe}\n */\n static observe(props) {\n for (const [name, typeOrOptions] of Object.entries(props ?? {})) {\n if (typeof typeOrOptions === 'function') {\n this.prop(name, {\n reflect: false,\n get: typeOrOptions,\n });\n } else {\n this.prop(name, typeOrOptions);\n }\n }\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement.defineStatic} */\n static defineStatic(props) {\n for (const [name, typeOrOptions] of Object.entries(props ?? {})) {\n const options = (typeof typeOrOptions === 'function')\n ? { get: typeOrOptions }\n : (typeof typeOrOptions === 'string'\n ? { type: typeOrOptions }\n : typeOrOptions);\n defineObservableProperty(this, name, {\n reflect: false,\n ...options,\n });\n }\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement.events} */\n static events(listeners, options) {\n this.on({\n composed({ composition }) {\n for (const [key, listenerOptions] of Object.entries(listeners)) {\n const [, flags, type] = key.match(EVENT_PREFIX_REGEX);\n composition.addCompositionEventListener({\n type,\n once: flags?.includes('1'),\n passive: flags?.includes('~'),\n capture: flags?.includes('*'),\n ...(\n typeof listenerOptions === 'function'\n ? { handleEvent: listenerOptions }\n : (typeof listenerOptions === 'string'\n ? { prop: listenerOptions }\n : listenerOptions)\n ),\n ...(\n options\n )\n ,\n });\n }\n },\n });\n\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement.childEvents} */\n static childEvents(listenerMap, options) {\n for (const [id, listeners] of Object.entries(listenerMap)) {\n this.events(listeners, {\n id,\n ...options,\n });\n }\n\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement['on']} */\n static on(nameOrCallbacks, callback) {\n const callbacks = typeof nameOrCallbacks === 'string'\n ? { [nameOrCallbacks]: callback }\n : nameOrCallbacks;\n for (const [name, fn] of Object.entries(callbacks)) {\n /** @type {keyof (typeof CustomElement)} */\n let arrayPropName;\n switch (name) {\n case 'composed': arrayPropName = '_onComposeCallbacks'; break;\n case 'constructed': arrayPropName = '_onConstructedCallbacks'; break;\n case 'connected': arrayPropName = '_onConnectedCallbacks'; break;\n case 'disconnected': arrayPropName = '_onDisconnectedCallbacks'; break;\n case 'props':\n this.onPropChanged(fn);\n continue;\n case 'attrs':\n this.onAttributeChanged(fn);\n continue;\n default:\n if (name.endsWith('Changed')) {\n const prop = name.slice(0, name.length - 'Changed'.length);\n this.onPropChanged({ [prop]: fn });\n continue;\n }\n throw new Error('Invalid callback name');\n }\n this._addCallback(arrayPropName, fn);\n }\n\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement['onPropChanged']} */\n static onPropChanged(options) {\n for (const [prop, callback] of Object.entries(options)) {\n let array = this.propChangedCallbacks.get(prop);\n if (!array) {\n array = [];\n this.propChangedCallbacks.set(prop, array);\n }\n array.push(callback);\n }\n\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement['onAttributeChanged']} */\n static onAttributeChanged(options) {\n for (const [name, callback] of Object.entries(options)) {\n let array = this.attributeChangedCallbacks.get(name);\n if (!array) {\n array = [];\n this.attributeChangedCallbacks.set(name, array);\n }\n array.push(callback);\n }\n\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {Record<string, HTMLElement>}} */\n #refsProxy;\n\n /** @type {Map<string, WeakRef<HTMLElement>>}} */\n #refsCache = new Map();\n\n /** @type {Map<string, WeakRef<HTMLElement>>}} */\n #refsCompositionCache = new Map();\n\n /** @type {Composition<?>} */\n #composition;\n\n /** @type {Map<string,null|[string,any]>} */\n _propAttributeCache;\n\n /** @type {import('./ICustomElement.js').CallbackArguments} */\n _callbackArguments = null;\n\n /** @param {any[]} args */\n constructor(...args) {\n super();\n\n if (CustomElement.supportsElementInternals) {\n this.elementInternals = this.attachInternals();\n }\n\n this.attachShadow({ mode: 'open', delegatesFocus: this.delegatesFocus });\n\n this.composition.initialRender(this.shadowRoot, this);\n\n for (const callback of this.static._onConstructedCallbacks) {\n callback.call(this, this.callbackArguments);\n }\n }\n\n /**\n * Updates nodes based on data\n * Expects data in JSON Merge Patch format\n * @see https://www.rfc-editor.org/rfc/rfc7386\n * @param {?} data\n * @param {?} [store]\n * @return {void}\n */\n render(data, store) {\n // console.log('render', data);\n this.composition.render(this.shadowRoot, data, this, store ? { ...this, store } : this);\n }\n\n /** @type {InstanceType<typeof ICustomElement>['propChangedCallback']} */\n propChangedCallback(name, oldValue, newValue, changes = newValue) {\n const callbacks = this.static.propChangedCallbacks.get(name);\n if (callbacks) {\n for (const callback of callbacks) {\n callback.call(this, oldValue, newValue, changes, this);\n }\n }\n\n this.render({ [name]: changes });\n }\n\n /**\n * @param {string} name\n * @param {string|null} oldValue\n * @param {string|null} newValue\n */\n attributeChangedCallback(name, oldValue, newValue) {\n const callbacks = this.static.attributeChangedCallbacks.get(name);\n if (callbacks) {\n for (const callback of callbacks) {\n callback.call(this, oldValue, newValue, this);\n }\n }\n\n // Array.find\n for (const config of this.static.propList.values()) {\n if (config.attr !== name) continue;\n\n if (config.reflect !== true && config.reflect !== 'read') return;\n\n if (config.attributeChangedCallback) {\n config.attributeChangedCallback.call(this, name, oldValue, newValue);\n return;\n }\n\n const [stringValue] = this.attributeCache.get(name) ?? [null, null];\n if (stringValue === newValue) {\n // Attribute was changed via data change event. Ignore.\n return;\n }\n\n // @ts-expect-error any\n const previousDataValue = this[config.key];\n const parsedValue = newValue === null\n ? config.nullParser(/** @type {null} */ (newValue))\n // Avoid Boolean('') === false\n : (config.type === 'boolean' ? true : config.parser(newValue));\n\n if (parsedValue === previousDataValue) {\n // No internal value change\n return;\n }\n // \"Remember\" that this attrValue equates to this data value\n // Avoids rewriting attribute later on data change event\n this.attributeCache.set(name, [newValue, parsedValue]);\n // @ts-expect-error any\n this[config.key] = parsedValue;\n return;\n }\n }\n\n get #template() {\n return this.#composition?.template;\n }\n\n /**\n * @param {string} name\n * @param {any} oldValue\n * @param {any} newValue\n * @param {any} changes\n */\n _onObserverPropertyChanged(name, oldValue, newValue, changes) {\n const { reflect, attr } = this.static.propList.get(name);\n if (attr && (reflect === true || reflect === 'write')) {\n const [, dataValue] = this.attributeCache.get(attr) ?? [null, null];\n // Don't change attribute if data value is equivalent\n // (eg: Boolean('foo') === true; Number(\"1.0\") === 1)\n if (dataValue !== newValue) {\n const attrValue = attrValueFromDataValue(newValue);\n // Cache attrValue to ignore attributeChangedCallback later\n this.attributeCache.set(attr, [attrValue, newValue]);\n if (attrValue == null) {\n this.removeAttribute(attr);\n } else {\n this.setAttribute(attr, attrValue);\n }\n }\n }\n\n // Invoke change => render\n this.propChangedCallback(name, oldValue, newValue, changes);\n }\n\n /**\n * Proxy object that returns shadow DOM elements by ID.\n * If called before interpolation (eg: on composed), returns from template\n * @return {Record<string,HTMLElement>}\n */\n get refs() {\n // eslint-disable-next-line no-return-assign\n return (this.#refsProxy ??= new Proxy({}, {\n /**\n * @param {any} target\n * @param {string} id\n * @return {Element}\n */\n get: (target, id) => {\n if (!this.#composition) {\n console.warn(this.static.name, 'Attempted to access references before composing!');\n }\n const composition = this.composition;\n if (!composition.interpolated) {\n let element = this.#refsCompositionCache.get(id)?.deref();\n if (element) return element;\n const formattedId = attrNameFromPropName(id);\n // console.warn(this.tagName, 'Returning template reference');\n element = composition.template.getElementById(formattedId);\n if (!element) return null;\n this.#refsCompositionCache.set(id, new WeakRef(element));\n return element;\n }\n let element = this.#refsCache.get(id)?.deref();\n if (element) {\n return element;\n }\n const formattedId = attrNameFromPropName(id);\n element = composition.getElement(this.shadowRoot, formattedId);\n if (!element) return null;\n this.#refsCache.set(id, new WeakRef(element));\n return element;\n },\n }));\n }\n\n get attributeCache() {\n this._propAttributeCache ??= new Map();\n return this._propAttributeCache;\n }\n\n get tabIndex() {\n return super.tabIndex;\n }\n\n set tabIndex(value) {\n if (value === super.tabIndex && value !== -1) {\n // Non -1 value already set\n return;\n }\n\n if (this.delegatesFocus && document.activeElement === this) {\n if (this.getAttribute('tabindex') === value.toString()) {\n // Skip if possible\n return;\n }\n\n // Chrome blurs on tabindex changes with delegatesFocus\n // Fixed in Chrome 111\n // Remove this code ~June 2023\n // https://bugs.chromium.org/p/chromium/issues/detail?id=1346606\n /** @type {EventListener} */\n const listener = (e) => {\n e.stopImmediatePropagation();\n e.stopPropagation();\n if (e.type === 'blur') {\n console.warn('Chromium bug 1346606: Tabindex change caused blur. Giving focusing back.', this);\n this.focus();\n } else {\n console.warn('Chromium bug 1346606: Blocking focus event.', this);\n }\n };\n this.addEventListener('blur', listener, { capture: true, once: true });\n this.addEventListener('focus', listener, { capture: true, once: true });\n super.tabIndex = value;\n this.removeEventListener('blur', listener, { capture: true });\n this.removeEventListener('focus', listener, { capture: true });\n return;\n }\n\n super.tabIndex = value;\n }\n\n get static() { return /** @type {typeof CustomElement} */ (/** @type {unknown} */ (this.constructor)); }\n\n get unique() { return false; }\n\n get callbackArguments() {\n // eslint-disable-next-line no-return-assign\n return this._callbackArguments ??= {\n composition: this.#composition,\n html: html.bind(this),\n inline: addInlineFunction,\n template: this.#template,\n element: this,\n };\n }\n\n /** @return {Composition<?>} */\n get composition() {\n if (this.#composition) return this.#composition;\n\n if (!this.unique && this.static.hasOwnProperty('_composition')) {\n this.#composition = this.static._composition;\n return this.static._composition;\n }\n\n // TODO: Use Composition to track uniqueness\n // console.log('composing', this.static.elementName);\n this.compose();\n for (const callback of this.static._onComposeCallbacks) {\n // console.log(this.static.elementName, 'composition callback');\n callback.call(this, this.callbackArguments);\n }\n\n if (!this.unique) {\n // Cache compilation into static property\n this.static._composition = this.#composition;\n }\n\n return this.#composition;\n }\n\n connectedCallback() {\n for (const callbacks of this.static._onConnectedCallbacks) {\n callbacks.call(this, this.callbackArguments);\n }\n }\n\n disconnectedCallback() {\n for (const callbacks of this.static._onDisconnectedCallbacks) {\n callbacks.call(this, this.callbackArguments);\n }\n }\n}\n\nCustomElement.prototype.delegatesFocus = false;\n", "/** @param {typeof import('../core/CustomElement.js').default} Base */\nexport default function DensityMixin(Base) {\n return Base\n .extend()\n .observe({\n density: 'integer',\n })\n .css`\n :host {\n --mdw-density: var(--mdw-density__default, 0);\n }\n \n /* Reset */\n :host([density]) { --mdw-density: 0; }\n \n :host([density=\"-1\"]) { --mdw-density: -1; }\n :host([density=\"-2\"]) { --mdw-density: -2; }\n :host([density=\"-3\"]) { --mdw-density: -2; }\n :host([density=\"-4\"]) { --mdw-density: -4; }\n :host([density=\"1\"]) { --mdw-density: 1; }\n :host([density=\"2\"]) { --mdw-density: 2; }\n :host([density=\"3\"]) { --mdw-density: 3; }\n :host([density=\"4\"]) { --mdw-density: 3; }\n `;\n}\n", "/**\n * @param {ReturnType<import('./StateMixin.js').default> & ReturnType<import('./ThemableMixin.js').default>} Base\n */\nexport default function ShapeMixin(Base) {\n return Base\n .extend()\n .observe({\n shapeTop: 'boolean',\n shapeBottom: 'boolean',\n shapeStart: 'boolean',\n shapeEnd: 'boolean',\n shapeStyle: 'string',\n outlined: 'boolean',\n })\n .html/* html */`\n <div id=shape part=shape class=shape elevated={elevated} shape-top={shapeTop} shape-bottom={shapeBottom} shape-start={shapeStart} shape-end={shapeEnd} shape-style={shapeStyle} color={color} outlined={outlined} disabled={disabledState}>\n <div id=outline _if={outlined} class=outline disabled={disabledState} focused={focusedState} pressed={pressedState} hovered={hoveredState}>\n <div id=outline-left class=\"outline-section outline-left\"></div>\n <div id=outline-right class=\"outline-section outline-right\"></div>\n </div>\n </div>\n `\n .css`\n :host {\n --mdw-shape__size: 0px;\n --mdw-shape__bg: transparent;\n --mdw-surface__will-change: none;\n --mdw-shape__size__top-start-size: var(--mdw-shape__size);\n --mdw-shape__size__top-end-size: var(--mdw-shape__size);\n --mdw-shape__size__bottom-start-size: var(--mdw-shape__size);\n --mdw-shape__size__bottom-end-size: var(--mdw-shape__size);\n \n /* (1/2n + 1/2)L + (-1/2n + 1/2)R */\n --mdw-shape__ltr: calc(0.5 * var(--mdw-dir, 1) + 0.5); /* 1 if LTR, 0 if RTL */\n --mdw-shape__rtl: calc(-0.5 * var(--mdw-dir, 1) + 0.5); /* 0 if LTR, 1 if RTL */\n --mdw-shape__size__top-left-size: calc((var(--mdw-shape__ltr) * var(--mdw-shape__size__top-start-size)) + (var(--mdw-shape__rtl) * var(--mdw-shape__size__top-end-size)));\n --mdw-shape__size__top-right-size: calc((var(--mdw-shape__rtl) * var(--mdw-shape__size__top-start-size)) + (var(--mdw-shape__ltr) * var(--mdw-shape__size__top-end-size)));\n --mdw-shape__size__bottom-left-size: calc((var(--mdw-shape__ltr) * var(--mdw-shape__size__bottom-start-size)) + (var(--mdw-shape__rtl) * var(--mdw-shape__size__bottom-end-size)));\n --mdw-shape__size__bottom-right-size: calc((var(--mdw-shape__rtl) * var(--mdw-shape__size__bottom-start-size)) + (var(--mdw-shape__ltr) * var(--mdw-shape__size__bottom-end-size)));\n \n /** By default, fallback to border-radius */\n --mdw-shape__rounded: 1;\n --mdw-shape__inline-start-deg: calc(var(--mdw-dir, 1) * -90deg);\n z-index: 0;\n }\n\n :host([shape-style=\"none\"]) {\n --mdw-shape__size: 0px;\n }\n \n :host([shape-style=\"extra-small\"]) {\n --mdw-shape__size: var(--mdw-shape__extra-small);\n }\n \n :host([shape-style=\"small\"]) {\n --mdw-shape__size: var(--mdw-shape__small);\n }\n \n :host([shape-style=\"medium\"]) {\n --mdw-shape__size: var(--mdw-shape__medium);\n }\n \n :host([shape-style=\"large\"]) {\n --mdw-shape__size: var(--mdw-shape__large);\n }\n \n :host([shape-style=\"extra-large\"]) {\n --mdw-shape__size: var(--mdw-shape__extra-large);\n }\n \n :host([shape-style=\"full\"]) {\n --mdw-shape__size: var(--mdw-shape__full);\n }\n \n :host([shape-style=\"inherit\"]) {\n --mdw-shape__size: inherit;\n }\n \n :host([shape-top]) {\n --mdw-shape__size__bottom-start-size: 0px;\n --mdw-shape__size__bottom-end-size: 0px;\n --mdw-shape__mask: linear-gradient(transparent 50%, black 50%);\n \n }\n \n :host([shape-bottom]) {\n --mdw-shape__size__top-start-size: 0px;\n --mdw-shape__size__top-end-size: 0px;\n --mdw-shape__mask: linear-gradient(black 50%, transparent 50%);\n }\n \n :host([shape-start]) {\n --mdw-shape__size__top-end-size: 0px;\n --mdw-shape__size__bottom-end-size: 0px;\n --mdw-shape__mask: linear-gradient(var(--mdw-shape__inline-start-deg), black 50%, transparent 50%);\n }\n \n :host([shape-end]) {\n --mdw-shape__size__top-start-size: 0px;\n --mdw-shape__size__bottom-start-size: 0px;\n --mdw-shape__mask: linear-gradient(var(--mdw-shape__inline-start-deg), transparent 50%, black 50%);\n }\n \n @supports(-webkit-mask-box-image: none) {\n :host {\n /* Inherit all the way up to :root */\n --mdw-shape__rounded: inherit;\n }\n }\n `\n .css`\n .shape {\n position: absolute;\n inset: 0;\n \n overflow: hidden;\n \n z-index: -1;\n \n background-color: var(--mdw-shape__bg, transparent);\n \n border-start-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-start-size));\n border-start-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-end-size));\n border-end-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-start-size));\n border-end-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-end-size));\n \n transition-delay: 1ms;\n transition-duration: 200ms;\n transition-property: background-color, color;\n will-change: background-color, color;\n \n }\n \n .shape[outlined] {\n background-color: transparent;\n }\n \n .shape[color] {\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-ink));\n }\n \n .shape:is([color=\"none\"], [color=\"transparent\"]) {\n background-color: transparent;\n }\n\n @supports(-webkit-mask-box-image: none) {\n .shape {\n -webkit-mask-box-image: var(--mdw-shape__mask-border-source)\n 8 fill /\n var(--mdw-shape__size)\n stretch;\n \n -webkit-mask: var(--mdw-shape__mask);\n\n transition-duration: 200ms, 200ms, 200ms;\n transition-property: background-color, color, -webkit-mask-box-image-width;\n will-change: background-color, color, -webkit-mask-box-image;\n }\n }\n `\n .css`\n .outline {\n position: absolute;\n inset: 0;\n \n pointer-events: none;\n \n border-color: currentColor;\n border-radius: inherit;\n color: rgb(var(--mdw-color__outline));\n }\n \n .outline:is([pressed],[focused]) {\n color: rgb(var(--mdw-ink));\n \n transition-delay: 0;\n transition-duration: 0;\n }\n \n .outline[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.12);\n }\n \n .outline::before {\n content: '';\n \n position: absolute;\n inset: 0;\n \n border-style: solid;\n border-width: 1px;\n \n border-radius: inherit;\n }\n \n @supports(-webkit-mask-box-image: none) {\n .outline::before {\n content: none;\n }\n \n .outline::after {\n content: '';\n \n position: absolute;\n inset: 0;\n \n -webkit-mask-box-image: var(--mdw-shape__mask-image__edges)\n 8 fill /\n auto\n stretch;\n \n background-color: currentColor;\n }\n \n .outline-section {\n position: absolute;\n inset: 0;\n }\n \n .outline-section::before,\n .outline-section::after {\n content: \"\";\n \n position: absolute;\n \n max-block-size: 50%;\n max-inline-size: 50%;\n \n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: contain;\n \n background-color: currentColor;\n \n transition-duration: 200ms;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n transition-property: width, height;\n }\n \n .outline-left::before {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: calc(-1px * var(--mdw-shape__convex));\n inset-block-start: calc(-1px * var(--mdw-shape__convex));\n \n block-size: calc(var(--mdw-shape__size__top-left-size));\n inline-size: calc(var(--mdw-shape__size__top-left-size));\n /* stylelint-disable-next-line liberty/use-logical-spec */\n padding-right: calc(2px * var(--mdw-shape__convex));\n padding-block-end: calc(2px * var(--mdw-shape__convex));\n \n -webkit-mask-image: var(--mdw-shape__mask-image__top-left);\n }\n \n .outline-left::after {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: calc(-1px * var(--mdw-shape__convex));\n inset-block-end: calc(-1px * var(--mdw-shape__convex));\n \n block-size: var(--mdw-shape__size__bottom-left-size);\n inline-size: var(--mdw-shape__size__bottom-left-size);\n /* stylelint-disable-next-line liberty/use-logical-spec */\n padding-right: calc(2px * var(--mdw-shape__convex));\n padding-block-start: calc(2px * var(--mdw-shape__convex));\n \n -webkit-mask-image: var(--mdw-shape__mask-image__bottom-left);\n -webkit-mask-position-y: 100%;\n }\n \n .outline-right::before {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n right: calc(-1px * var(--mdw-shape__convex));\n inset-block-start: calc(-1px * var(--mdw-shape__convex));\n \n block-size: var(--mdw-shape__size__top-right-size);\n inline-size: var(--mdw-shape__size__top-right-size);\n /* stylelint-disable-next-line liberty/use-logical-spec */\n padding-left: calc(2px * var(--mdw-shape__convex));\n padding-block-end: calc(2px * var(--mdw-shape__convex));\n \n -webkit-mask-image: var(--mdw-shape__mask-image__top-right);\n -webkit-mask-position-x: 100%;\n }\n\n .outline-right::after {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n right: calc(-1px * var(--mdw-shape__convex));\n inset-block-end: calc(-1px * var(--mdw-shape__convex));\n \n block-size: var(--mdw-shape__size__bottom-right-size);\n inline-size: var(--mdw-shape__size__bottom-right-size);\n /* stylelint-disable-next-line liberty/use-logical-spec */\n padding-left: calc(2px * var(--mdw-shape__convex));\n padding-block-start: calc(2px * var(--mdw-shape__convex));\n \n -webkit-mask-image: var(--mdw-shape__mask-image__bottom-right);\n -webkit-mask-position-x: 100%;\n -webkit-mask-position-y: 100%;\n }\n }\n `;\n}\n", "/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function ThemableMixin(Base) {\n return Base\n .extend()\n .observe({\n color: 'string',\n ink: 'string',\n block: 'boolean',\n typeStyle: 'string',\n })\n .css`\n :host([color=\"primary\"]) {\n --mdw-bg: var(--mdw-color__primary);\n --mdw-ink: var(--mdw-color__on-primary);\n }\n \n :host([color=\"primary-container\"]) {\n --mdw-bg: var(--mdw-color__primary-container);\n --mdw-ink: var(--mdw-color__on-primary-container);\n }\n \n :host([color=\"secondary\"]) {\n --mdw-bg: var(--mdw-color__secondary);\n --mdw-ink: var(--mdw-color__on-secondary);\n }\n \n :host([color=\"secondary-container\"]) {\n --mdw-bg: var(--mdw-color__secondary-container);\n --mdw-ink: var(--mdw-color__on-secondary-container);\n }\n \n :host([color=\"tertiary\"]) {\n --mdw-bg: var(--mdw-color__tertiary);\n --mdw-ink: var(--mdw-color__on-tertiary);\n }\n \n :host([color=\"tertiary-container\"]) {\n --mdw-bg: var(--mdw-color__tertiary-container);\n --mdw-ink: var(--mdw-color__on-tertiary-container);\n }\n \n :host([color=\"error\"]) {\n --mdw-bg: var(--mdw-color__error);\n --mdw-ink: var(--mdw-color__on-error);\n }\n \n :host([color=\"error-container\"]) {\n --mdw-bg: var(--mdw-color__error-container);\n --mdw-ink: var(--mdw-color__on-error-container);\n }\n \n :host([color=\"background\"]) {\n --mdw-bg: var(--mdw-color__background);\n --mdw-ink: var(--mdw-color__on-background);\n }\n \n :host([color^=\"surface\"]) {\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__on-surface);\n }\n \n /* Quality-of-life */\n :host([color=\"surface-primary\"]) {\n --mdw-ink: var(--mdw-color__primary);\n }\n \n :host([color$=\"variant\"]) {\n --mdw-bg: var(--mdw-color__surface-variant);\n --mdw-ink: var(--mdw-color__on-surface-variant);\n }\n \n :host([color^=\"inverse\"]) {\n --mdw-bg: var(--mdw-color__inverse-surface);\n --mdw-ink: var(--mdw-color__inverse-on-surface);\n }\n \n :host([color=\"inverse-primary\"]) {\n --mdw-ink: var(--mdw-color__inverse-primary);\n }\n \n :host([color][disabled]) {\n /* background-color: rgba(var(--mdw-color__on-surface), 0.12); */\n /* color: rgba(var(--mdw-color__on-surface), 0.38); */\n }\n \n :host([ink=\"inverse-primary\"]) {\n --mdw-ink: var(--mdw-color__inverse-primary);\n }\n \n :host([ink=\"primary\"]) {\n --mdw-ink: var(--mdw-color__primary);\n }\n \n :host([ink=\"on-primary-container\"]) {\n --mdw-ink: var(--mdw-color__on-primary-container);\n }\n \n :host([ink=\"secondary\"]) {\n --mdw-ink: var(--mdw-color__secondary);\n }\n \n :host([ink=\"on-secondary-container\"]) {\n --mdw-ink: var(--mdw-color__on-secondary-container);\n }\n \n :host([ink=\"tertiary\"]) {\n --mdw-ink: var(--mdw-color__tertiary);\n }\n \n :host([ink=\"on-tertiary-container\"]) {\n --mdw-ink: var(--mdw-color__on-tertiary-container);\n }\n \n :host([ink=\"error\"]) {\n --mdw-ink: var(--mdw-color__error);\n }\n \n :host([ink=\"outline\"]) {\n --mdw-ink: var(--mdw-color__outline);\n }\n \n :host([ink=\"on-surface\"]) {\n --mdw-ink: var(--mdw-color__on-surface);\n }\n \n :host([ink=\"surface-variant\"]) {\n --mdw-ink: var(--mdw-color__surface-variant);\n }\n \n :host([ink=\"on-surface-variant\"]) {\n --mdw-ink: var(--mdw-color__on-surface-variant);\n }\n \n :host([ink=\"inverse-on-surface\"]) {\n --mdw-ink: var(--mdw-color__inverse-on-surface);\n }\n \n :host([ink=\"inherit\"]) {\n --mdw-ink: inherit;\n }\n \n :host([type-style|=\"display\"]) {\n --mdw-type__font: var(--mdw-typescale__display-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__display-large__letter-spacing);\n }\n \n :host([type-style=\"display-medium\"]) {\n --mdw-type__font: var(--mdw-typescale__display-medium__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__display-medium__letter-spacing);\n }\n \n :host([type-style=\"display-small\"]) {\n --mdw-type__font: var(--mdw-typescale__display-small__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__display-small__letter-spacing);\n }\n \n :host([type-style|=\"headline\"]) {\n --mdw-type__font: var(--mdw-typescale__headline-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__headline-large__letter-spacing);\n }\n \n :host([type-style=\"headline-medium\"]) {\n --mdw-type__font: var(--mdw-typescale__headline-medium__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__headline-medium__letter-spacing);\n }\n \n :host([type-style=\"headline-small\"]) {\n --mdw-type__font: var(--mdw-typescale__headline-small__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__headline-small__letter-spacing);\n }\n \n :host([type-style|=\"title\"]) {\n --mdw-type__font: var(--mdw-typescale__title-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__title-large__letter-spacing);\n }\n \n :host([type-style=\"title-medium\"]) {\n --mdw-type__font: var(--mdw-typescale__title-medium__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__title-medium__letter-spacing);\n }\n \n :host([type-style=\"title-small\"]) {\n --mdw-type__font: var(--mdw-typescale__title-small__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__title-small__letter-spacing);\n }\n \n :host([type-style|=\"label\"]) {\n --mdw-type__font: var(--mdw-typescale__label-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__label-large__letter-spacing);\n }\n \n :host([type-style=\"label-medium\"]) {\n --mdw-type__font: var(--mdw-typescale__label-medium__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);\n }\n \n :host([type-style=\"label-small\"]) {\n --mdw-type__font: var(--mdw-typescale__label-small__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__label-small__letter-spacing);\n }\n \n :host([type-style|=\"body\"]) {\n --mdw-type__font: var(--mdw-typescale__body-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__body-large__letter-spacing);\n }\n \n :host([type-style=\"body-medium\"]) {\n --mdw-type__font: var(--mdw-typescale__body-medium__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n \n :host([type-style=\"body-small\"]) {\n --mdw-type__font: var(--mdw-typescale__body-small__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__body-small__letter-spacing);\n } \n `;\n}\n", "import CustomElement from '../core/CustomElement.js';\nimport DensityMixin from '../mixins/DensityMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(DensityMixin)\n .mixin(ShapeMixin)\n .extend()\n .html/* html */`<slot id=slot></slot>`\n .css`\n :host {\n --mdw-shape__size: 8px;\n --mdw-ink: var(--mdw-color__on-error);\n --mdw-shape__bg: rgb(var(--mdw-color__error));\n --mdw-type__font: var(--mdw-typescale__label-small__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__label-small__letter-spacing);\n position: relative;\n \n display: inline-block;\n vertical-align: middle;\n \n box-sizing: border-box;\n min-block-size: var(--mdw-typescale__label-small__line-height);\n min-inline-size: var(--mdw-typescale__label-small__line-height);\n padding-inline: max(4px, calc(4px + (var(--mdw-density) * 2px)));\n \n color: rgb(var(--mdw-ink));\n \n font: var(--mdw-type__font);\n letter-spacing: var(--mdw-type__letter-spacing);\n text-align: center;\n }\n \n @supports (width: 1lh) {\n :host {\n min-block-size: 1lh; /* Clamps to 1:1 */\n min-inline-size: 1lh; /* Clamps to 1:1 */\n padding-inline: max(0.25lh, calc(0.25lh + (var(--mdw-density) * 2px)));\n }\n }\n \n :host(:empty) {\n vertical-align: middle;\n }\n \n :host(:empty) #shape {\n inset: 5px;\n }\n `\n .autoRegister('mdw-badge');\n", "/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function FlexableMixin(Base) {\n return Base\n .extend()\n .observe({\n flex: {\n type: 'string',\n empty: 'row',\n /** @type {'row'|'column'} */\n value: 'row',\n },\n x: {\n type: 'string',\n empty: 'start',\n /** @type {'start'|'center'|'end'|'between'|'around'|'stretch'} */\n value: 'start',\n },\n y: {\n type: 'string',\n empty: 'start',\n /** @type {'start'|'center'|'end'|'between'|'around'|'stretch'} */\n value: 'start',\n },\n gap: 'float',\n padding: 'float',\n })\n .css`\n /* https://css-tricks.com/snippets/css/a-guide-to-flexbox/ */\n\n :host{\n box-sizing: border-box;\n }\n\n :host([flex]) {\n display:flex;\n }\n\n :host([flex=\"column\"]) {\n flex-direction: column;\n }\n\n :host(:where([flex][y=\"start\"], [flex=\"column\"][x=\"start\"])) {\n align-items: flex-start;\n }\n\n :host(:where([flex][y=\"end\"], [flex=\"column\"][x=\"end\"])) {\n align-items: flex-end;\n }\n\n :host(:where([flex][y=\"center\"], [flex=\"column\"][x=\"center\"])) {\n align-items: center;\n }\n\n :host(:where([flex][y=\"between\"], [flex=\"column\"][x=\"between\"])) {\n align-items: space-between;\n }\n\n :host(:where([flex][y=\"around\"], [flex=\"column\"][x=\"around\"])) {\n align-items: space-around;\n }\n\n :host(:where([flex][y=\"stretch\"], [flex=\"column\"][x=\"stretch\"])) {\n align-items: stretch;\n }\n\n :host(:where([flex][x=\"start\"], [flex=\"column\"][y=\"start\"])) {\n justify-content: flex-start;\n }\n\n :host(:where([flex][x=\"end\"], [flex=\"column\"][y=\"end\"])) {\n justify-content: flex-end;\n }\n\n :host(:where([flex][x=\"center\"], [flex=\"column\"][y=\"center\"])) {\n justify-content: center;\n }\n\n :host(:where([flex][x=\"between\"], [flex=\"column\"][y=\"between\"])) {\n justify-content: space-between;\n }\n\n :host(:where([flex][x=\"stretch\"], [flex=\"column\"][y=\"stretch\"])) {\n justify-content: space-around;\n }\n\n :host([wrap]) {\n flex-wrap: wrap;\n }\n\n :host([wrap=\"reverse\"]) {\n flex-wrap: wrap-reverse;\n }\n\n :host([gap=\"4\"]) {gap: 4px;}\n :host([gap=\"8\"]) {gap: 8px;}\n :host([gap=\"12\"]) {gap: 12px;}\n :host([gap=\"16\"]) {gap: 16px;}\n :host([gap=\"20\"]) {gap: 20px;}\n :host([gap=\"24\"]) {gap: 24px;}\n\n :host([padding=\"4\"]) {padding: 4px;}\n :host([padding=\"8\"]) {padding: 8px;}\n :host([padding=\"12\"]) {padding: 12px;}\n :host([padding=\"16\"]) {padding: 16px;}\n :host([padding=\"20\"]) {padding: 20px;}\n :host([padding=\"24\"]) {padding: 24px;}\n `;\n}\n", "import CustomElement from '../core/CustomElement.js';\nimport FlexableMixin from '../mixins/FlexableMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n/**\n * Containers are stateless elements that may have a color and ink.\n * They should have simple geometry for rendering and layout.\n */\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(FlexableMixin)\n .extend()\n .observe({\n inline: 'boolean',\n block: {\n type: 'boolean',\n empty: true,\n },\n })\n .css`\n :host {\n display: block;\n }\n \n :host([inline]) {\n display: inline-block;\n }\n \n :host([flex]:where([inline])) {\n display: inline-flex;\n }\n \n :host([color]) {\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-ink));\n }\n \n :host([ink]) {\n color: rgb(var(--mdw-ink));\n }\n \n :host([type-style]) {\n font: var(--mdw-type__font);\n letter-spacing: var(--mdw-type__letter-spacing);\n }\n \n #slot {\n /* Passthrough from parent */\n block-size: inherit;\n inline-size: inherit;\n }\n `\n .html/* html */`<slot id=slot type-style={typeStyle}></slot>`\n .autoRegister('mdw-box');\n", "import Box from './Box.js';\n\nexport default Box\n .extend()\n .css`\n :host {\n font: var(--mdw-typescale__body-large__font);\n letter-spacing: var(--mdw-typescale__body-large__letter-spacing);\n }\n \n :host([size=\"medium\"]) {\n font: var(--mdw-typescale__body-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n \n :host([size=\"small\"]) {\n font: var(--mdw-typescale__body-small__font);\n letter-spacing: var(--mdw-typescale__body-small__letter-spacing);\n }\n `\n .autoRegister('mdw-body');\n", "import { attrNameFromPropName } from '../core/dom.js';\n\n/** @param {typeof import('../core/CustomElement.js').default} Base */\nexport default function AriaReflectorMixin(Base) {\n return Base\n .extend()\n .observe({\n _ariaRole: 'string',\n }).methods({\n /**\n * @param {keyof HTMLElement & keyof ElementInternals} name\n * @param {string} value\n */\n updateAriaProperty(name, value) {\n if (this.elementInternals && name in this.elementInternals) {\n this.elementInternals[name] = value;\n } else if (name in this) {\n this[name] = value;\n } else {\n console.warn('Unknown ARIA property', name);\n /** @type {string} */\n let attrName = name;\n if (attrName.startsWith('aria')) {\n attrName = `aria-${attrName.slice(4).toLowerCase()}`;\n }\n if (value == null) {\n this.removeAttribute(name);\n } else {\n this.setAttribute(attrName, value);\n }\n }\n },\n })\n .on({\n _ariaRoleChanged(oldValue, newValue) {\n this.updateAriaProperty('role', newValue);\n },\n constructed() {\n this.updateAriaProperty('role', this._ariaRole);\n },\n });\n}\n", "import { attemptFocus, isRtl } from '../core/dom.js';\n\nconst DEFAULT_ELEMENT_QUERY = [\n 'button',\n '[href]',\n 'input',\n 'select',\n 'textarea',\n '[tabindex]',\n].join(', ');\n\n/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function KeyboardNavMixin(Base) {\n return Base\n .extend()\n .observe({\n /** Keyboard navigation attribute */\n kbdNav: { empty: 'true' },\n _kbdFocusable: { empty: true },\n\n })\n .define({\n /**\n * Query used to find roving tab index children\n */\n kbdNavQuery() {\n return DEFAULT_ELEMENT_QUERY;\n },\n /**\n * Flag whether disabled elements participating in roving tab index\n * should be focusable.\n */\n kbdNavFocusableWhenDisabled() { return true; },\n /** @return {'horizontal'|'vertical'} */\n ariaOrientationDefault() { return 'vertical'; },\n })\n .define({\n /**\n * List of roving tab index participating children\n * @return {NodeListOf<HTMLElement>}\n */\n kbdNavChildren() {\n return this.querySelectorAll(this.kbdNavQuery);\n },\n })\n .methods({\n _ariaOrientationIsVertical() {\n return (this.ariaOrientation\n ?? this.getAttribute('aria-orientation')\n ?? this.ariaOrientationDefault) === 'vertical';\n },\n /**\n * Focuses next element participating in roving tab index list\n * @param {HTMLElement} [current]\n * @param {boolean} [loop=true]\n * @param {boolean} [reverse]\n * @return {HTMLElement} focusedElement\n */\n focusNext(current = null, loop = true, reverse = false) {\n let foundCurrent = false;\n const array = reverse ? [...this.kbdNavChildren].reverse() : this.kbdNavChildren;\n for (const candidate of array) {\n if (!foundCurrent) {\n foundCurrent = (current\n ? (candidate === current)\n : (candidate.getAttribute('tabindex') === '0'));\n continue;\n }\n if (!candidate.hasAttribute('tabindex')) {\n continue;\n }\n if (candidate.getAttribute('aria-hidden') === 'true') {\n continue;\n }\n if (attemptFocus(candidate)) {\n this.ariaActiveDescendantElement = candidate;\n return candidate;\n }\n }\n\n if (!loop) {\n if (document.activeElement !== current && current instanceof HTMLElement) {\n current.focus();\n }\n return current;\n }\n // Loop\n for (const candidate of array) {\n if (!candidate.hasAttribute('tabindex')) {\n continue;\n }\n if (candidate.getAttribute('aria-hidden') === 'true') {\n continue;\n }\n // Abort if we've looped all the way back to original element\n // Abort if candidate received focus\n if (attemptFocus(candidate)) {\n return candidate;\n }\n if (candidate === current) {\n return candidate;\n }\n }\n return null;\n },\n\n /**\n * Alias for focusNext(list, current, true).\n * Selects previous element\n * @param {HTMLElement} [current]\n * @param {boolean} [loop=true]\n * @return {HTMLElement}\n */\n focusPrevious(current, loop = true) {\n return this.focusNext(current, loop, true);\n },\n\n /** @type {HTMLElement['focus']} */\n focus(...options) {\n // super.focus(...options);\n if (attemptFocus(this.ariaActiveDescendantElement, ...options)) {\n return;\n }\n for (const candidate of this.kbdNavChildren) {\n if (candidate.getAttribute('tabindex') === '0' && candidate instanceof HTMLElement) {\n this.ariaActiveDescendantElement = candidate;\n candidate.focus(...options);\n return;\n }\n }\n this.focusNext();\n },\n\n /**\n * Refreshes roving tab index attributes based on kbdNavChildren\n */\n refreshTabIndexes() {\n if (this.kbdNav !== 'true') return;\n /** @type {HTMLElement} */\n let currentlyFocusedChild = null;\n /** @type {HTMLElement} */\n let currentTabIndexChild = null;\n /** @type {HTMLElement} */\n let firstFocusableChild = null;\n for (const child of this.kbdNavChildren) {\n if (!currentlyFocusedChild && document.activeElement === child) {\n currentlyFocusedChild = child;\n } else if (!currentTabIndexChild && child.getAttribute('tabindex') === '0') {\n currentTabIndexChild = child;\n } else {\n if (!firstFocusableChild && child.getAttribute('aria-hidden') !== 'true'\n && (this.kbdNavFocusableWhenDisabled || child.getAttribute('aria-disabled') !== 'true')) {\n firstFocusableChild = child;\n }\n child.tabIndex = -1;\n // child.setAttribute('tabindex', '-1');\n }\n // Bind\n if (!child.hasAttribute('tabindex')) {\n child.tabIndex = (document.activeElement === child) ? 0 : -1;\n }\n // this.rtiBindChild(child);\n }\n if (currentlyFocusedChild) {\n currentlyFocusedChild.tabIndex = 0;\n // currentlyFocusedChild.setAttribute('tabindex', '0');\n } else if (currentTabIndexChild) {\n if (currentlyFocusedChild) {\n currentTabIndexChild.tabIndex = -1;\n // currentTabIndexChild.setAttribute('tabindex', '-1');\n }\n } else if (firstFocusableChild) {\n firstFocusableChild.tabIndex = 0;\n // firstFocusableChild.setAttribute('tabindex', '0');\n }\n },\n })\n .events({\n focusin(event) {\n if (this.kbdNav !== 'true') return;\n const currentItem = /** @type {HTMLElement} */ (event.target);\n const participates = currentItem.matches(this.kbdNavQuery);\n if (!participates) return;\n this.ariaActiveDescendantElement = currentItem;\n if (currentItem.getAttribute('tabindex') !== '0') {\n currentItem.tabIndex = 0;\n }\n for (const item of this.kbdNavChildren) {\n if (item !== currentItem && item.hasAttribute('tabindex')) {\n item.tabIndex = -1;\n // item.setAttribute('tabindex', '-1');\n }\n }\n },\n keydown(event) {\n if (event.ctrlKey || event.altKey || event.shiftKey || event.metaKey) return;\n if (this.kbdNav !== 'true') return;\n\n switch (event.key) {\n case 'ArrowUp':\n case 'Up':\n if (this._ariaOrientationIsVertical()) {\n this.focusPrevious();\n }\n break;\n case 'ArrowDown':\n case 'Down':\n if (this._ariaOrientationIsVertical()) {\n this.focusNext();\n }\n break;\n case 'ArrowLeft':\n case 'Left':\n if (this._ariaOrientationIsVertical()) return;\n if (isRtl(this)) {\n this.focusNext();\n } else {\n this.focusPrevious();\n }\n break;\n case 'ArrowRight':\n case 'Right':\n if (this._ariaOrientationIsVertical()) return;\n if (isRtl(this)) {\n this.focusPrevious();\n } else {\n this.focusNext();\n }\n break;\n default:\n return;\n }\n event.stopPropagation(); // Avoid kbd within kbd (sub menus)\n event.preventDefault();\n },\n })\n .on({\n connected() {\n this.refreshTabIndexes();\n },\n });\n}\n", "import KbdNavWidgetMixin from './KeyboardNavMixin.js';\n\n/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function AriaToolbarMixin(Base) {\n return Base\n .mixin(KbdNavWidgetMixin)\n .extend()\n .set({\n ariaOrientationDefault: 'horizontal',\n });\n}\n", "/**\n * @param {ReturnType<import('./StateMixin.js').default> & ReturnType<import('./ThemableMixin.js').default>} Base\n */\nexport default function SurfaceMixin(Base) {\n return Base\n .extend()\n .observe({\n elevated: 'boolean',\n elevation: 'integer',\n _raised: {\n type: 'boolean',\n get({ hoveredState, pressedState }) {\n return hoveredState && !pressedState;\n },\n },\n })\n .expressions({\n showSurfaceTint({ elevated, elevation, disabledState, color }) {\n return (elevated || elevation !== null)\n && !disabledState\n && (!color || color.includes('surface'));\n },\n })\n .html/* html */`\n <div id=surface class=surface raised={_raised} disabled={disabledState} color={color}>\n <div _if={showSurfaceTint} id=surface-tint class=surface-tint raised={_raised} color={color} aria-hidden=true></div>\n </div>\n `\n .css`\n :host {\n\n /** Filter blur is 1/2 CSS blur */\n \n /** Reference Properties */\n /*\n --mdw-surface__box-shadow__1__umbra: 0px 1px 2px 0px rgba(var(--mdw-color__shadow), 0.30);\n --mdw-surface__box-shadow__2__umbra: 0px 1px 2px 0px rgba(var(--mdw-color__shadow), 0.30);\n --mdw-surface__box-shadow__3__umbra: 0px 1px 3px 0px rgba(var(--mdw-color__shadow), 0.30);\n --mdw-surface__box-shadow__4__umbra: 0px 2px 3px 0px rgba(var(--mdw-color__shadow), 0.30);\n --mdw-surface__box-shadow__5__umbra: 0px 4px 4px 0px rgba(var(--mdw-color__shadow), 0.30);\n \n --mdw-surface__filter__0__umbra: drop-shadow(0px 1px 1px rgba(var(--mdw-color__shadow), 0));\n --mdw-surface__filter__1__umbra: drop-shadow(0px 1px 1px rgba(var(--mdw-color__shadow), 0.30));\n --mdw-surface__filter__2__umbra: drop-shadow(0px 1px 1px rgba(var(--mdw-color__shadow), 0.30));\n --mdw-surface__filter__3__umbra: drop-shadow(0px 1px 1.5px rgba(var(--mdw-color__shadow), 0.30));\n --mdw-surface__filter__4__umbra: drop-shadow(0px 2px 1.5px rgba(var(--mdw-color__shadow), 0.30));\n --mdw-surface__filter__5__umbra: drop-shadow(0px 4px 2px rgba(var(--mdw-color__shadow), 0.30));\n \n --mdw-surface__box-shadow__1__penumbra: 0px 1px 3px 1px rgba(var(--mdw-color__shadow), 0.15);\n --mdw-surface__box-shadow__2__penumbra: 0px 2px 6px 2px rgba(var(--mdw-color__shadow), 0.15);\n --mdw-surface__box-shadow__3__penumbra: 0px 4px 8px 3px rgba(var(--mdw-color__shadow), 0.15);\n --mdw-surface__box-shadow__4__penumbra: 0px 6px 10px 4px rgba(var(--mdw-color__shadow), 0.15);\n --mdw-surface__box-shadow__5__penumbra: 0px 8px 12px 6px rgba(var(--mdw-color__shadow), 0.15);\n \n --mdw-surface__filter__0__penumbra: drop-shadow(0px 1px 2.5px rgba(var(--mdw-color__shadow), 0));\n --mdw-surface__filter__1__penumbra: drop-shadow(0px 1px 2.5px rgba(var(--mdw-color__shadow), 0.25));\n --mdw-surface__filter__2__penumbra: drop-shadow(0px 2px 5px rgba(var(--mdw-color__shadow), 0.25));\n --mdw-surface__filter__3__penumbra: drop-shadow(0px 4px 7px rgba(var(--mdw-color__shadow), 0.263));\n --mdw-surface__filter__4__penumbra: drop-shadow(0px 6px 9px rgba(var(--mdw-color__shadow), 0.27));\n --mdw-surface__filter__5__penumbra: drop-shadow(0px 8px 12px rgba(var(--mdw-color__shadow), 0.30));\n \n --mdw-surface__filter__0: var(--mdw-surface__shadow__0__umbra) var(--mdw-surface__shadow__0__penumbra);\n --mdw-surface__filter__1: var(--mdw-surface__shadow__1__umbra) var(--mdw-surface__shadow__1__penumbra);\n --mdw-surface__filter__2: var(--mdw-surface__shadow__2__umbra) var(--mdw-surface__shadow__2__penumbra);\n --mdw-surface__filter__3: var(--mdw-surface__shadow__3__umbra) var(--mdw-surface__shadow__3__penumbra);\n --mdw-surface__filter__4: var(--mdw-surface__shadow__4__umbra) var(--mdw-surface__shadow__4__penumbra);\n --mdw-surface__filter__5: var(--mdw-surface__shadow__5__umbra) var(--mdw-surface__shadow__5__penumbra);\n */\n \n /** Flatten for performance */\n --mdw-surface__shadow__0: drop-shadow(0px 1px 001px rgba(0,0,0,000)) drop-shadow(0px 1px 2.5px rgba(0,0,0,00000));\n --mdw-surface__shadow__1: drop-shadow(0px 1px 001px rgba(0,0,0,0.3)) drop-shadow(0px 1px 2.5px rgba(0,0,0,0.250));\n --mdw-surface__shadow__2: drop-shadow(0px 1px 001px rgba(0,0,0,0.3)) drop-shadow(0px 2px 005px rgba(0,0,0,0.250));\n --mdw-surface__shadow__3: drop-shadow(0px 1px 1.5px rgba(0,0,0,0.3)) drop-shadow(0px 4px 007px rgba(0,0,0,0.263));\n --mdw-surface__shadow__4: drop-shadow(0px 2px 1.5px rgba(0,0,0,0.3)) drop-shadow(0px 6px 009px rgba(0,0,0,0.270));\n --mdw-surface__shadow__5: drop-shadow(0px 4px 2.0px rgba(0,0,0,0.3)) drop-shadow(0px 8px 012px rgba(0,0,0,0.300));\n \n --mdw-surface__tint__1: 0.05;\n --mdw-surface__tint__2: 0.08;\n --mdw-surface__tint__3: 0.11;\n --mdw-surface__tint__4: 0.12;\n --mdw-surface__tint__5: 0.14;\n \n /** Configurables */\n \n --mdw-surface__shadow__resting: none;\n --mdw-surface__shadow: var(--mdw-surface__shadow__resting);\n --mdw-surface__tint: 0;\n --mdw-surface__tint__raised: 0;\n z-index: 0;\n }\n \n :host([elevation=\"0\"]) {\n --mdw-surface__tint: 0;\n --mdw-surface__shadow__resting: none;\n }\n \n :host([elevation=\"1\"]) {\n --mdw-surface__tint: var(--mdw-surface__tint__1);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__1);\n }\n \n :host([elevation=\"2\"]) {\n --mdw-surface__tint: var(--mdw-surface__tint__2);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__2);\n }\n \n :host([elevation=\"3\"]) {\n --mdw-surface__tint: var(--mdw-surface__tint__3);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__3);\n }\n \n :host([elevation=\"4\"]) {\n --mdw-surface__tint: var(--mdw-surface__tint__4);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__4);\n }\n \n :host([elevation=\"5\"]) {\n --mdw-surface__tint: var(--mdw-surface__tint__5);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__5);\n }\n \n :host([elevation]) {\n --mdw-surface__tint__raised: var(--mdw-surface__tint);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__resting);\n }\n \n .surface {\n position: absolute;\n inset: 0;\n \n pointer-events: none;\n \n filter: var(--mdw-surface__shadow);\n z-index: -1;\n \n transition-delay: 1ms;\n transition-duration: 200ms;\n transition-property: filter;\n transition-timing-function: linear;\n will-change: filter;\n }\n \n .surface[raised] {\n filter: var(--mdw-surface__shadow__raised, var(--mdw-surface__shadow__resting));\n }\n \n .surface[disabled] {\n filter:none;\n }\n \n .surface-tint {\n position: absolute;\n inset: 0;\n \n pointer-events: none;\n \n opacity: var(--mdw-surface__tint, 0);\n \n background-color: rgb(var(--mdw-color__primary));\n border-radius: inherit;\n \n transition-delay: 1ms;\n transition-duration: 200ms;\n transition-property: opacity;\n will-change: opacity;\n }\n \n .surface-tint[raised] {\n opacity: var(--mdw-surface__tint__raised, 0);\n }\n \n .surface-tint[pressed] {\n opacity: var(--mdw-surface__tint, 0);\n }\n \n .surface-tint[color]:not([color|=\"surface\"]) {\n display: none;\n } \n `;\n}\n", "import CustomElement from '../core/CustomElement.js';\nimport FlexableMixin from '../mixins/FlexableMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport SurfaceMixin from '../mixins/SurfaceMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(FlexableMixin)\n .mixin(SurfaceMixin)\n .mixin(ShapeMixin)\n .html/* html */`<slot id=slot></slot>`\n .on({\n composed() {\n const { surface, shape, surfaceTint } = this.refs;\n shape.append(surfaceTint);\n surface.append(shape);\n },\n })\n .css`\n :host {\n --mdw-shape__bg: rgb(var(--mdw-color__surface));\n --mdw-ink: var(--mdw-color__on-surface);\n position: relative;\n \n color: rgb(var(--mdw-ink));\n \n font: var(--mdw-type__font);\n letter-spacing: var(--mdw-type__letter-spacing);\n } \n `\n .autoRegister('mdw-surface');\n", "import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\nimport AriaToolbarMixin from '../mixins/AriaToolbarMixin.js';\n\nimport Surface from './Surface.js';\n\n/**\n * Note: FAB does not exist inside because FABs can appear outside.\n * Space will be maintained for the FAB to slide into position. FAB should be\n * next on the DOM, so users can logically tab to it.\n */\n\nexport default Surface\n .mixin(AriaToolbarMixin)\n .mixin(AriaReflectorMixin)\n .extend()\n .set({\n elevated: true,\n _ariaRole: 'toolbar',\n })\n .observe({\n color: { empty: 'surface' },\n })\n .css`\n /* https://m3.material.io/components/bottom-app-bar/specs */\n\n :host {\n --mdw-surface__tint: var(--mdw-surface__tint__2);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__2);\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__on-surface);\n\n display: flex;\n align-items: center;\n gap: 8px;\n justify-content: flex-start;\n\n box-sizing: content-box;\n /* Don't apply density */\n block-size: 56px;\n padding-block: 12px;\n padding-inline: 8px 16px;\n\n box-shadow: none;\n\n direction: ltr;\n }\n `\n .autoRegister('mdw-bottom-app-bar');\n", "// import fontStyles from 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&display=block' assert { type: 'css'};\n\nimport CustomElement from '../core/CustomElement.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n/** @type {Map<string, {path:string, viewBox:string}>} */\nconst svgAliasMap = new Map();\nconst unaliased = new Set();\n\nconst documentLoadedStyleSheets = new Set();\n\n/** @typedef {'align'|'border'|'hspace'|'longDesc'|'lowsrc'|'name'|'vspace'} DeprecatedHTMLImageElementProperties */\n\n// https://html.spec.whatwg.org/multipage/embedded-content.html#htmlimageelement\n\n/** @implements {Omit<HTMLImageElement,DeprecatedHTMLImageElementProperties>} */\nexport default class Icon extends CustomElement\n .mixin(ThemableMixin)\n .extend()\n .define({\n _img() { return /** @type {HTMLImageElement} */ (this.refs.img); },\n })\n .define({\n naturalWidth() { return this._img.naturalWidth; },\n naturalHeight() { return this._img.naturalHeight; },\n complete() { return this._img.complete; },\n currentSrc() { return this._img.currentSrc; },\n x() { return this._img.x; },\n y() { return this._img.y; },\n decode() { return this._img.decode; },\n })\n .observe({\n _slottedText: 'string',\n disabled: 'boolean',\n alt: 'string',\n src: 'string',\n svg: 'string',\n svgPath: 'string',\n srcset: 'string',\n sizes: 'string',\n crossOrigin: { attr: 'crossorigin' },\n useMap: { attr: 'usemap' },\n isMap: { type: 'boolean', attr: 'ismap' },\n referrerPolicy: { attr: 'referrerpolicy' },\n decoding: { value: /** @type {'async'|'sync'|'auto'} */ (null) },\n loading: { value: /** @type {'eager'|'lazy'} */ (null) },\n width: 'integer',\n height: 'integer',\n forceFont: 'boolean',\n _linkLoaded: 'boolean',\n viewBox: { attr: 'viewBox' },\n fontClass: { empty: 'material-symbols-outlined' },\n fontLibrary: { empty: 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&display=block' },\n })\n .observe({\n _svgAlias: {\n type: 'object',\n get({ _slottedText }) {\n if (!_slottedText) return null;\n const result = svgAliasMap.get(_slottedText.trim().toLowerCase());\n if (!result) {\n unaliased.add(_slottedText);\n console.warn(`Icon: No SVG alias for ${JSON.stringify([...unaliased])}`);\n }\n return result;\n },\n },\n })\n .observe({\n _computedSVGPath({ svgPath, _svgAlias }) {\n return svgPath || _svgAlias?.path;\n },\n _computedViewBox({ viewBox, _svgAlias }) {\n return viewBox ?? _svgAlias?.viewBox ?? '0 0 24 24';\n },\n })\n .observe({\n _showSlot: {\n type: 'boolean',\n get({ _slottedText, svg, _computedSVGPath, src }) {\n return _slottedText && !svg && !_computedSVGPath && !src;\n },\n },\n })\n .expressions({\n showSVG({ svg, _computedSVGPath }) {\n return Boolean(svg || _computedSVGPath);\n },\n\n })\n .html/* html */`\n <link _if={_showSlot} id=link rel=stylesheet href={fontLibrary} />\n <svg _if=\"{showSVG}\" id=\"svg\" viewBox=\"{_computedViewBox}\">\n <use id=\"use\" _if=\"{svg}\" href=\"{svg}\" fill=\"currentColor\"/>\n <path id=\"path\" _if=\"{_computedSVGPath}\" d=\"{_computedSVGPath}\"/>\n </svg>\n <img _if={src} id=img\n disabled={disabled}\n alt={alt} src={src} srcset={srcset} sizes={sizes}\n crossorigin={crossOrigin} usemap={useMap} ismap={isMap}\n referrerpolicy={referrerPolicy} decoding={decoding} loading={loading}\n width={width} height={height}\n />\n <slot id=icon class={fontClass} hidden={!_showSlot} aria-hidden=true></slot>\n `\n .css`\n /* https://material.io/design/iconography/system-icons.html */\n\n :host {\n display: inline-block;\n vertical-align: -11.5%;\n\n block-size: 1em;\n inline-size: 1em;\n\n -webkit-user-select: none;\n user-select: none;\n\n font-variation-settings: 'FILL' 1;\n\n transition-duration: 200ms;\n /* stylelint-disable-next-line liberty/use-logical-spec -- Safari does not animate inline-size */\n transition-property: inline-size, width;\n }\n\n :host(:is([color],[ink])) {\n color: rgb(var(--mdw-ink));\n }\n\n #icon {\n /* Clip bounds in case font is not ready */\n display: block;\n overflow: clip;\n\n block-size: 1em;\n inline-size: 1em;\n\n font-size: inherit;\n font-variation-settings: inherit;\n\n transition-delay: 1ms;\n transition-duration: 200ms;\n\n transition-property: font-variation-settings;\n }\n\n #icon[hidden] {\n display: none;\n }\n\n #svg {\n display: block;\n\n block-size: inherit;\n inline-size: inherit;\n\n fill: currentColor;\n\n object-fit: cover;\n }\n\n #img {\n display: block;\n\n block-size: inherit;\n inline-size: inherit;\n\n object-fit: cover;\n\n transition-delay: 1ms;\n transition-duration: 200ms;\n transition-property: filter;\n }\n\n #img[disabled] {\n filter: grayscale();\n }\n\n .material-symbols-outlined {\n /* https://github.com/google/material-design-icons/issues/750 */\n direction: inherit;\n }\n\n `\n .childEvents({\n icon: {\n slotchange() {\n this._slottedText = this.textContent;\n },\n },\n link: {\n /**\n * @param {{currentTarget: HTMLLinkElement}} event\n * @type {any}\n */\n load({ currentTarget }) {\n const { href, parentNode } = currentTarget;\n if (!parentNode) {\n console.warn('Icon: parentNode is blank');\n }\n if (documentLoadedStyleSheets.has(href)) return;\n console.debug('Icon: Checking if link also in document', href);\n for (const link of document.head.getElementsByTagName('link')) {\n if (link.href === href) {\n console.debug(`Icon: Found ${href} in document.`);\n documentLoadedStyleSheets.add(href);\n return;\n }\n }\n console.debug(`Icon: Adding ${href} to document.`);\n document.head.append(currentTarget.cloneNode());\n documentLoadedStyleSheets.add(href);\n },\n },\n }) {\n static get svgAliasMap() { return svgAliasMap; }\n\n static get svgUnaliased() { return unaliased; }\n\n /**\n * @param {string} name\n * @param {string} path\n * @param {string} [viewBox]\n */\n static addSVGAlias(name, path, viewBox = '0 0 24 24') {\n name = name.toLowerCase();\n if (path) {\n svgAliasMap.set(name, { path, viewBox });\n } else {\n svgAliasMap.delete(name);\n }\n }\n\n /**\n * @param {number} [width]\n * @param {number} [height]\n */\n constructor(width, height) {\n super();\n\n if (width != null) {\n this.width = width;\n }\n if (height != null) {\n this.height = height;\n }\n }\n}\n\nIcon.autoRegister('mdw-icon');\n", "/* https://html.spec.whatwg.org/multipage/form-control-infrastructure.html */\n\n/** @typedef {HTMLElement & {value:string}} HTMLControlElement */\n\n/** @typedef {import('../core/CustomElement.js').default} CustomElement */\n\nconst DOMString = { nullParser: String };\n\nconst FORM_IPC_EVENT = 'mdw-form-associated-changed';\n\n/**\n * @param {ReturnType<import('./StateMixin.js').default>} Base\n */\nexport default function FormAssociatedMixin(Base) {\n return Base\n .extend()\n .setStatic({\n formAssociated: true,\n })\n .set({\n _valueDirty: false,\n /** @type {EventListener} */\n _ipcListener: null,\n /** @type {EventTarget} */\n _ipcTarget: null,\n })\n .observe({\n ariaControls: 'string',\n autocomplete: DOMString,\n name: DOMString,\n readOnly: { attr: 'readonly', type: 'boolean' },\n required: 'boolean',\n type: DOMString,\n // [CEReactions] attribute [LegacyNullToEmptyString] DOMString value;\n _value: {\n empty: '',\n /**\n * @param {string} oldValue\n * @param {string} newValue\n */\n changedCallback(oldValue, newValue) {\n this.propChangedCallback('value', oldValue, newValue);\n },\n },\n _invalid: 'boolean',\n _badInput: 'boolean',\n _validationMessage: 'string',\n _formDisabled: 'boolean',\n })\n .observe({\n erroredState({ _invalid }) { return _invalid; },\n })\n .define({\n form() { return this.elementInternals.form; },\n validity() { return this.elementInternals.validity; },\n validationMessage() { return this.elementInternals.validationMessage; },\n willValidate() { return this.elementInternals.willValidate; },\n labels() { return this.elementInternals.labels; },\n value: {\n get() {\n return this._value;\n },\n /** @param {string} v */\n set(v) {\n this._valueDirty = true;\n this._value = v;\n },\n },\n })\n .observe({\n disabledState({ _formDisabled, disabled }) {\n if (_formDisabled) return true;\n return !!disabled;\n },\n })\n .methods({\n checkValidity() { return this.elementInternals.checkValidity(); },\n\n reportValidity() { return this.elementInternals.reportValidity(); },\n\n /**\n * @param {string} error\n * @return {void}\n */\n setCustomValidity(error) {\n this.elementInternals.setValidity({\n ...this.elementInternals.validity,\n customError: !!error,\n }, this.elementInternals.validationMessage || error);\n },\n\n /**\n * @param {string} key\n * @param {string} value\n * @return {void}\n */\n _notifyRadioChange(key, value) {\n this._ipcTarget?.dispatchEvent(\n new CustomEvent(FORM_IPC_EVENT, { detail: [key, value] }),\n );\n },\n\n refreshFormAssociation() {\n const newTarget = this.elementInternals.form ?? this.getRootNode();\n if (newTarget === this._ipcTarget) {\n // console.warn('Already associated?', newTarget);\n return;\n }\n if (this._ipcTarget) {\n this._ipcTarget.removeEventListener(FORM_IPC_EVENT, this._ipcListener);\n }\n if (this.type !== 'radio') return;\n\n this._ipcTarget = newTarget;\n this._ipcListener ??= this.formIPCEvent.bind(this);\n this._ipcTarget.addEventListener(FORM_IPC_EVENT, this._ipcListener);\n },\n\n /**\n * New lifecycle callback. This is called when association with\n * <form> is changed.\n * @param {HTMLFormElement?} form\n * @return {void}\n */\n formAssociatedCallback(form) {\n this.refreshFormAssociation();\n },\n\n /**\n * @param {CustomEvent<[string, string]>} event\n * @return {void}\n */\n\n formIPCEvent(event) {\n console.warn('Virtual formIPCEvent invoked.');\n // virtual\n },\n\n /** @param {boolean} disabled */\n formDisabledCallback(disabled) {\n this._formDisabled = disabled;\n },\n\n formResetCallback() {\n this._valueDirty = false;\n this.checkValidity();\n },\n\n /**\n * @param {string|FormData} state\n * @param {'autocomplete'|'restore'} mode\n */\n formStateRestoreCallback(state, mode) {\n if (typeof state === 'string') {\n this.value = state;\n } else {\n console.warn('Could not restore', state);\n }\n },\n })\n .events({\n blur() { this.checkValidity(); },\n })\n .on({\n connected() {\n // Bind to global if no form is present (used by radio)\n this.refreshFormAssociation();\n },\n });\n}\n", "/* https://html.spec.whatwg.org/multipage/form-control-infrastructure.html */\n\nimport FormAssociatedMixin from './FormAssociatedMixin.js';\n\n/** @typedef {import('../core/CustomElement.js').default} CustomElement */\n\n/** @typedef {'align'|'useMap'} DeprecatedHTMLInputElementProperties */\n\n/** @typedef {HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement} HTMLControlElement */\n\n/**\n * @param {ReturnType<import('./StateMixin.js').default>} Base\n */\nexport default function ControlMixin(Base) {\n class Control extends Base.mixin(FormAssociatedMixin) {\n /** @return {Iterable<string>} */\n static get observedAttributes() {\n return [\n ...super.observedAttributes,\n 'aria-label',\n ...this.valueChangingContentAttributes,\n ...this.clonedContentAttributes,\n ];\n }\n\n static controlTagName = 'input';\n\n static controlVoidElement = true;\n\n /** @type {string[]} */\n static clonedContentAttributes = [\n 'autocomplete', 'name', 'readonly', 'required',\n ];\n\n /** @type {string[]} */\n static valueChangingContentAttributes = [];\n\n static {\n // eslint-disable-next-line no-unused-expressions\n this.css`\n \n :host {\n display: inline-flex;\n }\n \n /* Remove Firefox inner */\n :host(::-moz-focus-inner) {\n border: 0;\n }\n \n #label {\n display: contents;\n \n pointer-events: none;\n }\n \n #control {\n /* Control is the touch target */\n /* Firefox requires at least 1px \"visible\" for screen reading */\n /* Safari will not allow interaction with 0 opacity */\n /* Chrome will not focus with visibility:hidden */\n \n position: absolute;\n inset: 50%;\n /* --mdw-device-pixel-ratio: 1; */\n \n block-size: 100%;\n min-block-size: 48px;\n inline-size:100%;\n min-inline-size: 48px;\n margin: 0;\n border: 0;\n padding: 0;\n \n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n \n cursor: auto;\n outline: none;\n \n pointer-events: auto;\n \n transform: translateX(-50%) translateY(-50%);\n \n /* Safari and Chrome will emit two click events if not at top of stack */\n /* Allows up to 3 other layers (eg: ripple, outline) */\n z-index: 4;\n \n background-color: transparent;\n \n border-radius: 0;\n color: transparent;\n }\n \n #control::-moz-focus-inner {\n border: 0;\n }\n \n `;\n }\n\n /** @param {any[]} args */\n constructor(...args) {\n super(...args);\n /** @type {string} */\n this._value = this._control.value;\n // Expose this element as focusable\n if (!this.hasAttribute('tabindex')) {\n this.tabIndex = 0;\n }\n }\n\n /** @type {CustomElement['attributeChangedCallback']} */\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n if (this.static.clonedContentAttributes.includes(name)) {\n if (newValue == null) {\n this._control.removeAttribute(name);\n } else {\n this._control.setAttribute(name, newValue);\n }\n }\n\n if (this.static.valueChangingContentAttributes.includes(name)) {\n if (!this.hasAttribute('value')) {\n // Force HTMLInputElement to recalculate default\n // Unintended effect of incrementally changing attributes (eg: range)\n this._control.setAttribute('value', '');\n }\n // Changing control attribute may change the value (eg: min/max)\n this._value = this._control.value;\n }\n }\n\n /** @type {HTMLControlElement} */\n get _control() { return this.refs.control; }\n\n /**\n * @param {Partial<this>} data\n * @return {string}\n */\n computeAriaLabelledBy({ ariaLabel }) {\n if (ariaLabel) return null;\n return '#slot';\n }\n\n get stateTargetElement() { return this._control; }\n\n click() {\n /** Redirect click requests to control itself */\n this._control.click();\n }\n\n static {\n this.on({\n // Wait until controlTagName is settled before templating\n composed({ template, html }) {\n template.append(html`\n <label id=label disabled={disabledState}>\n <${this.static.controlTagName} id=control aria-labelledby={computeAriaLabelledBy} aria-label={ariaLabel}\n >${this.static.controlVoidElement ? '' : `</${this.static.controlTagName}>`}\n </label>\n `);\n },\n disabledStateChanged(oldValue, newValue) {\n this._control.setAttribute('aria-disabled', `${newValue}`);\n if (!this.focusableOnDisabled) {\n this._control.disabled = newValue;\n if (newValue) {\n this.tabIndex = 0;\n } else {\n this.removeAttribute('tabindex');\n }\n }\n },\n });\n this.childEvents({\n control: {\n input({ currentTarget }) {\n const control = /** @type {HTMLControlElement} */ (currentTarget);\n if (this.validity.valid) {\n // Track internally\n control.checkValidity();\n this._badInput = control.validity.badInput;\n } else {\n // Perform check in case user has validated\n this.checkValidity();\n }\n this._value = control.value;\n },\n change({ currentTarget }) {\n const control = /** @type {HTMLControlElement} */ (currentTarget);\n this._value = control.value;\n this.checkValidity();\n // Change event is NOT composed. Needs to escape shadow DOM\n this.dispatchEvent(new Event('change', { bubbles: true }));\n },\n },\n });\n }\n\n /** @type {HTMLElement['focus']} */\n focus(...options) {\n super.focus(...options);\n this.refs.control.focus(...options);\n }\n\n /**\n * @template {typeof Control & ReturnType<import('./RippleMixin.js').default> & ReturnType<import('./FormAssociatedMixin.js').default>} T\n * @return {T}\n */\n get static() {\n return /** @type {T} */ (/** @type {unknown} */ (super.static));\n }\n\n get form() { return this.elementInternals.form; }\n\n // get name() { return this.getAttribute('name'); }\n get value() {\n return this._value;\n }\n\n set value(v) {\n this._valueDirty = true;\n this._control.value = v;\n this._value = this._control.value;\n }\n\n get validity() { return this.elementInternals.validity; }\n\n get validationMessage() { return this.elementInternals.validationMessage; }\n\n get willValidate() { return this.elementInternals.willValidate; }\n\n checkValidity() {\n const validityState = this._control.checkValidity();\n /** @type {Partial<ValidityState>} */\n const newValidity = {};\n\n // eslint-disable-next-line guard-for-in\n for (const key in this._control.validity) {\n // @ts-ignore Skip cast\n newValidity[key] = this._control.validity[key];\n }\n this.elementInternals.setValidity(newValidity, this._control.validationMessage);\n this._invalid = !validityState;\n this._validationMessage = this._control.validationMessage;\n this._badInput = this._control.validity.badInput;\n return validityState;\n }\n\n reportValidity() {\n this.checkValidity();\n this._control.reportValidity();\n return this.elementInternals.reportValidity();\n }\n\n /**\n * @param {string} error\n * @return {void}\n */\n setCustomValidity(error) {\n this._control.setCustomValidity(error);\n this.checkValidity();\n }\n\n get labels() { return this.elementInternals.labels; }\n }\n Control.prototype.ariaLabel = Control.prop('ariaLabel');\n Control.prototype.delegatesFocus = true;\n Control.prototype.focusableOnDisabled = false;\n\n return Control;\n}\n", "import ControlMixin from './ControlMixin.js';\n\n/** @typedef {'align'|'useMap'} DeprecatedHTMLInputElementProperties */\n\n/** @typedef {import('../core/CustomElement.js').default} CustomElement */\n\nconst IMPLICIT_SUBMISSION_BLOCKING_TYPES = new Set([\n 'text',\n 'search',\n 'url',\n 'tel',\n 'email',\n 'password',\n 'date',\n 'month',\n 'week',\n 'time',\n 'datetime-local',\n 'number',\n]);\n\n/**\n * @param {ReturnType<import('./StateMixin.js').default>} Base\n */\nexport default function InputMixin(Base) {\n class Input extends Base.mixin(ControlMixin) {\n static inputTagName = 'input';\n\n static FORM_IPC_EVENT = 'mdw-input-changed';\n\n static GlobalListener = new EventTarget();\n\n static clonedContentAttributes = [\n ...super.clonedContentAttributes,\n 'aria-controls',\n 'accept', 'alt',\n // 'autocomplete',\n 'checked', 'dirname',\n // 'disabled',\n // 'form',\n 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formTarget',\n 'height',\n // 'list',\n 'max', 'maxlength', 'min', 'minlength',\n 'multiple',\n // 'name',\n 'pattern', 'placeholder',\n // 'readonly',\n // 'required',\n 'size', 'src', 'step',\n // 'type',\n 'value',\n 'width',\n // 'align', 'usemap',\n ];\n\n static valueChangingContentAttributes = [\n ...super.valueChangingContentAttributes,\n 'checked', 'max', 'maxlength', 'min', 'maxlength',\n 'multiple', 'pattern', 'step', 'type', 'value',\n ];\n\n /** @type {InstanceType<typeof CustomElement>['propChangedCallback']} */\n propChangedCallback(name, oldValue, newValue) {\n super.propChangedCallback(name, oldValue, newValue);\n switch (name) {\n case 'indeterminate':\n this.#input.indeterminate = newValue;\n break;\n case 'type':\n this.#input.type = newValue;\n break;\n case '_formAction':\n this.formAction = newValue;\n break;\n case '_height':\n this.height = newValue;\n break;\n case '_width':\n this.width = newValue;\n break;\n case 'checked':\n if (!this.type) {\n console.warn('unknown type?', this);\n }\n switch (this.type) {\n case 'checkbox':\n case 'radio':\n if (newValue) {\n this.elementInternals.setFormValue(this.value ?? 'on');\n if (this.type === 'radio') {\n this._notifyRadioChange(this.name, this.value ?? 'on');\n }\n } else {\n this.elementInternals.setFormValue(null);\n }\n break;\n default:\n }\n // Reinvoke change event for components tracking 'checked';\n // this.propChangedCallback('checked', oldValue, newValue);\n break;\n default:\n }\n }\n\n /** @type {CustomElement['attributeChangedCallback']} */\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n switch (name) {\n case 'aria-label':\n if (newValue == null) {\n this.#input.removeAttribute(name);\n if (!this.hasAttribute('aria-labelledby')) {\n this.#input.setAttribute('aria-labelledby', 'slot');\n }\n } else {\n this.#input.setAttribute(name, newValue);\n if (!this.hasAttribute('aria-labelledby')) {\n this.#input.removeAttribute('aria-labelledby');\n }\n }\n break;\n default:\n }\n }\n\n get #input() { return /** @type {HTMLInputElement} */ (this.refs.control); }\n\n static {\n this.on({\n composed() {\n const { label } = this.refs;\n // Expose [selected] to .checked\n label.setAttribute('selected', '{checked}');\n label.setAttribute('invalid', '{_invalid}');\n label.setAttribute('indeterminate', '{indeterminate}');\n },\n });\n this.childEvents({\n control: {\n keydown(event) {\n if (event.defaultPrevented) return;\n if (event.key !== 'Enter') return;\n if (/** @type {HTMLInputElement} */ (event.currentTarget).type === 'submit') return;\n this.performImplicitSubmission(event);\n },\n change(event) {\n if (this.disabledState) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n const input = /** @type {HTMLInputElement} */ (event.currentTarget);\n this.checked = input.checked;\n },\n },\n });\n }\n\n /**\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission\n * @param {Event} event\n * @return {void}\n */\n performImplicitSubmission(event) {\n const form = this.form;\n if (!form) return;\n /** @type {HTMLInputElement} */\n let defaultButton;\n const submissionBlockers = new Set();\n for (const element of /** @type {HTMLCollectionOf<HTMLInputElement>} */ (form.elements)) {\n if (element.type === 'submit' && !element.disabled && !element.matches(':disabled')) {\n defaultButton ??= element;\n break;\n }\n\n if (IMPLICIT_SUBMISSION_BLOCKING_TYPES.has(element.type)) {\n submissionBlockers.add(element);\n }\n }\n if (defaultButton) {\n defaultButton.click();\n return;\n }\n if (submissionBlockers.size > 1) return;\n this.form.submit();\n }\n\n /** @param {CustomEvent<[string, string]>} event */\n formIPCEvent(event) {\n if (event.target instanceof HTMLFormElement && event.target !== this.form) {\n console.warn('Control.formIPCEvent: Abort from wrong form');\n return;\n }\n if (this.type !== 'radio') {\n console.warn('Control.formIPCEvent: Abort from not radio');\n return;\n }\n const [name, value] = event.detail;\n if (this.name !== name) return;\n if (value === this.value) {\n // console.log('Control.formIPCEvent: Continue match', this.name, this.value);\n } else {\n this.checked = false;\n }\n }\n\n formResetCallback() {\n this.#input.value = this.defaultValue;\n this.#input.checked = this.defaultChecked;\n this._value = this.#input.value;\n this._checked = this.#input.checked;\n this._checkedDirty = false;\n\n super.formResetCallback();\n }\n\n get files() { return this.#input.files; }\n\n get select() { return this.#input.select; }\n\n get selectionDirection() { return this.#input.selectionDirection; }\n\n set selectionDirection(value) { this.#input.selectionDirection = value; }\n\n get selectionEnd() { return this.#input.selectionEnd; }\n\n set selectionEnd(value) { this.#input.selectionEnd = value; }\n\n get selectionStart() { return this.#input.selectionStart; }\n\n set selectionStart(value) { this.#input.selectionStart = value; }\n\n get setRangeText() { return this.#input.setRangeText; }\n\n get setSelectionRange() { return this.#input.setSelectionRange; }\n\n get showPicker() { return this.#input.showPicker; }\n\n get stepDown() { return this.#input.stepDown; }\n\n get stepUp() { return this.#input.stepUp; }\n\n get valueAsDate() { return this.#input.valueAsDate; }\n\n set valueAsDate(value) {\n this.#input.valueAsDate = value;\n this.value = this.#input.value;\n }\n\n get valueAsNumber() { return this.#input.valueAsNumber; }\n\n set valueAsNumber(value) {\n this.#input.valueAsNumber = value;\n this.value = this.#input.value;\n }\n\n get height() { return this.#input.height; }\n\n set height(value) {\n this.#input.height = value;\n this._height = value;\n }\n\n get formAction() { return this.#input.formAction; }\n\n set formAction(value) {\n this.#input.formAction = value;\n this._formAction = value;\n }\n\n get width() { return this.#input.width; }\n\n set width(value) {\n this.#input.width = value;\n this._width = value;\n }\n }\n\n Input.prototype.ariaControls = Input.prop('ariaControls');\n\n // https://html.spec.whatwg.org/multipage/input.html#htmlinputelement\n\n const DOMString = { nullParser: String, value: '' };\n\n Input.prototype.accept = Input.prop('accept', DOMString);\n Input.prototype.alt = Input.prop('alt', DOMString);\n Input.prototype.defaultChecked = Input.prop('defaultChecked', { attr: 'checked', type: 'boolean' });\n Input.prototype._checkedDirty = Input.prop('_checkedDirty', 'boolean');\n // attribute boolean checked;\n Input.prototype._checked = Input.prop('_checked', 'boolean');\n\n // Exposed property based other watched properties\n Input.prototype.checked = Input.prop('checked', {\n reflect: false,\n type: 'boolean',\n get({ _checkedDirty, defaultChecked, _checked }) {\n if (!_checkedDirty) return defaultChecked;\n return _checked;\n },\n set(value) {\n this._checked = value;\n this._checkedDirty = true;\n },\n changedCallback(oldValue, newValue) {\n this.shadowRoot.getElementById('control').checked = newValue;\n },\n });\n\n Input.prototype.dirName = Input.prop('dirName', { attr: 'dirname', ...DOMString });\n Input.prototype._formAction = Input.prop('_formAction', { attr: 'formaction' });\n Input.prototype.formEnctype = Input.prop('formEnctype', { attr: 'formenctype', ...DOMString });\n Input.prototype.formMethod = Input.prop('formMethod', { attr: 'formmethod', ...DOMString });\n Input.prototype.formNoValidate = Input.prop('formnovalidate', { attr: 'formNoValidate', type: 'boolean' });\n Input.prototype.formTarget = Input.prop('formTarget', { attr: 'formtarget', ...DOMString });\n Input.prototype._height = Input.prop('_height', { attr: 'height', type: 'integer' });\n Input.prototype.indeterminate = Input.prop('indeterminate', { type: 'boolean', reflect: false });\n Input.prototype.max = Input.prop('max', DOMString);\n Input.prototype.maxLength = Input.prop('maxLength', { attr: 'maxlength', type: 'integer', empty: -1 });\n Input.prototype.min = Input.prop('min', DOMString);\n Input.prototype.minLength = Input.prop('minLength', { attr: 'minlength', type: 'integer', empty: -1 });\n Input.prototype.multiple = Input.prop('multiple', 'boolean');\n Input.prototype.pattern = Input.prop('pattern', DOMString);\n Input.prototype.placeholder = Input.prop('placeholder', DOMString);\n Input.prototype.size = Input.prop('size', { type: 'integer', empty: 20 });\n Input.prototype.src = Input.prop('src', DOMString);\n Input.prototype.step = Input.prop('step', DOMString);\n Input.prototype.type = Input.prop('type', DOMString);\n Input.prototype.defaultValue = Input.prop('defaultValue', { attr: 'value', ...DOMString });\n // [CEReactions] attribute [LegacyNullToEmptyString] DOMString value;\n Input.prototype._width = Input.prop('_width', { attr: 'width', type: 'integer' });\n\n return Input.tsClassFix();\n}\n", "/** @typedef {import('./CustomElement').default} CustomElement */\n\n/** @type {WeakMap<HTMLElement, EventListener>} */\nconst eventHandlerValues = new Map();\n\n/**\n * @see https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-attributes\n * @type {import('./typings.js').ObserverOptions<'function',EventListener, unknown>}\n */\nexport const EVENT_HANDLER_TYPE = {\n type: 'function',\n reflect: 'read',\n value: null,\n values: eventHandlerValues,\n parser(v) { return v; },\n attributeChangedCallback(name, oldValue, newValue) {\n if (oldValue == null && newValue == null) return;\n // Must continue if oldValue === newValue;\n if (newValue == null) {\n this[name] = null;\n return;\n }\n // Assign to temp element, allow it to parse and then copy result.\n // Let browser parse instead of using eval()\n // CSP Violations will be thrown by browser on failure and result in `null`\n const button = document.createElement('button');\n button.setAttribute('onclick', newValue);\n const fn = button.onclick;\n button.remove();\n this[name] = fn;\n },\n propChangedCallback(name, oldValue, newValue) {\n const eventName = name.slice(2);\n if (oldValue) {\n this.removeEventListener(eventName, oldValue);\n }\n if (newValue) {\n this.addEventListener(eventName, newValue);\n }\n },\n};\n\nconst weakRefValues = new WeakMap();\n\n/**\n * @type {import('./typings.js').ObserverOptions<'object',HTMLElement>}\n */\nexport const WEAKREF_TYPE = {\n type: 'object',\n reflect: false,\n value: null,\n values: weakRefValues,\n parser(v) { return new WeakRef(v); },\n get() {\n return weakRefValues.get(this)?.deref();\n },\n};\n\n/** @type {WeakMap<any, Animation>} */\nconst elementStylerLastAnimation = new WeakMap();\n/** @type {WeakMap<CustomElement, ElementStylerOptions>} */\nconst elementStylerValues = new WeakMap();\n/** @type {WeakSet<any>} */\nconst elementStylerHasQueue = new WeakSet();\n\n/**\n * @typedef {Object} ElementStylerOptions\n * @prop {string} target Target ID\n * @prop {Keyframe} styles\n * @prop {EffectTiming} [timing]\n */\n\n/** @this {CustomElement} */\nfunction elementStylerRAFCallback() {\n let previousAnimation = elementStylerLastAnimation.get(this);\n const value = elementStylerValues.get(this);\n if (!value) {\n previousAnimation?.cancel();\n return;\n }\n /** @type {HTMLElement} */\n const el = value.target ? this.composition.getElement(this.shadowRoot, value.target) : this;\n const currentAnimation = el.animate(value.styles, {\n ...value.timing,\n fill: 'forwards',\n });\n currentAnimation.onremove = () => {\n previousAnimation?.effect.updateTiming({\n fill: 'none',\n });\n // Destroy previous manually to avoid leak\n previousAnimation?.finish();\n previousAnimation?.cancel();\n previousAnimation = null;\n };\n elementStylerLastAnimation.set(this, currentAnimation);\n elementStylerHasQueue.delete(this);\n}\n\n/** @type {import('./typings.js').ObserverOptions<'object',ElementStylerOptions, CustomElement>} */\nexport const ELEMENT_STYLER_TYPE = {\n type: 'object',\n reflect: false,\n values: elementStylerValues,\n diff: null, // Skip computing entire change\n changedCallback(oldValue, newValue) {\n const hasQueue = elementStylerHasQueue.has(this);\n if (!newValue) {\n if (!hasQueue) return;\n console.warn('debug needed of cancel needed');\n elementStylerHasQueue.delete(this);\n return;\n }\n\n if (hasQueue) {\n // Already scheduled\n return;\n }\n\n // Animation styles may trickle in steps, so queue a microtask before doing any work.\n // Using requestAnimationFrame would fire one frame too late for CSS animations already scheduled\n queueMicrotask(elementStylerRAFCallback.bind(this));\n elementStylerHasQueue.add(this);\n },\n};\n", "import CustomElement from '../core/CustomElement.js';\nimport { ELEMENT_STYLER_TYPE } from '../core/customTypes.js';\n\nexport default CustomElement\n .extend()\n .set({\n hadRippleHeld: false,\n hadRippleReleased: false,\n rippleStarted: false,\n })\n .observe({\n rippleState: 'string',\n keepAlive: 'boolean',\n _positionX: 'float',\n _positionY: 'float',\n _radius: 'float',\n holdRipple: {\n type: 'boolean',\n changedCallback(oldValue, newValue) {\n if (newValue) {\n this.hadRippleHeld = true;\n } else {\n this.hadRippleReleased = true;\n }\n },\n },\n })\n .observe({\n _positionStyle: {\n ...ELEMENT_STYLER_TYPE,\n get({ _positionX, _positionY, _radius }) {\n return {\n styles: {\n minBlockSize: `${_radius}px`,\n minInlineSize: `${_radius}px`,\n boxShadow: `0 0 calc(0.10 * ${_radius}px) calc(0.10 * ${_radius}px) currentColor`,\n left: `calc(50% + ${_positionX}px)`,\n top: `calc(50% + ${_positionY}px)`,\n },\n };\n },\n },\n })\n .methods({\n /**\n * @param {number} [x] offsetX\n * @param {number} [y] offsetY\n * @param {number} [size]\n * @return {void}\n */\n updatePosition(x, y, size) {\n // Element is already centered.\n // Use offset to calculate parent size;\n\n let hypotenuse = size;\n const { clientWidth: parentWidth, clientHeight: parentHeight } = this.offsetParent;\n\n x ??= parentWidth / 2;\n y ??= parentHeight / 2;\n if (!hypotenuse) {\n const width = (x >= parentWidth / 2) ? x : (parentWidth - x);\n const height = (y >= parentHeight / 2) ? y : (parentHeight - y);\n hypotenuse = 2 * Math.sqrt((width * width) + (height * height));\n }\n\n // const expandDuration = Math.min(\n // 500, // Never longer than long-press duration\n // (1000 * Math.sqrt(size / 2 / 1024) + 0.5), // From Android\n // );\n\n // this.style.minBlockSize = `${hypotenuse}px`;\n // this.style.minInlineSize = `${hypotenuse}px`;\n // this.style.boxShadow = `0 0 calc(0.10 * ${0}px) calc(0.10 * ${0}px) currentColor`;\n // this.style.marginLeft = `${x - (parentWidth / 2)}px`;\n // this.style.marginTop = `${y - (parentHeight / 2)}px`;\n\n this._positionX = x - (parentWidth / 2);\n this._positionY = y - (parentHeight / 2);\n this._radius = hypotenuse;\n },\n handleRippleComplete() {\n if (this.keepAlive) {\n this.setAttribute('ripple-state', 'complete');\n } else {\n this.remove();\n }\n },\n })\n .events({\n animationstart({ animationName }) {\n if (animationName !== 'ripple-fade-in') return;\n if (this.rippleStarted && !this.keepAlive) {\n // Animation restarted. Likely from visibility change\n this.remove();\n return;\n }\n this.rippleStarted = true;\n },\n animationend({ animationName }) {\n switch (animationName) {\n case 'ripple-fade-in':\n this.setAttribute('ripple-state', 'filled');\n break;\n case 'ripple-fade-out':\n this.handleRippleComplete();\n break;\n default:\n }\n },\n })\n .css`\n :host {\n --enter-delay: 80ms;\n --touch-down-acceleration: 1024;\n --touch-up-acceleration: 3400;\n --mdw-ripple-expand-duration: 300ms;\n --mdw-ripple-simple-duration: 200ms;\n --mdw-ripple-fade-out-duration: 333ms;\n --mdw-ripple-standard-easing: var(--mdw-motion-standard-easing, cubic-bezier(0.4, 0.0, 0.2, 1));\n --mdw-ripple-deceleration-easing: var(--mdw-motion-deceleration-easing, cubic-bezier(0.0, 0.0, 0.2, 1));\n \n --size: 0;\n position: absolute;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n top: 50%;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: 50%;\n \n display: block;\n \n min-block-size: 141.42%; /* √2 * 100% */\n min-inline-size: 141.42%;\n \n pointer-events: none;\n \n -webkit-tap-highlight-color: transparent;\n \n opacity: 0.12;\n transform: translateX(-50%) translateY(-50%) scale(1);\n \n background-color: currentColor;\n border-radius: 50%;\n \n /* Adds feathered appearance to ripple */\n box-shadow: 0 0 calc(0.10 * var(--size)) calc(0.10 * var(--size)) currentColor;\n \n transition-delay: 0s;\n transition-duration: var(--mdw-ripple-simple-duration);\n transition-property: background-color, color;\n transition-timing-function: var(--mdw-ripple-standard-easing);\n \n animation-name: ripple-fade-in, none;\n animation-duration: var(--mdw-ripple-expand-duration), var(--mdw-ripple-fade-out-duration);\n animation-timing-function: linear, var(--mdw-ripple-deceleration-easing);\n animation-direction: normal;\n animation-fill-mode: forwards;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n will-change: transform, opacity, top, left, box-shadow;\n \n aspect-ratio: 1/1;\n }\n \n :host([ripple-state=\"filled\"]) {\n animation-name: none, ripple-fade-out;\n }\n \n :host([ripple-state=\"filled\"][hold-ripple]) {\n animation-name: ripple-fade-in, none;\n }\n \n :host([ripple-state=\"complete\"]) {\n animation-name: none, ripple-fade-out;\n animation-duration: 0s;\n }\n \n @keyframes ripple-fade-in {\n from {\n transform: translateX(-50%) translateY(-50%) scale(0);\n }\n }\n \n @keyframes ripple-fade-out {\n \n to { opacity: 0; }\n }\n `\n .autoRegister('mdw-ripple');\n", "import Ripple from '../components/Ripple.js';\n\n/** @typedef {import('../components/Ripple.js').default} Ripple */\n\n/**\n * @param {ReturnType<import('./StateMixin.js').default>} Base\n */\nexport default function RippleMixin(Base) {\n return Base\n .extend()\n .set({\n /** @type {WeakRef<InstanceType<Ripple>>} */\n _lastRippleWeakRef: null,\n /** Flag set if ripple was added this event loop. */\n _rippleAdded: false,\n })\n .define({\n _lastRipple: {\n get() {\n const element = this._lastRippleWeakRef?.deref();\n if (element?.isConnected) return element;\n return null;\n },\n set(ripple) {\n this._lastRippleWeakRef = ripple ? new WeakRef(ripple) : null;\n },\n },\n })\n .methods({\n /**\n * @param {number} [x]\n * @param {number} [y]\n * @param {boolean} [hold]\n * @return {InstanceType<Ripple>}\n */\n addRipple(x, y, hold) {\n const { rippleContainer } = this.refs;\n if (!rippleContainer.isConnected) return null; // Detached?\n const ripple = new Ripple();\n this._rippleAdded = true;\n queueMicrotask(() => {\n // Reset before next event loop;\n this._rippleAdded = false;\n });\n rippleContainer.appendChild(ripple);\n if (hold) {\n ripple.holdRipple = true;\n }\n ripple.updatePosition(x, y);\n this._lastRipple = ripple;\n return ripple;\n },\n })\n .html/* html */`\n <div id=ripple-container _if={!disabledState} aria-hidden=true></div>\n `\n .events({\n '~pointerdown'(event) {\n if (event.button) return;\n if (this.disabledState) return;\n\n const { rippleContainer } = this.refs;\n if (!rippleContainer.isConnected) return; // Detached?\n const rect = rippleContainer.getBoundingClientRect();\n const x = event.pageX - rect.left - window.pageXOffset;\n const y = event.pageY - rect.top - window.pageYOffset;\n const lastRipple = this._lastRipple;\n if (lastRipple) {\n lastRipple.holdRipple = false;\n }\n console.debug('ripple from pointerdown');\n this.addRipple(x, y);\n },\n '~click'(e) {\n if (this._rippleAdded) {\n // Avoid double event\n return;\n }\n if (e.pointerType || e.detail) return;\n if (this.disabledState) return;\n if (this._pressed) return;\n const lastRipple = this._lastRipple;\n if (lastRipple) {\n lastRipple.holdRipple = false;\n }\n console.debug('ripple from programmatic click');\n this.addRipple();\n },\n })\n .on({\n _pressedChanged(oldValue, pressed) {\n const ripple = this._lastRipple;\n if (!pressed) {\n if (ripple) {\n ripple.holdRipple = false;\n }\n return;\n }\n if (!ripple || ripple.hadRippleReleased) {\n if (this._lastInteraction !== 'key') {\n // Sometimes pointer events may be out of order\n return;\n }\n console.debug('ripple from press state');\n this.addRipple(null, null, true);\n return;\n }\n if (ripple.hadRippleHeld) return;\n ripple.holdRipple = true;\n },\n })\n .css`\n :host {\n --mdw-state__pressed-opacity: 0;\n }\n \n #ripple-container {\n position: absolute;\n inset: 0;\n \n overflow: hidden;\n \n pointer-events: none;\n }\n `;\n}\n", "// Globals\n\nlet lastInteractionWasTouch = window?.matchMedia?.('(any-pointer: coarse)').matches;\n\n/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function StateMixin(Base) {\n return Base\n .extend()\n .observe({\n disabled: 'boolean',\n _lastInteraction: {\n /** @type {'mouse'|'touch'|'key'|'pen'|null} */\n value: null,\n },\n _hovered: 'boolean',\n _focused: 'boolean',\n _pressed: 'boolean',\n stateLayer: 'boolean',\n })\n .observe({\n disabledState({ disabled }) { return disabled; },\n hoveredState({ _hovered }) { return _hovered; },\n focusedState({ _focused }) { return _focused; },\n pressedState({ _pressed }) { return _pressed; },\n touchedState({ _lastInteraction }) {\n return _lastInteraction === 'touch';\n },\n })\n .define({\n stateTargetElement() { return this; },\n })\n .html/* html */`\n <div id=state _if={stateLayer}\n disabled={disabledState}\n focused={focusedState}\n hovered={hoveredState}\n pressed={pressedState}\n interaction={_lastInteraction}\n touched={touchedState}\n aria-hidden=true></div>\n `\n .events({\n pointerenter(event) {\n if (!event.isPrimary) return;\n this._pressed = this.stateTargetElement.matches(':active');\n if (event.pointerType === 'touch') return;\n this._hovered = true;\n // Firefox lags a frame before reporting :hover\n // requestAnimationFrame(() => {\n // this._hovered = this.stateTargetElement.matches(':hover');\n // });\n },\n '~pointerdown'(event) {\n if (!event.isPrimary) return;\n this._lastInteraction = /** @type {'touch'|'mouse'|'pen'} */ (event.pointerType);\n this._pressed = true;\n },\n '~pointerup'(event) {\n if (!event.isPrimary) return;\n this._lastInteraction = /** @type {'touch'|'mouse'|'pen'} */ (event.pointerType);\n this._pressed = false;\n },\n pointercancel(e) {\n if (!e.isPrimary) return;\n this._pressed = this.stateTargetElement.matches(':active');\n },\n pointerleave(event) {\n if (!event.isPrimary) return;\n this._pressed = false;\n this._hovered = false;\n },\n '~keydown'(e) {\n this._lastInteraction = 'key';\n if (e.repeat) return;\n // console.debug('keydown', this.stateTargetElement.matches(':active'));\n requestAnimationFrame(() => {\n this._pressed = this.stateTargetElement.matches(':active');\n // console.debug('pressed? after one keydown frame', this._pressed);\n });\n },\n '~keyup'() {\n this._lastInteraction = 'key';\n // console.debug('keyup', this.stateTargetElement.matches(':active'));\n requestAnimationFrame(() => {\n this._pressed = this.stateTargetElement.matches(':active');\n // console.debug('pressed? after one keyUP frame?', this._pressed);\n });\n },\n blur() {\n this._focused = false;\n if (!this._lastInteraction) return;\n lastInteractionWasTouch = (this._lastInteraction === 'touch');\n // this._lastInteraction = null;\n },\n focus() {\n this._focused = true;\n // Element was focused without a mouse or touch event (keyboard or programmatic)\n if (!this._lastInteraction && lastInteractionWasTouch) {\n // Replicate touch behavior\n this._lastInteraction = 'touch';\n }\n },\n })\n .on({\n disconnected() {\n this._lastInteraction = null;\n },\n })\n .css`\n /* https://m3.material.io/foundations/interaction-states */\n\n :host {\n --mdw-state__hovered-opacity: 0.08;\n --mdw-state__focused-opacity: 0.12;\n --mdw-state__pressed-opacity: 0.12;\n --mdw-state__dragged-opacity: 0.12;\n position: relative;\n\n outline: none;\n -webkit-tap-highlight-color: transparent;\n }\n\n /* Remove Firefox inner */\n :host(::-moz-focus-inner) {\n border: 0;\n }\n\n #state {\n position: absolute;\n inset: 0;\n\n pointer-events: none;\n\n opacity: calc(\n var(--mdw-state__hovered-opacity) +\n var(--mdw-state__focused-opacity) +\n var(--mdw-state__pressed-opacity) +\n var(--mdw-state__dragged-opacity)\n );\n /* opacity handled by theme engine */\n background-color: currentColor;\n border-radius: inherit;\n\n transition-delay: 0ms;\n transition-duration: 000ms;\n transition-property: opacity, color, background-color;\n will-change: opacity;\n }\n\n #state[touched] {\n --mdw-state__hovered-opacity: 0;\n --mdw-state__focused-opacity: 0;\n }\n\n /* Remove Hover State */\n #state:is(\n :not([hovered]),\n [disabled]:not([state-disabled~=\"hover\"]),\n [state-off~=\"hover\"]) {\n --mdw-state__hovered-opacity: 0;\n }\n\n /* Remove Focus State */\n #state:is(\n :not([focused]),\n [disabled]:not([state-disabled~=\"focus\"]),\n [state-off~=\"focus\"]) {\n --mdw-state__focused-opacity: 0;\n }\n\n /* Remove Pressed State */\n\n #state:is(\n :not([pressed]),\n [disabled]:not([state-disabled~=\"pressed\"]),\n [state-off~=\"pressed\"]) {\n --mdw-state__pressed-opacity: 0;\n }\n\n /* Remove Dragged State */\n :host(:not([aria-dragged=\"true\"])) #state,\n #state:is(\n [disabled]:not([state-disabled~=\"dragged\"]),\n [state-off~=\"dragged\"]) {\n --mdw-state__dragged-opacity: 0;\n }\n\n /* Disabled */\n #state[disabled]:not([state-disabled]) {\n display: none;\n }\n\n `;\n}\n", "import './Icon.js';\nimport CustomElement from '../core/CustomElement.js';\nimport DensityMixin from '../mixins/DensityMixin.js';\nimport InputMixin from '../mixins/InputMixin.js';\nimport RippleMixin from '../mixins/RippleMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport SurfaceMixin from '../mixins/SurfaceMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(DensityMixin)\n .mixin(SurfaceMixin)\n .mixin(ShapeMixin)\n .mixin(StateMixin)\n .mixin(RippleMixin)\n .mixin(InputMixin)\n .extend()\n .define({\n stateTargetElement() { return this.refs.control; },\n })\n .set({\n stateLayer: true,\n delegatesFocus: true,\n })\n .observe({\n type: { value: 'button' },\n elevated: 'boolean',\n filled: 'string',\n outlined: 'boolean',\n icon: 'string',\n iconInk: 'string',\n src: 'string',\n svg: 'string',\n svgPath: 'string',\n })\n .expressions({\n hasIcon({ icon, svg, src, svgPath }) {\n return icon ?? svg ?? src ?? svgPath;\n },\n })\n .html/* html */`\n <mdw-icon _if={hasIcon} id=icon ink={iconInk} disabled={disabledState} outlined={outlined} aria-hidden=true svg={svg} src={src} svg-path={svgPath}>{icon}</mdw-icon>\n <slot id=slot disabled={disabledState}></slot>\n `\n .on({\n composed() {\n const {\n shape, surfaceTint, state, rippleContainer,\n surface, control, label, slot,\n icon,\n } = this.refs;\n surface.append(shape);\n shape.append(state, rippleContainer, surfaceTint);\n label.append(icon, slot);\n\n shape.setAttribute('filled', '{filled}');\n control.setAttribute('role', 'button');\n control.setAttribute('type', 'button');\n },\n })\n .css`\n /* https://m3.material.io/components/buttons/specs */\n\n :host {\n --mdw-shape__size: var(--mdw-shape__full);\n --mdw-ink: var(--mdw-color__primary);\n\n --mdw-type__font: var(--mdw-typescale__label-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__label-large__letter-spacing);\n\n display: inline-flex;\n\n align-items: center;\n gap: 0;\n justify-content: center;\n vertical-align: middle;\n\n /* box-sizing: border-box; */\n min-block-size: 24px;\n min-inline-size: 24px;\n\n padding-block: calc(8px + (var(--mdw-density) * 2px));\n padding-inline: calc(12px + (var(--mdw-density) * 2px));\n\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n user-select: none;\n\n color: rgb(var(--mdw-ink));\n\n font: var(--mdw-type__font);\n letter-spacing: var(--mdw-type__letter-spacing);\n }\n\n :host(:where([elevated],[filled])) {\n will-change: filter;\n }\n\n /** Elevated Color Defaults */\n :host(:where([elevated])) {\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__primary);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__1);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__2);\n --mdw-surface__tint: var(--mdw-surface__tint__1);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__2);\n }\n /** Filled Color Defaults */\n :host(:where([filled])) {\n --mdw-bg: var(--mdw-color__primary);\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__0);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__1);\n --mdw-surface__tint: 0;\n --mdw-surface__tint__raised: var(--mdw-surface__tint__1);\n }\n /** Filled Tonal Color Defaults */\n :host(:where([filled=\"tonal\"])) {\n --mdw-bg: var(--mdw-color__secondary-container);\n --mdw-ink: var(--mdw-color__on-secondary-container);\n }\n /** Outlined Color Defaults */\n :host(:where([outlined])) {\n --mdw-ink: var(--mdw-color__primary);\n }\n\n :host(:where([icon])) {\n gap: 8px;\n\n padding-inline: calc(12px + (var(--mdw-density) * 2px)) calc(16px + (var(--mdw-density) * 2px));\n }\n\n :host(:where([outlined], [elevated], [filled])) {\n padding-inline: calc(24px + (var(--mdw-density) * 2px));\n }\n\n :host(:where([icon]):where([outlined], [elevated], [filled])) {\n gap: 8px;\n\n padding-inline: calc(16px + (var(--mdw-density) * 2px)) calc(24px + (var(--mdw-density) * 2px));\n }\n\n #shape:where([elevated],[filled],[color]) {\n background-color: rgb(var(--mdw-bg));\n }\n\n #slot {\n text-align: center;\n text-decoration: none;\n white-space: nowrap;\n }\n\n #control {\n cursor: inherit;\n }\n\n :host([disabled]) {\n /* cursor: not-allowed; */\n\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #shape[disabled]:is([elevated], [filled]) {\n background-color: rgba(var(--mdw-color__on-surface), 0.12);\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #slot[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #icon {\n font-size: calc(18/14 * 1em);\n font-variation-settings: 'FILL' 1;\n }\n\n #icon[outlined] {\n font-variation-settings: 'FILL' 0;\n }\n\n #icon[disabled] {\n opacity: 0.38;\n\n color: rgba(var(--mdw-color__on-surface));\n }\n\n #label {\n cursor: pointer;\n }\n\n #label[disabled] {\n cursor: not-allowed;\n }\n\n @media (any-pointer: coarse) {\n #touch-target {\n visibility: visible;\n }\n }\n `\n .childEvents({\n control: {\n /**\n * Duplicates button for form submission\n * @see https://github.com/WICG/webcomponents/issues/814\n * @param {{currentTarget:HTMLInputElement}} event\n * @type {any}\n */\n '~click'({ currentTarget }) {\n if (currentTarget.disabled) return;\n if (currentTarget.type !== 'submit') return;\n if (this.disabled) return;\n const { value } = currentTarget;\n const form = this.elementInternals?.form;\n if (!form) return;\n this.elementInternals.setFormValue(value);\n if ((currentTarget.type ?? 'submit') !== 'submit') return;\n const duplicatedButton = /** @type {HTMLInputElement} */ (currentTarget.cloneNode());\n duplicatedButton.hidden = true;\n form.append(duplicatedButton);\n if ('requestSubmit' in form) {\n form.requestSubmit(duplicatedButton);\n } else {\n duplicatedButton.click();\n }\n duplicatedButton.remove();\n },\n },\n })\n .autoRegister('mdw-button');\n", "import CustomElement from '../core/CustomElement.js';\nimport { EVENT_HANDLER_TYPE } from '../core/customTypes.js';\nimport AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\nimport FlexableMixin from '../mixins/FlexableMixin.js';\nimport FormAssociatedMixin from '../mixins/FormAssociatedMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport SurfaceMixin from '../mixins/SurfaceMixin.js';\n\nconst SUPPORTS_INERT = 'inert' in HTMLElement.prototype;\n\nexport default CustomElement\n .mixin(FlexableMixin)\n .mixin(SurfaceMixin)\n .mixin(ShapeMixin)\n .mixin(FormAssociatedMixin) // Tap into FormAssociated for disabledState\n .mixin(StateMixin)\n .mixin(AriaReflectorMixin)\n .extend()\n .setStatic({\n delegatesFocus: true,\n })\n .set({\n _ariaRole: 'figure',\n })\n .observe({\n filled: 'boolean',\n actionable: 'boolean',\n actionLabel: 'string',\n onaction: EVENT_HANDLER_TYPE,\n })\n .define({\n stateTargetElement() { return this.actionable ? this.refs.action : this; },\n })\n .expressions({\n showBlocker: ({ disabledState }) => !SUPPORTS_INERT && disabledState,\n })\n .methods({\n focus() {\n if (this.disabledState) return;\n if (this.actionable) this.refs.action.focus();\n },\n })\n .html/* html */`\n <mdw-button _if={actionable} aria-label={actionLabel} id=action disabled={disabledState}></mdw-button>\n <div _if={showBlocker} id=inert-blocker></div>\n <slot id=slot disabled={disabledState}></slot>\n `\n .css`\n /* https://m3.material.io/components/cards/specs */\n\n :host {\n --mdw-shape__size: 12px;\n --mdw-surface__tint: var(--mdw-surface__tint__0);\n --mdw-surface__tint__raised: var(--mdw-surface__tint);\n\n --mdw-surface__shadow__resting: none;\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__resting);\n /* padding-inline: 12px; */\n\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__on-surface);\n position: relative;\n\n display: block;\n\n color: rgb(var(--mdw-ink));\n\n font: var(--mdw-type__font);\n letter-spacing: var(--mdw-type__letter-spacing);\n }\n\n #shape:is([elevated],[filled]) {\n background-color: rgb(var(--mdw-bg));\n }\n\n :host(:where([filled])) {\n --mdw-bg: var(--mdw-color__surface-variant);\n --mdw-ink: var(--mdw-color__on-surface-variant);\n }\n\n :host(:where([elevated])) {\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__on-surface);\n }\n\n :host([filled]) {\n --mdw-surface__tint: var(--mdw-surface__tint__0);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__0);\n }\n\n :host([filled][actionable]) {\n --mdw-surface__tint__raised: var(--mdw-surface__tint__1);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__1);\n }\n\n :host([elevated]) {\n --mdw-surface__tint: var(--mdw-surface__tint__1);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__1);\n }\n\n :host([elevated][actionable]) {\n --mdw-surface__tint__raised: var(--mdw-surface__tint__2);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__2);\n }\n\n #shape[disabled] {\n\n /* Works on images */\n filter: grayscale();\n\n color: rgb(var(--mdw-color__on-surface));\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n\n filter: grayscale();\n opacity: 0.38;\n }\n\n #slot[disabled] {\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #outline[disabled] {\n color: rgba(var(--mdw-color__on-surface), calc(0.12/0.38));\n }\n\n /** Firefox and Safari do not support [inert] */\n\n #inert-blocker {\n position: absolute;\n inset: 0;\n\n cursor: not-allowed;\n pointer-events: auto;\n\n z-index: 99;\n }\n\n #shape[disabled][elevated] {\n background-color: rgba(var(--mdw-color__surface-variant));\n }\n\n #action {\n --mdw-ink: inherit;\n --mdw-shape__size: inherit;\n\n position: absolute;\n inset: 0;\n\n padding: 0;\n\n z-index: 0;\n\n color: inherit\n }\n `\n .on({\n composed() {\n const { slot, surface, surfaceTint, shape, outline } = this.refs;\n shape.append(surfaceTint);\n surface.append(shape);\n outline.removeAttribute('pressed');\n outline.removeAttribute('focused');\n\n shape.setAttribute('filled', '{filled}');\n slot.setAttribute('inert', '{disabledState}');\n slot.setAttribute('disabled', '{disabledState}');\n // shape.setAttribute('disabled', '{disabledState}');\n // shape.setAttribute('filled', '{filled}');\n },\n })\n .childEvents({\n action: {\n click() {\n if (this.disabledState) return;\n this.dispatchEvent(new Event('action'));\n },\n },\n slot: SUPPORTS_INERT ? {} : {\n focusin() {\n if (this.disabledState) {\n console.warn('Inert not supported. Element should be able to receive focus');\n }\n },\n },\n })\n .autoRegister('mdw-card');\n", "import './Icon.js';\nimport CustomElement from '../core/CustomElement.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(ShapeMixin)\n .observe({\n selected: 'boolean',\n icon: 'string',\n errored: 'boolean',\n disabled: 'boolean',\n })\n .define({\n /** Alias for Selected (QoL) */\n checked: {\n get() { return this.selected; },\n set(value) { this.selected = value; },\n },\n })\n .css`\n /* https://m3.material.io/components/checkbox/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-bg: var(--mdw-color__primary);\n --mdw-shape__size: 2px;\n --disabled-opacity: 0.38;\n position: relative;\n\n display: inline-block;\n align-items: center;\n justify-content: center;\n\n box-sizing: border-box;\n block-size: 18px;\n inline-size: 18px;\n\n font-size: 18px;\n line-height: 18px;\n }\n\n #shape {\n --mdw-shape__size: inherit;\n position: absolute;\n inset: 0;\n\n z-index: auto;\n\n background-color: transparent;\n }\n\n #icon {\n position: absolute;\n inset: 0;\n\n opacity: 0;\n\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-ink));\n\n transition-duration: 200ms;\n transition-property: opacity, background-color, color;\n will-change: opacity;\n }\n\n #outline {\n filter:\n drop-shadow(1px 0px 0px currentColor)\n drop-shadow(0px 1px 0px currentColor)\n drop-shadow(-1px 0px 0px currentColor)\n drop-shadow(0px -1px 0px currentColor);\n\n color: rgb(var(--mdw-color__on-surface));\n\n transition-duration: 200ms;\n transition-property: opacity, background-color, color;\n will-change: opacity;\n }\n\n /* Selected */\n\n #icon[selected] {\n opacity: 1;\n }\n\n #outline[selected] {\n opacity: 0;\n }\n\n /* Errored */\n\n #icon[errored] {\n background-color: rgb(var(--mdw-color__error));\n color: rgb(var(--mdw-color__on-error));\n }\n\n #outline[errored] {\n color: rgb(var(--mdw-color__error));\n }\n\n /* Disabled */\n\n #icon[disabled] {\n background-color: rgba(var(--mdw-color__on-surface), var(--disabled-opacity));\n color: rgb(var(--mdw-color__surface), var(--disabled-opacity));\n }\n\n #outline[disabled] {\n color: rgb(var(--mdw-color__on-surface), var(--disabled-opacity));\n }\n `\n .on({\n composed({ html }) {\n const { outline, shape } = this.refs;\n outline.removeAttribute('_if');\n outline.setAttribute('selected', '{selected}');\n outline.setAttribute('errored', '{errored}');\n outline.setAttribute('disabled', '{disabled}');\n // outlineLeft.remove();\n // outlineRight.remove();\n shape.append(html`\n <mdw-icon id=icon selected={selected} errored={errored} disabled={disabled}>{icon}</mdw-icon>\n `);\n },\n })\n .extend()\n .autoRegister('mdw-checkbox-icon');\n", "/** @param {typeof import('../core/CustomElement.js').default} Base */\nexport default function TouchTargetMixin(Base) {\n return Base\n .extend()\n .html/* html */`<div id=touch-target class=touch-target></div>`\n .css`\n .touch-target {\n position: absolute;\n inset: 50%;\n /* --mdw-device-pixel-ratio: 1; */\n \n block-size: 100%;\n min-block-size: 48px;\n /* min-block-size: 10mm; */\n /* min-block-size: calc(0.393701in / var(--mdw-device-pixel-ratio, 1)); */\n inline-size:100%;\n min-inline-size: 48px;\n /* min-inline-size: 10mm; */\n /* min-inline-size: calc(0.393701in / var(--mdw-device-pixel-ratio, 1)); */\n \n cursor: inherit;\n \n /* box-sizing: border-box; */\n /* border: solid 1px magenta; */\n pointer-events: auto;\n \n transform: translateX(-50%) translateY(-50%);\n visibility: visible;\n z-index: 1;\n \n border-radius: inherit;\n }\n `;\n}\n", "import './CheckboxIcon.js';\n\nimport CustomElement from '../core/CustomElement.js';\nimport InputMixin from '../mixins/InputMixin.js';\nimport RippleMixin from '../mixins/RippleMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\nimport TouchTargetMixin from '../mixins/TouchTargetMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(RippleMixin)\n .mixin(InputMixin)\n .mixin(TouchTargetMixin)\n .extend()\n .set({\n stateLayer: true,\n type: 'checkbox',\n })\n .observe({\n icon: { value: 'check' },\n indeterminateIcon: { value: 'check_indeterminate_small' },\n /** Reflected property */\n indeterminate: 'boolean',\n })\n .observe({\n _ariaChecked({ indeterminate, checked }) {\n return (indeterminate ? 'mixed' : `${!!checked}`);\n },\n _determinateIcon({ indeterminate, indeterminateIcon, icon }) {\n return (indeterminate ? indeterminateIcon : icon);\n },\n })\n .css`\n /* https://m3.material.io/components/checkbox/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-bg: var(--mdw-color__primary);\n\n display: inline-grid;\n align-items: baseline;\n gap: 12px;\n grid-auto-flow: column;\n justify-content: flex-start;\n\n cursor: pointer;\n\n transition: none 100ms cubic-bezier(0.4, 0.0, 1, 1);\n }\n\n :host([disabled]) {\n opacity: 0.38;\n }\n\n :host(:empty) {\n vertical-align: -11.5%;\n\n line-height: 18px;\n }\n\n :host(:empty) #checkbox {\n transform: none;\n }\n\n #control {\n grid-column: 1/1;\n\n cursor: inherit;\n }\n\n #label {\n cursor: inherit;\n }\n\n #label[disabled] {\n cursor: not-allowed;\n }\n\n #state,\n #ripple-container {\n inset-block-start: 50%;\n inset-inline-start: 50%;\n\n block-size: 40px;\n inline-size: 40px;\n\n transform: translateX(-50%) translateY(-50%);\n\n border-radius: 50%;\n }\n\n #checkbox {\n position: relative;\n\n display: inline-flex;\n\n grid-column: 1 / 1;\n\n pointer-events: none;\n\n transform: translateY(11.5%);\n\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #checkbox[selected] {\n color: rgb(var(--mdw-bg));\n }\n\n #checkbox[disabled] {\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #checkbox[errored] {\n color: rgb(var(--mdw-color__error));\n }\n\n #icon {\n --mdw-ink: inherit;\n --mdw-bg: inherit;\n --disabled-opacity: 1;\n }\n `\n .on({\n composed({ html }) {\n const { label, control, state, rippleContainer, touchTarget } = this.refs;\n label.append(html`\n ${touchTarget}\n ${control}\n <div id=checkbox errored={erroredState} selected={checked}>\n <mdw-checkbox-icon id=icon errored={erroredState} disabled={disabledState}\n icon={_determinateIcon} selected={checked}>\n </mdw-checkbox-icon>\n ${state}\n ${rippleContainer}\n </div>\n <slot id=slot></slot>\n `);\n\n control.setAttribute('type', 'checkbox');\n // Indeterminate must be manually expressed for ARIA\n control.setAttribute('aria-checked', '{_ariaChecked}');\n },\n })\n .autoRegister('mdw-checkbox');\n", "import Button from './Button.js';\n\nexport default Button\n .extend()\n .observe({\n suggestion: 'boolean',\n })\n .css`\n /* https://m3.material.io/components/chips/specs */\n\n :host {\n --mdw-shape__size: 8px;\n --mdw-ink: var(--mdw-color__on-surface);\n padding-block: calc(4px + (var(--mdw-density) * 2px));\n padding-inline: calc(16px + (var(--mdw-density) * 2px));\n\n color: rgb(var(--mdw-ink));\n }\n\n :host(:where([suggestion])) {\n --mdw-ink: var(--mdw-color__on-surface-variant);\n }\n\n :host(:where([icon])) {\n gap: 8px;\n\n padding-inline: calc(8px + (var(--mdw-density) * 2px)) calc(16px + (var(--mdw-density) * 2px));\n\n }\n\n #outline {\n --mdw-ink: rgb(var(--mdw-color__on-surface-variant));\n }\n\n #outline:is([ink],[color]) {\n /* stylelint-disable-next-line rule-selector-property-disallowed-list */\n --mdw-ink: inherit;\n }\n\n #slot[disabled],\n #icon[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n `\n .on({\n composed({ inline }) {\n const { slot, outline, icon } = this.refs;\n slot.setAttribute('disabled', '{disabledState}');\n slot.removeAttribute('ink');\n slot.removeAttribute('color');\n outline.setAttribute('_if', '{!elevated}');\n outline.setAttribute('ink', '{ink}');\n outline.setAttribute('color', '{color}');\n icon.setAttribute('ink', inline(({ ink, iconInk }) => iconInk ?? ink ?? 'primary'));\n },\n })\n .autoRegister('mdw-chip');\n", "import CustomElement from '../core/CustomElement.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .extend()\n .observe({\n vertical: 'boolean',\n })\n .css`\n /* https://m3.material.io/components/dividers/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__outline-variant);\n position: relative;\n\n display: block;\n overflow: visible;\n\n box-sizing: border-box;\n block-size: 0;\n inline-size: 100%;\n\n color: rgb(var(--mdw-ink));\n }\n\n :host::before {\n content: '';\n\n display: block;\n\n box-sizing: border-box;\n block-size: 1px;\n inline-size: auto;\n\n background-color: currentcolor;\n }\n\n :host([vertical]) {\n display: inline-flex;\n vertical-align: top;\n\n block-size: auto;\n min-block-size: 100%;\n inline-size: 0;\n }\n\n :host([vertical])::before {\n block-size: auto;\n min-inline-size: 1px;\n }\n\n `\n .autoRegister('mdw-divider');\n", "import CustomElement from '../core/CustomElement.js';\n\nexport default CustomElement\n .extend()\n .css`\n :host {\n align-self: flex-end;\n\n margin-block: 24px;\n padding-inline: 24px;\n }\n `\n .html/* html */`<slot id=slot></slot>`\n .register('mdw-dialog-actions');\n", "/**\n * @param {KeyboardEvent} event\n * @this {HTMLElement}\n * @return {void}\n */\nexport function handleTabKeyPress(event) {\n const focusableElements = this.querySelectorAll([\n 'button:not(:disabled):not([tabindex=\"-1\"])',\n '[href]:not(:disabled):not([tabindex=\"-1\"])',\n 'input:not(:disabled):not([tabindex=\"-1\"]):not([hidden])',\n 'select:not(:disabled):not([tabindex=\"-1\"])',\n 'textarea:not(:disabled):not([tabindex=\"-1\"])',\n '[tabindex]:not([tabindex=\"-1\"])',\n ].join(', '));\n let foundTarget = false;\n let candidate = null;\n for (const el of focusableElements) {\n if (el === event.target) {\n foundTarget = true;\n if (event.shiftKey) {\n break;\n }\n } else if (event.shiftKey) {\n candidate = el;\n } else if (foundTarget) {\n candidate = el;\n break;\n }\n }\n if (!candidate) {\n candidate = event.shiftKey ? focusableElements[focusableElements.length - 1] : focusableElements[0];\n }\n event.stopPropagation();\n event.preventDefault();\n if (candidate && candidate instanceof HTMLElement) {\n try {\n candidate.focus();\n } catch {\n // Failed to focus\n }\n }\n}\n", "import './Button.js';\nimport './Surface.js';\nimport './Divider.js';\nimport './Icon.js';\nimport './DialogActions.js';\n\nimport { handleTabKeyPress } from '../aria/modal.js';\nimport CustomElement from '../core/CustomElement.js';\n\n/** @typedef {Object<string,any>} DialogStackState */\n\n/** @typedef {InstanceType<import('./Dialog.js').default>} Dialog */\n\n/**\n * @typedef {Object} DialogStack\n * @prop {Dialog} element\n * @prop {Element} [previousFocus]\n * @prop {DialogStackState} [state]\n * @prop {DialogStackState} [previousState]\n */\n\n/** @type {DialogStack[]} */\nconst OPEN_DIALOGS = [];\n\nconst supportsHTMLDialogElement = typeof HTMLDialogElement !== 'undefined';\n\nexport default CustomElement\n .extend()\n .define({\n _dialog() {\n return /** @type {HTMLDialogElement} */ (this.refs.dialog);\n },\n returnValue() {\n return /** @type {HTMLDialogElement} */ (this.refs.dialog).returnValue;\n },\n })\n .observe({\n open: 'boolean',\n dividers: {\n /** @type {'full'|''|'inset'} */\n value: null,\n },\n headline: 'string',\n icon: 'string',\n default: { value: 'confirm' },\n cancel: { value: 'Cancel' },\n confirm: { value: 'Confirm' },\n _isNativeModal: 'boolean',\n color: { empty: 'surface' },\n ink: 'string',\n outlined: 'boolean',\n elevation: { empty: 3 },\n })\n .methods({\n /**\n * @param {TransitionEvent} event\n * @return {void}\n */\n onTransitionEnd(event) {\n if (event.propertyName !== 'opacity') return;\n if (this.getAttribute('aria-hidden') !== 'true') return;\n this.setAttribute('mdw-ready', '');\n },\n\n /**\n * @param {Event & {currentTarget: HTMLSlotElement}} event\n * @return {void}\n */\n onSlotChange({ currentTarget }) {\n const nodes = currentTarget.assignedNodes();\n const hasContent = nodes.some((node) => (node.nodeType === node.ELEMENT_NODE)\n || (node.nodeType === node.TEXT_NODE && node.nodeValue.trim().length));\n currentTarget.toggleAttribute('slotted', hasContent);\n },\n\n /**\n * @param {SubmitEvent & {currentTarget: HTMLFormElement}} event\n * @return {void}\n */\n onFormSubmit(event) {\n if (event.currentTarget.assignedSlot) {\n // Custom form.\n // @ts-ignore Skip cast\n const returnValue = event.submitter?.value;\n this.close(returnValue);\n event.preventDefault();\n }\n },\n\n /**\n * @param {Event & {currentTarget: HTMLFormElement}} event\n * @return {void}\n */\n onFormSlotChange({ currentTarget }) {\n /** @type {HTMLFormElement} */\n const [form] = currentTarget.assignedNodes();\n form?.addEventListener('submit', (e) => this.onFormSubmit(e));\n },\n\n /**\n * @param {PopStateEvent} event\n * @return {void}\n */\n onPopState(event) {\n if (!event.state) return;\n\n const lastOpenDialog = OPEN_DIALOGS.at(-1);\n if (!lastOpenDialog || !lastOpenDialog.previousState) {\n return;\n }\n if ((lastOpenDialog.previousState === event.state) || Object.entries(event.state)\n .every(([key, value]) => value === lastOpenDialog.previousState[key])) {\n const cancelEvent = new Event('cancel', { cancelable: true });\n if (lastOpenDialog.element.dispatchEvent(cancelEvent)) {\n lastOpenDialog.element.close();\n } else {\n // Revert pop state by pushing state again\n window.history.pushState(lastOpenDialog.state, lastOpenDialog.state.title);\n }\n }\n },\n\n /**\n * @param {any} returnValue\n * @return {boolean} handled\n */\n close(returnValue) {\n if (!this.open) return false;\n if (this._isNativeModal) {\n this._isNativeModal = false;\n } else {\n const main = document.querySelector('main');\n if (main) {\n main.removeAttribute('aria-hidden');\n }\n }\n // if (this.dialogElement.getAttribute('aria-hidden') === 'true') return false;\n if (supportsHTMLDialogElement && this._dialog.open) {\n // Force close native dialog\n this._dialog.close(returnValue);\n } else {\n this._dialog.returnValue = returnValue;\n }\n\n // Will invoke observed attribute change: ('aria-hidden', 'true');\n this.open = false;\n this.dispatchEvent(new Event('close'));\n // .mdw-dialog__popup hidden by transitionEnd event\n let stackIndex = -1;\n OPEN_DIALOGS.some((stack, index) => {\n // @ts-ignore Skip unknown\n if (stack.element === this) {\n stackIndex = index;\n return true;\n }\n return false;\n });\n if (stackIndex !== -1) {\n const stack = OPEN_DIALOGS[stackIndex];\n if (stack.previousFocus\n && stack.previousFocus instanceof HTMLElement\n && document.activeElement?.closest(this.constructor.elementName) === this) {\n // Only pop focus back when hiding a dialog with focus within itself.\n try {\n stack.previousFocus.focus();\n } catch {\n // Failed to focus\n }\n }\n OPEN_DIALOGS.splice(stackIndex, 1);\n if (stack.state && window.history && window.history.state // IE11 returns a cloned state object, not the original\n && stack.state.hash === window.history.state.hash) {\n window.history.back();\n }\n }\n if (!OPEN_DIALOGS.length) {\n window.removeEventListener('popstate', this.onPopState);\n }\n return true;\n },\n\n /**\n * @param {Event} [event]\n * @return {boolean} handled\n */\n showModal(event) {\n if (this.open) return false;\n if (supportsHTMLDialogElement) {\n this._dialog.showModal();\n this._isNativeModal = true;\n }\n return this.show(event);\n },\n\n /**\n * @param {MouseEvent|PointerEvent|HTMLElement|Event} [source]\n * @return {boolean} handled\n */\n show(source) {\n if (this.open) return false;\n this.open = true;\n\n if (supportsHTMLDialogElement) {\n this._dialog.show();\n const main = document.querySelector('main');\n if (main) {\n main.setAttribute('aria-hidden', 'true');\n }\n }\n\n const previousFocus = document.activeElement;\n const title = this.headline || this.textContent;\n const newState = { time: Date.now(), random: Math.random(), title };\n let previousState = null;\n\n if (!window.history.state) {\n window.history.replaceState({\n hash: Math.random().toString(36).slice(2, 18),\n }, document.title);\n }\n previousState = window.history.state;\n window.history.pushState(newState, title);\n window.addEventListener('popstate', this.onPopState);\n\n /** @type {DialogStack} */\n const dialogStack = {\n // @ts-ignore Recursive cast\n element: this,\n previousFocus,\n state: newState,\n previousState,\n };\n OPEN_DIALOGS.push(dialogStack);\n const focusElement = this.querySelector('[autofocus]')\n ?? this.shadowRoot.querySelector('[autofocus]');\n try {\n if (focusElement && focusElement instanceof HTMLElement) {\n if (focusElement.scrollIntoView) {\n focusElement.scrollIntoView();\n }\n focusElement.focus();\n } else {\n this.refs.surface.focus();\n }\n } catch {\n // Failed to focus\n }\n return true;\n },\n })\n .expressions({\n cancelAutoFocus({ default: d }) { return d === 'cancel'; },\n confirmAutoFocus({ default: d }) { return d === 'confirm'; },\n _ariaHidden({ open }) { return (open ? 'false' : 'true'); },\n })\n .html/* html */`\n <dialog id=dialog aria-modal=true role=dialog\n aria-hidden={_ariaHidden}\n aria-labelledby=headline aria-describedby=slot>\n <div _if={open} id=scrim aria-hidden=true></div>\n <mdw-surface id=surface open={open} icon={icon} elevation={elevation} color={color} ink={ink} outlined={outlined}>\n <mdw-icon _if={icon} id=icon class=content ink=secondary aria-hidden=true>{icon}</mdw-icon>\n <slot id=headline name=headline on-slotchange={onSlotChange} role=header>{headline}</slot>\n <slot id=fixed name=fixed class=content on-slotchange={onSlotChange}></slot>\n <mdw-divider id=divider-top size={dividers}></mdw-divider>\n <slot id=slot class=content on-slotchange={onSlotChange}></slot>\n <mdw-divider id=divider-bottom size={dividers}></mdw-divider>\n <slot name=form id=form-slot on-slotchange={onFormSlotChange}>\n <form id=form method=dialog role=none on-submit={onFormSubmit}>\n <mdw-dialog-actions>\n <mdw-button id=cancel type=submit value=cancel\n autofocus={cancelAutoFocus}>{cancel}</mdw-button>\n <mdw-button id=confirm type=submit value=confirm\n autofocus={confirmAutoFocus}>{confirm}</mdw-button>\n </mdw-dialog-actions>\n </form>\n </slot>\n </mdw-surface>\n </dialog>\n `\n .css`\n /* https://m3.material.io/components/dialogs/specs */\n\n :host {\n --mdw-dialog__expand-duration: var(--mdw-motion-expand-duration, 250ms);\n --mdw-dialog__simple-duration: var(--mdw-motion-simple-duration, 100ms);\n --mdw-dialog__standard-easing: var(--mdw-motion-standard-easing, cubic-bezier(0.4, 0.0, 0.2, 1));\n --mdw-dialog__deceleration-easing: var(--mdw-motion-deceleration-easing, cubic-bezier(0.0, 0.0, 0.2, 1));\n --mdw-dialog__fade-in-duration: var(--mdw-motion-fade-in-duration, 150ms);\n\n position: fixed;\n inset: 0;\n\n pointer-events: none;\n\n z-index: 24;\n }\n\n #dialog {\n position: fixed;\n inset-block-start: 0;\n inset-inline-start: 0;\n\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: center;\n\n box-sizing: border-box;\n block-size:100%;\n max-block-size: none;\n inline-size:100%;\n max-inline-size: none;\n margin:0;\n border: none;\n padding: 48px;\n\n opacity: 0;\n /* visiblity:hidden still registers events, hide from pointer with scale(0) */\n transform: scale(0);\n visibility: hidden;\n z-index: 24;\n\n background-color: transparent;\n\n transition-delay: 0s, 200ms, 200ms;\n transition-duration: 200ms, 0s, 0s;\n transition-property: opacity, transform, visibility;\n transition-timing-function: ease-out;\n will-change: opacity;\n }\n\n @media (min-width: 1440px) {\n #dialog {\n padding: 56px;\n }\n }\n\n #dialog::backdrop {\n /** Use scrim instead */\n display: none;\n }\n\n #dialog[aria-hidden=\"false\"],\n #dialog:modal {\n pointer-events: auto;\n\n opacity: 1;\n\n transform: none;\n visibility: visible;\n\n transition-delay: 0s;\n transition-duration: 0s;\n transition-timing-function: ease-in;\n }\n\n #scrim {\n position: fixed;\n inset: 0;\n\n overflow-y: scroll;\n overscroll-behavior: none;\n overscroll-behavior: contain;\n scrollbar-width: none;\n\n block-size: 100%;\n inline-size: 100%;\n\n cursor: default;\n pointer-events: inherit;\n -webkit-tap-highlight-color: transparent;\n\n opacity: 0.38;\n z-index: 0;\n\n background-color: rgb(var(--mdw-color__scrim));\n }\n\n #scrim::-webkit-scrollbar {\n display: none;\n }\n\n #scrim::after {\n content: '';\n\n display: block;\n\n block-size: 200%;\n inline-size: 200%;\n }\n @keyframes scaleUpAnimation {\n from {\n transform: scaleY(0);\n }\n\n to {\n transform: scaleY(1);\n }\n }\n\n #surface {\n --mdw-shape__size: 28px;\n\n position: relative;\n\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior: none;\n overscroll-behavior: contain;\n\n box-sizing: border-box;\n max-block-size: 100%;\n min-inline-size: 280px;\n max-inline-size: 560px;\n flex-shrink: 1;\n\n padding-block-start: 8px;\n\n transform: scale(1);\n transform-origin: top center;\n z-index: 24;\n\n will-change: display, transform;\n }\n\n #surface[icon] {\n align-items: center;\n }\n\n #surface[open] {\n animation-name: scaleUpAnimation;\n animation-duration: 200ms;\n animation-direction: forwards;\n }\n\n #icon {\n padding-block-start: 16px;\n\n font-size: 24px;\n }\n\n #headline {\n display: block;\n\n padding-block-start: 16px;\n padding-inline: 24px;\n\n font: var(--mdw-typescale__headline-small__font);\n letter-spacing: var(--mdw-typescale__headline-small__letter-spacing);\n }\n\n #headline:not([slotted]):empty {\n display: none;\n }\n\n #body {\n padding-block: 16px;\n }\n\n .content {\n padding-inline: 24px;\n }\n\n #divider-top {\n padding-block-start: 16px;\n }\n\n mdw-divider:not([size]) {\n color: transparent;\n }\n\n mdw-divider[size=\"inset\"] {\n padding-inline: 24px;\n }\n\n #fixed {\n display:block;\n\n padding-block-start: 16px;\n\n color: rgb(var(--mdw-color__on-surface-variant));\n\n font: var(--mdw-typescale__body-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n\n #fixed:not([slotted]) {\n display: none;\n }\n\n #slot {\n display:block;\n\n overflow-y: auto;\n\n color: rgb(var(--mdw-color__on-surface-variant));\n\n font: var(--mdw-typescale__body-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n\n #scroller {\n display: block;\n overflow-y: auto;\n }\n\n #form {\n display: contents;\n }\n\n #form-slot::slotted(form) {\n display: contents;\n }\n `\n .childEvents({\n dialog: {\n cancel(event) {\n event.stopPropagation();\n const cancelEvent = new Event('cancel', { cancelable: true });\n if (!this.dispatchEvent(cancelEvent)) {\n event.preventDefault();\n }\n },\n close(event) {\n event.stopPropagation();\n this.close(this.returnValue);\n },\n },\n scrim: {\n '~click'() {\n const cancelEvent = new Event('cancel', { cancelable: true });\n if (!this.dispatchEvent(cancelEvent)) return;\n this.close();\n },\n },\n surface: {\n keydown(event) {\n if (event.key === 'Tab') {\n const surface = /** @type {HTMLElement} */ (event.currentTarget);\n if (!this._isNativeModal) {\n // Move via Light or Shadow DOM, depending on target\n const context = surface.contains(event.target) ? surface : this;\n handleTabKeyPress.call(context, event);\n }\n return;\n }\n if (event.key === 'Escape' || event.key === 'Esc') {\n event.preventDefault();\n event.stopPropagation();\n const cancelEvent = new Event('cancel', { cancelable: true });\n if (this.dispatchEvent(cancelEvent)) {\n this.close();\n }\n }\n },\n },\n })\n .autoRegister('mdw-dialog');\n", "import Button from './Button.js';\n\nexport default Button\n .extend()\n .css`\n /* https://m3.material.io/components/extended-fab/specs */\n\n :host {\n --mdw-bg: var(--mdw-color__primary-container);\n --mdw-ink: var(--mdw-color__on-primary-container);\n --mdw-shape__size: 16px;\n --mdw-surface__tint: var(--mdw-surface__tint__3);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__4);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__3);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__4);\n min-inline-size: 48px;\n padding: calc(16px + (var(--mdw-density) * 2px));\n }\n\n #icon {\n font-size: 24px;\n }\n\n :host([lowered]) {\n --mdw-surface__tint: var(--mdw-surface__tint__1);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__2);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__1);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__2);\n }\n\n `\n .observe({\n filled: { empty: 'tonal' },\n elevated: { type: 'boolean', empty: true },\n })\n .autoRegister('mdw-extended-fab');\n", "import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\n\nimport Surface from './Surface.js';\n\nexport default Surface\n .mixin(AriaReflectorMixin)\n .extend()\n .set({\n _ariaRole: 'tooltip',\n })\n .observe({\n open: {\n type: 'boolean',\n changedCallback(oldValue, newValue) {\n this.updateAriaProperty('ariaHidden', newValue ? 'true' : 'false');\n },\n },\n touch: 'boolean',\n })\n .css`\n /* https://m2.material.io/components/tooltips */\n\n :host {\n --mdw-shape__size: var(--mdw-shape__extra-small);\n --mdw-ink: var(--mdw-color__on-surface-variant);\n --mdw-shape__bg: rgb(var(--mdw-color__surface-variant));\n display: block;\n vertical-align: middle;\n\n box-sizing: border-box;\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin-inline: auto;\n padding-block: 4px;\n padding-inline: 8px;\n\n pointer-events: none;\n\n opacity: 0;\n transform: scale(0);\n z-index: 24;\n\n font: var(--mdw-typescale__label-medium__font);\n letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);\n\n transition: transform 200ms, opacity 200ms;\n\n }\n\n :host([touch]) {\n padding-block: 6px;\n padding-inline: 16px;\n\n font: var(--mdw-typescale__label-large__font);\n letter-spacing: var(--mdw-typescale__label-large__letter-spacing);\n }\n\n :host([open]) {\n opacity: 1;\n transform: scale(1);\n }\n `\n .autoRegister('mdw-tooltip');\n", "/**\n * @typedef {Object} CanAnchorPopUpOptions\n * @prop {Element|DOMRect} [anchor]\n * @prop {number|'left'|'center'|'right'} [clientX]\n * @prop {number|'top'|'center'|'bottom'} [clientY]\n * @prop {number} [pageX]\n * @prop {number} [pageY]\n * @prop {Element|DOMRect} [popup]\n * @prop {number} [width]\n * @prop {number} [height]\n * @prop {number} [offsetX] Offset from anchor\n * @prop {number} [offsetY] Offset from anchor\n * @prop {number} [margin] Margin from page\n * @prop {'left'|'center'|'right'} [directionX='right']\n * @prop {'up'|'center'|'down'} [directionY='down']\n * @prop {boolean} [force=false]\n */\n\n/** @param {CanAnchorPopUpOptions} options */\nexport function canAnchorPopup(options) {\n let { pageX, pageY, directionX, directionY } = options;\n if (pageX == null || pageY == null) {\n const { clientX, clientY, anchor } = options;\n const rect = anchor instanceof Element ? anchor.getBoundingClientRect() : anchor;\n if (pageX == null) {\n switch (clientX) {\n case 'left':\n case null:\n case undefined:\n pageX = rect.left;\n directionX ??= 'right';\n break;\n case 'center':\n pageX = rect.left + rect.width / 2;\n directionX ??= 'center';\n break;\n case 'right':\n pageX = rect.right;\n directionX ??= 'left';\n break;\n default:\n pageX = rect.left + clientX;\n }\n }\n if (pageY == null) {\n switch (clientY) {\n case 'top':\n pageY = rect.top;\n directionY ??= 'up';\n break;\n case 'center':\n pageY = rect.top + rect.height / 2;\n directionY ??= 'center';\n break;\n case 'bottom':\n case null:\n case undefined:\n pageY = rect.bottom;\n directionY ??= 'down';\n break;\n default:\n pageY = rect.top + clientY;\n }\n }\n }\n let { width, height } = options;\n if (width == null || height == null) {\n const { popup } = options;\n if (popup instanceof Element) {\n width = popup.clientWidth;\n height = popup.clientHeight;\n } else {\n width = popup.width;\n height = popup.width;\n }\n }\n\n // eslint-disable-next-line default-case\n switch (directionX) {\n case 'left':\n pageX -= width;\n break;\n case 'center':\n pageX -= width / 2;\n }\n\n // eslint-disable-next-line default-case\n switch (directionY) {\n case 'up':\n pageY -= height;\n break;\n case 'center':\n pageY -= height / 2;\n }\n\n const offsetX = options.offsetX ?? 0;\n const offsetY = options.offsetY ?? 0;\n pageX += offsetX;\n pageY += offsetY;\n const margin = options.margin ?? 0;\n if (!options.force) {\n if (pageX - margin < 0) return null;\n if (pageY - margin < 0) return null;\n if (pageX + width > (document.documentElement.clientWidth - margin)) return null;\n if (pageY + height > (document.documentElement.clientHeight - margin)) return null;\n }\n\n return {\n ...options,\n offsetX,\n offsetY,\n pageX,\n pageY,\n transformOriginX: directionX === 'center' ? 'center' : (directionX === 'left' ? 'right' : 'left'),\n transformOriginY: directionY === 'center' ? 'center' : (directionY === 'up' ? 'bottom' : 'top'),\n };\n}\n", "import '../components/Tooltip.js';\nimport { canAnchorPopup } from '../utils/popup.js';\n\n/**\n * @param {ReturnType<import('./StateMixin.js').default>} Base\n */\nexport default function TooltipTriggerMixin(Base) {\n class TooltipTrigger extends Base {\n static {\n this.on({\n composed({ template, html }) {\n template.append(html`\n <mdw-tooltip role=tooltip id=tooltip>\n <slot id=tooltip-slot on-slotchange={onTooltipTriggerSlotChange} name=tooltip>{tooltip}</slot>\n </mdw-tooltip>\n `);\n },\n });\n // eslint-disable-next-line no-unused-expressions\n this.css`\n #tooltip {\n position:absolute;\n \n overflow: hidden;\n \n box-sizing: content-box;\n \n block-size: 0;\n inline-size: 0;\n margin: 0;\n padding: 0;\n \n transform: none;\n }\n \n #tooltip[open] {\n display: block;\n \n block-size: auto;\n inline-size: auto;\n \n cursor: default;\n pointer-events:auto;\n \n opacity: 0;\n transform: none;\n }\n `;\n }\n\n static TOOLTIP_MOUSE_IDLE_MS = 500;\n\n static TOOLTIP_TOUCH_IDLE_MS = 1500;\n\n /** @type {InstanceType<Tooltip>} */\n #tooltip;\n\n /** @type {any} */\n #idleDebounce;\n\n #pendingHide = false;\n\n /** @type {HTMLElement[]} */\n #watchedParents = [];\n\n #resizeObserver;\n\n #intersectObserver;\n\n onParentScroll = (event) => {\n this.updateTooltipPosition();\n };\n\n /** @param {any[]} args */\n constructor(...args) {\n super(...args);\n this.#tooltip = /** @type {InstanceType<Tooltip>} */ (this.refs.tooltip.cloneNode(true));\n this.#tooltip.removeAttribute('id');\n this.#tooltip.style.setProperty('position', 'fixed');\n this.#tooltip.setAttribute('aria-hidden', 'true');\n this.#resizeObserver = new ResizeObserver((entries) => {\n // console.log('RO', entries);\n if (!this.#tooltip.open) return;\n this.updateTooltipPosition();\n });\n const threshold = [0, 0.49, 0.5, 0.51, 1];\n this.#intersectObserver = new IntersectionObserver((entries) => {\n // console.log('IO', entries);\n if (!this.#tooltip.open) return;\n for (const entry of entries) {\n if (entry.intersectionRatio <= 0) {\n console.debug('Hide tooltip due to tooltip occlusion');\n this.hideTooltip();\n return;\n }\n if (entry.target === this.#tooltip) {\n console.debug('Reposition tooltip due to possible tooltip occlusion');\n this.updateTooltipPosition();\n return;\n }\n if (entry.target === this) {\n if (entry.intersectionRatio <= 0.5) {\n console.debug('Hiding tooltip because target is occluded');\n this.hideTooltip();\n } else {\n console.debug('Using InsectionObserver rect to update tooltip');\n this.updateTooltipPosition(entry.boundingClientRect);\n }\n return;\n }\n }\n console.debug('Updating tooltip position because offsetParent change.');\n this.updateTooltipPosition();\n }, { threshold });\n // this.#tooltip.remove();\n }\n\n /**\n * @param {Event & {currentTarget: HTMLSlotElement}} event\n * @return {void}\n */\n onTooltipTriggerSlotChange(event) {\n const tooltip = this.tooltipClone;\n tooltip.replaceChildren(\n ...event.currentTarget.assignedNodes()\n .map((child) => child.cloneNode(true)),\n );\n }\n\n /**\n * @this {TooltipTrigger} this\n * @param {FocusEvent} event\n * @return {void}\n */\n onTooltipTriggerFocus(event) {\n // console.log('getting focus', event);\n if (this.disabledState) return;\n if (this.matches(':active')) {\n // console.log('abort from active');\n return;\n }\n this.showTooltip();\n }\n\n /**\n * @this {TooltipTrigger} this\n * @param {KeyboardEvent} event\n * @return {void}\n */\n onTooltipTriggerKeydown(event) {\n if (event.ctrlKey) this.hideTooltip();\n }\n\n /**\n * @this {TooltipTrigger} this\n * @return {void}\n */\n onTooltipTriggerBlur() {\n this.hideTooltip();\n }\n\n /**\n * @param {MouseEvent|TouchEvent} event\n * @this {TooltipTrigger} this\n * @return {void}\n */\n onTooltipTriggerPointer(event) {\n if (this.disabledState) return;\n // console.log('tooltip event', event.type);\n switch (event.type) {\n case 'touchstart':\n this.scheduleShowTooltip('touch');\n break;\n case 'touchend':\n case 'touchcancel':\n this.scheduleHideTooltip('touch');\n break;\n case 'click':\n case 'mouseout':\n this.cancelShowTooltip();\n this.hideTooltip();\n break;\n case 'mousemove':\n case 'mouseover':\n this.scheduleShowTooltip('mouse');\n break;\n default:\n }\n }\n\n get tooltipClone() {\n return this.#tooltip;\n }\n\n get clonedTooltip() {\n return this.#tooltip;\n }\n\n cancelShowTooltip() {\n // console.log('cancel tooltiptimer');\n clearTimeout(this.#idleDebounce);\n }\n\n /** @param {'mouse'|'touch'|'keyboard'} type */\n scheduleHideTooltip(type) {\n clearTimeout(this.#idleDebounce);\n if (!this.#tooltip.open) {\n // console.log('abort schedule (shown)');\n return;\n }\n let timeout = 0;\n switch (type) {\n case 'mouse':\n timeout = 0;\n break;\n case 'touch':\n timeout = 1500;\n break;\n default:\n }\n // console.log('schedule tooltiptimer');\n this.#idleDebounce = setTimeout(() => {\n // console.log('hide timeout');\n this.hideTooltip();\n }, timeout);\n }\n\n /** @param {'mouse'|'touch'|'keyboard'} type */\n scheduleShowTooltip(type) {\n if (this.#tooltip.open) {\n // console.log('abort schedule (shown)');\n return;\n }\n let timeout = 0;\n switch (type) {\n case 'mouse':\n timeout = this.constructor.TOOLTIP_MOUSE_IDLE_MS;\n break;\n case 'touch':\n timeout = this.constructor.TOOLTIP_TOUCH_IDLE_MS;\n break;\n default:\n }\n // console.log('schedule tooltiptimer');\n clearTimeout(this.#idleDebounce);\n this.#idleDebounce = setTimeout(() => {\n // console.log('idle');\n this.showTooltip(type === 'touch');\n }, timeout);\n }\n\n showTooltip(touch = false) {\n if (this.#tooltip.open) return;\n this.refs.tooltip.open = true;\n this.refs.tooltip.touch = touch;\n this.#tooltip.touch = touch;\n document.body.append(this.#tooltip);\n this.updateTooltipPosition();\n this.#resizeObserver.observe(this, { box: 'border-box' });\n this.#intersectObserver.observe(this);\n this.#intersectObserver.observe(this.#tooltip);\n /** @type {HTMLElement} */\n let offsetParent = this;\n while ((offsetParent = offsetParent.offsetParent)) {\n this.#resizeObserver.observe(offsetParent, { box: 'border-box' });\n // console.log('observing', offsetParent);\n this.#watchedParents.push(offsetParent);\n this.#intersectObserver.observe(offsetParent);\n offsetParent.addEventListener('scroll', this.onParentScroll);\n }\n window.addEventListener('scroll', this.onParentScroll);\n\n // console.log('offsetparent', this.offsetParent);\n\n this.#tooltip.open = true;\n }\n\n hideTooltip() {\n this.#resizeObserver.disconnect();\n this.#intersectObserver.disconnect();\n let parent;\n while ((parent = this.#watchedParents.pop())) {\n parent.removeEventListener('scroll', this.onParentScroll);\n }\n window.removeEventListener('scroll', this.onParentScroll);\n this.#tooltip.open = false;\n this.#tooltip.remove();\n this.refs.tooltip.open = false;\n const hoverStyle = this.refs.tooltip.style;\n hoverStyle.removeProperty('width');\n hoverStyle.removeProperty('height');\n }\n\n /**\n * @param {DOMRect} [domRect]\n * @return {void}\n */\n updateTooltipPosition(domRect) {\n const offset = 8;\n // const margin = 8;\n /** @type {import('../utils/popup.js').CanAnchorPopUpOptions} */\n const anchorOptions = {\n anchor: domRect ?? this.getBoundingClientRect(),\n width: this.#tooltip.clientWidth,\n height: this.#tooltip.clientHeight,\n // margin,\n };\n\n const isPageRTL = (getComputedStyle(this).direction === 'rtl');\n const xStart = isPageRTL ? 'right' : 'left';\n const xEnd = isPageRTL ? 'left' : 'right';\n /** @type {import('../utils/popup.js').CanAnchorPopUpOptions[]} */\n const preferences = [\n { clientY: 'bottom', clientX: 'center', offsetY: offset },\n { clientY: 'bottom', clientX: xStart, offsetY: offset },\n { clientY: 'bottom', clientX: xEnd, offsetY: offset },\n { clientY: 'top', clientX: 'center', offsetY: -offset },\n { clientY: 'top', clientX: xStart, offsetY: -offset },\n { clientY: 'top', clientX: xEnd, offsetY: -offset },\n ];\n\n let anchorResult;\n for (const preference of preferences) {\n anchorResult = canAnchorPopup({\n ...anchorOptions,\n ...preference,\n });\n if (anchorResult) break;\n }\n\n // console.log({ anchorResult });\n if (!anchorResult) {\n anchorResult = canAnchorPopup({\n ...anchorOptions,\n ...preferences[0],\n force: true,\n });\n }\n\n this.#tooltip.style.setProperty('top', `${anchorResult.pageY}px`);\n this.#tooltip.style.setProperty('left', `${anchorResult.pageX}px`);\n this.#tooltip.style.setProperty('margin', '0');\n this.#tooltip.style.setProperty('transform-origin', `${anchorResult.transformOriginY} ${anchorResult.transformOriginX}`);\n\n const hoverStyle = this.refs.tooltip.style;\n hoverStyle.setProperty('width', `${anchorResult.width + (anchorResult.offsetX * 2)}px`);\n hoverStyle.setProperty('height', `${anchorResult.height + (anchorResult.offsetY)}px`);\n if (anchorResult.clientY === 'bottom') {\n hoverStyle.setProperty('top', '100%');\n hoverStyle.removeProperty('bottom');\n } else {\n hoverStyle.removeProperty('top');\n hoverStyle.setProperty('height', `${anchorResult.height + (anchorResult.offsetY)}px`);\n hoverStyle.setProperty('bottom', '100%');\n }\n switch (anchorResult.clientX) {\n case 'left':\n hoverStyle.setProperty('left', '0');\n hoverStyle.removeProperty('right');\n break;\n default:\n case 'center':\n hoverStyle.removeProperty('left');\n hoverStyle.removeProperty('right');\n break;\n case 'right':\n hoverStyle.removeProperty('left');\n hoverStyle.setProperty('right', '0');\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n for (const type of ['click', 'mousedown', 'mousemove', 'mouseout',\n 'touchmove', 'touchstart', 'touchend', 'touchleave', 'touchcancel']) {\n this.addEventListener(type, this.onTooltipTriggerPointer, { passive: true });\n }\n this.addEventListener('focus', this.onTooltipTriggerFocus);\n this.addEventListener('blur', this.onTooltipTriggerBlur);\n this.addEventListener('keydown', this.onTooltipTriggerKeydown, { passive: true });\n }\n\n disconnectedCallback() {\n // console.log('disconnected');\n this.hideTooltip();\n super.disconnectedCallback();\n }\n }\n TooltipTrigger.prototype.tooltip = TooltipTrigger.prop('tooltip');\n return TooltipTrigger;\n}\n", "import TooltipTriggerMixin from '../mixins/TooltipTriggerMixin.js';\n\nimport ExtendedFab from './ExtendedFab.js';\n\nexport default ExtendedFab\n .mixin(TooltipTriggerMixin)\n .extend()\n .observe({\n fabSize: {\n /** @type {null|'small'|'large'} */\n value: null,\n },\n })\n .css`\n /* https://m3.material.io/components/floating-action-button/specs */\n\n :host {\n min-inline-size: 24px;\n }\n\n #icon {\n font-size: 24px;\n }\n\n #icon[fab-size=\"large\"] {\n font-size: 36px;\n }\n\n :host([fab-size=\"small\"]) {\n --mdw-shape__size: 12px;\n padding: calc(8px + (var(--mdw-density) * 2px));\n }\n\n :host([fab-size=\"large\"]) {\n --mdw-shape__size: 28px;\n padding: calc(30px + (var(--mdw-density) * 2px));\n }\n\n `\n .on({\n composed() {\n const { slot, tooltipSlot, control, shape, icon } = this.refs;\n slot.remove();\n tooltipSlot.removeAttribute('name');\n control.setAttribute('aria-labelledby', 'tooltip');\n shape.setAttribute('fab-size', '{fabSize}');\n icon.setAttribute('fab-size', '{fabSize}');\n },\n })\n .autoRegister('mdw-fab');\n", "import './Icon.js';\n\nimport Chip from './Chip.js';\n\nexport default Chip\n .extend()\n .observe({\n type: { empty: 'checkbox' },\n dropdown: 'boolean',\n trailingSrc: 'string',\n trailingIcon: 'string',\n })\n .expressions({\n computedTrailingIcon: ({ trailingIcon, dropdown, trailingSrc }) => {\n if (trailingIcon) return trailingIcon;\n if (dropdown) return 'arrow_drop_down';\n if (trailingSrc) return '';\n return null;\n },\n })\n .html/* html */`\n <mdw-icon _if={!icon} id=check-icon disabled={disabledState} selected={checked} aria-hidden=true>check</mdw-icon>\n <mdw-icon _if={computedTrailingIcon} id=trailing-icon aria-hidden=true src={trailingSrc}>{computedTrailingIcon}</mdw-icon>\n `\n .on({\n composed() {\n const { shape, icon, control, outline, slot, trailingIcon, checkIcon } = this.refs;\n\n shape.setAttribute('selected', '{checked}');\n shape.setAttribute('icon', '');\n shape.setAttribute('trailing-icon', '{computedTrailingIcon}');\n icon.setAttribute('_if', '{icon}');\n icon.setAttribute('ink', '{iconInk}');\n\n control.removeAttribute('role');\n control.setAttribute('type', 'checkbox');\n\n outline.removeAttribute('ink');\n outline.removeAttribute('color');\n outline.setAttribute('selected', '{checked}');\n\n slot.removeAttribute('ink');\n slot.removeAttribute('color');\n\n slot.before(checkIcon);\n slot.after(trailingIcon);\n },\n })\n .css`\n /* https://m3.material.io/components/chips/specs */\n\n /* Filter Chips can be elevated */\n\n :host {\n --mdw-ink: var(--mdw-color__on-secondary-container);\n --mdw-bg: var(--mdw-color__secondary-container);\n gap: 8px;\n\n padding-inline-start: max(4px, calc(8px + (var(--mdw-density) * 2px)));\n padding-inline-end: max(12px, calc(16px + (var(--mdw-density) * 2px)));\n\n color: rgb(var(--mdw-color__on-surface-variant));\n\n }\n\n :host(:focus) {\n --mdw-outline__rgb: var(--mdw-color__outline);\n }\n\n #icon[selected] {\n font-variation-settings: 'FILL' 1;\n }\n\n #shape {\n background-color: transparent;\n }\n\n :host(:where([trailing-icon],[dropdown],[trailing-src])) {\n padding-inline-start: max(4px, calc(8px + (var(--mdw-density) * 2px)));\n }\n\n #shape[elevated] {\n background-color: rgb(var(--mdw-color__surface));\n }\n\n #shape[selected] {\n background-color: rgb(var(--mdw-bg));\n }\n\n :host([selected]) {\n color: rgb(var(--mdw-ink));\n }\n\n #outline[selected] {\n opacity: 0;\n }\n\n #trailing-icon {\n position: relative;\n\n font-size: 18px;\n }\n\n .mdw-chip__checkbox {\n position: absolute;\n\n max-block-size: 0;\n max-inline-size: 0;\n\n appearance: none;\n pointer-events: none;\n }\n\n #check-icon {\n font-size: 0;\n }\n\n #check-icon[selected] {\n font-size: 18px;\n }\n\n #check-icon[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #shape[disabled]:is([elevated],[selected]) {\n background-color: rgba(var(--mdw-color__on-surface), 0.12);\n /* color: rgba(var(--mdw-color__on-surface), 0.38); */\n }\n\n `\n .autoRegister('mdw-filter-chip');\n", "import ThemableMixin from '../mixins/ThemableMixin.js';\n\nimport Box from './Box.js';\n\nexport default Box\n .mixin(ThemableMixin)\n .extend()\n .observe({\n ariaLevel: 'string',\n size: {\n type: 'string',\n /** @type {'large'|'medium'|'small'} */\n empty: 'large',\n },\n })\n .expressions({\n computeAriaLevel({ ariaLevel, size }) {\n if (ariaLevel) return ariaLevel;\n if (size === 'medium') return '2';\n if (size === 'small') return '3';\n return '1';\n },\n })\n .on({\n composed() {\n const { slot } = this.refs;\n slot.setAttribute('role', 'heading');\n slot.setAttribute('aria-level', '{computeAriaLevel}');\n },\n })\n .css`\n :host {\n font: var(--mdw-typescale__headline-large__font);\n letter-spacing: var(--mdw-typescale__headline-large__letter-spacing);\n }\n \n :host([size=\"medium\"]) {\n font: var(--mdw-typescale__headline-medium__font);\n letter-spacing: var(--mdw-typescale__headline-medium__letter-spacing);\n }\n \n :host([size=\"small\"]) {\n font: var(--mdw-typescale__headline-small__font);\n letter-spacing: var(--mdw-typescale__headline-small__letter-spacing);\n } \n `\n .autoRegister('mdw-headline');\n", "import TooltipTriggerMixin from '../mixins/TooltipTriggerMixin.js';\n\nimport Button from './Button.js';\n\nexport default Button\n .mixin(TooltipTriggerMixin)\n .extend()\n .observe({\n _ariaPressed: {\n get({ type, checked }) {\n if (type !== 'checkbox') return null;\n return checked ? 'true' : 'false';\n },\n },\n })\n .expressions({\n isToggle({ type }) {\n return type === 'checkbox';\n },\n })\n .childEvents({\n control: {\n keydown(event) {\n if (event.key !== 'Enter') return;\n const input = /** @type {HTMLInputElement} */ (event.currentTarget);\n if (input.type !== 'checkbox') return;\n event.stopImmediatePropagation();\n event.stopPropagation();\n event.preventDefault();\n if (input.disabled) return;\n\n // Simulate click\n const clickEvent = new Event('click', { bubbles: true, cancelable: true, composed: true });\n if (!input.dispatchEvent(clickEvent)) return;\n\n // Toggle check and signal\n input.checked = !input.checked;\n input.dispatchEvent(new Event('change', { bubbles: true }));\n },\n },\n })\n .on({\n composed() {\n const { slot, shape, tooltipSlot, icon, label, surfaceTint, control, outline } = this.refs;\n shape.classList.add('colored');\n label.classList.add('colored');\n for (const el of [shape, label, icon]) {\n el.setAttribute('toggle', '{isToggle}');\n el.setAttribute('selected', '{checked}');\n }\n slot.remove();\n icon.removeAttribute('_if');\n tooltipSlot.removeAttribute('name');\n\n surfaceTint.remove();\n\n control.setAttribute('aria-pressed', '{_ariaPressed}');\n control.setAttribute('aria-labelledby', 'tooltip');\n\n outline.setAttribute('selected', '{checked}');\n },\n })\n .css`\n /* https://m3.material.io/components/icon-buttons/specs */\n\n :host {\n --mdw-shape__size: var(--mdw-shape__full);\n --mdw-ink: rgb(var(--mdw-color__on-surface-variant));\n\n align-items: center;\n justify-content: center;\n\n padding: max(8px, calc(8px + (var(--mdw-density) * 2px)));\n\n background-color: transparent;\n\n font-size: 24px;\n }\n\n :host(:where([type=\"checkbox\"])) {\n --mdw-ink: var(--mdw-color__primary);\n }\n\n /** Filled | Filled Checked */\n :host(:where([filled])) {\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-bg: var(--mdw-color__primary);\n --mdw-surface__shadow__resting: none;\n --mdw-surface__shadow__raised: none;\n }\n\n /** Tonal | Tonal Checked */\n :host(:where([filled=\"tonal\"])) {\n --mdw-ink: var(--mdw-color__on-secondary-container);\n --mdw-bg: var(--mdw-color__secondary-container);\n }\n\n /** Outlined | Outlined Unchecked */\n :host(:where([outlined])) {\n --mdw-ink: var(--mdw-color__on-surface-variant);\n }\n\n /** Outlined | Outlined Unchecked */\n :host(:where([outlined][type=\"checkbox\"])) {\n --mdw-bg: var(--mdw-color__inverse-surface);\n --mdw-ink: var(--mdw-color__inverse-on-surface);\n }\n\n #label {\n font-size: inherit;\n letter-spacing: inherit;\n }\n\n #shape[toggle] {\n background-color: transparent;\n }\n\n .colored[toggle] {\n color: rgb(var(--mdw-color__on-surface-variant));\n }\n\n .colored[selected] {\n /* background-color: rgb(var(--mdw-bg)); */\n color: rgb(var(--mdw-ink));\n }\n\n #shape[filled][toggle] {\n background-color: rgb(var(--mdw-color__surface-variant));\n }\n\n .colored[filled][toggle] {\n color: rgb(var(--mdw-bg));\n }\n\n #shape[filled=\"tonal\"][toggle] {\n background-color: rgb(var(--mdw-color__surface-variant));\n }\n\n .colored[filled=\"tonal\"][toggle] {\n color: rgb(var(--mdw-color__on-surface-variant));\n }\n\n #shape[filled][selected] {\n background-color: rgb(var(--mdw-bg));\n }\n\n .colored[filled][selected] {\n color: rgb(var(--mdw-ink));\n }\n\n #shape[outlined] {\n background-color: transparent;\n }\n\n .colored[outlined] {\n color: inherit;\n }\n\n #shape[outlined][toggle] {\n background-color: transparent;\n }\n\n .colored[outlined][toggle] {\n color: rgb(var(--mdw-color__on-surface-variant));\n }\n\n #shape[outlined][selected] {\n background-color: rgb(var(--mdw-bg));\n }\n\n .colored[outlined][selected] {\n color: rgb(var(--mdw-ink));\n }\n\n #icon {\n font-size: inherit;\n font-variation-settings: 'FILL' 1;\n }\n\n #icon[toggle] {\n font-variation-settings: 'FILL' 0;\n }\n\n #icon[selected] {\n font-variation-settings: 'FILL' 1;\n }\n\n #outline[focused] {\n opacity: 1;\n\n color: inherit;\n }\n\n #outline[selected] {\n opacity: 0;\n }\n\n /** Disabled */\n .colored[disabled] {\n cursor: not-allowed;\n\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #shape[disabled][filled],\n #shape[disabled][outlined][selected] {\n background-color: rgba(var(--mdw-color__on-surface), 0.12);\n }\n\n .colored[disabled][filled],\n .colored[disabled][outlined][selected] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n `\n .autoRegister('mdw-icon-button');\n", "import '../components/Icon.js';\nimport DensityMixin from './DensityMixin.js';\nimport ShapeMixin from './ShapeMixin.js';\n\n/** @typedef {import('../core/CustomElement.js').default} CustomElement */\n\n/**\n * @param {ReturnType<import('./ControlMixin.js').default>} Base\n */\nexport default function TextFieldMixin(Base) {\n return Base\n .mixin(DensityMixin)\n .mixin(ShapeMixin)\n .extend()\n .set({\n stateLayer: true,\n })\n .observe({\n type: { empty: 'text' },\n icon: 'string',\n label: 'string',\n filled: 'boolean',\n outlined: 'boolean',\n inputPrefix: 'string',\n inputSuffix: 'string',\n trailingIcon: 'string',\n trailingIconInk: 'string',\n supporting: 'string',\n error: 'string',\n placeholder: { nullParser: String }, // DOMString\n })\n .observe({\n erroredState({ error, _invalid }) { return Boolean(error || _invalid); },\n })\n .expressions({\n computePlaceholder({ filled, outlined, label, placeholder }) {\n if (filled || outlined) return placeholder;\n return placeholder ?? label;\n },\n\n shouldShowSupporting({ _invalid, error, supporting }) {\n return _invalid || ((error ?? supporting) != null);\n },\n\n computeSupportingText({ error, _validationMessage, supporting }) {\n return (error || _validationMessage || supporting) ?? '';\n },\n\n populatedState({ value, _badInput }) {\n return !!value || _badInput;\n },\n _showLabelText({ label, filled, outlined }) {\n return label && (filled || outlined);\n },\n })\n .on({\n composed({ template, html, inline }) {\n const { control, label: labelElement, outline, shape, outlineLeft, outlineRight, state } = this.refs;\n control.setAttribute('type', 'text');\n control.setAttribute('placeholder', '{computePlaceholder}');\n control.setAttribute('aria-label', '{label}');\n control.setAttribute('input-suffix', '{inputSuffix}');\n control.setAttribute('errored', '{erroredState}');\n control.removeAttribute('aria-labelledby');\n control.classList.add('inline');\n\n labelElement.classList.add('shape');\n labelElement.setAttribute('filled', '{filled}');\n labelElement.setAttribute('color', '{color}');\n labelElement.setAttribute('icon', '{icon}');\n labelElement.setAttribute('shape-style', '{shapeStyle}');\n labelElement.setAttribute('trailingIcon', '{trailingIcon}');\n labelElement.setAttribute('populated', '{populatedState}');\n labelElement.setAttribute('outlined', '{outlined}');\n labelElement.setAttribute('focused', '{focusedState}');\n labelElement.setAttribute('label', '{label}');\n labelElement.setAttribute('shape-top', inline(({ shapeTop, filled }) => shapeTop || filled));\n labelElement.append(\n state,\n outline,\n html`\n <mdw-icon _if={icon} id=icon aria-hidden=true disabled={disabledState}>{icon}</mdw-icon>\n <span _if={inputPrefix} class=inline id=prefix aria-hidden=true focused={focusedState} populated={populatedState}>{inputPrefix}</span>\n <span _if={inputSuffix} class=inline id=suffix aria-hidden=true focused={focusedState} populated={populatedState}>{inputSuffix}</span>\n <mdw-icon _if={trailingIcon} id=trailing-icon ink={trailingIconInk} aria-hidden=true disabled={disabledState}>{trailingIcon}</mdw-icon>\n <div id=indicator _if={filled} focused={focusedState} hovered={hoveredState} errored={erroredState} disabled={disabledState} ></div>\n `,\n );\n\n outline.setAttribute('invalid', '{invalid}');\n outline.setAttribute('errored', '{erroredState}');\n outlineLeft.after(html`\n <div id=gap _if={label} label={label} populated={populatedState} focused={focusedState}>\n <div id=gap-slot focused={focusedState}></div>\n <span id=gap-label>{label}</span>\n </div>\n `);\n\n outlineLeft.setAttribute('focused', '{focusedState}');\n outlineRight.setAttribute('focused', '{focusedState}');\n\n shape.remove();\n state.setAttribute('_if', '{!outlined}');\n\n template.append(html`\n <div id=label-text _if={_showLabelText} aria-hidden=true\n outlined={outlined}\n populated={populatedState}\n focused={focusedState}\n icon={icon}\n trailing-icon={trailingIcon}\n disabled={disabledState}\n errored={erroredState}>{label}</div>\n <div _if={shouldShowSupporting} id=supporting disabled={disabledState} errored={erroredState}>\n {computeSupportingText}\n <slot id=supporting-slot name=supporting></slot>\n </div>\n `);\n },\n sizeChanged(oldValue, newValue) {\n this.refs.control.style.setProperty('--size', `${newValue}ch`);\n },\n })\n .css`\n /* https://m3.material.io/components/text-fields/specs */\n\n /**\n * States: Enabled / Hover / Focus / Error / Error Hover / Error Focus\n * Input: on-surface / on-surface / on-surface / on-surface / on-surface / on-surface\n * Inline: on-surface-variant / on-surface-variant / on-surface-variant / on-surface-variant / on-surface-variant / on-surface-variant\n * Label: on-surface-variant / on-surface* / ink / error / on-error-container / error\n * Indicator: on-surface-variant / on-surface / ink / error / on-error-container / error\n * Caret: (any) / (any) / ink / (any) / (any) / error\n * Outline: outline / on-surface / ink / error / on-error-container / error\n * Selection: on-* / on-* / ink / error / on-error-container / error\n *\n *\n * *Filled hovered unpopulated label may be on-surface-variant instead\n *\n * Input: Always on-surface\n * Inline: Always on-surface-variant\n * Indicator: same as label\n * Label: same as indicator\n * Outline: outline default, same as label+indicator on :hover or :focus\n * Caret: same as label+indicator+outline (cannot inherit color or use currentColor)\n * Selection: (cannot inherit color or use currentColor)\n */\n\n :host {\n --mdw-shape__size: var(--mdw-shape__extra-small);\n /* --mdw-shape__size: 8px; */\n /* --mdw-shape__size__bottom-start-size: var(--mdw-shape__size); */\n /* --mdw-shape__size__bottom-end-size: var(--mdw-shape__size); */\n --mdw-text-field__ratio: calc(var(--mdw-density) * 0.125 + 1);\n\n --control__margin-top: calc(var(--mdw-typescale__body-small__line-height) / 2);\n --control__padding-top: calc((var(--mdw-text-field__ratio) * 16px) - calc(var(--mdw-typescale__body-small__line-height) / 2));\n --control__padding-bottom: calc(var(--mdw-text-field__ratio) * 16px);\n --control__margin-bottom: 0px;\n\n --inline-color: rgb(var(--mdw-color__on-surface-variant));\n\n --descriptor-opacity: 0.5;\n --mdw-ink: var(--mdw-color__primary);\n --mdw-bg: var(--mdw-color__surface-variant);\n\n --mdw-type__font: var(--mdw-typescale__body-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__body-large__letter-spacing);\n\n display: inline-block;\n\n /* State layer */\n color: rgb(var(--mdw-color__on-surface));\n\n font: var(--mdw-type__font);\n letter-spacing: var(--mdw-type__letter-spacing);\n }\n\n :host([icon]) {\n --padding-inline-start: 12px;\n }\n\n :host([trailing-icon]) {\n --padding-inline-end: 12px;\n }\n\n :host(:is([color], [ink])) {\n background-color: transparent;\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #label {\n position: relative;\n\n display: flex;\n\n align-items: center;\n overflow: visible;\n\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n\n cursor: inherit;\n\n z-index: 0;\n\n background-color: transparent;\n\n font-weight: inherit;\n font-size: inherit;\n line-height: inherit;\n font-family: inherit;\n letter-spacing: inherit;\n\n transition: none 200ms cubic-bezier(0.0, 0.0, 0.2, 1);\n }\n\n #label:is([filled],[color]) {\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #label[outlined] {\n background-color: transparent;\n }\n\n #label-text,\n #indicator {\n color: rgb(var(--mdw-color__on-surface-variant))\n }\n\n :is(#label-text, #indicator)[focused] {\n color: rgb(var(--mdw-ink))\n }\n\n #label[icon] {\n padding-inline-start: 12px;\n }\n\n #label[trailing-icon] {\n padding-inline-end: 12px;\n }\n\n #label[focused] {\n transition: none 100ms cubic-bezier(0.4, 0.0, 1, 1);\n }\n\n #label[shape-top] {\n --mdw-shape__size__bottom-start-size: 0px;\n --mdw-shape__size__bottom-end-size: 0px;\n --mdw-shape__mask: linear-gradient(transparent 50%, black 50%);\n }\n\n #prefix,\n #suffix,\n #control::placeholder {\n opacity: var(--descriptor-opacity);\n\n color: var(--inline-color);\n\n transition-duration: inherit;\n transition-property: opacity;\n transition-timing-function: inherit;\n will-change: opacity;\n }\n\n :host([label]:is([filled],[outlined])) {\n --descriptor-opacity: 0;\n }\n\n #control {\n position: relative;\n inset: auto;\n align-self: flex-start;\n\n display: inline;\n\n box-sizing: border-box;\n\n block-size: auto;\n min-block-size: none;\n inline-size: 100%;\n min-inline-size: none;\n flex: 1;\n border-block-start: solid var(--control__margin-top) transparent;\n border-block-end: solid var(--control__margin-bottom) transparent;\n padding-block: var(--control__padding-top) var(--control__padding-bottom);\n\n appearance: none;\n caret-color: rgb(var(--mdw-ink));\n cursor: auto;\n\n transform: none;\n\n visibility: visible;\n\n background-color: transparent;\n border-color: transparent;\n color: inherit;\n /* rgb(var(--mdw-color__on-surface)); */\n\n font-weight: inherit;\n font-size: inherit;\n line-height: inherit;\n font-family: inherit;\n letter-spacing: inherit;\n\n transition-duration: inherit;\n transition-property: color;\n transition-timing-function: inherit;\n }\n\n #suffix,\n #prefix {\n /* Symmetrical to allow centering */\n margin-block: var(--control__margin-top) var(--control__margin-bottom);\n padding-block: var(--control__padding-top) var(--control__padding-bottom);\n }\n\n /* stylelint-disable-next-line plugin/no-unsupported-browser-features */\n #control::selection {\n background-color: rgb(var(--mdw-ink));\n color: rgb(var(--mdw-color__surface));\n }\n\n #state {\n --mdw-state__focus-opacity: 0;\n --mdw-state__pressed-opacity: 0;\n }\n\n mdw-icon {\n --mdw-icon__size: 24px;\n align-self: center;\n\n color: var(--inline-color);\n }\n\n #icon {\n order: -2;\n\n margin-inline-end: 16px;\n\n font-size: 24px;\n }\n\n #prefix {\n order: -1;\n }\n\n #suffix {\n order: 1;\n }\n\n #trailing-icon {\n order: 2;\n\n margin-inline-start: 16px;\n }\n\n #indicator {\n position: absolute;\n inset-block-end: 0;\n inset-inline: 0;\n\n border-block-end: 2px solid currentColor;\n\n pointer-events: none;\n\n transform: scaleY(0.5);\n z-index: 1; /* Force new layer to avoid repaint */\n\n transition-duration: inherit;\n transition-property: transform;\n transition-timing-function: inherit;\n will-change: transform;\n }\n\n #indicator[focused] {\n transform: scaleY(1);\n\n }\n\n /** Label Text **/\n\n #label-text {\n position: absolute;\n inset-block-start: 0;\n inset-inline: 0;\n\n display: block;\n overflow-x: clip;\n overflow-y: visible;\n\n padding-inline: 16px;\n\n pointer-events: none;\n\n opacity: 1;\n transform: translateY(calc((var(--control__margin-top) + var(--control__padding-top) + 100% + var(--control__padding-bottom) + var(--control__margin-bottom)) / 2)) translateY(-50%);\n z-index: 4;\n /* FireFox bug */\n\n color: rgb(var(--mdw-color__on-surface-variant));\n\n text-overflow: ellipsis;\n white-space: nowrap;\n\n transition-duration: 200ms;\n transition-property: inset-inline-start, font-size, transform;\n /* transition-timing-function: inherit; */\n /*Expand*/\n\n will-change: inset-inline-start, font-size, transform;\n }\n\n @supports (-moz-appearance:none ) {\n #label-text {\n /* Firefox clips Y as well as X */\n overflow-x: hidden;\n }\n }\n\n #label-text[focused] {\n color: rgb(var(--mdw-ink));\n }\n\n #label-text[icon] {\n inset-inline-start: calc(12px + 24px);\n }\n\n #label-text[trailing-icon] {\n inset-inline-end: calc(24px + 12px);\n }\n\n #label-text:is([focused], [populated]) {\n transform: translateY(calc(var(--mdw-text-field__ratio) * 8px));\n\n font: var(--mdw-typescale__body-small__font);\n /* Not spec: Should only use font-size and line-height */\n letter-spacing: var(--mdw-typescale__body-small__letter-spacing);\n }\n\n #label-text[outlined]:is([focused], [populated]) {\n inset-inline: 0;\n\n transform: translateY(-50%);\n }\n\n #label[label][outlined] {\n /** Guard against bleed */\n --mdw-shape__size__top-start-size: min(var(--mdw-shape__size), 12px);\n --mdw-shape__size__bottom-start-size: min(var(--mdw-shape__size), 12px);\n --mdw-shape__size__top-end-size: min(var(--mdw-shape__size), 12px);\n --mdw-shape__size__bottom-end-size: min(var(--mdw-shape__size), 12px);\n -webkit-mask-box-image-width: min(var(--mdw-shape__size), 12px);\n }\n\n :is(#prefix, #suffix):is([focused], [populated]) {\n opacity: 1;\n }\n\n /* If no label */\n #control:is(:focus, :not(:placeholder-shown))::placeholder {\n opacity: 0.70;\n }\n\n #control[input-suffix] {\n text-align: end;\n }\n\n /** Outlined **/\n\n #outline::before {\n content: none;\n }\n\n .outline-section {\n position: relative;\n\n border: 1px solid currentColor;\n }\n\n .outline-section[focused] {\n border-width: 2px;\n }\n\n #outline-left {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-right-width: 0;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-top-left-radius: inherit;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-bottom-left-radius: inherit;\n }\n\n #outline-right {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-left-width: 0;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-top-right-radius: inherit;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-bottom-right-radius: inherit;\n }\n\n #outline {\n display: grid;\n grid-auto-flow: column;\n grid-template-columns: 12px minmax(0,auto) minmax(12px, 1fr);\n\n color: rgb(var(--mdw-color__outline));\n\n\n }\n\n #outline[hovered] {\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #outline[focused] {\n color: rgb(var(--mdw-ink));\n }\n\n .outline-section {\n min-inline-size: 12px;\n }\n\n .outline-section::before,\n .outline-section::after {\n max-inline-size: none;\n }\n\n .outline-left {\n grid-column: calc(2 - var(--mdw-dir, 1)) / span 1; /* 1 on LTR, 3 on RTL */\n }\n\n .outline-right {\n grid-column: calc(2 + var(--mdw-dir, 1)) / span 1;\n }\n\n #gap {\n position: relative;\n\n display: inline-block;\n overflow: clip hidden;\n\n max-inline-size: 100%;\n grid-column: 2;\n\n font: var(--mdw-typescale__body-small__font);\n /* Not spec: Should only use font-size and line-height */\n letter-spacing: var(--mdw-typescale__body-small__letter-spacing);\n\n /* Close gap */\n transition-duration: inherit;\n transition-property: padding;\n transition-timing-function: inherit;\n }\n\n #gap-label {\n display: inline-block;\n overflow: clip hidden;\n\n padding-inline: 4px;\n\n color:transparent;\n\n white-space: nowrap;\n }\n\n #gap::after {\n content: '';\n\n position: absolute;\n inset: 0;\n\n border-block-end: solid 1px currentColor;\n }\n\n #gap[focused]::after {\n border-block-end-width: 2px;\n }\n\n #gap-slot {\n position: absolute;\n inset: 0;\n\n }\n\n #gap-slot::before,\n #gap-slot::after {\n content: '';\n\n position: absolute;\n inset: 0;\n\n border-block-start: solid 1px currentColor;\n\n transition: transform 200ms;\n will-change: transform;\n }\n\n #gap-slot[focused]::before,\n #gap-slot[focused]::after {\n border-block-start-width: 2px;\n }\n\n @supports(-webkit-mask-box-image: none) {\n #outline[focused] {\n /** Fake 2px outline */\n filter:\n drop-shadow(1px 0px 0px currentColor)\n drop-shadow(0px 1px 0px currentColor)\n drop-shadow(-1px 0px 0px currentColor)\n drop-shadow(0px -1px 0px currentColor);\n }\n\n #outline::before {\n content: '';\n\n position: absolute;\n inset: 0;\n\n grid-column: calc(2 - var(--mdw-dir, 1)) / span 1;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n margin-right: -0.99px;\n border: none;\n\n background-color: currentColor;\n -webkit-mask-box-image: var(--mdw-shape__mask-image__edges)\n 8 fill /\n auto\n stretch;\n -webkit-mask-box-image-width: auto 0 auto auto;\n }\n\n #outline::after {\n grid-column: calc(2 + var(--mdw-dir, 1)) / span 1;\n grid-row: 1;\n\n /* stylelint-disable-next-line liberty/use-logical-spec */\n margin-left: -0.99px;\n -webkit-mask-box-image-width: auto auto auto 0;\n }\n\n .outline-section {\n border: none;\n }\n\n #gap::after {\n border: none;\n\n background-color: currentColor;\n -webkit-mask-box-image: var(--mdw-shape__mask-image__edges)\n 8 fill /\n auto\n stretch;\n -webkit-mask-box-image-width: 0 0 auto 0;\n }\n\n #gap-slot::before,\n #gap-slot::after {\n border: none;\n\n background-color: currentColor;\n\n -webkit-mask-box-image: var(--mdw-shape__mask-image__edges)\n 8 fill /\n auto\n stretch;\n -webkit-mask-box-image-width: auto 0 0 0;\n }\n }\n\n #gap-slot::before {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n margin-right: -0.99px;\n\n transform: var(--gap-transform, scaleX(0.5));\n transform-origin: 0 0;\n }\n\n #gap-slot::after {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n margin-left: -0.99px;\n\n transform: var(--gap-transform, scaleX(0.5));\n transform-origin: 100% 0;\n }\n\n #gap:is([focused], [populated]) {\n /* Open gap */\n --gap-transform: scaleX(0);\n }\n\n #gap:empty {\n padding: 0;\n }\n\n #label[label][filled] {\n align-items: flex-start;\n }\n\n :host([filled]) {\n --mdw-shape__size__bottom-start-size: 0px;\n --mdw-shape__size__bottom-end-size: 0px;\n --mdw-text-field__ratio: calc(var(--mdw-density) * 0.25 + 1);\n }\n\n :host(:is([filled][label])) {\n --control__margin-top: calc((var(--mdw-text-field__ratio) * 8px) + var(--mdw-typescale__body-small__line-height));\n --control__padding-top: 0px;\n --control__padding-bottom: calc(var(--mdw-text-field__ratio) * 4px);\n --control__margin-bottom: calc(var(--mdw-text-field__ratio) * 4px);\n }\n\n #supporting {\n min-block-size: var(--mdw-typescale__body-small__line-height);\n margin-block-start: 4px;\n margin-inline: 16px;\n\n font-weight: var(--mdw-typescale__body-small__font-weight); /* Not spec */\n font-size: var(--mdw-typescale__body-small__font-size);\n line-height: var(--mdw-typescale__body-small__line-height);\n font-family: var(--mdw-typescale__body-small__font-family); /* Not spec */\n letter-spacing: var(--mdw-typescale__body-small__letter-spacing); /* Not spec */\n }\n\n /* Error States */\n\n #control[errored] {\n caret-color: rgb(var(--mdw-color__error));\n }\n\n #control[errored]::selection {\n background-color: rgb(var(--mdw-color__on-error-container));\n }\n\n :is(#indicator, #label-text, #supporting, #outline)[errored] {\n color: rgb(var(--mdw-color__error));\n }\n\n :is(#indicator, #label-text, #supporting, #outline)[errored]:where([hovered]) {\n color: rgb(var(--mdw-color__on-error-container));\n }\n\n :is(#indicator, #label-text, #supporting, #outline)[errored]:where([focused]) {\n color: rgb(var(--mdw-color__error));\n }\n\n /* stylelint-disable-next-line selector-max-compound-selectors */\n #label[disabled],\n #label[disabled] #control {\n cursor: not-allowed;\n }\n\n #outline[disabled] {\n color: rgba(var(--mdw-color__outline), 0.12);\n }\n\n #label-text[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #supporting[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n .inline[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n mdw-icon[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #label[disabled] {\n background-color: rgba(var(--mdw-color__on-surface), calc(0.04));\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #indicator[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #label[disabled][outlined] {\n background-color: transparent;\n }\n \n `;\n}\n", "import CustomElement from '../core/CustomElement.js';\nimport InputMixin from '../mixins/InputMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport TextFieldMixin from '../mixins/TextFieldMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(InputMixin)\n .mixin(TextFieldMixin)\n .extend()\n .define({\n stateTargetElement() { return this.refs.control; },\n })\n .autoRegister('mdw-input');\n", "import Box from './Box.js';\n\nexport default Box\n .extend()\n .css`\n :host {\n font: var(--mdw-typescale__label-large__font);\n letter-spacing: var(--mdw-typescale__body-large__letter-spacing);\n }\n \n :host([size=\"medium\"]) {\n font: var(--mdw-typescale__label-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n \n :host([size=\"small\"]) {\n font: var(--mdw-typescale__label-small__font);\n letter-spacing: var(--mdw-typescale__body-small__letter-spacing);\n }\n `\n .autoRegister('mdw-label');\n", "import CustomElement from '../core/CustomElement.js';\n\nexport default CustomElement\n .extend()\n .html/* html */`\n <slot id=slot-top name=top></slot>\n <slot id=slot></slot>\n `\n .css`\n /* https://m3.material.io/foundations/layout/applying-layout/window-size-classes */\n\n :host {\n display: block;\n }\n\n /* Pane Slot */\n #slot {\n display: flex;\n gap: 24px;\n\n justify-content: center;\n\n padding-inline: 16px;\n\n transition: padding-inline 100ms;\n }\n\n @media screen and (min-width: 648px) { #slot { padding-inline: 24px; } }\n `\n .autoRegister('mdw-layout');\n", "import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\nimport DensityMixin from '../mixins/DensityMixin.js';\n\nimport Box from './Box.js';\n\n/** @typedef {'compact'} DeprecatedHTMLMenuElementProperties */\n\nexport default Box\n .mixin(DensityMixin)\n .mixin(AriaReflectorMixin)\n .extend()\n .set({\n _ariaRole: 'list',\n })\n .css`\n /* https://m3.material.io/components/lists/specs */\n\n :host {\n display: flex;\n flex-direction: column;\n\n padding-block: 8px;\n }\n\n :host(:focus) {\n outline: 1px solid red;\n }\n\n `\n .autoRegister('mdw-list');\n", "import CustomElement from '../core/CustomElement.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(ShapeMixin)\n .extend()\n .observe({\n selected: 'boolean',\n icon: 'string',\n errored: 'boolean',\n disabled: 'boolean',\n hovered: 'boolean',\n focused: 'boolean',\n })\n .define({\n /** Alias for Selected (QoL) */\n checked: {\n get() { return this.selected; },\n set(value) { this.selected = value; },\n },\n })\n .html/* html */`\n <div id=inner-shape class=shape selected={selected}></div>\n `.on({\n composed() {\n const { outline } = this.refs;\n outline.removeAttribute('_if');\n outline.setAttribute('selected', '{selected}');\n },\n })\n .css`\n /* https://m3.material.io/components/radio-button/specs */\n\n :host {\n --disabled-opacity: 0.38;\n --mdw-ink: rgb(var(--mdw-color__primary));\n /* Use CSS Variables to force filter to reapply (Chrome Bug) */\n --color: rgb(var(--mdw-color__on-surface-variant));\n --mdw-shape__size: var(--mdw-shape__full);\n position: relative;\n\n display: inline-block;\n\n block-size: 20px;\n inline-size: 20px;\n\n background-color: transparent;\n\n transition: opacity 200ms;\n }\n\n #outline {\n filter:\n drop-shadow(1px 0px 0px var(--color))\n drop-shadow(0px 1px 0px var(--color))\n drop-shadow(-1px 0px 0px var(--color))\n drop-shadow(0px -1px 0px var(--color))\n ;\n\n color: var(--color);\n\n will-change: filter, color;\n }\n\n #inner-shape {\n position: absolute;\n inset: 0;\n\n transform: scale(0);\n\n background-color: var(--color);\n\n transition: transform 200ms, background-color 100ms;\n }\n\n :host([hovered]) {\n --color: rgb(var(--mdw-color__on-surface));\n }\n\n :host([focused]) {\n --color: rgb(var(--mdw-color__on-surface));\n }\n\n :host([selected]) {\n --color: rgb(var(--mdw-ink));\n }\n\n :host([errored]) {\n --color: rgb(var(--mdw-color__error));\n }\n\n :host([disabled]) {\n --color: rgba(var(--mdw-color__on-surface));\n opacity: var(--disabled-opacity);\n }\n\n #inner-shape[selected] {\n transform: scale(0.5);\n }\n\n `\n .autoRegister('mdw-radio-icon');\n", "// https://www.w3.org/WAI/ARIA/apg/patterns/listbox/\n\nimport './CheckboxIcon.js';\nimport './RadioIcon.js';\nimport './Divider.js';\nimport './Icon.js';\n\nimport CustomElement from '../core/CustomElement.js';\nimport AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\nimport RippleMixin from '../mixins/RippleMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(RippleMixin)\n .mixin(AriaReflectorMixin)\n .extend()\n .set({\n _ariaRole: 'listitem',\n delegatesFocus: false,\n stateLayer: true,\n })\n .observe({\n leading: 'string',\n avatar: 'string',\n avatarColor: { value: 'primary-container' },\n avatarSrc: 'string',\n src: 'string',\n alt: 'string',\n icon: 'string',\n href: 'string',\n iconInk: 'string',\n iconSrc: 'string',\n checkbox: 'string',\n radio: 'string',\n selectionColor: { value: 'primary' },\n selected: 'boolean',\n supporting: 'string',\n trailing: 'string',\n trailingIcon: 'string',\n trailingIconInk: 'string',\n trailingIconSrc: 'string',\n divider: 'boolean',\n video: 'boolean',\n lines: 'integer',\n _supportingSlotted: 'boolean',\n })\n .observe({\n // Alias since not form-associated\n disabledState({ disabled }) {\n return disabled;\n },\n\n })\n .expressions({\n isInteractive({ href }) {\n return href != null;\n },\n hasSupporting() {\n return this.supporting || this._supportingSlotted;\n },\n checkboxClass() {\n return this.checkbox || 'leading';\n },\n radioClass() {\n return this.radio || 'leading';\n },\n })\n .html/* html */`\n <a id=anchor _if={href} href={href} disabled={disabledState} aria-labelledby=content></a>\n <mdw-checkbox-icon id=checkbox _if={checkbox} aria-hidden=true class={checkboxClass} color={selectionColor} disabled={disabledState} icon=check selected={selected}></mdw-checkbox-icon>\n <mdw-radio-icon id=radio _if={radio} aria-hidden=true class={radioClass} disabled={disabledState} ink={selectionColor} selected={selected}></mdw-radio-icon>\n <mdw-box _if={avatar} id=avatar color={avatarColor} type-style=title-medium src={AvatarSrc}\n aria-hidden=true>{avatar}</mdw-box>\n <mdw-icon _if={icon} id=icon ink={iconInk} src={iconSrc} aria-hidden=true>{icon}</mdw-icon>\n <img id=img _if={src} src={src} alt={alt} video={video} />\n <slot name=leading>{leading}</slot>\n <div id=content has-supporting={hasSupporting} lines={lines}>\n <slot id=slot></slot>\n <slot id=supporting name=supporting class=text lines={lines}>{supporting}</slot>\n </div>\n <mdw-icon _if={trailingIcon} id=trailing-icon ink={trailingIconInk} src={trailingIconSrc} aria-hidden=true>{trailingIcon}</mdw-icon>\n <slot id=trailing name=trailing role=note>{trailing}</slot>\n <mdw-divider _if={divider} id=divider divder={divider}></mdw-divider>\n `\n .on({\n composed() {\n const { state, rippleContainer, anchor } = this.refs;\n anchor.append(\n state,\n rippleContainer,\n );\n state.setAttribute('state-disabled', 'focus hover');\n },\n disabledStateChanged(oldValue, newValue) {\n this.updateAriaProperty('ariaDisabled', newValue ? 'true' : 'false');\n },\n })\n .css`\n /* https://m3.material.io/components/lists/specs */\n\n :host {\n --mdw-shape__size: 0px;\n /* Grid does not auto collapse columns, leaving gaps */\n\n display: flex;\n align-items: center;\n gap: 16px;\n\n border: none;\n padding-block: 8px;\n padding-inline: 16px 24px;\n\n cursor: auto;\n\n outline: none;\n\n color: inherit;\n\n text-decoration: none;\n }\n\n :host([href]) {\n cursor: pointer;\n }\n\n #anchor {\n position: absolute;\n inset: 0;\n\n outline: none;\n\n color: inherit;\n\n }\n\n :host([video]) {\n padding-inline-start: 0;\n }\n\n :host([lines=\"3\"]) {\n align-items: flex-start;\n\n padding-block: 12px;\n }\n\n #content {\n display: inline-flex;\n align-items: flex-start;\n flex-direction: column;\n justify-content: center;\n\n flex: 1;\n\n padding-block: calc(8px + (var(--mdw-density) * 2px));\n }\n\n #content:is([has-supporting], [lines=\"2\"]) {\n box-sizing: border-box;\n min-block-size: calc(8px + calc(48px + var(--mdw-density) * 2px));\n padding-block: calc(4px + var(--mdw-density) * 2px);\n }\n\n #content:is([lines=\"3\"]) {\n box-sizing: border-box;\n min-block-size: calc(8px + calc(48px + var(--mdw-density) * 2px));\n padding-block: calc(0 + var(--mdw-density) * 2px);\n }\n\n #icon {\n font-size: 24px;\n }\n\n #trailing-icon {\n font-size: 24px;\n }\n\n #divider {\n position: absolute;\n inset-block-end: 0;\n\n display: block;\n\n color: rgb(var(--mdw-color__surface-variant));\n }\n\n #divider[divider=\"inset\"] {\n padding-inline: 16px 24px;\n }\n\n #slot {\n max-block-size: var(--mdw-typescale__body-large__line-height) * 2;\n\n /* background-color: rgba(255,0,0,0.10); */\n\n color: var(--mdw-color__on-surface);\n\n font: var(--mdw-typescale__body-large__font);\n letter-spacing: var(--mdw-typescale__body-large__letter-spacing);\n }\n\n #supporting {\n max-block-size: calc(var(--mdw-typescale__body-medium__line-height) * 2);\n\n /* background-color: rgba(0,255,0,0.10); */\n\n color: var(--mdw-color__on-surface-variant);\n\n font: var(--mdw-typescale__body-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n\n #trailing {\n color: var(--mdw-color__on-surface-variant);\n\n font: var(--mdw-typescale__body-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n\n #slot, #supporting {\n display: block;\n overflow-x: hidden;\n overflow-y: hidden;\n\n text-align: start;\n text-overflow: ellipsis;\n text-transform: none;\n white-space: normal;\n word-break: break-word;\n }\n\n #supporting[lines=\"2\"] {\n min-block-size: var(--mdw-typescale__body-medium__line-height);\n max-block-size: var(--mdw-typescale__body-medium__line-height);\n }\n\n #supporting[lines=\"3\"] {\n min-block-size: calc(var(--mdw-typescale__body-medium__line-height) * 2);\n max-block-size: calc(var(--mdw-typescale__body-medium__line-height) * 2);\n }\n\n @supports(width: 1lh) {\n #slot {\n max-block-size: 1lh;\n }\n\n #supporting {\n max-block-size: 2lh;\n }\n\n #supporting[lines=\"2\"] {\n min-block-size: 1lh;\n max-block-size: 1lh;\n }\n\n #supporting[lines=\"3\"] {\n min-block-size: 2lh;\n max-block-size: 2lh;\n }\n }\n\n @supports(-webkit-line-clamp:1) {\n #slot {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n }\n\n #supporting {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n }\n\n #supporting[lines=\"2\"] {\n -webkit-line-clamp: 1;\n }\n }\n\n #avatar {\n display: flex;\n align-items: center;\n justify-content: center;\n\n block-size: 40px;\n inline-size: 40px;\n\n border-radius: 50%;\n }\n\n #img {\n block-size: 56px;\n max-block-size: 56px;\n inline-size: 56px;\n max-inline-size: 56px;\n\n object-fit: cover;\n object-position: center center;\n }\n\n #img[video] {\n block-size: 64px;\n max-block-size: 64px;\n inline-size: 114px;\n max-inline-size: 114px;\n }\n\n #checkbox {\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin: 3px;\n }\n\n #radio {\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin: 2px;\n }\n\n .trailing {\n order: 1;\n }\n\n :host([disabled]) {\n opacity: 0.38;\n\n color: rgb(var(--mdw-color__on-surface));\n }\n `\n .childEvents({\n supporting: {\n /** @param {Event & {currentTarget: HTMLSlotElement}} event */\n slotchange({ currentTarget }) {\n this._supportingSlotted = currentTarget.assignedNodes().length !== 0;\n },\n },\n })\n .autoRegister('mdw-list-item');\n", "// https://www.w3.org/WAI/ARIA/apg/patterns/listbox/\n\nimport ListItem from './ListItem.js';\n\n// https://html.spec.whatwg.org/multipage/form-elements.html#htmloptionelement\n\nexport default class ListOption extends ListItem\n .extend()\n .setStatic({\n formAssociated: true,\n })\n .set({\n _ariaRole: 'none',\n delegatesFocus: true,\n _index: -1,\n _selectedDirty: false,\n isInteractive: true,\n })\n .observe({\n // ListOption.prototype._form = ListOption.prop('_form');\n _label: { attr: 'label', nullParser: String },\n defaultSelected: { attr: 'selected', reflect: true, type: 'boolean' },\n _selected: 'boolean',\n _value: { attr: 'value', reflect: true },\n _formDisabled: 'boolean',\n })\n .observe({\n selected: {\n reflect: false,\n type: 'boolean',\n get({ _selectedDirty, defaultSelected, _selected }) {\n if (!_selectedDirty) return defaultSelected;\n return _selected;\n },\n /** @param {boolean} value */\n set(value) {\n this._selectedDirty = true;\n this._selected = value;\n },\n },\n disabledState({ _formDisabled, disabled }) {\n if (_formDisabled) return true;\n return !!disabled;\n },\n })\n .define({\n index() { return this._index; },\n form() { return /** @type {import('./ListSelect.js').default} */ (this.parentElement)?.form; },\n label: {\n get() { return this._label; },\n /** @param {string} value */\n set(value) {\n this._label = value;\n },\n },\n value: {\n get() { return this._value; },\n /** @param {string} value */\n set(value) { this._label = value; },\n },\n })\n .methods({\n /** @param {boolean} formDisabled */\n formDisabledCallback(formDisabled) {\n this._formDisabled = formDisabled;\n },\n /** @type {HTMLElement['focus']} */\n focus(...options) {\n this.refs.anchor.focus(...options);\n },\n })\n .on({\n composed({ inline }) {\n const { anchor, state, content } = this.refs;\n\n // Form Associated elements cannot receive focus unless using delegatesFocus\n // Workaround by redirecting focus to an inner element\n // Reuse HTMLAnchorElement with no HREF\n\n anchor.setAttribute('disabled', '{disabledState}');\n anchor.setAttribute('role', 'option');\n anchor.setAttribute('aria-disabled', inline(({ disabledState }) => `${disabledState}`));\n anchor.setAttribute('tabindex', '0');\n anchor.setAttribute('aria-selected', inline(({ selected }) => `${selected}`));\n anchor.setAttribute('selected', '{selected}');\n anchor.removeAttribute('href');\n anchor.removeAttribute('_if');\n\n content.setAttribute('selected', '{selected}');\n\n state.setAttribute('state-disabled', 'focus');\n },\n })\n .css`\n :host {\n --mdw-bg: var(--mdw-color__secondary-container);\n --mdw-ink: var(--mdw-color__on-secondary-container);\n cursor: pointer;\n \n z-index: 0;\n }\n \n :host([href]) {\n cursor: pointer;\n }\n \n :host([disabled]) {\n cursor: not-allowed;\n pointer-events: none;\n }\n \n #content {\n -webkit-user-select: none;\n user-select: none;\n }\n \n #content[selected] {\n color: rgb(var(--mdw-ink));\n }\n \n #anchor {\n z-index: -1;\n }\n \n #anchor[selected] {\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-ink));\n }\n ` {\n static { this.autoRegister('mdw-list-option'); }\n\n /**\n * @param {string} [text]\n * @param {string} [value]\n * @param {boolean} [defaultSelected]\n * @param {boolean} [selected]\n */\n constructor(text, value, defaultSelected, selected) {\n super();\n if (text !== undefined) {\n this.text = text;\n }\n if (value !== undefined) {\n this._value = value;\n }\n if (defaultSelected !== undefined) {\n this.defaultSelected = defaultSelected;\n }\n if (selected !== undefined) {\n this._selected = selected;\n }\n if (!this.hasAttribute('tabindex')) {\n this.tabIndex = 0;\n }\n }\n}\n", "/**\n * @see https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#htmloptionscollection\n * @template {HTMLOptionElement} T1\n * @template {HTMLOptGroupElement} T2\n * @param {Object} options\n * @param {HTMLElement} options.host\n * @param {HTMLCollectionOf<T1>} options.collection\n * @param {typeof T1} options.OptionConstructor\n * @param {typeof T2} options.GroupConstructor\n * @return {HTMLCollectionOf<T1> & HTMLOptionsCollection}\n */\nexport function constructHTMLOptionsCollectionProxy({ host, collection, OptionConstructor, GroupConstructor }) {\n /**\n * @param {T1} element\n * @param {HTMLElement|number} [before]\n * @return {void}\n */\n // eslint-disable-next-line func-style\n const add = function add(element, before) {\n let beforeElement;\n let index = -1;\n if (typeof before === 'number') {\n if (before >= 0 && before < collection.length - 1) {\n index = before;\n }\n } else if (before instanceof HTMLElement) {\n beforeElement = before;\n }\n if (index !== -1) {\n beforeElement = collection.item(index);\n }\n if (beforeElement) {\n beforeElement.before(element);\n } else {\n host.append(element);\n }\n };\n /**\n * @param {number} index\n * @return {void}\n */\n // eslint-disable-next-line func-style\n const remove = function remove(index) {\n collection.item(index)?.remove();\n };\n\n Object.defineProperty(collection, 'selectedIndex', {\n get() {\n for (let i = 0; i < collection.length; i++) {\n if (collection[i].selected) {\n return i;\n }\n }\n return -1;\n },\n set(value) {\n for (let i = 0; i < collection.length; i++) {\n collection[i].selected = (i === value);\n }\n },\n });\n const newCollection = new Proxy(collection, {\n get(target, p, receiver) {\n switch (p) {\n case 'add':\n return add;\n case 'remove':\n return remove;\n default:\n return target[p];\n }\n },\n set(target, p, newValue, receiver) {\n let index = Number.NaN;\n switch (typeof p) {\n case 'string':\n index = Number.parseInt(p, 10);\n break;\n case 'number':\n index = p;\n break;\n default:\n case 'symbol':\n return Reflect.set(target, p, newValue, receiver);\n }\n if (Number.isNaN(index)) {\n return Reflect.set(target, p, newValue, receiver);\n }\n const currentSize = collection.length;\n while (index > collection.length) {\n add(new OptionConstructor());\n }\n if (index === currentSize) {\n if (newValue != null) {\n add(newValue);\n }\n } else if (index >= 0) {\n remove(index);\n if (newValue !== null) {\n add(newValue, index);\n }\n }\n },\n });\n return newCollection;\n}\n", "import { constructHTMLOptionsCollectionProxy } from '../dom/ HTMLOptionsCollectionProxy.js';\nimport FormAssociatedMixin from '../mixins/FormAssociatedMixin.js';\nimport KeyboardNavMixin from '../mixins/KeyboardNavMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\n\nimport List from './List.js';\nimport ListOption from './ListOption.js';\n\n/** @implements {HTMLSelectElement} */\nexport default class ListSelect extends List\n .mixin(StateMixin)\n .mixin(FormAssociatedMixin)\n .mixin(KeyboardNavMixin) {\n static {\n this.autoRegister('mdw-list-select');\n // eslint-disable-next-line no-unused-expressions\n this.css`\n :host(:disabled) {\n cursor: not-allowed;\n pointer-events: none;\n }\n \n :host([internals-disabled]) {\n cursor: not-allowed;\n pointer-events: none;\n }\n `;\n this.on({\n disabledStateChanged(oldValue, newValue) {\n this._kbdFocusable = !newValue;\n this.tabIndex = newValue ? -1 : 0;\n },\n multipleChanged(oldValue, newValue) {\n this.updateAriaProperty('ariaMultiSelectable', newValue ? 'true' : 'false');\n },\n });\n }\n\n /** @type {HTMLCollectionOf<ListOption> & HTMLOptionsCollection} */\n _optionsCollection = null;\n\n constructor() {\n super();\n if (!this.hasAttribute('tabindex')) {\n this.tabIndex = 0;\n }\n this.refs.slot.addEventListener('slotchange', this.onSlotChange);\n this.addEventListener('keydown', this.onControlKeydown);\n this.addEventListener('click', this.onListSelectClick);\n }\n\n * _selectedOptionsGenerator() {\n for (const el of this.options) {\n if (!el.selected) continue;\n yield el;\n }\n }\n\n /**\n * @param {Event} event\n * @this {HTMLSlotElement}\n * @return {void}\n */\n onSlotChange(event) {\n /** @type {{host:ListSelect}} */ // @ts-ignore Coerce\n const { host } = this.getRootNode();\n host.refreshTabIndexes();\n let index = 0;\n for (const el of host.options) {\n el._index = index++;\n }\n }\n\n /**\n * @param {KeyboardEvent} event\n * @this {ListSelect}\n * @return {void}\n */\n onControlKeydown(event) {\n if (event.key === 'Spacebar' || event.key === ' ') {\n const target = event.target;\n if (!(target instanceof ListOption)) return;\n event.stopPropagation();\n event.preventDefault();\n this.onListSelectClick.call(this, event);\n }\n }\n\n /**\n * @param {MouseEvent|KeyboardEvent} event\n * @this {ListSelect}\n * @return {void}\n */\n onListSelectClick(event) {\n console.log('onListSelectClick');\n const target = event.target;\n if (!(target instanceof ListOption)) return;\n event.stopPropagation();\n if (target.disabledState) return;\n\n // Perform unselect\n if (target.selected) {\n if (this.multiple) {\n const selections = [...this.selectedOptions];\n if (this.required && selections.length === 1) return;\n if (selections.length === 0) {\n console.warn('impossible??');\n }\n target.selected = false;\n let firstSelection = selections.shift();\n if (firstSelection === target) {\n // Get new first selection (or undefined)\n firstSelection = selections.shift();\n }\n this._value = firstSelection?.value ?? '';\n return;\n }\n if (this.required) return;\n target.selected = false;\n this._value = '';\n return;\n }\n\n if (this.multiple) {\n // Skip ctrlKey requirement\n target.selected = true;\n this._value = this.selectedOptions.next().value;\n return;\n }\n\n for (const el of this.options) {\n el.selected = el === target;\n }\n this._value = target.value;\n }\n\n formResetCallback() {\n // TODO: Reset dirty on options\n super.formResetCallback();\n }\n\n get options() {\n if (!this._optionsCollection) {\n this._optionsCollection = constructHTMLOptionsCollectionProxy({\n host: this,\n collection: this.getElementsByTagName(ListOption.elementName),\n OptionConstructor: ListOption,\n GroupConstructor: ListOption,\n });\n }\n return this._optionsCollection;\n }\n\n get selectedOptions() {\n return this._selectedOptionsGenerator();\n }\n\n // @ts-ignore @override\n get type() { return 'select'; }\n\n /** @override */\n get kbdNavQuery() { return ListOption.elementName; }\n\n // @ts-ignore @override\n get length() {\n return this.options.length;\n }\n\n get selectedIndex() {\n return this.options.selectedIndex;\n }\n\n set selectedIndex(value) {\n this.options.selectedIndex = value;\n this._value = (this.options.item(value)?.value) ?? '';\n }\n\n get value() {\n return this._value;\n }\n\n /** @param {string} v */\n set value(v) {\n for (const el of this.options) {\n el.selected = (el.value === v);\n }\n this._value = v;\n }\n\n get add() { return this.options.add; }\n\n get item() { return this.options.item; }\n\n get namedItem() { return this.options.namedItem; }\n\n * [Symbol.iterator]() {\n for (const el of this.options) {\n yield el;\n }\n }\n\n get kbdNavFocusableWhenDisabled() { return true; }\n}\n\n// https://html.spec.whatwg.org/multipage/form-elements.html#htmlselectelement\n\n// [CEReactions] attribute DOMString autocomplete;\n// ListSelect.prototype.disabled = ListSelect.prop('disabled', { type: 'boolean' });\n// readonly attribute HTMLFormElement? form;\nListSelect.prototype.multiple = ListSelect.prop('multiple', { type: 'boolean' });\n// [CEReactions] attribute boolean multiple;\n// [CEReactions] attribute DOMString name;\n// [CEReactions] attribute boolean required;\nListSelect.prototype.size = ListSelect.prop('size', { type: 'integer', empty: 0 });\nListSelect.prototype._ariaRole = 'listbox';\nListSelect.prototype.delegatesFocus = true;\n", "// https://www.w3.org/TR/wai-aria-practices/#menu\n\nimport './Surface.js';\nimport CustomElement from '../core/CustomElement.js';\nimport { attemptFocus } from '../core/dom.js';\nimport DensityMixin from '../mixins/DensityMixin.js';\nimport KeyboardNavMixin from '../mixins/KeyboardNavMixin.js';\nimport { canAnchorPopup } from '../utils/popup.js';\n\n/**\n * @typedef {Object} MenuStack\n * @prop {HTMLElement} element\n * @prop {Element} previousFocus\n * @prop {Object} [state]\n * @prop {Object} [previousState]\n * @prop {MouseEvent|PointerEvent|HTMLElement|Element} [originalEvent]\n * @prop {any} [pendingResizeOperation]\n * @prop {window['history']['scrollRestoration']} [scrollRestoration]\n */\n\nconst supportsHTMLDialogElement = typeof HTMLDialogElement !== 'undefined';\n/** @type {MenuStack[]} */\nconst OPEN_MENUS = [];\n\n/**\n * @return {void}\n */\nfunction onWindowResize() {\n const lastOpenMenu = OPEN_MENUS.at(-1);\n if (!lastOpenMenu || !lastOpenMenu.originalEvent) {\n return;\n }\n if (lastOpenMenu.pendingResizeOperation) {\n cancelAnimationFrame(lastOpenMenu.pendingResizeOperation);\n }\n lastOpenMenu.pendingResizeOperation = requestAnimationFrame(() => {\n lastOpenMenu.element.updateMenuPosition(lastOpenMenu.originalEvent);\n lastOpenMenu.pendingResizeOperation = null;\n });\n}\n\n/**\n * @param {PopStateEvent} event\n */\nfunction onPopState(event) {\n if (!event.state) return;\n const lastOpenMenu = OPEN_MENUS.at(-1);\n if (!lastOpenMenu || !lastOpenMenu.previousState) {\n return;\n }\n if ((lastOpenMenu.previousState === event.state) || Object.keys(event.state)\n .every((key) => event.state[key] === lastOpenMenu.previousState[key])) {\n lastOpenMenu.element.close();\n }\n}\n\n/** @param {BeforeUnloadEvent} event */\nfunction onBeforeUnload(event) {\n if (!OPEN_MENUS.length) return;\n console.warn('Menu was open during page unload (refresh?).');\n}\n\nexport default CustomElement\n .mixin(DensityMixin)\n .mixin(KeyboardNavMixin)\n .extend()\n .observe({\n open: 'boolean',\n flow: {\n type: 'string',\n /** @type {'corner'|'adjacent'|'overflow'|'vcenter'|'hcenter'|'center'} */\n value: null,\n },\n submenu: 'boolean',\n modal: 'boolean',\n _isNativeModal: 'boolean',\n color: { empty: 'surface' },\n ink: 'string',\n elevation: { empty: 2 },\n outlined: 'boolean',\n })\n .set({\n returnValue: '',\n delegatesFocus: true,\n /** @type {WeakRef<HTMLElement>} */\n _cascader: null,\n _closing: false,\n })\n .define({\n kbdNavChildren() {\n const items = [...this.querySelectorAll('mdw-menu-item')];\n // eslint-disable-next-line unicorn/prefer-set-has\n const submenuItems = [...this.querySelectorAll(':scope mdw-menu mdw-menu-item')];\n return items.filter((el) => !submenuItems.includes(el));\n },\n _dialog() {\n return /** @type {HTMLDialogElement} */ (this.refs.dialog);\n },\n cascader: {\n get() {\n return this._cascader?.deref();\n },\n /**\n * @param {HTMLElement} value\n */\n set(value) {\n this._cascader = value ? new WeakRef(value) : null;\n },\n },\n })\n .html/* html */`\n <dialog id=dialog role=menu aria-hidden=${({ open }) => (open ? 'false' : 'true')}>\n <div id=scrim aria-hidden=true modal={modal}></div>\n <form id=form method=dialog role=none>\n <mdw-surface id=surface elevation={elevation} color={color} ink={ink} outlined={outlined}>\n <div id=scroller>\n <slot id=slot on-slotchange={refreshTabIndexes}></slot>\n </div>\n </mdw-surface>\n <slot id=submenu-slot name=submenu></slot>\n </form>\n </dialog>\n `\n .css`\n /* https://m3.material.io/components/menus/specs */\n\n :host {\n --mdw-menu__transform-origin-inline-start: left;\n --mdw-menu__transform-origin-inline-end: right;\n /* Normal */\n --mdw-menu__transform-origin-x: var(--mdw-menu__transform-origin-inline-start);\n /* Down */\n --mdw-menu__transform-origin-y: top;\n --mdw-menu__inline-base: 56px;\n --mdw-menu__size: 2;\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__on-surface);\n position: absolute;\n /* Default position is bottom */\n /* Default direction is start */\n inset-block: 100% auto;\n inset-inline: auto 0;\n\n display: block;\n /* Hide scrollbar */\n -ms-overflow-style: none;\n /* Scroll mask */\n overscroll-behavior: none;\n overscroll-behavior: contain;\n scrollbar-width: none;\n\n pointer-events: none;\n\n transform-origin: var(--mdw-menu__transform-origin-x) var(--mdw-menu__transform-origin-y);\n\n transition-duration: motion.$fadeOutDuration;\n transition-property: none;\n transition-timing-function: motion.$decelerateEasing;\n }\n\n :host(::after) {\n content: '';\n\n display: block;\n\n block-size: 200%;\n inline-size: 200%;\n }\n\n :host(::-webkit-scrollbar) {\n display: none;\n }\n\n dialog {\n position: fixed;\n inset: 0;\n\n box-sizing: border-box;\n block-size:100%;\n max-block-size: none;\n inline-size:100%;\n max-inline-size: none;\n margin: 0;\n border: none;\n padding: 0;\n\n opacity: 0;\n visibility: hidden;\n z-index: 24;\n\n background-color: transparent;\n\n transition: none;\n transition-property: opacity;\n will-change: opacity;\n }\n\n dialog::backdrop {\n /** Use scrim instead */\n display: none;\n }\n\n dialog[aria-hidden=\"false\"],\n dialog:modal {\n display: block;\n\n pointer-events: none;\n\n opacity: 1;\n visibility: visible;\n\n transition-duration: var(--mdw-dialog__fade-in-duration);\n transition-property: opacity;\n transition-timing-function: var(--mdw-dialog__deceleration-easing);\n }\n\n #scrim {\n position: fixed;\n inset: 0;\n\n overflow-y: scroll;\n overscroll-behavior: none;\n overscroll-behavior: contain;\n scrollbar-width: none;\n\n block-size: 100%;\n inline-size: 100%;\n\n cursor: default;\n pointer-events: auto;\n -webkit-tap-highlight-color: transparent;\n\n visibility: hidden; /* Only show if [modal] */\n\n z-index:0;\n }\n\n #form {\n display: contents;\n }\n\n #scrim::-webkit-scrollbar {\n display: none;\n }\n\n #scrim::after {\n content: '';\n\n display: block;\n\n block-size: 200%;\n inline-size: 200%;\n }\n\n #surface {\n --mdw-shape__size: var(--mdw-shape__extra-small);\n position: sticky;\n\n display: inline-flex;\n flex-direction: column;\n\n inline-size: calc(var(--mdw-menu__size) * var(--mdw-menu__inline-base));\n min-inline-size: calc(var(--mdw-menu__inline-base) * 2);\n max-inline-size: 100vw;\n flex:1;\n\n pointer-events: auto;\n /* background-color: rgb(var(--mdw-color__surface)); */\n /* color: rgb(var(--mdw-color__on-surface)); */\n /* stylelint-disable-next-line liberty/use-logical-spec */\n will-change: top, left;\n }\n\n @supports(-moz-appearance: none) {\n #surface {\n position: absolute;\n }\n }\n\n #scroller {\n display: flex;\n align-items: stretch;\n flex-direction: column;\n overflow-y: auto;\n overscroll-behavior: none;\n overscroll-behavior: contain;\n\n flex: 1;\n\n padding-block: 8px;\n }\n\n #scrim[modal] {\n visibility: visible;\n }\n `\n .methods({\n focus() {\n const [firstItem] = this.kbdNavChildren;\n if (!attemptFocus(firstItem)) {\n this.focusNext(firstItem);\n }\n },\n /**\n * @param {DOMRect|Element} [anchor]\n * @return {void}\n */\n updateMenuPosition(anchor) {\n const surface = this.refs.surface;\n surface.style.setProperty('max-height', 'none');\n surface.style.setProperty('width', 'auto');\n const newSize = Math.ceil(surface.clientWidth / 56);\n surface.style.removeProperty('width');\n surface.style.setProperty('--mdw-menu__size', newSize.toString(10));\n\n /** @type {import('../utils/popup.js').CanAnchorPopUpOptions} */\n const anchorOptions = {\n anchor: anchor ?? this.getBoundingClientRect(),\n width: surface.clientWidth,\n height: surface.clientHeight,\n // margin,\n };\n\n const isPageRTL = (getComputedStyle(this).direction === 'rtl');\n const xStart = isPageRTL ? 'right' : 'left';\n const xEnd = isPageRTL ? 'left' : 'right';\n\n /* Automatic Positioning\n *\n * Positions:\n * 3 7 4\n * ┌─────────┐\n * │ │\n * 5 │ 9 │ 6\n * │ │\n * └─────────┘\n * 1 8 2\n *\n * 1: Bottom Left\n * 2: Bottom Right\n * 3: Top Left\n * 4: Top Right\n * 5: VCenter Left\n * 6: VCenter Right\n * 7: HCenter Top\n * 8: HCenter Bottom\n * 9: VCenter HCenter\n *\n * Directions:\n * a - Down LTR\n * b - Down RTL\n * c - Up LTR\n * d - Up RTL\n * e - LTR\n * f - RTL\n * g - Down\n * h - Up\n * i - Center\n *\n *\n * 16 total combos\n * 1a 1b 1c 1d └↘ └↙ └↗ └↖\n * 2a 2b 2c 2d ┘↘ ┘↙ ┘↗ ┘↖\n * 3a 3b 3c 3d ┌↘ ┌↙ ┌↗ ┌↖\n * 4a 4b 4c 4d ┐↘ ┐↙ ┐↗ ┐↖\n *\n * Avoid using opposite angle\n *\n * 1a XX 1c 1d └↘ ██ └↗ └↖\n * XX 2b 2c 2d ██ ┘↙ ┘↗ ┘↖\n * 1a 3b 3c XX ┌↘ ┌↙ ┌↗ ██\n * 4a 4b XX 4d ┐↘ ┐↙ ██ ┐↖\n *\n *\n * Preference Order:\n * - Flow from corner 1a 2b 3c 4d └↘ ┘↙ ┌↗ ┐↖\n * - Open adjacent to target 4a 3b 2c 1d ┐↘ ┌↙ ┘↗ └↖\n * - Overlay target 3a 4b 1c 2d ┌↘ ┐↙ └↗ ┘↖\n * - Open from horizontal side 5e 6f │→ │←\n * - Open from center 9i █·\n */\n\n /** @type {import('../utils/popup.js').CanAnchorPopUpOptions[]} */\n const preferences = [\n (!this.submenu && (this.flow ?? 'corner') === 'corner') ? [\n { clientY: 'bottom', clientX: xStart },\n { clientY: 'bottom', clientX: xEnd },\n { clientY: 'top', clientX: xStart },\n { clientY: 'top', clientX: xEnd },\n ] : [],\n (this.submenu || (this.flow ?? 'adjacent') === 'adjacent') ? [\n { clientY: 'top', clientX: xEnd, directionX: xEnd, directionY: 'down' },\n { clientY: 'top', clientX: xStart, directionX: xStart, directionY: 'down' },\n { clientY: 'bottom', clientX: xEnd, directionX: xEnd, directionY: 'up' },\n { clientY: 'bottom', clientX: xStart, directionX: xStart, directionY: 'up' },\n ] : [],\n (!this.submenu && (this.flow ?? 'overlay') === 'overlay') ? [\n { clientY: 'top', clientX: xStart, directionX: xEnd, directionY: 'down' },\n { clientY: 'top', clientX: xEnd, directionX: xStart, directionY: 'down' },\n { clientY: 'bottom', clientX: xStart, directionX: xEnd, directionY: 'up' },\n { clientY: 'bottom', clientX: xEnd, directionX: xStart, directionY: 'up' },\n ] : [],\n (!this.submenu && (this.flow ?? 'vcenter') === 'vcenter') ? [\n { clientY: 'center', clientX: xEnd, directionX: xEnd, directionY: 'center' },\n { clientY: 'center', clientX: xStart, directionX: xStart, directionY: 'center' },\n ] : [],\n (!this.submenu && (this.flow ?? 'hcenter') === 'hcenter') ? [\n { clientY: 'bottom', clientX: 'center', directionX: 'center', directionY: 'down' },\n { clientY: 'top', clientX: 'center', directionX: 'center', directionY: 'up' },\n ] : [],\n (!this.submenu && (this.flow ?? 'center') === 'center') ? [\n { clientY: 'center', clientX: 'center', directionX: 'center', directionY: 'center' },\n ] : [],\n ].flat();\n\n let anchorResult;\n for (const preference of preferences) {\n anchorResult = canAnchorPopup({\n ...anchorOptions,\n ...preference,\n });\n if (anchorResult) break;\n }\n\n if (!anchorResult) {\n anchorResult = canAnchorPopup({\n ...anchorOptions,\n ...preferences[0],\n force: true,\n });\n }\n\n surface.style.setProperty('inset-block-start', `${anchorResult.pageY}px`);\n surface.style.setProperty('inset-inline-start', `${anchorResult.pageX}px`);\n surface.style.setProperty('margin', '0');\n surface.style.setProperty('transform-origin', `${anchorResult.transformOriginY} ${anchorResult.transformOriginX}`);\n surface.scrollIntoView();\n },\n /**\n * @param {MouseEvent|PointerEvent|HTMLElement|Element} source\n * @return {boolean} handled\n */\n showModal(source) {\n if (this.open) return false;\n this.modal = true;\n if (supportsHTMLDialogElement) {\n this._dialog.showModal();\n this._isNativeModal = true;\n }\n return this.showPopup(source);\n },\n /**\n * @param {MouseEvent|PointerEvent|HTMLElement|Element} source\n * @return {boolean} handled\n */\n showPopup(source) {\n if (this.open) return false;\n this.open = true;\n\n const previousFocus = source instanceof HTMLElement ? source : document.activeElement;\n this.updateMenuPosition(source);\n if (supportsHTMLDialogElement && !this._dialog.open) {\n this._dialog.show();\n }\n\n const newState = { hash: Math.random().toString(36).slice(2, 18) };\n let previousState = null;\n\n if (!window.history.state) {\n // Create new previous state\n window.history.replaceState({\n hash: Math.random().toString(36).slice(2, 18),\n }, document.title);\n }\n previousState = window.history.state;\n const scrollRestoration = window.history.scrollRestoration;\n window.history.scrollRestoration = 'manual';\n window.history.pushState(newState, document.title);\n console.debug('Menu pushed page');\n window.addEventListener('popstate', onPopState);\n window.addEventListener('beforeunload', onBeforeUnload);\n\n window.addEventListener('resize', onWindowResize);\n window.addEventListener('scroll', onWindowResize);\n\n OPEN_MENUS.push({\n element: this,\n previousFocus,\n state: newState,\n previousState,\n originalEvent: source,\n scrollRestoration,\n });\n\n this.focus();\n\n return true;\n },\n /**\n * @param {boolean} returnFocus Return focus to element focused during open\n * @return {boolean} handled\n */\n close(returnFocus = true) {\n if (!this.open) return false;\n if (this._closing) return false;\n this._closing = true;\n this.modal = false;\n if (this._isNativeModal) {\n this._isNativeModal = false;\n } else {\n const main = document.querySelector('main');\n if (main) {\n main.removeAttribute('aria-hidden');\n }\n }\n // if (this.dialogElement.getAttribute('aria-hidden') === 'true') return false;\n if (supportsHTMLDialogElement && this._dialog.open) {\n const previousFocus = document.activeElement;\n // Closing a native dialog will return focus automatically.\n this._dialog.close();\n if (!attemptFocus(previousFocus, { preventScroll: true })) {\n document.activeElement?.blur?.();\n }\n }\n\n // Will invoke observed attribute change: ('aria-hidden', 'true');\n\n this.open = false;\n this.dispatchEvent(new Event('close'));\n\n const len = OPEN_MENUS.length;\n for (let i = len - 1; i >= 0; i--) {\n const entry = OPEN_MENUS[i];\n if (entry.element === this) {\n if (entry.state && window.history && window.history.state && entry.state.hash === window.history.state.hash) {\n window.removeEventListener('popstate', onPopState);\n window.history.back();\n // Back does not set state immediately\n // Needed to track submenu\n // TODO: use window.history.go(indexDelta) instead for Safari (not Wekbit) submenu support\n window.history.replaceState(entry.previousState, document.title);\n window.history.scrollRestoration = entry.scrollRestoration || 'auto';\n window.addEventListener('popstate', onPopState);\n } else {\n console.warn('Menu state mismatch?', entry, window.history.state);\n }\n if (returnFocus) {\n entry.previousFocus?.focus?.({ preventScroll: true });\n }\n OPEN_MENUS.splice(i, 1);\n break;\n } else if (this.contains(entry.element)) {\n console.debug('Closing submenu first');\n entry.element.close(false);\n console.debug('Sub menu closed. Continuing...');\n }\n }\n if (!OPEN_MENUS.length) {\n window.removeEventListener('popstate', onPopState);\n window.removeEventListener('beforeunload', onBeforeUnload);\n window.removeEventListener('resize', onWindowResize);\n console.debug('All menus closed');\n }\n this._closing = false;\n return true;\n },\n /**\n * @param {HTMLElement} cascader Element that calls for submenu cascade\n */\n cascade(cascader) {\n this.cascader = cascader;\n this.showPopup(cascader);\n },\n /**\n * @param {MouseEvent|PointerEvent|HTMLElement|Element} source\n * @return {boolean} handled\n */\n show(source) {\n // Auto-select type based on default platform convention\n // Mac OS X / iPad does not expect clickthrough\n if (navigator.userAgent.includes('Mac OS X')) {\n return this.showModal(source);\n }\n return this.showPopup(source);\n },\n })\n .events({\n '~click'(event) {\n if (this !== event.target) return;\n // Clicked self (scrim-like)\n event.stopPropagation();\n this.close(true);\n },\n keydown(event) {\n if (!this.open) return;\n\n switch (event.key) {\n case 'Tab':\n // Hide menu allowing focus to revert to calling element\n // If close is successfully, focus will return to spawning element\n // and browser will then tab from spawning to next.\n // If close is not successful, stop event.\n if (!this.close()) {\n event.stopPropagation();\n event.preventDefault();\n }\n break;\n // Unless menu hiding is cancelled\n case 'ArrowLeft':\n case 'ArrowRight':\n if (!this.submenu) break;\n if (getComputedStyle(this).direction === 'rtl') {\n if (event.key === 'ArrowLeft') break;\n } else if (event.key === 'ArrowRight') break;\n // Fallthrough;\n case 'Escape':\n case 'Esc':\n event.stopPropagation();\n event.preventDefault();\n this.close(true);\n break;\n default:\n }\n },\n focusout(event) {\n if (!this.open) return;\n if (this.modal) return;\n // Wait until end of event loop cycle to see if focus really is lost\n queueMicrotask(() => {\n if (this.matches(':focus-within')) return;\n const activeElement = document.activeElement;\n if (activeElement\n && (this.cascader === activeElement || this.contains(activeElement))) {\n return;\n }\n this.close(false);\n });\n },\n })\n .autoRegister('mdw-menu');\n", "// https://www.w3.org/TR/wai-aria-practices/#menu\n\nimport FormAssociatedMixin from '../mixins/FormAssociatedMixin.js';\n\nimport './Icon.js';\nimport ListOption from './ListOption.js';\n\nexport default class MenuItem extends ListOption\n .mixin(FormAssociatedMixin)\n .extend()\n .set({\n _cascadeTimeout: null,\n CASCADE_TIMEOUT: 500,\n _cascading: false,\n })\n .define({\n type() {\n if (this.radio != null) return 'radio';\n if (this.checkbox != null) return 'checkbox';\n return null;\n },\n })\n .observe({\n /** ID of menu to cascade */\n cascades: 'string',\n /** Can be null */\n _defaultValue: {\n attr: 'value',\n reflect: true,\n nullParser: String,\n empty: null,\n },\n })\n .observe({\n /** Never returns null */\n defaultValue: {\n reflect: false,\n get() {\n return this._defaultValue ?? '';\n },\n /** @param {string} value */\n set(value) {\n this._defaultValue = value;\n },\n },\n value: {\n reflect: false,\n get() {\n return this._defaultValue ?? 'on';\n },\n /**\n * @param {string} value\n * @return {void}\n */\n set(value) {\n this._defaultValue = value;\n },\n },\n })\n .overrides({\n formIPCEvent(event) {\n if (event.target instanceof HTMLFormElement && event.target !== this.form) {\n console.warn('Control.formIPCEvent: Abort from wrong form');\n return;\n }\n if (this.type !== 'radio') {\n console.warn('Control.formIPCEvent: Abort from not radio');\n return;\n }\n const [name, value] = event.detail;\n if (this.name !== name) return;\n if (value === this.value) return;\n if (this.value === '1') {\n console.log('unchecking', this.name, this.value);\n this.selected = false;\n } else {\n this.selected = false;\n }\n },\n })\n .expressions({\n computeTrailingIcon({ trailingIcon, cascades }) {\n if (!trailingIcon && cascades) return 'arrow_right';\n return trailingIcon;\n },\n })\n .methods({\n unscheduleCascade() {\n clearTimeout(this._cascadeTimeout);\n this._cascadeTimeout = null;\n },\n scheduleCascade() {\n if (this._cascadeTimeout) return;\n this._cascadeTimeout = setTimeout(this.cascade.bind(this), this.CASCADE_TIMEOUT);\n },\n cascade() {\n this.unscheduleCascade();\n this._cascading = true;\n document.getElementById(this.cascades)?.cascade?.(this);\n this._cascading = false;\n },\n })\n .on({\n _selectedChanged(oldValue, newValue) {\n console.log('_selectedChanged', oldValue, newValue);\n if (newValue) {\n this.elementInternals.setFormValue(this.value);\n if (this.type === 'radio') {\n this._notifyRadioChange(this.name, this.value);\n }\n } else {\n this.elementInternals.setFormValue(null);\n }\n if (this._selectedDirty) {\n this.dispatchEvent(new Event('change', { bubbles: true }));\n }\n },\n })\n .events({\n mouseenter() {\n if (this.disabledState) return;\n if (document.activeElement !== this) {\n this.focus();\n }\n if (!this.cascades) return;\n this.scheduleCascade();\n },\n mouseout: 'unscheduleCascade',\n '~click'() {\n if (this.disabledState) return;\n if (this.type === 'radio') {\n if (this.required) return;\n this.selected = true;\n } else if (this.type === 'checkbox') {\n if (this.required) return;\n this.selected = !this.selected;\n return;\n }\n\n if (this.cascades) {\n this.cascade();\n }\n },\n keydown(event) {\n if (this.disabledState) return;\n switch (event.key) {\n case 'Enter':\n case ' ':\n event.stopPropagation();\n event.preventDefault();\n this.click();\n break;\n case 'ArrowLeft':\n case 'ArrowRight':\n if (!this.cascades) break;\n if (getComputedStyle(this).direction === 'rtl') {\n if (event.key === 'ArrowRight') break;\n } else if (event.key === 'ArrowLeft') break;\n event.stopPropagation();\n event.preventDefault();\n this.cascade();\n break;\n default:\n }\n },\n /**\n * Closes submenu if focus leaves cascader to something else (sibling menu item)\n * RelatedTarget is unreliable on Webkit\n */\n blur() {\n if (!this.cascades) return;\n if (this._cascading) return;\n const submenuElement = document.getElementById(this.cascades);\n if (submenuElement.matches(':focus-within')) return;\n console.debug('closing submenu via cascader blur');\n submenuElement.close(false);\n },\n })\n .on({\n composed({ inline, html }) {\n const { checkbox: checkboxRef, radio: radioRef, anchor, trailing, trailingIcon } = this.refs;\n checkboxRef.remove();\n radioRef.remove();\n\n anchor.setAttribute('role', inline(({ checkbox, radio }) => {\n if (checkbox != null) return 'menuitemcheckbox';\n if (radio != null) return 'menuitemradio';\n return 'menuitem';\n }));\n\n // MenuItems use checked instead of selected as in list items.\n anchor.setAttribute('ariaChecked', anchor.getAttribute('aria-selected'));\n\n anchor.after(html`\n <mdw-icon id=selection\n _if=${({ checkbox, radio }) => checkbox ?? radio ?? false}\n class=${({ checkbox, radio }) => checkbox || radio || 'leading'}\n selected={selected}>check</mdw-icon>\n `);\n\n trailing.setAttribute('type-style', 'label-large');\n\n trailingIcon.setAttribute('_if', '{computeTrailingIcon}');\n trailingIcon.textContent = '{computeTrailingIcon}';\n },\n })\n .css`\n /* https://m3.material.io/components/menus/specs */\n\n :host {\n gap: 12px;\n\n padding-inline: 12px;\n\n cursor: pointer;\n\n white-space: nowrap;\n }\n\n #content {\n padding-block: calc(4px + (var(--mdw-density) * 2px))\n }\n\n #icon {\n transition-duration: 100ms;\n transition-property: opacity;\n will-change: opacity;\n }\n\n #trailing,\n #icon {\n color: rgb(var(--mdw-color__on-surface-variant));\n }\n\n #selection {\n opacity: 0;\n\n font-size: 18px;\n }\n\n #selection.trailing {\n font-size: 24px;\n }\n\n #selection[selected] {\n opacity: 1;\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n }\n\n #anchor[selected] {\n background-color: transparent;\n color: inherit;\n }\n\n #content[selected] {\n color: inherit;\n }\n `\n .autoRegister('mdw-menu-item')\n .tsClassFix() {\n formResetCallback() {\n this._selected = this.defaultSelected;\n super.formResetCallback();\n }\n}\n", "const IDLE_TIMEOUT_MS = 500;\n\n/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function ScrollListenerMixin(Base) {\n return Base\n .extend()\n .observe({\n scrollListenerPositionX: { type: 'float', empty: 0, reflect: false },\n scrollListenerPositionY: { type: 'float', empty: 0, reflect: false },\n })\n .set({\n /** @type {WeakRef<EventTarget>} */\n _scroller: null,\n /** @type {EventListener} */\n _scrollerScrollListener: null,\n /** @type {EventListener} */\n _scrollerResizeListener: null,\n _scrollDebounce: null,\n })\n .methods({\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onScrollIdle() {},\n\n /** @param {Event} event */\n onScrollerScroll(event) {\n this.scrollListenerPositionY = (event.currentTarget === window)\n ? window.scrollY\n : /** @type {HTMLElement} */ (event.currentTarget).scrollTop;\n\n this.scrollListenerPositionX = (event.currentTarget === window)\n ? window.scrollX\n : /** @type {HTMLElement} */ (event.currentTarget).scrollLeft;\n\n clearTimeout(this._scrollDebounce);\n this._scrollDebounce = setTimeout(() => this.onScrollIdle(), IDLE_TIMEOUT_MS);\n },\n\n /** @param {Event} event */\n onScrollerResize(event) {},\n\n /**\n * @param {EventTarget} [scroller]\n * @return {boolean}\n */\n startScrollListener(scroller) {\n scroller ??= this.offsetParent;\n if (!scroller) return false;\n\n if (scroller === document.body) {\n // console.log('scroller is body, attaching to window');\n scroller = window;\n }\n\n this._scroller = new WeakRef(scroller);\n this._scrollerScrollListener = this.onScrollerScroll.bind(this);\n this._scrollerResizeListener = this.onScrollerResize.bind(this);\n scroller.addEventListener('scroll', this._scrollerScrollListener);\n scroller.addEventListener('resize', this._scrollerResizeListener);\n this.scrollListenerPositionX = 0;\n this.scrollListenerPositionY = 0;\n return true;\n },\n\n getScrollingElementScrollHeight() {\n const element = this.getScroller();\n if (element === window) {\n return document.documentElement.scrollHeight;\n }\n // @ts-expect-error Skip Element cast\n return element.scrollHeight;\n },\n\n getScrollingElementClientHeight() {\n const element = this.getScroller();\n if (element === window) {\n return window.innerHeight;\n }\n // @ts-expect-error Skip Element cast\n return element.clientHeight;\n },\n\n getScroller() {\n return this._scroller.deref();\n },\n\n /**\n * @param {EventTarget} [scroller]\n * @return {boolean}\n */\n clearScrollListener(scroller) {\n scroller ??= this._scroller?.deref();\n if (!scroller) return false;\n if (!this._scrollerScrollListener) return false;\n scroller.removeEventListener('scroll', this._scrollerScrollListener);\n return true;\n },\n });\n}\n", "import './Icon.js';\nimport './Ripple.js';\nimport './Badge.js';\n\nimport CustomElement from '../core/CustomElement.js';\nimport RippleMixin from '../mixins/RippleMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n/** @typedef {'charset'|'coords'|'name'|'shape'} DeprecatedHTMLAnchorElementProperties */\n\nexport default class NavItem extends CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(RippleMixin)\n .mixin(ShapeMixin)\n .extend()\n .set({\n delegatesFocus: true,\n stateLayer: true,\n })\n .observe({\n showLabel: 'string',\n active: 'boolean',\n icon: 'string',\n src: 'string',\n href: 'string',\n badge: 'string',\n ariaLabel: 'string', // watch attribute and emit callback\n })\n .methods({\n focus(options) {\n this.refs.anchor.focus(options);\n },\n })\n .html/* html */`\n <mdw-icon id=icon aria-hidden=true src={src} active={active}>{icon}</mdw-icon>\n <a id=anchor\n aria-current=${({ active }) => (active ? 'page' : null)}\n aria-describedby=badge\n aria-label={ariaLabel}\n aria-labelledby=${({ ariaLabel }) => (ariaLabel ? null : 'slot')}\n href=${({ href }) => href ?? '#'}>\n </a>\n <slot id=slot active={active} show-label={showLabel} aria-hidden=true></slot>\n <mdw-badge part=badge id=badge badge={badge} show-label={showLabel} aria-hidden=true>{badge}</mdw-badge>\n `\n .on({\n composed({ html }) {\n const { shape, state, rippleContainer } = this.refs;\n shape.append(html`\n <mdw-ripple id=ripple ripple-origin=center keep-alive hold-ripple ripple-state=${({ active }) => ((active) ? null : 'complete')}></mdw-ripple>\n ${state}\n ${rippleContainer}\n `);\n shape.setAttribute('active', '{active}');\n shape.removeAttribute('color');\n },\n })\n .css`\n /* https://m3.material.io/components/navigation-bar/specs */\n /* https://m3.material.io/components/navigation-drawer/specs */\n /* https://m3.material.io/components/navigation-rail/specs */\n\n :host {\n --mdw-badge__scale: 0;\n --mdw-shape__size: var(--mdw-shape__full);\n --mdw-nav-item__offset-y: 0;\n position: relative;\n\n display: grid;\n align-content: center;\n align-items: center;\n grid-auto-flow: row;\n grid-auto-rows: minmax(20px, min-content);\n grid-template-rows: [icon] minmax(32px, 1fr);\n grid-template-columns: [icon] minmax(56px, 1fr);\n\n justify-items: center;\n row-gap: 4px;\n\n box-sizing: border-box;\n min-block-size: 56px;\n\n padding-inline: 0;\n\n cursor: pointer;\n /* stylelint-disable-next-line plugin/no-unsupported-browser-features */\n user-select: none;\n\n font: var(--mdw-typescale__label-large__font);\n letter-spacing: var(--mdw-typescale__label-large__letter-spacing);\n\n text-align: center;\n }\n\n :host(:not([color])) {\n --mdw-ink: var(--mdw-color__on-secondary-container);\n --mdw-bg: var(--mdw-color__secondary-container);\n }\n\n :host([color]) {\n background-color: transparent;\n color: rgb(var(--mdw-color__on-surface-variant));\n }\n\n #slot {\n display: contents;\n align-items: center;\n flex-direction: column;\n grid-area: label;\n justify-content: center;\n\n grid-column: 1 /4;\n\n grid-row: 2;\n\n flex: 1;\n\n cursor: inherit;\n outline: none;\n\n transform: translateY(var(--mdw-nav-item__offset-y));\n\n color: rgb(var(--mdw-color__on-surface-variant));\n\n transition: opacity, color, transform 200ms;\n will-change: opacity, transform;\n }\n\n #anchor {\n position: absolute;\n inset: 0;\n }\n\n #shape {\n position: absolute;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n top: 50%;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: 50%;\n\n block-size: 100%;\n inline-size: 100%;\n max-inline-size: 56px;\n\n grid-column: icon;\n grid-row: 1 / 1;\n\n transform: translateX(-50%) translateY(-50%) translateY(var(--mdw-nav-item__offset-y));\n z-index: 0;\n\n background-color: transparent;\n\n transition: transform 200ms;\n will-change: transform;\n }\n\n #icon {\n position: relative;\n align-self: center;\n\n grid-area: icon;\n\n transform: translateY(var(--mdw-nav-item__offset-y));\n z-index: 3;\n\n color: rgb(var(--mdw-color__on-surface-variant));\n\n font-size: 24px;\n font-variation-settings: 'FILL' 0;\n\n transition: transform 200ms;\n will-change: transform;\n }\n\n #state {\n z-index: 2;\n }\n\n #badge {\n --mdw-badge__scale: 0;\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 50%;\n\n overflow: hidden;\n\n max-inline-size: 50%;\n grid-column: 1 / 4;\n\n grid-row: 1 / 2;\n\n transform: translateY(-100%) translateY(var(--mdw-nav-item__offset-y)) scale(var(--mdw-badge__scale));\n z-index: 4;\n\n text-align: start;\n text-overflow: ellipsis;\n text-transform: none;\n white-space: nowrap;\n word-break: normal;\n\n transition: transform 200ms;\n will-change: transform;\n }\n\n #badge[badge] {\n --mdw-badge__scale: 1;\n }\n\n #ripple {\n opacity: 1;\n\n color: rgb(var(--mdw-bg));\n }\n\n #ripple-container {\n z-index:1;\n }\n\n #shape[active] {\n color: rgb(var(--mdw-ink));\n }\n\n #icon[active] {\n color: rgb(var(--mdw-ink));\n\n font-variation-settings: 'FILL' 1;\n }\n\n #slot[active] {\n color: inherit;\n }\n\n :host([show-label]) {\n --mdw-nav-item__offset-y: 12px;\n }\n\n :host([show-label=\"active\"][active]) {\n --mdw-nav-item__offset-y: 0;\n }\n `\n .childEvents({\n anchor: {\n click() {\n /* Prevent Default (false) if no href */\n return this.href != null;\n },\n keydown({ key, repeat }) {\n if (key !== ' ') return true;\n if (!repeat) this.click();\n return false;\n },\n },\n })\n .autoRegister('mdw-nav-item')\n .tsClassFix() {\n addRipple(...args) {\n if (!this.active) return null;\n return super.addRipple(...args);\n }\n}\n", "import NavItem from './NavItem.js';\nimport Surface from './Surface.js';\n\nexport default Surface\n .extend()\n .css`\n /* https://m3.material.io/components/navigation-bar/specs */\n /* https://m3.material.io/components/navigation-drawer/specs */\n /* https://m3.material.io/components/navigation-rail/specs */\n\n :host {\n --mdw-surface__tint: var(--mdw-surface__tint__2);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__2);\n --mdw-ink: var(--mdw-color__on-surface);\n --mdw-bg: var(--mdw-color__surface);\n\n z-index:2;\n\n color: rgb(var(--mdw-ink));\n\n font: var(--mdw-typescale__label-medium__font);\n letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);\n }\n `\n .set({\n elevated: true,\n color: 'surface',\n })\n .events({\n '~click'(event) {\n // Abort if not child\n if (event.target === this) return;\n if (event.target instanceof NavItem === false) return;\n for (const el of this.querySelectorAll('*')) {\n if (el instanceof NavItem === false) continue;\n el.active = (el === event.target);\n }\n },\n })\n .autoRegister('mdw-nav');\n", "import { ELEMENT_STYLER_TYPE } from '../core/customTypes.js';\nimport ScrollListenerMixin from '../mixins/ScrollListenerMixin.js';\n\nimport Nav from './Nav.js';\n\nexport default Nav\n .mixin(ScrollListenerMixin)\n .observe({\n hideOnScroll: 'boolean',\n _translateY: { type: 'float', empty: 0 },\n _transition: { empty: 'none' },\n })\n .observe({\n _positioningStyle: {\n ...ELEMENT_STYLER_TYPE,\n get({ _translateY, _transition }) {\n return {\n styles: {\n transform: `translateY(${_translateY}px)`,\n transition: _transition,\n },\n };\n },\n },\n })\n .methods({\n onScrollerResize() {\n console.log('onScrollerResize');\n // Chrome Bug: When window resizes bottom sticky needs to be recomputed\n // Force style recalculation\n this.style.setProperty('bottom', 'auto');\n // eslint-disable-next-line no-unused-expressions\n this.clientHeight;\n this.style.removeProperty('bottom');\n this.propChangedCallback('scrollListenerPositionY', this.scrollListenerPositionY, this.scrollListenerPositionY);\n },\n onScrollIdle() {\n const max = this.scrollHeight;\n const visibility = (max - this._translateY) / max;\n if (visibility <= 0) return;\n if (visibility >= 1) return;\n if (visibility >= 0.5) {\n // Reveal all\n this._translateY = 0;\n this._transition = 'transform 250ms ease-in';\n } else {\n this._translateY = max;\n this._transition = 'transform 200ms ease-out';\n }\n },\n })\n .css`\n /* https://m3.material.io/components/navigation-bar/specs */\n\n :host {\n position: sticky;\n inset-block-end: 0;\n order:1; /* Nav Bars are at top of tab order, but bottom of page */\n\n display: grid;\n align-content: flex-start;\n align-items: flex-start;\n gap: 8px;\n grid-auto-columns: minmax(48px, 1fr);\n grid-auto-flow: column;\n\n overflow: hidden; /* Don't expand viewport when contents translates */\n\n box-sizing: border-box;\n min-block-size: 80px;\n inline-size: 100%;\n\n flex-shrink: 0;\n\n transform: translateY(0);\n\n box-shadow: none;\n\n text-align: center;\n\n will-change: transform;\n }\n\n #slot {\n pointer-events: auto;\n }\n\n `\n .on({\n connected() {\n if (this.hideOnScroll) {\n if (this.offsetParent) {\n this.startScrollListener(this.offsetParent ?? window);\n } else {\n const resizeObserver = new ResizeObserver(() => {\n this.startScrollListener(this.offsetParent ?? window);\n resizeObserver.disconnect();\n });\n resizeObserver.observe(this);\n }\n }\n },\n disconnected() {\n this.clearScrollListener();\n },\n scrollListenerPositionYChanged(oldValue, newValue) {\n if (!this.hideOnScroll) return;\n const delta = newValue - oldValue;\n const rate = 1;\n const shift = rate * delta;\n\n const bottom = this.getScrollingElementScrollHeight() - this.getScrollingElementClientHeight();\n const breakpoint = bottom - this.scrollHeight;\n let max = this.scrollHeight;\n if (newValue >= breakpoint) {\n // Scrolling to bottom always shows Nav Bar (ensures content isn't occluded)\n max -= (newValue - breakpoint);\n }\n this._transition = 'none';\n this._translateY = Math.max(0, Math.min(this._translateY + shift, max));\n },\n })\n .autoRegister('mdw-nav-bar');\n", "import NavItem from './NavItem.js';\n\nexport default NavItem\n .extend()\n .css`\n /* https://m3.material.io/components/navigation-bar/specs */\n /* https://m3.material.io/components/navigation-drawer/specs */\n /* https://m3.material.io/components/navigation-rail/specs */\n\n :host {\n grid-auto-rows: minmax(20px, min-content);\n grid-template-rows: [icon] minmax(32px, 1fr);\n grid-template-columns: auto [icon] minmax(56px, 1fr) auto;\n\n padding-block: 12px; /* Spec 16px bottom is based on 1em not 1lh */\n }\n\n #slot {\n display: block;\n }\n\n :host(:empty) {\n font-size: 0;\n line-height: 0;\n }\n\n #slot[show-label] {\n grid-column: 1 /4;\n\n grid-row: 2;\n\n opacity: 0;\n }\n\n #shape {\n grid-column: 2;\n grid-row: 1 / 1;\n }\n\n #slot[show-label=\"never\"] {\n block-size: 0;\n }\n\n #slot[show-label=\"active\"][active] {\n opacity: 1;\n }\n\n `\n .autoRegister('mdw-nav-bar-item');\n", "import Nav from './Nav.js';\n\nexport default Nav\n .extend()\n .observe({\n align: { value: /** @type {'start'|'center'|'end'} */ (null) },\n })\n .on({\n composed({ html }) {\n const { slot } = this.refs;\n slot.before(html`<slot id=start name=start></slot>`);\n slot.setAttribute('align', '{align}');\n },\n })\n .css`\n /* https://m3.material.io/components/navigation-rail/specs */\n\n :host{\n display: grid;\n align-content: flex-start;\n flex-direction: column;\n grid-template-rows: auto minmax(0,1fr);\n grid-template-columns: 80px;\n justify-items: stretch;\n\n text-align: center;\n }\n\n #start {\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: 12px;\n\n padding-block-start: 12px;\n\n }\n\n #slot {\n align-self: center;\n\n display: flex;\n align-items: stretch;\n flex-direction: column;\n gap: 12px;\n overflow-x: clip;\n overflow-y: auto;\n\n box-sizing: border-box;\n\n inline-size: 100%;\n\n padding-block: 12px;\n }\n\n #slot[align=\"start\"] {\n align-self: flex-start;\n }\n\n #slot[align=\"end\"] {\n align-self: flex-end;\n }\n\n `\n .autoRegister('mdw-nav-rail');\n", "import NavRail from './NavRail.js';\n\nexport default NavRail\n .extend()\n .observe({\n shapeEnd: {\n type: 'boolean',\n empty: true,\n },\n })\n .css`\n /* https://m3.material.io/components/navigation-drawer/specs */\n\n :host([open]) {\n --mdw-surface__tint: var(--mdw-surface__tint__0);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__1);\n --mdw-shape__size: var(--mdw-shape__large, 16px);\n --mdw-shape__size__top-start-size: 0px;\n --mdw-shape__size__bottom-start-size: 0px;\n\n --mdw-nav-item__badge__position: static;\n --mdw-nav-item__badge__transform: none;\n --mdw-nav-item__badge__grid-area: badge;\n --mdw-nav-item__label__padding-block: 18px;\n --mdw-nav-item__label__padding-inline: 52px 0;\n --mdw-nav-item__anchor__display: block;\n --mdw-nav-item__indicator__grid-area: auto;\n\n display: block;\n grid-template-rows: min-content;\n grid-template-columns: minmax(360px, min-content);\n\n min-inline-size: 360px;\n padding-inline: 12px;\n\n box-shadow: none;\n\n }\n\n #slot {\n gap: 0;\n }\n\n `\n .autoRegister('mdw-nav-drawer');\n", "import NavItem from './NavItem.js';\n\nexport default NavItem\n .extend()\n .css`\n /* https://m3.material.io/components/navigation-bar/specs */\n /* https://m3.material.io/components/navigation-drawer/specs */\n /* https://m3.material.io/components/navigation-rail/specs */\n\n :host {\n align-self: stretch;\n\n display: grid;\n display: flex;\n align-items: center;\n gap: 12px;\n grid-template:\n \"icon label badge\" minmax(56px, min-content)\n / 24px 1fr minmax(0, min-content);\n justify-items: flex-start;\n\n padding-inline: 16px 24px;\n }\n\n #icon {\n grid-area: icon;\n }\n\n #slot {\n display: block;\n\n text-align: start;\n }\n\n :host([active]) {\n color: rgb(var(--mdw-ink));\n }\n\n #shape {\n max-inline-size: none;\n grid-column: auto;\n grid-row: 1 / 2;\n }\n\n #badge-text {\n z-index: 1;\n }\n `\n .on({\n composed({ html }) {\n this.refs.badge.replaceWith(html`<span id=\"badge-text\">{badge}</span>`);\n },\n })\n .autoRegister('mdw-nav-drawer-item');\n", "/* https://m3.material.io/components/navigation-rail/specs */\n\nimport NavItem from './NavItem.js';\n\nexport default NavItem\n .extend()\n .css`\n :host {\n grid-auto-flow: row;\n grid-auto-rows: minmax(20px, min-content);\n grid-template-rows: [icon] minmax(32px, 1fr);\n grid-template-columns: [icon] minmax(56px, 1fr);\n\n padding-inline: 12px;\n }\n\n #slot {\n display: contents;\n overflow-wrap: anywhere;\n\n word-break: break-all;\n word-break: break-word;\n }\n\n #badge {\n max-inline-size:40px;\n grid-column: 1 / 2;\n }\n `\n .autoRegister('mdw-nav-rail-item');\n", "import CustomElement from '../core/CustomElement.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .extend()\n .observe({\n columns: 'integer',\n flexible: 'boolean',\n fixed: 'boolean',\n split: 'boolean',\n navDrawer: 'boolean',\n navRail: 'boolean',\n })\n .html/* html */`\n <slot id=slot></slot>\n `\n .css`\n /* https://m2.material.io/design/layout/responsive-layout-grid.html#columns-gutters-and-margins */\n /*\n * Window breakpoints\n * Compact (0 <= width < 600px):\n * * Single: 100vw - padding\n * * Padding: 16px\n * * Spacer: 0 (none)\n * Medium (600px <= width < 840px)\n * * Single: 100vw - padding - (?navrail)\n * * [Fixed]: 360px\n * * [Flexable]: 100vw - 360px - spacer - padding\n * * [Split] 50vw - ((padding + spacer) / 2)\n * * Padding: 24px\n * * Spacer: 24px\n * Expanded (840px <= width)\n * * Single: 100vw - padding - (?navrail | ?navdrawer)\n * * [Fixed] 360px\n * * [Flexable] 100vw - 360px - spacer - padding - (?navrail | ?navdrawer)\n * * [Split] 50vw - ((padding + spacer + (?navrail | ?navdrawer)) / 2)\n * * Padding: 24px\n * * Spacer: 24px\n *\n * | Screen size | Margin | Body | Layout columns |\n * |---------------------|---------|---------|----------------|\n * | Extra-small (phone) | | | |\n * | 0-631dp | 16dp | Scaling | 4 |\n * | 632 - 647 | Scaling | 600dp | 8 |\n * | Small (tablet) | | | |\n * | 648-887 | 24dp | Scaling | 8 |\n * | 888-1239 | Scaling | 840dp | 12 |\n * | Medium (laptop) | | | |\n * | 1240-1439 | 200dp | Scaling | 12 |\n * | Large (desktop) | | | |\n * | 1440+ | Scaling | 1040 | 12 |\n *\n *\n * Column count is pane-based, not window based requiring newly computed values.\n * Gutters are irrelevant to pane sizing.\n * Nav Rail is ~80px.\n * Nav Drawer is ~360px.\n * Padding and spacers are set by pane's parent.\n * Avoid using CSS Variables because panes are at top of document tree. https://bugs.chromium.org/p/chromium/issues/detail?id=1056209\n * Container queries would reduce code considerably.\n */\n\n /* Compact */\n :host {\n display: grid;\n align-content: flex-start;\n gap: 16px;\n grid-auto-flow: row;\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n\n flex: 1;\n\n transition-duration: 200ms;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n transition-property: visibility, width, max-inline-size;\n }\n\n /* Will set 8col when window is 600px + padding (2x16) */\n /* Will set 12col when window is 840px + padding (2x24) */\n @media screen and (min-width: 632px) { :host { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 888px) { :host { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) */\n @media screen and (min-width: 648px) { :host { max-inline-size: 840px } }\n @media screen and (min-width: 1240px) { :host { max-inline-size: 1040px; } }\n\n /* NAVRAIL */\n\n :host([nav-rail]) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + navrail (80) */\n /* Will set 12col when window is 840px + padding (2x24) + navrail (80) */\n @media screen and (min-width: 728px) { :host([nav-rail]) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 968px) { :host([nav-rail]) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + navrail (80) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + navrail (80) */\n @media screen and (min-width: 728px) { :host([nav-rail]) { max-inline-size: 840px } }\n @media screen and (min-width: 1320px) { :host([nav-rail]) { max-inline-size: 1040px; } }\n\n /* NAVDRAWER */\n\n :host([nav-drawer]) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + navdrawer (360) */\n /* Will set 12col when window is 840px + padding (2x24) + navdrawer (360) */\n @media screen and (min-width: 1008px) { :host([nav-rail]) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 1248px) { :host([nav-rail]) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + navrail (360) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + navrail (360) */\n @media screen and (min-width: 1008px) { :host([nav-rail]) { max-inline-size: 840px } }\n @media screen and (min-width: 1600px) { :host([nav-rail]) { max-inline-size: 1040px; } }\n\n /* FLEXIBLE */\n\n :host([flexible]) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + fixed (360) */\n /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + fixed (360) */\n @media screen and (min-width: 1032px) { :host([flexible]) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 1272px) { :host([flexible]) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + fixed (360) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + fixed (360) */\n @media screen and (min-width: 1032px) { :host([flexible]) { max-inline-size: 840px } }\n @media screen and (min-width: 1624px) { :host([flexible]) { max-inline-size: 1040px; } }\n\n /* FLEXIBLE + NAV RAIL */\n\n :host([flexible]:where([nav-rail])) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + fixed (360) + navrail (80) */\n /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + fixed (360) + navrail (80) */\n @media screen and (min-width: 1112px) { :host([flexible]:where([nav-rail])) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 1352px) { :host([flexible]:where([nav-rail])) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + fixed (360) + navrail (80) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + fixed (360) + navrail (80) */\n @media screen and (min-width: 1112px) { :host([flexible]:where([nav-rail])) { max-inline-size: 840px } }\n @media screen and (min-width: 1704px) { :host([flexible]:where([nav-rail])) { max-inline-size: 1040px; } }\n\n /* FLEXIBLE + NAV DRAWER */\n\n :host([flexible]:where([nav-drawer])) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + fixed (360) + navdrawer (360) */\n /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + fixed (360) + navdrawer (360) */\n @media screen and (min-width: 1392px) { :host([flexible]:where([nav-drawer])) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 1632px) { :host([flexible]:where([nav-drawer])) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + fixed (360) + navdrawer (360) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + fixed (360) + navdrawer (360) */\n @media screen and (min-width: 1392px) { :host([flexible]:where([nav-drawer])) { max-inline-size: 840px } }\n @media screen and (min-width: 1984px) { :host([flexible]:where([nav-drawer])) { max-inline-size: 1040px; } }\n\n /* SPLIT */\n\n :host([split]) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + split (600) */\n /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + split (840) */\n @media screen and (min-width: 1272px) { :host([split]) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 1752px) { :host([split]) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + split (600) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + split (840) */\n @media screen and (min-width: 1272px) { :host([split]) { max-inline-size: 840px } }\n @media screen and (min-width: 2104px) { :host([split]) { max-inline-size: 1040px; } }\n\n /* SPLIT + NAVRAIL */\n\n :host([split]:where([nav-rail])) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + split (600) + navrail (80) */\n /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + split (840) + navrail (80) */\n @media screen and (min-width: 1352px) { :host([split]:where([nav-rail])) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 1832px) { :host([split]:where([nav-rail])) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + split (600) + navrail (80) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + split (840) + navrail (80) */\n @media screen and (min-width: 1352px) { :host([split]:where([nav-rail])) { max-inline-size: 840px } }\n @media screen and (min-width: 2184px) { :host([split]:where([nav-rail])) { max-inline-size: 1040px; } }\n\n /* SPLIT + NAVDRAWER */\n\n :host([split]:where([nav-drawer])) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + split (600) + navdrawer (360) */\n /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + split (840) + navdrawer (360) */\n @media screen and (min-width: 1632px) { :host([split]:where([nav-drawer])) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 2112px) { :host([split]:where([nav-drawer])) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + split (600) + navdrawer (360) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + split (840) + navdrawer (360) */\n @media screen and (min-width: 1632px) { :host([split]:where([nav-drawer])) { max-inline-size: 840px } }\n @media screen and (min-width: 2464px) { :host([split]:where([nav-drawer])) { max-inline-size: 1040px; } }\n\n :host([full-width]) {\n max-inline-size: none;\n }\n\n /** FIXED **/\n\n :host([fixed]) {\n grid-template-columns: repeat(4, 1fr);\n\n inline-size:360px;\n }\n\n @media screen and (max-width: 600px) {\n :host(:nth-of-type(2)) {\n display: none;\n }\n }\n /* Will cap to 360px when window is 360px + padding (2x24px) + spacer (24) + 360px */\n @media screen and (min-width: 792px) {\n :host([fixed]) {\n max-inline-size: 360px\n }\n }\n\n #scrim {\n position: absolute;\n inset: 0;\n\n grid-area: auto;\n }\n\n #slot::slotted(*) { grid-column: 1 / none }\n #slot::slotted([colspan=\"1\"]) { grid-column-end: span 1; }\n #slot::slotted([colspan=\"2\"]) { grid-column-end: span 2; }\n #slot::slotted([colspan=\"3\"]) { grid-column-end: span 3; }\n #slot::slotted([colspan=\"4\"]) { grid-column-end: span 4; }\n #slot::slotted([colspan=\"5\"]) { grid-column-end: span 5; }\n #slot::slotted([colspan=\"6\"]) { grid-column-end: span 6; }\n #slot::slotted([colspan=\"7\"]) { grid-column-end: span 7; }\n #slot::slotted([colspan=\"8\"]) { grid-column-end: span 8; }\n #slot::slotted([colspan=\"9\"]) { grid-column-end: span 9; }\n #slot::slotted([colspan=\"10\"]) { grid-column-end: span 10; }\n #slot::slotted([colspan=\"11\"]) { grid-column-end: span 11; }\n #slot::slotted([colspan=\"12\"]) { grid-column-end: span 12; }\n\n `\n .autoRegister('mdw-pane');\n", "/* https://m3.material.io/components/progress-indicators/specs */\n\nimport CustomElement from '../core/CustomElement.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n// https://html.spec.whatwg.org/multipage/form-elements.html#the-progress-element\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .extend()\n .observe({\n circle: 'boolean',\n value: 'float',\n max: 'float',\n autoHide: 'boolean',\n _determinateStyle: 'string',\n })\n .observe({\n _valueAsFraction: {\n type: 'float',\n get({ value, max }) {\n return (value / (max || 100));\n },\n changedCallback(oldValue, newValue) {\n this._determinateStyle = `\n --previous:${oldValue ?? newValue ?? 0};\n --value:${newValue ?? 0};\n `;\n },\n },\n })\n .define({\n position() {\n return /** @type {HTMLProgressElement} */ (this.refs.progress).position;\n },\n labels() {\n return /** @type {HTMLProgressElement} */ (this.refs.progress).labels;\n },\n })\n .html/* html */`\n <div id=determinate style=\"{_determinateStyle}\">\n <progress id=progress value={value} max={max} circle={circle}></progress>\n <div _if={circle} id=circle>\n <div id=semi1 class=semi></div>\n <div id=semi2 class=semi></div>\n </div>\n </div>\n <div _if={!value} id=indeterminate>\n <div _if={!circle} id=indeterminate-line>\n <div id=line1 class=line value={value}></div>\n <div id=line2 class=line value={value}></div>\n </div>\n <div _if={circle} id=indeterminate-circle>\n <div id=arc2 class=arc></div>\n <div id=arc3 class=arc></div>\n <div id=arc4 class=arc></div>\n </div>\n </div>\n `\n .css`\n /* Base Styles */\n\n :host {\n --mdw-bg: var(--mdw-color__surface-variant);\n --mdw-ink: var(--mdw-color__primary);\n --mdw-progress__opacity__duration: 500ms;\n position: relative;\n\n display: inline-block;\n overflow: hidden;\n vertical-align: middle;\n\n min-block-size: 4px;\n inline-size: 100%;\n\n opacity: 1;\n\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-ink));\n\n transition: opacity 500ms 275ms;\n }\n\n :host([auto-hide]) {\n will-change: opacity;\n }\n\n :host([auto-hide][value=\"100\"]) {\n opacity:0;\n\n transition: opacity 1s 1s;\n }\n\n #determinate {\n --previous: 0;\n --value: 0;\n }\n\n #progress {\n position: absolute;\n inset: 0;\n\n box-sizing: border-box;\n block-size: 100%;\n inline-size: 100%;\n border: none; /* FireFox */\n\n -moz-appearance: none;\n appearance: none;\n\n opacity:0;\n transform: scaleX(var(--value, 0));\n transform-origin: 0 0;\n\n background-color: currentColor;\n color: inherit;\n\n transition: transform 275ms, opacity var(--mdw-progress__opacity__duration);\n will-change: transform, opacity;\n }\n\n #progress::-webkit-progress-bar {\n display: none;\n }\n\n #progress::-moz-progress-bar {\n display: none; /* Doesn't always work */\n\n block-size: 0;\n }\n\n #progress[value] {\n opacity:1;\n transform: scaleX(var(--value, 0));\n }\n `\n .css`\n /* Line Styles */\n\n /* https://github.com/material-components/material-components-android/blob/ed77ab36ccac98df24e55060d58406c5981a9062/lib/java/com/google/android/material/progressindicator/ */\n\n :host {\n --mdw-progress__line1-head__timing: cubic-bezier(0.2, 0.8, 0, 1.0);\n --mdw-progress__line1-tail__timing: cubic-bezier(0.4, 0.0, 1.0, 1.0);\n --mdw-progress__line2-head__timing: cubic-bezier(0.0, 0.65, 0, 1.0);\n --mdw-progress__line2-tail__timing: cubic-bezier(0.1, 0.45, 0, 1.0);\n --mdw-progress__line__duration: 1800ms;\n }\n\n @media (prefers-reduced-motion) {\n :host {\n --mdw-progress__line__duration: 18000ms\n }\n }\n\n .line {\n opacity: 1;\n\n transition: opacity var(--mdw-progress__opacity__duration);\n will-change: opacity;\n }\n\n .line,\n .line::after {\n position: absolute;\n inset: 0;\n\n overflow: hidden;\n\n animation-duration: var(--mdw-progress__line__duration);\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n animation-fill-mode: forwards;\n }\n\n .line::after {\n content: '';\n\n background-color: currentColor;\n\n animation: inherit;\n will-change: transform;\n }\n\n #line1 {\n animation-name: l1h;\n }\n\n #line2 {\n animation-name: l2h;\n }\n\n #line1::after {\n animation-name: l1t;\n }\n\n #line2::after {\n animation-name: l2t;\n }\n\n .line[value] {\n opacity: 0;\n visibility: hidden;\n\n transition: opacity var(--mdw-progress__opacity__duration), visibility 1ms var(--mdw-progress__opacity__duration);\n }\n\n /**\n * L1H = 1267 / +533 = 70.39% - 100%\n * L1T = 1000 / +567 = 55.56% - 87.05%\n * L2H = 0333 / +850 = 18.50% - 65.72%\n * L2T = 0000 / +750 = 0% - 41.67%\n * Total = 1800ms\n *\n * t l1h l1t l2h l2t\n * --------------------------------------\n * 0.0000 0.0000 0.0000 0.0000 0.0000\n * 0.1850 0.0000 0.0000 0.0000 0.5899\n * 0.4167 0.0000 0.0000 0.7374 1.0000\n * 0.5556 0.0000 0.0000 0.9072 1.0000\n * 0.6572 0.0000 0.1544 1.0000 1.0000\n * 0.7039 0.0000 0.2939 1.0000 1.0000\n * 0.8706 0.7918 1.0000 1.0000 1.0000\n * 1.0000 1.0000 1.0000 1.0000 1.0000\n */\n\n @keyframes l1h {\n 0% {\n transform: translateX(0%);\n }\n\n 70.4% {\n transform: translateX(0%);\n\n animation-timing-function: var(--mdw-progress__line1-head__timing);\n }\n\n 100% {\n transform: translateX(100%);\n }\n }\n @keyframes l1t {\n 0% {\n transform: translateX(-100%);\n }\n\n 55.6% {\n transform: translateX(-100%);\n\n animation-timing-function: var(--mdw-progress__line1-tail__timing);\n }\n\n 87.1% {\n transform: translateX(0%);\n }\n\n 100% {\n transform: translateX(0%);\n }\n }\n @keyframes l2h {\n 0% {\n transform: translateX(0%);\n }\n\n 18.5% {\n transform: translateX(0%);\n\n animation-timing-function: var(--mdw-progress__line2-head__timing);\n }\n\n 65.72% {\n transform: translateX(100%);\n }\n\n to {\n transform: translateX(100%);\n }\n }\n @keyframes l2t {\n 0% {\n transform: translateX(-100%);\n\n animation-timing-function: var(--mdw-progress__line2-tail__timing);\n }\n\n 41.67% {\n transform: translateX(0%);\n }\n\n to {\n transform: translateX(0%);\n }\n }\n\n `\n .css`\n /* Circle Styles */\n /** https://github.com/material-components/material-components-android/blob/ed77ab36ccac98df24e55060d58406c5981a9062/lib/java/com/google/android/material/progressindicator/CircularIndeterminateAnimatorDelegate.java */\n\n :host {\n --mdw-progress__circle__timing: cubic-bezier(0.4, 0.0, 0.2, 1);\n --mdw-progress__circle__margin: 4px;\n --mdw-progress__circle__duration: 5400ms;\n --mdw-progress__circle__duration__expand: 667ms;\n --mdw-progress__circle__duration__collapse: 667ms;\n --mdw-progress__circle__duration__fade-in: 333ms;\n --mdw-progress__circle__duration__complete-end: 333ms;\n }\n\n @media (prefers-reduced-motion) {\n :host {\n --mdw-progress__circle__duration: 54000ms;\n }\n }\n\n #circle {\n --startA: min(0.5, var(--previous));\n --endA: min(0.5, var(--value));\n --travelA: max(\n calc(var(--startA) - var(--endA)),\n calc(var(--endA) - var(--startA))\n );\n --delayA: max(0, calc(var(--previous) - 0.5));\n --startB: max(0, calc(var(--previous) - 0.5));\n --endB: max(0, calc(var(--value) - 0.5));\n --travelB: max(\n calc(var(--startB) - var(--endB)),\n calc(var(--endB) - var(--startB))\n );\n --delayB: max(0, 0.5 - calc(var(--previous)));\n\n position: absolute;\n inset: 0;\n }\n\n :host([circle]) {\n block-size: 48px;\n inline-size: 48px;\n }\n\n :host([circle]:not([color])) {\n background-color: transparent;\n }\n\n #progress[circle] {\n visibility: hidden;\n }\n\n .semi {\n position: absolute;\n inset: var(--mdw-progress__circle__margin);\n\n overflow: hidden;\n\n box-sizing: border-box;\n }\n\n #semi1 {\n inset-inline-start: 50%;\n }\n\n #semi2 {\n inset-inline-end: 50%;\n }\n\n .semi::after {\n content: \"\";\n\n position: absolute;\n inset: 0;\n\n box-sizing: border-box;\n border: solid currentcolor 4px;\n\n transform: rotate(var(--rotation));\n\n background-color: transparent;\n border-radius: 50%;\n\n transition: transform 400ms;\n transition-timing-function: linear;\n }\n\n #semi1::after {\n --rotation: min(180deg, calc(var(--value) * 360deg));\n inset-inline-start: -100%;\n\n clip-path: inset(0 50% 0 0);\n\n transition-delay: calc(var(--delayA) * var(--mdw-progress__circle__duration__expand));\n transition-duration: calc(var(--travelA) * var(--mdw-progress__circle__duration__expand));\n }\n\n #semi2::after {\n --rotation: max(0deg, calc(var(--value) * 360deg - 180deg));\n inset-inline-end: -100%;\n\n clip-path: inset(0 0 0 50%);\n\n transition-delay: calc(var(--delayB) * var(--mdw-progress__circle__duration__expand));\n transition-duration: calc(var(--travelB) * var(--mdw-progress__circle__duration__expand));\n }\n\n #indeterminate-circle {\n position: absolute;\n inset: 0;\n\n display: block;\n\n animation: rotate-cw calc(var(--mdw-progress__circle__duration) / 4) linear infinite;\n }\n\n .arc {\n position: absolute;\n inset: var(--mdw-progress__circle__margin);\n\n overflow: hidden;\n\n box-sizing: border-box;\n\n animation: rotate-jump var(--mdw-progress__circle__duration) steps(1,end) infinite;\n }\n\n .arc::after {\n content: \"\";\n\n position: absolute;\n inset: 0;\n\n box-sizing: border-box;\n border: solid currentcolor 4px;\n\n background-color: transparent;\n border-radius: 50%;\n\n animation: grow-shrink calc(var(--mdw-progress__circle__duration) / 4) var(--mdw-progress__circle__timing) infinite;\n }\n\n #arc2 {\n inset-block-end: 50%;\n inset-inline-start: 50%;\n\n transform-origin: 0 100%;\n }\n\n #arc3 {\n inset-block-start: 50%;\n inset-inline-end: 50%;\n\n transform-origin: 100% 0;\n }\n\n #arc4 {\n inset-block-start: 50%;\n inset-inline-start: 50%;\n\n transform-origin: 0 0;\n }\n\n #arc2:after {\n inset-block-end: -100%;\n inset-inline-start: -100%;\n\n clip-path: polygon(0% 0%, 50% 0%, 50% 50%, 100% 50%, 100% 100%, 0% 100%);\n }\n\n #arc3:after {\n inset-block-start: -100%;\n inset-inline-end: -100%;\n\n clip-path: inset(0 50% 50% 0);\n }\n\n #arc4:after {\n inset-block-start: -100%;\n inset-inline-start: -100%;\n\n clip-path: inset(0 50% 0 0);\n }\n\n @keyframes rotate-cw {\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n }\n\n @keyframes rotate-jump {\n 0% { transform: scaleX(1) rotate(0deg); }\n\n 12.5% { transform: scaleX(-1) rotate(-270deg); }\n\n 25% { transform: scaleX(1) rotate(270deg); }\n\n 37.5% {transform: scaleX(-1) rotate(-180deg);}\n\n 50% { transform: scaleX(1) rotate(180deg); }\n\n 62.5% { transform: scaleX(-1) rotate(-90deg); }\n\n 75% { transform: scaleX(1) rotate(90deg); }\n\n 87.5% { transform: scaleX(-1) rotate(0deg); }\n\n to { transform: scaleX(1) rotate(0deg); }\n }\n\n @keyframes grow-shrink {\n from {\n transform: rotate(calc(0.01 * 360deg));\n }\n\n 50% {\n transform: rotate(calc(0.73 * 360deg));\n }\n\n to {\n transform: rotate(calc(0.01 * 360deg));\n }\n }\n `\n .autoRegister('mdw-progress');\n", "import './RadioIcon.js';\n\nimport CustomElement from '../core/CustomElement.js';\nimport InputMixin from '../mixins/InputMixin.js';\nimport RippleMixin from '../mixins/RippleMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\nimport TouchTargetMixin from '../mixins/TouchTargetMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(RippleMixin)\n .mixin(InputMixin)\n .mixin(TouchTargetMixin)\n .extend()\n .set({\n type: 'radio',\n stateLayer: true,\n })\n .on({\n composed({ html }) {\n const { label, rippleContainer, state, control, touchTarget } = this.refs;\n label.append(html`\n ${touchTarget}\n ${control}\n <div id=radio errored={erroredState} selected={checked}>\n <mdw-radio-icon id=icon errored={erroredState} disabled={disabledState}\n selected={checked} focused={focusedState} hovered={hoveredState}></mdw-radio-icon>\n ${state}\n ${rippleContainer}\n </div>\n <slot id=slot></slot>\n `);\n\n control.setAttribute('type', 'radio');\n },\n })\n .css`\n /* https://m3.material.io/components/radio/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__primary);\n --mdw-shape__size: var(--mdw-shape__full);\n display: inline-grid;\n align-items: baseline;\n gap: 12px;\n grid-auto-flow: column;\n grid-template-rows: minmax(20px, auto);\n grid-template-columns: 20px;\n justify-content: flex-start;\n\n cursor: pointer;\n\n transition: none 100ms cubic-bezier(0.4, 0.0, 1, 1);\n }\n\n :host(:empty) {\n vertical-align: -11.5%;\n\n line-height: 20px;\n }\n\n :host(:empty) #radio {\n transform: none;\n }\n\n #control {\n grid-column: 1/1;\n\n cursor: inherit;\n }\n\n #label {\n cursor: inherit;\n }\n\n #label[disabled] {\n cursor: not-allowed;\n }\n\n #state {\n pointer-events: auto;\n }\n\n #state,\n #ripple-container {\n inset-block-start: 50%;\n inset-inline-start: 50%;\n\n block-size: 40px;\n inline-size: 40px;\n\n transform: translateX(-50%) translateY(-50%);\n\n border-radius: 50%;\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n\n opacity: 0.38;\n }\n\n #radio {\n position: relative;\n\n display: inline-flex;\n\n grid-column: 1 / 1;\n\n pointer-events: none;\n\n transform: translateY(11.5%);\n\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #radio[selected] {\n color: rgb(var(--mdw-ink));\n }\n\n #radio[disabled] {\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #radio[errored] {\n color: rgb(var(--mdw-color__error));\n }\n\n #icon {\n --mdw-ink: inherit;\n --disabled-opacity: 1;\n }\n `\n .autoRegister('mdw-radio');\n", "import './Icon.js';\n\nimport Button from './Button.js';\n\nexport default Button\n .extend()\n .observe({\n type: { empty: 'radio' },\n innerSegmentedButton: 'boolean',\n })\n .set({\n focusableOnDisabled: true,\n })\n .on({\n composed({ html, inline }) {\n const { shape, icon, outline, control, slot, state } = this.refs;\n\n slot.before(html`\n <div id=icons>\n ${icon}\n <mdw-icon selected={checked} id=check-icon aria-hidden=true>check</mdw-icon>\n </div>\n `);\n shape.setAttribute('selected', '{checked}');\n\n icon.removeAttribute('_if');\n icon.setAttribute('has-icon', '{hasIcon}');\n icon.setAttribute('selected', '{checked}');\n outline.setAttribute('inner-segmented-button', '{innerSegmentedButton}');\n outline.setAttribute('shape-start', '{shapeStart}');\n outline.setAttribute('shape-end', '{shapeEnd}');\n control.setAttribute('type', 'radio');\n control.setAttribute('role', 'option');\n control.setAttribute('aria-checked', inline(\n ({ type, checked }) => (type === 'checkbox' ? `${(!!checked)}` : null),\n ));\n control.setAttribute('aria-selected', inline(\n ({ type, checked }) => (type === 'checkbox' ? null : `${!!checked}`),\n ));\n\n state.setAttribute('state-disabled', 'focus');\n },\n constructed() {\n this.outlined = true;\n },\n })\n .css`\n /* https://m3.material.io/components/segmented-buttons/specs */\n\n :host {\n --mdw-shape__size: var(--mdw-shape__full);\n --mdw-ink: var(--mdw-color__on-surface);\n gap: 8px;\n\n min-inline-size: 24px;\n padding-inline-start: max(12px, calc(16px + (var(--mdw-density) * 2px)));\n padding-inline-end: max(20px, calc(24px + (var(--mdw-density) * 2px)));\n\n color: rgb(var(--mdw-ink));\n }\n\n :host([inner-segmented-button]) {\n --mdw-shape__size: 0px;\n }\n\n #outline {\n inset-inline-end: -1px;\n }\n\n #outline[shape-end] {\n inset-inline-end: 0;\n }\n\n #shape[selected] {\n background-color: rgb(var(--mdw-bg));\n }\n\n #label[selected] {\n color: rgb(var(--mdw-ink));\n }\n\n #icons {\n position: relative;\n\n display: inline-flex;\n }\n\n #icon {\n box-sizing: border-box;\n inline-size: 0;\n\n opacity: 1;\n }\n\n #icon[has-icon] {\n inline-size: 18px;\n\n opacity: 1;\n }\n\n #icon[selected] {\n inline-size: 18px;\n\n opacity: 0;\n }\n\n #check-icon {\n position: absolute;\n inset: 0;\n\n display: block;\n\n overflow: visible;\n\n margin: 0;\n\n opacity: 0;\n\n font-size: 18px;\n font-variation-settings: 'FILL' 1;\n }\n\n #check-icon[selected] {\n opacity: 1;\n\n font-size: 18px;\n }\n\n #icon[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #shape[disabled][selected] {\n background-color: rgba(var(--mdw-color__on-surface), 0.12);\n }\n\n #label[disabled][selected] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n `\n .autoRegister('mdw-segmented-button');\n", "import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\nimport KeyboardNav from '../mixins/KeyboardNavMixin.js';\n\nimport Box from './Box.js';\nimport SegmentedButton from './SegmentedButton.js';\n\n/** @typedef {'compact'} DeprecatedHTMLMenuElementProperties */\n\nexport default Box\n .mixin(KeyboardNav)\n .mixin(AriaReflectorMixin)\n .extend()\n .define({\n kbdNavQuery() {\n return SegmentedButton.elementName;\n },\n })\n .set({\n _ariaRole: 'listbox',\n })\n .childEvents({\n slot: {\n slotchange() {\n this.refreshTabIndexes();\n // eslint-disable-next-line github/array-foreach\n this.kbdNavChildren.forEach((child, index, list) => {\n /** @type {InstanceType<SegmentedButton>} */\n (child).shapeStart = index === 0;\n /** @type {InstanceType<SegmentedButton>} */\n (child).innerSegmentedButton = index > 0 && index < list.length - 1;\n /** @type {InstanceType<SegmentedButton>} */\n (child).shapeEnd = index === list.length - 1;\n });\n },\n },\n })\n .css`\n /* https://m3.material.io/components/segmented-buttons/specs */\n\n :host {\n --mdw-bg: var(--mdw-color__secondary-container);\n --mdw-ink: var(--mdw-color__on-secondary-container);\n\n display: inline-flex;\n }\n\n :host([color]) {\n background-color: transparent;\n }\n\n `\n .on({\n constructed() {\n this.setAttribute('aria-orientation', 'horizontal');\n },\n })\n .autoRegister('mdw-segmented-button-group');\n", "import CustomElement from '../core/CustomElement.js';\nimport ControlMixin from '../mixins/ControlMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport TextFieldMixin from '../mixins/TextFieldMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n\n/* @implements {HTMLSelectElement} */\n\nexport default class Select extends CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(ControlMixin)\n .mixin(TextFieldMixin)\n .extend()\n .observe({\n autocomplete: 'string',\n trailingIcon: {\n empty: 'arrow_drop_down',\n },\n })\n .define({\n _select() {\n return /** @type {HTMLSelectElement} */ (this.refs.control);\n },\n /** Readonly values */\n multiple: { value: false },\n size: { value: 1 },\n type: { value: 'select-one' },\n })\n .html/* html */`<slot id=slot></slot>`\n .childEvents({\n slot: {\n /** @param {Event & {currentTarget:HTMLSlotElement}} event */\n slotchange(event) {\n const select = this._select;\n select.replaceChildren(\n ...event.currentTarget.assignedNodes()\n .map((child) => child.cloneNode(true)),\n );\n this._value = select.value;\n },\n },\n })\n .on({\n composed({ template }) {\n const { slot, prefix, suffix, control } = this.refs;\n control.setAttribute('icon', '{icon}');\n template.append(slot);\n prefix.remove();\n suffix.remove();\n },\n })\n .css`\n #slot {\n display: none;\n }\n \n #label {\n padding: 0;\n \n cursor: pointer;\n }\n \n #label[disabled] {\n cursor: not-allowed;\n }\n \n #icon {\n position: absolute;\n \n /* padding-inline-start: 12px; */\n }\n \n #trailing-icon {\n position: absolute;\n inset-inline-end: 16px;\n }\n \n #control {\n padding-inline-start: 16px;\n padding-inline-end: calc(16px + 24px + 16px);\n accent-color: rgb(var(--mdw-ink));\n \n cursor: inherit;\n }\n \n #control[icon] {\n margin-inline-start: calc(16px + 24px);\n padding-inline-start: 0;\n }\n \n option {\n accent-color: rgb(var(--mdw-ink));\n \n min-block-size: var(--mdw-typescale__label-large__line-height);\n \n appearance: none;\n \n background-color: rgb(var(--mdw-color__surface)) !important;\n border-radius: 0;\n color: rgb(var(--mdw-color__on-surface)) !important;\n \n font: var(--mdw-typescale__label-large__font);\n letter-spacing: var(--mdw-typescale__label-large__letter-spacing);\n }\n `\n .setStatic({\n controlTagName: 'select',\n controlVoidElement: false,\n })\n .autoRegister('mdw-select') {\n /* Overrides */\n static clonedContentAttributes = [\n ...super.clonedContentAttributes,\n 'autocomplete', // Hint for form autofill feature\n ];\n\n formResetCallback() {\n this._select.value = this.querySelector('option[selected]')?.value ?? '';\n super.formResetCallback();\n }\n}\n", "import CustomElement from '../core/CustomElement.js';\nimport InputMixin from '../mixins/InputMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n/**\n * @param {string} value\n * @param {number} onNaN\n * @return {number}\n */\nfunction parseFloat(value, onNaN = 0) {\n const number = Number.parseFloat(value);\n if (Number.isNaN(number)) return onNaN;\n return number;\n}\n\n/**\n * @param {string} value\n * @param {string} min\n * @param {string} max\n * @return {?number}\n */\nfunction valueAsFraction(value, min, max) {\n const nValue = parseFloat(value);\n const nMin = parseFloat(min);\n const nMax = parseFloat(max, 100);\n\n return (nValue - nMin) / (nMax - nMin);\n}\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(InputMixin)\n .extend()\n .set({\n stateLayer: true,\n type: 'range',\n })\n .observe({\n ticks: 'string',\n showLabel: { type: 'boolean', reflect: false },\n _previewValue: { nullable: false },\n _roundedValue: 'float',\n _isHoveringThumb: 'boolean',\n })\n .methods({\n /**\n * @param {(MouseEvent|TouchEvent) & {currentTarget:HTMLInputElement}} event\n * @return {void}\n */\n onControlMouseOrTouch(event) {\n const input = event.currentTarget;\n if (input.disabled) return;\n\n if (this.disabledState) return;\n\n if (event.type === 'touchend') {\n this._isHoveringThumb = false;\n return;\n }\n\n let offsetX;\n let clientX;\n let pageX;\n let isActive;\n\n const isTouch = 'touches' in event;\n if (isTouch) {\n if (event.touches.length) {\n const [touch] = event.touches;\n isActive = true;\n // @ts-ignore Might exist\n ({ offsetX, clientX, pageX } = touch);\n }\n } else {\n // Ignore mouse drag-over\n // Firefox doesn't report `:active`\n // eslint-disable-next-line no-bitwise\n isActive = (event.buttons & 1) === 1\n && (event.type === 'mousedown' || input.matches(':active'));\n ({ offsetX, clientX, pageX } = event);\n }\n\n if (offsetX == null) {\n clientX ??= pageX - window.scrollX; // Safari\n offsetX = clientX - input.getBoundingClientRect().left;\n }\n\n const { clientWidth } = input;\n let position = (offsetX / clientWidth);\n if (position > 1) {\n position = 1;\n } else if (position < 0) {\n position = 0;\n }\n\n if (isActive) {\n this._isHoveringThumb = true;\n const { min, max, step } = this;\n\n const nMin = parseFloat(min);\n const nMax = parseFloat(max, 100);\n const nStep = parseFloat(step, 1);\n\n const currentValue = position * (nMax - nMin) + nMin;\n let roundedValue = Math.round(currentValue / nStep) * nStep;\n\n if (nStep < 1) {\n // Floating Point Numbers need to be rounded off based on step\n // eg: 3.4 / 10 with step of 0.1 yields 0.33999999999999997\n const log10 = Math.floor(Math.log10(nStep)); // e value in scientific notation\n const scale = 10 ** (-1 * log10); // multiplier to scale up to integer\n roundedValue = Math.round(roundedValue * scale) / scale;\n }\n\n this._roundedValue = roundedValue;\n this._previewValue = roundedValue.toString(10);\n return;\n }\n\n if (isTouch) return;\n\n const fractionalValue = valueAsFraction(this.value, this.min, this.max);\n const thumbOffset = fractionalValue * clientWidth;\n const thumbMin = thumbOffset - 20;\n const thumbMax = thumbOffset + 20;\n this._isHoveringThumb = offsetX >= thumbMin && offsetX <= thumbMax;\n },\n\n /** @param {Event} event */\n onLeaveEvent({ currentTarget }) {\n if (document.activeElement === currentTarget) return;\n this._isHoveringThumb = false;\n },\n\n /**\n * @param {(MouseEvent|TouchEvent) & {currentTarget:HTMLInputElement}} event\n * @return {void}\n */\n onControlFinish(event) {\n const input = event.currentTarget;\n if (input.disabled) return;\n event.preventDefault();\n input.valueAsNumber = this._roundedValue;\n if (this._value !== input.value) {\n this._value = input.value;\n input.dispatchEvent(new Event('change', { bubbles: true }));\n }\n },\n })\n .events({\n blur: 'onLeaveEvent',\n mouseout: 'onLeaveEvent',\n })\n .childEvents({\n control: {\n '~mousedown': 'onControlMouseOrTouch',\n '~mousemove': 'onControlMouseOrTouch',\n '~mouseout': 'onControlMouseOrTouch',\n '~touchmove': 'onControlMouseOrTouch',\n '~touchstart': 'onControlMouseOrTouch',\n // @ts-expect-error Old spec\n '~touchleave': 'onControlMouseOrTouch',\n '~touchcancel': 'onControlMouseOrTouch',\n '~touchend': 'onControlMouseOrTouch',\n touchend: 'onControlFinish',\n click: 'onControlFinish',\n },\n })\n .expressions({\n computeTrackStyle({ ticks, _previewValue, min, max }) {\n return [\n ticks ? `--ticks:${ticks}` : null,\n `--value:${valueAsFraction(_previewValue, min, max)}`,\n ].filter(Boolean).join(';') || null;\n },\n })\n .on({\n composed({ template, html }) {\n const { state, label, control } = this.refs;\n template.append(html`\n <div id=track style={computeTrackStyle} aria-hidden=true disabled={disabledState}>\n <div _if={ticks} id=ticks></div>\n <div id=track-active></div>\n <div id=thumb-anchor>\n <div id=thumb>\n ${state}\n </div>\n <div id=thumb-label\n hidden=${({ _isHoveringThumb, focusedState }) => (!_isHoveringThumb && !focusedState)} \n text={_previewValue}></div>\n </div>\n </div>\n `);\n label.removeAttribute('aria-labelledby');\n control.setAttribute('type', 'range');\n },\n valueChanged(oldValue, newValue) {\n this._previewValue = newValue;\n },\n })\n .css`\n /* https://m3.material.io/components/sliders/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-bg: var(--mdw-color__primary);\n\n display: inline-block;\n vertical-align: middle;\n\n min-block-size: 40px;\n min-inline-size: 88px;\n\n background-color: transparent;\n }\n\n :host,\n :host([color]) {\n background-color: transparent;\n }\n\n #label {\n position: absolute;\n inset: 0;\n\n display: block;\n\n cursor: pointer;\n\n z-index: 1;\n\n /* border-radius: 50%; */\n color: rgb(var(--mdw-bg));\n }\n\n #control {\n inset:0;\n\n overflow: visible;\n\n block-size: 100%;\n min-block-size: 0;\n inline-size: 100%;\n min-inline-size: 0;\n\n appearance: none;\n\n cursor: inherit;\n\n transform: none;\n\n background-color: transparent;\n color: inherit;\n }\n\n #control::-webkit-slider-runnable-track {\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin-inline: -10px;\n\n appearance: none;\n\n background-color: transparent;\n }\n\n @supports (-moz-appearance:none ){\n #control {\n inset-inline: -10px;\n\n inline-size: calc(100% + 20px);\n }\n }\n\n #control::-moz-range-track {\n inline-size: calc(100% + 20px) !important;\n\n appearance: none;\n }\n\n #control::-webkit-slider-thumb {\n display: block;\n\n block-size: 20px;\n inline-size: 20px;\n\n -webkit-appearance: none;\n cursor: inherit;\n\n transform: scale(2);\n\n background-color: transparent; /* Safari */\n\n border-radius: 50%;\n box-shadow: none; /* Safari */\n }\n\n #control::-moz-range-thumb {\n display: block;\n\n box-sizing: content-box;\n block-size: 20px;\n inline-size: 20px;\n border: none;\n\n appearance: none;\n cursor: inherit;\n\n transform: scale(2);\n\n background-color: transparent;\n border-radius: 50%;\n }\n\n #track {\n --value: 0.5;\n position: absolute;\n inset-block-start: 50%;\n inset-inline: 0;\n\n block-size: 4px;\n margin-block-start: -2px;\n\n pointer-events: none;\n user-select: none;\n\n background-color: rgb(var(--mdw-color__surface-variant));\n border-radius: inherit;\n }\n\n #thumb {\n position: absolute;\n inset-block-start: -18px;\n inset-inline-start: -20px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n\n block-size: 40px;\n inline-size: 40px;\n\n pointer-events: none;\n\n border-radius: 50%;\n\n color: rgb(var(--mdw-bg));\n }\n\n #thumb::before {\n content: '';\n\n display: block;\n\n block-size: 20px;\n inline-size: 20px;\n\n background-color: currentColor;\n border-radius: 50%;\n\n transition: background-color 100ms;\n }\n\n /* Inactive ticks */\n\n #ticks::before,\n #ticks::after {\n content: '';\n\n position: absolute;\n inset: 0;\n\n padding-inline: 10px;\n\n background-clip: content-box;\n /* stylelint-disable-next-line plugin/no-unsupported-browser-features */\n background-image: radial-gradient(circle at center, var(--tick-color) 0, var(--tick-color) 1px, transparent 0);\n background-position: center center;\n background-repeat: repeat-x;\n background-size: 0 100%;\n background-size: calc(100% / var(--ticks, 0)) 2px;\n }\n\n #ticks::before {\n --tick-color: rgb(var(--mdw-color__on-surface-variant));\n }\n\n #ticks::after {\n --tick-color: rgb(var(--mdw-ink));\n /* TODO: Use single-paint implementation */\n padding-inline-end: calc(100% - (100% * var(--value)) + 10px);\n\n z-index: 1;\n\n will-change: padding-inline-end;\n }\n /* Active Indicator */\n #track-active {\n position: absolute;\n inset: 0;\n\n overflow: hidden;\n\n border-radius: 99px;\n }\n\n #track-active::before {\n content: '';\n\n position: absolute;\n inset: 0;\n\n transform: scaleX(var(--value));\n transform-origin: 0 0;\n\n background-color: rgb(var(--mdw-bg));\n\n will-change: transform;\n }\n\n #thumb-anchor {\n position: absolute;\n inset-inline: 0;\n\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n\n inline-size: 1%;\n\n transform: translateX(calc(var(--value) * 100 * 100%));\n transform-origin: 0 0;\n z-index: 24;\n\n will-change: transform;\n }\n\n #thumb-label {\n position: absolute;\n inset-block-end: 14px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n box-sizing: content-box;\n margin-block-end: 6px;\n\n transform: translateX(-50%) scale(1);\n transform-origin: 50% 100%;\n\n font-weight: var(--mdw-typescale__label-medium__font-weight);\n line-height: var(--mdw-typescale__label-medium__line-height);\n font-family: var(--mdw-typescale__label-medium__font-family);\n letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);\n\n transition: transform 200ms;\n will-change: transform;\n }\n\n #thumb-label:is([hidden],[text=\"\"]) {\n transform: translateX(-50%) scale(0);\n }\n\n #thumb-label::before {\n content: attr(text);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n min-block-size: 28px;\n min-inline-size: 28px;\n\n z-index: 1;\n\n background-color: rgb(var(--mdw-bg));\n border-radius: 50%;\n color: rgb(var(--mdw-ink));\n }\n\n #thumb-label::after {\n /* Values from Figma SVG */\n --x-start: 14.6446%; /*4.1005px*/\n --x-end: 85.3554%;\n --y: 70.7106%; /*24.0416px*/\n\n content: \"\";\n\n position: absolute;\n inset: 0;\n inset-block-end: -6px;\n\n clip-path: polygon(var(--x-start) var(--y), var(--x-end) var(--y), 50% 100%, var(--x-start) var(--y));\n\n background-color: rgb(var(--mdw-bg));\n }\n\n #track[disabled] {\n background-color: rgb(var(--mdw-color__on-surface), calc(0.12 / 0.38));\n }\n\n #label[disabled],\n #track[disabled] {\n --mdw-bg: var(--mdw-color__on-surface);\n cursor: not-allowed;\n\n opacity: 0.38;\n }\n `\n .autoRegister('mdw-slider');\n", "// https://w3c.github.io/aria/#status\n\nimport { EVENT_HANDLER_TYPE } from '../core/customTypes.js';\nimport AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\nimport DensityMixin from '../mixins/DensityMixin.js';\n\nimport './Button.js';\nimport './IconButton.js';\n\nimport Surface from './Surface.js';\n\nexport default Surface\n .mixin(DensityMixin)\n .mixin(AriaReflectorMixin)\n .extend()\n .set({\n _ariaRole: 'status',\n elevated: true,\n })\n .observe({\n open: 'boolean',\n persistent: 'boolean',\n action: 'string',\n actionInk: { empty: 'inverse-primary' },\n actionTypeStyle: { empty: 'label-large' },\n closeButton: 'boolean',\n closeIcon: { empty: 'close' },\n closeInk: { empty: 'inherit' },\n onaction: EVENT_HANDLER_TYPE,\n })\n .methods({\n async close() {\n if (!this.dispatchEvent(new Event('close', { cancelable: true }))) return;\n if (!this.open) return;\n this.open = false;\n if (window.getComputedStyle(this).transitionDuration === '0s') return;\n await new Promise((resolve) => {\n this.addEventListener('transitionend', resolve, { once: true });\n });\n },\n show() {\n this.open = true;\n },\n /** @param {string} text */\n update(text) {\n this.textContent = text;\n },\n })\n .html/* html */`\n <div id=content></div>\n <mdw-button _if={action} id=action class=button ink={actionInk} type-style={actionTypeStyle}>{action}</mdw-button>\n <mdw-icon-button _if={closeButton} id=close class=button icon={closeIcon} ink={closeInk}>Close</mdw-button>\n `\n .on({\n composed() {\n const { content, slot } = this.refs;\n content.append(slot);\n },\n })\n .childEvents({\n action: {\n '~click'() {\n if (!this.dispatchEvent(new Event('action', { cancelable: true }))) return;\n this.close();\n },\n },\n close: {\n '~click'() {\n this.close();\n },\n },\n })\n .css`\n /* https://m3.material.io/components/snackbar/specs */\n\n :host {\n --mdw-shape__size: var(--mdw-shape__small);\n --mdw-surface__shadow: var(--mdw-surface__shadow__3);\n --mdw-surface__tint: var(--mdw-surface__tint__3);\n --mdw-shape__bg: rgb(var(--mdw-color__inverse-surface));\n --mdw-ink: var(--mdw-color__inverse-on-surface);\n\n --mdw-type__line-height: var(--mdw-typescale__body-medium__line-height);\n display: flex;\n align-items: center;\n\n padding-inline: 16px;\n\n opacity: 0;\n transform: translateY(25%) scaleY(0.25);\n transform-origin: bottom center;\n visibility: hidden; /* Remove from tab order */\n z-index: 24;\n\n font: var(--mdw-typescale__body-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n\n transition: transform 200ms, opacity 200ms, visibility 200ms;\n }\n\n :host([action]) {\n gap: 8px;\n\n padding-inline-end: 8px;\n }\n\n :host([close-button]) {\n gap: 4px;\n\n padding-inline-end: 4px;\n }\n\n :host([open]) {\n opacity: 1;\n transform: scale(1);\n visibility: visible;\n }\n\n #content {\n display: flex;\n align-items: center;\n\n flex: 1;\n padding-block: max(2px, calc(14px + (var(--mdw-density) * 2px)));\n }\n\n #slot {\n display: block;\n overflow-x: hidden;\n overflow-y: hidden;\n\n max-block-size: calc(var(--mdw-type__line-height) * 2);\n\n text-align: start;\n text-overflow: ellipsis;\n text-transform: none;\n white-space: normal;\n word-break: break-word;\n }\n\n @supports(width: 1lh) {\n #slot {\n max-block-size: 2lh;\n }\n }\n\n @supports(-webkit-line-clamp:1) {\n #slot {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n }\n }\n `\n .autoRegister('mdw-snackbar');\n", "import ShapeMixin from '../mixins/ShapeMixin.js';\n\nimport Box from './Box.js';\n\nexport default Box\n .mixin(ShapeMixin)\n .extend()\n .on({\n composed() {\n const { shape, outline } = this.refs;\n shape.before(outline);\n shape.remove();\n },\n })\n .css`\n :host {\n position: relative;\n\n overflow: hidden;\n\n z-index: auto;\n\n background-color: var(--mdw-shape__bg, transparent);\n\n border-start-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-start-size));\n border-start-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-end-size));\n border-end-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-start-size));\n border-end-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-end-size));\n\n transition-delay: 1ms;\n transition-duration: 200ms;\n transition-property: background-color, color;\n will-change: background-color, color;\n\n }\n\n :host([color]) {\n background-color: rgb(var(--mdw-bg));\n }\n\n :host(:where([ink],[color])) {\n color: rgb(var(--mdw-ink));\n }\n\n :host([outlined]) {\n background-color: transparent;\n }\n\n :host(:is([color=\"none\"], [color=\"transparent\"])) {\n background-color: transparent;\n }\n\n @supports(-webkit-mask-box-image: none) {\n :host {\n -webkit-mask-box-image: var(--mdw-shape__mask-border-source)\n 8 fill /\n var(--mdw-shape__size)\n stretch;\n\n -webkit-mask: var(--mdw-shape__mask);\n\n transition-duration: 200ms, 200ms, 200ms;\n transition-property: background-color, color, -webkit-mask-box-image-width;\n will-change: background-color, color, -webkit-mask-box-image;\n }\n }\n `\n .autoRegister('mdw-shape');\n", "import './Icon.js';\nimport './Shape.js';\nimport CustomElement from '../core/CustomElement.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(ShapeMixin)\n .extend()\n .observe({\n selected: 'boolean',\n icon: 'string',\n errored: 'boolean',\n disabled: 'boolean',\n selectedIcon: 'string',\n unselectedIcon: 'string',\n src: 'string',\n selectedSrc: 'string',\n unselectedSrc: 'string',\n hovered: 'boolean',\n pressed: 'boolean',\n focused: 'boolean',\n dragValue: 'float',\n color: { empty: 'primary' },\n })\n .observe({\n /** Alias for Selected (QoL) */\n checked: {\n type: 'boolean',\n get({ selected }) { return selected; },\n /** @param {boolean} value */\n set(value) { this.selected = value; },\n },\n _active({ disabled, pressed, focused, hovered }) {\n return !disabled && (pressed || focused || hovered);\n },\n })\n .observe({\n _thumbColor({ color, _active }) {\n return _active ? `${color}-container` : '';\n },\n _iconInk({ disabled, selected, color }) {\n if (!selected) return 'surface-variant';\n if (disabled) return 'on-surface';\n return `on-${color}-container`;\n },\n })\n .expressions({\n hasIcon({ icon, src, unselectedIcon, unselectedSrc }) {\n return Boolean(icon || src || unselectedIcon || unselectedSrc);\n },\n })\n .html/* html */`\n <div id=thumb selected={checked} pressed={pressed} disabled={disabled}>\n <mdw-shape id=thumb-shape shape-style=full selected={checked} pressed={pressed} hovered={hovered} focused={focused} icon={hasIcon}\n color={_thumbColor} active={_active} ink={_thumbInk} disabled={disabled}></mdw-shape>\n <mdw-icon ink={_iconInk} class=icon id=icon src={src} selected={checked}>{icon}</mdw-icon>\n <mdw-icon ink={_iconInk} class=icon id=selected-icon src={selectedIconSrc} selected={checked}>{selectedIcon}</mdw-icon>\n <mdw-icon ink={_iconInk} class=icon id=unselected-icon src={unselectedIconSrc} selected={checked}>{unselectedIcon}</mdw-icon>\n <slot id=slot selected={checked}></slot>\n </div>\n `\n .on({\n composed() {\n const { outline, shape: track } = this.refs;\n track.id = 'track';\n track.setAttribute('selected', '{checked}');\n track.setAttribute('disabled', '{disabled}');\n outline.removeAttribute('_if');\n outline.setAttribute('selected', '{checked}');\n outline.setAttribute('errored', '{errored}');\n outline.setAttribute('disabled', '{disabled}');\n },\n dragValueChanged(oldValue, newValue) {\n if (newValue == null) {\n this.refs.thumb.style.removeProperty('--mdw-switch__value');\n this.refs.thumb.style.removeProperty('transition-duration');\n } else {\n this.refs.thumb.style.setProperty('--mdw-switch__value', `${newValue}`);\n this.refs.thumb.style.setProperty('transition-duration', '0s');\n }\n },\n })\n .css`\n /* https://m3.material.io/components/switch/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-bg: var(--mdw-color__primary);\n --mdw-shape__size: var(--mdw-shape__full);\n --mdw-switch__value: 0;\n\n position: relative;\n\n display: inline-block;\n vertical-align: middle;\n\n box-sizing: border-box;\n block-size: 32px;\n inline-size: 52px;\n container-type: inline-size;\n container-name: switch-icon;\n }\n\n :host([selected]) {\n --mdw-switch__value: 1;\n }\n\n :host([disabled]) {\n opacity: 0.38;\n }\n\n #track{\n position: absolute;\n inset: 0;\n\n background-color: rgb(var(--mdw-color__surface-variant));\n }\n\n #track[selected] {\n background-color: rgb(var(--mdw-bg));\n }\n\n #track[disabled] {\n opacity: calc(0.12/0.38);\n }\n\n #track[disabled][selected] {\n background-color: rgb(var(--mdw-color__on-surface));\n }\n\n #outline {\n filter:\n drop-shadow(1px 0px 0px currentColor)\n drop-shadow(0px 1px 0px currentColor)\n drop-shadow(-1px 0px 0px currentColor)\n drop-shadow(0px -1px 0px currentColor);\n\n color: rgb(var(--mdw-color__outline));\n }\n\n #outline:is([pressed],[focused]) {\n color: rgb(var(--mdw-color__outline));\n }\n\n #outline[disabled] {\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #outline[selected] {\n color: transparent;\n }\n\n /** Thumb (state) **/\n\n #thumb {\n --thumb-color: var(--mdw-ink);\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n transform: translateX(calc(var(--mdw-dir, 1) * var(--mdw-switch__value) * (52px - 100%)));\n\n aspect-ratio: 1/1;\n }\n\n :dir(rtl) #thumb {\n --mdw-dir: -1;\n }\n\n @supports(width: 1cqw) {\n #thumb {\n transform: translateX(calc(var(--mdw-dir, 1) * var(--mdw-switch__value) * (100cqw - 100%)));\n }\n }\n\n #slot {\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #slot[selected] {\n color: rgb(var(--mdw-bg));\n }\n\n /** Thumb Shape **/\n\n #thumb-shape {\n --mdw-shape__size: inherit;\n\n position: absolute;\n\n inset: 2px;\n\n transform: scale(calc(16/28));\n z-index: 0;\n }\n\n #thumb-shape[icon] {\n transform: scale(calc(24/28));\n }\n\n #thumb-shape:not([selected]) {\n --mdw-bg: var(--mdw-color__outline);\n --mdw-ink: var(--mdw-color__surface-variant);\n }\n\n #thumb-shape[selected] {\n transform: scale(calc(24/28));\n }\n\n #thumb-shape[selected]:not([active]) {\n --mdw-bg: var(--thumb-color);\n }\n\n #thumb-shape[pressed]:not([disabled]) {\n transform: scale(1);\n }\n\n /** Thumb Icons **/\n\n .icon {\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 50%;\n\n opacity: 0;\n transform: translateX(-50%) translateY(-50%);\n\n font-size: 16px;\n\n /* border-radius: 50%; */\n }\n\n .icon:not([src]):empty {\n display: none;\n }\n\n #icon, #unselected-icon {\n opacity: 1;\n\n font-variation-settings: 'FILL' 0;\n }\n\n #unselected-icon[selected] {\n opacity: 0;\n }\n\n #selected-icon[selected] {\n opacity: 1;\n }\n\n #icon[selected] {\n font-variation-settings: 'FILL' 1;\n }\n\n #thumb[disabled] {\n color: rgb(var(--mdw-color__on-surface));\n }\n `\n .css`\n /* https://m3.material.io/components/switch/specs */\n\n :host {\n /*FastOutLinearInInterpolator*/\n --mdw-switch__transition-timing__collapse: cubic-bezier(0.4, 0.0, 1, 1);\n --mdw-switch__transition-duration__collapse: 375ms;\n /*LinearOutSlowInInterpolator*/\n --mdw-switch__transition-timing__expand: cubic-bezier(0.0, 0.0, 0.2, 1);\n --mdw-switch__transition-duration__expand: 500ms;\n --scale-delay: var(--mdw-switch__transition-duration);\n\n --mdw-switch__transition-duration: var(--mdw-switch__transition-duration__collapse);\n --mdw-switch__transition-timing: var(--mdw-switch__transition-timing__collapse);\n --mdw-switch__transition-delay__color: calc(var(--mdw-switch__transition-duration) / 2);\n --mdw-switch__transition-delay__translate: calc(var(--mdw-switch__transition-duration) / 2);\n --mdw-switch__transition-delay__scale: calc(var(--mdw-switch__transition-duration) / 2);\n\n transition-delay: var(--mdw-switch__transition-delay__color);\n transition-duration: calc(var(--mdw-switch__transition-duration) / 2);\n /* 2 legged animation */\n transition-timing-function: var(--mdw-switch__transition-timing);\n }\n\n #track {\n transition-delay: var(--mdw-switch__transition-delay__color);\n transition-duration: inherit;\n transition-property: background-color;\n transition-timing-function: inherit;\n }\n\n #outline {\n transition-delay: var(--mdw-switch__transition-delay__color);\n transition-duration: inherit;\n transition-property: background-color, color;\n transition-timing-function: inherit;\n }\n\n #thumb {\n transition-delay: var(--mdw-switch__transition-delay__translate);\n transition-duration: inherit;\n transition-property: transform;\n transition-timing-function: inherit;\n }\n\n #thumb-shape, .icon {\n /* (selected => unselected): stall color+scale */\n transition-delay: var(--mdw-switch__transition-delay__scale), var(--mdw-switch__transition-delay__color), var(--mdw-switch__transition-delay__color);\n transition-duration: inherit;\n transition-property: transform, background-color, color;\n transition-timing-function: inherit;\n }\n\n :host([icon]) {\n --mdw-switch__transition-delay__translate: 0s;\n }\n\n .icon {\n transition-property: transform, opacity, color;\n }\n\n /* unselected => selected */\n :host([selected]) {\n --mdw-switch__transition-delay__color: 0s;\n --mdw-switch__transition-delay__scale: 0s;\n /* --mdw-switch__transition-delay__translate: 0s; */\n --mdw-switch__transition-duration: var(--mdw-switch__transition-duration__expand);\n --mdw-switch__transition-timing: var(--mdw-switch__transition-timing__expand);\n }\n\n /* active => selected */\n :host([selected][pressed]) {\n /* --mdw-switch__transition-delay__color: 0s; */\n /* --mdw-switch__transition-delay__scale: 0s; */\n --mdw-switch__transition-delay__translate: 0s;\n }\n\n /* selected => unselected */\n :host(:not([selected])) {\n /* --mdw-switch__transition-delay__color: 0s; */\n /* --mdw-switch__transition-delay__scale: 0s; */\n --mdw-switch__transition-delay__translate: 0s;\n }\n\n /* unselected => active */\n :host([pressed]:not([selected])) {\n /* --mdw-switch__transition-delay__color: 0s; */\n --mdw-switch__transition-delay__scale: 0s;\n /* --mdw-switch__transition-delay__translate: 0s; */\n }\n `\n .autoRegister('mdw-switch-icon');\n", "import './SwitchIcon.js';\nimport CustomElement from '../core/CustomElement.js';\nimport InputMixin from '../mixins/InputMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\nimport TouchTargetMixin from '../mixins/TouchTargetMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(InputMixin) // Label as root\n .mixin(StateMixin)\n .mixin(TouchTargetMixin)\n // Switches have their own pressed animation (No ripple)\n .extend()\n .set({\n type: 'checkbox',\n stateLayer: true,\n })\n .observe({\n icon: 'string',\n selectedIcon: 'string',\n unselectedIcon: 'string',\n src: 'string',\n selectedSrc: 'string',\n unselectedSrc: 'string',\n })\n .on({\n composed({ html }) {\n const { state, label, control, touchTarget } = this.refs;\n label.append(html`\n ${touchTarget}\n <mdw-switch-icon id=switch\n color={color} ink={ink} selected={checked} hovered={hoveredState} focused={focusedState} pressed={pressedState} disabled={disabledState}\n icon={icon}\n selected-icon={selectedIcon}\n unselected-icon={unselectedIcon}\n src={src}\n selected-src={selectedSrc}\n unselected-src={unselectedSrc}\n >\n ${state}\n ${control}\n </mdw-switch-icon>\n <slot id=slot></slot>\n `);\n control.setAttribute('type', 'checkbox');\n control.setAttribute('role', 'switch');\n },\n })\n .methods({\n /**\n * @param {(MouseEvent|TouchEvent) & {currentTarget:HTMLInputElement}} event\n * @return {void}\n */\n onControlMouseOrTouch(event) {\n const input = event.currentTarget;\n if (input.disabled) return;\n\n if (this.disabledState) return;\n\n if (event.type === 'touchend') {\n // this._isHoveringThumb = false;\n return;\n }\n\n let offsetX;\n let clientX;\n let pageX;\n let isActive;\n\n const isTouch = 'touches' in event;\n if (isTouch) {\n if (event.touches.length) {\n const [touch] = event.touches;\n isActive = true;\n // @ts-ignore Might exist\n ({ offsetX, clientX, pageX } = touch);\n }\n } else {\n // Ignore mouse drag-over\n // Firefox doesn't report `:active`\n // eslint-disable-next-line no-bitwise\n isActive = (event.buttons & 1) === 1\n && (event.type === 'mousedown' || input.matches(':active'));\n ({ offsetX, clientX, pageX } = event);\n }\n\n if (!isActive) return;\n\n if (offsetX == null) {\n clientX ??= pageX - window.scrollX; // Safari\n offsetX = clientX - input.getBoundingClientRect().left;\n }\n\n const { clientWidth } = input;\n let position = (offsetX / clientWidth);\n if (position > 1) {\n position = 1;\n } else if (position < 0) {\n position = 0;\n }\n\n // this._isHoveringThumb = true;\n\n let currentValue = this.refs.switch.dragValue;\n if (currentValue == null) {\n currentValue = this.checked ? 1 : 0;\n }\n const pixels = offsetX - (clientWidth / 2);\n const currentPixels = this.refs.switch.clientWidth - (this.refs.switch.clientHeight);\n // console.log(pixels, currentPixels, currentPixels * currentValue, pixels / currentPixels);\n const newRatio = pixels / currentPixels;\n const newValue = Math.max(Math.min(currentValue + newRatio, 1), 0);\n // this.refs.switch.dragValue = newValue;\n // event.preventDefault();\n },\n })\n .childEvents({\n control: {\n '~pointermove': 'onControlMouseOrTouch',\n },\n })\n .css`\n /* https://m3.material.io/components/switch/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-bg: var(--mdw-color__primary);\n position: relative;\n\n display: inline-flex;\n align-items: center;\n\n gap: 12px;\n vertical-align: middle;\n\n }\n\n #touch-target {\n z-index: 0;\n }\n\n #label {\n display: contents;\n\n cursor: pointer;\n\n /* border-radius: 50%; */\n }\n\n /** Switch **/\n\n #switch {\n --mdw-bg: inherit;\n --mdw-ink: inherit;\n flex:1;\n\n pointer-events: none;\n }\n\n /** State **/\n\n #state {\n position: absolute;\n inset: 50%;\n\n block-size: 100%;\n min-block-size: 40px;\n inline-size: 100%;\n min-inline-size: 40px;\n\n pointer-events: none;\n\n transform: translateX(-50%) translateY(-50%);\n\n border-radius: 50%;\n }\n\n /** Disabled **/\n\n #label[disabled] {\n --mdw-ink: var(--mdw-color__on-surface); /* selected icon */\n --mdw-bg: var(--mdw-color__surface);\n cursor: not-allowed;\n\n opacity: 0.38;\n }\n\n `\n .autoRegister('mdw-switch');\n", "// https://w3c.github.io/aria/#tab\n\nimport './Icon.js';\n\nimport CustomElement from '../core/CustomElement.js';\nimport RippleMixin from '../mixins/RippleMixin.js';\nimport ScrollListenerMixin from '../mixins/ScrollListenerMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\n\nexport default CustomElement\n .mixin(ShapeMixin)\n .mixin(StateMixin)\n .mixin(RippleMixin)\n .mixin(ScrollListenerMixin)\n .extend()\n .define({\n stateTargetElement() { return this.refs.anchor; },\n /**\n * Used to compute primary indicator size.\n * Default to 24.\n */\n labelMetrics() {\n const slot = this.refs.slot;\n let target = this.refs.slot;\n if (!slot.clientWidth) target = this.refs.icon;\n return {\n width: target.clientWidth,\n left: target.offsetLeft,\n };\n },\n })\n .set({\n delegatesFocus: true,\n stateLayer: true,\n })\n .observe({\n active: 'boolean',\n icon: 'string',\n src: 'string',\n href: 'string',\n ariaLabel: 'string',\n })\n .methods({\n /** @type {HTMLElement['focus']} */\n focus(options) {\n this.refs.anchor.focus(options);\n },\n })\n .html/* html */`\n <a id=anchor role=tab\n aria-label={ariaLabel}\n aria-controls=${({ href }) => (href?.startsWith('#') ? href.slice(1) : null)}\n aria-selected=${({ active }) => (active ? 'true' : 'false')}\n aria-disabled=${({ disabledState }) => `${disabledState}`}\n disabled={disabledState}\n href=${({ href }) => href ?? '#'}>\n <mdw-icon _if=${(data) => data.icon || data.src} id=icon aria-hidden=true src={src} active={active}>{icon}</mdw-icon>\n <slot id=slot></slot>\n </a>\n `\n .on({\n composed() {\n const { shape, rippleContainer, state } = this.refs;\n shape.append(state, rippleContainer);\n state.setAttribute('state-disabled', 'focus');\n },\n })\n .events({\n keydown(event) {\n if (event.key === ' ') {\n event.preventDefault(); // Avoid vertical scroll\n this.refs.anchor.click();\n }\n },\n })\n .childEvents({\n anchor: {\n click(event) {\n if (this.disabledState) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n const { href } = this;\n if (!href) {\n event.preventDefault();\n return;\n }\n if (href.startsWith('#')) {\n /** @type {HTMLElement} */\n const el = document.querySelector(href);\n if (!el) { console.warn('Unknown element', href); }\n event.preventDefault();\n el.scrollIntoView({ block: 'nearest', inline: 'start' });\n }\n },\n },\n })\n .css`\n /* https://m3.material.io/components/tabs/specs */\n\n :host {\n display: inline-flex;\n\n min-inline-size: 64px;\n\n cursor: pointer;\n }\n\n #anchor {\n display: flex;\n align-items: center;\n flex-direction: column;\n justify-content: center;\n\n box-sizing: border-box;\n block-size: 100%;\n inline-size: 100%;\n flex: 1;\n\n padding-block: 6px;\n padding-inline: 12px;\n\n cursor: pointer;\n outline: none;\n\n color: inherit;\n\n text-decoration: inherit;\n }\n\n #icon {\n padding-block: 4px;\n\n font-size: 24px;\n font-variation-settings: 'FILL' 0;\n\n }\n\n #shape[disabled],\n #anchor[disabled] {\n cursor: not-allowed;\n\n background-color: rgba(var(--mdw-color__on-surface), 0.12);\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n :host([active]) {\n color: rgb(var(--mdw-ink));\n }\n\n #icon[active] {\n font-variation-settings: 'FILL' 1;\n }\n\n #slot {\n display: block;\n overflow-x: hidden;\n overflow-y: hidden;\n\n max-block-size: var(--mdw-typescale__title-small__line-height);\n\n max-inline-size: 100%;\n\n cursor: inherit;\n outline: none;\n\n opacity: var(--mdw-nav-item__anchor__opacity, 1);\n transform: translateY(var(--mdw-nav-item__offset-y, 0));\n\n color: inherit;\n\n font: var(--mdw-typescale__title-small__font);\n letter-spacing: var(--mdw-typescale__title-small__letter-spacing);\n text-align: center;\n text-decoration: inherit;\n text-overflow: ellipsis;\n text-transform: none;\n white-space: nowrap;\n word-break: break-word;\n\n transition: opacity, color, transform 200ms;\n will-change: opacity, transform;\n }\n `\n .autoRegister('mdw-tab');\n", "const registeredElements = new Set();\n\n/** @type {MutationObserver} */\nlet rtlObserver;\n\n/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function RTLObserverMixin(Base) {\n return Base\n .extend()\n .observe({\n pageIsRTL: {\n type: 'boolean',\n value: document.documentElement.dir === 'rtl',\n },\n })\n .on({\n connected() {\n if (!rtlObserver) {\n rtlObserver = new MutationObserver(() => {\n const isRTL = document.documentElement.dir === 'rtl';\n for (const el of registeredElements) {\n el.pageIsRTL = isRTL;\n }\n });\n rtlObserver.observe(document.documentElement, { attributeFilter: ['dir'] });\n }\n registeredElements.add(this);\n },\n disconnected() {\n registeredElements.delete(this);\n },\n });\n}\n", "const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n // @ts-ignore Skip cast\n entry.target.onResizeObserved(entry);\n }\n});\n\n/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function ResizeObserverMixin(Base) {\n return Base\n .extend()\n .set({\n observeResizeOnConnected: true,\n })\n .methods({\n /** @param {ResizeObserverEntry} entry */\n onResizeObserved(entry) {\n // Virtual function\n },\n observeResize() {\n resizeObserver.observe(this);\n },\n unobserveResize() {\n resizeObserver.unobserve(this);\n },\n })\n .on({\n connected() {\n if (!this.observeResizeOnConnected) return;\n this.observeResize();\n },\n disconnected() {\n this.unobserveResize();\n },\n });\n}\n", "// https://w3c.github.io/aria/#tablist\n\nimport CustomElement from '../core/CustomElement.js';\nimport KeyboardNavMixin from '../mixins/KeyboardNavMixin.js';\nimport RTLObserverMixin from '../mixins/RTLObserverMixin.js';\nimport ResizeObserverMixin from '../mixins/ResizeObserverMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nimport Tab from './Tab.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(KeyboardNavMixin)\n .mixin(ResizeObserverMixin)\n .mixin(RTLObserverMixin)\n .mixin(ShapeMixin)\n .extend()\n .set({\n /** @type {WeakRef<HTMLElement>} */\n _tabContentRef: null,\n _tabContentScrollListener: null,\n /** @type {HTMLCollectionOf<InstanceType<Tab>>} */\n _tabCollection: null,\n /**\n * @type {{\n * left:number,\n * width:number,\n * right:number,\n * center: number,\n * label: {left:number, width:number},\n * index: number,\n * }[]}\n */\n _tabMetrics: null,\n _isRTL: null,\n })\n .define({\n tabContent: {\n get() {\n return this._tabContentRef?.deref();\n },\n /** @param {HTMLElement} value */\n set(value) {\n const oldValue = this._tabContentRef?.deref();\n if (oldValue) {\n oldValue.removeEventListener('scroll', this._tabContentScrollListener);\n }\n if (value) {\n this._tabContentRef = new WeakRef(value);\n this._tabContentScrollListener = this.observeTabContent.bind(this);\n value.addEventListener('scroll', this._tabContentScrollListener);\n this.observeTabContent();\n } else {\n this._tabContentRef = null;\n }\n },\n },\n })\n .observe({\n tabContentId: {\n /**\n * @param {string} oldValue\n * @param {string} newValue\n */\n changedCallback(oldValue, newValue) {\n // @ts-ignore Skip cast\n this.tabContent = newValue ? document.getElementById(newValue) : null;\n },\n },\n active: 'boolean',\n secondary: 'boolean',\n _indicatorStyle: { value: 'opacity: 0' },\n color: { empty: 'surface-primary' },\n })\n .define({\n tabs() {\n // eslint-disable-next-line no-return-assign\n return this._tabCollection ??= /** @type {HTMLCollectionOf<InstanceType<Tab>>} */ (\n this.getElementsByTagName(Tab.elementName)\n );\n },\n })\n .observe({\n /** Internal observed property */\n _selectedIndex: {\n type: 'integer',\n empty: -1,\n /**\n * @param {number} oldValue\n * @param {number} newValue\n */\n changedCallback(oldValue, newValue) {\n this.active = newValue !== -1;\n },\n },\n })\n .define({\n kbdNavQuery() {\n return Tab.elementName;\n },\n ariaOrientationDefault() {\n return /** @type {'horizontal'|'vertical'} */ ('horizontal');\n },\n /** @return {NodeListOf<InstanceType<Tab>>} */\n childTabItems() {\n return (this.querySelectorAll(Tab.elementName));\n },\n tabMetrics() {\n // eslint-disable-next-line no-return-assign\n return this._tabMetrics ??= [...this.tabs].map((tab, index) => ({\n left: tab.offsetLeft,\n width: tab.offsetWidth,\n right: tab.offsetLeft + tab.offsetWidth,\n center: tab.offsetLeft + (tab.offsetWidth / 2),\n label: tab.labelMetrics,\n index,\n }));\n },\n selectedIndex: {\n get() {\n let index = 0;\n for (const tab of this.tabs) {\n if (tab.active) return index;\n index++;\n }\n return -1;\n },\n set(value) {\n let index = 0;\n for (const el of this.tabs) {\n if (index === value) {\n el.active = true;\n this._selectedIndex = index;\n } else {\n el.active = false;\n }\n index++;\n }\n },\n },\n })\n .define({\n selectedItem: {\n /**\n * @return {InstanceType<Tab>}\n */\n get() {\n for (const tab of this.tabs) {\n if (tab.active) return tab;\n }\n return null;\n },\n /**\n * @param {InstanceType<Tab>} value\n * @return {InstanceType<Tab>}\n */\n set(value) {\n let index = 0;\n for (const tab of this.tabs) {\n if (tab === value) {\n this.selectedIndex = index;\n return value;\n }\n index++;\n }\n return null;\n },\n },\n })\n .methods({\n clearCache() {\n this._tabMetrics = null;\n },\n /** @param {InstanceType<Tab>} [tab] */\n updateIndicatorByTab(tab) {\n tab ??= this.selectedItem ?? this.tabs.item(0);\n\n const width = this.secondary ? tab.clientWidth : tab.labelMetrics.width;\n const position = this.secondary ? tab.offsetLeft : tab.offsetLeft + tab.labelMetrics.left;\n this._indicatorStyle = `--width: ${width}; --offset: ${position}px`;\n },\n updateIndicator(animate = false) {\n this.updateIndicatorByTab();\n if (!animate) {\n this.refs.indicator.style.setProperty('--transition-ratio', '0');\n }\n },\n /** @param {number} percentage */\n updateIndicatorByPosition(percentage) {\n const metrics = this.tabMetrics;\n\n // Tab panels are equal-width whereas tablist may be variable\n\n const clamped = Math.min(Math.max(percentage, 0), 1);\n const decimalIndex = (metrics.length - 1) * clamped;\n const leftIndex = Math.floor(decimalIndex);\n const rightIndex = Math.ceil(decimalIndex);\n\n const leftMetrics = metrics[leftIndex];\n if (!leftMetrics) return;\n\n const rightMetrics = metrics[rightIndex];\n\n let width;\n let activeTab;\n /** Center-based position */\n let center;\n if (leftMetrics === rightMetrics) {\n width = this.secondary ? leftMetrics.width : leftMetrics.label.width;\n activeTab = this.tabs.item(leftIndex);\n center = leftMetrics.center;\n } else {\n const leftRatio = 1 - (decimalIndex - leftIndex);\n const rightRatio = 1 - leftRatio;\n const leftWidth = leftRatio * (this.secondary ? leftMetrics.width : leftMetrics.label.width);\n const rightWidth = rightRatio * (this.secondary ? rightMetrics.width : rightMetrics.label.width);\n const activeIndex = leftRatio > rightRatio ? leftIndex : rightIndex;\n const distance = rightMetrics.center - leftMetrics.center;\n width = leftWidth + rightWidth;\n activeTab = this.tabs.item(activeIndex);\n center = leftMetrics.center + (distance * rightRatio);\n }\n\n if (!activeTab.active) {\n for (const tab of this.tabs) {\n tab.active = tab === activeTab;\n }\n this.active = true;\n }\n\n this._indicatorStyle = `--width: ${width}; --offset: ${center - (width / 2)}px`;\n this.refs.indicator.style.setProperty('--transition-ratio', '0');\n },\n /** @param {number} index */\n updateIndicatorByIndex(index) {\n this.updateIndicatorByTab(this.tabs.item(index ?? this._selectedIndex));\n },\n observeTabContent() {\n const tabContent = this.tabContent;\n if (!tabContent) return;\n let start = tabContent.scrollLeft;\n if (this.pageIsRTL) {\n start *= -1;\n }\n const width = tabContent.clientWidth;\n const max = tabContent.scrollWidth - width;\n const percentage = max === 0 ? 0 : start / max;\n this.updateIndicatorByPosition(percentage);\n },\n onResizeObserved() {\n this.clearCache();\n this.updateIndicator();\n },\n })\n\n .set({\n ariaRole: 'tablist',\n })\n .html/* html */`\n <slot id=slot ink={ink} type-style={typeStyle}></slot>\n <div id=indicator aria-hidden=true style={_indicatorStyle} active={active} secondary={secondary}>\n <div id=indicator-start class=indicator-piece></div>\n <div id=indicator-center class=indicator-piece></div>\n <div id=indicator-end class=indicator-piece></div>\n </div>\n `\n .on({\n composed() {\n const { shape, indicator } = this.refs;\n shape.append(indicator);\n },\n pageIsRTLChanged() {\n this.clearCache();\n this.updateIndicator();\n },\n activeChanged(oldValue, newValue) {\n if (newValue) {\n // Update indicator position without transition\n this.updateIndicator();\n }\n },\n secondaryChanged() {\n this.updateIndicator();\n },\n _selectedIndexChanged(oldValue, newValue) {\n this.updateIndicatorByIndex(newValue);\n },\n })\n .events({\n '~click'({ target }) {\n // Abort if not child\n if (target === this) return;\n if (target instanceof Tab) {\n // TODO: Override colors from scroll events\n }\n },\n })\n .childEvents({\n slot: {\n slotchange() {\n this.clearCache();\n this.updateIndicator();\n },\n },\n })\n .css`\n /* https://m3.material.io/components/tabs/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__primary);\n --mdw-shape__bg: rgb(var(--mdw-color__surface));\n position: relative;\n position: sticky;\n inset-block-start: 0;\n inset-inline: 0;\n\n display: grid;\n align-items: stretch;\n grid-auto-columns: minmax(auto, 1fr);\n grid-auto-flow: column;\n justify-content: space-evenly;\n overflow-y: hidden;\n\n box-sizing: border-box;\n min-block-size: 48px;\n inline-size: 100%;\n flex:none;\n\n color: inherit;\n\n text-align: center;\n\n will-change: transform;\n }\n\n #indicator {\n --corner: 3;\n --width: 24;\n --offset: 0;\n --visibility: 0;\n --transition-ratio: 1;\n position: absolute;\n inset-block-end: 0;\n inset-inline: 0;\n\n overflow-y: clip;\n\n block-size: 3px;\n inline-size: 100%;\n\n pointer-events: none;\n\n opacity: 1;\n transform: translateY(calc(100% * (1 - var(--visibility))));\n\n color: inherit;\n\n transition: transform 200ms;\n will-change: transform;\n }\n\n .indicator-piece {\n position: absolute;\n inset-block: 0;\n\n opacity: 1;\n /* opacity: 0.60; */\n transform-origin: 0 0;\n z-index:1;\n\n background-color: currentColor;\n\n transition: transform;\n transition-duration: calc(200ms * var(--transition-ratio));\n will-change: transform;\n }\n\n #indicator-start {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: 0;\n\n inline-size: calc(2 * 1px * var(--corner));\n\n transform: translateX(var(--offset));\n\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-top-left-radius: calc(1px * var(--corner));\n }\n\n #indicator-center {\n /* Chrome has rendering issues upscaling small elements */\n --precision: 100;\n\n position: absolute;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: calc(1px * var(--corner));\n\n inline-size: calc(1px * var(--precision));\n\n transform: translateX(var(--offset)) scaleX(calc((var(--width) - (2 * var(--corner))) / var(--precision)));\n\n }\n\n #indicator-end {\n position: absolute;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: 0;\n\n inline-size: calc(2 * 1px * var(--corner));\n\n transform:\n translateX(var(--offset))\n translateX(calc(-2px * var(--corner)))\n translateX(calc(var(--width) * 1px));\n\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-top-right-radius: calc(1px * var(--corner));\n }\n\n #indicator[active] {\n --visibility: 1;\n color: rgb(var(--mdw-ink));\n }\n\n #indicator[secondary] {\n --corner: 0;\n }\n\n :host([scrollable]) {\n grid-auto-columns: max-content;\n justify-content: flex-start;\n overflow-x: auto;\n\n padding-inline: 48px\n }\n `\n .autoRegister('mdw-tab-list');\n", "import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\n\nimport Box from './Box.js';\n\nexport default Box\n .mixin(AriaReflectorMixin)\n .extend()\n .set({\n _ariaRole: 'tabpanel',\n })\n .observe({\n active: {\n type: 'boolean',\n changedCallback(oldValue, newValue) {\n this.updateAriaProperty('ariaHidden', newValue ? 'false' : 'true');\n },\n },\n peeking: 'boolean',\n })\n .css/* css */`\n :host {\n scroll-snap-align: center;\n min-inline-size: 100%;\n max-inline-size: 100%;\n min-block-size: 100%;\n max-block-size: 100%;\n overflow-y: auto;\n will-change: visibility;\n\n visibility: hidden; \n }\n :host(:is([active],[peeking])) {\n /* Safari bug: Visiblity not changing without !important or layout reflow */\n visibility: visible !important;;\n }\n `\n .autoRegister('mdw-tab-panel');\n", "import './TabList.js'; /* TabList must register before TabContent */\nimport CustomElement from '../core/CustomElement.js';\nimport ResizeObserverMixin from '../mixins/ResizeObserverMixin.js';\n\nimport TabPanel from './TabPanel.js';\n\nexport default CustomElement\n .mixin(ResizeObserverMixin)\n .extend()\n .set({\n /** @type {InstanceType<TabPanel>[]} */\n _panelNodes: [],\n /**\n * @type {{\n * left:number,\n * width:number,\n * right:number,\n * center: number,\n * index: number,\n * }[]}\n */\n _panelMetrics: null,\n })\n .observe({\n /** Internal observed property */\n _selectedIndex: {\n type: 'integer',\n empty: -1,\n },\n })\n .define({\n panels() {\n return this._panelNodes;\n },\n panelMetrics() {\n // eslint-disable-next-line no-return-assign\n return this._panelMetrics ??= [...this._panelNodes].map((panel, index) => ({\n left: panel.offsetLeft,\n width: panel.offsetWidth,\n right: panel.offsetLeft + panel.offsetWidth,\n center: panel.offsetLeft + (panel.offsetWidth / 2),\n index,\n }));\n },\n })\n .define({\n selectedIndex: {\n get() {\n let index = 0;\n for (const panel of this.panels) {\n if (panel.active) return index;\n index++;\n }\n return -1;\n },\n set(value) {\n let index = 0;\n for (const el of this.panels) {\n if (index === value) {\n el.active = true;\n this._selectedIndex = index;\n } else {\n el.active = false;\n }\n index++;\n }\n },\n },\n })\n .define({\n selectedPanel: {\n /**\n * @return {InstanceType<TabPanel>}\n */\n get() {\n return this.panels.find((panel) => panel.active);\n },\n /**\n * @param {InstanceType<TabPanel>} value\n * @return {InstanceType<TabPanel>}\n */\n set(value) {\n const index = this.panels.indexOf(value);\n if (index === -1) return null;\n this.selectedIndex = index;\n return value;\n },\n },\n })\n .html/* html */`<slot id=slot></slot>`\n .methods({\n onResizeObserved() {\n this._panelMetrics = null;\n // Resize should not change panel visibility\n },\n updatePanels() {\n const start = this.scrollLeft;\n const width = this.clientWidth;\n const end = start + width;\n for (const metric of this.panelMetrics) {\n const visibleWidth = (start > metric.right) || (end < metric.left) // Offscreen ?\n ? 0\n : (\n (start >= metric.left) // Scroll at or over panel left point?\n ? metric.right - start // Measure from panel right\n : end - metric.left // Measure from panel left\n );\n const percentage = visibleWidth / width;\n const panel = this.panels[metric.index];\n panel.active = percentage >= 0.5;\n // TODO: Investigate possible subpixel imprecision\n panel.peeking = percentage > 0 && percentage < 0.5;\n }\n },\n })\n .childEvents({\n slot: {\n slotchange(event) {\n const slot = /** @type {HTMLSlotElement} */ (event.currentTarget);\n // @ts-ignore Skip cast\n this._panelNodes = slot.assignedElements()\n .filter((el) => el.tagName === TabPanel.elementName.toUpperCase());\n this.updatePanels();\n },\n },\n })\n .events({\n scroll: 'updatePanels',\n })\n .css`\n :host {\n display: grid;\n grid-auto-columns: 100%;\n grid-auto-flow: column;\n grid-template-columns: 100%;\n overflow-x: auto;\n scroll-behavior: smooth;\n scroll-snap-type: x mandatory;\n scrollbar-width: none;\n\n flex-grow: 1;\n -webkit-scroll-snap-type-x: mandatory;\n scroll-snap-type-x: mandatory;\n -webkit-scroll-snap-points-x: repeat(100%);\n scroll-snap-points-x: repeat(100%);\n overscroll-behavior-x: none;\n\n will-change: transform; /* Avoid repaint on scroll */\n }\n `\n .autoRegister('mdw-tab-content');\n", "import CustomElement from '../core/CustomElement.js';\nimport ControlMixin from '../mixins/ControlMixin.js';\nimport ResizeObserverMixin from '../mixins/ResizeObserverMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport TextFieldMixin from '../mixins/TextFieldMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n/** @implements {HTMLTextAreaElement} */\nexport default class TextArea extends CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(ControlMixin)\n .mixin(TextFieldMixin)\n .mixin(ResizeObserverMixin) {\n static { this.autoRegister('mdw-textarea'); }\n\n static {\n // eslint-disable-next-line no-unused-expressions\n this.css`\n /* https://m3.material.io/components/text-fields/specs */\n\n :host {\n display: inline-grid;\n grid-auto-flow: row;\n grid-template-rows: minmax(0, 100%);\n }\n\n :host(:is([filled][label])) {\n --control__margin-top: calc((var(--mdw-text-field__ratio) * 8px) + var(--mdw-typescale__body-small__line-height));\n --control__padding-top: 0px;\n --control__padding-bottom: calc((var(--mdw-text-field__ratio) * 8px) - 1px);\n --control__margin-bottom: 1px;\n }\n\n #label {\n --max-rows: none;\n --line-height: var(--mdw-typescale__body-large__line-height);\n --expected-height: calc((var(--control__margin-top) + var(--control__padding-top) + var(--line-height) + var(--control__padding-bottom) + var(--control__margin-bottom)));\n max-block-size: 100%;\n grid-row: 1 / 1;\n padding: 0;\n }\n\n @supports(height: 1lh) {\n #label {\n --line-height: 1lh;\n }\n }\n\n #slot {\n display: none;\n }\n\n #control {\n -ms-overflow-style: -ms-autohiding-scrollbar;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n\n box-sizing: border-box;\n block-size: 100%;\n\n min-block-size: var(--expected-height);\n /* Avoid clipping on resize */\n max-block-size: inherit;\n inline-size: 100% !important; /* !important to override user-agent resize */\n padding-inline: 16px;\n }\n\n #control[icon] {\n padding-inline-start: 0;\n }\n\n #control[minrows] {\n min-block-size: calc((var(--min-rows) * var(--line-height))\n + var(--control__margin-top)\n + var(--control__padding-top)\n + var(--control__padding-bottom)\n + var(--control__margin-bottom)\n );\n }\n\n #control[maxrows] {\n max-block-size: calc((var(--max-rows) * var(--line-height))\n + var(--control__margin-top)\n + var(--control__padding-top)\n + var(--control__padding-bottom)\n + var(--control__margin-bottom)\n );\n }\n\n #control:is([icon], [input-prefix]) {\n padding-inline-start: 0;\n }\n\n #control:is([trailing-icon], [input-suffix]) {\n padding-inline-end: 0;\n }\n\n #suffix {\n padding-inline-end: 16px;\n }\n\n mdw-icon {\n align-self: flex-start;\n\n margin-block-start: calc((var(--expected-height) - var(--mdw-icon__size)) / 2);\n }\n\n #control[fixed] {\n /* stylelint-disable-next-line plugin/no-unsupported-browser-features */\n resize: none;\n }\n\n `;\n this.childEvents({ slot: { slotchange: 'onSlotChange' } });\n this.on({\n composed() {\n const { control } = this.refs;\n control.setAttribute('input-prefix', '{input-prefix}');\n control.setAttribute('input-suffix', '{input-suffix}');\n control.setAttribute('minrows', '{minrows}');\n control.setAttribute('fixed', '{fixed}');\n control.setAttribute('icon', '{icon}');\n control.setAttribute('maxrows', '{maxrows}');\n },\n defaultValueAttrChanged(oldValue, newValue) {\n this.defaultValue = newValue;\n },\n defaultValueChanged() {\n this._value = this.#textarea.value;\n this.resize();\n },\n _maxHeightChanged(oldValue, newValue) {\n this.#textarea.style.setProperty('max-height', newValue);\n },\n _lineHeightChanged(oldValue, newValue) {\n this.refs.label.style.setProperty('--line-height', newValue);\n },\n minRowsChanged(oldValue, newValue) {\n this.refs.label.style.setProperty('--min-rows', `${newValue || 'none'}`);\n this.resize();\n },\n maxRowsChanged(oldValue, newValue) {\n this.refs.label.style.setProperty('--max-rows', `${newValue || 'none'}`);\n this.resize();\n },\n rowsChanged() {\n this.resize();\n },\n });\n }\n\n static supportsCSSLineHeightUnit = CSS.supports('height', '1lh');\n\n static controlTagName = 'textarea';\n\n static controlVoidElement = false;\n\n static clonedContentAttributes = [\n ...super.clonedContentAttributes,\n 'cols',\n 'dirname',\n 'maxlength',\n 'minlength',\n 'placeholder',\n 'rows',\n ];\n\n #updatingSlot = false;\n\n #textarea = /** @type {HTMLTextAreaElement} */ (this.refs.control);\n\n static {\n if (TextArea.supportsCSSLineHeightUnit) {\n this.childEvents({\n control: {\n input() {\n this.resize();\n },\n },\n });\n }\n }\n\n /**\n * @param {Event & {currentTarget:HTMLSlotElement}} event\n * @return {void}\n */\n onSlotChange({ currentTarget }) {\n const textarea = /** @type {HTMLTextAreaElement} */ (this.refs.control);\n const previousValue = textarea.defaultValue;\n textarea.replaceChildren(\n ...currentTarget.assignedNodes().map((child) => child.cloneNode(true)),\n );\n\n const newValue = textarea.defaultValue;\n if (previousValue !== newValue) {\n this.propChangedCallback('defaultValue', previousValue, newValue);\n }\n }\n\n /** @return {number} */\n resize() {\n const textarea = this.#textarea;\n textarea.style.removeProperty('height');\n\n // if (this.placeholder) textarea.removeAttribute('placeholder');\n\n if (!TextArea.supportsCSSLineHeightUnit) {\n const { lineHeight } = window.getComputedStyle(textarea);\n this._lineHeight = lineHeight;\n }\n\n if (this.minRows > 1 && textarea.rows < this.minRows) {\n textarea.rows = this.minRows;\n } else if (this.maxRows && textarea.rows > this.maxRows) {\n textarea.rows = this.maxRows;\n }\n if (!this.fixed) {\n while (textarea.scrollHeight > textarea.clientHeight) {\n if (this.maxRows && textarea.rows === this.maxRows) break;\n const lastClientHeight = textarea.clientHeight;\n textarea.rows++;\n if (lastClientHeight === textarea.clientHeight) {\n textarea.rows--;\n break;\n }\n }\n while (textarea.scrollHeight === textarea.clientHeight) {\n if (textarea.rows === 1) break;\n if (this.minRows > 1 && textarea.rows === this.minRows) break;\n const lastClientHeight = textarea.clientHeight;\n textarea.rows--;\n if ((lastClientHeight === textarea.clientHeight)\n || (textarea.scrollHeight > textarea.clientHeight)) {\n textarea.rows++;\n break;\n }\n }\n }\n\n if (textarea.selectionEnd === textarea.value.length) {\n textarea.scrollTop = textarea.scrollHeight;\n }\n\n this.rows = textarea.rows;\n // if (this.placeholder) textarea.setAttribute('placeholder', this.placeholder);\n return this.rows;\n }\n\n formResetCallback() {\n this.#textarea.value = this.defaultValue;\n this._value = this.#textarea.value;\n super.formResetCallback();\n }\n\n get updatingSlot() { return this.#updatingSlot; }\n\n get defaultValue() {\n return this.#textarea.defaultValue;\n }\n\n set defaultValue(value) {\n const previousValue = this.#textarea.defaultValue;\n this.#textarea.defaultValue = value;\n if (previousValue !== this.#textarea.defaultValue) {\n this.propChangedCallback('defaultValue', previousValue, this.defaultValue);\n }\n this.textContent = this.#textarea.defaultValue;\n }\n\n // @ts-ignore @override\n\n get type() { return 'textarea'; }\n\n get textLength() { return this.#textarea.textLength; }\n\n get select() { return this.#textarea.select; }\n\n get selectionDirection() { return this.#textarea.selectionDirection; }\n\n set selectionDirection(value) { this.#textarea.selectionDirection = value; }\n\n get selectionStart() { return this.#textarea.selectionStart; }\n\n set selectionStart(value) { this.#textarea.selectionStart = value; }\n\n get selectionEnd() { return this.#textarea.selectionEnd; }\n\n set selectionEnd(value) { this.#textarea.selectionEnd = value; }\n\n get setRangeText() { return this.#textarea.setRangeText; }\n\n get setSelectionRange() { return this.#textarea.setSelectionRange; }\n\n /** @param {ResizeObserverEntry} entry */\n onResizeObserved(entry) {\n super.onResizeObserved(entry);\n this.resize();\n }\n}\n\nTextArea.propList.delete('type');\n\nTextArea.prototype._maxHeight = TextArea.prop('_maxHeight');\nTextArea.prototype.fixed = TextArea.prop('fixed', { type: 'boolean' });\nTextArea.prototype.minRows = TextArea.prop('minRows', { attr: 'minrows', type: 'integer', empty: 0 });\nTextArea.prototype.maxRows = TextArea.prop('maxRows', { attr: 'maxrows', type: 'integer', empty: 0 });\nTextArea.prototype._lineHeight = TextArea.prop('_lineHeight');\n\n// https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element\n\nconst DOMString = { nullParser: String };\nTextArea.prototype.cols = TextArea.prop('cols', { type: 'integer', empty: 0 });\nTextArea.prototype.dirName = TextArea.prop('dirName', { attr: 'dirname', ...DOMString });\nTextArea.prototype.maxLength = TextArea.prop('maxLength', { attr: 'maxlength', type: 'integer', empty: 0 });\nTextArea.prototype.minLength = TextArea.prop('minLength', { attr: 'minlength', type: 'integer', empty: 0 });\nTextArea.prototype.placeholder = TextArea.prop('placeholder', DOMString);\nTextArea.prototype.rows = TextArea.prop('rows', { type: 'integer', empty: 1 });\nTextArea.prototype.wrap = TextArea.prop('wrap', DOMString);\n\n// Not in spec, but plays nice with HTML linters\nTextArea.prototype.defaultValueAttr = TextArea.prop('defaultValueAttr', { attr: 'value', ...DOMString });\n", "import Headline from './Headline.js';\n\nexport default Headline\n .extend()\n .expressions({\n computeAriaLevel({ ariaLevel, size }) {\n if (ariaLevel) return ariaLevel;\n if (size === 'medium') return '5';\n if (size === 'small') return '6';\n return '4';\n },\n })\n .css`\n :host {\n font: var(--mdw-typescale__title-large__font);\n letter-spacing: var(--mdw-typescale__title-large__letter-spacing);\n }\n \n :host([size=\"medium\"]) {\n font: var(--mdw-typescale__title-medium__font);\n letter-spacing: var(--mdw-typescale__title-medium__letter-spacing);\n }\n \n :host([size=\"small\"]) {\n font: var(--mdw-typescale__title-small__font);\n letter-spacing: var(--mdw-typescale__title-small__letter-spacing);\n }\n `\n .autoRegister('mdw-title');\n", "import CustomElement from '../core/CustomElement.js';\nimport { ELEMENT_STYLER_TYPE } from '../core/customTypes.js';\nimport AriaToolbarMixin from '../mixins/AriaToolbarMixin.js';\nimport ResizeObserverMixin from '../mixins/ResizeObserverMixin.js';\nimport ScrollListenerMixin from '../mixins/ScrollListenerMixin.js';\nimport SurfaceMixin from '../mixins/SurfaceMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(SurfaceMixin) // TopAppBars are non-shaped surfaces\n .mixin(AriaToolbarMixin)\n .mixin(ScrollListenerMixin)\n .mixin(ResizeObserverMixin)\n .extend()\n .set({\n elevated: true,\n })\n .observe({\n headline: 'string',\n _raised: 'boolean', // Change to raw value instead of computed\n hideOnScroll: 'boolean',\n size: { value: /** @type {'small'|'medium'|'large'|null} */ (null) },\n _cssPosition: {\n /** @type {'sticky'|'relative'} */\n empty: 'relative',\n },\n _visibleStart: { type: 'float', default: 0 },\n _translateY: { type: 'float', empty: 0 },\n _duration: { type: 'float', empty: 0 },\n _easing: { empty: 'ease-in' },\n _headlineOpacity: { type: 'float', default: 0 },\n /** Convert to observable */\n ariaLabel: 'string',\n color: { empty: 'surface' },\n })\n .observe({\n _scrollDirection: {\n /**\n * @param {'up'|'down'} oldValue\n * @param {'up'|'down'} newValue\n */\n changedCallback(oldValue, newValue) {\n if (newValue === 'down') {\n if (this._cssPosition !== 'sticky') return;\n // Was sticky, switch to relative and let appbar scroll away\n this._cssPosition = 'relative';\n this._translateY = this.scrollListenerPositionY;\n return;\n }\n if (this._visibleStart < 1) return;\n // Align appbar.bottom with scroll position (top of screen)\n this._translateY = this.scrollListenerPositionY - this.refs.surface.scrollHeight;\n },\n },\n _surfaceStyle: {\n ...ELEMENT_STYLER_TYPE,\n get({ hideOnScroll, _cssPosition, _translateY, _duration, _easing }) {\n if (!hideOnScroll) {\n return null;\n }\n return {\n target: 'surface',\n styles: {\n position: _cssPosition,\n transform: `translateY(${_translateY}px)`,\n },\n timing: {\n duration: _duration,\n easing: _easing,\n },\n };\n },\n },\n _headlineStyle: {\n ...ELEMENT_STYLER_TYPE,\n get({ size, _headlineOpacity }) {\n if (size !== 'medium' && size !== 'large') return null;\n return {\n target: 'headline',\n styles: {\n opacity: _headlineOpacity ?? 0,\n },\n timing: {\n duration: 200,\n },\n };\n },\n },\n })\n .html/* html */`\n <slot id=leading name=leading on-slotchange={refreshTabIndexes}></slot>\n <div id=headline ink={ink} color={color} type-style={typeStyle} on-slotchange={refreshTabIndexes}>\n {headline}\n <slot id=headline-slot></slot>\n </div>\n <slot id=trailing name=trailing on-slotchange={refreshTabIndexes}></slot>\n <div _if=${({ size }) => size === 'medium' || size === 'large'} id=companion aria-hidden=true size={size}>\n <div _if={showSurfaceTint} id=companion-tint raised={_raised} class=surface-tint color={color}></div>\n <slot id=companion-slot name=companion size={size}>{headline}</span>\n </div>\n `\n .on({\n composed({ inline }) {\n const { surface, leading, headline, trailing } = this.refs;\n surface.append(leading, headline, trailing);\n surface.setAttribute('size', '{size}');\n surface.setAttribute('hide-on-scroll', '{hideOnScroll}');\n surface.setAttribute('role', 'toolbar');\n surface.setAttribute('aria-label', '{ariaLabel}');\n surface.setAttribute(\n 'aria-labelledby',\n inline(({ ariaLabel }) => (ariaLabel ? null : 'headline')),\n );\n },\n scrollListenerPositionYChanged(oldValue, newValue) {\n this._raised = (newValue > 0);\n if (this.size === 'medium' || this.size === 'large') {\n const max = this.refs.companion.scrollHeight;\n const min = (0.5 * max);\n this._headlineOpacity = Math.max(0, Math.min(1, (newValue - min) / (max - min)));\n }\n\n if (!this.hideOnScroll) return;\n\n this._duration = 0;\n if (newValue <= 0) {\n // Set at rest (top of parent, but allow overscroll)\n this._cssPosition = 'relative';\n this._translateY = 0;\n this._visibleStart = 0;\n } else if (newValue < this._translateY) {\n // Align appbar.top with scroll position (top of screen)\n this._cssPosition = 'sticky';\n this._translateY = 0;\n this._visibleStart = 0;\n } else if (this._cssPosition !== 'sticky') {\n this._visibleStart = (newValue - this._translateY) / this.refs.surface.scrollHeight;\n }\n\n this._scrollDirection = newValue > oldValue ? 'down' : 'up';\n },\n })\n .methods({\n onScrollIdle() {\n const _visibleStart = this._visibleStart;\n if (this._headlineOpacity > 0) {\n // Fill in opacity on idle\n this._headlineOpacity = 1;\n }\n if (_visibleStart <= 0) return;\n if (_visibleStart >= 1) return;\n if (this.scrollListenerPositionY < (this.refs.surface.scrollHeight)) return;\n if (_visibleStart <= 0.5) {\n // Reveal all\n this._duration = 250;\n this._easing = 'ease-in';\n this._cssPosition = 'relative';\n this._translateY = this.scrollListenerPositionY;\n this._headlineOpacity = 1;\n } else {\n this._duration = 200;\n this._easing = 'ease-out';\n this._cssPosition = 'relative';\n this._translateY = this.scrollListenerPositionY - this.refs.surface.scrollHeight;\n }\n },\n })\n .define({\n ariaActiveDescendantElement: {\n get() {\n // @ts-ignore Accessibility Object Model\n return this.refs.surface.ariaActiveDescendantElement;\n },\n set(value) {\n // @ts-ignore Accessibility Object Model\n this.refs.surface.ariaActiveDescendantElement = value;\n },\n },\n })\n .on({\n connected() {\n const { surface } = this.refs;\n if (surface.offsetParent) {\n this.startScrollListener(surface.offsetParent ?? window);\n } else {\n const resizeObserver = new ResizeObserver(() => {\n this.startScrollListener(surface.offsetParent ?? window);\n resizeObserver.disconnect();\n });\n resizeObserver.observe(surface);\n }\n },\n disconnected() {\n this.clearScrollListener();\n },\n })\n .css`\n /* https://m3.material.io/components/bottom-app-bar/specs */\n\n :host {\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__on-surface);\n --mdw-surface__tint: var(--mdw-surface__tint__0);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__2);\n display: contents;\n\n z-index:2;\n }\n\n #surface {\n position: sticky;\n inset-block-start: 0;\n\n display: grid;\n\n align-items: center;\n gap: 12px;\n grid-auto-flow: row;\n grid-template-rows: minmax(64px,min-content);\n grid-template-columns: minmax(auto,1fr) minmax(0,auto) minmax(auto,1fr);\n overflow-x: clip; /* Clip oversized touch targets to avoid scroll-bars */\n overflow-y: visible;\n\n box-sizing: border-box;\n inline-size: 100%;\n max-inline-size: 100%;\n\n /* 16px from icon */\n /* inset = (button.width / 2) - (icon.width / 2) */\n /* paddingInline = 16px - inset */\n /* paddingInlineStart = 16px - ((48px / 2) - (24px / 2)) */\n /* paddingInlineEnd = 16px - ((48px / 2) - (30px / 2)) */\n\n padding-inline: 4px;\n\n pointer-events: auto;\n\n filter: none; /* Never receive shadow */\n\n z-index: 5;\n /* inset-inline: 0; */\n\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-ink));\n\n transition: grid-template-columns 100ms;\n\n }\n\n #surface-tint {\n position: 0;\n\n z-index: 1;\n }\n\n #leading {\n justify-self: flex-start;\n\n display: flex;\n align-items: center;\n\n grid-column: 1;\n grid-row: 1;\n }\n\n #headline {\n display: inline-block;\n\n overflow: clip hidden;\n\n max-inline-size: 100%;\n\n grid-column: 2;\n grid-row: 1;\n\n font: var(--mdw-typescale__title-large__font);\n letter-spacing: var(--mdw-typescale__title-large__letter-spacing);\n\n text-overflow: ellipsis;\n text-transform: none;\n white-space: nowrap;\n word-break: break-word;\n\n transition-duration: 200ms;\n transition-property: transform, opacity, color, background-color;\n }\n\n #trailing {\n justify-self: flex-end;\n\n display: flex;\n align-items: center;\n gap: 8px;\n justify-content: flex-end;\n\n grid-column: 3;\n grid-row: 1;\n\n color: var(--mdw-color__on-surface-variant);\n }\n\n /* Medium */\n #companion {\n position: relative;\n\n display: flex;\n align-items: flex-end;\n\n /**\n * Total Height = 112px\n * Bar = 12 + 40 + 12 (64)\n * Companion = 112px - 64\n * Companion Bottom = 20px\n * Companion = 28px\n * Shift up = 1lh - 28px\n */\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin-block-start: calc(28px - var(--mdw-typescale__headline-small__line-height));\n padding-block-end: 20px;\n\n padding-inline: 16px;\n\n background-color: rgb(var(--mdw-bg));\n box-shadow: none;\n\n font: var(--mdw-typescale__headline-small__font);\n letter-spacing: var(--mdw-typescale__headline-small__letter-spacing);\n white-space: nowrap;\n }\n\n #companion[size=\"large\"] {\n /**\n * Total Height = 152px\n * Bar = 12 + 40 + 12 (64)\n * Companion = 152px - 64\n * Companion Bottom = 20px\n * Companion = 68px\n * Shift up = 2lh - 68px\n */\n\n min-block-size: calc(2 * var(--mdw-typescale__headline-medium__line-height));\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin-block-start: calc(68px - (2 * var(--mdw-typescale__headline-medium__line-height)));\n\n font: var(--mdw-typescale__headline-medium__font);\n letter-spacing: var(--mdw-typescale__headline-medium__letter-spacing);\n white-space: normal;\n }\n\n @supports(width: 1lh) {\n #companion {\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin-block-start: calc(28px - 1lh);\n }\n\n #companion[size=\"large\"] {\n min-block-size: 2lh;\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin-block-start: calc(68px - 2lh);\n }\n }\n\n #companion-slot {\n display: block;\n overflow-x: clip;\n overflow-y: hidden;\n\n text-overflow: ellipsis;\n text-transform: none;\n word-break: break-word;\n }\n\n #companion-slot[size=\"large\"] {\n max-block-size: calc(2 * var(--mdw-typescale__headline-medium__line-height));\n }\n\n @supports(-webkit-line-clamp: 2) {\n #companion-slot[size=\"large\"] {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n\n max-block-size: none;\n }\n }\n\n #surface[hide-on-scroll] {\n position: relative;\n\n inset-block-start: 0;\n\n transform: translateY(0);\n\n will-change: transform, position;\n }\n\n #surface[size=\"small\"] {\n gap: 4px;\n grid-template-columns: auto 1fr auto;\n }\n\n #headline:is([size=\"medium\"],[size=\"large\"]) {\n opacity: 0;\n\n will-change: opacity;\n }\n\n `\n .autoRegister('mdw-top-app-bar');\n", "import { css } from '../core/template.js';\n\nimport {\n generateThemeCSS,\n generateTypographyGlobalCSS,\n themeOptionsFromSearchParams,\n} from './index.js';\n\nconst rules = [\n generateThemeCSS(themeOptionsFromSearchParams(new URL(import.meta.url).searchParams)),\n generateTypographyGlobalCSS(),\n].join('\\n');\n\nconst parsed = css`${rules}`;\nif (parsed instanceof HTMLStyleElement) {\n document.head.append(parsed);\n} else {\n document.adoptedStyleSheets = [\n ...document.adoptedStyleSheets,\n parsed,\n ];\n}\n", "import { COLOR_KEYWORDS } from '../utils/color_keywords.js';\nimport { getScheme } from '../utils/hct/helper.js';\nimport { svgToCSSURL } from '../utils/svg.js';\n\n/**\n * @typedef {Object} ThemeOptions\n * @prop {string} [color]\n * @prop {Iterable<[string,string?]>} [custom] Map()\n * @prop {'auto'|'light'|'dark'} [lightness='auto']\n * @return {string}\n */\n\n/**\n * @param {string} shape\n * @return {string}\n */\nfunction getShapeMaskSVG(shape) {\n return [\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">',\n `<defs><path id=\"a\" d=\"${shape}\"/></defs>`,\n '<use href=\"#a\" transform=\"scale(.666)\"/>',\n '<use href=\"#a\" transform=\"translate(8) scale(.666)\"/>',\n '<use href=\"#a\" transform=\"matrix(.666 0 0 .666 0 8)\"/>',\n '<use href=\"#a\" transform=\"matrix(.666 0 0 .666 8 8)\"/>',\n '<path d=\"M8 0h8v24H8Z\"/><path d=\"M0 8h24v8H0Z\"/>',\n '</svg>',\n ].join('');\n}\n\n/**\n * @param {string} shape\n * @param {'top-left'|'top-right'|'bottom-left'|'bottom-right'} corner\n * @param {boolean} [convex]\n * @return {string}\n */\nfunction getShapeCornerSVGs(shape, corner, convex) {\n const path = `<path ${[\n `d=\"${shape}\"`,\n 'vector-effect=\"non-scaling-stroke\"',\n `transform-origin=\"${corner.replace('-', ' ')}\"`,\n 'stroke-linejoin=\"miter\"',\n 'transform=\"scale(2)\"',\n `stroke-width=\"${convex ? 4 : 2}px\"`,\n 'stroke=\"black\"',\n 'fill=\"none\"',\n ].join(' ')}/>`;\n\n return [\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">',\n convex\n ? [\n '<mask id=\"m\">',\n '<rect x=\"0\" y=\"0\" width=\"24\" height=\"24\" fill=\"white\"/>',\n `<path d=\"${shape}\" transform-origin=\"${corner.replace('-', ' ')}\" transform=\"scale(2)\"/>`,\n '</mask>',\n `<g mask=\"url(#m)\">${path}</g>`,\n ].join('')\n : path,\n '</svg>',\n ].join('');\n}\n\n/**\n * @return {string}\n */\nfunction getShapeEdgesSVGs() {\n return [\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">',\n '<rect x=\"0\" y=\"0\" width=\"24\" height=\"24\" vector-effect=\"non-scaling-stroke\" stroke-width=\"2px\" stroke=\"black\" fill=\"none\"/>',\n '</svg>',\n ].join('');\n}\n\nconst CIRCLE_PATH = 'M0 12A12 12 0 1012 0 12 12 0 000 12Z';\n// const SQUIRCLE_PATH = 'M12 24C17.2583 24 20.1815 24 22.0908 22.0908 24 20.1815 24 17.2583 24 12 24 6.7417 24 3.8185 22.0908 1.9092 20.1815-0 17.2583-0 12-0 6.7417-0 3.8185-0 1.9092 1.9092-0 3.8185-0 6.7417-0 12-0 17.2583-0 20.1815 1.9092 22.0908 3.8185 24 6.7417 24 12 24Z';\nconst DIAMOND_PATH = 'M 0 12 12 0 24 12 12 24 Z';\nconst SQUIRCLE_PATH = 'M12 24C17.2583 24 20.1815 24 22.0908 22.0908 24 20.1815 24 17.2583 24 12 24 6.7417 24 3.8185 22.0908 1.9092 20.1815-0 17.2583-0 12-0 6.7417-0 3.8185-0 1.9092 1.9092-0 3.8185-0 6.7417-0 12-0 17.2583-0 20.1815 1.9092 22.0908 3.8185 24 6.7417 24 12 24Z';\nconst HALF_NOTCH_PATH = 'M0 6H6V0H18V6H24V18H18V24H6V18H0Z';\n\nconst SHAPE_ROUNDED_DEFAULT = {\n size: {\n extraSmall: '4px',\n small: '8px',\n medium: '12px',\n large: '16px',\n extraLarge: '28px',\n full: '32px',\n },\n /** @type {string?} */\n mask: CIRCLE_PATH, // CIRCLE_PATH\n convex: false,\n};\n\nconst SHAPE_CUT_DEFAULT = {\n ...SHAPE_ROUNDED_DEFAULT,\n size: {\n extraSmall: '4px',\n small: '8px',\n medium: '12px',\n large: '16px',\n extraLarge: '28px',\n full: '32px',\n },\n mask: DIAMOND_PATH,\n};\n\nconst SHAPE_SQUIRCLE_DEFAULT = {\n ...SHAPE_ROUNDED_DEFAULT,\n mask: SQUIRCLE_PATH,\n};\n\nconst SP = 1 / 16;\n\nconst TYPOGRAPHY_DEFAULT = {\n face: {\n brand: '\"Roboto Medium\", Roboto, -apple-system, BlinkMacSystemFont, \"Segoe UI Variable Display\", Helvetica, \"Segoe UI\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"',\n plain: '\"Roboto Regular\", Roboto, -apple-system, BlinkMacSystemFont, \"Segoe UI Variable Text\", Helvetica, \"Segoe UI\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"',\n weight: {\n regular: 400,\n medium: 500,\n },\n },\n scale: {\n display: {\n large: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 64,\n fontSize: 57,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n medium: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 52,\n fontSize: 45,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n small: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 44,\n fontSize: 36,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n },\n headline: {\n large: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 40,\n fontSize: 32,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n medium: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 36,\n fontSize: 28,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n small: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 32,\n fontSize: 24,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n },\n title: {\n large: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 28,\n fontSize: 22,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-medium)', // Figma style has regular\n },\n medium: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 24,\n fontSize: 16,\n letterSpacing: 0.15,\n weight: 'var(--mdw-typeface__weight-medium)',\n },\n small: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 20,\n fontSize: 14,\n letterSpacing: 0.1,\n weight: 'var(--mdw-typeface__weight-medium)',\n },\n },\n label: {\n large: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 20,\n fontSize: 14,\n letterSpacing: 0.1,\n weight: 'var(--mdw-typeface__weight-medium)',\n },\n medium: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 16,\n fontSize: 12,\n letterSpacing: 0.5,\n weight: 'var(--mdw-typeface__weight-medium)',\n },\n small: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 16,\n fontSize: 11,\n letterSpacing: 0.5,\n weight: 'var(--mdw-typeface__weight-medium)',\n },\n },\n body: {\n large: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 24,\n fontSize: 16,\n letterSpacing: 0.5, // Figma text has 0.15\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n medium: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 20,\n fontSize: 14,\n letterSpacing: 0.25,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n small: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 16,\n fontSize: 12,\n letterSpacing: 0.4,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n },\n },\n};\n\n/**\n * @param {typeof TYPOGRAPHY_DEFAULT} config\n * @return {string}\n */\nexport function generateTypographyCSS(config = TYPOGRAPHY_DEFAULT) {\n return /* css */ `\n :root {\n --mdw-typeface__brand: ${config.face.brand};\n --mdw-typeface__weight-regular: ${config.face.weight.regular};\n --mdw-typeface__weight-medium: ${config.face.weight.medium};\n --mdw-typeface__plain: ${config.face.plain};\n\n --mdw-typescale__display-large__font-family: ${config.scale.display.large.fontFamily};\n --mdw-typescale__display-large__line-height: calc(${config.scale.display.large.lineHeight} * 0.0625rem);\n --mdw-typescale__display-large__font-size: calc(${config.scale.display.large.fontSize} * 0.0625rem);\n --mdw-typescale__display-large__letter-spacing: calc(${config.scale.display.large.letterSpacing} * 0.0625rem);\n --mdw-typescale__display-large__font-weight: ${config.scale.display.large.weight};\n\n --mdw-typescale__display-medium__font-family: ${config.scale.display.medium.fontFamily};\n --mdw-typescale__display-medium__line-height: calc(${config.scale.display.medium.lineHeight} * 0.0625rem);\n --mdw-typescale__display-medium__font-size: calc(${config.scale.display.medium.fontSize} * 0.0625rem);\n --mdw-typescale__display-medium__letter-spacing: calc(${config.scale.display.medium.letterSpacing} * 0.0625rem);\n --mdw-typescale__display-medium__font-weight: ${config.scale.display.medium.weight};\n\n --mdw-typescale__display-small__font-family: ${config.scale.display.small.fontFamily};\n --mdw-typescale__display-small__line-height: calc(${config.scale.display.small.lineHeight} * 0.0625rem);\n --mdw-typescale__display-small__font-size: calc(${config.scale.display.small.fontSize} * 0.0625rem);\n --mdw-typescale__display-small__letter-spacing: calc(${config.scale.display.small.letterSpacing} * 0.0625rem);\n --mdw-typescale__display-small__font-weight: ${config.scale.display.small.weight};\n\n --mdw-typescale__headline-large__font-family: ${config.scale.headline.large.fontFamily};\n --mdw-typescale__headline-large__line-height: calc(${config.scale.headline.large.lineHeight} * 0.0625rem);\n --mdw-typescale__headline-large__font-size: calc(${config.scale.headline.large.fontSize} * 0.0625rem);\n --mdw-typescale__headline-large__letter-spacing: calc(${config.scale.headline.large.letterSpacing} * 0.0625rem);\n --mdw-typescale__headline-large__font-weight: ${config.scale.headline.large.weight};\n\n --mdw-typescale__headline-medium__font-family: ${config.scale.headline.medium.fontFamily};\n --mdw-typescale__headline-medium__line-height: calc(${config.scale.headline.medium.lineHeight} * 0.0625rem);\n --mdw-typescale__headline-medium__font-size: calc(${config.scale.headline.medium.fontSize} * 0.0625rem);\n --mdw-typescale__headline-medium__letter-spacing: calc(${config.scale.headline.medium.letterSpacing} * 0.0625rem);\n --mdw-typescale__headline-medium__font-weight: ${config.scale.headline.medium.weight};\n\n --mdw-typescale__headline-small__font-family: ${config.scale.headline.small.fontFamily};\n --mdw-typescale__headline-small__line-height: calc(${config.scale.headline.small.lineHeight} * 0.0625rem);\n --mdw-typescale__headline-small__font-size: calc(${config.scale.headline.small.fontSize} * 0.0625rem);\n --mdw-typescale__headline-small__letter-spacing: calc(${config.scale.headline.small.letterSpacing} * 0.0625rem);\n --mdw-typescale__headline-small__font-weight: ${config.scale.headline.small.weight};\n\n --mdw-typescale__title-large__font-family: ${config.scale.title.large.fontFamily};\n --mdw-typescale__title-large__line-height: calc(${config.scale.title.large.lineHeight} * 0.0625rem);\n --mdw-typescale__title-large__font-size: calc(${config.scale.title.large.fontSize} * 0.0625rem);\n --mdw-typescale__title-large__letter-spacing: calc(${config.scale.title.large.letterSpacing} * 0.0625rem);\n --mdw-typescale__title-large__font-weight: ${config.scale.title.large.weight};\n\n --mdw-typescale__title-medium__font-family: ${config.scale.title.medium.fontFamily};\n --mdw-typescale__title-medium__line-height: calc(${config.scale.title.medium.lineHeight} * 0.0625rem);\n --mdw-typescale__title-medium__font-size: calc(${config.scale.title.medium.fontSize} * 0.0625rem);\n --mdw-typescale__title-medium__letter-spacing: calc(${config.scale.title.medium.letterSpacing} * 0.0625rem);\n --mdw-typescale__title-medium__font-weight: ${config.scale.title.medium.weight};\n\n --mdw-typescale__title-small__font-family: ${config.scale.title.small.fontFamily};\n --mdw-typescale__title-small__line-height: calc(${config.scale.title.small.lineHeight} * 0.0625rem);\n --mdw-typescale__title-small__font-size: calc(${config.scale.title.small.fontSize} * 0.0625rem);\n --mdw-typescale__title-small__letter-spacing: calc(${config.scale.title.small.letterSpacing} * 0.0625rem);\n --mdw-typescale__title-small__font-weight: ${config.scale.title.small.weight};\n\n --mdw-typescale__label-large__font-family: ${config.scale.label.large.fontFamily};\n --mdw-typescale__label-large__line-height: calc(${config.scale.label.large.lineHeight} * 0.0625rem);\n --mdw-typescale__label-large__font-size: calc(${config.scale.label.large.fontSize} * 0.0625rem);\n --mdw-typescale__label-large__letter-spacing: calc(${config.scale.label.large.letterSpacing} * 0.0625rem);\n --mdw-typescale__label-large__font-weight: ${config.scale.label.large.weight};\n\n --mdw-typescale__label-medium__font-family: ${config.scale.label.medium.fontFamily};\n --mdw-typescale__label-medium__line-height: calc(${config.scale.label.medium.lineHeight} * 0.0625rem);\n --mdw-typescale__label-medium__font-size: calc(${config.scale.label.medium.fontSize} * 0.0625rem);\n --mdw-typescale__label-medium__letter-spacing: calc(${config.scale.label.medium.letterSpacing} * 0.0625rem);\n --mdw-typescale__label-medium__font-weight: ${config.scale.label.medium.weight};\n\n --mdw-typescale__label-small__font-family: ${config.scale.label.small.fontFamily};\n --mdw-typescale__label-small__line-height: calc(${config.scale.label.small.lineHeight} * 0.0625rem);\n --mdw-typescale__label-small__font-size: calc(${config.scale.label.small.fontSize} * 0.0625rem);\n --mdw-typescale__label-small__letter-spacing: calc(${config.scale.label.small.letterSpacing} * 0.0625rem);\n --mdw-typescale__label-small__font-weight: ${config.scale.label.small.weight};\n\n --mdw-typescale__body-large__font-family: ${config.scale.body.large.fontFamily};\n --mdw-typescale__body-large__line-height: calc(${config.scale.body.large.lineHeight} * 0.0625rem);\n --mdw-typescale__body-large__font-size: calc(${config.scale.body.large.fontSize} * 0.0625rem);\n --mdw-typescale__body-large__letter-spacing: calc(${config.scale.body.large.letterSpacing} * 0.0625rem);\n --mdw-typescale__body-large__font-weight: ${config.scale.body.large.weight};\n\n --mdw-typescale__body-medium__font-family: ${config.scale.body.medium.fontFamily};\n --mdw-typescale__body-medium__line-height: calc(${config.scale.body.medium.lineHeight} * 0.0625rem);\n --mdw-typescale__body-medium__font-size: calc(${config.scale.body.medium.fontSize} * 0.0625rem);\n --mdw-typescale__body-medium__letter-spacing: calc(${config.scale.body.medium.letterSpacing} * 0.0625rem);\n --mdw-typescale__body-medium__font-weight: ${config.scale.body.medium.weight};\n\n --mdw-typescale__body-small__font-family: ${config.scale.body.small.fontFamily};\n --mdw-typescale__body-small__line-height: calc(${config.scale.body.small.lineHeight} * 0.0625rem);\n --mdw-typescale__body-small__font-size: calc(${config.scale.body.small.fontSize} * 0.0625rem);\n --mdw-typescale__body-small__letter-spacing: calc(${config.scale.body.small.letterSpacing} * 0.0625rem);\n --mdw-typescale__body-small__font-weight: ${config.scale.body.small.weight};\n }`;\n}\n\n/** @return {string} */\nexport function generateTypographyGlobalCSS() {\n return /* css */ `\n :root {${['display', 'headline', 'title', 'label', 'body']\n .map((style) => ['large', 'medium', 'small']\n .map((size) => `--mdw-typescale__${style}-${size}__font: ${\n [\n `var(--mdw-typescale__${style}-${size}__font-weight)`,\n `var(--mdw-typescale__${style}-${size}__font-size)/var(--mdw-typescale__${style}-${size}__line-height)`,\n `var(--mdw-typescale__${style}-${size}__font-family)`,\n ].join(' ')\n };`).join('\\n'))\n .join('\\n')}}`;\n}\n\n/**\n * @param {typeof SHAPE_ROUNDED_DEFAULT} config\n * @return {string}\n */\nexport function generateShapeCSS(config = SHAPE_ROUNDED_DEFAULT) {\n return /* css */`\n :root {\n --mdw-shape__extra-small: ${config.size.extraSmall};\n --mdw-shape__small: ${config.size.small};\n --mdw-shape__medium: ${config.size.medium};\n --mdw-shape__large: ${config.size.large};\n --mdw-shape__extra-large: ${config.size.extraLarge};\n --mdw-shape__full: ${config.size.full};\n --mdw-shape__rounded: ${config.mask ? '0' : '1'};\n --mdw-shape__outline__background: ${config.mask ? 'currentColor' : 'transparent'};\n --mdw-shape__convex: ${config.convex ? '1' : '0'};\n --mdw-shape__mask-border-source: ${config.mask ? svgToCSSURL(getShapeMaskSVG(config.mask)) : 'none'};\n --mdw-shape__mask-image__top-left: ${config.mask ? svgToCSSURL(getShapeCornerSVGs(config.mask, 'top-left')) : 'none'};\n --mdw-shape__mask-image__top-right: ${config.mask ? svgToCSSURL(getShapeCornerSVGs(config.mask, 'top-right')) : 'none'};\n --mdw-shape__mask-image__bottom-right: ${config.mask ? svgToCSSURL(getShapeCornerSVGs(config.mask, 'bottom-right')) : 'none'};\n --mdw-shape__mask-image__bottom-left: ${config.mask ? svgToCSSURL(getShapeCornerSVGs(config.mask, 'bottom-left')) : 'none'};\n --mdw-shape__mask-image__edges: ${config.mask ? svgToCSSURL(getShapeEdgesSVGs()) : 'none'};\n }\n `;\n}\n\n/**\n * @param {string} content\n * @return {HTMLStyleElement } element\n */\nfunction addStyle(content) {\n const element = document.createElement('style');\n element.textContent = content;\n document.head.append(element);\n return element;\n}\n\n/**\n * @param {ThemeOptions} options\n * @return {string}\n */\nexport function generateColorCSS({ color = '#6750A4', custom = [], lightness = 'light' }) {\n /** @type {[string,string][]} */\n const parsedColors = [...custom]\n .map(([name, hex]) => [name, COLOR_KEYWORDS.get(hex) || hex || COLOR_KEYWORDS.get(name)]);\n const scheme = getScheme(color, parsedColors);\n if (lightness === 'dark') {\n return scheme.dark;\n }\n return scheme.light;\n}\n\n/**\n * @param {ThemeOptions} options\n * @return {void}\n */\nexport function setupTheme({ color = '#6750A4', custom = [], lightness = 'auto' }) {\n /** @type {[string,string][]} */\n const parsedColors = [...custom]\n .map(([name, hex]) => [name, COLOR_KEYWORDS.get(hex) || hex || COLOR_KEYWORDS.get(name)]);\n const scheme = getScheme(color, parsedColors);\n if (lightness === 'dark') {\n addStyle(scheme.dark);\n } else {\n addStyle(scheme.light);\n if (lightness !== 'light') {\n addStyle(scheme.dark).media = '(prefers-color-scheme:dark)';\n }\n }\n addStyle(generateShapeCSS());\n addStyle(generateTypographyCSS());\n}\n\n/**\n * @param {URLSearchParams} searchParams\n * @return {ThemeOptions}\n */\nexport function themeOptionsFromSearchParams(searchParams) {\n const color = searchParams.get('color') || '#6750A4';\n\n /** @type {[string,string?][]} */\n const custom = searchParams.getAll('custom')\n .flatMap((c) => c.split(','))\n .map((c) => c.split(':'));\n\n const lightness = searchParams.get('lightness') ?? 'auto';\n return { color, custom, lightness };\n}\n\n/**\n * @param {ThemeOptions} options\n * @return {string}\n */\nexport function generateThemeCSS({ color = '#6750A4', custom = [], lightness = 'auto' }) {\n const shapeCss = generateShapeCSS();\n const typographyCss = generateTypographyCSS();\n let colorCss;\n if (lightness === 'light' || lightness === 'dark') {\n colorCss = generateColorCSS({ color, custom, lightness });\n } else {\n colorCss = `\n ${generateColorCSS({ color, custom, lightness: 'light' })}\n @media (prefers-color-scheme:dark) {\n :root { color-scheme: dark; }\n ${generateColorCSS({ color, custom, lightness: 'dark' })}\n }`;\n }\n return [\n shapeCss,\n typographyCss,\n colorCss,\n ].join('\\n');\n}\n", "// https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color_keywords\nexport const COLOR_KEYWORDS = new Map([\n ['black', '#000000'],\n ['silver', '#c0c0c0'],\n ['gray', '#808080'],\n ['white', '#ffffff'],\n ['maroon', '#800000'],\n ['red', '#ff0000'],\n ['purple', '#800080'],\n ['fuchsia', '#ff00ff'],\n ['green', '#008000'],\n ['lime', '#00ff00'],\n ['olive', '#808000'],\n ['yellow', '#ffff00'],\n ['navy', '#000080'],\n ['blue', '#0000ff'],\n ['teal', '#008080'],\n ['aqua', '#00ffff'],\n ['orange', '#ffa500'],\n ['aliceblue', '#f0f8ff'],\n ['antiquewhite', '#faebd7'],\n ['aquamarine', '#7fffd4'],\n ['azure', '#f0ffff'],\n ['beige', '#f5f5dc'],\n ['bisque', '#ffe4c4'],\n ['blanchedalmond', '#ffebcd'],\n ['blueviolet', '#8a2be2'],\n ['brown', '#a52a2a'],\n ['burlywood', '#deb887'],\n ['cadetblue', '#5f9ea0'],\n ['chartreuse', '#7fff00'],\n ['chocolate', '#d2691e'],\n ['coral', '#ff7f50'],\n ['cornflowerblue', '#6495ed'],\n ['cornsilk', '#fff8dc'],\n ['crimson', '#dc143c'],\n ['cyan', '00ffff'],\n ['darkblue', '#00008b'],\n ['darkcyan', '#008b8b'],\n ['darkgoldenrod', '#b8860b'],\n ['darkgray', '#a9a9a9'],\n ['darkgreen', '#006400'],\n ['darkgrey', '#a9a9a9'],\n ['darkkhaki', '#bdb76b'],\n ['darkmagenta', '#8b008b'],\n ['darkolivegreen', '#556b2f'],\n ['darkorange', '#ff8c00'],\n ['darkorchid', '#9932cc'],\n ['darkred', '#8b0000'],\n ['darksalmon', '#e9967a'],\n ['darkseagreen', '#8fbc8f'],\n ['darkslateblue', '#483d8b'],\n ['darkslategray', '#2f4f4f'],\n ['darkslategrey', '#2f4f4f'],\n ['darkturquoise', '#00ced1'],\n ['darkviolet', '#9400d3'],\n ['deeppink', '#ff1493'],\n ['deepskyblue', '#00bfff'],\n ['dimgray', '#696969'],\n ['dimgrey', '#696969'],\n ['dodgerblue', '#1e90ff'],\n ['firebrick', '#b22222'],\n ['floralwhite', '#fffaf0'],\n ['forestgreen', '#228b22'],\n ['gainsboro', '#dcdcdc'],\n ['ghostwhite', '#f8f8ff'],\n ['gold', '#ffd700'],\n ['goldenrod', '#daa520'],\n ['greenyellow', '#adff2f'],\n ['grey', '#808080'],\n ['honeydew', '#f0fff0'],\n ['hotpink', '#ff69b4'],\n ['indianred', '#cd5c5c'],\n ['indigo', '#4b0082'],\n ['ivory', '#fffff0'],\n ['khaki', '#f0e68c'],\n ['lavender', '#e6e6fa'],\n ['lavenderblush', '#fff0f5'],\n ['lawngreen', '#7cfc00'],\n ['lemonchiffon', '#fffacd'],\n ['lightblue', '#add8e6'],\n ['lightcoral', '#f08080'],\n ['lightcyan', '#e0ffff'],\n ['lightgoldenrodyellow', '#fafad2'],\n ['lightgray', '#d3d3d3'],\n ['lightgreen', '#90ee90'],\n ['lightgrey', '#d3d3d3'],\n ['lightpink', '#ffb6c1'],\n ['lightsalmon', '#ffa07a'],\n ['lightseagreen', '#20b2aa'],\n ['lightskyblue', '#87cefa'],\n ['lightslategray', '#778899'],\n ['lightslategrey', '#778899'],\n ['lightsteelblue', '#b0c4de'],\n ['lightyellow', '#ffffe0'],\n ['limegreen', '#32cd32'],\n ['linen', '#faf0e6'],\n ['magenta', '#ff00ff'],\n ['mediumaquamarine', '#66cdaa'],\n ['mediumblue', '#0000cd'],\n ['mediumorchid', '#ba55d3'],\n ['mediumpurple', '#9370db'],\n ['mediumseagreen', '#3cb371'],\n ['mediumslateblue', '#7b68ee'],\n ['mediumspringgreen', '#00fa9a'],\n ['mediumturquoise', '#48d1cc'],\n ['mediumvioletred', '#c71585'],\n ['midnightblue', '#191970'],\n ['mintcream', '#f5fffa'],\n ['mistyrose', '#ffe4e1'],\n ['moccasin', '#ffe4b5'],\n ['navajowhite', '#ffdead'],\n ['oldlace', '#fdf5e6'],\n ['olivedrab', '#6b8e23'],\n ['orangered', '#ff4500'],\n ['orchid', '#da70d6'],\n ['palegoldenrod', '#eee8aa'],\n ['palegreen', '#98fb98'],\n ['paleturquoise', '#afeeee'],\n ['palevioletred', '#db7093'],\n ['papayawhip', '#ffefd5'],\n ['peachpuff', '#ffdab9'],\n ['peru', '#cd853f'],\n ['pink', '#ffc0cb'],\n ['plum', '#dda0dd'],\n ['powderblue', '#b0e0e6'],\n ['rosybrown', '#bc8f8f'],\n ['royalblue', '#4169e1'],\n ['saddlebrown', '#8b4513'],\n ['salmon', '#fa8072'],\n ['sandybrown', '#f4a460'],\n ['seagreen', '#2e8b57'],\n ['seashell', '#fff5ee'],\n ['sienna', '#a0522d'],\n ['skyblue', '#87ceeb'],\n ['slateblue', '#6a5acd'],\n ['slategray', '#708090'],\n ['slategrey', '#708090'],\n ['snow', '#fffafa'],\n ['springgreen', '#00ff7f'],\n ['steelblue', '#4682b4'],\n ['tan', '#d2b48c'],\n ['thistle', '#d8bfd8'],\n ['tomato', '#ff6347'],\n ['turquoise', '#40e0d0'],\n ['violet', '#ee82ee'],\n ['wheat', '#f5deb3'],\n ['whitesmoke', '#f5f5f5'],\n ['yellowgreen', '#9acd32'],\n ['rebeccapurple', '#663399'],\n]);\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// This file is automatically generated. Do not modify it.\n\n/**\n * Utility methods for mathematical operations.\n */\n\n/**\n * The signum function.\n * @param {number} num\n * @return {1|-1|0} 1 if num > 0, -1 if num < 0, and 0 if num = 0\n */\nexport function signum(num) {\n if (num < 0) {\n return -1;\n }\n if (num === 0) {\n return 0;\n }\n return 1;\n}\n\n/**\n * The linear interpolation function.\n * @param {number} start\n * @param {number} stop\n * @param {number} amount\n * @return {number} start if amount = 0 and stop if amount = 1\n */\nexport function lerp(start, stop, amount) {\n return (1 - amount) * start + amount * stop;\n}\n\n/**\n * Clamps an integer between two integers.\n * @param {number} min\n * @param {number} max\n * @param {number} input\n * @return {number} input when min <= input <= max, and either min or max\n * otherwise.\n */\nexport function clampInt(min, max, input) {\n if (input < min) {\n return min;\n } if (input > max) {\n return max;\n }\n\n return input;\n}\n\n/**\n * Clamps an integer between two floating-point numbers.\n * @param {number} min\n * @param {number} max\n * @param {number} input\n * @return {number} input when min <= input <= max, and either min or max\n * otherwise.\n */\nexport function clampDouble(min, max, input) {\n if (input < min) {\n return min;\n } if (input > max) {\n return max;\n }\n\n return input;\n}\n\n/**\n * Sanitizes a degree measure as an integer.\n * @param {number} degrees\n * @return {number} a degree measure between 0 (inclusive) and 360\n * (exclusive).\n */\nexport function sanitizeDegreesInt(degrees) {\n degrees %= 360;\n if (degrees < 0) {\n degrees += 360;\n }\n return degrees;\n}\n\n/**\n * Sanitizes a degree measure as a floating-point number.\n * @param {number} degrees\n * @return {number} a degree measure between 0.0 (inclusive) and 360.0\n * (exclusive).\n */\nexport function sanitizeDegreesDouble(degrees) {\n degrees %= 360;\n if (degrees < 0) {\n degrees += 360;\n }\n return degrees;\n}\n\n/**\n * Sign of direction change needed to travel from one angle to\n * another.\n *\n * For angles that are 180 degrees apart from each other, both\n * directions have the same travel distance, so either direction is\n * shortest. The value 1.0 is returned in this case.\n * @param {number} from The angle travel starts from, in degrees.\n * @param {number} to The angle travel ends at, in degrees.\n * @return {number} -1 if decreasing from leads to the shortest travel\n * distance, 1 if increasing from leads to the shortest travel\n * distance.\n */\nexport function rotationDirection(from, to) {\n const increasingDifference = sanitizeDegreesDouble(to - from);\n return increasingDifference <= 180 ? 1 : -1;\n}\n\n/**\n * Distance of two points on a circle, represented using degrees.\n * @param {number} a\n * @param {number} b\n * @return {number}\n */\nexport function differenceDegrees(a, b) {\n return 180 - Math.abs(Math.abs(a - b) - 180);\n}\n\n/**\n * Multiplies a 1x3 row vector with a 3x3 matrix.\n * @param {number[]} row\n * @param {number[][]} matrix\n * @return {number[]}\n */\nexport function matrixMultiply(row, matrix) {\n const a = row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2];\n const b = row[0] * matrix[1][0] + row[1] * matrix[1][1] + row[2] * matrix[1][2];\n const c = row[0] * matrix[2][0] + row[1] * matrix[2][1] + row[2] * matrix[2][2];\n return [a, b, c];\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// This file is automatically generated. Do not modify it.\n\nimport * as mathUtils from './mathUtils.js';\n\n/**\n * Color science utilities.\n *\n * Utility methods for color science constants and color space\n * conversions that aren't HCT or CAM16.\n */\n\nconst SRGB_TO_XYZ = [\n [0.412_338_95, 0.357_620_64, 0.180_510_42],\n [0.2126, 0.7152, 0.0722],\n [0.019_321_41, 0.119_163_82, 0.950_344_78],\n];\n\nconst XYZ_TO_SRGB = [\n [\n 3.241_377_479_238_868_5,\n -1.537_665_240_285_185_1,\n -0.498_853_668_462_680_53,\n ],\n [\n -0.969_145_251_300_532_1,\n 1.875_885_345_106_787_2,\n 0.041_565_856_169_120_61,\n ],\n [\n 0.055_620_936_896_913_05,\n -0.203_955_245_647_421_23,\n 1.057_179_911_122_033_5,\n ],\n];\n\nconst WHITE_POINT_D65 = [95.047, 100, 108.883];\n\n/**\n * Converts a color from RGB components to ARGB format.\n * @param {number} red\n * @param {number} green\n * @param {number} blue\n * @return {number}\n */\nexport function argbFromRgb(red, green, blue) {\n return (255 << 24 | (red & 255) << 16 | (green & 255) << 8 | blue & 255)\n >>> 0;\n}\n\n/**\n * Converts a color from linear RGB components to ARGB format.\n * @param {number[]} linrgb\n * @return {number}\n */\nexport function argbFromLinrgb(linrgb) {\n const r = delinearized(linrgb[0]);\n const g = delinearized(linrgb[1]);\n const b = delinearized(linrgb[2]);\n return argbFromRgb(r, g, b);\n}\n\n/**\n * Returns the alpha component of a color in ARGB format.\n * @param {number} argb\n * @return {number}\n */\nexport function alphaFromArgb(argb) {\n return argb >> 24 & 255;\n}\n\n/**\n * Returns the red component of a color in ARGB format.\n * @param {number} argb\n * @return {number}\n */\nexport function redFromArgb(argb) {\n return argb >> 16 & 255;\n}\n\n/**\n * Returns the green component of a color in ARGB format.\n * @param {number} argb\n * @return {number}\n */\nexport function greenFromArgb(argb) {\n return argb >> 8 & 255;\n}\n\n/**\n * Returns the blue component of a color in ARGB format.\n * @param {number} argb\n * @return {number}\n */\nexport function blueFromArgb(argb) {\n return argb & 255;\n}\n\n/**\n * Returns whether a color in ARGB format is opaque.\n * @param {number} argb\n * @return {boolean}\n */\nexport function isOpaque(argb) {\n return alphaFromArgb(argb) >= 255;\n}\n\n/**\n * Converts a color from ARGB to XYZ.\n * @param {number} x\n * @param {number} y\n * @param {number} z\n * @return {number}\n */\nexport function argbFromXyz(x, y, z) {\n const matrix = XYZ_TO_SRGB;\n const linearR = matrix[0][0] * x + matrix[0][1] * y + matrix[0][2] * z;\n const linearG = matrix[1][0] * x + matrix[1][1] * y + matrix[1][2] * z;\n const linearB = matrix[2][0] * x + matrix[2][1] * y + matrix[2][2] * z;\n const r = delinearized(linearR);\n const g = delinearized(linearG);\n const b = delinearized(linearB);\n return argbFromRgb(r, g, b);\n}\n\n/**\n * Converts a color from XYZ to ARGB.\n * @param {number} argb\n * @return {number[]}\n */\nexport function xyzFromArgb(argb) {\n const r = linearized(redFromArgb(argb));\n const g = linearized(greenFromArgb(argb));\n const b = linearized(blueFromArgb(argb));\n return mathUtils.matrixMultiply([r, g, b], SRGB_TO_XYZ);\n}\n\n/**\n * Converts a color represented in Lab color space into an ARGB\n * integer.\n * @param {number} l\n * @param {number} a\n * @param {number} b\n * @return {number}\n */\nexport function argbFromLab(l, a, b) {\n const whitePoint = WHITE_POINT_D65;\n const fy = (l + 16) / 116;\n const fx = a / 500 + fy;\n const fz = fy - b / 200;\n const xNormalized = labInvf(fx);\n const yNormalized = labInvf(fy);\n const zNormalized = labInvf(fz);\n const x = xNormalized * whitePoint[0];\n const y = yNormalized * whitePoint[1];\n const z = zNormalized * whitePoint[2];\n return argbFromXyz(x, y, z);\n}\n\n/**\n * Converts a color from ARGB representation to L*a*b*\n * representation.\n * @param {number} argb the ARGB representation of a color\n * @return {number[]} a Lab object representing the color\n */\nexport function labFromArgb(argb) {\n const linearR = linearized(redFromArgb(argb));\n const linearG = linearized(greenFromArgb(argb));\n const linearB = linearized(blueFromArgb(argb));\n const matrix = SRGB_TO_XYZ;\n const x = matrix[0][0] * linearR + matrix[0][1] * linearG + matrix[0][2] * linearB;\n const y = matrix[1][0] * linearR + matrix[1][1] * linearG + matrix[1][2] * linearB;\n const z = matrix[2][0] * linearR + matrix[2][1] * linearG + matrix[2][2] * linearB;\n const whitePoint = WHITE_POINT_D65;\n const xNormalized = x / whitePoint[0];\n const yNormalized = y / whitePoint[1];\n const zNormalized = z / whitePoint[2];\n const fx = labF(xNormalized);\n const fy = labF(yNormalized);\n const fz = labF(zNormalized);\n const l = 116 * fy - 16;\n const a = 500 * (fx - fy);\n const b = 200 * (fy - fz);\n return [l, a, b];\n}\n\n/**\n * Converts an L* value to an ARGB representation.\n * @param {number} lstar L* in L*a*b*\n * @return {number} ARGB representation of grayscale color with lightness\n * matching L*\n */\nexport function argbFromLstar(lstar) {\n const y = yFromLstar(lstar);\n const component = delinearized(y);\n return argbFromRgb(component, component, component);\n}\n\n/**\n * Computes the L* value of a color in ARGB representation.\n * @param {number} argb ARGB representation of a color\n * @return {number} L*, from L*a*b*, coordinate of the color\n */\nexport function lstarFromArgb(argb) {\n const y = xyzFromArgb(argb)[1];\n return 116 * labF(y / 100) - 16;\n}\n\n/**\n * Converts an L* value to a Y value.\n *\n * L* in L*a*b* and Y in XYZ measure the same quantity, luminance.\n *\n * L* measures perceptual luminance, a linear scale. Y in XYZ\n * measures relative luminance, a logarithmic scale.\n * @param {number} lstar L* in L*a*b*\n * @return {number} Y in XYZ\n */\nexport function yFromLstar(lstar) {\n return 100 * labInvf((lstar + 16) / 116);\n}\n\n/**\n * Linearizes an RGB component.\n * @param {number} rgbComponent 0 <= rgb_component <= 255, represents R/G/B\n * channel\n * @return {number} 0.0 <= output <= 100.0, color channel converted to\n * linear RGB space\n */\nexport function linearized(rgbComponent) {\n const normalized = rgbComponent / 255;\n if (normalized <= 0.040_449_936) {\n return (normalized / 12.92) * 100;\n }\n return ((normalized + 0.055) / 1.055) ** 2.4 * 100;\n}\n\n/**\n * Delinearizes an RGB component.\n * @param {number} rgbComponent 0.0 <= rgb_component <= 100.0, represents\n * linear R/G/B channel\n * @return {number} 0 <= output <= 255, color channel converted to regular\n * RGB space\n */\nexport function delinearized(rgbComponent) {\n const normalized = rgbComponent / 100;\n let delinearized = 0;\n delinearized = normalized <= 0.003_130_8 ? normalized * 12.92 : 1.055 * normalized ** (1 / 2.4) - 0.055;\n return mathUtils.clampInt(0, 255, Math.round(delinearized * 255));\n}\n\n/**\n * Returns the standard white point; white on a sunny day.\n * @return {number[]} The white point\n */\nexport function whitePointD65() {\n return WHITE_POINT_D65;\n}\n\n/**\n * @param {number} t\n * @return {number}\n */\nfunction labF(t) {\n const e = 216 / 24_389;\n const kappa = 24_389 / 27;\n if (t > e) {\n return t ** (1 / 3);\n }\n return (kappa * t + 16) / 116;\n}\n\n/**\n *\n * @param {number} ft\n * @return {number}\n */\nfunction labInvf(ft) {\n const e = 216 / 24_389;\n const kappa = 24_389 / 27;\n const ft3 = ft * ft * ft;\n if (ft3 > e) {\n return ft3;\n }\n return (116 * ft - 16) / kappa;\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as utils from './colorUtils.js';\nimport * as math from './mathUtils.js';\n\n/**\n * In traditional color spaces, a color can be identified solely by the\n * observer's measurement of the color. Color appearance models such as CAM16\n * also use information about the environment where the color was\n * observed, known as the viewing conditions.\n *\n * For example, white under the traditional assumption of a midday sun white\n * point is accurately measured as a slightly chromatic blue by CAM16. (roughly,\n * hue 203, chroma 3, lightness 100)\n *\n * This class caches intermediate values of the CAM16 conversion process that\n * depend only on viewing conditions, enabling speed ups.\n */\nexport default class ViewingConditions {\n /** sRGB-like viewing conditions. */\n static DEFAULT = ViewingConditions.make();\n\n /**\n * Create ViewingConditions from a simple, physically relevant, set of\n * parameters.\n * @param whitePoint White point, measured in the XYZ color space.\n * default = D65, or sunny day afternoon\n * @param {number} adaptingLuminance The luminance of the adapting field. Informally,\n * how bright it is in the room where the color is viewed. Can be\n * calculated from lux by multiplying lux by 0.0586. default = 11.72,\n * or 200 lux.\n * @param {number} backgroundLstar The lightness of the area surrounding the color.\n * measured by L* in L*a*b*. default = 50.0\n * @param {number} surround A general description of the lighting surrounding the\n * color. 0 is pitch dark, like watching a movie in a theater. 1.0 is a\n * dimly light room, like watching TV at home at night. 2.0 means there\n * is no difference between the lighting on the color and around it.\n * default = 2.0\n * @param {boolean} discountingIlluminant Whether the eye accounts for the tint of the\n * ambient lighting, such as knowing an apple is still red in green light.\n * default = false, the eye does not perform this process on\n * self-luminous objects like displays.\n * @return {ViewingConditions}\n */\n static make(\n whitePoint = utils.whitePointD65(),\n adaptingLuminance = ((200 / Math.PI) * utils.yFromLstar(50)) / 100,\n backgroundLstar = 50,\n surround = 2,\n discountingIlluminant = false,\n ) {\n const xyz = whitePoint;\n const rW = xyz[0] * 0.401_288 + xyz[1] * 0.650_173 + xyz[2] * -0.051_461;\n const gW = xyz[0] * -0.250_268 + xyz[1] * 1.204_414 + xyz[2] * 0.045_854;\n const bW = xyz[0] * -0.002_079 + xyz[1] * 0.048_952 + xyz[2] * 0.953_127;\n const f = 0.8 + surround / 10;\n const c = f >= 0.9 ? math.lerp(0.59, 0.69, (f - 0.9) * 10)\n : math.lerp(0.525, 0.59, (f - 0.8) * 10);\n let d = discountingIlluminant\n ? 1\n : f * (1 - (1 / 3.6) * Math.exp((-adaptingLuminance - 42) / 92));\n d = d > 1 ? 1 : (d < 0 ? 0 : d);\n const nc = f;\n const rgbD = [\n d * (100 / rW) + 1 - d,\n d * (100 / gW) + 1 - d,\n d * (100 / bW) + 1 - d,\n ];\n const k = 1 / (5 * adaptingLuminance + 1);\n const k4 = k * k * k * k;\n const k4F = 1 - k4;\n const fl = k4 * adaptingLuminance\n + 0.1 * k4F * k4F * Math.cbrt(5 * adaptingLuminance);\n const n = utils.yFromLstar(backgroundLstar) / whitePoint[1];\n const z = 1.48 + Math.sqrt(n);\n const nbb = 0.725 / n ** 0.2;\n const ncb = nbb;\n const rgbAFactors = [\n ((fl * rgbD[0] * rW) / 100) ** 0.42,\n ((fl * rgbD[1] * gW) / 100) ** 0.42,\n ((fl * rgbD[2] * bW) / 100) ** 0.42,\n ];\n const rgbA = [\n (400 * rgbAFactors[0]) / (rgbAFactors[0] + 27.13),\n (400 * rgbAFactors[1]) / (rgbAFactors[1] + 27.13),\n (400 * rgbAFactors[2]) / (rgbAFactors[2] + 27.13),\n ];\n const aw = (2 * rgbA[0] + rgbA[1] + 0.05 * rgbA[2]) * nbb;\n return new ViewingConditions(n, aw, nbb, ncb, c, nc, rgbD, fl, fl ** 0.25, z);\n }\n\n /**\n * Parameters are intermediate values of the CAM16 conversion process. Their\n * names are shorthand for technical color science terminology, this class\n * would not benefit from documenting them individually. A brief overview\n * is available in the CAM16 specification, and a complete overview requires\n * a color science textbook, such as Fairchild's Color Appearance Models.\n * @param {number} n\n * @param {number} aw\n * @param {number} nbb\n * @param {number} ncb\n * @param {number} c\n * @param {number} nc\n * @param {number[]} rgbD\n * @param {number} fl\n * @param {number} fLRoot\n * @param {number} z\n */\n constructor(n, aw, nbb, ncb, c, nc, rgbD, fl, fLRoot, z) {\n this.n = n;\n this.aw = aw;\n this.nbb = nbb;\n this.ncb = ncb;\n this.c = c;\n this.nc = nc;\n this.rgbD = rgbD;\n this.fl = fl;\n this.fLRoot = fLRoot;\n this.z = z;\n }\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport ViewingConditions from './ViewingConditions.js';\nimport * as utils from './colorUtils.js';\nimport * as math from './mathUtils.js';\n\n/**\n * CAM16, a color appearance model. Colors are not just defined by their hex\n * code, but rather, a hex code and viewing conditions.\n *\n * CAM16 instances also have coordinates in the CAM16-UCS space, called J*, a*,\n * b*, or jstar, astar, bstar in code. CAM16-UCS is included in the CAM16\n * specification, and should be used when measuring distances between colors.\n *\n * In traditional color spaces, a color can be identified solely by the\n * observer's measurement of the color. Color appearance models such as CAM16\n * also use information about the environment where the color was\n * observed, known as the viewing conditions.\n *\n * For example, white under the traditional assumption of a midday sun white\n * point is accurately measured as a slightly chromatic blue by CAM16. (roughly,\n * hue 203, chroma 3, lightness 100)\n */\nexport default class Cam16 {\n /**\n * All of the CAM16 dimensions can be calculated from 3 of the dimensions, in\n * the following combinations:\n * - {j or q} and {c, m, or s} and hue\n * - jstar, astar, bstar\n * Prefer using a static method that constructs from 3 of those dimensions.\n * This constructor is intended for those methods to use to return all\n * possible dimensions.\n * @param {number} hue\n * @param {number} chroma informally, colorfulness / color intensity. like saturation\n * in HSL, except perceptually accurate.\n * @param {number} j lightness\n * @param {number} q brightness; ratio of lightness to white point's lightness\n * @param {number} m colorfulness\n * @param {number} s saturation; ratio of chroma to white point's chroma\n * @param {number} jstar CAM16-UCS J coordinate\n * @param {number} astar CAM16-UCS a coordinate\n * @param {number} bstar CAM16-UCS b coordinate\n */\n constructor(hue, chroma, j, q, m, s, jstar, astar, bstar) {\n /** @readonly */\n this.hue = hue;\n /** @readonly */\n this.chroma = chroma;\n /** @readonly */\n this.j = j;\n /** @readonly */\n this.q = q;\n /** @readonly */\n this.m = m;\n /** @readonly */\n this.s = s;\n /** @readonly */\n this.jstar = jstar;\n /** @readonly */\n this.astar = astar;\n /** @readonly */\n this.bstar = bstar;\n }\n\n /**\n * CAM16 instances also have coordinates in the CAM16-UCS space, called J*,\n * a*, b*, or jstar, astar, bstar in code. CAM16-UCS is included in the CAM16\n * specification, and is used to measure distances between colors.\n * @param {Cam16} other\n * @return {number}\n */\n distance(other) {\n const dJ = this.jstar - other.jstar;\n const dA = this.astar - other.astar;\n const dB = this.bstar - other.bstar;\n const dEPrime = Math.sqrt(dJ * dJ + dA * dA + dB * dB);\n const dE = 1.41 * dEPrime ** 0.63;\n return dE;\n }\n\n /**\n * @param {number} argb ARGB representation of a color.\n * @return {Cam16} CAM16 color, assuming the color was viewed in default viewing\n * conditions.\n */\n static fromInt(argb) {\n return Cam16.fromIntInViewingConditions(argb, ViewingConditions.DEFAULT);\n }\n\n /**\n * @param {number} argb ARGB representation of a color.\n * @param {ViewingConditions} viewingConditions Information about the environment where the color\n * was observed.\n * @return {Cam16} CAM16 color.\n */\n static fromIntInViewingConditions(argb, viewingConditions) {\n const red = (argb & 0x00_FF_00_00) >> 16;\n const green = (argb & 0x00_00_FF_00) >> 8;\n const blue = (argb & 0x00_00_00_FF);\n const redL = utils.linearized(red);\n const greenL = utils.linearized(green);\n const blueL = utils.linearized(blue);\n const x = 0.412_338_95 * redL + 0.357_620_64 * greenL + 0.180_510_42 * blueL;\n const y = 0.2126 * redL + 0.7152 * greenL + 0.0722 * blueL;\n const z = 0.019_321_41 * redL + 0.119_163_82 * greenL + 0.950_344_78 * blueL;\n\n const rC = 0.401_288 * x + 0.650_173 * y - 0.051_461 * z;\n const gC = -0.250_268 * x + 1.204_414 * y + 0.045_854 * z;\n const bC = -0.002_079 * x + 0.048_952 * y + 0.953_127 * z;\n\n const rD = viewingConditions.rgbD[0] * rC;\n const gD = viewingConditions.rgbD[1] * gC;\n const bD = viewingConditions.rgbD[2] * bC;\n\n const rAF = ((viewingConditions.fl * Math.abs(rD)) / 100) ** 0.42;\n const gAF = ((viewingConditions.fl * Math.abs(gD)) / 100) ** 0.42;\n const bAF = ((viewingConditions.fl * Math.abs(bD)) / 100) ** 0.42;\n\n const rA = (math.signum(rD) * 400 * rAF) / (rAF + 27.13);\n const gA = (math.signum(gD) * 400 * gAF) / (gAF + 27.13);\n const bA = (math.signum(bD) * 400 * bAF) / (bAF + 27.13);\n\n const a = (11 * rA + -12 * gA + bA) / 11;\n const b = (rA + gA - 2 * bA) / 9;\n const u = (20 * rA + 20 * gA + 21 * bA) / 20;\n const p2 = (40 * rA + 20 * gA + bA) / 20;\n const atan2 = Math.atan2(b, a);\n const atanDegrees = (atan2 * 180) / Math.PI;\n const hue = atanDegrees < 0 ? atanDegrees + 360\n : (atanDegrees >= 360 ? atanDegrees - 360\n : atanDegrees);\n const hueRadians = (hue * Math.PI) / 180;\n\n const ac = p2 * viewingConditions.nbb;\n const j = 100\n * (ac / viewingConditions.aw) ** (viewingConditions.c * viewingConditions.z);\n const q = (4 / viewingConditions.c) * Math.sqrt(j / 100)\n * (viewingConditions.aw + 4) * viewingConditions.fLRoot;\n const huePrime = hue < 20.14 ? hue + 360 : hue;\n const eHue = 0.25 * (Math.cos((huePrime * Math.PI) / 180 + 2) + 3.8);\n const p1 = (50_000 / 13) * eHue * viewingConditions.nc * viewingConditions.ncb;\n const t = (p1 * Math.sqrt(a * a + b * b)) / (u + 0.305);\n const alpha = t ** 0.9\n * (1.64 - 0.29 ** viewingConditions.n) ** 0.73;\n const c = alpha * Math.sqrt(j / 100);\n const m = c * viewingConditions.fLRoot;\n const s = 50\n * Math.sqrt((alpha * viewingConditions.c) / (viewingConditions.aw + 4));\n const jstar = ((1 + 100 * 0.007) * j) / (1 + 0.007 * j);\n const mstar = (1 / 0.0228) * Math.log(1 + 0.0228 * m);\n const astar = mstar * Math.cos(hueRadians);\n const bstar = mstar * Math.sin(hueRadians);\n\n return new Cam16(hue, c, j, q, m, s, jstar, astar, bstar);\n }\n\n /**\n * @param {number} j CAM16 lightness\n * @param {number} c CAM16 chroma\n * @param {number} h CAM16 hue\n * @return {Cam16}\n */\n static fromJch(j, c, h) {\n return Cam16.fromJchInViewingConditions(j, c, h, ViewingConditions.DEFAULT);\n }\n\n /**\n * @param {number} j CAM16 lightness\n * @param {number} c CAM16 chroma\n * @param {number} h CAM16 hue\n * @param {ViewingConditions} viewingConditions Information about the environment where the color\n * was observed.\n */\n static fromJchInViewingConditions(j, c, h, viewingConditions) {\n const q = (4 / viewingConditions.c) * Math.sqrt(j / 100)\n * (viewingConditions.aw + 4) * viewingConditions.fLRoot;\n const m = c * viewingConditions.fLRoot;\n const alpha = c / Math.sqrt(j / 100);\n const s = 50\n * Math.sqrt((alpha * viewingConditions.c) / (viewingConditions.aw + 4));\n const hueRadians = (h * Math.PI) / 180;\n const jstar = ((1 + 100 * 0.007) * j) / (1 + 0.007 * j);\n const mstar = (1 / 0.0228) * Math.log(1 + 0.0228 * m);\n const astar = mstar * Math.cos(hueRadians);\n const bstar = mstar * Math.sin(hueRadians);\n return new Cam16(h, c, j, q, m, s, jstar, astar, bstar);\n }\n\n /**\n * @param {number} jstar CAM16-UCS lightness.\n * @param {number} astar CAM16-UCS a dimension. Like a* in L*a*b*, it is a Cartesian\n * coordinate on the Y axis.\n * @param {number} bstar CAM16-UCS b dimension. Like a* in L*a*b*, it is a Cartesian\n * coordinate on the X axis.\n * @return {Cam16}\n */\n static fromUcs(jstar, astar, bstar) {\n return Cam16.fromUcsInViewingConditions(jstar, astar, bstar, ViewingConditions.DEFAULT);\n }\n\n /**\n * @param {number} jstar CAM16-UCS lightness.\n * @param {number} astar CAM16-UCS a dimension. Like a* in L*a*b*, it is a Cartesian\n * coordinate on the Y axis.\n * @param {number} bstar CAM16-UCS b dimension. Like a* in L*a*b*, it is a Cartesian\n * coordinate on the X axis.\n * @param {ViewingConditions} viewingConditions Information about the environment where the color\n * was observed.\n */\n static fromUcsInViewingConditions(jstar, astar, bstar, viewingConditions) {\n const a = astar;\n const b = bstar;\n const m = Math.sqrt(a * a + b * b);\n const M = (Math.exp(m * 0.0228) - 1) / 0.0228;\n const c = M / viewingConditions.fLRoot;\n let h = Math.atan2(b, a) * (180 / Math.PI);\n if (h < 0) {\n h += 360;\n }\n const j = jstar / (1 - (jstar - 100) * 0.007);\n return Cam16.fromJchInViewingConditions(j, c, h, viewingConditions);\n }\n\n /**\n * @return {number} ARGB representation of color, assuming the color was viewed in\n * default viewing conditions, which are near-identical to the default\n * viewing conditions for sRGB.\n */\n toInt() {\n return this.viewed(ViewingConditions.DEFAULT);\n }\n\n /**\n * @param {ViewingConditions} viewingConditions Information about the environment where the color\n * will be viewed.\n * @return {number} ARGB representation of color\n */\n viewed(viewingConditions) {\n const alpha = this.chroma === 0 || this.j === 0\n ? 0\n : this.chroma / Math.sqrt(this.j / 100);\n\n const t = (alpha / (1.64 - 0.29 ** viewingConditions.n) ** 0.73) ** (1 / 0.9);\n const hRad = (this.hue * Math.PI) / 180;\n\n const eHue = 0.25 * (Math.cos(hRad + 2) + 3.8);\n const ac = viewingConditions.aw\n * (this.j / 100) ** (1 / viewingConditions.c / viewingConditions.z);\n const p1 = eHue * (50_000 / 13) * viewingConditions.nc * viewingConditions.ncb;\n const p2 = ac / viewingConditions.nbb;\n\n const hSin = Math.sin(hRad);\n const hCos = Math.cos(hRad);\n\n const gamma = (23 * (p2 + 0.305) * t)\n / (23 * p1 + 11 * t * hCos + 108 * t * hSin);\n const a = gamma * hCos;\n const b = gamma * hSin;\n const rA = (460 * p2 + 451 * a + 288 * b) / 1403;\n const gA = (460 * p2 - 891 * a - 261 * b) / 1403;\n const bA = (460 * p2 - 220 * a - 6300 * b) / 1403;\n\n const rCBase = Math.max(0, (27.13 * Math.abs(rA)) / (400 - Math.abs(rA)));\n const rC = math.signum(rA) * (100 / viewingConditions.fl)\n * rCBase ** (1 / 0.42);\n const gCBase = Math.max(0, (27.13 * Math.abs(gA)) / (400 - Math.abs(gA)));\n const gC = math.signum(gA) * (100 / viewingConditions.fl)\n * gCBase ** (1 / 0.42);\n const bCBase = Math.max(0, (27.13 * Math.abs(bA)) / (400 - Math.abs(bA)));\n const bC = math.signum(bA) * (100 / viewingConditions.fl)\n * bCBase ** (1 / 0.42);\n const rF = rC / viewingConditions.rgbD[0];\n const gF = gC / viewingConditions.rgbD[1];\n const bF = bC / viewingConditions.rgbD[2];\n\n const x = 1.862_067_86 * rF - 1.011_254_63 * gF + 0.149_186_77 * bF;\n const y = 0.387_526_54 * rF + 0.621_447_44 * gF - 0.008_973_98 * bF;\n const z = -0.015_841_5 * rF - 0.034_122_94 * gF + 1.049_964_44 * bF;\n\n const argb = utils.argbFromXyz(x, y, z);\n return argb;\n }\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Cam16 from './Cam16.js';\nimport ViewingConditions from './ViewingConditions.js';\nimport * as colorUtils from './colorUtils.js';\nimport * as mathUtils from './mathUtils.js';\n\n/**\n * A class that solves the HCT equation.\n */\n// libmonet is designed to have a consistent API across platforms\n// and modular components that can be moved around easily. Using a class as a\n// namespace facilitates this.\n//\n// tslint:disable-next-line:class-as-namespace\n\nexport const SCALED_DISCOUNT_FROM_LINRGB = [\n [\n 0.001_200_833_568_784_504,\n 0.002_389_694_492_170_889,\n 0.000_279_574_288_586_112_4,\n ],\n [\n 0.000_589_108_665_137_599_9,\n 0.002_978_550_257_343_875_8,\n 0.000_327_066_610_400_839_8,\n ],\n [\n 0.000_101_466_924_916_405_72,\n 0.000_536_421_435_918_669_4,\n 0.003_297_940_177_071_207_6,\n ],\n];\n\nexport const LINRGB_FROM_SCALED_DISCOUNT = [\n [\n 1373.219_870_959_423_1,\n -1100.425_119_075_482_1,\n -7.278_681_089_101_213,\n ],\n [\n -271.815_969_077_903,\n 559.658_046_594_073_3,\n -32.460_474_827_911_94,\n ],\n [\n 1.962_289_959_966_566_6,\n -57.173_814_538_844_006,\n 308.723_319_781_238_5,\n ],\n];\n\nexport const Y_FROM_LINRGB = [0.2126, 0.7152, 0.0722];\n\nexport const CRITICAL_PLANES = [\n 0.015_176_349_177_441_876, 0.045_529_047_532_325_624, 0.075_881_745_887_209_38,\n 0.106_234_444_242_093_13, 0.136_587_142_596_976_85, 0.166_939_840_951_860_62,\n 0.197_292_539_306_744_34, 0.227_645_237_661_628_1, 0.257_997_936_016_511_9,\n 0.288_350_634_371_395_63, 0.318_830_090_443_053_2, 0.350_925_934_958_123,\n 0.384_831_493_309_642_6, 0.420_574_803_010_494_66, 0.458_183_274_052_838,\n 0.497_683_725_027_402_3, 0.539_102_415_980_638_1, 0.582_465_078_404_089_8,\n 0.627_796_942_691_410_7, 0.675_122_763_349_862_3, 0.724_466_842_212_892_1,\n 0.775_853_049_866_786, 0.829_304_845_476_233, 0.884_845_295_169_849_8,\n 0.942_497_089_126_609, 1.002_282_557_486_903_9, 1.064_223_685_197_357_7,\n 1.128_342_125_885_829_7, 1.194_659_214_852_212_8, 1.263_195_981_251_186_4,\n 1.333_973_159_534_903_4, 1.407_011_200_216_447, 1.482_330_280_008_641_5,\n 1.559_950_311_387_327_2, 1.639_890_951_623_367_7, 1.722_171_611_323_410_5,\n 1.806_811_462_515_637_7, 1.893_829_446_313_407_3, 1.983_244_280_186_685_2,\n 2.075_074_464_868_551, 2.169_338_290_921_623_4, 2.266_053_844_987_206_3,\n 2.365_239_015_737_95, 2.466_911_499_553_200_7, 2.571_088_805_934_576_4,\n 2.677_788_262_677_978_5, 2.787_027_020_816_925_7, 2.898_822_059_350_997,\n 3.013_190_189_772_090_7, 3.130_148_060_400_286_3, 3.249_712_160_540_222_6,\n 3.371_898_824_468_108_7, 3.496_724_235_258_794_6, 3.624_204_428_461_639,\n 3.754_355_295_633_311, 3.887_192_587_735_158, 4.022_731_918_402_185,\n 4.160_988_767_090_289, 4.301_978_482_107_941, 4.445_716_283_538_092,\n 4.592_217_266_055_746, 4.741_496_401_646_282, 4.893_568_542_229_298,\n 5.048_448_422_192_488, 5.206_150_660_839_72, 5.366_689_764_757_337_5,\n 5.530_080_130_102_386_5, 5.696_336_044_816_294, 5.865_471_690_767_354,\n 6.037_501_145_825_082, 6.212_438_385_869_475, 6.390_297_286_737_924,\n 6.571_091_626_112_461, 6.754_835_085_349_804_5, 6.941_541_251_256_611,\n 7.131_223_617_812_143, 7.323_895_587_840_543, 7.519_570_474_634_666_5,\n 7.718_261_503_533_434_5, 7.919_981_813_454_504, 8.124_744_458_384_042,\n 8.332_562_408_825_165, 8.543_448_553_206_703, 8.757_415_699_253_682,\n 8.974_476_575_321_063, 9.194_643_831_691_977, 9.417_930_041_841_839,\n 9.644_347_703_669_503, 9.873_909_240_696_694, 10.106_627_003_236_781,\n 10.342_513_269_534_024, 10.581_580_246_874_27, 10.823_840_072_668_1,\n 11.069_304_815_507_364, 11.317_986_476_196_008, 11.569_896_988_756_009,\n 11.825_048_221_409_341, 12.083_451_977_536_606, 12.345_119_996_613_247,\n 12.610_063_955_123_938, 12.878_295_467_455_942, 13.149_826_086_772_048,\n 13.424_667_305_863_72, 13.702_830_557_985_108, 13.984_327_217_668_513,\n 14.269_168_601_521_828, 14.557_365_969_008_56, 14.848_930_523_210_871,\n 15.143_873_411_576_273, 15.442_205_726_648_32, 15.743_938_506_781_891,\n 16.049_082_736_843_37, 16.357_649_348_896_34, 16.669_649_222_873_04,\n 16.985_093_187_232_053, 17.303_992_019_602_69, 17.626_356_447_416_25,\n 17.952_197_148_524_76, 18.281_524_751_807_332, 18.614_349_837_764_564,\n 18.950_682_939_101_38, 19.290_534_541_298_456, 19.633_915_083_172_692,\n 19.980_834_957_426_89, 20.331_304_511_189_067, 20.685_334_046_541_502,\n 21.042_933_821_039_977, 21.404_114_048_223_256, 21.768_884_898_113_22,\n 22.137_256_497_705_877, 22.509_238_931_453_28, 22.884_842_241_736_916,\n 23.264_076_429_332_462, 23.646_951_453_866_3, 24.033_477_234_264_016,\n 24.423_663_649_190_83, 24.817_520_537_484_558, 25.215_057_698_580_89,\n 25.616_284_892_931_38, 26.021_211_842_414_342, 26.429_848_230_738_664,\n 26.842_203_703_840_827, 27.258_287_870_275_353, 27.678_110_301_598_522,\n 28.101_680_532_745_97, 28.529_008_062_403_893, 28.960_102_353_374_22,\n 29.394_972_832_933_96, 29.833_628_893_188_45, 30.276_079_891_419_332,\n 30.722_335_150_426_627, 31.172_403_958_865_512, 31.626_295_571_577_85,\n 32.084_019_209_918_37, 32.545_584_062_075_92, 33.010_999_283_389_665,\n 33.480_273_996_660_3, 33.953_417_292_456_834, 34.430_438_229_418_264,\n 34.911_345_834_551_085, 35.396_149_103_522_07, 35.884_857_000_946_71,\n 36.377_478_460_673_49, 36.874_022_386_063_82, 37.374_497_650_267_89,\n 37.878_913_096_496_59, 38.387_277_538_289_26, 38.899_599_759_777_85,\n 39.415_888_515_946_97, 39.936_152_532_890_54, 40.460_400_508_064_545,\n 40.988_641_110_536_29, 41.520_882_981_230_194, 42.057_134_733_170_16,\n 42.597_404_951_718_396, 43.141_702_194_811_224, 43.690_034_993_191_3,\n 44.242_411_850_636_97, 44.798_841_244_188_324, 45.359_331_624_370_17,\n 45.923_891_415_412_09, 46.492_529_015_465_52, 47.065_252_796_817_916,\n 47.642_071_106_104_09, 48.222_992_264_514_68, 48.808_024_568_002_054,\n 49.397_176_287_483_3, 49.990_455_669_040_8, 50.587_870_934_119_984,\n 51.189_430_279_724_725, 51.795_141_878_610_14, 52.405_013_879_472_88,\n 53.019_054_407_139_2, 53.637_271_562_750_364, 54.259_673_423_945_976,\n 54.886_268_045_044_93, 55.517_063_457_223_934, 56.152_067_668_694_24,\n 56.791_288_664_875_74, 57.434_734_408_569_16, 58.082_412_840_126_21,\n 58.734_331_877_617_365, 59.390_499_416_998_07, 60.050_923_332_272_51,\n 60.715_611_475_655_585, 61.384_571_677_733_11, 62.057_811_747_619_894,\n 62.735_339_473_115_9, 63.417_162_620_860_914, 64.103_288_936_486_92,\n 64.793_726_144_769_21, 65.488_481_949_775_29, 66.187_564_035_012_24,\n 66.890_980_063_572_58, 67.598_737_678_278_08, 68.310_844_501_822_22,\n 69.027_308_136_910_93, 69.748_136_166_401_64, 70.473_336_153_441_07,\n 71.202_915_641_601_04, 71.936_882_155_013_12, 72.675_243_198_501_72,\n 73.418_006_257_715_42, 74.165_178_799_257_33, 74.916_768_270_813_6,\n 75.672_782_101_280_72, 76.433_227_700_891_46, 77.198_112_461_339_3,\n 77.967_443_755_901_67, 78.741_228_939_561_74, 79.519_475_349_129_04,\n 80.302_190_303_358_69, 81.089_381_103_069_34, 81.881_055_031_259_99,\n 82.677_219_353_225_41, 83.477_881_316_670_6, 84.283_048_151_823_72,\n 85.092_727_071_548_08, 85.906_925_271_453_02, 86.725_649_930_003_43,\n 87.548_908_208_628_19, 88.376_707_251_827_7, 89.209_054_187_280_1,\n 90.045_956_125_946_55, 90.887_420_162_175_18, 91.733_453_373_804_38,\n 92.584_062_822_264_91, 93.439_255_552_680_66, 94.299_038_593_969_02,\n 95.163_418_958_939_69, 96.032_403_644_392_74, 96.905_999_631_215_9,\n 97.784_213_884_480_44, 98.667_053_353_536_6, 99.554_524_972_107_76,\n];\n\n/**\n * Sanitizes a small enough angle in radians.\n * @param {number} angle An angle in radians; must not deviate too much\n * from 0.\n * @return {number} A coterminal angle between 0 and 2pi.\n */\nfunction sanitizeRadians(angle) {\n return (angle + Math.PI * 8) % (Math.PI * 2);\n}\n\n/**\n * Delinearizes an RGB component, returning a floating-point\n * number.\n * @param {number} rgbComponent 0.0 <= rgb_component <= 100.0, represents\n * linear R/G/B channel\n * @return {number} 0.0 <= output <= 255.0, color channel converted to\n * regular RGB space\n */\nfunction trueDelinearized(rgbComponent) {\n const normalized = rgbComponent / 100;\n let delinearized = 0;\n delinearized = normalized <= 0.003_130_8 ? normalized * 12.92 : 1.055 * normalized ** (1 / 2.4) - 0.055;\n return delinearized * 255;\n}\n\n/**\n * @param {number} component\n * @return {number}\n */\nfunction chromaticAdaptation(component) {\n const af = Math.abs(component) ** 0.42;\n return mathUtils.signum(component) * 400 * af / (af + 27.13);\n}\n\n/**\n * Returns the hue of a linear RGB color in CAM16.\n * @param {number[]} linrgb The linear RGB coordinates of a color.\n * @return {number} The hue of the color in CAM16, in radians.\n */\nfunction hueOf(linrgb) {\n const scaledDiscount = mathUtils.matrixMultiply(linrgb, SCALED_DISCOUNT_FROM_LINRGB);\n const rA = chromaticAdaptation(scaledDiscount[0]);\n const gA = chromaticAdaptation(scaledDiscount[1]);\n const bA = chromaticAdaptation(scaledDiscount[2]);\n // redness-greenness\n const a = (11 * rA + -12 * gA + bA) / 11;\n // yellowness-blueness\n const b = (rA + gA - 2 * bA) / 9;\n return Math.atan2(b, a);\n}\n\n/**\n *\n * @param {number} a\n * @param {number} b\n * @param {number} c\n * @return {boolean}\n */\nfunction areInCyclicOrder(a, b, c) {\n const deltaAB = sanitizeRadians(b - a);\n const deltaAC = sanitizeRadians(c - a);\n return deltaAB < deltaAC;\n}\n\n/**\n * Solves the lerp equation.\n * @param {number} source The starting number.\n * @param {number} mid The number in the middle.\n * @param {number} target The ending number.\n * @return {number} A number t such that lerp(source, target, t) = mid.\n */\nfunction intercept(source, mid, target) {\n return (mid - source) / (target - source);\n}\n\n/**\n *\n * @param {number[]} source\n * @param {number} t\n * @param {number[]} target\n * @return {[number,number,number]}\n */\nfunction lerpPoint(source, t, target) {\n return [\n source[0] + (target[0] - source[0]) * t,\n source[1] + (target[1] - source[1]) * t,\n source[2] + (target[2] - source[2]) * t,\n ];\n}\n\n/**\n * Intersects a segment with a plane.\n * @param {number[]} source The coordinates of point A.\n * @param {number} coordinate The R-, G-, or B-coordinate of the plane.\n * @param {number[]} target The coordinates of point B.\n * @param {number} axis The axis the plane is perpendicular with. (0: R, 1:\n * G, 2: B)\n * @return {number[]} The intersection point of the segment AB with the plane\n * R=coordinate, G=coordinate, or B=coordinate\n */\nfunction setCoordinate(source, coordinate, target, axis) {\n const t = intercept(source[axis], coordinate, target[axis]);\n return lerpPoint(source, t, target);\n}\n\n/**\n * @param {number} x\n * @return {boolean}\n */\nfunction isBounded(x) {\n return x >= 0 && x <= 100;\n}\n\n/**\n * Returns the nth possible vertex of the polygonal intersection.\n * @param {number} y The Y value of the plane\n * @param {number} n The zero-based index of the point. 0 <= n <= 11.\n * @return {number[]} The nth possible vertex of the polygonal intersection\n * of the y plane and the RGB cube, in linear RGB coordinates, if\n * it exists. If this possible vertex lies outside of the cube,\n * [-1.0, -1.0, -1.0] is returned.\n */\nfunction nthVertex(y, n) {\n const kR = Y_FROM_LINRGB[0];\n const kG = Y_FROM_LINRGB[1];\n const kB = Y_FROM_LINRGB[2];\n const coordA = n % 4 <= 1 ? 0 : 100;\n const coordB = n % 2 === 0 ? 0 : 100;\n if (n < 4) {\n const g = coordA;\n const b = coordB;\n const r = (y - g * kG - b * kB) / kR;\n if (isBounded(r)) {\n return [r, g, b];\n }\n return [-1, -1, -1];\n }\n if (n < 8) {\n const b = coordA;\n const r = coordB;\n const g = (y - r * kR - b * kB) / kG;\n if (isBounded(g)) {\n return [r, g, b];\n }\n return [-1, -1, -1];\n }\n const r = coordA;\n const g = coordB;\n const b = (y - r * kR - g * kG) / kB;\n if (isBounded(b)) {\n return [r, g, b];\n }\n return [-1, -1, -1];\n}\n\n/**\n * Finds the segment containing the desired color.\n * @param {number} y The Y value of the color.\n * @param {number} targetHue The hue of the color.\n * @return {[number[], number[]]} A list of two sets of linear RGB coordinates, each\n * corresponding to an endpoint of the segment containing the\n * desired color.\n */\nfunction bisectToSegment(y, targetHue) {\n let left = [-1, -1, -1];\n let right = left;\n let leftHue = 0;\n let rightHue = 0;\n let initialized = false;\n let uncut = true;\n\n for (let n = 0; n < 12; n++) {\n const mid = nthVertex(y, n);\n if (mid[0] < 0) {\n continue;\n }\n const midHue = hueOf(mid);\n if (!initialized) {\n left = mid;\n right = mid;\n leftHue = midHue;\n rightHue = midHue;\n initialized = true;\n continue;\n }\n if (uncut || areInCyclicOrder(leftHue, midHue, rightHue)) {\n uncut = false;\n if (areInCyclicOrder(leftHue, targetHue, midHue)) {\n right = mid;\n rightHue = midHue;\n } else {\n left = mid;\n leftHue = midHue;\n }\n }\n }\n return [left, right];\n}\n\n/**\n *\n * @param {number[]} a\n * @param {number[]} b\n * @return {number[]}\n */\nfunction midpoint(a, b) {\n return [\n (a[0] + b[0]) / 2,\n (a[1] + b[1]) / 2,\n (a[2] + b[2]) / 2,\n ];\n}\n\n/**\n * @param {number} x\n * @return {number}\n */\nfunction criticalPlaneBelow(x) {\n return Math.floor(x - 0.5);\n}\n\n/**\n * @param {number} x\n * @return {number}\n */\nfunction criticalPlaneAbove(x) {\n return Math.ceil(x - 0.5);\n}\n\n/**\n * Finds a color with the given Y and hue on the boundary of the\n * cube.\n * @param {number} y The Y value of the color.\n * @param {number} targetHue The hue of the color.\n * @return {number[]} The desired color, in linear RGB coordinates.\n */\nfunction bisectToLimit(y, targetHue) {\n const segment = bisectToSegment(y, targetHue);\n let left = segment[0];\n let leftHue = hueOf(left);\n let right = segment[1];\n for (let axis = 0; axis < 3; axis++) {\n if (left[axis] !== right[axis]) {\n let lPlane = -1;\n let rPlane = 255;\n if (left[axis] < right[axis]) {\n lPlane = criticalPlaneBelow(\n trueDelinearized(left[axis]),\n );\n rPlane = criticalPlaneAbove(\n trueDelinearized(right[axis]),\n );\n } else {\n lPlane = criticalPlaneAbove(\n trueDelinearized(left[axis]),\n );\n rPlane = criticalPlaneBelow(\n trueDelinearized(right[axis]),\n );\n }\n for (let i = 0; i < 8; i++) {\n if (Math.abs(rPlane - lPlane) <= 1) {\n break;\n } else {\n const mPlane = Math.floor((lPlane + rPlane) / 2);\n const midPlaneCoordinate = CRITICAL_PLANES[mPlane];\n const mid = setCoordinate(left, midPlaneCoordinate, right, axis);\n const midHue = hueOf(mid);\n if (areInCyclicOrder(leftHue, targetHue, midHue)) {\n right = mid;\n rPlane = mPlane;\n } else {\n left = mid;\n leftHue = midHue;\n lPlane = mPlane;\n }\n }\n }\n }\n }\n return midpoint(left, right);\n}\n\n/**\n * @param {number} adapted\n * @return {number}\n */\nfunction inverseChromaticAdaptation(adapted) {\n const adaptedAbs = Math.abs(adapted);\n const base = Math.max(0, 27.13 * adaptedAbs / (400 - adaptedAbs));\n return mathUtils.signum(adapted) * base ** (1 / 0.42);\n}\n\n/**\n * Finds a color with the given hue, chroma, and Y.\n * @param {number} hueRadians The desired hue in radians.\n * @param {number} chroma The desired chroma.\n * @param {number} y The desired Y.\n * @return {number} The desired color as a hexadecimal integer, if found; 0\n * otherwise.\n */\nfunction findResultByJ(hueRadians, chroma, y) {\n // Initial estimate of j.\n let j = Math.sqrt(y) * 11;\n // ===========================================================\n // Operations inlined from Cam16 to avoid repeated calculation\n // ===========================================================\n const viewingConditions = ViewingConditions.DEFAULT;\n const tInnerCoeff = 1 / (1.64 - 0.29 ** viewingConditions.n) ** 0.73;\n const eHue = 0.25 * (Math.cos(hueRadians + 2) + 3.8);\n const p1 = eHue * (50_000 / 13) * viewingConditions.nc * viewingConditions.ncb;\n const hSin = Math.sin(hueRadians);\n const hCos = Math.cos(hueRadians);\n for (let iterationRound = 0; iterationRound < 5; iterationRound++) {\n // ===========================================================\n // Operations inlined from Cam16 to avoid repeated calculation\n // ===========================================================\n const jNormalized = j / 100;\n const alpha = chroma === 0 || j === 0 ? 0 : chroma / Math.sqrt(jNormalized);\n const t = (alpha * tInnerCoeff) ** (1 / 0.9);\n const ac = viewingConditions.aw\n * jNormalized ** (1 / viewingConditions.c / viewingConditions.z);\n const p2 = ac / viewingConditions.nbb;\n const gamma = 23 * (p2 + 0.305) * t / (23 * p1 + 11 * t * hCos + 108 * t * hSin);\n const a = gamma * hCos;\n const b = gamma * hSin;\n const rA = (460 * p2 + 451 * a + 288 * b) / 1403;\n const gA = (460 * p2 - 891 * a - 261 * b) / 1403;\n const bA = (460 * p2 - 220 * a - 6300 * b) / 1403;\n const rCScaled = inverseChromaticAdaptation(rA);\n const gCScaled = inverseChromaticAdaptation(gA);\n const bCScaled = inverseChromaticAdaptation(bA);\n const linrgb = mathUtils.matrixMultiply(\n [rCScaled, gCScaled, bCScaled],\n LINRGB_FROM_SCALED_DISCOUNT,\n );\n // ===========================================================\n // Operations inlined from Cam16 to avoid repeated calculation\n // ===========================================================\n if (linrgb[0] < 0 || linrgb[1] < 0 || linrgb[2] < 0) {\n return 0;\n }\n const kR = Y_FROM_LINRGB[0];\n const kG = Y_FROM_LINRGB[1];\n const kB = Y_FROM_LINRGB[2];\n const fnj = kR * linrgb[0] + kG * linrgb[1] + kB * linrgb[2];\n if (fnj <= 0) {\n return 0;\n }\n if (iterationRound === 4 || Math.abs(fnj - y) < 0.002) {\n if (linrgb[0] > 100.01 || linrgb[1] > 100.01 || linrgb[2] > 100.01) {\n return 0;\n }\n return colorUtils.argbFromLinrgb(linrgb);\n }\n // Iterates with Newton method,\n // Using 2 * fn(j) / j as the approximation of fn'(j)\n j -= (fnj - y) * j / (2 * fnj);\n }\n return 0;\n}\n\n/**\n * Finds an sRGB color with the given hue, chroma, and L*, if\n * possible.\n * @param {number} hueDegrees The desired hue, in degrees.\n * @param {number} chroma The desired chroma.\n * @param {number} lstar The desired L*.\n * @return {number} A hexadecimal representing the sRGB color. The color\n * has sufficiently close hue, chroma, and L* to the desired\n * values, if possible; otherwise, the hue and L* will be\n * sufficiently close, and chroma will be maximized.\n */\nexport function solveToInt(hueDegrees, chroma, lstar) {\n if (chroma < 0.0001 || lstar < 0.0001 || lstar > 99.9999) {\n return colorUtils.argbFromLstar(lstar);\n }\n hueDegrees = mathUtils.sanitizeDegreesDouble(hueDegrees);\n const hueRadians = hueDegrees / 180 * Math.PI;\n const y = colorUtils.yFromLstar(lstar);\n const exactAnswer = findResultByJ(hueRadians, chroma, y);\n if (exactAnswer !== 0) {\n return exactAnswer;\n }\n const linrgb = bisectToLimit(y, hueRadians);\n return colorUtils.argbFromLinrgb(linrgb);\n}\n\n/**\n * Finds an sRGB color with the given hue, chroma, and L*, if\n * possible.\n * @param {number} hueDegrees The desired hue, in degrees.\n * @param {number} chroma The desired chroma.\n * @param {number} lstar The desired L*.\n * @return {Cam16} An CAM16 object representing the sRGB color. The color\n * has sufficiently close hue, chroma, and L* to the desired\n * values, if possible; otherwise, the hue and L* will be\n * sufficiently close, and chroma will be maximized.\n */\nexport function solveToCam(hueDegrees, chroma, lstar) {\n return Cam16.fromInt(solveToInt(hueDegrees, chroma, lstar));\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A color system built using CAM16 hue and chroma, and L* from\n * L*a*b*.\n *\n * Using L* creates a link between the color system, contrast, and thus\n * accessibility. Contrast ratio depends on relative luminance, or Y in the XYZ\n * color space. L*, or perceptual luminance can be calculated from Y.\n *\n * Unlike Y, L* is linear to human perception, allowing trivial creation of\n * accurate color tones.\n *\n * Unlike contrast ratio, measuring contrast in L* is linear, and simple to\n * calculate. A difference of 40 in HCT tone guarantees a contrast ratio >= 3.0,\n * and a difference of 50 guarantees a contrast ratio >= 4.5.\n */\n\nimport Cam16 from './Cam16.js';\nimport * as utils from './colorUtils.js';\nimport * as hctSolver from './hctSolver.js';\n\n/**\n * HCT, hue, chroma, and tone. A color system that provides a perceptually\n * accurate color measurement system that can also accurately render what colors\n * will appear as in different lighting environments.\n */\nexport default class Hct {\n /**\n * @param hue 0 <= hue < 360; invalid values are corrected.\n * @param chroma 0 <= chroma < ?; Informally, colorfulness. The color\n * returned may be lower than the requested chroma. Chroma has a different\n * maximum for any given hue and tone.\n * @param tone 0 <= tone <= 100; invalid values are corrected.\n * @return HCT representation of a color in default viewing conditions.\n */\n\n /** @type {number} */\n internalHue;\n\n /** @type {number} */\n internalChroma;\n\n /** @type {number} */\n internalTone;\n\n /**\n * @param {number} hue\n * @param {number} chroma\n * @param {number} tone\n * @return {Hct}\n */\n static from(hue, chroma, tone) {\n return new Hct(hctSolver.solveToInt(hue, chroma, tone));\n }\n\n /**\n * @param {number} argb ARGB representation of a color.\n * @return {Hct} HCT representation of a color in default viewing conditions\n */\n static fromInt(argb) {\n return new Hct(argb);\n }\n\n /** @return {number} */\n toInt() {\n return this.argb;\n }\n\n /**\n * A number, in degrees, representing ex. red, orange, yellow, etc.\n * Ranges from 0 <= hue < 360.\n * @return {number}\n */\n get hue() {\n return this.internalHue;\n }\n\n /**\n * @param {number} newHue 0 <= newHue < 360; invalid values are corrected.\n * Chroma may decrease because chroma has a different maximum for any given\n * hue and tone.\n */\n set hue(newHue) {\n this.setInternalState(\n hctSolver.solveToInt(\n newHue,\n this.internalChroma,\n this.internalTone,\n ),\n );\n }\n\n /** @return {number} */\n get chroma() {\n return this.internalChroma;\n }\n\n /**\n * @param {number} newChroma 0 <= newChroma < ?\n * Chroma may decrease because chroma has a different maximum for any given\n * hue and tone.\n */\n set chroma(newChroma) {\n this.setInternalState(\n hctSolver.solveToInt(\n this.internalHue,\n newChroma,\n this.internalTone,\n ),\n );\n }\n\n /**\n * Lightness. Ranges from 0 to 100.\n * @return {number}\n */\n get tone() {\n return this.internalTone;\n }\n\n /**\n * @param {number} newTone 0 <= newTone <= 100; invalid valids are corrected.\n * Chroma may decrease because chroma has a different maximum for any given\n * hue and tone.\n */\n set tone(newTone) {\n this.setInternalState(\n hctSolver.solveToInt(\n this.internalHue,\n this.internalChroma,\n newTone,\n ),\n );\n }\n\n /** @param {number} argb */\n constructor(argb) {\n const cam = Cam16.fromInt(argb);\n this.internalHue = cam.hue;\n this.internalChroma = cam.chroma;\n this.internalTone = utils.lstarFromArgb(argb);\n this.argb = argb;\n }\n\n /**\n * @private\n * @param {number} argb\n */\n setInternalState(argb) {\n const cam = Cam16.fromInt(argb);\n this.internalHue = cam.hue;\n this.internalChroma = cam.chroma;\n this.internalTone = utils.lstarFromArgb(argb);\n this.argb = argb;\n }\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Hct from './Hct.js';\n\n/**\n * A convenience class for retrieving colors that are constant in hue and\n * chroma, but vary in tone.\n */\nexport default class TonalPalette {\n /** @type {Map<number, number>} */\n #cache = new Map();\n\n /**\n * @param {number} argb ARGB representation of a color\n * @return {TonalPalette} Tones matching that color's hue and chroma.\n */\n static fromInt(argb) {\n const hct = Hct.fromInt(argb);\n return TonalPalette.fromHueAndChroma(hct.hue, hct.chroma);\n }\n\n /**\n * @param {number} hue HCT hue\n * @param {number} chroma HCT chroma\n * @return {TonalPalette} Tones matching hue and chroma.\n */\n static fromHueAndChroma(hue, chroma) {\n return new TonalPalette(hue, chroma);\n }\n\n /**\n * @private\n * @param {number} hue\n * @param {number} chroma\n */\n constructor(hue, chroma) {\n this.hue = hue;\n this.chroma = chroma;\n }\n\n /**\n * @param {number} tone HCT tone, measured from 0 to 100.\n * @return {number} ARGB representation of a color with that tone.\n */\n tone(tone) {\n let argb = this.#cache.get(tone);\n if (argb === undefined) {\n argb = Hct.from(this.hue, this.chroma, tone).toInt();\n this.#cache.set(tone, argb);\n }\n return argb;\n }\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Hct from './Hct.js';\nimport TonalPalette from './TonalPalette.js';\n\n/**\n * An intermediate concept between the key color for a UI theme, and a full\n * color scheme. 5 sets of tones are generated, all except one use the same hue\n * as the key color, and all vary in chroma.\n */\nexport default class CorePalette {\n /** @type {TonalPalette} */\n a1;\n\n /** @type {TonalPalette} */\n a2;\n\n /** @type {TonalPalette} */\n a3;\n\n /** @type {TonalPalette} */\n n1;\n\n /** @type {TonalPalette} */\n n2;\n\n /** @type {TonalPalette} */\n error;\n\n /**\n * @param {number} argb ARGB representation of a color\n * @return {CorePalette}\n */\n static of(argb) {\n return new CorePalette(argb, false);\n }\n\n /**\n * @param {number} argb ARGB representation of a color\n * @return {CorePalette}\n */\n static contentOf(argb) {\n return new CorePalette(argb, true);\n }\n\n /**\n * @param {number} argb\n * @param {boolean} isContent\n */\n constructor(argb, isContent) {\n const hct = Hct.fromInt(argb);\n const { hue } = hct;\n const { chroma } = hct;\n if (isContent) {\n this.a1 = TonalPalette.fromHueAndChroma(hue, chroma);\n this.a2 = TonalPalette.fromHueAndChroma(hue, chroma / 3);\n this.a3 = TonalPalette.fromHueAndChroma(hue + 60, chroma / 2);\n this.n1 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 12, 4));\n this.n2 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 6, 8));\n } else {\n this.a1 = TonalPalette.fromHueAndChroma(hue, Math.max(48, chroma));\n this.a2 = TonalPalette.fromHueAndChroma(hue, 16);\n this.a3 = TonalPalette.fromHueAndChroma(hue + 60, 24);\n this.n1 = TonalPalette.fromHueAndChroma(hue, 4);\n this.n2 = TonalPalette.fromHueAndChroma(hue, 8);\n }\n this.error = TonalPalette.fromHueAndChroma(25, 84);\n }\n}\n", "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport CorePalette from './CorePalette.js';\n\n/** Represents a Material color scheme, a mapping of color roles to colors. */\nexport default class Scheme {\n /**\n * @param {number} [primary]\n * @param {number} [onPrimary]\n * @param {number} [primaryContainer]\n * @param {number} [onPrimaryContainer]\n * @param {number} [secondary]\n * @param {number} [onSecondary]\n * @param {number} [secondaryContainer]\n * @param {number} [onSecondaryContainer]\n * @param {number} [tertiary]\n * @param {number} [onTertiary]\n * @param {number} [tertiaryContainer]\n * @param {number} [onTertiaryContainer]\n * @param {number} [error]\n * @param {number} [onError]\n * @param {number} [errorContainer]\n * @param {number} [onErrorContainer]\n * @param {number} [background]\n * @param {number} [onBackground]\n * @param {number} [surface]\n * @param {number} [onSurface]\n * @param {number} [surfaceVariant]\n * @param {number} [onSurfaceVariant]\n * @param {number} [outline]\n * @param {number} [outlineVariant]\n * @param {number} [shadow]\n * @param {number} [scrim]\n * @param {number} [inverseSurface]\n * @param {number} [inverseOnSurface]\n * @param {number} [inversePrimary]\n */\n constructor(\n primary,\n onPrimary,\n primaryContainer,\n onPrimaryContainer,\n secondary,\n onSecondary,\n secondaryContainer,\n onSecondaryContainer,\n tertiary,\n onTertiary,\n tertiaryContainer,\n onTertiaryContainer,\n error,\n onError,\n errorContainer,\n onErrorContainer,\n background,\n onBackground,\n surface,\n onSurface,\n surfaceVariant,\n onSurfaceVariant,\n outline,\n outlineVariant,\n shadow,\n scrim,\n inverseSurface,\n inverseOnSurface,\n inversePrimary,\n ) {\n this.primary = primary;\n this.onPrimary = onPrimary;\n this.primaryContainer = primaryContainer;\n this.onPrimaryContainer = onPrimaryContainer;\n this.secondary = secondary;\n this.onSecondary = onSecondary;\n this.secondaryContainer = secondaryContainer;\n this.onSecondaryContainer = onSecondaryContainer;\n this.tertiary = tertiary;\n this.onTertiary = onTertiary;\n this.tertiaryContainer = tertiaryContainer;\n this.onTertiaryContainer = onTertiaryContainer;\n this.error = error;\n this.onError = onError;\n this.errorContainer = errorContainer;\n this.onErrorContainer = onErrorContainer;\n this.background = background;\n this.onBackground = onBackground;\n this.surface = surface;\n this.onSurface = onSurface;\n this.surfaceVariant = surfaceVariant;\n this.onSurfaceVariant = onSurfaceVariant;\n this.outline = outline;\n this.outlineVariant = outlineVariant;\n this.shadow = shadow;\n this.scrim = scrim;\n this.inverseSurface = inverseSurface;\n this.inverseOnSurface = inverseOnSurface;\n this.inversePrimary = inversePrimary;\n }\n\n /**\n * @param {number} argb\n * @return {Scheme}\n */\n static light(argb) {\n return Scheme.#lightFromCorePalette(CorePalette.of(argb));\n }\n\n /**\n * @param {number} argb\n * @return {Scheme}\n */\n static dark(argb) {\n return Scheme.#darkFromCorePalette(CorePalette.of(argb));\n }\n\n /**\n * @param {number} argb\n * @return {Scheme}\n */\n static lightContent(argb) {\n return Scheme.#lightFromCorePalette(CorePalette.contentOf(argb));\n }\n\n /**\n * @param {number} argb\n * @return {Scheme}\n */\n static darkContent(argb) {\n return Scheme.#darkFromCorePalette(CorePalette.contentOf(argb));\n }\n\n /**\n * Light scheme from core palette\n * @param {CorePalette} core\n * @return {Scheme}\n */\n static #lightFromCorePalette(core) {\n return new Scheme()\n .withPrimary(core.a1.tone(40))\n .withOnPrimary(core.a1.tone(100))\n .withPrimaryContainer(core.a1.tone(90))\n .withOnPrimaryContainer(core.a1.tone(10))\n .withSecondary(core.a2.tone(40))\n .withOnSecondary(core.a2.tone(100))\n .withSecondaryContainer(core.a2.tone(90))\n .withOnSecondaryContainer(core.a2.tone(10))\n .withTertiary(core.a3.tone(40))\n .withOnTertiary(core.a3.tone(100))\n .withTertiaryContainer(core.a3.tone(90))\n .withOnTertiaryContainer(core.a3.tone(10))\n .withError(core.error.tone(40))\n .withOnError(core.error.tone(100))\n .withErrorContainer(core.error.tone(90))\n .withOnErrorContainer(core.error.tone(10))\n .withBackground(core.n1.tone(99))\n .withOnBackground(core.n1.tone(10))\n .withSurface(core.n1.tone(99))\n .withOnSurface(core.n1.tone(10))\n .withSurfaceVariant(core.n2.tone(90))\n .withOnSurfaceVariant(core.n2.tone(30))\n .withOutline(core.n2.tone(50))\n .withOutlineVariant(core.n2.tone(80))\n .withShadow(core.n1.tone(0))\n .withScrim(core.n1.tone(0))\n .withInverseSurface(core.n1.tone(20))\n .withInverseOnSurface(core.n1.tone(95))\n .withInversePrimary(core.a1.tone(80));\n }\n\n /**\n * Dark scheme from core palette\n * @param {CorePalette} core\n * @return {Scheme}\n */\n static #darkFromCorePalette(core) {\n return new Scheme()\n .withPrimary(core.a1.tone(80))\n .withOnPrimary(core.a1.tone(20))\n .withPrimaryContainer(core.a1.tone(30))\n .withOnPrimaryContainer(core.a1.tone(90))\n .withSecondary(core.a2.tone(80))\n .withOnSecondary(core.a2.tone(20))\n .withSecondaryContainer(core.a2.tone(30))\n .withOnSecondaryContainer(core.a2.tone(90))\n .withTertiary(core.a3.tone(80))\n .withOnTertiary(core.a3.tone(20))\n .withTertiaryContainer(core.a3.tone(30))\n .withOnTertiaryContainer(core.a3.tone(90))\n .withError(core.error.tone(80))\n .withOnError(core.error.tone(20))\n .withErrorContainer(core.error.tone(30))\n .withOnErrorContainer(core.error.tone(90))\n .withBackground(core.n1.tone(10))\n .withOnBackground(core.n1.tone(90))\n .withSurface(core.n1.tone(10))\n .withOnSurface(core.n1.tone(90))\n .withSurfaceVariant(core.n2.tone(30))\n .withOnSurfaceVariant(core.n2.tone(80))\n .withOutline(core.n2.tone(60))\n .withOutlineVariant(core.n2.tone(30))\n .withShadow(core.n1.tone(0))\n .withScrim(core.n1.tone(0))\n .withInverseSurface(core.n1.tone(90))\n .withInverseOnSurface(core.n1.tone(20))\n .withInversePrimary(core.a1.tone(40));\n }\n\n /**\n * @param {number} primary\n * @return {this}\n */\n withPrimary(primary) {\n this.primary = primary;\n return this;\n }\n\n /**\n * @param {number} onPrimary\n * @return {this}\n */\n withOnPrimary(onPrimary) {\n this.onPrimary = onPrimary;\n return this;\n }\n\n /**\n * @param {number} primaryContainer\n * @return {this}\n */\n withPrimaryContainer(primaryContainer) {\n this.primaryContainer = primaryContainer;\n return this;\n }\n\n /**\n * @param {number} onPrimaryContainer\n * @return {this}\n */\n withOnPrimaryContainer(onPrimaryContainer) {\n this.onPrimaryContainer = onPrimaryContainer;\n return this;\n }\n\n /**\n * @param {number} secondary\n * @return {this}\n */\n withSecondary(secondary) {\n this.secondary = secondary;\n return this;\n }\n\n /**\n * @param {number} onSecondary\n * @return {this}\n */\n withOnSecondary(onSecondary) {\n this.onSecondary = onSecondary;\n return this;\n }\n\n /**\n * @param {number} secondaryContainer\n * @return {this}\n */\n withSecondaryContainer(secondaryContainer) {\n this.secondaryContainer = secondaryContainer;\n return this;\n }\n\n /**\n * @param {number} onSecondaryContainer\n * @return {this}\n */\n withOnSecondaryContainer(onSecondaryContainer) {\n this.onSecondaryContainer = onSecondaryContainer;\n return this;\n }\n\n /**\n * @param {number} tertiary\n * @return {this}\n */\n withTertiary(tertiary) {\n this.tertiary = tertiary;\n return this;\n }\n\n /**\n * @param {number} onTertiary\n * @return {this}\n */\n withOnTertiary(onTertiary) {\n this.onTertiary = onTertiary;\n return this;\n }\n\n /**\n * @param {number} tertiaryContainer\n * @return {this}\n */\n withTertiaryContainer(tertiaryContainer) {\n this.tertiaryContainer = tertiaryContainer;\n return this;\n }\n\n /**\n * @param {number} onTertiaryContainer\n * @return {this}\n */\n withOnTertiaryContainer(onTertiaryContainer) {\n this.onTertiaryContainer = onTertiaryContainer;\n return this;\n }\n\n /**\n * @param {number} error\n * @return {this}\n */\n withError(error) {\n this.error = error;\n return this;\n }\n\n /**\n * @param {number} onError\n * @return {this}\n */\n withOnError(onError) {\n this.onError = onError;\n return this;\n }\n\n /**\n * @param {number} errorContainer\n * @return {this}\n */\n withErrorContainer(errorContainer) {\n this.errorContainer = errorContainer;\n return this;\n }\n\n /**\n * @param {number} onErrorContainer\n * @return {this}\n */\n withOnErrorContainer(onErrorContainer) {\n this.onErrorContainer = onErrorContainer;\n return this;\n }\n\n /**\n * @param {number} background\n * @return {this}\n */\n withBackground(background) {\n this.background = background;\n return this;\n }\n\n /**\n * @param {number} onBackground\n * @return {this}\n */\n withOnBackground(onBackground) {\n this.onBackground = onBackground;\n return this;\n }\n\n /**\n * @param {number} surface\n * @return {this}\n */\n withSurface(surface) {\n this.surface = surface;\n return this;\n }\n\n /**\n * @param {number} onSurface\n * @return {this}\n */\n withOnSurface(onSurface) {\n this.onSurface = onSurface;\n return this;\n }\n\n /**\n * @param {number} surfaceVariant\n * @return {this}\n */\n withSurfaceVariant(surfaceVariant) {\n this.surfaceVariant = surfaceVariant;\n return this;\n }\n\n /**\n * @param {number} onSurfaceVariant\n * @return {this}\n */\n withOnSurfaceVariant(onSurfaceVariant) {\n this.onSurfaceVariant = onSurfaceVariant;\n return this;\n }\n\n /**\n * @param {number} outline\n * @return {this}\n */\n withOutline(outline) {\n this.outline = outline;\n return this;\n }\n\n /**\n * @param {number} outlineVariant\n * @return {this}\n */\n withOutlineVariant(outlineVariant) {\n this.outlineVariant = outlineVariant;\n return this;\n }\n\n /**\n * @param {number} shadow\n * @return {this}\n */\n withShadow(shadow) {\n this.shadow = shadow;\n return this;\n }\n\n /**\n * @param {number} scrim\n * @return {this}\n */\n withScrim(scrim) {\n this.scrim = scrim;\n return this;\n }\n\n /**\n * @param {number} inverseSurface\n * @return {this}\n */\n withInverseSurface(inverseSurface) {\n this.inverseSurface = inverseSurface;\n return this;\n }\n\n /**\n * @param {number} inverseOnSurface\n * @return {this}\n */\n withInverseOnSurface(inverseOnSurface) {\n this.inverseOnSurface = inverseOnSurface;\n return this;\n }\n\n /**\n * @param {number} inversePrimary\n * @return {this}\n */\n withInversePrimary(inversePrimary) {\n this.inversePrimary = inversePrimary;\n return this;\n }\n\n /**\n * @param {any} object\n @return {boolean} */\n equals(object) {\n if (this === object) {\n return true;\n }\n if (!(object instanceof Scheme)) {\n return false;\n }\n\n /** @type {Scheme} */\n const scheme = object;\n\n if (this.primary !== scheme.primary) {\n return false;\n }\n if (this.onPrimary !== scheme.onPrimary) {\n return false;\n }\n if (this.primaryContainer !== scheme.primaryContainer) {\n return false;\n }\n if (this.onPrimaryContainer !== scheme.onPrimaryContainer) {\n return false;\n }\n if (this.secondary !== scheme.secondary) {\n return false;\n }\n if (this.onSecondary !== scheme.onSecondary) {\n return false;\n }\n if (this.secondaryContainer !== scheme.secondaryContainer) {\n return false;\n }\n if (this.onSecondaryContainer !== scheme.onSecondaryContainer) {\n return false;\n }\n if (this.tertiary !== scheme.tertiary) {\n return false;\n }\n if (this.onTertiary !== scheme.onTertiary) {\n return false;\n }\n if (this.tertiaryContainer !== scheme.tertiaryContainer) {\n return false;\n }\n if (this.onTertiaryContainer !== scheme.onTertiaryContainer) {\n return false;\n }\n if (this.error !== scheme.error) {\n return false;\n }\n if (this.onError !== scheme.onError) {\n return false;\n }\n if (this.errorContainer !== scheme.errorContainer) {\n return false;\n }\n if (this.onErrorContainer !== scheme.onErrorContainer) {\n return false;\n }\n if (this.background !== scheme.background) {\n return false;\n }\n if (this.onBackground !== scheme.onBackground) {\n return false;\n }\n if (this.surface !== scheme.surface) {\n return false;\n }\n if (this.onSurface !== scheme.onSurface) {\n return false;\n }\n if (this.surfaceVariant !== scheme.surfaceVariant) {\n return false;\n }\n if (this.onSurfaceVariant !== scheme.onSurfaceVariant) {\n return false;\n }\n if (this.outline !== scheme.outline) {\n return false;\n }\n if (this.outlineVariant !== scheme.outlineVariant) {\n return false;\n }\n if (this.shadow !== scheme.shadow) {\n return false;\n }\n if (this.scrim !== scheme.scrim) {\n return false;\n }\n if (this.inverseSurface !== scheme.inverseSurface) {\n return false;\n }\n if (this.inverseOnSurface !== scheme.inverseOnSurface) {\n return false;\n }\n if (this.inversePrimary !== scheme.inversePrimary) {\n return false;\n }\n\n return true;\n }\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// libmonet is designed to have a consistent API across platforms\n// and modular components that can be moved around easily. Using a class as a\n// namespace facilitates this.\n//\n// tslint:disable:class-as-namespace\n\nimport Cam16 from './Cam16.js';\nimport Hct from './Hct.js';\nimport * as colorUtils from './colorUtils.js';\nimport * as mathUtils from './mathUtils.js';\n\n/**\n * Blend the design color's HCT hue towards the key color's HCT\n * hue, in a way that leaves the original color recognizable and\n * recognizably shifted towards the key color.\n * @param {number} designColor ARGB representation of an arbitrary color.\n * @param {number} sourceColor ARGB representation of the main theme color.\n * @return {number} The design color with a hue shifted towards the\n * system's color, a slightly warmer/cooler variant of the design\n * color's hue.\n */\nexport function harmonize(designColor, sourceColor) {\n const fromHct = Hct.fromInt(designColor);\n const toHct = Hct.fromInt(sourceColor);\n const differenceDegrees = mathUtils.differenceDegrees(fromHct.hue, toHct.hue);\n const rotationDegrees = Math.min(differenceDegrees * 0.5, 15);\n const outputHue = mathUtils.sanitizeDegreesDouble(\n fromHct.hue\n + rotationDegrees * mathUtils.rotationDirection(fromHct.hue, toHct.hue),\n );\n return Hct.from(outputHue, fromHct.chroma, fromHct.tone).toInt();\n}\n\n/**\n * Blend in CAM16-UCS space.\n * @param {number} from ARGB representation of color\n * @param {number} to ARGB representation of color\n * @param {number} amount how much blending to perform; 0.0 >= and <= 1.0\n * @return {number} from, blended towards to. Hue, chroma, and tone will\n * change.\n */\nexport function cam16Ucs(from, to, amount) {\n const fromCam = Cam16.fromInt(from);\n const toCam = Cam16.fromInt(to);\n const fromJ = fromCam.jstar;\n const fromA = fromCam.astar;\n const fromB = fromCam.bstar;\n const toJ = toCam.jstar;\n const toA = toCam.astar;\n const toB = toCam.bstar;\n const jstar = fromJ + (toJ - fromJ) * amount;\n const astar = fromA + (toA - fromA) * amount;\n const bstar = fromB + (toB - fromB) * amount;\n return Cam16.fromUcs(jstar, astar, bstar).toInt();\n}\n\n/**\n * Blends hue from one color into another. The chroma and tone of\n * the original color are maintained.\n * @param {number} from ARGB representation of color\n * @param {number} to ARGB representation of color\n * @param {number} amount how much blending to perform; 0.0 >= and <= 1.0\n * @return {number} from, with a hue blended towards to. Chroma and tone\n * are constant.\n */\nexport function hctHue(from, to, amount) {\n const ucs = cam16Ucs(from, to, amount);\n const ucsCam = Cam16.fromInt(ucs);\n const fromCam = Cam16.fromInt(from);\n const blended = Hct.from(\n ucsCam.hue,\n fromCam.chroma,\n colorUtils.lstarFromArgb(from),\n );\n return blended.toInt();\n}\n", "import CorePalette from './CorePalette.js';\nimport Scheme from './Scheme.js';\nimport { harmonize } from './blend.js';\nimport * as colorUtils from './colorUtils.js';\n\n/** @typedef {import('./TonalPalette.js').default} TonalPalette */\n\n/**\n * @param {string} value\n * @return {number}\n */\nfunction parseIntHex(value) {\n // tslint:disable-next-line:ban\n return Number.parseInt(value, 16);\n}\n\n/**\n * @param {string} hex String representing color as hex code. Accepts strings with or\n * without leading #, and string representing the color using 3, 6, or 8\n * hex characters.\n * @return {number} ARGB representation of color.\n */\nfunction argbFromHex(hex) {\n hex = hex.replace('#', '');\n const isThree = hex.length === 3;\n const isSix = hex.length === 6;\n const isEight = hex.length === 8;\n if (!isThree && !isSix && !isEight) {\n throw new Error(`unexpected hex ${hex}`);\n }\n let r = 0;\n let g = 0;\n let b = 0;\n if (isThree) {\n r = parseIntHex(hex.slice(0, 1).repeat(2));\n g = parseIntHex(hex.slice(1, 2).repeat(2));\n b = parseIntHex(hex.slice(2, 3).repeat(2));\n } else if (isSix) {\n r = parseIntHex(hex.slice(0, 2));\n g = parseIntHex(hex.slice(2, 4));\n b = parseIntHex(hex.slice(4, 6));\n } else if (isEight) {\n r = parseIntHex(hex.slice(2, 4));\n g = parseIntHex(hex.slice(4, 6));\n b = parseIntHex(hex.slice(6, 8));\n }\n\n return (\n ((255 << 24) | ((r & 0x0_FF) << 16) | ((g & 0x0_FF) << 8) | (b & 0x0_FF))\n >>> 0);\n}\n\n/**\n * @param {number} argb ARGB representation of a color.\n * @return {string} Hex string representing color, ex. #ff0000 for red.\n */\nfunction hexFromArgb(argb) {\n const r = colorUtils.redFromArgb(argb);\n const g = colorUtils.greenFromArgb(argb);\n const b = colorUtils.blueFromArgb(argb);\n const outParts = [r.toString(16), g.toString(16), b.toString(16)];\n\n // Pad single-digit output values\n for (const [i, part] of outParts.entries()) {\n if (part.length === 1) {\n outParts[i] = `0${part}`;\n }\n }\n\n return `#${outParts.join('')}`;\n}\n\n/**\n * @param {number} argb\n * @return {string}\n */\nfunction cssVarFromArgb(argb) {\n return [\n colorUtils.redFromArgb(argb),\n colorUtils.greenFromArgb(argb),\n colorUtils.blueFromArgb(argb),\n ].join(',');\n}\n\n/**\n * @param {Scheme} scheme\n * @return {string}\n */\nfunction cssVariablesFromScheme(scheme) {\n return /* css */`\n :root {\n --mdw-color__primary: ${cssVarFromArgb(scheme.primary)};\n --mdw-color__on-primary: ${cssVarFromArgb(scheme.onPrimary)};\n --mdw-color__primary-container: ${cssVarFromArgb(scheme.primaryContainer)};\n --mdw-color__on-primary-container: ${cssVarFromArgb(scheme.onPrimaryContainer)};\n --mdw-color__secondary: ${cssVarFromArgb(scheme.secondary)};\n --mdw-color__on-secondary: ${cssVarFromArgb(scheme.onSecondary)};\n --mdw-color__secondary-container: ${cssVarFromArgb(scheme.secondaryContainer)};\n --mdw-color__on-secondary-container: ${cssVarFromArgb(scheme.onSecondaryContainer)};\n --mdw-color__tertiary: ${cssVarFromArgb(scheme.tertiary)};\n --mdw-color__on-tertiary: ${cssVarFromArgb(scheme.onTertiary)};\n --mdw-color__tertiary-container: ${cssVarFromArgb(scheme.tertiaryContainer)};\n --mdw-color__on-tertiary-container: ${cssVarFromArgb(scheme.onTertiaryContainer)};\n --mdw-color__error: ${cssVarFromArgb(scheme.error)};\n --mdw-color__on-error: ${cssVarFromArgb(scheme.onError)};\n --mdw-color__error-container: ${cssVarFromArgb(scheme.errorContainer)};\n --mdw-color__on-error-container: ${cssVarFromArgb(scheme.onErrorContainer)};\n --mdw-color__background: ${cssVarFromArgb(scheme.background)};\n --mdw-color__on-background: ${cssVarFromArgb(scheme.onBackground)};\n --mdw-color__surface: ${cssVarFromArgb(scheme.surface)};\n --mdw-color__on-surface: ${cssVarFromArgb(scheme.onSurface)};\n --mdw-color__surface-variant: ${cssVarFromArgb(scheme.surfaceVariant)};\n --mdw-color__on-surface-variant: ${cssVarFromArgb(scheme.onSurfaceVariant)};\n --mdw-color__outline: ${cssVarFromArgb(scheme.outline)};\n --mdw-color__outline-variant: ${cssVarFromArgb(scheme.outlineVariant)};\n --mdw-color__shadow: ${cssVarFromArgb(scheme.shadow)};\n --mdw-color__scrim: ${cssVarFromArgb(scheme.scrim)};\n --mdw-color__inverse-surface: ${cssVarFromArgb(scheme.inverseSurface)};\n --mdw-color__inverse-on-surface: ${cssVarFromArgb(scheme.inverseOnSurface)};\n --mdw-color__inverse-primary: ${cssVarFromArgb(scheme.inversePrimary)};\n }\n `;\n}\n\n/**\n * @param {string} name\n * @param {TonalPalette} tonalPalette\n * @param {boolean} [isDark]\n */\nfunction cssVariablesFromCustom(name, tonalPalette, isDark) {\n return /* css */`\n :root {\n --mdw-color__${name}: ${cssVarFromArgb(tonalPalette.tone(isDark ? 80 : 40))};\n --mdw-color__on-${name}: ${cssVarFromArgb(tonalPalette.tone(isDark ? 20 : 100))};\n --mdw-color__${name}-container: ${cssVarFromArgb(tonalPalette.tone(isDark ? 30 : 90))};\n --mdw-color__on-${name}-container: ${cssVarFromArgb(tonalPalette.tone(isDark ? 90 : 10))};\n }\n .mdw-custom[color=\"${name}\"] {\n --mdw-bg: var(--mdw-color__${name});\n --mdw-ink: var(--mdw-color__on-${name});\n }\n .mdw-custom[color=\"${name}-container\"] {\n --mdw-bg: var(--mdw-color__${name}-container);\n --mdw-ink: var(--mdw-color__on-${name}-container);\n }\n .mdw-custom[ink=\"${name}\"] {\n --mdw-ink: var(--mdw-color__${name});\n }\n \n \n `;\n}\n\n/**\n * @param {string} mainColor as hex\n * @param {Iterable<[string,string]>} [customColors]\n * @return {Record<string, string>}\n */\nexport function getScheme(mainColor, customColors = []) {\n const argbColor = argbFromHex(mainColor);\n const lightRules = [cssVariablesFromScheme(Scheme.light(argbColor))];\n const darkRules = [cssVariablesFromScheme(Scheme.dark(argbColor))];\n const lightContentRules = [cssVariablesFromScheme(Scheme.lightContent(argbColor))];\n const darkContentRules = [cssVariablesFromScheme(Scheme.darkContent(argbColor))];\n for (const [name, color] of customColors) {\n const argbCustom = argbFromHex(color);\n const blended = harmonize(argbCustom, argbColor);\n const { a1: tp } = CorePalette.of(blended);\n const { a1: ctp } = CorePalette.contentOf(blended);\n\n lightRules.push(cssVariablesFromCustom(name, tp));\n darkRules.push(cssVariablesFromCustom(name, tp, true));\n lightContentRules.push(cssVariablesFromCustom(name, ctp));\n darkContentRules.push(cssVariablesFromCustom(name, ctp, true));\n }\n return {\n light: lightRules.join('\\n'),\n dark: darkRules.join('\\n'),\n lightContent: lightContentRules.join('\\n'),\n darkContent: darkContentRules.join('\\n'),\n };\n}\n", "/**\n * Uses UTF-8 charset instead of base64 for better compression\n * @param {string} svg\n * @return {string}\n */\nexport function svgToCSSURL(svg) {\n return `url('data:image/svg+xml;charset=UTF-8,${svg\n .replaceAll('\\n', ' ')\n .replaceAll('#', '%23')\n .replaceAll('(', '%28')\n .replaceAll(')', '%29')}')`;\n}\n"],
5
- "mappings": "6rBAKO,SAAUA,GAAuBC,EAAQ,CAC9C,QAAWC,KAASD,EAClB,GAAIC,aAAiB,iBAAkB,CACrC,IAAMC,EAAQ,IAAI,cAClBA,EAAM,YAAYD,EAAM,WAAW,EACnC,MAAMC,UACGD,EAAM,UAAW,CAE1B,IAAMC,EAAQ,IAAI,cAClBA,EAAM,YAAY,CAAC,GAAGD,EAAM,QAAQ,EAAE,IAAK,GAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EACpE,MAAMC,OAEN,MAAMD,CAGZ,CAGA,IAAME,GAAuB,IAAI,QAO1B,SAAUC,GAA0BJ,EAAQ,CACjD,QAAWC,KAASD,EAClB,GAAIC,aAAiB,iBACnB,MAAMA,UACGA,EAAM,qBAAqB,iBAGpC,MAAMA,EAAM,UAAU,UAAU,EAAI,MAC/B,CACL,IAAII,EAAeF,GAAqB,IAAIF,CAAK,EAC5CI,IAEHA,EAAe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,EACF",
6
- "names": ["generateCSSStyleSheets", "styles", "style", "sheet", "styleElementWrappers", "generateHTMLStyleElements", "styleElement", "PREFIX", "generatedUIDs", "generateUID", "id", "identifierFromElement", "element", "mutate", "buildMergePatch", "previous", "current", "arrayStrategy", "isArray", "patch", "previousKeys", "key", "value", "changes", "hasMergePatch", "target", "attrValueFromDataValue", "value", "attrNameFromPropName", "name", "attrNameWords", "prev", "curr", "IS_FIREFOX", "isFocused", "element", "attemptFocus", "options", "isRtl", "DEFAULT_NULL_PARSER", "DEFAULT_BOOLEAN_PARSER", "v", "DEFAULT_NUMBER_PARSER", "DEFAULT_STRING_PARSER", "DEFAULT_OBJECT_PARSER", "o", "DEFAULT_OBJECT_COMPARATOR", "a", "b", "hasMergePatch", "DEFAULT_OBJECT_DIFF", "buildMergePatch", "emptyFromType", "type", "defaultParserFromType", "parseObserverOptions", "name", "typeOrOptions", "object", "options", "enumerable", "attr", "reflect", "empty", "changedCallback", "parsedType", "value", "parsed", "attrNameFromPropName", "parser", "nullParser", "parsedEmpty", "isFn", "diff", "INIT_SYMBOL", "DEFAULT_OBSERVER_CONFIGURATION", "observeFunction", "fn", "arg0", "args", "argPoked", "thisPoked", "buildProxy", "proxyTarget", "set", "prefix", "target", "p", "arg", "value", "argProxy", "thisProxy", "defaultValue", "reusable", "defineObservableProperty", "object", "key", "options", "config", "DEFAULT_OBSERVER_CONFIGURATION", "parseObserverOptions", "detectChange", "oldValue", "commit", "newValue", "changes", "internalGet", "internalSet", "onInvalidate", "props", "prop", "descriptor", "INIT_SYMBOL", "_inactiveDocument", "_cssStyleSheetConstructable", "generateFragment", "fromString", "inlineFunctions", "addInlineFunction", "fn", "internalName", "generateUID", "cssStyleSheetsCache", "styleElementCache", "css", "array", "substitutions", "content", "sheet", "style", "fragmentCache", "html", "strings", "tempSlots", "replacements", "sub", "tempId", "compiledString", "fragment", "id", "element", "STRING_INTERPOLATION_REGEX", "buildShadowRootChildListener", "fn", "event", "host", "flattenObject", "object", "syntax", "target", "scope", "key", "value", "scopedKey", "entryFromPropName", "prop", "source", "child", "valueFromPropName", "Composition", "parts", "generateFragment", "part", "listener", "set", "root", "changes", "context", "store", "fnResults", "modifiedNodes", "flattened", "rawValue", "entries", "id", "node", "nodeType", "props", "negate", "doubleNegate", "ref", "args", "lastIndexOfDot", "entry", "propSearchKey", "lastPropSearchKey", "propName", "index", "nodesFound", "childNode", "attached", "orphaned", "shouldShow", "metadata", "comment", "parent", "commentText", "#interpolateNode", "element", "defaults", "parsedValue", "nodeValue", "nodeName", "trimmed", "length", "segments", "segment", "newNode", "isEvent", "textNodeIndex", "prev", "identifierFromElement", "eventType", "flags", "type", "options", "inlineFunctions", "defaultValue", "inlineFunctionOptions", "observeResult", "observeFunction", "parsedNodeName", "removalList", "TREE_WALKER_FILTER", "treeWalker", "removeElement", "attr", "parentId", "nextNode", "watcher", "generateCSSStyleSheets", "generateHTMLStyleElements", "data", "rootEventTarget", "events", "eventTarget", "references", "anchorElement", "cloneTarget", "interpolatedElement", "parentElement", "referencedParent", "liveElement", "conditionalParent", "iterator", "nodeIdentifier", "reusable", "ICustomElement", "EVENT_PREFIX_REGEX", "_refsProxy", "_refsCache", "_refsCompositionCache", "_composition", "_template", "template_get", "_CustomElement", "ICustomElement", "args", "__privateAdd", "__publicField", "callback", "s", "config", "__privateGet", "__privateSet", "Composition", "collection", "parts", "composition", "array", "substitutions", "css", "schema", "elementName", "strings", "html", "source", "options", "name", "value", "mixin", "force", "typeOrOptions", "customCallback", "oldValue", "newValue", "changes", "defineObservableProperty", "prop", "props", "propWatchers", "watcher", "index", "listeners", "key", "listenerOptions", "flags", "type", "listenerMap", "id", "nameOrCallbacks", "callbacks", "fn", "arrayPropName", "data", "store", "stringValue", "previousDataValue", "parsedValue", "reflect", "attr", "dataValue", "attrValue", "attrValueFromDataValue", "target", "element", "formattedId", "attrNameFromPropName", "listener", "e", "addInlineFunction", "CustomElement", "DensityMixin", "Base", "ShapeMixin", "Base", "ThemableMixin", "Base", "Badge_default", "CustomElement", "ThemableMixin", "DensityMixin", "ShapeMixin", "FlexableMixin", "Base", "Box_default", "CustomElement", "ThemableMixin", "FlexableMixin", "Body_default", "Box_default", "AriaReflectorMixin", "Base", "name", "value", "attrName", "oldValue", "newValue", "DEFAULT_ELEMENT_QUERY", "KeyboardNavMixin", "Base", "current", "loop", "reverse", "foundCurrent", "array", "candidate", "attemptFocus", "options", "currentlyFocusedChild", "currentTabIndexChild", "firstFocusableChild", "child", "event", "currentItem", "item", "isRtl", "AriaToolbarMixin", "Base", "KeyboardNavMixin", "SurfaceMixin", "Base", "hoveredState", "pressedState", "elevated", "elevation", "disabledState", "color", "Surface_default", "CustomElement", "ThemableMixin", "FlexableMixin", "SurfaceMixin", "ShapeMixin", "surface", "shape", "surfaceTint", "BottomAppBar_default", "Surface_default", "AriaToolbarMixin", "AriaReflectorMixin", "svgAliasMap", "unaliased", "documentLoadedStyleSheets", "Icon", "CustomElement", "ThemableMixin", "_slottedText", "result", "svgPath", "_svgAlias", "viewBox", "svg", "_computedSVGPath", "src", "currentTarget", "href", "parentNode", "link", "name", "path", "width", "height", "DOMString", "FORM_IPC_EVENT", "FormAssociatedMixin", "Base", "oldValue", "newValue", "_invalid", "v", "_formDisabled", "disabled", "error", "key", "value", "newTarget", "form", "event", "state", "mode", "ControlMixin", "Base", "_Control", "FormAssociatedMixin", "args", "name", "oldValue", "newValue", "ariaLabel", "options", "v", "validityState", "newValidity", "key", "error", "Control", "__publicField", "template", "html", "currentTarget", "control", "IMPLICIT_SUBMISSION_BLOCKING_TYPES", "InputMixin", "Base", "_input", "input_get", "_Input", "ControlMixin", "__privateAdd", "name", "oldValue", "newValue", "__privateGet", "event", "form", "defaultButton", "submissionBlockers", "element", "value", "Input", "__publicField", "__superGet", "label", "input", "DOMString", "_checkedDirty", "defaultChecked", "_checked", "eventHandlerValues", "EVENT_HANDLER_TYPE", "v", "name", "oldValue", "newValue", "button", "fn", "eventName", "elementStylerLastAnimation", "elementStylerValues", "elementStylerHasQueue", "elementStylerRAFCallback", "previousAnimation", "value", "currentAnimation", "ELEMENT_STYLER_TYPE", "oldValue", "newValue", "hasQueue", "Ripple_default", "CustomElement", "oldValue", "newValue", "ELEMENT_STYLER_TYPE", "_positionX", "_positionY", "_radius", "x", "y", "size", "hypotenuse", "parentWidth", "parentHeight", "width", "height", "animationName", "RippleMixin", "Base", "element", "ripple", "x", "y", "hold", "rippleContainer", "Ripple_default", "event", "rect", "lastRipple", "oldValue", "pressed", "lastInteractionWasTouch", "StateMixin", "Base", "disabled", "_hovered", "_focused", "_pressed", "_lastInteraction", "event", "Button_default", "CustomElement", "ThemableMixin", "DensityMixin", "SurfaceMixin", "ShapeMixin", "StateMixin", "RippleMixin", "InputMixin", "icon", "svg", "src", "svgPath", "shape", "surfaceTint", "state", "rippleContainer", "surface", "control", "label", "slot", "currentTarget", "value", "form", "duplicatedButton", "SUPPORTS_INERT", "Card_default", "CustomElement", "FlexableMixin", "SurfaceMixin", "ShapeMixin", "FormAssociatedMixin", "StateMixin", "AriaReflectorMixin", "EVENT_HANDLER_TYPE", "disabledState", "slot", "surface", "surfaceTint", "shape", "outline", "CheckboxIcon_default", "CustomElement", "ThemableMixin", "ShapeMixin", "value", "html", "outline", "shape", "TouchTargetMixin", "Base", "Checkbox_default", "CustomElement", "ThemableMixin", "StateMixin", "RippleMixin", "InputMixin", "TouchTargetMixin", "indeterminate", "checked", "indeterminateIcon", "icon", "html", "label", "control", "state", "rippleContainer", "touchTarget", "Chip_default", "Button_default", "inline", "slot", "outline", "icon", "ink", "iconInk", "Divider_default", "CustomElement", "ThemableMixin", "DialogActions_default", "CustomElement", "handleTabKeyPress", "event", "focusableElements", "foundTarget", "candidate", "el", "OPEN_DIALOGS", "supportsHTMLDialogElement", "Dialog_default", "CustomElement", "event", "currentTarget", "hasContent", "node", "returnValue", "form", "e", "lastOpenDialog", "key", "value", "cancelEvent", "main", "stackIndex", "stack", "index", "source", "previousFocus", "title", "newState", "previousState", "dialogStack", "focusElement", "d", "open", "surface", "context", "handleTabKeyPress", "ExtendedFab_default", "Button_default", "Tooltip_default", "Surface_default", "AriaReflectorMixin", "oldValue", "newValue", "canAnchorPopup", "options", "pageX", "pageY", "directionX", "directionY", "clientX", "clientY", "anchor", "rect", "width", "height", "popup", "offsetX", "offsetY", "margin", "TooltipTriggerMixin", "Base", "_tooltip", "_idleDebounce", "_pendingHide", "_watchedParents", "_resizeObserver", "_intersectObserver", "_TooltipTrigger", "args", "__privateAdd", "__publicField", "event", "__privateSet", "__privateGet", "entries", "threshold", "entry", "child", "type", "timeout", "touch", "offsetParent", "parent", "hoverStyle", "domRect", "anchorOptions", "isPageRTL", "xStart", "xEnd", "preferences", "anchorResult", "preference", "canAnchorPopup", "TooltipTrigger", "template", "html", "Fab_default", "ExtendedFab_default", "TooltipTriggerMixin", "slot", "tooltipSlot", "control", "shape", "icon", "FilterChip_default", "Chip_default", "trailingIcon", "dropdown", "trailingSrc", "shape", "icon", "control", "outline", "slot", "checkIcon", "Headline_default", "Box_default", "ThemableMixin", "ariaLevel", "size", "slot", "IconButton_default", "Button_default", "TooltipTriggerMixin", "type", "checked", "event", "input", "clickEvent", "slot", "shape", "tooltipSlot", "icon", "label", "surfaceTint", "control", "outline", "el", "TextFieldMixin", "Base", "DensityMixin", "ShapeMixin", "error", "_invalid", "filled", "outlined", "label", "placeholder", "supporting", "_validationMessage", "value", "_badInput", "template", "html", "inline", "control", "labelElement", "outline", "shape", "outlineLeft", "outlineRight", "state", "shapeTop", "oldValue", "newValue", "Input_default", "CustomElement", "ThemableMixin", "StateMixin", "InputMixin", "TextFieldMixin", "Label_default", "Box_default", "Layout_default", "CustomElement", "List_default", "Box_default", "DensityMixin", "AriaReflectorMixin", "RadioIcon_default", "CustomElement", "ThemableMixin", "ShapeMixin", "value", "outline", "ListItem_default", "CustomElement", "ThemableMixin", "StateMixin", "RippleMixin", "AriaReflectorMixin", "disabled", "href", "state", "rippleContainer", "anchor", "oldValue", "newValue", "currentTarget", "_ListOption", "ListItem_default", "_selectedDirty", "defaultSelected", "_selected", "value", "_formDisabled", "disabled", "formDisabled", "options", "inline", "anchor", "state", "content", "disabledState", "selected", "text", "ListOption", "constructHTMLOptionsCollectionProxy", "host", "collection", "OptionConstructor", "GroupConstructor", "add", "element", "before", "beforeElement", "index", "remove", "i", "value", "target", "p", "receiver", "newValue", "currentSize", "_ListSelect", "List_default", "StateMixin", "FormAssociatedMixin", "KeyboardNavMixin", "el", "event", "host", "index", "ListOption", "target", "selections", "firstSelection", "constructHTMLOptionsCollectionProxy", "value", "v", "ListSelect", "oldValue", "newValue", "supportsHTMLDialogElement", "OPEN_MENUS", "onWindowResize", "lastOpenMenu", "onPopState", "event", "key", "onBeforeUnload", "Menu_default", "CustomElement", "DensityMixin", "KeyboardNavMixin", "items", "submenuItems", "el", "value", "open", "firstItem", "attemptFocus", "anchor", "surface", "newSize", "anchorOptions", "isPageRTL", "xStart", "xEnd", "preferences", "anchorResult", "preference", "canAnchorPopup", "source", "previousFocus", "newState", "previousState", "scrollRestoration", "returnFocus", "main", "len", "entry", "cascader", "activeElement", "MenuItem", "ListOption", "FormAssociatedMixin", "value", "event", "name", "trailingIcon", "cascades", "oldValue", "newValue", "submenuElement", "inline", "html", "checkboxRef", "radioRef", "anchor", "trailing", "checkbox", "radio", "ScrollListenerMixin", "Base", "event", "scroller", "element", "NavItem", "CustomElement", "ThemableMixin", "StateMixin", "RippleMixin", "ShapeMixin", "options", "active", "ariaLabel", "href", "html", "shape", "state", "rippleContainer", "key", "repeat", "args", "Nav_default", "Surface_default", "event", "NavItem", "el", "NavBar_default", "Nav_default", "ScrollListenerMixin", "ELEMENT_STYLER_TYPE", "_translateY", "_transition", "max", "visibility", "resizeObserver", "oldValue", "newValue", "shift", "breakpoint", "NavBarItem_default", "NavItem", "NavRail_default", "Nav_default", "html", "slot", "NavDrawer_default", "NavRail_default", "NavDrawerItem_default", "NavItem", "html", "NavRailItem_default", "NavItem", "Pane_default", "CustomElement", "ThemableMixin", "Progress_default", "CustomElement", "ThemableMixin", "value", "max", "oldValue", "newValue", "Radio_default", "CustomElement", "ThemableMixin", "StateMixin", "RippleMixin", "InputMixin", "TouchTargetMixin", "html", "label", "rippleContainer", "state", "control", "touchTarget", "SegmentedButton_default", "Button_default", "html", "inline", "shape", "icon", "outline", "control", "slot", "state", "type", "checked", "SegmentedButtonGroup_default", "Box_default", "KeyboardNavMixin", "AriaReflectorMixin", "SegmentedButton_default", "child", "index", "list", "_Select", "CustomElement", "ThemableMixin", "StateMixin", "ControlMixin", "TextFieldMixin", "event", "select", "child", "template", "slot", "prefix", "suffix", "control", "Select", "__publicField", "__superGet", "parseFloat", "value", "onNaN", "number", "valueAsFraction", "min", "max", "nValue", "nMin", "nMax", "Slider_default", "CustomElement", "ThemableMixin", "StateMixin", "InputMixin", "event", "input", "offsetX", "clientX", "pageX", "isActive", "isTouch", "touch", "clientWidth", "position", "step", "nStep", "currentValue", "roundedValue", "scale", "thumbOffset", "thumbMin", "thumbMax", "currentTarget", "ticks", "_previewValue", "template", "html", "state", "label", "control", "_isHoveringThumb", "focusedState", "oldValue", "newValue", "Snackbar_default", "Surface_default", "DensityMixin", "AriaReflectorMixin", "EVENT_HANDLER_TYPE", "resolve", "text", "content", "slot", "Shape_default", "Box_default", "ShapeMixin", "shape", "outline", "SwitchIcon_default", "CustomElement", "ThemableMixin", "ShapeMixin", "selected", "value", "disabled", "pressed", "focused", "hovered", "color", "_active", "icon", "src", "unselectedIcon", "unselectedSrc", "outline", "track", "oldValue", "newValue", "Switch_default", "CustomElement", "ThemableMixin", "InputMixin", "StateMixin", "TouchTargetMixin", "html", "state", "label", "control", "touchTarget", "event", "input", "offsetX", "clientX", "pageX", "isActive", "touch", "clientWidth", "position", "currentValue", "pixels", "currentPixels", "newRatio", "newValue", "Tab_default", "CustomElement", "ShapeMixin", "StateMixin", "RippleMixin", "ScrollListenerMixin", "slot", "target", "options", "href", "active", "disabledState", "data", "shape", "rippleContainer", "state", "event", "el", "registeredElements", "rtlObserver", "RTLObserverMixin", "Base", "isRTL", "el", "resizeObserver", "entries", "entry", "ResizeObserverMixin", "Base", "TabList_default", "CustomElement", "ThemableMixin", "KeyboardNavMixin", "ResizeObserverMixin", "RTLObserverMixin", "ShapeMixin", "value", "oldValue", "newValue", "Tab_default", "tab", "index", "el", "width", "position", "animate", "percentage", "metrics", "clamped", "decimalIndex", "leftIndex", "rightIndex", "leftMetrics", "rightMetrics", "activeTab", "center", "leftRatio", "rightRatio", "leftWidth", "rightWidth", "activeIndex", "distance", "tabContent", "start", "max", "shape", "indicator", "target", "TabPanel_default", "Box_default", "AriaReflectorMixin", "oldValue", "newValue", "TabContent_default", "CustomElement", "ResizeObserverMixin", "panel", "index", "value", "el", "start", "width", "end", "metric", "percentage", "event", "slot", "TabPanel_default", "_updatingSlot", "_textarea", "_TextArea", "CustomElement", "ThemableMixin", "StateMixin", "ControlMixin", "TextFieldMixin", "ResizeObserverMixin", "__privateAdd", "currentTarget", "textarea", "previousValue", "child", "newValue", "__privateGet", "lineHeight", "lastClientHeight", "value", "entry", "TextArea", "control", "oldValue", "__publicField", "__superGet", "DOMString", "Title_default", "Headline_default", "ariaLevel", "size", "TopAppBar_default", "CustomElement", "ThemableMixin", "SurfaceMixin", "AriaToolbarMixin", "ScrollListenerMixin", "ResizeObserverMixin", "oldValue", "newValue", "ELEMENT_STYLER_TYPE", "hideOnScroll", "_cssPosition", "_translateY", "_duration", "_easing", "size", "_headlineOpacity", "inline", "surface", "leading", "headline", "trailing", "ariaLabel", "max", "min", "_visibleStart", "value", "resizeObserver", "loader_exports", "theming_exports", "__export", "generateColorCSS", "generateShapeCSS", "generateThemeCSS", "generateTypographyCSS", "generateTypographyGlobalCSS", "setupTheme", "themeOptionsFromSearchParams", "COLOR_KEYWORDS", "signum", "num", "lerp", "start", "stop", "amount", "clampInt", "min", "max", "input", "sanitizeDegreesDouble", "degrees", "rotationDirection", "from", "to", "differenceDegrees", "a", "b", "matrixMultiply", "row", "matrix", "c", "SRGB_TO_XYZ", "XYZ_TO_SRGB", "WHITE_POINT_D65", "argbFromRgb", "red", "green", "blue", "argbFromLinrgb", "linrgb", "r", "delinearized", "g", "b", "redFromArgb", "argb", "greenFromArgb", "blueFromArgb", "argbFromXyz", "x", "y", "z", "matrix", "XYZ_TO_SRGB", "linearR", "linearG", "linearB", "r", "delinearized", "g", "b", "argbFromRgb", "xyzFromArgb", "argb", "linearized", "redFromArgb", "greenFromArgb", "blueFromArgb", "matrixMultiply", "SRGB_TO_XYZ", "argbFromLstar", "lstar", "y", "yFromLstar", "component", "delinearized", "argbFromRgb", "lstarFromArgb", "argb", "xyzFromArgb", "labF", "labInvf", "linearized", "rgbComponent", "normalized", "clampInt", "whitePointD65", "WHITE_POINT_D65", "kappa", "ft", "ft3", "_ViewingConditions", "whitePoint", "whitePointD65", "adaptingLuminance", "yFromLstar", "backgroundLstar", "surround", "discountingIlluminant", "xyz", "rW", "gW", "bW", "f", "c", "lerp", "d", "nc", "rgbD", "k", "k4", "k4F", "fl", "n", "z", "nbb", "ncb", "rgbAFactors", "rgbA", "aw", "fLRoot", "ViewingConditions", "__publicField", "Cam16", "hue", "chroma", "j", "q", "m", "s", "jstar", "astar", "bstar", "other", "dJ", "dA", "dB", "argb", "ViewingConditions", "viewingConditions", "red", "green", "blue", "redL", "linearized", "greenL", "blueL", "x", "y", "z", "rC", "gC", "bC", "rD", "gD", "bD", "rAF", "gAF", "bAF", "rA", "signum", "gA", "bA", "a", "b", "u", "p2", "atanDegrees", "hueRadians", "huePrime", "eHue", "alpha", "c", "mstar", "h", "t", "hRad", "ac", "p1", "hSin", "hCos", "gamma", "rCBase", "gCBase", "bCBase", "rF", "gF", "bF", "argbFromXyz", "SCALED_DISCOUNT_FROM_LINRGB", "LINRGB_FROM_SCALED_DISCOUNT", "Y_FROM_LINRGB", "CRITICAL_PLANES", "sanitizeRadians", "angle", "trueDelinearized", "rgbComponent", "normalized", "delinearized", "chromaticAdaptation", "component", "af", "signum", "hueOf", "linrgb", "scaledDiscount", "matrixMultiply", "rA", "gA", "bA", "a", "b", "areInCyclicOrder", "c", "deltaAB", "deltaAC", "intercept", "source", "mid", "target", "lerpPoint", "t", "setCoordinate", "coordinate", "axis", "isBounded", "x", "nthVertex", "y", "n", "kR", "kG", "kB", "coordA", "coordB", "g", "r", "bisectToSegment", "targetHue", "left", "right", "leftHue", "rightHue", "initialized", "uncut", "midHue", "midpoint", "criticalPlaneBelow", "criticalPlaneAbove", "bisectToLimit", "segment", "lPlane", "rPlane", "i", "mPlane", "midPlaneCoordinate", "inverseChromaticAdaptation", "adapted", "adaptedAbs", "base", "findResultByJ", "hueRadians", "chroma", "j", "viewingConditions", "ViewingConditions", "tInnerCoeff", "p1", "hSin", "hCos", "iterationRound", "jNormalized", "p2", "gamma", "rCScaled", "gCScaled", "bCScaled", "fnj", "argbFromLinrgb", "solveToInt", "hueDegrees", "lstar", "argbFromLstar", "sanitizeDegreesDouble", "yFromLstar", "exactAnswer", "Hct", "hue", "chroma", "tone", "solveToInt", "argb", "newHue", "newChroma", "newTone", "cam", "Cam16", "lstarFromArgb", "TonalPalette", "#cache", "argb", "hct", "Hct", "hue", "chroma", "tone", "CorePalette", "argb", "isContent", "hct", "Hct", "hue", "chroma", "TonalPalette", "_lightFromCorePalette", "lightFromCorePalette_fn", "_darkFromCorePalette", "darkFromCorePalette_fn", "_Scheme", "primary", "onPrimary", "primaryContainer", "onPrimaryContainer", "secondary", "onSecondary", "secondaryContainer", "onSecondaryContainer", "tertiary", "onTertiary", "tertiaryContainer", "onTertiaryContainer", "error", "onError", "errorContainer", "onErrorContainer", "background", "onBackground", "surface", "onSurface", "surfaceVariant", "onSurfaceVariant", "outline", "outlineVariant", "shadow", "scrim", "inverseSurface", "inverseOnSurface", "inversePrimary", "argb", "_a", "__privateMethod", "CorePalette", "object", "scheme", "Scheme", "core", "__privateAdd", "harmonize", "designColor", "sourceColor", "fromHct", "Hct", "toHct", "differenceDegrees", "rotationDegrees", "outputHue", "sanitizeDegreesDouble", "rotationDirection", "parseIntHex", "value", "argbFromHex", "hex", "isThree", "isSix", "isEight", "r", "g", "b", "cssVarFromArgb", "argb", "redFromArgb", "greenFromArgb", "blueFromArgb", "cssVariablesFromScheme", "scheme", "cssVariablesFromCustom", "name", "tonalPalette", "isDark", "getScheme", "mainColor", "customColors", "argbColor", "argbFromHex", "lightRules", "Scheme", "darkRules", "lightContentRules", "darkContentRules", "color", "argbCustom", "blended", "harmonize", "tp", "CorePalette", "ctp", "svgToCSSURL", "svg", "getShapeMaskSVG", "shape", "getShapeCornerSVGs", "corner", "convex", "path", "getShapeEdgesSVGs", "CIRCLE_PATH", "DIAMOND_PATH", "SQUIRCLE_PATH", "SHAPE_ROUNDED_DEFAULT", "CIRCLE_PATH", "SHAPE_CUT_DEFAULT", "DIAMOND_PATH", "SHAPE_SQUIRCLE_DEFAULT", "SQUIRCLE_PATH", "SP", "TYPOGRAPHY_DEFAULT", "generateTypographyCSS", "config", "generateTypographyGlobalCSS", "style", "size", "generateShapeCSS", "svgToCSSURL", "getShapeMaskSVG", "getShapeCornerSVGs", "getShapeEdgesSVGs", "addStyle", "content", "element", "generateColorCSS", "color", "custom", "lightness", "parsedColors", "name", "hex", "COLOR_KEYWORDS", "scheme", "getScheme", "setupTheme", "themeOptionsFromSearchParams", "searchParams", "c", "generateThemeCSS", "shapeCss", "typographyCss", "colorCss", "rules", "generateThemeCSS", "themeOptionsFromSearchParams", "generateTypographyGlobalCSS", "parsed", "css"]
4
+ "sourcesContent": ["/**\n * @param {Iterable<HTMLStyleElement|CSSStyleSheet>} styles\n * @yields composed CSSStyleSheet\n * @return {Generator<CSSStyleSheet>} composed CSSStyleSheet\n */\nexport function* generateCSSStyleSheets(styles) {\n for (const style of styles) {\n if (style instanceof HTMLStyleElement) {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(style.textContent);\n yield sheet;\n } else if (style.ownerNode) {\n console.warn('Stylesheet is part of style');\n const sheet = new CSSStyleSheet();\n sheet.replaceSync([...style.cssRules].map((r) => r.cssText).join(''));\n yield sheet;\n } else {\n yield style;\n }\n }\n}\n\n/** @type {WeakMap<CSSStyleSheet, HTMLStyleElement>} */\nconst styleElementWrappers = new WeakMap();\n\n/**\n * @param {Iterable<HTMLStyleElement|CSSStyleSheet>} styles\n * @yields composed HTMLStyleElement\n * @return {Generator<HTMLStyleElement>} composed CSSStyleSheet\n */\nexport function* generateHTMLStyleElements(styles) {\n for (const style of styles) {\n if (style instanceof HTMLStyleElement) {\n yield style;\n } else if (style.ownerNode instanceof HTMLStyleElement) {\n // console.log('Cloning parent HTMLStyleElement instead');\n // @ts-ignore Skip cast\n yield style.ownerNode.cloneNode(true);\n } else {\n let styleElement = styleElementWrappers.get(style);\n if (!styleElement) {\n console.warn('Manually constructing HTMLStyleElement', [...style.cssRules].map((r) => r.cssText).join('\\n'));\n styleElement = document.createElement('style');\n styleElement.textContent = [...style.cssRules].map((r) => r.cssText).join('');\n styleElementWrappers.set(style, styleElement);\n }\n // @ts-ignore Skip cast\n yield styleElement.cloneNode(true);\n }\n }\n}\n", "const PREFIX = '_mdw-';\n\n/** @type {Set<string>} */\nconst generatedUIDs = new Set();\n\n/** @return {string} */\nexport function generateUID() {\n const id = Math.random().toString(36).slice(2, 10);\n if (generatedUIDs.has(id)) {\n return generateUID();\n }\n generatedUIDs.add(id);\n return id;\n}\n\n/**\n * @param {Element} element\n * @param {boolean} [mutate=false]\n * @return {string}\n */\nexport function identifierFromElement(element, mutate) {\n if (element.id) {\n return element.id;\n }\n if (!mutate) {\n return null;\n }\n const id = PREFIX + generateUID();\n element.id = id;\n return id;\n}\n\n/**\n * @param {string} identifier\n * @param {Element} element\n * @return {boolean}\n */\nexport function identifierMatchesElement(identifier, element) {\n return element.id === identifier;\n}\n", "/** @link https://www.rfc-editor.org/rfc/rfc7396 */\n\n/**\n * @template T1\n * @template T2\n * @param {T1} target\n * @param {T2} patch\n * @return {T1|T2|(T1 & T2)}\n */\nexport function applyMergePatch(target, patch) {\n if (target === patch) return target;\n if (patch == null || typeof patch !== 'object') return patch;\n if (target != null && typeof target !== 'object') {\n target = {};\n }\n for (const [key, value] of Object.entries(patch)) {\n if (value == null) {\n if (key in target) {\n delete target[key];\n }\n } else {\n target[key] = applyMergePatch(target[key], value);\n }\n }\n return target;\n}\n\n/**\n * Creates a JSON Merge patch based\n * Allows different strategies for arrays\n * - `clone`: Per spec, clones all entries with no inspection.\n * - `object`: Convert to flattened, array-like objects. Requires\n * consumer of patch to be aware of the schema beforehand.\n * @param {object|number|string|boolean} previous\n * @param {object|number|string|boolean} current\n * @param {'clone'|'object'} [arrayStrategy='clone']\n * @return {any} Patch\n */\nexport function buildMergePatch(previous, current, arrayStrategy = 'clone') {\n if (previous === current) return null;\n if (current == null || typeof current !== 'object') return current;\n if (previous == null || typeof previous !== 'object') {\n return structuredClone(current);\n }\n const isArray = Array.isArray(current);\n if (isArray && arrayStrategy === 'clone') {\n return structuredClone(current);\n }\n\n const patch = {};\n const previousKeys = new Set(Object.keys(previous));\n for (const [key, value] of Object.entries(current)) {\n previousKeys.delete(key);\n if (value == null) {\n console.warn('Nullish value found at', key);\n continue;\n }\n const changes = buildMergePatch(previous[key], value, arrayStrategy);\n if (changes === null) {\n console.log('keeping', key);\n } else {\n patch[key] = changes;\n }\n }\n for (const key of previousKeys) {\n patch[key] = null;\n console.log('removing', key);\n }\n\n if (isArray && arrayStrategy === 'object' && current.length !== previous.length) {\n patch.length = current.length;\n }\n\n return patch;\n}\n\n/**\n * Short-circuited JSON Merge Patch evaluation\n * @template T\n * @param {T} target\n * @param {Partial<T>} patch\n * @return {boolean}\n */\nexport function hasMergePatch(target, patch) {\n if (target === patch) return false;\n if (patch == null || typeof patch !== 'object') return true;\n if (target != null && typeof target !== 'object') {\n return true;\n }\n for (const [key, value] of Object.entries(patch)) {\n if (value == null) {\n if (key in target) {\n return true;\n }\n } else if (hasMergePatch(target[key], value)) {\n return true;\n }\n }\n return false;\n}\n", "/* eslint-disable no-bitwise */\n\n/**\n * @param {any} value\n * @return {?string}\n */\nexport function attrValueFromDataValue(value) {\n switch (value) {\n case undefined:\n case null:\n case false:\n return null;\n case true:\n return '';\n default:\n return `${value}`;\n }\n}\n\n/**\n * Converts property name to attribute name\n * (Similar to DOMStringMap)\n * @param {string} name\n * @return {string}\n */\nexport function attrNameFromPropName(name) {\n const attrNameWords = name.split(/([A-Z])/);\n if (attrNameWords.length === 1) return name;\n return attrNameWords.reduce((prev, curr) => {\n if (prev == null) return curr;\n if (curr.length === 1 && curr.toUpperCase() === curr) {\n return `${prev}-${curr.toLowerCase()}`;\n }\n return prev + curr;\n });\n}\n\nconst IS_FIREFOX = globalThis?.navigator?.userAgent.includes('Firefox');\n\n/**\n * @param {Element} element\n * @return {boolean}\n */\nexport function isFocused(element) {\n if (!element) return false;\n if (IS_FIREFOX && element.constructor.formAssociated && element.hasAttribute('disabled')) {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1818287\n console.warn('Firefox bug 1818287: Disabled form associated custom element cannot receive focus.');\n return false;\n }\n if (document.activeElement === element) return true;\n if (!element.isConnected) return false;\n if (element?.getRootNode() === document) return false; // isInLightDOM\n // console.debug('checking shadowdom', element, element.matches(':focus'));\n return element.matches(':focus');\n}\n\n/**\n * @param {HTMLElement|Element} element\n * @param {Parameters<HTMLElement['focus']>} [options]\n * @return {boolean} Focus was successful\n */\nexport function attemptFocus(element, ...options) {\n if (!element) return false;\n try {\n // @ts-expect-error Use catch if not HTMLElement\n element.focus(...options);\n } catch (e) {\n console.error(e);\n return false;\n // Ignore error.\n }\n return isFocused(element);\n}\n\n/**\n * @param {Element} element\n * @return {boolean}\n */\nexport function isRtl(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n", "import { buildMergePatch, hasMergePatch } from '../utils/jsonMergePatch.js';\n\nimport { attrNameFromPropName } from './dom.js';\n\n/** @typedef {import('./typings.js').ObserverPropertyType} ObserverPropertyType */\n\n/** @return {null} */\nconst DEFAULT_NULL_PARSER = () => null;\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion\n * @param {any} v\n * @return {boolean}\n */\nconst DEFAULT_BOOLEAN_PARSER = (v) => !!v;\n\n/**\n * Doesn't support `BigInt` types\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion\n * @param {any} v\n * @return {number}\n */\nconst DEFAULT_NUMBER_PARSER = (v) => +v;\n\n/**\n * Doesn't support `Symbol` types\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion\n * @param {any} v\n * @return {string}\n */\nconst DEFAULT_STRING_PARSER = (v) => `${v}`;\n\n/**\n * @template T\n * @param {T} o\n * @return {T}\n */\nconst DEFAULT_OBJECT_PARSER = (o) => o;\n\n/**\n * @template T\n * @param {T} a\n * @param {T} b\n * @return {boolean} true if equal\n */\nexport const DEFAULT_OBJECT_COMPARATOR = (a, b) => !hasMergePatch(a, b);\n\n/**\n * @template T\n * @param {T} a\n * @param {T} b\n * @return {boolean} true if equal\n */\nexport const DEFAULT_OBJECT_DIFF = (a, b) => buildMergePatch(a, b, 'object');\n\n/**\n * @param {ObserverPropertyType} type\n * @return {any}\n */\nfunction emptyFromType(type) {\n switch (type) {\n case 'boolean':\n return false;\n case 'integer':\n case 'float':\n return 0;\n case 'map':\n return new Map();\n case 'set':\n return new Set();\n case 'array':\n return [];\n case 'object':\n return null;\n default:\n case 'string':\n return '';\n }\n}\n\n/**\n * @param {ObserverPropertyType} type\n * @return {any}\n */\nfunction defaultParserFromType(type) {\n switch (type) {\n case 'boolean':\n return DEFAULT_BOOLEAN_PARSER;\n case 'integer':\n // Calls ToNumber(x)\n return Math.round;\n case 'float':\n return DEFAULT_NUMBER_PARSER;\n case 'map':\n return Map;\n case 'set':\n return Set;\n case 'object':\n return DEFAULT_OBJECT_PARSER;\n case 'array':\n return Array.from;\n default:\n case 'string':\n return DEFAULT_STRING_PARSER;\n }\n}\n\n/**\n * @template {string} K\n * @template {ObserverPropertyType} [T1=any]\n * @template {any} [T2=import('./typings.js').ParsedObserverPropertyType<T1>]\n * @param {K} name\n * @param {T1|import('./typings.js').ObserverOptions<T1,T2>} [typeOrOptions='string']\n * @param {any} object\n * @return {import('./typings.js').ObserverConfiguration<T1,T2,K> & import('./typings.js').ObserverOptions<T1,T2>}\n */\nexport function parseObserverOptions(name, typeOrOptions, object) {\n /** @type {Partial<import('./typings.js').ObserverOptions<T1,T2>>} */\n const options = {\n ...((typeof typeOrOptions === 'string') ? { type: typeOrOptions } : typeOrOptions),\n };\n\n let { enumerable, attr, reflect } = options;\n const { type, empty, changedCallback } = options;\n\n /** @type {ObserverPropertyType} */\n let parsedType = type;\n if (parsedType == null) {\n // Use .value or .get() to parse type\n const value = options.value ?? empty ?? options.get?.call(object ?? {}, object ?? {});\n if (value == null) {\n parsedType = 'string';\n } else {\n const parsed = typeof value;\n parsedType = (parsed === 'number')\n ? (Number.isInteger(value) ? 'integer' : 'number')\n : parsed;\n }\n }\n\n enumerable ??= name[0] !== '_';\n reflect ??= enumerable ? parsedType !== 'object' : (attr ? 'write' : false);\n attr ??= (reflect ? attrNameFromPropName(name) : null);\n\n // if defined ? value\n // else if boolean ? false\n // else if onNullish ? false\n // else if empty == null\n const parser = options.parser ?? defaultParserFromType(parsedType);\n let nullParser = options.nullParser;\n let parsedEmpty = empty ?? null;\n if (!nullParser) {\n const nullable = options.nullable ?? (\n parsedType === 'boolean'\n ? false\n : (empty == null));\n if (nullable) {\n nullParser = DEFAULT_NULL_PARSER;\n } else {\n parsedEmpty ??= emptyFromType(parsedType);\n nullParser = parsedEmpty === null ? () => emptyFromType(parsedType) : () => parsedEmpty;\n }\n }\n\n let isFn = options.is;\n if (!isFn) {\n isFn = parsedType === 'object'\n ? DEFAULT_OBJECT_COMPARATOR\n : Object.is;\n }\n\n const diff = 'diff' in options\n ? options.diff\n : ((parsedType === 'object') ? DEFAULT_OBJECT_DIFF : null);\n\n return {\n ...options,\n type: parsedType,\n is: isFn,\n diff,\n attr,\n reflect,\n readonly: options.readonly ?? false,\n enumerable,\n value: options.value ?? parsedEmpty,\n parser,\n nullParser,\n key: name,\n changedCallback,\n watchers: options.watchers ?? [],\n values: options.values ?? new WeakMap(),\n validValues: options.validValues ?? new WeakMap(),\n attributeChangedCallback: options.attributeChangedCallback,\n };\n}\n\nconst INIT_SYMBOL = Symbol('PROP_INIT');\n\n/** @type {Partial<import('./typings.js').ObserverConfiguration<?,?,?>>} */\nconst DEFAULT_OBSERVER_CONFIGURATION = {\n nullParser: DEFAULT_NULL_PARSER,\n is: Object.is,\n INIT_SYMBOL,\n};\n\n/**\n * @this {import('./typings.js').ObserverConfiguration<?,?,?>}\n * @param {*} value\n */\nexport function parsePropertyValue(value) {\n let newValue = value;\n newValue = value == null\n ? this.nullParser.call(this, value)\n : this.parser.call(this, newValue);\n}\n\n/**\n * @param {(data: Partial<any>) => any} fn\n * @param {any} arg0\n * @param {any} args[]\n * @param {...any} args\n * @this {any}\n * @return {{props:Set<string>, defaultValue:any, reusable: boolean}}\n */\nexport function observeFunction(fn, arg0, ...args) {\n const argPoked = new Set();\n const thisPoked = new Set();\n\n /**\n * @template {Object} T\n * @param {T} proxyTarget\n * @param {Set<string>} set\n * @param {string} [prefix]\n * @return {T}\n */\n function buildProxy(proxyTarget, set, prefix) {\n return new Proxy(proxyTarget, {\n get(target, p) {\n const arg = prefix ? `${prefix}.${p}` : p;\n set.add(arg);\n const value = Reflect.get(target, p);\n if (typeof value === 'object' && value != null) {\n console.debug('tried to arg poke object get', p, value);\n return buildProxy(value, set, arg);\n }\n return value;\n },\n has(target, p) {\n const arg = prefix ? `${prefix}.p` : p;\n set.add(arg);\n const value = Reflect.has(target, p);\n return value;\n },\n });\n }\n\n const argProxy = buildProxy(arg0, argPoked);\n const thisProxy = buildProxy(this ?? arg0, thisPoked);\n const defaultValue = fn.call(thisProxy, argProxy, ...args);\n /* Arrow functions can reused if they don't poke `this` */\n const reusable = fn.name ? true : !thisPoked.size;\n\n const props = new Set([\n ...argPoked,\n ...thisPoked,\n ]);\n\n return {\n props,\n defaultValue,\n reusable,\n };\n}\n\n/**\n * @template {ObserverPropertyType} T1\n * @template {any} T2\n * @template {string} K\n * @template [C=any]\n * @param {C} object\n * @param {K} key\n * @param {import('./typings.js').ObserverOptions<T1, T2, C>} options\n * @return {import('./typings.js').ObserverConfiguration<T1,T2,K,C>}\n */\nexport function defineObservableProperty(object, key, options) {\n /** @type {import('./typings.js').ObserverConfiguration<T1,T2,K,C>} */\n const config = {\n ...DEFAULT_OBSERVER_CONFIGURATION,\n ...parseObserverOptions(key, options, object),\n changedCallback: options.changedCallback,\n };\n\n /**\n * @param {T2} oldValue\n * @param {T2} value\n * @param {boolean} [commit=false]\n * @return {boolean} changed\n */\n function detectChange(oldValue, value, commit) {\n if (oldValue === value) return false;\n if (config.get) {\n // TODO: Custom getter vs parser\n }\n let newValue = value;\n newValue = (value == null)\n ? config.nullParser.call(this, value)\n : config.parser.call(this, newValue);\n\n let changes = newValue;\n if (oldValue == null) {\n if (newValue == null) return false; // Both nullish\n } else if (newValue != null) {\n if (oldValue === newValue) return false;\n if (config.diff) {\n changes = config.diff.call(this, oldValue, newValue);\n if (changes == null) return false;\n }\n if (config.is.call(this, oldValue, newValue)) return false;\n }\n\n // Before changing, store old values of properties that will invalidate;\n\n // Do no set if transient (getter)\n\n config.values.set(this, newValue);\n // console.log(key, 'value.set', newValue);\n config.propChangedCallback?.call(this, key, oldValue, newValue, changes);\n config.changedCallback?.call(this, oldValue, newValue, changes);\n return true;\n }\n /**\n * @this {C}\n * @return {T2}\n */\n function internalGet() {\n return config.values.has(this) ? config.values.get(this) : config.value;\n }\n\n /**\n * @this {C}\n * @param {T2} value\n * @return {void}\n */\n function internalSet(value) {\n const oldValue = this[key];\n // console.log(key, 'internalSet', oldValue, '=>', value);\n detectChange.call(this, oldValue, value, true);\n }\n\n /**\n *\n */\n function onInvalidate() {\n // console.log(key, 'onInvalidate', '???');\n const oldValue = config.validValues.get(this);\n const newValue = this[key];\n // console.log(key, 'onInvalidate', oldValue, '=>', newValue);\n detectChange.call(this, oldValue, newValue);\n }\n\n if (config.get) {\n const { props } = observeFunction(config.get.bind(object), object, internalGet.bind(object));\n // Set of watchers needed\n // console.log(key, 'invalidates with', props);\n config.watchers.push(\n ...[...props].map((prop) => [prop, onInvalidate]),\n );\n }\n /** @type {Partial<PropertyDescriptor>} */\n const descriptor = {\n enumerable: config.enumerable,\n /**\n * @this {C}\n * @return {T2}\n */\n get() {\n if (config.get) {\n const newValue = config.get.call(this, this, internalGet.bind(this));\n // Store value internally. Used by onInvalidate to get previous value\n config.validValues.set(this, newValue);\n return newValue;\n }\n return internalGet.call(this);\n },\n /**\n * @this {C}\n * @param {T2} value\n * @return {void}\n */\n set(value) {\n if (value === INIT_SYMBOL) {\n // console.log(key, 'returning due to INIT');\n return;\n }\n if (config.set) {\n const oldValue = this[key];\n config.set.call(this, value, internalSet.bind(this));\n const newValue = this[key];\n // Invalidate self\n detectChange.call(this, oldValue, newValue);\n } else {\n internalSet.call(this, value);\n }\n },\n };\n\n Object.defineProperty(object, key, descriptor);\n\n return config;\n}\n", "import { generateUID } from './identify.js';\n\n/**\n * Property are bound to an ID+Node\n * Values are either getter or via an function\n * @template {any} T\n * @typedef {Object} InlineFunctionEntry\n * @prop {(data:T) => any} fn\n * @prop {Set<keyof T & string>} [props]\n * @prop {T} [defaultValue]\n */\n\n/** @type {Document} */\nlet _inactiveDocument;\n\n/** @type {boolean} */\nlet _cssStyleSheetConstructable;\n\n/**\n * @param {string} [fromString]\n * @return {DocumentFragment}\n */\nexport function generateFragment(fromString) {\n _inactiveDocument ??= document.implementation.createHTMLDocument();\n if (fromString == null) {\n return _inactiveDocument.createDocumentFragment();\n }\n return _inactiveDocument.createRange().createContextualFragment(fromString);\n}\n\n/** @type {Map<string, InlineFunctionEntry<?>>} */\nexport const inlineFunctions = new Map();\n\n/**\n * @template T\n * @typedef {Object} RenderOptions\n * @prop {Object} context\n * @prop {ParentNode} root\n * @prop {Object<string, HTMLElement>} refs\n */\n\n/**\n * @param {(data: Partial<any>) => any} fn\n * @return {string}\n */\nexport function addInlineFunction(fn) {\n const internalName = `#${generateUID()}`;\n inlineFunctions.set(internalName, { fn });\n return `{${internalName}}`;\n}\n\n/** @type {Map<string, CSSStyleSheet>} */\nconst cssStyleSheetsCache = new Map();\n\n/** @type {Map<string, HTMLStyleElement>} */\nconst styleElementCache = new Map();\n\n/**\n * @param {TemplateStringsArray} array\n * @param {...(string)} substitutions\n * @return {HTMLStyleElement|CSSStyleSheet}\n */\nexport function css(array, ...substitutions) {\n const content = String.raw({ raw: array }, ...substitutions);\n\n if (_cssStyleSheetConstructable == null) {\n try {\n const sheet = new CSSStyleSheet();\n _cssStyleSheetConstructable = true;\n sheet.replaceSync(content);\n cssStyleSheetsCache.set(content, sheet);\n return sheet;\n } catch {\n _cssStyleSheetConstructable = false;\n }\n }\n\n if (_cssStyleSheetConstructable) {\n let sheet = cssStyleSheetsCache.get(content);\n if (!sheet) {\n sheet = new CSSStyleSheet();\n _cssStyleSheetConstructable = true;\n sheet.replaceSync(content);\n cssStyleSheetsCache.set(content, sheet);\n }\n return sheet;\n }\n\n let style = styleElementCache.get(content);\n if (!style) {\n _inactiveDocument ??= document.implementation.createHTMLDocument();\n style = _inactiveDocument.createElement('style');\n style.textContent = content;\n styleElementCache.set(content, style);\n }\n return /** @type {HTMLStyleElement} */ (style.cloneNode(true));\n}\n\n/** @type {Map<string, DocumentFragment>} */\nconst fragmentCache = new Map();\n/**\n * @template T1\n * @template T2\n * @param {TemplateStringsArray} strings\n * @param {...(string|DocumentFragment|Element|((this:T1, data:T2) => any))} substitutions\n * @return {DocumentFragment}\n */\nexport function html(strings, ...substitutions) {\n /** @type {Map<string, DocumentFragment|Element>} */\n let tempSlots;\n const replacements = substitutions.map((sub) => {\n switch (typeof sub) {\n case 'string': return sub;\n case 'function': return addInlineFunction(sub);\n case 'object': {\n if (sub == null) {\n console.warn(sub, 'is null', strings);\n return '';\n }\n // Assume Element\n const tempId = generateUID();\n tempSlots ??= new Map();\n tempSlots.set(tempId, sub);\n return `<div id=\"${tempId}\"></div>`;\n }\n default:\n throw new Error(`Unexpected substitution: ${sub}`);\n }\n });\n const compiledString = String.raw({ raw: strings }, ...replacements);\n\n if (tempSlots) {\n const fragment = generateFragment(compiledString);\n for (const [id, element] of tempSlots) {\n const slot = fragment.getElementById(id);\n slot.replaceWith(element);\n }\n return fragment;\n }\n\n let fragment = fragmentCache.get(compiledString);\n if (!fragment) {\n fragment = generateFragment(compiledString);\n fragmentCache.set(compiledString, fragment);\n }\n\n return /** @type {DocumentFragment} */ (fragment.cloneNode(true));\n}\n", "/* eslint-disable sort-class-members/sort-class-members */\nimport { generateCSSStyleSheets, generateHTMLStyleElements } from './css.js';\nimport { identifierFromElement } from './identify.js';\nimport { observeFunction } from './observe.js';\nimport { generateFragment, inlineFunctions } from './template.js';\n\n/**\n * @template T\n * @typedef {Composition<?>|HTMLStyleElement|CSSStyleSheet|DocumentFragment|((this:T, changes:T) => any)|string} CompositionPart\n */\n\n/**\n * @template {any} T\n * @callback Compositor\n * @param {...(CompositionPart<T>)} parts source for interpolation (not mutated)\n * @return {Composition<T>}\n */\n\n/**\n * @template T\n * @typedef {Object} WatcherBindEntry\n * @prop {Function} fn\n * @prop {Set<keyof T & string>} props\n */\n\n/**\n * @template {any} T\n * @typedef {Object} NodeBindEntry\n * @prop {string} id\n * @prop {number} nodeType\n * @prop {string} node\n * @prop {boolean} [negate]\n * @prop {boolean} [doubleNegate]\n * @prop {Function} [fn]\n * @prop {Set<keyof T & string>} props\n * @prop {T} defaultValue\n */\n\n/** Splits: `{template}text{template}` as `['', 'template', 'text', 'template', '']` */\nconst STRING_INTERPOLATION_REGEX = /{([^}]*)}/g;\n\n/**\n * Returns event listener bound to shadow root host.\n * Use this function to avoid generating extra closures\n * @this {HTMLElement}\n * @param {Function} fn\n */\nfunction buildShadowRootChildListener(fn) {\n /** @param {Event & {currentTarget:{getRootNode: () => ShadowRoot}}} event */\n return function onShadowRootChildEvent(event) {\n const host = event.currentTarget.getRootNode().host;\n fn.call(host, event);\n };\n}\n\n/**\n *\n * @param {Object} object\n * @param {'dot'|'bracket'} [syntax]\n * @param {Object} [target]\n * @param {string} [scope]\n * @return {Object}\n */\nfunction flattenObject(object, syntax = 'dot', target = {}, scope = '') {\n for (const [key, value] of Object.entries(object)) {\n if (!key) continue; // Blank keys are not supported;\n const scopedKey = scope ? `${scope}.${key}` : key;\n target[scopedKey] = value;\n if (value != null && typeof value === 'object') {\n flattenObject(value, syntax, target, scopedKey);\n }\n }\n if (Array.isArray(object)) {\n const scopedKey = scope ? `${scope}.length` : 'length';\n target[scopedKey] = object.length;\n }\n return target;\n}\n\n/**\n * @example\n * entryFromPropName(\n * 'address.home.houseNumber',\n * {\n * address: {\n * home: {\n * houseNumber:35,\n * },\n * }\n * }\n * ) === {value:35}\n * @param {string} prop\n * @param {any} source\n * @return {null|[string, any]}\n */\nfunction entryFromPropName(prop, source) {\n let value = source;\n let child;\n for (child of prop.split('.')) {\n if (!child) throw new Error(`Invalid property: ${prop}`);\n if (child in value === false) return null;\n // @ts-ignore Skip cast\n value = value[child];\n }\n if (value === source) return null;\n return [child, value];\n}\n\n/**\n * @param {string} prop\n * @param {any} source\n * @return {any}\n */\nfunction valueFromPropName(prop, source) {\n let value = source;\n for (const child of prop.split('.')) {\n if (!child) return null;\n // @ts-ignore Skip cast\n value = value[child];\n if (value == null) return null;\n }\n if (value === source) return null;\n return value;\n}\n\n/** @template T */\nexport default class Composition {\n /**\n * Collection of property bindings.\n * @type {Map<keyof T & string, Set<NodeBindEntry<?>>>}\n */\n bindings = new Map();\n\n /**\n * Data of arrays used in templates\n * Usage of a [_for] will create an ArrayLike expectation based on key\n * Only store metadata, not actual data. Currently only needs length.\n * TBD if more is needed later\n * Referenced by property key (string)\n * @type {Map<keyof T & string, ArrayMetadata<T>}\n */\n arrayMetadata = new Map();\n\n /**\n * Collection of events to bind.\n * Indexed by ID\n * @type {Map<string, Set<import('./typings.js').CompositionEventListener<any>>>}\n */\n events = new Map();\n\n /**\n * Snapshot of composition at initial state.\n * This fragment can be cloned for first rendering, instead of calling\n * of using `render()` to construct the initial DOM tree.\n * @type {DocumentFragment}\n */\n cloneable;\n\n /**\n * Result of interpolation of the composition template.\n * Includes all DOM elements, which is used to reference for adding and\n * removing DOM elements during render.\n * @type {DocumentFragment}\n */\n interpolation;\n\n /** @type {(HTMLStyleElement|CSSStyleSheet)[]} */\n styles = [];\n\n /** @type {CSSStyleSheet[]} */\n adoptedStyleSheets = [];\n\n /** @type {DocumentFragment} */\n stylesFragment;\n\n /** @type {((this:T, changes:T) => any)[]} */\n watchers = [];\n\n /**\n * Maintains a reference list of elements used by render target (root).\n * When root is garbage collected, references are released.\n * This includes disconnected elements.\n * @type {WeakMap<Element|DocumentFragment, Map<string,HTMLElement>>}\n */\n referenceCache = new WeakMap();\n\n /**\n * Part of interpolation phase.\n * Maintains a reference list of conditional elements that were removed from\n * `cloneable` due to default state. Used to reconstruct conditional elements\n * with conditional children in default state as well (unlike `interpolation`).\n * @type {Map<string, {element: Element, id: string, parentId: string, commentCache: WeakMap<Element|DocumentFragment,Comment>}>}\n */\n conditionalElementMetadata = new Map();\n\n /** Flag set when template and styles have been interpolated */\n interpolated = false;\n\n /**\n * @param {(CompositionPart<T>)[]} parts\n */\n constructor(...parts) {\n /**\n * Template used to build interpolation and cloneable\n */\n this.template = generateFragment();\n this.append(...parts);\n }\n\n * [Symbol.iterator]() {\n for (const part of this.styles) {\n yield part;\n }\n yield this.template;\n for (const part of this.watchers) {\n yield part;\n }\n }\n\n /**\n * @param {CompositionPart<T>[]} parts\n */\n append(...parts) {\n for (const part of parts) {\n if (typeof part === 'string') {\n this.append(generateFragment(part.trim()));\n } else if (typeof part === 'function') {\n this.watchers.push(part);\n } else if (part instanceof Composition) {\n this.append(...part);\n } else if (part instanceof DocumentFragment) {\n this.template.append(part);\n } else if (part instanceof CSSStyleSheet || part instanceof HTMLStyleElement) {\n this.styles.push(part);\n }\n }\n // Allow chaining\n return this;\n }\n\n /** @param {import('./typings.js').CompositionEventListener<T>} listener */\n addCompositionEventListener(listener) {\n const key = listener.id ?? '';\n let set = this.events.get(key);\n if (!set) {\n set = new Set();\n this.events.set(key, set);\n }\n set.add(listener);\n return this;\n }\n\n /**\n * Updates component nodes based on data.\n * Expects data in JSON Merge Patch format\n * @see https://www.rfc-editor.org/rfc/rfc7386\n * @param {DocumentFragment|ShadowRoot} root where\n * @param {Partial<?>} changes what\n * @param {any} [context] who\n * @param {Partial<?>} [store] If needed, where to grab extra props\n * @return {void}\n */\n render(root, changes, context, store) {\n if (!this.initiallyRendered) this.initialRender(root, changes);\n\n if (!changes) return;\n\n const fnResults = new WeakMap();\n /** @type {WeakMap<Element, Set<string>>} */\n const modifiedNodes = new WeakMap();\n\n // Iterate data instead of bindings.\n // TODO: Avoid double iteration and flatten on-the-fly\n const flattened = flattenObject(changes);\n\n for (const [key, rawValue] of Object.entries(flattened)) {\n const entries = this.bindings.get(key);\n if (!entries) continue;\n for (const { id, node, nodeType, fn, props, negate, doubleNegate } of entries) {\n /* 1. Find Element */\n\n // TODO: Avoid unnecessary element creation.\n // If element can be fully reconstructed with internal properties,\n // skip recreation of element unless it actually needs to added to DOM.\n // Requires tracing of all properties used by conditional elements.\n const ref = this.getElement(root, id);\n if (!ref) {\n console.warn('Non existent id', id);\n continue;\n }\n if (!ref) continue;\n if (modifiedNodes.get(ref)?.has(node)) {\n // console.warn('Node already modified. Skipping', id, node);\n continue;\n }\n\n // if (!ref.parentElement && node !== '_if') {\n // if (ref.parentNode === root) {\n // console.debug('Offscreen? root? rendering', ref, node, ref.id, root.host.outerHTML);\n // } else {\n // console.debug('Offscreen rendering', ref, node, ref.id, root.host.outerHTML);\n // }\n // }\n\n /* 2. Compute value */\n let value;\n if (fn) {\n if (fnResults.has(fn)) {\n value = fnResults.get(fn);\n } else {\n const args = structuredClone(changes);\n for (const prop of props) {\n if (prop in flattened) continue;\n let lastIndexOfDot = prop.lastIndexOf('.');\n if (lastIndexOfDot === -1) {\n // console.debug('injected shallow', prop);\n args[prop] = store[prop];\n } else {\n // Relying on props being sorted...\n console.debug('need deep', prop);\n let entry;\n let propSearchKey = prop;\n let lastPropSearchKey = prop;\n while (!entry) {\n entry = entryFromPropName(propSearchKey, args);\n if (entry) {\n const propName = lastPropSearchKey.slice(propSearchKey.length + 1);\n entry[1][propName] = valueFromPropName(lastPropSearchKey, store);\n break;\n }\n if (lastIndexOfDot === -1) break;\n lastPropSearchKey = prop;\n propSearchKey = prop.slice(0, lastIndexOfDot);\n lastIndexOfDot = propSearchKey.lastIndexOf(',');\n }\n if (!entry) {\n console.warn('what do?');\n }\n }\n }\n value = fn.call(context, args);\n fnResults.set(fn, value);\n }\n } else {\n value = rawValue;\n }\n\n /* 3. Operate on value */\n if (doubleNegate) {\n value = !!value;\n } else if (negate) {\n value = !value;\n }\n\n /* 4. Find Target Node */\n if (nodeType === Node.TEXT_NODE) {\n const index = (node === '#text')\n ? 0\n : Number.parseInt(node.slice('#text'.length), 10);\n let nodesFound = 0;\n for (const childNode of ref.childNodes) {\n if (childNode.nodeType !== Node.TEXT_NODE) continue;\n if (index !== nodesFound++) continue;\n childNode.nodeValue = value ?? '';\n break;\n }\n if (index > nodesFound) {\n console.warn('Node not found, adding?');\n ref.append(value);\n }\n } else if (node === '_if') {\n const attached = root.contains(ref);\n const orphaned = ref.parentElement == null && ref.parentNode !== root;\n const shouldShow = value !== null && value !== false;\n if (orphaned && ref.parentNode) {\n console.warn('Orphaned with parent node?', id, { attached, orphaned, shouldShow }, ref.parentNode);\n }\n if (attached !== !orphaned) {\n console.warn('Conditional state', id, { attached, orphaned, shouldShow });\n console.warn('Not attached and not orphaned. Should do nothing?', ref, ref.parentElement);\n }\n if (shouldShow) {\n if (orphaned) {\n const metadata = this.conditionalElementMetadata.get(id);\n if (!metadata) {\n console.error(id);\n throw new Error('Could not find conditional element metadata');\n }\n\n let comment = metadata.commentCache.get(root);\n if (!comment) {\n console.debug('Composition: Comment not cached, building first time');\n const parent = metadata.parentId\n ? this.getElement(root, metadata.parentId)\n : root;\n if (!parent) {\n console.error(id);\n throw new Error('Could not find reference parent!');\n }\n\n const commentText = `{#${id}}`;\n for (const child of parent.childNodes) {\n if (child.nodeType !== Node.COMMENT_NODE) continue;\n if ((/** @type {Comment} */child).nodeValue === commentText) {\n comment = child;\n break;\n }\n }\n metadata.commentCache.set(this, comment);\n }\n if (comment) {\n console.debug('Composition: Add', id, 'back', ref.outerHTML);\n comment.replaceWith(ref);\n } else {\n console.warn('Could not add', id, 'back to parent');\n }\n }\n } else if (!orphaned) {\n const metadata = this.conditionalElementMetadata.get(id);\n if (!metadata) {\n console.error(id);\n throw new Error(`Could not find conditional element metadata for ${id}`);\n }\n let comment = metadata.commentCache.get(root);\n if (!comment) {\n comment = new Comment(`{#${id}}`);\n metadata.commentCache.set(this, comment);\n }\n console.debug('Composition: Remove', id, ref.outerHTML);\n ref.replaceWith(comment);\n }\n } else if (value === false || value == null) {\n ref.removeAttribute(node);\n } else {\n ref.setAttribute(node, value === true ? '' : value);\n }\n\n /* 5. Mark Node as modified */\n let set = modifiedNodes.get(ref);\n if (!set) {\n set = new Set();\n modifiedNodes.set(ref, set);\n }\n set.add(node);\n }\n }\n }\n\n /**\n * @param {Attr|Text} node\n * @param {Element} element\n * @param {Object} [defaults]\n * @param {string} [parsedValue]\n * @return {boolean} Remove node\n */\n #interpolateNode(node, element, defaults, parsedValue) {\n const { nodeValue, nodeName, nodeType } = node;\n\n if (parsedValue == null) {\n if (!nodeValue) return false;\n const trimmed = nodeValue.trim();\n if (!trimmed) return false;\n if (nodeType === Node.ATTRIBUTE_NODE) {\n if (trimmed[0] !== '{') return false;\n const { length } = trimmed;\n if (trimmed[length - 1] !== '}') return false;\n parsedValue = trimmed.slice(1, -1);\n } else {\n // Split text node into segments\n // TODO: Benchmark indexOf pre-check vs regex\n\n const segments = trimmed.split(STRING_INTERPOLATION_REGEX);\n if (segments.length < 3) return false;\n if (segments.length === 3 && !segments[0] && !segments[2]) {\n parsedValue = segments[1];\n } else {\n segments.forEach((segment, index) => {\n // is even = is template string\n if (index % 2) {\n const newNode = new Text();\n node.before(newNode);\n this.#interpolateNode(newNode, element, defaults, segment);\n } else {\n if (!segment) return; // blank\n node.before(segment);\n }\n });\n // node.remove();\n return true;\n }\n }\n }\n\n const negate = parsedValue[0] === '!';\n let doubleNegate = false;\n if (negate) {\n parsedValue = parsedValue.slice(1);\n doubleNegate = parsedValue[0] === '!';\n if (doubleNegate) {\n parsedValue = parsedValue.slice(1);\n }\n }\n\n let isEvent;\n let textNodeIndex;\n\n if (nodeType === Node.TEXT_NODE) {\n // eslint-disable-next-line unicorn/consistent-destructuring\n if (element !== node.parentElement) {\n console.warn('mismatch?');\n element = node.parentElement;\n }\n textNodeIndex = 0;\n let prev = node;\n while ((prev = prev.previousSibling)) {\n if (prev.nodeType === Node.TEXT_NODE) {\n textNodeIndex++;\n }\n }\n } else {\n // @ts-ignore Skip cast\n // eslint-disable-next-line unicorn/consistent-destructuring\n if (element !== node.ownerElement) {\n console.warn('mismatch?');\n element = node.ownerElement;\n }\n if (nodeName.startsWith('on')) {\n // Do not interpolate inline event listeners\n if (nodeName[2] !== '-') return false;\n isEvent = true;\n }\n }\n\n const id = identifierFromElement(element, true);\n\n if (isEvent) {\n const eventType = nodeName.slice(3);\n const [, flags, type] = eventType.match(/^([*1~]+)?(.*)$/);\n const options = {\n once: flags?.includes('1'),\n passive: flags?.includes('~'),\n capture: flags?.includes('*'),\n };\n\n element.removeAttribute(nodeName);\n\n let set = this.events.get(id);\n if (!set) {\n set = new Set();\n this.events.set(id, set);\n }\n if (parsedValue.startsWith('#')) {\n set.add({ type, handleEvent: inlineFunctions.get(parsedValue).fn, ...options });\n } else {\n set.add({ type, prop: parsedValue, ...options });\n }\n return false;\n }\n\n /** @type {Function} */\n let fn;\n /** @type {Set<string>} */\n let props;\n\n /** @type {any} */\n let defaultValue;\n let inlineFunctionOptions;\n // Is Inline Function?\n if (parsedValue.startsWith('#')) {\n inlineFunctionOptions = inlineFunctions.get(parsedValue);\n if (!inlineFunctionOptions) {\n console.warn(`Invalid interpolation value: ${parsedValue}`);\n return false;\n }\n if (inlineFunctionOptions.props) {\n console.log('This function has already been called. Reuse props', inlineFunctionOptions, this);\n props = inlineFunctionOptions.props;\n defaultValue = inlineFunctionOptions.defaultValue ?? null;\n } else {\n defaultValue = inlineFunctionOptions.fn;\n }\n } else {\n defaultValue = valueFromPropName(parsedValue, defaults);\n }\n\n if (!props) {\n if (typeof defaultValue === 'function') {\n // Value must be reinterpolated and function observed\n const observeResult = observeFunction.call(this, defaultValue, defaults);\n fn = defaultValue;\n defaultValue = observeResult.defaultValue;\n props = observeResult.props;\n // console.log(this.static.name, fn.name || parsedValue, combinedSet);\n } else {\n props = new Set([parsedValue]);\n }\n }\n\n if (typeof defaultValue === 'symbol') {\n console.warn(': Invalid binding:', parsedValue);\n defaultValue = null;\n }\n\n if (doubleNegate) {\n defaultValue = !!defaultValue;\n } else if (negate) {\n defaultValue = !defaultValue;\n }\n\n if (inlineFunctionOptions) {\n inlineFunctionOptions.defaultValue = defaultValue;\n inlineFunctionOptions.props = props;\n }\n\n // Bind\n const parsedNodeName = textNodeIndex ? nodeName + textNodeIndex : nodeName;\n const entry = { id, node: parsedNodeName, fn, props, nodeType, defaultValue, negate, doubleNegate };\n for (const prop of props) {\n let set = this.bindings.get(prop);\n if (!set) {\n set = new Set();\n this.bindings.set(prop, set);\n }\n set.add(entry);\n }\n\n // Mutate\n\n if (nodeType === Node.TEXT_NODE) {\n node.nodeValue = defaultValue ?? '';\n } else if (nodeName === '_if') {\n element.removeAttribute(nodeName);\n if (defaultValue == null || defaultValue === false) {\n // If default state is removed, mark for removal\n return true;\n }\n } else if (defaultValue == null || defaultValue === false) {\n element.removeAttribute(nodeName);\n } else {\n element.setAttribute(nodeName, defaultValue === true ? '' : defaultValue);\n }\n return false;\n }\n\n /**\n * @param {Object} [defaults]\n */\n interpolate(defaults) {\n // console.log('Template', [...this.template.children].map((child) => child.outerHTML).join('\\n'));\n\n // Copy template before working on it\n // Store into `cloneable` to split later into `interpolation`\n this.cloneable = /** @type {DocumentFragment} */ (this.template.cloneNode(true));\n\n /**\n * Track elements to be removed before using for cloning\n * @type {Element[]}\n */\n const removalList = [];\n\n const TREE_WALKER_FILTER = 5; /* NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT */\n\n const treeWalker = document.createTreeWalker(this.cloneable, TREE_WALKER_FILTER);\n let node = treeWalker.nextNode();\n while (node) {\n /** @type {Element} */\n let element = null;\n let removeElement = false;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n element = node;\n if (element instanceof HTMLTemplateElement) {\n node = treeWalker.nextSibling();\n continue;\n }\n if (node instanceof HTMLStyleElement) {\n // Move style elements out of cloneable\n if (node.parentNode === this.cloneable) {\n this.styles.push(node);\n node.remove();\n node = treeWalker.nextSibling();\n continue;\n }\n console.warn('<style> element not moved');\n }\n if (node instanceof HTMLScriptElement) {\n console.warn('<script> element found.');\n node.remove();\n node = treeWalker.nextSibling();\n continue;\n }\n for (const attr of [...element.attributes].reverse()) {\n if (attr.nodeName === '_if') {\n // Ensure elements to be removed has identifiable parent\n const id = identifierFromElement(element, true);\n const parentId = element.parentElement\n ? identifierFromElement(element.parentElement, true)\n : null;\n this.conditionalElementMetadata.set(id, {\n element,\n id,\n parentId,\n commentCache: new WeakMap(),\n });\n }\n removeElement ||= this.#interpolateNode(attr, element, defaults);\n }\n\n break;\n case Node.TEXT_NODE:\n element = node.parentNode;\n if (this.#interpolateNode(/** @type {Text} */ (node), element, defaults)) {\n const nextNode = treeWalker.nextNode();\n node.remove();\n node = nextNode;\n continue;\n }\n\n break;\n default:\n throw new Error(`Unexpected node type: ${node.nodeType}`);\n }\n if (removeElement) {\n removalList.push(element);\n }\n node = treeWalker.nextNode();\n }\n\n // Split into `interpolation` before removing elements\n /** @type {DocumentFragment} */\n this.interpolation = /** @type {DocumentFragment} */ (this.cloneable.cloneNode(true));\n\n // console.debug('Interpolated', [...this.interpolation.children].map((child) => child.outerHTML).join('\\n'));\n\n // Remove elements from `cloneable` and place comment placeholders\n // Remove in reverse so conditionals within conditionals are properly isolated\n for (const element of [...removalList].reverse()) {\n const { id } = element;\n element.replaceWith(new Comment(`{#${id}}`));\n }\n\n for (const watcher of this.watchers) {\n this.bindWatcher(watcher, defaults);\n }\n\n if ('adoptedStyleSheets' in document) {\n this.adoptedStyleSheets = [\n ...generateCSSStyleSheets(this.styles),\n ];\n } else {\n this.stylesFragment = generateFragment();\n this.stylesFragment.append(\n ...generateHTMLStyleElements(this.styles),\n );\n }\n\n this.interpolated = true;\n\n // console.log('Cloneable', [...this.cloneable.children].map((child) => child.outerHTML).join('\\n'));\n }\n\n /**\n * Updates component nodes based on data\n * Expects data in JSON Merge Patch format\n * @see https://www.rfc-editor.org/rfc/rfc7386\n * @param {DocumentFragment|ShadowRoot} root where\n * @param {Partial<?>} data what\n * @return {void}\n */\n initialRender(root, data) {\n if (!this.interpolated) this.interpolate(data);\n\n if ('adoptedStyleSheets' in root) {\n root.adoptedStyleSheets = [\n ...root.adoptedStyleSheets,\n ...this.adoptedStyleSheets,\n ];\n } else if (root instanceof ShadowRoot) {\n root.append(this.stylesFragment.cloneNode(true));\n } else {\n // TODO: Support document styles\n // console.warn('Cannot apply styles to singular element');\n }\n\n root.append(this.cloneable.cloneNode(true));\n\n // console.log('Initial render', [...root.children].map((child) => child.outerHTML).join('\\n'));\n\n /** @type {EventTarget} */\n const rootEventTarget = root instanceof ShadowRoot ? root.host : root;\n // Bind events in reverse order to support stopImmediatePropagation\n for (const [id, events] of [...this.events].reverse()) {\n // Prepare all event listeners first\n for (const entry of [...events].reverse()) {\n let listener = entry.listener;\n if (!listener) {\n if (root instanceof ShadowRoot) {\n listener = entry.handleEvent ?? valueFromPropName(entry.prop, data);\n if (id) {\n // Wrap to retarget this\n listener = buildShadowRootChildListener(listener);\n }\n // Cache and reuse\n entry.listener = listener;\n // console.log('caching listener', entry);\n } else {\n throw new TypeError('Anonymous event listeners cannot be used in templates');\n // console.warn('creating new listener', entry);\n // listener = entry.handleEvent ?? ((event) => {\n // valueFromPropName(entry.prop, data)(event);\n // });\n }\n }\n const eventTarget = id ? root.getElementById(id) : rootEventTarget;\n if (!eventTarget) {\n // Element is not available yet. Bind on reference\n console.debug('Composition: Skip bind events for', id);\n continue;\n }\n eventTarget.addEventListener(entry.type, listener, entry);\n }\n }\n\n this.initiallyRendered = true;\n }\n\n /**\n * @param {string} id\n * @param {Element} element\n */\n attachEventListeners(id, element) {\n const events = this.events.get(id);\n if (events) {\n console.debug('attaching events for', id);\n } else {\n // console.log('no events for', id);\n return;\n }\n for (const entry of [...this.events.get(id)].reverse()) {\n const { listener } = entry;\n if (!listener) {\n throw new Error('Template must be interpolated before attaching events');\n }\n element.addEventListener(entry.type, listener, entry);\n }\n }\n\n /**\n * @param {Element|DocumentFragment} root\n * @return {Map<string,Element>}\n */\n getReferences(root) {\n let references = this.referenceCache.get(root);\n if (!references) {\n references = new Map();\n this.referenceCache.set(root, references);\n }\n return references;\n }\n\n /**\n * @param {ShadowRoot|DocumentFragment} root\n * @param {string} id\n * @return {Element}\n */\n getElement(root, id) {\n const references = this.getReferences(root);\n let element = references.get(id);\n if (element) {\n // console.log('Returning from cache', id);\n return element;\n }\n if (element === null) return null; // Cached null response\n\n // Undefined\n\n // console.log('Search in DOM', id);\n element = root.getElementById(id);\n\n if (element) {\n // console.log('Found in DOM', id);\n references.set(id, element);\n return element;\n }\n\n // Element not in DOM means child of conditional element\n /** @type {Element} */\n let anchorElement;\n\n // Check if element is conditional\n let cloneTarget = this.conditionalElementMetadata.get(id)?.element;\n\n if (!cloneTarget) {\n // Check if element even exists in interpolation\n // Check interpolation (full-tree) first\n const interpolatedElement = this.interpolation.getElementById(id);\n if (!interpolatedElement) {\n console.warn('Not in full-tree', id);\n // Cache not in full composition\n references.set(id, null);\n return null;\n }\n // Iterate backgrounds until closest conditional element\n // const anchorElementId = this.template.getElementById(id).closest('[_if]').id;\n // anchorElement = this.references.get(anchorElementId) this.interpolation.getElementById(anchorElementId).cloneNode(true);\n let parentElement = interpolatedElement;\n while ((parentElement = parentElement.parentElement) != null) {\n const parentId = parentElement.id;\n if (!parentId) {\n console.warn('Parent does not have ID!');\n cloneTarget = parentElement;\n continue;\n }\n\n // Parent already referenced\n const referencedParent = references.get(parentId);\n if (referencedParent) {\n // Element may have been removed without ever tree-walking\n console.debug('Parent already referenced', parentId, '>', id);\n anchorElement = referencedParent;\n break;\n }\n\n const liveElement = root.getElementById(parentId);\n if (liveElement) {\n console.warn('Parent in DOM and not referenced', parentId, '>', id);\n // Parent already in DOM. Cache reference\n references.set(parentId, liveElement);\n anchorElement = referencedParent;\n break;\n }\n\n const conditionalParent = this.conditionalElementMetadata.get(parentId)?.element;\n if (conditionalParent) {\n console.debug('Found parent conditional element', parentId, '>', id);\n cloneTarget = conditionalParent;\n break;\n }\n\n cloneTarget = parentElement;\n }\n }\n\n anchorElement ??= /** @type {Element} */ (cloneTarget.cloneNode(true));\n\n // Iterate downwards and cache all references\n let node = anchorElement;\n const iterator = document.createTreeWalker(anchorElement, NodeFilter.SHOW_ELEMENT);\n do {\n const nodeIdentifier = node.id;\n if (!element && nodeIdentifier === id) {\n element = node;\n }\n\n if (nodeIdentifier) {\n // console.debug('Caching element', nodeIdentifier);\n references.set(nodeIdentifier, node);\n if (cloneTarget) {\n // Attach events regardless of DOM state.\n // EventTargets should still fire even if not part of live document\n this.attachEventListeners(id, element);\n }\n } else {\n console.warn('Could not cache node', node);\n }\n } while ((node = iterator.nextNode()));\n return element;\n }\n\n /**\n * @param {*} fn\n * @param {any} defaults\n * @return {boolean} reusable\n */\n bindWatcher(fn, defaults) {\n const { props, defaultValue, reusable } = observeFunction(fn, defaults);\n const entry = { fn, props, defaultValue };\n for (const prop of props) {\n let set = this.bindings.get(prop);\n if (!set) {\n set = new Set();\n this.bindings.set(prop, set);\n }\n set.add(entry);\n }\n return reusable;\n }\n}\n", "export class ICustomElement extends HTMLElement {}\n", "/* eslint-disable max-classes-per-file */\n\nimport Composition from './Composition.js';\nimport { ICustomElement } from './ICustomElement.js';\nimport { attrNameFromPropName, attrValueFromDataValue } from './dom.js';\nimport { defineObservableProperty } from './observe.js';\nimport { addInlineFunction, css, html } from './template.js';\n\n/**\n * @template {abstract new (...args: any) => unknown} T\n * @param {InstanceType<T>} instance\n */\nfunction superOf(instance) {\n const staticContext = instance.constructor;\n const superOfStatic = Object.getPrototypeOf(staticContext);\n return superOfStatic.prototype;\n}\n\nconst EVENT_PREFIX_REGEX = /^([*1~]+)?(.*)$/;\n\n/**\n * Web Component that can cache templates for minification or performance\n */\nexport default class CustomElement extends ICustomElement {\n /** @type {string} */\n static elementName;\n\n /** @return {Iterable<string>} */\n static get observedAttributes() {\n const s = new Set();\n for (const config of this.propList.values()) {\n if (config.reflect === true || config.reflect === 'read') {\n s.add(config.attr);\n }\n }\n return s;\n }\n\n /** @type {import('./Composition.js').Compositor<?>} */\n compose() {\n if (this.#composition) {\n console.warn('Already composed. Generating *new* composition...');\n }\n this.#composition = new Composition();\n return this.#composition;\n }\n\n /** @type {Composition<?>} */\n static _composition = null;\n\n /** @type {Map<string, import('./typings.js').ObserverConfiguration<?,?,?>>} */\n static _props = new Map();\n\n /** @type {Map<string, Function[]>} */\n static _propChangedCallbacks = new Map();\n\n /** @type {Map<string, Function[]>} */\n static _attributeChangedCallbacks = new Map();\n\n /** @type {typeof ICustomElement._onComposeCallbacks} */\n static _onComposeCallbacks = [];\n\n /** @type {typeof ICustomElement._onConnectedCallbacks} */\n static _onConnectedCallbacks = [];\n\n /** @type {typeof ICustomElement._onDisconnectedCallbacks} */\n static _onDisconnectedCallbacks = [];\n\n /** @type {typeof ICustomElement._onConstructedCallbacks} */\n static _onConstructedCallbacks = [];\n\n static interpolatesTemplate = true;\n\n static supportsElementInternals = 'attachInternals' in HTMLElement.prototype;\n\n static supportsElementInternalsRole = CustomElement.supportsElementInternals\n && 'role' in ElementInternals.prototype;\n\n /** @type {boolean} */\n static templatable = null;\n\n static defined = false;\n\n static autoRegistration = true;\n\n /** @type {Map<string, typeof CustomElement>} */\n static registrations = new Map();\n\n /** @type {typeof ICustomElement.expressions} */\n static expressions = this.set;\n\n /** @type {typeof ICustomElement.methods} */\n static methods = this.set;\n\n /** @type {typeof ICustomElement.overrides} */\n static overrides = this.set;\n\n /** @type {typeof ICustomElement.props} */\n static props = this.observe;\n\n /**\n * @template {typeof CustomElement} T\n * @this T\n * @template {keyof T} K\n * @param {K} collection\n * @param {T[K] extends (infer R)[] ? R : never} callback\n */\n static _addCallback(collection, callback) {\n if (!this.hasOwnProperty(collection)) {\n this[collection] = [\n ...this[collection],\n ];\n }\n this[collection].push(callback);\n }\n\n /**\n * Append parts to composition\n * @type {typeof ICustomElement.append}\n */\n static append(...parts) {\n this.on({\n composed({ composition }) {\n // console.debug('onComposed:append', ...parts);\n composition.append(...parts);\n },\n });\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Appends styles to composition\n * @type {typeof ICustomElement.css}\n */\n static css(array, ...substitutions) {\n if (Array.isArray(array)) {\n // @ts-expect-error Complex cast\n this.append(css(array, ...substitutions));\n } else {\n // @ts-expect-error Complex cast\n this.append(array, ...substitutions);\n }\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement['setSchema']} */\n static setSchema(schema) {\n this.schema = schema;\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Registers class asynchronously at end of current event loop cycle\n * via `queueMicrotask`. If class is registered before then,\n * does nothing.\n * @type {typeof ICustomElement['autoRegister']}\n */\n static autoRegister(elementName) {\n if (elementName) {\n this.elementName = elementName;\n }\n queueMicrotask(() => {\n if (this.autoRegistration) {\n this.register();\n }\n });\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Appends DocumentFragment to composition\n * @type {typeof ICustomElement.html}\n */\n static html(strings, ...substitutions) {\n this.on({\n composed({ composition }) {\n // console.log('onComposed:html', strings);\n composition.append(html(strings, ...substitutions));\n },\n });\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Extends base class into a new class.\n * Use to avoid mutating base class.\n * TODO: Add constructor arguments typing\n * @type {typeof ICustomElement.extend}\n */\n static extend() {\n // @ts-expect-error Can't cast T\n return class extends this {};\n }\n\n /**\n * Extends base class into a new class.\n * Use to avoid mutating base class.\n * TODO: Add constructor arguments typing\n * @type {typeof ICustomElement.tsClassFix}\n */\n static tsClassFix() {\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Assigns static values to class\n * @type {typeof ICustomElement.setStatic}\n */\n static setStatic(source) {\n Object.assign(this, source);\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Assigns values directly to all instances (via prototype)\n * @type {typeof ICustomElement.set}\n */\n static readonly(source, options) {\n // @ts-expect-error Can't cast T\n return this.set(source, { ...options, writable: false });\n }\n\n /**\n * Assigns values directly to all instances (via prototype)\n * @type {typeof ICustomElement.set}\n */\n static set(source, options) {\n Object.defineProperties(\n this.prototype,\n Object.fromEntries(\n Object.entries(source).map(([name, value]) => {\n // Tap into .map() to avoid double iteration\n // Property may be redefined observable\n this.undefine(name);\n return [\n name,\n {\n enumerable: name[0] !== '_',\n configurable: true,\n value,\n writable: true,\n ...options,\n },\n ];\n }),\n ),\n );\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /**\n * Returns result of calling mixin with current class\n * @type {typeof ICustomElement.mixin}\n */\n static mixin(mixin) {\n return mixin(this);\n }\n\n /**\n * Registers class with window.customElements synchronously\n * @type {typeof ICustomElement['register']}\n */\n static register(elementName, force = false) {\n if (this.hasOwnProperty('defined') && this.defined && !force) {\n console.warn(this.elementName, 'already registered.');\n // @ts-expect-error Can't cast T\n return this;\n }\n\n if (elementName) {\n this.elementName = elementName;\n }\n\n customElements.define(this.elementName, this);\n CustomElement.registrations.set(this.elementName, this);\n this.defined = true;\n // @ts-expect-error Can't cast T\n return this;\n }\n\n static get propList() {\n if (!this.hasOwnProperty('_props')) {\n this._props = new Map(this._props);\n }\n return this._props;\n }\n\n static get propChangedCallbacks() {\n if (!this.hasOwnProperty('_propChangedCallbacks')) {\n // structuredClone()\n this._propChangedCallbacks = new Map(\n [\n ...this._propChangedCallbacks,\n ].map(([name, array]) => [name, array.slice()]),\n );\n }\n return this._propChangedCallbacks;\n }\n\n static get attributeChangedCallbacks() {\n if (!this.hasOwnProperty('_attributeChangedCallbacks')) {\n this._attributeChangedCallbacks = new Map(\n [\n ...this._attributeChangedCallbacks,\n ].map(([name, array]) => [name, array.slice()]),\n );\n }\n return this._attributeChangedCallbacks;\n }\n\n /**\n * Creates observable property on instances (via prototype)\n * @template {import('./typings.js').ObserverPropertyType} [T1=null]\n * @template {import('./typings.js').ObserverPropertyType} [T2=null]\n * @template {any} [T3=null]\n * @param {string} name\n * @param {T1|import('./typings.js').ObserverOptions<T2,T3>} [typeOrOptions='string']\n * @return {(\n * T3 extends null ?\n * T2 extends null ?\n * T1 extends null ?\n * string\n * : import('./typings.js').ParsedObserverPropertyType<T1>\n * : import('./typings.js').ParsedObserverPropertyType<T2>\n * : T3\n * )}\n */\n static prop(name, typeOrOptions) {\n // TODO: Cache and save configuration for reuse (mixins)\n /** @type {import('./typings.js').ObserverOptions<?,?>} */\n const options = {\n ...((typeof typeOrOptions === 'string') ? { type: typeOrOptions } : typeOrOptions),\n };\n\n const customCallback = options.changedCallback;\n\n if (customCallback) {\n // Move callback to later in stack for attribute-based changes as well\n this.onPropChanged({ [name]: customCallback });\n }\n\n // TODO: Inspect possible closure bloat\n options.changedCallback = function wrappedChangedCallback(oldValue, newValue, changes) {\n this._onObserverPropertyChanged.call(this, name, oldValue, newValue, changes);\n };\n\n const config = defineObservableProperty(this.prototype, name, options);\n\n this.propList.set(name, config);\n for (const [prop, callback] of config.watchers) {\n this.on(`${prop}Changed`, callback);\n }\n\n return config.INIT_SYMBOL;\n }\n\n /**\n * Define properties on instances via Object.defineProperties().\n * Automatically sets property non-enumerable if name begins with `_`.\n * @type {typeof ICustomElement.define}\n */\n static define(props) {\n Object.defineProperties(\n this.prototype,\n Object.fromEntries(\n Object.entries(props).map(([name, options]) => {\n // Tap into .map() to avoid double iteration\n // Property may be redefined observable\n this.undefine(name);\n return [\n name,\n {\n enumerable: name[0] !== '_',\n configurable: true,\n ...(\n typeof options === 'function'\n ? { get: options }\n : options\n ),\n },\n ];\n }),\n ),\n );\n\n // @ts-expect-error Can't cast T\n return this;\n }\n\n static undefine(name) {\n Reflect.deleteProperty(this.prototype, name);\n const config = this.propList.get(name);\n if (config && config.watchers.length) {\n const propWatchers = this.propChangedCallbacks.get(name);\n if (propWatchers) {\n for (const watcher of config.watchers) {\n const index = propWatchers.indexOf(watcher);\n if (index !== -1) {\n console.warn('Unwatching', name);\n propWatchers.splice(index, 1);\n }\n }\n }\n }\n this.propList.delete(name);\n return this;\n }\n\n /**\n * Creates observable properties on instances\n * @type {typeof ICustomElement.observe}\n */\n static observe(props) {\n for (const [name, typeOrOptions] of Object.entries(props ?? {})) {\n if (typeof typeOrOptions === 'function') {\n this.prop(name, {\n reflect: false,\n get: typeOrOptions,\n });\n } else {\n this.prop(name, typeOrOptions);\n }\n }\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement.defineStatic} */\n static defineStatic(props) {\n for (const [name, typeOrOptions] of Object.entries(props ?? {})) {\n const options = (typeof typeOrOptions === 'function')\n ? { get: typeOrOptions }\n : (typeof typeOrOptions === 'string'\n ? { type: typeOrOptions }\n : typeOrOptions);\n defineObservableProperty(this, name, {\n reflect: false,\n ...options,\n });\n }\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement.events} */\n static events(listeners, options) {\n this.on({\n composed({ composition }) {\n for (const [key, listenerOptions] of Object.entries(listeners)) {\n const [, flags, type] = key.match(EVENT_PREFIX_REGEX);\n composition.addCompositionEventListener({\n type,\n once: flags?.includes('1'),\n passive: flags?.includes('~'),\n capture: flags?.includes('*'),\n ...(\n typeof listenerOptions === 'function'\n ? { handleEvent: listenerOptions }\n : (typeof listenerOptions === 'string'\n ? { prop: listenerOptions }\n : listenerOptions)\n ),\n ...(\n options\n )\n ,\n });\n }\n },\n });\n\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement.childEvents} */\n static childEvents(listenerMap, options) {\n for (const [id, listeners] of Object.entries(listenerMap)) {\n this.events(listeners, {\n id,\n ...options,\n });\n }\n\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement['on']} */\n static on(nameOrCallbacks, callback) {\n const callbacks = typeof nameOrCallbacks === 'string'\n ? { [nameOrCallbacks]: callback }\n : nameOrCallbacks;\n for (const [name, fn] of Object.entries(callbacks)) {\n /** @type {keyof (typeof CustomElement)} */\n let arrayPropName;\n switch (name) {\n case 'composed': arrayPropName = '_onComposeCallbacks'; break;\n case 'constructed': arrayPropName = '_onConstructedCallbacks'; break;\n case 'connected': arrayPropName = '_onConnectedCallbacks'; break;\n case 'disconnected': arrayPropName = '_onDisconnectedCallbacks'; break;\n case 'props':\n this.onPropChanged(fn);\n continue;\n case 'attrs':\n this.onAttributeChanged(fn);\n continue;\n default:\n if (name.endsWith('Changed')) {\n const prop = name.slice(0, name.length - 'Changed'.length);\n this.onPropChanged({ [prop]: fn });\n continue;\n }\n throw new Error('Invalid callback name');\n }\n this._addCallback(arrayPropName, fn);\n }\n\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement['onPropChanged']} */\n static onPropChanged(options) {\n for (const [prop, callback] of Object.entries(options)) {\n let array = this.propChangedCallbacks.get(prop);\n if (!array) {\n array = [];\n this.propChangedCallbacks.set(prop, array);\n }\n array.push(callback);\n }\n\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {typeof ICustomElement['onAttributeChanged']} */\n static onAttributeChanged(options) {\n for (const [name, callback] of Object.entries(options)) {\n let array = this.attributeChangedCallbacks.get(name);\n if (!array) {\n array = [];\n this.attributeChangedCallbacks.set(name, array);\n }\n array.push(callback);\n }\n\n // @ts-expect-error Can't cast T\n return this;\n }\n\n /** @type {Record<string, HTMLElement>}} */\n #refsProxy;\n\n /** @type {Map<string, WeakRef<HTMLElement>>}} */\n #refsCache = new Map();\n\n /** @type {Map<string, WeakRef<HTMLElement>>}} */\n #refsCompositionCache = new Map();\n\n /** @type {Composition<?>} */\n #composition;\n\n /** @type {Map<string,null|[string,any]>} */\n _propAttributeCache;\n\n /** @type {import('./ICustomElement.js').CallbackArguments} */\n _callbackArguments = null;\n\n /** @param {any[]} args */\n constructor(...args) {\n super();\n\n if (CustomElement.supportsElementInternals) {\n this.elementInternals = this.attachInternals();\n }\n\n this.attachShadow({ mode: 'open', delegatesFocus: this.delegatesFocus });\n\n this.composition.initialRender(this.shadowRoot, this);\n\n for (const callback of this.static._onConstructedCallbacks) {\n callback.call(this, this.callbackArguments);\n }\n }\n\n /**\n * Updates nodes based on data\n * Expects data in JSON Merge Patch format\n * @see https://www.rfc-editor.org/rfc/rfc7386\n * @param {?} data\n * @param {?} [store]\n * @return {void}\n */\n render(data, store) {\n // console.log('render', data);\n this.composition.render(this.shadowRoot, data, this, store ? { ...this, store } : this);\n }\n\n /** @type {InstanceType<typeof ICustomElement>['propChangedCallback']} */\n propChangedCallback(name, oldValue, newValue, changes = newValue) {\n const callbacks = this.static.propChangedCallbacks.get(name);\n if (callbacks) {\n for (const callback of callbacks) {\n callback.call(this, oldValue, newValue, changes, this);\n }\n }\n\n this.render({ [name]: changes });\n }\n\n /**\n * @param {string} name\n * @param {string|null} oldValue\n * @param {string|null} newValue\n */\n attributeChangedCallback(name, oldValue, newValue) {\n const callbacks = this.static.attributeChangedCallbacks.get(name);\n if (callbacks) {\n for (const callback of callbacks) {\n callback.call(this, oldValue, newValue, this);\n }\n }\n\n // Array.find\n for (const config of this.static.propList.values()) {\n if (config.attr !== name) continue;\n\n if (config.reflect !== true && config.reflect !== 'read') return;\n\n if (config.attributeChangedCallback) {\n config.attributeChangedCallback.call(this, name, oldValue, newValue);\n return;\n }\n\n const [stringValue] = this.attributeCache.get(name) ?? [null, null];\n if (stringValue === newValue) {\n // Attribute was changed via data change event. Ignore.\n return;\n }\n\n // @ts-expect-error any\n const previousDataValue = this[config.key];\n const parsedValue = newValue === null\n ? config.nullParser(/** @type {null} */ (newValue))\n // Avoid Boolean('') === false\n : (config.type === 'boolean' ? true : config.parser(newValue));\n\n if (parsedValue === previousDataValue) {\n // No internal value change\n return;\n }\n // \"Remember\" that this attrValue equates to this data value\n // Avoids rewriting attribute later on data change event\n this.attributeCache.set(name, [newValue, parsedValue]);\n // @ts-expect-error any\n this[config.key] = parsedValue;\n return;\n }\n }\n\n get #template() {\n return this.#composition?.template;\n }\n\n /**\n * @param {string} name\n * @param {any} oldValue\n * @param {any} newValue\n * @param {any} changes\n */\n _onObserverPropertyChanged(name, oldValue, newValue, changes) {\n const { reflect, attr } = this.static.propList.get(name);\n if (attr && (reflect === true || reflect === 'write')) {\n const [, dataValue] = this.attributeCache.get(attr) ?? [null, null];\n // Don't change attribute if data value is equivalent\n // (eg: Boolean('foo') === true; Number(\"1.0\") === 1)\n if (dataValue !== newValue) {\n const attrValue = attrValueFromDataValue(newValue);\n // Cache attrValue to ignore attributeChangedCallback later\n this.attributeCache.set(attr, [attrValue, newValue]);\n if (attrValue == null) {\n this.removeAttribute(attr);\n } else {\n this.setAttribute(attr, attrValue);\n }\n }\n }\n\n // Invoke change => render\n this.propChangedCallback(name, oldValue, newValue, changes);\n }\n\n /**\n * Proxy object that returns shadow DOM elements by ID.\n * If called before interpolation (eg: on composed), returns from template\n * @return {Record<string,HTMLElement>}\n */\n get refs() {\n // eslint-disable-next-line no-return-assign\n return (this.#refsProxy ??= new Proxy({}, {\n /**\n * @param {any} target\n * @param {string} id\n * @return {Element}\n */\n get: (target, id) => {\n if (!this.#composition) {\n console.warn(this.static.name, 'Attempted to access references before composing!');\n }\n const composition = this.composition;\n if (!composition.interpolated) {\n let element = this.#refsCompositionCache.get(id)?.deref();\n if (element) return element;\n const formattedId = attrNameFromPropName(id);\n // console.warn(this.tagName, 'Returning template reference');\n element = composition.template.getElementById(formattedId);\n if (!element) return null;\n this.#refsCompositionCache.set(id, new WeakRef(element));\n return element;\n }\n let element = this.#refsCache.get(id)?.deref();\n if (element) {\n return element;\n }\n const formattedId = attrNameFromPropName(id);\n element = composition.getElement(this.shadowRoot, formattedId);\n if (!element) return null;\n this.#refsCache.set(id, new WeakRef(element));\n return element;\n },\n }));\n }\n\n get attributeCache() {\n this._propAttributeCache ??= new Map();\n return this._propAttributeCache;\n }\n\n get tabIndex() {\n return super.tabIndex;\n }\n\n set tabIndex(value) {\n if (value === super.tabIndex && value !== -1) {\n // Non -1 value already set\n return;\n }\n\n if (this.delegatesFocus && document.activeElement === this) {\n if (this.getAttribute('tabindex') === value.toString()) {\n // Skip if possible\n return;\n }\n\n // Chrome blurs on tabindex changes with delegatesFocus\n // Fixed in Chrome 111\n // Remove this code ~June 2023\n // https://bugs.chromium.org/p/chromium/issues/detail?id=1346606\n /** @type {EventListener} */\n const listener = (e) => {\n e.stopImmediatePropagation();\n e.stopPropagation();\n if (e.type === 'blur') {\n console.warn('Chromium bug 1346606: Tabindex change caused blur. Giving focusing back.', this);\n this.focus();\n } else {\n console.warn('Chromium bug 1346606: Blocking focus event.', this);\n }\n };\n this.addEventListener('blur', listener, { capture: true, once: true });\n this.addEventListener('focus', listener, { capture: true, once: true });\n super.tabIndex = value;\n this.removeEventListener('blur', listener, { capture: true });\n this.removeEventListener('focus', listener, { capture: true });\n return;\n }\n\n super.tabIndex = value;\n }\n\n get static() { return /** @type {typeof CustomElement} */ (/** @type {unknown} */ (this.constructor)); }\n\n get unique() { return false; }\n\n get callbackArguments() {\n // eslint-disable-next-line no-return-assign\n return this._callbackArguments ??= {\n composition: this.#composition,\n html: html.bind(this),\n inline: addInlineFunction,\n template: this.#template,\n element: this,\n };\n }\n\n /** @return {Composition<?>} */\n get composition() {\n if (this.#composition) return this.#composition;\n\n if (!this.unique && this.static.hasOwnProperty('_composition')) {\n this.#composition = this.static._composition;\n return this.static._composition;\n }\n\n // TODO: Use Composition to track uniqueness\n // console.log('composing', this.static.elementName);\n this.compose();\n for (const callback of this.static._onComposeCallbacks) {\n // console.log(this.static.elementName, 'composition callback');\n callback.call(this, this.callbackArguments);\n }\n\n if (!this.unique) {\n // Cache compilation into static property\n this.static._composition = this.#composition;\n }\n\n return this.#composition;\n }\n\n connectedCallback() {\n for (const callbacks of this.static._onConnectedCallbacks) {\n callbacks.call(this, this.callbackArguments);\n }\n }\n\n disconnectedCallback() {\n for (const callbacks of this.static._onDisconnectedCallbacks) {\n callbacks.call(this, this.callbackArguments);\n }\n }\n}\n\nCustomElement.prototype.delegatesFocus = false;\n", "/** @param {typeof import('../core/CustomElement.js').default} Base */\nexport default function DensityMixin(Base) {\n return Base\n .extend()\n .observe({\n density: 'integer',\n })\n .css`\n :host {\n --mdw-density: var(--mdw-density__default, 0);\n }\n \n /* Reset */\n :host([density]) { --mdw-density: 0; }\n \n :host([density=\"-1\"]) { --mdw-density: -1; }\n :host([density=\"-2\"]) { --mdw-density: -2; }\n :host([density=\"-3\"]) { --mdw-density: -2; }\n :host([density=\"-4\"]) { --mdw-density: -4; }\n :host([density=\"1\"]) { --mdw-density: 1; }\n :host([density=\"2\"]) { --mdw-density: 2; }\n :host([density=\"3\"]) { --mdw-density: 3; }\n :host([density=\"4\"]) { --mdw-density: 3; }\n `;\n}\n", "/**\n * @param {ReturnType<import('./StateMixin.js').default> & ReturnType<import('./ThemableMixin.js').default>} Base\n */\nexport default function ShapeMixin(Base) {\n return Base\n .extend()\n .observe({\n shapeTop: 'boolean',\n shapeBottom: 'boolean',\n shapeStart: 'boolean',\n shapeEnd: 'boolean',\n shapeStyle: 'string',\n outlined: 'boolean',\n })\n .html/* html */`\n <div id=shape part=shape class=shape elevated={elevated} shape-top={shapeTop} shape-bottom={shapeBottom} shape-start={shapeStart} shape-end={shapeEnd} shape-style={shapeStyle} color={color} outlined={outlined} disabled={disabledState}>\n <div id=outline _if={outlined} class=outline disabled={disabledState} focused={focusedState} pressed={pressedState} hovered={hoveredState}>\n <div id=outline-left class=\"outline-section outline-left\"></div>\n <div id=outline-right class=\"outline-section outline-right\"></div>\n </div>\n </div>\n `\n .css`\n :host {\n --mdw-shape__size: 0px;\n --mdw-shape__bg: transparent;\n --mdw-surface__will-change: none;\n --mdw-shape__size__top-start-size: var(--mdw-shape__size);\n --mdw-shape__size__top-end-size: var(--mdw-shape__size);\n --mdw-shape__size__bottom-start-size: var(--mdw-shape__size);\n --mdw-shape__size__bottom-end-size: var(--mdw-shape__size);\n \n /* (1/2n + 1/2)L + (-1/2n + 1/2)R */\n --mdw-shape__ltr: calc(0.5 * var(--mdw-dir, 1) + 0.5); /* 1 if LTR, 0 if RTL */\n --mdw-shape__rtl: calc(-0.5 * var(--mdw-dir, 1) + 0.5); /* 0 if LTR, 1 if RTL */\n --mdw-shape__size__top-left-size: calc((var(--mdw-shape__ltr) * var(--mdw-shape__size__top-start-size)) + (var(--mdw-shape__rtl) * var(--mdw-shape__size__top-end-size)));\n --mdw-shape__size__top-right-size: calc((var(--mdw-shape__rtl) * var(--mdw-shape__size__top-start-size)) + (var(--mdw-shape__ltr) * var(--mdw-shape__size__top-end-size)));\n --mdw-shape__size__bottom-left-size: calc((var(--mdw-shape__ltr) * var(--mdw-shape__size__bottom-start-size)) + (var(--mdw-shape__rtl) * var(--mdw-shape__size__bottom-end-size)));\n --mdw-shape__size__bottom-right-size: calc((var(--mdw-shape__rtl) * var(--mdw-shape__size__bottom-start-size)) + (var(--mdw-shape__ltr) * var(--mdw-shape__size__bottom-end-size)));\n \n /** By default, fallback to border-radius */\n --mdw-shape__rounded: 1;\n --mdw-shape__inline-start-deg: calc(var(--mdw-dir, 1) * -90deg);\n z-index: 0;\n }\n\n :host([shape-style=\"none\"]) {\n --mdw-shape__size: 0px;\n }\n \n :host([shape-style=\"extra-small\"]) {\n --mdw-shape__size: var(--mdw-shape__extra-small);\n }\n \n :host([shape-style=\"small\"]) {\n --mdw-shape__size: var(--mdw-shape__small);\n }\n \n :host([shape-style=\"medium\"]) {\n --mdw-shape__size: var(--mdw-shape__medium);\n }\n \n :host([shape-style=\"large\"]) {\n --mdw-shape__size: var(--mdw-shape__large);\n }\n \n :host([shape-style=\"extra-large\"]) {\n --mdw-shape__size: var(--mdw-shape__extra-large);\n }\n \n :host([shape-style=\"full\"]) {\n --mdw-shape__size: var(--mdw-shape__full);\n }\n \n :host([shape-style=\"inherit\"]) {\n --mdw-shape__size: inherit;\n }\n \n :host([shape-top]) {\n --mdw-shape__size__bottom-start-size: 0px;\n --mdw-shape__size__bottom-end-size: 0px;\n --mdw-shape__mask: linear-gradient(transparent 50%, black 50%);\n \n }\n \n :host([shape-bottom]) {\n --mdw-shape__size__top-start-size: 0px;\n --mdw-shape__size__top-end-size: 0px;\n --mdw-shape__mask: linear-gradient(black 50%, transparent 50%);\n }\n \n :host([shape-start]) {\n --mdw-shape__size__top-end-size: 0px;\n --mdw-shape__size__bottom-end-size: 0px;\n --mdw-shape__mask: linear-gradient(var(--mdw-shape__inline-start-deg), black 50%, transparent 50%);\n }\n \n :host([shape-end]) {\n --mdw-shape__size__top-start-size: 0px;\n --mdw-shape__size__bottom-start-size: 0px;\n --mdw-shape__mask: linear-gradient(var(--mdw-shape__inline-start-deg), transparent 50%, black 50%);\n }\n \n @supports(-webkit-mask-box-image: none) {\n :host {\n /* Inherit all the way up to :root */\n --mdw-shape__rounded: inherit;\n }\n }\n `\n .css`\n .shape {\n position: absolute;\n inset: 0;\n \n overflow: hidden;\n \n z-index: -1;\n \n background-color: var(--mdw-shape__bg, transparent);\n \n border-start-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-start-size));\n border-start-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-end-size));\n border-end-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-start-size));\n border-end-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-end-size));\n \n transition-delay: 1ms;\n transition-duration: 200ms;\n transition-property: background-color, color;\n will-change: background-color, color;\n \n }\n \n .shape[outlined] {\n background-color: transparent;\n }\n \n .shape[color] {\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-ink));\n }\n \n .shape:is([color=\"none\"], [color=\"transparent\"]) {\n background-color: transparent;\n }\n\n @supports(-webkit-mask-box-image: none) {\n .shape {\n -webkit-mask-box-image: var(--mdw-shape__mask-border-source)\n 8 fill /\n var(--mdw-shape__size)\n stretch;\n \n -webkit-mask: var(--mdw-shape__mask);\n\n transition-duration: 200ms, 200ms, 200ms;\n transition-property: background-color, color, -webkit-mask-box-image-width;\n will-change: background-color, color, -webkit-mask-box-image;\n }\n }\n `\n .css`\n .outline {\n position: absolute;\n inset: 0;\n \n pointer-events: none;\n \n border-color: currentColor;\n border-radius: inherit;\n color: rgb(var(--mdw-color__outline));\n }\n \n .outline:is([pressed],[focused]) {\n color: rgb(var(--mdw-ink));\n \n transition-delay: 0;\n transition-duration: 0;\n }\n \n .outline[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.12);\n }\n \n .outline::before {\n content: '';\n \n position: absolute;\n inset: 0;\n \n border-style: solid;\n border-width: 1px;\n \n border-radius: inherit;\n }\n \n @supports(-webkit-mask-box-image: none) {\n .outline::before {\n content: none;\n }\n \n .outline::after {\n content: '';\n \n position: absolute;\n inset: 0;\n \n -webkit-mask-box-image: var(--mdw-shape__mask-image__edges)\n 8 fill /\n auto\n stretch;\n \n background-color: currentColor;\n }\n \n .outline-section {\n position: absolute;\n inset: 0;\n }\n \n .outline-section::before,\n .outline-section::after {\n content: \"\";\n \n position: absolute;\n \n max-block-size: 50%;\n max-inline-size: 50%;\n \n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: contain;\n \n background-color: currentColor;\n \n transition-duration: 200ms;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n transition-property: width, height;\n }\n \n .outline-left::before {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: calc(-1px * var(--mdw-shape__convex));\n inset-block-start: calc(-1px * var(--mdw-shape__convex));\n \n block-size: calc(var(--mdw-shape__size__top-left-size));\n inline-size: calc(var(--mdw-shape__size__top-left-size));\n /* stylelint-disable-next-line liberty/use-logical-spec */\n padding-right: calc(2px * var(--mdw-shape__convex));\n padding-block-end: calc(2px * var(--mdw-shape__convex));\n \n -webkit-mask-image: var(--mdw-shape__mask-image__top-left);\n }\n \n .outline-left::after {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: calc(-1px * var(--mdw-shape__convex));\n inset-block-end: calc(-1px * var(--mdw-shape__convex));\n \n block-size: var(--mdw-shape__size__bottom-left-size);\n inline-size: var(--mdw-shape__size__bottom-left-size);\n /* stylelint-disable-next-line liberty/use-logical-spec */\n padding-right: calc(2px * var(--mdw-shape__convex));\n padding-block-start: calc(2px * var(--mdw-shape__convex));\n \n -webkit-mask-image: var(--mdw-shape__mask-image__bottom-left);\n -webkit-mask-position-y: 100%;\n }\n \n .outline-right::before {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n right: calc(-1px * var(--mdw-shape__convex));\n inset-block-start: calc(-1px * var(--mdw-shape__convex));\n \n block-size: var(--mdw-shape__size__top-right-size);\n inline-size: var(--mdw-shape__size__top-right-size);\n /* stylelint-disable-next-line liberty/use-logical-spec */\n padding-left: calc(2px * var(--mdw-shape__convex));\n padding-block-end: calc(2px * var(--mdw-shape__convex));\n \n -webkit-mask-image: var(--mdw-shape__mask-image__top-right);\n -webkit-mask-position-x: 100%;\n }\n\n .outline-right::after {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n right: calc(-1px * var(--mdw-shape__convex));\n inset-block-end: calc(-1px * var(--mdw-shape__convex));\n \n block-size: var(--mdw-shape__size__bottom-right-size);\n inline-size: var(--mdw-shape__size__bottom-right-size);\n /* stylelint-disable-next-line liberty/use-logical-spec */\n padding-left: calc(2px * var(--mdw-shape__convex));\n padding-block-start: calc(2px * var(--mdw-shape__convex));\n \n -webkit-mask-image: var(--mdw-shape__mask-image__bottom-right);\n -webkit-mask-position-x: 100%;\n -webkit-mask-position-y: 100%;\n }\n }\n `;\n}\n", "/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function ThemableMixin(Base) {\n return Base\n .extend()\n .observe({\n color: 'string',\n ink: 'string',\n block: 'boolean',\n typeStyle: 'string',\n })\n .css`\n :host([color=\"primary\"]) {\n --mdw-bg: var(--mdw-color__primary);\n --mdw-ink: var(--mdw-color__on-primary);\n }\n \n :host([color=\"primary-container\"]) {\n --mdw-bg: var(--mdw-color__primary-container);\n --mdw-ink: var(--mdw-color__on-primary-container);\n }\n \n :host([color=\"secondary\"]) {\n --mdw-bg: var(--mdw-color__secondary);\n --mdw-ink: var(--mdw-color__on-secondary);\n }\n \n :host([color=\"secondary-container\"]) {\n --mdw-bg: var(--mdw-color__secondary-container);\n --mdw-ink: var(--mdw-color__on-secondary-container);\n }\n \n :host([color=\"tertiary\"]) {\n --mdw-bg: var(--mdw-color__tertiary);\n --mdw-ink: var(--mdw-color__on-tertiary);\n }\n \n :host([color=\"tertiary-container\"]) {\n --mdw-bg: var(--mdw-color__tertiary-container);\n --mdw-ink: var(--mdw-color__on-tertiary-container);\n }\n \n :host([color=\"error\"]) {\n --mdw-bg: var(--mdw-color__error);\n --mdw-ink: var(--mdw-color__on-error);\n }\n \n :host([color=\"error-container\"]) {\n --mdw-bg: var(--mdw-color__error-container);\n --mdw-ink: var(--mdw-color__on-error-container);\n }\n \n :host([color=\"background\"]) {\n --mdw-bg: var(--mdw-color__background);\n --mdw-ink: var(--mdw-color__on-background);\n }\n \n :host([color^=\"surface\"]) {\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__on-surface);\n }\n \n /* Quality-of-life */\n :host([color=\"surface-primary\"]) {\n --mdw-ink: var(--mdw-color__primary);\n }\n \n :host([color$=\"variant\"]) {\n --mdw-bg: var(--mdw-color__surface-variant);\n --mdw-ink: var(--mdw-color__on-surface-variant);\n }\n \n :host([color^=\"inverse\"]) {\n --mdw-bg: var(--mdw-color__inverse-surface);\n --mdw-ink: var(--mdw-color__inverse-on-surface);\n }\n \n :host([color=\"inverse-primary\"]) {\n --mdw-ink: var(--mdw-color__inverse-primary);\n }\n \n :host([color][disabled]) {\n /* background-color: rgba(var(--mdw-color__on-surface), 0.12); */\n /* color: rgba(var(--mdw-color__on-surface), 0.38); */\n }\n \n :host([ink=\"inverse-primary\"]) {\n --mdw-ink: var(--mdw-color__inverse-primary);\n }\n \n :host([ink=\"primary\"]) {\n --mdw-ink: var(--mdw-color__primary);\n }\n \n :host([ink=\"on-primary-container\"]) {\n --mdw-ink: var(--mdw-color__on-primary-container);\n }\n \n :host([ink=\"secondary\"]) {\n --mdw-ink: var(--mdw-color__secondary);\n }\n \n :host([ink=\"on-secondary-container\"]) {\n --mdw-ink: var(--mdw-color__on-secondary-container);\n }\n \n :host([ink=\"tertiary\"]) {\n --mdw-ink: var(--mdw-color__tertiary);\n }\n \n :host([ink=\"on-tertiary-container\"]) {\n --mdw-ink: var(--mdw-color__on-tertiary-container);\n }\n \n :host([ink=\"error\"]) {\n --mdw-ink: var(--mdw-color__error);\n }\n \n :host([ink=\"outline\"]) {\n --mdw-ink: var(--mdw-color__outline);\n }\n \n :host([ink=\"on-surface\"]) {\n --mdw-ink: var(--mdw-color__on-surface);\n }\n \n :host([ink=\"surface-variant\"]) {\n --mdw-ink: var(--mdw-color__surface-variant);\n }\n \n :host([ink=\"on-surface-variant\"]) {\n --mdw-ink: var(--mdw-color__on-surface-variant);\n }\n \n :host([ink=\"inverse-on-surface\"]) {\n --mdw-ink: var(--mdw-color__inverse-on-surface);\n }\n \n :host([ink=\"inherit\"]) {\n --mdw-ink: inherit;\n }\n \n :host([type-style|=\"display\"]) {\n --mdw-type__font: var(--mdw-typescale__display-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__display-large__letter-spacing);\n }\n \n :host([type-style=\"display-medium\"]) {\n --mdw-type__font: var(--mdw-typescale__display-medium__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__display-medium__letter-spacing);\n }\n \n :host([type-style=\"display-small\"]) {\n --mdw-type__font: var(--mdw-typescale__display-small__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__display-small__letter-spacing);\n }\n \n :host([type-style|=\"headline\"]) {\n --mdw-type__font: var(--mdw-typescale__headline-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__headline-large__letter-spacing);\n }\n \n :host([type-style=\"headline-medium\"]) {\n --mdw-type__font: var(--mdw-typescale__headline-medium__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__headline-medium__letter-spacing);\n }\n \n :host([type-style=\"headline-small\"]) {\n --mdw-type__font: var(--mdw-typescale__headline-small__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__headline-small__letter-spacing);\n }\n \n :host([type-style|=\"title\"]) {\n --mdw-type__font: var(--mdw-typescale__title-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__title-large__letter-spacing);\n }\n \n :host([type-style=\"title-medium\"]) {\n --mdw-type__font: var(--mdw-typescale__title-medium__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__title-medium__letter-spacing);\n }\n \n :host([type-style=\"title-small\"]) {\n --mdw-type__font: var(--mdw-typescale__title-small__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__title-small__letter-spacing);\n }\n \n :host([type-style|=\"label\"]) {\n --mdw-type__font: var(--mdw-typescale__label-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__label-large__letter-spacing);\n }\n \n :host([type-style=\"label-medium\"]) {\n --mdw-type__font: var(--mdw-typescale__label-medium__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);\n }\n \n :host([type-style=\"label-small\"]) {\n --mdw-type__font: var(--mdw-typescale__label-small__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__label-small__letter-spacing);\n }\n \n :host([type-style|=\"body\"]) {\n --mdw-type__font: var(--mdw-typescale__body-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__body-large__letter-spacing);\n }\n \n :host([type-style=\"body-medium\"]) {\n --mdw-type__font: var(--mdw-typescale__body-medium__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n \n :host([type-style=\"body-small\"]) {\n --mdw-type__font: var(--mdw-typescale__body-small__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__body-small__letter-spacing);\n } \n `;\n}\n", "import CustomElement from '../core/CustomElement.js';\nimport DensityMixin from '../mixins/DensityMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(DensityMixin)\n .mixin(ShapeMixin)\n .extend()\n .html/* html */`<slot id=slot></slot>`\n .css`\n :host {\n --mdw-shape__size: 8px;\n --mdw-ink: var(--mdw-color__on-error);\n --mdw-shape__bg: rgb(var(--mdw-color__error));\n --mdw-type__font: var(--mdw-typescale__label-small__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__label-small__letter-spacing);\n position: relative;\n \n display: inline-block;\n vertical-align: middle;\n \n box-sizing: border-box;\n min-block-size: var(--mdw-typescale__label-small__line-height);\n min-inline-size: var(--mdw-typescale__label-small__line-height);\n padding-inline: max(4px, calc(4px + (var(--mdw-density) * 2px)));\n \n color: rgb(var(--mdw-ink));\n \n font: var(--mdw-type__font);\n letter-spacing: var(--mdw-type__letter-spacing);\n text-align: center;\n }\n \n @supports (width: 1lh) {\n :host {\n min-block-size: 1lh; /* Clamps to 1:1 */\n min-inline-size: 1lh; /* Clamps to 1:1 */\n padding-inline: max(0.25lh, calc(0.25lh + (var(--mdw-density) * 2px)));\n }\n }\n \n :host(:empty) {\n vertical-align: middle;\n }\n \n :host(:empty) #shape {\n inset: 5px;\n }\n `\n .autoRegister('mdw-badge');\n", "/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function FlexableMixin(Base) {\n return Base\n .extend()\n .observe({\n flex: {\n type: 'string',\n empty: 'row',\n /** @type {'row'|'column'} */\n value: 'row',\n },\n x: {\n type: 'string',\n empty: 'start',\n /** @type {'start'|'center'|'end'|'between'|'around'|'stretch'} */\n value: 'start',\n },\n y: {\n type: 'string',\n empty: 'start',\n /** @type {'start'|'center'|'end'|'between'|'around'|'stretch'} */\n value: 'start',\n },\n gap: 'float',\n padding: 'float',\n })\n .css`\n /* https://css-tricks.com/snippets/css/a-guide-to-flexbox/ */\n\n :host{\n box-sizing: border-box;\n }\n\n :host([flex]) {\n display:flex;\n }\n\n :host([flex=\"column\"]) {\n flex-direction: column;\n }\n\n :host(:where([flex][y=\"start\"], [flex=\"column\"][x=\"start\"])) {\n align-items: flex-start;\n }\n\n :host(:where([flex][y=\"end\"], [flex=\"column\"][x=\"end\"])) {\n align-items: flex-end;\n }\n\n :host(:where([flex][y=\"center\"], [flex=\"column\"][x=\"center\"])) {\n align-items: center;\n }\n\n :host(:where([flex][y=\"between\"], [flex=\"column\"][x=\"between\"])) {\n align-items: space-between;\n }\n\n :host(:where([flex][y=\"around\"], [flex=\"column\"][x=\"around\"])) {\n align-items: space-around;\n }\n\n :host(:where([flex][y=\"stretch\"], [flex=\"column\"][x=\"stretch\"])) {\n align-items: stretch;\n }\n\n :host(:where([flex][x=\"start\"], [flex=\"column\"][y=\"start\"])) {\n justify-content: flex-start;\n }\n\n :host(:where([flex][x=\"end\"], [flex=\"column\"][y=\"end\"])) {\n justify-content: flex-end;\n }\n\n :host(:where([flex][x=\"center\"], [flex=\"column\"][y=\"center\"])) {\n justify-content: center;\n }\n\n :host(:where([flex][x=\"between\"], [flex=\"column\"][y=\"between\"])) {\n justify-content: space-between;\n }\n\n :host(:where([flex][x=\"stretch\"], [flex=\"column\"][y=\"stretch\"])) {\n justify-content: space-around;\n }\n\n :host([wrap]) {\n flex-wrap: wrap;\n }\n\n :host([wrap=\"reverse\"]) {\n flex-wrap: wrap-reverse;\n }\n\n :host([gap=\"4\"]) {gap: 4px;}\n :host([gap=\"8\"]) {gap: 8px;}\n :host([gap=\"12\"]) {gap: 12px;}\n :host([gap=\"16\"]) {gap: 16px;}\n :host([gap=\"20\"]) {gap: 20px;}\n :host([gap=\"24\"]) {gap: 24px;}\n\n :host([padding=\"4\"]) {padding: 4px;}\n :host([padding=\"8\"]) {padding: 8px;}\n :host([padding=\"12\"]) {padding: 12px;}\n :host([padding=\"16\"]) {padding: 16px;}\n :host([padding=\"20\"]) {padding: 20px;}\n :host([padding=\"24\"]) {padding: 24px;}\n `;\n}\n", "import CustomElement from '../core/CustomElement.js';\nimport FlexableMixin from '../mixins/FlexableMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n/**\n * Containers are stateless elements that may have a color and ink.\n * They should have simple geometry for rendering and layout.\n */\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(FlexableMixin)\n .extend()\n .observe({\n inline: 'boolean',\n block: {\n type: 'boolean',\n empty: true,\n },\n })\n .css`\n :host {\n display: block;\n }\n \n :host([inline]) {\n display: inline-block;\n }\n \n :host([flex]:where([inline])) {\n display: inline-flex;\n }\n \n :host([color]) {\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-ink));\n }\n \n :host([ink]) {\n color: rgb(var(--mdw-ink));\n }\n \n :host([type-style]) {\n font: var(--mdw-type__font);\n letter-spacing: var(--mdw-type__letter-spacing);\n }\n \n #slot {\n /* Passthrough from parent */\n block-size: inherit;\n inline-size: inherit;\n }\n `\n .html/* html */`<slot id=slot type-style={typeStyle}></slot>`\n .autoRegister('mdw-box');\n", "import Box from './Box.js';\n\nexport default Box\n .extend()\n .css`\n :host {\n font: var(--mdw-typescale__body-large__font);\n letter-spacing: var(--mdw-typescale__body-large__letter-spacing);\n }\n \n :host([size=\"medium\"]) {\n font: var(--mdw-typescale__body-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n \n :host([size=\"small\"]) {\n font: var(--mdw-typescale__body-small__font);\n letter-spacing: var(--mdw-typescale__body-small__letter-spacing);\n }\n `\n .autoRegister('mdw-body');\n", "/** @param {typeof import('../core/CustomElement.js').default} Base */\nexport default function AriaReflectorMixin(Base) {\n return Base\n .extend()\n .observe({\n _ariaRole: 'string',\n }).methods({\n /**\n * @param {keyof HTMLElement & keyof ElementInternals} name\n * @param {string} value\n */\n updateAriaProperty(name, value) {\n if (this.elementInternals && name in this.elementInternals) {\n this.elementInternals[name] = value;\n } else if (name in this) {\n this[name] = value;\n } else {\n console.warn('Unknown ARIA property', name);\n /** @type {string} */\n let attrName = name;\n if (attrName.startsWith('aria')) {\n attrName = `aria-${attrName.slice(4).toLowerCase()}`;\n }\n if (value == null) {\n this.removeAttribute(name);\n } else {\n this.setAttribute(attrName, value);\n }\n }\n },\n })\n .on({\n _ariaRoleChanged(oldValue, newValue) {\n this.updateAriaProperty('role', newValue);\n },\n constructed() {\n this.updateAriaProperty('role', this._ariaRole);\n },\n });\n}\n", "import { attemptFocus, isRtl } from '../core/dom.js';\n\nconst DEFAULT_ELEMENT_QUERY = [\n 'button',\n '[href]',\n 'input',\n 'select',\n 'textarea',\n '[tabindex]',\n].join(', ');\n\n/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function KeyboardNavMixin(Base) {\n return Base\n .extend()\n .observe({\n /** Keyboard navigation attribute */\n kbdNav: { empty: 'true' },\n _kbdFocusable: { empty: true },\n\n })\n .define({\n /**\n * Query used to find roving tab index children\n */\n kbdNavQuery() {\n return DEFAULT_ELEMENT_QUERY;\n },\n /**\n * Flag whether disabled elements participating in roving tab index\n * should be focusable.\n */\n kbdNavFocusableWhenDisabled() { return true; },\n /** @return {'horizontal'|'vertical'} */\n ariaOrientationDefault() { return 'vertical'; },\n })\n .define({\n /**\n * List of roving tab index participating children\n * @return {NodeListOf<HTMLElement>}\n */\n kbdNavChildren() {\n return this.querySelectorAll(this.kbdNavQuery);\n },\n })\n .methods({\n _ariaOrientationIsVertical() {\n return (this.ariaOrientation\n ?? this.getAttribute('aria-orientation')\n ?? this.ariaOrientationDefault) === 'vertical';\n },\n /**\n * Focuses next element participating in roving tab index list\n * @param {HTMLElement} [current]\n * @param {boolean} [loop=true]\n * @param {boolean} [reverse]\n * @return {HTMLElement} focusedElement\n */\n focusNext(current = null, loop = true, reverse = false) {\n let foundCurrent = false;\n const array = reverse ? [...this.kbdNavChildren].reverse() : this.kbdNavChildren;\n for (const candidate of array) {\n if (!foundCurrent) {\n foundCurrent = (current\n ? (candidate === current)\n : (candidate.getAttribute('tabindex') === '0'));\n continue;\n }\n if (!candidate.hasAttribute('tabindex')) {\n continue;\n }\n if (candidate.getAttribute('aria-hidden') === 'true') {\n continue;\n }\n if (attemptFocus(candidate)) {\n this.ariaActiveDescendantElement = candidate;\n return candidate;\n }\n }\n\n if (!loop) {\n if (document.activeElement !== current && current instanceof HTMLElement) {\n current.focus();\n }\n return current;\n }\n // Loop\n for (const candidate of array) {\n if (!candidate.hasAttribute('tabindex')) {\n continue;\n }\n if (candidate.getAttribute('aria-hidden') === 'true') {\n continue;\n }\n // Abort if we've looped all the way back to original element\n // Abort if candidate received focus\n if (attemptFocus(candidate)) {\n return candidate;\n }\n if (candidate === current) {\n return candidate;\n }\n }\n return null;\n },\n\n /**\n * Alias for focusNext(list, current, true).\n * Selects previous element\n * @param {HTMLElement} [current]\n * @param {boolean} [loop=true]\n * @return {HTMLElement}\n */\n focusPrevious(current, loop = true) {\n return this.focusNext(current, loop, true);\n },\n\n /** @type {HTMLElement['focus']} */\n focus(...options) {\n // super.focus(...options);\n if (attemptFocus(this.ariaActiveDescendantElement, ...options)) {\n return;\n }\n for (const candidate of this.kbdNavChildren) {\n if (candidate.getAttribute('tabindex') === '0' && candidate instanceof HTMLElement) {\n this.ariaActiveDescendantElement = candidate;\n candidate.focus(...options);\n return;\n }\n }\n this.focusNext();\n },\n\n /**\n * Refreshes roving tab index attributes based on kbdNavChildren\n */\n refreshTabIndexes() {\n if (this.kbdNav !== 'true') return;\n /** @type {HTMLElement} */\n let currentlyFocusedChild = null;\n /** @type {HTMLElement} */\n let currentTabIndexChild = null;\n /** @type {HTMLElement} */\n let firstFocusableChild = null;\n for (const child of this.kbdNavChildren) {\n if (!currentlyFocusedChild && document.activeElement === child) {\n currentlyFocusedChild = child;\n } else if (!currentTabIndexChild && child.getAttribute('tabindex') === '0') {\n currentTabIndexChild = child;\n } else {\n if (!firstFocusableChild && child.getAttribute('aria-hidden') !== 'true'\n && (this.kbdNavFocusableWhenDisabled || child.getAttribute('aria-disabled') !== 'true')) {\n firstFocusableChild = child;\n }\n child.tabIndex = -1;\n // child.setAttribute('tabindex', '-1');\n }\n // Bind\n if (!child.hasAttribute('tabindex')) {\n child.tabIndex = (document.activeElement === child) ? 0 : -1;\n }\n // this.rtiBindChild(child);\n }\n if (currentlyFocusedChild) {\n currentlyFocusedChild.tabIndex = 0;\n // currentlyFocusedChild.setAttribute('tabindex', '0');\n } else if (currentTabIndexChild) {\n if (currentlyFocusedChild) {\n currentTabIndexChild.tabIndex = -1;\n // currentTabIndexChild.setAttribute('tabindex', '-1');\n }\n } else if (firstFocusableChild) {\n firstFocusableChild.tabIndex = 0;\n // firstFocusableChild.setAttribute('tabindex', '0');\n }\n },\n })\n .events({\n focusin(event) {\n if (this.kbdNav !== 'true') return;\n const currentItem = /** @type {HTMLElement} */ (event.target);\n const participates = currentItem.matches(this.kbdNavQuery);\n if (!participates) return;\n this.ariaActiveDescendantElement = currentItem;\n if (currentItem.getAttribute('tabindex') !== '0') {\n currentItem.tabIndex = 0;\n }\n for (const item of this.kbdNavChildren) {\n if (item !== currentItem && item.hasAttribute('tabindex')) {\n item.tabIndex = -1;\n // item.setAttribute('tabindex', '-1');\n }\n }\n },\n keydown(event) {\n if (event.ctrlKey || event.altKey || event.shiftKey || event.metaKey) return;\n if (this.kbdNav !== 'true') return;\n\n switch (event.key) {\n case 'ArrowUp':\n case 'Up':\n if (this._ariaOrientationIsVertical()) {\n this.focusPrevious();\n }\n break;\n case 'ArrowDown':\n case 'Down':\n if (this._ariaOrientationIsVertical()) {\n this.focusNext();\n }\n break;\n case 'ArrowLeft':\n case 'Left':\n if (this._ariaOrientationIsVertical()) return;\n if (isRtl(this)) {\n this.focusNext();\n } else {\n this.focusPrevious();\n }\n break;\n case 'ArrowRight':\n case 'Right':\n if (this._ariaOrientationIsVertical()) return;\n if (isRtl(this)) {\n this.focusPrevious();\n } else {\n this.focusNext();\n }\n break;\n default:\n return;\n }\n event.stopPropagation(); // Avoid kbd within kbd (sub menus)\n event.preventDefault();\n },\n })\n .on({\n connected() {\n this.refreshTabIndexes();\n },\n });\n}\n", "import KbdNavWidgetMixin from './KeyboardNavMixin.js';\n\n/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function AriaToolbarMixin(Base) {\n return Base\n .mixin(KbdNavWidgetMixin)\n .extend()\n .set({\n ariaOrientationDefault: 'horizontal',\n });\n}\n", "/**\n * @param {ReturnType<import('./StateMixin.js').default> & ReturnType<import('./ThemableMixin.js').default>} Base\n */\nexport default function SurfaceMixin(Base) {\n return Base\n .extend()\n .observe({\n elevated: 'boolean',\n elevation: 'integer',\n _raised: {\n type: 'boolean',\n get({ hoveredState, pressedState }) {\n return hoveredState && !pressedState;\n },\n },\n })\n .expressions({\n showSurfaceTint({ elevated, elevation, disabledState, color }) {\n return (elevated || elevation !== null)\n && !disabledState\n && (!color || color.includes('surface'));\n },\n })\n .html/* html */`\n <div id=surface class=surface raised={_raised} disabled={disabledState} color={color}>\n <div _if={showSurfaceTint} id=surface-tint class=surface-tint raised={_raised} color={color} aria-hidden=true></div>\n </div>\n `\n .css`\n :host {\n\n /** Filter blur is 1/2 CSS blur */\n \n /** Reference Properties */\n /*\n --mdw-surface__box-shadow__1__umbra: 0px 1px 2px 0px rgba(var(--mdw-color__shadow), 0.30);\n --mdw-surface__box-shadow__2__umbra: 0px 1px 2px 0px rgba(var(--mdw-color__shadow), 0.30);\n --mdw-surface__box-shadow__3__umbra: 0px 1px 3px 0px rgba(var(--mdw-color__shadow), 0.30);\n --mdw-surface__box-shadow__4__umbra: 0px 2px 3px 0px rgba(var(--mdw-color__shadow), 0.30);\n --mdw-surface__box-shadow__5__umbra: 0px 4px 4px 0px rgba(var(--mdw-color__shadow), 0.30);\n \n --mdw-surface__filter__0__umbra: drop-shadow(0px 1px 1px rgba(var(--mdw-color__shadow), 0));\n --mdw-surface__filter__1__umbra: drop-shadow(0px 1px 1px rgba(var(--mdw-color__shadow), 0.30));\n --mdw-surface__filter__2__umbra: drop-shadow(0px 1px 1px rgba(var(--mdw-color__shadow), 0.30));\n --mdw-surface__filter__3__umbra: drop-shadow(0px 1px 1.5px rgba(var(--mdw-color__shadow), 0.30));\n --mdw-surface__filter__4__umbra: drop-shadow(0px 2px 1.5px rgba(var(--mdw-color__shadow), 0.30));\n --mdw-surface__filter__5__umbra: drop-shadow(0px 4px 2px rgba(var(--mdw-color__shadow), 0.30));\n \n --mdw-surface__box-shadow__1__penumbra: 0px 1px 3px 1px rgba(var(--mdw-color__shadow), 0.15);\n --mdw-surface__box-shadow__2__penumbra: 0px 2px 6px 2px rgba(var(--mdw-color__shadow), 0.15);\n --mdw-surface__box-shadow__3__penumbra: 0px 4px 8px 3px rgba(var(--mdw-color__shadow), 0.15);\n --mdw-surface__box-shadow__4__penumbra: 0px 6px 10px 4px rgba(var(--mdw-color__shadow), 0.15);\n --mdw-surface__box-shadow__5__penumbra: 0px 8px 12px 6px rgba(var(--mdw-color__shadow), 0.15);\n \n --mdw-surface__filter__0__penumbra: drop-shadow(0px 1px 2.5px rgba(var(--mdw-color__shadow), 0));\n --mdw-surface__filter__1__penumbra: drop-shadow(0px 1px 2.5px rgba(var(--mdw-color__shadow), 0.25));\n --mdw-surface__filter__2__penumbra: drop-shadow(0px 2px 5px rgba(var(--mdw-color__shadow), 0.25));\n --mdw-surface__filter__3__penumbra: drop-shadow(0px 4px 7px rgba(var(--mdw-color__shadow), 0.263));\n --mdw-surface__filter__4__penumbra: drop-shadow(0px 6px 9px rgba(var(--mdw-color__shadow), 0.27));\n --mdw-surface__filter__5__penumbra: drop-shadow(0px 8px 12px rgba(var(--mdw-color__shadow), 0.30));\n \n --mdw-surface__filter__0: var(--mdw-surface__shadow__0__umbra) var(--mdw-surface__shadow__0__penumbra);\n --mdw-surface__filter__1: var(--mdw-surface__shadow__1__umbra) var(--mdw-surface__shadow__1__penumbra);\n --mdw-surface__filter__2: var(--mdw-surface__shadow__2__umbra) var(--mdw-surface__shadow__2__penumbra);\n --mdw-surface__filter__3: var(--mdw-surface__shadow__3__umbra) var(--mdw-surface__shadow__3__penumbra);\n --mdw-surface__filter__4: var(--mdw-surface__shadow__4__umbra) var(--mdw-surface__shadow__4__penumbra);\n --mdw-surface__filter__5: var(--mdw-surface__shadow__5__umbra) var(--mdw-surface__shadow__5__penumbra);\n */\n \n /** Flatten for performance */\n --mdw-surface__shadow__0: drop-shadow(0px 1px 001px rgba(0,0,0,000)) drop-shadow(0px 1px 2.5px rgba(0,0,0,00000));\n --mdw-surface__shadow__1: drop-shadow(0px 1px 001px rgba(0,0,0,0.3)) drop-shadow(0px 1px 2.5px rgba(0,0,0,0.250));\n --mdw-surface__shadow__2: drop-shadow(0px 1px 001px rgba(0,0,0,0.3)) drop-shadow(0px 2px 005px rgba(0,0,0,0.250));\n --mdw-surface__shadow__3: drop-shadow(0px 1px 1.5px rgba(0,0,0,0.3)) drop-shadow(0px 4px 007px rgba(0,0,0,0.263));\n --mdw-surface__shadow__4: drop-shadow(0px 2px 1.5px rgba(0,0,0,0.3)) drop-shadow(0px 6px 009px rgba(0,0,0,0.270));\n --mdw-surface__shadow__5: drop-shadow(0px 4px 2.0px rgba(0,0,0,0.3)) drop-shadow(0px 8px 012px rgba(0,0,0,0.300));\n \n --mdw-surface__tint__1: 0.05;\n --mdw-surface__tint__2: 0.08;\n --mdw-surface__tint__3: 0.11;\n --mdw-surface__tint__4: 0.12;\n --mdw-surface__tint__5: 0.14;\n \n /** Configurables */\n \n --mdw-surface__shadow__resting: none;\n --mdw-surface__shadow: var(--mdw-surface__shadow__resting);\n --mdw-surface__tint: 0;\n --mdw-surface__tint__raised: 0;\n z-index: 0;\n }\n \n :host([elevation=\"0\"]) {\n --mdw-surface__tint: 0;\n --mdw-surface__shadow__resting: none;\n }\n \n :host([elevation=\"1\"]) {\n --mdw-surface__tint: var(--mdw-surface__tint__1);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__1);\n }\n \n :host([elevation=\"2\"]) {\n --mdw-surface__tint: var(--mdw-surface__tint__2);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__2);\n }\n \n :host([elevation=\"3\"]) {\n --mdw-surface__tint: var(--mdw-surface__tint__3);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__3);\n }\n \n :host([elevation=\"4\"]) {\n --mdw-surface__tint: var(--mdw-surface__tint__4);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__4);\n }\n \n :host([elevation=\"5\"]) {\n --mdw-surface__tint: var(--mdw-surface__tint__5);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__5);\n }\n \n :host([elevation]) {\n --mdw-surface__tint__raised: var(--mdw-surface__tint);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__resting);\n }\n \n .surface {\n position: absolute;\n inset: 0;\n \n pointer-events: none;\n \n filter: var(--mdw-surface__shadow);\n z-index: -1;\n \n transition-delay: 1ms;\n transition-duration: 200ms;\n transition-property: filter;\n transition-timing-function: linear;\n will-change: filter;\n }\n \n .surface[raised] {\n filter: var(--mdw-surface__shadow__raised, var(--mdw-surface__shadow__resting));\n }\n \n .surface[disabled] {\n filter:none;\n }\n \n .surface-tint {\n position: absolute;\n inset: 0;\n \n pointer-events: none;\n \n opacity: var(--mdw-surface__tint, 0);\n \n background-color: rgb(var(--mdw-color__primary));\n border-radius: inherit;\n \n transition-delay: 1ms;\n transition-duration: 200ms;\n transition-property: opacity;\n will-change: opacity;\n }\n \n .surface-tint[raised] {\n opacity: var(--mdw-surface__tint__raised, 0);\n }\n \n .surface-tint[pressed] {\n opacity: var(--mdw-surface__tint, 0);\n }\n \n .surface-tint[color]:not([color|=\"surface\"]) {\n display: none;\n } \n `;\n}\n", "import CustomElement from '../core/CustomElement.js';\nimport FlexableMixin from '../mixins/FlexableMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport SurfaceMixin from '../mixins/SurfaceMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(FlexableMixin)\n .mixin(SurfaceMixin)\n .mixin(ShapeMixin)\n .html/* html */`<slot id=slot></slot>`\n .on({\n composed() {\n const { surface, shape, surfaceTint } = this.refs;\n shape.append(surfaceTint);\n surface.append(shape);\n },\n })\n .css`\n :host {\n --mdw-shape__bg: rgb(var(--mdw-color__surface));\n --mdw-ink: var(--mdw-color__on-surface);\n position: relative;\n \n color: rgb(var(--mdw-ink));\n \n font: var(--mdw-type__font);\n letter-spacing: var(--mdw-type__letter-spacing);\n } \n `\n .autoRegister('mdw-surface');\n", "import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\nimport AriaToolbarMixin from '../mixins/AriaToolbarMixin.js';\n\nimport Surface from './Surface.js';\n\n/**\n * Note: FAB does not exist inside because FABs can appear outside.\n * Space will be maintained for the FAB to slide into position. FAB should be\n * next on the DOM, so users can logically tab to it.\n */\n\nexport default Surface\n .mixin(AriaToolbarMixin)\n .mixin(AriaReflectorMixin)\n .extend()\n .set({\n elevated: true,\n _ariaRole: 'toolbar',\n })\n .observe({\n color: { empty: 'surface' },\n })\n .css`\n /* https://m3.material.io/components/bottom-app-bar/specs */\n\n :host {\n --mdw-surface__tint: var(--mdw-surface__tint__2);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__2);\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__on-surface);\n\n display: flex;\n align-items: center;\n gap: 8px;\n justify-content: flex-start;\n\n box-sizing: content-box;\n /* Don't apply density */\n block-size: 56px;\n padding-block: 12px;\n padding-inline: 8px 16px;\n\n box-shadow: none;\n\n direction: ltr;\n }\n `\n .autoRegister('mdw-bottom-app-bar');\n", "// import fontStyles from 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&display=block' assert { type: 'css'};\n\nimport CustomElement from '../core/CustomElement.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n/** @type {Map<string, {path:string, viewBox:string}>} */\nconst svgAliasMap = new Map();\nconst unaliased = new Set();\n\nconst documentLoadedStyleSheets = new Set();\n\n/** @typedef {'align'|'border'|'hspace'|'longDesc'|'lowsrc'|'name'|'vspace'} DeprecatedHTMLImageElementProperties */\n\n// https://html.spec.whatwg.org/multipage/embedded-content.html#htmlimageelement\n\n/** @implements {Omit<HTMLImageElement,DeprecatedHTMLImageElementProperties>} */\nexport default class Icon extends CustomElement\n .mixin(ThemableMixin)\n .extend()\n .define({\n _img() { return /** @type {HTMLImageElement} */ (this.refs.img); },\n })\n .define({\n naturalWidth() { return this._img.naturalWidth; },\n naturalHeight() { return this._img.naturalHeight; },\n complete() { return this._img.complete; },\n currentSrc() { return this._img.currentSrc; },\n x() { return this._img.x; },\n y() { return this._img.y; },\n decode() { return this._img.decode; },\n })\n .observe({\n _slottedText: 'string',\n disabled: 'boolean',\n alt: 'string',\n src: 'string',\n svg: 'string',\n svgPath: 'string',\n srcset: 'string',\n sizes: 'string',\n crossOrigin: { attr: 'crossorigin' },\n useMap: { attr: 'usemap' },\n isMap: { type: 'boolean', attr: 'ismap' },\n referrerPolicy: { attr: 'referrerpolicy' },\n decoding: { value: /** @type {'async'|'sync'|'auto'} */ (null) },\n loading: { value: /** @type {'eager'|'lazy'} */ (null) },\n width: 'integer',\n height: 'integer',\n forceFont: 'boolean',\n _linkLoaded: 'boolean',\n viewBox: { attr: 'viewBox' },\n fontClass: { empty: 'material-symbols-outlined' },\n fontLibrary: { empty: 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&display=block' },\n })\n .observe({\n _svgAlias: {\n type: 'object',\n get({ _slottedText }) {\n if (!_slottedText) return null;\n const result = svgAliasMap.get(_slottedText.trim().toLowerCase());\n if (!result) {\n unaliased.add(_slottedText);\n console.warn(`Icon: No SVG alias for ${JSON.stringify([...unaliased])}`);\n }\n return result;\n },\n },\n })\n .observe({\n _computedSVGPath({ svgPath, _svgAlias }) {\n return svgPath || _svgAlias?.path;\n },\n _computedViewBox({ viewBox, _svgAlias }) {\n return viewBox ?? _svgAlias?.viewBox ?? '0 0 24 24';\n },\n })\n .observe({\n _showSlot: {\n type: 'boolean',\n get({ _slottedText, svg, _computedSVGPath, src }) {\n return _slottedText && !svg && !_computedSVGPath && !src;\n },\n },\n })\n .expressions({\n showSVG({ svg, _computedSVGPath }) {\n return Boolean(svg || _computedSVGPath);\n },\n\n })\n .html/* html */`\n <link _if={_showSlot} id=link rel=stylesheet href={fontLibrary} />\n <svg _if=\"{showSVG}\" id=\"svg\" viewBox=\"{_computedViewBox}\">\n <use id=\"use\" _if=\"{svg}\" href=\"{svg}\" fill=\"currentColor\"/>\n <path id=\"path\" _if=\"{_computedSVGPath}\" d=\"{_computedSVGPath}\"/>\n </svg>\n <img _if={src} id=img\n disabled={disabled}\n alt={alt} src={src} srcset={srcset} sizes={sizes}\n crossorigin={crossOrigin} usemap={useMap} ismap={isMap}\n referrerpolicy={referrerPolicy} decoding={decoding} loading={loading}\n width={width} height={height}\n />\n <slot id=icon class={fontClass} hidden={!_showSlot} aria-hidden=true></slot>\n `\n .css`\n /* https://material.io/design/iconography/system-icons.html */\n\n :host {\n display: inline-block;\n vertical-align: -11.5%;\n\n block-size: 1em;\n inline-size: 1em;\n\n -webkit-user-select: none;\n user-select: none;\n\n font-variation-settings: 'FILL' 1;\n\n transition-duration: 200ms;\n /* stylelint-disable-next-line liberty/use-logical-spec -- Safari does not animate inline-size */\n transition-property: inline-size, width;\n }\n\n :host(:is([color],[ink])) {\n color: rgb(var(--mdw-ink));\n }\n\n #icon {\n /* Clip bounds in case font is not ready */\n display: block;\n overflow: clip;\n\n block-size: 1em;\n inline-size: 1em;\n\n font-size: inherit;\n font-variation-settings: inherit;\n\n transition-delay: 1ms;\n transition-duration: 200ms;\n\n transition-property: font-variation-settings;\n }\n\n #icon[hidden] {\n display: none;\n }\n\n #svg {\n display: block;\n\n block-size: inherit;\n inline-size: inherit;\n\n fill: currentColor;\n\n object-fit: cover;\n }\n\n #img {\n display: block;\n\n block-size: inherit;\n inline-size: inherit;\n\n object-fit: cover;\n\n transition-delay: 1ms;\n transition-duration: 200ms;\n transition-property: filter;\n }\n\n #img[disabled] {\n filter: grayscale();\n }\n\n .material-symbols-outlined {\n /* https://github.com/google/material-design-icons/issues/750 */\n direction: inherit;\n }\n\n `\n .childEvents({\n icon: {\n slotchange() {\n this._slottedText = this.textContent;\n },\n },\n link: {\n /**\n * @param {{currentTarget: HTMLLinkElement}} event\n * @type {any}\n */\n load({ currentTarget }) {\n const { href, parentNode } = currentTarget;\n if (!parentNode) {\n console.warn('Icon: parentNode is blank');\n }\n if (documentLoadedStyleSheets.has(href)) return;\n console.debug('Icon: Checking if link also in document', href);\n for (const link of document.head.getElementsByTagName('link')) {\n if (link.href === href) {\n console.debug(`Icon: Found ${href} in document.`);\n documentLoadedStyleSheets.add(href);\n return;\n }\n }\n console.debug(`Icon: Adding ${href} to document.`);\n document.head.append(currentTarget.cloneNode());\n documentLoadedStyleSheets.add(href);\n },\n },\n }) {\n static get svgAliasMap() { return svgAliasMap; }\n\n static get svgUnaliased() { return unaliased; }\n\n /**\n * @param {string} name\n * @param {string} path\n * @param {string} [viewBox]\n */\n static addSVGAlias(name, path, viewBox = '0 0 24 24') {\n name = name.toLowerCase();\n if (path) {\n svgAliasMap.set(name, { path, viewBox });\n } else {\n svgAliasMap.delete(name);\n }\n }\n\n /**\n * @param {number} [width]\n * @param {number} [height]\n */\n constructor(width, height) {\n super();\n\n if (width != null) {\n this.width = width;\n }\n if (height != null) {\n this.height = height;\n }\n }\n}\n\nIcon.autoRegister('mdw-icon');\n", "/* https://html.spec.whatwg.org/multipage/form-control-infrastructure.html */\n\n/** @typedef {HTMLElement & {value:string}} HTMLControlElement */\n\n/** @typedef {import('../core/CustomElement.js').default} CustomElement */\n\nconst DOMString = { nullParser: String };\n\nconst FORM_IPC_EVENT = 'mdw-form-associated-changed';\n\n/**\n * @param {ReturnType<import('./StateMixin.js').default>} Base\n */\nexport default function FormAssociatedMixin(Base) {\n return Base\n .extend()\n .setStatic({\n formAssociated: true,\n })\n .set({\n _valueDirty: false,\n /** @type {EventListener} */\n _ipcListener: null,\n /** @type {EventTarget} */\n _ipcTarget: null,\n })\n .observe({\n ariaControls: 'string',\n autocomplete: DOMString,\n name: DOMString,\n readOnly: { attr: 'readonly', type: 'boolean' },\n required: 'boolean',\n type: DOMString,\n // [CEReactions] attribute [LegacyNullToEmptyString] DOMString value;\n _value: {\n empty: '',\n /**\n * @param {string} oldValue\n * @param {string} newValue\n */\n changedCallback(oldValue, newValue) {\n this.propChangedCallback('value', oldValue, newValue);\n },\n },\n _invalid: 'boolean',\n _badInput: 'boolean',\n _validationMessage: 'string',\n _formDisabled: 'boolean',\n })\n .observe({\n erroredState({ _invalid }) { return _invalid; },\n })\n .define({\n form() { return this.elementInternals.form; },\n validity() { return this.elementInternals.validity; },\n validationMessage() { return this.elementInternals.validationMessage; },\n willValidate() { return this.elementInternals.willValidate; },\n labels() { return this.elementInternals.labels; },\n value: {\n get() {\n return this._value;\n },\n /** @param {string} v */\n set(v) {\n this._valueDirty = true;\n this._value = v;\n },\n },\n })\n .observe({\n disabledState({ _formDisabled, disabled }) {\n if (_formDisabled) return true;\n return !!disabled;\n },\n })\n .methods({\n checkValidity() { return this.elementInternals.checkValidity(); },\n\n reportValidity() { return this.elementInternals.reportValidity(); },\n\n /**\n * @param {string} error\n * @return {void}\n */\n setCustomValidity(error) {\n this.elementInternals.setValidity({\n ...this.elementInternals.validity,\n customError: !!error,\n }, this.elementInternals.validationMessage || error);\n },\n\n /**\n * @param {string} key\n * @param {string} value\n * @return {void}\n */\n _notifyRadioChange(key, value) {\n this._ipcTarget?.dispatchEvent(\n new CustomEvent(FORM_IPC_EVENT, { detail: [key, value] }),\n );\n },\n\n refreshFormAssociation() {\n const newTarget = this.elementInternals.form ?? this.getRootNode();\n if (newTarget === this._ipcTarget) {\n // console.warn('Already associated?', newTarget);\n return;\n }\n if (this._ipcTarget) {\n this._ipcTarget.removeEventListener(FORM_IPC_EVENT, this._ipcListener);\n }\n if (this.type !== 'radio') return;\n\n this._ipcTarget = newTarget;\n this._ipcListener ??= this.formIPCEvent.bind(this);\n this._ipcTarget.addEventListener(FORM_IPC_EVENT, this._ipcListener);\n },\n\n /**\n * New lifecycle callback. This is called when association with\n * <form> is changed.\n * @param {HTMLFormElement?} form\n * @return {void}\n */\n formAssociatedCallback(form) {\n this.refreshFormAssociation();\n },\n\n /**\n * @param {CustomEvent<[string, string]>} event\n * @return {void}\n */\n\n formIPCEvent(event) {\n console.warn('Virtual formIPCEvent invoked.');\n // virtual\n },\n\n /** @param {boolean} disabled */\n formDisabledCallback(disabled) {\n this._formDisabled = disabled;\n },\n\n formResetCallback() {\n this._valueDirty = false;\n this.checkValidity();\n },\n\n /**\n * @param {string|FormData} state\n * @param {'autocomplete'|'restore'} mode\n */\n formStateRestoreCallback(state, mode) {\n if (typeof state === 'string') {\n this.value = state;\n } else {\n console.warn('Could not restore', state);\n }\n },\n })\n .events({\n blur() { this.checkValidity(); },\n })\n .on({\n connected() {\n // Bind to global if no form is present (used by radio)\n this.refreshFormAssociation();\n },\n });\n}\n", "/* https://html.spec.whatwg.org/multipage/form-control-infrastructure.html */\n\nimport FormAssociatedMixin from './FormAssociatedMixin.js';\n\n/** @typedef {import('../core/CustomElement.js').default} CustomElement */\n\n/** @typedef {'align'|'useMap'} DeprecatedHTMLInputElementProperties */\n\n/** @typedef {HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement} HTMLControlElement */\n\n/**\n * @param {ReturnType<import('./StateMixin.js').default>} Base\n */\nexport default function ControlMixin(Base) {\n class Control extends Base.mixin(FormAssociatedMixin) {\n /** @return {Iterable<string>} */\n static get observedAttributes() {\n return [\n ...super.observedAttributes,\n 'aria-label',\n ...this.valueChangingContentAttributes,\n ...this.clonedContentAttributes,\n ];\n }\n\n static controlTagName = 'input';\n\n static controlVoidElement = true;\n\n /** @type {string[]} */\n static clonedContentAttributes = [\n 'autocomplete', 'name', 'readonly', 'required',\n ];\n\n /** @type {string[]} */\n static valueChangingContentAttributes = [];\n\n static {\n // eslint-disable-next-line no-unused-expressions\n this.css`\n \n :host {\n display: inline-flex;\n }\n \n /* Remove Firefox inner */\n :host(::-moz-focus-inner) {\n border: 0;\n }\n \n #label {\n display: contents;\n \n pointer-events: none;\n }\n \n #control {\n /* Control is the touch target */\n /* Firefox requires at least 1px \"visible\" for screen reading */\n /* Safari will not allow interaction with 0 opacity */\n /* Chrome will not focus with visibility:hidden */\n \n position: absolute;\n inset: 50%;\n /* --mdw-device-pixel-ratio: 1; */\n \n block-size: 100%;\n min-block-size: 48px;\n inline-size:100%;\n min-inline-size: 48px;\n margin: 0;\n border: 0;\n padding: 0;\n \n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n \n cursor: auto;\n outline: none;\n \n pointer-events: auto;\n \n transform: translateX(-50%) translateY(-50%);\n \n /* Safari and Chrome will emit two click events if not at top of stack */\n /* Allows up to 3 other layers (eg: ripple, outline) */\n z-index: 4;\n \n background-color: transparent;\n \n border-radius: 0;\n color: transparent;\n }\n \n #control::-moz-focus-inner {\n border: 0;\n }\n \n `;\n }\n\n /** @param {any[]} args */\n constructor(...args) {\n super(...args);\n /** @type {string} */\n this._value = this._control.value;\n // Expose this element as focusable\n if (!this.hasAttribute('tabindex')) {\n this.tabIndex = 0;\n }\n }\n\n /** @type {CustomElement['attributeChangedCallback']} */\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n if (this.static.clonedContentAttributes.includes(name)) {\n if (newValue == null) {\n this._control.removeAttribute(name);\n } else {\n this._control.setAttribute(name, newValue);\n }\n }\n\n if (this.static.valueChangingContentAttributes.includes(name)) {\n if (!this.hasAttribute('value')) {\n // Force HTMLInputElement to recalculate default\n // Unintended effect of incrementally changing attributes (eg: range)\n this._control.setAttribute('value', '');\n }\n // Changing control attribute may change the value (eg: min/max)\n this._value = this._control.value;\n }\n }\n\n /** @type {HTMLControlElement} */\n get _control() { return this.refs.control; }\n\n /**\n * @param {Partial<this>} data\n * @return {string}\n */\n computeAriaLabelledBy({ ariaLabel }) {\n if (ariaLabel) return null;\n return '#slot';\n }\n\n get stateTargetElement() { return this._control; }\n\n click() {\n /** Redirect click requests to control itself */\n this._control.click();\n }\n\n static {\n this.on({\n // Wait until controlTagName is settled before templating\n composed({ template, html }) {\n template.append(html`\n <label id=label disabled={disabledState}>\n <${this.static.controlTagName} id=control aria-labelledby={computeAriaLabelledBy} aria-label={ariaLabel}\n >${this.static.controlVoidElement ? '' : `</${this.static.controlTagName}>`}\n </label>\n `);\n },\n disabledStateChanged(oldValue, newValue) {\n this._control.setAttribute('aria-disabled', `${newValue}`);\n if (!this.focusableOnDisabled) {\n this._control.disabled = newValue;\n if (newValue) {\n this.tabIndex = 0;\n } else {\n this.removeAttribute('tabindex');\n }\n }\n },\n });\n this.childEvents({\n control: {\n input({ currentTarget }) {\n const control = /** @type {HTMLControlElement} */ (currentTarget);\n if (this.validity.valid) {\n // Track internally\n control.checkValidity();\n this._badInput = control.validity.badInput;\n } else {\n // Perform check in case user has validated\n this.checkValidity();\n }\n this._value = control.value;\n },\n change({ currentTarget }) {\n const control = /** @type {HTMLControlElement} */ (currentTarget);\n this._value = control.value;\n this.checkValidity();\n // Change event is NOT composed. Needs to escape shadow DOM\n this.dispatchEvent(new Event('change', { bubbles: true }));\n },\n },\n });\n }\n\n /** @type {HTMLElement['focus']} */\n focus(...options) {\n super.focus(...options);\n this.refs.control.focus(...options);\n }\n\n /**\n * @template {typeof Control & ReturnType<import('./RippleMixin.js').default> & ReturnType<import('./FormAssociatedMixin.js').default>} T\n * @return {T}\n */\n get static() {\n return /** @type {T} */ (/** @type {unknown} */ (super.static));\n }\n\n get form() { return this.elementInternals.form; }\n\n // get name() { return this.getAttribute('name'); }\n get value() {\n return this._value;\n }\n\n set value(v) {\n this._valueDirty = true;\n this._control.value = v;\n this._value = this._control.value;\n }\n\n get validity() { return this.elementInternals.validity; }\n\n get validationMessage() { return this.elementInternals.validationMessage; }\n\n get willValidate() { return this.elementInternals.willValidate; }\n\n checkValidity() {\n const validityState = this._control.checkValidity();\n /** @type {Partial<ValidityState>} */\n const newValidity = {};\n\n // eslint-disable-next-line guard-for-in\n for (const key in this._control.validity) {\n // @ts-ignore Skip cast\n newValidity[key] = this._control.validity[key];\n }\n this.elementInternals.setValidity(newValidity, this._control.validationMessage);\n this._invalid = !validityState;\n this._validationMessage = this._control.validationMessage;\n this._badInput = this._control.validity.badInput;\n return validityState;\n }\n\n reportValidity() {\n this.checkValidity();\n this._control.reportValidity();\n return this.elementInternals.reportValidity();\n }\n\n /**\n * @param {string} error\n * @return {void}\n */\n setCustomValidity(error) {\n this._control.setCustomValidity(error);\n this.checkValidity();\n }\n\n get labels() { return this.elementInternals.labels; }\n }\n Control.prototype.ariaLabel = Control.prop('ariaLabel');\n Control.prototype.delegatesFocus = true;\n Control.prototype.focusableOnDisabled = false;\n\n return Control;\n}\n", "import ControlMixin from './ControlMixin.js';\n\n/** @typedef {'align'|'useMap'} DeprecatedHTMLInputElementProperties */\n\n/** @typedef {import('../core/CustomElement.js').default} CustomElement */\n\nconst IMPLICIT_SUBMISSION_BLOCKING_TYPES = new Set([\n 'text',\n 'search',\n 'url',\n 'tel',\n 'email',\n 'password',\n 'date',\n 'month',\n 'week',\n 'time',\n 'datetime-local',\n 'number',\n]);\n\n/**\n * @param {ReturnType<import('./StateMixin.js').default>} Base\n */\nexport default function InputMixin(Base) {\n class Input extends Base.mixin(ControlMixin) {\n static inputTagName = 'input';\n\n static FORM_IPC_EVENT = 'mdw-input-changed';\n\n static GlobalListener = new EventTarget();\n\n static clonedContentAttributes = [\n ...super.clonedContentAttributes,\n 'aria-controls',\n 'accept', 'alt',\n // 'autocomplete',\n 'checked', 'dirname',\n // 'disabled',\n // 'form',\n 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formTarget',\n 'height',\n // 'list',\n 'max', 'maxlength', 'min', 'minlength',\n 'multiple',\n // 'name',\n 'pattern', 'placeholder',\n // 'readonly',\n // 'required',\n 'size', 'src', 'step',\n // 'type',\n 'value',\n 'width',\n // 'align', 'usemap',\n ];\n\n static valueChangingContentAttributes = [\n ...super.valueChangingContentAttributes,\n 'checked', 'max', 'maxlength', 'min', 'maxlength',\n 'multiple', 'pattern', 'step', 'type', 'value',\n ];\n\n /** @type {InstanceType<typeof CustomElement>['propChangedCallback']} */\n propChangedCallback(name, oldValue, newValue) {\n super.propChangedCallback(name, oldValue, newValue);\n switch (name) {\n case 'indeterminate':\n this.#input.indeterminate = newValue;\n break;\n case 'type':\n this.#input.type = newValue;\n break;\n case '_formAction':\n this.formAction = newValue;\n break;\n case '_height':\n this.height = newValue;\n break;\n case '_width':\n this.width = newValue;\n break;\n case 'checked':\n if (!this.type) {\n console.warn('unknown type?', this);\n }\n switch (this.type) {\n case 'checkbox':\n case 'radio':\n if (newValue) {\n this.elementInternals.setFormValue(this.value ?? 'on');\n if (this.type === 'radio') {\n this._notifyRadioChange(this.name, this.value ?? 'on');\n }\n } else {\n this.elementInternals.setFormValue(null);\n }\n break;\n default:\n }\n // Reinvoke change event for components tracking 'checked';\n // this.propChangedCallback('checked', oldValue, newValue);\n break;\n default:\n }\n }\n\n /** @type {CustomElement['attributeChangedCallback']} */\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n switch (name) {\n case 'aria-label':\n if (newValue == null) {\n this.#input.removeAttribute(name);\n if (!this.hasAttribute('aria-labelledby')) {\n this.#input.setAttribute('aria-labelledby', 'slot');\n }\n } else {\n this.#input.setAttribute(name, newValue);\n if (!this.hasAttribute('aria-labelledby')) {\n this.#input.removeAttribute('aria-labelledby');\n }\n }\n break;\n default:\n }\n }\n\n get #input() { return /** @type {HTMLInputElement} */ (this.refs.control); }\n\n static {\n this.on({\n composed() {\n const { label } = this.refs;\n // Expose [selected] to .checked\n label.setAttribute('selected', '{checked}');\n label.setAttribute('invalid', '{_invalid}');\n label.setAttribute('indeterminate', '{indeterminate}');\n },\n });\n this.childEvents({\n control: {\n keydown(event) {\n if (event.defaultPrevented) return;\n if (event.key !== 'Enter') return;\n if (/** @type {HTMLInputElement} */ (event.currentTarget).type === 'submit') return;\n this.performImplicitSubmission(event);\n },\n change(event) {\n if (this.disabledState) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n const input = /** @type {HTMLInputElement} */ (event.currentTarget);\n this.checked = input.checked;\n },\n },\n });\n }\n\n /**\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission\n * @param {Event} event\n * @return {void}\n */\n performImplicitSubmission(event) {\n const form = this.form;\n if (!form) return;\n /** @type {HTMLInputElement} */\n let defaultButton;\n const submissionBlockers = new Set();\n for (const element of /** @type {HTMLCollectionOf<HTMLInputElement>} */ (form.elements)) {\n if (element.type === 'submit' && !element.disabled && !element.matches(':disabled')) {\n defaultButton ??= element;\n break;\n }\n\n if (IMPLICIT_SUBMISSION_BLOCKING_TYPES.has(element.type)) {\n submissionBlockers.add(element);\n }\n }\n if (defaultButton) {\n defaultButton.click();\n return;\n }\n if (submissionBlockers.size > 1) return;\n this.form.submit();\n }\n\n /** @param {CustomEvent<[string, string]>} event */\n formIPCEvent(event) {\n if (event.target instanceof HTMLFormElement && event.target !== this.form) {\n console.warn('Control.formIPCEvent: Abort from wrong form');\n return;\n }\n if (this.type !== 'radio') {\n console.warn('Control.formIPCEvent: Abort from not radio');\n return;\n }\n const [name, value] = event.detail;\n if (this.name !== name) return;\n if (value === this.value) {\n // console.log('Control.formIPCEvent: Continue match', this.name, this.value);\n } else {\n this.checked = false;\n }\n }\n\n formResetCallback() {\n this.#input.value = this.defaultValue;\n this.#input.checked = this.defaultChecked;\n this._value = this.#input.value;\n this._checked = this.#input.checked;\n this._checkedDirty = false;\n\n super.formResetCallback();\n }\n\n get files() { return this.#input.files; }\n\n get select() { return this.#input.select; }\n\n get selectionDirection() { return this.#input.selectionDirection; }\n\n set selectionDirection(value) { this.#input.selectionDirection = value; }\n\n get selectionEnd() { return this.#input.selectionEnd; }\n\n set selectionEnd(value) { this.#input.selectionEnd = value; }\n\n get selectionStart() { return this.#input.selectionStart; }\n\n set selectionStart(value) { this.#input.selectionStart = value; }\n\n get setRangeText() { return this.#input.setRangeText; }\n\n get setSelectionRange() { return this.#input.setSelectionRange; }\n\n get showPicker() { return this.#input.showPicker; }\n\n get stepDown() { return this.#input.stepDown; }\n\n get stepUp() { return this.#input.stepUp; }\n\n get valueAsDate() { return this.#input.valueAsDate; }\n\n set valueAsDate(value) {\n this.#input.valueAsDate = value;\n this.value = this.#input.value;\n }\n\n get valueAsNumber() { return this.#input.valueAsNumber; }\n\n set valueAsNumber(value) {\n this.#input.valueAsNumber = value;\n this.value = this.#input.value;\n }\n\n get height() { return this.#input.height; }\n\n set height(value) {\n this.#input.height = value;\n this._height = value;\n }\n\n get formAction() { return this.#input.formAction; }\n\n set formAction(value) {\n this.#input.formAction = value;\n this._formAction = value;\n }\n\n get width() { return this.#input.width; }\n\n set width(value) {\n this.#input.width = value;\n this._width = value;\n }\n }\n\n Input.prototype.ariaControls = Input.prop('ariaControls');\n\n // https://html.spec.whatwg.org/multipage/input.html#htmlinputelement\n\n const DOMString = { nullParser: String, value: '' };\n\n Input.prototype.accept = Input.prop('accept', DOMString);\n Input.prototype.alt = Input.prop('alt', DOMString);\n Input.prototype.defaultChecked = Input.prop('defaultChecked', { attr: 'checked', type: 'boolean' });\n Input.prototype._checkedDirty = Input.prop('_checkedDirty', 'boolean');\n // attribute boolean checked;\n Input.prototype._checked = Input.prop('_checked', 'boolean');\n\n // Exposed property based other watched properties\n Input.prototype.checked = Input.prop('checked', {\n reflect: false,\n type: 'boolean',\n get({ _checkedDirty, defaultChecked, _checked }) {\n if (!_checkedDirty) return defaultChecked;\n return _checked;\n },\n set(value) {\n this._checked = value;\n this._checkedDirty = true;\n },\n changedCallback(oldValue, newValue) {\n this.shadowRoot.getElementById('control').checked = newValue;\n },\n });\n\n Input.prototype.dirName = Input.prop('dirName', { attr: 'dirname', ...DOMString });\n Input.prototype._formAction = Input.prop('_formAction', { attr: 'formaction' });\n Input.prototype.formEnctype = Input.prop('formEnctype', { attr: 'formenctype', ...DOMString });\n Input.prototype.formMethod = Input.prop('formMethod', { attr: 'formmethod', ...DOMString });\n Input.prototype.formNoValidate = Input.prop('formnovalidate', { attr: 'formNoValidate', type: 'boolean' });\n Input.prototype.formTarget = Input.prop('formTarget', { attr: 'formtarget', ...DOMString });\n Input.prototype._height = Input.prop('_height', { attr: 'height', type: 'integer' });\n Input.prototype.indeterminate = Input.prop('indeterminate', { type: 'boolean', reflect: false });\n Input.prototype.max = Input.prop('max', DOMString);\n Input.prototype.maxLength = Input.prop('maxLength', { attr: 'maxlength', type: 'integer', empty: -1 });\n Input.prototype.min = Input.prop('min', DOMString);\n Input.prototype.minLength = Input.prop('minLength', { attr: 'minlength', type: 'integer', empty: -1 });\n Input.prototype.multiple = Input.prop('multiple', 'boolean');\n Input.prototype.pattern = Input.prop('pattern', DOMString);\n Input.prototype.placeholder = Input.prop('placeholder', DOMString);\n Input.prototype.size = Input.prop('size', { type: 'integer', empty: 20 });\n Input.prototype.src = Input.prop('src', DOMString);\n Input.prototype.step = Input.prop('step', DOMString);\n Input.prototype.type = Input.prop('type', DOMString);\n Input.prototype.defaultValue = Input.prop('defaultValue', { attr: 'value', ...DOMString });\n // [CEReactions] attribute [LegacyNullToEmptyString] DOMString value;\n Input.prototype._width = Input.prop('_width', { attr: 'width', type: 'integer' });\n\n return Input.tsClassFix();\n}\n", "/** @typedef {import('./CustomElement').default} CustomElement */\n\n/** @type {WeakMap<HTMLElement, EventListener>} */\nconst eventHandlerValues = new Map();\n\n/**\n * @see https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-attributes\n * @type {import('./typings.js').ObserverOptions<'function',EventListener, unknown>}\n */\nexport const EVENT_HANDLER_TYPE = {\n type: 'function',\n reflect: 'read',\n value: null,\n values: eventHandlerValues,\n parser(v) { return v; },\n attributeChangedCallback(name, oldValue, newValue) {\n if (oldValue == null && newValue == null) return;\n // Must continue if oldValue === newValue;\n if (newValue == null) {\n this[name] = null;\n return;\n }\n // Assign to temp element, allow it to parse and then copy result.\n // Let browser parse instead of using eval()\n // CSP Violations will be thrown by browser on failure and result in `null`\n const button = document.createElement('button');\n button.setAttribute('onclick', newValue);\n const fn = button.onclick;\n button.remove();\n this[name] = fn;\n },\n propChangedCallback(name, oldValue, newValue) {\n const eventName = name.slice(2);\n if (oldValue) {\n this.removeEventListener(eventName, oldValue);\n }\n if (newValue) {\n this.addEventListener(eventName, newValue);\n }\n },\n};\n\nconst weakRefValues = new WeakMap();\n\n/**\n * @type {import('./typings.js').ObserverOptions<'object',HTMLElement>}\n */\nexport const WEAKREF_TYPE = {\n type: 'object',\n reflect: false,\n value: null,\n values: weakRefValues,\n parser(v) { return new WeakRef(v); },\n get() {\n return weakRefValues.get(this)?.deref();\n },\n};\n\n/** @type {WeakMap<any, Animation>} */\nconst elementStylerLastAnimation = new WeakMap();\n/** @type {WeakMap<CustomElement, ElementStylerOptions>} */\nconst elementStylerValues = new WeakMap();\n/** @type {WeakSet<any>} */\nconst elementStylerHasQueue = new WeakSet();\n\n/**\n * @typedef {Object} ElementStylerOptions\n * @prop {string} target Target ID\n * @prop {Keyframe} styles\n * @prop {EffectTiming} [timing]\n */\n\n/** @this {CustomElement} */\nfunction elementStylerRAFCallback() {\n let previousAnimation = elementStylerLastAnimation.get(this);\n const value = elementStylerValues.get(this);\n if (!value) {\n previousAnimation?.cancel();\n return;\n }\n /** @type {HTMLElement} */\n const el = value.target ? this.composition.getElement(this.shadowRoot, value.target) : this;\n const currentAnimation = el.animate(value.styles, {\n ...value.timing,\n fill: 'forwards',\n });\n currentAnimation.onremove = () => {\n previousAnimation?.effect.updateTiming({\n fill: 'none',\n });\n // Destroy previous manually to avoid leak\n previousAnimation?.finish();\n previousAnimation?.cancel();\n previousAnimation = null;\n };\n elementStylerLastAnimation.set(this, currentAnimation);\n elementStylerHasQueue.delete(this);\n}\n\n/** @type {import('./typings.js').ObserverOptions<'object',ElementStylerOptions, CustomElement>} */\nexport const ELEMENT_STYLER_TYPE = {\n type: 'object',\n reflect: false,\n values: elementStylerValues,\n diff: null, // Skip computing entire change\n changedCallback(oldValue, newValue) {\n const hasQueue = elementStylerHasQueue.has(this);\n if (!newValue) {\n if (!hasQueue) return;\n console.warn('debug needed of cancel needed');\n elementStylerHasQueue.delete(this);\n return;\n }\n\n if (hasQueue) {\n // Already scheduled\n return;\n }\n\n // Animation styles may trickle in steps, so queue a microtask before doing any work.\n // Using requestAnimationFrame would fire one frame too late for CSS animations already scheduled\n queueMicrotask(elementStylerRAFCallback.bind(this));\n elementStylerHasQueue.add(this);\n },\n};\n", "import CustomElement from '../core/CustomElement.js';\nimport { ELEMENT_STYLER_TYPE } from '../core/customTypes.js';\n\nexport default CustomElement\n .extend()\n .set({\n hadRippleHeld: false,\n hadRippleReleased: false,\n rippleStarted: false,\n })\n .observe({\n rippleState: 'string',\n keepAlive: 'boolean',\n _positionX: 'float',\n _positionY: 'float',\n _radius: 'float',\n holdRipple: {\n type: 'boolean',\n changedCallback(oldValue, newValue) {\n if (newValue) {\n this.hadRippleHeld = true;\n } else {\n this.hadRippleReleased = true;\n }\n },\n },\n })\n .observe({\n _positionStyle: {\n ...ELEMENT_STYLER_TYPE,\n get({ _positionX, _positionY, _radius }) {\n return {\n styles: {\n minBlockSize: `${_radius}px`,\n minInlineSize: `${_radius}px`,\n boxShadow: `0 0 calc(0.10 * ${_radius}px) calc(0.10 * ${_radius}px) currentColor`,\n left: `calc(50% + ${_positionX}px)`,\n top: `calc(50% + ${_positionY}px)`,\n },\n };\n },\n },\n })\n .methods({\n /**\n * @param {number} [x] offsetX\n * @param {number} [y] offsetY\n * @param {number} [size]\n * @return {void}\n */\n updatePosition(x, y, size) {\n // Element is already centered.\n // Use offset to calculate parent size;\n\n let hypotenuse = size;\n const { clientWidth: parentWidth, clientHeight: parentHeight } = this.offsetParent;\n\n x ??= parentWidth / 2;\n y ??= parentHeight / 2;\n if (!hypotenuse) {\n const width = (x >= parentWidth / 2) ? x : (parentWidth - x);\n const height = (y >= parentHeight / 2) ? y : (parentHeight - y);\n hypotenuse = 2 * Math.sqrt((width * width) + (height * height));\n }\n\n // const expandDuration = Math.min(\n // 500, // Never longer than long-press duration\n // (1000 * Math.sqrt(size / 2 / 1024) + 0.5), // From Android\n // );\n\n // this.style.minBlockSize = `${hypotenuse}px`;\n // this.style.minInlineSize = `${hypotenuse}px`;\n // this.style.boxShadow = `0 0 calc(0.10 * ${0}px) calc(0.10 * ${0}px) currentColor`;\n // this.style.marginLeft = `${x - (parentWidth / 2)}px`;\n // this.style.marginTop = `${y - (parentHeight / 2)}px`;\n\n this._positionX = x - (parentWidth / 2);\n this._positionY = y - (parentHeight / 2);\n this._radius = hypotenuse;\n },\n handleRippleComplete() {\n if (this.keepAlive) {\n this.setAttribute('ripple-state', 'complete');\n } else {\n this.remove();\n }\n },\n })\n .events({\n animationstart({ animationName }) {\n if (animationName !== 'ripple-fade-in') return;\n if (this.rippleStarted && !this.keepAlive) {\n // Animation restarted. Likely from visibility change\n this.remove();\n return;\n }\n this.rippleStarted = true;\n },\n animationend({ animationName }) {\n switch (animationName) {\n case 'ripple-fade-in':\n this.setAttribute('ripple-state', 'filled');\n break;\n case 'ripple-fade-out':\n this.handleRippleComplete();\n break;\n default:\n }\n },\n })\n .css`\n :host {\n --enter-delay: 80ms;\n --touch-down-acceleration: 1024;\n --touch-up-acceleration: 3400;\n --mdw-ripple-expand-duration: 300ms;\n --mdw-ripple-simple-duration: 200ms;\n --mdw-ripple-fade-out-duration: 333ms;\n --mdw-ripple-standard-easing: var(--mdw-motion-standard-easing, cubic-bezier(0.4, 0.0, 0.2, 1));\n --mdw-ripple-deceleration-easing: var(--mdw-motion-deceleration-easing, cubic-bezier(0.0, 0.0, 0.2, 1));\n \n --size: 0;\n position: absolute;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n top: 50%;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: 50%;\n \n display: block;\n \n min-block-size: 141.42%; /* √2 * 100% */\n min-inline-size: 141.42%;\n \n pointer-events: none;\n \n -webkit-tap-highlight-color: transparent;\n \n opacity: 0.12;\n transform: translateX(-50%) translateY(-50%) scale(1);\n \n background-color: currentColor;\n border-radius: 50%;\n \n /* Adds feathered appearance to ripple */\n box-shadow: 0 0 calc(0.10 * var(--size)) calc(0.10 * var(--size)) currentColor;\n \n transition-delay: 0s;\n transition-duration: var(--mdw-ripple-simple-duration);\n transition-property: background-color, color;\n transition-timing-function: var(--mdw-ripple-standard-easing);\n \n animation-name: ripple-fade-in, none;\n animation-duration: var(--mdw-ripple-expand-duration), var(--mdw-ripple-fade-out-duration);\n animation-timing-function: linear, var(--mdw-ripple-deceleration-easing);\n animation-direction: normal;\n animation-fill-mode: forwards;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n will-change: transform, opacity, top, left, box-shadow;\n \n aspect-ratio: 1/1;\n }\n \n :host([ripple-state=\"filled\"]) {\n animation-name: none, ripple-fade-out;\n }\n \n :host([ripple-state=\"filled\"][hold-ripple]) {\n animation-name: ripple-fade-in, none;\n }\n \n :host([ripple-state=\"complete\"]) {\n animation-name: none, ripple-fade-out;\n animation-duration: 0s;\n }\n \n @keyframes ripple-fade-in {\n from {\n transform: translateX(-50%) translateY(-50%) scale(0);\n }\n }\n \n @keyframes ripple-fade-out {\n \n to { opacity: 0; }\n }\n `\n .autoRegister('mdw-ripple');\n", "import Ripple from '../components/Ripple.js';\n\n/** @typedef {import('../components/Ripple.js').default} Ripple */\n\n/**\n * @param {ReturnType<import('./StateMixin.js').default>} Base\n */\nexport default function RippleMixin(Base) {\n return Base\n .extend()\n .set({\n /** @type {WeakRef<InstanceType<Ripple>>} */\n _lastRippleWeakRef: null,\n /** Flag set if ripple was added this event loop. */\n _rippleAdded: false,\n })\n .define({\n _lastRipple: {\n get() {\n const element = this._lastRippleWeakRef?.deref();\n if (element?.isConnected) return element;\n return null;\n },\n set(ripple) {\n this._lastRippleWeakRef = ripple ? new WeakRef(ripple) : null;\n },\n },\n })\n .methods({\n /**\n * @param {number} [x]\n * @param {number} [y]\n * @param {boolean} [hold]\n * @return {InstanceType<Ripple>}\n */\n addRipple(x, y, hold) {\n const { rippleContainer } = this.refs;\n if (!rippleContainer.isConnected) return null; // Detached?\n const ripple = new Ripple();\n this._rippleAdded = true;\n queueMicrotask(() => {\n // Reset before next event loop;\n this._rippleAdded = false;\n });\n rippleContainer.appendChild(ripple);\n if (hold) {\n ripple.holdRipple = true;\n }\n ripple.updatePosition(x, y);\n this._lastRipple = ripple;\n return ripple;\n },\n })\n .html/* html */`\n <div id=ripple-container _if={!disabledState} aria-hidden=true></div>\n `\n .events({\n '~pointerdown'(event) {\n if (event.button) return;\n if (this.disabledState) return;\n\n const { rippleContainer } = this.refs;\n if (!rippleContainer.isConnected) return; // Detached?\n const rect = rippleContainer.getBoundingClientRect();\n const x = event.pageX - rect.left - window.pageXOffset;\n const y = event.pageY - rect.top - window.pageYOffset;\n const lastRipple = this._lastRipple;\n if (lastRipple) {\n lastRipple.holdRipple = false;\n }\n console.debug('ripple from pointerdown');\n this.addRipple(x, y);\n },\n '~click'(e) {\n if (this._rippleAdded) {\n // Avoid double event\n return;\n }\n if (e.pointerType || e.detail) return;\n if (this.disabledState) return;\n if (this._pressed) return;\n const lastRipple = this._lastRipple;\n if (lastRipple) {\n lastRipple.holdRipple = false;\n }\n console.debug('ripple from programmatic click');\n this.addRipple();\n },\n })\n .on({\n _pressedChanged(oldValue, pressed) {\n const ripple = this._lastRipple;\n if (!pressed) {\n if (ripple) {\n ripple.holdRipple = false;\n }\n return;\n }\n if (!ripple || ripple.hadRippleReleased) {\n if (this._lastInteraction !== 'key') {\n // Sometimes pointer events may be out of order\n return;\n }\n console.debug('ripple from press state');\n this.addRipple(null, null, true);\n return;\n }\n if (ripple.hadRippleHeld) return;\n ripple.holdRipple = true;\n },\n })\n .css`\n :host {\n --mdw-state__pressed-opacity: 0;\n }\n \n #ripple-container {\n position: absolute;\n inset: 0;\n \n overflow: hidden;\n \n pointer-events: none;\n }\n `;\n}\n", "// Globals\n\nlet lastInteractionWasTouch = window?.matchMedia?.('(any-pointer: coarse)').matches;\n\n/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function StateMixin(Base) {\n return Base\n .extend()\n .observe({\n disabled: 'boolean',\n _lastInteraction: {\n /** @type {'mouse'|'touch'|'key'|'pen'|null} */\n value: null,\n },\n _hovered: 'boolean',\n _focused: 'boolean',\n _pressed: 'boolean',\n stateLayer: 'boolean',\n })\n .observe({\n disabledState({ disabled }) { return disabled; },\n hoveredState({ _hovered }) { return _hovered; },\n focusedState({ _focused }) { return _focused; },\n pressedState({ _pressed }) { return _pressed; },\n touchedState({ _lastInteraction }) {\n return _lastInteraction === 'touch';\n },\n })\n .define({\n stateTargetElement() { return this; },\n })\n .html/* html */`\n <div id=state _if={stateLayer}\n disabled={disabledState}\n focused={focusedState}\n hovered={hoveredState}\n pressed={pressedState}\n interaction={_lastInteraction}\n touched={touchedState}\n aria-hidden=true></div>\n `\n .events({\n pointerenter(event) {\n if (!event.isPrimary) return;\n this._pressed = this.stateTargetElement.matches(':active');\n if (event.pointerType === 'touch') return;\n this._hovered = true;\n // Firefox lags a frame before reporting :hover\n // requestAnimationFrame(() => {\n // this._hovered = this.stateTargetElement.matches(':hover');\n // });\n },\n '~pointerdown'(event) {\n if (!event.isPrimary) return;\n this._lastInteraction = /** @type {'touch'|'mouse'|'pen'} */ (event.pointerType);\n this._pressed = true;\n },\n '~pointerup'(event) {\n if (!event.isPrimary) return;\n this._lastInteraction = /** @type {'touch'|'mouse'|'pen'} */ (event.pointerType);\n this._pressed = false;\n },\n pointercancel(e) {\n if (!e.isPrimary) return;\n this._pressed = this.stateTargetElement.matches(':active');\n },\n pointerleave(event) {\n if (!event.isPrimary) return;\n this._pressed = false;\n this._hovered = false;\n },\n '~keydown'(e) {\n this._lastInteraction = 'key';\n if (e.repeat) return;\n // console.debug('keydown', this.stateTargetElement.matches(':active'));\n requestAnimationFrame(() => {\n this._pressed = this.stateTargetElement.matches(':active');\n // console.debug('pressed? after one keydown frame', this._pressed);\n });\n },\n '~keyup'() {\n this._lastInteraction = 'key';\n // console.debug('keyup', this.stateTargetElement.matches(':active'));\n requestAnimationFrame(() => {\n this._pressed = this.stateTargetElement.matches(':active');\n // console.debug('pressed? after one keyUP frame?', this._pressed);\n });\n },\n blur() {\n this._focused = false;\n if (!this._lastInteraction) return;\n lastInteractionWasTouch = (this._lastInteraction === 'touch');\n // this._lastInteraction = null;\n },\n focus() {\n this._focused = true;\n // Element was focused without a mouse or touch event (keyboard or programmatic)\n if (!this._lastInteraction && lastInteractionWasTouch) {\n // Replicate touch behavior\n this._lastInteraction = 'touch';\n }\n },\n })\n .on({\n disconnected() {\n this._lastInteraction = null;\n },\n })\n .css`\n /* https://m3.material.io/foundations/interaction-states */\n\n :host {\n --mdw-state__hovered-opacity: 0.08;\n --mdw-state__focused-opacity: 0.12;\n --mdw-state__pressed-opacity: 0.12;\n --mdw-state__dragged-opacity: 0.12;\n position: relative;\n\n outline: none;\n -webkit-tap-highlight-color: transparent;\n }\n\n /* Remove Firefox inner */\n :host(::-moz-focus-inner) {\n border: 0;\n }\n\n #state {\n position: absolute;\n inset: 0;\n\n pointer-events: none;\n\n opacity: calc(\n var(--mdw-state__hovered-opacity) +\n var(--mdw-state__focused-opacity) +\n var(--mdw-state__pressed-opacity) +\n var(--mdw-state__dragged-opacity)\n );\n /* opacity handled by theme engine */\n background-color: currentColor;\n border-radius: inherit;\n\n transition-delay: 0ms;\n transition-duration: 000ms;\n transition-property: opacity, color, background-color;\n will-change: opacity;\n }\n\n #state[touched] {\n --mdw-state__hovered-opacity: 0;\n --mdw-state__focused-opacity: 0;\n }\n\n /* Remove Hover State */\n #state:is(\n :not([hovered]),\n [disabled]:not([state-disabled~=\"hover\"]),\n [state-off~=\"hover\"]) {\n --mdw-state__hovered-opacity: 0;\n }\n\n /* Remove Focus State */\n #state:is(\n :not([focused]),\n [disabled]:not([state-disabled~=\"focus\"]),\n [state-off~=\"focus\"]) {\n --mdw-state__focused-opacity: 0;\n }\n\n /* Remove Pressed State */\n\n #state:is(\n :not([pressed]),\n [disabled]:not([state-disabled~=\"pressed\"]),\n [state-off~=\"pressed\"]) {\n --mdw-state__pressed-opacity: 0;\n }\n\n /* Remove Dragged State */\n :host(:not([aria-dragged=\"true\"])) #state,\n #state:is(\n [disabled]:not([state-disabled~=\"dragged\"]),\n [state-off~=\"dragged\"]) {\n --mdw-state__dragged-opacity: 0;\n }\n\n /* Disabled */\n #state[disabled]:not([state-disabled]) {\n display: none;\n }\n\n `;\n}\n", "import './Icon.js';\nimport CustomElement from '../core/CustomElement.js';\nimport DensityMixin from '../mixins/DensityMixin.js';\nimport InputMixin from '../mixins/InputMixin.js';\nimport RippleMixin from '../mixins/RippleMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport SurfaceMixin from '../mixins/SurfaceMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(DensityMixin)\n .mixin(SurfaceMixin)\n .mixin(ShapeMixin)\n .mixin(StateMixin)\n .mixin(RippleMixin)\n .mixin(InputMixin)\n .extend()\n .define({\n stateTargetElement() { return this.refs.control; },\n })\n .set({\n stateLayer: true,\n delegatesFocus: true,\n })\n .observe({\n type: { value: 'button' },\n elevated: 'boolean',\n filled: 'string',\n outlined: 'boolean',\n icon: 'string',\n iconInk: 'string',\n src: 'string',\n svg: 'string',\n svgPath: 'string',\n })\n .expressions({\n hasIcon({ icon, svg, src, svgPath }) {\n return icon ?? svg ?? src ?? svgPath;\n },\n })\n .html/* html */`\n <mdw-icon _if={hasIcon} id=icon ink={iconInk} disabled={disabledState} outlined={outlined} aria-hidden=true svg={svg} src={src} svg-path={svgPath}>{icon}</mdw-icon>\n <slot id=slot disabled={disabledState}></slot>\n `\n .on({\n composed() {\n const {\n shape, surfaceTint, state, rippleContainer,\n surface, control, label, slot,\n icon,\n } = this.refs;\n surface.append(shape);\n shape.append(state, rippleContainer, surfaceTint);\n label.append(icon, slot);\n\n shape.setAttribute('filled', '{filled}');\n control.setAttribute('role', 'button');\n control.setAttribute('type', 'button');\n },\n })\n .css`\n /* https://m3.material.io/components/buttons/specs */\n\n :host {\n --mdw-shape__size: var(--mdw-shape__full);\n --mdw-ink: var(--mdw-color__primary);\n\n --mdw-type__font: var(--mdw-typescale__label-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__label-large__letter-spacing);\n\n display: inline-flex;\n\n align-items: center;\n gap: 0;\n justify-content: center;\n vertical-align: middle;\n\n /* box-sizing: border-box; */\n min-block-size: 24px;\n min-inline-size: 24px;\n\n padding-block: calc(8px + (var(--mdw-density) * 2px));\n padding-inline: calc(12px + (var(--mdw-density) * 2px));\n\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n user-select: none;\n\n color: rgb(var(--mdw-ink));\n\n font: var(--mdw-type__font);\n letter-spacing: var(--mdw-type__letter-spacing);\n }\n\n :host(:where([elevated],[filled])) {\n will-change: filter;\n }\n\n /** Elevated Color Defaults */\n :host(:where([elevated])) {\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__primary);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__1);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__2);\n --mdw-surface__tint: var(--mdw-surface__tint__1);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__2);\n }\n /** Filled Color Defaults */\n :host(:where([filled])) {\n --mdw-bg: var(--mdw-color__primary);\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__0);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__1);\n --mdw-surface__tint: 0;\n --mdw-surface__tint__raised: var(--mdw-surface__tint__1);\n }\n /** Filled Tonal Color Defaults */\n :host(:where([filled=\"tonal\"])) {\n --mdw-bg: var(--mdw-color__secondary-container);\n --mdw-ink: var(--mdw-color__on-secondary-container);\n }\n /** Outlined Color Defaults */\n :host(:where([outlined])) {\n --mdw-ink: var(--mdw-color__primary);\n }\n\n :host(:where([icon])) {\n gap: 8px;\n\n padding-inline: calc(12px + (var(--mdw-density) * 2px)) calc(16px + (var(--mdw-density) * 2px));\n }\n\n :host(:where([outlined], [elevated], [filled])) {\n padding-inline: calc(24px + (var(--mdw-density) * 2px));\n }\n\n :host(:where([icon]):where([outlined], [elevated], [filled])) {\n gap: 8px;\n\n padding-inline: calc(16px + (var(--mdw-density) * 2px)) calc(24px + (var(--mdw-density) * 2px));\n }\n\n #shape:where([elevated],[filled],[color]) {\n background-color: rgb(var(--mdw-bg));\n }\n\n #slot {\n text-align: center;\n text-decoration: none;\n white-space: nowrap;\n }\n\n #control {\n cursor: inherit;\n }\n\n :host([disabled]) {\n /* cursor: not-allowed; */\n\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #shape[disabled]:is([elevated], [filled]) {\n background-color: rgba(var(--mdw-color__on-surface), 0.12);\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #slot[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #icon {\n font-size: calc(18/14 * 1em);\n font-variation-settings: 'FILL' 1;\n }\n\n #icon[outlined] {\n font-variation-settings: 'FILL' 0;\n }\n\n #icon[disabled] {\n opacity: 0.38;\n\n color: rgba(var(--mdw-color__on-surface));\n }\n\n #label {\n cursor: pointer;\n }\n\n #label[disabled] {\n cursor: not-allowed;\n }\n\n @media (any-pointer: coarse) {\n #touch-target {\n visibility: visible;\n }\n }\n `\n .childEvents({\n control: {\n /**\n * Duplicates button for form submission\n * @see https://github.com/WICG/webcomponents/issues/814\n * @param {{currentTarget:HTMLInputElement}} event\n * @type {any}\n */\n '~click'({ currentTarget }) {\n if (currentTarget.disabled) return;\n if (currentTarget.type !== 'submit') return;\n if (this.disabled) return;\n const { value } = currentTarget;\n const form = this.elementInternals?.form;\n if (!form) return;\n this.elementInternals.setFormValue(value);\n if ((currentTarget.type ?? 'submit') !== 'submit') return;\n const duplicatedButton = /** @type {HTMLInputElement} */ (currentTarget.cloneNode());\n duplicatedButton.hidden = true;\n form.append(duplicatedButton);\n if ('requestSubmit' in form) {\n form.requestSubmit(duplicatedButton);\n } else {\n duplicatedButton.click();\n }\n duplicatedButton.remove();\n },\n },\n })\n .autoRegister('mdw-button');\n", "import CustomElement from '../core/CustomElement.js';\nimport { EVENT_HANDLER_TYPE } from '../core/customTypes.js';\nimport AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\nimport FlexableMixin from '../mixins/FlexableMixin.js';\nimport FormAssociatedMixin from '../mixins/FormAssociatedMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport SurfaceMixin from '../mixins/SurfaceMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nconst SUPPORTS_INERT = 'inert' in HTMLElement.prototype;\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(FlexableMixin)\n .mixin(SurfaceMixin)\n .mixin(ShapeMixin)\n .mixin(FormAssociatedMixin) // Tap into FormAssociated for disabledState\n .mixin(StateMixin)\n .mixin(AriaReflectorMixin)\n .extend()\n .setStatic({\n delegatesFocus: true,\n })\n .set({\n _ariaRole: 'figure',\n })\n .observe({\n filled: 'boolean',\n actionable: 'boolean',\n actionLabel: 'string',\n onaction: EVENT_HANDLER_TYPE,\n })\n .define({\n stateTargetElement() { return this.actionable ? this.refs.action : this; },\n })\n .expressions({\n showBlocker: ({ disabledState }) => !SUPPORTS_INERT && disabledState,\n })\n .methods({\n focus() {\n if (this.disabledState) return;\n if (this.actionable) this.refs.action.focus();\n },\n })\n .html/* html */`\n <mdw-button _if={actionable} aria-label={actionLabel} id=action disabled={disabledState}></mdw-button>\n <div _if={showBlocker} id=inert-blocker></div>\n <slot id=slot disabled={disabledState}></slot>\n `\n .css`\n /* https://m3.material.io/components/cards/specs */\n\n :host {\n --mdw-shape__size: 12px;\n --mdw-surface__tint: var(--mdw-surface__tint__0);\n --mdw-surface__tint__raised: var(--mdw-surface__tint);\n\n --mdw-surface__shadow__resting: none;\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__resting);\n /* padding-inline: 12px; */\n\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__on-surface);\n position: relative;\n\n display: block;\n\n color: rgb(var(--mdw-ink));\n\n font: var(--mdw-type__font);\n letter-spacing: var(--mdw-type__letter-spacing);\n }\n\n #shape:where([elevated],[filled],[color]) {\n background-color: rgb(var(--mdw-bg));\n }\n\n :host(:where([filled])) {\n --mdw-bg: var(--mdw-color__surface-variant);\n --mdw-ink: var(--mdw-color__on-surface-variant);\n }\n\n :host(:where([elevated])) {\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__on-surface);\n }\n\n :host([filled]) {\n --mdw-surface__tint: var(--mdw-surface__tint__0);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__0);\n }\n\n :host([filled][actionable]) {\n --mdw-surface__tint__raised: var(--mdw-surface__tint__1);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__1);\n }\n\n :host([elevated]) {\n --mdw-surface__tint: var(--mdw-surface__tint__1);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__1);\n }\n\n :host([elevated][actionable]) {\n --mdw-surface__tint__raised: var(--mdw-surface__tint__2);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__2);\n }\n\n #shape[disabled] {\n\n /* Works on images */\n filter: grayscale();\n\n color: rgb(var(--mdw-color__on-surface));\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n\n filter: grayscale();\n opacity: 0.38;\n }\n\n #slot[disabled] {\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #outline[disabled] {\n color: rgba(var(--mdw-color__on-surface), calc(0.12/0.38));\n }\n\n /** Firefox and Safari do not support [inert] */\n\n #inert-blocker {\n position: absolute;\n inset: 0;\n\n cursor: not-allowed;\n pointer-events: auto;\n\n z-index: 99;\n }\n\n #shape[disabled][elevated] {\n background-color: rgba(var(--mdw-color__surface-variant));\n }\n\n #action {\n --mdw-ink: inherit;\n --mdw-shape__size: inherit;\n\n position: absolute;\n inset: 0;\n\n padding: 0;\n\n z-index: 0;\n\n color: inherit\n }\n `\n .on({\n composed() {\n const { slot, surface, surfaceTint, shape, outline } = this.refs;\n shape.append(surfaceTint);\n surface.append(shape);\n outline.removeAttribute('pressed');\n outline.removeAttribute('focused');\n\n shape.setAttribute('filled', '{filled}');\n slot.setAttribute('inert', '{disabledState}');\n slot.setAttribute('disabled', '{disabledState}');\n // shape.setAttribute('disabled', '{disabledState}');\n // shape.setAttribute('filled', '{filled}');\n },\n })\n .childEvents({\n action: {\n click() {\n if (this.disabledState) return;\n this.dispatchEvent(new Event('action'));\n },\n },\n slot: SUPPORTS_INERT ? {} : {\n focusin() {\n if (this.disabledState) {\n console.warn('Inert not supported. Element should be able to receive focus');\n }\n },\n },\n })\n .autoRegister('mdw-card');\n", "import './Icon.js';\nimport CustomElement from '../core/CustomElement.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(ShapeMixin)\n .observe({\n selected: 'boolean',\n icon: 'string',\n errored: 'boolean',\n disabled: 'boolean',\n })\n .define({\n /** Alias for Selected (QoL) */\n checked: {\n get() { return this.selected; },\n set(value) { this.selected = value; },\n },\n })\n .css`\n /* https://m3.material.io/components/checkbox/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-bg: var(--mdw-color__primary);\n --mdw-shape__size: 2px;\n --disabled-opacity: 0.38;\n position: relative;\n\n display: inline-block;\n align-items: center;\n justify-content: center;\n\n box-sizing: border-box;\n block-size: 18px;\n inline-size: 18px;\n\n font-size: 18px;\n line-height: 18px;\n }\n\n #shape {\n --mdw-shape__size: inherit;\n position: absolute;\n inset: 0;\n\n z-index: auto;\n\n background-color: transparent;\n }\n\n #icon {\n position: absolute;\n inset: 0;\n\n opacity: 0;\n\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-ink));\n\n transition-duration: 200ms;\n transition-property: opacity, background-color, color;\n will-change: opacity;\n }\n\n #outline {\n filter:\n drop-shadow(1px 0px 0px currentColor)\n drop-shadow(0px 1px 0px currentColor)\n drop-shadow(-1px 0px 0px currentColor)\n drop-shadow(0px -1px 0px currentColor);\n\n color: rgb(var(--mdw-color__on-surface));\n\n transition-duration: 200ms;\n transition-property: opacity, background-color, color;\n will-change: opacity;\n }\n\n /* Selected */\n\n #icon[selected] {\n opacity: 1;\n }\n\n #outline[selected] {\n opacity: 0;\n }\n\n /* Errored */\n\n #icon[errored] {\n background-color: rgb(var(--mdw-color__error));\n color: rgb(var(--mdw-color__on-error));\n }\n\n #outline[errored] {\n color: rgb(var(--mdw-color__error));\n }\n\n /* Disabled */\n\n #icon[disabled] {\n background-color: rgba(var(--mdw-color__on-surface), var(--disabled-opacity));\n color: rgb(var(--mdw-color__surface), var(--disabled-opacity));\n }\n\n #outline[disabled] {\n color: rgb(var(--mdw-color__on-surface), var(--disabled-opacity));\n }\n `\n .on({\n composed({ html }) {\n const { outline, shape } = this.refs;\n outline.removeAttribute('_if');\n outline.setAttribute('selected', '{selected}');\n outline.setAttribute('errored', '{errored}');\n outline.setAttribute('disabled', '{disabled}');\n // outlineLeft.remove();\n // outlineRight.remove();\n shape.append(html`\n <mdw-icon id=icon selected={selected} errored={errored} disabled={disabled}>{icon}</mdw-icon>\n `);\n },\n })\n .extend()\n .autoRegister('mdw-checkbox-icon');\n", "/** @param {typeof import('../core/CustomElement.js').default} Base */\nexport default function TouchTargetMixin(Base) {\n return Base\n .extend()\n .html/* html */`<div id=touch-target class=touch-target></div>`\n .css`\n .touch-target {\n position: absolute;\n inset: 50%;\n /* --mdw-device-pixel-ratio: 1; */\n \n block-size: 100%;\n min-block-size: 48px;\n /* min-block-size: 10mm; */\n /* min-block-size: calc(0.393701in / var(--mdw-device-pixel-ratio, 1)); */\n inline-size:100%;\n min-inline-size: 48px;\n /* min-inline-size: 10mm; */\n /* min-inline-size: calc(0.393701in / var(--mdw-device-pixel-ratio, 1)); */\n \n cursor: inherit;\n \n /* box-sizing: border-box; */\n /* border: solid 1px magenta; */\n pointer-events: auto;\n \n transform: translateX(-50%) translateY(-50%);\n visibility: visible;\n z-index: 1;\n \n border-radius: inherit;\n }\n `;\n}\n", "import './CheckboxIcon.js';\n\nimport CustomElement from '../core/CustomElement.js';\nimport InputMixin from '../mixins/InputMixin.js';\nimport RippleMixin from '../mixins/RippleMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\nimport TouchTargetMixin from '../mixins/TouchTargetMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(RippleMixin)\n .mixin(InputMixin)\n .mixin(TouchTargetMixin)\n .extend()\n .set({\n stateLayer: true,\n type: 'checkbox',\n })\n .observe({\n icon: { value: 'check' },\n indeterminateIcon: { value: 'check_indeterminate_small' },\n /** Reflected property */\n indeterminate: 'boolean',\n })\n .observe({\n _ariaChecked({ indeterminate, checked }) {\n return (indeterminate ? 'mixed' : `${!!checked}`);\n },\n _determinateIcon({ indeterminate, indeterminateIcon, icon }) {\n return (indeterminate ? indeterminateIcon : icon);\n },\n })\n .css`\n /* https://m3.material.io/components/checkbox/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-bg: var(--mdw-color__primary);\n\n display: inline-grid;\n align-items: baseline;\n gap: 12px;\n grid-auto-flow: column;\n justify-content: flex-start;\n\n cursor: pointer;\n\n transition: none 100ms cubic-bezier(0.4, 0.0, 1, 1);\n }\n\n :host([disabled]) {\n opacity: 0.38;\n }\n\n :host(:empty) {\n vertical-align: -11.5%;\n\n line-height: 18px;\n }\n\n :host(:empty) #checkbox {\n transform: none;\n }\n\n #control {\n grid-column: 1/1;\n\n cursor: inherit;\n }\n\n #label {\n cursor: inherit;\n }\n\n #label[disabled] {\n cursor: not-allowed;\n }\n\n #state,\n #ripple-container {\n inset-block-start: 50%;\n inset-inline-start: 50%;\n\n block-size: 40px;\n inline-size: 40px;\n\n transform: translateX(-50%) translateY(-50%);\n\n border-radius: 50%;\n }\n\n #checkbox {\n position: relative;\n\n display: inline-flex;\n\n grid-column: 1 / 1;\n\n pointer-events: none;\n\n transform: translateY(11.5%);\n\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #checkbox[selected] {\n color: rgb(var(--mdw-bg));\n }\n\n #checkbox[disabled] {\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #checkbox[errored] {\n color: rgb(var(--mdw-color__error));\n }\n\n #icon {\n --mdw-ink: inherit;\n --mdw-bg: inherit;\n --disabled-opacity: 1;\n }\n `\n .on({\n composed({ html }) {\n const { label, control, state, rippleContainer, touchTarget } = this.refs;\n label.append(html`\n ${touchTarget}\n ${control}\n <div id=checkbox errored={erroredState} selected={checked}>\n <mdw-checkbox-icon id=icon errored={erroredState} disabled={disabledState}\n icon={_determinateIcon} selected={checked}>\n </mdw-checkbox-icon>\n ${state}\n ${rippleContainer}\n </div>\n <slot id=slot></slot>\n `);\n\n control.setAttribute('type', 'checkbox');\n // Indeterminate must be manually expressed for ARIA\n control.setAttribute('aria-checked', '{_ariaChecked}');\n },\n })\n .autoRegister('mdw-checkbox');\n", "import Button from './Button.js';\n\nexport default Button\n .extend()\n .observe({\n suggestion: 'boolean',\n })\n .css`\n /* https://m3.material.io/components/chips/specs */\n\n :host {\n --mdw-shape__size: 8px;\n --mdw-ink: var(--mdw-color__on-surface);\n padding-block: calc(4px + (var(--mdw-density) * 2px));\n padding-inline: calc(16px + (var(--mdw-density) * 2px));\n\n color: rgb(var(--mdw-ink));\n }\n\n :host(:where([suggestion])) {\n --mdw-ink: var(--mdw-color__on-surface-variant);\n }\n\n :host(:where([icon])) {\n gap: 8px;\n\n padding-inline: calc(8px + (var(--mdw-density) * 2px)) calc(16px + (var(--mdw-density) * 2px));\n\n }\n\n #outline {\n --mdw-ink: rgb(var(--mdw-color__on-surface-variant));\n }\n\n #outline:is([ink],[color]) {\n /* stylelint-disable-next-line rule-selector-property-disallowed-list */\n --mdw-ink: inherit;\n }\n\n #slot[disabled],\n #icon[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n `\n .on({\n composed({ inline }) {\n const { slot, outline, icon } = this.refs;\n slot.setAttribute('disabled', '{disabledState}');\n slot.removeAttribute('ink');\n slot.removeAttribute('color');\n outline.setAttribute('_if', '{!elevated}');\n outline.setAttribute('ink', '{ink}');\n outline.setAttribute('color', '{color}');\n icon.setAttribute('ink', inline(({ ink, iconInk }) => iconInk ?? ink ?? 'primary'));\n },\n })\n .autoRegister('mdw-chip');\n", "import CustomElement from '../core/CustomElement.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .extend()\n .observe({\n vertical: 'boolean',\n })\n .css`\n /* https://m3.material.io/components/dividers/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__outline-variant);\n position: relative;\n\n display: block;\n overflow: visible;\n\n box-sizing: border-box;\n block-size: 0;\n inline-size: 100%;\n\n color: rgb(var(--mdw-ink));\n }\n\n :host::before {\n content: '';\n\n display: block;\n\n box-sizing: border-box;\n block-size: 1px;\n inline-size: auto;\n\n background-color: currentcolor;\n }\n\n :host([vertical]) {\n display: inline-flex;\n vertical-align: top;\n\n block-size: auto;\n min-block-size: 100%;\n inline-size: 0;\n }\n\n :host([vertical])::before {\n block-size: auto;\n min-inline-size: 1px;\n }\n\n `\n .autoRegister('mdw-divider');\n", "import CustomElement from '../core/CustomElement.js';\n\nexport default CustomElement\n .extend()\n .css`\n :host {\n align-self: flex-end;\n\n margin-block: 24px;\n padding-inline: 24px;\n }\n `\n .html/* html */`<slot id=slot></slot>`\n .register('mdw-dialog-actions');\n", "/**\n * @param {KeyboardEvent} event\n * @this {HTMLElement}\n * @return {void}\n */\nexport function handleTabKeyPress(event) {\n const focusableElements = this.querySelectorAll([\n 'button:not(:disabled):not([tabindex=\"-1\"])',\n '[href]:not(:disabled):not([tabindex=\"-1\"])',\n 'input:not(:disabled):not([tabindex=\"-1\"]):not([hidden])',\n 'select:not(:disabled):not([tabindex=\"-1\"])',\n 'textarea:not(:disabled):not([tabindex=\"-1\"])',\n '[tabindex]:not([tabindex=\"-1\"])',\n ].join(', '));\n let foundTarget = false;\n let candidate = null;\n for (const el of focusableElements) {\n if (el === event.target) {\n foundTarget = true;\n if (event.shiftKey) {\n break;\n }\n } else if (event.shiftKey) {\n candidate = el;\n } else if (foundTarget) {\n candidate = el;\n break;\n }\n }\n if (!candidate) {\n candidate = event.shiftKey ? focusableElements[focusableElements.length - 1] : focusableElements[0];\n }\n event.stopPropagation();\n event.preventDefault();\n if (candidate && candidate instanceof HTMLElement) {\n try {\n candidate.focus();\n } catch {\n // Failed to focus\n }\n }\n}\n", "import './Button.js';\nimport './Surface.js';\nimport './Divider.js';\nimport './Icon.js';\nimport './DialogActions.js';\n\nimport { handleTabKeyPress } from '../aria/modal.js';\nimport CustomElement from '../core/CustomElement.js';\n\n/** @typedef {Object<string,any>} DialogStackState */\n\n/** @typedef {InstanceType<import('./Dialog.js').default>} Dialog */\n\n/**\n * @typedef {Object} DialogStack\n * @prop {Dialog} element\n * @prop {Element} [previousFocus]\n * @prop {DialogStackState} [state]\n * @prop {DialogStackState} [previousState]\n */\n\n/** @type {DialogStack[]} */\nconst OPEN_DIALOGS = [];\n\nconst supportsHTMLDialogElement = typeof HTMLDialogElement !== 'undefined';\n\nexport default CustomElement\n .extend()\n .define({\n _dialog() {\n return /** @type {HTMLDialogElement} */ (this.refs.dialog);\n },\n returnValue() {\n return /** @type {HTMLDialogElement} */ (this.refs.dialog).returnValue;\n },\n })\n .observe({\n open: 'boolean',\n dividers: {\n /** @type {'full'|''|'inset'} */\n value: null,\n },\n headline: 'string',\n icon: 'string',\n default: { value: 'confirm' },\n cancel: { value: 'Cancel' },\n confirm: { value: 'Confirm' },\n _isNativeModal: 'boolean',\n color: { empty: 'surface' },\n ink: 'string',\n outlined: 'boolean',\n elevation: { empty: 3 },\n })\n .methods({\n /**\n * @param {TransitionEvent} event\n * @return {void}\n */\n onTransitionEnd(event) {\n if (event.propertyName !== 'opacity') return;\n if (this.getAttribute('aria-hidden') !== 'true') return;\n this.setAttribute('mdw-ready', '');\n },\n\n /**\n * @param {Event & {currentTarget: HTMLSlotElement}} event\n * @return {void}\n */\n onSlotChange({ currentTarget }) {\n const nodes = currentTarget.assignedNodes();\n const hasContent = nodes.some((node) => (node.nodeType === node.ELEMENT_NODE)\n || (node.nodeType === node.TEXT_NODE && node.nodeValue.trim().length));\n currentTarget.toggleAttribute('slotted', hasContent);\n },\n\n /**\n * @param {SubmitEvent & {currentTarget: HTMLFormElement}} event\n * @return {void}\n */\n onFormSubmit(event) {\n if (event.currentTarget.assignedSlot) {\n // Custom form.\n // @ts-ignore Skip cast\n const returnValue = event.submitter?.value;\n this.close(returnValue);\n event.preventDefault();\n }\n },\n\n /**\n * @param {Event & {currentTarget: HTMLFormElement}} event\n * @return {void}\n */\n onFormSlotChange({ currentTarget }) {\n /** @type {HTMLFormElement} */\n const [form] = currentTarget.assignedNodes();\n form?.addEventListener('submit', (e) => this.onFormSubmit(e));\n },\n\n /**\n * @param {PopStateEvent} event\n * @return {void}\n */\n onPopState(event) {\n if (!event.state) return;\n\n const lastOpenDialog = OPEN_DIALOGS.at(-1);\n if (!lastOpenDialog || !lastOpenDialog.previousState) {\n return;\n }\n if ((lastOpenDialog.previousState === event.state) || Object.entries(event.state)\n .every(([key, value]) => value === lastOpenDialog.previousState[key])) {\n const cancelEvent = new Event('cancel', { cancelable: true });\n if (lastOpenDialog.element.dispatchEvent(cancelEvent)) {\n lastOpenDialog.element.close();\n } else {\n // Revert pop state by pushing state again\n window.history.pushState(lastOpenDialog.state, lastOpenDialog.state.title);\n }\n }\n },\n\n /**\n * @param {any} returnValue\n * @return {boolean} handled\n */\n close(returnValue) {\n if (!this.open) return false;\n if (this._isNativeModal) {\n this._isNativeModal = false;\n } else {\n const main = document.querySelector('main');\n if (main) {\n main.removeAttribute('aria-hidden');\n }\n }\n // if (this.dialogElement.getAttribute('aria-hidden') === 'true') return false;\n if (supportsHTMLDialogElement && this._dialog.open) {\n // Force close native dialog\n this._dialog.close(returnValue);\n } else {\n this._dialog.returnValue = returnValue;\n }\n\n // Will invoke observed attribute change: ('aria-hidden', 'true');\n this.open = false;\n this.dispatchEvent(new Event('close'));\n // .mdw-dialog__popup hidden by transitionEnd event\n let stackIndex = -1;\n OPEN_DIALOGS.some((stack, index) => {\n // @ts-ignore Skip unknown\n if (stack.element === this) {\n stackIndex = index;\n return true;\n }\n return false;\n });\n if (stackIndex !== -1) {\n const stack = OPEN_DIALOGS[stackIndex];\n if (stack.previousFocus\n && stack.previousFocus instanceof HTMLElement\n && document.activeElement?.closest(this.constructor.elementName) === this) {\n // Only pop focus back when hiding a dialog with focus within itself.\n try {\n stack.previousFocus.focus();\n } catch {\n // Failed to focus\n }\n }\n OPEN_DIALOGS.splice(stackIndex, 1);\n if (stack.state && window.history && window.history.state // IE11 returns a cloned state object, not the original\n && stack.state.hash === window.history.state.hash) {\n window.history.back();\n }\n }\n if (!OPEN_DIALOGS.length) {\n window.removeEventListener('popstate', this.onPopState);\n }\n return true;\n },\n\n /**\n * @param {Event} [event]\n * @return {boolean} handled\n */\n showModal(event) {\n if (this.open) return false;\n if (supportsHTMLDialogElement) {\n this._dialog.showModal();\n this._isNativeModal = true;\n }\n return this.show(event);\n },\n\n /**\n * @param {MouseEvent|PointerEvent|HTMLElement|Event} [source]\n * @return {boolean} handled\n */\n show(source) {\n if (this.open) return false;\n this.open = true;\n\n if (supportsHTMLDialogElement) {\n this._dialog.show();\n const main = document.querySelector('main');\n if (main) {\n main.setAttribute('aria-hidden', 'true');\n }\n }\n\n const previousFocus = document.activeElement;\n const title = this.headline || this.textContent;\n const newState = { time: Date.now(), random: Math.random(), title };\n let previousState = null;\n\n if (!window.history.state) {\n window.history.replaceState({\n hash: Math.random().toString(36).slice(2, 18),\n }, document.title);\n }\n previousState = window.history.state;\n window.history.pushState(newState, title);\n window.addEventListener('popstate', this.onPopState);\n\n /** @type {DialogStack} */\n const dialogStack = {\n // @ts-ignore Recursive cast\n element: this,\n previousFocus,\n state: newState,\n previousState,\n };\n OPEN_DIALOGS.push(dialogStack);\n const focusElement = this.querySelector('[autofocus]')\n ?? this.shadowRoot.querySelector('[autofocus]');\n try {\n if (focusElement && focusElement instanceof HTMLElement) {\n if (focusElement.scrollIntoView) {\n focusElement.scrollIntoView();\n }\n focusElement.focus();\n } else {\n this.refs.surface.focus();\n }\n } catch {\n // Failed to focus\n }\n return true;\n },\n })\n .expressions({\n cancelAutoFocus({ default: d }) { return d === 'cancel'; },\n confirmAutoFocus({ default: d }) { return d === 'confirm'; },\n _ariaHidden({ open }) { return (open ? 'false' : 'true'); },\n })\n .html/* html */`\n <dialog id=dialog aria-modal=true role=dialog\n aria-hidden={_ariaHidden}\n aria-labelledby=headline aria-describedby=slot>\n <div _if={open} id=scrim aria-hidden=true></div>\n <mdw-surface id=surface open={open} icon={icon} elevation={elevation} color={color} ink={ink} outlined={outlined}>\n <mdw-icon _if={icon} id=icon class=content ink=secondary aria-hidden=true>{icon}</mdw-icon>\n <slot id=headline name=headline on-slotchange={onSlotChange} role=header>{headline}</slot>\n <slot id=fixed name=fixed class=content on-slotchange={onSlotChange}></slot>\n <mdw-divider id=divider-top size={dividers}></mdw-divider>\n <slot id=slot class=content on-slotchange={onSlotChange}></slot>\n <mdw-divider id=divider-bottom size={dividers}></mdw-divider>\n <slot name=form id=form-slot on-slotchange={onFormSlotChange}>\n <form id=form method=dialog role=none on-submit={onFormSubmit}>\n <mdw-dialog-actions>\n <mdw-button id=cancel type=submit value=cancel\n autofocus={cancelAutoFocus}>{cancel}</mdw-button>\n <mdw-button id=confirm type=submit value=confirm\n autofocus={confirmAutoFocus}>{confirm}</mdw-button>\n </mdw-dialog-actions>\n </form>\n </slot>\n </mdw-surface>\n </dialog>\n `\n .css`\n /* https://m3.material.io/components/dialogs/specs */\n\n :host {\n --mdw-dialog__expand-duration: var(--mdw-motion-expand-duration, 250ms);\n --mdw-dialog__simple-duration: var(--mdw-motion-simple-duration, 100ms);\n --mdw-dialog__standard-easing: var(--mdw-motion-standard-easing, cubic-bezier(0.4, 0.0, 0.2, 1));\n --mdw-dialog__deceleration-easing: var(--mdw-motion-deceleration-easing, cubic-bezier(0.0, 0.0, 0.2, 1));\n --mdw-dialog__fade-in-duration: var(--mdw-motion-fade-in-duration, 150ms);\n\n position: fixed;\n inset: 0;\n\n pointer-events: none;\n\n z-index: 24;\n }\n\n #dialog {\n position: fixed;\n inset-block-start: 0;\n inset-inline-start: 0;\n\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: center;\n\n box-sizing: border-box;\n block-size:100%;\n max-block-size: none;\n inline-size:100%;\n max-inline-size: none;\n margin:0;\n border: none;\n padding: 48px;\n\n opacity: 0;\n /* visiblity:hidden still registers events, hide from pointer with scale(0) */\n transform: scale(0);\n visibility: hidden;\n z-index: 24;\n\n background-color: transparent;\n\n transition-delay: 0s, 200ms, 200ms;\n transition-duration: 200ms, 0s, 0s;\n transition-property: opacity, transform, visibility;\n transition-timing-function: ease-out;\n will-change: opacity;\n }\n\n @media (min-width: 1440px) {\n #dialog {\n padding: 56px;\n }\n }\n\n #dialog::backdrop {\n /** Use scrim instead */\n display: none;\n }\n\n #dialog[aria-hidden=\"false\"],\n #dialog:modal {\n pointer-events: auto;\n\n opacity: 1;\n\n transform: none;\n visibility: visible;\n\n transition-delay: 0s;\n transition-duration: 0s;\n transition-timing-function: ease-in;\n }\n\n #scrim {\n position: fixed;\n inset: 0;\n\n overflow-y: scroll;\n overscroll-behavior: none;\n overscroll-behavior: contain;\n scrollbar-width: none;\n\n block-size: 100%;\n inline-size: 100%;\n\n cursor: default;\n pointer-events: inherit;\n -webkit-tap-highlight-color: transparent;\n\n opacity: 0.38;\n z-index: 0;\n\n background-color: rgb(var(--mdw-color__scrim));\n }\n\n #scrim::-webkit-scrollbar {\n display: none;\n }\n\n #scrim::after {\n content: '';\n\n display: block;\n\n block-size: 200%;\n inline-size: 200%;\n }\n @keyframes scaleUpAnimation {\n from {\n transform: scaleY(0);\n }\n\n to {\n transform: scaleY(1);\n }\n }\n\n #surface {\n --mdw-shape__size: 28px;\n\n position: relative;\n\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior: none;\n overscroll-behavior: contain;\n\n box-sizing: border-box;\n max-block-size: 100%;\n min-inline-size: 280px;\n max-inline-size: 560px;\n flex-shrink: 1;\n\n padding-block-start: 8px;\n\n transform: scale(1);\n transform-origin: top center;\n z-index: 24;\n\n will-change: display, transform;\n }\n\n #surface[icon] {\n align-items: center;\n }\n\n #surface[open] {\n animation-name: scaleUpAnimation;\n animation-duration: 200ms;\n animation-direction: forwards;\n }\n\n #icon {\n padding-block-start: 16px;\n\n font-size: 24px;\n }\n\n #headline {\n display: block;\n\n padding-block-start: 16px;\n padding-inline: 24px;\n\n font: var(--mdw-typescale__headline-small__font);\n letter-spacing: var(--mdw-typescale__headline-small__letter-spacing);\n }\n\n #headline:not([slotted]):empty {\n display: none;\n }\n\n #body {\n padding-block: 16px;\n }\n\n .content {\n padding-inline: 24px;\n }\n\n #divider-top {\n padding-block-start: 16px;\n }\n\n mdw-divider:not([size]) {\n color: transparent;\n }\n\n mdw-divider[size=\"inset\"] {\n padding-inline: 24px;\n }\n\n #fixed {\n display:block;\n\n padding-block-start: 16px;\n\n color: rgb(var(--mdw-color__on-surface-variant));\n\n font: var(--mdw-typescale__body-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n\n #fixed:not([slotted]) {\n display: none;\n }\n\n #slot {\n display:block;\n\n overflow-y: auto;\n\n color: rgb(var(--mdw-color__on-surface-variant));\n\n font: var(--mdw-typescale__body-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n\n #scroller {\n display: block;\n overflow-y: auto;\n }\n\n #form {\n display: contents;\n }\n\n #form-slot::slotted(form) {\n display: contents;\n }\n `\n .childEvents({\n dialog: {\n cancel(event) {\n event.stopPropagation();\n const cancelEvent = new Event('cancel', { cancelable: true });\n if (!this.dispatchEvent(cancelEvent)) {\n event.preventDefault();\n }\n },\n close(event) {\n event.stopPropagation();\n this.close(this.returnValue);\n },\n },\n scrim: {\n '~click'() {\n const cancelEvent = new Event('cancel', { cancelable: true });\n if (!this.dispatchEvent(cancelEvent)) return;\n this.close();\n },\n },\n surface: {\n keydown(event) {\n if (event.key === 'Tab') {\n const surface = /** @type {HTMLElement} */ (event.currentTarget);\n if (!this._isNativeModal) {\n // Move via Light or Shadow DOM, depending on target\n const context = surface.contains(event.target) ? surface : this;\n handleTabKeyPress.call(context, event);\n }\n return;\n }\n if (event.key === 'Escape' || event.key === 'Esc') {\n event.preventDefault();\n event.stopPropagation();\n const cancelEvent = new Event('cancel', { cancelable: true });\n if (this.dispatchEvent(cancelEvent)) {\n this.close();\n }\n }\n },\n },\n })\n .autoRegister('mdw-dialog');\n", "import Button from './Button.js';\n\nexport default Button\n .extend()\n .css`\n /* https://m3.material.io/components/extended-fab/specs */\n\n :host {\n --mdw-bg: var(--mdw-color__primary-container);\n --mdw-ink: var(--mdw-color__on-primary-container);\n --mdw-shape__size: 16px;\n --mdw-surface__tint: var(--mdw-surface__tint__3);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__4);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__3);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__4);\n min-inline-size: 48px;\n padding: calc(16px + (var(--mdw-density) * 2px));\n }\n\n #icon {\n font-size: 24px;\n }\n\n :host([lowered]) {\n --mdw-surface__tint: var(--mdw-surface__tint__1);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__2);\n --mdw-surface__shadow__resting: var(--mdw-surface__shadow__1);\n --mdw-surface__shadow__raised: var(--mdw-surface__shadow__2);\n }\n\n `\n .observe({\n filled: { empty: 'tonal' },\n elevated: { type: 'boolean', empty: true },\n })\n .autoRegister('mdw-extended-fab');\n", "import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\n\nimport Surface from './Surface.js';\n\nexport default Surface\n .mixin(AriaReflectorMixin)\n .extend()\n .set({\n _ariaRole: 'tooltip',\n })\n .observe({\n open: {\n type: 'boolean',\n changedCallback(oldValue, newValue) {\n this.updateAriaProperty('ariaHidden', newValue ? 'true' : 'false');\n },\n },\n touch: 'boolean',\n })\n .css`\n /* https://m2.material.io/components/tooltips */\n\n :host {\n --mdw-shape__size: var(--mdw-shape__extra-small);\n --mdw-ink: var(--mdw-color__on-surface-variant);\n --mdw-shape__bg: rgb(var(--mdw-color__surface-variant));\n display: block;\n vertical-align: middle;\n\n box-sizing: border-box;\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin-inline: auto;\n padding-block: 4px;\n padding-inline: 8px;\n\n pointer-events: none;\n\n opacity: 0;\n transform: scale(0);\n z-index: 24;\n\n font: var(--mdw-typescale__label-medium__font);\n letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);\n\n transition: transform 200ms, opacity 200ms;\n\n }\n\n :host([touch]) {\n padding-block: 6px;\n padding-inline: 16px;\n\n font: var(--mdw-typescale__label-large__font);\n letter-spacing: var(--mdw-typescale__label-large__letter-spacing);\n }\n\n :host([open]) {\n opacity: 1;\n transform: scale(1);\n }\n `\n .autoRegister('mdw-tooltip');\n", "/**\n * @typedef {Object} CanAnchorPopUpOptions\n * @prop {Element|DOMRect} [anchor]\n * @prop {number|'left'|'center'|'right'} [clientX]\n * @prop {number|'top'|'center'|'bottom'} [clientY]\n * @prop {number} [pageX]\n * @prop {number} [pageY]\n * @prop {Element|DOMRect} [popup]\n * @prop {number} [width]\n * @prop {number} [height]\n * @prop {number} [offsetX] Offset from anchor\n * @prop {number} [offsetY] Offset from anchor\n * @prop {number} [margin] Margin from page\n * @prop {'left'|'center'|'right'} [directionX='right']\n * @prop {'up'|'center'|'down'} [directionY='down']\n * @prop {boolean} [force=false]\n */\n\n/** @param {CanAnchorPopUpOptions} options */\nexport function canAnchorPopup(options) {\n let { pageX, pageY, directionX, directionY } = options;\n if (pageX == null || pageY == null) {\n const { clientX, clientY, anchor } = options;\n const rect = anchor instanceof Element ? anchor.getBoundingClientRect() : anchor;\n if (pageX == null) {\n switch (clientX) {\n case 'left':\n case null:\n case undefined:\n pageX = rect.left;\n directionX ??= 'right';\n break;\n case 'center':\n pageX = rect.left + rect.width / 2;\n directionX ??= 'center';\n break;\n case 'right':\n pageX = rect.right;\n directionX ??= 'left';\n break;\n default:\n pageX = rect.left + clientX;\n }\n }\n if (pageY == null) {\n switch (clientY) {\n case 'top':\n pageY = rect.top;\n directionY ??= 'up';\n break;\n case 'center':\n pageY = rect.top + rect.height / 2;\n directionY ??= 'center';\n break;\n case 'bottom':\n case null:\n case undefined:\n pageY = rect.bottom;\n directionY ??= 'down';\n break;\n default:\n pageY = rect.top + clientY;\n }\n }\n }\n let { width, height } = options;\n if (width == null || height == null) {\n const { popup } = options;\n if (popup instanceof Element) {\n width = popup.clientWidth;\n height = popup.clientHeight;\n } else {\n width = popup.width;\n height = popup.width;\n }\n }\n\n // eslint-disable-next-line default-case\n switch (directionX) {\n case 'left':\n pageX -= width;\n break;\n case 'center':\n pageX -= width / 2;\n }\n\n // eslint-disable-next-line default-case\n switch (directionY) {\n case 'up':\n pageY -= height;\n break;\n case 'center':\n pageY -= height / 2;\n }\n\n const offsetX = options.offsetX ?? 0;\n const offsetY = options.offsetY ?? 0;\n pageX += offsetX;\n pageY += offsetY;\n const margin = options.margin ?? 0;\n if (!options.force) {\n if (pageX - margin < 0) return null;\n if (pageY - margin < 0) return null;\n if (pageX + width > (document.documentElement.clientWidth - margin)) return null;\n if (pageY + height > (document.documentElement.clientHeight - margin)) return null;\n }\n\n return {\n ...options,\n offsetX,\n offsetY,\n pageX,\n pageY,\n transformOriginX: directionX === 'center' ? 'center' : (directionX === 'left' ? 'right' : 'left'),\n transformOriginY: directionY === 'center' ? 'center' : (directionY === 'up' ? 'bottom' : 'top'),\n };\n}\n", "import '../components/Tooltip.js';\nimport { canAnchorPopup } from '../utils/popup.js';\n\n/**\n * @param {ReturnType<import('./StateMixin.js').default>} Base\n */\nexport default function TooltipTriggerMixin(Base) {\n class TooltipTrigger extends Base {\n static {\n this.on({\n composed({ template, html }) {\n template.append(html`\n <mdw-tooltip role=tooltip id=tooltip>\n <slot id=tooltip-slot on-slotchange={onTooltipTriggerSlotChange} name=tooltip>{tooltip}</slot>\n </mdw-tooltip>\n `);\n },\n });\n // eslint-disable-next-line no-unused-expressions\n this.css`\n #tooltip {\n position:absolute;\n \n overflow: hidden;\n \n box-sizing: content-box;\n \n block-size: 0;\n inline-size: 0;\n margin: 0;\n padding: 0;\n \n transform: none;\n }\n \n #tooltip[open] {\n display: block;\n \n block-size: auto;\n inline-size: auto;\n \n cursor: default;\n pointer-events:auto;\n \n opacity: 0;\n transform: none;\n }\n `;\n }\n\n static TOOLTIP_MOUSE_IDLE_MS = 500;\n\n static TOOLTIP_TOUCH_IDLE_MS = 1500;\n\n /** @type {InstanceType<Tooltip>} */\n #tooltip;\n\n /** @type {any} */\n #idleDebounce;\n\n #pendingHide = false;\n\n /** @type {HTMLElement[]} */\n #watchedParents = [];\n\n #resizeObserver;\n\n #intersectObserver;\n\n onParentScroll = (event) => {\n this.updateTooltipPosition();\n };\n\n /** @param {any[]} args */\n constructor(...args) {\n super(...args);\n this.#tooltip = /** @type {InstanceType<Tooltip>} */ (this.refs.tooltip.cloneNode(true));\n this.#tooltip.removeAttribute('id');\n this.#tooltip.style.setProperty('position', 'fixed');\n this.#tooltip.setAttribute('aria-hidden', 'true');\n this.#resizeObserver = new ResizeObserver((entries) => {\n // console.log('RO', entries);\n if (!this.#tooltip.open) return;\n this.updateTooltipPosition();\n });\n const threshold = [0, 0.49, 0.5, 0.51, 1];\n this.#intersectObserver = new IntersectionObserver((entries) => {\n // console.log('IO', entries);\n if (!this.#tooltip.open) return;\n for (const entry of entries) {\n if (entry.intersectionRatio <= 0) {\n console.debug('Hide tooltip due to tooltip occlusion');\n this.hideTooltip();\n return;\n }\n if (entry.target === this.#tooltip) {\n console.debug('Reposition tooltip due to possible tooltip occlusion');\n this.updateTooltipPosition();\n return;\n }\n if (entry.target === this) {\n if (entry.intersectionRatio <= 0.5) {\n console.debug('Hiding tooltip because target is occluded');\n this.hideTooltip();\n } else {\n console.debug('Using InsectionObserver rect to update tooltip');\n this.updateTooltipPosition(entry.boundingClientRect);\n }\n return;\n }\n }\n console.debug('Updating tooltip position because offsetParent change.');\n this.updateTooltipPosition();\n }, { threshold });\n // this.#tooltip.remove();\n }\n\n /**\n * @param {Event & {currentTarget: HTMLSlotElement}} event\n * @return {void}\n */\n onTooltipTriggerSlotChange(event) {\n const tooltip = this.tooltipClone;\n tooltip.replaceChildren(\n ...event.currentTarget.assignedNodes()\n .map((child) => child.cloneNode(true)),\n );\n }\n\n /**\n * @this {TooltipTrigger} this\n * @param {FocusEvent} event\n * @return {void}\n */\n onTooltipTriggerFocus(event) {\n // console.log('getting focus', event);\n if (this.disabledState) return;\n if (this.matches(':active')) {\n // console.log('abort from active');\n return;\n }\n this.showTooltip();\n }\n\n /**\n * @this {TooltipTrigger} this\n * @param {KeyboardEvent} event\n * @return {void}\n */\n onTooltipTriggerKeydown(event) {\n if (event.ctrlKey) this.hideTooltip();\n }\n\n /**\n * @this {TooltipTrigger} this\n * @return {void}\n */\n onTooltipTriggerBlur() {\n this.hideTooltip();\n }\n\n /**\n * @param {MouseEvent|TouchEvent} event\n * @this {TooltipTrigger} this\n * @return {void}\n */\n onTooltipTriggerPointer(event) {\n if (this.disabledState) return;\n // console.log('tooltip event', event.type);\n switch (event.type) {\n case 'touchstart':\n this.scheduleShowTooltip('touch');\n break;\n case 'touchend':\n case 'touchcancel':\n this.scheduleHideTooltip('touch');\n break;\n case 'click':\n case 'mouseout':\n this.cancelShowTooltip();\n this.hideTooltip();\n break;\n case 'mousemove':\n case 'mouseover':\n this.scheduleShowTooltip('mouse');\n break;\n default:\n }\n }\n\n get tooltipClone() {\n return this.#tooltip;\n }\n\n get clonedTooltip() {\n return this.#tooltip;\n }\n\n cancelShowTooltip() {\n // console.log('cancel tooltiptimer');\n clearTimeout(this.#idleDebounce);\n }\n\n /** @param {'mouse'|'touch'|'keyboard'} type */\n scheduleHideTooltip(type) {\n clearTimeout(this.#idleDebounce);\n if (!this.#tooltip.open) {\n // console.log('abort schedule (shown)');\n return;\n }\n let timeout = 0;\n switch (type) {\n case 'mouse':\n timeout = 0;\n break;\n case 'touch':\n timeout = 1500;\n break;\n default:\n }\n // console.log('schedule tooltiptimer');\n this.#idleDebounce = setTimeout(() => {\n // console.log('hide timeout');\n this.hideTooltip();\n }, timeout);\n }\n\n /** @param {'mouse'|'touch'|'keyboard'} type */\n scheduleShowTooltip(type) {\n if (this.#tooltip.open) {\n // console.log('abort schedule (shown)');\n return;\n }\n let timeout = 0;\n switch (type) {\n case 'mouse':\n timeout = this.constructor.TOOLTIP_MOUSE_IDLE_MS;\n break;\n case 'touch':\n timeout = this.constructor.TOOLTIP_TOUCH_IDLE_MS;\n break;\n default:\n }\n // console.log('schedule tooltiptimer');\n clearTimeout(this.#idleDebounce);\n this.#idleDebounce = setTimeout(() => {\n // console.log('idle');\n this.showTooltip(type === 'touch');\n }, timeout);\n }\n\n showTooltip(touch = false) {\n if (this.#tooltip.open) return;\n this.refs.tooltip.open = true;\n this.refs.tooltip.touch = touch;\n this.#tooltip.touch = touch;\n document.body.append(this.#tooltip);\n this.updateTooltipPosition();\n this.#resizeObserver.observe(this, { box: 'border-box' });\n this.#intersectObserver.observe(this);\n this.#intersectObserver.observe(this.#tooltip);\n /** @type {HTMLElement} */\n let offsetParent = this;\n while ((offsetParent = offsetParent.offsetParent)) {\n this.#resizeObserver.observe(offsetParent, { box: 'border-box' });\n // console.log('observing', offsetParent);\n this.#watchedParents.push(offsetParent);\n this.#intersectObserver.observe(offsetParent);\n offsetParent.addEventListener('scroll', this.onParentScroll);\n }\n window.addEventListener('scroll', this.onParentScroll);\n\n // console.log('offsetparent', this.offsetParent);\n\n this.#tooltip.open = true;\n }\n\n hideTooltip() {\n this.#resizeObserver.disconnect();\n this.#intersectObserver.disconnect();\n let parent;\n while ((parent = this.#watchedParents.pop())) {\n parent.removeEventListener('scroll', this.onParentScroll);\n }\n window.removeEventListener('scroll', this.onParentScroll);\n this.#tooltip.open = false;\n this.#tooltip.remove();\n this.refs.tooltip.open = false;\n const hoverStyle = this.refs.tooltip.style;\n hoverStyle.removeProperty('width');\n hoverStyle.removeProperty('height');\n }\n\n /**\n * @param {DOMRect} [domRect]\n * @return {void}\n */\n updateTooltipPosition(domRect) {\n const offset = 8;\n // const margin = 8;\n /** @type {import('../utils/popup.js').CanAnchorPopUpOptions} */\n const anchorOptions = {\n anchor: domRect ?? this.getBoundingClientRect(),\n width: this.#tooltip.clientWidth,\n height: this.#tooltip.clientHeight,\n // margin,\n };\n\n const isPageRTL = (getComputedStyle(this).direction === 'rtl');\n const xStart = isPageRTL ? 'right' : 'left';\n const xEnd = isPageRTL ? 'left' : 'right';\n /** @type {import('../utils/popup.js').CanAnchorPopUpOptions[]} */\n const preferences = [\n { clientY: 'bottom', clientX: 'center', offsetY: offset },\n { clientY: 'bottom', clientX: xStart, offsetY: offset },\n { clientY: 'bottom', clientX: xEnd, offsetY: offset },\n { clientY: 'top', clientX: 'center', offsetY: -offset },\n { clientY: 'top', clientX: xStart, offsetY: -offset },\n { clientY: 'top', clientX: xEnd, offsetY: -offset },\n ];\n\n let anchorResult;\n for (const preference of preferences) {\n anchorResult = canAnchorPopup({\n ...anchorOptions,\n ...preference,\n });\n if (anchorResult) break;\n }\n\n // console.log({ anchorResult });\n if (!anchorResult) {\n anchorResult = canAnchorPopup({\n ...anchorOptions,\n ...preferences[0],\n force: true,\n });\n }\n\n this.#tooltip.style.setProperty('top', `${anchorResult.pageY}px`);\n this.#tooltip.style.setProperty('left', `${anchorResult.pageX}px`);\n this.#tooltip.style.setProperty('margin', '0');\n this.#tooltip.style.setProperty('transform-origin', `${anchorResult.transformOriginY} ${anchorResult.transformOriginX}`);\n\n const hoverStyle = this.refs.tooltip.style;\n hoverStyle.setProperty('width', `${anchorResult.width + (anchorResult.offsetX * 2)}px`);\n hoverStyle.setProperty('height', `${anchorResult.height + (anchorResult.offsetY)}px`);\n if (anchorResult.clientY === 'bottom') {\n hoverStyle.setProperty('top', '100%');\n hoverStyle.removeProperty('bottom');\n } else {\n hoverStyle.removeProperty('top');\n hoverStyle.setProperty('height', `${anchorResult.height + (anchorResult.offsetY)}px`);\n hoverStyle.setProperty('bottom', '100%');\n }\n switch (anchorResult.clientX) {\n case 'left':\n hoverStyle.setProperty('left', '0');\n hoverStyle.removeProperty('right');\n break;\n default:\n case 'center':\n hoverStyle.removeProperty('left');\n hoverStyle.removeProperty('right');\n break;\n case 'right':\n hoverStyle.removeProperty('left');\n hoverStyle.setProperty('right', '0');\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n for (const type of ['click', 'mousedown', 'mousemove', 'mouseout',\n 'touchmove', 'touchstart', 'touchend', 'touchleave', 'touchcancel']) {\n this.addEventListener(type, this.onTooltipTriggerPointer, { passive: true });\n }\n this.addEventListener('focus', this.onTooltipTriggerFocus);\n this.addEventListener('blur', this.onTooltipTriggerBlur);\n this.addEventListener('keydown', this.onTooltipTriggerKeydown, { passive: true });\n }\n\n disconnectedCallback() {\n // console.log('disconnected');\n this.hideTooltip();\n super.disconnectedCallback();\n }\n }\n TooltipTrigger.prototype.tooltip = TooltipTrigger.prop('tooltip');\n return TooltipTrigger;\n}\n", "import TooltipTriggerMixin from '../mixins/TooltipTriggerMixin.js';\n\nimport ExtendedFab from './ExtendedFab.js';\n\nexport default ExtendedFab\n .mixin(TooltipTriggerMixin)\n .extend()\n .observe({\n fabSize: {\n /** @type {null|'small'|'large'} */\n value: null,\n },\n })\n .css`\n /* https://m3.material.io/components/floating-action-button/specs */\n\n :host {\n min-inline-size: 24px;\n }\n\n #icon {\n font-size: 24px;\n }\n\n #icon[fab-size=\"large\"] {\n font-size: 36px;\n }\n\n :host([fab-size=\"small\"]) {\n --mdw-shape__size: 12px;\n padding: calc(8px + (var(--mdw-density) * 2px));\n }\n\n :host([fab-size=\"large\"]) {\n --mdw-shape__size: 28px;\n padding: calc(30px + (var(--mdw-density) * 2px));\n }\n\n `\n .on({\n composed() {\n const { slot, tooltipSlot, control, shape, icon } = this.refs;\n slot.remove();\n tooltipSlot.removeAttribute('name');\n control.setAttribute('aria-labelledby', 'tooltip');\n shape.setAttribute('fab-size', '{fabSize}');\n icon.setAttribute('fab-size', '{fabSize}');\n },\n })\n .autoRegister('mdw-fab');\n", "import './Icon.js';\n\nimport Chip from './Chip.js';\n\nexport default Chip\n .extend()\n .observe({\n type: { empty: 'checkbox' },\n dropdown: 'boolean',\n trailingSrc: 'string',\n trailingIcon: 'string',\n })\n .expressions({\n computedTrailingIcon: ({ trailingIcon, dropdown, trailingSrc }) => {\n if (trailingIcon) return trailingIcon;\n if (dropdown) return 'arrow_drop_down';\n if (trailingSrc) return '';\n return null;\n },\n })\n .html/* html */`\n <mdw-icon _if={!icon} id=check-icon disabled={disabledState} selected={checked} aria-hidden=true>check</mdw-icon>\n <mdw-icon _if={computedTrailingIcon} id=trailing-icon aria-hidden=true src={trailingSrc}>{computedTrailingIcon}</mdw-icon>\n `\n .on({\n composed() {\n const { shape, icon, control, outline, slot, trailingIcon, checkIcon } = this.refs;\n\n shape.setAttribute('selected', '{checked}');\n shape.setAttribute('icon', '');\n shape.setAttribute('trailing-icon', '{computedTrailingIcon}');\n icon.setAttribute('_if', '{icon}');\n icon.setAttribute('ink', '{iconInk}');\n\n control.removeAttribute('role');\n control.setAttribute('type', 'checkbox');\n\n outline.removeAttribute('ink');\n outline.removeAttribute('color');\n outline.setAttribute('selected', '{checked}');\n\n slot.removeAttribute('ink');\n slot.removeAttribute('color');\n\n slot.before(checkIcon);\n slot.after(trailingIcon);\n },\n })\n .css`\n /* https://m3.material.io/components/chips/specs */\n\n /* Filter Chips can be elevated */\n\n :host {\n --mdw-ink: var(--mdw-color__on-secondary-container);\n --mdw-bg: var(--mdw-color__secondary-container);\n gap: 8px;\n\n padding-inline-start: max(4px, calc(8px + (var(--mdw-density) * 2px)));\n padding-inline-end: max(12px, calc(16px + (var(--mdw-density) * 2px)));\n\n color: rgb(var(--mdw-color__on-surface-variant));\n\n }\n\n :host(:focus) {\n --mdw-outline__rgb: var(--mdw-color__outline);\n }\n\n #icon[selected] {\n font-variation-settings: 'FILL' 1;\n }\n\n #shape {\n background-color: transparent;\n }\n\n :host(:where([trailing-icon],[dropdown],[trailing-src])) {\n padding-inline-start: max(4px, calc(8px + (var(--mdw-density) * 2px)));\n }\n\n #shape[elevated] {\n background-color: rgb(var(--mdw-color__surface));\n }\n\n #shape[selected] {\n background-color: rgb(var(--mdw-bg));\n }\n\n :host([selected]) {\n color: rgb(var(--mdw-ink));\n }\n\n #outline[selected] {\n opacity: 0;\n }\n\n #trailing-icon {\n position: relative;\n\n font-size: 18px;\n }\n\n .mdw-chip__checkbox {\n position: absolute;\n\n max-block-size: 0;\n max-inline-size: 0;\n\n appearance: none;\n pointer-events: none;\n }\n\n #check-icon {\n font-size: 0;\n }\n\n #check-icon[selected] {\n font-size: 18px;\n }\n\n #check-icon[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #shape[disabled]:is([elevated],[selected]) {\n background-color: rgba(var(--mdw-color__on-surface), 0.12);\n /* color: rgba(var(--mdw-color__on-surface), 0.38); */\n }\n\n `\n .autoRegister('mdw-filter-chip');\n", "import ThemableMixin from '../mixins/ThemableMixin.js';\n\nimport Box from './Box.js';\n\nexport default Box\n .mixin(ThemableMixin)\n .extend()\n .observe({\n ariaLevel: 'string',\n size: {\n type: 'string',\n /** @type {'large'|'medium'|'small'} */\n empty: 'large',\n },\n })\n .expressions({\n computeAriaLevel({ ariaLevel, size }) {\n if (ariaLevel) return ariaLevel;\n if (size === 'medium') return '2';\n if (size === 'small') return '3';\n return '1';\n },\n })\n .on({\n composed() {\n const { slot } = this.refs;\n slot.setAttribute('role', 'heading');\n slot.setAttribute('aria-level', '{computeAriaLevel}');\n },\n })\n .css`\n :host {\n font: var(--mdw-typescale__headline-large__font);\n letter-spacing: var(--mdw-typescale__headline-large__letter-spacing);\n }\n \n :host([size=\"medium\"]) {\n font: var(--mdw-typescale__headline-medium__font);\n letter-spacing: var(--mdw-typescale__headline-medium__letter-spacing);\n }\n \n :host([size=\"small\"]) {\n font: var(--mdw-typescale__headline-small__font);\n letter-spacing: var(--mdw-typescale__headline-small__letter-spacing);\n } \n `\n .autoRegister('mdw-headline');\n", "import TooltipTriggerMixin from '../mixins/TooltipTriggerMixin.js';\n\nimport Button from './Button.js';\n\nexport default Button\n .mixin(TooltipTriggerMixin)\n .extend()\n .observe({\n _ariaPressed: {\n get({ type, checked }) {\n if (type !== 'checkbox') return null;\n return checked ? 'true' : 'false';\n },\n },\n })\n .expressions({\n isToggle({ type }) {\n return type === 'checkbox';\n },\n })\n .childEvents({\n control: {\n keydown(event) {\n if (event.key !== 'Enter') return;\n const input = /** @type {HTMLInputElement} */ (event.currentTarget);\n if (input.type !== 'checkbox') return;\n event.stopImmediatePropagation();\n event.stopPropagation();\n event.preventDefault();\n if (input.disabled) return;\n\n // Simulate click\n const clickEvent = new Event('click', { bubbles: true, cancelable: true, composed: true });\n if (!input.dispatchEvent(clickEvent)) return;\n\n // Toggle check and signal\n input.checked = !input.checked;\n input.dispatchEvent(new Event('change', { bubbles: true }));\n },\n },\n })\n .on({\n composed() {\n const { slot, shape, tooltipSlot, icon, label, surfaceTint, control, outline } = this.refs;\n shape.classList.add('colored');\n label.classList.add('colored');\n for (const el of [shape, label, icon]) {\n el.setAttribute('toggle', '{isToggle}');\n el.setAttribute('selected', '{checked}');\n }\n slot.remove();\n icon.removeAttribute('_if');\n tooltipSlot.removeAttribute('name');\n\n surfaceTint.remove();\n\n control.setAttribute('aria-pressed', '{_ariaPressed}');\n control.setAttribute('aria-labelledby', 'tooltip');\n\n outline.setAttribute('selected', '{checked}');\n },\n })\n .css`\n /* https://m3.material.io/components/icon-buttons/specs */\n\n :host {\n --mdw-shape__size: var(--mdw-shape__full);\n --mdw-ink: rgb(var(--mdw-color__on-surface-variant));\n\n align-items: center;\n justify-content: center;\n\n padding: max(8px, calc(8px + (var(--mdw-density) * 2px)));\n\n background-color: transparent;\n\n font-size: 24px;\n }\n\n :host(:where([type=\"checkbox\"])) {\n --mdw-ink: var(--mdw-color__primary);\n }\n\n /** Filled | Filled Checked */\n :host(:where([filled])) {\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-bg: var(--mdw-color__primary);\n --mdw-surface__shadow__resting: none;\n --mdw-surface__shadow__raised: none;\n }\n\n /** Tonal | Tonal Checked */\n :host(:where([filled=\"tonal\"])) {\n --mdw-ink: var(--mdw-color__on-secondary-container);\n --mdw-bg: var(--mdw-color__secondary-container);\n }\n\n /** Outlined | Outlined Unchecked */\n :host(:where([outlined])) {\n --mdw-ink: var(--mdw-color__on-surface-variant);\n }\n\n /** Outlined | Outlined Unchecked */\n :host(:where([outlined][type=\"checkbox\"])) {\n --mdw-bg: var(--mdw-color__inverse-surface);\n --mdw-ink: var(--mdw-color__inverse-on-surface);\n }\n\n #label {\n font-size: inherit;\n letter-spacing: inherit;\n }\n\n #shape[toggle] {\n background-color: transparent;\n }\n\n .colored[toggle] {\n color: rgb(var(--mdw-color__on-surface-variant));\n }\n\n .colored[selected] {\n /* background-color: rgb(var(--mdw-bg)); */\n color: rgb(var(--mdw-ink));\n }\n\n #shape[filled][toggle] {\n background-color: rgb(var(--mdw-color__surface-variant));\n }\n\n .colored[filled][toggle] {\n color: rgb(var(--mdw-bg));\n }\n\n #shape[filled=\"tonal\"][toggle] {\n background-color: rgb(var(--mdw-color__surface-variant));\n }\n\n .colored[filled=\"tonal\"][toggle] {\n color: rgb(var(--mdw-color__on-surface-variant));\n }\n\n #shape[filled][selected] {\n background-color: rgb(var(--mdw-bg));\n }\n\n .colored[filled][selected] {\n color: rgb(var(--mdw-ink));\n }\n\n #shape[outlined] {\n background-color: transparent;\n }\n\n .colored[outlined] {\n color: inherit;\n }\n\n #shape[outlined][toggle] {\n background-color: transparent;\n }\n\n .colored[outlined][toggle] {\n color: rgb(var(--mdw-color__on-surface-variant));\n }\n\n #shape[outlined][selected] {\n background-color: rgb(var(--mdw-bg));\n }\n\n .colored[outlined][selected] {\n color: rgb(var(--mdw-ink));\n }\n\n #icon {\n font-size: inherit;\n font-variation-settings: 'FILL' 1;\n }\n\n #icon[toggle] {\n font-variation-settings: 'FILL' 0;\n }\n\n #icon[selected] {\n font-variation-settings: 'FILL' 1;\n }\n\n #outline[focused] {\n opacity: 1;\n\n color: inherit;\n }\n\n #outline[selected] {\n opacity: 0;\n }\n\n /** Disabled */\n .colored[disabled] {\n cursor: not-allowed;\n\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #shape[disabled][filled],\n #shape[disabled][outlined][selected] {\n background-color: rgba(var(--mdw-color__on-surface), 0.12);\n }\n\n .colored[disabled][filled],\n .colored[disabled][outlined][selected] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n `\n .autoRegister('mdw-icon-button');\n", "import '../components/Icon.js';\nimport DensityMixin from './DensityMixin.js';\nimport ShapeMixin from './ShapeMixin.js';\n\n/** @typedef {import('../core/CustomElement.js').default} CustomElement */\n\n/**\n * @param {ReturnType<import('./ControlMixin.js').default>} Base\n */\nexport default function TextFieldMixin(Base) {\n return Base\n .mixin(DensityMixin)\n .mixin(ShapeMixin)\n .extend()\n .set({\n stateLayer: true,\n })\n .observe({\n type: { empty: 'text' },\n icon: 'string',\n label: 'string',\n filled: 'boolean',\n outlined: 'boolean',\n inputPrefix: 'string',\n inputSuffix: 'string',\n trailingIcon: 'string',\n trailingIconInk: 'string',\n supporting: 'string',\n error: 'string',\n placeholder: { nullParser: String }, // DOMString\n })\n .observe({\n erroredState({ error, _invalid }) { return Boolean(error || _invalid); },\n })\n .expressions({\n computePlaceholder({ filled, outlined, label, placeholder }) {\n if (filled || outlined) return placeholder;\n return placeholder ?? label;\n },\n\n shouldShowSupporting({ _invalid, error, supporting }) {\n return _invalid || ((error ?? supporting) != null);\n },\n\n computeSupportingText({ error, _validationMessage, supporting }) {\n return (error || _validationMessage || supporting) ?? '';\n },\n\n populatedState({ value, _badInput }) {\n return !!value || _badInput;\n },\n _showLabelText({ label, filled, outlined }) {\n return label && (filled || outlined);\n },\n })\n .on({\n composed({ template, html, inline }) {\n const { control, label: labelElement, outline, shape, outlineLeft, outlineRight, state } = this.refs;\n control.setAttribute('type', 'text');\n control.setAttribute('placeholder', '{computePlaceholder}');\n control.setAttribute('aria-label', '{label}');\n control.setAttribute('input-suffix', '{inputSuffix}');\n control.setAttribute('errored', '{erroredState}');\n control.removeAttribute('aria-labelledby');\n control.classList.add('inline');\n\n labelElement.classList.add('shape');\n labelElement.setAttribute('filled', '{filled}');\n labelElement.setAttribute('color', '{color}');\n labelElement.setAttribute('icon', '{icon}');\n labelElement.setAttribute('shape-style', '{shapeStyle}');\n labelElement.setAttribute('trailingIcon', '{trailingIcon}');\n labelElement.setAttribute('populated', '{populatedState}');\n labelElement.setAttribute('outlined', '{outlined}');\n labelElement.setAttribute('focused', '{focusedState}');\n labelElement.setAttribute('label', '{label}');\n labelElement.setAttribute('shape-top', inline(({ shapeTop, filled }) => shapeTop || filled));\n labelElement.append(\n state,\n outline,\n html`\n <mdw-icon _if={icon} id=icon aria-hidden=true disabled={disabledState}>{icon}</mdw-icon>\n <span _if={inputPrefix} class=inline id=prefix aria-hidden=true focused={focusedState} populated={populatedState}>{inputPrefix}</span>\n <span _if={inputSuffix} class=inline id=suffix aria-hidden=true focused={focusedState} populated={populatedState}>{inputSuffix}</span>\n <mdw-icon _if={trailingIcon} id=trailing-icon ink={trailingIconInk} aria-hidden=true disabled={disabledState}>{trailingIcon}</mdw-icon>\n <div id=indicator _if={filled} focused={focusedState} hovered={hoveredState} errored={erroredState} disabled={disabledState} ></div>\n `,\n );\n\n outline.setAttribute('invalid', '{invalid}');\n outline.setAttribute('errored', '{erroredState}');\n outlineLeft.after(html`\n <div id=gap _if={label} label={label} populated={populatedState} focused={focusedState}>\n <div id=gap-slot focused={focusedState}></div>\n <span id=gap-label>{label}</span>\n </div>\n `);\n\n outlineLeft.setAttribute('focused', '{focusedState}');\n outlineRight.setAttribute('focused', '{focusedState}');\n\n shape.remove();\n state.setAttribute('_if', '{!outlined}');\n\n template.append(html`\n <div id=label-text _if={_showLabelText} aria-hidden=true\n outlined={outlined}\n populated={populatedState}\n focused={focusedState}\n icon={icon}\n trailing-icon={trailingIcon}\n disabled={disabledState}\n errored={erroredState}>{label}</div>\n <div _if={shouldShowSupporting} id=supporting disabled={disabledState} errored={erroredState}>\n {computeSupportingText}\n <slot id=supporting-slot name=supporting></slot>\n </div>\n `);\n },\n sizeChanged(oldValue, newValue) {\n this.refs.control.style.setProperty('--size', `${newValue}ch`);\n },\n })\n .css`\n /* https://m3.material.io/components/text-fields/specs */\n\n /**\n * States: Enabled / Hover / Focus / Error / Error Hover / Error Focus\n * Input: on-surface / on-surface / on-surface / on-surface / on-surface / on-surface\n * Inline: on-surface-variant / on-surface-variant / on-surface-variant / on-surface-variant / on-surface-variant / on-surface-variant\n * Label: on-surface-variant / on-surface* / ink / error / on-error-container / error\n * Indicator: on-surface-variant / on-surface / ink / error / on-error-container / error\n * Caret: (any) / (any) / ink / (any) / (any) / error\n * Outline: outline / on-surface / ink / error / on-error-container / error\n * Selection: on-* / on-* / ink / error / on-error-container / error\n *\n *\n * *Filled hovered unpopulated label may be on-surface-variant instead\n *\n * Input: Always on-surface\n * Inline: Always on-surface-variant\n * Indicator: same as label\n * Label: same as indicator\n * Outline: outline default, same as label+indicator on :hover or :focus\n * Caret: same as label+indicator+outline (cannot inherit color or use currentColor)\n * Selection: (cannot inherit color or use currentColor)\n */\n\n :host {\n --mdw-shape__size: var(--mdw-shape__extra-small);\n /* --mdw-shape__size: 8px; */\n /* --mdw-shape__size__bottom-start-size: var(--mdw-shape__size); */\n /* --mdw-shape__size__bottom-end-size: var(--mdw-shape__size); */\n --mdw-text-field__ratio: calc(var(--mdw-density) * 0.125 + 1);\n\n --control__margin-top: calc(var(--mdw-typescale__body-small__line-height) / 2);\n --control__padding-top: calc((var(--mdw-text-field__ratio) * 16px) - calc(var(--mdw-typescale__body-small__line-height) / 2));\n --control__padding-bottom: calc(var(--mdw-text-field__ratio) * 16px);\n --control__margin-bottom: 0px;\n\n --inline-color: rgb(var(--mdw-color__on-surface-variant));\n\n --descriptor-opacity: 0.5;\n --mdw-ink: var(--mdw-color__primary);\n --mdw-bg: var(--mdw-color__surface-variant);\n\n --mdw-type__font: var(--mdw-typescale__body-large__font);\n --mdw-type__letter-spacing: var(--mdw-typescale__body-large__letter-spacing);\n\n display: inline-block;\n\n /* State layer */\n color: rgb(var(--mdw-color__on-surface));\n\n font: var(--mdw-type__font);\n letter-spacing: var(--mdw-type__letter-spacing);\n }\n\n :host([icon]) {\n --padding-inline-start: 12px;\n }\n\n :host([trailing-icon]) {\n --padding-inline-end: 12px;\n }\n\n :host(:is([color], [ink])) {\n background-color: transparent;\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #label {\n position: relative;\n\n display: flex;\n\n align-items: center;\n overflow: visible;\n\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n\n cursor: inherit;\n\n z-index: 0;\n\n background-color: transparent;\n\n font-weight: inherit;\n font-size: inherit;\n line-height: inherit;\n font-family: inherit;\n letter-spacing: inherit;\n\n transition: none 200ms cubic-bezier(0.0, 0.0, 0.2, 1);\n }\n\n #label:is([filled],[color]) {\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #label[outlined] {\n background-color: transparent;\n }\n\n #label-text,\n #indicator {\n color: rgb(var(--mdw-color__on-surface-variant))\n }\n\n :is(#label-text, #indicator)[focused] {\n color: rgb(var(--mdw-ink))\n }\n\n #label[icon] {\n padding-inline-start: 12px;\n }\n\n #label[trailing-icon] {\n padding-inline-end: 12px;\n }\n\n #label[focused] {\n transition: none 100ms cubic-bezier(0.4, 0.0, 1, 1);\n }\n\n #label[shape-top] {\n --mdw-shape__size__bottom-start-size: 0px;\n --mdw-shape__size__bottom-end-size: 0px;\n --mdw-shape__mask: linear-gradient(transparent 50%, black 50%);\n }\n\n #prefix,\n #suffix,\n #control::placeholder {\n opacity: var(--descriptor-opacity);\n\n color: var(--inline-color);\n\n transition-duration: inherit;\n transition-property: opacity;\n transition-timing-function: inherit;\n will-change: opacity;\n }\n\n :host([label]:is([filled],[outlined])) {\n --descriptor-opacity: 0;\n }\n\n #control {\n position: relative;\n inset: auto;\n align-self: flex-start;\n\n display: inline;\n\n box-sizing: border-box;\n\n block-size: auto;\n min-block-size: none;\n inline-size: 100%;\n min-inline-size: none;\n flex: 1;\n border-block-start: solid var(--control__margin-top) transparent;\n border-block-end: solid var(--control__margin-bottom) transparent;\n padding-block: var(--control__padding-top) var(--control__padding-bottom);\n\n appearance: none;\n caret-color: rgb(var(--mdw-ink));\n cursor: auto;\n\n transform: none;\n\n visibility: visible;\n\n background-color: transparent;\n border-color: transparent;\n color: inherit;\n /* rgb(var(--mdw-color__on-surface)); */\n\n font-weight: inherit;\n font-size: inherit;\n line-height: inherit;\n font-family: inherit;\n letter-spacing: inherit;\n\n transition-duration: inherit;\n transition-property: color;\n transition-timing-function: inherit;\n }\n\n #suffix,\n #prefix {\n /* Symmetrical to allow centering */\n margin-block: var(--control__margin-top) var(--control__margin-bottom);\n padding-block: var(--control__padding-top) var(--control__padding-bottom);\n }\n\n /* stylelint-disable-next-line plugin/no-unsupported-browser-features */\n #control::selection {\n background-color: rgb(var(--mdw-ink));\n color: rgb(var(--mdw-color__surface));\n }\n\n #state {\n --mdw-state__focus-opacity: 0;\n --mdw-state__pressed-opacity: 0;\n }\n\n mdw-icon {\n --mdw-icon__size: 24px;\n align-self: center;\n\n color: var(--inline-color);\n }\n\n #icon {\n order: -2;\n\n margin-inline-end: 16px;\n\n font-size: 24px;\n }\n\n #prefix {\n order: -1;\n }\n\n #suffix {\n order: 1;\n }\n\n #trailing-icon {\n order: 2;\n\n margin-inline-start: 16px;\n }\n\n #indicator {\n position: absolute;\n inset-block-end: 0;\n inset-inline: 0;\n\n border-block-end: 2px solid currentColor;\n\n pointer-events: none;\n\n transform: scaleY(0.5);\n z-index: 1; /* Force new layer to avoid repaint */\n\n transition-duration: inherit;\n transition-property: transform;\n transition-timing-function: inherit;\n will-change: transform;\n }\n\n #indicator[focused] {\n transform: scaleY(1);\n\n }\n\n /** Label Text **/\n\n #label-text {\n position: absolute;\n inset-block-start: 0;\n inset-inline: 0;\n\n display: block;\n overflow-x: clip;\n overflow-y: visible;\n\n padding-inline: 16px;\n\n pointer-events: none;\n\n opacity: 1;\n transform: translateY(calc((var(--control__margin-top) + var(--control__padding-top) + 100% + var(--control__padding-bottom) + var(--control__margin-bottom)) / 2)) translateY(-50%);\n z-index: 4;\n /* FireFox bug */\n\n color: rgb(var(--mdw-color__on-surface-variant));\n\n text-overflow: ellipsis;\n white-space: nowrap;\n\n transition-duration: 200ms;\n transition-property: inset-inline-start, font-size, transform;\n /* transition-timing-function: inherit; */\n /*Expand*/\n\n will-change: inset-inline-start, font-size, transform;\n }\n\n @supports (-moz-appearance:none ) {\n #label-text {\n /* Firefox clips Y as well as X */\n overflow-x: hidden;\n }\n }\n\n #label-text[focused] {\n color: rgb(var(--mdw-ink));\n }\n\n #label-text[icon] {\n inset-inline-start: calc(12px + 24px);\n }\n\n #label-text[trailing-icon] {\n inset-inline-end: calc(24px + 12px);\n }\n\n #label-text:is([focused], [populated]) {\n transform: translateY(calc(var(--mdw-text-field__ratio) * 8px));\n\n font: var(--mdw-typescale__body-small__font);\n /* Not spec: Should only use font-size and line-height */\n letter-spacing: var(--mdw-typescale__body-small__letter-spacing);\n }\n\n #label-text[outlined]:is([focused], [populated]) {\n inset-inline: 0;\n\n transform: translateY(-50%);\n }\n\n #label[label][outlined] {\n /** Guard against bleed */\n --mdw-shape__size__top-start-size: min(var(--mdw-shape__size), 12px);\n --mdw-shape__size__bottom-start-size: min(var(--mdw-shape__size), 12px);\n --mdw-shape__size__top-end-size: min(var(--mdw-shape__size), 12px);\n --mdw-shape__size__bottom-end-size: min(var(--mdw-shape__size), 12px);\n -webkit-mask-box-image-width: min(var(--mdw-shape__size), 12px);\n }\n\n :is(#prefix, #suffix):is([focused], [populated]) {\n opacity: 1;\n }\n\n /* If no label */\n #control:is(:focus, :not(:placeholder-shown))::placeholder {\n opacity: 0.70;\n }\n\n #control[input-suffix] {\n text-align: end;\n }\n\n /** Outlined **/\n\n #outline::before {\n content: none;\n }\n\n .outline-section {\n position: relative;\n\n border: 1px solid currentColor;\n }\n\n .outline-section[focused] {\n border-width: 2px;\n }\n\n #outline-left {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-right-width: 0;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-top-left-radius: inherit;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-bottom-left-radius: inherit;\n }\n\n #outline-right {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-left-width: 0;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-top-right-radius: inherit;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-bottom-right-radius: inherit;\n }\n\n #outline {\n display: grid;\n grid-auto-flow: column;\n grid-template-columns: 12px minmax(0,auto) minmax(12px, 1fr);\n\n color: rgb(var(--mdw-color__outline));\n\n\n }\n\n #outline[hovered] {\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #outline[focused] {\n color: rgb(var(--mdw-ink));\n }\n\n .outline-section {\n min-inline-size: 12px;\n }\n\n .outline-section::before,\n .outline-section::after {\n max-inline-size: none;\n }\n\n .outline-left {\n grid-column: calc(2 - var(--mdw-dir, 1)) / span 1; /* 1 on LTR, 3 on RTL */\n }\n\n .outline-right {\n grid-column: calc(2 + var(--mdw-dir, 1)) / span 1;\n }\n\n #gap {\n position: relative;\n\n display: inline-block;\n overflow: clip hidden;\n\n max-inline-size: 100%;\n grid-column: 2;\n\n font: var(--mdw-typescale__body-small__font);\n /* Not spec: Should only use font-size and line-height */\n letter-spacing: var(--mdw-typescale__body-small__letter-spacing);\n\n /* Close gap */\n transition-duration: inherit;\n transition-property: padding;\n transition-timing-function: inherit;\n }\n\n #gap-label {\n display: inline-block;\n overflow: clip hidden;\n\n padding-inline: 4px;\n\n color:transparent;\n\n white-space: nowrap;\n }\n\n #gap::after {\n content: '';\n\n position: absolute;\n inset: 0;\n\n border-block-end: solid 1px currentColor;\n }\n\n #gap[focused]::after {\n border-block-end-width: 2px;\n }\n\n #gap-slot {\n position: absolute;\n inset: 0;\n\n }\n\n #gap-slot::before,\n #gap-slot::after {\n content: '';\n\n position: absolute;\n inset: 0;\n\n border-block-start: solid 1px currentColor;\n\n transition: transform 200ms;\n will-change: transform;\n }\n\n #gap-slot[focused]::before,\n #gap-slot[focused]::after {\n border-block-start-width: 2px;\n }\n\n @supports(-webkit-mask-box-image: none) {\n #outline[focused] {\n /** Fake 2px outline */\n filter:\n drop-shadow(1px 0px 0px currentColor)\n drop-shadow(0px 1px 0px currentColor)\n drop-shadow(-1px 0px 0px currentColor)\n drop-shadow(0px -1px 0px currentColor);\n }\n\n #outline::before {\n content: '';\n\n position: absolute;\n inset: 0;\n\n grid-column: calc(2 - var(--mdw-dir, 1)) / span 1;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n margin-right: -0.99px;\n border: none;\n\n background-color: currentColor;\n -webkit-mask-box-image: var(--mdw-shape__mask-image__edges)\n 8 fill /\n auto\n stretch;\n -webkit-mask-box-image-width: auto 0 auto auto;\n }\n\n #outline::after {\n grid-column: calc(2 + var(--mdw-dir, 1)) / span 1;\n grid-row: 1;\n\n /* stylelint-disable-next-line liberty/use-logical-spec */\n margin-left: -0.99px;\n -webkit-mask-box-image-width: auto auto auto 0;\n }\n\n .outline-section {\n border: none;\n }\n\n #gap::after {\n border: none;\n\n background-color: currentColor;\n -webkit-mask-box-image: var(--mdw-shape__mask-image__edges)\n 8 fill /\n auto\n stretch;\n -webkit-mask-box-image-width: 0 0 auto 0;\n }\n\n #gap-slot::before,\n #gap-slot::after {\n border: none;\n\n background-color: currentColor;\n\n -webkit-mask-box-image: var(--mdw-shape__mask-image__edges)\n 8 fill /\n auto\n stretch;\n -webkit-mask-box-image-width: auto 0 0 0;\n }\n }\n\n #gap-slot::before {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n margin-right: -0.99px;\n\n transform: var(--gap-transform, scaleX(0.5));\n transform-origin: 0 0;\n }\n\n #gap-slot::after {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n margin-left: -0.99px;\n\n transform: var(--gap-transform, scaleX(0.5));\n transform-origin: 100% 0;\n }\n\n #gap:is([focused], [populated]) {\n /* Open gap */\n --gap-transform: scaleX(0);\n }\n\n #gap:empty {\n padding: 0;\n }\n\n #label[label][filled] {\n align-items: flex-start;\n }\n\n :host([filled]) {\n --mdw-shape__size__bottom-start-size: 0px;\n --mdw-shape__size__bottom-end-size: 0px;\n --mdw-text-field__ratio: calc(var(--mdw-density) * 0.25 + 1);\n }\n\n :host(:is([filled][label])) {\n --control__margin-top: calc((var(--mdw-text-field__ratio) * 8px) + var(--mdw-typescale__body-small__line-height));\n --control__padding-top: 0px;\n --control__padding-bottom: calc(var(--mdw-text-field__ratio) * 4px);\n --control__margin-bottom: calc(var(--mdw-text-field__ratio) * 4px);\n }\n\n #supporting {\n min-block-size: var(--mdw-typescale__body-small__line-height);\n margin-block-start: 4px;\n margin-inline: 16px;\n\n font-weight: var(--mdw-typescale__body-small__font-weight); /* Not spec */\n font-size: var(--mdw-typescale__body-small__font-size);\n line-height: var(--mdw-typescale__body-small__line-height);\n font-family: var(--mdw-typescale__body-small__font-family); /* Not spec */\n letter-spacing: var(--mdw-typescale__body-small__letter-spacing); /* Not spec */\n }\n\n /* Error States */\n\n #control[errored] {\n caret-color: rgb(var(--mdw-color__error));\n }\n\n #control[errored]::selection {\n background-color: rgb(var(--mdw-color__on-error-container));\n }\n\n :is(#indicator, #label-text, #supporting, #outline)[errored] {\n color: rgb(var(--mdw-color__error));\n }\n\n :is(#indicator, #label-text, #supporting, #outline)[errored]:where([hovered]) {\n color: rgb(var(--mdw-color__on-error-container));\n }\n\n :is(#indicator, #label-text, #supporting, #outline)[errored]:where([focused]) {\n color: rgb(var(--mdw-color__error));\n }\n\n /* stylelint-disable-next-line selector-max-compound-selectors */\n #label[disabled],\n #label[disabled] #control {\n cursor: not-allowed;\n }\n\n #outline[disabled] {\n color: rgba(var(--mdw-color__outline), 0.12);\n }\n\n #label-text[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #supporting[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n .inline[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n mdw-icon[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #label[disabled] {\n background-color: rgba(var(--mdw-color__on-surface), calc(0.04));\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #indicator[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #label[disabled][outlined] {\n background-color: transparent;\n }\n \n `;\n}\n", "import CustomElement from '../core/CustomElement.js';\nimport InputMixin from '../mixins/InputMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport TextFieldMixin from '../mixins/TextFieldMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(InputMixin)\n .mixin(TextFieldMixin)\n .extend()\n .define({\n stateTargetElement() { return this.refs.control; },\n })\n .autoRegister('mdw-input');\n", "import Box from './Box.js';\n\nexport default Box\n .extend()\n .css`\n :host {\n font: var(--mdw-typescale__label-large__font);\n letter-spacing: var(--mdw-typescale__body-large__letter-spacing);\n }\n \n :host([size=\"medium\"]) {\n font: var(--mdw-typescale__label-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n \n :host([size=\"small\"]) {\n font: var(--mdw-typescale__label-small__font);\n letter-spacing: var(--mdw-typescale__body-small__letter-spacing);\n }\n `\n .autoRegister('mdw-label');\n", "import CustomElement from '../core/CustomElement.js';\n\nexport default CustomElement\n .extend()\n .html/* html */`\n <slot id=slot-top name=top></slot>\n <slot id=slot></slot>\n `\n .css`\n /* https://m3.material.io/foundations/layout/applying-layout/window-size-classes */\n\n :host {\n display: block;\n }\n\n /* Pane Slot */\n #slot {\n display: flex;\n gap: 24px;\n\n justify-content: center;\n\n padding-inline: 16px;\n\n transition: padding-inline 100ms;\n }\n\n @media screen and (min-width: 648px) { #slot { padding-inline: 24px; } }\n `\n .autoRegister('mdw-layout');\n", "import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\nimport DensityMixin from '../mixins/DensityMixin.js';\n\nimport Box from './Box.js';\n\n/** @typedef {'compact'} DeprecatedHTMLMenuElementProperties */\n\nexport default Box\n .mixin(DensityMixin)\n .mixin(AriaReflectorMixin)\n .extend()\n .set({\n _ariaRole: 'list',\n })\n .css`\n /* https://m3.material.io/components/lists/specs */\n\n :host {\n display: flex;\n flex-direction: column;\n\n padding-block: 8px;\n }\n\n :host(:focus) {\n outline: 1px solid red;\n }\n\n `\n .autoRegister('mdw-list');\n", "import CustomElement from '../core/CustomElement.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(ShapeMixin)\n .extend()\n .observe({\n selected: 'boolean',\n icon: 'string',\n errored: 'boolean',\n disabled: 'boolean',\n hovered: 'boolean',\n focused: 'boolean',\n })\n .define({\n /** Alias for Selected (QoL) */\n checked: {\n get() { return this.selected; },\n set(value) { this.selected = value; },\n },\n })\n .html/* html */`\n <div id=inner-shape class=shape selected={selected}></div>\n `.on({\n composed() {\n const { outline } = this.refs;\n outline.removeAttribute('_if');\n outline.setAttribute('selected', '{selected}');\n },\n })\n .css`\n /* https://m3.material.io/components/radio-button/specs */\n\n :host {\n --disabled-opacity: 0.38;\n --mdw-ink: rgb(var(--mdw-color__primary));\n /* Use CSS Variables to force filter to reapply (Chrome Bug) */\n --color: rgb(var(--mdw-color__on-surface-variant));\n --mdw-shape__size: var(--mdw-shape__full);\n position: relative;\n\n display: inline-block;\n\n block-size: 20px;\n inline-size: 20px;\n\n background-color: transparent;\n\n transition: opacity 200ms;\n }\n\n #outline {\n filter:\n drop-shadow(1px 0px 0px var(--color))\n drop-shadow(0px 1px 0px var(--color))\n drop-shadow(-1px 0px 0px var(--color))\n drop-shadow(0px -1px 0px var(--color))\n ;\n\n color: var(--color);\n\n will-change: filter, color;\n }\n\n #inner-shape {\n position: absolute;\n inset: 0;\n\n transform: scale(0);\n\n background-color: var(--color);\n\n transition: transform 200ms, background-color 100ms;\n }\n\n :host([hovered]) {\n --color: rgb(var(--mdw-color__on-surface));\n }\n\n :host([focused]) {\n --color: rgb(var(--mdw-color__on-surface));\n }\n\n :host([selected]) {\n --color: rgb(var(--mdw-ink));\n }\n\n :host([errored]) {\n --color: rgb(var(--mdw-color__error));\n }\n\n :host([disabled]) {\n --color: rgba(var(--mdw-color__on-surface));\n opacity: var(--disabled-opacity);\n }\n\n #inner-shape[selected] {\n transform: scale(0.5);\n }\n\n `\n .autoRegister('mdw-radio-icon');\n", "// https://www.w3.org/WAI/ARIA/apg/patterns/listbox/\n\nimport './CheckboxIcon.js';\nimport './RadioIcon.js';\nimport './Divider.js';\nimport './Icon.js';\n\nimport CustomElement from '../core/CustomElement.js';\nimport AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\nimport RippleMixin from '../mixins/RippleMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(RippleMixin)\n .mixin(AriaReflectorMixin)\n .extend()\n .set({\n _ariaRole: 'listitem',\n delegatesFocus: false,\n stateLayer: true,\n })\n .observe({\n leading: 'string',\n avatar: 'string',\n avatarColor: { value: 'primary-container' },\n avatarSrc: 'string',\n src: 'string',\n alt: 'string',\n icon: 'string',\n href: 'string',\n iconInk: 'string',\n iconSrc: 'string',\n checkbox: 'string',\n radio: 'string',\n selectionColor: { value: 'primary' },\n selected: 'boolean',\n supporting: 'string',\n trailing: 'string',\n trailingIcon: 'string',\n trailingIconInk: 'string',\n trailingIconSrc: 'string',\n divider: 'boolean',\n video: 'boolean',\n lines: 'integer',\n _supportingSlotted: 'boolean',\n })\n .observe({\n // Alias since not form-associated\n disabledState({ disabled }) {\n return disabled;\n },\n\n })\n .expressions({\n isInteractive({ href }) {\n return href != null;\n },\n hasSupporting() {\n return this.supporting || this._supportingSlotted;\n },\n checkboxClass() {\n return this.checkbox || 'leading';\n },\n radioClass() {\n return this.radio || 'leading';\n },\n })\n .html/* html */`\n <a id=anchor _if={href} href={href} disabled={disabledState} aria-labelledby=content></a>\n <mdw-checkbox-icon id=checkbox _if={checkbox} aria-hidden=true class={checkboxClass} color={selectionColor} disabled={disabledState} icon=check selected={selected}></mdw-checkbox-icon>\n <mdw-radio-icon id=radio _if={radio} aria-hidden=true class={radioClass} disabled={disabledState} ink={selectionColor} selected={selected}></mdw-radio-icon>\n <mdw-box _if={avatar} id=avatar color={avatarColor} type-style=title-medium src={AvatarSrc}\n aria-hidden=true>{avatar}</mdw-box>\n <mdw-icon _if={icon} id=icon ink={iconInk} src={iconSrc} aria-hidden=true>{icon}</mdw-icon>\n <img id=img _if={src} src={src} alt={alt} video={video} />\n <slot name=leading>{leading}</slot>\n <div id=content has-supporting={hasSupporting} lines={lines}>\n <slot id=slot></slot>\n <slot id=supporting name=supporting class=text lines={lines}>{supporting}</slot>\n </div>\n <mdw-icon _if={trailingIcon} id=trailing-icon ink={trailingIconInk} src={trailingIconSrc} aria-hidden=true>{trailingIcon}</mdw-icon>\n <slot id=trailing name=trailing role=note>{trailing}</slot>\n <mdw-divider _if={divider} id=divider divder={divider}></mdw-divider>\n `\n .on({\n composed() {\n const { state, rippleContainer, anchor } = this.refs;\n anchor.append(\n state,\n rippleContainer,\n );\n state.setAttribute('state-disabled', 'focus hover');\n },\n disabledStateChanged(oldValue, newValue) {\n this.updateAriaProperty('ariaDisabled', newValue ? 'true' : 'false');\n },\n })\n .css`\n /* https://m3.material.io/components/lists/specs */\n\n :host {\n --mdw-shape__size: 0px;\n /* Grid does not auto collapse columns, leaving gaps */\n\n display: flex;\n align-items: center;\n gap: 16px;\n\n border: none;\n padding-block: 8px;\n padding-inline: 16px 24px;\n\n cursor: auto;\n\n outline: none;\n\n color: inherit;\n\n text-decoration: none;\n }\n\n :host([href]) {\n cursor: pointer;\n }\n\n #anchor {\n position: absolute;\n inset: 0;\n\n outline: none;\n\n color: inherit;\n\n }\n\n :host([video]) {\n padding-inline-start: 0;\n }\n\n :host([lines=\"3\"]) {\n align-items: flex-start;\n\n padding-block: 12px;\n }\n\n #content {\n display: inline-flex;\n align-items: flex-start;\n flex-direction: column;\n justify-content: center;\n\n flex: 1;\n\n padding-block: calc(8px + (var(--mdw-density) * 2px));\n }\n\n #content:is([has-supporting], [lines=\"2\"]) {\n box-sizing: border-box;\n min-block-size: calc(8px + calc(48px + var(--mdw-density) * 2px));\n padding-block: calc(4px + var(--mdw-density) * 2px);\n }\n\n #content:is([lines=\"3\"]) {\n box-sizing: border-box;\n min-block-size: calc(8px + calc(48px + var(--mdw-density) * 2px));\n padding-block: calc(0 + var(--mdw-density) * 2px);\n }\n\n #icon {\n font-size: 24px;\n }\n\n #trailing-icon {\n font-size: 24px;\n }\n\n #divider {\n position: absolute;\n inset-block-end: 0;\n\n display: block;\n\n color: rgb(var(--mdw-color__surface-variant));\n }\n\n #divider[divider=\"inset\"] {\n padding-inline: 16px 24px;\n }\n\n #slot {\n max-block-size: var(--mdw-typescale__body-large__line-height) * 2;\n\n /* background-color: rgba(255,0,0,0.10); */\n\n color: var(--mdw-color__on-surface);\n\n font: var(--mdw-typescale__body-large__font);\n letter-spacing: var(--mdw-typescale__body-large__letter-spacing);\n }\n\n #supporting {\n max-block-size: calc(var(--mdw-typescale__body-medium__line-height) * 2);\n\n /* background-color: rgba(0,255,0,0.10); */\n\n color: var(--mdw-color__on-surface-variant);\n\n font: var(--mdw-typescale__body-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n\n #trailing {\n color: var(--mdw-color__on-surface-variant);\n\n font: var(--mdw-typescale__body-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n }\n\n #slot, #supporting {\n display: block;\n overflow-x: hidden;\n overflow-y: hidden;\n\n text-align: start;\n text-overflow: ellipsis;\n text-transform: none;\n white-space: normal;\n word-break: break-word;\n }\n\n #supporting[lines=\"2\"] {\n min-block-size: var(--mdw-typescale__body-medium__line-height);\n max-block-size: var(--mdw-typescale__body-medium__line-height);\n }\n\n #supporting[lines=\"3\"] {\n min-block-size: calc(var(--mdw-typescale__body-medium__line-height) * 2);\n max-block-size: calc(var(--mdw-typescale__body-medium__line-height) * 2);\n }\n\n @supports(width: 1lh) {\n #slot {\n max-block-size: 1lh;\n }\n\n #supporting {\n max-block-size: 2lh;\n }\n\n #supporting[lines=\"2\"] {\n min-block-size: 1lh;\n max-block-size: 1lh;\n }\n\n #supporting[lines=\"3\"] {\n min-block-size: 2lh;\n max-block-size: 2lh;\n }\n }\n\n @supports(-webkit-line-clamp:1) {\n #slot {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n }\n\n #supporting {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n }\n\n #supporting[lines=\"2\"] {\n -webkit-line-clamp: 1;\n }\n }\n\n #avatar {\n display: flex;\n align-items: center;\n justify-content: center;\n\n block-size: 40px;\n inline-size: 40px;\n\n border-radius: 50%;\n }\n\n #img {\n block-size: 56px;\n max-block-size: 56px;\n inline-size: 56px;\n max-inline-size: 56px;\n\n object-fit: cover;\n object-position: center center;\n }\n\n #img[video] {\n block-size: 64px;\n max-block-size: 64px;\n inline-size: 114px;\n max-inline-size: 114px;\n }\n\n #checkbox {\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin: 3px;\n }\n\n #radio {\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin: 2px;\n }\n\n .trailing {\n order: 1;\n }\n\n :host([disabled]) {\n opacity: 0.38;\n\n color: rgb(var(--mdw-color__on-surface));\n }\n `\n .childEvents({\n supporting: {\n /** @param {Event & {currentTarget: HTMLSlotElement}} event */\n slotchange({ currentTarget }) {\n this._supportingSlotted = currentTarget.assignedNodes().length !== 0;\n },\n },\n })\n .autoRegister('mdw-list-item');\n", "// https://www.w3.org/WAI/ARIA/apg/patterns/listbox/\n\nimport ListItem from './ListItem.js';\n\n// https://html.spec.whatwg.org/multipage/form-elements.html#htmloptionelement\n\nexport default class ListOption extends ListItem\n .extend()\n .setStatic({\n formAssociated: true,\n })\n .set({\n _ariaRole: 'none',\n delegatesFocus: true,\n _index: -1,\n _selectedDirty: false,\n isInteractive: true,\n })\n .observe({\n // ListOption.prototype._form = ListOption.prop('_form');\n _label: { attr: 'label', nullParser: String },\n defaultSelected: { attr: 'selected', reflect: true, type: 'boolean' },\n _selected: 'boolean',\n _value: { attr: 'value', reflect: true },\n _formDisabled: 'boolean',\n })\n .observe({\n selected: {\n reflect: false,\n type: 'boolean',\n get({ _selectedDirty, defaultSelected, _selected }) {\n if (!_selectedDirty) return defaultSelected;\n return _selected;\n },\n /** @param {boolean} value */\n set(value) {\n this._selectedDirty = true;\n this._selected = value;\n },\n },\n disabledState({ _formDisabled, disabled }) {\n if (_formDisabled) return true;\n return !!disabled;\n },\n })\n .define({\n index() { return this._index; },\n form() { return /** @type {import('./ListSelect.js').default} */ (this.parentElement)?.form; },\n label: {\n get() { return this._label; },\n /** @param {string} value */\n set(value) {\n this._label = value;\n },\n },\n value: {\n get() { return this._value; },\n /** @param {string} value */\n set(value) { this._label = value; },\n },\n })\n .methods({\n /** @param {boolean} formDisabled */\n formDisabledCallback(formDisabled) {\n this._formDisabled = formDisabled;\n },\n /** @type {HTMLElement['focus']} */\n focus(...options) {\n this.refs.anchor.focus(...options);\n },\n })\n .on({\n composed({ inline }) {\n const { anchor, state, content } = this.refs;\n\n // Form Associated elements cannot receive focus unless using delegatesFocus\n // Workaround by redirecting focus to an inner element\n // Reuse HTMLAnchorElement with no HREF\n\n anchor.setAttribute('disabled', '{disabledState}');\n anchor.setAttribute('role', 'option');\n anchor.setAttribute('aria-disabled', inline(({ disabledState }) => `${disabledState}`));\n anchor.setAttribute('tabindex', '0');\n anchor.setAttribute('aria-selected', inline(({ selected }) => `${selected}`));\n anchor.setAttribute('selected', '{selected}');\n anchor.removeAttribute('href');\n anchor.removeAttribute('_if');\n\n content.setAttribute('selected', '{selected}');\n\n state.setAttribute('state-disabled', 'focus');\n },\n })\n .css`\n :host {\n --mdw-bg: var(--mdw-color__secondary-container);\n --mdw-ink: var(--mdw-color__on-secondary-container);\n cursor: pointer;\n \n z-index: 0;\n }\n \n :host([href]) {\n cursor: pointer;\n }\n \n :host([disabled]) {\n cursor: not-allowed;\n pointer-events: none;\n }\n \n #content {\n -webkit-user-select: none;\n user-select: none;\n }\n \n #content[selected] {\n color: rgb(var(--mdw-ink));\n }\n \n #anchor {\n z-index: -1;\n }\n \n #anchor[selected] {\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-ink));\n }\n ` {\n static { this.autoRegister('mdw-list-option'); }\n\n /**\n * @param {string} [text]\n * @param {string} [value]\n * @param {boolean} [defaultSelected]\n * @param {boolean} [selected]\n */\n constructor(text, value, defaultSelected, selected) {\n super();\n if (text !== undefined) {\n this.text = text;\n }\n if (value !== undefined) {\n this._value = value;\n }\n if (defaultSelected !== undefined) {\n this.defaultSelected = defaultSelected;\n }\n if (selected !== undefined) {\n this._selected = selected;\n }\n if (!this.hasAttribute('tabindex')) {\n this.tabIndex = 0;\n }\n }\n}\n", "/**\n * @see https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#htmloptionscollection\n * @template {HTMLOptionElement} T1\n * @template {HTMLOptGroupElement} T2\n * @param {Object} options\n * @param {HTMLElement} options.host\n * @param {HTMLCollectionOf<T1>} options.collection\n * @param {typeof T1} options.OptionConstructor\n * @param {typeof T2} options.GroupConstructor\n * @return {HTMLCollectionOf<T1> & HTMLOptionsCollection}\n */\nexport function constructHTMLOptionsCollectionProxy({ host, collection, OptionConstructor, GroupConstructor }) {\n /**\n * @param {T1} element\n * @param {HTMLElement|number} [before]\n * @return {void}\n */\n // eslint-disable-next-line func-style\n const add = function add(element, before) {\n let beforeElement;\n let index = -1;\n if (typeof before === 'number') {\n if (before >= 0 && before < collection.length - 1) {\n index = before;\n }\n } else if (before instanceof HTMLElement) {\n beforeElement = before;\n }\n if (index !== -1) {\n beforeElement = collection.item(index);\n }\n if (beforeElement) {\n beforeElement.before(element);\n } else {\n host.append(element);\n }\n };\n /**\n * @param {number} index\n * @return {void}\n */\n // eslint-disable-next-line func-style\n const remove = function remove(index) {\n collection.item(index)?.remove();\n };\n\n Object.defineProperty(collection, 'selectedIndex', {\n get() {\n for (let i = 0; i < collection.length; i++) {\n if (collection[i].selected) {\n return i;\n }\n }\n return -1;\n },\n set(value) {\n for (let i = 0; i < collection.length; i++) {\n collection[i].selected = (i === value);\n }\n },\n });\n const newCollection = new Proxy(collection, {\n get(target, p, receiver) {\n switch (p) {\n case 'add':\n return add;\n case 'remove':\n return remove;\n default:\n return target[p];\n }\n },\n set(target, p, newValue, receiver) {\n let index = Number.NaN;\n switch (typeof p) {\n case 'string':\n index = Number.parseInt(p, 10);\n break;\n case 'number':\n index = p;\n break;\n default:\n case 'symbol':\n return Reflect.set(target, p, newValue, receiver);\n }\n if (Number.isNaN(index)) {\n return Reflect.set(target, p, newValue, receiver);\n }\n const currentSize = collection.length;\n while (index > collection.length) {\n add(new OptionConstructor());\n }\n if (index === currentSize) {\n if (newValue != null) {\n add(newValue);\n }\n } else if (index >= 0) {\n remove(index);\n if (newValue !== null) {\n add(newValue, index);\n }\n }\n },\n });\n return newCollection;\n}\n", "import { constructHTMLOptionsCollectionProxy } from '../dom/ HTMLOptionsCollectionProxy.js';\nimport FormAssociatedMixin from '../mixins/FormAssociatedMixin.js';\nimport KeyboardNavMixin from '../mixins/KeyboardNavMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\n\nimport List from './List.js';\nimport ListOption from './ListOption.js';\n\n/** @implements {HTMLSelectElement} */\nexport default class ListSelect extends List\n .mixin(StateMixin)\n .mixin(FormAssociatedMixin)\n .mixin(KeyboardNavMixin) {\n static {\n this.autoRegister('mdw-list-select');\n // eslint-disable-next-line no-unused-expressions\n this.css`\n :host(:disabled) {\n cursor: not-allowed;\n pointer-events: none;\n }\n \n :host([internals-disabled]) {\n cursor: not-allowed;\n pointer-events: none;\n }\n `;\n this.on({\n disabledStateChanged(oldValue, newValue) {\n this._kbdFocusable = !newValue;\n this.tabIndex = newValue ? -1 : 0;\n },\n multipleChanged(oldValue, newValue) {\n this.updateAriaProperty('ariaMultiSelectable', newValue ? 'true' : 'false');\n },\n });\n }\n\n /** @type {HTMLCollectionOf<ListOption> & HTMLOptionsCollection} */\n _optionsCollection = null;\n\n constructor() {\n super();\n if (!this.hasAttribute('tabindex')) {\n this.tabIndex = 0;\n }\n this.refs.slot.addEventListener('slotchange', this.onSlotChange);\n this.addEventListener('keydown', this.onControlKeydown);\n this.addEventListener('click', this.onListSelectClick);\n }\n\n * _selectedOptionsGenerator() {\n for (const el of this.options) {\n if (!el.selected) continue;\n yield el;\n }\n }\n\n /**\n * @param {Event} event\n * @this {HTMLSlotElement}\n * @return {void}\n */\n onSlotChange(event) {\n /** @type {{host:ListSelect}} */ // @ts-ignore Coerce\n const { host } = this.getRootNode();\n host.refreshTabIndexes();\n let index = 0;\n for (const el of host.options) {\n el._index = index++;\n }\n }\n\n /**\n * @param {KeyboardEvent} event\n * @this {ListSelect}\n * @return {void}\n */\n onControlKeydown(event) {\n if (event.key === 'Spacebar' || event.key === ' ') {\n const target = event.target;\n if (!(target instanceof ListOption)) return;\n event.stopPropagation();\n event.preventDefault();\n this.onListSelectClick.call(this, event);\n }\n }\n\n /**\n * @param {MouseEvent|KeyboardEvent} event\n * @this {ListSelect}\n * @return {void}\n */\n onListSelectClick(event) {\n console.log('onListSelectClick');\n const target = event.target;\n if (!(target instanceof ListOption)) return;\n event.stopPropagation();\n if (target.disabledState) return;\n\n // Perform unselect\n if (target.selected) {\n if (this.multiple) {\n const selections = [...this.selectedOptions];\n if (this.required && selections.length === 1) return;\n if (selections.length === 0) {\n console.warn('impossible??');\n }\n target.selected = false;\n let firstSelection = selections.shift();\n if (firstSelection === target) {\n // Get new first selection (or undefined)\n firstSelection = selections.shift();\n }\n this._value = firstSelection?.value ?? '';\n return;\n }\n if (this.required) return;\n target.selected = false;\n this._value = '';\n return;\n }\n\n if (this.multiple) {\n // Skip ctrlKey requirement\n target.selected = true;\n this._value = this.selectedOptions.next().value;\n return;\n }\n\n for (const el of this.options) {\n el.selected = el === target;\n }\n this._value = target.value;\n }\n\n formResetCallback() {\n // TODO: Reset dirty on options\n super.formResetCallback();\n }\n\n get options() {\n if (!this._optionsCollection) {\n this._optionsCollection = constructHTMLOptionsCollectionProxy({\n host: this,\n collection: this.getElementsByTagName(ListOption.elementName),\n OptionConstructor: ListOption,\n GroupConstructor: ListOption,\n });\n }\n return this._optionsCollection;\n }\n\n get selectedOptions() {\n return this._selectedOptionsGenerator();\n }\n\n // @ts-ignore @override\n get type() { return 'select'; }\n\n /** @override */\n get kbdNavQuery() { return ListOption.elementName; }\n\n // @ts-ignore @override\n get length() {\n return this.options.length;\n }\n\n get selectedIndex() {\n return this.options.selectedIndex;\n }\n\n set selectedIndex(value) {\n this.options.selectedIndex = value;\n this._value = (this.options.item(value)?.value) ?? '';\n }\n\n get value() {\n return this._value;\n }\n\n /** @param {string} v */\n set value(v) {\n for (const el of this.options) {\n el.selected = (el.value === v);\n }\n this._value = v;\n }\n\n get add() { return this.options.add; }\n\n get item() { return this.options.item; }\n\n get namedItem() { return this.options.namedItem; }\n\n * [Symbol.iterator]() {\n for (const el of this.options) {\n yield el;\n }\n }\n\n get kbdNavFocusableWhenDisabled() { return true; }\n}\n\n// https://html.spec.whatwg.org/multipage/form-elements.html#htmlselectelement\n\n// [CEReactions] attribute DOMString autocomplete;\n// ListSelect.prototype.disabled = ListSelect.prop('disabled', { type: 'boolean' });\n// readonly attribute HTMLFormElement? form;\nListSelect.prototype.multiple = ListSelect.prop('multiple', { type: 'boolean' });\n// [CEReactions] attribute boolean multiple;\n// [CEReactions] attribute DOMString name;\n// [CEReactions] attribute boolean required;\nListSelect.prototype.size = ListSelect.prop('size', { type: 'integer', empty: 0 });\nListSelect.prototype._ariaRole = 'listbox';\nListSelect.prototype.delegatesFocus = true;\n", "// https://www.w3.org/TR/wai-aria-practices/#menu\n\nimport './Surface.js';\nimport CustomElement from '../core/CustomElement.js';\nimport { attemptFocus } from '../core/dom.js';\nimport DensityMixin from '../mixins/DensityMixin.js';\nimport KeyboardNavMixin from '../mixins/KeyboardNavMixin.js';\nimport { canAnchorPopup } from '../utils/popup.js';\n\n/**\n * @typedef {Object} MenuStack\n * @prop {HTMLElement} element\n * @prop {Element} previousFocus\n * @prop {Object} [state]\n * @prop {Object} [previousState]\n * @prop {MouseEvent|PointerEvent|HTMLElement|Element} [originalEvent]\n * @prop {any} [pendingResizeOperation]\n * @prop {window['history']['scrollRestoration']} [scrollRestoration]\n */\n\nconst supportsHTMLDialogElement = typeof HTMLDialogElement !== 'undefined';\n/** @type {MenuStack[]} */\nconst OPEN_MENUS = [];\n\n/**\n * @return {void}\n */\nfunction onWindowResize() {\n const lastOpenMenu = OPEN_MENUS.at(-1);\n if (!lastOpenMenu || !lastOpenMenu.originalEvent) {\n return;\n }\n if (lastOpenMenu.pendingResizeOperation) {\n cancelAnimationFrame(lastOpenMenu.pendingResizeOperation);\n }\n lastOpenMenu.pendingResizeOperation = requestAnimationFrame(() => {\n lastOpenMenu.element.updateMenuPosition(lastOpenMenu.originalEvent);\n lastOpenMenu.pendingResizeOperation = null;\n });\n}\n\n/**\n * @param {PopStateEvent} event\n */\nfunction onPopState(event) {\n if (!event.state) return;\n const lastOpenMenu = OPEN_MENUS.at(-1);\n if (!lastOpenMenu || !lastOpenMenu.previousState) {\n return;\n }\n if ((lastOpenMenu.previousState === event.state) || Object.keys(event.state)\n .every((key) => event.state[key] === lastOpenMenu.previousState[key])) {\n lastOpenMenu.element.close();\n }\n}\n\n/** @param {BeforeUnloadEvent} event */\nfunction onBeforeUnload(event) {\n if (!OPEN_MENUS.length) return;\n console.warn('Menu was open during page unload (refresh?).');\n}\n\nexport default CustomElement\n .mixin(DensityMixin)\n .mixin(KeyboardNavMixin)\n .extend()\n .observe({\n open: 'boolean',\n flow: {\n type: 'string',\n /** @type {'corner'|'adjacent'|'overflow'|'vcenter'|'hcenter'|'center'} */\n value: null,\n },\n submenu: 'boolean',\n modal: 'boolean',\n _isNativeModal: 'boolean',\n color: { empty: 'surface' },\n ink: 'string',\n elevation: { empty: 2 },\n outlined: 'boolean',\n })\n .set({\n returnValue: '',\n delegatesFocus: true,\n /** @type {WeakRef<HTMLElement>} */\n _cascader: null,\n _closing: false,\n })\n .define({\n kbdNavChildren() {\n const items = [...this.querySelectorAll('mdw-menu-item')];\n // eslint-disable-next-line unicorn/prefer-set-has\n const submenuItems = [...this.querySelectorAll(':scope mdw-menu mdw-menu-item')];\n return items.filter((el) => !submenuItems.includes(el));\n },\n _dialog() {\n return /** @type {HTMLDialogElement} */ (this.refs.dialog);\n },\n cascader: {\n get() {\n return this._cascader?.deref();\n },\n /**\n * @param {HTMLElement} value\n */\n set(value) {\n this._cascader = value ? new WeakRef(value) : null;\n },\n },\n })\n .html/* html */`\n <dialog id=dialog role=menu aria-hidden=${({ open }) => (open ? 'false' : 'true')}>\n <div id=scrim aria-hidden=true modal={modal}></div>\n <form id=form method=dialog role=none>\n <mdw-surface id=surface elevation={elevation} color={color} ink={ink} outlined={outlined}>\n <div id=scroller>\n <slot id=slot on-slotchange={refreshTabIndexes}></slot>\n </div>\n </mdw-surface>\n <slot id=submenu-slot name=submenu></slot>\n </form>\n </dialog>\n `\n .css`\n /* https://m3.material.io/components/menus/specs */\n\n :host {\n --mdw-menu__transform-origin-inline-start: left;\n --mdw-menu__transform-origin-inline-end: right;\n /* Normal */\n --mdw-menu__transform-origin-x: var(--mdw-menu__transform-origin-inline-start);\n /* Down */\n --mdw-menu__transform-origin-y: top;\n --mdw-menu__inline-base: 56px;\n --mdw-menu__size: 2;\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__on-surface);\n position: absolute;\n /* Default position is bottom */\n /* Default direction is start */\n inset-block: 100% auto;\n inset-inline: auto 0;\n\n display: block;\n /* Hide scrollbar */\n -ms-overflow-style: none;\n /* Scroll mask */\n overscroll-behavior: none;\n overscroll-behavior: contain;\n scrollbar-width: none;\n\n pointer-events: none;\n\n transform-origin: var(--mdw-menu__transform-origin-x) var(--mdw-menu__transform-origin-y);\n\n transition-duration: motion.$fadeOutDuration;\n transition-property: none;\n transition-timing-function: motion.$decelerateEasing;\n }\n\n :host(::after) {\n content: '';\n\n display: block;\n\n block-size: 200%;\n inline-size: 200%;\n }\n\n :host(::-webkit-scrollbar) {\n display: none;\n }\n\n dialog {\n position: fixed;\n inset: 0;\n\n box-sizing: border-box;\n block-size:100%;\n max-block-size: none;\n inline-size:100%;\n max-inline-size: none;\n margin: 0;\n border: none;\n padding: 0;\n\n opacity: 0;\n visibility: hidden;\n z-index: 24;\n\n background-color: transparent;\n\n transition: none;\n transition-property: opacity;\n will-change: opacity;\n }\n\n dialog::backdrop {\n /** Use scrim instead */\n display: none;\n }\n\n dialog[aria-hidden=\"false\"],\n dialog:modal {\n display: block;\n\n pointer-events: none;\n\n opacity: 1;\n visibility: visible;\n\n transition-duration: var(--mdw-dialog__fade-in-duration);\n transition-property: opacity;\n transition-timing-function: var(--mdw-dialog__deceleration-easing);\n }\n\n #scrim {\n position: fixed;\n inset: 0;\n\n overflow-y: scroll;\n overscroll-behavior: none;\n overscroll-behavior: contain;\n scrollbar-width: none;\n\n block-size: 100%;\n inline-size: 100%;\n\n cursor: default;\n pointer-events: auto;\n -webkit-tap-highlight-color: transparent;\n\n visibility: hidden; /* Only show if [modal] */\n\n z-index:0;\n }\n\n #form {\n display: contents;\n }\n\n #scrim::-webkit-scrollbar {\n display: none;\n }\n\n #scrim::after {\n content: '';\n\n display: block;\n\n block-size: 200%;\n inline-size: 200%;\n }\n\n #surface {\n --mdw-shape__size: var(--mdw-shape__extra-small);\n position: sticky;\n\n display: inline-flex;\n flex-direction: column;\n\n inline-size: calc(var(--mdw-menu__size) * var(--mdw-menu__inline-base));\n min-inline-size: calc(var(--mdw-menu__inline-base) * 2);\n max-inline-size: 100vw;\n flex:1;\n\n pointer-events: auto;\n /* background-color: rgb(var(--mdw-color__surface)); */\n /* color: rgb(var(--mdw-color__on-surface)); */\n /* stylelint-disable-next-line liberty/use-logical-spec */\n will-change: top, left;\n }\n\n @supports(-moz-appearance: none) {\n #surface {\n position: absolute;\n }\n }\n\n #scroller {\n display: flex;\n align-items: stretch;\n flex-direction: column;\n overflow-y: auto;\n overscroll-behavior: none;\n overscroll-behavior: contain;\n\n flex: 1;\n\n padding-block: 8px;\n }\n\n #scrim[modal] {\n visibility: visible;\n }\n `\n .methods({\n focus() {\n const [firstItem] = this.kbdNavChildren;\n if (!attemptFocus(firstItem)) {\n this.focusNext(firstItem);\n }\n },\n /**\n * @param {DOMRect|Element} [anchor]\n * @return {void}\n */\n updateMenuPosition(anchor) {\n const surface = this.refs.surface;\n surface.style.setProperty('max-height', 'none');\n surface.style.setProperty('width', 'auto');\n const newSize = Math.ceil(surface.clientWidth / 56);\n surface.style.removeProperty('width');\n surface.style.setProperty('--mdw-menu__size', newSize.toString(10));\n\n /** @type {import('../utils/popup.js').CanAnchorPopUpOptions} */\n const anchorOptions = {\n anchor: anchor ?? this.getBoundingClientRect(),\n width: surface.clientWidth,\n height: surface.clientHeight,\n // margin,\n };\n\n const isPageRTL = (getComputedStyle(this).direction === 'rtl');\n const xStart = isPageRTL ? 'right' : 'left';\n const xEnd = isPageRTL ? 'left' : 'right';\n\n /* Automatic Positioning\n *\n * Positions:\n * 3 7 4\n * ┌─────────┐\n * │ │\n * 5 │ 9 │ 6\n * │ │\n * └─────────┘\n * 1 8 2\n *\n * 1: Bottom Left\n * 2: Bottom Right\n * 3: Top Left\n * 4: Top Right\n * 5: VCenter Left\n * 6: VCenter Right\n * 7: HCenter Top\n * 8: HCenter Bottom\n * 9: VCenter HCenter\n *\n * Directions:\n * a - Down LTR\n * b - Down RTL\n * c - Up LTR\n * d - Up RTL\n * e - LTR\n * f - RTL\n * g - Down\n * h - Up\n * i - Center\n *\n *\n * 16 total combos\n * 1a 1b 1c 1d └↘ └↙ └↗ └↖\n * 2a 2b 2c 2d ┘↘ ┘↙ ┘↗ ┘↖\n * 3a 3b 3c 3d ┌↘ ┌↙ ┌↗ ┌↖\n * 4a 4b 4c 4d ┐↘ ┐↙ ┐↗ ┐↖\n *\n * Avoid using opposite angle\n *\n * 1a XX 1c 1d └↘ ██ └↗ └↖\n * XX 2b 2c 2d ██ ┘↙ ┘↗ ┘↖\n * 1a 3b 3c XX ┌↘ ┌↙ ┌↗ ██\n * 4a 4b XX 4d ┐↘ ┐↙ ██ ┐↖\n *\n *\n * Preference Order:\n * - Flow from corner 1a 2b 3c 4d └↘ ┘↙ ┌↗ ┐↖\n * - Open adjacent to target 4a 3b 2c 1d ┐↘ ┌↙ ┘↗ └↖\n * - Overlay target 3a 4b 1c 2d ┌↘ ┐↙ └↗ ┘↖\n * - Open from horizontal side 5e 6f │→ │←\n * - Open from center 9i █·\n */\n\n /** @type {import('../utils/popup.js').CanAnchorPopUpOptions[]} */\n const preferences = [\n (!this.submenu && (this.flow ?? 'corner') === 'corner') ? [\n { clientY: 'bottom', clientX: xStart },\n { clientY: 'bottom', clientX: xEnd },\n { clientY: 'top', clientX: xStart },\n { clientY: 'top', clientX: xEnd },\n ] : [],\n (this.submenu || (this.flow ?? 'adjacent') === 'adjacent') ? [\n { clientY: 'top', clientX: xEnd, directionX: xEnd, directionY: 'down' },\n { clientY: 'top', clientX: xStart, directionX: xStart, directionY: 'down' },\n { clientY: 'bottom', clientX: xEnd, directionX: xEnd, directionY: 'up' },\n { clientY: 'bottom', clientX: xStart, directionX: xStart, directionY: 'up' },\n ] : [],\n (!this.submenu && (this.flow ?? 'overlay') === 'overlay') ? [\n { clientY: 'top', clientX: xStart, directionX: xEnd, directionY: 'down' },\n { clientY: 'top', clientX: xEnd, directionX: xStart, directionY: 'down' },\n { clientY: 'bottom', clientX: xStart, directionX: xEnd, directionY: 'up' },\n { clientY: 'bottom', clientX: xEnd, directionX: xStart, directionY: 'up' },\n ] : [],\n (!this.submenu && (this.flow ?? 'vcenter') === 'vcenter') ? [\n { clientY: 'center', clientX: xEnd, directionX: xEnd, directionY: 'center' },\n { clientY: 'center', clientX: xStart, directionX: xStart, directionY: 'center' },\n ] : [],\n (!this.submenu && (this.flow ?? 'hcenter') === 'hcenter') ? [\n { clientY: 'bottom', clientX: 'center', directionX: 'center', directionY: 'down' },\n { clientY: 'top', clientX: 'center', directionX: 'center', directionY: 'up' },\n ] : [],\n (!this.submenu && (this.flow ?? 'center') === 'center') ? [\n { clientY: 'center', clientX: 'center', directionX: 'center', directionY: 'center' },\n ] : [],\n ].flat();\n\n let anchorResult;\n for (const preference of preferences) {\n anchorResult = canAnchorPopup({\n ...anchorOptions,\n ...preference,\n });\n if (anchorResult) break;\n }\n\n if (!anchorResult) {\n anchorResult = canAnchorPopup({\n ...anchorOptions,\n ...preferences[0],\n force: true,\n });\n }\n\n surface.style.setProperty('inset-block-start', `${anchorResult.pageY}px`);\n surface.style.setProperty('inset-inline-start', `${anchorResult.pageX}px`);\n surface.style.setProperty('margin', '0');\n surface.style.setProperty('transform-origin', `${anchorResult.transformOriginY} ${anchorResult.transformOriginX}`);\n surface.scrollIntoView();\n },\n /**\n * @param {MouseEvent|PointerEvent|HTMLElement|Element} source\n * @return {boolean} handled\n */\n showModal(source) {\n if (this.open) return false;\n this.modal = true;\n if (supportsHTMLDialogElement) {\n this._dialog.showModal();\n this._isNativeModal = true;\n }\n return this.showPopup(source);\n },\n /**\n * @param {MouseEvent|PointerEvent|HTMLElement|Element} source\n * @return {boolean} handled\n */\n showPopup(source) {\n if (this.open) return false;\n this.open = true;\n\n const previousFocus = source instanceof HTMLElement ? source : document.activeElement;\n this.updateMenuPosition(source);\n if (supportsHTMLDialogElement && !this._dialog.open) {\n this._dialog.show();\n }\n\n const newState = { hash: Math.random().toString(36).slice(2, 18) };\n let previousState = null;\n\n if (!window.history.state) {\n // Create new previous state\n window.history.replaceState({\n hash: Math.random().toString(36).slice(2, 18),\n }, document.title);\n }\n previousState = window.history.state;\n const scrollRestoration = window.history.scrollRestoration;\n window.history.scrollRestoration = 'manual';\n window.history.pushState(newState, document.title);\n console.debug('Menu pushed page');\n window.addEventListener('popstate', onPopState);\n window.addEventListener('beforeunload', onBeforeUnload);\n\n window.addEventListener('resize', onWindowResize);\n window.addEventListener('scroll', onWindowResize);\n\n OPEN_MENUS.push({\n element: this,\n previousFocus,\n state: newState,\n previousState,\n originalEvent: source,\n scrollRestoration,\n });\n\n this.focus();\n\n return true;\n },\n /**\n * @param {boolean} returnFocus Return focus to element focused during open\n * @return {boolean} handled\n */\n close(returnFocus = true) {\n if (!this.open) return false;\n if (this._closing) return false;\n this._closing = true;\n this.modal = false;\n if (this._isNativeModal) {\n this._isNativeModal = false;\n } else {\n const main = document.querySelector('main');\n if (main) {\n main.removeAttribute('aria-hidden');\n }\n }\n // if (this.dialogElement.getAttribute('aria-hidden') === 'true') return false;\n if (supportsHTMLDialogElement && this._dialog.open) {\n const previousFocus = document.activeElement;\n // Closing a native dialog will return focus automatically.\n this._dialog.close();\n if (!attemptFocus(previousFocus, { preventScroll: true })) {\n document.activeElement?.blur?.();\n }\n }\n\n // Will invoke observed attribute change: ('aria-hidden', 'true');\n\n this.open = false;\n this.dispatchEvent(new Event('close'));\n\n const len = OPEN_MENUS.length;\n for (let i = len - 1; i >= 0; i--) {\n const entry = OPEN_MENUS[i];\n if (entry.element === this) {\n if (entry.state && window.history && window.history.state && entry.state.hash === window.history.state.hash) {\n window.removeEventListener('popstate', onPopState);\n window.history.back();\n // Back does not set state immediately\n // Needed to track submenu\n // TODO: use window.history.go(indexDelta) instead for Safari (not Wekbit) submenu support\n window.history.replaceState(entry.previousState, document.title);\n window.history.scrollRestoration = entry.scrollRestoration || 'auto';\n window.addEventListener('popstate', onPopState);\n } else {\n console.warn('Menu state mismatch?', entry, window.history.state);\n }\n if (returnFocus) {\n entry.previousFocus?.focus?.({ preventScroll: true });\n }\n OPEN_MENUS.splice(i, 1);\n break;\n } else if (this.contains(entry.element)) {\n console.debug('Closing submenu first');\n entry.element.close(false);\n console.debug('Sub menu closed. Continuing...');\n }\n }\n if (!OPEN_MENUS.length) {\n window.removeEventListener('popstate', onPopState);\n window.removeEventListener('beforeunload', onBeforeUnload);\n window.removeEventListener('resize', onWindowResize);\n console.debug('All menus closed');\n }\n this._closing = false;\n return true;\n },\n /**\n * @param {HTMLElement} cascader Element that calls for submenu cascade\n */\n cascade(cascader) {\n this.cascader = cascader;\n this.showPopup(cascader);\n },\n /**\n * @param {MouseEvent|PointerEvent|HTMLElement|Element} source\n * @return {boolean} handled\n */\n show(source) {\n // Auto-select type based on default platform convention\n // Mac OS X / iPad does not expect clickthrough\n if (navigator.userAgent.includes('Mac OS X')) {\n return this.showModal(source);\n }\n return this.showPopup(source);\n },\n })\n .events({\n '~click'(event) {\n if (this !== event.target) return;\n // Clicked self (scrim-like)\n event.stopPropagation();\n this.close(true);\n },\n keydown(event) {\n if (!this.open) return;\n\n switch (event.key) {\n case 'Tab':\n // Hide menu allowing focus to revert to calling element\n // If close is successfully, focus will return to spawning element\n // and browser will then tab from spawning to next.\n // If close is not successful, stop event.\n if (!this.close()) {\n event.stopPropagation();\n event.preventDefault();\n }\n break;\n // Unless menu hiding is cancelled\n case 'ArrowLeft':\n case 'ArrowRight':\n if (!this.submenu) break;\n if (getComputedStyle(this).direction === 'rtl') {\n if (event.key === 'ArrowLeft') break;\n } else if (event.key === 'ArrowRight') break;\n // Fallthrough;\n case 'Escape':\n case 'Esc':\n event.stopPropagation();\n event.preventDefault();\n this.close(true);\n break;\n default:\n }\n },\n focusout(event) {\n if (!this.open) return;\n if (this.modal) return;\n // Wait until end of event loop cycle to see if focus really is lost\n queueMicrotask(() => {\n if (this.matches(':focus-within')) return;\n const activeElement = document.activeElement;\n if (activeElement\n && (this.cascader === activeElement || this.contains(activeElement))) {\n return;\n }\n this.close(false);\n });\n },\n })\n .autoRegister('mdw-menu');\n", "// https://www.w3.org/TR/wai-aria-practices/#menu\n\nimport FormAssociatedMixin from '../mixins/FormAssociatedMixin.js';\n\nimport './Icon.js';\nimport ListOption from './ListOption.js';\n\nexport default class MenuItem extends ListOption\n .mixin(FormAssociatedMixin)\n .extend()\n .set({\n _cascadeTimeout: null,\n CASCADE_TIMEOUT: 500,\n _cascading: false,\n })\n .define({\n type() {\n if (this.radio != null) return 'radio';\n if (this.checkbox != null) return 'checkbox';\n return null;\n },\n })\n .observe({\n /** ID of menu to cascade */\n cascades: 'string',\n /** Can be null */\n _defaultValue: {\n attr: 'value',\n reflect: true,\n nullParser: String,\n empty: null,\n },\n })\n .observe({\n /** Never returns null */\n defaultValue: {\n reflect: false,\n get() {\n return this._defaultValue ?? '';\n },\n /** @param {string} value */\n set(value) {\n this._defaultValue = value;\n },\n },\n value: {\n reflect: false,\n get() {\n return this._defaultValue ?? 'on';\n },\n /**\n * @param {string} value\n * @return {void}\n */\n set(value) {\n this._defaultValue = value;\n },\n },\n })\n .overrides({\n formIPCEvent(event) {\n if (event.target instanceof HTMLFormElement && event.target !== this.form) {\n console.warn('Control.formIPCEvent: Abort from wrong form');\n return;\n }\n if (this.type !== 'radio') {\n console.warn('Control.formIPCEvent: Abort from not radio');\n return;\n }\n const [name, value] = event.detail;\n if (this.name !== name) return;\n if (value === this.value) return;\n if (this.value === '1') {\n console.log('unchecking', this.name, this.value);\n this.selected = false;\n } else {\n this.selected = false;\n }\n },\n })\n .expressions({\n computeTrailingIcon({ trailingIcon, cascades }) {\n if (!trailingIcon && cascades) return 'arrow_right';\n return trailingIcon;\n },\n })\n .methods({\n unscheduleCascade() {\n clearTimeout(this._cascadeTimeout);\n this._cascadeTimeout = null;\n },\n scheduleCascade() {\n if (this._cascadeTimeout) return;\n this._cascadeTimeout = setTimeout(this.cascade.bind(this), this.CASCADE_TIMEOUT);\n },\n cascade() {\n this.unscheduleCascade();\n this._cascading = true;\n document.getElementById(this.cascades)?.cascade?.(this);\n this._cascading = false;\n },\n })\n .on({\n _selectedChanged(oldValue, newValue) {\n console.log('_selectedChanged', oldValue, newValue);\n if (newValue) {\n this.elementInternals.setFormValue(this.value);\n if (this.type === 'radio') {\n this._notifyRadioChange(this.name, this.value);\n }\n } else {\n this.elementInternals.setFormValue(null);\n }\n if (this._selectedDirty) {\n this.dispatchEvent(new Event('change', { bubbles: true }));\n }\n },\n })\n .events({\n mouseenter() {\n if (this.disabledState) return;\n if (document.activeElement !== this) {\n this.focus();\n }\n if (!this.cascades) return;\n this.scheduleCascade();\n },\n mouseout: 'unscheduleCascade',\n '~click'() {\n if (this.disabledState) return;\n if (this.type === 'radio') {\n if (this.required) return;\n this.selected = true;\n } else if (this.type === 'checkbox') {\n if (this.required) return;\n this.selected = !this.selected;\n return;\n }\n\n if (this.cascades) {\n this.cascade();\n }\n },\n keydown(event) {\n if (this.disabledState) return;\n switch (event.key) {\n case 'Enter':\n case ' ':\n event.stopPropagation();\n event.preventDefault();\n this.click();\n break;\n case 'ArrowLeft':\n case 'ArrowRight':\n if (!this.cascades) break;\n if (getComputedStyle(this).direction === 'rtl') {\n if (event.key === 'ArrowRight') break;\n } else if (event.key === 'ArrowLeft') break;\n event.stopPropagation();\n event.preventDefault();\n this.cascade();\n break;\n default:\n }\n },\n /**\n * Closes submenu if focus leaves cascader to something else (sibling menu item)\n * RelatedTarget is unreliable on Webkit\n */\n blur() {\n if (!this.cascades) return;\n if (this._cascading) return;\n const submenuElement = document.getElementById(this.cascades);\n if (submenuElement.matches(':focus-within')) return;\n console.debug('closing submenu via cascader blur');\n submenuElement.close(false);\n },\n })\n .on({\n composed({ inline, html }) {\n const { checkbox: checkboxRef, radio: radioRef, anchor, trailing, trailingIcon } = this.refs;\n checkboxRef.remove();\n radioRef.remove();\n\n anchor.setAttribute('role', inline(({ checkbox, radio }) => {\n if (checkbox != null) return 'menuitemcheckbox';\n if (radio != null) return 'menuitemradio';\n return 'menuitem';\n }));\n\n // MenuItems use checked instead of selected as in list items.\n anchor.setAttribute('ariaChecked', anchor.getAttribute('aria-selected'));\n\n anchor.after(html`\n <mdw-icon id=selection\n _if=${({ checkbox, radio }) => checkbox ?? radio ?? false}\n class=${({ checkbox, radio }) => checkbox || radio || 'leading'}\n selected={selected}>check</mdw-icon>\n `);\n\n trailing.setAttribute('type-style', 'label-large');\n\n trailingIcon.setAttribute('_if', '{computeTrailingIcon}');\n trailingIcon.textContent = '{computeTrailingIcon}';\n },\n })\n .css`\n /* https://m3.material.io/components/menus/specs */\n\n :host {\n gap: 12px;\n\n padding-inline: 12px;\n\n cursor: pointer;\n\n white-space: nowrap;\n }\n\n #content {\n padding-block: calc(4px + (var(--mdw-density) * 2px))\n }\n\n #icon {\n transition-duration: 100ms;\n transition-property: opacity;\n will-change: opacity;\n }\n\n #trailing,\n #icon {\n color: rgb(var(--mdw-color__on-surface-variant));\n }\n\n #selection {\n opacity: 0;\n\n font-size: 18px;\n }\n\n #selection.trailing {\n font-size: 24px;\n }\n\n #selection[selected] {\n opacity: 1;\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n }\n\n #anchor[selected] {\n background-color: transparent;\n color: inherit;\n }\n\n #content[selected] {\n color: inherit;\n }\n `\n .autoRegister('mdw-menu-item')\n .tsClassFix() {\n formResetCallback() {\n this._selected = this.defaultSelected;\n super.formResetCallback();\n }\n}\n", "const IDLE_TIMEOUT_MS = 500;\n\n/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function ScrollListenerMixin(Base) {\n return Base\n .extend()\n .observe({\n scrollListenerPositionX: { type: 'float', empty: 0, reflect: false },\n scrollListenerPositionY: { type: 'float', empty: 0, reflect: false },\n })\n .set({\n /** @type {WeakRef<EventTarget>} */\n _scroller: null,\n /** @type {EventListener} */\n _scrollerScrollListener: null,\n /** @type {EventListener} */\n _scrollerResizeListener: null,\n _scrollDebounce: null,\n })\n .methods({\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onScrollIdle() {},\n\n /** @param {Event} event */\n onScrollerScroll(event) {\n this.scrollListenerPositionY = (event.currentTarget === window)\n ? window.scrollY\n : /** @type {HTMLElement} */ (event.currentTarget).scrollTop;\n\n this.scrollListenerPositionX = (event.currentTarget === window)\n ? window.scrollX\n : /** @type {HTMLElement} */ (event.currentTarget).scrollLeft;\n\n clearTimeout(this._scrollDebounce);\n this._scrollDebounce = setTimeout(() => this.onScrollIdle(), IDLE_TIMEOUT_MS);\n },\n\n /** @param {Event} event */\n onScrollerResize(event) {},\n\n /**\n * @param {EventTarget} [scroller]\n * @return {boolean}\n */\n startScrollListener(scroller) {\n scroller ??= this.offsetParent;\n if (!scroller) return false;\n\n if (scroller === document.body) {\n // console.log('scroller is body, attaching to window');\n scroller = window;\n }\n\n this._scroller = new WeakRef(scroller);\n this._scrollerScrollListener = this.onScrollerScroll.bind(this);\n this._scrollerResizeListener = this.onScrollerResize.bind(this);\n scroller.addEventListener('scroll', this._scrollerScrollListener);\n scroller.addEventListener('resize', this._scrollerResizeListener);\n this.scrollListenerPositionX = 0;\n this.scrollListenerPositionY = 0;\n return true;\n },\n\n getScrollingElementScrollHeight() {\n const element = this.getScroller();\n if (element === window) {\n return document.documentElement.scrollHeight;\n }\n // @ts-expect-error Skip Element cast\n return element.scrollHeight;\n },\n\n getScrollingElementClientHeight() {\n const element = this.getScroller();\n if (element === window) {\n return window.innerHeight;\n }\n // @ts-expect-error Skip Element cast\n return element.clientHeight;\n },\n\n getScroller() {\n return this._scroller.deref();\n },\n\n /**\n * @param {EventTarget} [scroller]\n * @return {boolean}\n */\n clearScrollListener(scroller) {\n scroller ??= this._scroller?.deref();\n if (!scroller) return false;\n if (!this._scrollerScrollListener) return false;\n scroller.removeEventListener('scroll', this._scrollerScrollListener);\n return true;\n },\n });\n}\n", "import './Icon.js';\nimport './Ripple.js';\nimport './Badge.js';\n\nimport CustomElement from '../core/CustomElement.js';\nimport RippleMixin from '../mixins/RippleMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n/** @typedef {'charset'|'coords'|'name'|'shape'} DeprecatedHTMLAnchorElementProperties */\n\nexport default class NavItem extends CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(RippleMixin)\n .mixin(ShapeMixin)\n .extend()\n .set({\n delegatesFocus: true,\n stateLayer: true,\n })\n .observe({\n showLabel: 'string',\n active: 'boolean',\n icon: 'string',\n src: 'string',\n href: 'string',\n badge: 'string',\n ariaLabel: 'string', // watch attribute and emit callback\n })\n .methods({\n focus(options) {\n this.refs.anchor.focus(options);\n },\n })\n .html/* html */`\n <mdw-icon id=icon aria-hidden=true src={src} active={active}>{icon}</mdw-icon>\n <a id=anchor\n aria-current=${({ active }) => (active ? 'page' : null)}\n aria-describedby=badge\n aria-label={ariaLabel}\n aria-labelledby=${({ ariaLabel }) => (ariaLabel ? null : 'slot')}\n href=${({ href }) => href ?? '#'}>\n </a>\n <slot id=slot active={active} show-label={showLabel} aria-hidden=true></slot>\n <mdw-badge part=badge id=badge badge={badge} show-label={showLabel} aria-hidden=true>{badge}</mdw-badge>\n `\n .on({\n composed({ html }) {\n const { shape, state, rippleContainer } = this.refs;\n shape.append(html`\n <mdw-ripple id=ripple ripple-origin=center keep-alive hold-ripple ripple-state=${({ active }) => ((active) ? null : 'complete')}></mdw-ripple>\n ${state}\n ${rippleContainer}\n `);\n shape.setAttribute('active', '{active}');\n shape.removeAttribute('color');\n },\n })\n .css`\n /* https://m3.material.io/components/navigation-bar/specs */\n /* https://m3.material.io/components/navigation-drawer/specs */\n /* https://m3.material.io/components/navigation-rail/specs */\n\n :host {\n --mdw-badge__scale: 0;\n --mdw-shape__size: var(--mdw-shape__full);\n --mdw-nav-item__offset-y: 0;\n position: relative;\n\n display: grid;\n align-content: center;\n align-items: center;\n grid-auto-flow: row;\n grid-auto-rows: minmax(20px, min-content);\n grid-template-rows: [icon] minmax(32px, 1fr);\n grid-template-columns: [icon] minmax(56px, 1fr);\n\n justify-items: center;\n row-gap: 4px;\n\n box-sizing: border-box;\n min-block-size: 56px;\n\n padding-inline: 0;\n\n cursor: pointer;\n /* stylelint-disable-next-line plugin/no-unsupported-browser-features */\n user-select: none;\n\n font: var(--mdw-typescale__label-large__font);\n letter-spacing: var(--mdw-typescale__label-large__letter-spacing);\n\n text-align: center;\n }\n\n :host(:not([color])) {\n --mdw-ink: var(--mdw-color__on-secondary-container);\n --mdw-bg: var(--mdw-color__secondary-container);\n }\n\n :host([color]) {\n background-color: transparent;\n color: rgb(var(--mdw-color__on-surface-variant));\n }\n\n #slot {\n display: contents;\n align-items: center;\n flex-direction: column;\n grid-area: label;\n justify-content: center;\n\n grid-column: 1 /4;\n\n grid-row: 2;\n\n flex: 1;\n\n cursor: inherit;\n outline: none;\n\n transform: translateY(var(--mdw-nav-item__offset-y));\n\n color: rgb(var(--mdw-color__on-surface-variant));\n\n transition: opacity, color, transform 200ms;\n will-change: opacity, transform;\n }\n\n #anchor {\n position: absolute;\n inset: 0;\n }\n\n #shape {\n position: absolute;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n top: 50%;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: 50%;\n\n block-size: 100%;\n inline-size: 100%;\n max-inline-size: 56px;\n\n grid-column: icon;\n grid-row: 1 / 1;\n\n transform: translateX(-50%) translateY(-50%) translateY(var(--mdw-nav-item__offset-y));\n z-index: 0;\n\n background-color: transparent;\n\n transition: transform 200ms;\n will-change: transform;\n }\n\n #icon {\n position: relative;\n align-self: center;\n\n grid-area: icon;\n\n transform: translateY(var(--mdw-nav-item__offset-y));\n z-index: 3;\n\n color: rgb(var(--mdw-color__on-surface-variant));\n\n font-size: 24px;\n font-variation-settings: 'FILL' 0;\n\n transition: transform 200ms;\n will-change: transform;\n }\n\n #state {\n z-index: 2;\n }\n\n #badge {\n --mdw-badge__scale: 0;\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 50%;\n\n overflow: hidden;\n\n max-inline-size: 50%;\n grid-column: 1 / 4;\n\n grid-row: 1 / 2;\n\n transform: translateY(-100%) translateY(var(--mdw-nav-item__offset-y)) scale(var(--mdw-badge__scale));\n z-index: 4;\n\n text-align: start;\n text-overflow: ellipsis;\n text-transform: none;\n white-space: nowrap;\n word-break: normal;\n\n transition: transform 200ms;\n will-change: transform;\n }\n\n #badge[badge] {\n --mdw-badge__scale: 1;\n }\n\n #ripple {\n opacity: 1;\n\n color: rgb(var(--mdw-bg));\n }\n\n #ripple-container {\n z-index:1;\n }\n\n #shape[active] {\n color: rgb(var(--mdw-ink));\n }\n\n #icon[active] {\n color: rgb(var(--mdw-ink));\n\n font-variation-settings: 'FILL' 1;\n }\n\n #slot[active] {\n color: inherit;\n }\n\n :host([show-label]) {\n --mdw-nav-item__offset-y: 12px;\n }\n\n :host([show-label=\"active\"][active]) {\n --mdw-nav-item__offset-y: 0;\n }\n `\n .childEvents({\n anchor: {\n click() {\n /* Prevent Default (false) if no href */\n return this.href != null;\n },\n keydown({ key, repeat }) {\n if (key !== ' ') return true;\n if (!repeat) this.click();\n return false;\n },\n },\n })\n .autoRegister('mdw-nav-item')\n .tsClassFix() {\n addRipple(...args) {\n if (!this.active) return null;\n return super.addRipple(...args);\n }\n}\n", "import NavItem from './NavItem.js';\nimport Surface from './Surface.js';\n\nexport default Surface\n .extend()\n .css`\n /* https://m3.material.io/components/navigation-bar/specs */\n /* https://m3.material.io/components/navigation-drawer/specs */\n /* https://m3.material.io/components/navigation-rail/specs */\n\n :host {\n --mdw-surface__tint: var(--mdw-surface__tint__2);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__2);\n --mdw-ink: var(--mdw-color__on-surface);\n --mdw-bg: var(--mdw-color__surface);\n\n z-index:2;\n\n color: rgb(var(--mdw-ink));\n\n font: var(--mdw-typescale__label-medium__font);\n letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);\n }\n `\n .set({\n elevated: true,\n color: 'surface',\n })\n .events({\n '~click'(event) {\n // Abort if not child\n if (event.target === this) return;\n if (event.target instanceof NavItem === false) return;\n for (const el of this.querySelectorAll('*')) {\n if (el instanceof NavItem === false) continue;\n el.active = (el === event.target);\n }\n },\n })\n .autoRegister('mdw-nav');\n", "import { ELEMENT_STYLER_TYPE } from '../core/customTypes.js';\nimport ScrollListenerMixin from '../mixins/ScrollListenerMixin.js';\n\nimport Nav from './Nav.js';\n\nexport default Nav\n .mixin(ScrollListenerMixin)\n .observe({\n hideOnScroll: 'boolean',\n _translateY: { type: 'float', empty: 0 },\n _transition: { empty: 'none' },\n })\n .observe({\n _positioningStyle: {\n ...ELEMENT_STYLER_TYPE,\n get({ _translateY, _transition }) {\n return {\n styles: {\n transform: `translateY(${_translateY}px)`,\n transition: _transition,\n },\n };\n },\n },\n })\n .methods({\n onScrollerResize() {\n console.log('onScrollerResize');\n // Chrome Bug: When window resizes bottom sticky needs to be recomputed\n // Force style recalculation\n this.style.setProperty('bottom', 'auto');\n // eslint-disable-next-line no-unused-expressions\n this.clientHeight;\n this.style.removeProperty('bottom');\n this.propChangedCallback('scrollListenerPositionY', this.scrollListenerPositionY, this.scrollListenerPositionY);\n },\n onScrollIdle() {\n const max = this.scrollHeight;\n const visibility = (max - this._translateY) / max;\n if (visibility <= 0) return;\n if (visibility >= 1) return;\n if (visibility >= 0.5) {\n // Reveal all\n this._translateY = 0;\n this._transition = 'transform 250ms ease-in';\n } else {\n this._translateY = max;\n this._transition = 'transform 200ms ease-out';\n }\n },\n })\n .css`\n /* https://m3.material.io/components/navigation-bar/specs */\n\n :host {\n position: sticky;\n inset-block-end: 0;\n order:1; /* Nav Bars are at top of tab order, but bottom of page */\n\n display: grid;\n align-content: flex-start;\n align-items: flex-start;\n gap: 8px;\n grid-auto-columns: minmax(48px, 1fr);\n grid-auto-flow: column;\n\n overflow: hidden; /* Don't expand viewport when contents translates */\n\n box-sizing: border-box;\n min-block-size: 80px;\n inline-size: 100%;\n\n flex-shrink: 0;\n\n transform: translateY(0);\n\n box-shadow: none;\n\n text-align: center;\n\n will-change: transform;\n }\n\n #slot {\n pointer-events: auto;\n }\n\n `\n .on({\n connected() {\n if (this.hideOnScroll) {\n if (this.offsetParent) {\n this.startScrollListener(this.offsetParent ?? window);\n } else {\n const resizeObserver = new ResizeObserver(() => {\n this.startScrollListener(this.offsetParent ?? window);\n resizeObserver.disconnect();\n });\n resizeObserver.observe(this);\n }\n }\n },\n disconnected() {\n this.clearScrollListener();\n },\n scrollListenerPositionYChanged(oldValue, newValue) {\n if (!this.hideOnScroll) return;\n const delta = newValue - oldValue;\n const rate = 1;\n const shift = rate * delta;\n\n const bottom = this.getScrollingElementScrollHeight() - this.getScrollingElementClientHeight();\n const breakpoint = bottom - this.scrollHeight;\n let max = this.scrollHeight;\n if (newValue >= breakpoint) {\n // Scrolling to bottom always shows Nav Bar (ensures content isn't occluded)\n max -= (newValue - breakpoint);\n }\n this._transition = 'none';\n this._translateY = Math.max(0, Math.min(this._translateY + shift, max));\n },\n })\n .autoRegister('mdw-nav-bar');\n", "import NavItem from './NavItem.js';\n\nexport default NavItem\n .extend()\n .css`\n /* https://m3.material.io/components/navigation-bar/specs */\n /* https://m3.material.io/components/navigation-drawer/specs */\n /* https://m3.material.io/components/navigation-rail/specs */\n\n :host {\n grid-auto-rows: minmax(20px, min-content);\n grid-template-rows: [icon] minmax(32px, 1fr);\n grid-template-columns: auto [icon] minmax(56px, 1fr) auto;\n\n padding-block: 12px; /* Spec 16px bottom is based on 1em not 1lh */\n }\n\n #slot {\n display: block;\n }\n\n :host(:empty) {\n font-size: 0;\n line-height: 0;\n }\n\n #slot[show-label] {\n grid-column: 1 /4;\n\n grid-row: 2;\n\n opacity: 0;\n }\n\n #shape {\n grid-column: 2;\n grid-row: 1 / 1;\n }\n\n #slot[show-label=\"never\"] {\n block-size: 0;\n }\n\n #slot[show-label=\"active\"][active] {\n opacity: 1;\n }\n\n `\n .autoRegister('mdw-nav-bar-item');\n", "import Nav from './Nav.js';\n\nexport default Nav\n .extend()\n .observe({\n align: { value: /** @type {'start'|'center'|'end'} */ (null) },\n })\n .on({\n composed({ html }) {\n const { slot } = this.refs;\n slot.before(html`<slot id=start name=start></slot>`);\n slot.setAttribute('align', '{align}');\n },\n })\n .css`\n /* https://m3.material.io/components/navigation-rail/specs */\n\n :host{\n display: grid;\n align-content: flex-start;\n flex-direction: column;\n grid-template-rows: auto minmax(0,1fr);\n grid-template-columns: 80px;\n justify-items: stretch;\n\n text-align: center;\n }\n\n #start {\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: 12px;\n\n padding-block-start: 12px;\n\n }\n\n #slot {\n align-self: center;\n\n display: flex;\n align-items: stretch;\n flex-direction: column;\n gap: 12px;\n overflow-x: clip;\n overflow-y: auto;\n\n box-sizing: border-box;\n\n inline-size: 100%;\n\n padding-block: 12px;\n }\n\n #slot[align=\"start\"] {\n align-self: flex-start;\n }\n\n #slot[align=\"end\"] {\n align-self: flex-end;\n }\n\n `\n .autoRegister('mdw-nav-rail');\n", "import NavRail from './NavRail.js';\n\nexport default NavRail\n .extend()\n .observe({\n shapeEnd: {\n type: 'boolean',\n empty: true,\n },\n })\n .css`\n /* https://m3.material.io/components/navigation-drawer/specs */\n\n :host([open]) {\n --mdw-surface__tint: var(--mdw-surface__tint__0);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__1);\n --mdw-shape__size: var(--mdw-shape__large, 16px);\n --mdw-shape__size__top-start-size: 0px;\n --mdw-shape__size__bottom-start-size: 0px;\n\n --mdw-nav-item__badge__position: static;\n --mdw-nav-item__badge__transform: none;\n --mdw-nav-item__badge__grid-area: badge;\n --mdw-nav-item__label__padding-block: 18px;\n --mdw-nav-item__label__padding-inline: 52px 0;\n --mdw-nav-item__anchor__display: block;\n --mdw-nav-item__indicator__grid-area: auto;\n\n display: block;\n grid-template-rows: min-content;\n grid-template-columns: minmax(360px, min-content);\n\n min-inline-size: 360px;\n padding-inline: 12px;\n\n box-shadow: none;\n\n }\n\n #slot {\n gap: 0;\n }\n\n `\n .autoRegister('mdw-nav-drawer');\n", "import NavItem from './NavItem.js';\n\nexport default NavItem\n .extend()\n .css`\n /* https://m3.material.io/components/navigation-bar/specs */\n /* https://m3.material.io/components/navigation-drawer/specs */\n /* https://m3.material.io/components/navigation-rail/specs */\n\n :host {\n align-self: stretch;\n\n display: grid;\n display: flex;\n align-items: center;\n gap: 12px;\n grid-template:\n \"icon label badge\" minmax(56px, min-content)\n / 24px 1fr minmax(0, min-content);\n justify-items: flex-start;\n\n padding-inline: 16px 24px;\n }\n\n #icon {\n grid-area: icon;\n }\n\n #slot {\n display: block;\n\n text-align: start;\n }\n\n :host([active]) {\n color: rgb(var(--mdw-ink));\n }\n\n #shape {\n max-inline-size: none;\n grid-column: auto;\n grid-row: 1 / 2;\n }\n\n #badge-text {\n z-index: 1;\n }\n `\n .on({\n composed({ html }) {\n this.refs.badge.replaceWith(html`<span id=\"badge-text\">{badge}</span>`);\n },\n })\n .autoRegister('mdw-nav-drawer-item');\n", "/* https://m3.material.io/components/navigation-rail/specs */\n\nimport NavItem from './NavItem.js';\n\nexport default NavItem\n .extend()\n .css`\n :host {\n grid-auto-flow: row;\n grid-auto-rows: minmax(20px, min-content);\n grid-template-rows: [icon] minmax(32px, 1fr);\n grid-template-columns: [icon] minmax(56px, 1fr);\n\n padding-inline: 12px;\n }\n\n #slot {\n display: contents;\n overflow-wrap: anywhere;\n\n word-break: break-all;\n word-break: break-word;\n }\n\n #badge {\n max-inline-size:40px;\n grid-column: 1 / 2;\n }\n `\n .autoRegister('mdw-nav-rail-item');\n", "import CustomElement from '../core/CustomElement.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .extend()\n .observe({\n columns: 'integer',\n flexible: 'boolean',\n fixed: 'boolean',\n split: 'boolean',\n navDrawer: 'boolean',\n navRail: 'boolean',\n })\n .html/* html */`\n <slot id=slot></slot>\n `\n .css`\n /* https://m2.material.io/design/layout/responsive-layout-grid.html#columns-gutters-and-margins */\n /*\n * Window breakpoints\n * Compact (0 <= width < 600px):\n * * Single: 100vw - padding\n * * Padding: 16px\n * * Spacer: 0 (none)\n * Medium (600px <= width < 840px)\n * * Single: 100vw - padding - (?navrail)\n * * [Fixed]: 360px\n * * [Flexable]: 100vw - 360px - spacer - padding\n * * [Split] 50vw - ((padding + spacer) / 2)\n * * Padding: 24px\n * * Spacer: 24px\n * Expanded (840px <= width)\n * * Single: 100vw - padding - (?navrail | ?navdrawer)\n * * [Fixed] 360px\n * * [Flexable] 100vw - 360px - spacer - padding - (?navrail | ?navdrawer)\n * * [Split] 50vw - ((padding + spacer + (?navrail | ?navdrawer)) / 2)\n * * Padding: 24px\n * * Spacer: 24px\n *\n * | Screen size | Margin | Body | Layout columns |\n * |---------------------|---------|---------|----------------|\n * | Extra-small (phone) | | | |\n * | 0-631dp | 16dp | Scaling | 4 |\n * | 632 - 647 | Scaling | 600dp | 8 |\n * | Small (tablet) | | | |\n * | 648-887 | 24dp | Scaling | 8 |\n * | 888-1239 | Scaling | 840dp | 12 |\n * | Medium (laptop) | | | |\n * | 1240-1439 | 200dp | Scaling | 12 |\n * | Large (desktop) | | | |\n * | 1440+ | Scaling | 1040 | 12 |\n *\n *\n * Column count is pane-based, not window based requiring newly computed values.\n * Gutters are irrelevant to pane sizing.\n * Nav Rail is ~80px.\n * Nav Drawer is ~360px.\n * Padding and spacers are set by pane's parent.\n * Avoid using CSS Variables because panes are at top of document tree. https://bugs.chromium.org/p/chromium/issues/detail?id=1056209\n * Container queries would reduce code considerably.\n */\n\n /* Compact */\n :host {\n display: grid;\n align-content: flex-start;\n gap: 16px;\n grid-auto-flow: row;\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n\n flex: 1;\n\n transition-duration: 200ms;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n transition-property: visibility, width, max-inline-size;\n }\n\n /* Will set 8col when window is 600px + padding (2x16) */\n /* Will set 12col when window is 840px + padding (2x24) */\n @media screen and (min-width: 632px) { :host { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 888px) { :host { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) */\n @media screen and (min-width: 648px) { :host { max-inline-size: 840px } }\n @media screen and (min-width: 1240px) { :host { max-inline-size: 1040px; } }\n\n /* NAVRAIL */\n\n :host([nav-rail]) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + navrail (80) */\n /* Will set 12col when window is 840px + padding (2x24) + navrail (80) */\n @media screen and (min-width: 728px) { :host([nav-rail]) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 968px) { :host([nav-rail]) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + navrail (80) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + navrail (80) */\n @media screen and (min-width: 728px) { :host([nav-rail]) { max-inline-size: 840px } }\n @media screen and (min-width: 1320px) { :host([nav-rail]) { max-inline-size: 1040px; } }\n\n /* NAVDRAWER */\n\n :host([nav-drawer]) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + navdrawer (360) */\n /* Will set 12col when window is 840px + padding (2x24) + navdrawer (360) */\n @media screen and (min-width: 1008px) { :host([nav-rail]) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 1248px) { :host([nav-rail]) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + navrail (360) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + navrail (360) */\n @media screen and (min-width: 1008px) { :host([nav-rail]) { max-inline-size: 840px } }\n @media screen and (min-width: 1600px) { :host([nav-rail]) { max-inline-size: 1040px; } }\n\n /* FLEXIBLE */\n\n :host([flexible]) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + fixed (360) */\n /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + fixed (360) */\n @media screen and (min-width: 1032px) { :host([flexible]) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 1272px) { :host([flexible]) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + fixed (360) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + fixed (360) */\n @media screen and (min-width: 1032px) { :host([flexible]) { max-inline-size: 840px } }\n @media screen and (min-width: 1624px) { :host([flexible]) { max-inline-size: 1040px; } }\n\n /* FLEXIBLE + NAV RAIL */\n\n :host([flexible]:where([nav-rail])) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + fixed (360) + navrail (80) */\n /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + fixed (360) + navrail (80) */\n @media screen and (min-width: 1112px) { :host([flexible]:where([nav-rail])) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 1352px) { :host([flexible]:where([nav-rail])) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + fixed (360) + navrail (80) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + fixed (360) + navrail (80) */\n @media screen and (min-width: 1112px) { :host([flexible]:where([nav-rail])) { max-inline-size: 840px } }\n @media screen and (min-width: 1704px) { :host([flexible]:where([nav-rail])) { max-inline-size: 1040px; } }\n\n /* FLEXIBLE + NAV DRAWER */\n\n :host([flexible]:where([nav-drawer])) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + fixed (360) + navdrawer (360) */\n /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + fixed (360) + navdrawer (360) */\n @media screen and (min-width: 1392px) { :host([flexible]:where([nav-drawer])) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 1632px) { :host([flexible]:where([nav-drawer])) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + fixed (360) + navdrawer (360) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + fixed (360) + navdrawer (360) */\n @media screen and (min-width: 1392px) { :host([flexible]:where([nav-drawer])) { max-inline-size: 840px } }\n @media screen and (min-width: 1984px) { :host([flexible]:where([nav-drawer])) { max-inline-size: 1040px; } }\n\n /* SPLIT */\n\n :host([split]) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + split (600) */\n /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + split (840) */\n @media screen and (min-width: 1272px) { :host([split]) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 1752px) { :host([split]) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + split (600) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + split (840) */\n @media screen and (min-width: 1272px) { :host([split]) { max-inline-size: 840px } }\n @media screen and (min-width: 2104px) { :host([split]) { max-inline-size: 1040px; } }\n\n /* SPLIT + NAVRAIL */\n\n :host([split]:where([nav-rail])) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + split (600) + navrail (80) */\n /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + split (840) + navrail (80) */\n @media screen and (min-width: 1352px) { :host([split]:where([nav-rail])) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 1832px) { :host([split]:where([nav-rail])) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + split (600) + navrail (80) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + split (840) + navrail (80) */\n @media screen and (min-width: 1352px) { :host([split]:where([nav-rail])) { max-inline-size: 840px } }\n @media screen and (min-width: 2184px) { :host([split]:where([nav-rail])) { max-inline-size: 1040px; } }\n\n /* SPLIT + NAVDRAWER */\n\n :host([split]:where([nav-drawer])) {\n grid-template-columns: repeat(4, 1fr);\n\n max-inline-size: 600px;\n }\n\n /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + split (600) + navdrawer (360) */\n /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + split (840) + navdrawer (360) */\n @media screen and (min-width: 1632px) { :host([split]:where([nav-drawer])) { grid-template-columns: repeat(8, 1fr); } }\n @media screen and (min-width: 2112px) { :host([split]:where([nav-drawer])) { grid-template-columns: repeat(12, 1fr); } }\n\n /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + split (600) + navdrawer (360) */\n /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + split (840) + navdrawer (360) */\n @media screen and (min-width: 1632px) { :host([split]:where([nav-drawer])) { max-inline-size: 840px } }\n @media screen and (min-width: 2464px) { :host([split]:where([nav-drawer])) { max-inline-size: 1040px; } }\n\n :host([full-width]) {\n max-inline-size: none;\n }\n\n /** FIXED **/\n\n :host([fixed]) {\n grid-template-columns: repeat(4, 1fr);\n\n inline-size:360px;\n }\n\n @media screen and (max-width: 600px) {\n :host(:nth-of-type(2)) {\n display: none;\n }\n }\n /* Will cap to 360px when window is 360px + padding (2x24px) + spacer (24) + 360px */\n @media screen and (min-width: 792px) {\n :host([fixed]) {\n max-inline-size: 360px\n }\n }\n\n #scrim {\n position: absolute;\n inset: 0;\n\n grid-area: auto;\n }\n\n #slot::slotted(*) { grid-column: 1 / none }\n #slot::slotted([colspan=\"1\"]) { grid-column-end: span 1; }\n #slot::slotted([colspan=\"2\"]) { grid-column-end: span 2; }\n #slot::slotted([colspan=\"3\"]) { grid-column-end: span 3; }\n #slot::slotted([colspan=\"4\"]) { grid-column-end: span 4; }\n #slot::slotted([colspan=\"5\"]) { grid-column-end: span 5; }\n #slot::slotted([colspan=\"6\"]) { grid-column-end: span 6; }\n #slot::slotted([colspan=\"7\"]) { grid-column-end: span 7; }\n #slot::slotted([colspan=\"8\"]) { grid-column-end: span 8; }\n #slot::slotted([colspan=\"9\"]) { grid-column-end: span 9; }\n #slot::slotted([colspan=\"10\"]) { grid-column-end: span 10; }\n #slot::slotted([colspan=\"11\"]) { grid-column-end: span 11; }\n #slot::slotted([colspan=\"12\"]) { grid-column-end: span 12; }\n\n `\n .autoRegister('mdw-pane');\n", "/* https://m3.material.io/components/progress-indicators/specs */\n\nimport CustomElement from '../core/CustomElement.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n// https://html.spec.whatwg.org/multipage/form-elements.html#the-progress-element\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .extend()\n .observe({\n circle: 'boolean',\n value: 'float',\n max: 'float',\n autoHide: 'boolean',\n _determinateStyle: 'string',\n })\n .observe({\n _valueAsFraction: {\n type: 'float',\n get({ value, max }) {\n return (value / (max || 100));\n },\n changedCallback(oldValue, newValue) {\n this._determinateStyle = `\n --previous:${oldValue ?? newValue ?? 0};\n --value:${newValue ?? 0};\n `;\n },\n },\n })\n .define({\n position() {\n return /** @type {HTMLProgressElement} */ (this.refs.progress).position;\n },\n labels() {\n return /** @type {HTMLProgressElement} */ (this.refs.progress).labels;\n },\n })\n .html/* html */`\n <div id=determinate style=\"{_determinateStyle}\">\n <progress id=progress value={value} max={max} circle={circle}></progress>\n <div _if={circle} id=circle>\n <div id=semi1 class=semi></div>\n <div id=semi2 class=semi></div>\n </div>\n </div>\n <div _if={!value} id=indeterminate>\n <div _if={!circle} id=indeterminate-line>\n <div id=line1 class=line value={value}></div>\n <div id=line2 class=line value={value}></div>\n </div>\n <div _if={circle} id=indeterminate-circle>\n <div id=arc2 class=arc></div>\n <div id=arc3 class=arc></div>\n <div id=arc4 class=arc></div>\n </div>\n </div>\n `\n .css`\n /* Base Styles */\n\n :host {\n --mdw-bg: var(--mdw-color__surface-variant);\n --mdw-ink: var(--mdw-color__primary);\n --mdw-progress__opacity__duration: 500ms;\n position: relative;\n\n display: inline-block;\n overflow: hidden;\n vertical-align: middle;\n\n min-block-size: 4px;\n inline-size: 100%;\n\n opacity: 1;\n\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-ink));\n\n transition: opacity 500ms 275ms;\n }\n\n :host([auto-hide]) {\n will-change: opacity;\n }\n\n :host([auto-hide][value=\"100\"]) {\n opacity:0;\n\n transition: opacity 1s 1s;\n }\n\n #determinate {\n --previous: 0;\n --value: 0;\n }\n\n #progress {\n position: absolute;\n inset: 0;\n\n box-sizing: border-box;\n block-size: 100%;\n inline-size: 100%;\n border: none; /* FireFox */\n\n -moz-appearance: none;\n appearance: none;\n\n opacity:0;\n transform: scaleX(var(--value, 0));\n transform-origin: 0 0;\n\n background-color: currentColor;\n color: inherit;\n\n transition: transform 275ms, opacity var(--mdw-progress__opacity__duration);\n will-change: transform, opacity;\n }\n\n #progress::-webkit-progress-bar {\n display: none;\n }\n\n #progress::-moz-progress-bar {\n display: none; /* Doesn't always work */\n\n block-size: 0;\n }\n\n #progress[value] {\n opacity:1;\n transform: scaleX(var(--value, 0));\n }\n `\n .css`\n /* Line Styles */\n\n /* https://github.com/material-components/material-components-android/blob/ed77ab36ccac98df24e55060d58406c5981a9062/lib/java/com/google/android/material/progressindicator/ */\n\n :host {\n --mdw-progress__line1-head__timing: cubic-bezier(0.2, 0.8, 0, 1.0);\n --mdw-progress__line1-tail__timing: cubic-bezier(0.4, 0.0, 1.0, 1.0);\n --mdw-progress__line2-head__timing: cubic-bezier(0.0, 0.65, 0, 1.0);\n --mdw-progress__line2-tail__timing: cubic-bezier(0.1, 0.45, 0, 1.0);\n --mdw-progress__line__duration: 1800ms;\n }\n\n @media (prefers-reduced-motion) {\n :host {\n --mdw-progress__line__duration: 18000ms\n }\n }\n\n .line {\n opacity: 1;\n\n transition: opacity var(--mdw-progress__opacity__duration);\n will-change: opacity;\n }\n\n .line,\n .line::after {\n position: absolute;\n inset: 0;\n\n overflow: hidden;\n\n animation-duration: var(--mdw-progress__line__duration);\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n animation-fill-mode: forwards;\n }\n\n .line::after {\n content: '';\n\n background-color: currentColor;\n\n animation: inherit;\n will-change: transform;\n }\n\n #line1 {\n animation-name: l1h;\n }\n\n #line2 {\n animation-name: l2h;\n }\n\n #line1::after {\n animation-name: l1t;\n }\n\n #line2::after {\n animation-name: l2t;\n }\n\n .line[value] {\n opacity: 0;\n visibility: hidden;\n\n transition: opacity var(--mdw-progress__opacity__duration), visibility 1ms var(--mdw-progress__opacity__duration);\n }\n\n /**\n * L1H = 1267 / +533 = 70.39% - 100%\n * L1T = 1000 / +567 = 55.56% - 87.05%\n * L2H = 0333 / +850 = 18.50% - 65.72%\n * L2T = 0000 / +750 = 0% - 41.67%\n * Total = 1800ms\n *\n * t l1h l1t l2h l2t\n * --------------------------------------\n * 0.0000 0.0000 0.0000 0.0000 0.0000\n * 0.1850 0.0000 0.0000 0.0000 0.5899\n * 0.4167 0.0000 0.0000 0.7374 1.0000\n * 0.5556 0.0000 0.0000 0.9072 1.0000\n * 0.6572 0.0000 0.1544 1.0000 1.0000\n * 0.7039 0.0000 0.2939 1.0000 1.0000\n * 0.8706 0.7918 1.0000 1.0000 1.0000\n * 1.0000 1.0000 1.0000 1.0000 1.0000\n */\n\n @keyframes l1h {\n 0% {\n transform: translateX(0%);\n }\n\n 70.4% {\n transform: translateX(0%);\n\n animation-timing-function: var(--mdw-progress__line1-head__timing);\n }\n\n 100% {\n transform: translateX(100%);\n }\n }\n @keyframes l1t {\n 0% {\n transform: translateX(-100%);\n }\n\n 55.6% {\n transform: translateX(-100%);\n\n animation-timing-function: var(--mdw-progress__line1-tail__timing);\n }\n\n 87.1% {\n transform: translateX(0%);\n }\n\n 100% {\n transform: translateX(0%);\n }\n }\n @keyframes l2h {\n 0% {\n transform: translateX(0%);\n }\n\n 18.5% {\n transform: translateX(0%);\n\n animation-timing-function: var(--mdw-progress__line2-head__timing);\n }\n\n 65.72% {\n transform: translateX(100%);\n }\n\n to {\n transform: translateX(100%);\n }\n }\n @keyframes l2t {\n 0% {\n transform: translateX(-100%);\n\n animation-timing-function: var(--mdw-progress__line2-tail__timing);\n }\n\n 41.67% {\n transform: translateX(0%);\n }\n\n to {\n transform: translateX(0%);\n }\n }\n\n `\n .css`\n /* Circle Styles */\n /** https://github.com/material-components/material-components-android/blob/ed77ab36ccac98df24e55060d58406c5981a9062/lib/java/com/google/android/material/progressindicator/CircularIndeterminateAnimatorDelegate.java */\n\n :host {\n --mdw-progress__circle__timing: cubic-bezier(0.4, 0.0, 0.2, 1);\n --mdw-progress__circle__margin: 4px;\n --mdw-progress__circle__duration: 5400ms;\n --mdw-progress__circle__duration__expand: 667ms;\n --mdw-progress__circle__duration__collapse: 667ms;\n --mdw-progress__circle__duration__fade-in: 333ms;\n --mdw-progress__circle__duration__complete-end: 333ms;\n }\n\n @media (prefers-reduced-motion) {\n :host {\n --mdw-progress__circle__duration: 54000ms;\n }\n }\n\n #circle {\n --startA: min(0.5, var(--previous));\n --endA: min(0.5, var(--value));\n --travelA: max(\n calc(var(--startA) - var(--endA)),\n calc(var(--endA) - var(--startA))\n );\n --delayA: max(0, calc(var(--previous) - 0.5));\n --startB: max(0, calc(var(--previous) - 0.5));\n --endB: max(0, calc(var(--value) - 0.5));\n --travelB: max(\n calc(var(--startB) - var(--endB)),\n calc(var(--endB) - var(--startB))\n );\n --delayB: max(0, 0.5 - calc(var(--previous)));\n\n position: absolute;\n inset: 0;\n }\n\n :host([circle]) {\n block-size: 48px;\n inline-size: 48px;\n }\n\n :host([circle]:not([color])) {\n background-color: transparent;\n }\n\n #progress[circle] {\n visibility: hidden;\n }\n\n .semi {\n position: absolute;\n inset: var(--mdw-progress__circle__margin);\n\n overflow: hidden;\n\n box-sizing: border-box;\n }\n\n #semi1 {\n inset-inline-start: 50%;\n }\n\n #semi2 {\n inset-inline-end: 50%;\n }\n\n .semi::after {\n content: \"\";\n\n position: absolute;\n inset: 0;\n\n box-sizing: border-box;\n border: solid currentcolor 4px;\n\n transform: rotate(var(--rotation));\n\n background-color: transparent;\n border-radius: 50%;\n\n transition: transform 400ms;\n transition-timing-function: linear;\n }\n\n #semi1::after {\n --rotation: min(180deg, calc(var(--value) * 360deg));\n inset-inline-start: -100%;\n\n clip-path: inset(0 50% 0 0);\n\n transition-delay: calc(var(--delayA) * var(--mdw-progress__circle__duration__expand));\n transition-duration: calc(var(--travelA) * var(--mdw-progress__circle__duration__expand));\n }\n\n #semi2::after {\n --rotation: max(0deg, calc(var(--value) * 360deg - 180deg));\n inset-inline-end: -100%;\n\n clip-path: inset(0 0 0 50%);\n\n transition-delay: calc(var(--delayB) * var(--mdw-progress__circle__duration__expand));\n transition-duration: calc(var(--travelB) * var(--mdw-progress__circle__duration__expand));\n }\n\n #indeterminate-circle {\n position: absolute;\n inset: 0;\n\n display: block;\n\n animation: rotate-cw calc(var(--mdw-progress__circle__duration) / 4) linear infinite;\n }\n\n .arc {\n position: absolute;\n inset: var(--mdw-progress__circle__margin);\n\n overflow: hidden;\n\n box-sizing: border-box;\n\n animation: rotate-jump var(--mdw-progress__circle__duration) steps(1,end) infinite;\n }\n\n .arc::after {\n content: \"\";\n\n position: absolute;\n inset: 0;\n\n box-sizing: border-box;\n border: solid currentcolor 4px;\n\n background-color: transparent;\n border-radius: 50%;\n\n animation: grow-shrink calc(var(--mdw-progress__circle__duration) / 4) var(--mdw-progress__circle__timing) infinite;\n }\n\n #arc2 {\n inset-block-end: 50%;\n inset-inline-start: 50%;\n\n transform-origin: 0 100%;\n }\n\n #arc3 {\n inset-block-start: 50%;\n inset-inline-end: 50%;\n\n transform-origin: 100% 0;\n }\n\n #arc4 {\n inset-block-start: 50%;\n inset-inline-start: 50%;\n\n transform-origin: 0 0;\n }\n\n #arc2:after {\n inset-block-end: -100%;\n inset-inline-start: -100%;\n\n clip-path: polygon(0% 0%, 50% 0%, 50% 50%, 100% 50%, 100% 100%, 0% 100%);\n }\n\n #arc3:after {\n inset-block-start: -100%;\n inset-inline-end: -100%;\n\n clip-path: inset(0 50% 50% 0);\n }\n\n #arc4:after {\n inset-block-start: -100%;\n inset-inline-start: -100%;\n\n clip-path: inset(0 50% 0 0);\n }\n\n @keyframes rotate-cw {\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n }\n\n @keyframes rotate-jump {\n 0% { transform: scaleX(1) rotate(0deg); }\n\n 12.5% { transform: scaleX(-1) rotate(-270deg); }\n\n 25% { transform: scaleX(1) rotate(270deg); }\n\n 37.5% {transform: scaleX(-1) rotate(-180deg);}\n\n 50% { transform: scaleX(1) rotate(180deg); }\n\n 62.5% { transform: scaleX(-1) rotate(-90deg); }\n\n 75% { transform: scaleX(1) rotate(90deg); }\n\n 87.5% { transform: scaleX(-1) rotate(0deg); }\n\n to { transform: scaleX(1) rotate(0deg); }\n }\n\n @keyframes grow-shrink {\n from {\n transform: rotate(calc(0.01 * 360deg));\n }\n\n 50% {\n transform: rotate(calc(0.73 * 360deg));\n }\n\n to {\n transform: rotate(calc(0.01 * 360deg));\n }\n }\n `\n .autoRegister('mdw-progress');\n", "import './RadioIcon.js';\n\nimport CustomElement from '../core/CustomElement.js';\nimport InputMixin from '../mixins/InputMixin.js';\nimport RippleMixin from '../mixins/RippleMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\nimport TouchTargetMixin from '../mixins/TouchTargetMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(RippleMixin)\n .mixin(InputMixin)\n .mixin(TouchTargetMixin)\n .extend()\n .set({\n type: 'radio',\n stateLayer: true,\n })\n .on({\n composed({ html }) {\n const { label, rippleContainer, state, control, touchTarget } = this.refs;\n label.append(html`\n ${touchTarget}\n ${control}\n <div id=radio errored={erroredState} selected={checked}>\n <mdw-radio-icon id=icon errored={erroredState} disabled={disabledState}\n selected={checked} focused={focusedState} hovered={hoveredState}></mdw-radio-icon>\n ${state}\n ${rippleContainer}\n </div>\n <slot id=slot></slot>\n `);\n\n control.setAttribute('type', 'radio');\n },\n })\n .css`\n /* https://m3.material.io/components/radio/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__primary);\n --mdw-shape__size: var(--mdw-shape__full);\n display: inline-grid;\n align-items: baseline;\n gap: 12px;\n grid-auto-flow: column;\n grid-template-rows: minmax(20px, auto);\n grid-template-columns: 20px;\n justify-content: flex-start;\n\n cursor: pointer;\n\n transition: none 100ms cubic-bezier(0.4, 0.0, 1, 1);\n }\n\n :host(:empty) {\n vertical-align: -11.5%;\n\n line-height: 20px;\n }\n\n :host(:empty) #radio {\n transform: none;\n }\n\n #control {\n grid-column: 1/1;\n\n cursor: inherit;\n }\n\n #label {\n cursor: inherit;\n }\n\n #label[disabled] {\n cursor: not-allowed;\n }\n\n #state {\n pointer-events: auto;\n }\n\n #state,\n #ripple-container {\n inset-block-start: 50%;\n inset-inline-start: 50%;\n\n block-size: 40px;\n inline-size: 40px;\n\n transform: translateX(-50%) translateY(-50%);\n\n border-radius: 50%;\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n\n opacity: 0.38;\n }\n\n #radio {\n position: relative;\n\n display: inline-flex;\n\n grid-column: 1 / 1;\n\n pointer-events: none;\n\n transform: translateY(11.5%);\n\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #radio[selected] {\n color: rgb(var(--mdw-ink));\n }\n\n #radio[disabled] {\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #radio[errored] {\n color: rgb(var(--mdw-color__error));\n }\n\n #icon {\n --mdw-ink: inherit;\n --disabled-opacity: 1;\n }\n `\n .autoRegister('mdw-radio');\n", "import './Icon.js';\n\nimport Button from './Button.js';\n\nexport default Button\n .extend()\n .observe({\n type: { empty: 'radio' },\n innerSegmentedButton: 'boolean',\n })\n .set({\n focusableOnDisabled: true,\n })\n .on({\n composed({ html, inline }) {\n const { shape, icon, outline, control, slot, state } = this.refs;\n\n slot.before(html`\n <div id=icons>\n ${icon}\n <mdw-icon selected={checked} id=check-icon aria-hidden=true>check</mdw-icon>\n </div>\n `);\n shape.setAttribute('selected', '{checked}');\n\n icon.removeAttribute('_if');\n icon.setAttribute('has-icon', '{hasIcon}');\n icon.setAttribute('selected', '{checked}');\n outline.setAttribute('inner-segmented-button', '{innerSegmentedButton}');\n outline.setAttribute('shape-start', '{shapeStart}');\n outline.setAttribute('shape-end', '{shapeEnd}');\n control.setAttribute('type', 'radio');\n control.setAttribute('role', 'option');\n control.setAttribute('aria-checked', inline(\n ({ type, checked }) => (type === 'checkbox' ? `${(!!checked)}` : null),\n ));\n control.setAttribute('aria-selected', inline(\n ({ type, checked }) => (type === 'checkbox' ? null : `${!!checked}`),\n ));\n\n state.setAttribute('state-disabled', 'focus');\n },\n constructed() {\n this.outlined = true;\n },\n })\n .css`\n /* https://m3.material.io/components/segmented-buttons/specs */\n\n :host {\n --mdw-shape__size: var(--mdw-shape__full);\n --mdw-ink: var(--mdw-color__on-surface);\n gap: 8px;\n\n min-inline-size: 24px;\n padding-inline-start: max(12px, calc(16px + (var(--mdw-density) * 2px)));\n padding-inline-end: max(20px, calc(24px + (var(--mdw-density) * 2px)));\n\n color: rgb(var(--mdw-ink));\n }\n\n :host([inner-segmented-button]) {\n --mdw-shape__size: 0px;\n }\n\n #outline {\n inset-inline-end: -1px;\n }\n\n #outline[shape-end] {\n inset-inline-end: 0;\n }\n\n #shape[selected] {\n background-color: rgb(var(--mdw-bg));\n }\n\n #label[selected] {\n color: rgb(var(--mdw-ink));\n }\n\n #icons {\n position: relative;\n\n display: inline-flex;\n }\n\n #icon {\n box-sizing: border-box;\n inline-size: 0;\n\n opacity: 1;\n }\n\n #icon[has-icon] {\n inline-size: 18px;\n\n opacity: 1;\n }\n\n #icon[selected] {\n inline-size: 18px;\n\n opacity: 0;\n }\n\n #check-icon {\n position: absolute;\n inset: 0;\n\n display: block;\n\n overflow: visible;\n\n margin: 0;\n\n opacity: 0;\n\n font-size: 18px;\n font-variation-settings: 'FILL' 1;\n }\n\n #check-icon[selected] {\n opacity: 1;\n\n font-size: 18px;\n }\n\n #icon[disabled] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n #shape[disabled][selected] {\n background-color: rgba(var(--mdw-color__on-surface), 0.12);\n }\n\n #label[disabled][selected] {\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n `\n .autoRegister('mdw-segmented-button');\n", "import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\nimport KeyboardNav from '../mixins/KeyboardNavMixin.js';\n\nimport Box from './Box.js';\nimport SegmentedButton from './SegmentedButton.js';\n\n/** @typedef {'compact'} DeprecatedHTMLMenuElementProperties */\n\nexport default Box\n .mixin(KeyboardNav)\n .mixin(AriaReflectorMixin)\n .extend()\n .define({\n kbdNavQuery() {\n return SegmentedButton.elementName;\n },\n })\n .set({\n _ariaRole: 'listbox',\n })\n .childEvents({\n slot: {\n slotchange() {\n this.refreshTabIndexes();\n // eslint-disable-next-line github/array-foreach\n this.kbdNavChildren.forEach((child, index, list) => {\n /** @type {InstanceType<SegmentedButton>} */\n (child).shapeStart = index === 0;\n /** @type {InstanceType<SegmentedButton>} */\n (child).innerSegmentedButton = index > 0 && index < list.length - 1;\n /** @type {InstanceType<SegmentedButton>} */\n (child).shapeEnd = index === list.length - 1;\n });\n },\n },\n })\n .css`\n /* https://m3.material.io/components/segmented-buttons/specs */\n\n :host {\n --mdw-bg: var(--mdw-color__secondary-container);\n --mdw-ink: var(--mdw-color__on-secondary-container);\n\n display: inline-flex;\n }\n\n :host([color]) {\n background-color: transparent;\n }\n\n `\n .on({\n constructed() {\n this.setAttribute('aria-orientation', 'horizontal');\n },\n })\n .autoRegister('mdw-segmented-button-group');\n", "import CustomElement from '../core/CustomElement.js';\nimport ControlMixin from '../mixins/ControlMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport TextFieldMixin from '../mixins/TextFieldMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n\n/* @implements {HTMLSelectElement} */\n\nexport default class Select extends CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(ControlMixin)\n .mixin(TextFieldMixin)\n .extend()\n .observe({\n autocomplete: 'string',\n trailingIcon: {\n empty: 'arrow_drop_down',\n },\n })\n .define({\n _select() {\n return /** @type {HTMLSelectElement} */ (this.refs.control);\n },\n /** Readonly values */\n multiple: { value: false },\n size: { value: 1 },\n type: { value: 'select-one' },\n })\n .html/* html */`<slot id=slot></slot>`\n .childEvents({\n slot: {\n /** @param {Event & {currentTarget:HTMLSlotElement}} event */\n slotchange(event) {\n const select = this._select;\n select.replaceChildren(\n ...event.currentTarget.assignedNodes()\n .map((child) => child.cloneNode(true)),\n );\n this._value = select.value;\n },\n },\n })\n .on({\n composed({ template }) {\n const { slot, prefix, suffix, control } = this.refs;\n control.setAttribute('icon', '{icon}');\n template.append(slot);\n prefix.remove();\n suffix.remove();\n },\n })\n .css`\n #slot {\n display: none;\n }\n \n #label {\n padding: 0;\n \n cursor: pointer;\n }\n \n #label[disabled] {\n cursor: not-allowed;\n }\n \n #icon {\n position: absolute;\n \n /* padding-inline-start: 12px; */\n }\n \n #trailing-icon {\n position: absolute;\n inset-inline-end: 16px;\n }\n \n #control {\n padding-inline-start: 16px;\n padding-inline-end: calc(16px + 24px + 16px);\n accent-color: rgb(var(--mdw-ink));\n \n cursor: inherit;\n }\n \n #control[icon] {\n margin-inline-start: calc(16px + 24px);\n padding-inline-start: 0;\n }\n \n option {\n accent-color: rgb(var(--mdw-ink));\n \n min-block-size: var(--mdw-typescale__label-large__line-height);\n \n appearance: none;\n \n background-color: rgb(var(--mdw-color__surface)) !important;\n border-radius: 0;\n color: rgb(var(--mdw-color__on-surface)) !important;\n \n font: var(--mdw-typescale__label-large__font);\n letter-spacing: var(--mdw-typescale__label-large__letter-spacing);\n }\n `\n .setStatic({\n controlTagName: 'select',\n controlVoidElement: false,\n })\n .autoRegister('mdw-select') {\n /* Overrides */\n static clonedContentAttributes = [\n ...super.clonedContentAttributes,\n 'autocomplete', // Hint for form autofill feature\n ];\n\n formResetCallback() {\n this._select.value = this.querySelector('option[selected]')?.value ?? '';\n super.formResetCallback();\n }\n}\n", "import CustomElement from '../core/CustomElement.js';\nimport InputMixin from '../mixins/InputMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n/**\n * @param {string} value\n * @param {number} onNaN\n * @return {number}\n */\nfunction parseFloat(value, onNaN = 0) {\n const number = Number.parseFloat(value);\n if (Number.isNaN(number)) return onNaN;\n return number;\n}\n\n/**\n * @param {string} value\n * @param {string} min\n * @param {string} max\n * @return {?number}\n */\nfunction valueAsFraction(value, min, max) {\n const nValue = parseFloat(value);\n const nMin = parseFloat(min);\n const nMax = parseFloat(max, 100);\n\n return (nValue - nMin) / (nMax - nMin);\n}\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(InputMixin)\n .extend()\n .set({\n stateLayer: true,\n type: 'range',\n })\n .observe({\n ticks: 'string',\n showLabel: { type: 'boolean', reflect: false },\n _previewValue: { nullable: false },\n _roundedValue: 'float',\n _isHoveringThumb: 'boolean',\n })\n .methods({\n /**\n * @param {(MouseEvent|TouchEvent) & {currentTarget:HTMLInputElement}} event\n * @return {void}\n */\n onControlMouseOrTouch(event) {\n const input = event.currentTarget;\n if (input.disabled) return;\n\n if (this.disabledState) return;\n\n if (event.type === 'touchend') {\n this._isHoveringThumb = false;\n return;\n }\n\n let offsetX;\n let clientX;\n let pageX;\n let isActive;\n\n const isTouch = 'touches' in event;\n if (isTouch) {\n if (event.touches.length) {\n const [touch] = event.touches;\n isActive = true;\n // @ts-ignore Might exist\n ({ offsetX, clientX, pageX } = touch);\n }\n } else {\n // Ignore mouse drag-over\n // Firefox doesn't report `:active`\n // eslint-disable-next-line no-bitwise\n isActive = (event.buttons & 1) === 1\n && (event.type === 'mousedown' || input.matches(':active'));\n ({ offsetX, clientX, pageX } = event);\n }\n\n if (offsetX == null) {\n clientX ??= pageX - window.scrollX; // Safari\n offsetX = clientX - input.getBoundingClientRect().left;\n }\n\n const { clientWidth } = input;\n let position = (offsetX / clientWidth);\n if (position > 1) {\n position = 1;\n } else if (position < 0) {\n position = 0;\n }\n\n if (isActive) {\n this._isHoveringThumb = true;\n const { min, max, step } = this;\n\n const nMin = parseFloat(min);\n const nMax = parseFloat(max, 100);\n const nStep = parseFloat(step, 1);\n\n const currentValue = position * (nMax - nMin) + nMin;\n let roundedValue = Math.round(currentValue / nStep) * nStep;\n\n if (nStep < 1) {\n // Floating Point Numbers need to be rounded off based on step\n // eg: 3.4 / 10 with step of 0.1 yields 0.33999999999999997\n const log10 = Math.floor(Math.log10(nStep)); // e value in scientific notation\n const scale = 10 ** (-1 * log10); // multiplier to scale up to integer\n roundedValue = Math.round(roundedValue * scale) / scale;\n }\n\n this._roundedValue = roundedValue;\n this._previewValue = roundedValue.toString(10);\n return;\n }\n\n if (isTouch) return;\n\n const fractionalValue = valueAsFraction(this.value, this.min, this.max);\n const thumbOffset = fractionalValue * clientWidth;\n const thumbMin = thumbOffset - 20;\n const thumbMax = thumbOffset + 20;\n this._isHoveringThumb = offsetX >= thumbMin && offsetX <= thumbMax;\n },\n\n /** @param {Event} event */\n onLeaveEvent({ currentTarget }) {\n if (document.activeElement === currentTarget) return;\n this._isHoveringThumb = false;\n },\n\n /**\n * @param {(MouseEvent|TouchEvent) & {currentTarget:HTMLInputElement}} event\n * @return {void}\n */\n onControlFinish(event) {\n const input = event.currentTarget;\n if (input.disabled) return;\n event.preventDefault();\n input.valueAsNumber = this._roundedValue;\n if (this._value !== input.value) {\n this._value = input.value;\n input.dispatchEvent(new Event('change', { bubbles: true }));\n }\n },\n })\n .events({\n blur: 'onLeaveEvent',\n mouseout: 'onLeaveEvent',\n })\n .childEvents({\n control: {\n '~mousedown': 'onControlMouseOrTouch',\n '~mousemove': 'onControlMouseOrTouch',\n '~mouseout': 'onControlMouseOrTouch',\n '~touchmove': 'onControlMouseOrTouch',\n '~touchstart': 'onControlMouseOrTouch',\n // @ts-expect-error Old spec\n '~touchleave': 'onControlMouseOrTouch',\n '~touchcancel': 'onControlMouseOrTouch',\n '~touchend': 'onControlMouseOrTouch',\n touchend: 'onControlFinish',\n click: 'onControlFinish',\n },\n })\n .expressions({\n computeTrackStyle({ ticks, _previewValue, min, max }) {\n return [\n ticks ? `--ticks:${ticks}` : null,\n `--value:${valueAsFraction(_previewValue, min, max)}`,\n ].filter(Boolean).join(';') || null;\n },\n })\n .on({\n composed({ template, html }) {\n const { state, label, control } = this.refs;\n template.append(html`\n <div id=track style={computeTrackStyle} aria-hidden=true disabled={disabledState}>\n <div _if={ticks} id=ticks></div>\n <div id=track-active></div>\n <div id=thumb-anchor>\n <div id=thumb>\n ${state}\n </div>\n <div id=thumb-label\n hidden=${({ _isHoveringThumb, focusedState }) => (!_isHoveringThumb && !focusedState)} \n text={_previewValue}></div>\n </div>\n </div>\n `);\n label.removeAttribute('aria-labelledby');\n control.setAttribute('type', 'range');\n },\n valueChanged(oldValue, newValue) {\n this._previewValue = newValue;\n },\n })\n .css`\n /* https://m3.material.io/components/sliders/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-bg: var(--mdw-color__primary);\n\n display: inline-block;\n vertical-align: middle;\n\n min-block-size: 40px;\n min-inline-size: 88px;\n\n background-color: transparent;\n }\n\n :host,\n :host([color]) {\n background-color: transparent;\n }\n\n #label {\n position: absolute;\n inset: 0;\n\n display: block;\n\n cursor: pointer;\n\n z-index: 1;\n\n /* border-radius: 50%; */\n color: rgb(var(--mdw-bg));\n }\n\n #control {\n inset:0;\n\n overflow: visible;\n\n block-size: 100%;\n min-block-size: 0;\n inline-size: 100%;\n min-inline-size: 0;\n\n appearance: none;\n\n cursor: inherit;\n\n transform: none;\n\n background-color: transparent;\n color: inherit;\n }\n\n #control::-webkit-slider-runnable-track {\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin-inline: -10px;\n\n appearance: none;\n\n background-color: transparent;\n }\n\n @supports (-moz-appearance:none ){\n #control {\n inset-inline: -10px;\n\n inline-size: calc(100% + 20px);\n }\n }\n\n #control::-moz-range-track {\n inline-size: calc(100% + 20px) !important;\n\n appearance: none;\n }\n\n #control::-webkit-slider-thumb {\n display: block;\n\n block-size: 20px;\n inline-size: 20px;\n\n -webkit-appearance: none;\n cursor: inherit;\n\n transform: scale(2);\n\n background-color: transparent; /* Safari */\n\n border-radius: 50%;\n box-shadow: none; /* Safari */\n }\n\n #control::-moz-range-thumb {\n display: block;\n\n box-sizing: content-box;\n block-size: 20px;\n inline-size: 20px;\n border: none;\n\n appearance: none;\n cursor: inherit;\n\n transform: scale(2);\n\n background-color: transparent;\n border-radius: 50%;\n }\n\n #track {\n --value: 0.5;\n position: absolute;\n inset-block-start: 50%;\n inset-inline: 0;\n\n block-size: 4px;\n margin-block-start: -2px;\n\n pointer-events: none;\n user-select: none;\n\n background-color: rgb(var(--mdw-color__surface-variant));\n border-radius: inherit;\n }\n\n #thumb {\n position: absolute;\n inset-block-start: -18px;\n inset-inline-start: -20px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n\n block-size: 40px;\n inline-size: 40px;\n\n pointer-events: none;\n\n border-radius: 50%;\n\n color: rgb(var(--mdw-bg));\n }\n\n #thumb::before {\n content: '';\n\n display: block;\n\n block-size: 20px;\n inline-size: 20px;\n\n background-color: currentColor;\n border-radius: 50%;\n\n transition: background-color 100ms;\n }\n\n /* Inactive ticks */\n\n #ticks::before,\n #ticks::after {\n content: '';\n\n position: absolute;\n inset: 0;\n\n padding-inline: 10px;\n\n background-clip: content-box;\n /* stylelint-disable-next-line plugin/no-unsupported-browser-features */\n background-image: radial-gradient(circle at center, var(--tick-color) 0, var(--tick-color) 1px, transparent 0);\n background-position: center center;\n background-repeat: repeat-x;\n background-size: 0 100%;\n background-size: calc(100% / var(--ticks, 0)) 2px;\n }\n\n #ticks::before {\n --tick-color: rgb(var(--mdw-color__on-surface-variant));\n }\n\n #ticks::after {\n --tick-color: rgb(var(--mdw-ink));\n /* TODO: Use single-paint implementation */\n padding-inline-end: calc(100% - (100% * var(--value)) + 10px);\n\n z-index: 1;\n\n will-change: padding-inline-end;\n }\n /* Active Indicator */\n #track-active {\n position: absolute;\n inset: 0;\n\n overflow: hidden;\n\n border-radius: 99px;\n }\n\n #track-active::before {\n content: '';\n\n position: absolute;\n inset: 0;\n\n transform: scaleX(var(--value));\n transform-origin: 0 0;\n\n background-color: rgb(var(--mdw-bg));\n\n will-change: transform;\n }\n\n #thumb-anchor {\n position: absolute;\n inset-inline: 0;\n\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n\n inline-size: 1%;\n\n transform: translateX(calc(var(--value) * 100 * 100%));\n transform-origin: 0 0;\n z-index: 24;\n\n will-change: transform;\n }\n\n #thumb-label {\n position: absolute;\n inset-block-end: 14px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n box-sizing: content-box;\n margin-block-end: 6px;\n\n transform: translateX(-50%) scale(1);\n transform-origin: 50% 100%;\n\n font-weight: var(--mdw-typescale__label-medium__font-weight);\n line-height: var(--mdw-typescale__label-medium__line-height);\n font-family: var(--mdw-typescale__label-medium__font-family);\n letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);\n\n transition: transform 200ms;\n will-change: transform;\n }\n\n #thumb-label:is([hidden],[text=\"\"]) {\n transform: translateX(-50%) scale(0);\n }\n\n #thumb-label::before {\n content: attr(text);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n min-block-size: 28px;\n min-inline-size: 28px;\n\n z-index: 1;\n\n background-color: rgb(var(--mdw-bg));\n border-radius: 50%;\n color: rgb(var(--mdw-ink));\n }\n\n #thumb-label::after {\n /* Values from Figma SVG */\n --x-start: 14.6446%; /*4.1005px*/\n --x-end: 85.3554%;\n --y: 70.7106%; /*24.0416px*/\n\n content: \"\";\n\n position: absolute;\n inset: 0;\n inset-block-end: -6px;\n\n clip-path: polygon(var(--x-start) var(--y), var(--x-end) var(--y), 50% 100%, var(--x-start) var(--y));\n\n background-color: rgb(var(--mdw-bg));\n }\n\n #track[disabled] {\n background-color: rgb(var(--mdw-color__on-surface), calc(0.12 / 0.38));\n }\n\n #label[disabled],\n #track[disabled] {\n --mdw-bg: var(--mdw-color__on-surface);\n cursor: not-allowed;\n\n opacity: 0.38;\n }\n `\n .autoRegister('mdw-slider');\n", "// https://w3c.github.io/aria/#status\n\nimport { EVENT_HANDLER_TYPE } from '../core/customTypes.js';\nimport AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\nimport DensityMixin from '../mixins/DensityMixin.js';\n\nimport './Button.js';\nimport './IconButton.js';\n\nimport Surface from './Surface.js';\n\nexport default Surface\n .mixin(DensityMixin)\n .mixin(AriaReflectorMixin)\n .extend()\n .set({\n _ariaRole: 'status',\n elevated: true,\n })\n .observe({\n open: 'boolean',\n persistent: 'boolean',\n action: 'string',\n actionInk: { empty: 'inverse-primary' },\n actionTypeStyle: { empty: 'label-large' },\n closeButton: 'boolean',\n closeIcon: { empty: 'close' },\n closeInk: { empty: 'inherit' },\n onaction: EVENT_HANDLER_TYPE,\n })\n .methods({\n async close() {\n if (!this.dispatchEvent(new Event('close', { cancelable: true }))) return;\n if (!this.open) return;\n this.open = false;\n if (window.getComputedStyle(this).transitionDuration === '0s') return;\n await new Promise((resolve) => {\n this.addEventListener('transitionend', resolve, { once: true });\n });\n },\n show() {\n this.open = true;\n },\n /** @param {string} text */\n update(text) {\n this.textContent = text;\n },\n })\n .html/* html */`\n <div id=content></div>\n <mdw-button _if={action} id=action class=button ink={actionInk} type-style={actionTypeStyle}>{action}</mdw-button>\n <mdw-icon-button _if={closeButton} id=close class=button icon={closeIcon} ink={closeInk}>Close</mdw-button>\n `\n .on({\n composed() {\n const { content, slot } = this.refs;\n content.append(slot);\n },\n })\n .childEvents({\n action: {\n '~click'() {\n if (!this.dispatchEvent(new Event('action', { cancelable: true }))) return;\n this.close();\n },\n },\n close: {\n '~click'() {\n this.close();\n },\n },\n })\n .css`\n /* https://m3.material.io/components/snackbar/specs */\n\n :host {\n --mdw-shape__size: var(--mdw-shape__small);\n --mdw-surface__shadow: var(--mdw-surface__shadow__3);\n --mdw-surface__tint: var(--mdw-surface__tint__3);\n --mdw-shape__bg: rgb(var(--mdw-color__inverse-surface));\n --mdw-ink: var(--mdw-color__inverse-on-surface);\n\n --mdw-type__line-height: var(--mdw-typescale__body-medium__line-height);\n display: flex;\n align-items: center;\n\n padding-inline: 16px;\n\n opacity: 0;\n transform: translateY(25%) scaleY(0.25);\n transform-origin: bottom center;\n visibility: hidden; /* Remove from tab order */\n z-index: 24;\n\n font: var(--mdw-typescale__body-medium__font);\n letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);\n\n transition: transform 200ms, opacity 200ms, visibility 200ms;\n }\n\n :host([action]) {\n gap: 8px;\n\n padding-inline-end: 8px;\n }\n\n :host([close-button]) {\n gap: 4px;\n\n padding-inline-end: 4px;\n }\n\n :host([open]) {\n opacity: 1;\n transform: scale(1);\n visibility: visible;\n }\n\n #content {\n display: flex;\n align-items: center;\n\n flex: 1;\n padding-block: max(2px, calc(14px + (var(--mdw-density) * 2px)));\n }\n\n #slot {\n display: block;\n overflow-x: hidden;\n overflow-y: hidden;\n\n max-block-size: calc(var(--mdw-type__line-height) * 2);\n\n text-align: start;\n text-overflow: ellipsis;\n text-transform: none;\n white-space: normal;\n word-break: break-word;\n }\n\n @supports(width: 1lh) {\n #slot {\n max-block-size: 2lh;\n }\n }\n\n @supports(-webkit-line-clamp:1) {\n #slot {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n }\n }\n `\n .autoRegister('mdw-snackbar');\n", "import ShapeMixin from '../mixins/ShapeMixin.js';\n\nimport Box from './Box.js';\n\nexport default Box\n .mixin(ShapeMixin)\n .extend()\n .on({\n composed() {\n const { shape, outline } = this.refs;\n shape.before(outline);\n shape.remove();\n },\n })\n .css`\n :host {\n position: relative;\n\n overflow: hidden;\n\n z-index: auto;\n\n background-color: var(--mdw-shape__bg, transparent);\n\n border-start-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-start-size));\n border-start-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-end-size));\n border-end-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-start-size));\n border-end-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-end-size));\n\n transition-delay: 1ms;\n transition-duration: 200ms;\n transition-property: background-color, color;\n will-change: background-color, color;\n\n }\n\n :host([color]) {\n background-color: rgb(var(--mdw-bg));\n }\n\n :host(:where([ink],[color])) {\n color: rgb(var(--mdw-ink));\n }\n\n :host([outlined]) {\n background-color: transparent;\n }\n\n :host(:is([color=\"none\"], [color=\"transparent\"])) {\n background-color: transparent;\n }\n\n @supports(-webkit-mask-box-image: none) {\n :host {\n -webkit-mask-box-image: var(--mdw-shape__mask-border-source)\n 8 fill /\n var(--mdw-shape__size)\n stretch;\n\n -webkit-mask: var(--mdw-shape__mask);\n\n transition-duration: 200ms, 200ms, 200ms;\n transition-property: background-color, color, -webkit-mask-box-image-width;\n will-change: background-color, color, -webkit-mask-box-image;\n }\n }\n `\n .autoRegister('mdw-shape');\n", "import './Icon.js';\nimport './Shape.js';\nimport CustomElement from '../core/CustomElement.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(ShapeMixin)\n .extend()\n .observe({\n selected: 'boolean',\n icon: 'string',\n errored: 'boolean',\n disabled: 'boolean',\n selectedIcon: 'string',\n unselectedIcon: 'string',\n src: 'string',\n selectedSrc: 'string',\n unselectedSrc: 'string',\n hovered: 'boolean',\n pressed: 'boolean',\n focused: 'boolean',\n dragValue: 'float',\n color: { empty: 'primary' },\n })\n .observe({\n /** Alias for Selected (QoL) */\n checked: {\n type: 'boolean',\n get({ selected }) { return selected; },\n /** @param {boolean} value */\n set(value) { this.selected = value; },\n },\n _active({ disabled, pressed, focused, hovered }) {\n return !disabled && (pressed || focused || hovered);\n },\n })\n .observe({\n _thumbColor({ color, _active }) {\n return _active ? `${color}-container` : '';\n },\n _iconInk({ disabled, selected, color }) {\n if (!selected) return 'surface-variant';\n if (disabled) return 'on-surface';\n return `on-${color}-container`;\n },\n })\n .expressions({\n hasIcon({ icon, src, unselectedIcon, unselectedSrc }) {\n return Boolean(icon || src || unselectedIcon || unselectedSrc);\n },\n })\n .html/* html */`\n <div id=thumb selected={checked} pressed={pressed} disabled={disabled}>\n <mdw-shape id=thumb-shape shape-style=full selected={checked} pressed={pressed} hovered={hovered} focused={focused} icon={hasIcon}\n color={_thumbColor} active={_active} ink={_thumbInk} disabled={disabled}></mdw-shape>\n <mdw-icon ink={_iconInk} class=icon id=icon src={src} selected={checked}>{icon}</mdw-icon>\n <mdw-icon ink={_iconInk} class=icon id=selected-icon src={selectedIconSrc} selected={checked}>{selectedIcon}</mdw-icon>\n <mdw-icon ink={_iconInk} class=icon id=unselected-icon src={unselectedIconSrc} selected={checked}>{unselectedIcon}</mdw-icon>\n <slot id=slot selected={checked}></slot>\n </div>\n `\n .on({\n composed() {\n const { outline, shape: track } = this.refs;\n track.id = 'track';\n track.setAttribute('selected', '{checked}');\n track.setAttribute('disabled', '{disabled}');\n outline.removeAttribute('_if');\n outline.setAttribute('selected', '{checked}');\n outline.setAttribute('errored', '{errored}');\n outline.setAttribute('disabled', '{disabled}');\n },\n dragValueChanged(oldValue, newValue) {\n if (newValue == null) {\n this.refs.thumb.style.removeProperty('--mdw-switch__value');\n this.refs.thumb.style.removeProperty('transition-duration');\n } else {\n this.refs.thumb.style.setProperty('--mdw-switch__value', `${newValue}`);\n this.refs.thumb.style.setProperty('transition-duration', '0s');\n }\n },\n })\n .css`\n /* https://m3.material.io/components/switch/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-bg: var(--mdw-color__primary);\n --mdw-shape__size: var(--mdw-shape__full);\n --mdw-switch__value: 0;\n\n position: relative;\n\n display: inline-block;\n vertical-align: middle;\n\n box-sizing: border-box;\n block-size: 32px;\n inline-size: 52px;\n container-type: inline-size;\n container-name: switch-icon;\n }\n\n :host([selected]) {\n --mdw-switch__value: 1;\n }\n\n :host([disabled]) {\n opacity: 0.38;\n }\n\n #track{\n position: absolute;\n inset: 0;\n\n background-color: rgb(var(--mdw-color__surface-variant));\n }\n\n #track[selected] {\n background-color: rgb(var(--mdw-bg));\n }\n\n #track[disabled] {\n opacity: calc(0.12/0.38);\n }\n\n #track[disabled][selected] {\n background-color: rgb(var(--mdw-color__on-surface));\n }\n\n #outline {\n filter:\n drop-shadow(1px 0px 0px currentColor)\n drop-shadow(0px 1px 0px currentColor)\n drop-shadow(-1px 0px 0px currentColor)\n drop-shadow(0px -1px 0px currentColor);\n\n color: rgb(var(--mdw-color__outline));\n }\n\n #outline:is([pressed],[focused]) {\n color: rgb(var(--mdw-color__outline));\n }\n\n #outline[disabled] {\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #outline[selected] {\n color: transparent;\n }\n\n /** Thumb (state) **/\n\n #thumb {\n --thumb-color: var(--mdw-ink);\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n transform: translateX(calc(var(--mdw-dir, 1) * var(--mdw-switch__value) * (52px - 100%)));\n\n aspect-ratio: 1/1;\n }\n\n :dir(rtl) #thumb {\n --mdw-dir: -1;\n }\n\n @supports(width: 1cqw) {\n #thumb {\n transform: translateX(calc(var(--mdw-dir, 1) * var(--mdw-switch__value) * (100cqw - 100%)));\n }\n }\n\n #slot {\n color: rgb(var(--mdw-color__on-surface));\n }\n\n #slot[selected] {\n color: rgb(var(--mdw-bg));\n }\n\n /** Thumb Shape **/\n\n #thumb-shape {\n --mdw-shape__size: inherit;\n\n position: absolute;\n\n inset: 2px;\n\n transform: scale(calc(16/28));\n z-index: 0;\n }\n\n #thumb-shape[icon] {\n transform: scale(calc(24/28));\n }\n\n #thumb-shape:not([selected]) {\n --mdw-bg: var(--mdw-color__outline);\n --mdw-ink: var(--mdw-color__surface-variant);\n }\n\n #thumb-shape[selected] {\n transform: scale(calc(24/28));\n }\n\n #thumb-shape[selected]:not([active]) {\n --mdw-bg: var(--thumb-color);\n }\n\n #thumb-shape[pressed]:not([disabled]) {\n transform: scale(1);\n }\n\n /** Thumb Icons **/\n\n .icon {\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 50%;\n\n opacity: 0;\n transform: translateX(-50%) translateY(-50%);\n\n font-size: 16px;\n\n /* border-radius: 50%; */\n }\n\n .icon:not([src]):empty {\n display: none;\n }\n\n #icon, #unselected-icon {\n opacity: 1;\n\n font-variation-settings: 'FILL' 0;\n }\n\n #unselected-icon[selected] {\n opacity: 0;\n }\n\n #selected-icon[selected] {\n opacity: 1;\n }\n\n #icon[selected] {\n font-variation-settings: 'FILL' 1;\n }\n\n #thumb[disabled] {\n color: rgb(var(--mdw-color__on-surface));\n }\n `\n .css`\n /* https://m3.material.io/components/switch/specs */\n\n :host {\n /*FastOutLinearInInterpolator*/\n --mdw-switch__transition-timing__collapse: cubic-bezier(0.4, 0.0, 1, 1);\n --mdw-switch__transition-duration__collapse: 375ms;\n /*LinearOutSlowInInterpolator*/\n --mdw-switch__transition-timing__expand: cubic-bezier(0.0, 0.0, 0.2, 1);\n --mdw-switch__transition-duration__expand: 500ms;\n --scale-delay: var(--mdw-switch__transition-duration);\n\n --mdw-switch__transition-duration: var(--mdw-switch__transition-duration__collapse);\n --mdw-switch__transition-timing: var(--mdw-switch__transition-timing__collapse);\n --mdw-switch__transition-delay__color: calc(var(--mdw-switch__transition-duration) / 2);\n --mdw-switch__transition-delay__translate: calc(var(--mdw-switch__transition-duration) / 2);\n --mdw-switch__transition-delay__scale: calc(var(--mdw-switch__transition-duration) / 2);\n\n transition-delay: var(--mdw-switch__transition-delay__color);\n transition-duration: calc(var(--mdw-switch__transition-duration) / 2);\n /* 2 legged animation */\n transition-timing-function: var(--mdw-switch__transition-timing);\n }\n\n #track {\n transition-delay: var(--mdw-switch__transition-delay__color);\n transition-duration: inherit;\n transition-property: background-color;\n transition-timing-function: inherit;\n }\n\n #outline {\n transition-delay: var(--mdw-switch__transition-delay__color);\n transition-duration: inherit;\n transition-property: background-color, color;\n transition-timing-function: inherit;\n }\n\n #thumb {\n transition-delay: var(--mdw-switch__transition-delay__translate);\n transition-duration: inherit;\n transition-property: transform;\n transition-timing-function: inherit;\n }\n\n #thumb-shape, .icon {\n /* (selected => unselected): stall color+scale */\n transition-delay: var(--mdw-switch__transition-delay__scale), var(--mdw-switch__transition-delay__color), var(--mdw-switch__transition-delay__color);\n transition-duration: inherit;\n transition-property: transform, background-color, color;\n transition-timing-function: inherit;\n }\n\n :host([icon]) {\n --mdw-switch__transition-delay__translate: 0s;\n }\n\n .icon {\n transition-property: transform, opacity, color;\n }\n\n /* unselected => selected */\n :host([selected]) {\n --mdw-switch__transition-delay__color: 0s;\n --mdw-switch__transition-delay__scale: 0s;\n /* --mdw-switch__transition-delay__translate: 0s; */\n --mdw-switch__transition-duration: var(--mdw-switch__transition-duration__expand);\n --mdw-switch__transition-timing: var(--mdw-switch__transition-timing__expand);\n }\n\n /* active => selected */\n :host([selected][pressed]) {\n /* --mdw-switch__transition-delay__color: 0s; */\n /* --mdw-switch__transition-delay__scale: 0s; */\n --mdw-switch__transition-delay__translate: 0s;\n }\n\n /* selected => unselected */\n :host(:not([selected])) {\n /* --mdw-switch__transition-delay__color: 0s; */\n /* --mdw-switch__transition-delay__scale: 0s; */\n --mdw-switch__transition-delay__translate: 0s;\n }\n\n /* unselected => active */\n :host([pressed]:not([selected])) {\n /* --mdw-switch__transition-delay__color: 0s; */\n --mdw-switch__transition-delay__scale: 0s;\n /* --mdw-switch__transition-delay__translate: 0s; */\n }\n `\n .autoRegister('mdw-switch-icon');\n", "import './SwitchIcon.js';\nimport CustomElement from '../core/CustomElement.js';\nimport InputMixin from '../mixins/InputMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\nimport TouchTargetMixin from '../mixins/TouchTargetMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(InputMixin) // Label as root\n .mixin(StateMixin)\n .mixin(TouchTargetMixin)\n // Switches have their own pressed animation (No ripple)\n .extend()\n .set({\n type: 'checkbox',\n stateLayer: true,\n })\n .observe({\n icon: 'string',\n selectedIcon: 'string',\n unselectedIcon: 'string',\n src: 'string',\n selectedSrc: 'string',\n unselectedSrc: 'string',\n })\n .on({\n composed({ html }) {\n const { state, label, control, touchTarget } = this.refs;\n label.append(html`\n ${touchTarget}\n <mdw-switch-icon id=switch\n color={color} ink={ink} selected={checked} hovered={hoveredState} focused={focusedState} pressed={pressedState} disabled={disabledState}\n icon={icon}\n selected-icon={selectedIcon}\n unselected-icon={unselectedIcon}\n src={src}\n selected-src={selectedSrc}\n unselected-src={unselectedSrc}\n >\n ${state}\n ${control}\n </mdw-switch-icon>\n <slot id=slot></slot>\n `);\n control.setAttribute('type', 'checkbox');\n control.setAttribute('role', 'switch');\n },\n })\n .methods({\n /**\n * @param {(MouseEvent|TouchEvent) & {currentTarget:HTMLInputElement}} event\n * @return {void}\n */\n onControlMouseOrTouch(event) {\n const input = event.currentTarget;\n if (input.disabled) return;\n\n if (this.disabledState) return;\n\n if (event.type === 'touchend') {\n // this._isHoveringThumb = false;\n return;\n }\n\n let offsetX;\n let clientX;\n let pageX;\n let isActive;\n\n const isTouch = 'touches' in event;\n if (isTouch) {\n if (event.touches.length) {\n const [touch] = event.touches;\n isActive = true;\n // @ts-ignore Might exist\n ({ offsetX, clientX, pageX } = touch);\n }\n } else {\n // Ignore mouse drag-over\n // Firefox doesn't report `:active`\n // eslint-disable-next-line no-bitwise\n isActive = (event.buttons & 1) === 1\n && (event.type === 'mousedown' || input.matches(':active'));\n ({ offsetX, clientX, pageX } = event);\n }\n\n if (!isActive) return;\n\n if (offsetX == null) {\n clientX ??= pageX - window.scrollX; // Safari\n offsetX = clientX - input.getBoundingClientRect().left;\n }\n\n const { clientWidth } = input;\n let position = (offsetX / clientWidth);\n if (position > 1) {\n position = 1;\n } else if (position < 0) {\n position = 0;\n }\n\n // this._isHoveringThumb = true;\n\n let currentValue = this.refs.switch.dragValue;\n if (currentValue == null) {\n currentValue = this.checked ? 1 : 0;\n }\n const pixels = offsetX - (clientWidth / 2);\n const currentPixels = this.refs.switch.clientWidth - (this.refs.switch.clientHeight);\n // console.log(pixels, currentPixels, currentPixels * currentValue, pixels / currentPixels);\n const newRatio = pixels / currentPixels;\n const newValue = Math.max(Math.min(currentValue + newRatio, 1), 0);\n // this.refs.switch.dragValue = newValue;\n // event.preventDefault();\n },\n })\n .childEvents({\n control: {\n '~pointermove': 'onControlMouseOrTouch',\n },\n })\n .css`\n /* https://m3.material.io/components/switch/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__on-primary);\n --mdw-bg: var(--mdw-color__primary);\n position: relative;\n\n display: inline-flex;\n align-items: center;\n\n gap: 12px;\n vertical-align: middle;\n\n }\n\n #touch-target {\n z-index: 0;\n }\n\n #label {\n display: contents;\n\n cursor: pointer;\n\n /* border-radius: 50%; */\n }\n\n /** Switch **/\n\n #switch {\n --mdw-bg: inherit;\n --mdw-ink: inherit;\n flex:1;\n\n pointer-events: none;\n }\n\n /** State **/\n\n #state {\n position: absolute;\n inset: 50%;\n\n block-size: 100%;\n min-block-size: 40px;\n inline-size: 100%;\n min-inline-size: 40px;\n\n pointer-events: none;\n\n transform: translateX(-50%) translateY(-50%);\n\n border-radius: 50%;\n }\n\n /** Disabled **/\n\n #label[disabled] {\n --mdw-ink: var(--mdw-color__on-surface); /* selected icon */\n --mdw-bg: var(--mdw-color__surface);\n cursor: not-allowed;\n\n opacity: 0.38;\n }\n\n `\n .autoRegister('mdw-switch');\n", "// https://w3c.github.io/aria/#tab\n\nimport './Icon.js';\n\nimport CustomElement from '../core/CustomElement.js';\nimport RippleMixin from '../mixins/RippleMixin.js';\nimport ScrollListenerMixin from '../mixins/ScrollListenerMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\n\nexport default CustomElement\n .mixin(ShapeMixin)\n .mixin(StateMixin)\n .mixin(RippleMixin)\n .mixin(ScrollListenerMixin)\n .extend()\n .define({\n stateTargetElement() { return this.refs.anchor; },\n /**\n * Used to compute primary indicator size.\n * Default to 24.\n */\n labelMetrics() {\n const slot = this.refs.slot;\n let target = this.refs.slot;\n if (!slot.clientWidth) target = this.refs.icon;\n return {\n width: target.clientWidth,\n left: target.offsetLeft,\n };\n },\n })\n .set({\n delegatesFocus: true,\n stateLayer: true,\n })\n .observe({\n active: 'boolean',\n icon: 'string',\n src: 'string',\n href: 'string',\n ariaLabel: 'string',\n })\n .methods({\n /** @type {HTMLElement['focus']} */\n focus(options) {\n this.refs.anchor.focus(options);\n },\n })\n .html/* html */`\n <a id=anchor role=tab\n aria-label={ariaLabel}\n aria-controls=${({ href }) => (href?.startsWith('#') ? href.slice(1) : null)}\n aria-selected=${({ active }) => (active ? 'true' : 'false')}\n aria-disabled=${({ disabledState }) => `${disabledState}`}\n disabled={disabledState}\n href=${({ href }) => href ?? '#'}>\n <mdw-icon _if=${(data) => data.icon || data.src} id=icon aria-hidden=true src={src} active={active}>{icon}</mdw-icon>\n <slot id=slot></slot>\n </a>\n `\n .on({\n composed() {\n const { shape, rippleContainer, state } = this.refs;\n shape.append(state, rippleContainer);\n state.setAttribute('state-disabled', 'focus');\n },\n })\n .events({\n keydown(event) {\n if (event.key === ' ') {\n event.preventDefault(); // Avoid vertical scroll\n this.refs.anchor.click();\n }\n },\n })\n .childEvents({\n anchor: {\n click(event) {\n if (this.disabledState) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n const { href } = this;\n if (!href) {\n event.preventDefault();\n return;\n }\n if (href.startsWith('#')) {\n /** @type {HTMLElement} */\n const el = document.querySelector(href);\n if (!el) { console.warn('Unknown element', href); }\n event.preventDefault();\n el.scrollIntoView({ block: 'nearest', inline: 'start' });\n }\n },\n },\n })\n .css`\n /* https://m3.material.io/components/tabs/specs */\n\n :host {\n display: inline-flex;\n\n min-inline-size: 64px;\n\n cursor: pointer;\n }\n\n #anchor {\n display: flex;\n align-items: center;\n flex-direction: column;\n justify-content: center;\n\n box-sizing: border-box;\n block-size: 100%;\n inline-size: 100%;\n flex: 1;\n\n padding-block: 6px;\n padding-inline: 12px;\n\n cursor: pointer;\n outline: none;\n\n color: inherit;\n\n text-decoration: inherit;\n }\n\n #icon {\n padding-block: 4px;\n\n font-size: 24px;\n font-variation-settings: 'FILL' 0;\n\n }\n\n #shape[disabled],\n #anchor[disabled] {\n cursor: not-allowed;\n\n background-color: rgba(var(--mdw-color__on-surface), 0.12);\n color: rgba(var(--mdw-color__on-surface), 0.38);\n }\n\n :host([active]) {\n color: rgb(var(--mdw-ink));\n }\n\n #icon[active] {\n font-variation-settings: 'FILL' 1;\n }\n\n #slot {\n display: block;\n overflow-x: hidden;\n overflow-y: hidden;\n\n max-block-size: var(--mdw-typescale__title-small__line-height);\n\n max-inline-size: 100%;\n\n cursor: inherit;\n outline: none;\n\n opacity: var(--mdw-nav-item__anchor__opacity, 1);\n transform: translateY(var(--mdw-nav-item__offset-y, 0));\n\n color: inherit;\n\n font: var(--mdw-typescale__title-small__font);\n letter-spacing: var(--mdw-typescale__title-small__letter-spacing);\n text-align: center;\n text-decoration: inherit;\n text-overflow: ellipsis;\n text-transform: none;\n white-space: nowrap;\n word-break: break-word;\n\n transition: opacity, color, transform 200ms;\n will-change: opacity, transform;\n }\n `\n .autoRegister('mdw-tab');\n", "const registeredElements = new Set();\n\n/** @type {MutationObserver} */\nlet rtlObserver;\n\n/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function RTLObserverMixin(Base) {\n return Base\n .extend()\n .observe({\n pageIsRTL: {\n type: 'boolean',\n value: document.documentElement.dir === 'rtl',\n },\n })\n .on({\n connected() {\n if (!rtlObserver) {\n rtlObserver = new MutationObserver(() => {\n const isRTL = document.documentElement.dir === 'rtl';\n for (const el of registeredElements) {\n el.pageIsRTL = isRTL;\n }\n });\n rtlObserver.observe(document.documentElement, { attributeFilter: ['dir'] });\n }\n registeredElements.add(this);\n },\n disconnected() {\n registeredElements.delete(this);\n },\n });\n}\n", "const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n // @ts-ignore Skip cast\n entry.target.onResizeObserved(entry);\n }\n});\n\n/**\n * @param {typeof import('../core/CustomElement.js').default} Base\n */\nexport default function ResizeObserverMixin(Base) {\n return Base\n .extend()\n .set({\n observeResizeOnConnected: true,\n })\n .methods({\n /** @param {ResizeObserverEntry} entry */\n onResizeObserved(entry) {\n // Virtual function\n },\n observeResize() {\n resizeObserver.observe(this);\n },\n unobserveResize() {\n resizeObserver.unobserve(this);\n },\n })\n .on({\n connected() {\n if (!this.observeResizeOnConnected) return;\n this.observeResize();\n },\n disconnected() {\n this.unobserveResize();\n },\n });\n}\n", "// https://w3c.github.io/aria/#tablist\n\nimport CustomElement from '../core/CustomElement.js';\nimport KeyboardNavMixin from '../mixins/KeyboardNavMixin.js';\nimport RTLObserverMixin from '../mixins/RTLObserverMixin.js';\nimport ResizeObserverMixin from '../mixins/ResizeObserverMixin.js';\nimport ShapeMixin from '../mixins/ShapeMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nimport Tab from './Tab.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(KeyboardNavMixin)\n .mixin(ResizeObserverMixin)\n .mixin(RTLObserverMixin)\n .mixin(ShapeMixin)\n .extend()\n .set({\n /** @type {WeakRef<HTMLElement>} */\n _tabContentRef: null,\n _tabContentScrollListener: null,\n /** @type {HTMLCollectionOf<InstanceType<Tab>>} */\n _tabCollection: null,\n /**\n * @type {{\n * left:number,\n * width:number,\n * right:number,\n * center: number,\n * label: {left:number, width:number},\n * index: number,\n * }[]}\n */\n _tabMetrics: null,\n _isRTL: null,\n })\n .define({\n tabContent: {\n get() {\n return this._tabContentRef?.deref();\n },\n /** @param {HTMLElement} value */\n set(value) {\n const oldValue = this._tabContentRef?.deref();\n if (oldValue) {\n oldValue.removeEventListener('scroll', this._tabContentScrollListener);\n }\n if (value) {\n this._tabContentRef = new WeakRef(value);\n this._tabContentScrollListener = this.observeTabContent.bind(this);\n value.addEventListener('scroll', this._tabContentScrollListener);\n this.observeTabContent();\n } else {\n this._tabContentRef = null;\n }\n },\n },\n })\n .observe({\n tabContentId: {\n /**\n * @param {string} oldValue\n * @param {string} newValue\n */\n changedCallback(oldValue, newValue) {\n // @ts-ignore Skip cast\n this.tabContent = newValue ? document.getElementById(newValue) : null;\n },\n },\n active: 'boolean',\n secondary: 'boolean',\n _indicatorStyle: { value: 'opacity: 0' },\n color: { empty: 'surface-primary' },\n })\n .define({\n tabs() {\n // eslint-disable-next-line no-return-assign\n return this._tabCollection ??= /** @type {HTMLCollectionOf<InstanceType<Tab>>} */ (\n this.getElementsByTagName(Tab.elementName)\n );\n },\n })\n .observe({\n /** Internal observed property */\n _selectedIndex: {\n type: 'integer',\n empty: -1,\n /**\n * @param {number} oldValue\n * @param {number} newValue\n */\n changedCallback(oldValue, newValue) {\n this.active = newValue !== -1;\n },\n },\n })\n .define({\n kbdNavQuery() {\n return Tab.elementName;\n },\n ariaOrientationDefault() {\n return /** @type {'horizontal'|'vertical'} */ ('horizontal');\n },\n /** @return {NodeListOf<InstanceType<Tab>>} */\n childTabItems() {\n return (this.querySelectorAll(Tab.elementName));\n },\n tabMetrics() {\n // eslint-disable-next-line no-return-assign\n return this._tabMetrics ??= [...this.tabs].map((tab, index) => ({\n left: tab.offsetLeft,\n width: tab.offsetWidth,\n right: tab.offsetLeft + tab.offsetWidth,\n center: tab.offsetLeft + (tab.offsetWidth / 2),\n label: tab.labelMetrics,\n index,\n }));\n },\n selectedIndex: {\n get() {\n let index = 0;\n for (const tab of this.tabs) {\n if (tab.active) return index;\n index++;\n }\n return -1;\n },\n set(value) {\n let index = 0;\n for (const el of this.tabs) {\n if (index === value) {\n el.active = true;\n this._selectedIndex = index;\n } else {\n el.active = false;\n }\n index++;\n }\n },\n },\n })\n .define({\n selectedItem: {\n /**\n * @return {InstanceType<Tab>}\n */\n get() {\n for (const tab of this.tabs) {\n if (tab.active) return tab;\n }\n return null;\n },\n /**\n * @param {InstanceType<Tab>} value\n * @return {InstanceType<Tab>}\n */\n set(value) {\n let index = 0;\n for (const tab of this.tabs) {\n if (tab === value) {\n this.selectedIndex = index;\n return value;\n }\n index++;\n }\n return null;\n },\n },\n })\n .methods({\n clearCache() {\n this._tabMetrics = null;\n },\n /** @param {InstanceType<Tab>} [tab] */\n updateIndicatorByTab(tab) {\n tab ??= this.selectedItem ?? this.tabs.item(0);\n\n const width = this.secondary ? tab.clientWidth : tab.labelMetrics.width;\n const position = this.secondary ? tab.offsetLeft : tab.offsetLeft + tab.labelMetrics.left;\n this._indicatorStyle = `--width: ${width}; --offset: ${position}px`;\n },\n updateIndicator(animate = false) {\n this.updateIndicatorByTab();\n if (!animate) {\n this.refs.indicator.style.setProperty('--transition-ratio', '0');\n }\n },\n /** @param {number} percentage */\n updateIndicatorByPosition(percentage) {\n const metrics = this.tabMetrics;\n\n // Tab panels are equal-width whereas tablist may be variable\n\n const clamped = Math.min(Math.max(percentage, 0), 1);\n const decimalIndex = (metrics.length - 1) * clamped;\n const leftIndex = Math.floor(decimalIndex);\n const rightIndex = Math.ceil(decimalIndex);\n\n const leftMetrics = metrics[leftIndex];\n if (!leftMetrics) return;\n\n const rightMetrics = metrics[rightIndex];\n\n let width;\n let activeTab;\n /** Center-based position */\n let center;\n if (leftMetrics === rightMetrics) {\n width = this.secondary ? leftMetrics.width : leftMetrics.label.width;\n activeTab = this.tabs.item(leftIndex);\n center = leftMetrics.center;\n } else {\n const leftRatio = 1 - (decimalIndex - leftIndex);\n const rightRatio = 1 - leftRatio;\n const leftWidth = leftRatio * (this.secondary ? leftMetrics.width : leftMetrics.label.width);\n const rightWidth = rightRatio * (this.secondary ? rightMetrics.width : rightMetrics.label.width);\n const activeIndex = leftRatio > rightRatio ? leftIndex : rightIndex;\n const distance = rightMetrics.center - leftMetrics.center;\n width = leftWidth + rightWidth;\n activeTab = this.tabs.item(activeIndex);\n center = leftMetrics.center + (distance * rightRatio);\n }\n\n if (!activeTab.active) {\n for (const tab of this.tabs) {\n tab.active = tab === activeTab;\n }\n this.active = true;\n }\n\n this._indicatorStyle = `--width: ${width}; --offset: ${center - (width / 2)}px`;\n this.refs.indicator.style.setProperty('--transition-ratio', '0');\n },\n /** @param {number} index */\n updateIndicatorByIndex(index) {\n this.updateIndicatorByTab(this.tabs.item(index ?? this._selectedIndex));\n },\n observeTabContent() {\n const tabContent = this.tabContent;\n if (!tabContent) return;\n let start = tabContent.scrollLeft;\n if (this.pageIsRTL) {\n start *= -1;\n }\n const width = tabContent.clientWidth;\n const max = tabContent.scrollWidth - width;\n const percentage = max === 0 ? 0 : start / max;\n this.updateIndicatorByPosition(percentage);\n },\n onResizeObserved() {\n this.clearCache();\n this.updateIndicator();\n },\n })\n\n .set({\n ariaRole: 'tablist',\n })\n .html/* html */`\n <slot id=slot ink={ink} type-style={typeStyle}></slot>\n <div id=indicator aria-hidden=true style={_indicatorStyle} active={active} secondary={secondary}>\n <div id=indicator-start class=indicator-piece></div>\n <div id=indicator-center class=indicator-piece></div>\n <div id=indicator-end class=indicator-piece></div>\n </div>\n `\n .on({\n composed() {\n const { shape, indicator } = this.refs;\n shape.append(indicator);\n },\n pageIsRTLChanged() {\n this.clearCache();\n this.updateIndicator();\n },\n activeChanged(oldValue, newValue) {\n if (newValue) {\n // Update indicator position without transition\n this.updateIndicator();\n }\n },\n secondaryChanged() {\n this.updateIndicator();\n },\n _selectedIndexChanged(oldValue, newValue) {\n this.updateIndicatorByIndex(newValue);\n },\n })\n .events({\n '~click'({ target }) {\n // Abort if not child\n if (target === this) return;\n if (target instanceof Tab) {\n // TODO: Override colors from scroll events\n }\n },\n })\n .childEvents({\n slot: {\n slotchange() {\n this.clearCache();\n this.updateIndicator();\n },\n },\n })\n .css`\n /* https://m3.material.io/components/tabs/specs */\n\n :host {\n --mdw-ink: var(--mdw-color__primary);\n --mdw-shape__bg: rgb(var(--mdw-color__surface));\n position: relative;\n position: sticky;\n inset-block-start: 0;\n inset-inline: 0;\n\n display: grid;\n align-items: stretch;\n grid-auto-columns: minmax(auto, 1fr);\n grid-auto-flow: column;\n justify-content: space-evenly;\n overflow-y: hidden;\n\n box-sizing: border-box;\n min-block-size: 48px;\n inline-size: 100%;\n flex:none;\n\n color: inherit;\n\n text-align: center;\n\n will-change: transform;\n }\n\n #indicator {\n --corner: 3;\n --width: 24;\n --offset: 0;\n --visibility: 0;\n --transition-ratio: 1;\n position: absolute;\n inset-block-end: 0;\n inset-inline: 0;\n\n overflow-y: clip;\n\n block-size: 3px;\n inline-size: 100%;\n\n pointer-events: none;\n\n opacity: 1;\n transform: translateY(calc(100% * (1 - var(--visibility))));\n\n color: inherit;\n\n transition: transform 200ms;\n will-change: transform;\n }\n\n .indicator-piece {\n position: absolute;\n inset-block: 0;\n\n opacity: 1;\n /* opacity: 0.60; */\n transform-origin: 0 0;\n z-index:1;\n\n background-color: currentColor;\n\n transition: transform;\n transition-duration: calc(200ms * var(--transition-ratio));\n will-change: transform;\n }\n\n #indicator-start {\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: 0;\n\n inline-size: calc(2 * 1px * var(--corner));\n\n transform: translateX(var(--offset));\n\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-top-left-radius: calc(1px * var(--corner));\n }\n\n #indicator-center {\n /* Chrome has rendering issues upscaling small elements */\n --precision: 100;\n\n position: absolute;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: calc(1px * var(--corner));\n\n inline-size: calc(1px * var(--precision));\n\n transform: translateX(var(--offset)) scaleX(calc((var(--width) - (2 * var(--corner))) / var(--precision)));\n\n }\n\n #indicator-end {\n position: absolute;\n /* stylelint-disable-next-line liberty/use-logical-spec */\n left: 0;\n\n inline-size: calc(2 * 1px * var(--corner));\n\n transform:\n translateX(var(--offset))\n translateX(calc(-2px * var(--corner)))\n translateX(calc(var(--width) * 1px));\n\n /* stylelint-disable-next-line liberty/use-logical-spec */\n border-top-right-radius: calc(1px * var(--corner));\n }\n\n #indicator[active] {\n --visibility: 1;\n color: rgb(var(--mdw-ink));\n }\n\n #indicator[secondary] {\n --corner: 0;\n }\n\n :host([scrollable]) {\n grid-auto-columns: max-content;\n justify-content: flex-start;\n overflow-x: auto;\n\n padding-inline: 48px\n }\n `\n .autoRegister('mdw-tab-list');\n", "import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';\n\nimport Box from './Box.js';\n\nexport default Box\n .mixin(AriaReflectorMixin)\n .extend()\n .set({\n _ariaRole: 'tabpanel',\n })\n .observe({\n active: {\n type: 'boolean',\n changedCallback(oldValue, newValue) {\n this.updateAriaProperty('ariaHidden', newValue ? 'false' : 'true');\n },\n },\n peeking: 'boolean',\n })\n .css/* css */`\n :host {\n scroll-snap-align: center;\n min-inline-size: 100%;\n max-inline-size: 100%;\n min-block-size: 100%;\n max-block-size: 100%;\n overflow-y: auto;\n will-change: visibility;\n\n visibility: hidden; \n }\n :host(:is([active],[peeking])) {\n /* Safari bug: Visiblity not changing without !important or layout reflow */\n visibility: visible !important;;\n }\n `\n .autoRegister('mdw-tab-panel');\n", "import './TabList.js'; /* TabList must register before TabContent */\nimport CustomElement from '../core/CustomElement.js';\nimport ResizeObserverMixin from '../mixins/ResizeObserverMixin.js';\n\nimport TabPanel from './TabPanel.js';\n\nexport default CustomElement\n .mixin(ResizeObserverMixin)\n .extend()\n .set({\n /** @type {InstanceType<TabPanel>[]} */\n _panelNodes: [],\n /**\n * @type {{\n * left:number,\n * width:number,\n * right:number,\n * center: number,\n * index: number,\n * }[]}\n */\n _panelMetrics: null,\n })\n .observe({\n /** Internal observed property */\n _selectedIndex: {\n type: 'integer',\n empty: -1,\n },\n })\n .define({\n panels() {\n return this._panelNodes;\n },\n panelMetrics() {\n // eslint-disable-next-line no-return-assign\n return this._panelMetrics ??= [...this._panelNodes].map((panel, index) => ({\n left: panel.offsetLeft,\n width: panel.offsetWidth,\n right: panel.offsetLeft + panel.offsetWidth,\n center: panel.offsetLeft + (panel.offsetWidth / 2),\n index,\n }));\n },\n })\n .define({\n selectedIndex: {\n get() {\n let index = 0;\n for (const panel of this.panels) {\n if (panel.active) return index;\n index++;\n }\n return -1;\n },\n set(value) {\n let index = 0;\n for (const el of this.panels) {\n if (index === value) {\n el.active = true;\n this._selectedIndex = index;\n } else {\n el.active = false;\n }\n index++;\n }\n },\n },\n })\n .define({\n selectedPanel: {\n /**\n * @return {InstanceType<TabPanel>}\n */\n get() {\n return this.panels.find((panel) => panel.active);\n },\n /**\n * @param {InstanceType<TabPanel>} value\n * @return {InstanceType<TabPanel>}\n */\n set(value) {\n const index = this.panels.indexOf(value);\n if (index === -1) return null;\n this.selectedIndex = index;\n return value;\n },\n },\n })\n .html/* html */`<slot id=slot></slot>`\n .methods({\n onResizeObserved() {\n this._panelMetrics = null;\n // Resize should not change panel visibility\n },\n updatePanels() {\n const start = this.scrollLeft;\n const width = this.clientWidth;\n const end = start + width;\n for (const metric of this.panelMetrics) {\n const visibleWidth = (start > metric.right) || (end < metric.left) // Offscreen ?\n ? 0\n : (\n (start >= metric.left) // Scroll at or over panel left point?\n ? metric.right - start // Measure from panel right\n : end - metric.left // Measure from panel left\n );\n const percentage = visibleWidth / width;\n const panel = this.panels[metric.index];\n panel.active = percentage >= 0.5;\n // TODO: Investigate possible subpixel imprecision\n panel.peeking = percentage > 0 && percentage < 0.5;\n }\n },\n })\n .childEvents({\n slot: {\n slotchange(event) {\n const slot = /** @type {HTMLSlotElement} */ (event.currentTarget);\n // @ts-ignore Skip cast\n this._panelNodes = slot.assignedElements()\n .filter((el) => el.tagName === TabPanel.elementName.toUpperCase());\n this.updatePanels();\n },\n },\n })\n .events({\n scroll: 'updatePanels',\n })\n .css`\n :host {\n display: grid;\n grid-auto-columns: 100%;\n grid-auto-flow: column;\n grid-template-columns: 100%;\n overflow-x: auto;\n scroll-behavior: smooth;\n scroll-snap-type: x mandatory;\n scrollbar-width: none;\n\n flex-grow: 1;\n -webkit-scroll-snap-type-x: mandatory;\n scroll-snap-type-x: mandatory;\n -webkit-scroll-snap-points-x: repeat(100%);\n scroll-snap-points-x: repeat(100%);\n overscroll-behavior-x: none;\n\n will-change: transform; /* Avoid repaint on scroll */\n }\n `\n .autoRegister('mdw-tab-content');\n", "import CustomElement from '../core/CustomElement.js';\nimport ControlMixin from '../mixins/ControlMixin.js';\nimport ResizeObserverMixin from '../mixins/ResizeObserverMixin.js';\nimport StateMixin from '../mixins/StateMixin.js';\nimport TextFieldMixin from '../mixins/TextFieldMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\n/** @implements {HTMLTextAreaElement} */\nexport default class TextArea extends CustomElement\n .mixin(ThemableMixin)\n .mixin(StateMixin)\n .mixin(ControlMixin)\n .mixin(TextFieldMixin)\n .mixin(ResizeObserverMixin) {\n static { this.autoRegister('mdw-textarea'); }\n\n static {\n // eslint-disable-next-line no-unused-expressions\n this.css`\n /* https://m3.material.io/components/text-fields/specs */\n\n :host {\n display: inline-grid;\n grid-auto-flow: row;\n grid-template-rows: minmax(0, 100%);\n }\n\n :host(:is([filled][label])) {\n --control__margin-top: calc((var(--mdw-text-field__ratio) * 8px) + var(--mdw-typescale__body-small__line-height));\n --control__padding-top: 0px;\n --control__padding-bottom: calc((var(--mdw-text-field__ratio) * 8px) - 1px);\n --control__margin-bottom: 1px;\n }\n\n #label {\n --max-rows: none;\n --line-height: var(--mdw-typescale__body-large__line-height);\n --expected-height: calc((var(--control__margin-top) + var(--control__padding-top) + var(--line-height) + var(--control__padding-bottom) + var(--control__margin-bottom)));\n max-block-size: 100%;\n grid-row: 1 / 1;\n padding: 0;\n }\n\n @supports(height: 1lh) {\n #label {\n --line-height: 1lh;\n }\n }\n\n #slot {\n display: none;\n }\n\n #control {\n -ms-overflow-style: -ms-autohiding-scrollbar;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n\n box-sizing: border-box;\n block-size: 100%;\n\n min-block-size: var(--expected-height);\n /* Avoid clipping on resize */\n max-block-size: inherit;\n inline-size: 100% !important; /* !important to override user-agent resize */\n padding-inline: 16px;\n }\n\n #control[icon] {\n padding-inline-start: 0;\n }\n\n #control[minrows] {\n min-block-size: calc((var(--min-rows) * var(--line-height))\n + var(--control__margin-top)\n + var(--control__padding-top)\n + var(--control__padding-bottom)\n + var(--control__margin-bottom)\n );\n }\n\n #control[maxrows] {\n max-block-size: calc((var(--max-rows) * var(--line-height))\n + var(--control__margin-top)\n + var(--control__padding-top)\n + var(--control__padding-bottom)\n + var(--control__margin-bottom)\n );\n }\n\n #control:is([icon], [input-prefix]) {\n padding-inline-start: 0;\n }\n\n #control:is([trailing-icon], [input-suffix]) {\n padding-inline-end: 0;\n }\n\n #suffix {\n padding-inline-end: 16px;\n }\n\n mdw-icon {\n align-self: flex-start;\n\n margin-block-start: calc((var(--expected-height) - var(--mdw-icon__size)) / 2);\n }\n\n #control[fixed] {\n /* stylelint-disable-next-line plugin/no-unsupported-browser-features */\n resize: none;\n }\n\n `;\n this.childEvents({ slot: { slotchange: 'onSlotChange' } });\n this.on({\n composed() {\n const { control } = this.refs;\n control.setAttribute('input-prefix', '{input-prefix}');\n control.setAttribute('input-suffix', '{input-suffix}');\n control.setAttribute('minrows', '{minrows}');\n control.setAttribute('fixed', '{fixed}');\n control.setAttribute('icon', '{icon}');\n control.setAttribute('maxrows', '{maxrows}');\n },\n defaultValueAttrChanged(oldValue, newValue) {\n this.defaultValue = newValue;\n },\n defaultValueChanged() {\n this._value = this.#textarea.value;\n this.resize();\n },\n _maxHeightChanged(oldValue, newValue) {\n this.#textarea.style.setProperty('max-height', newValue);\n },\n _lineHeightChanged(oldValue, newValue) {\n this.refs.label.style.setProperty('--line-height', newValue);\n },\n minRowsChanged(oldValue, newValue) {\n this.refs.label.style.setProperty('--min-rows', `${newValue || 'none'}`);\n this.resize();\n },\n maxRowsChanged(oldValue, newValue) {\n this.refs.label.style.setProperty('--max-rows', `${newValue || 'none'}`);\n this.resize();\n },\n rowsChanged() {\n this.resize();\n },\n });\n }\n\n static supportsCSSLineHeightUnit = CSS.supports('height', '1lh');\n\n static controlTagName = 'textarea';\n\n static controlVoidElement = false;\n\n static clonedContentAttributes = [\n ...super.clonedContentAttributes,\n 'cols',\n 'dirname',\n 'maxlength',\n 'minlength',\n 'placeholder',\n 'rows',\n ];\n\n #updatingSlot = false;\n\n #textarea = /** @type {HTMLTextAreaElement} */ (this.refs.control);\n\n static {\n if (TextArea.supportsCSSLineHeightUnit) {\n this.childEvents({\n control: {\n input() {\n this.resize();\n },\n },\n });\n }\n }\n\n /**\n * @param {Event & {currentTarget:HTMLSlotElement}} event\n * @return {void}\n */\n onSlotChange({ currentTarget }) {\n const textarea = /** @type {HTMLTextAreaElement} */ (this.refs.control);\n const previousValue = textarea.defaultValue;\n textarea.replaceChildren(\n ...currentTarget.assignedNodes().map((child) => child.cloneNode(true)),\n );\n\n const newValue = textarea.defaultValue;\n if (previousValue !== newValue) {\n this.propChangedCallback('defaultValue', previousValue, newValue);\n }\n }\n\n /** @return {number} */\n resize() {\n const textarea = this.#textarea;\n textarea.style.removeProperty('height');\n\n // if (this.placeholder) textarea.removeAttribute('placeholder');\n\n if (!TextArea.supportsCSSLineHeightUnit) {\n const { lineHeight } = window.getComputedStyle(textarea);\n this._lineHeight = lineHeight;\n }\n\n if (this.minRows > 1 && textarea.rows < this.minRows) {\n textarea.rows = this.minRows;\n } else if (this.maxRows && textarea.rows > this.maxRows) {\n textarea.rows = this.maxRows;\n }\n if (!this.fixed) {\n while (textarea.scrollHeight > textarea.clientHeight) {\n if (this.maxRows && textarea.rows === this.maxRows) break;\n const lastClientHeight = textarea.clientHeight;\n textarea.rows++;\n if (lastClientHeight === textarea.clientHeight) {\n textarea.rows--;\n break;\n }\n }\n while (textarea.scrollHeight === textarea.clientHeight) {\n if (textarea.rows === 1) break;\n if (this.minRows > 1 && textarea.rows === this.minRows) break;\n const lastClientHeight = textarea.clientHeight;\n textarea.rows--;\n if ((lastClientHeight === textarea.clientHeight)\n || (textarea.scrollHeight > textarea.clientHeight)) {\n textarea.rows++;\n break;\n }\n }\n }\n\n if (textarea.selectionEnd === textarea.value.length) {\n textarea.scrollTop = textarea.scrollHeight;\n }\n\n this.rows = textarea.rows;\n // if (this.placeholder) textarea.setAttribute('placeholder', this.placeholder);\n return this.rows;\n }\n\n formResetCallback() {\n this.#textarea.value = this.defaultValue;\n this._value = this.#textarea.value;\n super.formResetCallback();\n }\n\n get updatingSlot() { return this.#updatingSlot; }\n\n get defaultValue() {\n return this.#textarea.defaultValue;\n }\n\n set defaultValue(value) {\n const previousValue = this.#textarea.defaultValue;\n this.#textarea.defaultValue = value;\n if (previousValue !== this.#textarea.defaultValue) {\n this.propChangedCallback('defaultValue', previousValue, this.defaultValue);\n }\n this.textContent = this.#textarea.defaultValue;\n }\n\n // @ts-ignore @override\n\n get type() { return 'textarea'; }\n\n get textLength() { return this.#textarea.textLength; }\n\n get select() { return this.#textarea.select; }\n\n get selectionDirection() { return this.#textarea.selectionDirection; }\n\n set selectionDirection(value) { this.#textarea.selectionDirection = value; }\n\n get selectionStart() { return this.#textarea.selectionStart; }\n\n set selectionStart(value) { this.#textarea.selectionStart = value; }\n\n get selectionEnd() { return this.#textarea.selectionEnd; }\n\n set selectionEnd(value) { this.#textarea.selectionEnd = value; }\n\n get setRangeText() { return this.#textarea.setRangeText; }\n\n get setSelectionRange() { return this.#textarea.setSelectionRange; }\n\n /** @param {ResizeObserverEntry} entry */\n onResizeObserved(entry) {\n super.onResizeObserved(entry);\n this.resize();\n }\n}\n\nTextArea.propList.delete('type');\n\nTextArea.prototype._maxHeight = TextArea.prop('_maxHeight');\nTextArea.prototype.fixed = TextArea.prop('fixed', { type: 'boolean' });\nTextArea.prototype.minRows = TextArea.prop('minRows', { attr: 'minrows', type: 'integer', empty: 0 });\nTextArea.prototype.maxRows = TextArea.prop('maxRows', { attr: 'maxrows', type: 'integer', empty: 0 });\nTextArea.prototype._lineHeight = TextArea.prop('_lineHeight');\n\n// https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element\n\nconst DOMString = { nullParser: String };\nTextArea.prototype.cols = TextArea.prop('cols', { type: 'integer', empty: 0 });\nTextArea.prototype.dirName = TextArea.prop('dirName', { attr: 'dirname', ...DOMString });\nTextArea.prototype.maxLength = TextArea.prop('maxLength', { attr: 'maxlength', type: 'integer', empty: 0 });\nTextArea.prototype.minLength = TextArea.prop('minLength', { attr: 'minlength', type: 'integer', empty: 0 });\nTextArea.prototype.placeholder = TextArea.prop('placeholder', DOMString);\nTextArea.prototype.rows = TextArea.prop('rows', { type: 'integer', empty: 1 });\nTextArea.prototype.wrap = TextArea.prop('wrap', DOMString);\n\n// Not in spec, but plays nice with HTML linters\nTextArea.prototype.defaultValueAttr = TextArea.prop('defaultValueAttr', { attr: 'value', ...DOMString });\n", "import Headline from './Headline.js';\n\nexport default Headline\n .extend()\n .expressions({\n computeAriaLevel({ ariaLevel, size }) {\n if (ariaLevel) return ariaLevel;\n if (size === 'medium') return '5';\n if (size === 'small') return '6';\n return '4';\n },\n })\n .css`\n :host {\n font: var(--mdw-typescale__title-large__font);\n letter-spacing: var(--mdw-typescale__title-large__letter-spacing);\n }\n \n :host([size=\"medium\"]) {\n font: var(--mdw-typescale__title-medium__font);\n letter-spacing: var(--mdw-typescale__title-medium__letter-spacing);\n }\n \n :host([size=\"small\"]) {\n font: var(--mdw-typescale__title-small__font);\n letter-spacing: var(--mdw-typescale__title-small__letter-spacing);\n }\n `\n .autoRegister('mdw-title');\n", "import CustomElement from '../core/CustomElement.js';\nimport { ELEMENT_STYLER_TYPE } from '../core/customTypes.js';\nimport AriaToolbarMixin from '../mixins/AriaToolbarMixin.js';\nimport ResizeObserverMixin from '../mixins/ResizeObserverMixin.js';\nimport ScrollListenerMixin from '../mixins/ScrollListenerMixin.js';\nimport SurfaceMixin from '../mixins/SurfaceMixin.js';\nimport ThemableMixin from '../mixins/ThemableMixin.js';\n\nexport default CustomElement\n .mixin(ThemableMixin)\n .mixin(SurfaceMixin) // TopAppBars are non-shaped surfaces\n .mixin(AriaToolbarMixin)\n .mixin(ScrollListenerMixin)\n .mixin(ResizeObserverMixin)\n .extend()\n .set({\n elevated: true,\n })\n .observe({\n headline: 'string',\n _raised: 'boolean', // Change to raw value instead of computed\n hideOnScroll: 'boolean',\n size: { value: /** @type {'small'|'medium'|'large'|null} */ (null) },\n _cssPosition: {\n /** @type {'sticky'|'relative'} */\n empty: 'relative',\n },\n _visibleStart: { type: 'float', default: 0 },\n _translateY: { type: 'float', empty: 0 },\n _duration: { type: 'float', empty: 0 },\n _easing: { empty: 'ease-in' },\n _headlineOpacity: { type: 'float', default: 0 },\n /** Convert to observable */\n ariaLabel: 'string',\n color: { empty: 'surface' },\n })\n .observe({\n _scrollDirection: {\n /**\n * @param {'up'|'down'} oldValue\n * @param {'up'|'down'} newValue\n */\n changedCallback(oldValue, newValue) {\n if (newValue === 'down') {\n if (this._cssPosition !== 'sticky') return;\n // Was sticky, switch to relative and let appbar scroll away\n this._cssPosition = 'relative';\n this._translateY = this.scrollListenerPositionY;\n return;\n }\n if (this._visibleStart < 1) return;\n // Align appbar.bottom with scroll position (top of screen)\n this._translateY = this.scrollListenerPositionY - this.refs.surface.scrollHeight;\n },\n },\n _surfaceStyle: {\n ...ELEMENT_STYLER_TYPE,\n get({ hideOnScroll, _cssPosition, _translateY, _duration, _easing }) {\n if (!hideOnScroll) {\n return null;\n }\n return {\n target: 'surface',\n styles: {\n position: _cssPosition,\n transform: `translateY(${_translateY}px)`,\n },\n timing: {\n duration: _duration,\n easing: _easing,\n },\n };\n },\n },\n _headlineStyle: {\n ...ELEMENT_STYLER_TYPE,\n get({ size, _headlineOpacity }) {\n if (size !== 'medium' && size !== 'large') return null;\n return {\n target: 'headline',\n styles: {\n opacity: _headlineOpacity ?? 0,\n },\n timing: {\n duration: 200,\n },\n };\n },\n },\n })\n .html/* html */`\n <slot id=leading name=leading on-slotchange={refreshTabIndexes}></slot>\n <div id=headline ink={ink} color={color} type-style={typeStyle} on-slotchange={refreshTabIndexes}>\n {headline}\n <slot id=headline-slot></slot>\n </div>\n <slot id=trailing name=trailing on-slotchange={refreshTabIndexes}></slot>\n <div _if=${({ size }) => size === 'medium' || size === 'large'} id=companion aria-hidden=true size={size}>\n <div _if={showSurfaceTint} id=companion-tint raised={_raised} class=surface-tint color={color}></div>\n <slot id=companion-slot name=companion size={size}>{headline}</span>\n </div>\n `\n .on({\n composed({ inline }) {\n const { surface, leading, headline, trailing } = this.refs;\n surface.append(leading, headline, trailing);\n surface.setAttribute('size', '{size}');\n surface.setAttribute('hide-on-scroll', '{hideOnScroll}');\n surface.setAttribute('role', 'toolbar');\n surface.setAttribute('aria-label', '{ariaLabel}');\n surface.setAttribute(\n 'aria-labelledby',\n inline(({ ariaLabel }) => (ariaLabel ? null : 'headline')),\n );\n },\n scrollListenerPositionYChanged(oldValue, newValue) {\n this._raised = (newValue > 0);\n if (this.size === 'medium' || this.size === 'large') {\n const max = this.refs.companion.scrollHeight;\n const min = (0.5 * max);\n this._headlineOpacity = Math.max(0, Math.min(1, (newValue - min) / (max - min)));\n }\n\n if (!this.hideOnScroll) return;\n\n this._duration = 0;\n if (newValue <= 0) {\n // Set at rest (top of parent, but allow overscroll)\n this._cssPosition = 'relative';\n this._translateY = 0;\n this._visibleStart = 0;\n } else if (newValue < this._translateY) {\n // Align appbar.top with scroll position (top of screen)\n this._cssPosition = 'sticky';\n this._translateY = 0;\n this._visibleStart = 0;\n } else if (this._cssPosition !== 'sticky') {\n this._visibleStart = (newValue - this._translateY) / this.refs.surface.scrollHeight;\n }\n\n this._scrollDirection = newValue > oldValue ? 'down' : 'up';\n },\n })\n .methods({\n onScrollIdle() {\n const _visibleStart = this._visibleStart;\n if (this._headlineOpacity > 0) {\n // Fill in opacity on idle\n this._headlineOpacity = 1;\n }\n if (_visibleStart <= 0) return;\n if (_visibleStart >= 1) return;\n if (this.scrollListenerPositionY < (this.refs.surface.scrollHeight)) return;\n if (_visibleStart <= 0.5) {\n // Reveal all\n this._duration = 250;\n this._easing = 'ease-in';\n this._cssPosition = 'relative';\n this._translateY = this.scrollListenerPositionY;\n this._headlineOpacity = 1;\n } else {\n this._duration = 200;\n this._easing = 'ease-out';\n this._cssPosition = 'relative';\n this._translateY = this.scrollListenerPositionY - this.refs.surface.scrollHeight;\n }\n },\n })\n .define({\n ariaActiveDescendantElement: {\n get() {\n // @ts-ignore Accessibility Object Model\n return this.refs.surface.ariaActiveDescendantElement;\n },\n set(value) {\n // @ts-ignore Accessibility Object Model\n this.refs.surface.ariaActiveDescendantElement = value;\n },\n },\n })\n .on({\n connected() {\n const { surface } = this.refs;\n if (surface.offsetParent) {\n this.startScrollListener(surface.offsetParent ?? window);\n } else {\n const resizeObserver = new ResizeObserver(() => {\n this.startScrollListener(surface.offsetParent ?? window);\n resizeObserver.disconnect();\n });\n resizeObserver.observe(surface);\n }\n },\n disconnected() {\n this.clearScrollListener();\n },\n })\n .css`\n /* https://m3.material.io/components/bottom-app-bar/specs */\n\n :host {\n --mdw-bg: var(--mdw-color__surface);\n --mdw-ink: var(--mdw-color__on-surface);\n --mdw-surface__tint: var(--mdw-surface__tint__0);\n --mdw-surface__tint__raised: var(--mdw-surface__tint__2);\n display: contents;\n\n z-index:2;\n }\n\n #surface {\n position: sticky;\n inset-block-start: 0;\n\n display: grid;\n\n align-items: center;\n gap: 12px;\n grid-auto-flow: row;\n grid-template-rows: minmax(64px,min-content);\n grid-template-columns: minmax(auto,1fr) minmax(0,auto) minmax(auto,1fr);\n overflow-x: clip; /* Clip oversized touch targets to avoid scroll-bars */\n overflow-y: visible;\n\n box-sizing: border-box;\n inline-size: 100%;\n max-inline-size: 100%;\n\n /* 16px from icon */\n /* inset = (button.width / 2) - (icon.width / 2) */\n /* paddingInline = 16px - inset */\n /* paddingInlineStart = 16px - ((48px / 2) - (24px / 2)) */\n /* paddingInlineEnd = 16px - ((48px / 2) - (30px / 2)) */\n\n padding-inline: 4px;\n\n pointer-events: auto;\n\n filter: none; /* Never receive shadow */\n\n z-index: 5;\n /* inset-inline: 0; */\n\n background-color: rgb(var(--mdw-bg));\n color: rgb(var(--mdw-ink));\n\n transition: grid-template-columns 100ms;\n\n }\n\n #surface-tint {\n position: 0;\n\n z-index: 1;\n }\n\n #leading {\n justify-self: flex-start;\n\n display: flex;\n align-items: center;\n\n grid-column: 1;\n grid-row: 1;\n }\n\n #headline {\n display: inline-block;\n\n overflow: clip hidden;\n\n max-inline-size: 100%;\n\n grid-column: 2;\n grid-row: 1;\n\n font: var(--mdw-typescale__title-large__font);\n letter-spacing: var(--mdw-typescale__title-large__letter-spacing);\n\n text-overflow: ellipsis;\n text-transform: none;\n white-space: nowrap;\n word-break: break-word;\n\n transition-duration: 200ms;\n transition-property: transform, opacity, color, background-color;\n }\n\n #trailing {\n justify-self: flex-end;\n\n display: flex;\n align-items: center;\n gap: 8px;\n justify-content: flex-end;\n\n grid-column: 3;\n grid-row: 1;\n\n color: var(--mdw-color__on-surface-variant);\n }\n\n /* Medium */\n #companion {\n position: relative;\n\n display: flex;\n align-items: flex-end;\n\n /**\n * Total Height = 112px\n * Bar = 12 + 40 + 12 (64)\n * Companion = 112px - 64\n * Companion Bottom = 20px\n * Companion = 28px\n * Shift up = 1lh - 28px\n */\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin-block-start: calc(28px - var(--mdw-typescale__headline-small__line-height));\n padding-block-end: 20px;\n\n padding-inline: 16px;\n\n background-color: rgb(var(--mdw-bg));\n box-shadow: none;\n\n font: var(--mdw-typescale__headline-small__font);\n letter-spacing: var(--mdw-typescale__headline-small__letter-spacing);\n white-space: nowrap;\n }\n\n #companion[size=\"large\"] {\n /**\n * Total Height = 152px\n * Bar = 12 + 40 + 12 (64)\n * Companion = 152px - 64\n * Companion Bottom = 20px\n * Companion = 68px\n * Shift up = 2lh - 68px\n */\n\n min-block-size: calc(2 * var(--mdw-typescale__headline-medium__line-height));\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin-block-start: calc(68px - (2 * var(--mdw-typescale__headline-medium__line-height)));\n\n font: var(--mdw-typescale__headline-medium__font);\n letter-spacing: var(--mdw-typescale__headline-medium__letter-spacing);\n white-space: normal;\n }\n\n @supports(width: 1lh) {\n #companion {\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin-block-start: calc(28px - 1lh);\n }\n\n #companion[size=\"large\"] {\n min-block-size: 2lh;\n /* stylelint-disable-next-line declaration-property-value-disallowed-list */\n margin-block-start: calc(68px - 2lh);\n }\n }\n\n #companion-slot {\n display: block;\n overflow-x: clip;\n overflow-y: hidden;\n\n text-overflow: ellipsis;\n text-transform: none;\n word-break: break-word;\n }\n\n #companion-slot[size=\"large\"] {\n max-block-size: calc(2 * var(--mdw-typescale__headline-medium__line-height));\n }\n\n @supports(-webkit-line-clamp: 2) {\n #companion-slot[size=\"large\"] {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n\n max-block-size: none;\n }\n }\n\n #surface[hide-on-scroll] {\n position: relative;\n\n inset-block-start: 0;\n\n transform: translateY(0);\n\n will-change: transform, position;\n }\n\n #surface[size=\"small\"] {\n gap: 4px;\n grid-template-columns: auto 1fr auto;\n }\n\n #headline:is([size=\"medium\"],[size=\"large\"]) {\n opacity: 0;\n\n will-change: opacity;\n }\n\n `\n .autoRegister('mdw-top-app-bar');\n", "import { css } from '../core/template.js';\n\nimport {\n generateThemeCSS,\n generateTypographyGlobalCSS,\n themeOptionsFromSearchParams,\n} from './index.js';\n\nconst rules = [\n generateThemeCSS(themeOptionsFromSearchParams(new URL(import.meta.url).searchParams)),\n generateTypographyGlobalCSS(),\n].join('\\n');\n\nconst parsed = css`${rules}`;\nif (parsed instanceof HTMLStyleElement) {\n document.head.append(parsed);\n} else {\n document.adoptedStyleSheets = [\n ...document.adoptedStyleSheets,\n parsed,\n ];\n}\n", "import { COLOR_KEYWORDS } from '../utils/color_keywords.js';\nimport { getScheme } from '../utils/hct/helper.js';\nimport { svgToCSSURL } from '../utils/svg.js';\n\n/**\n * @typedef {Object} ThemeOptions\n * @prop {string} [color]\n * @prop {Iterable<[string,string?]>} [custom] Map()\n * @prop {'auto'|'light'|'dark'} [lightness='auto']\n * @return {string}\n */\n\n/**\n * @param {string} shape\n * @return {string}\n */\nfunction getShapeMaskSVG(shape) {\n return [\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">',\n `<defs><path id=\"a\" d=\"${shape}\"/></defs>`,\n '<use href=\"#a\" transform=\"scale(.666)\"/>',\n '<use href=\"#a\" transform=\"translate(8) scale(.666)\"/>',\n '<use href=\"#a\" transform=\"matrix(.666 0 0 .666 0 8)\"/>',\n '<use href=\"#a\" transform=\"matrix(.666 0 0 .666 8 8)\"/>',\n '<path d=\"M8 0h8v24H8Z\"/><path d=\"M0 8h24v8H0Z\"/>',\n '</svg>',\n ].join('');\n}\n\n/**\n * @param {string} shape\n * @param {'top-left'|'top-right'|'bottom-left'|'bottom-right'} corner\n * @param {boolean} [convex]\n * @return {string}\n */\nfunction getShapeCornerSVGs(shape, corner, convex) {\n const path = `<path ${[\n `d=\"${shape}\"`,\n 'vector-effect=\"non-scaling-stroke\"',\n `transform-origin=\"${corner.replace('-', ' ')}\"`,\n 'stroke-linejoin=\"miter\"',\n 'transform=\"scale(2)\"',\n `stroke-width=\"${convex ? 4 : 2}px\"`,\n 'stroke=\"black\"',\n 'fill=\"none\"',\n ].join(' ')}/>`;\n\n return [\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">',\n convex\n ? [\n '<mask id=\"m\">',\n '<rect x=\"0\" y=\"0\" width=\"24\" height=\"24\" fill=\"white\"/>',\n `<path d=\"${shape}\" transform-origin=\"${corner.replace('-', ' ')}\" transform=\"scale(2)\"/>`,\n '</mask>',\n `<g mask=\"url(#m)\">${path}</g>`,\n ].join('')\n : path,\n '</svg>',\n ].join('');\n}\n\n/**\n * @return {string}\n */\nfunction getShapeEdgesSVGs() {\n return [\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">',\n '<rect x=\"0\" y=\"0\" width=\"24\" height=\"24\" vector-effect=\"non-scaling-stroke\" stroke-width=\"2px\" stroke=\"black\" fill=\"none\"/>',\n '</svg>',\n ].join('');\n}\n\nconst CIRCLE_PATH = 'M0 12A12 12 0 1012 0 12 12 0 000 12Z';\n// const SQUIRCLE_PATH = 'M12 24C17.2583 24 20.1815 24 22.0908 22.0908 24 20.1815 24 17.2583 24 12 24 6.7417 24 3.8185 22.0908 1.9092 20.1815-0 17.2583-0 12-0 6.7417-0 3.8185-0 1.9092 1.9092-0 3.8185-0 6.7417-0 12-0 17.2583-0 20.1815 1.9092 22.0908 3.8185 24 6.7417 24 12 24Z';\nconst DIAMOND_PATH = 'M 0 12 12 0 24 12 12 24 Z';\nconst SQUIRCLE_PATH = 'M12 24C17.2583 24 20.1815 24 22.0908 22.0908 24 20.1815 24 17.2583 24 12 24 6.7417 24 3.8185 22.0908 1.9092 20.1815-0 17.2583-0 12-0 6.7417-0 3.8185-0 1.9092 1.9092-0 3.8185-0 6.7417-0 12-0 17.2583-0 20.1815 1.9092 22.0908 3.8185 24 6.7417 24 12 24Z';\nconst HALF_NOTCH_PATH = 'M0 6H6V0H18V6H24V18H18V24H6V18H0Z';\n\nconst SHAPE_ROUNDED_DEFAULT = {\n size: {\n extraSmall: '4px',\n small: '8px',\n medium: '12px',\n large: '16px',\n extraLarge: '28px',\n full: '32px',\n },\n /** @type {string?} */\n mask: CIRCLE_PATH, // CIRCLE_PATH\n convex: false,\n};\n\nconst SHAPE_CUT_DEFAULT = {\n ...SHAPE_ROUNDED_DEFAULT,\n size: {\n extraSmall: '4px',\n small: '8px',\n medium: '12px',\n large: '16px',\n extraLarge: '28px',\n full: '32px',\n },\n mask: DIAMOND_PATH,\n};\n\nconst SHAPE_SQUIRCLE_DEFAULT = {\n ...SHAPE_ROUNDED_DEFAULT,\n mask: SQUIRCLE_PATH,\n};\n\nconst SP = 1 / 16;\n\nconst TYPOGRAPHY_DEFAULT = {\n face: {\n brand: '\"Roboto Medium\", Roboto, -apple-system, BlinkMacSystemFont, \"Segoe UI Variable Display\", Helvetica, \"Segoe UI\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"',\n plain: '\"Roboto Regular\", Roboto, -apple-system, BlinkMacSystemFont, \"Segoe UI Variable Text\", Helvetica, \"Segoe UI\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"',\n weight: {\n regular: 400,\n medium: 500,\n },\n },\n scale: {\n display: {\n large: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 64,\n fontSize: 57,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n medium: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 52,\n fontSize: 45,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n small: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 44,\n fontSize: 36,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n },\n headline: {\n large: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 40,\n fontSize: 32,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n medium: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 36,\n fontSize: 28,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n small: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 32,\n fontSize: 24,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n },\n title: {\n large: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 28,\n fontSize: 22,\n letterSpacing: 0,\n weight: 'var(--mdw-typeface__weight-medium)', // Figma style has regular\n },\n medium: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 24,\n fontSize: 16,\n letterSpacing: 0.15,\n weight: 'var(--mdw-typeface__weight-medium)',\n },\n small: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 20,\n fontSize: 14,\n letterSpacing: 0.1,\n weight: 'var(--mdw-typeface__weight-medium)',\n },\n },\n label: {\n large: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 20,\n fontSize: 14,\n letterSpacing: 0.1,\n weight: 'var(--mdw-typeface__weight-medium)',\n },\n medium: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 16,\n fontSize: 12,\n letterSpacing: 0.5,\n weight: 'var(--mdw-typeface__weight-medium)',\n },\n small: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 16,\n fontSize: 11,\n letterSpacing: 0.5,\n weight: 'var(--mdw-typeface__weight-medium)',\n },\n },\n body: {\n large: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 24,\n fontSize: 16,\n letterSpacing: 0.5, // Figma text has 0.15\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n medium: {\n fontFamily: 'var(--mdw-typeface__plain)',\n lineHeight: 20,\n fontSize: 14,\n letterSpacing: 0.25,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n small: {\n fontFamily: 'var(--mdw-typeface__brand)',\n lineHeight: 16,\n fontSize: 12,\n letterSpacing: 0.4,\n weight: 'var(--mdw-typeface__weight-regular)',\n },\n },\n },\n};\n\n/**\n * @param {typeof TYPOGRAPHY_DEFAULT} config\n * @return {string}\n */\nexport function generateTypographyCSS(config = TYPOGRAPHY_DEFAULT) {\n return /* css */ `\n :root {\n --mdw-typeface__brand: ${config.face.brand};\n --mdw-typeface__weight-regular: ${config.face.weight.regular};\n --mdw-typeface__weight-medium: ${config.face.weight.medium};\n --mdw-typeface__plain: ${config.face.plain};\n\n --mdw-typescale__display-large__font-family: ${config.scale.display.large.fontFamily};\n --mdw-typescale__display-large__line-height: calc(${config.scale.display.large.lineHeight} * 0.0625rem);\n --mdw-typescale__display-large__font-size: calc(${config.scale.display.large.fontSize} * 0.0625rem);\n --mdw-typescale__display-large__letter-spacing: calc(${config.scale.display.large.letterSpacing} * 0.0625rem);\n --mdw-typescale__display-large__font-weight: ${config.scale.display.large.weight};\n\n --mdw-typescale__display-medium__font-family: ${config.scale.display.medium.fontFamily};\n --mdw-typescale__display-medium__line-height: calc(${config.scale.display.medium.lineHeight} * 0.0625rem);\n --mdw-typescale__display-medium__font-size: calc(${config.scale.display.medium.fontSize} * 0.0625rem);\n --mdw-typescale__display-medium__letter-spacing: calc(${config.scale.display.medium.letterSpacing} * 0.0625rem);\n --mdw-typescale__display-medium__font-weight: ${config.scale.display.medium.weight};\n\n --mdw-typescale__display-small__font-family: ${config.scale.display.small.fontFamily};\n --mdw-typescale__display-small__line-height: calc(${config.scale.display.small.lineHeight} * 0.0625rem);\n --mdw-typescale__display-small__font-size: calc(${config.scale.display.small.fontSize} * 0.0625rem);\n --mdw-typescale__display-small__letter-spacing: calc(${config.scale.display.small.letterSpacing} * 0.0625rem);\n --mdw-typescale__display-small__font-weight: ${config.scale.display.small.weight};\n\n --mdw-typescale__headline-large__font-family: ${config.scale.headline.large.fontFamily};\n --mdw-typescale__headline-large__line-height: calc(${config.scale.headline.large.lineHeight} * 0.0625rem);\n --mdw-typescale__headline-large__font-size: calc(${config.scale.headline.large.fontSize} * 0.0625rem);\n --mdw-typescale__headline-large__letter-spacing: calc(${config.scale.headline.large.letterSpacing} * 0.0625rem);\n --mdw-typescale__headline-large__font-weight: ${config.scale.headline.large.weight};\n\n --mdw-typescale__headline-medium__font-family: ${config.scale.headline.medium.fontFamily};\n --mdw-typescale__headline-medium__line-height: calc(${config.scale.headline.medium.lineHeight} * 0.0625rem);\n --mdw-typescale__headline-medium__font-size: calc(${config.scale.headline.medium.fontSize} * 0.0625rem);\n --mdw-typescale__headline-medium__letter-spacing: calc(${config.scale.headline.medium.letterSpacing} * 0.0625rem);\n --mdw-typescale__headline-medium__font-weight: ${config.scale.headline.medium.weight};\n\n --mdw-typescale__headline-small__font-family: ${config.scale.headline.small.fontFamily};\n --mdw-typescale__headline-small__line-height: calc(${config.scale.headline.small.lineHeight} * 0.0625rem);\n --mdw-typescale__headline-small__font-size: calc(${config.scale.headline.small.fontSize} * 0.0625rem);\n --mdw-typescale__headline-small__letter-spacing: calc(${config.scale.headline.small.letterSpacing} * 0.0625rem);\n --mdw-typescale__headline-small__font-weight: ${config.scale.headline.small.weight};\n\n --mdw-typescale__title-large__font-family: ${config.scale.title.large.fontFamily};\n --mdw-typescale__title-large__line-height: calc(${config.scale.title.large.lineHeight} * 0.0625rem);\n --mdw-typescale__title-large__font-size: calc(${config.scale.title.large.fontSize} * 0.0625rem);\n --mdw-typescale__title-large__letter-spacing: calc(${config.scale.title.large.letterSpacing} * 0.0625rem);\n --mdw-typescale__title-large__font-weight: ${config.scale.title.large.weight};\n\n --mdw-typescale__title-medium__font-family: ${config.scale.title.medium.fontFamily};\n --mdw-typescale__title-medium__line-height: calc(${config.scale.title.medium.lineHeight} * 0.0625rem);\n --mdw-typescale__title-medium__font-size: calc(${config.scale.title.medium.fontSize} * 0.0625rem);\n --mdw-typescale__title-medium__letter-spacing: calc(${config.scale.title.medium.letterSpacing} * 0.0625rem);\n --mdw-typescale__title-medium__font-weight: ${config.scale.title.medium.weight};\n\n --mdw-typescale__title-small__font-family: ${config.scale.title.small.fontFamily};\n --mdw-typescale__title-small__line-height: calc(${config.scale.title.small.lineHeight} * 0.0625rem);\n --mdw-typescale__title-small__font-size: calc(${config.scale.title.small.fontSize} * 0.0625rem);\n --mdw-typescale__title-small__letter-spacing: calc(${config.scale.title.small.letterSpacing} * 0.0625rem);\n --mdw-typescale__title-small__font-weight: ${config.scale.title.small.weight};\n\n --mdw-typescale__label-large__font-family: ${config.scale.label.large.fontFamily};\n --mdw-typescale__label-large__line-height: calc(${config.scale.label.large.lineHeight} * 0.0625rem);\n --mdw-typescale__label-large__font-size: calc(${config.scale.label.large.fontSize} * 0.0625rem);\n --mdw-typescale__label-large__letter-spacing: calc(${config.scale.label.large.letterSpacing} * 0.0625rem);\n --mdw-typescale__label-large__font-weight: ${config.scale.label.large.weight};\n\n --mdw-typescale__label-medium__font-family: ${config.scale.label.medium.fontFamily};\n --mdw-typescale__label-medium__line-height: calc(${config.scale.label.medium.lineHeight} * 0.0625rem);\n --mdw-typescale__label-medium__font-size: calc(${config.scale.label.medium.fontSize} * 0.0625rem);\n --mdw-typescale__label-medium__letter-spacing: calc(${config.scale.label.medium.letterSpacing} * 0.0625rem);\n --mdw-typescale__label-medium__font-weight: ${config.scale.label.medium.weight};\n\n --mdw-typescale__label-small__font-family: ${config.scale.label.small.fontFamily};\n --mdw-typescale__label-small__line-height: calc(${config.scale.label.small.lineHeight} * 0.0625rem);\n --mdw-typescale__label-small__font-size: calc(${config.scale.label.small.fontSize} * 0.0625rem);\n --mdw-typescale__label-small__letter-spacing: calc(${config.scale.label.small.letterSpacing} * 0.0625rem);\n --mdw-typescale__label-small__font-weight: ${config.scale.label.small.weight};\n\n --mdw-typescale__body-large__font-family: ${config.scale.body.large.fontFamily};\n --mdw-typescale__body-large__line-height: calc(${config.scale.body.large.lineHeight} * 0.0625rem);\n --mdw-typescale__body-large__font-size: calc(${config.scale.body.large.fontSize} * 0.0625rem);\n --mdw-typescale__body-large__letter-spacing: calc(${config.scale.body.large.letterSpacing} * 0.0625rem);\n --mdw-typescale__body-large__font-weight: ${config.scale.body.large.weight};\n\n --mdw-typescale__body-medium__font-family: ${config.scale.body.medium.fontFamily};\n --mdw-typescale__body-medium__line-height: calc(${config.scale.body.medium.lineHeight} * 0.0625rem);\n --mdw-typescale__body-medium__font-size: calc(${config.scale.body.medium.fontSize} * 0.0625rem);\n --mdw-typescale__body-medium__letter-spacing: calc(${config.scale.body.medium.letterSpacing} * 0.0625rem);\n --mdw-typescale__body-medium__font-weight: ${config.scale.body.medium.weight};\n\n --mdw-typescale__body-small__font-family: ${config.scale.body.small.fontFamily};\n --mdw-typescale__body-small__line-height: calc(${config.scale.body.small.lineHeight} * 0.0625rem);\n --mdw-typescale__body-small__font-size: calc(${config.scale.body.small.fontSize} * 0.0625rem);\n --mdw-typescale__body-small__letter-spacing: calc(${config.scale.body.small.letterSpacing} * 0.0625rem);\n --mdw-typescale__body-small__font-weight: ${config.scale.body.small.weight};\n }`;\n}\n\n/** @return {string} */\nexport function generateTypographyGlobalCSS() {\n return /* css */ `\n :root {${['display', 'headline', 'title', 'label', 'body']\n .map((style) => ['large', 'medium', 'small']\n .map((size) => `--mdw-typescale__${style}-${size}__font: ${\n [\n `var(--mdw-typescale__${style}-${size}__font-weight)`,\n `var(--mdw-typescale__${style}-${size}__font-size)/var(--mdw-typescale__${style}-${size}__line-height)`,\n `var(--mdw-typescale__${style}-${size}__font-family)`,\n ].join(' ')\n };`).join('\\n'))\n .join('\\n')}}`;\n}\n\n/**\n * @param {typeof SHAPE_ROUNDED_DEFAULT} config\n * @return {string}\n */\nexport function generateShapeCSS(config = SHAPE_ROUNDED_DEFAULT) {\n return /* css */`\n :root {\n --mdw-shape__extra-small: ${config.size.extraSmall};\n --mdw-shape__small: ${config.size.small};\n --mdw-shape__medium: ${config.size.medium};\n --mdw-shape__large: ${config.size.large};\n --mdw-shape__extra-large: ${config.size.extraLarge};\n --mdw-shape__full: ${config.size.full};\n --mdw-shape__rounded: ${config.mask ? '0' : '1'};\n --mdw-shape__outline__background: ${config.mask ? 'currentColor' : 'transparent'};\n --mdw-shape__convex: ${config.convex ? '1' : '0'};\n --mdw-shape__mask-border-source: ${config.mask ? svgToCSSURL(getShapeMaskSVG(config.mask)) : 'none'};\n --mdw-shape__mask-image__top-left: ${config.mask ? svgToCSSURL(getShapeCornerSVGs(config.mask, 'top-left')) : 'none'};\n --mdw-shape__mask-image__top-right: ${config.mask ? svgToCSSURL(getShapeCornerSVGs(config.mask, 'top-right')) : 'none'};\n --mdw-shape__mask-image__bottom-right: ${config.mask ? svgToCSSURL(getShapeCornerSVGs(config.mask, 'bottom-right')) : 'none'};\n --mdw-shape__mask-image__bottom-left: ${config.mask ? svgToCSSURL(getShapeCornerSVGs(config.mask, 'bottom-left')) : 'none'};\n --mdw-shape__mask-image__edges: ${config.mask ? svgToCSSURL(getShapeEdgesSVGs()) : 'none'};\n }\n `;\n}\n\n/**\n * @param {string} content\n * @return {HTMLStyleElement } element\n */\nfunction addStyle(content) {\n const element = document.createElement('style');\n element.textContent = content;\n document.head.append(element);\n return element;\n}\n\n/**\n * @param {ThemeOptions} options\n * @return {string}\n */\nexport function generateColorCSS({ color = '#6750A4', custom = [], lightness = 'light' }) {\n /** @type {[string,string][]} */\n const parsedColors = [...custom]\n .map(([name, hex]) => [name, COLOR_KEYWORDS.get(hex) || hex || COLOR_KEYWORDS.get(name)]);\n const scheme = getScheme(color, parsedColors);\n if (lightness === 'dark') {\n return scheme.dark;\n }\n return scheme.light;\n}\n\n/**\n * @param {ThemeOptions} options\n * @return {void}\n */\nexport function setupTheme({ color = '#6750A4', custom = [], lightness = 'auto' }) {\n /** @type {[string,string][]} */\n const parsedColors = [...custom]\n .map(([name, hex]) => [name, COLOR_KEYWORDS.get(hex) || hex || COLOR_KEYWORDS.get(name)]);\n const scheme = getScheme(color, parsedColors);\n if (lightness === 'dark') {\n addStyle(scheme.dark);\n } else {\n addStyle(scheme.light);\n if (lightness !== 'light') {\n addStyle(scheme.dark).media = '(prefers-color-scheme:dark)';\n }\n }\n addStyle(generateShapeCSS());\n addStyle(generateTypographyCSS());\n}\n\n/**\n * @param {URLSearchParams} searchParams\n * @return {ThemeOptions}\n */\nexport function themeOptionsFromSearchParams(searchParams) {\n const color = searchParams.get('color') || '#6750A4';\n\n /** @type {[string,string?][]} */\n const custom = searchParams.getAll('custom')\n .flatMap((c) => c.split(','))\n .map((c) => c.split(':'));\n\n const lightness = searchParams.get('lightness') ?? 'auto';\n return { color, custom, lightness };\n}\n\n/**\n * @param {ThemeOptions} options\n * @return {string}\n */\nexport function generateThemeCSS({ color = '#6750A4', custom = [], lightness = 'auto' }) {\n const shapeCss = generateShapeCSS();\n const typographyCss = generateTypographyCSS();\n let colorCss;\n if (lightness === 'light' || lightness === 'dark') {\n colorCss = generateColorCSS({ color, custom, lightness });\n } else {\n colorCss = `\n ${generateColorCSS({ color, custom, lightness: 'light' })}\n @media (prefers-color-scheme:dark) {\n :root { color-scheme: dark; }\n ${generateColorCSS({ color, custom, lightness: 'dark' })}\n }`;\n }\n return [\n shapeCss,\n typographyCss,\n colorCss,\n ].join('\\n');\n}\n", "// https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color_keywords\nexport const COLOR_KEYWORDS = new Map([\n ['black', '#000000'],\n ['silver', '#c0c0c0'],\n ['gray', '#808080'],\n ['white', '#ffffff'],\n ['maroon', '#800000'],\n ['red', '#ff0000'],\n ['purple', '#800080'],\n ['fuchsia', '#ff00ff'],\n ['green', '#008000'],\n ['lime', '#00ff00'],\n ['olive', '#808000'],\n ['yellow', '#ffff00'],\n ['navy', '#000080'],\n ['blue', '#0000ff'],\n ['teal', '#008080'],\n ['aqua', '#00ffff'],\n ['orange', '#ffa500'],\n ['aliceblue', '#f0f8ff'],\n ['antiquewhite', '#faebd7'],\n ['aquamarine', '#7fffd4'],\n ['azure', '#f0ffff'],\n ['beige', '#f5f5dc'],\n ['bisque', '#ffe4c4'],\n ['blanchedalmond', '#ffebcd'],\n ['blueviolet', '#8a2be2'],\n ['brown', '#a52a2a'],\n ['burlywood', '#deb887'],\n ['cadetblue', '#5f9ea0'],\n ['chartreuse', '#7fff00'],\n ['chocolate', '#d2691e'],\n ['coral', '#ff7f50'],\n ['cornflowerblue', '#6495ed'],\n ['cornsilk', '#fff8dc'],\n ['crimson', '#dc143c'],\n ['cyan', '00ffff'],\n ['darkblue', '#00008b'],\n ['darkcyan', '#008b8b'],\n ['darkgoldenrod', '#b8860b'],\n ['darkgray', '#a9a9a9'],\n ['darkgreen', '#006400'],\n ['darkgrey', '#a9a9a9'],\n ['darkkhaki', '#bdb76b'],\n ['darkmagenta', '#8b008b'],\n ['darkolivegreen', '#556b2f'],\n ['darkorange', '#ff8c00'],\n ['darkorchid', '#9932cc'],\n ['darkred', '#8b0000'],\n ['darksalmon', '#e9967a'],\n ['darkseagreen', '#8fbc8f'],\n ['darkslateblue', '#483d8b'],\n ['darkslategray', '#2f4f4f'],\n ['darkslategrey', '#2f4f4f'],\n ['darkturquoise', '#00ced1'],\n ['darkviolet', '#9400d3'],\n ['deeppink', '#ff1493'],\n ['deepskyblue', '#00bfff'],\n ['dimgray', '#696969'],\n ['dimgrey', '#696969'],\n ['dodgerblue', '#1e90ff'],\n ['firebrick', '#b22222'],\n ['floralwhite', '#fffaf0'],\n ['forestgreen', '#228b22'],\n ['gainsboro', '#dcdcdc'],\n ['ghostwhite', '#f8f8ff'],\n ['gold', '#ffd700'],\n ['goldenrod', '#daa520'],\n ['greenyellow', '#adff2f'],\n ['grey', '#808080'],\n ['honeydew', '#f0fff0'],\n ['hotpink', '#ff69b4'],\n ['indianred', '#cd5c5c'],\n ['indigo', '#4b0082'],\n ['ivory', '#fffff0'],\n ['khaki', '#f0e68c'],\n ['lavender', '#e6e6fa'],\n ['lavenderblush', '#fff0f5'],\n ['lawngreen', '#7cfc00'],\n ['lemonchiffon', '#fffacd'],\n ['lightblue', '#add8e6'],\n ['lightcoral', '#f08080'],\n ['lightcyan', '#e0ffff'],\n ['lightgoldenrodyellow', '#fafad2'],\n ['lightgray', '#d3d3d3'],\n ['lightgreen', '#90ee90'],\n ['lightgrey', '#d3d3d3'],\n ['lightpink', '#ffb6c1'],\n ['lightsalmon', '#ffa07a'],\n ['lightseagreen', '#20b2aa'],\n ['lightskyblue', '#87cefa'],\n ['lightslategray', '#778899'],\n ['lightslategrey', '#778899'],\n ['lightsteelblue', '#b0c4de'],\n ['lightyellow', '#ffffe0'],\n ['limegreen', '#32cd32'],\n ['linen', '#faf0e6'],\n ['magenta', '#ff00ff'],\n ['mediumaquamarine', '#66cdaa'],\n ['mediumblue', '#0000cd'],\n ['mediumorchid', '#ba55d3'],\n ['mediumpurple', '#9370db'],\n ['mediumseagreen', '#3cb371'],\n ['mediumslateblue', '#7b68ee'],\n ['mediumspringgreen', '#00fa9a'],\n ['mediumturquoise', '#48d1cc'],\n ['mediumvioletred', '#c71585'],\n ['midnightblue', '#191970'],\n ['mintcream', '#f5fffa'],\n ['mistyrose', '#ffe4e1'],\n ['moccasin', '#ffe4b5'],\n ['navajowhite', '#ffdead'],\n ['oldlace', '#fdf5e6'],\n ['olivedrab', '#6b8e23'],\n ['orangered', '#ff4500'],\n ['orchid', '#da70d6'],\n ['palegoldenrod', '#eee8aa'],\n ['palegreen', '#98fb98'],\n ['paleturquoise', '#afeeee'],\n ['palevioletred', '#db7093'],\n ['papayawhip', '#ffefd5'],\n ['peachpuff', '#ffdab9'],\n ['peru', '#cd853f'],\n ['pink', '#ffc0cb'],\n ['plum', '#dda0dd'],\n ['powderblue', '#b0e0e6'],\n ['rosybrown', '#bc8f8f'],\n ['royalblue', '#4169e1'],\n ['saddlebrown', '#8b4513'],\n ['salmon', '#fa8072'],\n ['sandybrown', '#f4a460'],\n ['seagreen', '#2e8b57'],\n ['seashell', '#fff5ee'],\n ['sienna', '#a0522d'],\n ['skyblue', '#87ceeb'],\n ['slateblue', '#6a5acd'],\n ['slategray', '#708090'],\n ['slategrey', '#708090'],\n ['snow', '#fffafa'],\n ['springgreen', '#00ff7f'],\n ['steelblue', '#4682b4'],\n ['tan', '#d2b48c'],\n ['thistle', '#d8bfd8'],\n ['tomato', '#ff6347'],\n ['turquoise', '#40e0d0'],\n ['violet', '#ee82ee'],\n ['wheat', '#f5deb3'],\n ['whitesmoke', '#f5f5f5'],\n ['yellowgreen', '#9acd32'],\n ['rebeccapurple', '#663399'],\n]);\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// This file is automatically generated. Do not modify it.\n\n/**\n * Utility methods for mathematical operations.\n */\n\n/**\n * The signum function.\n * @param {number} num\n * @return {1|-1|0} 1 if num > 0, -1 if num < 0, and 0 if num = 0\n */\nexport function signum(num) {\n if (num < 0) {\n return -1;\n }\n if (num === 0) {\n return 0;\n }\n return 1;\n}\n\n/**\n * The linear interpolation function.\n * @param {number} start\n * @param {number} stop\n * @param {number} amount\n * @return {number} start if amount = 0 and stop if amount = 1\n */\nexport function lerp(start, stop, amount) {\n return (1 - amount) * start + amount * stop;\n}\n\n/**\n * Clamps an integer between two integers.\n * @param {number} min\n * @param {number} max\n * @param {number} input\n * @return {number} input when min <= input <= max, and either min or max\n * otherwise.\n */\nexport function clampInt(min, max, input) {\n if (input < min) {\n return min;\n } if (input > max) {\n return max;\n }\n\n return input;\n}\n\n/**\n * Clamps an integer between two floating-point numbers.\n * @param {number} min\n * @param {number} max\n * @param {number} input\n * @return {number} input when min <= input <= max, and either min or max\n * otherwise.\n */\nexport function clampDouble(min, max, input) {\n if (input < min) {\n return min;\n } if (input > max) {\n return max;\n }\n\n return input;\n}\n\n/**\n * Sanitizes a degree measure as an integer.\n * @param {number} degrees\n * @return {number} a degree measure between 0 (inclusive) and 360\n * (exclusive).\n */\nexport function sanitizeDegreesInt(degrees) {\n degrees %= 360;\n if (degrees < 0) {\n degrees += 360;\n }\n return degrees;\n}\n\n/**\n * Sanitizes a degree measure as a floating-point number.\n * @param {number} degrees\n * @return {number} a degree measure between 0.0 (inclusive) and 360.0\n * (exclusive).\n */\nexport function sanitizeDegreesDouble(degrees) {\n degrees %= 360;\n if (degrees < 0) {\n degrees += 360;\n }\n return degrees;\n}\n\n/**\n * Sign of direction change needed to travel from one angle to\n * another.\n *\n * For angles that are 180 degrees apart from each other, both\n * directions have the same travel distance, so either direction is\n * shortest. The value 1.0 is returned in this case.\n * @param {number} from The angle travel starts from, in degrees.\n * @param {number} to The angle travel ends at, in degrees.\n * @return {number} -1 if decreasing from leads to the shortest travel\n * distance, 1 if increasing from leads to the shortest travel\n * distance.\n */\nexport function rotationDirection(from, to) {\n const increasingDifference = sanitizeDegreesDouble(to - from);\n return increasingDifference <= 180 ? 1 : -1;\n}\n\n/**\n * Distance of two points on a circle, represented using degrees.\n * @param {number} a\n * @param {number} b\n * @return {number}\n */\nexport function differenceDegrees(a, b) {\n return 180 - Math.abs(Math.abs(a - b) - 180);\n}\n\n/**\n * Multiplies a 1x3 row vector with a 3x3 matrix.\n * @param {number[]} row\n * @param {number[][]} matrix\n * @return {number[]}\n */\nexport function matrixMultiply(row, matrix) {\n const a = row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2];\n const b = row[0] * matrix[1][0] + row[1] * matrix[1][1] + row[2] * matrix[1][2];\n const c = row[0] * matrix[2][0] + row[1] * matrix[2][1] + row[2] * matrix[2][2];\n return [a, b, c];\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// This file is automatically generated. Do not modify it.\n\nimport * as mathUtils from './mathUtils.js';\n\n/**\n * Color science utilities.\n *\n * Utility methods for color science constants and color space\n * conversions that aren't HCT or CAM16.\n */\n\nconst SRGB_TO_XYZ = [\n [0.412_338_95, 0.357_620_64, 0.180_510_42],\n [0.2126, 0.7152, 0.0722],\n [0.019_321_41, 0.119_163_82, 0.950_344_78],\n];\n\nconst XYZ_TO_SRGB = [\n [\n 3.241_377_479_238_868_5,\n -1.537_665_240_285_185_1,\n -0.498_853_668_462_680_53,\n ],\n [\n -0.969_145_251_300_532_1,\n 1.875_885_345_106_787_2,\n 0.041_565_856_169_120_61,\n ],\n [\n 0.055_620_936_896_913_05,\n -0.203_955_245_647_421_23,\n 1.057_179_911_122_033_5,\n ],\n];\n\nconst WHITE_POINT_D65 = [95.047, 100, 108.883];\n\n/**\n * Converts a color from RGB components to ARGB format.\n * @param {number} red\n * @param {number} green\n * @param {number} blue\n * @return {number}\n */\nexport function argbFromRgb(red, green, blue) {\n return (255 << 24 | (red & 255) << 16 | (green & 255) << 8 | blue & 255)\n >>> 0;\n}\n\n/**\n * Converts a color from linear RGB components to ARGB format.\n * @param {number[]} linrgb\n * @return {number}\n */\nexport function argbFromLinrgb(linrgb) {\n const r = delinearized(linrgb[0]);\n const g = delinearized(linrgb[1]);\n const b = delinearized(linrgb[2]);\n return argbFromRgb(r, g, b);\n}\n\n/**\n * Returns the alpha component of a color in ARGB format.\n * @param {number} argb\n * @return {number}\n */\nexport function alphaFromArgb(argb) {\n return argb >> 24 & 255;\n}\n\n/**\n * Returns the red component of a color in ARGB format.\n * @param {number} argb\n * @return {number}\n */\nexport function redFromArgb(argb) {\n return argb >> 16 & 255;\n}\n\n/**\n * Returns the green component of a color in ARGB format.\n * @param {number} argb\n * @return {number}\n */\nexport function greenFromArgb(argb) {\n return argb >> 8 & 255;\n}\n\n/**\n * Returns the blue component of a color in ARGB format.\n * @param {number} argb\n * @return {number}\n */\nexport function blueFromArgb(argb) {\n return argb & 255;\n}\n\n/**\n * Returns whether a color in ARGB format is opaque.\n * @param {number} argb\n * @return {boolean}\n */\nexport function isOpaque(argb) {\n return alphaFromArgb(argb) >= 255;\n}\n\n/**\n * Converts a color from ARGB to XYZ.\n * @param {number} x\n * @param {number} y\n * @param {number} z\n * @return {number}\n */\nexport function argbFromXyz(x, y, z) {\n const matrix = XYZ_TO_SRGB;\n const linearR = matrix[0][0] * x + matrix[0][1] * y + matrix[0][2] * z;\n const linearG = matrix[1][0] * x + matrix[1][1] * y + matrix[1][2] * z;\n const linearB = matrix[2][0] * x + matrix[2][1] * y + matrix[2][2] * z;\n const r = delinearized(linearR);\n const g = delinearized(linearG);\n const b = delinearized(linearB);\n return argbFromRgb(r, g, b);\n}\n\n/**\n * Converts a color from XYZ to ARGB.\n * @param {number} argb\n * @return {number[]}\n */\nexport function xyzFromArgb(argb) {\n const r = linearized(redFromArgb(argb));\n const g = linearized(greenFromArgb(argb));\n const b = linearized(blueFromArgb(argb));\n return mathUtils.matrixMultiply([r, g, b], SRGB_TO_XYZ);\n}\n\n/**\n * Converts a color represented in Lab color space into an ARGB\n * integer.\n * @param {number} l\n * @param {number} a\n * @param {number} b\n * @return {number}\n */\nexport function argbFromLab(l, a, b) {\n const whitePoint = WHITE_POINT_D65;\n const fy = (l + 16) / 116;\n const fx = a / 500 + fy;\n const fz = fy - b / 200;\n const xNormalized = labInvf(fx);\n const yNormalized = labInvf(fy);\n const zNormalized = labInvf(fz);\n const x = xNormalized * whitePoint[0];\n const y = yNormalized * whitePoint[1];\n const z = zNormalized * whitePoint[2];\n return argbFromXyz(x, y, z);\n}\n\n/**\n * Converts a color from ARGB representation to L*a*b*\n * representation.\n * @param {number} argb the ARGB representation of a color\n * @return {number[]} a Lab object representing the color\n */\nexport function labFromArgb(argb) {\n const linearR = linearized(redFromArgb(argb));\n const linearG = linearized(greenFromArgb(argb));\n const linearB = linearized(blueFromArgb(argb));\n const matrix = SRGB_TO_XYZ;\n const x = matrix[0][0] * linearR + matrix[0][1] * linearG + matrix[0][2] * linearB;\n const y = matrix[1][0] * linearR + matrix[1][1] * linearG + matrix[1][2] * linearB;\n const z = matrix[2][0] * linearR + matrix[2][1] * linearG + matrix[2][2] * linearB;\n const whitePoint = WHITE_POINT_D65;\n const xNormalized = x / whitePoint[0];\n const yNormalized = y / whitePoint[1];\n const zNormalized = z / whitePoint[2];\n const fx = labF(xNormalized);\n const fy = labF(yNormalized);\n const fz = labF(zNormalized);\n const l = 116 * fy - 16;\n const a = 500 * (fx - fy);\n const b = 200 * (fy - fz);\n return [l, a, b];\n}\n\n/**\n * Converts an L* value to an ARGB representation.\n * @param {number} lstar L* in L*a*b*\n * @return {number} ARGB representation of grayscale color with lightness\n * matching L*\n */\nexport function argbFromLstar(lstar) {\n const y = yFromLstar(lstar);\n const component = delinearized(y);\n return argbFromRgb(component, component, component);\n}\n\n/**\n * Computes the L* value of a color in ARGB representation.\n * @param {number} argb ARGB representation of a color\n * @return {number} L*, from L*a*b*, coordinate of the color\n */\nexport function lstarFromArgb(argb) {\n const y = xyzFromArgb(argb)[1];\n return 116 * labF(y / 100) - 16;\n}\n\n/**\n * Converts an L* value to a Y value.\n *\n * L* in L*a*b* and Y in XYZ measure the same quantity, luminance.\n *\n * L* measures perceptual luminance, a linear scale. Y in XYZ\n * measures relative luminance, a logarithmic scale.\n * @param {number} lstar L* in L*a*b*\n * @return {number} Y in XYZ\n */\nexport function yFromLstar(lstar) {\n return 100 * labInvf((lstar + 16) / 116);\n}\n\n/**\n * Linearizes an RGB component.\n * @param {number} rgbComponent 0 <= rgb_component <= 255, represents R/G/B\n * channel\n * @return {number} 0.0 <= output <= 100.0, color channel converted to\n * linear RGB space\n */\nexport function linearized(rgbComponent) {\n const normalized = rgbComponent / 255;\n if (normalized <= 0.040_449_936) {\n return (normalized / 12.92) * 100;\n }\n return ((normalized + 0.055) / 1.055) ** 2.4 * 100;\n}\n\n/**\n * Delinearizes an RGB component.\n * @param {number} rgbComponent 0.0 <= rgb_component <= 100.0, represents\n * linear R/G/B channel\n * @return {number} 0 <= output <= 255, color channel converted to regular\n * RGB space\n */\nexport function delinearized(rgbComponent) {\n const normalized = rgbComponent / 100;\n let delinearized = 0;\n delinearized = normalized <= 0.003_130_8 ? normalized * 12.92 : 1.055 * normalized ** (1 / 2.4) - 0.055;\n return mathUtils.clampInt(0, 255, Math.round(delinearized * 255));\n}\n\n/**\n * Returns the standard white point; white on a sunny day.\n * @return {number[]} The white point\n */\nexport function whitePointD65() {\n return WHITE_POINT_D65;\n}\n\n/**\n * @param {number} t\n * @return {number}\n */\nfunction labF(t) {\n const e = 216 / 24_389;\n const kappa = 24_389 / 27;\n if (t > e) {\n return t ** (1 / 3);\n }\n return (kappa * t + 16) / 116;\n}\n\n/**\n *\n * @param {number} ft\n * @return {number}\n */\nfunction labInvf(ft) {\n const e = 216 / 24_389;\n const kappa = 24_389 / 27;\n const ft3 = ft * ft * ft;\n if (ft3 > e) {\n return ft3;\n }\n return (116 * ft - 16) / kappa;\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as utils from './colorUtils.js';\nimport * as math from './mathUtils.js';\n\n/**\n * In traditional color spaces, a color can be identified solely by the\n * observer's measurement of the color. Color appearance models such as CAM16\n * also use information about the environment where the color was\n * observed, known as the viewing conditions.\n *\n * For example, white under the traditional assumption of a midday sun white\n * point is accurately measured as a slightly chromatic blue by CAM16. (roughly,\n * hue 203, chroma 3, lightness 100)\n *\n * This class caches intermediate values of the CAM16 conversion process that\n * depend only on viewing conditions, enabling speed ups.\n */\nexport default class ViewingConditions {\n /** sRGB-like viewing conditions. */\n static DEFAULT = ViewingConditions.make();\n\n /**\n * Create ViewingConditions from a simple, physically relevant, set of\n * parameters.\n * @param whitePoint White point, measured in the XYZ color space.\n * default = D65, or sunny day afternoon\n * @param {number} adaptingLuminance The luminance of the adapting field. Informally,\n * how bright it is in the room where the color is viewed. Can be\n * calculated from lux by multiplying lux by 0.0586. default = 11.72,\n * or 200 lux.\n * @param {number} backgroundLstar The lightness of the area surrounding the color.\n * measured by L* in L*a*b*. default = 50.0\n * @param {number} surround A general description of the lighting surrounding the\n * color. 0 is pitch dark, like watching a movie in a theater. 1.0 is a\n * dimly light room, like watching TV at home at night. 2.0 means there\n * is no difference between the lighting on the color and around it.\n * default = 2.0\n * @param {boolean} discountingIlluminant Whether the eye accounts for the tint of the\n * ambient lighting, such as knowing an apple is still red in green light.\n * default = false, the eye does not perform this process on\n * self-luminous objects like displays.\n * @return {ViewingConditions}\n */\n static make(\n whitePoint = utils.whitePointD65(),\n adaptingLuminance = ((200 / Math.PI) * utils.yFromLstar(50)) / 100,\n backgroundLstar = 50,\n surround = 2,\n discountingIlluminant = false,\n ) {\n const xyz = whitePoint;\n const rW = xyz[0] * 0.401_288 + xyz[1] * 0.650_173 + xyz[2] * -0.051_461;\n const gW = xyz[0] * -0.250_268 + xyz[1] * 1.204_414 + xyz[2] * 0.045_854;\n const bW = xyz[0] * -0.002_079 + xyz[1] * 0.048_952 + xyz[2] * 0.953_127;\n const f = 0.8 + surround / 10;\n const c = f >= 0.9 ? math.lerp(0.59, 0.69, (f - 0.9) * 10)\n : math.lerp(0.525, 0.59, (f - 0.8) * 10);\n let d = discountingIlluminant\n ? 1\n : f * (1 - (1 / 3.6) * Math.exp((-adaptingLuminance - 42) / 92));\n d = d > 1 ? 1 : (d < 0 ? 0 : d);\n const nc = f;\n const rgbD = [\n d * (100 / rW) + 1 - d,\n d * (100 / gW) + 1 - d,\n d * (100 / bW) + 1 - d,\n ];\n const k = 1 / (5 * adaptingLuminance + 1);\n const k4 = k * k * k * k;\n const k4F = 1 - k4;\n const fl = k4 * adaptingLuminance\n + 0.1 * k4F * k4F * Math.cbrt(5 * adaptingLuminance);\n const n = utils.yFromLstar(backgroundLstar) / whitePoint[1];\n const z = 1.48 + Math.sqrt(n);\n const nbb = 0.725 / n ** 0.2;\n const ncb = nbb;\n const rgbAFactors = [\n ((fl * rgbD[0] * rW) / 100) ** 0.42,\n ((fl * rgbD[1] * gW) / 100) ** 0.42,\n ((fl * rgbD[2] * bW) / 100) ** 0.42,\n ];\n const rgbA = [\n (400 * rgbAFactors[0]) / (rgbAFactors[0] + 27.13),\n (400 * rgbAFactors[1]) / (rgbAFactors[1] + 27.13),\n (400 * rgbAFactors[2]) / (rgbAFactors[2] + 27.13),\n ];\n const aw = (2 * rgbA[0] + rgbA[1] + 0.05 * rgbA[2]) * nbb;\n return new ViewingConditions(n, aw, nbb, ncb, c, nc, rgbD, fl, fl ** 0.25, z);\n }\n\n /**\n * Parameters are intermediate values of the CAM16 conversion process. Their\n * names are shorthand for technical color science terminology, this class\n * would not benefit from documenting them individually. A brief overview\n * is available in the CAM16 specification, and a complete overview requires\n * a color science textbook, such as Fairchild's Color Appearance Models.\n * @param {number} n\n * @param {number} aw\n * @param {number} nbb\n * @param {number} ncb\n * @param {number} c\n * @param {number} nc\n * @param {number[]} rgbD\n * @param {number} fl\n * @param {number} fLRoot\n * @param {number} z\n */\n constructor(n, aw, nbb, ncb, c, nc, rgbD, fl, fLRoot, z) {\n this.n = n;\n this.aw = aw;\n this.nbb = nbb;\n this.ncb = ncb;\n this.c = c;\n this.nc = nc;\n this.rgbD = rgbD;\n this.fl = fl;\n this.fLRoot = fLRoot;\n this.z = z;\n }\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport ViewingConditions from './ViewingConditions.js';\nimport * as utils from './colorUtils.js';\nimport * as math from './mathUtils.js';\n\n/**\n * CAM16, a color appearance model. Colors are not just defined by their hex\n * code, but rather, a hex code and viewing conditions.\n *\n * CAM16 instances also have coordinates in the CAM16-UCS space, called J*, a*,\n * b*, or jstar, astar, bstar in code. CAM16-UCS is included in the CAM16\n * specification, and should be used when measuring distances between colors.\n *\n * In traditional color spaces, a color can be identified solely by the\n * observer's measurement of the color. Color appearance models such as CAM16\n * also use information about the environment where the color was\n * observed, known as the viewing conditions.\n *\n * For example, white under the traditional assumption of a midday sun white\n * point is accurately measured as a slightly chromatic blue by CAM16. (roughly,\n * hue 203, chroma 3, lightness 100)\n */\nexport default class Cam16 {\n /**\n * All of the CAM16 dimensions can be calculated from 3 of the dimensions, in\n * the following combinations:\n * - {j or q} and {c, m, or s} and hue\n * - jstar, astar, bstar\n * Prefer using a static method that constructs from 3 of those dimensions.\n * This constructor is intended for those methods to use to return all\n * possible dimensions.\n * @param {number} hue\n * @param {number} chroma informally, colorfulness / color intensity. like saturation\n * in HSL, except perceptually accurate.\n * @param {number} j lightness\n * @param {number} q brightness; ratio of lightness to white point's lightness\n * @param {number} m colorfulness\n * @param {number} s saturation; ratio of chroma to white point's chroma\n * @param {number} jstar CAM16-UCS J coordinate\n * @param {number} astar CAM16-UCS a coordinate\n * @param {number} bstar CAM16-UCS b coordinate\n */\n constructor(hue, chroma, j, q, m, s, jstar, astar, bstar) {\n /** @readonly */\n this.hue = hue;\n /** @readonly */\n this.chroma = chroma;\n /** @readonly */\n this.j = j;\n /** @readonly */\n this.q = q;\n /** @readonly */\n this.m = m;\n /** @readonly */\n this.s = s;\n /** @readonly */\n this.jstar = jstar;\n /** @readonly */\n this.astar = astar;\n /** @readonly */\n this.bstar = bstar;\n }\n\n /**\n * CAM16 instances also have coordinates in the CAM16-UCS space, called J*,\n * a*, b*, or jstar, astar, bstar in code. CAM16-UCS is included in the CAM16\n * specification, and is used to measure distances between colors.\n * @param {Cam16} other\n * @return {number}\n */\n distance(other) {\n const dJ = this.jstar - other.jstar;\n const dA = this.astar - other.astar;\n const dB = this.bstar - other.bstar;\n const dEPrime = Math.sqrt(dJ * dJ + dA * dA + dB * dB);\n const dE = 1.41 * dEPrime ** 0.63;\n return dE;\n }\n\n /**\n * @param {number} argb ARGB representation of a color.\n * @return {Cam16} CAM16 color, assuming the color was viewed in default viewing\n * conditions.\n */\n static fromInt(argb) {\n return Cam16.fromIntInViewingConditions(argb, ViewingConditions.DEFAULT);\n }\n\n /**\n * @param {number} argb ARGB representation of a color.\n * @param {ViewingConditions} viewingConditions Information about the environment where the color\n * was observed.\n * @return {Cam16} CAM16 color.\n */\n static fromIntInViewingConditions(argb, viewingConditions) {\n const red = (argb & 0x00_FF_00_00) >> 16;\n const green = (argb & 0x00_00_FF_00) >> 8;\n const blue = (argb & 0x00_00_00_FF);\n const redL = utils.linearized(red);\n const greenL = utils.linearized(green);\n const blueL = utils.linearized(blue);\n const x = 0.412_338_95 * redL + 0.357_620_64 * greenL + 0.180_510_42 * blueL;\n const y = 0.2126 * redL + 0.7152 * greenL + 0.0722 * blueL;\n const z = 0.019_321_41 * redL + 0.119_163_82 * greenL + 0.950_344_78 * blueL;\n\n const rC = 0.401_288 * x + 0.650_173 * y - 0.051_461 * z;\n const gC = -0.250_268 * x + 1.204_414 * y + 0.045_854 * z;\n const bC = -0.002_079 * x + 0.048_952 * y + 0.953_127 * z;\n\n const rD = viewingConditions.rgbD[0] * rC;\n const gD = viewingConditions.rgbD[1] * gC;\n const bD = viewingConditions.rgbD[2] * bC;\n\n const rAF = ((viewingConditions.fl * Math.abs(rD)) / 100) ** 0.42;\n const gAF = ((viewingConditions.fl * Math.abs(gD)) / 100) ** 0.42;\n const bAF = ((viewingConditions.fl * Math.abs(bD)) / 100) ** 0.42;\n\n const rA = (math.signum(rD) * 400 * rAF) / (rAF + 27.13);\n const gA = (math.signum(gD) * 400 * gAF) / (gAF + 27.13);\n const bA = (math.signum(bD) * 400 * bAF) / (bAF + 27.13);\n\n const a = (11 * rA + -12 * gA + bA) / 11;\n const b = (rA + gA - 2 * bA) / 9;\n const u = (20 * rA + 20 * gA + 21 * bA) / 20;\n const p2 = (40 * rA + 20 * gA + bA) / 20;\n const atan2 = Math.atan2(b, a);\n const atanDegrees = (atan2 * 180) / Math.PI;\n const hue = atanDegrees < 0 ? atanDegrees + 360\n : (atanDegrees >= 360 ? atanDegrees - 360\n : atanDegrees);\n const hueRadians = (hue * Math.PI) / 180;\n\n const ac = p2 * viewingConditions.nbb;\n const j = 100\n * (ac / viewingConditions.aw) ** (viewingConditions.c * viewingConditions.z);\n const q = (4 / viewingConditions.c) * Math.sqrt(j / 100)\n * (viewingConditions.aw + 4) * viewingConditions.fLRoot;\n const huePrime = hue < 20.14 ? hue + 360 : hue;\n const eHue = 0.25 * (Math.cos((huePrime * Math.PI) / 180 + 2) + 3.8);\n const p1 = (50_000 / 13) * eHue * viewingConditions.nc * viewingConditions.ncb;\n const t = (p1 * Math.sqrt(a * a + b * b)) / (u + 0.305);\n const alpha = t ** 0.9\n * (1.64 - 0.29 ** viewingConditions.n) ** 0.73;\n const c = alpha * Math.sqrt(j / 100);\n const m = c * viewingConditions.fLRoot;\n const s = 50\n * Math.sqrt((alpha * viewingConditions.c) / (viewingConditions.aw + 4));\n const jstar = ((1 + 100 * 0.007) * j) / (1 + 0.007 * j);\n const mstar = (1 / 0.0228) * Math.log(1 + 0.0228 * m);\n const astar = mstar * Math.cos(hueRadians);\n const bstar = mstar * Math.sin(hueRadians);\n\n return new Cam16(hue, c, j, q, m, s, jstar, astar, bstar);\n }\n\n /**\n * @param {number} j CAM16 lightness\n * @param {number} c CAM16 chroma\n * @param {number} h CAM16 hue\n * @return {Cam16}\n */\n static fromJch(j, c, h) {\n return Cam16.fromJchInViewingConditions(j, c, h, ViewingConditions.DEFAULT);\n }\n\n /**\n * @param {number} j CAM16 lightness\n * @param {number} c CAM16 chroma\n * @param {number} h CAM16 hue\n * @param {ViewingConditions} viewingConditions Information about the environment where the color\n * was observed.\n */\n static fromJchInViewingConditions(j, c, h, viewingConditions) {\n const q = (4 / viewingConditions.c) * Math.sqrt(j / 100)\n * (viewingConditions.aw + 4) * viewingConditions.fLRoot;\n const m = c * viewingConditions.fLRoot;\n const alpha = c / Math.sqrt(j / 100);\n const s = 50\n * Math.sqrt((alpha * viewingConditions.c) / (viewingConditions.aw + 4));\n const hueRadians = (h * Math.PI) / 180;\n const jstar = ((1 + 100 * 0.007) * j) / (1 + 0.007 * j);\n const mstar = (1 / 0.0228) * Math.log(1 + 0.0228 * m);\n const astar = mstar * Math.cos(hueRadians);\n const bstar = mstar * Math.sin(hueRadians);\n return new Cam16(h, c, j, q, m, s, jstar, astar, bstar);\n }\n\n /**\n * @param {number} jstar CAM16-UCS lightness.\n * @param {number} astar CAM16-UCS a dimension. Like a* in L*a*b*, it is a Cartesian\n * coordinate on the Y axis.\n * @param {number} bstar CAM16-UCS b dimension. Like a* in L*a*b*, it is a Cartesian\n * coordinate on the X axis.\n * @return {Cam16}\n */\n static fromUcs(jstar, astar, bstar) {\n return Cam16.fromUcsInViewingConditions(jstar, astar, bstar, ViewingConditions.DEFAULT);\n }\n\n /**\n * @param {number} jstar CAM16-UCS lightness.\n * @param {number} astar CAM16-UCS a dimension. Like a* in L*a*b*, it is a Cartesian\n * coordinate on the Y axis.\n * @param {number} bstar CAM16-UCS b dimension. Like a* in L*a*b*, it is a Cartesian\n * coordinate on the X axis.\n * @param {ViewingConditions} viewingConditions Information about the environment where the color\n * was observed.\n */\n static fromUcsInViewingConditions(jstar, astar, bstar, viewingConditions) {\n const a = astar;\n const b = bstar;\n const m = Math.sqrt(a * a + b * b);\n const M = (Math.exp(m * 0.0228) - 1) / 0.0228;\n const c = M / viewingConditions.fLRoot;\n let h = Math.atan2(b, a) * (180 / Math.PI);\n if (h < 0) {\n h += 360;\n }\n const j = jstar / (1 - (jstar - 100) * 0.007);\n return Cam16.fromJchInViewingConditions(j, c, h, viewingConditions);\n }\n\n /**\n * @return {number} ARGB representation of color, assuming the color was viewed in\n * default viewing conditions, which are near-identical to the default\n * viewing conditions for sRGB.\n */\n toInt() {\n return this.viewed(ViewingConditions.DEFAULT);\n }\n\n /**\n * @param {ViewingConditions} viewingConditions Information about the environment where the color\n * will be viewed.\n * @return {number} ARGB representation of color\n */\n viewed(viewingConditions) {\n const alpha = this.chroma === 0 || this.j === 0\n ? 0\n : this.chroma / Math.sqrt(this.j / 100);\n\n const t = (alpha / (1.64 - 0.29 ** viewingConditions.n) ** 0.73) ** (1 / 0.9);\n const hRad = (this.hue * Math.PI) / 180;\n\n const eHue = 0.25 * (Math.cos(hRad + 2) + 3.8);\n const ac = viewingConditions.aw\n * (this.j / 100) ** (1 / viewingConditions.c / viewingConditions.z);\n const p1 = eHue * (50_000 / 13) * viewingConditions.nc * viewingConditions.ncb;\n const p2 = ac / viewingConditions.nbb;\n\n const hSin = Math.sin(hRad);\n const hCos = Math.cos(hRad);\n\n const gamma = (23 * (p2 + 0.305) * t)\n / (23 * p1 + 11 * t * hCos + 108 * t * hSin);\n const a = gamma * hCos;\n const b = gamma * hSin;\n const rA = (460 * p2 + 451 * a + 288 * b) / 1403;\n const gA = (460 * p2 - 891 * a - 261 * b) / 1403;\n const bA = (460 * p2 - 220 * a - 6300 * b) / 1403;\n\n const rCBase = Math.max(0, (27.13 * Math.abs(rA)) / (400 - Math.abs(rA)));\n const rC = math.signum(rA) * (100 / viewingConditions.fl)\n * rCBase ** (1 / 0.42);\n const gCBase = Math.max(0, (27.13 * Math.abs(gA)) / (400 - Math.abs(gA)));\n const gC = math.signum(gA) * (100 / viewingConditions.fl)\n * gCBase ** (1 / 0.42);\n const bCBase = Math.max(0, (27.13 * Math.abs(bA)) / (400 - Math.abs(bA)));\n const bC = math.signum(bA) * (100 / viewingConditions.fl)\n * bCBase ** (1 / 0.42);\n const rF = rC / viewingConditions.rgbD[0];\n const gF = gC / viewingConditions.rgbD[1];\n const bF = bC / viewingConditions.rgbD[2];\n\n const x = 1.862_067_86 * rF - 1.011_254_63 * gF + 0.149_186_77 * bF;\n const y = 0.387_526_54 * rF + 0.621_447_44 * gF - 0.008_973_98 * bF;\n const z = -0.015_841_5 * rF - 0.034_122_94 * gF + 1.049_964_44 * bF;\n\n const argb = utils.argbFromXyz(x, y, z);\n return argb;\n }\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Cam16 from './Cam16.js';\nimport ViewingConditions from './ViewingConditions.js';\nimport * as colorUtils from './colorUtils.js';\nimport * as mathUtils from './mathUtils.js';\n\n/**\n * A class that solves the HCT equation.\n */\n// libmonet is designed to have a consistent API across platforms\n// and modular components that can be moved around easily. Using a class as a\n// namespace facilitates this.\n//\n// tslint:disable-next-line:class-as-namespace\n\nexport const SCALED_DISCOUNT_FROM_LINRGB = [\n [\n 0.001_200_833_568_784_504,\n 0.002_389_694_492_170_889,\n 0.000_279_574_288_586_112_4,\n ],\n [\n 0.000_589_108_665_137_599_9,\n 0.002_978_550_257_343_875_8,\n 0.000_327_066_610_400_839_8,\n ],\n [\n 0.000_101_466_924_916_405_72,\n 0.000_536_421_435_918_669_4,\n 0.003_297_940_177_071_207_6,\n ],\n];\n\nexport const LINRGB_FROM_SCALED_DISCOUNT = [\n [\n 1373.219_870_959_423_1,\n -1100.425_119_075_482_1,\n -7.278_681_089_101_213,\n ],\n [\n -271.815_969_077_903,\n 559.658_046_594_073_3,\n -32.460_474_827_911_94,\n ],\n [\n 1.962_289_959_966_566_6,\n -57.173_814_538_844_006,\n 308.723_319_781_238_5,\n ],\n];\n\nexport const Y_FROM_LINRGB = [0.2126, 0.7152, 0.0722];\n\nexport const CRITICAL_PLANES = [\n 0.015_176_349_177_441_876, 0.045_529_047_532_325_624, 0.075_881_745_887_209_38,\n 0.106_234_444_242_093_13, 0.136_587_142_596_976_85, 0.166_939_840_951_860_62,\n 0.197_292_539_306_744_34, 0.227_645_237_661_628_1, 0.257_997_936_016_511_9,\n 0.288_350_634_371_395_63, 0.318_830_090_443_053_2, 0.350_925_934_958_123,\n 0.384_831_493_309_642_6, 0.420_574_803_010_494_66, 0.458_183_274_052_838,\n 0.497_683_725_027_402_3, 0.539_102_415_980_638_1, 0.582_465_078_404_089_8,\n 0.627_796_942_691_410_7, 0.675_122_763_349_862_3, 0.724_466_842_212_892_1,\n 0.775_853_049_866_786, 0.829_304_845_476_233, 0.884_845_295_169_849_8,\n 0.942_497_089_126_609, 1.002_282_557_486_903_9, 1.064_223_685_197_357_7,\n 1.128_342_125_885_829_7, 1.194_659_214_852_212_8, 1.263_195_981_251_186_4,\n 1.333_973_159_534_903_4, 1.407_011_200_216_447, 1.482_330_280_008_641_5,\n 1.559_950_311_387_327_2, 1.639_890_951_623_367_7, 1.722_171_611_323_410_5,\n 1.806_811_462_515_637_7, 1.893_829_446_313_407_3, 1.983_244_280_186_685_2,\n 2.075_074_464_868_551, 2.169_338_290_921_623_4, 2.266_053_844_987_206_3,\n 2.365_239_015_737_95, 2.466_911_499_553_200_7, 2.571_088_805_934_576_4,\n 2.677_788_262_677_978_5, 2.787_027_020_816_925_7, 2.898_822_059_350_997,\n 3.013_190_189_772_090_7, 3.130_148_060_400_286_3, 3.249_712_160_540_222_6,\n 3.371_898_824_468_108_7, 3.496_724_235_258_794_6, 3.624_204_428_461_639,\n 3.754_355_295_633_311, 3.887_192_587_735_158, 4.022_731_918_402_185,\n 4.160_988_767_090_289, 4.301_978_482_107_941, 4.445_716_283_538_092,\n 4.592_217_266_055_746, 4.741_496_401_646_282, 4.893_568_542_229_298,\n 5.048_448_422_192_488, 5.206_150_660_839_72, 5.366_689_764_757_337_5,\n 5.530_080_130_102_386_5, 5.696_336_044_816_294, 5.865_471_690_767_354,\n 6.037_501_145_825_082, 6.212_438_385_869_475, 6.390_297_286_737_924,\n 6.571_091_626_112_461, 6.754_835_085_349_804_5, 6.941_541_251_256_611,\n 7.131_223_617_812_143, 7.323_895_587_840_543, 7.519_570_474_634_666_5,\n 7.718_261_503_533_434_5, 7.919_981_813_454_504, 8.124_744_458_384_042,\n 8.332_562_408_825_165, 8.543_448_553_206_703, 8.757_415_699_253_682,\n 8.974_476_575_321_063, 9.194_643_831_691_977, 9.417_930_041_841_839,\n 9.644_347_703_669_503, 9.873_909_240_696_694, 10.106_627_003_236_781,\n 10.342_513_269_534_024, 10.581_580_246_874_27, 10.823_840_072_668_1,\n 11.069_304_815_507_364, 11.317_986_476_196_008, 11.569_896_988_756_009,\n 11.825_048_221_409_341, 12.083_451_977_536_606, 12.345_119_996_613_247,\n 12.610_063_955_123_938, 12.878_295_467_455_942, 13.149_826_086_772_048,\n 13.424_667_305_863_72, 13.702_830_557_985_108, 13.984_327_217_668_513,\n 14.269_168_601_521_828, 14.557_365_969_008_56, 14.848_930_523_210_871,\n 15.143_873_411_576_273, 15.442_205_726_648_32, 15.743_938_506_781_891,\n 16.049_082_736_843_37, 16.357_649_348_896_34, 16.669_649_222_873_04,\n 16.985_093_187_232_053, 17.303_992_019_602_69, 17.626_356_447_416_25,\n 17.952_197_148_524_76, 18.281_524_751_807_332, 18.614_349_837_764_564,\n 18.950_682_939_101_38, 19.290_534_541_298_456, 19.633_915_083_172_692,\n 19.980_834_957_426_89, 20.331_304_511_189_067, 20.685_334_046_541_502,\n 21.042_933_821_039_977, 21.404_114_048_223_256, 21.768_884_898_113_22,\n 22.137_256_497_705_877, 22.509_238_931_453_28, 22.884_842_241_736_916,\n 23.264_076_429_332_462, 23.646_951_453_866_3, 24.033_477_234_264_016,\n 24.423_663_649_190_83, 24.817_520_537_484_558, 25.215_057_698_580_89,\n 25.616_284_892_931_38, 26.021_211_842_414_342, 26.429_848_230_738_664,\n 26.842_203_703_840_827, 27.258_287_870_275_353, 27.678_110_301_598_522,\n 28.101_680_532_745_97, 28.529_008_062_403_893, 28.960_102_353_374_22,\n 29.394_972_832_933_96, 29.833_628_893_188_45, 30.276_079_891_419_332,\n 30.722_335_150_426_627, 31.172_403_958_865_512, 31.626_295_571_577_85,\n 32.084_019_209_918_37, 32.545_584_062_075_92, 33.010_999_283_389_665,\n 33.480_273_996_660_3, 33.953_417_292_456_834, 34.430_438_229_418_264,\n 34.911_345_834_551_085, 35.396_149_103_522_07, 35.884_857_000_946_71,\n 36.377_478_460_673_49, 36.874_022_386_063_82, 37.374_497_650_267_89,\n 37.878_913_096_496_59, 38.387_277_538_289_26, 38.899_599_759_777_85,\n 39.415_888_515_946_97, 39.936_152_532_890_54, 40.460_400_508_064_545,\n 40.988_641_110_536_29, 41.520_882_981_230_194, 42.057_134_733_170_16,\n 42.597_404_951_718_396, 43.141_702_194_811_224, 43.690_034_993_191_3,\n 44.242_411_850_636_97, 44.798_841_244_188_324, 45.359_331_624_370_17,\n 45.923_891_415_412_09, 46.492_529_015_465_52, 47.065_252_796_817_916,\n 47.642_071_106_104_09, 48.222_992_264_514_68, 48.808_024_568_002_054,\n 49.397_176_287_483_3, 49.990_455_669_040_8, 50.587_870_934_119_984,\n 51.189_430_279_724_725, 51.795_141_878_610_14, 52.405_013_879_472_88,\n 53.019_054_407_139_2, 53.637_271_562_750_364, 54.259_673_423_945_976,\n 54.886_268_045_044_93, 55.517_063_457_223_934, 56.152_067_668_694_24,\n 56.791_288_664_875_74, 57.434_734_408_569_16, 58.082_412_840_126_21,\n 58.734_331_877_617_365, 59.390_499_416_998_07, 60.050_923_332_272_51,\n 60.715_611_475_655_585, 61.384_571_677_733_11, 62.057_811_747_619_894,\n 62.735_339_473_115_9, 63.417_162_620_860_914, 64.103_288_936_486_92,\n 64.793_726_144_769_21, 65.488_481_949_775_29, 66.187_564_035_012_24,\n 66.890_980_063_572_58, 67.598_737_678_278_08, 68.310_844_501_822_22,\n 69.027_308_136_910_93, 69.748_136_166_401_64, 70.473_336_153_441_07,\n 71.202_915_641_601_04, 71.936_882_155_013_12, 72.675_243_198_501_72,\n 73.418_006_257_715_42, 74.165_178_799_257_33, 74.916_768_270_813_6,\n 75.672_782_101_280_72, 76.433_227_700_891_46, 77.198_112_461_339_3,\n 77.967_443_755_901_67, 78.741_228_939_561_74, 79.519_475_349_129_04,\n 80.302_190_303_358_69, 81.089_381_103_069_34, 81.881_055_031_259_99,\n 82.677_219_353_225_41, 83.477_881_316_670_6, 84.283_048_151_823_72,\n 85.092_727_071_548_08, 85.906_925_271_453_02, 86.725_649_930_003_43,\n 87.548_908_208_628_19, 88.376_707_251_827_7, 89.209_054_187_280_1,\n 90.045_956_125_946_55, 90.887_420_162_175_18, 91.733_453_373_804_38,\n 92.584_062_822_264_91, 93.439_255_552_680_66, 94.299_038_593_969_02,\n 95.163_418_958_939_69, 96.032_403_644_392_74, 96.905_999_631_215_9,\n 97.784_213_884_480_44, 98.667_053_353_536_6, 99.554_524_972_107_76,\n];\n\n/**\n * Sanitizes a small enough angle in radians.\n * @param {number} angle An angle in radians; must not deviate too much\n * from 0.\n * @return {number} A coterminal angle between 0 and 2pi.\n */\nfunction sanitizeRadians(angle) {\n return (angle + Math.PI * 8) % (Math.PI * 2);\n}\n\n/**\n * Delinearizes an RGB component, returning a floating-point\n * number.\n * @param {number} rgbComponent 0.0 <= rgb_component <= 100.0, represents\n * linear R/G/B channel\n * @return {number} 0.0 <= output <= 255.0, color channel converted to\n * regular RGB space\n */\nfunction trueDelinearized(rgbComponent) {\n const normalized = rgbComponent / 100;\n let delinearized = 0;\n delinearized = normalized <= 0.003_130_8 ? normalized * 12.92 : 1.055 * normalized ** (1 / 2.4) - 0.055;\n return delinearized * 255;\n}\n\n/**\n * @param {number} component\n * @return {number}\n */\nfunction chromaticAdaptation(component) {\n const af = Math.abs(component) ** 0.42;\n return mathUtils.signum(component) * 400 * af / (af + 27.13);\n}\n\n/**\n * Returns the hue of a linear RGB color in CAM16.\n * @param {number[]} linrgb The linear RGB coordinates of a color.\n * @return {number} The hue of the color in CAM16, in radians.\n */\nfunction hueOf(linrgb) {\n const scaledDiscount = mathUtils.matrixMultiply(linrgb, SCALED_DISCOUNT_FROM_LINRGB);\n const rA = chromaticAdaptation(scaledDiscount[0]);\n const gA = chromaticAdaptation(scaledDiscount[1]);\n const bA = chromaticAdaptation(scaledDiscount[2]);\n // redness-greenness\n const a = (11 * rA + -12 * gA + bA) / 11;\n // yellowness-blueness\n const b = (rA + gA - 2 * bA) / 9;\n return Math.atan2(b, a);\n}\n\n/**\n *\n * @param {number} a\n * @param {number} b\n * @param {number} c\n * @return {boolean}\n */\nfunction areInCyclicOrder(a, b, c) {\n const deltaAB = sanitizeRadians(b - a);\n const deltaAC = sanitizeRadians(c - a);\n return deltaAB < deltaAC;\n}\n\n/**\n * Solves the lerp equation.\n * @param {number} source The starting number.\n * @param {number} mid The number in the middle.\n * @param {number} target The ending number.\n * @return {number} A number t such that lerp(source, target, t) = mid.\n */\nfunction intercept(source, mid, target) {\n return (mid - source) / (target - source);\n}\n\n/**\n *\n * @param {number[]} source\n * @param {number} t\n * @param {number[]} target\n * @return {[number,number,number]}\n */\nfunction lerpPoint(source, t, target) {\n return [\n source[0] + (target[0] - source[0]) * t,\n source[1] + (target[1] - source[1]) * t,\n source[2] + (target[2] - source[2]) * t,\n ];\n}\n\n/**\n * Intersects a segment with a plane.\n * @param {number[]} source The coordinates of point A.\n * @param {number} coordinate The R-, G-, or B-coordinate of the plane.\n * @param {number[]} target The coordinates of point B.\n * @param {number} axis The axis the plane is perpendicular with. (0: R, 1:\n * G, 2: B)\n * @return {number[]} The intersection point of the segment AB with the plane\n * R=coordinate, G=coordinate, or B=coordinate\n */\nfunction setCoordinate(source, coordinate, target, axis) {\n const t = intercept(source[axis], coordinate, target[axis]);\n return lerpPoint(source, t, target);\n}\n\n/**\n * @param {number} x\n * @return {boolean}\n */\nfunction isBounded(x) {\n return x >= 0 && x <= 100;\n}\n\n/**\n * Returns the nth possible vertex of the polygonal intersection.\n * @param {number} y The Y value of the plane\n * @param {number} n The zero-based index of the point. 0 <= n <= 11.\n * @return {number[]} The nth possible vertex of the polygonal intersection\n * of the y plane and the RGB cube, in linear RGB coordinates, if\n * it exists. If this possible vertex lies outside of the cube,\n * [-1.0, -1.0, -1.0] is returned.\n */\nfunction nthVertex(y, n) {\n const kR = Y_FROM_LINRGB[0];\n const kG = Y_FROM_LINRGB[1];\n const kB = Y_FROM_LINRGB[2];\n const coordA = n % 4 <= 1 ? 0 : 100;\n const coordB = n % 2 === 0 ? 0 : 100;\n if (n < 4) {\n const g = coordA;\n const b = coordB;\n const r = (y - g * kG - b * kB) / kR;\n if (isBounded(r)) {\n return [r, g, b];\n }\n return [-1, -1, -1];\n }\n if (n < 8) {\n const b = coordA;\n const r = coordB;\n const g = (y - r * kR - b * kB) / kG;\n if (isBounded(g)) {\n return [r, g, b];\n }\n return [-1, -1, -1];\n }\n const r = coordA;\n const g = coordB;\n const b = (y - r * kR - g * kG) / kB;\n if (isBounded(b)) {\n return [r, g, b];\n }\n return [-1, -1, -1];\n}\n\n/**\n * Finds the segment containing the desired color.\n * @param {number} y The Y value of the color.\n * @param {number} targetHue The hue of the color.\n * @return {[number[], number[]]} A list of two sets of linear RGB coordinates, each\n * corresponding to an endpoint of the segment containing the\n * desired color.\n */\nfunction bisectToSegment(y, targetHue) {\n let left = [-1, -1, -1];\n let right = left;\n let leftHue = 0;\n let rightHue = 0;\n let initialized = false;\n let uncut = true;\n\n for (let n = 0; n < 12; n++) {\n const mid = nthVertex(y, n);\n if (mid[0] < 0) {\n continue;\n }\n const midHue = hueOf(mid);\n if (!initialized) {\n left = mid;\n right = mid;\n leftHue = midHue;\n rightHue = midHue;\n initialized = true;\n continue;\n }\n if (uncut || areInCyclicOrder(leftHue, midHue, rightHue)) {\n uncut = false;\n if (areInCyclicOrder(leftHue, targetHue, midHue)) {\n right = mid;\n rightHue = midHue;\n } else {\n left = mid;\n leftHue = midHue;\n }\n }\n }\n return [left, right];\n}\n\n/**\n *\n * @param {number[]} a\n * @param {number[]} b\n * @return {number[]}\n */\nfunction midpoint(a, b) {\n return [\n (a[0] + b[0]) / 2,\n (a[1] + b[1]) / 2,\n (a[2] + b[2]) / 2,\n ];\n}\n\n/**\n * @param {number} x\n * @return {number}\n */\nfunction criticalPlaneBelow(x) {\n return Math.floor(x - 0.5);\n}\n\n/**\n * @param {number} x\n * @return {number}\n */\nfunction criticalPlaneAbove(x) {\n return Math.ceil(x - 0.5);\n}\n\n/**\n * Finds a color with the given Y and hue on the boundary of the\n * cube.\n * @param {number} y The Y value of the color.\n * @param {number} targetHue The hue of the color.\n * @return {number[]} The desired color, in linear RGB coordinates.\n */\nfunction bisectToLimit(y, targetHue) {\n const segment = bisectToSegment(y, targetHue);\n let left = segment[0];\n let leftHue = hueOf(left);\n let right = segment[1];\n for (let axis = 0; axis < 3; axis++) {\n if (left[axis] !== right[axis]) {\n let lPlane = -1;\n let rPlane = 255;\n if (left[axis] < right[axis]) {\n lPlane = criticalPlaneBelow(\n trueDelinearized(left[axis]),\n );\n rPlane = criticalPlaneAbove(\n trueDelinearized(right[axis]),\n );\n } else {\n lPlane = criticalPlaneAbove(\n trueDelinearized(left[axis]),\n );\n rPlane = criticalPlaneBelow(\n trueDelinearized(right[axis]),\n );\n }\n for (let i = 0; i < 8; i++) {\n if (Math.abs(rPlane - lPlane) <= 1) {\n break;\n } else {\n const mPlane = Math.floor((lPlane + rPlane) / 2);\n const midPlaneCoordinate = CRITICAL_PLANES[mPlane];\n const mid = setCoordinate(left, midPlaneCoordinate, right, axis);\n const midHue = hueOf(mid);\n if (areInCyclicOrder(leftHue, targetHue, midHue)) {\n right = mid;\n rPlane = mPlane;\n } else {\n left = mid;\n leftHue = midHue;\n lPlane = mPlane;\n }\n }\n }\n }\n }\n return midpoint(left, right);\n}\n\n/**\n * @param {number} adapted\n * @return {number}\n */\nfunction inverseChromaticAdaptation(adapted) {\n const adaptedAbs = Math.abs(adapted);\n const base = Math.max(0, 27.13 * adaptedAbs / (400 - adaptedAbs));\n return mathUtils.signum(adapted) * base ** (1 / 0.42);\n}\n\n/**\n * Finds a color with the given hue, chroma, and Y.\n * @param {number} hueRadians The desired hue in radians.\n * @param {number} chroma The desired chroma.\n * @param {number} y The desired Y.\n * @return {number} The desired color as a hexadecimal integer, if found; 0\n * otherwise.\n */\nfunction findResultByJ(hueRadians, chroma, y) {\n // Initial estimate of j.\n let j = Math.sqrt(y) * 11;\n // ===========================================================\n // Operations inlined from Cam16 to avoid repeated calculation\n // ===========================================================\n const viewingConditions = ViewingConditions.DEFAULT;\n const tInnerCoeff = 1 / (1.64 - 0.29 ** viewingConditions.n) ** 0.73;\n const eHue = 0.25 * (Math.cos(hueRadians + 2) + 3.8);\n const p1 = eHue * (50_000 / 13) * viewingConditions.nc * viewingConditions.ncb;\n const hSin = Math.sin(hueRadians);\n const hCos = Math.cos(hueRadians);\n for (let iterationRound = 0; iterationRound < 5; iterationRound++) {\n // ===========================================================\n // Operations inlined from Cam16 to avoid repeated calculation\n // ===========================================================\n const jNormalized = j / 100;\n const alpha = chroma === 0 || j === 0 ? 0 : chroma / Math.sqrt(jNormalized);\n const t = (alpha * tInnerCoeff) ** (1 / 0.9);\n const ac = viewingConditions.aw\n * jNormalized ** (1 / viewingConditions.c / viewingConditions.z);\n const p2 = ac / viewingConditions.nbb;\n const gamma = 23 * (p2 + 0.305) * t / (23 * p1 + 11 * t * hCos + 108 * t * hSin);\n const a = gamma * hCos;\n const b = gamma * hSin;\n const rA = (460 * p2 + 451 * a + 288 * b) / 1403;\n const gA = (460 * p2 - 891 * a - 261 * b) / 1403;\n const bA = (460 * p2 - 220 * a - 6300 * b) / 1403;\n const rCScaled = inverseChromaticAdaptation(rA);\n const gCScaled = inverseChromaticAdaptation(gA);\n const bCScaled = inverseChromaticAdaptation(bA);\n const linrgb = mathUtils.matrixMultiply(\n [rCScaled, gCScaled, bCScaled],\n LINRGB_FROM_SCALED_DISCOUNT,\n );\n // ===========================================================\n // Operations inlined from Cam16 to avoid repeated calculation\n // ===========================================================\n if (linrgb[0] < 0 || linrgb[1] < 0 || linrgb[2] < 0) {\n return 0;\n }\n const kR = Y_FROM_LINRGB[0];\n const kG = Y_FROM_LINRGB[1];\n const kB = Y_FROM_LINRGB[2];\n const fnj = kR * linrgb[0] + kG * linrgb[1] + kB * linrgb[2];\n if (fnj <= 0) {\n return 0;\n }\n if (iterationRound === 4 || Math.abs(fnj - y) < 0.002) {\n if (linrgb[0] > 100.01 || linrgb[1] > 100.01 || linrgb[2] > 100.01) {\n return 0;\n }\n return colorUtils.argbFromLinrgb(linrgb);\n }\n // Iterates with Newton method,\n // Using 2 * fn(j) / j as the approximation of fn'(j)\n j -= (fnj - y) * j / (2 * fnj);\n }\n return 0;\n}\n\n/**\n * Finds an sRGB color with the given hue, chroma, and L*, if\n * possible.\n * @param {number} hueDegrees The desired hue, in degrees.\n * @param {number} chroma The desired chroma.\n * @param {number} lstar The desired L*.\n * @return {number} A hexadecimal representing the sRGB color. The color\n * has sufficiently close hue, chroma, and L* to the desired\n * values, if possible; otherwise, the hue and L* will be\n * sufficiently close, and chroma will be maximized.\n */\nexport function solveToInt(hueDegrees, chroma, lstar) {\n if (chroma < 0.0001 || lstar < 0.0001 || lstar > 99.9999) {\n return colorUtils.argbFromLstar(lstar);\n }\n hueDegrees = mathUtils.sanitizeDegreesDouble(hueDegrees);\n const hueRadians = hueDegrees / 180 * Math.PI;\n const y = colorUtils.yFromLstar(lstar);\n const exactAnswer = findResultByJ(hueRadians, chroma, y);\n if (exactAnswer !== 0) {\n return exactAnswer;\n }\n const linrgb = bisectToLimit(y, hueRadians);\n return colorUtils.argbFromLinrgb(linrgb);\n}\n\n/**\n * Finds an sRGB color with the given hue, chroma, and L*, if\n * possible.\n * @param {number} hueDegrees The desired hue, in degrees.\n * @param {number} chroma The desired chroma.\n * @param {number} lstar The desired L*.\n * @return {Cam16} An CAM16 object representing the sRGB color. The color\n * has sufficiently close hue, chroma, and L* to the desired\n * values, if possible; otherwise, the hue and L* will be\n * sufficiently close, and chroma will be maximized.\n */\nexport function solveToCam(hueDegrees, chroma, lstar) {\n return Cam16.fromInt(solveToInt(hueDegrees, chroma, lstar));\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A color system built using CAM16 hue and chroma, and L* from\n * L*a*b*.\n *\n * Using L* creates a link between the color system, contrast, and thus\n * accessibility. Contrast ratio depends on relative luminance, or Y in the XYZ\n * color space. L*, or perceptual luminance can be calculated from Y.\n *\n * Unlike Y, L* is linear to human perception, allowing trivial creation of\n * accurate color tones.\n *\n * Unlike contrast ratio, measuring contrast in L* is linear, and simple to\n * calculate. A difference of 40 in HCT tone guarantees a contrast ratio >= 3.0,\n * and a difference of 50 guarantees a contrast ratio >= 4.5.\n */\n\nimport Cam16 from './Cam16.js';\nimport * as utils from './colorUtils.js';\nimport * as hctSolver from './hctSolver.js';\n\n/**\n * HCT, hue, chroma, and tone. A color system that provides a perceptually\n * accurate color measurement system that can also accurately render what colors\n * will appear as in different lighting environments.\n */\nexport default class Hct {\n /**\n * @param hue 0 <= hue < 360; invalid values are corrected.\n * @param chroma 0 <= chroma < ?; Informally, colorfulness. The color\n * returned may be lower than the requested chroma. Chroma has a different\n * maximum for any given hue and tone.\n * @param tone 0 <= tone <= 100; invalid values are corrected.\n * @return HCT representation of a color in default viewing conditions.\n */\n\n /** @type {number} */\n internalHue;\n\n /** @type {number} */\n internalChroma;\n\n /** @type {number} */\n internalTone;\n\n /**\n * @param {number} hue\n * @param {number} chroma\n * @param {number} tone\n * @return {Hct}\n */\n static from(hue, chroma, tone) {\n return new Hct(hctSolver.solveToInt(hue, chroma, tone));\n }\n\n /**\n * @param {number} argb ARGB representation of a color.\n * @return {Hct} HCT representation of a color in default viewing conditions\n */\n static fromInt(argb) {\n return new Hct(argb);\n }\n\n /** @return {number} */\n toInt() {\n return this.argb;\n }\n\n /**\n * A number, in degrees, representing ex. red, orange, yellow, etc.\n * Ranges from 0 <= hue < 360.\n * @return {number}\n */\n get hue() {\n return this.internalHue;\n }\n\n /**\n * @param {number} newHue 0 <= newHue < 360; invalid values are corrected.\n * Chroma may decrease because chroma has a different maximum for any given\n * hue and tone.\n */\n set hue(newHue) {\n this.setInternalState(\n hctSolver.solveToInt(\n newHue,\n this.internalChroma,\n this.internalTone,\n ),\n );\n }\n\n /** @return {number} */\n get chroma() {\n return this.internalChroma;\n }\n\n /**\n * @param {number} newChroma 0 <= newChroma < ?\n * Chroma may decrease because chroma has a different maximum for any given\n * hue and tone.\n */\n set chroma(newChroma) {\n this.setInternalState(\n hctSolver.solveToInt(\n this.internalHue,\n newChroma,\n this.internalTone,\n ),\n );\n }\n\n /**\n * Lightness. Ranges from 0 to 100.\n * @return {number}\n */\n get tone() {\n return this.internalTone;\n }\n\n /**\n * @param {number} newTone 0 <= newTone <= 100; invalid valids are corrected.\n * Chroma may decrease because chroma has a different maximum for any given\n * hue and tone.\n */\n set tone(newTone) {\n this.setInternalState(\n hctSolver.solveToInt(\n this.internalHue,\n this.internalChroma,\n newTone,\n ),\n );\n }\n\n /** @param {number} argb */\n constructor(argb) {\n const cam = Cam16.fromInt(argb);\n this.internalHue = cam.hue;\n this.internalChroma = cam.chroma;\n this.internalTone = utils.lstarFromArgb(argb);\n this.argb = argb;\n }\n\n /**\n * @private\n * @param {number} argb\n */\n setInternalState(argb) {\n const cam = Cam16.fromInt(argb);\n this.internalHue = cam.hue;\n this.internalChroma = cam.chroma;\n this.internalTone = utils.lstarFromArgb(argb);\n this.argb = argb;\n }\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Hct from './Hct.js';\n\n/**\n * A convenience class for retrieving colors that are constant in hue and\n * chroma, but vary in tone.\n */\nexport default class TonalPalette {\n /** @type {Map<number, number>} */\n #cache = new Map();\n\n /**\n * @param {number} argb ARGB representation of a color\n * @return {TonalPalette} Tones matching that color's hue and chroma.\n */\n static fromInt(argb) {\n const hct = Hct.fromInt(argb);\n return TonalPalette.fromHueAndChroma(hct.hue, hct.chroma);\n }\n\n /**\n * @param {number} hue HCT hue\n * @param {number} chroma HCT chroma\n * @return {TonalPalette} Tones matching hue and chroma.\n */\n static fromHueAndChroma(hue, chroma) {\n return new TonalPalette(hue, chroma);\n }\n\n /**\n * @private\n * @param {number} hue\n * @param {number} chroma\n */\n constructor(hue, chroma) {\n this.hue = hue;\n this.chroma = chroma;\n }\n\n /**\n * @param {number} tone HCT tone, measured from 0 to 100.\n * @return {number} ARGB representation of a color with that tone.\n */\n tone(tone) {\n let argb = this.#cache.get(tone);\n if (argb === undefined) {\n argb = Hct.from(this.hue, this.chroma, tone).toInt();\n this.#cache.set(tone, argb);\n }\n return argb;\n }\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Hct from './Hct.js';\nimport TonalPalette from './TonalPalette.js';\n\n/**\n * An intermediate concept between the key color for a UI theme, and a full\n * color scheme. 5 sets of tones are generated, all except one use the same hue\n * as the key color, and all vary in chroma.\n */\nexport default class CorePalette {\n /** @type {TonalPalette} */\n a1;\n\n /** @type {TonalPalette} */\n a2;\n\n /** @type {TonalPalette} */\n a3;\n\n /** @type {TonalPalette} */\n n1;\n\n /** @type {TonalPalette} */\n n2;\n\n /** @type {TonalPalette} */\n error;\n\n /**\n * @param {number} argb ARGB representation of a color\n * @return {CorePalette}\n */\n static of(argb) {\n return new CorePalette(argb, false);\n }\n\n /**\n * @param {number} argb ARGB representation of a color\n * @return {CorePalette}\n */\n static contentOf(argb) {\n return new CorePalette(argb, true);\n }\n\n /**\n * @param {number} argb\n * @param {boolean} isContent\n */\n constructor(argb, isContent) {\n const hct = Hct.fromInt(argb);\n const { hue } = hct;\n const { chroma } = hct;\n if (isContent) {\n this.a1 = TonalPalette.fromHueAndChroma(hue, chroma);\n this.a2 = TonalPalette.fromHueAndChroma(hue, chroma / 3);\n this.a3 = TonalPalette.fromHueAndChroma(hue + 60, chroma / 2);\n this.n1 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 12, 4));\n this.n2 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 6, 8));\n } else {\n this.a1 = TonalPalette.fromHueAndChroma(hue, Math.max(48, chroma));\n this.a2 = TonalPalette.fromHueAndChroma(hue, 16);\n this.a3 = TonalPalette.fromHueAndChroma(hue + 60, 24);\n this.n1 = TonalPalette.fromHueAndChroma(hue, 4);\n this.n2 = TonalPalette.fromHueAndChroma(hue, 8);\n }\n this.error = TonalPalette.fromHueAndChroma(25, 84);\n }\n}\n", "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport CorePalette from './CorePalette.js';\n\n/** Represents a Material color scheme, a mapping of color roles to colors. */\nexport default class Scheme {\n /**\n * @param {number} [primary]\n * @param {number} [onPrimary]\n * @param {number} [primaryContainer]\n * @param {number} [onPrimaryContainer]\n * @param {number} [secondary]\n * @param {number} [onSecondary]\n * @param {number} [secondaryContainer]\n * @param {number} [onSecondaryContainer]\n * @param {number} [tertiary]\n * @param {number} [onTertiary]\n * @param {number} [tertiaryContainer]\n * @param {number} [onTertiaryContainer]\n * @param {number} [error]\n * @param {number} [onError]\n * @param {number} [errorContainer]\n * @param {number} [onErrorContainer]\n * @param {number} [background]\n * @param {number} [onBackground]\n * @param {number} [surface]\n * @param {number} [onSurface]\n * @param {number} [surfaceVariant]\n * @param {number} [onSurfaceVariant]\n * @param {number} [outline]\n * @param {number} [outlineVariant]\n * @param {number} [shadow]\n * @param {number} [scrim]\n * @param {number} [inverseSurface]\n * @param {number} [inverseOnSurface]\n * @param {number} [inversePrimary]\n */\n constructor(\n primary,\n onPrimary,\n primaryContainer,\n onPrimaryContainer,\n secondary,\n onSecondary,\n secondaryContainer,\n onSecondaryContainer,\n tertiary,\n onTertiary,\n tertiaryContainer,\n onTertiaryContainer,\n error,\n onError,\n errorContainer,\n onErrorContainer,\n background,\n onBackground,\n surface,\n onSurface,\n surfaceVariant,\n onSurfaceVariant,\n outline,\n outlineVariant,\n shadow,\n scrim,\n inverseSurface,\n inverseOnSurface,\n inversePrimary,\n ) {\n this.primary = primary;\n this.onPrimary = onPrimary;\n this.primaryContainer = primaryContainer;\n this.onPrimaryContainer = onPrimaryContainer;\n this.secondary = secondary;\n this.onSecondary = onSecondary;\n this.secondaryContainer = secondaryContainer;\n this.onSecondaryContainer = onSecondaryContainer;\n this.tertiary = tertiary;\n this.onTertiary = onTertiary;\n this.tertiaryContainer = tertiaryContainer;\n this.onTertiaryContainer = onTertiaryContainer;\n this.error = error;\n this.onError = onError;\n this.errorContainer = errorContainer;\n this.onErrorContainer = onErrorContainer;\n this.background = background;\n this.onBackground = onBackground;\n this.surface = surface;\n this.onSurface = onSurface;\n this.surfaceVariant = surfaceVariant;\n this.onSurfaceVariant = onSurfaceVariant;\n this.outline = outline;\n this.outlineVariant = outlineVariant;\n this.shadow = shadow;\n this.scrim = scrim;\n this.inverseSurface = inverseSurface;\n this.inverseOnSurface = inverseOnSurface;\n this.inversePrimary = inversePrimary;\n }\n\n /**\n * @param {number} argb\n * @return {Scheme}\n */\n static light(argb) {\n return Scheme.#lightFromCorePalette(CorePalette.of(argb));\n }\n\n /**\n * @param {number} argb\n * @return {Scheme}\n */\n static dark(argb) {\n return Scheme.#darkFromCorePalette(CorePalette.of(argb));\n }\n\n /**\n * @param {number} argb\n * @return {Scheme}\n */\n static lightContent(argb) {\n return Scheme.#lightFromCorePalette(CorePalette.contentOf(argb));\n }\n\n /**\n * @param {number} argb\n * @return {Scheme}\n */\n static darkContent(argb) {\n return Scheme.#darkFromCorePalette(CorePalette.contentOf(argb));\n }\n\n /**\n * Light scheme from core palette\n * @param {CorePalette} core\n * @return {Scheme}\n */\n static #lightFromCorePalette(core) {\n return new Scheme()\n .withPrimary(core.a1.tone(40))\n .withOnPrimary(core.a1.tone(100))\n .withPrimaryContainer(core.a1.tone(90))\n .withOnPrimaryContainer(core.a1.tone(10))\n .withSecondary(core.a2.tone(40))\n .withOnSecondary(core.a2.tone(100))\n .withSecondaryContainer(core.a2.tone(90))\n .withOnSecondaryContainer(core.a2.tone(10))\n .withTertiary(core.a3.tone(40))\n .withOnTertiary(core.a3.tone(100))\n .withTertiaryContainer(core.a3.tone(90))\n .withOnTertiaryContainer(core.a3.tone(10))\n .withError(core.error.tone(40))\n .withOnError(core.error.tone(100))\n .withErrorContainer(core.error.tone(90))\n .withOnErrorContainer(core.error.tone(10))\n .withBackground(core.n1.tone(99))\n .withOnBackground(core.n1.tone(10))\n .withSurface(core.n1.tone(99))\n .withOnSurface(core.n1.tone(10))\n .withSurfaceVariant(core.n2.tone(90))\n .withOnSurfaceVariant(core.n2.tone(30))\n .withOutline(core.n2.tone(50))\n .withOutlineVariant(core.n2.tone(80))\n .withShadow(core.n1.tone(0))\n .withScrim(core.n1.tone(0))\n .withInverseSurface(core.n1.tone(20))\n .withInverseOnSurface(core.n1.tone(95))\n .withInversePrimary(core.a1.tone(80));\n }\n\n /**\n * Dark scheme from core palette\n * @param {CorePalette} core\n * @return {Scheme}\n */\n static #darkFromCorePalette(core) {\n return new Scheme()\n .withPrimary(core.a1.tone(80))\n .withOnPrimary(core.a1.tone(20))\n .withPrimaryContainer(core.a1.tone(30))\n .withOnPrimaryContainer(core.a1.tone(90))\n .withSecondary(core.a2.tone(80))\n .withOnSecondary(core.a2.tone(20))\n .withSecondaryContainer(core.a2.tone(30))\n .withOnSecondaryContainer(core.a2.tone(90))\n .withTertiary(core.a3.tone(80))\n .withOnTertiary(core.a3.tone(20))\n .withTertiaryContainer(core.a3.tone(30))\n .withOnTertiaryContainer(core.a3.tone(90))\n .withError(core.error.tone(80))\n .withOnError(core.error.tone(20))\n .withErrorContainer(core.error.tone(30))\n .withOnErrorContainer(core.error.tone(90))\n .withBackground(core.n1.tone(10))\n .withOnBackground(core.n1.tone(90))\n .withSurface(core.n1.tone(10))\n .withOnSurface(core.n1.tone(90))\n .withSurfaceVariant(core.n2.tone(30))\n .withOnSurfaceVariant(core.n2.tone(80))\n .withOutline(core.n2.tone(60))\n .withOutlineVariant(core.n2.tone(30))\n .withShadow(core.n1.tone(0))\n .withScrim(core.n1.tone(0))\n .withInverseSurface(core.n1.tone(90))\n .withInverseOnSurface(core.n1.tone(20))\n .withInversePrimary(core.a1.tone(40));\n }\n\n /**\n * @param {number} primary\n * @return {this}\n */\n withPrimary(primary) {\n this.primary = primary;\n return this;\n }\n\n /**\n * @param {number} onPrimary\n * @return {this}\n */\n withOnPrimary(onPrimary) {\n this.onPrimary = onPrimary;\n return this;\n }\n\n /**\n * @param {number} primaryContainer\n * @return {this}\n */\n withPrimaryContainer(primaryContainer) {\n this.primaryContainer = primaryContainer;\n return this;\n }\n\n /**\n * @param {number} onPrimaryContainer\n * @return {this}\n */\n withOnPrimaryContainer(onPrimaryContainer) {\n this.onPrimaryContainer = onPrimaryContainer;\n return this;\n }\n\n /**\n * @param {number} secondary\n * @return {this}\n */\n withSecondary(secondary) {\n this.secondary = secondary;\n return this;\n }\n\n /**\n * @param {number} onSecondary\n * @return {this}\n */\n withOnSecondary(onSecondary) {\n this.onSecondary = onSecondary;\n return this;\n }\n\n /**\n * @param {number} secondaryContainer\n * @return {this}\n */\n withSecondaryContainer(secondaryContainer) {\n this.secondaryContainer = secondaryContainer;\n return this;\n }\n\n /**\n * @param {number} onSecondaryContainer\n * @return {this}\n */\n withOnSecondaryContainer(onSecondaryContainer) {\n this.onSecondaryContainer = onSecondaryContainer;\n return this;\n }\n\n /**\n * @param {number} tertiary\n * @return {this}\n */\n withTertiary(tertiary) {\n this.tertiary = tertiary;\n return this;\n }\n\n /**\n * @param {number} onTertiary\n * @return {this}\n */\n withOnTertiary(onTertiary) {\n this.onTertiary = onTertiary;\n return this;\n }\n\n /**\n * @param {number} tertiaryContainer\n * @return {this}\n */\n withTertiaryContainer(tertiaryContainer) {\n this.tertiaryContainer = tertiaryContainer;\n return this;\n }\n\n /**\n * @param {number} onTertiaryContainer\n * @return {this}\n */\n withOnTertiaryContainer(onTertiaryContainer) {\n this.onTertiaryContainer = onTertiaryContainer;\n return this;\n }\n\n /**\n * @param {number} error\n * @return {this}\n */\n withError(error) {\n this.error = error;\n return this;\n }\n\n /**\n * @param {number} onError\n * @return {this}\n */\n withOnError(onError) {\n this.onError = onError;\n return this;\n }\n\n /**\n * @param {number} errorContainer\n * @return {this}\n */\n withErrorContainer(errorContainer) {\n this.errorContainer = errorContainer;\n return this;\n }\n\n /**\n * @param {number} onErrorContainer\n * @return {this}\n */\n withOnErrorContainer(onErrorContainer) {\n this.onErrorContainer = onErrorContainer;\n return this;\n }\n\n /**\n * @param {number} background\n * @return {this}\n */\n withBackground(background) {\n this.background = background;\n return this;\n }\n\n /**\n * @param {number} onBackground\n * @return {this}\n */\n withOnBackground(onBackground) {\n this.onBackground = onBackground;\n return this;\n }\n\n /**\n * @param {number} surface\n * @return {this}\n */\n withSurface(surface) {\n this.surface = surface;\n return this;\n }\n\n /**\n * @param {number} onSurface\n * @return {this}\n */\n withOnSurface(onSurface) {\n this.onSurface = onSurface;\n return this;\n }\n\n /**\n * @param {number} surfaceVariant\n * @return {this}\n */\n withSurfaceVariant(surfaceVariant) {\n this.surfaceVariant = surfaceVariant;\n return this;\n }\n\n /**\n * @param {number} onSurfaceVariant\n * @return {this}\n */\n withOnSurfaceVariant(onSurfaceVariant) {\n this.onSurfaceVariant = onSurfaceVariant;\n return this;\n }\n\n /**\n * @param {number} outline\n * @return {this}\n */\n withOutline(outline) {\n this.outline = outline;\n return this;\n }\n\n /**\n * @param {number} outlineVariant\n * @return {this}\n */\n withOutlineVariant(outlineVariant) {\n this.outlineVariant = outlineVariant;\n return this;\n }\n\n /**\n * @param {number} shadow\n * @return {this}\n */\n withShadow(shadow) {\n this.shadow = shadow;\n return this;\n }\n\n /**\n * @param {number} scrim\n * @return {this}\n */\n withScrim(scrim) {\n this.scrim = scrim;\n return this;\n }\n\n /**\n * @param {number} inverseSurface\n * @return {this}\n */\n withInverseSurface(inverseSurface) {\n this.inverseSurface = inverseSurface;\n return this;\n }\n\n /**\n * @param {number} inverseOnSurface\n * @return {this}\n */\n withInverseOnSurface(inverseOnSurface) {\n this.inverseOnSurface = inverseOnSurface;\n return this;\n }\n\n /**\n * @param {number} inversePrimary\n * @return {this}\n */\n withInversePrimary(inversePrimary) {\n this.inversePrimary = inversePrimary;\n return this;\n }\n\n /**\n * @param {any} object\n @return {boolean} */\n equals(object) {\n if (this === object) {\n return true;\n }\n if (!(object instanceof Scheme)) {\n return false;\n }\n\n /** @type {Scheme} */\n const scheme = object;\n\n if (this.primary !== scheme.primary) {\n return false;\n }\n if (this.onPrimary !== scheme.onPrimary) {\n return false;\n }\n if (this.primaryContainer !== scheme.primaryContainer) {\n return false;\n }\n if (this.onPrimaryContainer !== scheme.onPrimaryContainer) {\n return false;\n }\n if (this.secondary !== scheme.secondary) {\n return false;\n }\n if (this.onSecondary !== scheme.onSecondary) {\n return false;\n }\n if (this.secondaryContainer !== scheme.secondaryContainer) {\n return false;\n }\n if (this.onSecondaryContainer !== scheme.onSecondaryContainer) {\n return false;\n }\n if (this.tertiary !== scheme.tertiary) {\n return false;\n }\n if (this.onTertiary !== scheme.onTertiary) {\n return false;\n }\n if (this.tertiaryContainer !== scheme.tertiaryContainer) {\n return false;\n }\n if (this.onTertiaryContainer !== scheme.onTertiaryContainer) {\n return false;\n }\n if (this.error !== scheme.error) {\n return false;\n }\n if (this.onError !== scheme.onError) {\n return false;\n }\n if (this.errorContainer !== scheme.errorContainer) {\n return false;\n }\n if (this.onErrorContainer !== scheme.onErrorContainer) {\n return false;\n }\n if (this.background !== scheme.background) {\n return false;\n }\n if (this.onBackground !== scheme.onBackground) {\n return false;\n }\n if (this.surface !== scheme.surface) {\n return false;\n }\n if (this.onSurface !== scheme.onSurface) {\n return false;\n }\n if (this.surfaceVariant !== scheme.surfaceVariant) {\n return false;\n }\n if (this.onSurfaceVariant !== scheme.onSurfaceVariant) {\n return false;\n }\n if (this.outline !== scheme.outline) {\n return false;\n }\n if (this.outlineVariant !== scheme.outlineVariant) {\n return false;\n }\n if (this.shadow !== scheme.shadow) {\n return false;\n }\n if (this.scrim !== scheme.scrim) {\n return false;\n }\n if (this.inverseSurface !== scheme.inverseSurface) {\n return false;\n }\n if (this.inverseOnSurface !== scheme.inverseOnSurface) {\n return false;\n }\n if (this.inversePrimary !== scheme.inversePrimary) {\n return false;\n }\n\n return true;\n }\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// libmonet is designed to have a consistent API across platforms\n// and modular components that can be moved around easily. Using a class as a\n// namespace facilitates this.\n//\n// tslint:disable:class-as-namespace\n\nimport Cam16 from './Cam16.js';\nimport Hct from './Hct.js';\nimport * as colorUtils from './colorUtils.js';\nimport * as mathUtils from './mathUtils.js';\n\n/**\n * Blend the design color's HCT hue towards the key color's HCT\n * hue, in a way that leaves the original color recognizable and\n * recognizably shifted towards the key color.\n * @param {number} designColor ARGB representation of an arbitrary color.\n * @param {number} sourceColor ARGB representation of the main theme color.\n * @return {number} The design color with a hue shifted towards the\n * system's color, a slightly warmer/cooler variant of the design\n * color's hue.\n */\nexport function harmonize(designColor, sourceColor) {\n const fromHct = Hct.fromInt(designColor);\n const toHct = Hct.fromInt(sourceColor);\n const differenceDegrees = mathUtils.differenceDegrees(fromHct.hue, toHct.hue);\n const rotationDegrees = Math.min(differenceDegrees * 0.5, 15);\n const outputHue = mathUtils.sanitizeDegreesDouble(\n fromHct.hue\n + rotationDegrees * mathUtils.rotationDirection(fromHct.hue, toHct.hue),\n );\n return Hct.from(outputHue, fromHct.chroma, fromHct.tone).toInt();\n}\n\n/**\n * Blend in CAM16-UCS space.\n * @param {number} from ARGB representation of color\n * @param {number} to ARGB representation of color\n * @param {number} amount how much blending to perform; 0.0 >= and <= 1.0\n * @return {number} from, blended towards to. Hue, chroma, and tone will\n * change.\n */\nexport function cam16Ucs(from, to, amount) {\n const fromCam = Cam16.fromInt(from);\n const toCam = Cam16.fromInt(to);\n const fromJ = fromCam.jstar;\n const fromA = fromCam.astar;\n const fromB = fromCam.bstar;\n const toJ = toCam.jstar;\n const toA = toCam.astar;\n const toB = toCam.bstar;\n const jstar = fromJ + (toJ - fromJ) * amount;\n const astar = fromA + (toA - fromA) * amount;\n const bstar = fromB + (toB - fromB) * amount;\n return Cam16.fromUcs(jstar, astar, bstar).toInt();\n}\n\n/**\n * Blends hue from one color into another. The chroma and tone of\n * the original color are maintained.\n * @param {number} from ARGB representation of color\n * @param {number} to ARGB representation of color\n * @param {number} amount how much blending to perform; 0.0 >= and <= 1.0\n * @return {number} from, with a hue blended towards to. Chroma and tone\n * are constant.\n */\nexport function hctHue(from, to, amount) {\n const ucs = cam16Ucs(from, to, amount);\n const ucsCam = Cam16.fromInt(ucs);\n const fromCam = Cam16.fromInt(from);\n const blended = Hct.from(\n ucsCam.hue,\n fromCam.chroma,\n colorUtils.lstarFromArgb(from),\n );\n return blended.toInt();\n}\n", "import CorePalette from './CorePalette.js';\nimport Scheme from './Scheme.js';\nimport { harmonize } from './blend.js';\nimport * as colorUtils from './colorUtils.js';\n\n/** @typedef {import('./TonalPalette.js').default} TonalPalette */\n\n/**\n * @param {string} value\n * @return {number}\n */\nfunction parseIntHex(value) {\n // tslint:disable-next-line:ban\n return Number.parseInt(value, 16);\n}\n\n/**\n * @param {string} hex String representing color as hex code. Accepts strings with or\n * without leading #, and string representing the color using 3, 6, or 8\n * hex characters.\n * @return {number} ARGB representation of color.\n */\nfunction argbFromHex(hex) {\n hex = hex.replace('#', '');\n const isThree = hex.length === 3;\n const isSix = hex.length === 6;\n const isEight = hex.length === 8;\n if (!isThree && !isSix && !isEight) {\n throw new Error(`unexpected hex ${hex}`);\n }\n let r = 0;\n let g = 0;\n let b = 0;\n if (isThree) {\n r = parseIntHex(hex.slice(0, 1).repeat(2));\n g = parseIntHex(hex.slice(1, 2).repeat(2));\n b = parseIntHex(hex.slice(2, 3).repeat(2));\n } else if (isSix) {\n r = parseIntHex(hex.slice(0, 2));\n g = parseIntHex(hex.slice(2, 4));\n b = parseIntHex(hex.slice(4, 6));\n } else if (isEight) {\n r = parseIntHex(hex.slice(2, 4));\n g = parseIntHex(hex.slice(4, 6));\n b = parseIntHex(hex.slice(6, 8));\n }\n\n return (\n ((255 << 24) | ((r & 0x0_FF) << 16) | ((g & 0x0_FF) << 8) | (b & 0x0_FF))\n >>> 0);\n}\n\n/**\n * @param {number} argb ARGB representation of a color.\n * @return {string} Hex string representing color, ex. #ff0000 for red.\n */\nfunction hexFromArgb(argb) {\n const r = colorUtils.redFromArgb(argb);\n const g = colorUtils.greenFromArgb(argb);\n const b = colorUtils.blueFromArgb(argb);\n const outParts = [r.toString(16), g.toString(16), b.toString(16)];\n\n // Pad single-digit output values\n for (const [i, part] of outParts.entries()) {\n if (part.length === 1) {\n outParts[i] = `0${part}`;\n }\n }\n\n return `#${outParts.join('')}`;\n}\n\n/**\n * @param {number} argb\n * @return {string}\n */\nfunction cssVarFromArgb(argb) {\n return [\n colorUtils.redFromArgb(argb),\n colorUtils.greenFromArgb(argb),\n colorUtils.blueFromArgb(argb),\n ].join(',');\n}\n\n/**\n * @param {Scheme} scheme\n * @return {string}\n */\nfunction cssVariablesFromScheme(scheme) {\n return /* css */`\n :root {\n --mdw-color__primary: ${cssVarFromArgb(scheme.primary)};\n --mdw-color__on-primary: ${cssVarFromArgb(scheme.onPrimary)};\n --mdw-color__primary-container: ${cssVarFromArgb(scheme.primaryContainer)};\n --mdw-color__on-primary-container: ${cssVarFromArgb(scheme.onPrimaryContainer)};\n --mdw-color__secondary: ${cssVarFromArgb(scheme.secondary)};\n --mdw-color__on-secondary: ${cssVarFromArgb(scheme.onSecondary)};\n --mdw-color__secondary-container: ${cssVarFromArgb(scheme.secondaryContainer)};\n --mdw-color__on-secondary-container: ${cssVarFromArgb(scheme.onSecondaryContainer)};\n --mdw-color__tertiary: ${cssVarFromArgb(scheme.tertiary)};\n --mdw-color__on-tertiary: ${cssVarFromArgb(scheme.onTertiary)};\n --mdw-color__tertiary-container: ${cssVarFromArgb(scheme.tertiaryContainer)};\n --mdw-color__on-tertiary-container: ${cssVarFromArgb(scheme.onTertiaryContainer)};\n --mdw-color__error: ${cssVarFromArgb(scheme.error)};\n --mdw-color__on-error: ${cssVarFromArgb(scheme.onError)};\n --mdw-color__error-container: ${cssVarFromArgb(scheme.errorContainer)};\n --mdw-color__on-error-container: ${cssVarFromArgb(scheme.onErrorContainer)};\n --mdw-color__background: ${cssVarFromArgb(scheme.background)};\n --mdw-color__on-background: ${cssVarFromArgb(scheme.onBackground)};\n --mdw-color__surface: ${cssVarFromArgb(scheme.surface)};\n --mdw-color__on-surface: ${cssVarFromArgb(scheme.onSurface)};\n --mdw-color__surface-variant: ${cssVarFromArgb(scheme.surfaceVariant)};\n --mdw-color__on-surface-variant: ${cssVarFromArgb(scheme.onSurfaceVariant)};\n --mdw-color__outline: ${cssVarFromArgb(scheme.outline)};\n --mdw-color__outline-variant: ${cssVarFromArgb(scheme.outlineVariant)};\n --mdw-color__shadow: ${cssVarFromArgb(scheme.shadow)};\n --mdw-color__scrim: ${cssVarFromArgb(scheme.scrim)};\n --mdw-color__inverse-surface: ${cssVarFromArgb(scheme.inverseSurface)};\n --mdw-color__inverse-on-surface: ${cssVarFromArgb(scheme.inverseOnSurface)};\n --mdw-color__inverse-primary: ${cssVarFromArgb(scheme.inversePrimary)};\n }\n `;\n}\n\n/**\n * @param {string} name\n * @param {TonalPalette} tonalPalette\n * @param {boolean} [isDark]\n */\nfunction cssVariablesFromCustom(name, tonalPalette, isDark) {\n return /* css */`\n :root {\n --mdw-color__${name}: ${cssVarFromArgb(tonalPalette.tone(isDark ? 80 : 40))};\n --mdw-color__on-${name}: ${cssVarFromArgb(tonalPalette.tone(isDark ? 20 : 100))};\n --mdw-color__${name}-container: ${cssVarFromArgb(tonalPalette.tone(isDark ? 30 : 90))};\n --mdw-color__on-${name}-container: ${cssVarFromArgb(tonalPalette.tone(isDark ? 90 : 10))};\n }\n .mdw-custom[color=\"${name}\"] {\n --mdw-bg: var(--mdw-color__${name});\n --mdw-ink: var(--mdw-color__on-${name});\n }\n .mdw-custom[color=\"${name}-container\"] {\n --mdw-bg: var(--mdw-color__${name}-container);\n --mdw-ink: var(--mdw-color__on-${name}-container);\n }\n .mdw-custom[ink=\"${name}\"] {\n --mdw-ink: var(--mdw-color__${name});\n }\n \n \n `;\n}\n\n/**\n * @param {string} mainColor as hex\n * @param {Iterable<[string,string]>} [customColors]\n * @return {Record<string, string>}\n */\nexport function getScheme(mainColor, customColors = []) {\n const argbColor = argbFromHex(mainColor);\n const lightRules = [cssVariablesFromScheme(Scheme.light(argbColor))];\n const darkRules = [cssVariablesFromScheme(Scheme.dark(argbColor))];\n const lightContentRules = [cssVariablesFromScheme(Scheme.lightContent(argbColor))];\n const darkContentRules = [cssVariablesFromScheme(Scheme.darkContent(argbColor))];\n for (const [name, color] of customColors) {\n const argbCustom = argbFromHex(color);\n const blended = harmonize(argbCustom, argbColor);\n const { a1: tp } = CorePalette.of(blended);\n const { a1: ctp } = CorePalette.contentOf(blended);\n\n lightRules.push(cssVariablesFromCustom(name, tp));\n darkRules.push(cssVariablesFromCustom(name, tp, true));\n lightContentRules.push(cssVariablesFromCustom(name, ctp));\n darkContentRules.push(cssVariablesFromCustom(name, ctp, true));\n }\n return {\n light: lightRules.join('\\n'),\n dark: darkRules.join('\\n'),\n lightContent: lightContentRules.join('\\n'),\n darkContent: darkContentRules.join('\\n'),\n };\n}\n", "/**\n * Uses UTF-8 charset instead of base64 for better compression\n * @param {string} svg\n * @return {string}\n */\nexport function svgToCSSURL(svg) {\n return `url('data:image/svg+xml;charset=UTF-8,${svg\n .replaceAll('\\n', ' ')\n .replaceAll('#', '%23')\n .replaceAll('(', '%28')\n .replaceAll(')', '%29')}')`;\n}\n"],
5
+ "mappings": "6rBAKO,SAAUA,GAAuBC,EAAQ,CAC9C,QAAWC,KAASD,EAClB,GAAIC,aAAiB,iBAAkB,CACrC,IAAMC,EAAQ,IAAI,cAClBA,EAAM,YAAYD,EAAM,WAAW,EACnC,MAAMC,UACGD,EAAM,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AC,EAAQ,UAAW,OAAQ,CAAC;AAAA;AAAA;AAAA,QAGpDF,GAAiB,CAAE,MAAAC,EAAO,OAAAC,EAAQ,UAAW,MAAO,CAAC;AAAA,OAGpD,CACLa,EACAC,EACAC,CACF,EAAE,KAAK;AAAA,CAAI,CACb,CDhdA,IAAMC,GAAQ,CACZC,GAAiBC,GAA6B,IAAI,IAAI,YAAY,GAAG,EAAE,YAAY,CAAC,EACpFC,GAA4B,CAC9B,EAAE,KAAK;AAAA,CAAI,EAELC,GAASC,KAAML,KACjBI,cAAkB,iBACpB,SAAS,KAAK,OAAOA,EAAM,EAE3B,SAAS,mBAAqB,CAC5B,GAAG,SAAS,mBACZA,EACF",
6
+ "names": ["generateCSSStyleSheets", "styles", "style", "sheet", "styleElementWrappers", "generateHTMLStyleElements", "styleElement", "PREFIX", "generatedUIDs", "generateUID", "id", "identifierFromElement", "element", "mutate", "buildMergePatch", "previous", "current", "arrayStrategy", "isArray", "patch", "previousKeys", "key", "value", "changes", "hasMergePatch", "target", "attrValueFromDataValue", "value", "attrNameFromPropName", "name", "attrNameWords", "prev", "curr", "IS_FIREFOX", "isFocused", "element", "attemptFocus", "options", "isRtl", "DEFAULT_NULL_PARSER", "DEFAULT_BOOLEAN_PARSER", "v", "DEFAULT_NUMBER_PARSER", "DEFAULT_STRING_PARSER", "DEFAULT_OBJECT_PARSER", "o", "DEFAULT_OBJECT_COMPARATOR", "a", "b", "hasMergePatch", "DEFAULT_OBJECT_DIFF", "buildMergePatch", "emptyFromType", "type", "defaultParserFromType", "parseObserverOptions", "name", "typeOrOptions", "object", "options", "enumerable", "attr", "reflect", "empty", "changedCallback", "parsedType", "value", "parsed", "attrNameFromPropName", "parser", "nullParser", "parsedEmpty", "isFn", "diff", "INIT_SYMBOL", "DEFAULT_OBSERVER_CONFIGURATION", "observeFunction", "fn", "arg0", "args", "argPoked", "thisPoked", "buildProxy", "proxyTarget", "set", "prefix", "target", "p", "arg", "value", "argProxy", "thisProxy", "defaultValue", "reusable", "defineObservableProperty", "object", "key", "options", "config", "DEFAULT_OBSERVER_CONFIGURATION", "parseObserverOptions", "detectChange", "oldValue", "commit", "newValue", "changes", "internalGet", "internalSet", "onInvalidate", "props", "prop", "descriptor", "INIT_SYMBOL", "_inactiveDocument", "_cssStyleSheetConstructable", "generateFragment", "fromString", "inlineFunctions", "addInlineFunction", "fn", "internalName", "generateUID", "cssStyleSheetsCache", "styleElementCache", "css", "array", "substitutions", "content", "sheet", "style", "fragmentCache", "html", "strings", "tempSlots", "replacements", "sub", "tempId", "compiledString", "fragment", "id", "element", "STRING_INTERPOLATION_REGEX", "buildShadowRootChildListener", "fn", "event", "host", "flattenObject", "object", "syntax", "target", "scope", "key", "value", "scopedKey", "entryFromPropName", "prop", "source", "child", "valueFromPropName", "Composition", "parts", "generateFragment", "part", "listener", "set", "root", "changes", "context", "store", "fnResults", "modifiedNodes", "flattened", "rawValue", "entries", "id", "node", "nodeType", "props", "negate", "doubleNegate", "ref", "args", "lastIndexOfDot", "entry", "propSearchKey", "lastPropSearchKey", "propName", "index", "nodesFound", "childNode", "attached", "orphaned", "shouldShow", "metadata", "comment", "parent", "commentText", "#interpolateNode", "element", "defaults", "parsedValue", "nodeValue", "nodeName", "trimmed", "length", "segments", "segment", "newNode", "isEvent", "textNodeIndex", "prev", "identifierFromElement", "eventType", "flags", "type", "options", "inlineFunctions", "defaultValue", "inlineFunctionOptions", "observeResult", "observeFunction", "parsedNodeName", "removalList", "TREE_WALKER_FILTER", "treeWalker", "removeElement", "attr", "parentId", "nextNode", "watcher", "generateCSSStyleSheets", "generateHTMLStyleElements", "data", "rootEventTarget", "events", "eventTarget", "references", "anchorElement", "cloneTarget", "interpolatedElement", "parentElement", "referencedParent", "liveElement", "conditionalParent", "iterator", "nodeIdentifier", "reusable", "ICustomElement", "EVENT_PREFIX_REGEX", "_refsProxy", "_refsCache", "_refsCompositionCache", "_composition", "_template", "template_get", "_CustomElement", "ICustomElement", "args", "__privateAdd", "__publicField", "callback", "s", "config", "__privateGet", "__privateSet", "Composition", "collection", "parts", "composition", "array", "substitutions", "css", "schema", "elementName", "strings", "html", "source", "options", "name", "value", "mixin", "force", "typeOrOptions", "customCallback", "oldValue", "newValue", "changes", "defineObservableProperty", "prop", "props", "propWatchers", "watcher", "index", "listeners", "key", "listenerOptions", "flags", "type", "listenerMap", "id", "nameOrCallbacks", "callbacks", "fn", "arrayPropName", "data", "store", "stringValue", "previousDataValue", "parsedValue", "reflect", "attr", "dataValue", "attrValue", "attrValueFromDataValue", "target", "element", "formattedId", "attrNameFromPropName", "listener", "e", "addInlineFunction", "CustomElement", "DensityMixin", "Base", "ShapeMixin", "Base", "ThemableMixin", "Base", "Badge_default", "CustomElement", "ThemableMixin", "DensityMixin", "ShapeMixin", "FlexableMixin", "Base", "Box_default", "CustomElement", "ThemableMixin", "FlexableMixin", "Body_default", "Box_default", "AriaReflectorMixin", "Base", "name", "value", "attrName", "oldValue", "newValue", "DEFAULT_ELEMENT_QUERY", "KeyboardNavMixin", "Base", "current", "loop", "reverse", "foundCurrent", "array", "candidate", "attemptFocus", "options", "currentlyFocusedChild", "currentTabIndexChild", "firstFocusableChild", "child", "event", "currentItem", "item", "isRtl", "AriaToolbarMixin", "Base", "KeyboardNavMixin", "SurfaceMixin", "Base", "hoveredState", "pressedState", "elevated", "elevation", "disabledState", "color", "Surface_default", "CustomElement", "ThemableMixin", "FlexableMixin", "SurfaceMixin", "ShapeMixin", "surface", "shape", "surfaceTint", "BottomAppBar_default", "Surface_default", "AriaToolbarMixin", "AriaReflectorMixin", "svgAliasMap", "unaliased", "documentLoadedStyleSheets", "Icon", "CustomElement", "ThemableMixin", "_slottedText", "result", "svgPath", "_svgAlias", "viewBox", "svg", "_computedSVGPath", "src", "currentTarget", "href", "parentNode", "link", "name", "path", "width", "height", "DOMString", "FORM_IPC_EVENT", "FormAssociatedMixin", "Base", "oldValue", "newValue", "_invalid", "v", "_formDisabled", "disabled", "error", "key", "value", "newTarget", "form", "event", "state", "mode", "ControlMixin", "Base", "_Control", "FormAssociatedMixin", "args", "name", "oldValue", "newValue", "ariaLabel", "options", "v", "validityState", "newValidity", "key", "error", "Control", "__publicField", "template", "html", "currentTarget", "control", "IMPLICIT_SUBMISSION_BLOCKING_TYPES", "InputMixin", "Base", "_input", "input_get", "_Input", "ControlMixin", "__privateAdd", "name", "oldValue", "newValue", "__privateGet", "event", "form", "defaultButton", "submissionBlockers", "element", "value", "Input", "__publicField", "__superGet", "label", "input", "DOMString", "_checkedDirty", "defaultChecked", "_checked", "eventHandlerValues", "EVENT_HANDLER_TYPE", "v", "name", "oldValue", "newValue", "button", "fn", "eventName", "elementStylerLastAnimation", "elementStylerValues", "elementStylerHasQueue", "elementStylerRAFCallback", "previousAnimation", "value", "currentAnimation", "ELEMENT_STYLER_TYPE", "oldValue", "newValue", "hasQueue", "Ripple_default", "CustomElement", "oldValue", "newValue", "ELEMENT_STYLER_TYPE", "_positionX", "_positionY", "_radius", "x", "y", "size", "hypotenuse", "parentWidth", "parentHeight", "width", "height", "animationName", "RippleMixin", "Base", "element", "ripple", "x", "y", "hold", "rippleContainer", "Ripple_default", "event", "rect", "lastRipple", "oldValue", "pressed", "lastInteractionWasTouch", "StateMixin", "Base", "disabled", "_hovered", "_focused", "_pressed", "_lastInteraction", "event", "Button_default", "CustomElement", "ThemableMixin", "DensityMixin", "SurfaceMixin", "ShapeMixin", "StateMixin", "RippleMixin", "InputMixin", "icon", "svg", "src", "svgPath", "shape", "surfaceTint", "state", "rippleContainer", "surface", "control", "label", "slot", "currentTarget", "value", "form", "duplicatedButton", "SUPPORTS_INERT", "Card_default", "CustomElement", "ThemableMixin", "FlexableMixin", "SurfaceMixin", "ShapeMixin", "FormAssociatedMixin", "StateMixin", "AriaReflectorMixin", "EVENT_HANDLER_TYPE", "disabledState", "slot", "surface", "surfaceTint", "shape", "outline", "CheckboxIcon_default", "CustomElement", "ThemableMixin", "ShapeMixin", "value", "html", "outline", "shape", "TouchTargetMixin", "Base", "Checkbox_default", "CustomElement", "ThemableMixin", "StateMixin", "RippleMixin", "InputMixin", "TouchTargetMixin", "indeterminate", "checked", "indeterminateIcon", "icon", "html", "label", "control", "state", "rippleContainer", "touchTarget", "Chip_default", "Button_default", "inline", "slot", "outline", "icon", "ink", "iconInk", "Divider_default", "CustomElement", "ThemableMixin", "DialogActions_default", "CustomElement", "handleTabKeyPress", "event", "focusableElements", "foundTarget", "candidate", "el", "OPEN_DIALOGS", "supportsHTMLDialogElement", "Dialog_default", "CustomElement", "event", "currentTarget", "hasContent", "node", "returnValue", "form", "e", "lastOpenDialog", "key", "value", "cancelEvent", "main", "stackIndex", "stack", "index", "source", "previousFocus", "title", "newState", "previousState", "dialogStack", "focusElement", "d", "open", "surface", "context", "handleTabKeyPress", "ExtendedFab_default", "Button_default", "Tooltip_default", "Surface_default", "AriaReflectorMixin", "oldValue", "newValue", "canAnchorPopup", "options", "pageX", "pageY", "directionX", "directionY", "clientX", "clientY", "anchor", "rect", "width", "height", "popup", "offsetX", "offsetY", "margin", "TooltipTriggerMixin", "Base", "_tooltip", "_idleDebounce", "_pendingHide", "_watchedParents", "_resizeObserver", "_intersectObserver", "_TooltipTrigger", "args", "__privateAdd", "__publicField", "event", "__privateSet", "__privateGet", "entries", "threshold", "entry", "child", "type", "timeout", "touch", "offsetParent", "parent", "hoverStyle", "domRect", "anchorOptions", "isPageRTL", "xStart", "xEnd", "preferences", "anchorResult", "preference", "canAnchorPopup", "TooltipTrigger", "template", "html", "Fab_default", "ExtendedFab_default", "TooltipTriggerMixin", "slot", "tooltipSlot", "control", "shape", "icon", "FilterChip_default", "Chip_default", "trailingIcon", "dropdown", "trailingSrc", "shape", "icon", "control", "outline", "slot", "checkIcon", "Headline_default", "Box_default", "ThemableMixin", "ariaLevel", "size", "slot", "IconButton_default", "Button_default", "TooltipTriggerMixin", "type", "checked", "event", "input", "clickEvent", "slot", "shape", "tooltipSlot", "icon", "label", "surfaceTint", "control", "outline", "el", "TextFieldMixin", "Base", "DensityMixin", "ShapeMixin", "error", "_invalid", "filled", "outlined", "label", "placeholder", "supporting", "_validationMessage", "value", "_badInput", "template", "html", "inline", "control", "labelElement", "outline", "shape", "outlineLeft", "outlineRight", "state", "shapeTop", "oldValue", "newValue", "Input_default", "CustomElement", "ThemableMixin", "StateMixin", "InputMixin", "TextFieldMixin", "Label_default", "Box_default", "Layout_default", "CustomElement", "List_default", "Box_default", "DensityMixin", "AriaReflectorMixin", "RadioIcon_default", "CustomElement", "ThemableMixin", "ShapeMixin", "value", "outline", "ListItem_default", "CustomElement", "ThemableMixin", "StateMixin", "RippleMixin", "AriaReflectorMixin", "disabled", "href", "state", "rippleContainer", "anchor", "oldValue", "newValue", "currentTarget", "_ListOption", "ListItem_default", "_selectedDirty", "defaultSelected", "_selected", "value", "_formDisabled", "disabled", "formDisabled", "options", "inline", "anchor", "state", "content", "disabledState", "selected", "text", "ListOption", "constructHTMLOptionsCollectionProxy", "host", "collection", "OptionConstructor", "GroupConstructor", "add", "element", "before", "beforeElement", "index", "remove", "i", "value", "target", "p", "receiver", "newValue", "currentSize", "_ListSelect", "List_default", "StateMixin", "FormAssociatedMixin", "KeyboardNavMixin", "el", "event", "host", "index", "ListOption", "target", "selections", "firstSelection", "constructHTMLOptionsCollectionProxy", "value", "v", "ListSelect", "oldValue", "newValue", "supportsHTMLDialogElement", "OPEN_MENUS", "onWindowResize", "lastOpenMenu", "onPopState", "event", "key", "onBeforeUnload", "Menu_default", "CustomElement", "DensityMixin", "KeyboardNavMixin", "items", "submenuItems", "el", "value", "open", "firstItem", "attemptFocus", "anchor", "surface", "newSize", "anchorOptions", "isPageRTL", "xStart", "xEnd", "preferences", "anchorResult", "preference", "canAnchorPopup", "source", "previousFocus", "newState", "previousState", "scrollRestoration", "returnFocus", "main", "len", "entry", "cascader", "activeElement", "MenuItem", "ListOption", "FormAssociatedMixin", "value", "event", "name", "trailingIcon", "cascades", "oldValue", "newValue", "submenuElement", "inline", "html", "checkboxRef", "radioRef", "anchor", "trailing", "checkbox", "radio", "ScrollListenerMixin", "Base", "event", "scroller", "element", "NavItem", "CustomElement", "ThemableMixin", "StateMixin", "RippleMixin", "ShapeMixin", "options", "active", "ariaLabel", "href", "html", "shape", "state", "rippleContainer", "key", "repeat", "args", "Nav_default", "Surface_default", "event", "NavItem", "el", "NavBar_default", "Nav_default", "ScrollListenerMixin", "ELEMENT_STYLER_TYPE", "_translateY", "_transition", "max", "visibility", "resizeObserver", "oldValue", "newValue", "shift", "breakpoint", "NavBarItem_default", "NavItem", "NavRail_default", "Nav_default", "html", "slot", "NavDrawer_default", "NavRail_default", "NavDrawerItem_default", "NavItem", "html", "NavRailItem_default", "NavItem", "Pane_default", "CustomElement", "ThemableMixin", "Progress_default", "CustomElement", "ThemableMixin", "value", "max", "oldValue", "newValue", "Radio_default", "CustomElement", "ThemableMixin", "StateMixin", "RippleMixin", "InputMixin", "TouchTargetMixin", "html", "label", "rippleContainer", "state", "control", "touchTarget", "SegmentedButton_default", "Button_default", "html", "inline", "shape", "icon", "outline", "control", "slot", "state", "type", "checked", "SegmentedButtonGroup_default", "Box_default", "KeyboardNavMixin", "AriaReflectorMixin", "SegmentedButton_default", "child", "index", "list", "_Select", "CustomElement", "ThemableMixin", "StateMixin", "ControlMixin", "TextFieldMixin", "event", "select", "child", "template", "slot", "prefix", "suffix", "control", "Select", "__publicField", "__superGet", "parseFloat", "value", "onNaN", "number", "valueAsFraction", "min", "max", "nValue", "nMin", "nMax", "Slider_default", "CustomElement", "ThemableMixin", "StateMixin", "InputMixin", "event", "input", "offsetX", "clientX", "pageX", "isActive", "isTouch", "touch", "clientWidth", "position", "step", "nStep", "currentValue", "roundedValue", "scale", "thumbOffset", "thumbMin", "thumbMax", "currentTarget", "ticks", "_previewValue", "template", "html", "state", "label", "control", "_isHoveringThumb", "focusedState", "oldValue", "newValue", "Snackbar_default", "Surface_default", "DensityMixin", "AriaReflectorMixin", "EVENT_HANDLER_TYPE", "resolve", "text", "content", "slot", "Shape_default", "Box_default", "ShapeMixin", "shape", "outline", "SwitchIcon_default", "CustomElement", "ThemableMixin", "ShapeMixin", "selected", "value", "disabled", "pressed", "focused", "hovered", "color", "_active", "icon", "src", "unselectedIcon", "unselectedSrc", "outline", "track", "oldValue", "newValue", "Switch_default", "CustomElement", "ThemableMixin", "InputMixin", "StateMixin", "TouchTargetMixin", "html", "state", "label", "control", "touchTarget", "event", "input", "offsetX", "clientX", "pageX", "isActive", "touch", "clientWidth", "position", "currentValue", "pixels", "currentPixels", "newRatio", "newValue", "Tab_default", "CustomElement", "ShapeMixin", "StateMixin", "RippleMixin", "ScrollListenerMixin", "slot", "target", "options", "href", "active", "disabledState", "data", "shape", "rippleContainer", "state", "event", "el", "registeredElements", "rtlObserver", "RTLObserverMixin", "Base", "isRTL", "el", "resizeObserver", "entries", "entry", "ResizeObserverMixin", "Base", "TabList_default", "CustomElement", "ThemableMixin", "KeyboardNavMixin", "ResizeObserverMixin", "RTLObserverMixin", "ShapeMixin", "value", "oldValue", "newValue", "Tab_default", "tab", "index", "el", "width", "position", "animate", "percentage", "metrics", "clamped", "decimalIndex", "leftIndex", "rightIndex", "leftMetrics", "rightMetrics", "activeTab", "center", "leftRatio", "rightRatio", "leftWidth", "rightWidth", "activeIndex", "distance", "tabContent", "start", "max", "shape", "indicator", "target", "TabPanel_default", "Box_default", "AriaReflectorMixin", "oldValue", "newValue", "TabContent_default", "CustomElement", "ResizeObserverMixin", "panel", "index", "value", "el", "start", "width", "end", "metric", "percentage", "event", "slot", "TabPanel_default", "_updatingSlot", "_textarea", "_TextArea", "CustomElement", "ThemableMixin", "StateMixin", "ControlMixin", "TextFieldMixin", "ResizeObserverMixin", "__privateAdd", "currentTarget", "textarea", "previousValue", "child", "newValue", "__privateGet", "lineHeight", "lastClientHeight", "value", "entry", "TextArea", "control", "oldValue", "__publicField", "__superGet", "DOMString", "Title_default", "Headline_default", "ariaLevel", "size", "TopAppBar_default", "CustomElement", "ThemableMixin", "SurfaceMixin", "AriaToolbarMixin", "ScrollListenerMixin", "ResizeObserverMixin", "oldValue", "newValue", "ELEMENT_STYLER_TYPE", "hideOnScroll", "_cssPosition", "_translateY", "_duration", "_easing", "size", "_headlineOpacity", "inline", "surface", "leading", "headline", "trailing", "ariaLabel", "max", "min", "_visibleStart", "value", "resizeObserver", "loader_exports", "theming_exports", "__export", "generateColorCSS", "generateShapeCSS", "generateThemeCSS", "generateTypographyCSS", "generateTypographyGlobalCSS", "setupTheme", "themeOptionsFromSearchParams", "COLOR_KEYWORDS", "signum", "num", "lerp", "start", "stop", "amount", "clampInt", "min", "max", "input", "sanitizeDegreesDouble", "degrees", "rotationDirection", "from", "to", "differenceDegrees", "a", "b", "matrixMultiply", "row", "matrix", "c", "SRGB_TO_XYZ", "XYZ_TO_SRGB", "WHITE_POINT_D65", "argbFromRgb", "red", "green", "blue", "argbFromLinrgb", "linrgb", "r", "delinearized", "g", "b", "redFromArgb", "argb", "greenFromArgb", "blueFromArgb", "argbFromXyz", "x", "y", "z", "matrix", "XYZ_TO_SRGB", "linearR", "linearG", "linearB", "r", "delinearized", "g", "b", "argbFromRgb", "xyzFromArgb", "argb", "linearized", "redFromArgb", "greenFromArgb", "blueFromArgb", "matrixMultiply", "SRGB_TO_XYZ", "argbFromLstar", "lstar", "y", "yFromLstar", "component", "delinearized", "argbFromRgb", "lstarFromArgb", "argb", "xyzFromArgb", "labF", "labInvf", "linearized", "rgbComponent", "normalized", "clampInt", "whitePointD65", "WHITE_POINT_D65", "kappa", "ft", "ft3", "_ViewingConditions", "whitePoint", "whitePointD65", "adaptingLuminance", "yFromLstar", "backgroundLstar", "surround", "discountingIlluminant", "xyz", "rW", "gW", "bW", "f", "c", "lerp", "d", "nc", "rgbD", "k", "k4", "k4F", "fl", "n", "z", "nbb", "ncb", "rgbAFactors", "rgbA", "aw", "fLRoot", "ViewingConditions", "__publicField", "Cam16", "hue", "chroma", "j", "q", "m", "s", "jstar", "astar", "bstar", "other", "dJ", "dA", "dB", "argb", "ViewingConditions", "viewingConditions", "red", "green", "blue", "redL", "linearized", "greenL", "blueL", "x", "y", "z", "rC", "gC", "bC", "rD", "gD", "bD", "rAF", "gAF", "bAF", "rA", "signum", "gA", "bA", "a", "b", "u", "p2", "atanDegrees", "hueRadians", "huePrime", "eHue", "alpha", "c", "mstar", "h", "t", "hRad", "ac", "p1", "hSin", "hCos", "gamma", "rCBase", "gCBase", "bCBase", "rF", "gF", "bF", "argbFromXyz", "SCALED_DISCOUNT_FROM_LINRGB", "LINRGB_FROM_SCALED_DISCOUNT", "Y_FROM_LINRGB", "CRITICAL_PLANES", "sanitizeRadians", "angle", "trueDelinearized", "rgbComponent", "normalized", "delinearized", "chromaticAdaptation", "component", "af", "signum", "hueOf", "linrgb", "scaledDiscount", "matrixMultiply", "rA", "gA", "bA", "a", "b", "areInCyclicOrder", "c", "deltaAB", "deltaAC", "intercept", "source", "mid", "target", "lerpPoint", "t", "setCoordinate", "coordinate", "axis", "isBounded", "x", "nthVertex", "y", "n", "kR", "kG", "kB", "coordA", "coordB", "g", "r", "bisectToSegment", "targetHue", "left", "right", "leftHue", "rightHue", "initialized", "uncut", "midHue", "midpoint", "criticalPlaneBelow", "criticalPlaneAbove", "bisectToLimit", "segment", "lPlane", "rPlane", "i", "mPlane", "midPlaneCoordinate", "inverseChromaticAdaptation", "adapted", "adaptedAbs", "base", "findResultByJ", "hueRadians", "chroma", "j", "viewingConditions", "ViewingConditions", "tInnerCoeff", "p1", "hSin", "hCos", "iterationRound", "jNormalized", "p2", "gamma", "rCScaled", "gCScaled", "bCScaled", "fnj", "argbFromLinrgb", "solveToInt", "hueDegrees", "lstar", "argbFromLstar", "sanitizeDegreesDouble", "yFromLstar", "exactAnswer", "Hct", "hue", "chroma", "tone", "solveToInt", "argb", "newHue", "newChroma", "newTone", "cam", "Cam16", "lstarFromArgb", "TonalPalette", "#cache", "argb", "hct", "Hct", "hue", "chroma", "tone", "CorePalette", "argb", "isContent", "hct", "Hct", "hue", "chroma", "TonalPalette", "_lightFromCorePalette", "lightFromCorePalette_fn", "_darkFromCorePalette", "darkFromCorePalette_fn", "_Scheme", "primary", "onPrimary", "primaryContainer", "onPrimaryContainer", "secondary", "onSecondary", "secondaryContainer", "onSecondaryContainer", "tertiary", "onTertiary", "tertiaryContainer", "onTertiaryContainer", "error", "onError", "errorContainer", "onErrorContainer", "background", "onBackground", "surface", "onSurface", "surfaceVariant", "onSurfaceVariant", "outline", "outlineVariant", "shadow", "scrim", "inverseSurface", "inverseOnSurface", "inversePrimary", "argb", "_a", "__privateMethod", "CorePalette", "object", "scheme", "Scheme", "core", "__privateAdd", "harmonize", "designColor", "sourceColor", "fromHct", "Hct", "toHct", "differenceDegrees", "rotationDegrees", "outputHue", "sanitizeDegreesDouble", "rotationDirection", "parseIntHex", "value", "argbFromHex", "hex", "isThree", "isSix", "isEight", "r", "g", "b", "cssVarFromArgb", "argb", "redFromArgb", "greenFromArgb", "blueFromArgb", "cssVariablesFromScheme", "scheme", "cssVariablesFromCustom", "name", "tonalPalette", "isDark", "getScheme", "mainColor", "customColors", "argbColor", "argbFromHex", "lightRules", "Scheme", "darkRules", "lightContentRules", "darkContentRules", "color", "argbCustom", "blended", "harmonize", "tp", "CorePalette", "ctp", "svgToCSSURL", "svg", "getShapeMaskSVG", "shape", "getShapeCornerSVGs", "corner", "convex", "path", "getShapeEdgesSVGs", "CIRCLE_PATH", "DIAMOND_PATH", "SQUIRCLE_PATH", "SHAPE_ROUNDED_DEFAULT", "CIRCLE_PATH", "SHAPE_CUT_DEFAULT", "DIAMOND_PATH", "SHAPE_SQUIRCLE_DEFAULT", "SQUIRCLE_PATH", "SP", "TYPOGRAPHY_DEFAULT", "generateTypographyCSS", "config", "generateTypographyGlobalCSS", "style", "size", "generateShapeCSS", "svgToCSSURL", "getShapeMaskSVG", "getShapeCornerSVGs", "getShapeEdgesSVGs", "addStyle", "content", "element", "generateColorCSS", "color", "custom", "lightness", "parsedColors", "name", "hex", "COLOR_KEYWORDS", "scheme", "getScheme", "setupTheme", "themeOptionsFromSearchParams", "searchParams", "c", "generateThemeCSS", "shapeCss", "typographyCss", "colorCss", "rules", "generateThemeCSS", "themeOptionsFromSearchParams", "generateTypographyGlobalCSS", "parsed", "css"]
7
7
  }