primer_view_components 0.32.0 → 0.34.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +42 -0
- data/app/assets/javascripts/app/components/primer/alpha/x_banner.d.ts +5 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/banner.rb +6 -0
- data/app/components/primer/alpha/overlay.css +1 -1
- data/app/components/primer/alpha/overlay.css.json +1 -0
- data/app/components/primer/alpha/overlay.css.map +1 -1
- data/app/components/primer/alpha/overlay.pcss +4 -0
- data/app/components/primer/alpha/select_panel.css +1 -0
- data/app/components/primer/alpha/select_panel.css.json +7 -0
- data/app/components/primer/alpha/select_panel.css.map +1 -0
- data/app/components/primer/alpha/select_panel.html.erb +15 -14
- data/app/components/primer/alpha/select_panel.pcss +7 -0
- data/app/components/primer/alpha/select_panel.rb +43 -4
- data/app/components/primer/alpha/select_panel_element.js +12 -10
- data/app/components/primer/alpha/select_panel_element.ts +12 -10
- data/app/components/primer/alpha/x_banner.d.ts +5 -0
- data/app/components/primer/alpha/x_banner.js +4 -3
- data/app/components/primer/alpha/x_banner.ts +11 -3
- data/app/components/primer/beta/button.css +1 -1
- data/app/components/primer/beta/button.css.map +1 -1
- data/app/components/primer/beta/button.pcss +1 -1
- data/app/components/primer/beta/label.css +1 -1
- data/app/components/primer/beta/label.css.map +1 -1
- data/app/components/primer/beta/label.pcss +3 -4
- data/app/components/primer/beta/spinner.html.erb +8 -6
- data/app/components/primer/beta/spinner.rb +3 -0
- data/app/components/primer/component.rb +4 -0
- data/app/components/primer/primer.pcss +1 -0
- data/app/lib/primer/attributes_helper.rb +10 -0
- data/lib/primer/forms/primer_text_field.js +1 -3
- data/lib/primer/forms/primer_text_field.ts +1 -3
- data/lib/primer/view_components/linters/base_linter.rb +4 -2
- data/lib/primer/view_components/linters/blankslate_component_migration_counter.rb +1 -1
- data/lib/primer/view_components/linters/select_menu_migration_counter.rb +14 -0
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/rubocop/cop/primer/primer_octicon.rb +1 -1
- data/previews/primer/alpha/select_panel_preview/eventually_local_fetch.html.erb +2 -1
- data/previews/primer/alpha/select_panel_preview/list_of_links.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/local_fetch.html.erb +2 -1
- data/previews/primer/alpha/select_panel_preview.rb +10 -9
- data/static/classes.json +6 -0
- data/static/constants.json +2 -1
- data/static/info_arch.json +1 -1
- metadata +8 -3
@@ -1 +1 @@
|
|
1
|
-
{"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/aria_live.ts","../../../node_modules/@github/image-crop-element/dist/index.js","../../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","../../components/primer/alpha/select_panel_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 */\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;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (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 = {}, 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 function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\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 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 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 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\n// eslint-disable-next-line no-unused-vars\nenum ItemType {\n // eslint-disable-next-line no-unused-vars\n Item,\n // eslint-disable-next-line no-unused-vars\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<HTMLElement> {\n return this.moreMenu.querySelectorAll('[role=\"menu\"] > li')\n }\n\n // eslint-disable-next-line no-unused-vars\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<AnchoredPositionElement>()\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<typeof requestAnimationFrame>\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 <dialog> 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<HTMLElement>('.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 this.ownerDocument.body.classList.toggle('has-modal', this.dialog.matches(':modal'))\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<HTMLElement>('[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","const safeDocument = typeof document === 'undefined' ? undefined : document\n\n// Announce an element's text to the screen reader.\nexport function announceFromElement(el: HTMLElement, options?: {assertive?: boolean; element?: HTMLElement}) {\n announce(getTextContent(el), options)\n}\n\n// Announce message update to screen reader.\n// Note: Use caution when using this function while a dialog is active.\n// If the message is updated while the dialog is open, the screen reader may not announce the live region.\nexport function announce(message: string, options?: {assertive?: boolean; element?: HTMLElement}) {\n const {assertive, element} = options ?? {}\n\n setContainerContent(message, assertive, element)\n}\n\n// Set aria-live container to message.\nfunction setContainerContent(message: string, assertive?: boolean, element?: HTMLElement) {\n const getQuerySelector = () => {\n return assertive ? '#js-global-screen-reader-notice-assertive' : '#js-global-screen-reader-notice'\n }\n const container = element ?? safeDocument?.querySelector(getQuerySelector())\n if (!container) return\n if (container.textContent === message) {\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 container.textContent = `${message}\\u00A0`\n } else {\n container.textContent = message\n }\n}\n\n// Gets the trimmed text content of an element.\nfunction getTextContent(el: HTMLElement): string {\n // innerText does not contain hidden text\n /* eslint-disable-next-line github/no-innerText */\n return (el.getAttribute('aria-label') || el.innerText || '').trim()\n}\n","const startPositions = new WeakMap();\nconst dragStartPositions = new WeakMap();\nconst constructedElements = new WeakMap();\nfunction moveCropArea(event) {\n const el = event.currentTarget;\n if (!(el instanceof ImageCropElement))\n return;\n const { box, image } = constructedElements.get(el) || {};\n if (!box || !image)\n return;\n let deltaX = 0;\n let deltaY = 0;\n if (event instanceof KeyboardEvent) {\n if (event.key === 'ArrowUp') {\n deltaY = -1;\n }\n else if (event.key === 'ArrowDown') {\n deltaY = 1;\n }\n else if (event.key === 'ArrowLeft') {\n deltaX = -1;\n }\n else if (event.key === 'ArrowRight') {\n deltaX = 1;\n }\n }\n else if (dragStartPositions.has(el) && event instanceof MouseEvent) {\n const pos = dragStartPositions.get(el);\n deltaX = event.pageX - pos.dragStartX;\n deltaY = event.pageY - pos.dragStartY;\n }\n else if (dragStartPositions.has(el) && event instanceof TouchEvent) {\n const { pageX, pageY } = event.changedTouches[0];\n const { dragStartX, dragStartY } = dragStartPositions.get(el);\n deltaX = pageX - dragStartX;\n deltaY = pageY - dragStartY;\n }\n if (deltaX !== 0 || deltaY !== 0) {\n const x = Math.min(Math.max(0, box.offsetLeft + deltaX), image.width - box.offsetWidth);\n const y = Math.min(Math.max(0, box.offsetTop + deltaY), image.height - box.offsetHeight);\n box.style.left = `${x}px`;\n box.style.top = `${y}px`;\n fireChangeEvent(el, { x, y, width: box.offsetWidth, height: box.offsetHeight });\n }\n if (event instanceof MouseEvent) {\n dragStartPositions.set(el, {\n dragStartX: event.pageX,\n dragStartY: event.pageY\n });\n }\n else if (event instanceof TouchEvent) {\n const { pageX, pageY } = event.changedTouches[0];\n dragStartPositions.set(el, {\n dragStartX: pageX,\n dragStartY: pageY\n });\n }\n}\nfunction updateCropArea(event) {\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n const el = getShadowHost(target);\n if (!(el instanceof ImageCropElement))\n return;\n const { box } = constructedElements.get(el) || {};\n if (!box)\n return;\n const rect = el.getBoundingClientRect();\n let deltaX, deltaY, delta;\n if (event instanceof KeyboardEvent) {\n if (event.key === 'Escape')\n return setInitialPosition(el);\n if (event.key === '-')\n delta = -10;\n if (event.key === '=')\n delta = +10;\n if (!delta)\n return;\n deltaX = box.offsetWidth + delta;\n deltaY = box.offsetHeight + delta;\n startPositions.set(el, { startX: box.offsetLeft, startY: box.offsetTop });\n }\n else if (event instanceof MouseEvent) {\n const pos = startPositions.get(el);\n if (!pos)\n return;\n deltaX = event.pageX - pos.startX - rect.left - window.pageXOffset;\n deltaY = event.pageY - pos.startY - rect.top - window.pageYOffset;\n }\n else if (event instanceof TouchEvent) {\n const pos = startPositions.get(el);\n if (!pos)\n return;\n deltaX = event.changedTouches[0].pageX - pos.startX - rect.left - window.pageXOffset;\n deltaY = event.changedTouches[0].pageY - pos.startY - rect.top - window.pageYOffset;\n }\n if (deltaX && deltaY)\n updateDimensions(el, deltaX, deltaY, !(event instanceof KeyboardEvent));\n}\nfunction getShadowHost(el) {\n const rootNode = el.getRootNode();\n if (!(rootNode instanceof ShadowRoot))\n return el;\n return rootNode.host;\n}\nfunction startUpdate(event) {\n const currentTarget = event.currentTarget;\n if (!(currentTarget instanceof HTMLElement))\n return;\n const el = getShadowHost(currentTarget);\n if (!(el instanceof ImageCropElement))\n return;\n const { box } = constructedElements.get(el) || {};\n if (!box)\n return;\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n if (target.hasAttribute('data-direction')) {\n const direction = target.getAttribute('data-direction') || '';\n el.addEventListener('mousemove', updateCropArea);\n el.addEventListener('touchmove', updateCropArea, { passive: true });\n if (['nw', 'se'].indexOf(direction) >= 0)\n el.classList.add('nwse');\n if (['ne', 'sw'].indexOf(direction) >= 0)\n el.classList.add('nesw');\n startPositions.set(el, {\n startX: box.offsetLeft + (['se', 'ne'].indexOf(direction) >= 0 ? 0 : box.offsetWidth),\n startY: box.offsetTop + (['se', 'sw'].indexOf(direction) >= 0 ? 0 : box.offsetHeight)\n });\n updateCropArea(event);\n }\n else {\n el.addEventListener('mousemove', moveCropArea);\n el.addEventListener('touchmove', moveCropArea, { passive: true });\n }\n}\nfunction updateDimensions(target, deltaX, deltaY, reposition = true) {\n let newSide = Math.max(Math.abs(deltaX), Math.abs(deltaY), 10);\n const pos = startPositions.get(target);\n if (!pos)\n return;\n const { box, image } = constructedElements.get(target) || {};\n if (!box || !image)\n return;\n newSide = Math.min(newSide, deltaY > 0 ? image.height - pos.startY : pos.startY, deltaX > 0 ? image.width - pos.startX : pos.startX);\n const x = reposition ? Math.round(Math.max(0, deltaX > 0 ? pos.startX : pos.startX - newSide)) : box.offsetLeft;\n const y = reposition ? Math.round(Math.max(0, deltaY > 0 ? pos.startY : pos.startY - newSide)) : box.offsetTop;\n box.style.left = `${x}px`;\n box.style.top = `${y}px`;\n box.style.width = `${newSide}px`;\n box.style.height = `${newSide}px`;\n fireChangeEvent(target, { x, y, width: newSide, height: newSide });\n}\nfunction setInitialPosition(el) {\n const { image } = constructedElements.get(el) || {};\n if (!image)\n return;\n const side = Math.round(image.clientWidth > image.clientHeight ? image.clientHeight : image.clientWidth);\n startPositions.set(el, {\n startX: (image.clientWidth - side) / 2,\n startY: (image.clientHeight - side) / 2\n });\n updateDimensions(el, side, side);\n}\nfunction stopUpdate(event) {\n const el = event.currentTarget;\n if (!(el instanceof ImageCropElement))\n return;\n dragStartPositions.delete(el);\n el.classList.remove('nwse', 'nesw');\n el.removeEventListener('mousemove', updateCropArea);\n el.removeEventListener('mousemove', moveCropArea);\n el.removeEventListener('touchmove', updateCropArea);\n el.removeEventListener('touchmove', moveCropArea);\n}\nfunction fireChangeEvent(target, result) {\n const { image } = constructedElements.get(target) || {};\n if (!image)\n return;\n const ratio = image.naturalWidth / image.width;\n for (const key in result) {\n const value = Math.round(result[key] * ratio);\n result[key] = value;\n const slottedInput = target.querySelector(`[data-image-crop-input='${key}']`);\n if (slottedInput instanceof HTMLInputElement)\n slottedInput.value = value.toString();\n }\n target.dispatchEvent(new CustomEvent('image-crop-change', { bubbles: true, detail: result }));\n}\nclass ImageCropElement extends HTMLElement {\n connectedCallback() {\n if (constructedElements.has(this))\n return;\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.innerHTML = `\n<style>\n :host { touch-action: none; display: block; }\n :host(.nesw) { cursor: nesw-resize; }\n :host(.nwse) { cursor: nwse-resize; }\n :host(.nesw) .crop-box, :host(.nwse) .crop-box { cursor: inherit; }\n :host([loaded]) .crop-image { display: block; }\n :host([loaded]) ::slotted([data-loading-slot]), .crop-image { display: none; }\n\n .crop-wrapper {\n position: relative;\n font-size: 0;\n }\n .crop-container {\n user-select: none;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n overflow: hidden;\n z-index: 1;\n top: 0;\n width: 100%;\n height: 100%;\n }\n\n :host([rounded]) .crop-box {\n border-radius: 50%;\n box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.3);\n }\n .crop-box {\n position: absolute;\n border: 1px dashed #fff;\n box-sizing: border-box;\n cursor: move;\n }\n\n :host([rounded]) .crop-outline {\n outline: none;\n }\n .crop-outline {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n outline: 4000px solid rgba(0, 0, 0, .3);\n }\n\n .handle { position: absolute; }\n :host([rounded]) .handle::before { border-radius: 50%; }\n .handle:before {\n position: absolute;\n display: block;\n padding: 4px;\n transform: translate(-50%, -50%);\n content: ' ';\n background: #fff;\n border: 1px solid #767676;\n }\n .ne { top: 0; right: 0; cursor: nesw-resize; }\n .nw { top: 0; left: 0; cursor: nwse-resize; }\n .se { bottom: 0; right: 0; cursor: nwse-resize; }\n .sw { bottom: 0; left: 0; cursor: nesw-resize; }\n</style>\n<slot></slot>\n<div class=\"crop-wrapper\">\n <img width=\"100%\" class=\"crop-image\" alt=\"\">\n <div class=\"crop-container\">\n <div data-crop-box class=\"crop-box\">\n <div class=\"crop-outline\"></div>\n <div data-direction=\"nw\" class=\"handle nw\"></div>\n <div data-direction=\"ne\" class=\"handle ne\"></div>\n <div data-direction=\"sw\" class=\"handle sw\"></div>\n <div data-direction=\"se\" class=\"handle se\"></div>\n </div>\n </div>\n</div>\n`;\n const box = shadowRoot.querySelector('[data-crop-box]');\n if (!(box instanceof HTMLElement))\n return;\n const image = shadowRoot.querySelector('img');\n if (!(image instanceof HTMLImageElement))\n return;\n constructedElements.set(this, { box, image });\n image.addEventListener('load', () => {\n this.loaded = true;\n setInitialPosition(this);\n });\n this.addEventListener('mouseleave', stopUpdate);\n this.addEventListener('touchend', stopUpdate);\n this.addEventListener('mouseup', stopUpdate);\n box.addEventListener('mousedown', startUpdate);\n box.addEventListener('touchstart', startUpdate, { passive: true });\n this.addEventListener('keydown', moveCropArea);\n this.addEventListener('keydown', updateCropArea);\n if (this.src)\n image.src = this.src;\n }\n static get observedAttributes() {\n return ['src'];\n }\n get src() {\n return this.getAttribute('src');\n }\n set src(val) {\n if (val) {\n this.setAttribute('src', val);\n }\n else {\n this.removeAttribute('src');\n }\n }\n get loaded() {\n return this.hasAttribute('loaded');\n }\n set loaded(val) {\n if (val) {\n this.setAttribute('loaded', '');\n }\n else {\n this.removeAttribute('loaded');\n }\n }\n attributeChangedCallback(attribute, oldValue, newValue) {\n const { image } = constructedElements.get(this) || {};\n if (attribute === 'src') {\n this.loaded = false;\n if (image)\n image.src = newValue;\n }\n }\n}\nexport default ImageCropElement;\nif (!window.customElements.get('image-crop')) {\n window.ImageCropElement = ImageCropElement;\n window.customElements.define('image-crop', ImageCropElement);\n}\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 <action-list>, 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<HTMLButtonElement>('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<HTMLButtonElement>('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<HTMLAnchorElement>(`.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<ToolTipElement>()\nconst openTooltips = new Set<ToolTipElement>()\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\n@controller\nclass XBannerElement extends HTMLElement {\n @target titleText: HTMLElement\n\n dismiss() {\n const parentElement = this.parentElement\n if (!parentElement) return\n\n if (this.#dismissScheme === 'remove') {\n parentElement.removeChild(this)\n } else {\n this.hide()\n }\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<SVGElement>('.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<SVGElement>('.octicon')\n\n if (!copyIcon || !checkIcon) return\n\n hideSVG(copyIcon)\n showSVG(checkIcon)\n}\n\nconst clipboardCopyElementTimers = new WeakMap<HTMLElement, number>()\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<HTMLElement>('[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 })(), \"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 __classPrivateFieldSet(this, _RelativeTimeElement_updating, false, \"f\");\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\nconst SCREENREADER_TEXT_CLASSNAME = 'spinner-screenreader-text'\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 }\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.leadingSpinner?.querySelector(SCREENREADER_TEXT_CLASSNAME)?.removeAttribute('hidden')\n this.leadingVisual?.setAttribute('hidden', '')\n }\n\n hideLeadingSpinner(): void {\n this.leadingSpinner?.setAttribute('hidden', '')\n this.leadingSpinner?.querySelector(SCREENREADER_TEXT_CLASSNAME)?.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<HTMLElement>('.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<HTMLElement>('.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 <dialog> 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 // <a> 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","import {getAnchoredPosition} from '@primer/behaviors'\nimport {controller, target} from '@github/catalyst'\nimport {announceFromElement, announce} from '../aria_live'\nimport {IncludeFragmentElement} from '@github/include-fragment-element'\nimport type {PrimerTextFieldElement} from 'lib/primer/forms/primer_text_field'\nimport type {AnchorAlignment, AnchorSide} from '@primer/behaviors'\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<SelectPanelElement>()\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 ariaLiveContainer: HTMLElement\n @target noResults: HTMLElement\n @target fragmentErrorElement: HTMLElement\n @target bannerErrorElement: HTMLElement\n @target bodySpinner: HTMLElement\n\n filterFn?: FilterFn\n\n #dialogIntersectionObserver: IntersectionObserver\n #abortController: AbortController\n #originalLabel = ''\n #inputName = ''\n #selectedItems: Map<string, SelectedItem> = 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.dialog.close()\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 // <li> 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 if (!this.isItemHidden(item) && !setZeroTabIndex) {\n setZeroTabIndex = true\n } else {\n itemContent.setAttribute('tabindex', '-1')\n }\n\n // <li> 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.#loadingDelayTimeoutId) clearTimeout(this.#loadingDelayTimeoutId)\n if (this.#loadingAnnouncementTimeoutId) clearTimeout(this.#loadingAnnouncementTimeoutId)\n\n this.#loadingAnnouncementTimeoutId = setTimeout(() => {\n announce('Loading', {element: this.ariaLiveContainer})\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\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 announceFromElement(errorElement, {element: this.ariaLiveContainer, assertive: true})\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 return !this.bannerErrorElement.hasAttribute('hidden')\n }\n\n #setErrorState(type: ErrorStateType) {\n let errorElement = this.fragmentErrorElement\n\n if (type === ErrorStateType.BODY) {\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 announceFromElement(errorElement, {element: this.ariaLiveContainer, assertive: true})\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.items\n\n if (items.length > 0) {\n const instructions = 'tab for results'\n announce(`${items.length} result${items.length === 1 ? '' : 's'} ${instructions}`, {\n element: this.ariaLiveContainer,\n })\n } else {\n const noResultsEl = this.noResults\n if (noResultsEl) {\n announceFromElement(noResultsEl, {element: this.ariaLiveContainer})\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 {\n return this.filterInputTextField.closest('primer-text-field') as PrimerTextFieldElement\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<HTMLElement>('.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<HTMLElement>('.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 <dialog> 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 // <a> 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 // 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"],"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","lastFocusedChild","ensureTrapZoneHasFocus","focusedElement","firstFocusableChild","prepend","wrappingController","followSignal","suspendedTrap","sentinels","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","from","setActiveDescendant","clearActiveDescendant","id","previouslyActiveElement","beginFocusManagement","elements","filteredElements","filter","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","Array","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","safeDocument","announceFromElement","announce","innerText","getTextContent","message","assertive","getQuerySelector","setContainerContent","startPositions","dragStartPositions","constructedElements","moveCropArea","ImageCropElement","box","image","deltaX","deltaY","MouseEvent","pageX","dragStartX","pageY","dragStartY","TouchEvent","changedTouches","offsetLeft","y","offsetTop","fireChangeEvent","updateCropArea","getShadowHost","delta","setInitialPosition","startX","startY","pageXOffset","pageYOffset","updateDimensions","rootNode","startUpdate","reposition","newSide","abs","round","stopUpdate","result","ratio","naturalWidth","slottedInput","HTMLImageElement","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","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","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","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","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","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","SCREENREADER_TEXT_CLASSNAME","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","_ActionMenuElement_isOpen","_ActionMenuElement_hide","_ActionMenuElement_show","_ActionMenuElement_handleDialogItemActivated","dialog_controller","handleDialogClose","lostFocus","focusInClosedMenu","focusInDialog","newActiveElement","checkedItem","itemLabel","prefixSpan","contentSpan","inputList","inputs","newInput","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","_SelectPanelElement_potentiallyDisallowActivation","_SelectPanelElement_isAnchorActivationViaSpace","_SelectPanelElement_getItemContent","_SelectPanelElement_handleItemActivated","_SelectPanelElement_handleIncludeFragmentEvent","visibleItems","focusableItem","condition","mutationObserver","setZeroTabIndex","_SelectPanelElement_firstItem_get","inputName","ariaLiveContainer","_SelectPanelElement_filterInputTextFieldElement_get","_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","clear","_SelectPanelElement_removeSelectedItem"],"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,KAC5B,MAAMC,+BAA+BC,YACxCC,cACIC,SAASC,WACT3B,EAAkC4B,IAAIC,MACtC5B,EAA6BkB,IAAIU,MAAM,GACvC3B,EAAiCiB,IAAIU,KAAM,IAAIC,sBAAqBC,IAChE,IAAK,MAAMC,KAASD,EAChB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,eAAeC,OAAO,eAAgB8zC"}
|
1
|
+
{"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/aria_live.ts","../../../node_modules/@github/image-crop-element/dist/index.js","../../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","../../components/primer/alpha/select_panel_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\n// eslint-disable-next-line no-unused-vars\nenum ItemType {\n // eslint-disable-next-line no-unused-vars\n Item,\n // eslint-disable-next-line no-unused-vars\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<HTMLElement> {\n return this.moreMenu.querySelectorAll('[role=\"menu\"] > li')\n }\n\n // eslint-disable-next-line no-unused-vars\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<AnchoredPositionElement>()\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<typeof requestAnimationFrame>\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 <dialog> 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<HTMLElement>('.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 this.ownerDocument.body.classList.toggle('has-modal', this.dialog.matches(':modal'))\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<HTMLElement>('[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","const safeDocument = typeof document === 'undefined' ? undefined : document\n\n// Announce an element's text to the screen reader.\nexport function announceFromElement(el: HTMLElement, options?: {assertive?: boolean; element?: HTMLElement}) {\n announce(getTextContent(el), options)\n}\n\n// Announce message update to screen reader.\n// Note: Use caution when using this function while a dialog is active.\n// If the message is updated while the dialog is open, the screen reader may not announce the live region.\nexport function announce(message: string, options?: {assertive?: boolean; element?: HTMLElement}) {\n const {assertive, element} = options ?? {}\n\n setContainerContent(message, assertive, element)\n}\n\n// Set aria-live container to message.\nfunction setContainerContent(message: string, assertive?: boolean, element?: HTMLElement) {\n const getQuerySelector = () => {\n return assertive ? '#js-global-screen-reader-notice-assertive' : '#js-global-screen-reader-notice'\n }\n const container = element ?? safeDocument?.querySelector(getQuerySelector())\n if (!container) return\n if (container.textContent === message) {\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 container.textContent = `${message}\\u00A0`\n } else {\n container.textContent = message\n }\n}\n\n// Gets the trimmed text content of an element.\nfunction getTextContent(el: HTMLElement): string {\n // innerText does not contain hidden text\n /* eslint-disable-next-line github/no-innerText */\n return (el.getAttribute('aria-label') || el.innerText || '').trim()\n}\n","const startPositions = new WeakMap();\nconst dragStartPositions = new WeakMap();\nconst constructedElements = new WeakMap();\nfunction moveCropArea(event) {\n const el = event.currentTarget;\n if (!(el instanceof ImageCropElement))\n return;\n const { box, image } = constructedElements.get(el) || {};\n if (!box || !image)\n return;\n let deltaX = 0;\n let deltaY = 0;\n if (event instanceof KeyboardEvent) {\n if (event.key === 'ArrowUp') {\n deltaY = -1;\n }\n else if (event.key === 'ArrowDown') {\n deltaY = 1;\n }\n else if (event.key === 'ArrowLeft') {\n deltaX = -1;\n }\n else if (event.key === 'ArrowRight') {\n deltaX = 1;\n }\n }\n else if (dragStartPositions.has(el) && event instanceof MouseEvent) {\n const pos = dragStartPositions.get(el);\n deltaX = event.pageX - pos.dragStartX;\n deltaY = event.pageY - pos.dragStartY;\n }\n else if (dragStartPositions.has(el) && event instanceof TouchEvent) {\n const { pageX, pageY } = event.changedTouches[0];\n const { dragStartX, dragStartY } = dragStartPositions.get(el);\n deltaX = pageX - dragStartX;\n deltaY = pageY - dragStartY;\n }\n if (deltaX !== 0 || deltaY !== 0) {\n const x = Math.min(Math.max(0, box.offsetLeft + deltaX), image.width - box.offsetWidth);\n const y = Math.min(Math.max(0, box.offsetTop + deltaY), image.height - box.offsetHeight);\n box.style.left = `${x}px`;\n box.style.top = `${y}px`;\n fireChangeEvent(el, { x, y, width: box.offsetWidth, height: box.offsetHeight });\n }\n if (event instanceof MouseEvent) {\n dragStartPositions.set(el, {\n dragStartX: event.pageX,\n dragStartY: event.pageY\n });\n }\n else if (event instanceof TouchEvent) {\n const { pageX, pageY } = event.changedTouches[0];\n dragStartPositions.set(el, {\n dragStartX: pageX,\n dragStartY: pageY\n });\n }\n}\nfunction updateCropArea(event) {\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n const el = getShadowHost(target);\n if (!(el instanceof ImageCropElement))\n return;\n const { box } = constructedElements.get(el) || {};\n if (!box)\n return;\n const rect = el.getBoundingClientRect();\n let deltaX, deltaY, delta;\n if (event instanceof KeyboardEvent) {\n if (event.key === 'Escape')\n return setInitialPosition(el);\n if (event.key === '-')\n delta = -10;\n if (event.key === '=')\n delta = +10;\n if (!delta)\n return;\n deltaX = box.offsetWidth + delta;\n deltaY = box.offsetHeight + delta;\n startPositions.set(el, { startX: box.offsetLeft, startY: box.offsetTop });\n }\n else if (event instanceof MouseEvent) {\n const pos = startPositions.get(el);\n if (!pos)\n return;\n deltaX = event.pageX - pos.startX - rect.left - window.pageXOffset;\n deltaY = event.pageY - pos.startY - rect.top - window.pageYOffset;\n }\n else if (event instanceof TouchEvent) {\n const pos = startPositions.get(el);\n if (!pos)\n return;\n deltaX = event.changedTouches[0].pageX - pos.startX - rect.left - window.pageXOffset;\n deltaY = event.changedTouches[0].pageY - pos.startY - rect.top - window.pageYOffset;\n }\n if (deltaX && deltaY)\n updateDimensions(el, deltaX, deltaY, !(event instanceof KeyboardEvent));\n}\nfunction getShadowHost(el) {\n const rootNode = el.getRootNode();\n if (!(rootNode instanceof ShadowRoot))\n return el;\n return rootNode.host;\n}\nfunction startUpdate(event) {\n const currentTarget = event.currentTarget;\n if (!(currentTarget instanceof HTMLElement))\n return;\n const el = getShadowHost(currentTarget);\n if (!(el instanceof ImageCropElement))\n return;\n const { box } = constructedElements.get(el) || {};\n if (!box)\n return;\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n if (target.hasAttribute('data-direction')) {\n const direction = target.getAttribute('data-direction') || '';\n el.addEventListener('mousemove', updateCropArea);\n el.addEventListener('touchmove', updateCropArea, { passive: true });\n if (['nw', 'se'].indexOf(direction) >= 0)\n el.classList.add('nwse');\n if (['ne', 'sw'].indexOf(direction) >= 0)\n el.classList.add('nesw');\n startPositions.set(el, {\n startX: box.offsetLeft + (['se', 'ne'].indexOf(direction) >= 0 ? 0 : box.offsetWidth),\n startY: box.offsetTop + (['se', 'sw'].indexOf(direction) >= 0 ? 0 : box.offsetHeight)\n });\n updateCropArea(event);\n }\n else {\n el.addEventListener('mousemove', moveCropArea);\n el.addEventListener('touchmove', moveCropArea, { passive: true });\n }\n}\nfunction updateDimensions(target, deltaX, deltaY, reposition = true) {\n let newSide = Math.max(Math.abs(deltaX), Math.abs(deltaY), 10);\n const pos = startPositions.get(target);\n if (!pos)\n return;\n const { box, image } = constructedElements.get(target) || {};\n if (!box || !image)\n return;\n newSide = Math.min(newSide, deltaY > 0 ? image.height - pos.startY : pos.startY, deltaX > 0 ? image.width - pos.startX : pos.startX);\n const x = reposition ? Math.round(Math.max(0, deltaX > 0 ? pos.startX : pos.startX - newSide)) : box.offsetLeft;\n const y = reposition ? Math.round(Math.max(0, deltaY > 0 ? pos.startY : pos.startY - newSide)) : box.offsetTop;\n box.style.left = `${x}px`;\n box.style.top = `${y}px`;\n box.style.width = `${newSide}px`;\n box.style.height = `${newSide}px`;\n fireChangeEvent(target, { x, y, width: newSide, height: newSide });\n}\nfunction setInitialPosition(el) {\n const { image } = constructedElements.get(el) || {};\n if (!image)\n return;\n const side = Math.round(image.clientWidth > image.clientHeight ? image.clientHeight : image.clientWidth);\n startPositions.set(el, {\n startX: (image.clientWidth - side) / 2,\n startY: (image.clientHeight - side) / 2\n });\n updateDimensions(el, side, side);\n}\nfunction stopUpdate(event) {\n const el = event.currentTarget;\n if (!(el instanceof ImageCropElement))\n return;\n dragStartPositions.delete(el);\n el.classList.remove('nwse', 'nesw');\n el.removeEventListener('mousemove', updateCropArea);\n el.removeEventListener('mousemove', moveCropArea);\n el.removeEventListener('touchmove', updateCropArea);\n el.removeEventListener('touchmove', moveCropArea);\n}\nfunction fireChangeEvent(target, result) {\n const { image } = constructedElements.get(target) || {};\n if (!image)\n return;\n const ratio = image.naturalWidth / image.width;\n for (const key in result) {\n const value = Math.round(result[key] * ratio);\n result[key] = value;\n const slottedInput = target.querySelector(`[data-image-crop-input='${key}']`);\n if (slottedInput instanceof HTMLInputElement)\n slottedInput.value = value.toString();\n }\n target.dispatchEvent(new CustomEvent('image-crop-change', { bubbles: true, detail: result }));\n}\nclass ImageCropElement extends HTMLElement {\n connectedCallback() {\n if (constructedElements.has(this))\n return;\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.innerHTML = `\n<style>\n :host { touch-action: none; display: block; }\n :host(.nesw) { cursor: nesw-resize; }\n :host(.nwse) { cursor: nwse-resize; }\n :host(.nesw) .crop-box, :host(.nwse) .crop-box { cursor: inherit; }\n :host([loaded]) .crop-image { display: block; }\n :host([loaded]) ::slotted([data-loading-slot]), .crop-image { display: none; }\n\n .crop-wrapper {\n position: relative;\n font-size: 0;\n }\n .crop-container {\n user-select: none;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n overflow: hidden;\n z-index: 1;\n top: 0;\n width: 100%;\n height: 100%;\n }\n\n :host([rounded]) .crop-box {\n border-radius: 50%;\n box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.3);\n }\n .crop-box {\n position: absolute;\n border: 1px dashed #fff;\n box-sizing: border-box;\n cursor: move;\n }\n\n :host([rounded]) .crop-outline {\n outline: none;\n }\n .crop-outline {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n outline: 4000px solid rgba(0, 0, 0, .3);\n }\n\n .handle { position: absolute; }\n :host([rounded]) .handle::before { border-radius: 50%; }\n .handle:before {\n position: absolute;\n display: block;\n padding: 4px;\n transform: translate(-50%, -50%);\n content: ' ';\n background: #fff;\n border: 1px solid #767676;\n }\n .ne { top: 0; right: 0; cursor: nesw-resize; }\n .nw { top: 0; left: 0; cursor: nwse-resize; }\n .se { bottom: 0; right: 0; cursor: nwse-resize; }\n .sw { bottom: 0; left: 0; cursor: nesw-resize; }\n</style>\n<slot></slot>\n<div class=\"crop-wrapper\">\n <img width=\"100%\" class=\"crop-image\" alt=\"\">\n <div class=\"crop-container\">\n <div data-crop-box class=\"crop-box\">\n <div class=\"crop-outline\"></div>\n <div data-direction=\"nw\" class=\"handle nw\"></div>\n <div data-direction=\"ne\" class=\"handle ne\"></div>\n <div data-direction=\"sw\" class=\"handle sw\"></div>\n <div data-direction=\"se\" class=\"handle se\"></div>\n </div>\n </div>\n</div>\n`;\n const box = shadowRoot.querySelector('[data-crop-box]');\n if (!(box instanceof HTMLElement))\n return;\n const image = shadowRoot.querySelector('img');\n if (!(image instanceof HTMLImageElement))\n return;\n constructedElements.set(this, { box, image });\n image.addEventListener('load', () => {\n this.loaded = true;\n setInitialPosition(this);\n });\n this.addEventListener('mouseleave', stopUpdate);\n this.addEventListener('touchend', stopUpdate);\n this.addEventListener('mouseup', stopUpdate);\n box.addEventListener('mousedown', startUpdate);\n box.addEventListener('touchstart', startUpdate, { passive: true });\n this.addEventListener('keydown', moveCropArea);\n this.addEventListener('keydown', updateCropArea);\n if (this.src)\n image.src = this.src;\n }\n static get observedAttributes() {\n return ['src'];\n }\n get src() {\n return this.getAttribute('src');\n }\n set src(val) {\n if (val) {\n this.setAttribute('src', val);\n }\n else {\n this.removeAttribute('src');\n }\n }\n get loaded() {\n return this.hasAttribute('loaded');\n }\n set loaded(val) {\n if (val) {\n this.setAttribute('loaded', '');\n }\n else {\n this.removeAttribute('loaded');\n }\n }\n attributeChangedCallback(attribute, oldValue, newValue) {\n const { image } = constructedElements.get(this) || {};\n if (attribute === 'src') {\n this.loaded = false;\n if (image)\n image.src = newValue;\n }\n }\n}\nexport default ImageCropElement;\nif (!window.customElements.get('image-crop')) {\n window.ImageCropElement = ImageCropElement;\n window.customElements.define('image-crop', ImageCropElement);\n}\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 <action-list>, 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<HTMLButtonElement>('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<HTMLButtonElement>('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<HTMLAnchorElement>(`.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<ToolTipElement>()\nconst openTooltips = new Set<ToolTipElement>()\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<void>\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<SVGElement>('.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<SVGElement>('.octicon')\n\n if (!copyIcon || !checkIcon) return\n\n hideSVG(copyIcon)\n showSVG(checkIcon)\n}\n\nconst clipboardCopyElementTimers = new WeakMap<HTMLElement, number>()\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<HTMLElement>('[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<HTMLElement>('.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<HTMLElement>('.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 <dialog> 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 // <a> 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","import {getAnchoredPosition} from '@primer/behaviors'\nimport {controller, target} from '@github/catalyst'\nimport {announceFromElement, announce} from '../aria_live'\nimport {IncludeFragmentElement} from '@github/include-fragment-element'\nimport type {PrimerTextFieldElement} from 'lib/primer/forms/primer_text_field'\nimport type {AnchorAlignment, AnchorSide} from '@primer/behaviors'\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<SelectPanelElement>()\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 ariaLiveContainer: HTMLElement\n @target noResults: HTMLElement\n @target fragmentErrorElement: HTMLElement\n @target bannerErrorElement: HTMLElement\n @target bodySpinner: HTMLElement\n\n filterFn?: FilterFn\n\n #dialogIntersectionObserver: IntersectionObserver\n #abortController: AbortController\n #originalLabel = ''\n #inputName = ''\n #selectedItems: Map<string, SelectedItem> = 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.dialog.close()\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 // <li> 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 // <li> 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 announce('Loading', {element: this.ariaLiveContainer})\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\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 announceFromElement(errorElement, {element: this.ariaLiveContainer, assertive: true})\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) {\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 announceFromElement(errorElement, {element: this.ariaLiveContainer, assertive: true})\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.items\n\n if (items.length > 0) {\n const instructions = 'tab for results'\n announce(`${items.length} result${items.length === 1 ? '' : 's'} ${instructions}`, {\n element: this.ariaLiveContainer,\n })\n } else {\n const noResultsEl = this.noResults\n if (noResultsEl) {\n announceFromElement(noResultsEl, {element: this.ariaLiveContainer})\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<HTMLElement>('.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<HTMLElement>('.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 <dialog> 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 // <a> 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"],"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","safeDocument","announceFromElement","announce","innerText","getTextContent","message","assertive","getQuerySelector","setContainerContent","startPositions","dragStartPositions","constructedElements","moveCropArea","ImageCropElement","box","image","deltaX","deltaY","MouseEvent","pageX","dragStartX","pageY","dragStartY","TouchEvent","changedTouches","offsetLeft","y","offsetTop","fireChangeEvent","updateCropArea","getShadowHost","delta","setInitialPosition","startX","startY","pageXOffset","pageYOffset","updateDimensions","rootNode","startUpdate","reposition","newSide","abs","round","stopUpdate","result","ratio","naturalWidth","slottedInput","HTMLImageElement","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","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","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","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","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","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","_ActionMenuElement_isOpen","_ActionMenuElement_hide","_ActionMenuElement_show","_ActionMenuElement_handleDialogItemActivated","dialog_controller","handleDialogClose","lostFocus","focusInClosedMenu","focusInDialog","newActiveElement","checkedItem","itemLabel","prefixSpan","contentSpan","inputList","inputs","newInput","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","_SelectPanelElement_potentiallyDisallowActivation","_SelectPanelElement_isAnchorActivationViaSpace","_SelectPanelElement_getItemContent","_SelectPanelElement_handleItemActivated","_SelectPanelElement_handleIncludeFragmentEvent","visibleItems","focusableItem","condition","mutationObserver","setZeroTabIndex","_SelectPanelElement_firstItem_get","inputName","_SelectPanelElement_filterInputTextFieldElement_get","ariaLiveContainer","_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","clear","_SelectPanelElement_removeSelectedItem"],"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,E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