{"version":3,"file":"primer_view_components.js","sources":["../../../node_modules/@github/include-fragment-element/dist/include-fragment-element.js","../../../node_modules/@github/include-fragment-element/dist/include-fragment-element-define.js","../../../node_modules/@github/remote-input-element/dist/index.js","../../../node_modules/tslib/tslib.es6.js","../../../node_modules/@github/catalyst/lib/bind.js","../../../node_modules/@github/catalyst/lib/dasherize.js","../../../node_modules/@github/catalyst/lib/attr.js","../../../node_modules/@github/catalyst/lib/core.js","../../../node_modules/@github/catalyst/lib/register.js","../../../node_modules/@github/catalyst/lib/auto-shadow-root.js","../../../node_modules/@github/catalyst/lib/target.js","../../../node_modules/@github/catalyst/lib/findtarget.js","../../../node_modules/@github/catalyst/lib/controller.js","../../../node_modules/@github/catalyst/lib/lazy-define.js","../../components/primer/alpha/action_list.ts","../../../node_modules/@primer/behaviors/dist/esm/anchored-position.mjs","../../../node_modules/@primer/behaviors/dist/esm/utils/iterate-focusable-elements.mjs","../../../node_modules/@primer/behaviors/dist/esm/polyfills/event-listener-signal.mjs","../../../node_modules/@primer/behaviors/dist/esm/focus-trap.mjs","../../../node_modules/@primer/behaviors/dist/esm/utils/user-agent.mjs","../../../node_modules/@primer/behaviors/dist/esm/utils/unique-id.mjs","../../../node_modules/@primer/behaviors/dist/esm/focus-zone.mjs","../../components/primer/alpha/action_bar_element.ts","../../../node_modules/@github/details-menu-element/dist/index.js","../../components/primer/anchored_position.ts","../../components/primer/dialog_helper.ts","../../../node_modules/@oddbird/popover-polyfill/dist/popover.js","../../components/primer/focus_group.ts","../../components/primer/scrollable_region.ts","../../components/primer/alpha/modal_dialog.ts","../../components/primer/beta/nav_list.ts","../../components/primer/beta/nav_list_group_element.ts","../../components/primer/alpha/segmented_control.ts","../../components/primer/alpha/toggle_switch.ts","../../components/primer/alpha/tool_tip.ts","../../components/primer/alpha/x_banner.ts","../../../node_modules/@github/combobox-nav/dist/index.js","../../../node_modules/@github/auto-complete-element/dist/autocomplete.js","../../../node_modules/@github/auto-complete-element/dist/debounce.js","../../../node_modules/@github/auto-complete-element/dist/auto-complete-element.js","../../../node_modules/@github/auto-complete-element/dist/auto-complete-element-define.js","../../../node_modules/@github/clipboard-copy-element/dist/clipboard.js","../../../node_modules/@github/clipboard-copy-element/dist/clipboard-copy-element.js","../../../node_modules/@github/clipboard-copy-element/dist/clipboard-copy-element-define.js","../../components/primer/beta/clipboard_copy.ts","../../../node_modules/@github/relative-time-element/dist/duration-format-ponyfill.js","../../../node_modules/@github/relative-time-element/dist/duration.js","../../../node_modules/@github/relative-time-element/dist/relative-time-element.js","../../../node_modules/@github/relative-time-element/dist/relative-time-element-define.js","../../../node_modules/@github/tab-container-element/dist/tab-container-element.js","../../../node_modules/@github/tab-container-element/dist/tab-container-element-define.js","../../lib/primer/forms/primer_multi_input.ts","../../../node_modules/@github/mini-throttle/dist/index.js","../../../node_modules/@github/auto-check-element/dist/auto-check-element.js","../../../node_modules/@github/auto-check-element/dist/auto-check-element-define.js","../../lib/primer/forms/primer_text_field.ts","../../lib/primer/forms/toggle_switch_input.ts","../../components/primer/alpha/action_menu/action_menu_element.ts","../../../node_modules/@primer/live-region-element/dist/esm/index.js","../../components/primer/alpha/select_panel_element.ts","../../components/primer/open_project/page_header_element.ts","../../components/primer/open_project/zen_mode_button.ts","../../components/primer/open_project/sub_header_element.ts"],"sourcesContent":["var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _IncludeFragmentElement_instances, _IncludeFragmentElement_busy, _IncludeFragmentElement_observer, _IncludeFragmentElement_handleData, _IncludeFragmentElement_getData, _IncludeFragmentElement_getStringOrErrorData, _IncludeFragmentElement_task, _IncludeFragmentElement_fetchDataWithEvents;\nconst privateData = new WeakMap();\nfunction isWildcard(accept) {\n return accept && !!accept.split(',').find(x => x.match(/^\\s*\\*\\/\\*/));\n}\nlet cspTrustedTypesPolicyPromise = null;\nexport class IncludeFragmentElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _IncludeFragmentElement_instances.add(this);\n _IncludeFragmentElement_busy.set(this, false);\n _IncludeFragmentElement_observer.set(this, new IntersectionObserver(entries => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n const { target } = entry;\n __classPrivateFieldGet(this, _IncludeFragmentElement_observer, \"f\").unobserve(target);\n if (!(target instanceof IncludeFragmentElement))\n return;\n if (target.loading === 'lazy') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n }\n }\n }, {\n rootMargin: '0px 0px 256px 0px',\n threshold: 0.01,\n }));\n }\n static define(tag = 'include-fragment', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n static setCSPTrustedTypesPolicy(policy) {\n cspTrustedTypesPolicyPromise = policy === null ? policy : Promise.resolve(policy);\n }\n static get observedAttributes() {\n return ['src', 'loading'];\n }\n get src() {\n const src = this.getAttribute('src');\n if (src) {\n const link = this.ownerDocument.createElement('a');\n link.href = src;\n return link.href;\n }\n else {\n return '';\n }\n }\n set src(val) {\n this.setAttribute('src', val);\n }\n get loading() {\n if (this.getAttribute('loading') === 'lazy')\n return 'lazy';\n return 'eager';\n }\n set loading(value) {\n this.setAttribute('loading', value);\n }\n get accept() {\n return this.getAttribute('accept') || '';\n }\n set accept(val) {\n this.setAttribute('accept', val);\n }\n get data() {\n return __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_getStringOrErrorData).call(this);\n }\n attributeChangedCallback(attribute, oldVal) {\n if (attribute === 'src') {\n if (this.isConnected && this.loading === 'eager') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n }\n else if (attribute === 'loading') {\n if (this.isConnected && oldVal !== 'eager' && this.loading === 'eager') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n }\n }\n connectedCallback() {\n if (!this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n const style = document.createElement('style');\n style.textContent = `:host {display: block;}`;\n this.shadowRoot.append(style, document.createElement('slot'));\n }\n if (this.src && this.loading === 'eager') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n if (this.loading === 'lazy') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_observer, \"f\").observe(this);\n }\n }\n request() {\n const src = this.src;\n if (!src) {\n throw new Error('missing src');\n }\n return new Request(src, {\n method: 'GET',\n credentials: 'same-origin',\n headers: {\n Accept: this.accept || 'text/html',\n },\n });\n }\n load() {\n return __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_getStringOrErrorData).call(this);\n }\n fetch(request) {\n return fetch(request);\n }\n refetch() {\n privateData.delete(this);\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n}\n_IncludeFragmentElement_busy = new WeakMap(), _IncludeFragmentElement_observer = new WeakMap(), _IncludeFragmentElement_instances = new WeakSet(), _IncludeFragmentElement_handleData = async function _IncludeFragmentElement_handleData() {\n if (__classPrivateFieldGet(this, _IncludeFragmentElement_busy, \"f\"))\n return;\n __classPrivateFieldSet(this, _IncludeFragmentElement_busy, true, \"f\");\n __classPrivateFieldGet(this, _IncludeFragmentElement_observer, \"f\").unobserve(this);\n try {\n const data = await __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_getData).call(this);\n if (data instanceof Error) {\n throw data;\n }\n const dataTreatedAsString = data;\n const template = document.createElement('template');\n template.innerHTML = dataTreatedAsString;\n const fragment = document.importNode(template.content, true);\n const canceled = !this.dispatchEvent(new CustomEvent('include-fragment-replace', {\n cancelable: true,\n detail: { fragment },\n }));\n if (canceled) {\n __classPrivateFieldSet(this, _IncludeFragmentElement_busy, false, \"f\");\n return;\n }\n this.replaceWith(fragment);\n this.dispatchEvent(new CustomEvent('include-fragment-replaced'));\n }\n catch (_a) {\n this.classList.add('is-error');\n }\n finally {\n __classPrivateFieldSet(this, _IncludeFragmentElement_busy, false, \"f\");\n }\n}, _IncludeFragmentElement_getData = async function _IncludeFragmentElement_getData() {\n const src = this.src;\n const cachedData = privateData.get(this);\n if (cachedData && cachedData.src === src) {\n return cachedData.data;\n }\n else {\n let data;\n if (src) {\n data = __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_fetchDataWithEvents).call(this);\n }\n else {\n data = Promise.reject(new Error('missing src'));\n }\n privateData.set(this, { src, data });\n return data;\n }\n}, _IncludeFragmentElement_getStringOrErrorData = async function _IncludeFragmentElement_getStringOrErrorData() {\n const data = await __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_getData).call(this);\n if (data instanceof Error) {\n throw data;\n }\n return data.toString();\n}, _IncludeFragmentElement_task = async function _IncludeFragmentElement_task(eventsToDispatch) {\n await new Promise(resolve => setTimeout(resolve, 0));\n for (const eventType of eventsToDispatch) {\n this.dispatchEvent(new Event(eventType));\n }\n}, _IncludeFragmentElement_fetchDataWithEvents = async function _IncludeFragmentElement_fetchDataWithEvents() {\n try {\n await __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_task).call(this, ['loadstart']);\n const response = await this.fetch(this.request());\n if (response.status !== 200) {\n throw new Error(`Failed to load resource: the server responded with a status of ${response.status}`);\n }\n const ct = response.headers.get('Content-Type');\n if (!isWildcard(this.accept) && (!ct || !ct.includes(this.accept ? this.accept : 'text/html'))) {\n throw new Error(`Failed to load resource: expected ${this.accept || 'text/html'} but was ${ct}`);\n }\n const responseText = await response.text();\n let data = responseText;\n if (cspTrustedTypesPolicyPromise) {\n const cspTrustedTypesPolicy = await cspTrustedTypesPolicyPromise;\n data = cspTrustedTypesPolicy.createHTML(responseText, response);\n }\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_task).call(this, ['load', 'loadend']);\n return data;\n }\n catch (error) {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_task).call(this, ['error', 'loadend']);\n throw error;\n }\n};\n","import { IncludeFragmentElement } from './include-fragment-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.IncludeFragmentElement = IncludeFragmentElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default IncludeFragmentElement;\nexport * from './include-fragment-element.js';\n","const states = new WeakMap();\nclass RemoteInputElement extends HTMLElement {\n constructor() {\n super();\n const fetch = fetchResults.bind(null, this, true);\n const state = { currentQuery: null, oninput: debounce((e) => fetch(e)), fetch, controller: null };\n states.set(this, state);\n }\n static get observedAttributes() {\n return ['src'];\n }\n attributeChangedCallback(name, oldValue) {\n if (oldValue && name === 'src') {\n fetchResults(this, false);\n }\n }\n connectedCallback() {\n const input = this.input;\n if (!input)\n return;\n input.setAttribute('autocomplete', 'off');\n input.setAttribute('spellcheck', 'false');\n const state = states.get(this);\n if (!state)\n return;\n input.addEventListener('focus', state.fetch);\n input.addEventListener('change', state.fetch);\n input.addEventListener('input', state.oninput);\n }\n disconnectedCallback() {\n const input = this.input;\n if (!input)\n return;\n const state = states.get(this);\n if (!state)\n return;\n input.removeEventListener('focus', state.fetch);\n input.removeEventListener('change', state.fetch);\n input.removeEventListener('input', state.oninput);\n }\n get input() {\n const input = this.querySelector('input, textarea');\n return input instanceof HTMLInputElement || input instanceof HTMLTextAreaElement ? input : null;\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(url) {\n this.setAttribute('src', url);\n }\n}\nfunction makeAbortController() {\n if ('AbortController' in window) {\n return new AbortController();\n }\n return { signal: null, abort() { } };\n}\nasync function fetchResults(remoteInput, checkCurrentQuery, event) {\n const input = remoteInput.input;\n if (!input)\n return;\n const state = states.get(remoteInput);\n if (!state)\n return;\n const query = input.value;\n if (checkCurrentQuery && state.currentQuery === query)\n return;\n state.currentQuery = query;\n const src = remoteInput.src;\n if (!src)\n return;\n const resultsContainer = document.getElementById(remoteInput.getAttribute('aria-owns') || '');\n if (!resultsContainer)\n return;\n const url = new URL(src, window.location.href);\n const params = new URLSearchParams(url.search);\n params.append(remoteInput.getAttribute('param') || 'q', query);\n url.search = params.toString();\n if (state.controller) {\n state.controller.abort();\n }\n else {\n remoteInput.dispatchEvent(new CustomEvent('loadstart'));\n remoteInput.setAttribute('loading', '');\n }\n state.controller = makeAbortController();\n let response;\n let html = '';\n try {\n response = await fetchWithNetworkEvents(remoteInput, url.toString(), {\n signal: state.controller.signal,\n credentials: 'same-origin',\n headers: { accept: 'text/fragment+html' }\n });\n html = await response.text();\n remoteInput.removeAttribute('loading');\n state.controller = null;\n }\n catch (error) {\n if (error instanceof Error && error.name !== 'AbortError') {\n remoteInput.removeAttribute('loading');\n state.controller = null;\n }\n return;\n }\n if (response && response.ok) {\n resultsContainer.innerHTML = html;\n remoteInput.dispatchEvent(new CustomEvent('remote-input-success', { bubbles: true, detail: { \"eventType\": event ? event.type : undefined } }));\n }\n else {\n remoteInput.dispatchEvent(new CustomEvent('remote-input-error', { bubbles: true }));\n }\n}\nasync function fetchWithNetworkEvents(el, url, options) {\n try {\n const response = await fetch(url, options);\n el.dispatchEvent(new CustomEvent('load'));\n el.dispatchEvent(new CustomEvent('loadend'));\n return response;\n }\n catch (error) {\n if (error instanceof Error && (error === null || error === void 0 ? void 0 : error.name) !== 'AbortError') {\n el.dispatchEvent(new CustomEvent('error'));\n el.dispatchEvent(new CustomEvent('loadend'));\n }\n throw error;\n }\n}\nfunction debounce(callback) {\n let timeout;\n return function (args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n clearTimeout(timeout);\n callback(args);\n }, 300);\n };\n}\nexport default RemoteInputElement;\nif (!window.customElements.get('remote-input')) {\n window.RemoteInputElement = RemoteInputElement;\n window.customElements.define('remote-input', RemoteInputElement);\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","const controllers = new WeakSet();\n/*\n * Bind `[data-action]` elements from the DOM to their actions.\n *\n */\nexport function bind(controller) {\n controllers.add(controller);\n if (controller.shadowRoot)\n bindShadow(controller.shadowRoot);\n bindElements(controller);\n listenForBind(controller.ownerDocument);\n}\nexport function bindShadow(root) {\n bindElements(root);\n listenForBind(root);\n}\nconst observers = new WeakMap();\n/**\n * Set up observer that will make sure any actions that are dynamically\n * injected into `el` will be bound to it's controller.\n *\n * This returns a Subscription object which you can call `unsubscribe()` on to\n * stop further live updates.\n */\nexport function listenForBind(el = document) {\n if (observers.has(el))\n return observers.get(el);\n let closed = false;\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.type === 'attributes' && mutation.target instanceof Element) {\n bindActions(mutation.target);\n }\n else if (mutation.type === 'childList' && mutation.addedNodes.length) {\n for (const node of mutation.addedNodes) {\n if (node instanceof Element) {\n bindElements(node);\n }\n }\n }\n }\n });\n observer.observe(el, { childList: true, subtree: true, attributeFilter: ['data-action'] });\n const subscription = {\n get closed() {\n return closed;\n },\n unsubscribe() {\n closed = true;\n observers.delete(el);\n observer.disconnect();\n }\n };\n observers.set(el, subscription);\n return subscription;\n}\nfunction bindElements(root) {\n for (const el of root.querySelectorAll('[data-action]')) {\n bindActions(el);\n }\n // Also bind the controller to itself\n if (root instanceof Element && root.hasAttribute('data-action')) {\n bindActions(root);\n }\n}\n// Bind a single function to all events to avoid anonymous closure performance penalty.\nfunction handleEvent(event) {\n const el = event.currentTarget;\n for (const binding of bindings(el)) {\n if (event.type === binding.type) {\n const controller = el.closest(binding.tag);\n if (controllers.has(controller) && typeof controller[binding.method] === 'function') {\n controller[binding.method](event);\n }\n const root = el.getRootNode();\n if (root instanceof ShadowRoot && controllers.has(root.host) && root.host.matches(binding.tag)) {\n const shadowController = root.host;\n if (typeof shadowController[binding.method] === 'function') {\n shadowController[binding.method](event);\n }\n }\n }\n }\n}\nfunction* bindings(el) {\n for (const action of (el.getAttribute('data-action') || '').trim().split(/\\s+/)) {\n const eventSep = action.lastIndexOf(':');\n const methodSep = Math.max(0, action.lastIndexOf('#')) || action.length;\n yield {\n type: action.slice(0, eventSep),\n tag: action.slice(eventSep + 1, methodSep),\n method: action.slice(methodSep + 1) || 'handleEvent'\n } || 'handleEvent';\n }\n}\nfunction bindActions(el) {\n for (const binding of bindings(el)) {\n el.addEventListener(binding.type, handleEvent);\n }\n}\n//# sourceMappingURL=bind.js.map","export const dasherize = (str) => String(typeof str === 'symbol' ? str.description : str)\n .replace(/([A-Z]($|[a-z]))/g, '-$1')\n .replace(/--/g, '-')\n .replace(/^-|-$/, '')\n .toLowerCase();\nexport const mustDasherize = (str, type = 'property') => {\n const dashed = dasherize(str);\n if (!dashed.includes('-')) {\n throw new DOMException(`${type}: ${String(str)} is not a valid ${type} name`, 'SyntaxError');\n }\n return dashed;\n};\n//# sourceMappingURL=dasherize.js.map","import { mustDasherize } from './dasherize.js';\nimport { meta } from './core.js';\nconst attrKey = 'attr';\n/**\n * Attr is a decorator which tags a property as one to be initialized via\n * `initializeAttrs`.\n *\n * The signature is typed such that the property must be one of a String,\n * Number or Boolean. This matches the behavior of `initializeAttrs`.\n */\nexport function attr(proto, key) {\n meta(proto, attrKey).add(key);\n}\n/**\n * initializeAttrs is called with a set of class property names (if omitted, it\n * will look for any properties tagged with the `@attr` decorator). With this\n * list it defines property descriptors for each property that map to `data-*`\n * attributes on the HTMLElement instance.\n *\n * It works around Native Class Property semantics - which are equivalent to\n * calling `Object.defineProperty` on the instance upon creation, but before\n * `constructor()` is called.\n *\n * If a class property is assigned to the class body, it will infer the type\n * (using `typeof`) and define an appropriate getter/setter combo that aligns\n * to that type. This means class properties assigned to Numbers can only ever\n * be Numbers, assigned to Booleans can only ever be Booleans, and assigned to\n * Strings can only ever be Strings.\n *\n * This is automatically called as part of `@controller`. If a class uses the\n * `@controller` decorator it should not call this manually.\n */\nconst initialized = new WeakSet();\nexport function initializeAttrs(instance, names) {\n if (initialized.has(instance))\n return;\n initialized.add(instance);\n const proto = Object.getPrototypeOf(instance);\n const prefix = proto?.constructor?.attrPrefix ?? 'data-';\n if (!names)\n names = meta(proto, attrKey);\n for (const key of names) {\n const value = instance[key];\n const name = mustDasherize(`${prefix}${key}`);\n let descriptor = {\n configurable: true,\n get() {\n return this.getAttribute(name) || '';\n },\n set(newValue) {\n this.setAttribute(name, newValue || '');\n }\n };\n if (typeof value === 'number') {\n descriptor = {\n configurable: true,\n get() {\n return Number(this.getAttribute(name) || 0);\n },\n set(newValue) {\n this.setAttribute(name, newValue);\n }\n };\n }\n else if (typeof value === 'boolean') {\n descriptor = {\n configurable: true,\n get() {\n return this.hasAttribute(name);\n },\n set(newValue) {\n this.toggleAttribute(name, newValue);\n }\n };\n }\n Object.defineProperty(instance, key, descriptor);\n if (key in instance && !instance.hasAttribute(name)) {\n descriptor.set.call(instance, value);\n }\n }\n}\nexport function defineObservedAttributes(classObject) {\n let observed = classObject.observedAttributes || [];\n const prefix = classObject.attrPrefix ?? 'data-';\n const attrToAttributeName = (name) => mustDasherize(`${prefix}${name}`);\n Object.defineProperty(classObject, 'observedAttributes', {\n configurable: true,\n get() {\n return [...meta(classObject.prototype, attrKey)].map(attrToAttributeName).concat(observed);\n },\n set(attributes) {\n observed = attributes;\n }\n });\n}\n//# sourceMappingURL=attr.js.map","import { register } from './register.js';\nimport { bind, bindShadow } from './bind.js';\nimport { autoShadowRoot } from './auto-shadow-root.js';\nimport { defineObservedAttributes, initializeAttrs } from './attr.js';\nconst symbol = Symbol.for('catalyst');\nexport class CatalystDelegate {\n constructor(classObject) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const delegate = this;\n const connectedCallback = classObject.prototype.connectedCallback;\n classObject.prototype.connectedCallback = function () {\n delegate.connectedCallback(this, connectedCallback);\n };\n const disconnectedCallback = classObject.prototype.disconnectedCallback;\n classObject.prototype.disconnectedCallback = function () {\n delegate.disconnectedCallback(this, disconnectedCallback);\n };\n const attributeChangedCallback = classObject.prototype.attributeChangedCallback;\n classObject.prototype.attributeChangedCallback = function (name, oldValue, newValue) {\n delegate.attributeChangedCallback(this, name, oldValue, newValue, attributeChangedCallback);\n };\n let observedAttributes = classObject.observedAttributes || [];\n Object.defineProperty(classObject, 'observedAttributes', {\n configurable: true,\n get() {\n return delegate.observedAttributes(this, observedAttributes);\n },\n set(attributes) {\n observedAttributes = attributes;\n }\n });\n defineObservedAttributes(classObject);\n register(classObject);\n }\n observedAttributes(instance, observedAttributes) {\n return observedAttributes;\n }\n connectedCallback(instance, connectedCallback) {\n instance.toggleAttribute('data-catalyst', true);\n customElements.upgrade(instance);\n autoShadowRoot(instance);\n initializeAttrs(instance);\n bind(instance);\n connectedCallback?.call(instance);\n if (instance.shadowRoot)\n bindShadow(instance.shadowRoot);\n }\n disconnectedCallback(element, disconnectedCallback) {\n disconnectedCallback?.call(element);\n }\n attributeChangedCallback(instance, name, oldValue, newValue, attributeChangedCallback) {\n initializeAttrs(instance);\n if (name !== 'data-catalyst' && attributeChangedCallback) {\n attributeChangedCallback.call(instance, name, oldValue, newValue);\n }\n }\n}\nexport function meta(proto, name) {\n if (!Object.prototype.hasOwnProperty.call(proto, symbol)) {\n const parent = proto[symbol];\n const map = (proto[symbol] = new Map());\n if (parent) {\n for (const [key, value] of parent) {\n map.set(key, new Set(value));\n }\n }\n }\n const map = proto[symbol];\n if (!map.has(name))\n map.set(name, new Set());\n return map.get(name);\n}\n//# sourceMappingURL=core.js.map","import { dasherize } from './dasherize.js';\n/**\n * Register the controller as a custom element.\n *\n * The classname is converted to a approriate tag name.\n *\n * Example: HelloController => hello-controller\n */\nexport function register(classObject) {\n const name = dasherize(classObject.name).replace(/-element$/, '');\n try {\n window.customElements.define(name, classObject);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n window[classObject.name] = customElements.get(name);\n }\n catch (e) {\n // The only reason for window.customElements.define to throw a `NotSupportedError`\n // is if the element has already been defined.\n if (!(e instanceof DOMException && e.name === 'NotSupportedError'))\n throw e;\n }\n return classObject;\n}\n//# sourceMappingURL=register.js.map","export function autoShadowRoot(element) {\n for (const template of element.querySelectorAll('template[data-shadowroot]')) {\n if (template.parentElement === element) {\n element\n .attachShadow({\n mode: template.getAttribute('data-shadowroot') === 'closed' ? 'closed' : 'open'\n })\n .append(template.content.cloneNode(true));\n }\n }\n}\n//# sourceMappingURL=auto-shadow-root.js.map","import { findTarget, findTargets } from './findtarget.js';\nimport { meta } from './core.js';\n/**\n * Target is a decorator which - when assigned to a property field on the\n * class - will override that class field, turning it into a Getter which\n * returns a call to `findTarget(this, key)` where `key` is the name of the\n * property field. In other words, `@target foo` becomes a getter for\n * `findTarget(this, 'foo')`.\n */\nexport function target(proto, key) {\n meta(proto, 'target').add(key);\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n return findTarget(this, key);\n }\n });\n}\n/**\n * Targets is a decorator which - when assigned to a property field on the\n * class - will override that class field, turning it into a Getter which\n * returns a call to `findTargets(this, key)` where `key` is the name of the\n * property field. In other words, `@targets foo` becomes a getter for\n * `findTargets(this, 'foo')`.\n */\nexport function targets(proto, key) {\n meta(proto, 'targets').add(key);\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n return findTargets(this, key);\n }\n });\n}\n//# sourceMappingURL=target.js.map","/**\n * findTarget will run `querySelectorAll` against the given controller, plus\n * its shadowRoot, returning any the first child that:\n *\n * - Matches the selector of `[data-target~=\"tag.name\"]` where tag is the\n * tagName of the given HTMLElement, and `name` is the given `name` argument.\n *\n * - Closest ascendant of the element, that matches the tagname of the\n * controller, is the specific instance of the controller itself - in other\n * words it is not nested in other controllers of the same type.\n *\n */\nexport function findTarget(controller, name) {\n const tag = controller.tagName.toLowerCase();\n if (controller.shadowRoot) {\n for (const el of controller.shadowRoot.querySelectorAll(`[data-target~=\"${tag}.${name}\"]`)) {\n if (!el.closest(tag))\n return el;\n }\n }\n for (const el of controller.querySelectorAll(`[data-target~=\"${tag}.${name}\"]`)) {\n if (el.closest(tag) === controller)\n return el;\n }\n}\nexport function findTargets(controller, name) {\n const tag = controller.tagName.toLowerCase();\n const targets = [];\n if (controller.shadowRoot) {\n for (const el of controller.shadowRoot.querySelectorAll(`[data-targets~=\"${tag}.${name}\"]`)) {\n if (!el.closest(tag))\n targets.push(el);\n }\n }\n for (const el of controller.querySelectorAll(`[data-targets~=\"${tag}.${name}\"]`)) {\n if (el.closest(tag) === controller)\n targets.push(el);\n }\n return targets;\n}\n//# sourceMappingURL=findtarget.js.map","import { CatalystDelegate } from './core.js';\n/**\n * Controller is a decorator to be used over a class that extends HTMLElement.\n * It will automatically `register()` the component in the customElement\n * registry, as well as ensuring `bind(this)` is called on `connectedCallback`,\n * wrapping the classes `connectedCallback` method if needed.\n */\nexport function controller(classObject) {\n new CatalystDelegate(classObject);\n}\n//# sourceMappingURL=controller.js.map","const dynamicElements = new Map();\nconst ready = new Promise(resolve => {\n if (document.readyState !== 'loading') {\n resolve();\n }\n else {\n document.addEventListener('readystatechange', () => resolve(), { once: true });\n }\n});\nconst firstInteraction = new Promise(resolve => {\n const controller = new AbortController();\n controller.signal.addEventListener('abort', () => resolve());\n const listenerOptions = { once: true, passive: true, signal: controller.signal };\n const handler = () => controller.abort();\n document.addEventListener('mousedown', handler, listenerOptions);\n // eslint-disable-next-line github/require-passive-events\n document.addEventListener('touchstart', handler, listenerOptions);\n document.addEventListener('keydown', handler, listenerOptions);\n document.addEventListener('pointerdown', handler, listenerOptions);\n});\nconst visible = (tagName) => new Promise(resolve => {\n const observer = new IntersectionObserver(entries => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n resolve();\n observer.disconnect();\n return;\n }\n }\n }, {\n // Currently the threshold is set to 256px from the bottom of the viewport\n // with a threshold of 0.1. This means the element will not load until about\n // 2 keyboard-down-arrow presses away from being visible in the viewport,\n // giving us some time to fetch it before the contents are made visible\n rootMargin: '0px 0px 256px 0px',\n threshold: 0.01\n });\n for (const el of document.querySelectorAll(tagName)) {\n observer.observe(el);\n }\n});\nconst strategies = {\n ready: () => ready,\n firstInteraction: () => firstInteraction,\n visible\n};\nconst timers = new WeakMap();\nfunction scan(node) {\n cancelAnimationFrame(timers.get(node) || 0);\n timers.set(node, requestAnimationFrame(() => {\n for (const tagName of dynamicElements.keys()) {\n const child = node.matches(tagName) ? node : node.querySelector(tagName);\n if (customElements.get(tagName) || child) {\n const strategyName = (child?.getAttribute('data-load-on') || 'ready');\n const strategy = strategyName in strategies ? strategies[strategyName] : strategies.ready;\n // eslint-disable-next-line github/no-then\n for (const cb of dynamicElements.get(tagName) || [])\n strategy(tagName).then(cb);\n dynamicElements.delete(tagName);\n timers.delete(node);\n }\n }\n }));\n}\nlet elementLoader;\nexport function lazyDefine(tagName, callback) {\n if (!dynamicElements.has(tagName))\n dynamicElements.set(tagName, new Set());\n dynamicElements.get(tagName).add(callback);\n scan(document.body);\n if (!elementLoader) {\n elementLoader = new MutationObserver(mutations => {\n if (!dynamicElements.size)\n return;\n for (const mutation of mutations) {\n for (const node of mutation.addedNodes) {\n if (node instanceof Element)\n scan(node);\n }\n }\n });\n elementLoader.observe(document, { subtree: true, childList: true });\n }\n}\n//# sourceMappingURL=lazy-define.js.map","import {controller} from '@github/catalyst'\n\n// eslint-disable-next-line custom-elements/no-exports-with-element\nexport class ActionListTruncationObserver {\n resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const action = entry.target\n\n if (action instanceof HTMLElement) {\n this.update(action)\n }\n }\n })\n\n constructor(el: HTMLElement) {\n this.resizeObserver.observe(el)\n }\n\n unobserve(el: HTMLElement) {\n this.resizeObserver.unobserve(el)\n }\n\n update(el: HTMLElement) {\n const items = el.querySelectorAll('li')\n\n for (const item of items) {\n const label = item.querySelector('.ActionListItem-label') as HTMLElement\n if (!label) continue\n const tooltip = item.querySelector('.ActionListItem-truncationTooltip') as HTMLElement\n if (!tooltip) continue\n\n const isTruncated = label.scrollWidth > label.clientWidth\n\n if (isTruncated) {\n tooltip.style.display = ''\n } else {\n tooltip.style.display = 'none'\n }\n }\n }\n}\n\n@controller\n// eslint-disable-next-line custom-elements/expose-class-on-global\nexport class ActionListElement extends HTMLElement {\n #truncationObserver: ActionListTruncationObserver\n\n connectedCallback() {\n this.#truncationObserver = new ActionListTruncationObserver(this)\n }\n\n disconnectedCallback() {\n this.#truncationObserver.unobserve(this)\n }\n}\n\ndeclare global {\n interface Window {\n ActionListElement: typeof ActionListElement\n }\n}\n","const alternateOrders = {\n 'outside-top': ['outside-bottom', 'outside-right', 'outside-left', 'outside-bottom'],\n 'outside-bottom': ['outside-top', 'outside-right', 'outside-left', 'outside-bottom'],\n 'outside-left': ['outside-right', 'outside-bottom', 'outside-top', 'outside-bottom'],\n 'outside-right': ['outside-left', 'outside-bottom', 'outside-top', 'outside-bottom'],\n};\nconst alternateAlignments = {\n start: ['end', 'center'],\n end: ['start', 'center'],\n center: ['end', 'start'],\n};\nfunction getAnchoredPosition(floatingElement, anchorElement, settings = {}) {\n const parentElement = getPositionedParent(floatingElement);\n const clippingRect = getClippingRect(parentElement);\n const parentElementStyle = getComputedStyle(parentElement);\n const parentElementRect = parentElement.getBoundingClientRect();\n const [borderTop, borderLeft] = [parentElementStyle.borderTopWidth, parentElementStyle.borderLeftWidth].map(v => parseInt(v, 10) || 0);\n const relativeRect = {\n top: parentElementRect.top + borderTop,\n left: parentElementRect.left + borderLeft,\n };\n return pureCalculateAnchoredPosition(clippingRect, relativeRect, floatingElement.getBoundingClientRect(), anchorElement instanceof Element ? anchorElement.getBoundingClientRect() : anchorElement, getDefaultSettings(settings));\n}\nfunction getPositionedParent(element) {\n if (isOnTopLayer(element))\n return document.body;\n let parentNode = element.parentNode;\n while (parentNode !== null) {\n if (parentNode instanceof HTMLElement && getComputedStyle(parentNode).position !== 'static') {\n return parentNode;\n }\n parentNode = parentNode.parentNode;\n }\n return document.body;\n}\nfunction isOnTopLayer(element) {\n var _a;\n if (element.tagName === 'DIALOG') {\n return true;\n }\n try {\n if (element.matches(':popover-open') && /native code/.test((_a = document.body.showPopover) === null || _a === void 0 ? void 0 : _a.toString())) {\n return true;\n }\n }\n catch (_b) {\n return false;\n }\n return false;\n}\nfunction getClippingRect(element) {\n let parentNode = element;\n while (parentNode !== null) {\n if (!(parentNode instanceof Element)) {\n break;\n }\n const parentNodeStyle = getComputedStyle(parentNode);\n if (parentNodeStyle.overflow !== 'visible') {\n break;\n }\n parentNode = parentNode.parentNode;\n }\n const clippingNode = parentNode === document.body || !(parentNode instanceof HTMLElement) ? document.body : parentNode;\n const elemRect = clippingNode.getBoundingClientRect();\n const elemStyle = getComputedStyle(clippingNode);\n const [borderTop, borderLeft, borderRight, borderBottom] = [\n elemStyle.borderTopWidth,\n elemStyle.borderLeftWidth,\n elemStyle.borderRightWidth,\n elemStyle.borderBottomWidth,\n ].map(v => parseInt(v, 10) || 0);\n return {\n top: elemRect.top + borderTop,\n left: elemRect.left + borderLeft,\n width: elemRect.width - borderRight - borderLeft,\n height: Math.max(elemRect.height - borderTop - borderBottom, clippingNode === document.body ? window.innerHeight : -Infinity),\n };\n}\nconst positionDefaults = {\n side: 'outside-bottom',\n align: 'start',\n anchorOffset: 4,\n alignmentOffset: 4,\n allowOutOfBounds: false,\n};\nfunction getDefaultSettings(settings = {}) {\n var _a, _b, _c, _d, _e;\n const side = (_a = settings.side) !== null && _a !== void 0 ? _a : positionDefaults.side;\n const align = (_b = settings.align) !== null && _b !== void 0 ? _b : positionDefaults.align;\n return {\n side,\n align,\n anchorOffset: (_c = settings.anchorOffset) !== null && _c !== void 0 ? _c : (side === 'inside-center' ? 0 : positionDefaults.anchorOffset),\n alignmentOffset: (_d = settings.alignmentOffset) !== null && _d !== void 0 ? _d : (align !== 'center' && side.startsWith('inside') ? positionDefaults.alignmentOffset : 0),\n allowOutOfBounds: (_e = settings.allowOutOfBounds) !== null && _e !== void 0 ? _e : positionDefaults.allowOutOfBounds,\n };\n}\nfunction pureCalculateAnchoredPosition(viewportRect, relativePosition, floatingRect, anchorRect, { side, align, allowOutOfBounds, anchorOffset, alignmentOffset }) {\n const relativeViewportRect = {\n top: viewportRect.top - relativePosition.top,\n left: viewportRect.left - relativePosition.left,\n width: viewportRect.width,\n height: viewportRect.height,\n };\n let pos = calculatePosition(floatingRect, anchorRect, side, align, anchorOffset, alignmentOffset);\n let anchorSide = side;\n let anchorAlign = align;\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n if (!allowOutOfBounds) {\n const alternateOrder = alternateOrders[side];\n let positionAttempt = 0;\n if (alternateOrder) {\n let prevSide = side;\n while (positionAttempt < alternateOrder.length &&\n shouldRecalculatePosition(prevSide, pos, relativeViewportRect, floatingRect)) {\n const nextSide = alternateOrder[positionAttempt++];\n prevSide = nextSide;\n pos = calculatePosition(floatingRect, anchorRect, nextSide, align, anchorOffset, alignmentOffset);\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n anchorSide = nextSide;\n }\n }\n const alternateAlignment = alternateAlignments[align];\n let alignmentAttempt = 0;\n if (alternateAlignment) {\n let prevAlign = align;\n while (alignmentAttempt < alternateAlignment.length &&\n shouldRecalculateAlignment(prevAlign, pos, relativeViewportRect, floatingRect)) {\n const nextAlign = alternateAlignment[alignmentAttempt++];\n prevAlign = nextAlign;\n pos = calculatePosition(floatingRect, anchorRect, anchorSide, nextAlign, anchorOffset, alignmentOffset);\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n anchorAlign = nextAlign;\n }\n }\n if (pos.top < relativeViewportRect.top) {\n pos.top = relativeViewportRect.top;\n }\n if (pos.left < relativeViewportRect.left) {\n pos.left = relativeViewportRect.left;\n }\n if (pos.left + floatingRect.width > viewportRect.width + relativeViewportRect.left) {\n pos.left = viewportRect.width + relativeViewportRect.left - floatingRect.width;\n }\n if (alternateOrder && positionAttempt < alternateOrder.length) {\n if (pos.top + floatingRect.height > viewportRect.height + relativeViewportRect.top) {\n pos.top = Math.max(viewportRect.height + relativeViewportRect.top - floatingRect.height, 0);\n }\n }\n }\n return Object.assign(Object.assign({}, pos), { anchorSide, anchorAlign });\n}\nfunction calculatePosition(elementDimensions, anchorPosition, side, align, anchorOffset, alignmentOffset) {\n const anchorRight = anchorPosition.left + anchorPosition.width;\n const anchorBottom = anchorPosition.top + anchorPosition.height;\n let top = -1;\n let left = -1;\n if (side === 'outside-top') {\n top = anchorPosition.top - anchorOffset - elementDimensions.height;\n }\n else if (side === 'outside-bottom') {\n top = anchorBottom + anchorOffset;\n }\n else if (side === 'outside-left') {\n left = anchorPosition.left - anchorOffset - elementDimensions.width;\n }\n else if (side === 'outside-right') {\n left = anchorRight + anchorOffset;\n }\n if (side === 'outside-top' || side === 'outside-bottom') {\n if (align === 'start') {\n left = anchorPosition.left + alignmentOffset;\n }\n else if (align === 'center') {\n left = anchorPosition.left - (elementDimensions.width - anchorPosition.width) / 2 + alignmentOffset;\n }\n else {\n left = anchorRight - elementDimensions.width - alignmentOffset;\n }\n }\n if (side === 'outside-left' || side === 'outside-right') {\n if (align === 'start') {\n top = anchorPosition.top + alignmentOffset;\n }\n else if (align === 'center') {\n top = anchorPosition.top - (elementDimensions.height - anchorPosition.height) / 2 + alignmentOffset;\n }\n else {\n top = anchorBottom - elementDimensions.height - alignmentOffset;\n }\n }\n if (side === 'inside-top') {\n top = anchorPosition.top + anchorOffset;\n }\n else if (side === 'inside-bottom') {\n top = anchorBottom - anchorOffset - elementDimensions.height;\n }\n else if (side === 'inside-left') {\n left = anchorPosition.left + anchorOffset;\n }\n else if (side === 'inside-right') {\n left = anchorRight - anchorOffset - elementDimensions.width;\n }\n else if (side === 'inside-center') {\n left = (anchorRight + anchorPosition.left) / 2 - elementDimensions.width / 2 + anchorOffset;\n }\n if (side === 'inside-top' || side === 'inside-bottom') {\n if (align === 'start') {\n left = anchorPosition.left + alignmentOffset;\n }\n else if (align === 'center') {\n left = anchorPosition.left - (elementDimensions.width - anchorPosition.width) / 2 + alignmentOffset;\n }\n else {\n left = anchorRight - elementDimensions.width - alignmentOffset;\n }\n }\n else if (side === 'inside-left' || side === 'inside-right' || side === 'inside-center') {\n if (align === 'start') {\n top = anchorPosition.top + alignmentOffset;\n }\n else if (align === 'center') {\n top = anchorPosition.top - (elementDimensions.height - anchorPosition.height) / 2 + alignmentOffset;\n }\n else {\n top = anchorBottom - elementDimensions.height - alignmentOffset;\n }\n }\n return { top, left };\n}\nfunction shouldRecalculatePosition(side, currentPos, containerDimensions, elementDimensions) {\n if (side === 'outside-top' || side === 'outside-bottom') {\n return (currentPos.top < containerDimensions.top ||\n currentPos.top + elementDimensions.height > containerDimensions.height + containerDimensions.top);\n }\n else {\n return (currentPos.left < containerDimensions.left ||\n currentPos.left + elementDimensions.width > containerDimensions.width + containerDimensions.left);\n }\n}\nfunction shouldRecalculateAlignment(align, currentPos, containerDimensions, elementDimensions) {\n if (align === 'end') {\n return currentPos.left < containerDimensions.left;\n }\n else if (align === 'start' || align === 'center') {\n return (currentPos.left + elementDimensions.width > containerDimensions.left + containerDimensions.width ||\n currentPos.left < containerDimensions.left);\n }\n}\n\nexport { getAnchoredPosition };\n","function* iterateFocusableElements(container, options = {}) {\n var _a, _b;\n const strict = (_a = options.strict) !== null && _a !== void 0 ? _a : false;\n const acceptFn = ((_b = options.onlyTabbable) !== null && _b !== void 0 ? _b : false) ? isTabbable : isFocusable;\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: node => node instanceof HTMLElement && acceptFn(node, strict) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP,\n });\n let nextNode = null;\n if (!options.reverse && acceptFn(container, strict)) {\n yield container;\n }\n if (options.reverse) {\n let lastChild = walker.lastChild();\n while (lastChild) {\n nextNode = lastChild;\n lastChild = walker.lastChild();\n }\n }\n else {\n nextNode = walker.firstChild();\n }\n while (nextNode instanceof HTMLElement) {\n yield nextNode;\n nextNode = options.reverse ? walker.previousNode() : walker.nextNode();\n }\n if (options.reverse && acceptFn(container, strict)) {\n yield container;\n }\n return undefined;\n}\nfunction getFocusableChild(container, lastChild = false) {\n return iterateFocusableElements(container, { reverse: lastChild, strict: true, onlyTabbable: true }).next().value;\n}\nfunction isFocusable(elem, strict = false) {\n const disabledAttrInert = ['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA', 'OPTGROUP', 'OPTION', 'FIELDSET'].includes(elem.tagName) &&\n elem.disabled;\n const hiddenInert = elem.hidden;\n const hiddenInputInert = elem instanceof HTMLInputElement && elem.type === 'hidden';\n const sentinelInert = elem.classList.contains('sentinel');\n if (disabledAttrInert || hiddenInert || hiddenInputInert || sentinelInert) {\n return false;\n }\n if (strict) {\n const style = getComputedStyle(elem);\n const sizeInert = elem.offsetWidth === 0 || elem.offsetHeight === 0;\n const visibilityInert = ['hidden', 'collapse'].includes(style.visibility);\n const displayInert = style.display === 'none' || !elem.offsetParent;\n const clientRectsInert = elem.getClientRects().length === 0;\n if (sizeInert || visibilityInert || clientRectsInert || displayInert) {\n return false;\n }\n }\n if (elem.getAttribute('tabindex') != null) {\n return true;\n }\n if (elem.getAttribute('contenteditable') === 'true' || elem.getAttribute('contenteditable') === 'plaintext-only') {\n return true;\n }\n if (elem instanceof HTMLAnchorElement && elem.getAttribute('href') == null) {\n return false;\n }\n return elem.tabIndex !== -1;\n}\nfunction isTabbable(elem, strict = false) {\n return isFocusable(elem, strict) && elem.getAttribute('tabindex') !== '-1';\n}\n\nexport { getFocusableChild, isFocusable, isTabbable, iterateFocusableElements };\n","let signalSupported = false;\nfunction noop() { }\ntry {\n const options = Object.create({}, {\n signal: {\n get() {\n signalSupported = true;\n },\n },\n });\n window.addEventListener('test', noop, options);\n window.removeEventListener('test', noop, options);\n}\ncatch (e) {\n}\nfunction featureSupported() {\n return signalSupported;\n}\nfunction monkeyPatch() {\n if (typeof window === 'undefined') {\n return;\n }\n const originalAddEventListener = EventTarget.prototype.addEventListener;\n EventTarget.prototype.addEventListener = function (name, originalCallback, optionsOrCapture) {\n if (typeof optionsOrCapture === 'object' &&\n 'signal' in optionsOrCapture &&\n optionsOrCapture.signal instanceof AbortSignal) {\n originalAddEventListener.call(optionsOrCapture.signal, 'abort', () => {\n this.removeEventListener(name, originalCallback, optionsOrCapture);\n });\n }\n return originalAddEventListener.call(this, name, originalCallback, optionsOrCapture);\n };\n}\nfunction polyfill() {\n if (!featureSupported()) {\n monkeyPatch();\n signalSupported = true;\n }\n}\n\nexport { polyfill };\n","import { getFocusableChild, isTabbable } from './utils/iterate-focusable-elements.mjs';\nimport { polyfill } from './polyfills/event-listener-signal.mjs';\n\npolyfill();\nconst suspendedTrapStack = [];\nlet activeTrap = undefined;\nfunction tryReactivate() {\n const trapToReactivate = suspendedTrapStack.pop();\n if (trapToReactivate) {\n focusTrap(trapToReactivate.container, trapToReactivate.initialFocus, trapToReactivate.originalSignal);\n }\n}\nfunction followSignal(signal) {\n const controller = new AbortController();\n signal.addEventListener('abort', () => {\n controller.abort();\n });\n return controller;\n}\nfunction observeFocusTrap(container, sentinels) {\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.type === 'childList' && mutation.addedNodes.length) {\n const sentinelChildren = Array.from(mutation.addedNodes).filter(e => e instanceof HTMLElement && e.classList.contains('sentinel') && e.tagName === 'SPAN');\n if (sentinelChildren.length) {\n return;\n }\n const firstChild = container.firstElementChild;\n const lastChild = container.lastElementChild;\n const [sentinelStart, sentinelEnd] = sentinels;\n if (!(firstChild === null || firstChild === void 0 ? void 0 : firstChild.classList.contains('sentinel'))) {\n container.insertAdjacentElement('afterbegin', sentinelStart);\n }\n if (!(lastChild === null || lastChild === void 0 ? void 0 : lastChild.classList.contains('sentinel'))) {\n container.insertAdjacentElement('beforeend', sentinelEnd);\n }\n }\n }\n });\n observer.observe(container, { childList: true });\n return observer;\n}\nfunction focusTrap(container, initialFocus, abortSignal) {\n const controller = new AbortController();\n const signal = abortSignal !== null && abortSignal !== void 0 ? abortSignal : controller.signal;\n container.setAttribute('data-focus-trap', 'active');\n const sentinelStart = document.createElement('span');\n sentinelStart.setAttribute('class', 'sentinel');\n sentinelStart.setAttribute('tabindex', '0');\n sentinelStart.setAttribute('aria-hidden', 'true');\n sentinelStart.onfocus = () => {\n const lastFocusableChild = getFocusableChild(container, true);\n lastFocusableChild === null || lastFocusableChild === void 0 ? void 0 : lastFocusableChild.focus();\n };\n const sentinelEnd = document.createElement('span');\n sentinelEnd.setAttribute('class', 'sentinel');\n sentinelEnd.setAttribute('tabindex', '0');\n sentinelEnd.setAttribute('aria-hidden', 'true');\n sentinelEnd.onfocus = () => {\n const firstFocusableChild = getFocusableChild(container);\n firstFocusableChild === null || firstFocusableChild === void 0 ? void 0 : firstFocusableChild.focus();\n };\n container.prepend(sentinelStart);\n container.append(sentinelEnd);\n const observer = observeFocusTrap(container, [sentinelStart, sentinelEnd]);\n let lastFocusedChild = undefined;\n function ensureTrapZoneHasFocus(focusedElement) {\n if (focusedElement instanceof HTMLElement && document.contains(container)) {\n if (container.contains(focusedElement)) {\n lastFocusedChild = focusedElement;\n return;\n }\n else {\n if (lastFocusedChild && isTabbable(lastFocusedChild) && container.contains(lastFocusedChild)) {\n lastFocusedChild.focus();\n return;\n }\n else if (initialFocus && container.contains(initialFocus)) {\n initialFocus.focus();\n return;\n }\n else {\n const firstFocusableChild = getFocusableChild(container);\n firstFocusableChild === null || firstFocusableChild === void 0 ? void 0 : firstFocusableChild.focus();\n return;\n }\n }\n }\n }\n const wrappingController = followSignal(signal);\n if (activeTrap) {\n const suspendedTrap = activeTrap;\n activeTrap.container.setAttribute('data-focus-trap', 'suspended');\n activeTrap.controller.abort();\n suspendedTrapStack.push(suspendedTrap);\n }\n wrappingController.signal.addEventListener('abort', () => {\n activeTrap = undefined;\n });\n signal.addEventListener('abort', () => {\n container.removeAttribute('data-focus-trap');\n const sentinels = container.getElementsByClassName('sentinel');\n while (sentinels.length > 0)\n sentinels[0].remove();\n const suspendedTrapIndex = suspendedTrapStack.findIndex(t => t.container === container);\n if (suspendedTrapIndex >= 0) {\n suspendedTrapStack.splice(suspendedTrapIndex, 1);\n }\n observer.disconnect();\n tryReactivate();\n });\n document.addEventListener('focus', event => {\n ensureTrapZoneHasFocus(event.target);\n }, { signal: wrappingController.signal, capture: true });\n ensureTrapZoneHasFocus(document.activeElement);\n activeTrap = {\n container,\n controller: wrappingController,\n initialFocus,\n originalSignal: signal,\n };\n const suspendedTrapIndex = suspendedTrapStack.findIndex(t => t.container === container);\n if (suspendedTrapIndex >= 0) {\n suspendedTrapStack.splice(suspendedTrapIndex, 1);\n }\n if (!abortSignal) {\n return controller;\n }\n}\n\nexport { focusTrap };\n","let isMac = undefined;\nfunction isMacOS() {\n if (isMac === undefined) {\n isMac = /^mac/i.test(window.navigator.platform);\n }\n return isMac;\n}\n\nexport { isMacOS };\n","let idSeed = 10000;\nfunction uniqueId() {\n return `__primer_id_${idSeed++}`;\n}\n\nexport { uniqueId };\n","import { polyfill } from './polyfills/event-listener-signal.mjs';\nimport { isMacOS } from './utils/user-agent.mjs';\nimport { iterateFocusableElements } from './utils/iterate-focusable-elements.mjs';\nimport { uniqueId } from './utils/unique-id.mjs';\n\npolyfill();\nvar FocusKeys;\n(function (FocusKeys) {\n FocusKeys[FocusKeys[\"ArrowHorizontal\"] = 1] = \"ArrowHorizontal\";\n FocusKeys[FocusKeys[\"ArrowVertical\"] = 2] = \"ArrowVertical\";\n FocusKeys[FocusKeys[\"JK\"] = 4] = \"JK\";\n FocusKeys[FocusKeys[\"HL\"] = 8] = \"HL\";\n FocusKeys[FocusKeys[\"HomeAndEnd\"] = 16] = \"HomeAndEnd\";\n FocusKeys[FocusKeys[\"PageUpDown\"] = 256] = \"PageUpDown\";\n FocusKeys[FocusKeys[\"WS\"] = 32] = \"WS\";\n FocusKeys[FocusKeys[\"AD\"] = 64] = \"AD\";\n FocusKeys[FocusKeys[\"Tab\"] = 128] = \"Tab\";\n FocusKeys[FocusKeys[\"Backspace\"] = 512] = \"Backspace\";\n FocusKeys[FocusKeys[\"ArrowAll\"] = 3] = \"ArrowAll\";\n FocusKeys[FocusKeys[\"HJKL\"] = 12] = \"HJKL\";\n FocusKeys[FocusKeys[\"WASD\"] = 96] = \"WASD\";\n FocusKeys[FocusKeys[\"All\"] = 511] = \"All\";\n})(FocusKeys || (FocusKeys = {}));\nconst KEY_TO_BIT = {\n ArrowLeft: FocusKeys.ArrowHorizontal,\n ArrowDown: FocusKeys.ArrowVertical,\n ArrowUp: FocusKeys.ArrowVertical,\n ArrowRight: FocusKeys.ArrowHorizontal,\n h: FocusKeys.HL,\n j: FocusKeys.JK,\n k: FocusKeys.JK,\n l: FocusKeys.HL,\n a: FocusKeys.AD,\n s: FocusKeys.WS,\n w: FocusKeys.WS,\n d: FocusKeys.AD,\n Tab: FocusKeys.Tab,\n Home: FocusKeys.HomeAndEnd,\n End: FocusKeys.HomeAndEnd,\n PageUp: FocusKeys.PageUpDown,\n PageDown: FocusKeys.PageUpDown,\n Backspace: FocusKeys.Backspace,\n};\nconst KEY_TO_DIRECTION = {\n ArrowLeft: 'previous',\n ArrowDown: 'next',\n ArrowUp: 'previous',\n ArrowRight: 'next',\n h: 'previous',\n j: 'next',\n k: 'previous',\n l: 'next',\n a: 'previous',\n s: 'next',\n w: 'previous',\n d: 'next',\n Tab: 'next',\n Home: 'start',\n End: 'end',\n PageUp: 'start',\n PageDown: 'end',\n Backspace: 'previous',\n};\nfunction getDirection(keyboardEvent) {\n const direction = KEY_TO_DIRECTION[keyboardEvent.key];\n if (keyboardEvent.key === 'Tab' && keyboardEvent.shiftKey) {\n return 'previous';\n }\n const isMac = isMacOS();\n if ((isMac && keyboardEvent.metaKey) || (!isMac && keyboardEvent.ctrlKey)) {\n if (keyboardEvent.key === 'ArrowLeft' || keyboardEvent.key === 'ArrowUp') {\n return 'start';\n }\n else if (keyboardEvent.key === 'ArrowRight' || keyboardEvent.key === 'ArrowDown') {\n return 'end';\n }\n }\n return direction;\n}\nfunction shouldIgnoreFocusHandling(keyboardEvent, activeElement) {\n const key = keyboardEvent.key;\n const keyLength = [...key].length;\n const isTextInput = (activeElement instanceof HTMLInputElement && activeElement.type === 'text') ||\n activeElement instanceof HTMLTextAreaElement;\n if (isTextInput && (keyLength === 1 || key === 'Home' || key === 'End')) {\n return true;\n }\n if (activeElement instanceof HTMLSelectElement) {\n if (keyLength === 1) {\n return true;\n }\n if (key === 'ArrowDown' && isMacOS() && !keyboardEvent.metaKey) {\n return true;\n }\n if (key === 'ArrowDown' && !isMacOS() && keyboardEvent.altKey) {\n return true;\n }\n }\n if (activeElement instanceof HTMLTextAreaElement && (key === 'PageUp' || key === 'PageDown')) {\n return true;\n }\n if (isTextInput) {\n const textInput = activeElement;\n const cursorAtStart = textInput.selectionStart === 0 && textInput.selectionEnd === 0;\n const cursorAtEnd = textInput.selectionStart === textInput.value.length && textInput.selectionEnd === textInput.value.length;\n if (key === 'ArrowLeft' && !cursorAtStart) {\n return true;\n }\n if (key === 'ArrowRight' && !cursorAtEnd) {\n return true;\n }\n if (textInput instanceof HTMLTextAreaElement) {\n if (key === 'ArrowUp' && !cursorAtStart) {\n return true;\n }\n if (key === 'ArrowDown' && !cursorAtEnd) {\n return true;\n }\n }\n }\n return false;\n}\nconst isActiveDescendantAttribute = 'data-is-active-descendant';\nconst activeDescendantActivatedDirectly = 'activated-directly';\nconst activeDescendantActivatedIndirectly = 'activated-indirectly';\nconst hasActiveDescendantAttribute = 'data-has-active-descendant';\nfunction focusZone(container, settings) {\n var _a, _b, _c, _d, _e;\n const focusableElements = [];\n const savedTabIndex = new WeakMap();\n const bindKeys = (_a = settings === null || settings === void 0 ? void 0 : settings.bindKeys) !== null && _a !== void 0 ? _a : ((settings === null || settings === void 0 ? void 0 : settings.getNextFocusable) ? FocusKeys.ArrowAll : FocusKeys.ArrowVertical) | FocusKeys.HomeAndEnd;\n const focusOutBehavior = (_b = settings === null || settings === void 0 ? void 0 : settings.focusOutBehavior) !== null && _b !== void 0 ? _b : 'stop';\n const focusInStrategy = (_c = settings === null || settings === void 0 ? void 0 : settings.focusInStrategy) !== null && _c !== void 0 ? _c : 'previous';\n const activeDescendantControl = settings === null || settings === void 0 ? void 0 : settings.activeDescendantControl;\n const activeDescendantCallback = settings === null || settings === void 0 ? void 0 : settings.onActiveDescendantChanged;\n let currentFocusedElement;\n const preventScroll = (_d = settings === null || settings === void 0 ? void 0 : settings.preventScroll) !== null && _d !== void 0 ? _d : false;\n function getFirstFocusableElement() {\n return focusableElements[0];\n }\n function isActiveDescendantInputFocused() {\n return document.activeElement === activeDescendantControl;\n }\n function updateFocusedElement(to, directlyActivated = false) {\n const from = currentFocusedElement;\n currentFocusedElement = to;\n if (activeDescendantControl) {\n if (to && isActiveDescendantInputFocused()) {\n setActiveDescendant(from, to, directlyActivated);\n }\n else {\n clearActiveDescendant();\n }\n return;\n }\n if (from && from !== to && savedTabIndex.has(from)) {\n from.setAttribute('tabindex', '-1');\n }\n to === null || to === void 0 ? void 0 : to.setAttribute('tabindex', '0');\n }\n function setActiveDescendant(from, to, directlyActivated = false) {\n if (!to.id) {\n to.setAttribute('id', uniqueId());\n }\n if (from && from !== to) {\n from.removeAttribute(isActiveDescendantAttribute);\n }\n if (!activeDescendantControl ||\n (!directlyActivated && activeDescendantControl.getAttribute('aria-activedescendant') === to.id)) {\n return;\n }\n activeDescendantControl.setAttribute('aria-activedescendant', to.id);\n container.setAttribute(hasActiveDescendantAttribute, to.id);\n to.setAttribute(isActiveDescendantAttribute, directlyActivated ? activeDescendantActivatedDirectly : activeDescendantActivatedIndirectly);\n activeDescendantCallback === null || activeDescendantCallback === void 0 ? void 0 : activeDescendantCallback(to, from, directlyActivated);\n }\n function clearActiveDescendant(previouslyActiveElement = currentFocusedElement) {\n if (focusInStrategy === 'first') {\n currentFocusedElement = undefined;\n }\n activeDescendantControl === null || activeDescendantControl === void 0 ? void 0 : activeDescendantControl.removeAttribute('aria-activedescendant');\n container.removeAttribute(hasActiveDescendantAttribute);\n previouslyActiveElement === null || previouslyActiveElement === void 0 ? void 0 : previouslyActiveElement.removeAttribute(isActiveDescendantAttribute);\n activeDescendantCallback === null || activeDescendantCallback === void 0 ? void 0 : activeDescendantCallback(undefined, previouslyActiveElement, false);\n }\n function beginFocusManagement(...elements) {\n const filteredElements = elements.filter(e => { var _a, _b; return (_b = (_a = settings === null || settings === void 0 ? void 0 : settings.focusableElementFilter) === null || _a === void 0 ? void 0 : _a.call(settings, e)) !== null && _b !== void 0 ? _b : true; });\n if (filteredElements.length === 0) {\n return;\n }\n focusableElements.splice(findInsertionIndex(filteredElements), 0, ...filteredElements);\n for (const element of filteredElements) {\n if (!savedTabIndex.has(element)) {\n savedTabIndex.set(element, element.getAttribute('tabindex'));\n }\n element.setAttribute('tabindex', '-1');\n }\n if (!currentFocusedElement) {\n updateFocusedElement(getFirstFocusableElement());\n }\n }\n function findInsertionIndex(elementsToInsert) {\n const firstElementToInsert = elementsToInsert[0];\n if (focusableElements.length === 0)\n return 0;\n let iMin = 0;\n let iMax = focusableElements.length - 1;\n while (iMin <= iMax) {\n const i = Math.floor((iMin + iMax) / 2);\n const element = focusableElements[i];\n if (followsInDocument(firstElementToInsert, element)) {\n iMax = i - 1;\n }\n else {\n iMin = i + 1;\n }\n }\n return iMin;\n }\n function followsInDocument(first, second) {\n return (second.compareDocumentPosition(first) & Node.DOCUMENT_POSITION_PRECEDING) > 0;\n }\n function endFocusManagement(...elements) {\n for (const element of elements) {\n const focusableElementIndex = focusableElements.indexOf(element);\n if (focusableElementIndex >= 0) {\n focusableElements.splice(focusableElementIndex, 1);\n }\n const savedIndex = savedTabIndex.get(element);\n if (savedIndex !== undefined) {\n if (savedIndex === null) {\n element.removeAttribute('tabindex');\n }\n else {\n element.setAttribute('tabindex', savedIndex);\n }\n savedTabIndex.delete(element);\n }\n if (element === currentFocusedElement) {\n const nextElementToFocus = getFirstFocusableElement();\n updateFocusedElement(nextElementToFocus);\n }\n }\n }\n const iterateFocusableElementsOptions = {\n reverse: settings === null || settings === void 0 ? void 0 : settings.reverse,\n strict: settings === null || settings === void 0 ? void 0 : settings.strict,\n onlyTabbable: settings === null || settings === void 0 ? void 0 : settings.onlyTabbable,\n };\n beginFocusManagement(...iterateFocusableElements(container, iterateFocusableElementsOptions));\n const initialElement = typeof focusInStrategy === 'function' ? focusInStrategy(document.body) : getFirstFocusableElement();\n updateFocusedElement(initialElement);\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n for (const removedNode of mutation.removedNodes) {\n if (removedNode instanceof HTMLElement) {\n endFocusManagement(...iterateFocusableElements(removedNode));\n }\n }\n if (mutation.type === 'attributes' && mutation.oldValue === null) {\n if (mutation.target instanceof HTMLElement) {\n endFocusManagement(mutation.target);\n }\n }\n }\n for (const mutation of mutations) {\n for (const addedNode of mutation.addedNodes) {\n if (addedNode instanceof HTMLElement) {\n beginFocusManagement(...iterateFocusableElements(addedNode, iterateFocusableElementsOptions));\n }\n }\n if (mutation.type === 'attributes' && mutation.oldValue !== null) {\n if (mutation.target instanceof HTMLElement) {\n beginFocusManagement(mutation.target);\n }\n }\n }\n });\n observer.observe(container, {\n subtree: true,\n childList: true,\n attributeFilter: ['hidden', 'disabled'],\n attributeOldValue: true,\n });\n const controller = new AbortController();\n const signal = (_e = settings === null || settings === void 0 ? void 0 : settings.abortSignal) !== null && _e !== void 0 ? _e : controller.signal;\n signal.addEventListener('abort', () => {\n endFocusManagement(...focusableElements);\n });\n let elementIndexFocusedByClick = undefined;\n container.addEventListener('mousedown', event => {\n if (event.target instanceof HTMLElement && event.target !== document.activeElement) {\n elementIndexFocusedByClick = focusableElements.indexOf(event.target);\n }\n }, { signal });\n if (activeDescendantControl) {\n container.addEventListener('focusin', event => {\n if (event.target instanceof HTMLElement && focusableElements.includes(event.target)) {\n activeDescendantControl.focus({ preventScroll });\n updateFocusedElement(event.target);\n }\n });\n container.addEventListener('mousemove', ({ target }) => {\n if (!(target instanceof Node)) {\n return;\n }\n const focusableElement = focusableElements.find(element => element.contains(target));\n if (focusableElement) {\n updateFocusedElement(focusableElement);\n }\n }, { signal, capture: true });\n activeDescendantControl.addEventListener('focusin', () => {\n if (!currentFocusedElement) {\n updateFocusedElement(getFirstFocusableElement());\n }\n else {\n setActiveDescendant(undefined, currentFocusedElement);\n }\n });\n activeDescendantControl.addEventListener('focusout', () => {\n clearActiveDescendant();\n });\n }\n else {\n container.addEventListener('focusin', event => {\n if (event.target instanceof HTMLElement) {\n if (elementIndexFocusedByClick !== undefined) {\n if (elementIndexFocusedByClick >= 0) {\n if (focusableElements[elementIndexFocusedByClick] !== currentFocusedElement) {\n updateFocusedElement(focusableElements[elementIndexFocusedByClick]);\n }\n }\n elementIndexFocusedByClick = undefined;\n }\n else {\n if (focusInStrategy === 'previous') {\n updateFocusedElement(event.target);\n }\n else if (focusInStrategy === 'closest' || focusInStrategy === 'first') {\n if (event.relatedTarget instanceof Element && !container.contains(event.relatedTarget)) {\n const targetElementIndex = lastKeyboardFocusDirection === 'previous' ? focusableElements.length - 1 : 0;\n const targetElement = focusableElements[targetElementIndex];\n targetElement === null || targetElement === void 0 ? void 0 : targetElement.focus({ preventScroll });\n return;\n }\n else {\n updateFocusedElement(event.target);\n }\n }\n else if (typeof focusInStrategy === 'function') {\n if (event.relatedTarget instanceof Element && !container.contains(event.relatedTarget)) {\n const elementToFocus = focusInStrategy(event.relatedTarget);\n const requestedFocusElementIndex = elementToFocus ? focusableElements.indexOf(elementToFocus) : -1;\n if (requestedFocusElementIndex >= 0 && elementToFocus instanceof HTMLElement) {\n elementToFocus.focus({ preventScroll });\n return;\n }\n else {\n console.warn('Element requested is not a known focusable element.');\n }\n }\n else {\n updateFocusedElement(event.target);\n }\n }\n }\n }\n lastKeyboardFocusDirection = undefined;\n }, { signal });\n }\n const keyboardEventRecipient = activeDescendantControl !== null && activeDescendantControl !== void 0 ? activeDescendantControl : container;\n let lastKeyboardFocusDirection = undefined;\n if (focusInStrategy === 'closest') {\n document.addEventListener('keydown', event => {\n if (event.key === 'Tab') {\n lastKeyboardFocusDirection = getDirection(event);\n }\n }, { signal, capture: true });\n }\n function getCurrentFocusedIndex() {\n if (!currentFocusedElement) {\n return 0;\n }\n const focusedIndex = focusableElements.indexOf(currentFocusedElement);\n const fallbackIndex = currentFocusedElement === container ? -1 : 0;\n return focusedIndex !== -1 ? focusedIndex : fallbackIndex;\n }\n keyboardEventRecipient.addEventListener('keydown', event => {\n var _a;\n if (event.key in KEY_TO_DIRECTION) {\n const keyBit = KEY_TO_BIT[event.key];\n if (!event.defaultPrevented &&\n (keyBit & bindKeys) > 0 &&\n !shouldIgnoreFocusHandling(event, document.activeElement)) {\n const direction = getDirection(event);\n let nextElementToFocus = undefined;\n if (settings === null || settings === void 0 ? void 0 : settings.getNextFocusable) {\n nextElementToFocus = settings.getNextFocusable(direction, (_a = document.activeElement) !== null && _a !== void 0 ? _a : undefined, event);\n }\n if (!nextElementToFocus) {\n const lastFocusedIndex = getCurrentFocusedIndex();\n let nextFocusedIndex = lastFocusedIndex;\n if (direction === 'previous') {\n nextFocusedIndex -= 1;\n }\n else if (direction === 'start') {\n nextFocusedIndex = 0;\n }\n else if (direction === 'next') {\n nextFocusedIndex += 1;\n }\n else {\n nextFocusedIndex = focusableElements.length - 1;\n }\n if (nextFocusedIndex < 0) {\n if (focusOutBehavior === 'wrap' && event.key !== 'Tab') {\n nextFocusedIndex = focusableElements.length - 1;\n }\n else {\n nextFocusedIndex = 0;\n }\n }\n if (nextFocusedIndex >= focusableElements.length) {\n if (focusOutBehavior === 'wrap' && event.key !== 'Tab') {\n nextFocusedIndex = 0;\n }\n else {\n nextFocusedIndex = focusableElements.length - 1;\n }\n }\n if (lastFocusedIndex !== nextFocusedIndex) {\n nextElementToFocus = focusableElements[nextFocusedIndex];\n }\n }\n if (activeDescendantControl) {\n updateFocusedElement(nextElementToFocus || currentFocusedElement, true);\n }\n else if (nextElementToFocus) {\n lastKeyboardFocusDirection = direction;\n nextElementToFocus.focus({ preventScroll });\n }\n if (event.key !== 'Tab' || nextElementToFocus) {\n event.preventDefault();\n }\n }\n }\n }, { signal });\n return controller;\n}\n\nexport { FocusKeys, activeDescendantActivatedDirectly, activeDescendantActivatedIndirectly, focusZone, hasActiveDescendantAttribute, isActiveDescendantAttribute };\n","import {controller, targets, target} from '@github/catalyst'\nimport {focusZone, FocusKeys} from '@primer/behaviors'\nimport {ActionMenuElement} from './action_menu/action_menu_element'\n\nconst instersectionObserver = new IntersectionObserver(entries => {\n for (const entry of entries) {\n const action = entry.target\n if (entry.isIntersecting && action instanceof ActionBarElement) {\n action.update()\n }\n }\n})\n\nconst resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const action = entry.target\n if (action instanceof ActionBarElement) {\n action.update()\n }\n }\n})\n\n// These are definitely used, but eslint is dumb apparently\n\nenum ItemType {\n Item,\n Divider,\n}\n\n@controller\nclass ActionBarElement extends HTMLElement {\n @targets items: HTMLElement[]\n @target itemContainer: HTMLElement\n @target moreMenu: ActionMenuElement\n\n #focusZoneAbortController: AbortController | null = null\n\n connectedCallback() {\n // Calculate the width of all the items before hiding anything\n for (const item of this.items) {\n const width = item.getBoundingClientRect().width\n const marginLeft = parseInt(window.getComputedStyle(item)?.marginLeft, 10)\n const marginRight = parseInt(window.getComputedStyle(item)?.marginRight, 10)\n item.setAttribute('data-offset-width', `${width + marginLeft + marginRight}`)\n }\n\n resizeObserver.observe(this)\n instersectionObserver.observe(this)\n\n requestAnimationFrame(() => {\n // This overflow visible is needed for browsers that don't support PopoverElement\n // to ensure the menu and tooltips are visible when the action bar is in a collapsed state\n // once popover is fully supported we can remove this.style.overflow = 'visible'\n this.style.overflow = 'visible'\n this.update()\n })\n }\n\n disconnectedCallback() {\n resizeObserver.unobserve(this)\n instersectionObserver.unobserve(this)\n }\n\n menuItemClick(event: Event) {\n const currentTarget = event.currentTarget as HTMLButtonElement\n\n const id = currentTarget?.getAttribute('data-for')\n\n if (id) {\n document.getElementById(id)?.click()\n }\n }\n\n update() {\n const firstItem = this.#firstItem\n if (!firstItem) return\n\n const firstItemTop = firstItem.getBoundingClientRect().top\n let previousItemType: ItemType | null = null\n\n this.#eachItem((item: HTMLElement, index: number, type: ItemType): boolean => {\n const itemTop = item.getBoundingClientRect().top\n\n if (type === ItemType.Item) {\n if (itemTop > firstItemTop) {\n this.#hideItem(index)\n\n if (this.moreMenu.hidden) {\n this.moreMenu.hidden = false\n }\n\n if (previousItemType === ItemType.Divider) {\n this.#hideItem(index - 1)\n }\n } else {\n this.#showItem(index)\n\n if (index === this.items.length - 1) {\n this.moreMenu.hidden = true\n }\n\n if (previousItemType === ItemType.Divider) {\n this.#showItem(index - 1)\n }\n }\n }\n\n previousItemType = type\n\n return true\n })\n\n if (this.#focusZoneAbortController) {\n this.#focusZoneAbortController.abort()\n }\n\n this.#focusZoneAbortController = focusZone(this, {\n bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,\n focusOutBehavior: 'wrap',\n focusableElementFilter: element => {\n const idx = this.items.indexOf(element.parentElement!)\n const elementIsVisibleItem = idx > -1 && this.items[idx].style.visibility === 'visible'\n const elementIsVisibleActionMenuInvoker = element === this.moreMenu.invokerElement && !this.moreMenu.hidden\n return elementIsVisibleItem || elementIsVisibleActionMenuInvoker\n },\n })\n }\n\n get #firstItem(): HTMLElement | null {\n let foundItem = null\n\n this.#eachItem((item: HTMLElement, _index: number, type: ItemType): boolean => {\n if (type === ItemType.Item) {\n foundItem = item\n return false\n }\n\n return true\n })\n\n return foundItem\n }\n\n #showItem(index: number) {\n const item = this.items[index]\n const menuItem = this.#menuItems[index]\n if (!item || !menuItem) return\n item.style.setProperty('visibility', 'visible')\n menuItem.hidden = true\n }\n\n #hideItem(index: number) {\n const item = this.items[index]\n const menuItem = this.#menuItems[index]\n if (!item || !menuItem) return\n item.style.setProperty('visibility', 'hidden')\n menuItem.hidden = false\n }\n\n get #menuItems(): NodeListOf {\n return this.moreMenu.querySelectorAll('[role=\"menu\"] > li')\n }\n\n #eachItem(callback: (item: HTMLElement, index: number, type: ItemType) => boolean): void {\n for (let i = 0; i < this.items.length; i++) {\n const item = this.items[i]\n const type = item.classList.contains('ActionBar-divider') ? ItemType.Divider : ItemType.Item\n if (!callback(item, i, type)) {\n break\n }\n }\n }\n}\n\ndeclare global {\n interface Window {\n ActionBarElement: typeof ActionBarElement\n }\n}\n\nwindow.ActionBarElement = ActionBarElement\n","class DetailsMenuElement extends HTMLElement {\n get preload() {\n return this.hasAttribute('preload');\n }\n set preload(value) {\n if (value) {\n this.setAttribute('preload', '');\n }\n else {\n this.removeAttribute('preload');\n }\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(value) {\n this.setAttribute('src', value);\n }\n connectedCallback() {\n if (!this.hasAttribute('role'))\n this.setAttribute('role', 'menu');\n const details = this.parentElement;\n if (!details)\n return;\n const summary = details.querySelector('summary');\n if (summary) {\n summary.setAttribute('aria-haspopup', 'menu');\n if (!summary.hasAttribute('role'))\n summary.setAttribute('role', 'button');\n }\n const subscriptions = [\n fromEvent(details, 'compositionstart', e => trackComposition(this, e)),\n fromEvent(details, 'compositionend', e => trackComposition(this, e)),\n fromEvent(details, 'click', e => shouldCommit(details, e)),\n fromEvent(details, 'change', e => shouldCommit(details, e)),\n fromEvent(details, 'keydown', e => keydown(details, this, e)),\n fromEvent(details, 'toggle', () => loadFragment(details, this), { once: true }),\n fromEvent(details, 'toggle', () => closeCurrentMenu(details)),\n this.preload\n ? fromEvent(details, 'mouseover', () => loadFragment(details, this), { once: true })\n : NullSubscription,\n ...focusOnOpen(details)\n ];\n states.set(this, { subscriptions, loaded: false, isComposing: false });\n }\n disconnectedCallback() {\n const state = states.get(this);\n if (!state)\n return;\n states.delete(this);\n for (const sub of state.subscriptions) {\n sub.unsubscribe();\n }\n }\n}\nconst states = new WeakMap();\nconst NullSubscription = {\n unsubscribe() {\n }\n};\nfunction fromEvent(target, eventName, onNext, options = false) {\n target.addEventListener(eventName, onNext, options);\n return {\n unsubscribe: () => {\n target.removeEventListener(eventName, onNext, options);\n }\n };\n}\nfunction loadFragment(details, menu) {\n const src = menu.getAttribute('src');\n if (!src)\n return;\n const state = states.get(menu);\n if (!state)\n return;\n if (state.loaded)\n return;\n state.loaded = true;\n const loader = menu.querySelector('include-fragment');\n if (loader && !loader.hasAttribute('src')) {\n loader.addEventListener('loadend', () => autofocus(details));\n loader.setAttribute('src', src);\n }\n}\nfunction focusOnOpen(details) {\n let isMouse = false;\n const onmousedown = () => (isMouse = true);\n const onkeydown = () => (isMouse = false);\n const ontoggle = () => {\n if (!details.hasAttribute('open'))\n return;\n if (autofocus(details))\n return;\n if (!isMouse)\n focusFirstItem(details);\n };\n return [\n fromEvent(details, 'mousedown', onmousedown),\n fromEvent(details, 'keydown', onkeydown),\n fromEvent(details, 'toggle', ontoggle)\n ];\n}\nfunction closeCurrentMenu(details) {\n if (!details.hasAttribute('open'))\n return;\n for (const menu of document.querySelectorAll('details[open] > details-menu')) {\n const opened = menu.closest('details');\n if (opened && opened !== details && !opened.contains(details)) {\n opened.removeAttribute('open');\n }\n }\n}\nfunction autofocus(details) {\n if (!details.hasAttribute('open'))\n return false;\n const input = details.querySelector('details-menu [autofocus]');\n if (input) {\n input.focus();\n return true;\n }\n else {\n return false;\n }\n}\nfunction focusFirstItem(details) {\n const selected = document.activeElement;\n if (selected && isMenuItem(selected) && details.contains(selected))\n return;\n const target = sibling(details, true);\n if (target)\n target.focus();\n}\nfunction sibling(details, next) {\n const options = Array.from(details.querySelectorAll('[role^=\"menuitem\"]:not([hidden]):not([disabled])'));\n const selected = document.activeElement;\n const index = selected instanceof HTMLElement ? options.indexOf(selected) : -1;\n const found = next ? options[index + 1] : options[index - 1];\n const def = next ? options[0] : options[options.length - 1];\n return found || def;\n}\nconst ctrlBindings = navigator.userAgent.match(/Macintosh/);\nfunction shouldCommit(details, event) {\n const target = event.target;\n if (!(target instanceof Element))\n return;\n if (target.closest('details') !== details)\n return;\n if (event.type === 'click') {\n const menuitem = target.closest('[role=\"menuitem\"], [role=\"menuitemradio\"]');\n if (!menuitem)\n return;\n const input = menuitem.querySelector('input');\n if (menuitem.tagName === 'LABEL' && target === input)\n return;\n const onlyCommitOnChangeEvent = menuitem.tagName === 'LABEL' && input && !input.checked;\n if (!onlyCommitOnChangeEvent) {\n commit(menuitem, details);\n }\n }\n else if (event.type === 'change') {\n const menuitem = target.closest('[role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]');\n if (menuitem)\n commit(menuitem, details);\n }\n}\nfunction updateChecked(selected, details) {\n for (const el of details.querySelectorAll('[role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]')) {\n const input = el.querySelector('input[type=\"radio\"], input[type=\"checkbox\"]');\n let checkState = (el === selected).toString();\n if (input instanceof HTMLInputElement) {\n checkState = input.indeterminate ? 'mixed' : input.checked.toString();\n }\n el.setAttribute('aria-checked', checkState);\n }\n}\nfunction commit(selected, details) {\n if (selected.hasAttribute('disabled') || selected.getAttribute('aria-disabled') === 'true')\n return;\n const menu = selected.closest('details-menu');\n if (!menu)\n return;\n const dispatched = menu.dispatchEvent(new CustomEvent('details-menu-select', {\n cancelable: true,\n detail: { relatedTarget: selected }\n }));\n if (!dispatched)\n return;\n updateLabel(selected, details);\n updateChecked(selected, details);\n if (selected.getAttribute('role') !== 'menuitemcheckbox')\n close(details);\n menu.dispatchEvent(new CustomEvent('details-menu-selected', {\n detail: { relatedTarget: selected }\n }));\n}\nfunction keydown(details, menu, event) {\n if (!(event instanceof KeyboardEvent))\n return;\n if (details.querySelector('details[open]'))\n return;\n const state = states.get(menu);\n if (!state || state.isComposing)\n return;\n const isSummaryFocused = event.target instanceof Element && event.target.tagName === 'SUMMARY';\n switch (event.key) {\n case 'Escape':\n if (details.hasAttribute('open')) {\n close(details);\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n case 'ArrowDown':\n {\n if (isSummaryFocused && !details.hasAttribute('open')) {\n details.setAttribute('open', '');\n }\n const target = sibling(details, true);\n if (target)\n target.focus();\n event.preventDefault();\n }\n break;\n case 'ArrowUp':\n {\n if (isSummaryFocused && !details.hasAttribute('open')) {\n details.setAttribute('open', '');\n }\n const target = sibling(details, false);\n if (target)\n target.focus();\n event.preventDefault();\n }\n break;\n case 'n':\n {\n if (ctrlBindings && event.ctrlKey) {\n const target = sibling(details, true);\n if (target)\n target.focus();\n event.preventDefault();\n }\n }\n break;\n case 'p':\n {\n if (ctrlBindings && event.ctrlKey) {\n const target = sibling(details, false);\n if (target)\n target.focus();\n event.preventDefault();\n }\n }\n break;\n case ' ':\n case 'Enter':\n {\n const selected = document.activeElement;\n if (selected instanceof HTMLElement && isMenuItem(selected) && selected.closest('details') === details) {\n event.preventDefault();\n event.stopPropagation();\n selected.click();\n }\n }\n break;\n }\n}\nfunction isMenuItem(el) {\n const role = el.getAttribute('role');\n return role === 'menuitem' || role === 'menuitemcheckbox' || role === 'menuitemradio';\n}\nfunction close(details) {\n const wasOpen = details.hasAttribute('open');\n if (!wasOpen)\n return;\n details.removeAttribute('open');\n const summary = details.querySelector('summary');\n if (summary)\n summary.focus();\n}\nfunction updateLabel(item, details) {\n const button = details.querySelector('[data-menu-button]');\n if (!button)\n return;\n const text = labelText(item);\n if (text) {\n button.textContent = text;\n }\n else {\n const html = labelHTML(item);\n if (html)\n button.innerHTML = html;\n }\n}\nfunction labelText(el) {\n if (!el)\n return null;\n const textEl = el.hasAttribute('data-menu-button-text') ? el : el.querySelector('[data-menu-button-text]');\n if (!textEl)\n return null;\n return textEl.getAttribute('data-menu-button-text') || textEl.textContent;\n}\nfunction labelHTML(el) {\n if (!el)\n return null;\n const contentsEl = el.hasAttribute('data-menu-button-contents') ? el : el.querySelector('[data-menu-button-contents]');\n return contentsEl ? contentsEl.innerHTML : null;\n}\nfunction trackComposition(menu, event) {\n const state = states.get(menu);\n if (!state)\n return;\n state.isComposing = event.type === 'compositionstart';\n}\nexport default DetailsMenuElement;\nif (!window.customElements.get('details-menu')) {\n window.DetailsMenuElement = DetailsMenuElement;\n window.customElements.define('details-menu', DetailsMenuElement);\n}\n","import type {AnchorAlignment, AnchorSide, PositionSettings} from '@primer/behaviors'\nimport {getAnchoredPosition} from '@primer/behaviors'\n\nconst updateWhenVisible = (() => {\n const anchors = new Set()\n let intersectionObserver: IntersectionObserver | null = null\n let resizeObserver: ResizeObserver | null = null\n function updateVisibleAnchors() {\n for (const anchor of anchors) {\n anchor.update()\n }\n }\n return (el: AnchoredPositionElement) => {\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('resize', updateVisibleAnchors)\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('scroll', updateVisibleAnchors)\n intersectionObserver ||= new IntersectionObserver(entries => {\n for (const entry of entries) {\n const target = entry.target as AnchoredPositionElement\n if (entry.isIntersecting) {\n target.update()\n anchors.add(target)\n } else {\n anchors.delete(target)\n }\n }\n })\n resizeObserver ||= new ResizeObserver(() => {\n for (const anchor of anchors) {\n anchor.update()\n }\n })\n resizeObserver.observe(el.ownerDocument.documentElement)\n intersectionObserver.observe(el)\n }\n})()\n\nexport default class AnchoredPositionElement extends HTMLElement implements PositionSettings {\n get align(): AnchorAlignment {\n const value = this.getAttribute('align')\n if (value === 'center' || value === 'end') return value\n return 'start'\n }\n\n set align(value: AnchorAlignment) {\n this.setAttribute('align', `${value}`)\n }\n\n get side(): AnchorSide {\n const value = this.getAttribute('side')\n if (\n value === 'inside-top' ||\n value === 'inside-bottom' ||\n value === 'inside-left' ||\n value === 'inside-right' ||\n value === 'inside-center' ||\n value === 'outside-top' ||\n value === 'outside-left' ||\n value === 'outside-right'\n ) {\n return value\n }\n return 'outside-bottom'\n }\n\n set side(value: AnchorSide) {\n this.setAttribute('side', `${value}`)\n }\n\n get anchorOffset(): number {\n const alias = this.getAttribute('anchor-offset')\n if (alias === 'spacious' || alias === '8') return 8\n return 4\n }\n\n set anchorOffset(value: number | 'normal' | 'spacious') {\n this.setAttribute('anchor-offset', `${value}`)\n }\n\n get anchor() {\n return this.getAttribute('anchor') || ''\n }\n\n set anchor(value: string) {\n this.setAttribute('anchor', `${value}`)\n }\n\n #anchorElement: HTMLElement | null = null\n get anchorElement(): HTMLElement | null {\n if (this.#anchorElement) return this.#anchorElement\n const idRef = this.anchor\n if (!idRef) return null\n return this.ownerDocument.getElementById(idRef)\n }\n\n set anchorElement(value: HTMLElement | null) {\n this.#anchorElement = value\n if (!this.#anchorElement) {\n this.removeAttribute('anchor')\n }\n }\n\n get alignmentOffset(): number {\n return Number(this.getAttribute('alignment-offset'))\n }\n\n set alignmentOffset(value: number) {\n this.setAttribute('alignment-offset', `${value}`)\n }\n\n get allowOutOfBounds() {\n return this.hasAttribute('allow-out-of-bounds')\n }\n\n set allowOutOfBounds(value: boolean) {\n this.toggleAttribute('allow-out-of-bounds', value)\n }\n\n connectedCallback() {\n this.update()\n this.addEventListener('beforetoggle', () => this.update())\n updateWhenVisible(this)\n }\n\n static observedAttributes = ['align', 'side', 'anchor', 'alignment-offset', 'allow-out-of-bounds']\n attributeChangedCallback() {\n this.update()\n }\n\n #animationFrame: ReturnType\n update() {\n if (!this.isConnected) return\n cancelAnimationFrame(this.#animationFrame)\n\n this.#animationFrame = requestAnimationFrame(() => {\n const anchor = this.anchorElement\n this.classList.toggle('not-anchored', !anchor)\n if (anchor) {\n const {left, top} = getAnchoredPosition(this, anchor, this)\n this.style.top = `${top}px`\n this.style.left = `${left}px`\n this.style.bottom = 'auto'\n this.style.right = 'auto'\n } else {\n this.style.top = '0'\n this.style.left = '0'\n this.style.bottom = '0'\n this.style.right = '0'\n }\n })\n }\n}\n\nif (!customElements.get('anchored-position')) {\n window.AnchoredPositionElement = AnchoredPositionElement\n customElements.define('anchored-position', AnchoredPositionElement)\n}\n\ndeclare global {\n interface Window {\n AnchoredPositionElement: typeof AnchoredPositionElement\n }\n}\n","function dialogInvokerButtonHandler(event: Event) {\n const target = event.target as HTMLElement\n const button = target?.closest('button')\n\n if (!button || button.hasAttribute('disabled') || button.getAttribute('aria-disabled') === 'true') return\n\n // If the user is clicking a valid dialog trigger\n let dialogId = button?.getAttribute('data-show-dialog-id')\n if (dialogId) {\n const dialog = document.getElementById(dialogId)\n if (dialog instanceof HTMLDialogElement) {\n dialog.showModal()\n // A buttons default behaviour in some browsers it to send a pointer event\n // If the behaviour is allowed through the dialog will be shown but then\n // quickly hidden- as if it were never shown. This prevents that.\n event.preventDefault()\n\n // In some older browsers, such as Chrome 122, when a top layer element (such as a dialog)\n // opens from within a popover, the \"hide all popovers\" internal algorithm runs, hiding\n // any popover that is currently open, regardless of whether or not another top layer element,\n // such as a is nested inside.\n // See https://github.com/whatwg/html/issues/9998.\n // This is fixed by https://github.com/whatwg/html/pull/10116, but while we still support browsers\n // that present this bug, we must undo the work they did to hide ancestral popovers of the dialog:\n let node: HTMLElement | null | undefined = button\n let fixed = false\n while (node) {\n node = node.parentElement?.closest('[popover]:not(:popover-open)')\n if (node && node.popover === 'auto') {\n node.classList.add('dialog-inside-popover-fix')\n node.popover = 'manual'\n node.showPopover()\n fixed = true\n }\n }\n if (fixed) {\n // We need to re-open the dialog as modal, and also ensure no close event listeners\n // are trying to act on the close\n /* eslint-disable-next-line no-restricted-syntax */\n dialog.addEventListener('close', e => e.stopImmediatePropagation(), {once: true})\n dialog.close()\n dialog.showModal()\n dialog.addEventListener(\n 'close',\n () => {\n for (const el of dialog.ownerDocument.querySelectorAll('.dialog-inside-popover-fix')) {\n if (el.contains(dialog)) {\n el.classList.remove('dialog-inside-popover-fix')\n el.popover = 'auto'\n el.showPopover()\n }\n }\n },\n {once: true},\n )\n }\n }\n }\n\n dialogId = button.getAttribute('data-close-dialog-id') || button.getAttribute('data-submit-dialog-id')\n if (dialogId) {\n const dialog = document.getElementById(dialogId)\n if (dialog instanceof HTMLDialogElement && dialog.open) {\n dialog.close()\n }\n }\n}\n\nexport class DialogHelperElement extends HTMLElement {\n get dialog() {\n return this.querySelector('dialog')\n }\n\n #abortController: AbortController | null = null\n connectedCallback() {\n const {signal} = (this.#abortController = new AbortController())\n document.addEventListener('click', dialogInvokerButtonHandler, true)\n document.addEventListener('click', this, {signal})\n this.ownerDocument.body.style.setProperty(\n '--dialog-scrollgutter',\n `${window.innerWidth - this.ownerDocument.body.clientWidth}px`,\n )\n new MutationObserver(records => {\n for (const record of records) {\n if (record.target === this.dialog) {\n this.#handleDialogOpenAttribute()\n }\n }\n }).observe(this, {subtree: true, attributeFilter: ['open']})\n this.#handleDialogOpenAttribute()\n }\n\n disconnectedCallback() {\n this.#abortController?.abort()\n }\n\n #handleDialogOpenAttribute() {\n if (!this.dialog) return\n // We don't want to show the Dialog component as non-modal\n if (this.dialog.matches('[open]:not(:modal)')) {\n // eslint-disable-next-line no-restricted-syntax\n this.dialog.addEventListener('close', e => e.stopImmediatePropagation(), {once: true})\n this.dialog.close()\n this.dialog.showModal()\n }\n }\n\n handleEvent(event: MouseEvent) {\n const target = event.target as HTMLElement\n const dialog = this.dialog\n // The click target _must_ be the dialog element itself, and not elements underneath or inside.\n if (target !== dialog || !dialog?.open) return\n\n const rect = dialog.getBoundingClientRect()\n const clickWasInsideDialog =\n rect.top <= event.clientY &&\n event.clientY <= rect.top + rect.height &&\n rect.left <= event.clientX &&\n event.clientX <= rect.left + rect.width\n\n if (!clickWasInsideDialog) {\n dialog.close()\n }\n }\n}\n\ndeclare global {\n interface Window {\n DialogHelperElement: typeof DialogHelperElement\n }\n interface HTMLElementTagNameMap {\n 'dialog-helper': DialogHelperElement\n }\n}\n\nif (!window.customElements.get('dialog-helper')) {\n window.DialogHelperElement = DialogHelperElement\n window.customElements.define('dialog-helper', DialogHelperElement)\n}\n","// src/events.ts\nvar ToggleEvent = class extends Event {\n oldState;\n newState;\n constructor(type, { oldState = \"\", newState = \"\", ...init } = {}) {\n super(type, init);\n this.oldState = String(oldState || \"\");\n this.newState = String(newState || \"\");\n }\n};\nvar popoverToggleTaskQueue = /* @__PURE__ */ new WeakMap();\nfunction queuePopoverToggleEventTask(element, oldState, newState) {\n popoverToggleTaskQueue.set(\n element,\n setTimeout(() => {\n if (!popoverToggleTaskQueue.has(element)) return;\n element.dispatchEvent(\n new ToggleEvent(\"toggle\", {\n cancelable: false,\n oldState,\n newState\n })\n );\n }, 0)\n );\n}\n\n// src/popover-helpers.ts\nvar ShadowRoot = globalThis.ShadowRoot || function() {\n};\nvar HTMLDialogElement = globalThis.HTMLDialogElement || function() {\n};\nvar topLayerElements = /* @__PURE__ */ new WeakMap();\nvar autoPopoverList = /* @__PURE__ */ new WeakMap();\nvar visibilityState = /* @__PURE__ */ new WeakMap();\nfunction getPopoverVisibilityState(popover) {\n return visibilityState.get(popover) || \"hidden\";\n}\nvar popoverInvoker = /* @__PURE__ */ new WeakMap();\nfunction popoverTargetAttributeActivationBehavior(element) {\n const popover = element.popoverTargetElement;\n if (!(popover instanceof HTMLElement)) {\n return;\n }\n const visibility = getPopoverVisibilityState(popover);\n if (element.popoverTargetAction === \"show\" && visibility === \"showing\") {\n return;\n }\n if (element.popoverTargetAction === \"hide\" && visibility === \"hidden\") return;\n if (visibility === \"showing\") {\n hidePopover(popover, true, true);\n } else if (checkPopoverValidity(popover, false)) {\n popoverInvoker.set(popover, element);\n showPopover(popover);\n }\n}\nfunction checkPopoverValidity(element, expectedToBeShowing) {\n if (element.popover !== \"auto\" && element.popover !== \"manual\") {\n return false;\n }\n if (!element.isConnected) return false;\n if (expectedToBeShowing && getPopoverVisibilityState(element) !== \"showing\") {\n return false;\n }\n if (!expectedToBeShowing && getPopoverVisibilityState(element) !== \"hidden\") {\n return false;\n }\n if (element instanceof HTMLDialogElement && element.hasAttribute(\"open\")) {\n return false;\n }\n if (document.fullscreenElement === element) return false;\n return true;\n}\nfunction getStackPosition(popover) {\n if (!popover) return 0;\n return Array.from(autoPopoverList.get(popover.ownerDocument) || []).indexOf(\n popover\n ) + 1;\n}\nfunction topMostClickedPopover(target) {\n const clickedPopover = nearestInclusiveOpenPopover(target);\n const invokerPopover = nearestInclusiveTargetPopoverForInvoker(target);\n if (getStackPosition(clickedPopover) > getStackPosition(invokerPopover)) {\n return clickedPopover;\n }\n return invokerPopover;\n}\nfunction topMostAutoPopover(document2) {\n const documentPopovers = autoPopoverList.get(document2);\n for (const popover of documentPopovers || []) {\n if (!popover.isConnected) {\n documentPopovers.delete(popover);\n } else {\n return popover;\n }\n }\n return null;\n}\nfunction getRootNode(node) {\n if (typeof node.getRootNode === \"function\") {\n return node.getRootNode();\n }\n if (node.parentNode) return getRootNode(node.parentNode);\n return node;\n}\nfunction nearestInclusiveOpenPopover(node) {\n while (node) {\n if (node instanceof HTMLElement && node.popover === \"auto\" && visibilityState.get(node) === \"showing\") {\n return node;\n }\n node = node instanceof Element && node.assignedSlot || node.parentElement || getRootNode(node);\n if (node instanceof ShadowRoot) node = node.host;\n if (node instanceof Document) return;\n }\n}\nfunction nearestInclusiveTargetPopoverForInvoker(node) {\n while (node) {\n const nodePopover = node.popoverTargetElement;\n if (nodePopover instanceof HTMLElement) return nodePopover;\n node = node.parentElement || getRootNode(node);\n if (node instanceof ShadowRoot) node = node.host;\n if (node instanceof Document) return;\n }\n}\nfunction topMostPopoverAncestor(newPopover) {\n const popoverPositions = /* @__PURE__ */ new Map();\n let i = 0;\n for (const popover of autoPopoverList.get(newPopover.ownerDocument) || []) {\n popoverPositions.set(popover, i);\n i += 1;\n }\n popoverPositions.set(newPopover, i);\n i += 1;\n let topMostPopoverAncestor2 = null;\n function checkAncestor(candidate) {\n const candidateAncestor = nearestInclusiveOpenPopover(candidate);\n if (candidateAncestor === null) return null;\n const candidatePosition = popoverPositions.get(candidateAncestor);\n if (topMostPopoverAncestor2 === null || popoverPositions.get(topMostPopoverAncestor2) < candidatePosition) {\n topMostPopoverAncestor2 = candidateAncestor;\n }\n }\n checkAncestor(newPopover.parentElement || getRootNode(newPopover));\n return topMostPopoverAncestor2;\n}\nfunction isFocusable(focusTarget) {\n if (focusTarget.hidden || focusTarget instanceof ShadowRoot) return false;\n if (focusTarget instanceof HTMLButtonElement || focusTarget instanceof HTMLInputElement || focusTarget instanceof HTMLSelectElement || focusTarget instanceof HTMLTextAreaElement || focusTarget instanceof HTMLOptGroupElement || focusTarget instanceof HTMLOptionElement || focusTarget instanceof HTMLFieldSetElement) {\n if (focusTarget.disabled) return false;\n }\n if (focusTarget instanceof HTMLInputElement && focusTarget.type === \"hidden\") {\n return false;\n }\n if (focusTarget instanceof HTMLAnchorElement && focusTarget.href === \"\") {\n return false;\n }\n return typeof focusTarget.tabIndex === \"number\" && focusTarget.tabIndex !== -1;\n}\nfunction focusDelegate(focusTarget) {\n if (focusTarget.shadowRoot && focusTarget.shadowRoot.delegatesFocus !== true) {\n return null;\n }\n let whereToLook = focusTarget;\n if (whereToLook.shadowRoot) {\n whereToLook = whereToLook.shadowRoot;\n }\n let autoFocusDelegate = whereToLook.querySelector(\"[autofocus]\");\n if (autoFocusDelegate) {\n return autoFocusDelegate;\n } else {\n const slots = whereToLook.querySelectorAll(\"slot\");\n for (const slot of slots) {\n const assignedElements = slot.assignedElements({ flatten: true });\n for (const el of assignedElements) {\n if (el.hasAttribute(\"autofocus\")) {\n return el;\n } else {\n autoFocusDelegate = el.querySelector(\"[autofocus]\");\n if (autoFocusDelegate) {\n return autoFocusDelegate;\n }\n }\n }\n }\n }\n const walker = focusTarget.ownerDocument.createTreeWalker(\n whereToLook,\n NodeFilter.SHOW_ELEMENT\n );\n let descendant = walker.currentNode;\n while (descendant) {\n if (isFocusable(descendant)) {\n return descendant;\n }\n descendant = walker.nextNode();\n }\n}\nfunction popoverFocusingSteps(subject) {\n focusDelegate(subject)?.focus();\n}\nvar previouslyFocusedElements = /* @__PURE__ */ new WeakMap();\nfunction showPopover(element) {\n if (!checkPopoverValidity(element, false)) {\n return;\n }\n const document2 = element.ownerDocument;\n if (!element.dispatchEvent(\n new ToggleEvent(\"beforetoggle\", {\n cancelable: true,\n oldState: \"closed\",\n newState: \"open\"\n })\n )) {\n return;\n }\n if (!checkPopoverValidity(element, false)) {\n return;\n }\n let shouldRestoreFocus = false;\n if (element.popover === \"auto\") {\n const originalType = element.getAttribute(\"popover\");\n const ancestor = topMostPopoverAncestor(element) || document2;\n hideAllPopoversUntil(ancestor, false, true);\n if (originalType !== element.getAttribute(\"popover\") || !checkPopoverValidity(element, false)) {\n return;\n }\n }\n if (!topMostAutoPopover(document2)) {\n shouldRestoreFocus = true;\n }\n previouslyFocusedElements.delete(element);\n const originallyFocusedElement = document2.activeElement;\n element.classList.add(\":popover-open\");\n visibilityState.set(element, \"showing\");\n if (!topLayerElements.has(document2)) {\n topLayerElements.set(document2, /* @__PURE__ */ new Set());\n }\n topLayerElements.get(document2).add(element);\n popoverFocusingSteps(element);\n if (element.popover === \"auto\") {\n if (!autoPopoverList.has(document2)) {\n autoPopoverList.set(document2, /* @__PURE__ */ new Set());\n }\n autoPopoverList.get(document2).add(element);\n setInvokerAriaExpanded(popoverInvoker.get(element), true);\n }\n if (shouldRestoreFocus && originallyFocusedElement && element.popover === \"auto\") {\n previouslyFocusedElements.set(element, originallyFocusedElement);\n }\n queuePopoverToggleEventTask(element, \"closed\", \"open\");\n}\nfunction hidePopover(element, focusPreviousElement = false, fireEvents = false) {\n if (!checkPopoverValidity(element, true)) {\n return;\n }\n const document2 = element.ownerDocument;\n if (element.popover === \"auto\") {\n hideAllPopoversUntil(element, focusPreviousElement, fireEvents);\n if (!checkPopoverValidity(element, true)) {\n return;\n }\n }\n setInvokerAriaExpanded(popoverInvoker.get(element), false);\n popoverInvoker.delete(element);\n if (fireEvents) {\n element.dispatchEvent(\n new ToggleEvent(\"beforetoggle\", {\n oldState: \"open\",\n newState: \"closed\"\n })\n );\n if (!checkPopoverValidity(element, true)) {\n return;\n }\n }\n topLayerElements.get(document2)?.delete(element);\n autoPopoverList.get(document2)?.delete(element);\n element.classList.remove(\":popover-open\");\n visibilityState.set(element, \"hidden\");\n if (fireEvents) {\n queuePopoverToggleEventTask(element, \"open\", \"closed\");\n }\n const previouslyFocusedElement = previouslyFocusedElements.get(element);\n if (previouslyFocusedElement) {\n previouslyFocusedElements.delete(element);\n if (focusPreviousElement) {\n previouslyFocusedElement.focus();\n }\n }\n}\nfunction closeAllOpenPopovers(document2, focusPreviousElement = false, fireEvents = false) {\n let popover = topMostAutoPopover(document2);\n while (popover) {\n hidePopover(popover, focusPreviousElement, fireEvents);\n popover = topMostAutoPopover(document2);\n }\n}\nfunction hideAllPopoversUntil(endpoint, focusPreviousElement, fireEvents) {\n const document2 = endpoint.ownerDocument || endpoint;\n if (endpoint instanceof Document) {\n return closeAllOpenPopovers(document2, focusPreviousElement, fireEvents);\n }\n let lastToHide = null;\n let foundEndpoint = false;\n for (const popover of autoPopoverList.get(document2) || []) {\n if (popover === endpoint) {\n foundEndpoint = true;\n } else if (foundEndpoint) {\n lastToHide = popover;\n break;\n }\n }\n if (!foundEndpoint) {\n return closeAllOpenPopovers(document2, focusPreviousElement, fireEvents);\n }\n while (lastToHide && getPopoverVisibilityState(lastToHide) === \"showing\" && autoPopoverList.get(document2)?.size) {\n hidePopover(lastToHide, focusPreviousElement, fireEvents);\n }\n}\nvar popoverPointerDownTargets = /* @__PURE__ */ new WeakMap();\nfunction lightDismissOpenPopovers(event) {\n if (!event.isTrusted) return;\n const target = event.composedPath()[0];\n if (!target) return;\n const document2 = target.ownerDocument;\n const topMostPopover = topMostAutoPopover(document2);\n if (!topMostPopover) return;\n const ancestor = topMostClickedPopover(target);\n if (ancestor && event.type === \"pointerdown\") {\n popoverPointerDownTargets.set(document2, ancestor);\n } else if (event.type === \"pointerup\") {\n const sameTarget = popoverPointerDownTargets.get(document2) === ancestor;\n popoverPointerDownTargets.delete(document2);\n if (sameTarget) {\n hideAllPopoversUntil(ancestor || document2, false, true);\n }\n }\n}\nvar initialAriaExpandedValue = /* @__PURE__ */ new WeakMap();\nfunction setInvokerAriaExpanded(el, force = false) {\n if (!el) return;\n if (!initialAriaExpandedValue.has(el)) {\n initialAriaExpandedValue.set(el, el.getAttribute(\"aria-expanded\"));\n }\n const popover = el.popoverTargetElement;\n if (popover instanceof HTMLElement && popover.popover === \"auto\") {\n el.setAttribute(\"aria-expanded\", String(force));\n } else {\n const initialValue = initialAriaExpandedValue.get(el);\n if (!initialValue) {\n el.removeAttribute(\"aria-expanded\");\n } else {\n el.setAttribute(\"aria-expanded\", initialValue);\n }\n }\n}\n\n// src/popover.ts\nvar ShadowRoot2 = globalThis.ShadowRoot || function() {\n};\nfunction isSupported() {\n return typeof HTMLElement !== \"undefined\" && typeof HTMLElement.prototype === \"object\" && \"popover\" in HTMLElement.prototype;\n}\nfunction patchSelectorFn(object, name, mapper) {\n const original = object[name];\n Object.defineProperty(object, name, {\n value(selector) {\n return original.call(this, mapper(selector));\n }\n });\n}\nvar nonEscapedPopoverSelector = /(^|[^\\\\]):popover-open\\b/g;\nfunction hasLayerSupport() {\n return typeof globalThis.CSSLayerBlockRule === \"function\";\n}\nfunction getStyles() {\n const useLayer = hasLayerSupport();\n return `\n${useLayer ? \"@layer popover-polyfill {\" : \"\"}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where([popover]:not(.\\\\:popover-open)) {\n display: none;\n }\n\n :where(dialog[popover].\\\\:popover-open) {\n display: block;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n${useLayer ? \"}\" : \"\"}\n`;\n}\nvar popoverStyleSheet = null;\nfunction injectStyles(root) {\n const styles = getStyles();\n if (popoverStyleSheet === null) {\n try {\n popoverStyleSheet = new CSSStyleSheet();\n popoverStyleSheet.replaceSync(styles);\n } catch {\n popoverStyleSheet = false;\n }\n }\n if (popoverStyleSheet === false) {\n const sheet = document.createElement(\"style\");\n sheet.textContent = styles;\n if (root instanceof Document) {\n root.head.prepend(sheet);\n } else {\n root.prepend(sheet);\n }\n } else {\n root.adoptedStyleSheets = [popoverStyleSheet, ...root.adoptedStyleSheets];\n }\n}\nfunction apply() {\n if (typeof window === \"undefined\") return;\n window.ToggleEvent = window.ToggleEvent || ToggleEvent;\n function rewriteSelector(selector) {\n if (selector?.includes(\":popover-open\")) {\n selector = selector.replace(\n nonEscapedPopoverSelector,\n \"$1.\\\\:popover-open\"\n );\n }\n return selector;\n }\n patchSelectorFn(Document.prototype, \"querySelector\", rewriteSelector);\n patchSelectorFn(Document.prototype, \"querySelectorAll\", rewriteSelector);\n patchSelectorFn(Element.prototype, \"querySelector\", rewriteSelector);\n patchSelectorFn(Element.prototype, \"querySelectorAll\", rewriteSelector);\n patchSelectorFn(Element.prototype, \"matches\", rewriteSelector);\n patchSelectorFn(Element.prototype, \"closest\", rewriteSelector);\n patchSelectorFn(\n DocumentFragment.prototype,\n \"querySelectorAll\",\n rewriteSelector\n );\n Object.defineProperties(HTMLElement.prototype, {\n popover: {\n enumerable: true,\n configurable: true,\n get() {\n if (!this.hasAttribute(\"popover\")) return null;\n const value = (this.getAttribute(\"popover\") || \"\").toLowerCase();\n if (value === \"\" || value == \"auto\") return \"auto\";\n return \"manual\";\n },\n set(value) {\n this.setAttribute(\"popover\", value);\n }\n },\n showPopover: {\n enumerable: true,\n configurable: true,\n value() {\n showPopover(this);\n }\n },\n hidePopover: {\n enumerable: true,\n configurable: true,\n value() {\n hidePopover(this, true, true);\n }\n },\n togglePopover: {\n enumerable: true,\n configurable: true,\n value(force) {\n if (visibilityState.get(this) === \"showing\" && force === void 0 || force === false) {\n hidePopover(this, true, true);\n } else if (force === void 0 || force === true) {\n showPopover(this);\n }\n }\n }\n });\n const originalAttachShadow = Element.prototype.attachShadow;\n if (originalAttachShadow) {\n Object.defineProperties(Element.prototype, {\n attachShadow: {\n enumerable: true,\n configurable: true,\n writable: true,\n value(options) {\n const shadowRoot = originalAttachShadow.call(this, options);\n injectStyles(shadowRoot);\n return shadowRoot;\n }\n }\n });\n }\n const originalAttachInternals = HTMLElement.prototype.attachInternals;\n if (originalAttachInternals) {\n Object.defineProperties(HTMLElement.prototype, {\n attachInternals: {\n enumerable: true,\n configurable: true,\n writable: true,\n value() {\n const internals = originalAttachInternals.call(this);\n if (internals.shadowRoot) {\n injectStyles(internals.shadowRoot);\n }\n return internals;\n }\n }\n });\n }\n const popoverTargetAssociatedElements = /* @__PURE__ */ new WeakMap();\n function applyPopoverInvokerElementMixin(ElementClass) {\n Object.defineProperties(ElementClass.prototype, {\n popoverTargetElement: {\n enumerable: true,\n configurable: true,\n set(targetElement) {\n if (targetElement === null) {\n this.removeAttribute(\"popovertarget\");\n popoverTargetAssociatedElements.delete(this);\n } else if (!(targetElement instanceof Element)) {\n throw new TypeError(\n `popoverTargetElement must be an element or null`\n );\n } else {\n this.setAttribute(\"popovertarget\", \"\");\n popoverTargetAssociatedElements.set(this, targetElement);\n }\n },\n get() {\n if (this.localName !== \"button\" && this.localName !== \"input\") {\n return null;\n }\n if (this.localName === \"input\" && this.type !== \"reset\" && this.type !== \"image\" && this.type !== \"button\") {\n return null;\n }\n if (this.disabled) {\n return null;\n }\n if (this.form && this.type === \"submit\") {\n return null;\n }\n const targetElement = popoverTargetAssociatedElements.get(this);\n if (targetElement && targetElement.isConnected) {\n return targetElement;\n } else if (targetElement && !targetElement.isConnected) {\n popoverTargetAssociatedElements.delete(this);\n return null;\n }\n const root = getRootNode(this);\n const idref = this.getAttribute(\"popovertarget\");\n if ((root instanceof Document || root instanceof ShadowRoot2) && idref) {\n return root.getElementById(idref) || null;\n }\n return null;\n }\n },\n popoverTargetAction: {\n enumerable: true,\n configurable: true,\n get() {\n const value = (this.getAttribute(\"popovertargetaction\") || \"\").toLowerCase();\n if (value === \"show\" || value === \"hide\") return value;\n return \"toggle\";\n },\n set(value) {\n this.setAttribute(\"popovertargetaction\", value);\n }\n }\n });\n }\n applyPopoverInvokerElementMixin(HTMLButtonElement);\n applyPopoverInvokerElementMixin(HTMLInputElement);\n const handleInvokerActivation = (event) => {\n const composedPath = event.composedPath();\n const target = composedPath[0];\n if (!(target instanceof Element) || target?.shadowRoot) {\n return;\n }\n const root = getRootNode(target);\n if (!(root instanceof ShadowRoot2 || root instanceof Document)) {\n return;\n }\n const invoker = composedPath.find(\n (el) => el.matches?.(\"[popovertargetaction],[popovertarget]\")\n );\n if (invoker) {\n popoverTargetAttributeActivationBehavior(invoker);\n event.preventDefault();\n return;\n }\n };\n const onKeydown = (event) => {\n const key = event.key;\n const target = event.target;\n if (!event.defaultPrevented && target && (key === \"Escape\" || key === \"Esc\")) {\n hideAllPopoversUntil(target.ownerDocument, true, true);\n }\n };\n const addEventListeners = (root) => {\n root.addEventListener(\"click\", handleInvokerActivation);\n root.addEventListener(\"keydown\", onKeydown);\n root.addEventListener(\"pointerdown\", lightDismissOpenPopovers);\n root.addEventListener(\"pointerup\", lightDismissOpenPopovers);\n };\n addEventListeners(document);\n injectStyles(document);\n}\n\n// src/index.ts\nif (!isSupported()) apply();\n//# sourceMappingURL=popover.js.map\n","import '@oddbird/popover-polyfill'\n\nconst validSelectors = ['[role=\"menuitem\"]', '[role=\"menuitemcheckbox\"]', '[role=\"menuitemradio\"]', '[role=\"option\"]']\nconst menuItemSelector = validSelectors.map(selector => `:not([hidden]) > ${selector}`).join(', ')\n\nconst getMnemonicFor = (item: Element) => item.textContent?.trim()[0].toLowerCase()\n\nconst printable = /^\\S$/\n\nexport default class FocusGroupElement extends HTMLElement {\n #retainSignal: AbortController | null = null\n\n get nowrap(): boolean {\n return this.hasAttribute('nowrap')\n }\n\n set nowrap(value: boolean) {\n this.toggleAttribute('nowrap', value)\n }\n\n get direction(): 'horizontal' | 'vertical' | 'both' {\n if (this.getAttribute('direction') === 'horizontal') return 'horizontal'\n return 'vertical'\n }\n\n set direction(value: 'horizontal' | 'vertical' | 'both') {\n this.setAttribute('direction', `${value}`)\n }\n\n get retain() {\n return this.hasAttribute('retain')\n }\n\n set retain(value: boolean) {\n this.toggleAttribute('retain', value)\n }\n\n get mnemonics() {\n return this.hasAttribute('mnemonics')\n }\n\n #abortController: AbortController | null = null\n connectedCallback() {\n this.#abortController = new AbortController()\n const {signal} = this.#abortController\n\n this.addEventListener('keydown', this, {signal})\n this.addEventListener('click', this, {signal})\n this.addEventListener('mouseover', this, {signal})\n this.addEventListener('focusin', this, {signal})\n }\n\n disconnectedCallback() {\n this.#abortController?.abort()\n }\n\n get #items() {\n return this.querySelectorAll(menuItemSelector)\n }\n\n handleEvent(event: Event) {\n const {direction, nowrap} = this\n if (event.type === 'focusin') {\n if (this.retain && event.target instanceof Element && event.target.matches(menuItemSelector)) {\n this.#retainSignal?.abort()\n const {signal} = (this.#retainSignal = new AbortController())\n for (const item of this.#items) {\n item.setAttribute('tabindex', item === event.target ? '0' : '-1')\n const popover = event.target.closest('[popover]')\n if (item === event.target && popover?.popover === 'auto' && popover.closest('focus-group') === this) {\n popover.addEventListener(\n 'toggle',\n (toggleEvent: Event) => {\n if (!(toggleEvent.target instanceof Element)) return\n if ((toggleEvent as ToggleEvent).newState === 'closed') {\n this.#retainSignal?.abort()\n item.setAttribute('tabindex', '-1')\n if (popover.id) {\n const invoker = this.querySelector(`[popovertarget=\"${popover.id}\"]`)\n if (invoker) {\n invoker.setAttribute('tabindex', '0')\n } else {\n this.#items[0]?.setAttribute('tabindex', '0')\n }\n }\n }\n },\n {signal},\n )\n }\n }\n }\n } else if (event instanceof KeyboardEvent) {\n const items = Array.from(this.#items)\n let index = items.indexOf(event.target as Element)\n const key = event.key\n if (key === 'Up' || key === 'ArrowUp') {\n if (direction === 'vertical' || direction === 'both') {\n index -= index < 0 ? 0 : 1\n event.preventDefault()\n }\n } else if (key === 'Down' || key === 'ArrowDown') {\n if (direction === 'vertical' || direction === 'both') {\n index += 1\n event.preventDefault()\n }\n } else if (event.key === 'Left' || event.key === 'ArrowLeft') {\n if (direction === 'horizontal' || direction === 'both') {\n index -= 1\n event.preventDefault()\n }\n } else if (event.key === 'Right' || event.key === 'ArrowRight') {\n if (direction === 'horizontal' || direction === 'both') {\n index += 1\n event.preventDefault()\n }\n } else if (event.key === 'Home' || event.key === 'PageUp') {\n index = 0\n event.preventDefault()\n } else if (event.key === 'End' || event.key === 'PageDown') {\n index = items.length - 1\n event.preventDefault()\n } else if (this.mnemonics && printable.test(key)) {\n const mnemonic = key.toLowerCase()\n const offset = index > 0 && getMnemonicFor(event.target as Element) === mnemonic ? index : 0\n index = items.findIndex((item, i) => i > offset && getMnemonicFor(item) === mnemonic)\n if (index < 0 && !nowrap) {\n index = items.findIndex(item => getMnemonicFor(item) === mnemonic)\n }\n } else {\n return\n }\n if (nowrap && index < 0) index = 0\n if (!nowrap && index >= items.length) index = 0\n const focusEl = items.at(Math.min(index, items.length - 1)) as HTMLElement\n {\n let el: HTMLElement | null = focusEl\n do {\n el = el.closest(`[popover]:not(:popover-open)`)\n if (el?.popover === 'auto' && !['ArrowRight', 'ArrowLeft'].includes(event.key)) {\n el.showPopover()\n }\n el = el?.parentElement || null\n } while (el)\n }\n focusEl?.focus()\n }\n }\n}\n\nif (!customElements.get('focus-group')) {\n window.FocusGroupElement = FocusGroupElement\n customElements.define('focus-group', FocusGroupElement)\n}\n\ndeclare global {\n interface Window {\n FocusGroupElement: typeof FocusGroupElement\n }\n}\n","import {controller, attr} from '@github/catalyst'\n\n@controller\nexport class ScrollableRegionElement extends HTMLElement {\n @attr hasOverflow = false\n @attr labelledBy = ''\n\n observer: ResizeObserver\n\n connectedCallback() {\n this.style.overflow = 'auto'\n\n this.observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n this.hasOverflow =\n entry.target.scrollHeight > entry.target.clientHeight || entry.target.scrollWidth > entry.target.clientWidth\n }\n })\n\n this.observer.observe(this)\n }\n\n disconnectedCallback() {\n this.observer.disconnect()\n }\n\n attributeChangedCallback(name: string) {\n if (name === 'data-has-overflow') {\n if (this.hasOverflow) {\n this.setAttribute('aria-labelledby', this.labelledBy)\n this.setAttribute('role', 'region')\n this.setAttribute('tabindex', '0')\n } else {\n this.removeAttribute('aria-labelledby')\n this.removeAttribute('role')\n this.removeAttribute('tabindex')\n }\n }\n }\n}\n\ndeclare global {\n interface Window {\n ScrollableRegionElement: typeof ScrollableRegionElement\n }\n}\n\nwindow.ScrollableRegionElement = ScrollableRegionElement\n","import {focusTrap} from '@primer/behaviors'\nimport {getFocusableChild} from '@primer/behaviors/utils'\n\nfunction focusIfNeeded(elem: HTMLElement | undefined | null) {\n if (document.activeElement !== elem) {\n elem?.focus()\n }\n}\n\nconst overlayStack: ModalDialogElement[] = []\n\nfunction clickHandler(event: Event) {\n const target = event.target as HTMLElement\n const button = target?.closest('button')\n\n if (!button || button.hasAttribute('disabled') || button.getAttribute('aria-disabled') === 'true') return\n\n // If the user is clicking a valid dialog trigger\n let dialogId = button?.getAttribute('data-show-dialog-id')\n if (dialogId) {\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n const dialog = document.getElementById(dialogId)\n if (dialog instanceof ModalDialogElement) {\n dialog.openButton = button\n dialog.show()\n // A buttons default behaviour in some browsers it to send a pointer event\n // If the behaviour is allowed through the dialog will be shown but then\n // quickly hidden- as if it were never shown. This prevents that.\n event.preventDefault()\n return\n }\n }\n\n if (!overlayStack.length) return\n\n dialogId = button.getAttribute('data-close-dialog-id') || button.getAttribute('data-submit-dialog-id')\n if (dialogId) {\n const dialog = document.getElementById(dialogId)\n if (dialog instanceof ModalDialogElement) {\n const dialogIndex = overlayStack.findIndex(ele => ele.id === dialogId)\n overlayStack.splice(dialogIndex, 1)\n dialog.close(button.hasAttribute('data-submit-dialog-id'))\n }\n }\n}\n\nfunction keydownHandler(event: Event) {\n if (\n !(event instanceof KeyboardEvent) ||\n event.type !== 'keydown' ||\n event.key !== 'Enter' ||\n event.ctrlKey ||\n event.altKey ||\n event.metaKey ||\n event.shiftKey\n )\n return\n\n clickHandler(event)\n}\n\nfunction mousedownHandler(event: Event) {\n const target = event.target as HTMLElement\n if (target?.closest('button')) return\n\n // Find the top level dialog that is open.\n const topLevelDialog = overlayStack[overlayStack.length - 1]\n if (!topLevelDialog) return\n\n // Check if the mousedown happened outside the boundary of the top level dialog\n const mouseDownOutsideDialog = !target.closest(`#${topLevelDialog.getAttribute('id')}`)\n\n // Only close dialog if it's a click outside the dialog and the dialog has a button?\n if (mouseDownOutsideDialog) {\n target.ownerDocument.addEventListener(\n 'mouseup',\n (upEvent: Event) => {\n if (upEvent.target === target) {\n overlayStack.pop()\n topLevelDialog.close()\n }\n },\n {once: true},\n )\n }\n}\n\nexport class ModalDialogElement extends HTMLElement {\n //TODO: Do we remove the abortController from focusTrap?\n #focusAbortController = new AbortController()\n openButton: HTMLButtonElement | null\n\n get open() {\n return this.hasAttribute('open')\n }\n set open(value: boolean) {\n if (value) {\n if (this.open) return\n this.setAttribute('open', '')\n this.setAttribute('aria-disabled', 'false')\n document.body.style.paddingRight = `${window.innerWidth - document.body.clientWidth}px`\n document.body.style.overflow = 'hidden'\n this.#overlayBackdrop?.classList.remove('Overlay--hidden')\n if (this.#focusAbortController.signal.aborted) {\n this.#focusAbortController = new AbortController()\n }\n focusTrap(this, this.querySelector('[autofocus]') as HTMLElement, this.#focusAbortController.signal)\n overlayStack.push(this)\n } else {\n if (!this.open) return\n this.removeAttribute('open')\n this.setAttribute('aria-disabled', 'true')\n this.#overlayBackdrop?.classList.add('Overlay--hidden')\n document.body.style.paddingRight = '0'\n document.body.style.overflow = 'initial'\n this.#focusAbortController.abort()\n // if #openButton is a child of a menu, we need to focus a suitable child of the menu\n // element since it is expected for the menu to close on click\n const menu = this.openButton?.closest('details') || this.openButton?.closest('action-menu')\n if (menu) {\n focusIfNeeded(getFocusableChild(menu))\n } else {\n focusIfNeeded(this.openButton)\n }\n this.openButton = null\n }\n }\n\n get #overlayBackdrop(): HTMLElement | null {\n if (this.parentElement?.hasAttribute('data-modal-dialog-overlay')) {\n return this.parentElement\n }\n\n return null\n }\n\n get showButtons(): NodeList {\n // Dialogs may also be opened from any arbitrary button with a matching show-dialog-id data attribute\n return document.querySelectorAll(`button[data-show-dialog-id='${this.id}']`)\n }\n\n connectedCallback(): void {\n if (!this.hasAttribute('role')) this.setAttribute('role', 'dialog')\n\n document.addEventListener('click', clickHandler)\n document.addEventListener('keydown', keydownHandler)\n document.addEventListener('mousedown', mousedownHandler)\n\n this.addEventListener('keydown', e => this.#keydown(e))\n }\n\n show() {\n this.open = true\n }\n\n close(closedNotCancelled = false) {\n if (this.open === false) return\n const eventType = closedNotCancelled ? 'close' : 'cancel'\n const dialogEvent = new Event(eventType)\n this.dispatchEvent(dialogEvent)\n this.open = false\n }\n\n #keydown(event: Event) {\n if (!(event instanceof KeyboardEvent)) return\n if (event.isComposing) return\n if (!this.open) return\n\n switch (event.key) {\n case 'Escape':\n this.close()\n event.preventDefault()\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n break\n case 'Enter': {\n const target = event.target as HTMLElement\n\n if (target.getAttribute('data-close-dialog-id') === this.id) {\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n }\n break\n }\n }\n }\n}\n\ndeclare global {\n interface Window {\n ModalDialogElement: typeof ModalDialogElement\n }\n interface HTMLElementTagNameMap {\n 'modal-dialog': ModalDialogElement\n }\n}\n\nif (!window.customElements.get('modal-dialog')) {\n window.ModalDialogElement = ModalDialogElement\n window.customElements.define('modal-dialog', ModalDialogElement)\n}\n","/* eslint-disable custom-elements/expose-class-on-global */\nimport {controller, target, targets} from '@github/catalyst'\nimport {ActionListTruncationObserver} from '../alpha/action_list'\n\n@controller\nexport class NavListElement extends HTMLElement {\n @targets items: HTMLElement[]\n @target topLevelList: HTMLElement\n\n #truncationObserver: ActionListTruncationObserver\n\n connectedCallback() {\n // groups are wrapped in , which handles resizing on its own\n if (this.topLevelList) {\n this.#truncationObserver = new ActionListTruncationObserver(this.topLevelList)\n }\n }\n\n disconnectedCallback() {\n if (this.topLevelList) {\n this.#truncationObserver.unobserve(this.topLevelList)\n }\n }\n\n selectItemById(itemId: string | null): boolean {\n if (!itemId) return false\n\n const selectedItem = this.#findSelectedNavItemById(itemId)\n\n if (selectedItem) {\n this.#select(selectedItem)\n return true\n }\n\n return false\n }\n\n selectItemByHref(href: string | null): boolean {\n if (!href) return false\n\n const selectedItem = this.#findSelectedNavItemByHref(href)\n\n if (selectedItem) {\n this.#select(selectedItem)\n return true\n }\n\n return false\n }\n\n selectItemByCurrentLocation(): boolean {\n const selectedItem = this.#findSelectedNavItemByCurrentLocation()\n\n if (selectedItem) {\n this.#select(selectedItem)\n return true\n }\n\n return false\n }\n\n // expand collapsible item onClick\n expandItem(item: HTMLElement) {\n item.nextElementSibling?.removeAttribute('data-hidden')\n item.setAttribute('aria-expanded', 'true')\n }\n\n collapseItem(item: HTMLElement) {\n item.nextElementSibling?.setAttribute('data-hidden', '')\n item.setAttribute('aria-expanded', 'false')\n item.focus()\n }\n\n itemIsExpanded(item: HTMLElement | null) {\n if (item?.tagName === 'A') {\n return true\n }\n return item?.getAttribute('aria-expanded') === 'true'\n }\n\n // expand/collapse item\n handleItemWithSubItemClick(e: Event) {\n const el = e.target\n if (!(el instanceof HTMLElement)) return\n\n const button = el.closest('button')\n if (!button) return\n if (this.itemIsExpanded(button)) {\n this.collapseItem(button)\n } else {\n this.expandItem(button)\n }\n\n /* eslint-disable-next-line no-restricted-syntax */\n e.stopPropagation()\n }\n\n // collapse item\n handleItemWithSubItemKeydown(e: KeyboardEvent) {\n const el = e.currentTarget\n if (!(el instanceof HTMLElement)) return\n\n let button = el.closest('button')\n if (!button) {\n const button_id = el.getAttribute('aria-labelledby')\n if (button_id) {\n button = document.getElementById(button_id) as HTMLButtonElement\n } else {\n return\n }\n }\n\n if (this.itemIsExpanded(button) && e.key === 'Escape') {\n this.collapseItem(button)\n }\n\n /* eslint-disable-next-line no-restricted-syntax */\n e.stopPropagation()\n }\n\n #findSelectedNavItemById(itemId: string): HTMLElement | null {\n // First we compare the selected link to data-item-id for each nav item\n for (const navItem of this.items) {\n if (navItem.classList.contains('ActionListItem--hasSubItem')) {\n continue\n }\n\n const keys = navItem.getAttribute('data-item-id')?.split(' ') || []\n\n if (keys.includes(itemId)) {\n return navItem\n }\n }\n\n return null\n }\n\n #findSelectedNavItemByHref(href: string): HTMLElement | null {\n // If we didn't find a match, we compare the selected link to the href of each nav item\n const selectedNavItem = this.querySelector(`.ActionListContent[href=\"${href}\"]`)\n if (selectedNavItem) {\n return selectedNavItem.closest('.ActionListItem')\n }\n\n return null\n }\n\n #findSelectedNavItemByCurrentLocation(): HTMLElement | null {\n return this.#findSelectedNavItemByHref(window.location.pathname)\n }\n\n #select(navItem: HTMLElement) {\n const currentlySelectedItem = this.querySelector('.ActionListItem--navActive') as HTMLElement\n if (currentlySelectedItem) this.#deselect(currentlySelectedItem)\n\n navItem.classList.add('ActionListItem--navActive')\n\n if (navItem.children.length > 0) {\n navItem.children[0].setAttribute('aria-current', 'page')\n }\n\n const parentMenu = this.#findParentMenu(navItem)\n\n if (parentMenu) {\n this.expandItem(parentMenu)\n parentMenu.classList.add('ActionListContent--hasActiveSubItem')\n }\n }\n\n #deselect(navItem: HTMLElement) {\n navItem.classList.remove('ActionListItem--navActive')\n\n if (navItem.children.length > 0) {\n navItem.children[0].removeAttribute('aria-current')\n }\n\n const parentMenu = this.#findParentMenu(navItem)\n\n if (parentMenu) {\n this.collapseItem(parentMenu)\n parentMenu.classList.remove('ActionListContent--hasActiveSubItem')\n }\n }\n\n #findParentMenu(navItem: HTMLElement): HTMLElement | null {\n if (!navItem.classList.contains('ActionListItem--subItem')) return null\n\n const parent = navItem.closest('li.ActionListItem--hasSubItem')?.querySelector('button.ActionListContent')\n\n if (parent) {\n return parent as HTMLElement\n } else {\n return null\n }\n }\n}\n\ndeclare global {\n interface Window {\n NavListElement: typeof NavListElement\n }\n}\n","import {controller, target, targets} from '@github/catalyst'\nimport {ActionListTruncationObserver} from '../alpha/action_list'\n\n@controller\nexport class NavListGroupElement extends HTMLElement {\n @target showMoreItem: HTMLElement\n @targets focusMarkers: HTMLElement[]\n\n connectedCallback(): void {\n this.setShowMoreItemState()\n }\n\n get showMoreDisabled(): boolean {\n return this.showMoreItem.hasAttribute('aria-disabled')\n }\n\n set showMoreDisabled(value: boolean) {\n if (value) {\n this.showMoreItem.setAttribute('aria-disabled', 'true')\n } else {\n this.showMoreItem.removeAttribute('aria-disabled')\n }\n this.showMoreItem.classList.toggle('disabled', value)\n }\n\n set currentPage(value: number) {\n this.showMoreItem.setAttribute('data-current-page', value.toString())\n }\n\n get currentPage(): number {\n return parseInt(this.showMoreItem.getAttribute('data-current-page') as string) || 1\n }\n\n get totalPages(): number {\n return parseInt(this.showMoreItem.getAttribute('data-total-pages') as string) || 1\n }\n\n get paginationSrc(): string {\n return this.showMoreItem.getAttribute('src') || ''\n }\n\n private async showMore(e: Event) {\n e.preventDefault()\n if (this.showMoreDisabled) return\n this.showMoreDisabled = true\n let html\n try {\n const paginationURL = new URL(this.paginationSrc, window.location.origin)\n this.currentPage++\n paginationURL.searchParams.append('page', this.currentPage.toString())\n const response = await fetch(paginationURL)\n if (!response.ok) return\n html = await response.text()\n if (this.currentPage === this.totalPages) {\n this.showMoreItem.hidden = true\n }\n } catch (err) {\n // Ignore network errors\n this.showMoreDisabled = false\n this.currentPage--\n return\n }\n const fragment = this.#parseHTML(document, html)\n fragment?.querySelector('li > a')?.setAttribute('data-targets', 'nav-list-group.focusMarkers')\n const listId = (e.target as HTMLElement).closest('button')!.getAttribute('data-list-id')!\n const list = document.getElementById(listId)!\n list.append(fragment)\n this.focusMarkers.pop()?.focus()\n this.showMoreDisabled = false\n }\n\n private setShowMoreItemState() {\n if (!this.showMoreItem) {\n return\n }\n\n if (this.currentPage < this.totalPages) {\n this.showMoreItem.hidden = false\n } else {\n this.showMoreItem.hidden = true\n }\n }\n\n #parseHTML(document: Document, html: string): DocumentFragment {\n const template = document.createElement('template')\n // eslint-disable-next-line github/no-inner-html\n template.innerHTML = html\n return document.importNode(template.content, true)\n }\n\n #truncateObserver = new ActionListTruncationObserver(this)\n}\n\ndeclare global {\n interface Window {\n NavListGroupElement: typeof NavListGroupElement\n }\n}\n\nwindow.NavListGroupElement = NavListGroupElement\n","import {controller, targets} from '@github/catalyst'\n\n@controller\nclass SegmentedControlElement extends HTMLElement {\n @targets items: HTMLElement[]\n\n connectedCallback() {\n this.#updateButtonLabels()\n }\n\n select(event: Event) {\n const button = event.currentTarget as HTMLButtonElement\n for (const item of this.items) {\n item.classList.remove('SegmentedControl-item--selected')\n item.querySelector('[aria-current]')?.setAttribute('aria-current', 'false')\n }\n\n button.closest('li.SegmentedControl-item')?.classList.add('SegmentedControl-item--selected')\n button.setAttribute('aria-current', 'true')\n }\n\n // Updates the button labels to have a data-content attribute with the text\n // This is for selection styling to avoid the text jumping. It only needs to be\n // setup when the component is first loaded.\n #updateButtonLabels() {\n for (const label of this.querySelectorAll('.Button-label')) {\n label.setAttribute('data-content', label.textContent || '')\n }\n }\n}\n\ndeclare global {\n interface Window {\n SegmentedControlElement: typeof SegmentedControlElement\n }\n}\n\nif (!window.customElements.get('segmented-control')) {\n window.SegmentedControlElement = SegmentedControlElement\n window.customElements.define('segmented-control', SegmentedControlElement)\n}\n","import {controller, target, attr} from '@github/catalyst'\n\n@controller\nclass ToggleSwitchElement extends HTMLElement {\n @target switch: HTMLElement\n @target loadingSpinner: HTMLElement\n @target errorIcon: HTMLElement\n @attr turbo = false\n\n private toggling = false\n\n get src(): string | null {\n const src = this.getAttribute('src')\n if (!src) return null\n\n const link = this.ownerDocument.createElement('a')\n link.href = src\n return link.href\n }\n\n get csrf(): string | null {\n const csrfElement = this.querySelector('[data-csrf]')\n return this.getAttribute('data-csrf') || (csrfElement instanceof HTMLInputElement && csrfElement.value) || null\n }\n\n get csrfField(): string {\n // the authenticity token is passed into the element and is not generated in js land\n\n return this.getAttribute('csrf-field') || 'authenticity_token'\n }\n\n isRemote(): boolean {\n return this.src != null\n }\n\n async toggle() {\n if (this.toggling) return\n\n this.toggling = true\n\n if (this.isDisabled()) {\n return\n }\n\n if (!this.isRemote()) {\n this.performToggle()\n this.toggling = false\n return\n }\n\n // toggle immediately to tell screen readers the switch was clicked\n this.performToggle()\n this.setLoadingState()\n\n try {\n await this.submitForm()\n } catch (error) {\n if (error instanceof Error) {\n // because we toggle immediately when the switch is clicked, toggle back to the\n // old state on failure\n this.setErrorState(error.message || 'An error occurred, please try again.')\n this.performToggle()\n }\n\n return\n } finally {\n this.toggling = false\n }\n\n this.setSuccessState()\n }\n\n turnOn(): void {\n if (this.isDisabled()) {\n return\n }\n\n this.switch.setAttribute('aria-pressed', 'true')\n this.classList.add('ToggleSwitch--checked')\n }\n\n turnOff(): void {\n if (this.isDisabled()) {\n return\n }\n\n this.switch.setAttribute('aria-pressed', 'false')\n this.classList.remove('ToggleSwitch--checked')\n }\n\n isOn(): boolean {\n return this.switch.getAttribute('aria-pressed') === 'true'\n }\n\n isOff(): boolean {\n return !this.isOn()\n }\n\n isDisabled(): boolean {\n return this.switch.getAttribute('disabled') != null\n }\n\n disable(): void {\n this.switch.setAttribute('disabled', 'disabled')\n }\n\n enable(): void {\n this.switch.removeAttribute('disabled')\n }\n\n private performToggle(): void {\n if (this.isOn()) {\n this.turnOff()\n } else {\n this.turnOn()\n }\n }\n\n private setLoadingState(): void {\n this.errorIcon.setAttribute('hidden', 'hidden')\n this.loadingSpinner.removeAttribute('hidden')\n\n const event = new CustomEvent('toggleSwitchLoading', {bubbles: true})\n this.dispatchEvent(event)\n }\n\n private setSuccessState(): void {\n const event = new CustomEvent('toggleSwitchSuccess', {bubbles: true})\n this.dispatchEvent(event)\n\n this.setFinishedState(false)\n }\n\n private setErrorState(message: string): void {\n const event = new CustomEvent('toggleSwitchError', {bubbles: true, detail: message})\n this.dispatchEvent(event)\n\n this.setFinishedState(true)\n }\n\n private setFinishedState(error: boolean): void {\n if (error) {\n this.errorIcon.removeAttribute('hidden')\n }\n\n this.loadingSpinner.setAttribute('hidden', 'hidden')\n }\n\n private async submitForm() {\n const body = new FormData()\n\n if (this.csrf) {\n body.append(this.csrfField, this.csrf)\n }\n\n body.append('value', this.isOn() ? '1' : '0')\n\n if (!this.src) throw new Error('invalid src')\n\n let response\n\n const requestHeaders: {[key: string]: string} = {\n 'Requested-With': 'XMLHttpRequest',\n }\n\n if (this.turbo) {\n requestHeaders['Accept'] = 'text/vnd.turbo-stream.html'\n }\n\n try {\n response = await fetch(this.src, {\n credentials: 'same-origin',\n method: 'POST',\n headers: requestHeaders,\n body,\n })\n } catch (error) {\n throw new Error('A network error occurred, please try again.')\n }\n\n if (!response.ok) {\n throw new Error(await response.text())\n }\n\n const contentType = response.headers.get('Content-Type')\n if (window.Turbo && this.turbo && contentType?.startsWith('text/vnd.turbo-stream.html')) {\n window.Turbo.renderStreamMessage(await response.text())\n }\n }\n}\n\ndeclare global {\n interface Window {\n ToggleSwitchElement: typeof ToggleSwitchElement\n Turbo: {\n renderStreamMessage: (message: string) => void\n }\n }\n}\n\nif (!window.customElements.get('toggle-switch')) {\n window.ToggleSwitchElement = ToggleSwitchElement\n window.customElements.define('toggle-switch', ToggleSwitchElement)\n}\n","import type {AnchorAlignment, AnchorSide} from '@primer/behaviors'\nimport '@oddbird/popover-polyfill'\nimport {getAnchoredPosition} from '@primer/behaviors'\n\nconst isPopoverOpen = (() => {\n let selector: string\n function setSelector(el: Element) {\n try {\n selector = ':popover-open'\n return el.matches(selector)\n } catch {\n try {\n selector = ':open'\n return el.matches(':open')\n } catch {\n selector = '.\\\\:popover-open'\n return el.matches('.\\\\:popover-open')\n }\n }\n }\n return (el: Element) => (selector ? el.matches(selector) : setSelector(el))\n})()\n\nconst TOOLTIP_SR_ONLY_CLASS = 'sr-only'\n\ntype Direction = 'n' | 's' | 'e' | 'w' | 'ne' | 'se' | 'nw' | 'sw'\n\nconst DIRECTION_CLASSES = [\n 'tooltip-n',\n 'tooltip-s',\n 'tooltip-e',\n 'tooltip-w',\n 'tooltip-ne',\n 'tooltip-se',\n 'tooltip-nw',\n 'tooltip-sw',\n]\n\nfunction closeOpenTooltips(except?: Element) {\n for (const tooltip of openTooltips) {\n if (tooltip === except) continue\n if (isPopoverOpen(tooltip)) {\n tooltip.hidePopover()\n } else {\n openTooltips.delete(tooltip)\n }\n }\n}\n\nfunction focusOutListener() {\n closeOpenTooltips()\n}\n\nfunction focusInListener(event: Event) {\n setTimeout(() => {\n for (const tooltip of openTooltips) {\n if (isPopoverOpen(tooltip) && tooltip.showReason === 'focus' && tooltip.control !== event.target) {\n tooltip.hidePopover()\n }\n }\n }, 0)\n}\n\nconst tooltips = new Set()\nconst openTooltips = new Set()\nclass ToolTipElement extends HTMLElement {\n styles() {\n return `\n :host {\n --tooltip-top: var(--tool-tip-position-top, 0);\n --tooltip-left: var(--tool-tip-position-left, 0);\n padding: var(--overlay-paddingBlock-condensed) var(--overlay-padding-condensed) !important;\n font: var(--text-body-shorthand-small);\n color: var(--tooltip-fgColor, var(--fgColor-onEmphasis)) !important;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n background: var(--tooltip-bgColor, var(--bgColor-emphasis)) !important;\n border-radius: var(--borderRadius-medium);\n border: 0 !important;\n opacity: 0;\n max-width: var(--overlay-width-small);\n word-wrap: break-word;\n white-space: normal;\n width: max-content !important;\n inset: var(--tooltip-top) auto auto var(--tooltip-left) !important;\n overflow: visible !important;\n text-wrap: balance;\n }\n\n :host(:is(.tooltip-n, .tooltip-nw, .tooltip-ne)) {\n --tooltip-top: calc(var(--tool-tip-position-top, 0) - var(--overlay-offset, 0.25rem));\n --tooltip-left: var(--tool-tip-position-left);\n }\n\n :host(:is(.tooltip-s, .tooltip-sw, .tooltip-se)) {\n --tooltip-top: calc(var(--tool-tip-position-top, 0) + var(--overlay-offset, 0.25rem));\n --tooltip-left: var(--tool-tip-position-left);\n }\n\n :host(.tooltip-w) {\n --tooltip-top: var(--tool-tip-position-top);\n --tooltip-left: calc(var(--tool-tip-position-left, 0) - var(--overlay-offset, 0.25rem));\n }\n\n :host(.tooltip-e) {\n --tooltip-top: var(--tool-tip-position-top);\n --tooltip-left: calc(var(--tool-tip-position-left, 0) + var(--overlay-offset, 0.25rem));\n }\n\n :host:after{\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: var(--overlay-offset, 0.25rem);\n content: \"\";\n }\n\n :host(.tooltip-s):after,\n :host(.tooltip-se):after,\n :host(.tooltip-sw):after {\n bottom: 100%\n }\n\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%;\n }\n\n @keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n :host(:popover-open),\n :host(:popover-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n }\n\n :host(.\\\\:popover-open) {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n }\n\n @media (forced-colors: active) {\n :host {\n outline: solid 1px transparent;\n }\n\n :host:before {\n display: none;\n }\n }\n `\n }\n\n #abortController: AbortController | undefined\n #align: AnchorAlignment = 'center'\n #side: AnchorSide = 'outside-bottom'\n #allowUpdatePosition = false\n #showReason: 'focus' | 'mouse' = 'mouse'\n get showReason() {\n return this.#showReason\n }\n\n get htmlFor(): string {\n return this.getAttribute('for') || ''\n }\n\n set htmlFor(value: string) {\n this.setAttribute('for', value)\n }\n\n get type(): 'description' | 'label' {\n const type = this.getAttribute('data-type')\n return type === 'label' ? 'label' : 'description'\n }\n\n set type(value: 'description' | 'label') {\n this.setAttribute('data-type', value)\n }\n\n get direction(): Direction {\n return (this.getAttribute('data-direction') || 's') as Direction\n }\n\n set direction(value: Direction) {\n this.setAttribute('data-direction', value)\n }\n\n get control(): HTMLElement | null {\n return this.ownerDocument.getElementById(this.htmlFor)\n }\n\n /* @deprecated */\n set hiddenFromView(value: true | false) {\n if (value && isPopoverOpen(this)) {\n this.hidePopover()\n } else if (!value && !isPopoverOpen(this)) {\n this.showPopover()\n }\n }\n\n /* @deprecated */\n get hiddenFromView() {\n return !isPopoverOpen(this)\n }\n\n connectedCallback() {\n tooltips.add(this)\n this.#updateControlReference()\n this.#updateDirection()\n if (!this.shadowRoot) {\n const shadow = this.attachShadow({mode: 'open'})\n const style = shadow.appendChild(document.createElement('style'))\n style.textContent = this.styles()\n shadow.appendChild(document.createElement('slot'))\n }\n this.#update(false)\n this.#allowUpdatePosition = true\n\n if (!this.control) return\n\n this.setAttribute('role', 'tooltip')\n\n this.#abortController?.abort()\n this.#abortController = new AbortController()\n const {signal} = this.#abortController\n\n this.addEventListener('mouseleave', this, {signal})\n this.addEventListener('toggle', this, {signal})\n this.control.addEventListener('mouseenter', this, {signal})\n this.control.addEventListener('mouseleave', this, {signal})\n this.control.addEventListener('focus', this, {signal})\n this.control.addEventListener('mousedown', this, {signal})\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore popoverTargetElement is not in the type definition\n this.control.popoverTargetElement?.addEventListener('beforetoggle', this, {\n signal,\n })\n this.ownerDocument.addEventListener('focusout', focusOutListener)\n this.ownerDocument.addEventListener('focusin', focusInListener)\n this.ownerDocument.addEventListener('keydown', this, {signal, capture: true})\n }\n\n disconnectedCallback() {\n tooltips.delete(this)\n openTooltips.delete(this)\n this.#abortController?.abort()\n }\n\n async handleEvent(event: Event) {\n if (!this.control) return\n const showing = isPopoverOpen(this)\n\n // Ensures that tooltip stays open when hovering between tooltip and element\n // WCAG Success Criterion 1.4.13 Hoverable\n const shouldShow =\n event.type === 'mouseenter' ||\n // Only show tooltip on focus if running in headless browser (for tests) or if focus ring\n // is visible (i.e. if user is using keyboard navigation)\n (event.type === 'focus' && (navigator.webdriver || this.control.matches(':focus-visible')))\n const isMouseLeaveFromButton =\n event.type === 'mouseleave' &&\n (event as MouseEvent).relatedTarget !== this.control &&\n (event as MouseEvent).relatedTarget !== this\n const isEscapeKeydown = event.type === 'keydown' && (event as KeyboardEvent).key === 'Escape'\n const isMouseDownOnButton = event.type === 'mousedown' && event.currentTarget === this.control\n const isOpeningOtherPopover = event.type === 'beforetoggle' && event.currentTarget !== this\n const shouldHide = isMouseLeaveFromButton || isEscapeKeydown || isMouseDownOnButton || isOpeningOtherPopover\n\n if (showing && isEscapeKeydown) {\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopImmediatePropagation()\n event.preventDefault()\n }\n\n await Promise.resolve()\n if (!showing && shouldShow && !isPopoverOpen(this)) {\n this.#showReason = event.type === 'mouseenter' ? 'mouse' : 'focus'\n this.showPopover()\n } else if (showing && shouldHide && isPopoverOpen(this)) {\n this.hidePopover()\n }\n\n if (event.type === 'toggle') {\n this.#update((event as ToggleEvent).newState === 'open')\n }\n }\n\n static observedAttributes = ['data-type', 'data-direction', 'id']\n\n #update(isOpen: boolean) {\n if (isOpen) {\n openTooltips.add(this)\n this.classList.remove(TOOLTIP_SR_ONLY_CLASS)\n closeOpenTooltips(this)\n this.#updatePosition()\n } else {\n openTooltips.delete(this)\n this.classList.remove(...DIRECTION_CLASSES)\n this.classList.add(TOOLTIP_SR_ONLY_CLASS)\n }\n }\n\n attributeChangedCallback(name: string) {\n if (!this.isConnected) return\n\n if (name === 'id' || name === 'data-type') {\n this.#updateControlReference()\n } else if (name === 'data-direction') {\n this.#updateDirection()\n }\n }\n\n #updateControlReference() {\n if (!this.id || !this.control) return\n if (this.type === 'label') {\n let labelledBy = this.control.getAttribute('aria-labelledby')\n if (labelledBy) {\n if (!labelledBy.split(' ').includes(this.id)) {\n labelledBy = `${labelledBy} ${this.id}`\n } else {\n labelledBy = `${labelledBy}`\n }\n } else {\n labelledBy = this.id\n }\n this.control.setAttribute('aria-labelledby', labelledBy)\n\n // Prevent duplicate accessible name announcements.\n this.setAttribute('aria-hidden', 'true')\n } else {\n let describedBy = this.control.getAttribute('aria-describedby')\n if (describedBy) {\n if (!describedBy.split(' ').includes(this.id)) {\n describedBy = `${describedBy} ${this.id}`\n } else {\n describedBy = `${describedBy}`\n }\n } else {\n describedBy = this.id\n }\n this.control.setAttribute('aria-describedby', describedBy)\n }\n }\n\n #updateDirection() {\n this.classList.remove(...DIRECTION_CLASSES)\n const direction = this.direction\n if (direction === 'n') {\n this.#align = 'center'\n this.#side = 'outside-top'\n } else if (direction === 'ne') {\n this.#align = 'end'\n this.#side = 'outside-top'\n } else if (direction === 'e') {\n this.#align = 'center'\n this.#side = 'outside-right'\n } else if (direction === 'se') {\n this.#align = 'end'\n this.#side = 'outside-bottom'\n } else if (direction === 's') {\n this.#align = 'center'\n this.#side = 'outside-bottom'\n } else if (direction === 'sw') {\n this.#align = 'start'\n this.#side = 'outside-bottom'\n } else if (direction === 'w') {\n this.#align = 'center'\n this.#side = 'outside-left'\n } else if (direction === 'nw') {\n this.#align = 'start'\n this.#side = 'outside-top'\n }\n }\n\n #updatePosition() {\n if (!this.control) return\n if (!this.#allowUpdatePosition || !isPopoverOpen(this)) return\n\n const position = getAnchoredPosition(this, this.control, {\n side: this.#side,\n align: this.#align,\n anchorOffset: 0,\n })\n const anchorSide = position.anchorSide\n const align = position.anchorAlign\n\n this.style.setProperty('--tool-tip-position-top', `${position.top}px`)\n this.style.setProperty('--tool-tip-position-left', `${position.left}px`)\n\n let direction: Direction = 's'\n\n if (anchorSide === 'outside-left') {\n direction = 'w'\n } else if (anchorSide === 'outside-right') {\n direction = 'e'\n } else if (anchorSide === 'outside-top') {\n if (align === 'center') {\n direction = 'n'\n } else if (align === 'start') {\n direction = 'ne'\n } else {\n direction = 'nw'\n }\n } else {\n if (align === 'center') {\n direction = 's'\n } else if (align === 'start') {\n direction = 'se'\n } else {\n direction = 'sw'\n }\n }\n\n this.classList.add(`tooltip-${direction}`)\n }\n}\n\nif (!window.customElements.get('tool-tip')) {\n window.ToolTipElement = ToolTipElement\n window.customElements.define('tool-tip', ToolTipElement)\n}\n\ndeclare global {\n interface Window {\n ToolTipElement: typeof ToolTipElement\n }\n}\n","import {controller, target} from '@github/catalyst'\n\ndeclare global {\n interface HTMLElementEventMap {\n 'banner:dismiss': CustomEvent\n }\n}\n\n@controller\nclass XBannerElement extends HTMLElement {\n @target titleText: HTMLElement\n\n dismiss() {\n if (this.#dismissScheme === 'remove') {\n const parentElement = this.parentElement\n if (!parentElement) return\n\n parentElement.removeChild(this)\n } else {\n this.hide()\n }\n\n this.dispatchEvent(new CustomEvent('banner:dismiss'))\n }\n\n show() {\n this.style.setProperty('display', 'initial')\n }\n\n hide() {\n this.style.setProperty('display', 'none')\n }\n\n get #dismissScheme(): string {\n return this.getAttribute('data-dismiss-scheme')!\n }\n}\n\ndeclare global {\n interface Window {\n XBannerElement: typeof XBannerElement\n }\n}\n\nif (!window.customElements.get('x-banner')) {\n window.XBannerElement = XBannerElement\n window.customElements.define('x-banner', XBannerElement)\n}\n","export default class Combobox {\n constructor(input, list, { tabInsertsSuggestions, defaultFirstOption } = {}) {\n this.input = input;\n this.list = list;\n this.tabInsertsSuggestions = tabInsertsSuggestions !== null && tabInsertsSuggestions !== void 0 ? tabInsertsSuggestions : true;\n this.defaultFirstOption = defaultFirstOption !== null && defaultFirstOption !== void 0 ? defaultFirstOption : false;\n this.isComposing = false;\n if (!list.id) {\n list.id = `combobox-${Math.random().toString().slice(2, 6)}`;\n }\n this.ctrlBindings = !!navigator.userAgent.match(/Macintosh/);\n this.keyboardEventHandler = event => keyboardBindings(event, this);\n this.compositionEventHandler = event => trackComposition(event, this);\n this.inputHandler = this.clearSelection.bind(this);\n input.setAttribute('role', 'combobox');\n input.setAttribute('aria-controls', list.id);\n input.setAttribute('aria-expanded', 'false');\n input.setAttribute('aria-autocomplete', 'list');\n input.setAttribute('aria-haspopup', 'listbox');\n }\n destroy() {\n this.clearSelection();\n this.stop();\n this.input.removeAttribute('role');\n this.input.removeAttribute('aria-controls');\n this.input.removeAttribute('aria-expanded');\n this.input.removeAttribute('aria-autocomplete');\n this.input.removeAttribute('aria-haspopup');\n }\n start() {\n this.input.setAttribute('aria-expanded', 'true');\n this.input.addEventListener('compositionstart', this.compositionEventHandler);\n this.input.addEventListener('compositionend', this.compositionEventHandler);\n this.input.addEventListener('input', this.inputHandler);\n this.input.addEventListener('keydown', this.keyboardEventHandler);\n this.list.addEventListener('click', commitWithElement);\n this.indicateDefaultOption();\n }\n stop() {\n this.clearSelection();\n this.input.setAttribute('aria-expanded', 'false');\n this.input.removeEventListener('compositionstart', this.compositionEventHandler);\n this.input.removeEventListener('compositionend', this.compositionEventHandler);\n this.input.removeEventListener('input', this.inputHandler);\n this.input.removeEventListener('keydown', this.keyboardEventHandler);\n this.list.removeEventListener('click', commitWithElement);\n }\n indicateDefaultOption() {\n var _a;\n if (this.defaultFirstOption) {\n (_a = Array.from(this.list.querySelectorAll('[role=\"option\"]:not([aria-disabled=\"true\"])'))\n .filter(visible)[0]) === null || _a === void 0 ? void 0 : _a.setAttribute('data-combobox-option-default', 'true');\n }\n }\n navigate(indexDiff = 1) {\n const focusEl = Array.from(this.list.querySelectorAll('[aria-selected=\"true\"]')).filter(visible)[0];\n const els = Array.from(this.list.querySelectorAll('[role=\"option\"]')).filter(visible);\n const focusIndex = els.indexOf(focusEl);\n if ((focusIndex === els.length - 1 && indexDiff === 1) || (focusIndex === 0 && indexDiff === -1)) {\n this.clearSelection();\n this.input.focus();\n return;\n }\n let indexOfItem = indexDiff === 1 ? 0 : els.length - 1;\n if (focusEl && focusIndex >= 0) {\n const newIndex = focusIndex + indexDiff;\n if (newIndex >= 0 && newIndex < els.length)\n indexOfItem = newIndex;\n }\n const target = els[indexOfItem];\n if (!target)\n return;\n for (const el of els) {\n el.removeAttribute('data-combobox-option-default');\n if (target === el) {\n this.input.setAttribute('aria-activedescendant', target.id);\n target.setAttribute('aria-selected', 'true');\n scrollTo(this.list, target);\n }\n else {\n el.removeAttribute('aria-selected');\n }\n }\n }\n clearSelection() {\n this.input.removeAttribute('aria-activedescendant');\n for (const el of this.list.querySelectorAll('[aria-selected=\"true\"]')) {\n el.removeAttribute('aria-selected');\n }\n this.indicateDefaultOption();\n }\n}\nfunction keyboardBindings(event, combobox) {\n if (event.shiftKey || event.metaKey || event.altKey)\n return;\n if (!combobox.ctrlBindings && event.ctrlKey)\n return;\n if (combobox.isComposing)\n return;\n switch (event.key) {\n case 'Enter':\n if (commit(combobox.input, combobox.list)) {\n event.preventDefault();\n }\n break;\n case 'Tab':\n if (combobox.tabInsertsSuggestions && commit(combobox.input, combobox.list)) {\n event.preventDefault();\n }\n break;\n case 'Escape':\n combobox.clearSelection();\n break;\n case 'ArrowDown':\n combobox.navigate(1);\n event.preventDefault();\n break;\n case 'ArrowUp':\n combobox.navigate(-1);\n event.preventDefault();\n break;\n case 'n':\n if (combobox.ctrlBindings && event.ctrlKey) {\n combobox.navigate(1);\n event.preventDefault();\n }\n break;\n case 'p':\n if (combobox.ctrlBindings && event.ctrlKey) {\n combobox.navigate(-1);\n event.preventDefault();\n }\n break;\n default:\n if (event.ctrlKey)\n break;\n combobox.clearSelection();\n }\n}\nfunction commitWithElement(event) {\n if (!(event.target instanceof Element))\n return;\n const target = event.target.closest('[role=\"option\"]');\n if (!target)\n return;\n if (target.getAttribute('aria-disabled') === 'true')\n return;\n fireCommitEvent(target, { event });\n}\nfunction commit(input, list) {\n const target = list.querySelector('[aria-selected=\"true\"], [data-combobox-option-default=\"true\"]');\n if (!target)\n return false;\n if (target.getAttribute('aria-disabled') === 'true')\n return true;\n target.click();\n return true;\n}\nfunction fireCommitEvent(target, detail) {\n target.dispatchEvent(new CustomEvent('combobox-commit', { bubbles: true, detail }));\n}\nfunction visible(el) {\n return (!el.hidden &&\n !(el instanceof HTMLInputElement && el.type === 'hidden') &&\n (el.offsetWidth > 0 || el.offsetHeight > 0));\n}\nfunction trackComposition(event, combobox) {\n combobox.isComposing = event.type === 'compositionstart';\n const list = document.getElementById(combobox.input.getAttribute('aria-controls') || '');\n if (!list)\n return;\n combobox.clearSelection();\n}\nfunction scrollTo(container, target) {\n if (!inViewport(container, target)) {\n container.scrollTop = target.offsetTop;\n }\n}\nfunction inViewport(container, element) {\n const scrollTop = container.scrollTop;\n const containerBottom = scrollTop + container.clientHeight;\n const top = element.offsetTop;\n const bottom = top + element.clientHeight;\n return top >= scrollTop && bottom <= containerBottom;\n}\n","import Combobox from '@github/combobox-nav';\nimport debounce from './debounce.js';\nconst SCREEN_READER_DELAY = window.testScreenReaderDelay || 100;\nexport default class Autocomplete {\n constructor(container, input, results, autoselectEnabled = false) {\n var _a;\n this.container = container;\n this.input = input;\n this.results = results;\n this.combobox = new Combobox(input, results, {\n defaultFirstOption: autoselectEnabled,\n });\n this.feedback = container.getRootNode().getElementById(`${this.results.id}-feedback`);\n this.autoselectEnabled = autoselectEnabled;\n this.clearButton = container.getRootNode().getElementById(`${this.input.id || this.input.name}-clear`);\n this.clientOptions = results.querySelectorAll('[role=option]');\n if (this.feedback) {\n this.feedback.setAttribute('aria-live', 'polite');\n this.feedback.setAttribute('aria-atomic', 'true');\n }\n if (this.clearButton && !this.clearButton.getAttribute('aria-label')) {\n const labelElem = document.querySelector(`label[for=\"${this.input.name}\"]`);\n this.clearButton.setAttribute('aria-label', `clear:`);\n this.clearButton.setAttribute('aria-labelledby', `${this.clearButton.id} ${(labelElem === null || labelElem === void 0 ? void 0 : labelElem.id) || ''}`);\n }\n if (!this.input.getAttribute('aria-expanded')) {\n this.input.setAttribute('aria-expanded', 'false');\n }\n if (this.results.popover) {\n if (this.results.matches(':popover-open')) {\n this.results.hidePopover();\n }\n }\n else {\n this.results.hidden = true;\n }\n if (!this.results.getAttribute('aria-label')) {\n this.results.setAttribute('aria-label', 'results');\n }\n this.input.setAttribute('autocomplete', 'off');\n this.input.setAttribute('spellcheck', 'false');\n this.interactingWithList = false;\n this.onInputChange = debounce(this.onInputChange.bind(this), 300);\n this.onResultsMouseDown = this.onResultsMouseDown.bind(this);\n this.onInputBlur = this.onInputBlur.bind(this);\n this.onInputFocus = this.onInputFocus.bind(this);\n this.onKeydown = this.onKeydown.bind(this);\n this.onCommit = this.onCommit.bind(this);\n this.handleClear = this.handleClear.bind(this);\n this.input.addEventListener('keydown', this.onKeydown);\n this.input.addEventListener('focus', this.onInputFocus);\n this.input.addEventListener('blur', this.onInputBlur);\n this.input.addEventListener('input', this.onInputChange);\n this.results.addEventListener('mousedown', this.onResultsMouseDown);\n this.results.addEventListener('combobox-commit', this.onCommit);\n (_a = this.clearButton) === null || _a === void 0 ? void 0 : _a.addEventListener('click', this.handleClear);\n }\n destroy() {\n this.input.removeEventListener('keydown', this.onKeydown);\n this.input.removeEventListener('focus', this.onInputFocus);\n this.input.removeEventListener('blur', this.onInputBlur);\n this.input.removeEventListener('input', this.onInputChange);\n this.results.removeEventListener('mousedown', this.onResultsMouseDown);\n this.results.removeEventListener('combobox-commit', this.onCommit);\n }\n handleClear(event) {\n event.preventDefault();\n if (this.input.getAttribute('aria-expanded') === 'true') {\n this.input.setAttribute('aria-expanded', 'false');\n this.updateFeedbackForScreenReaders('Results hidden.');\n }\n this.input.value = '';\n this.container.value = '';\n this.input.focus();\n this.input.dispatchEvent(new Event('change'));\n this.close();\n }\n onKeydown(event) {\n if (event.key === 'Escape' && this.container.open) {\n this.close();\n event.stopPropagation();\n event.preventDefault();\n }\n else if (event.altKey && event.key === 'ArrowUp' && this.container.open) {\n this.close();\n event.stopPropagation();\n event.preventDefault();\n }\n else if (event.altKey && event.key === 'ArrowDown' && !this.container.open) {\n if (!this.input.value.trim())\n return;\n this.open();\n event.stopPropagation();\n event.preventDefault();\n }\n }\n onInputFocus() {\n if (this.interactingWithList)\n return;\n this.fetchResults();\n }\n onInputBlur() {\n if (this.interactingWithList)\n return;\n this.close();\n }\n onCommit({ target }) {\n const selected = target;\n if (!(selected instanceof HTMLElement))\n return;\n this.close();\n if (selected instanceof HTMLAnchorElement)\n return;\n const value = selected.getAttribute('data-autocomplete-value') || selected.textContent;\n this.updateFeedbackForScreenReaders(`${selected.textContent || ''} selected.`);\n this.container.value = value;\n if (!value) {\n this.updateFeedbackForScreenReaders(`Results hidden.`);\n }\n }\n onResultsMouseDown() {\n this.interactingWithList = true;\n }\n onInputChange() {\n if (this.feedback && this.feedback.textContent) {\n this.feedback.textContent = '';\n }\n this.container.removeAttribute('value');\n this.fetchResults();\n }\n identifyOptions() {\n let id = 0;\n for (const el of this.results.querySelectorAll('[role=\"option\"]:not([id])')) {\n el.id = `${this.results.id}-option-${id++}`;\n }\n }\n updateFeedbackForScreenReaders(inputString) {\n setTimeout(() => {\n if (this.feedback) {\n this.feedback.textContent = inputString;\n }\n }, SCREEN_READER_DELAY);\n }\n fetchResults() {\n const query = this.input.value.trim();\n if (!query && !this.container.fetchOnEmpty) {\n this.close();\n return;\n }\n const src = this.container.src;\n if (!src)\n return;\n const url = new URL(src, window.location.href);\n const params = new URLSearchParams(url.search.slice(1));\n params.append('q', query);\n url.search = params.toString();\n this.container.dispatchEvent(new CustomEvent('loadstart'));\n this.container\n .fetchResult(url)\n .then(html => {\n this.results.innerHTML = html;\n this.identifyOptions();\n this.combobox.indicateDefaultOption();\n const allNewOptions = this.results.querySelectorAll('[role=\"option\"]');\n const hasResults = !!allNewOptions.length;\n const numOptions = allNewOptions.length;\n const [firstOption] = allNewOptions;\n const firstOptionValue = firstOption === null || firstOption === void 0 ? void 0 : firstOption.textContent;\n if (this.autoselectEnabled && firstOptionValue) {\n this.updateFeedbackForScreenReaders(`${numOptions} results. ${firstOptionValue} is the top result: Press Enter to activate.`);\n }\n else {\n this.updateFeedbackForScreenReaders(`${numOptions || 'No'} results.`);\n }\n hasResults ? this.open() : this.close();\n this.container.dispatchEvent(new CustomEvent('load'));\n this.container.dispatchEvent(new CustomEvent('loadend'));\n })\n .catch(() => {\n this.container.dispatchEvent(new CustomEvent('error'));\n this.container.dispatchEvent(new CustomEvent('loadend'));\n });\n }\n open() {\n const isHidden = this.results.popover ? !this.results.matches(':popover-open') : this.results.hidden;\n if (isHidden) {\n this.combobox.start();\n if (this.results.popover) {\n this.results.showPopover();\n }\n else {\n this.results.hidden = false;\n }\n }\n this.container.open = true;\n this.interactingWithList = true;\n }\n close() {\n const isVisible = this.results.popover ? this.results.matches(':popover-open') : !this.results.hidden;\n if (isVisible) {\n this.combobox.stop();\n if (this.results.popover) {\n this.results.hidePopover();\n }\n else {\n this.results.hidden = true;\n }\n }\n this.container.open = false;\n this.interactingWithList = false;\n }\n}\n","export default function debounce(callback, wait = 0) {\n let timeout;\n return function (...Rest) {\n clearTimeout(timeout);\n timeout = window.setTimeout(() => {\n clearTimeout(timeout);\n callback(...Rest);\n }, wait);\n };\n}\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar _AutoCompleteElement_instances, _AutoCompleteElement_forElement, _AutoCompleteElement_inputElement, _AutoCompleteElement_reattachState, _AutoCompleteElement_requestController;\nimport Autocomplete from './autocomplete.js';\nconst HTMLElement = globalThis.HTMLElement || null;\nexport class AutoCompleteEvent extends Event {\n constructor(type, _a) {\n var { relatedTarget } = _a, init = __rest(_a, [\"relatedTarget\"]);\n super(type, init);\n this.relatedTarget = relatedTarget;\n }\n}\nconst state = new WeakMap();\nlet cspTrustedTypesPolicyPromise = null;\nexport class AutoCompleteElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _AutoCompleteElement_instances.add(this);\n _AutoCompleteElement_forElement.set(this, null);\n _AutoCompleteElement_inputElement.set(this, null);\n _AutoCompleteElement_requestController.set(this, void 0);\n }\n static define(tag = 'auto-complete', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n static setCSPTrustedTypesPolicy(policy) {\n cspTrustedTypesPolicyPromise = policy === null ? policy : Promise.resolve(policy);\n }\n get forElement() {\n var _a;\n if ((_a = __classPrivateFieldGet(this, _AutoCompleteElement_forElement, \"f\")) === null || _a === void 0 ? void 0 : _a.isConnected) {\n return __classPrivateFieldGet(this, _AutoCompleteElement_forElement, \"f\");\n }\n const id = this.getAttribute('for');\n const root = this.getRootNode();\n if (id && (root instanceof Document || root instanceof ShadowRoot)) {\n return root.getElementById(id);\n }\n return null;\n }\n set forElement(element) {\n __classPrivateFieldSet(this, _AutoCompleteElement_forElement, element, \"f\");\n this.setAttribute('for', '');\n }\n get inputElement() {\n var _a;\n if ((_a = __classPrivateFieldGet(this, _AutoCompleteElement_inputElement, \"f\")) === null || _a === void 0 ? void 0 : _a.isConnected) {\n return __classPrivateFieldGet(this, _AutoCompleteElement_inputElement, \"f\");\n }\n return this.querySelector('input');\n }\n set inputElement(input) {\n __classPrivateFieldSet(this, _AutoCompleteElement_inputElement, input, \"f\");\n __classPrivateFieldGet(this, _AutoCompleteElement_instances, \"m\", _AutoCompleteElement_reattachState).call(this);\n }\n connectedCallback() {\n if (!this.isConnected)\n return;\n __classPrivateFieldGet(this, _AutoCompleteElement_instances, \"m\", _AutoCompleteElement_reattachState).call(this);\n new MutationObserver(() => {\n if (!state.get(this)) {\n __classPrivateFieldGet(this, _AutoCompleteElement_instances, \"m\", _AutoCompleteElement_reattachState).call(this);\n }\n }).observe(this, { subtree: true, childList: true });\n }\n disconnectedCallback() {\n const autocomplete = state.get(this);\n if (autocomplete) {\n autocomplete.destroy();\n state.delete(this);\n }\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(url) {\n this.setAttribute('src', url);\n }\n get value() {\n return this.getAttribute('value') || '';\n }\n set value(value) {\n this.setAttribute('value', value);\n }\n get open() {\n return this.hasAttribute('open');\n }\n set open(value) {\n if (value) {\n this.setAttribute('open', '');\n }\n else {\n this.removeAttribute('open');\n }\n }\n get fetchOnEmpty() {\n return this.hasAttribute('fetch-on-empty');\n }\n set fetchOnEmpty(fetchOnEmpty) {\n this.toggleAttribute('fetch-on-empty', fetchOnEmpty);\n }\n async fetchResult(url) {\n var _a;\n (_a = __classPrivateFieldGet(this, _AutoCompleteElement_requestController, \"f\")) === null || _a === void 0 ? void 0 : _a.abort();\n const { signal } = (__classPrivateFieldSet(this, _AutoCompleteElement_requestController, new AbortController(), \"f\"));\n const res = await fetch(url.toString(), {\n signal,\n headers: {\n Accept: 'text/fragment+html',\n },\n });\n if (!res.ok) {\n throw new Error(await res.text());\n }\n if (cspTrustedTypesPolicyPromise) {\n const cspTrustedTypesPolicy = await cspTrustedTypesPolicyPromise;\n return cspTrustedTypesPolicy.createHTML(await res.text(), res);\n }\n return await res.text();\n }\n static get observedAttributes() {\n return ['open', 'value', 'for'];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n var _a, _b;\n if (oldValue === newValue)\n return;\n const autocomplete = state.get(this);\n if (!autocomplete)\n return;\n if (this.forElement !== ((_a = state.get(this)) === null || _a === void 0 ? void 0 : _a.results) || this.inputElement !== ((_b = state.get(this)) === null || _b === void 0 ? void 0 : _b.input)) {\n __classPrivateFieldGet(this, _AutoCompleteElement_instances, \"m\", _AutoCompleteElement_reattachState).call(this);\n }\n switch (name) {\n case 'open':\n newValue === null ? autocomplete.close() : autocomplete.open();\n break;\n case 'value':\n if (newValue !== null) {\n autocomplete.input.value = newValue;\n }\n this.dispatchEvent(new AutoCompleteEvent('auto-complete-change', {\n bubbles: true,\n relatedTarget: autocomplete.input,\n }));\n break;\n }\n }\n}\n_AutoCompleteElement_forElement = new WeakMap(), _AutoCompleteElement_inputElement = new WeakMap(), _AutoCompleteElement_requestController = new WeakMap(), _AutoCompleteElement_instances = new WeakSet(), _AutoCompleteElement_reattachState = function _AutoCompleteElement_reattachState() {\n var _a;\n (_a = state.get(this)) === null || _a === void 0 ? void 0 : _a.destroy();\n const { forElement, inputElement } = this;\n if (!forElement || !inputElement)\n return;\n const autoselectEnabled = this.getAttribute('data-autoselect') === 'true';\n state.set(this, new Autocomplete(this, inputElement, forElement, autoselectEnabled));\n forElement.setAttribute('role', 'listbox');\n};\nexport default AutoCompleteElement;\n","import { AutoCompleteElement } from './auto-complete-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.AutocompleteElement = root.AutoCompleteElement = AutoCompleteElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default AutoCompleteElement;\nexport * from './auto-complete-element.js';\n","function createNode(text) {\n const node = document.createElement('pre');\n node.style.width = '1px';\n node.style.height = '1px';\n node.style.position = 'fixed';\n node.style.top = '5px';\n node.textContent = text;\n return node;\n}\nexport function copyNode(node) {\n if ('clipboard' in navigator) {\n return navigator.clipboard.writeText(node.textContent || '');\n }\n const selection = getSelection();\n if (selection == null) {\n return Promise.reject(new Error());\n }\n selection.removeAllRanges();\n const range = document.createRange();\n range.selectNodeContents(node);\n selection.addRange(range);\n document.execCommand('copy');\n selection.removeAllRanges();\n return Promise.resolve();\n}\nexport function copyText(text) {\n if ('clipboard' in navigator) {\n return navigator.clipboard.writeText(text);\n }\n const body = document.body;\n if (!body) {\n return Promise.reject(new Error());\n }\n const node = createNode(text);\n body.appendChild(node);\n copyNode(node);\n body.removeChild(node);\n return Promise.resolve();\n}\n","import { copyNode, copyText } from './clipboard.js';\nasync function copy(button) {\n const id = button.getAttribute('for');\n const text = button.getAttribute('value');\n function trigger() {\n button.dispatchEvent(new CustomEvent('clipboard-copy', { bubbles: true }));\n }\n if (button.getAttribute('aria-disabled') === 'true') {\n return;\n }\n if (text) {\n await copyText(text);\n trigger();\n }\n else if (id) {\n const root = 'getRootNode' in Element.prototype ? button.getRootNode() : button.ownerDocument;\n if (!(root instanceof Document || ('ShadowRoot' in window && root instanceof ShadowRoot)))\n return;\n const node = root.getElementById(id);\n if (node) {\n await copyTarget(node);\n trigger();\n }\n }\n}\nfunction copyTarget(content) {\n if (content instanceof HTMLInputElement || content instanceof HTMLTextAreaElement) {\n return copyText(content.value);\n }\n else if (content instanceof HTMLAnchorElement && content.hasAttribute('href')) {\n return copyText(content.href);\n }\n else {\n return copyNode(content);\n }\n}\nfunction clicked(event) {\n const button = event.currentTarget;\n if (button instanceof HTMLElement) {\n copy(button);\n }\n}\nfunction keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n const button = event.currentTarget;\n if (button instanceof HTMLElement) {\n event.preventDefault();\n copy(button);\n }\n }\n}\nfunction focused(event) {\n ;\n event.currentTarget.addEventListener('keydown', keydown);\n}\nfunction blurred(event) {\n ;\n event.currentTarget.removeEventListener('keydown', keydown);\n}\nexport class ClipboardCopyElement extends HTMLElement {\n static define(tag = 'clipboard-copy', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n constructor() {\n super();\n this.addEventListener('click', clicked);\n this.addEventListener('focus', focused);\n this.addEventListener('blur', blurred);\n }\n connectedCallback() {\n if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', '0');\n }\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'button');\n }\n }\n get value() {\n return this.getAttribute('value') || '';\n }\n set value(text) {\n this.setAttribute('value', text);\n }\n}\n","import { ClipboardCopyElement } from './clipboard-copy-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.ClipboardCopyElement = ClipboardCopyElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default ClipboardCopyElement;\nexport * from './clipboard-copy-element.js';\n","import '@github/clipboard-copy-element'\n\nconst CLIPBOARD_COPY_TIMER_DURATION = 2000\n\nfunction showSVG(svg: SVGElement) {\n svg.style.display = 'inline-block'\n}\n\nfunction hideSVG(svg: SVGElement) {\n svg.style.display = 'none'\n}\n\n// Toggle a copy button.\nfunction showCopy(button: HTMLElement) {\n const [copyIcon, checkIcon] = button.querySelectorAll('.octicon')\n\n if (!copyIcon || !checkIcon) return\n\n showSVG(copyIcon)\n hideSVG(checkIcon)\n}\n\n// Toggle a copy button.\nfunction showCheck(button: HTMLElement) {\n const [copyIcon, checkIcon] = button.querySelectorAll('.octicon')\n\n if (!copyIcon || !checkIcon) return\n\n hideSVG(copyIcon)\n showSVG(checkIcon)\n}\n\nconst clipboardCopyElementTimers = new WeakMap()\n\ndocument.addEventListener('clipboard-copy', ({target}) => {\n if (!(target instanceof HTMLElement)) return\n if (!target.hasAttribute('data-view-component')) return\n\n const currentTimeout = clipboardCopyElementTimers.get(target)\n const clipboardCopyLiveRegion = target.parentNode?.querySelector('[data-clipboard-copy-feedback]')\n const copiedAnnouncement = 'Copied!'\n\n if (currentTimeout) {\n clearTimeout(currentTimeout)\n clipboardCopyElementTimers.delete(target)\n } else {\n showCheck(target)\n if (clipboardCopyLiveRegion) {\n if (clipboardCopyLiveRegion.textContent === copiedAnnouncement) {\n /* This is a hack due to the way the aria live API works.\n A screen reader will not read a live region again\n if the text is the same. Adding a space character tells\n the browser that the live region has updated,\n which will cause it to read again, but with no audible difference. */\n clipboardCopyLiveRegion.textContent = `${copiedAnnouncement}\\u00A0`\n } else {\n clipboardCopyLiveRegion.textContent = copiedAnnouncement\n }\n }\n }\n\n clipboardCopyElementTimers.set(\n target,\n setTimeout(() => {\n showCopy(target)\n clipboardCopyElementTimers.delete(target)\n }, CLIPBOARD_COPY_TIMER_DURATION),\n )\n})\n","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _DurationFormat_options;\nclass ListFormatPonyFill {\n formatToParts(members) {\n const parts = [];\n for (const value of members) {\n parts.push({ type: 'element', value });\n parts.push({ type: 'literal', value: ', ' });\n }\n return parts.slice(0, -1);\n }\n}\nconst ListFormat = (typeof Intl !== 'undefined' && Intl.ListFormat) || ListFormatPonyFill;\nconst partsTable = [\n ['years', 'year'],\n ['months', 'month'],\n ['weeks', 'week'],\n ['days', 'day'],\n ['hours', 'hour'],\n ['minutes', 'minute'],\n ['seconds', 'second'],\n ['milliseconds', 'millisecond'],\n];\nconst twoDigitFormatOptions = { minimumIntegerDigits: 2 };\nexport default class DurationFormat {\n constructor(locale, options = {}) {\n _DurationFormat_options.set(this, void 0);\n let style = String(options.style || 'short');\n if (style !== 'long' && style !== 'short' && style !== 'narrow' && style !== 'digital')\n style = 'short';\n let prevStyle = style === 'digital' ? 'numeric' : style;\n const hours = options.hours || prevStyle;\n prevStyle = hours === '2-digit' ? 'numeric' : hours;\n const minutes = options.minutes || prevStyle;\n prevStyle = minutes === '2-digit' ? 'numeric' : minutes;\n const seconds = options.seconds || prevStyle;\n prevStyle = seconds === '2-digit' ? 'numeric' : seconds;\n const milliseconds = options.milliseconds || prevStyle;\n __classPrivateFieldSet(this, _DurationFormat_options, {\n locale,\n style,\n years: options.years || style === 'digital' ? 'short' : style,\n yearsDisplay: options.yearsDisplay === 'always' ? 'always' : 'auto',\n months: options.months || style === 'digital' ? 'short' : style,\n monthsDisplay: options.monthsDisplay === 'always' ? 'always' : 'auto',\n weeks: options.weeks || style === 'digital' ? 'short' : style,\n weeksDisplay: options.weeksDisplay === 'always' ? 'always' : 'auto',\n days: options.days || style === 'digital' ? 'short' : style,\n daysDisplay: options.daysDisplay === 'always' ? 'always' : 'auto',\n hours,\n hoursDisplay: options.hoursDisplay === 'always' ? 'always' : style === 'digital' ? 'always' : 'auto',\n minutes,\n minutesDisplay: options.minutesDisplay === 'always' ? 'always' : style === 'digital' ? 'always' : 'auto',\n seconds,\n secondsDisplay: options.secondsDisplay === 'always' ? 'always' : style === 'digital' ? 'always' : 'auto',\n milliseconds,\n millisecondsDisplay: options.millisecondsDisplay === 'always' ? 'always' : 'auto',\n }, \"f\");\n }\n resolvedOptions() {\n return __classPrivateFieldGet(this, _DurationFormat_options, \"f\");\n }\n formatToParts(duration) {\n const list = [];\n const options = __classPrivateFieldGet(this, _DurationFormat_options, \"f\");\n const style = options.style;\n const locale = options.locale;\n for (const [unit, nfUnit] of partsTable) {\n const value = duration[unit];\n if (options[`${unit}Display`] === 'auto' && !value)\n continue;\n const unitStyle = options[unit];\n const nfOpts = unitStyle === '2-digit'\n ? twoDigitFormatOptions\n : unitStyle === 'numeric'\n ? {}\n : { style: 'unit', unit: nfUnit, unitDisplay: unitStyle };\n list.push(new Intl.NumberFormat(locale, nfOpts).format(value));\n }\n return new ListFormat(locale, {\n type: 'unit',\n style: style === 'digital' ? 'short' : style,\n }).formatToParts(list);\n }\n format(duration) {\n return this.formatToParts(duration)\n .map(p => p.value)\n .join('');\n }\n}\n_DurationFormat_options = new WeakMap();\n","import DurationFormat from './duration-format-ponyfill.js';\nconst durationRe = /^[-+]?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)S)?)?$/;\nexport const unitNames = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];\nexport const isDuration = (str) => durationRe.test(str);\nexport class Duration {\n constructor(years = 0, months = 0, weeks = 0, days = 0, hours = 0, minutes = 0, seconds = 0, milliseconds = 0) {\n this.years = years;\n this.months = months;\n this.weeks = weeks;\n this.days = days;\n this.hours = hours;\n this.minutes = minutes;\n this.seconds = seconds;\n this.milliseconds = milliseconds;\n this.years || (this.years = 0);\n this.sign || (this.sign = Math.sign(this.years));\n this.months || (this.months = 0);\n this.sign || (this.sign = Math.sign(this.months));\n this.weeks || (this.weeks = 0);\n this.sign || (this.sign = Math.sign(this.weeks));\n this.days || (this.days = 0);\n this.sign || (this.sign = Math.sign(this.days));\n this.hours || (this.hours = 0);\n this.sign || (this.sign = Math.sign(this.hours));\n this.minutes || (this.minutes = 0);\n this.sign || (this.sign = Math.sign(this.minutes));\n this.seconds || (this.seconds = 0);\n this.sign || (this.sign = Math.sign(this.seconds));\n this.milliseconds || (this.milliseconds = 0);\n this.sign || (this.sign = Math.sign(this.milliseconds));\n this.blank = this.sign === 0;\n }\n abs() {\n return new Duration(Math.abs(this.years), Math.abs(this.months), Math.abs(this.weeks), Math.abs(this.days), Math.abs(this.hours), Math.abs(this.minutes), Math.abs(this.seconds), Math.abs(this.milliseconds));\n }\n static from(durationLike) {\n var _a;\n if (typeof durationLike === 'string') {\n const str = String(durationLike).trim();\n const factor = str.startsWith('-') ? -1 : 1;\n const parsed = (_a = str\n .match(durationRe)) === null || _a === void 0 ? void 0 : _a.slice(1).map(x => (Number(x) || 0) * factor);\n if (!parsed)\n return new Duration();\n return new Duration(...parsed);\n }\n else if (typeof durationLike === 'object') {\n const { years, months, weeks, days, hours, minutes, seconds, milliseconds } = durationLike;\n return new Duration(years, months, weeks, days, hours, minutes, seconds, milliseconds);\n }\n throw new RangeError('invalid duration');\n }\n static compare(one, two) {\n const now = Date.now();\n const oneApplied = Math.abs(applyDuration(now, Duration.from(one)).getTime() - now);\n const twoApplied = Math.abs(applyDuration(now, Duration.from(two)).getTime() - now);\n return oneApplied > twoApplied ? -1 : oneApplied < twoApplied ? 1 : 0;\n }\n toLocaleString(locale, opts) {\n return new DurationFormat(locale, opts).format(this);\n }\n}\nexport function applyDuration(date, duration) {\n const r = new Date(date);\n r.setFullYear(r.getFullYear() + duration.years);\n r.setMonth(r.getMonth() + duration.months);\n r.setDate(r.getDate() + duration.weeks * 7 + duration.days);\n r.setHours(r.getHours() + duration.hours);\n r.setMinutes(r.getMinutes() + duration.minutes);\n r.setSeconds(r.getSeconds() + duration.seconds);\n return r;\n}\nexport function elapsedTime(date, precision = 'second', now = Date.now()) {\n const delta = date.getTime() - now;\n if (delta === 0)\n return new Duration();\n const sign = Math.sign(delta);\n const ms = Math.abs(delta);\n const sec = Math.floor(ms / 1000);\n const min = Math.floor(sec / 60);\n const hr = Math.floor(min / 60);\n const day = Math.floor(hr / 24);\n const month = Math.floor(day / 30);\n const year = Math.floor(month / 12);\n const i = unitNames.indexOf(precision) || unitNames.length;\n return new Duration(i >= 0 ? year * sign : 0, i >= 1 ? (month - year * 12) * sign : 0, 0, i >= 3 ? (day - month * 30) * sign : 0, i >= 4 ? (hr - day * 24) * sign : 0, i >= 5 ? (min - hr * 60) * sign : 0, i >= 6 ? (sec - min * 60) * sign : 0, i >= 7 ? (ms - sec * 1000) * sign : 0);\n}\nexport function roundToSingleUnit(duration, { relativeTo = Date.now() } = {}) {\n relativeTo = new Date(relativeTo);\n if (duration.blank)\n return duration;\n const sign = duration.sign;\n let years = Math.abs(duration.years);\n let months = Math.abs(duration.months);\n let weeks = Math.abs(duration.weeks);\n let days = Math.abs(duration.days);\n let hours = Math.abs(duration.hours);\n let minutes = Math.abs(duration.minutes);\n let seconds = Math.abs(duration.seconds);\n let milliseconds = Math.abs(duration.milliseconds);\n if (milliseconds >= 900)\n seconds += Math.round(milliseconds / 1000);\n if (seconds || minutes || hours || days || weeks || months || years) {\n milliseconds = 0;\n }\n if (seconds >= 55)\n minutes += Math.round(seconds / 60);\n if (minutes || hours || days || weeks || months || years)\n seconds = 0;\n if (minutes >= 55)\n hours += Math.round(minutes / 60);\n if (hours || days || weeks || months || years)\n minutes = 0;\n if (days && hours >= 12)\n days += Math.round(hours / 24);\n if (!days && hours >= 21)\n days += Math.round(hours / 24);\n if (days || weeks || months || years)\n hours = 0;\n const currentYear = relativeTo.getFullYear();\n const currentMonth = relativeTo.getMonth();\n const currentDate = relativeTo.getDate();\n if (days >= 27 || years + months + days) {\n const newMonthDate = new Date(relativeTo);\n newMonthDate.setDate(1);\n newMonthDate.setMonth(currentMonth + months * sign + 1);\n newMonthDate.setDate(0);\n const monthDateCorrection = Math.max(0, currentDate - newMonthDate.getDate());\n const newDate = new Date(relativeTo);\n newDate.setFullYear(currentYear + years * sign);\n newDate.setDate(currentDate - monthDateCorrection);\n newDate.setMonth(currentMonth + months * sign);\n newDate.setDate(currentDate - monthDateCorrection + days * sign);\n const yearDiff = newDate.getFullYear() - relativeTo.getFullYear();\n const monthDiff = newDate.getMonth() - relativeTo.getMonth();\n const daysDiff = Math.abs(Math.round((Number(newDate) - Number(relativeTo)) / 86400000)) + monthDateCorrection;\n const monthsDiff = Math.abs(yearDiff * 12 + monthDiff);\n if (daysDiff < 27) {\n if (days >= 6) {\n weeks += Math.round(days / 7);\n days = 0;\n }\n else {\n days = daysDiff;\n }\n months = years = 0;\n }\n else if (monthsDiff < 11) {\n months = monthsDiff;\n years = 0;\n }\n else {\n months = 0;\n years = yearDiff * sign;\n }\n if (months || years)\n days = 0;\n }\n if (years)\n months = 0;\n if (weeks >= 4)\n months += Math.round(weeks / 4);\n if (months || years)\n weeks = 0;\n if (days && weeks && !months && !years) {\n weeks += Math.round(days / 7);\n days = 0;\n }\n return new Duration(years * sign, months * sign, weeks * sign, days * sign, hours * sign, minutes * sign, seconds * sign, milliseconds * sign);\n}\nexport function getRelativeTimeUnit(duration, opts) {\n const rounded = roundToSingleUnit(duration, opts);\n if (rounded.blank)\n return [0, 'second'];\n for (const unit of unitNames) {\n if (unit === 'millisecond')\n continue;\n const val = rounded[`${unit}s`];\n if (val)\n return [val, unit];\n }\n return [0, 'second'];\n}\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _RelativeTimeElement_instances, _RelativeTimeElement_customTitle, _RelativeTimeElement_updating, _RelativeTimeElement_lang_get, _RelativeTimeElement_renderRoot, _RelativeTimeElement_getFormattedTitle, _RelativeTimeElement_resolveFormat, _RelativeTimeElement_getDurationFormat, _RelativeTimeElement_getRelativeFormat, _RelativeTimeElement_getDateTimeFormat, _RelativeTimeElement_onRelativeTimeUpdated;\nimport { Duration, elapsedTime, getRelativeTimeUnit, isDuration, roundToSingleUnit, unitNames } from './duration.js';\nconst HTMLElement = globalThis.HTMLElement || null;\nconst emptyDuration = new Duration();\nconst microEmptyDuration = new Duration(0, 0, 0, 0, 0, 1);\nexport class RelativeTimeUpdatedEvent extends Event {\n constructor(oldText, newText, oldTitle, newTitle) {\n super('relative-time-updated', { bubbles: true, composed: true });\n this.oldText = oldText;\n this.newText = newText;\n this.oldTitle = oldTitle;\n this.newTitle = newTitle;\n }\n}\nfunction getUnitFactor(el) {\n if (!el.date)\n return Infinity;\n if (el.format === 'duration' || el.format === 'elapsed') {\n const precision = el.precision;\n if (precision === 'second') {\n return 1000;\n }\n else if (precision === 'minute') {\n return 60 * 1000;\n }\n }\n const ms = Math.abs(Date.now() - el.date.getTime());\n if (ms < 60 * 1000)\n return 1000;\n if (ms < 60 * 60 * 1000)\n return 60 * 1000;\n return 60 * 60 * 1000;\n}\nconst dateObserver = new (class {\n constructor() {\n this.elements = new Set();\n this.time = Infinity;\n this.timer = -1;\n }\n observe(element) {\n if (this.elements.has(element))\n return;\n this.elements.add(element);\n const date = element.date;\n if (date && date.getTime()) {\n const ms = getUnitFactor(element);\n const time = Date.now() + ms;\n if (time < this.time) {\n clearTimeout(this.timer);\n this.timer = setTimeout(() => this.update(), ms);\n this.time = time;\n }\n }\n }\n unobserve(element) {\n if (!this.elements.has(element))\n return;\n this.elements.delete(element);\n }\n update() {\n clearTimeout(this.timer);\n if (!this.elements.size)\n return;\n let nearestDistance = Infinity;\n for (const timeEl of this.elements) {\n nearestDistance = Math.min(nearestDistance, getUnitFactor(timeEl));\n timeEl.update();\n }\n this.time = Math.min(60 * 60 * 1000, nearestDistance);\n this.timer = setTimeout(() => this.update(), this.time);\n this.time += Date.now();\n }\n})();\nexport class RelativeTimeElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _RelativeTimeElement_instances.add(this);\n _RelativeTimeElement_customTitle.set(this, false);\n _RelativeTimeElement_updating.set(this, false);\n _RelativeTimeElement_renderRoot.set(this, this.shadowRoot ? this.shadowRoot : this.attachShadow ? this.attachShadow({ mode: 'open' }) : this);\n _RelativeTimeElement_onRelativeTimeUpdated.set(this, null);\n }\n static define(tag = 'relative-time', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n static get observedAttributes() {\n return [\n 'second',\n 'minute',\n 'hour',\n 'weekday',\n 'day',\n 'month',\n 'year',\n 'time-zone-name',\n 'prefix',\n 'threshold',\n 'tense',\n 'precision',\n 'format',\n 'format-style',\n 'no-title',\n 'datetime',\n 'lang',\n 'title',\n ];\n }\n get onRelativeTimeUpdated() {\n return __classPrivateFieldGet(this, _RelativeTimeElement_onRelativeTimeUpdated, \"f\");\n }\n set onRelativeTimeUpdated(listener) {\n if (__classPrivateFieldGet(this, _RelativeTimeElement_onRelativeTimeUpdated, \"f\")) {\n this.removeEventListener('relative-time-updated', __classPrivateFieldGet(this, _RelativeTimeElement_onRelativeTimeUpdated, \"f\"));\n }\n __classPrivateFieldSet(this, _RelativeTimeElement_onRelativeTimeUpdated, typeof listener === 'object' || typeof listener === 'function' ? listener : null, \"f\");\n if (typeof listener === 'function') {\n this.addEventListener('relative-time-updated', listener);\n }\n }\n get second() {\n const second = this.getAttribute('second');\n if (second === 'numeric' || second === '2-digit')\n return second;\n }\n set second(value) {\n this.setAttribute('second', value || '');\n }\n get minute() {\n const minute = this.getAttribute('minute');\n if (minute === 'numeric' || minute === '2-digit')\n return minute;\n }\n set minute(value) {\n this.setAttribute('minute', value || '');\n }\n get hour() {\n const hour = this.getAttribute('hour');\n if (hour === 'numeric' || hour === '2-digit')\n return hour;\n }\n set hour(value) {\n this.setAttribute('hour', value || '');\n }\n get weekday() {\n const weekday = this.getAttribute('weekday');\n if (weekday === 'long' || weekday === 'short' || weekday === 'narrow') {\n return weekday;\n }\n if (this.format === 'datetime' && weekday !== '')\n return this.formatStyle;\n }\n set weekday(value) {\n this.setAttribute('weekday', value || '');\n }\n get day() {\n var _a;\n const day = (_a = this.getAttribute('day')) !== null && _a !== void 0 ? _a : 'numeric';\n if (day === 'numeric' || day === '2-digit')\n return day;\n }\n set day(value) {\n this.setAttribute('day', value || '');\n }\n get month() {\n const format = this.format;\n let month = this.getAttribute('month');\n if (month === '')\n return;\n month !== null && month !== void 0 ? month : (month = format === 'datetime' ? this.formatStyle : 'short');\n if (month === 'numeric' || month === '2-digit' || month === 'short' || month === 'long' || month === 'narrow') {\n return month;\n }\n }\n set month(value) {\n this.setAttribute('month', value || '');\n }\n get year() {\n var _a;\n const year = this.getAttribute('year');\n if (year === 'numeric' || year === '2-digit')\n return year;\n if (!this.hasAttribute('year') && new Date().getUTCFullYear() !== ((_a = this.date) === null || _a === void 0 ? void 0 : _a.getUTCFullYear())) {\n return 'numeric';\n }\n }\n set year(value) {\n this.setAttribute('year', value || '');\n }\n get timeZoneName() {\n const name = this.getAttribute('time-zone-name');\n if (name === 'long' ||\n name === 'short' ||\n name === 'shortOffset' ||\n name === 'longOffset' ||\n name === 'shortGeneric' ||\n name === 'longGeneric') {\n return name;\n }\n }\n set timeZoneName(value) {\n this.setAttribute('time-zone-name', value || '');\n }\n get prefix() {\n var _a;\n return (_a = this.getAttribute('prefix')) !== null && _a !== void 0 ? _a : (this.format === 'datetime' ? '' : 'on');\n }\n set prefix(value) {\n this.setAttribute('prefix', value);\n }\n get threshold() {\n const threshold = this.getAttribute('threshold');\n return threshold && isDuration(threshold) ? threshold : 'P30D';\n }\n set threshold(value) {\n this.setAttribute('threshold', value);\n }\n get tense() {\n const tense = this.getAttribute('tense');\n if (tense === 'past')\n return 'past';\n if (tense === 'future')\n return 'future';\n return 'auto';\n }\n set tense(value) {\n this.setAttribute('tense', value);\n }\n get precision() {\n const precision = this.getAttribute('precision');\n if (unitNames.includes(precision))\n return precision;\n if (this.format === 'micro')\n return 'minute';\n return 'second';\n }\n set precision(value) {\n this.setAttribute('precision', value);\n }\n get format() {\n const format = this.getAttribute('format');\n if (format === 'datetime')\n return 'datetime';\n if (format === 'relative')\n return 'relative';\n if (format === 'duration')\n return 'duration';\n if (format === 'micro')\n return 'micro';\n if (format === 'elapsed')\n return 'elapsed';\n return 'auto';\n }\n set format(value) {\n this.setAttribute('format', value);\n }\n get formatStyle() {\n const formatStyle = this.getAttribute('format-style');\n if (formatStyle === 'long')\n return 'long';\n if (formatStyle === 'short')\n return 'short';\n if (formatStyle === 'narrow')\n return 'narrow';\n const format = this.format;\n if (format === 'elapsed' || format === 'micro')\n return 'narrow';\n if (format === 'datetime')\n return 'short';\n return 'long';\n }\n set formatStyle(value) {\n this.setAttribute('format-style', value);\n }\n get noTitle() {\n return this.hasAttribute('no-title');\n }\n set noTitle(value) {\n this.toggleAttribute('no-title', value);\n }\n get datetime() {\n return this.getAttribute('datetime') || '';\n }\n set datetime(value) {\n this.setAttribute('datetime', value);\n }\n get date() {\n const parsed = Date.parse(this.datetime);\n return Number.isNaN(parsed) ? null : new Date(parsed);\n }\n set date(value) {\n this.datetime = (value === null || value === void 0 ? void 0 : value.toISOString()) || '';\n }\n connectedCallback() {\n this.update();\n }\n disconnectedCallback() {\n dateObserver.unobserve(this);\n }\n attributeChangedCallback(attrName, oldValue, newValue) {\n if (oldValue === newValue)\n return;\n if (attrName === 'title') {\n __classPrivateFieldSet(this, _RelativeTimeElement_customTitle, newValue !== null && (this.date && __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getFormattedTitle).call(this, this.date)) !== newValue, \"f\");\n }\n if (!__classPrivateFieldGet(this, _RelativeTimeElement_updating, \"f\") && !(attrName === 'title' && __classPrivateFieldGet(this, _RelativeTimeElement_customTitle, \"f\"))) {\n __classPrivateFieldSet(this, _RelativeTimeElement_updating, (async () => {\n await Promise.resolve();\n this.update();\n __classPrivateFieldSet(this, _RelativeTimeElement_updating, false, \"f\");\n })(), \"f\");\n }\n }\n update() {\n const oldText = __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\").textContent || this.textContent || '';\n const oldTitle = this.getAttribute('title') || '';\n let newTitle = oldTitle;\n const date = this.date;\n if (typeof Intl === 'undefined' || !Intl.DateTimeFormat || !date) {\n __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\").textContent = oldText;\n return;\n }\n const now = Date.now();\n if (!__classPrivateFieldGet(this, _RelativeTimeElement_customTitle, \"f\")) {\n newTitle = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getFormattedTitle).call(this, date) || '';\n if (newTitle && !this.noTitle)\n this.setAttribute('title', newTitle);\n }\n const duration = elapsedTime(date, this.precision, now);\n const format = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_resolveFormat).call(this, duration);\n let newText = oldText;\n if (format === 'duration') {\n newText = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getDurationFormat).call(this, duration);\n }\n else if (format === 'relative') {\n newText = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getRelativeFormat).call(this, duration);\n }\n else {\n newText = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getDateTimeFormat).call(this, date);\n }\n if (newText) {\n __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\").textContent = newText;\n }\n else if (this.shadowRoot === __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\") && this.textContent) {\n __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\").textContent = this.textContent;\n }\n if (newText !== oldText || newTitle !== oldTitle) {\n this.dispatchEvent(new RelativeTimeUpdatedEvent(oldText, newText, oldTitle, newTitle));\n }\n if (format === 'relative' || format === 'duration') {\n dateObserver.observe(this);\n }\n else {\n dateObserver.unobserve(this);\n }\n }\n}\n_RelativeTimeElement_customTitle = new WeakMap(), _RelativeTimeElement_updating = new WeakMap(), _RelativeTimeElement_renderRoot = new WeakMap(), _RelativeTimeElement_onRelativeTimeUpdated = new WeakMap(), _RelativeTimeElement_instances = new WeakSet(), _RelativeTimeElement_lang_get = function _RelativeTimeElement_lang_get() {\n var _a;\n return (((_a = this.closest('[lang]')) === null || _a === void 0 ? void 0 : _a.getAttribute('lang')) ||\n this.ownerDocument.documentElement.getAttribute('lang') ||\n 'default');\n}, _RelativeTimeElement_getFormattedTitle = function _RelativeTimeElement_getFormattedTitle(date) {\n return new Intl.DateTimeFormat(__classPrivateFieldGet(this, _RelativeTimeElement_instances, \"a\", _RelativeTimeElement_lang_get), {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short',\n }).format(date);\n}, _RelativeTimeElement_resolveFormat = function _RelativeTimeElement_resolveFormat(duration) {\n const format = this.format;\n if (format === 'datetime')\n return 'datetime';\n if (format === 'duration')\n return 'duration';\n if (format === 'elapsed')\n return 'duration';\n if (format === 'micro')\n return 'duration';\n if ((format === 'auto' || format === 'relative') && typeof Intl !== 'undefined' && Intl.RelativeTimeFormat) {\n const tense = this.tense;\n if (tense === 'past' || tense === 'future')\n return 'relative';\n if (Duration.compare(duration, this.threshold) === 1)\n return 'relative';\n }\n return 'datetime';\n}, _RelativeTimeElement_getDurationFormat = function _RelativeTimeElement_getDurationFormat(duration) {\n const locale = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"a\", _RelativeTimeElement_lang_get);\n const format = this.format;\n const style = this.formatStyle;\n const tense = this.tense;\n let empty = emptyDuration;\n if (format === 'micro') {\n duration = roundToSingleUnit(duration);\n empty = microEmptyDuration;\n if ((this.tense === 'past' && duration.sign !== -1) || (this.tense === 'future' && duration.sign !== 1)) {\n duration = microEmptyDuration;\n }\n }\n else if ((tense === 'past' && duration.sign !== -1) || (tense === 'future' && duration.sign !== 1)) {\n duration = empty;\n }\n const display = `${this.precision}sDisplay`;\n if (duration.blank) {\n return empty.toLocaleString(locale, { style, [display]: 'always' });\n }\n return duration.abs().toLocaleString(locale, { style });\n}, _RelativeTimeElement_getRelativeFormat = function _RelativeTimeElement_getRelativeFormat(duration) {\n const relativeFormat = new Intl.RelativeTimeFormat(__classPrivateFieldGet(this, _RelativeTimeElement_instances, \"a\", _RelativeTimeElement_lang_get), {\n numeric: 'auto',\n style: this.formatStyle,\n });\n const tense = this.tense;\n if (tense === 'future' && duration.sign !== 1)\n duration = emptyDuration;\n if (tense === 'past' && duration.sign !== -1)\n duration = emptyDuration;\n const [int, unit] = getRelativeTimeUnit(duration);\n if (unit === 'second' && int < 10) {\n return relativeFormat.format(0, this.precision === 'millisecond' ? 'second' : this.precision);\n }\n return relativeFormat.format(int, unit);\n}, _RelativeTimeElement_getDateTimeFormat = function _RelativeTimeElement_getDateTimeFormat(date) {\n const formatter = new Intl.DateTimeFormat(__classPrivateFieldGet(this, _RelativeTimeElement_instances, \"a\", _RelativeTimeElement_lang_get), {\n second: this.second,\n minute: this.minute,\n hour: this.hour,\n weekday: this.weekday,\n day: this.day,\n month: this.month,\n year: this.year,\n timeZoneName: this.timeZoneName,\n });\n return `${this.prefix} ${formatter.format(date)}`.trim();\n};\nexport default RelativeTimeElement;\n","import { RelativeTimeElement } from './relative-time-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.RelativeTimeElement = RelativeTimeElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default RelativeTimeElement;\nexport * from './relative-time-element.js';\n","function getTabs(el) {\n return Array.from(el.querySelectorAll('[role=\"tablist\"] [role=\"tab\"]')).filter(tab => tab instanceof HTMLElement && tab.closest(el.tagName) === el);\n}\nfunction getNavigationKeyCodes(vertical) {\n if (vertical) {\n return [\n ['ArrowDown', 'ArrowRight'],\n ['ArrowUp', 'ArrowLeft'],\n ];\n }\n else {\n return [['ArrowRight'], ['ArrowLeft']];\n }\n}\nexport class TabContainerElement extends HTMLElement {\n static define(tag = 'tab-container', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n connectedCallback() {\n this.addEventListener('keydown', (event) => {\n var _a;\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n if (target.closest(this.tagName) !== this)\n return;\n if (target.getAttribute('role') !== 'tab' && !target.closest('[role=\"tablist\"]'))\n return;\n const tabs = getTabs(this);\n const currentIndex = tabs.indexOf(tabs.find(tab => tab.matches('[aria-selected=\"true\"]')));\n const [incrementKeys, decrementKeys] = getNavigationKeyCodes(((_a = target.closest('[role=\"tablist\"]')) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-orientation')) === 'vertical');\n if (incrementKeys.some(code => event.code === code)) {\n let index = currentIndex + 1;\n if (index >= tabs.length)\n index = 0;\n this.selectTab(index);\n }\n else if (decrementKeys.some(code => event.code === code)) {\n let index = currentIndex - 1;\n if (index < 0)\n index = tabs.length - 1;\n this.selectTab(index);\n }\n else if (event.code === 'Home') {\n this.selectTab(0);\n event.preventDefault();\n }\n else if (event.code === 'End') {\n this.selectTab(tabs.length - 1);\n event.preventDefault();\n }\n });\n this.addEventListener('click', (event) => {\n const tabs = getTabs(this);\n if (!(event.target instanceof Element))\n return;\n if (event.target.closest(this.tagName) !== this)\n return;\n const tab = event.target.closest('[role=\"tab\"]');\n if (!(tab instanceof HTMLElement) || !tab.closest('[role=\"tablist\"]')) {\n return;\n }\n const index = tabs.indexOf(tab);\n this.selectTab(index);\n });\n for (const tab of getTabs(this)) {\n if (!tab.hasAttribute('aria-selected')) {\n tab.setAttribute('aria-selected', 'false');\n }\n if (!tab.hasAttribute('tabindex')) {\n if (tab.getAttribute('aria-selected') === 'true') {\n tab.setAttribute('tabindex', '0');\n }\n else {\n tab.setAttribute('tabindex', '-1');\n }\n }\n }\n }\n selectTab(index) {\n const tabs = getTabs(this);\n const panels = Array.from(this.querySelectorAll('[role=\"tabpanel\"]')).filter(panel => panel.closest(this.tagName) === this);\n if (index > tabs.length - 1) {\n throw new RangeError(`Index \"${index}\" out of bounds`);\n }\n const selectedTab = tabs[index];\n const selectedPanel = panels[index];\n const cancelled = !this.dispatchEvent(new CustomEvent('tab-container-change', {\n bubbles: true,\n cancelable: true,\n detail: { relatedTarget: selectedPanel },\n }));\n if (cancelled)\n return;\n for (const tab of tabs) {\n tab.setAttribute('aria-selected', 'false');\n tab.setAttribute('tabindex', '-1');\n }\n for (const panel of panels) {\n panel.hidden = true;\n if (!panel.hasAttribute('tabindex') && !panel.hasAttribute('data-tab-container-no-tabstop')) {\n panel.setAttribute('tabindex', '0');\n }\n }\n selectedTab.setAttribute('aria-selected', 'true');\n selectedTab.setAttribute('tabindex', '0');\n selectedTab.focus();\n selectedPanel.hidden = false;\n this.dispatchEvent(new CustomEvent('tab-container-changed', {\n bubbles: true,\n detail: { relatedTarget: selectedPanel },\n }));\n }\n}\n","import { TabContainerElement } from './tab-container-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.TabContainerElement = TabContainerElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default TabContainerElement;\nexport * from './tab-container-element.js';\n","/* eslint-disable custom-elements/expose-class-on-global */\nimport {controller, targets} from '@github/catalyst'\n\n@controller\nexport class PrimerMultiInputElement extends HTMLElement {\n @targets fields: HTMLInputElement[]\n\n activateField(name: string) {\n const fieldWithName = this.findField(name)\n if (!fieldWithName) return\n\n for (const field of this.fields) {\n if (field === fieldWithName) continue\n\n field.setAttribute('disabled', 'disabled')\n field.setAttribute('hidden', 'hidden')\n\n field.parentElement?.setAttribute('hidden', 'hidden')\n }\n\n fieldWithName.removeAttribute('disabled')\n fieldWithName.removeAttribute('hidden')\n fieldWithName.parentElement?.removeAttribute('hidden')\n }\n\n private findField(name: string): HTMLElement | null {\n for (const field of this.fields) {\n if (field.getAttribute('data-name') === name) {\n return field\n }\n }\n\n return null\n }\n}\n\ndeclare global {\n interface Window {\n PrimerMultiInputElement: typeof PrimerMultiInputElement\n }\n}\n\nif (!window.customElements.get('primer-multi-input')) {\n Object.assign(window, {PrimerMultiInputElement})\n window.customElements.define('primer-multi-input', PrimerMultiInputElement)\n}\n","export function throttle(callback, wait = 0, { start = true, middle = true, once = false } = {}) {\n let last = 0;\n let timer;\n let cancelled = false;\n function fn(...args) {\n if (cancelled)\n return;\n const delta = Date.now() - last;\n last = Date.now();\n if (start) {\n start = false;\n callback.apply(this, args);\n if (once)\n fn.cancel();\n }\n else if ((middle && delta < wait) || !middle) {\n clearTimeout(timer);\n timer = setTimeout(() => {\n last = Date.now();\n callback.apply(this, args);\n if (once)\n fn.cancel();\n }, !middle ? wait : wait - delta);\n }\n }\n fn.cancel = () => {\n clearTimeout(timer);\n cancelled = true;\n };\n return fn;\n}\nexport function debounce(callback, wait = 0, { start = false, middle = false, once = false } = {}) {\n return throttle(callback, wait, { start, middle, once });\n}\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _AutoCheckElement_onloadend;\nimport { debounce } from '@github/mini-throttle';\nvar AllowedHttpMethods;\n(function (AllowedHttpMethods) {\n AllowedHttpMethods[\"GET\"] = \"GET\";\n AllowedHttpMethods[\"POST\"] = \"POST\";\n})(AllowedHttpMethods || (AllowedHttpMethods = {}));\nconst states = new WeakMap();\nclass AutoCheckEvent extends Event {\n constructor(phase) {\n super(`auto-check-${phase}`, { bubbles: true });\n this.phase = phase;\n }\n get detail() {\n return this;\n }\n}\nclass AutoCheckValidationEvent extends AutoCheckEvent {\n constructor(phase, message = '') {\n super(phase);\n this.phase = phase;\n this.message = message;\n this.setValidity = (message) => {\n this.message = message;\n };\n }\n}\nexport class AutoCheckCompleteEvent extends AutoCheckEvent {\n constructor() {\n super('complete');\n }\n}\nexport class AutoCheckSuccessEvent extends AutoCheckEvent {\n constructor(response) {\n super('success');\n this.response = response;\n }\n}\nexport class AutoCheckStartEvent extends AutoCheckValidationEvent {\n constructor() {\n super('start', 'Verifying…');\n }\n}\nexport class AutoCheckErrorEvent extends AutoCheckValidationEvent {\n constructor(response) {\n super('error', 'Validation failed');\n this.response = response;\n }\n}\nexport class AutoCheckSendEvent extends AutoCheckEvent {\n constructor(body) {\n super('send');\n this.body = body;\n }\n}\nexport class AutoCheckElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _AutoCheckElement_onloadend.set(this, null);\n }\n static define(tag = 'auto-check', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n get onloadend() {\n return __classPrivateFieldGet(this, _AutoCheckElement_onloadend, \"f\");\n }\n set onloadend(listener) {\n if (__classPrivateFieldGet(this, _AutoCheckElement_onloadend, \"f\")) {\n this.removeEventListener('loadend', __classPrivateFieldGet(this, _AutoCheckElement_onloadend, \"f\"));\n }\n __classPrivateFieldSet(this, _AutoCheckElement_onloadend, typeof listener === 'object' || typeof listener === 'function' ? listener : null, \"f\");\n if (typeof listener === 'function') {\n this.addEventListener('loadend', listener);\n }\n }\n connectedCallback() {\n const input = this.input;\n if (!input)\n return;\n const checker = debounce(check.bind(null, this), 300);\n const state = { check: checker, controller: null };\n states.set(this, state);\n input.addEventListener('input', setLoadingState);\n input.addEventListener('input', checker);\n input.autocomplete = 'off';\n input.spellcheck = false;\n }\n disconnectedCallback() {\n const input = this.input;\n if (!input)\n return;\n const state = states.get(this);\n if (!state)\n return;\n states.delete(this);\n input.removeEventListener('input', setLoadingState);\n input.removeEventListener('input', state.check);\n input.setCustomValidity('');\n }\n attributeChangedCallback(name) {\n if (name === 'required') {\n const input = this.input;\n if (!input)\n return;\n input.required = this.required;\n }\n }\n static get observedAttributes() {\n return ['required'];\n }\n get input() {\n return this.querySelector('input');\n }\n get src() {\n const src = this.getAttribute('src');\n if (!src)\n return '';\n const link = this.ownerDocument.createElement('a');\n link.href = src;\n return link.href;\n }\n set src(value) {\n this.setAttribute('src', value);\n }\n get csrf() {\n const csrfElement = this.querySelector('[data-csrf]');\n return this.getAttribute('csrf') || (csrfElement instanceof HTMLInputElement && csrfElement.value) || '';\n }\n set csrf(value) {\n this.setAttribute('csrf', value);\n }\n get required() {\n return this.hasAttribute('required');\n }\n set required(required) {\n if (required) {\n this.setAttribute('required', '');\n }\n else {\n this.removeAttribute('required');\n }\n }\n get csrfField() {\n return this.getAttribute('csrf-field') || 'authenticity_token';\n }\n set csrfField(value) {\n this.setAttribute('csrf-field', value);\n }\n get httpMethod() {\n return AllowedHttpMethods[this.getAttribute('http-method')] || 'POST';\n }\n}\n_AutoCheckElement_onloadend = new WeakMap();\nfunction setLoadingState(event) {\n const input = event.currentTarget;\n if (!(input instanceof HTMLInputElement))\n return;\n const autoCheckElement = input.closest('auto-check');\n if (!(autoCheckElement instanceof AutoCheckElement))\n return;\n const src = autoCheckElement.src;\n const csrf = autoCheckElement.csrf;\n const httpMethod = autoCheckElement.httpMethod;\n const state = states.get(autoCheckElement);\n if (!src || (httpMethod === 'POST' && !csrf) || !state) {\n return;\n }\n const startEvent = new AutoCheckStartEvent();\n input.dispatchEvent(startEvent);\n if (autoCheckElement.required) {\n input.setCustomValidity(startEvent.message);\n }\n}\nfunction makeAbortController() {\n if ('AbortController' in window) {\n return new AbortController();\n }\n return {\n signal: null,\n abort() {\n },\n };\n}\nasync function fetchWithNetworkEvents(el, url, options) {\n if (options.method === 'GET') {\n delete options.body;\n }\n try {\n const response = await fetch(url, options);\n el.dispatchEvent(new Event('load'));\n el.dispatchEvent(new Event('loadend'));\n return response;\n }\n catch (error) {\n if (error.name !== 'AbortError') {\n el.dispatchEvent(new Event('error'));\n el.dispatchEvent(new Event('loadend'));\n }\n throw error;\n }\n}\nasync function check(autoCheckElement) {\n const input = autoCheckElement.input;\n if (!input) {\n return;\n }\n const csrfField = autoCheckElement.csrfField;\n const src = autoCheckElement.src;\n const csrf = autoCheckElement.csrf;\n const state = states.get(autoCheckElement);\n const httpMethod = autoCheckElement.httpMethod;\n if (!src || (httpMethod === 'POST' && !csrf) || !state) {\n if (autoCheckElement.required) {\n input.setCustomValidity('');\n }\n return;\n }\n if (!input.value.trim()) {\n if (autoCheckElement.required) {\n input.setCustomValidity('');\n }\n return;\n }\n const body = new FormData();\n const url = new URL(src, window.location.origin);\n if (httpMethod === 'POST') {\n body.append(csrfField, csrf);\n body.append('value', input.value);\n }\n else {\n url.search = new URLSearchParams({ value: input.value }).toString();\n }\n input.dispatchEvent(new AutoCheckSendEvent(body));\n if (state.controller) {\n state.controller.abort();\n }\n else {\n autoCheckElement.dispatchEvent(new Event('loadstart'));\n }\n state.controller = makeAbortController();\n try {\n const response = await fetchWithNetworkEvents(autoCheckElement, url.toString(), {\n credentials: 'same-origin',\n signal: state.controller.signal,\n method: httpMethod,\n body,\n });\n if (response.ok) {\n if (autoCheckElement.required) {\n input.setCustomValidity('');\n }\n input.dispatchEvent(new AutoCheckSuccessEvent(response.clone()));\n }\n else {\n const event = new AutoCheckErrorEvent(response.clone());\n input.dispatchEvent(event);\n if (autoCheckElement.required) {\n input.setCustomValidity(event.message);\n }\n }\n state.controller = null;\n input.dispatchEvent(new AutoCheckCompleteEvent());\n }\n catch (error) {\n if (error.name !== 'AbortError') {\n state.controller = null;\n input.dispatchEvent(new AutoCheckCompleteEvent());\n }\n }\n}\nexport default AutoCheckElement;\n","import { AutoCheckElement } from './auto-check-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.AutoCheckElement = AutoCheckElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default AutoCheckElement;\nexport * from './auto-check-element.js';\n","/* eslint-disable custom-elements/expose-class-on-global */\n\nimport '@github/auto-check-element'\nimport type {AutoCheckErrorEvent, AutoCheckSuccessEvent} from '@github/auto-check-element'\nimport {controller, target} from '@github/catalyst'\n\ndeclare global {\n interface HTMLElementEventMap {\n 'auto-check-success': AutoCheckSuccessEvent\n 'auto-check-error': AutoCheckErrorEvent\n }\n}\n\n@controller\nexport class PrimerTextFieldElement extends HTMLElement {\n @target inputElement: HTMLInputElement\n @target validationElement: HTMLElement\n @target validationMessageElement: HTMLElement\n @target validationSuccessIcon: HTMLElement\n @target validationErrorIcon: HTMLElement\n @target leadingVisual: HTMLElement\n @target leadingSpinner: HTMLElement\n\n #abortController: AbortController | null\n\n connectedCallback(): void {\n this.#abortController?.abort()\n const {signal} = (this.#abortController = new AbortController())\n\n this.addEventListener(\n 'auto-check-success',\n async (event: AutoCheckSuccessEvent) => {\n const message = await event.detail.response.text()\n if (message && message.length > 0) {\n this.setSuccess(message)\n } else {\n this.clearError()\n }\n },\n {signal},\n )\n\n this.addEventListener(\n 'auto-check-error',\n async (event: AutoCheckErrorEvent) => {\n const errorMessage = await event.detail.response.text()\n this.setError(errorMessage)\n },\n {signal},\n )\n }\n\n disconnectedCallback() {\n this.#abortController?.abort()\n }\n\n clearContents() {\n this.inputElement.value = ''\n this.inputElement.focus()\n this.inputElement.dispatchEvent(new Event('input', { bubbles: true, cancelable: false }))\n }\n\n clearError(): void {\n this.inputElement.removeAttribute('invalid')\n this.validationElement.hidden = true\n this.validationMessageElement.replaceChildren()\n }\n\n setValidationMessage(message: string): void {\n const template = document.createElement('template')\n // eslint-disable-next-line github/no-inner-html\n template.innerHTML = message\n const fragment = document.importNode(template.content, true)\n this.validationMessageElement.replaceChildren(fragment)\n }\n\n toggleValidationStyling(isError: boolean): void {\n if (isError) {\n this.validationElement.classList.remove('FormControl-inlineValidation--success')\n } else {\n this.validationElement.classList.add('FormControl-inlineValidation--success')\n }\n this.validationSuccessIcon.hidden = isError\n this.validationErrorIcon.hidden = !isError\n this.inputElement.setAttribute('invalid', isError ? 'true' : 'false')\n }\n\n setSuccess(message: string): void {\n this.toggleValidationStyling(false)\n this.setValidationMessage(message)\n this.validationElement.hidden = false\n }\n\n setError(message: string): void {\n this.toggleValidationStyling(true)\n this.setValidationMessage(message)\n this.validationElement.hidden = false\n }\n\n showLeadingSpinner(): void {\n this.leadingSpinner?.removeAttribute('hidden')\n this.leadingVisual?.setAttribute('hidden', '')\n }\n\n hideLeadingSpinner(): void {\n this.leadingSpinner?.setAttribute('hidden', '')\n this.leadingVisual?.removeAttribute('hidden')\n }\n}\n","/* eslint-disable custom-elements/expose-class-on-global */\n\nimport {controller, target} from '@github/catalyst'\n\n@controller\nexport class ToggleSwitchInputElement extends HTMLElement {\n @target validationElement: HTMLElement\n @target validationMessageElement: HTMLElement\n\n connectedCallback() {\n this.addEventListener('toggleSwitchError', (event: Event) => {\n this.validationMessageElement.textContent = (event as CustomEvent).detail\n this.validationElement.removeAttribute('hidden')\n })\n\n this.addEventListener('toggleSwitchSuccess', () => {\n this.validationMessageElement.textContent = ''\n this.validationElement.setAttribute('hidden', 'hidden')\n })\n\n this.addEventListener('toggleSwitchLoading', () => {\n this.validationMessageElement.textContent = ''\n this.validationElement.setAttribute('hidden', 'hidden')\n })\n }\n}\n","import {controller, target} from '@github/catalyst'\nimport '@oddbird/popover-polyfill'\nimport type {IncludeFragmentElement} from '@github/include-fragment-element'\n\ntype SelectVariant = 'none' | 'single' | 'multiple' | null\ntype SelectedItem = {\n label: string | null | undefined\n value: string | null | undefined\n element: Element\n}\n\nconst validSelectors = ['[role=\"menuitem\"]', '[role=\"menuitemcheckbox\"]', '[role=\"menuitemradio\"]']\nconst menuItemSelectors = validSelectors.map(selector => `:not([hidden]) > ${selector}`)\n\n@controller\nexport class ActionMenuElement extends HTMLElement {\n @target\n includeFragment: IncludeFragmentElement\n\n #abortController: AbortController\n #originalLabel = ''\n #inputName = ''\n #invokerBeingClicked = false\n\n get selectVariant(): SelectVariant {\n return this.getAttribute('data-select-variant') as SelectVariant\n }\n\n set selectVariant(variant: SelectVariant) {\n if (variant) {\n this.setAttribute('data-select-variant', variant)\n } else {\n this.removeAttribute('variant')\n }\n }\n\n get dynamicLabelPrefix(): string {\n const prefix = this.getAttribute('data-dynamic-label-prefix')\n if (!prefix) return ''\n return `${prefix}:`\n }\n\n set dynamicLabelPrefix(value: string) {\n this.setAttribute('data-dynamic-label', value)\n }\n\n get dynamicLabel(): boolean {\n return this.hasAttribute('data-dynamic-label')\n }\n\n set dynamicLabel(value: boolean) {\n this.toggleAttribute('data-dynamic-label', value)\n }\n\n get popoverElement(): HTMLElement | null {\n return (this.invokerElement?.popoverTargetElement as HTMLElement) || null\n }\n\n get invokerElement(): HTMLButtonElement | null {\n const id = this.querySelector('[role=menu]')?.id\n if (!id) return null\n for (const el of this.querySelectorAll(`[aria-controls]`)) {\n if (el.getAttribute('aria-controls') === id) {\n return el as HTMLButtonElement\n }\n }\n return null\n }\n\n get invokerLabel(): HTMLElement | null {\n if (!this.invokerElement) return null\n return this.invokerElement.querySelector('.Button-label')\n }\n\n get selectedItems(): SelectedItem[] {\n const selectedItems = this.querySelectorAll('[aria-checked=true]')\n const results: SelectedItem[] = []\n\n for (const selectedItem of selectedItems) {\n const labelEl = selectedItem.querySelector('.ActionListItem-label')\n\n results.push({\n label: labelEl?.textContent,\n value: selectedItem?.getAttribute('data-value'),\n element: selectedItem,\n })\n }\n\n return results\n }\n\n connectedCallback() {\n const {signal} = (this.#abortController = new AbortController())\n this.addEventListener('keydown', this, {signal})\n this.addEventListener('click', this, {signal})\n this.addEventListener('mouseover', this, {signal})\n this.addEventListener('focusout', this, {signal})\n this.addEventListener('mousedown', this, {signal})\n this.popoverElement?.addEventListener('toggle', this, {signal})\n this.#setDynamicLabel()\n this.#updateInput()\n this.#softDisableItems()\n\n if (this.includeFragment) {\n this.includeFragment.addEventListener('include-fragment-replaced', this, {\n signal,\n })\n }\n }\n\n disconnectedCallback() {\n this.#abortController.abort()\n }\n\n #softDisableItems() {\n const {signal} = this.#abortController\n\n for (const item of this.querySelectorAll(validSelectors.join(','))) {\n item.addEventListener('click', this.#potentiallyDisallowActivation.bind(this), {signal})\n item.addEventListener('keydown', this.#potentiallyDisallowActivation.bind(this), {signal})\n }\n }\n\n // returns true if activation was prevented\n #potentiallyDisallowActivation(event: Event): boolean {\n if (!this.#isActivation(event)) return false\n\n const item = (event.target as HTMLElement).closest(menuItemSelectors.join(','))\n if (!item) return false\n\n if (item.getAttribute('aria-disabled')) {\n event.preventDefault()\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopImmediatePropagation()\n return true\n }\n\n return false\n }\n\n #isAnchorActivationViaSpace(event: Event): boolean {\n return (\n event.target instanceof HTMLAnchorElement &&\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&\n event.key === ' '\n )\n }\n\n #isActivation(event: Event): boolean {\n // Some browsers fire MouseEvents (Firefox) and others fire PointerEvents (Chrome). Activating an item via\n // enter or space counterintuitively fires one of these rather than a KeyboardEvent. Since PointerEvent\n // inherits from MouseEvent, it is enough to check for MouseEvent here.\n return (event instanceof MouseEvent && event.type === 'click') || this.#isAnchorActivationViaSpace(event)\n }\n\n handleEvent(event: Event) {\n const targetIsInvoker = this.invokerElement?.contains(event.target as HTMLElement)\n const eventIsActivation = this.#isActivation(event)\n\n if (event.type === 'toggle' && (event as ToggleEvent).newState === 'open') {\n this.#firstItem?.focus()\n }\n\n if (targetIsInvoker && event.type === 'mousedown') {\n this.#invokerBeingClicked = true\n return\n }\n\n // Prevent safari bug that dismisses menu on mousedown instead of allowing\n // the click event to propagate to the button\n if (event.type === 'mousedown') {\n event.preventDefault()\n return\n }\n\n if (targetIsInvoker && eventIsActivation) {\n this.#handleInvokerActivated(event)\n this.#invokerBeingClicked = false\n return\n }\n\n if (event.type === 'focusout') {\n if (this.#invokerBeingClicked) return\n\n // Give the browser time to focus the next element\n requestAnimationFrame(() => {\n if (!this.contains(document.activeElement) || document.activeElement === this.invokerElement) {\n this.#handleFocusOut()\n }\n })\n\n return\n }\n\n const item = (event.target as Element).closest(menuItemSelectors.join(','))\n const targetIsItem = item !== null\n\n if (targetIsItem && eventIsActivation) {\n if (this.#potentiallyDisallowActivation(event)) return\n\n const dialogInvoker = item.closest('[data-show-dialog-id]')\n\n if (dialogInvoker) {\n const dialog = this.ownerDocument.getElementById(dialogInvoker.getAttribute('data-show-dialog-id') || '')\n\n if (dialog && this.contains(dialogInvoker)) {\n this.#handleDialogItemActivated(event, dialog)\n return\n }\n }\n\n // Pressing the space key on a link will cause the page to scroll unless preventDefault() is called.\n // We then click it manually to navigate.\n if (this.#isAnchorActivationViaSpace(event)) {\n event.preventDefault()\n ;(item as HTMLElement).click()\n }\n\n this.#handleItemActivated(item)\n\n return\n }\n\n if (event.type === 'include-fragment-replaced') {\n this.#handleIncludeFragmentReplaced()\n }\n }\n\n #handleInvokerActivated(event: Event) {\n event.preventDefault()\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n\n if (this.#isOpen()) {\n this.#hide()\n } else {\n this.#show()\n }\n }\n\n #handleDialogItemActivated(event: Event, dialog: HTMLElement) {\n if (this.contains(dialog)) {\n this.querySelector('.ActionListWrap')!.style.display = 'none'\n }\n const dialog_controller = new AbortController()\n const {signal} = dialog_controller\n const handleDialogClose = () => {\n dialog_controller.abort()\n if (this.contains(dialog)) {\n this.querySelector('.ActionListWrap')!.style.display = ''\n if (this.#isOpen()) {\n this.#hide()\n }\n }\n const activeElement = this.ownerDocument.activeElement\n const lostFocus = this.ownerDocument.activeElement === this.ownerDocument.body\n const focusInClosedMenu = this.contains(activeElement)\n const focusInDialog = dialog.contains(activeElement)\n if (lostFocus || focusInClosedMenu || focusInDialog) {\n setTimeout(() => {\n // if the activeElement has changed after a task, then it's likely\n // that other JS has tried to shift focus. We should respect that\n // focus shift as long as it's not back at the document.\n const newActiveElement = this.ownerDocument.activeElement\n if (newActiveElement === activeElement || newActiveElement === this.ownerDocument.body) {\n this.invokerElement?.focus()\n }\n }, 0)\n }\n }\n // a modal element will close all popovers\n dialog.addEventListener('close', handleDialogClose, {signal})\n dialog.addEventListener('cancel', handleDialogClose, {signal})\n }\n\n #handleItemActivated(item: Element) {\n // Hide popover after current event loop to prevent changes in focus from\n // altering the target of the event. Not doing this specifically affects\n // tags. It causes the event to be sent to the currently focused element\n // instead of the anchor, which effectively prevents navigation, i.e. it\n // appears as if hitting enter does nothing. Curiously, clicking instead\n // works fine.\n if (this.selectVariant !== 'multiple') {\n setTimeout(() => {\n if (this.#isOpen()) {\n this.#hide()\n }\n })\n }\n\n // The rest of the code below deals with single/multiple selection behavior, and should not\n // interfere with events fired by menu items whose behavior is specified outside the library.\n if (this.selectVariant !== 'multiple' && this.selectVariant !== 'single') return\n\n const ariaChecked = item.getAttribute('aria-checked')\n const checked = ariaChecked !== 'true'\n\n if (this.selectVariant === 'single') {\n // Only check, never uncheck here. Single-select mode does not allow unchecking a checked item.\n if (checked) {\n item.setAttribute('aria-checked', 'true')\n }\n\n for (const checkedItem of this.querySelectorAll('[aria-checked]')) {\n if (checkedItem !== item) {\n checkedItem.setAttribute('aria-checked', 'false')\n }\n }\n\n this.#setDynamicLabel()\n } else {\n // multi-select mode allows unchecking a checked item\n item.setAttribute('aria-checked', `${checked}`)\n }\n\n this.#updateInput()\n\n this.dispatchEvent(\n new CustomEvent('itemActivated', {\n detail: {item: item.parentElement, checked: this.isItemChecked(item.parentElement)},\n }),\n )\n }\n\n #handleIncludeFragmentReplaced() {\n if (this.#firstItem) this.#firstItem.focus()\n this.#softDisableItems()\n }\n\n // Close when focus leaves menu\n #handleFocusOut() {\n this.#hide()\n }\n\n #show() {\n this.popoverElement?.showPopover()\n }\n\n #hide() {\n this.popoverElement?.hidePopover()\n }\n\n #isOpen() {\n return this.popoverElement?.matches(':popover-open')\n }\n\n #setDynamicLabel() {\n if (!this.dynamicLabel) return\n const invokerLabel = this.invokerLabel\n if (!invokerLabel) return\n this.#originalLabel ||= invokerLabel.textContent || ''\n const itemLabel = this.querySelector('[aria-checked=true] .ActionListItem-label')\n if (itemLabel && this.dynamicLabel) {\n const prefixSpan = document.createElement('span')\n prefixSpan.classList.add('color-fg-muted')\n const contentSpan = document.createElement('span')\n prefixSpan.textContent = this.dynamicLabelPrefix\n contentSpan.textContent = itemLabel.textContent || ''\n invokerLabel.replaceChildren(prefixSpan, contentSpan)\n } else {\n invokerLabel.textContent = this.#originalLabel\n }\n }\n\n #updateInput() {\n if (this.selectVariant === 'single') {\n const input = this.querySelector(`[data-list-inputs=true] input`) as HTMLInputElement | null\n if (!input) return\n\n const selectedItem = this.selectedItems[0]\n\n if (selectedItem) {\n input.value = (selectedItem.value || selectedItem.label || '').trim()\n input.removeAttribute('disabled')\n } else {\n input.setAttribute('disabled', 'disabled')\n }\n } else if (this.selectVariant !== 'none') {\n // multiple select variant\n const inputList = this.querySelector('[data-list-inputs=true]')\n if (!inputList) return\n\n const inputs = inputList.querySelectorAll('input')\n\n if (inputs.length > 0) {\n this.#inputName ||= (inputs[0] as HTMLInputElement).name\n }\n\n for (const selectedItem of this.selectedItems) {\n const newInput = document.createElement('input')\n newInput.setAttribute('data-list-input', 'true')\n newInput.type = 'hidden'\n newInput.autocomplete = 'off'\n newInput.name = this.#inputName\n newInput.value = (selectedItem.value || selectedItem.label || '').trim()\n\n inputList.append(newInput)\n }\n\n for (const input of inputs) {\n input.remove()\n }\n }\n }\n\n get #firstItem(): HTMLElement | null {\n return this.querySelector(menuItemSelectors.join(','))\n }\n\n get items(): HTMLElement[] {\n return Array.from(this.querySelectorAll(menuItemSelectors.join(',')))\n }\n\n getItemById(itemId: string): HTMLElement | null {\n return this.querySelector(`li[data-item-id=\"${itemId}\"`)\n }\n\n isItemDisabled(item: Element | null): boolean {\n if (item) {\n return item.classList.contains('ActionListItem--disabled')\n } else {\n return false\n }\n }\n\n disableItem(item: Element | null) {\n if (item) {\n item.classList.add('ActionListItem--disabled')\n item.querySelector('.ActionListContent')!.setAttribute('aria-disabled', 'true')\n }\n }\n\n enableItem(item: Element | null) {\n if (item) {\n item.classList.remove('ActionListItem--disabled')\n item.querySelector('.ActionListContent')!.removeAttribute('aria-disabled')\n }\n }\n\n isItemHidden(item: Element | null): boolean {\n if (item) {\n return item.hasAttribute('hidden')\n } else {\n return false\n }\n }\n\n hideItem(item: Element | null) {\n if (item) {\n item.setAttribute('hidden', 'hidden')\n }\n }\n\n showItem(item: Element | null) {\n if (item) {\n item.removeAttribute('hidden')\n }\n }\n\n isItemChecked(item: Element | null) {\n if (item) {\n return item.querySelector('.ActionListContent')!.getAttribute('aria-checked') === 'true'\n } else {\n return false\n }\n }\n\n checkItem(item: Element | null) {\n if (item && (this.selectVariant === 'single' || this.selectVariant === 'multiple')) {\n const itemContent = item.querySelector('.ActionListContent')!\n const ariaChecked = itemContent.getAttribute('aria-checked') === 'true'\n\n if (!ariaChecked) {\n this.#handleItemActivated(itemContent)\n }\n }\n }\n\n uncheckItem(item: Element | null) {\n if (item && (this.selectVariant === 'single' || this.selectVariant === 'multiple')) {\n const itemContent = item.querySelector('.ActionListContent')!\n const ariaChecked = itemContent.getAttribute('aria-checked') === 'true'\n\n if (ariaChecked) {\n this.#handleItemActivated(itemContent)\n }\n }\n }\n}\n\nif (!window.customElements.get('action-menu')) {\n window.ActionMenuElement = ActionMenuElement\n window.customElements.define('action-menu', ActionMenuElement)\n}\n\ndeclare global {\n interface Window {\n ActionMenuElement: typeof ActionMenuElement\n }\n}\n","const Ordering = {\n Less: \"less\",\n Equal: \"equal\",\n Greater: \"greater\"\n};\n\nvar __typeError$2 = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck$2 = (obj, member, msg) => member.has(obj) || __typeError$2(\"Cannot \" + msg);\nvar __privateGet$2 = (obj, member, getter) => (__accessCheck$2(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\nvar __privateSet$2 = (obj, member, value, setter) => (__accessCheck$2(obj, member, \"write to private field\"), setter ? setter.call(obj, value) : member.set(obj, value), value);\nvar __privateMethod$1 = (obj, member, method) => (__accessCheck$2(obj, member, \"access private method\"), method);\nvar _compareFn, _heap, _MinHeap_instances, heapifyDown_fn, heapifyUp_fn;\nclass MinHeap {\n constructor({ compareFn }) {\n __privateAdd$2(this, _MinHeap_instances);\n __privateAdd$2(this, _compareFn);\n __privateAdd$2(this, _heap);\n __privateSet$2(this, _compareFn, compareFn);\n __privateSet$2(this, _heap, []);\n }\n insert(value) {\n __privateGet$2(this, _heap).push(value);\n __privateMethod$1(this, _MinHeap_instances, heapifyUp_fn).call(this);\n }\n pop() {\n const item = __privateGet$2(this, _heap)[0];\n if (__privateGet$2(this, _heap)[__privateGet$2(this, _heap).length - 1]) {\n __privateGet$2(this, _heap)[0] = __privateGet$2(this, _heap)[__privateGet$2(this, _heap).length - 1];\n __privateGet$2(this, _heap).pop();\n }\n __privateMethod$1(this, _MinHeap_instances, heapifyDown_fn).call(this);\n return item;\n }\n peek() {\n return __privateGet$2(this, _heap)[0];\n }\n delete(value) {\n const index = __privateGet$2(this, _heap).indexOf(value);\n if (index === -1) {\n return;\n }\n swap(__privateGet$2(this, _heap), index, __privateGet$2(this, _heap).length - 1);\n __privateGet$2(this, _heap).pop();\n __privateMethod$1(this, _MinHeap_instances, heapifyDown_fn).call(this);\n }\n clear() {\n __privateSet$2(this, _heap, []);\n }\n get size() {\n return __privateGet$2(this, _heap).length;\n }\n}\n_compareFn = new WeakMap();\n_heap = new WeakMap();\n_MinHeap_instances = new WeakSet();\nheapifyDown_fn = function() {\n let index = 0;\n while (hasLeftChild(index, __privateGet$2(this, _heap).length)) {\n let smallerChildIndex = getLeftChildIndex(index);\n if (hasRightChild(index, __privateGet$2(this, _heap).length) && __privateGet$2(this, _compareFn).call(this, rightChild(__privateGet$2(this, _heap), index), leftChild(__privateGet$2(this, _heap), index)) === Ordering.Less) {\n smallerChildIndex = getRightChildIndex(index);\n }\n if (__privateGet$2(this, _compareFn).call(this, __privateGet$2(this, _heap)[index], __privateGet$2(this, _heap)[smallerChildIndex]) === Ordering.Less) {\n break;\n } else {\n swap(__privateGet$2(this, _heap), index, smallerChildIndex);\n }\n index = smallerChildIndex;\n }\n};\nheapifyUp_fn = function() {\n let index = __privateGet$2(this, _heap).length - 1;\n while (hasParent(index) && __privateGet$2(this, _compareFn).call(this, __privateGet$2(this, _heap)[index], parent(__privateGet$2(this, _heap), index)) === Ordering.Less) {\n swap(__privateGet$2(this, _heap), index, getParentIndex(index));\n index = getParentIndex(index);\n }\n};\nfunction getLeftChildIndex(index) {\n return 2 * index + 1;\n}\nfunction getRightChildIndex(index) {\n return 2 * index + 2;\n}\nfunction getParentIndex(index) {\n return Math.floor((index - 1) / 2);\n}\nfunction hasLeftChild(index, size) {\n return getLeftChildIndex(index) < size;\n}\nfunction hasRightChild(index, size) {\n return getRightChildIndex(index) < size;\n}\nfunction hasParent(index) {\n return index > 0;\n}\nfunction leftChild(heap, index) {\n return heap[getLeftChildIndex(index)];\n}\nfunction rightChild(heap, index) {\n return heap[getRightChildIndex(index)];\n}\nfunction parent(heap, index) {\n return heap[getParentIndex(index)];\n}\nfunction swap(heap, a, b) {\n const tmp = heap[a];\n heap[a] = heap[b];\n heap[b] = tmp;\n}\n\nvar __defProp = Object.defineProperty;\nvar __typeError$1 = (msg) => {\n throw TypeError(msg);\n};\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nvar __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1(\"Cannot \" + msg);\nvar __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\nvar __privateSet$1 = (obj, member, value, setter) => (__accessCheck$1(obj, member, \"write to private field\"), setter ? setter.call(obj, value) : member.set(obj, value), value);\nvar _a, _promise, _resolve, _reject;\n_a = Symbol.toStringTag;\nclass Deferred {\n constructor() {\n __publicField(this, _a, \"Deferred\");\n __privateAdd$1(this, _promise);\n __privateAdd$1(this, _resolve);\n __privateAdd$1(this, _reject);\n __privateSet$1(this, _promise, new Promise((resolve, reject) => {\n __privateSet$1(this, _resolve, resolve);\n __privateSet$1(this, _reject, reject);\n }));\n }\n then(onfulfilled, onrejected) {\n return Promise.prototype.then.apply(__privateGet$1(this, _promise), [onfulfilled, onrejected]);\n }\n catch(onrejected) {\n return Promise.prototype.catch.apply(__privateGet$1(this, _promise), [onrejected]);\n }\n finally(onfinally) {\n return Promise.prototype.finally.apply(__privateGet$1(this, _promise), [onfinally]);\n }\n resolve(value) {\n __privateGet$1(this, _resolve).call(this, value);\n }\n reject(reason) {\n __privateGet$1(this, _reject).call(this, reason);\n }\n getPromise() {\n return __privateGet$1(this, _promise);\n }\n}\n_promise = new WeakMap();\n_resolve = new WeakMap();\n_reject = new WeakMap();\n\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\nvar __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, \"write to private field\"), setter ? setter.call(obj, value) : member.set(obj, value), value);\nvar __privateMethod = (obj, member, method) => (__accessCheck(obj, member, \"access private method\"), method);\nvar _pending, _queue, _timeoutId, _LiveRegionElement_instances, performWork_fn, updateContainerWithMessage_fn;\nconst DEFAULT_THROTTLE_DELAY_MS = 150;\nclass LiveRegionElement extends HTMLElement {\n constructor() {\n super();\n __privateAdd(this, _LiveRegionElement_instances);\n /**\n * A flag to indicate if a message has been announced and we are currently\n * waiting for the delay to pass before announcing the next message.\n */\n __privateAdd(this, _pending);\n /**\n * A priority queue to store messages to be announced by the live region.\n */\n __privateAdd(this, _queue);\n /**\n * The id for a timeout being used by the live region to either wait until the\n * next message or wait until the delay has passed before announcing the next\n * message\n */\n __privateAdd(this, _timeoutId);\n if (!this.shadowRoot) {\n const template2 = getTemplate();\n const shadowRoot = this.attachShadow({ mode: \"open\" });\n shadowRoot.appendChild(template2.content.cloneNode(true));\n }\n __privateSet(this, _pending, false);\n __privateSet(this, _timeoutId, null);\n __privateSet(this, _queue, new MinHeap({\n compareFn: compareMessages\n }));\n }\n /**\n * The delay in milliseconds to wait between announcements. This helps to\n * prevent announcements getting dropped if multiple are made at the same time.\n */\n get delay() {\n const value = this.getAttribute(\"delay\");\n if (value) {\n return parseInt(value, 10);\n }\n return DEFAULT_THROTTLE_DELAY_MS;\n }\n set delay(value) {\n this.setAttribute(\"delay\", `${value}`);\n }\n /**\n * Announce a message using a live region with a corresponding politeness\n * level.\n */\n announce(message, options = {}) {\n const { delayMs, politeness = \"polite\" } = options;\n const now = Date.now();\n const deferred = new Deferred();\n const item = {\n deferred,\n politeness,\n contents: message,\n scheduled: delayMs !== void 0 ? now + delayMs : now\n };\n __privateGet(this, _queue).insert(item);\n __privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);\n return {\n ...deferred.getPromise(),\n cancel: () => {\n __privateGet(this, _queue).delete(item);\n deferred.resolve();\n }\n };\n }\n /**\n * Announce a message using the text content of an element with a\n * corresponding politeness level\n */\n announceFromElement(element, options) {\n const textContent = getTextContent(element);\n if (textContent !== \"\") {\n return this.announce(textContent, options);\n }\n const promise = Promise.resolve();\n return {\n ...promise,\n cancel: noop\n };\n }\n getMessage(politeness = \"polite\") {\n const container = this.shadowRoot?.getElementById(politeness);\n if (!container) {\n throw new Error(\"Unable to find container for message\");\n }\n return container.textContent;\n }\n /**\n * Prevent pending messages from being announced by the live region.\n */\n clear() {\n if (__privateGet(this, _timeoutId) !== null) {\n clearTimeout(__privateGet(this, _timeoutId));\n __privateSet(this, _timeoutId, null);\n }\n __privateSet(this, _pending, false);\n __privateGet(this, _queue).clear();\n }\n}\n_pending = new WeakMap();\n_queue = new WeakMap();\n_timeoutId = new WeakMap();\n_LiveRegionElement_instances = new WeakSet();\nperformWork_fn = function() {\n if (__privateGet(this, _pending)) {\n return;\n }\n let message = __privateGet(this, _queue).peek();\n if (!message) {\n return;\n }\n if (__privateGet(this, _timeoutId) !== null) {\n clearTimeout(__privateGet(this, _timeoutId));\n __privateSet(this, _timeoutId, null);\n }\n const now = Date.now();\n if (message.scheduled <= now) {\n message = __privateGet(this, _queue).pop();\n if (message) {\n __privateMethod(this, _LiveRegionElement_instances, updateContainerWithMessage_fn).call(this, message);\n }\n __privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);\n return;\n }\n const timeout = message.scheduled - now;\n __privateSet(this, _timeoutId, window.setTimeout(() => {\n __privateSet(this, _timeoutId, null);\n __privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);\n }, timeout));\n};\nupdateContainerWithMessage_fn = function(message) {\n __privateSet(this, _pending, true);\n const { contents, deferred, politeness } = message;\n const container = this.shadowRoot?.getElementById(politeness);\n if (!container) {\n __privateSet(this, _pending, false);\n throw new Error(`Unable to find container for message. Expected a container with id=\"${politeness}\"`);\n }\n if (container.textContent === contents) {\n container.textContent = `${contents}\\xA0`;\n } else {\n container.textContent = contents;\n }\n if (__privateGet(this, _timeoutId) !== null) {\n clearTimeout(__privateGet(this, _timeoutId));\n }\n deferred.resolve();\n if (this.delay > 0) {\n __privateSet(this, _timeoutId, window.setTimeout(() => {\n __privateSet(this, _timeoutId, null);\n __privateSet(this, _pending, false);\n __privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);\n }, this.delay));\n } else {\n __privateSet(this, _timeoutId, null);\n __privateSet(this, _pending, false);\n __privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);\n }\n};\nfunction getTextContent(element) {\n let value = \"\";\n if (element.hasAttribute(\"aria-label\")) {\n value = element.getAttribute(\"aria-label\");\n } else if (element.innerText) {\n value = element.innerText;\n } else if (element.textContent) {\n value = element.textContent;\n }\n return value ? value.trim() : \"\";\n}\nlet template = null;\nconst templateContent = `\n\n
\n
\n`;\nfunction getTemplate() {\n if (template) {\n return template;\n }\n template = document.createElement(\"template\");\n template.innerHTML = templateContent;\n return template;\n}\nfunction compareMessages(a, b) {\n if (a.politeness === b.politeness) {\n if (a.scheduled === b.scheduled) {\n return Ordering.Equal;\n }\n if (a.scheduled < b.scheduled) {\n return Ordering.Less;\n }\n return Ordering.Greater;\n }\n if (a.politeness === \"assertive\" && b.politeness !== \"assertive\") {\n return Ordering.Less;\n }\n if (a.politeness !== \"assertive\" && b.politeness === \"assertive\") {\n return Ordering.Greater;\n }\n return Ordering.Equal;\n}\nfunction noop() {\n}\n\nif (!customElements.get(\"live-region\")) {\n customElements.define(\"live-region\", LiveRegionElement);\n}\n\nfunction announce(message, options = {}) {\n let liveRegion = findLiveRegion(options.from);\n if (!liveRegion) {\n liveRegion = document.createElement(\"live-region\");\n if (options.appendTo) {\n options.appendTo.appendChild(liveRegion);\n } else {\n const container = getLiveRegionContainer(options.from);\n container.appendChild(liveRegion);\n }\n if (process.env.NODE_ENV === \"test\") {\n return liveRegion.announce(message, options);\n }\n let canceled = false;\n let cancel = () => {\n canceled = true;\n };\n const promise = wait(REGISTER_WAIT_MS).then(() => {\n if (!canceled) {\n const result = liveRegion.announce(message, options);\n cancel = result.cancel;\n return result;\n }\n });\n return {\n ...promise,\n cancel: () => {\n cancel();\n }\n };\n }\n return liveRegion.announce(message, options);\n}\nfunction announceFromElement(element, options = {}) {\n let liveRegion = findLiveRegion(options.from);\n if (!liveRegion) {\n liveRegion = document.createElement(\"live-region\");\n if (options.appendTo) {\n options.appendTo.appendChild(liveRegion);\n } else {\n const container = getLiveRegionContainer(options.from);\n container.appendChild(liveRegion);\n }\n if (process.env.NODE_ENV === \"test\") {\n return liveRegion.announceFromElement(element, options);\n }\n let canceled = false;\n let cancel = () => {\n canceled = true;\n };\n const promise = wait(REGISTER_WAIT_MS).then(() => {\n if (!canceled) {\n const result = liveRegion.announceFromElement(element, options);\n cancel = result.cancel;\n return result;\n }\n });\n return {\n ...promise,\n cancel: () => {\n cancel();\n }\n };\n }\n return liveRegion.announceFromElement(element, options);\n}\nfunction findLiveRegion(from) {\n let liveRegion = null;\n liveRegion = from ? getClosestLiveRegion(from) : null;\n if (liveRegion !== null) {\n return liveRegion;\n }\n const container = getLiveRegionContainer(from);\n liveRegion = container.querySelector(\"live-region\");\n if (liveRegion !== null) {\n return liveRegion;\n }\n return null;\n}\nfunction getClosestLiveRegion(from) {\n const dialog = from.closest(\"dialog\");\n let current = from;\n while (current = current.parentElement) {\n if (dialog && !dialog.contains(current)) {\n break;\n }\n for (const child of current.childNodes) {\n if (child instanceof LiveRegionElement) {\n return child;\n }\n }\n }\n return null;\n}\nfunction getLiveRegionContainer(from) {\n let container = document.body;\n if (from) {\n const dialog = from.closest(\"dialog\");\n if (dialog) {\n container = dialog;\n }\n }\n return container;\n}\nconst REGISTER_WAIT_MS = 150;\nfunction wait(ms) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n\nexport { LiveRegionElement, announce, announceFromElement, templateContent };\n","import {getAnchoredPosition} from '@primer/behaviors'\nimport {controller, target} from '@github/catalyst'\nimport {IncludeFragmentElement} from '@github/include-fragment-element'\nimport type {PrimerTextFieldElement} from 'app/lib/primer/forms/primer_text_field'\nimport type {AnchorAlignment, AnchorSide} from '@primer/behaviors'\nimport type {LiveRegionElement} from '@primer/live-region-element'\nimport '@primer/live-region-element'\nimport '@oddbird/popover-polyfill'\n\ntype SelectVariant = 'none' | 'single' | 'multiple' | null\ntype SelectedItem = {\n label: string | null | undefined\n value: string | null | undefined\n inputName: string | null | undefined\n}\n\nconst validSelectors = ['[role=\"option\"]']\nconst menuItemSelectors = validSelectors.join(',')\nconst visibleMenuItemSelectors = validSelectors.map(selector => `:not([hidden]) > ${selector}`).join(',')\n\nexport type SelectPanelItem = HTMLLIElement\n\nenum FetchStrategy {\n REMOTE,\n EVENTUALLY_LOCAL,\n LOCAL,\n}\n\nenum ErrorStateType {\n BODY,\n BANNER,\n}\n\nexport type FilterFn = (item: SelectPanelItem, query: string) => boolean\n\nconst updateWhenVisible = (() => {\n const anchors = new Set()\n let resizeObserver: ResizeObserver | null = null\n function updateVisibleAnchors() {\n for (const anchor of anchors) {\n anchor.updateAnchorPosition()\n }\n }\n return (el: SelectPanelElement) => {\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('resize', updateVisibleAnchors)\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('scroll', updateVisibleAnchors)\n\n resizeObserver ||= new ResizeObserver(() => {\n for (const anchor of anchors) {\n anchor.updateAnchorPosition()\n }\n })\n resizeObserver.observe(el.ownerDocument.documentElement)\n el.addEventListener('dialog:close', () => {\n el.invokerElement?.setAttribute('aria-expanded', 'false')\n anchors.delete(el)\n })\n el.addEventListener('dialog:open', () => {\n anchors.add(el)\n })\n }\n})()\n\n@controller\nexport class SelectPanelElement extends HTMLElement {\n @target includeFragment: IncludeFragmentElement\n @target dialog: HTMLDialogElement\n @target filterInputTextField: HTMLInputElement\n @target remoteInput: HTMLElement\n @target list: HTMLElement\n @target noResults: HTMLElement\n @target fragmentErrorElement: HTMLElement\n @target bannerErrorElement: HTMLElement\n @target bodySpinner: HTMLElement\n @target liveRegion: LiveRegionElement\n\n filterFn?: FilterFn\n\n #dialogIntersectionObserver: IntersectionObserver\n #abortController: AbortController\n #originalLabel = ''\n #inputName = ''\n #selectedItems: Map = new Map()\n #loadingDelayTimeoutId: number | null = null\n #loadingAnnouncementTimeoutId: number | null = null\n #hasLoadedData = false\n\n get open(): boolean {\n return this.dialog.open\n }\n\n get selectVariant(): SelectVariant {\n return this.getAttribute('data-select-variant') as SelectVariant\n }\n\n get ariaSelectionType(): string {\n return this.selectVariant === 'multiple' ? 'aria-checked' : 'aria-selected'\n }\n\n set selectVariant(variant: SelectVariant) {\n if (variant) {\n this.setAttribute('data-select-variant', variant)\n } else {\n this.removeAttribute('variant')\n }\n }\n\n get dynamicLabelPrefix(): string {\n const prefix = this.getAttribute('data-dynamic-label-prefix')\n if (!prefix) return ''\n return `${prefix}:`\n }\n\n get dynamicAriaLabelPrefix(): string {\n const prefix = this.getAttribute('data-dynamic-aria-label-prefix')\n if (!prefix) return ''\n return `${prefix}:`\n }\n\n set dynamicLabelPrefix(value: string) {\n this.setAttribute('data-dynamic-label', value)\n }\n\n get dynamicLabel(): boolean {\n return this.hasAttribute('data-dynamic-label')\n }\n\n set dynamicLabel(value: boolean) {\n this.toggleAttribute('data-dynamic-label', value)\n }\n\n get invokerElement(): HTMLButtonElement | null {\n const id = this.querySelector('dialog')?.id\n if (!id) return null\n for (const el of this.querySelectorAll(`[aria-controls]`)) {\n if (el.getAttribute('aria-controls') === id) {\n return el as HTMLButtonElement\n }\n }\n return null\n }\n\n get closeButton(): HTMLButtonElement | null {\n return this.querySelector('button[data-close-dialog-id]')\n }\n\n get invokerLabel(): HTMLElement | null {\n if (!this.invokerElement) return null\n return this.invokerElement.querySelector('.Button-label')\n }\n\n get selectedItems(): SelectedItem[] {\n return Array.from(this.#selectedItems.values())\n }\n\n get align(): AnchorAlignment {\n return (this.getAttribute('anchor-align') || 'start') as AnchorAlignment\n }\n\n get side(): AnchorSide {\n return (this.getAttribute('anchor-side') || 'outside-bottom') as AnchorSide\n }\n\n updateAnchorPosition() {\n // If the selectPanel is removed from the screen on resize close the dialog\n if (this && this.offsetParent === null) {\n this.hide()\n }\n\n if (this.invokerElement) {\n const {top, left} = getAnchoredPosition(this.dialog, this.invokerElement, {\n align: this.align,\n side: this.side,\n anchorOffset: 4,\n })\n this.dialog.style.top = `${top}px`\n this.dialog.style.left = `${left}px`\n this.dialog.style.bottom = 'auto'\n this.dialog.style.right = 'auto'\n }\n }\n\n connectedCallback() {\n const {signal} = (this.#abortController = new AbortController())\n this.addEventListener('keydown', this, {signal})\n this.addEventListener('click', this, {signal})\n this.addEventListener('mousedown', this, {signal})\n this.addEventListener('input', this, {signal})\n this.addEventListener('remote-input-success', this, {signal})\n this.addEventListener('remote-input-error', this, {signal})\n this.addEventListener('loadstart', this, {signal})\n this.#setDynamicLabel()\n this.#updateInput()\n this.#softDisableItems()\n updateWhenVisible(this)\n\n this.#waitForCondition(\n () => Boolean(this.remoteInput),\n () => {\n this.remoteInput.addEventListener('loadstart', this, {signal})\n this.remoteInput.addEventListener('loadend', this, {signal})\n },\n )\n\n this.#waitForCondition(\n () => Boolean(this.includeFragment),\n () => {\n this.includeFragment.addEventListener('include-fragment-replaced', this, {signal})\n this.includeFragment.addEventListener('error', this, {signal})\n this.includeFragment.addEventListener('loadend', this, {signal})\n },\n )\n\n this.#dialogIntersectionObserver = new IntersectionObserver(entries => {\n for (const entry of entries) {\n const elem = entry.target\n if (entry.isIntersecting && elem === this.dialog) {\n // Focus on the filter input when the dialog opens to work around a Safari limitation\n // that prevents the autofocus attribute from working as it does in other browsers\n if (this.filterInputTextField) {\n if (document.activeElement !== this.filterInputTextField) {\n this.filterInputTextField.focus()\n }\n }\n\n // signal that any focus hijinks are finished (thanks Safari)\n this.dialog.setAttribute('data-ready', 'true')\n\n this.updateAnchorPosition()\n\n if (this.#fetchStrategy === FetchStrategy.LOCAL) {\n this.#updateItemVisibility()\n }\n }\n }\n })\n\n this.#waitForCondition(\n () => Boolean(this.dialog),\n () => {\n this.#dialogIntersectionObserver.observe(this.dialog)\n this.dialog.addEventListener('close', this, {signal})\n\n if (this.getAttribute('data-open-on-load') === 'true') {\n this.show()\n }\n },\n )\n\n if (this.#fetchStrategy === FetchStrategy.LOCAL) {\n this.#waitForCondition(\n () => this.items.length > 0,\n () => {\n this.#updateItemVisibility()\n this.#updateInput()\n },\n )\n }\n }\n\n // Waits for condition to return true. If it returns false initially, this function creates a\n // MutationObserver that calls body() whenever the contents of the component change.\n #waitForCondition(condition: () => boolean, body: () => void) {\n if (condition()) {\n body()\n } else {\n const mutationObserver = new MutationObserver(() => {\n if (condition()) {\n body()\n mutationObserver.disconnect()\n }\n })\n\n mutationObserver.observe(this, {childList: true, subtree: true})\n }\n }\n\n disconnectedCallback() {\n this.#abortController.abort()\n }\n\n #softDisableItems() {\n const {signal} = this.#abortController\n\n for (const item of this.querySelectorAll(validSelectors.join(','))) {\n item.addEventListener('click', this.#potentiallyDisallowActivation.bind(this), {signal})\n item.addEventListener('keydown', this.#potentiallyDisallowActivation.bind(this), {signal})\n }\n }\n\n // If there is an active item in single-select mode, set its tabindex to 0. Otherwise, set the\n // first visible item's tabindex to 0. All other items should have a tabindex of -1.\n #updateTabIndices() {\n let setZeroTabIndex = false\n\n if (this.selectVariant === 'single') {\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n\n if (!this.isItemHidden(item) && this.isItemChecked(item) && !setZeroTabIndex) {\n itemContent.setAttribute('tabindex', '0')\n setZeroTabIndex = true\n } else {\n itemContent.setAttribute('tabindex', '-1')\n }\n\n //
  • elements should not themselves be tabbable\n item.removeAttribute('tabindex')\n }\n } else {\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n\n itemContent.setAttribute('tabindex', '-1')\n\n //
  • elements should not themselves be tabbable\n item.removeAttribute('tabindex')\n }\n }\n\n if (!setZeroTabIndex && this.#firstItem) {\n this.#getItemContent(this.#firstItem)?.setAttribute('tabindex', '0')\n }\n }\n\n // returns true if activation was prevented\n #potentiallyDisallowActivation(event: Event): boolean {\n if (!this.#isActivation(event)) return false\n\n const item = (event.target as HTMLElement).closest(visibleMenuItemSelectors)\n if (!item) return false\n\n if (item.getAttribute('aria-disabled')) {\n event.preventDefault()\n\n // eslint-disable-next-line no-restricted-syntax\n event.stopPropagation()\n\n // eslint-disable-next-line no-restricted-syntax\n event.stopImmediatePropagation()\n return true\n }\n\n return false\n }\n\n #isAnchorActivationViaSpace(event: Event): boolean {\n return (\n event.target instanceof HTMLAnchorElement &&\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&\n event.key === ' '\n )\n }\n\n #isActivation(event: Event): boolean {\n // Some browsers fire MouseEvents (Firefox) and others fire PointerEvents (Chrome). Activating an item via\n // enter or space counterintuitively fires one of these rather than a KeyboardEvent. Since PointerEvent\n // inherits from MouseEvent, it is enough to check for MouseEvent here.\n return (event instanceof MouseEvent && event.type === 'click') || this.#isAnchorActivationViaSpace(event)\n }\n\n #checkSelectedItems() {\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n\n const value = itemContent.getAttribute('data-value')\n\n if (value) {\n if (this.#selectedItems.has(value)) {\n itemContent.setAttribute(this.ariaSelectionType, 'true')\n }\n }\n }\n\n this.#updateInput()\n }\n\n #addSelectedItem(item: SelectPanelItem) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) return\n\n const value = itemContent.getAttribute('data-value')\n\n if (value) {\n this.#selectedItems.set(value, {\n value,\n label: itemContent.querySelector('.ActionListItem-label')?.textContent?.trim(),\n inputName: itemContent.getAttribute('data-input-name'),\n })\n }\n }\n\n #removeSelectedItem(item: SelectPanelItem) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) return\n\n const value = itemContent.getAttribute('data-value')\n if (value) {\n this.#selectedItems.delete(value)\n }\n }\n\n #setTextFieldLoadingSpinnerTimer() {\n if (!this.#filterInputTextFieldElement) return\n if (this.#loadingDelayTimeoutId) clearTimeout(this.#loadingDelayTimeoutId)\n if (this.#loadingAnnouncementTimeoutId) clearTimeout(this.#loadingAnnouncementTimeoutId)\n\n this.#loadingAnnouncementTimeoutId = setTimeout(() => {\n this.liveRegion.announce('Loading')\n }, 2000) as unknown as number\n\n this.#loadingDelayTimeoutId = setTimeout(() => {\n this.#filterInputTextFieldElement?.showLeadingSpinner()\n }, 1000) as unknown as number\n }\n\n handleEvent(event: Event) {\n if (event.target === this.filterInputTextField) {\n this.#handleSearchFieldEvent(event)\n return\n }\n\n if (event.target === this.remoteInput) {\n this.#handleRemoteInputEvent(event)\n return\n }\n\n const targetIsInvoker = this.invokerElement?.contains(event.target as HTMLElement)\n const targetIsCloseButton = this.closeButton?.contains(event.target as HTMLElement)\n const eventIsActivation = this.#isActivation(event)\n\n if (targetIsInvoker && event.type === 'mousedown') {\n return\n }\n\n if (event.type === 'mousedown' && event.target instanceof HTMLInputElement) {\n return\n }\n\n // Prevent safari bug that dismisses menu on mousedown instead of allowing\n // the click event to propagate to the button\n if (event.type === 'mousedown') {\n event.preventDefault()\n return\n }\n\n if (targetIsInvoker && eventIsActivation) {\n this.#handleInvokerActivated(event)\n return\n }\n\n if (targetIsCloseButton && eventIsActivation) {\n // hide() will automatically be called by dialog event triggered from `data-close-dialog-id`\n return\n }\n\n if (event.target === this.dialog && event.type === 'close') {\n // Remove data-ready so it can be set the next time the panel is opened\n this.dialog.removeAttribute('data-ready')\n this.invokerElement?.setAttribute('aria-expanded', 'false')\n // When we close the dialog, clear the filter input\n\n if (this.filterInputTextField) {\n const fireSearchEvent = this.filterInputTextField.value.length > 0\n this.filterInputTextField.value = ''\n if (fireSearchEvent) {\n this.filterInputTextField.dispatchEvent(new Event('input'))\n }\n }\n\n this.dispatchEvent(\n new CustomEvent('panelClosed', {\n detail: {panel: this},\n bubbles: true,\n }),\n )\n\n return\n }\n\n const item = (event.target as Element).closest(visibleMenuItemSelectors)?.parentElement as\n | SelectPanelItem\n | null\n | undefined\n\n const targetIsItem = item !== null && item !== undefined\n\n if (targetIsItem && eventIsActivation) {\n if (this.#potentiallyDisallowActivation(event)) return\n\n const dialogInvoker = item.closest('[data-show-dialog-id]')\n\n if (dialogInvoker) {\n const dialog = this.ownerDocument.getElementById(dialogInvoker.getAttribute('data-show-dialog-id') || '')\n\n if (dialog && this.contains(dialogInvoker) && this.contains(dialog)) {\n this.#handleDialogItemActivated(event, dialog)\n return\n }\n }\n\n // Pressing the space key on a link will cause the page to scroll unless preventDefault() is called.\n // We then click it manually to navigate.\n if (this.#isAnchorActivationViaSpace(event)) {\n event.preventDefault()\n this.#getItemContent(item)?.click()\n }\n\n this.#handleItemActivated(item)\n\n return\n }\n\n if (event.type === 'click') {\n const rect = this.dialog.getBoundingClientRect()\n\n const clickWasInsideDialog =\n rect.top <= (event as MouseEvent).clientY &&\n (event as MouseEvent).clientY <= rect.top + rect.height &&\n rect.left <= (event as MouseEvent).clientX &&\n (event as MouseEvent).clientX <= rect.left + rect.width\n\n if (!clickWasInsideDialog) {\n this.hide()\n }\n }\n\n // The include fragment will have been removed from the DOM by the time\n // the include-fragment-replaced event has been dispatched, so we have to\n // check for the type of the event target manually, since this.includeFragment\n // will be null.\n if (event.target instanceof IncludeFragmentElement) {\n this.#handleIncludeFragmentEvent(event)\n }\n }\n\n #handleIncludeFragmentEvent(event: Event) {\n switch (event.type) {\n case 'include-fragment-replaced': {\n this.#updateItemVisibility()\n break\n }\n\n case 'loadstart': {\n this.#toggleIncludeFragmentElements(false)\n break\n }\n\n case 'loadend': {\n this.#filterInputTextFieldElement?.hideLeadingSpinner()\n this.dispatchEvent(new CustomEvent('loadend'))\n break\n }\n\n case 'error': {\n this.#toggleIncludeFragmentElements(true)\n\n const errorElement = this.fragmentErrorElement\n // check if the errorElement is visible in the dom\n if (errorElement && !errorElement.hasAttribute('hidden')) {\n this.liveRegion.announceFromElement(errorElement, {politeness: 'assertive'})\n return\n }\n\n break\n }\n }\n }\n\n #toggleIncludeFragmentElements(showError: boolean) {\n for (const el of this.includeFragment.querySelectorAll('[data-show-on-error]')) {\n if (el instanceof HTMLElement) el.hidden = !showError\n }\n for (const el of this.includeFragment.querySelectorAll('[data-hide-on-error]')) {\n if (el instanceof HTMLElement) el.hidden = showError\n }\n }\n\n #handleRemoteInputEvent(event: Event) {\n switch (event.type) {\n case 'remote-input-success': {\n this.#clearErrorState()\n this.#updateItemVisibility()\n this.#checkSelectedItems()\n break\n }\n\n case 'remote-input-error': {\n this.bodySpinner?.setAttribute('hidden', '')\n\n if (this.includeFragment || this.visibleItems.length === 0) {\n this.#setErrorState(ErrorStateType.BODY)\n } else {\n this.#setErrorState(ErrorStateType.BANNER)\n }\n\n break\n }\n\n case 'loadstart': {\n if (!this.#performFilteringLocally()) {\n this.#clearErrorState()\n this.bodySpinner?.removeAttribute('hidden')\n\n if (this.bodySpinner) break\n this.#setTextFieldLoadingSpinnerTimer()\n }\n\n break\n }\n\n case 'loadend': {\n this.#filterInputTextFieldElement?.hideLeadingSpinner()\n if (this.#loadingAnnouncementTimeoutId) clearTimeout(this.#loadingAnnouncementTimeoutId)\n if (this.#loadingDelayTimeoutId) clearTimeout(this.#loadingDelayTimeoutId)\n this.dispatchEvent(new CustomEvent('loadend'))\n break\n }\n }\n }\n\n #defaultFilterFn(item: HTMLElement, query: string) {\n const text = (item.getAttribute('data-filter-string') || item.textContent || '').toLowerCase()\n return text.indexOf(query.toLowerCase()) > -1\n }\n\n #handleSearchFieldEvent(event: Event) {\n if (event.type === 'keydown') {\n const key = (event as KeyboardEvent).key\n\n if (key === 'Enter') {\n const item = this.visibleItems[0] as HTMLLIElement | null\n\n if (item) {\n const itemContent = this.#getItemContent(item)\n if (itemContent) itemContent.click()\n }\n } else if (key === 'ArrowDown') {\n const item = (this.focusableItem || this.#getItemContent(this.visibleItems[0])) as HTMLLIElement\n\n if (item) {\n item.focus()\n event.preventDefault()\n }\n } else if (key === 'Home') {\n const item = this.visibleItems[0] as HTMLLIElement | null\n\n if (item) {\n const itemContent = this.#getItemContent(item)\n if (itemContent) itemContent.focus()\n event.preventDefault()\n }\n } else if (key === 'End') {\n if (this.visibleItems.length > 0) {\n const item = this.visibleItems[this.visibleItems.length - 1] as HTMLLIElement\n const itemContent = this.#getItemContent(item)\n if (itemContent) itemContent.focus()\n event.preventDefault()\n }\n }\n }\n\n if (event.type !== 'input') return\n\n // remote-input-element does not trigger another loadstart event if a request is\n // already in-flight, so we use the input event on the text field to reset the\n // loading spinner timer instead\n if (!this.bodySpinner && !this.#performFilteringLocally()) {\n this.#setTextFieldLoadingSpinnerTimer()\n }\n\n if (this.#fetchStrategy === FetchStrategy.LOCAL || this.#fetchStrategy === FetchStrategy.EVENTUALLY_LOCAL) {\n if (this.includeFragment) {\n this.includeFragment.refetch()\n return\n }\n\n this.#updateItemVisibility()\n }\n }\n\n #updateItemVisibility() {\n if (!this.list) return\n\n let atLeastOneResult = false\n\n if (this.#performFilteringLocally()) {\n const query = this.filterInputTextField?.value ?? ''\n const filter = this.filterFn || this.#defaultFilterFn\n\n for (const item of this.items) {\n if (filter(item, query)) {\n this.#showItem(item)\n atLeastOneResult = true\n } else {\n this.#hideItem(item)\n }\n }\n } else {\n atLeastOneResult = this.items.length > 0\n }\n\n this.#updateTabIndices()\n this.#maybeAnnounce()\n\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n\n const value = itemContent.getAttribute('data-value')\n if (this.#hasLoadedData) {\n if (value && !this.#selectedItems.has(value)) {\n itemContent.setAttribute(this.ariaSelectionType, 'false')\n }\n } else if (value && !this.#selectedItems.has(value) && this.isItemChecked(item)) {\n this.#addSelectedItem(item)\n }\n }\n\n this.#hasLoadedData = true\n\n if (!this.noResults) return\n\n if (this.#inErrorState()) {\n this.noResults.setAttribute('hidden', '')\n return\n }\n\n if (atLeastOneResult) {\n this.noResults.setAttribute('hidden', '')\n // TODO can we change this to search for `@panelId-list`\n this.list?.querySelector('.ActionListWrap')?.removeAttribute('hidden')\n } else {\n this.list?.querySelector('.ActionListWrap')?.setAttribute('hidden', '')\n this.noResults.removeAttribute('hidden')\n }\n }\n\n #inErrorState(): boolean {\n if (this.fragmentErrorElement && !this.fragmentErrorElement.hasAttribute('hidden')) {\n return true\n }\n\n if (!this.bannerErrorElement) return false\n\n return !this.bannerErrorElement.hasAttribute('hidden')\n }\n\n #setErrorState(type: ErrorStateType) {\n let errorElement = this.fragmentErrorElement\n\n if (type === ErrorStateType.BODY && this.fragmentErrorElement) {\n this.fragmentErrorElement.removeAttribute('hidden')\n this.bannerErrorElement.setAttribute('hidden', '')\n } else {\n errorElement = this.bannerErrorElement\n this.bannerErrorElement?.removeAttribute('hidden')\n this.fragmentErrorElement?.setAttribute('hidden', '')\n }\n\n // check if the errorElement is visible in the dom\n if (errorElement && !errorElement.hasAttribute('hidden')) {\n this.liveRegion.announceFromElement(errorElement, {politeness: 'assertive'})\n return\n }\n }\n\n #clearErrorState() {\n this.fragmentErrorElement?.setAttribute('hidden', '')\n this.bannerErrorElement.setAttribute('hidden', '')\n }\n\n #maybeAnnounce() {\n if (this.open && this.list) {\n const items = this.visibleItems\n\n if (items.length > 0) {\n const instructions = 'tab for results'\n this.liveRegion.announce(`${items.length} result${items.length === 1 ? '' : 's'} ${instructions}`)\n } else {\n const noResultsEl = this.noResults\n if (noResultsEl) {\n this.liveRegion.announceFromElement(noResultsEl)\n }\n }\n }\n }\n\n get #fetchStrategy(): FetchStrategy {\n if (!this.list) return FetchStrategy.REMOTE\n\n switch (this.list.getAttribute('data-fetch-strategy')) {\n case 'local':\n return FetchStrategy.LOCAL\n case 'eventually_local':\n return FetchStrategy.EVENTUALLY_LOCAL\n default:\n return FetchStrategy.REMOTE\n }\n }\n\n get #filterInputTextFieldElement(): PrimerTextFieldElement | null {\n return this.filterInputTextField?.closest('primer-text-field') as PrimerTextFieldElement | null\n }\n\n #performFilteringLocally(): boolean {\n return this.#fetchStrategy === FetchStrategy.LOCAL || this.#fetchStrategy === FetchStrategy.EVENTUALLY_LOCAL\n }\n\n #handleInvokerActivated(event: Event) {\n event.preventDefault()\n\n // eslint-disable-next-line no-restricted-syntax\n event.stopPropagation()\n\n if (this.open) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n #handleDialogItemActivated(event: Event, dialog: HTMLElement) {\n this.querySelector('.ActionListWrap')!.style.display = 'none'\n const dialog_controller = new AbortController()\n const {signal} = dialog_controller\n const handleDialogClose = () => {\n dialog_controller.abort()\n this.querySelector('.ActionListWrap')!.style.display = ''\n if (this.open) {\n this.hide()\n }\n const activeElement = this.ownerDocument.activeElement\n const lostFocus = this.ownerDocument.activeElement === this.ownerDocument.body\n const focusInClosedMenu = this.contains(activeElement)\n if (lostFocus || focusInClosedMenu) {\n setTimeout(() => this.invokerElement?.focus(), 0)\n }\n }\n // a modal element will close all popovers\n dialog.addEventListener('close', handleDialogClose, {signal})\n dialog.addEventListener('cancel', handleDialogClose, {signal})\n }\n\n #handleItemActivated(item: SelectPanelItem) {\n // Hide popover after current event loop to prevent changes in focus from\n // altering the target of the event. Not doing this specifically affects\n // tags. It causes the event to be sent to the currently focused element\n // instead of the anchor, which effectively prevents navigation, i.e. it\n // appears as if hitting enter does nothing. Curiously, clicking instead\n // works fine.\n if (this.selectVariant !== 'multiple') {\n setTimeout(() => {\n if (this.open) {\n this.hide()\n }\n })\n }\n\n // The rest of the code below deals with single/multiple selection behavior, and should not\n // interfere with events fired by menu items whose behavior is specified outside the library.\n if (this.selectVariant !== 'multiple' && this.selectVariant !== 'single') return\n\n const currentlyChecked = this.isItemChecked(item)\n const checked = !currentlyChecked\n\n const activationSuccess = this.dispatchEvent(\n new CustomEvent('beforeItemActivated', {\n bubbles: true,\n cancelable: true,\n detail: {\n item,\n checked,\n value: this.#getItemContent(item)?.getAttribute('data-value'),\n },\n }),\n )\n\n if (!activationSuccess) return\n\n const itemContent = this.#getItemContent(item)\n\n if (this.selectVariant === 'single') {\n // Don't check anything if we have an href\n if (itemContent?.getAttribute('href')) return\n\n // disallow unchecking checked item in single-select mode\n if (!currentlyChecked) {\n for (const el of this.items) {\n this.#getItemContent(el)?.setAttribute(this.ariaSelectionType, 'false')\n }\n\n this.#selectedItems.clear()\n\n if (checked) {\n this.#addSelectedItem(item)\n itemContent?.setAttribute(this.ariaSelectionType, 'true')\n }\n\n this.#setDynamicLabel()\n }\n } else {\n // multi-select mode allows unchecking a checked item\n itemContent?.setAttribute(this.ariaSelectionType, `${checked}`)\n\n if (checked) {\n this.#addSelectedItem(item)\n } else {\n this.#removeSelectedItem(item)\n }\n }\n\n this.#updateInput()\n this.#updateTabIndices()\n\n this.dispatchEvent(\n new CustomEvent('itemActivated', {\n bubbles: true,\n detail: {\n item,\n checked,\n value: this.#getItemContent(item)?.getAttribute('data-value'),\n },\n }),\n )\n }\n\n show() {\n this.updateAnchorPosition()\n this.dialog.showModal()\n this.invokerElement?.setAttribute('aria-expanded', 'true')\n const event = new CustomEvent('dialog:open', {\n detail: {dialog: this.dialog},\n })\n this.dispatchEvent(event)\n }\n\n hide() {\n this.dialog.close()\n }\n\n #setDynamicLabel() {\n if (!this.dynamicLabel) return\n const invokerLabel = this.invokerLabel\n if (!invokerLabel) return\n this.#originalLabel ||= invokerLabel.textContent || ''\n const itemLabel =\n this.querySelector(`[${this.ariaSelectionType}=true] .ActionListItem-label`)?.textContent || this.#originalLabel\n if (itemLabel) {\n const prefixSpan = document.createElement('span')\n prefixSpan.classList.add('color-fg-muted')\n const contentSpan = document.createElement('span')\n prefixSpan.textContent = `${this.dynamicLabelPrefix} `\n contentSpan.textContent = itemLabel\n invokerLabel.replaceChildren(prefixSpan, contentSpan)\n\n if (this.dynamicAriaLabelPrefix) {\n this.invokerElement?.setAttribute('aria-label', `${this.dynamicAriaLabelPrefix} ${itemLabel.trim()}`)\n }\n } else {\n invokerLabel.textContent = this.#originalLabel\n }\n }\n\n #updateInput() {\n if (this.selectVariant === 'single') {\n const input = this.querySelector(`[data-list-inputs=true] input`) as HTMLInputElement\n if (!input) return\n\n const selectedItem = this.selectedItems[0]\n\n if (selectedItem) {\n input.value = (selectedItem.value || selectedItem.label || '').trim()\n if (selectedItem.inputName) input.name = selectedItem.inputName\n input.removeAttribute('disabled')\n } else {\n input.setAttribute('disabled', 'disabled')\n }\n } else if (this.selectVariant !== 'none') {\n // multiple select variant\n const inputList = this.querySelector('[data-list-inputs=true]')\n if (!inputList) return\n\n const inputs = inputList.querySelectorAll('input')\n\n if (inputs.length > 0) {\n this.#inputName ||= (inputs[0] as HTMLInputElement).name\n }\n\n for (const selectedItem of this.selectedItems) {\n const newInput = document.createElement('input')\n newInput.setAttribute('data-list-input', 'true')\n newInput.type = 'hidden'\n newInput.autocomplete = 'off'\n newInput.name = selectedItem.inputName || this.#inputName\n newInput.value = (selectedItem.value || selectedItem.label || '').trim()\n\n inputList.append(newInput)\n }\n\n for (const input of inputs) {\n input.remove()\n }\n }\n }\n\n get #firstItem(): SelectPanelItem | null {\n return (this.querySelector(visibleMenuItemSelectors)?.parentElement || null) as SelectPanelItem | null\n }\n\n get visibleItems(): SelectPanelItem[] {\n return Array.from(this.querySelectorAll(visibleMenuItemSelectors)).map(\n element => element.parentElement! as SelectPanelItem,\n )\n }\n\n get items(): SelectPanelItem[] {\n return Array.from(this.querySelectorAll(menuItemSelectors)).map(\n element => element.parentElement! as SelectPanelItem,\n )\n }\n\n get focusableItem(): HTMLElement | undefined {\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n if (itemContent.getAttribute('tabindex') === '0') {\n return itemContent\n }\n }\n }\n\n getItemById(itemId: string): SelectPanelItem | null {\n return this.querySelector(`li[data-item-id=\"${itemId}\"`)\n }\n\n isItemDisabled(item: SelectPanelItem | null): boolean {\n if (item) {\n return item.classList.contains('ActionListItem--disabled')\n } else {\n return false\n }\n }\n\n disableItem(item: SelectPanelItem | null) {\n if (item) {\n item.classList.add('ActionListItem--disabled')\n this.#getItemContent(item)!.setAttribute('aria-disabled', 'true')\n }\n }\n\n enableItem(item: SelectPanelItem | null) {\n if (item) {\n item.classList.remove('ActionListItem--disabled')\n this.#getItemContent(item)!.removeAttribute('aria-disabled')\n }\n }\n\n isItemHidden(item: SelectPanelItem | null): boolean {\n if (item) {\n return item.hasAttribute('hidden')\n } else {\n return false\n }\n }\n\n #hideItem(item: SelectPanelItem | null) {\n if (item) {\n item.setAttribute('hidden', 'hidden')\n }\n }\n\n #showItem(item: SelectPanelItem | null) {\n if (item) {\n item.removeAttribute('hidden')\n }\n }\n\n isItemChecked(item: SelectPanelItem | null) {\n if (item) {\n return this.#getItemContent(item)!.getAttribute(this.ariaSelectionType) === 'true'\n } else {\n return false\n }\n }\n\n checkItem(item: SelectPanelItem | null) {\n if (item && (this.selectVariant === 'single' || this.selectVariant === 'multiple')) {\n if (!this.isItemChecked(item)) {\n this.#handleItemActivated(item)\n }\n }\n }\n\n uncheckItem(item: SelectPanelItem | null) {\n if (item && (this.selectVariant === 'single' || this.selectVariant === 'multiple')) {\n if (this.isItemChecked(item)) {\n this.#handleItemActivated(item)\n }\n }\n }\n\n #getItemContent(item: SelectPanelItem): HTMLElement | null {\n return item.querySelector('.ActionListContent')\n }\n}\n\nif (!window.customElements.get('select-panel')) {\n window.SelectPanelElement = SelectPanelElement\n window.customElements.define('select-panel', SelectPanelElement)\n}\n\ndeclare global {\n interface Window {\n SelectPanelElement: typeof SelectPanelElement\n }\n}\n","import {controller} from '@github/catalyst'\n\n@controller\nclass PageHeaderElement extends HTMLElement {\n menuItemClick(event: Event) {\n const currentTarget = event.currentTarget as HTMLButtonElement\n\n const id = currentTarget?.getAttribute('data-for')\n\n if (id) {\n document.getElementById(id)?.click()\n }\n }\n}\n\ndeclare global {\n interface Window {\n PageHeaderElement: typeof PageHeaderElement\n }\n}\n\nif (!window.customElements.get('page-header')) {\n window.PageHeaderElement = PageHeaderElement\n window.customElements.define('page-header', PageHeaderElement)\n}\n","import {controller, target} from '@github/catalyst'\n\n@controller\nclass ZenModeButtonElement extends HTMLElement {\n @target button: HTMLElement\n inZenMode = false\n\n // eslint-disable-next-line custom-elements/no-constructor\n constructor() {\n super()\n document.addEventListener('fullscreenchange', this.fullscreenChangeEventHandler.bind(this))\n }\n\n disconnectedCallback() {\n document.removeEventListener('fullscreenchange', this.fullscreenChangeEventHandler.bind(this))\n }\n\n fullscreenChangeEventHandler() {\n this.changeButtonState(!this.inZenMode)\n this.dispatchZenModeStatus()\n }\n dispatchZenModeStatus() {\n // Create a new custom event\n const event = new CustomEvent('zenModeToggled', {\n detail: {\n active: this.inZenMode,\n },\n })\n // Dispatch the custom event\n window.dispatchEvent(event)\n }\n\n private deactivateZenMode() {\n if (document.exitFullscreen) {\n void document.exitFullscreen()\n }\n }\n\n private activateZenMode() {\n if (document.documentElement.requestFullscreen) {\n void document.documentElement.requestFullscreen()\n }\n }\n public changeButtonState(inZenMode: boolean) {\n this.inZenMode = inZenMode\n this.button.setAttribute('aria-pressed', inZenMode.toString())\n }\n\n public performAction() {\n if (this.inZenMode) {\n this.deactivateZenMode()\n } else {\n this.activateZenMode()\n }\n }\n}\n\ndeclare global {\n interface Window {\n ZenModeButtonElement: typeof ZenModeButtonElement\n }\n}\n\nif (!window.customElements.get('zen-mode-button')) {\n window.ZenModeButtonElement = ZenModeButtonElement\n window.customElements.define('zen-mode-button', ZenModeButtonElement)\n}\n","import {controller, target, targets} from '@github/catalyst'\n\n@controller\nclass SubHeaderElement extends HTMLElement {\n @target filterInput: HTMLInputElement\n @targets hiddenItemsOnExpandedFilter: HTMLElement[]\n @targets shownItemsOnExpandedFilter: HTMLElement[]\n\n connectedCallback() {\n this.setupFilterInputClearButton()\n }\n\n setupFilterInputClearButton() {\n this.waitForCondition(\n () => Boolean(this.filterInput),\n () => {\n this.toggleFilterInputClearButton()\n },\n )\n }\n\n toggleFilterInputClearButton() {\n if (this.filterInput.value.length > 0) {\n this.filterInput.classList.remove('SubHeader-filterInput_hiddenClearButton')\n } else {\n this.filterInput.classList.add('SubHeader-filterInput_hiddenClearButton')\n }\n }\n\n expandFilterInput() {\n for (const item of this.hiddenItemsOnExpandedFilter) {\n item.classList.add('d-none')\n }\n\n for (const item of this.shownItemsOnExpandedFilter) {\n item.classList.remove('d-none')\n }\n\n this.classList.add('SubHeader--expandedSearch')\n\n this.filterInput.focus()\n }\n\n collapseFilterInput() {\n for (const item of this.hiddenItemsOnExpandedFilter) {\n item.classList.remove('d-none')\n }\n\n for (const item of this.shownItemsOnExpandedFilter) {\n item.classList.add('d-none')\n }\n\n this.classList.remove('SubHeader--expandedSearch')\n }\n\n // Waits for condition to return true. If it returns false initially, this function creates a\n // MutationObserver that calls body() whenever the contents of the component change.\n private waitForCondition(condition: () => boolean, body: () => void) {\n if (condition()) {\n body()\n } else {\n const mutationObserver = new MutationObserver(() => {\n if (condition()) {\n body()\n mutationObserver.disconnect()\n }\n })\n\n mutationObserver.observe(this, {childList: true, subtree: true})\n }\n }\n}\n\ndeclare global {\n interface Window {\n SubHeaderElement: typeof SubHeaderElement\n }\n}\n\nif (!window.customElements.get('sub-header')) {\n window.SubHeaderElement = SubHeaderElement\n window.customElements.define('sub-header', SubHeaderElement)\n}\n"],"names":["_IncludeFragmentElement_instances","_IncludeFragmentElement_busy","_IncludeFragmentElement_observer","_IncludeFragmentElement_handleData","_IncludeFragmentElement_getData","_IncludeFragmentElement_getStringOrErrorData","_IncludeFragmentElement_task","_IncludeFragmentElement_fetchDataWithEvents","__classPrivateFieldGet","receiver","state","kind","f","TypeError","has","call","value","get","__classPrivateFieldSet","set","privateData","WeakMap","cspTrustedTypesPolicyPromise","IncludeFragmentElement","HTMLElement","constructor","super","arguments","add","this","IntersectionObserver","entries","entry","isIntersecting","target","unobserve","loading","rootMargin","threshold","static","tag","registry","customElements","define","policy","Promise","resolve","observedAttributes","src","getAttribute","link","ownerDocument","createElement","href","val","setAttribute","accept","data","attributeChangedCallback","attribute","oldVal","isConnected","connectedCallback","shadowRoot","attachShadow","mode","style","document","textContent","append","observe","request","Error","Request","method","credentials","headers","Accept","load","fetch","refetch","delete","WeakSet","async","dataTreatedAsString","template","innerHTML","fragment","importNode","content","dispatchEvent","CustomEvent","cancelable","detail","replaceWith","_a","classList","cachedData","reject","toString","eventsToDispatch","setTimeout","eventType","Event","response","status","ct","split","find","x","match","includes","responseText","text","createHTML","error","root","globalThis","window","e","DOMException","name","ReferenceError","states","RemoteInputElement","fetchResults","bind","currentQuery","oninput","debounce","controller","oldValue","input","addEventListener","disconnectedCallback","removeEventListener","querySelector","HTMLInputElement","HTMLTextAreaElement","url","remoteInput","checkCurrentQuery","event","query","resultsContainer","getElementById","URL","location","params","URLSearchParams","search","abort","AbortController","signal","html","el","options","fetchWithNetworkEvents","removeAttribute","ok","bubbles","type","undefined","callback","timeout","args","clearTimeout","__decorate","decorators","key","desc","d","c","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","SuppressedError","controllers","bindShadow","bindElements","listenForBind","observers","closed","observer","MutationObserver","mutations","mutation","Element","bindActions","addedNodes","node","childList","subtree","attributeFilter","subscription","unsubscribe","disconnect","querySelectorAll","hasAttribute","handleEvent","currentTarget","binding","bindings","closest","getRootNode","ShadowRoot","host","matches","shadowController","action","trim","eventSep","lastIndexOf","methodSep","Math","max","slice","dasherize","str","String","description","replace","toLowerCase","mustDasherize","dashed","attrKey","attr","proto","meta","initialized","initializeAttrs","instance","names","getPrototypeOf","prefix","attrPrefix","descriptor","configurable","newValue","Number","toggleAttribute","symbol","Symbol","for","CatalystDelegate","classObject","delegate","prototype","attributes","observed","attrToAttributeName","map","concat","defineObservedAttributes","register","upgrade","element","parentElement","cloneNode","autoShadowRoot","hasOwnProperty","parent","Map","Set","tagName","findTarget","targets","push","findTargets","readyState","once","listenerOptions","passive","handler","ActionListTruncationObserver","resizeObserver","ResizeObserver","update","items","item","label","tooltip","isTruncated","scrollWidth","clientWidth","display","ActionListElement","_ActionListElement_truncationObserver","alternateOrders","alternateAlignments","start","end","center","getAnchoredPosition","floatingElement","anchorElement","settings","test","body","showPopover","_b","isOnTopLayer","parentNode","getComputedStyle","position","getPositionedParent","clippingRect","overflow","clippingNode","elemRect","getBoundingClientRect","elemStyle","borderTop","borderLeft","borderRight","borderBottom","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","v","parseInt","top","left","width","height","innerHeight","Infinity","getClippingRect","parentElementStyle","parentElementRect","viewportRect","relativePosition","floatingRect","anchorRect","side","align","allowOutOfBounds","anchorOffset","alignmentOffset","relativeViewportRect","pos","calculatePosition","anchorSide","anchorAlign","alternateOrder","positionAttempt","prevSide","shouldRecalculatePosition","nextSide","alternateAlignment","alignmentAttempt","prevAlign","shouldRecalculateAlignment","nextAlign","assign","pureCalculateAnchoredPosition","_c","_d","_e","positionDefaults","startsWith","getDefaultSettings","elementDimensions","anchorPosition","anchorRight","anchorBottom","currentPos","containerDimensions","iterateFocusableElements","container","strict","acceptFn","onlyTabbable","isTabbable","isFocusable","walker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","FILTER_ACCEPT","FILTER_SKIP","nextNode","reverse","lastChild","firstChild","previousNode","getFocusableChild","next","elem","disabledAttrInert","disabled","hiddenInert","hidden","hiddenInputInert","sentinelInert","contains","sizeInert","offsetWidth","offsetHeight","visibilityInert","visibility","displayInert","offsetParent","clientRectsInert","getClientRects","HTMLAnchorElement","tabIndex","signalSupported","noop","create","polyfill","originalAddEventListener","EventTarget","originalCallback","optionsOrCapture","AbortSignal","monkeyPatch","suspendedTrapStack","activeTrap","isMac","focusTrap","initialFocus","abortSignal","sentinelStart","onfocus","lastFocusableChild","focus","sentinelEnd","firstFocusableChild","prepend","sentinels","Array","from","filter","firstElementChild","lastElementChild","insertAdjacentElement","observeFocusTrap","lastFocusedChild","ensureTrapZoneHasFocus","focusedElement","wrappingController","followSignal","suspendedTrap","getElementsByClassName","remove","suspendedTrapIndex","findIndex","t","splice","trapToReactivate","pop","originalSignal","tryReactivate","capture","activeElement","isMacOS","navigator","platform","idSeed","FocusKeys","KEY_TO_BIT","ArrowLeft","ArrowHorizontal","ArrowDown","ArrowVertical","ArrowUp","ArrowRight","h","HL","j","JK","k","l","a","AD","s","WS","w","Tab","Home","HomeAndEnd","End","PageUp","PageUpDown","PageDown","Backspace","KEY_TO_DIRECTION","getDirection","keyboardEvent","direction","shiftKey","metaKey","ctrlKey","isActiveDescendantAttribute","hasActiveDescendantAttribute","focusZone","focusableElements","savedTabIndex","bindKeys","getNextFocusable","ArrowAll","focusOutBehavior","focusInStrategy","activeDescendantControl","activeDescendantCallback","onActiveDescendantChanged","currentFocusedElement","preventScroll","getFirstFocusableElement","updateFocusedElement","to","directlyActivated","setActiveDescendant","clearActiveDescendant","id","previouslyActiveElement","beginFocusManagement","elements","filteredElements","focusableElementFilter","elementsToInsert","firstElementToInsert","iMin","iMax","floor","followsInDocument","findInsertionIndex","first","second","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","endFocusManagement","focusableElementIndex","indexOf","savedIndex","iterateFocusableElementsOptions","removedNode","removedNodes","addedNode","attributeOldValue","elementIndexFocusedByClick","focusableElement","relatedTarget","targetElementIndex","lastKeyboardFocusDirection","targetElement","elementToFocus","console","warn","keyboardEventRecipient","keyBit","defaultPrevented","keyLength","isTextInput","HTMLSelectElement","altKey","textInput","cursorAtStart","selectionStart","selectionEnd","cursorAtEnd","shouldIgnoreFocusHandling","nextElementToFocus","lastFocusedIndex","focusedIndex","getCurrentFocusedIndex","nextFocusedIndex","preventDefault","instersectionObserver","ActionBarElement","ItemType","_ActionBarElement_focusZoneAbortController","marginLeft","marginRight","requestAnimationFrame","menuItemClick","click","firstItem","firstItemTop","previousItemType","_ActionBarElement_instances","_ActionBarElement_eachItem","index","itemTop","Item","_ActionBarElement_hideItem","moreMenu","Divider","_ActionBarElement_showItem","idx","elementIsVisibleItem","elementIsVisibleActionMenuInvoker","invokerElement","foundItem","_index","menuItem","setProperty","DetailsMenuElement","preload","details","summary","subscriptions","fromEvent","trackComposition","shouldCommit","menu","KeyboardEvent","isComposing","isSummaryFocused","close","stopPropagation","sibling","ctrlBindings","selected","isMenuItem","keydown","loadFragment","opened","closeCurrentMenu","NullSubscription","focusOnOpen","loaded","sub","eventName","onNext","loader","autofocus","isMouse","focusFirstItem","found","def","userAgent","menuitem","checked","commit","button","textEl","labelText","contentsEl","labelHTML","updateLabel","checkState","indeterminate","updateChecked","role","updateWhenVisible","anchors","intersectionObserver","updateVisibleAnchors","anchor","documentElement","AnchoredPositionElement","_AnchoredPositionElement_anchorElement","_AnchoredPositionElement_animationFrame","alias","idRef","cancelAnimationFrame","toggle","bottom","right","dialogInvokerButtonHandler","dialogId","dialog","HTMLDialogElement","showModal","fixed","popover","stopImmediatePropagation","open","DialogHelperElement","_DialogHelperElement_abortController","innerWidth","records","record","_DialogHelperElement_instances","_DialogHelperElement_handleDialogOpenAttribute","rect","clientY","clientX","ToggleEvent","oldState","newState","init","popoverToggleTaskQueue","queuePopoverToggleEventTask","topLayerElements","autoPopoverList","visibilityState","getPopoverVisibilityState","popoverInvoker","checkPopoverValidity","expectedToBeShowing","fullscreenElement","getStackPosition","topMostClickedPopover","clickedPopover","nearestInclusiveOpenPopover","invokerPopover","nodePopover","popoverTargetElement","Document","nearestInclusiveTargetPopoverForInvoker","topMostAutoPopover","document2","documentPopovers","assignedSlot","focusTarget","HTMLButtonElement","HTMLOptGroupElement","HTMLOptionElement","HTMLFieldSetElement","popoverFocusingSteps","subject","delegatesFocus","whereToLook","autoFocusDelegate","slots","slot","assignedElements","flatten","descendant","currentNode","focusDelegate","previouslyFocusedElements","shouldRestoreFocus","originalType","hideAllPopoversUntil","newPopover","popoverPositions","topMostPopoverAncestor2","candidate","candidateAncestor","candidatePosition","checkAncestor","topMostPopoverAncestor","originallyFocusedElement","setInvokerAriaExpanded","hidePopover","focusPreviousElement","fireEvents","previouslyFocusedElement","closeAllOpenPopovers","endpoint","lastToHide","foundEndpoint","size","popoverPointerDownTargets","lightDismissOpenPopovers","isTrusted","composedPath","ancestor","sameTarget","initialAriaExpandedValue","force","initialValue","ShadowRoot2","patchSelectorFn","object","mapper","original","selector","nonEscapedPopoverSelector","getStyles","useLayer","CSSLayerBlockRule","popoverStyleSheet","injectStyles","styles","CSSStyleSheet","replaceSync","sheet","head","adoptedStyleSheets","rewriteSelector","DocumentFragment","defineProperties","enumerable","togglePopover","originalAttachShadow","writable","originalAttachInternals","attachInternals","internals","popoverTargetAssociatedElements","applyPopoverInvokerElementMixin","ElementClass","localName","form","idref","popoverTargetAction","handleInvokerActivation","invoker","popoverTargetAttributeActivationBehavior","onKeydown","addEventListeners","apply","menuItemSelector","join","getMnemonicFor","printable","FocusGroupElement","_FocusGroupElement_retainSignal","_FocusGroupElement_abortController","nowrap","retain","mnemonics","_FocusGroupElement_instances","_FocusGroupElement_items_get","toggleEvent","mnemonic","offset","focusEl","at","min","ScrollableRegionElement","hasOverflow","labelledBy","scrollHeight","clientHeight","focusIfNeeded","overlayStack","clickHandler","ModalDialogElement","openButton","show","dialogIndex","ele","keydownHandler","mousedownHandler","topLevelDialog","upEvent","_ModalDialogElement_focusAbortController","paddingRight","aborted","showButtons","closedNotCancelled","dialogEvent","NavListElement","_NavListElement_truncationObserver","topLevelList","selectItemById","itemId","selectedItem","_NavListElement_instances","_NavListElement_findSelectedNavItemById","_NavListElement_select","selectItemByHref","_NavListElement_findSelectedNavItemByHref","selectItemByCurrentLocation","expandItem","nextElementSibling","collapseItem","itemIsExpanded","handleItemWithSubItemClick","handleItemWithSubItemKeydown","button_id","navItem","selectedNavItem","pathname","currentlySelectedItem","_NavListElement_deselect","children","parentMenu","_NavListElement_findParentMenu","NavListGroupElement","_NavListGroupElement_truncateObserver","setShowMoreItemState","showMoreDisabled","showMoreItem","currentPage","totalPages","paginationSrc","paginationURL","origin","searchParams","err","_NavListGroupElement_instances","_NavListGroupElement_parseHTML","listId","focusMarkers","SegmentedControlElement","_SegmentedControlElement_instances","_SegmentedControlElement_updateButtonLabels","select","ToggleSwitchElement","turbo","toggling","csrf","csrfElement","csrfField","isRemote","isDisabled","performToggle","setLoadingState","submitForm","setErrorState","message","setSuccessState","turnOn","switch","turnOff","isOn","isOff","disable","enable","errorIcon","loadingSpinner","setFinishedState","FormData","requestHeaders","contentType","Turbo","renderStreamMessage","isPopoverOpen","setSelector","TOOLTIP_SR_ONLY_CLASS","DIRECTION_CLASSES","closeOpenTooltips","except","openTooltips","focusOutListener","focusInListener","showReason","control","tooltips","ToolTipElement","_ToolTipElement_abortController","_ToolTipElement_align","_ToolTipElement_side","_ToolTipElement_allowUpdatePosition","_ToolTipElement_showReason","htmlFor","hiddenFromView","_ToolTipElement_instances","_ToolTipElement_updateControlReference","_ToolTipElement_updateDirection","shadow","appendChild","_ToolTipElement_update","showing","shouldShow","webdriver","isMouseLeaveFromButton","isEscapeKeydown","isMouseDownOnButton","isOpeningOtherPopover","shouldHide","isOpen","_ToolTipElement_updatePosition","describedBy","XBannerElement","dismiss","_XBannerElement_instances","_XBannerElement_dismissScheme_get","removeChild","hide","Combobox","list","tabInsertsSuggestions","defaultFirstOption","random","keyboardEventHandler","combobox","clearSelection","navigate","keyboardBindings","compositionEventHandler","inputHandler","destroy","stop","commitWithElement","indicateDefaultOption","visible","indexDiff","els","focusIndex","indexOfItem","newIndex","scrollTo","fireCommitEvent","scrollTop","containerBottom","offsetTop","inViewport","SCREEN_READER_DELAY","testScreenReaderDelay","Autocomplete","results","autoselectEnabled","feedback","clearButton","clientOptions","labelElem","interactingWithList","onInputChange","wait","Rest","onResultsMouseDown","onInputBlur","onInputFocus","onCommit","handleClear","updateFeedbackForScreenReaders","identifyOptions","inputString","fetchOnEmpty","fetchResult","then","allNewOptions","hasResults","numOptions","firstOption","firstOptionValue","catch","_AutoCompleteElement_instances","_AutoCompleteElement_forElement","_AutoCompleteElement_inputElement","_AutoCompleteElement_reattachState","_AutoCompleteElement_requestController","__rest","p","getOwnPropertySymbols","propertyIsEnumerable","AutoCompleteEvent","AutoCompleteElement","forElement","inputElement","autocomplete","res","AutocompleteElement","copyNode","clipboard","writeText","selection","getSelection","removeAllRanges","range","createRange","selectNodeContents","addRange","execCommand","copyText","createNode","copy","trigger","clicked","focused","blurred","ClipboardCopyElement","showSVG","svg","hideSVG","clipboardCopyElementTimers","currentTimeout","clipboardCopyLiveRegion","copiedAnnouncement","copyIcon","checkIcon","showCheck","showCopy","_DurationFormat_options","ListFormat","Intl","formatToParts","members","parts","partsTable","twoDigitFormatOptions","minimumIntegerDigits","DurationFormat","locale","prevStyle","hours","minutes","seconds","milliseconds","years","yearsDisplay","months","monthsDisplay","weeks","weeksDisplay","days","daysDisplay","hoursDisplay","minutesDisplay","secondsDisplay","millisecondsDisplay","resolvedOptions","duration","unit","nfUnit","unitStyle","nfOpts","unitDisplay","NumberFormat","format","durationRe","unitNames","Duration","sign","blank","abs","durationLike","factor","parsed","RangeError","one","two","now","Date","oneApplied","applyDuration","getTime","twoApplied","toLocaleString","opts","date","setFullYear","getFullYear","setMonth","getMonth","setDate","getDate","setHours","getHours","setMinutes","getMinutes","setSeconds","getSeconds","roundToSingleUnit","relativeTo","round","currentYear","currentMonth","currentDate","newMonthDate","monthDateCorrection","newDate","yearDiff","monthDiff","daysDiff","monthsDiff","_RelativeTimeElement_instances","_RelativeTimeElement_customTitle","_RelativeTimeElement_updating","_RelativeTimeElement_lang_get","_RelativeTimeElement_renderRoot","_RelativeTimeElement_getFormattedTitle","_RelativeTimeElement_resolveFormat","_RelativeTimeElement_getDurationFormat","_RelativeTimeElement_getRelativeFormat","_RelativeTimeElement_getDateTimeFormat","_RelativeTimeElement_onRelativeTimeUpdated","emptyDuration","microEmptyDuration","RelativeTimeUpdatedEvent","oldText","newText","oldTitle","newTitle","composed","getUnitFactor","precision","ms","dateObserver","time","timer","nearestDistance","timeEl","RelativeTimeElement","onRelativeTimeUpdated","listener","minute","hour","weekday","formatStyle","day","month","year","getUTCFullYear","timeZoneName","tense","noTitle","datetime","parse","isNaN","toISOString","attrName","DateTimeFormat","delta","sec","hr","elapsedTime","RelativeTimeFormat","compare","empty","relativeFormat","numeric","int","rounded","getRelativeTimeUnit","formatter","getTabs","tab","TabContainerElement","tabs","currentIndex","incrementKeys","decrementKeys","some","code","selectTab","panels","panel","selectedTab","selectedPanel","PrimerMultiInputElement","activateField","fieldWithName","findField","field","fields","middle","last","cancelled","fn","cancel","throttle","_AutoCheckElement_onloadend","AllowedHttpMethods","AutoCheckEvent","phase","AutoCheckValidationEvent","setValidity","AutoCheckCompleteEvent","AutoCheckSuccessEvent","AutoCheckStartEvent","AutoCheckErrorEvent","AutoCheckSendEvent","AutoCheckElement","onloadend","checker","check","spellcheck","setCustomValidity","required","httpMethod","autoCheckElement","startEvent","clone","PrimerTextFieldElement","_PrimerTextFieldElement_abortController","setSuccess","clearError","errorMessage","setError","clearContents","validationElement","validationMessageElement","replaceChildren","setValidationMessage","toggleValidationStyling","isError","validationSuccessIcon","validationErrorIcon","showLeadingSpinner","leadingSpinner","leadingVisual","hideLeadingSpinner","ToggleSwitchInputElement","validSelectors","menuItemSelectors","ActionMenuElement","_ActionMenuElement_abortController","_ActionMenuElement_originalLabel","_ActionMenuElement_inputName","_ActionMenuElement_invokerBeingClicked","selectVariant","variant","dynamicLabelPrefix","dynamicLabel","popoverElement","invokerLabel","selectedItems","labelEl","_ActionMenuElement_instances","_ActionMenuElement_setDynamicLabel","_ActionMenuElement_updateInput","_ActionMenuElement_softDisableItems","includeFragment","targetIsInvoker","eventIsActivation","_ActionMenuElement_isActivation","_ActionMenuElement_firstItem_get","_ActionMenuElement_handleInvokerActivated","_ActionMenuElement_handleFocusOut","_ActionMenuElement_potentiallyDisallowActivation","dialogInvoker","_ActionMenuElement_isAnchorActivationViaSpace","_ActionMenuElement_handleItemActivated","_ActionMenuElement_handleIncludeFragmentReplaced","getItemById","isItemDisabled","disableItem","enableItem","isItemHidden","hideItem","showItem","isItemChecked","checkItem","itemContent","uncheckItem","MouseEvent","_ActionMenuElement_isOpen","_ActionMenuElement_hide","_ActionMenuElement_show","_ActionMenuElement_handleDialogItemActivated","dialog_controller","handleDialogClose","lostFocus","focusInClosedMenu","focusInDialog","newActiveElement","checkedItem","itemLabel","prefixSpan","contentSpan","inputList","inputs","newInput","Ordering","_compareFn","_heap","_MinHeap_instances","heapifyDown_fn","heapifyUp_fn","__typeError$2","msg","__accessCheck$2","obj","member","__privateGet$2","getter","__privateAdd$2","__privateSet$2","setter","__privateMethod$1","MinHeap","compareFn","insert","peek","swap","clear","getLeftChildIndex","getRightChildIndex","getParentIndex","hasLeftChild","hasRightChild","hasParent","leftChild","heap","rightChild","b","tmp","smallerChildIndex","_promise","_resolve","_reject","__defProp","__typeError$1","__publicField","__defNormalProp","__accessCheck$1","__privateGet$1","__privateAdd$1","__privateSet$1","toStringTag","Deferred","onfulfilled","onrejected","finally","onfinally","reason","getPromise","_pending","_queue","_timeoutId","_LiveRegionElement_instances","performWork_fn","updateContainerWithMessage_fn","__typeError","__accessCheck","__privateGet","__privateAdd","__privateSet","__privateMethod","LiveRegionElement","template2","templateContent","getTemplate","compareMessages","delay","announce","delayMs","politeness","deferred","contents","scheduled","announceFromElement","innerText","getTextContent","getMessage","visibleMenuItemSelectors","FetchStrategy","ErrorStateType","updateAnchorPosition","SelectPanelElement","_SelectPanelElement_dialogIntersectionObserver","_SelectPanelElement_abortController","_SelectPanelElement_originalLabel","_SelectPanelElement_inputName","_SelectPanelElement_selectedItems","_SelectPanelElement_loadingDelayTimeoutId","_SelectPanelElement_loadingAnnouncementTimeoutId","_SelectPanelElement_hasLoadedData","ariaSelectionType","dynamicAriaLabelPrefix","closeButton","values","_SelectPanelElement_instances","_SelectPanelElement_setDynamicLabel","_SelectPanelElement_updateInput","_SelectPanelElement_softDisableItems","_SelectPanelElement_waitForCondition","Boolean","filterInputTextField","_SelectPanelElement_fetchStrategy_get","LOCAL","_SelectPanelElement_updateItemVisibility","_SelectPanelElement_handleSearchFieldEvent","_SelectPanelElement_handleRemoteInputEvent","targetIsCloseButton","_SelectPanelElement_isActivation","_SelectPanelElement_handleInvokerActivated","fireSearchEvent","_SelectPanelElement_potentiallyDisallowActivation","_SelectPanelElement_isAnchorActivationViaSpace","_SelectPanelElement_getItemContent","_SelectPanelElement_handleItemActivated","_SelectPanelElement_handleIncludeFragmentEvent","visibleItems","focusableItem","condition","mutationObserver","setZeroTabIndex","_SelectPanelElement_firstItem_get","inputName","_SelectPanelElement_filterInputTextFieldElement_get","liveRegion","_SelectPanelElement_toggleIncludeFragmentElements","errorElement","fragmentErrorElement","showError","_SelectPanelElement_clearErrorState","_SelectPanelElement_checkSelectedItems","bodySpinner","BODY","BANNER","_SelectPanelElement_performFilteringLocally","_SelectPanelElement_setTextFieldLoadingSpinnerTimer","_SelectPanelElement_defaultFilterFn","EVENTUALLY_LOCAL","atLeastOneResult","filterFn","_SelectPanelElement_showItem","_SelectPanelElement_hideItem","_SelectPanelElement_updateTabIndices","_SelectPanelElement_maybeAnnounce","_SelectPanelElement_addSelectedItem","noResults","_SelectPanelElement_inErrorState","bannerErrorElement","instructions","noResultsEl","REMOTE","_SelectPanelElement_handleDialogItemActivated","currentlyChecked","_SelectPanelElement_removeSelectedItem","PageHeaderElement","ZenModeButtonElement","inZenMode","fullscreenChangeEventHandler","changeButtonState","dispatchZenModeStatus","active","deactivateZenMode","exitFullscreen","activateZenMode","requestFullscreen","performAction","SubHeaderElement","setupFilterInputClearButton","waitForCondition","filterInput","toggleFilterInputClearButton","expandFilterInput","hiddenItemsOnExpandedFilter","shownItemsOnExpandedFilter","collapseFilterInput"],"mappings":"yBAAA,IAWIA,EAAmCC,EAA8BC,EAAkCC,EAAoCC,EAAiCC,EAA8CC,EAA8BC,EAXpPC,EAAkE,SAAUC,EAAUC,EAAOC,EAAMC,GACnG,GAAa,MAATD,IAAiBC,EAAG,MAAM,IAAIC,UAAU,iDAC5C,GAAqB,mBAAVH,EAAuBD,IAAaC,IAAUE,GAAKF,EAAMI,IAAIL,GAAW,MAAM,IAAII,UAAU,4EACvG,MAAgB,MAATF,EAAeC,EAAa,MAATD,EAAeC,EAAEG,KAAKN,GAAYG,EAAIA,EAAEI,MAAQN,EAAMO,IAAIR,EACxF,EACIS,EAAkE,SAAUT,EAAUC,EAAOM,EAAOL,EAAMC,GAC1G,GAAa,MAATD,EAAc,MAAM,IAAIE,UAAU,kCACtC,GAAa,MAATF,IAAiBC,EAAG,MAAM,IAAIC,UAAU,iDAC5C,GAAqB,mBAAVH,EAAuBD,IAAaC,IAAUE,GAAKF,EAAMI,IAAIL,GAAW,MAAM,IAAII,UAAU,2EACvG,MAAiB,MAATF,EAAeC,EAAEG,KAAKN,EAAUO,GAASJ,EAAIA,EAAEI,MAAQA,EAAQN,EAAMS,IAAIV,EAAUO,GAASA,CACxG,EAEA,MAAMI,EAAc,IAAIC,QAIxB,IAAIC,EAA+B,KAC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