@mixtint/primer-view-components 0.84.3 → 0.86.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/javascripts/components/primer/open_project/sub_header_element.d.ts +1 -1
- package/app/assets/javascripts/primer_view_components.js +1 -1
- package/app/assets/javascripts/primer_view_components.js.map +1 -1
- package/app/assets/styles/primer_view_components.css +101 -13
- package/app/assets/styles/primer_view_components.css.map +1 -1
- package/app/components/primer/alpha/action_menu/action_menu_element.js +4 -0
- package/app/components/primer/alpha/select_panel_element.js +2 -2
- package/app/components/primer/alpha/tree_view.css +22 -6
- package/app/components/primer/alpha/tree_view.css.json +4 -1
- package/app/components/primer/open_project/filterable_tree_view.css +64 -0
- package/app/components/primer/open_project/filterable_tree_view.css.json +14 -0
- package/app/components/primer/open_project/filterable_tree_view.js +294 -5
- package/app/components/primer/open_project/sub_header.css +14 -7
- package/app/components/primer/open_project/sub_header.css.json +2 -1
- package/app/components/primer/open_project/sub_header_element.d.ts +1 -1
- package/app/components/primer/open_project/sub_header_element.js +6 -6
- package/package.json +13 -13
- package/static/arguments.json +28 -0
- package/static/audited_at.json +1 -0
- package/static/classes.json +9 -0
- package/static/constants.json +10 -1
- package/static/info_arch.json +189 -30
- package/static/previews.json +94 -29
- package/static/statuses.json +1 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";var t,e,i,n,s,o,r,a,l=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},c=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i};const d=new WeakMap;let h=null;class IncludeFragmentElement extends HTMLElement{constructor(){super(...arguments),t.add(this),e.set(this,!1),i.set(this,new IntersectionObserver(e=>{for(const s of e)if(s.isIntersecting){const{target:e}=s;if(l(this,i,"f").unobserve(e),!(e instanceof IncludeFragmentElement))return;"lazy"===e.loading&&l(this,t,"m",n).call(this)}},{rootMargin:"0px 0px 256px 0px",threshold:.01}))}static define(t="include-fragment",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){h=null===t?t:Promise.resolve(t)}static get observedAttributes(){return["src","loading"]}get src(){const t=this.getAttribute("src");if(t){const e=this.ownerDocument.createElement("a");return e.href=t,e.href}return""}set src(t){this.setAttribute("src",t)}get loading(){return"lazy"===this.getAttribute("loading")?"lazy":"eager"}set loading(t){this.setAttribute("loading",t)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",t)}get data(){return l(this,t,"m",o).call(this)}attributeChangedCallback(e,i){"src"===e?this.isConnected&&"eager"===this.loading&&l(this,t,"m",n).call(this):"loading"===e&&this.isConnected&&"eager"!==i&&"eager"===this.loading&&l(this,t,"m",n).call(this)}connectedCallback(){if(!this.shadowRoot){this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=":host {display: block;}",this.shadowRoot.append(t,document.createElement("slot"))}this.src&&"eager"===this.loading&&l(this,t,"m",n).call(this),"lazy"===this.loading&&l(this,i,"f").observe(this)}request(){const t=this.src;if(!t)throw new Error("missing src");return new Request(t,{method:"GET",credentials:"same-origin",headers:{Accept:this.accept||"text/html"}})}load(){return l(this,t,"m",o).call(this)}fetch(t){return fetch(t)}refetch(){d.delete(this),l(this,t,"m",n).call(this)}}e=new WeakMap,i=new WeakMap,t=new WeakSet,n=async function(){if(!l(this,e,"f")){c(this,e,!0,"f"),l(this,i,"f").unobserve(this);try{const i=await l(this,t,"m",s).call(this);if(i instanceof Error)throw i;const n=i,o=document.createElement("template");o.innerHTML=n;const r=document.importNode(o.content,!0);if(!this.dispatchEvent(new CustomEvent("include-fragment-replace",{cancelable:!0,detail:{fragment:r}})))return void c(this,e,!1,"f");this.replaceWith(r),this.dispatchEvent(new CustomEvent("include-fragment-replaced"))}catch(t){this.classList.add("is-error")}finally{c(this,e,!1,"f")}}},s=async function(){const e=this.src,i=d.get(this);if(i&&i.src===e)return i.data;{let i;return i=e?l(this,t,"m",a).call(this):Promise.reject(new Error("missing src")),d.set(this,{src:e,data:i}),i}},o=async function(){const e=await l(this,t,"m",s).call(this);if(e instanceof Error)throw e;return e.toString()},r=async function(t,e){await new Promise(t=>setTimeout(t,0));for(const i of t)this.dispatchEvent(e?new CustomEvent(i,{detail:{error:e}}):new Event(i))},a=async function(){try{await l(this,t,"m",r).call(this,["loadstart"]);const i=await this.fetch(this.request()),n=i.headers.get("Content-Type");if(!(e=this.accept,e&&e.split(",").find(t=>t.match(/^\s*\*\/\*/))||n&&n.includes(this.accept?this.accept:"text/html")))throw new Error(`Failed to load resource: expected ${this.accept||"text/html"} but was ${n}`);if(200!==i.status)throw new Error(`Failed to load resource: the server responded with a status of ${i.status}`);const s=await i.text();let o=s;if(h){o=(await h).createHTML(s,i)}return l(this,t,"m",r).call(this,["load","loadend"]),o}catch(e){throw l(this,t,"m",r).call(this,["error","loadend"],e),e}var e};const u="undefined"!=typeof globalThis?globalThis:window;try{u.IncludeFragmentElement=IncludeFragmentElement.define()}catch(t){if(!(u.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}const m=new WeakMap;class RemoteInputElement extends HTMLElement{constructor(){super();const t=f.bind(null,this,!0),e={currentQuery:null,oninput:p(e=>t(e)),fetch:t,controller:null};m.set(this,e)}static get observedAttributes(){return["src"]}attributeChangedCallback(t,e){e&&"src"===t&&f(this,!1)}connectedCallback(){const t=this.input;if(!t)return;t.setAttribute("autocomplete","off"),t.setAttribute("spellcheck","false");const e=m.get(this);e&&(t.addEventListener("focus",e.fetch),t.addEventListener("change",e.fetch),t.addEventListener("input",e.oninput))}disconnectedCallback(){const t=this.input;if(!t)return;const e=m.get(this);e&&(t.removeEventListener("focus",e.fetch),t.removeEventListener("change",e.fetch),t.removeEventListener("input",e.oninput))}get input(){const t=this.querySelector("input, textarea");return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t:null}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}}async function f(t,e,i){const n=t.input;if(!n)return;const s=m.get(t);if(!s)return;const o=n.value;if(e&&s.currentQuery===o)return;s.currentQuery=o;const r=t.src;if(!r)return;const a=document.getElementById(t.getAttribute("aria-owns")||"");if(!a)return;const l=new URL(r,window.location.href),c=new URLSearchParams(l.search);let d;c.append(t.getAttribute("param")||"q",o),l.search=c.toString(),s.controller?s.controller.abort():(t.dispatchEvent(new CustomEvent("loadstart")),t.setAttribute("loading","")),s.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};let h="";try{d=await async function(t,e,i){try{const n=await fetch(e,i);return t.dispatchEvent(new CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),n}catch(e){throw e instanceof Error&&"AbortError"!==(null==e?void 0:e.name)&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),e}}(t,l.toString(),{signal:s.controller.signal,credentials:"same-origin",headers:{accept:"text/fragment+html"}}),h=await d.text(),t.removeAttribute("loading"),s.controller=null}catch(e){return void(e instanceof Error&&"AbortError"!==e.name&&(t.removeAttribute("loading"),s.controller=null))}d&&d.ok?(a.innerHTML=h,t.dispatchEvent(new CustomEvent("remote-input-success",{bubbles:!0,detail:{eventType:i?i.type:void 0}}))):t.dispatchEvent(new CustomEvent("remote-input-error",{bubbles:!0}))}function p(t){let e;return function(i){clearTimeout(e),e=setTimeout(()=>{clearTimeout(e),t(i)},300)}}function g(t,e,i,n){var s,o=arguments.length,r=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,i,r):s(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r}function b(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)}function v(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i}window.customElements.get("remote-input")||(window.RemoteInputElement=RemoteInputElement,window.customElements.define("remote-input",RemoteInputElement)),"function"==typeof SuppressedError&&SuppressedError;const w=new WeakSet;function y(t){k(t),A(t)}const E=new WeakMap;function A(t=document){if(E.has(t))return E.get(t);let e=!1;const i=new MutationObserver(t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)S(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&k(t)});i.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const n={get closed(){return e},unsubscribe(){e=!0,E.delete(t),i.disconnect()}};return E.set(t,n),n}function k(t){for(const e of t.querySelectorAll("[data-action]"))S(e);t instanceof Element&&t.hasAttribute("data-action")&&S(t)}function L(t){const e=t.currentTarget;for(const i of T(e))if(t.type===i.type){const n=e.closest(i.tag);w.has(n)&&"function"==typeof n[i.method]&&n[i.method](t);const s=e.getRootNode();if(s instanceof ShadowRoot&&w.has(s.host)&&s.host.matches(i.tag)){const e=s.host;"function"==typeof e[i.method]&&e[i.method](t)}}}function*T(t){for(const e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){const t=e.lastIndexOf(":"),i=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,t),tag:e.slice(t+1,i),method:e.slice(i+1)||"handleEvent"}||"handleEvent"}}function S(t){for(const e of T(t))t.addEventListener(e.type,L)}const C=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),x=(t,e="property")=>{const i=C(t);if(!i.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return i};const M="attr";function I(t,e){U(t,M).add(e)}const D=new WeakSet;function P(t,e){if(D.has(t))return;D.add(t);const i=Object.getPrototypeOf(t),n=i?.constructor?.attrPrefix??"data-";e||(e=U(i,M));for(const i of e){const e=t[i],s=x(`${n}${i}`);let o={configurable:!0,get(){return this.getAttribute(s)||""},set(t){this.setAttribute(s,t||"")}};"number"==typeof e?o={configurable:!0,get(){return Number(this.getAttribute(s)||0)},set(t){this.setAttribute(s,t)}}:"boolean"==typeof e&&(o={configurable:!0,get(){return this.hasAttribute(s)},set(t){this.toggleAttribute(s,t)}}),Object.defineProperty(t,i,o),i in t&&!t.hasAttribute(s)&&o.set.call(t,e)}}const N=new Map,O=new Promise(t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",()=>t(),{once:!0})}),F=new Promise(t=>{const e=new AbortController;e.signal.addEventListener("abort",()=>t());const i={once:!0,passive:!0,signal:e.signal},n=()=>e.abort();document.addEventListener("mousedown",n,i),document.addEventListener("touchstart",n,i),document.addEventListener("keydown",n,i),document.addEventListener("pointerdown",n,i)}),H={ready:()=>O,firstInteraction:()=>F,visible:t=>new Promise(e=>{const i=new IntersectionObserver(t=>{for(const n of t)if(n.isIntersecting)return e(),void i.disconnect()},{rootMargin:"0px 0px 256px 0px",threshold:.01});for(const e of document.querySelectorAll(t))i.observe(e)})},V=new Set;let q,R=null;function W(t){V.add(t),null==R&&(R=requestAnimationFrame(()=>{R=null;const t=new Set(V);if(V.clear(),N.size)t:for(const e of t)for(const t of N.keys()){const i=e instanceof Element&&e.matches(t)?e:e.querySelector(t);if(customElements.get(t)||i){const e=i?.getAttribute("data-load-on")||"ready",n=e in H?H[e]:H.ready;for(const e of N.get(t)||[])n(t).then(e);if(N.delete(t),!N.size)break t}}}))}const B=Symbol.for("catalyst");class ${constructor(t,e){const i=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){i.connectedCallback(this,n)};const s=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){i.disconnectedCallback(this,s)};const o=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,e,n){i.attributeChangedCallback(this,t,e,n,o)};let r=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return i.observedAttributes(this,r)},set(t){r=t}}),function(t){let e=t.observedAttributes||[];const i=t.attrPrefix??"data-",n=t=>x(`${i}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...U(t.prototype,M)].map(n).concat(e),set(t){e=t}})}(t),function(t,e){const i=e||C(t.name).replace(/-element$/,"");try{window.customElements.define(i,t),window[t.name]=customElements.get(i)}catch(t){if(!(t instanceof DOMException&&"NotSupportedError"===t.name))throw t}}(t,e)}observedAttributes(t,e){return e}connectedCallback(t,e){t.toggleAttribute("data-catalyst",!0),customElements.upgrade(t),function(t){for(const e of t.querySelectorAll("template[data-shadowroot]"))e.parentElement===t&&t.attachShadow({mode:"closed"===e.getAttribute("data-shadowroot")?"closed":"open"}).append(e.content.cloneNode(!0))}(t),P(t),function(t){w.add(t),t.shadowRoot&&y(t.shadowRoot),k(t),A(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&(y(t.shadowRoot),function(t){q||(q=new MutationObserver(t=>{if(N.size)for(const e of t)for(const t of e.addedNodes)t instanceof Element&&W(t)})),W(t),q.observe(t,{subtree:!0,childList:!0})}(t.shadowRoot))}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,i,n,s){P(t),"data-catalyst"!==e&&s&&s.call(t,e,i,n)}}function U(t,e){if(!Object.prototype.hasOwnProperty.call(t,B)){const e=t[B],i=t[B]=new Map;if(e)for(const[t,n]of e)i.set(t,new Set(n))}const i=t[B];return i.has(e)||i.set(e,new Set),i.get(e)}function _(t,e){U(t,"target").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const i=t.tagName.toLowerCase();if(t.shadowRoot)for(const n of t.shadowRoot.querySelectorAll(`[data-target~="${i}.${e}"]`))if(!n.closest(i))return n;for(const n of t.querySelectorAll(`[data-target~="${i}.${e}"]`))if(n.closest(i)===t)return n}(this,e)}})}function j(t,e){U(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const i=t.tagName.toLowerCase(),n=[];if(t.shadowRoot)for(const s of t.shadowRoot.querySelectorAll(`[data-targets~="${i}.${e}"]`))s.closest(i)||n.push(s);for(const s of t.querySelectorAll(`[data-targets~="${i}.${e}"]`))s.closest(i)===t&&n.push(s);return n}(this,e)}})}function K(t){if("string"==typeof t)return e=>{new $(e,t)};new $(t)}var z;class Z{constructor(t){this.resizeObserver=new ResizeObserver(t=>{for(const e of t){const t=e.target;t instanceof HTMLElement&&this.update(t)}}),this.resizeObserver.observe(t)}unobserve(t){this.resizeObserver.unobserve(t)}update(t){const e=t.querySelectorAll("li");for(const t of e){const e=t.querySelector(".ActionListItem-label");if(!e)continue;const i=t.querySelector(".ActionListItem-truncationTooltip");if(!i)continue;const n=e.scrollWidth>e.clientWidth;i.style.display=n?"":"none"}}}let Y=class ActionListElement extends HTMLElement{constructor(){super(...arguments),z.set(this,void 0)}connectedCallback(){v(this,z,new Z(this),"f")}disconnectedCallback(){b(this,z,"f").unobserve(this)}};z=new WeakMap,Y=g([K("action-list")],Y);const G={"outside-top":["outside-bottom","outside-right","outside-left","outside-bottom"],"outside-bottom":["outside-top","outside-right","outside-left","outside-bottom"],"outside-left":["outside-right","outside-bottom","outside-top","outside-bottom"],"outside-right":["outside-left","outside-bottom","outside-top","outside-bottom"]},X={start:["end","center"],end:["start","center"],center:["end","start"]};function J(t,e,i={}){const{positionedParent:n,clippingNode:s,positionedParentStyle:o,clippingNodeStyle:r}=function(t){if(function(t){var e;if("DIALOG"===t.tagName)return!0;try{if(t.matches(":popover-open")&&/native code/.test(null===(e=document.body.showPopover)||void 0===e?void 0:e.toString()))return!0}catch(t){return!1}return!1}(t))return{positionedParent:document.body,clippingNode:document.body,positionedParentStyle:null,clippingNodeStyle:null};let e=null,i=null,n=null,s=null,o=t.parentNode;for(;null!==o&&o!==document.body;){if(o instanceof HTMLElement){const t=getComputedStyle(o);if(e||"static"===t.position||(e=o,n=t),i||"visible"===t.overflow||(i=o,s=t),e&&i)break}o=o.parentNode}return{positionedParent:null!=e?e:document.body,clippingNode:null!=i?i:document.body,positionedParentStyle:n,clippingNodeStyle:s}}(t),a=function(t,e=null){const i=t.getBoundingClientRect(),n=e||getComputedStyle(t),s=parseInt(n.borderTopWidth,10)||0,o=parseInt(n.borderLeftWidth,10)||0,r=parseInt(n.borderRightWidth,10)||0,a=parseInt(n.borderBottomWidth,10)||0;return{top:i.top+s,left:i.left+o,width:i.width-r-o,height:Math.max(i.height-s-a,t===document.body?window.innerHeight:-1/0)}}(s,r),l=o||getComputedStyle(n),c=n.getBoundingClientRect(),[d,h]=[l.borderTopWidth,l.borderLeftWidth].map(t=>parseInt(t,10)||0);return function(t,e,i,n,{side:s,align:o,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:l,displayInViewport:c},d){let h=t;c&&(h={top:0,left:0,width:d.width,height:d.height});const u={top:h.top-e.top,left:h.left-e.left,width:h.width,height:h.height};let m=tt(i,n,s,o,a,l),f=s,p=o;if(m.top-=e.top,m.left-=e.left,!r){const t=G[s];let r=0;if(t){let c=s;for(;r<t.length&&et(c,m,u,i);){const s=t[r++];c=s,m=tt(i,n,s,o,a,l),m.top-=e.top,m.left-=e.left,f=s}}const d=X[o];let g=0;if(d){let t=o;for(;g<d.length&&it(t,m,u,i);){const s=d[g++];t=s,m=tt(i,n,f,s,a,l),m.top-=e.top,m.left-=e.left,p=s}}m.top<u.top&&(m.top=u.top),m.left<u.left&&(m.left=u.left),m.left+i.width>h.width+u.left&&(m.left=h.width+u.left-i.width),(c||t&&r<t.length)&&m.top+i.height>h.height+u.top&&(m.top=Math.max(h.height+u.top-i.height,0))}return Object.assign(Object.assign({},m),{anchorSide:f,anchorAlign:p})}(a,{top:c.top+d,left:c.left+h},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,i,n,s,o,r;const a=null!==(e=t.side)&&void 0!==e?e:Q.side,l=null!==(i=t.align)&&void 0!==i?i:Q.align;return{side:a,align:l,anchorOffset:null!==(n=t.anchorOffset)&&void 0!==n?n:"inside-center"===a?0:Q.anchorOffset,alignmentOffset:null!==(s=t.alignmentOffset)&&void 0!==s?s:"center"!==l&&a.startsWith("inside")?Q.alignmentOffset:0,allowOutOfBounds:null!==(o=t.allowOutOfBounds)&&void 0!==o?o:Q.allowOutOfBounds,displayInViewport:null!==(r=t.displayInViewport)&&void 0!==r?r:Q.displayInViewport}}(i),{width:window.innerWidth,height:window.innerHeight})}const Q={side:"outside-bottom",align:"start",anchorOffset:4,alignmentOffset:4,allowOutOfBounds:!1,displayInViewport:!1};function tt(t,e,i,n,s,o){const r=e.left+e.width,a=e.top+e.height;let l=-1,c=-1;return"outside-top"===i?l=e.top-s-t.height:"outside-bottom"===i?l=a+s:"outside-left"===i?c=e.left-s-t.width:"outside-right"===i&&(c=r+s),"outside-top"!==i&&"outside-bottom"!==i||(c="start"===n?e.left+o:"center"===n?e.left-(t.width-e.width)/2+o:r-t.width-o),"outside-left"!==i&&"outside-right"!==i||(l="start"===n?e.top+o:"center"===n?e.top-(t.height-e.height)/2+o:a-t.height-o),"inside-top"===i?l=e.top+s:"inside-bottom"===i?l=a-s-t.height:"inside-left"===i?c=e.left+s:"inside-right"===i?c=r-s-t.width:"inside-center"===i&&(c=(r+e.left)/2-t.width/2+s),"inside-top"===i||"inside-bottom"===i?c="start"===n?e.left+o:"center"===n?e.left-(t.width-e.width)/2+o:r-t.width-o:"inside-left"!==i&&"inside-right"!==i&&"inside-center"!==i||(l="start"===n?e.top+o:"center"===n?e.top-(t.height-e.height)/2+o:a-t.height-o),{top:l,left:c}}function et(t,e,i,n){return"outside-top"===t||"outside-bottom"===t?e.top<i.top||e.top+n.height>i.height+i.top:e.left<i.left||e.left+n.width>i.width+i.left}function it(t,e,i,n){return"end"===t?e.left<i.left:"start"===t||"center"===t?e.left+n.width>i.left+i.width||e.left<i.left:void 0}function*nt(t,e={}){var i,n;const s=null!==(i=e.strict)&&void 0!==i&&i,o=null!==(n=e.onlyTabbable)&&void 0!==n&&n?at:rt,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&o(t,s)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&o(t,s)&&(yield t),e.reverse){let t=r.lastChild();for(;t;)a=t,t=r.lastChild()}else a=r.firstChild();for(;a instanceof HTMLElement;)yield a,a=e.reverse?r.previousNode():r.nextNode();e.reverse&&o(t,s)&&(yield t)}function st(t,e=!1){return nt(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}const ot=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"]);function rt(t,e=!1){if(t.hidden)return!1;if(t.classList.contains("sentinel"))return!1;if(t instanceof HTMLInputElement&&"hidden"===t.type)return!1;if(ot.has(t.tagName)&&t.disabled)return!1;if(e){const e=t.offsetWidth,i=t.offsetHeight,n=t.offsetParent;if(0===e||0===i)return!1;const s=getComputedStyle(t);if("none"===s.display)return!1;if("hidden"===s.visibility||"collapse"===s.visibility)return!1;const o=s.position;if(!n&&"fixed"!==o&&"sticky"!==o)return!1;if(0===t.getClientRects().length)return!1}return null!=t.getAttribute("tabindex")||("true"===t.getAttribute("contenteditable")||"plaintext-only"===t.getAttribute("contenteditable")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex)}function at(t,e=!1){return rt(t,e)&&"-1"!==t.getAttribute("tabindex")}let lt=!1;function ct(){}try{const t=Object.create({},{signal:{get(){lt=!0}}});window.addEventListener("test",ct,t),window.removeEventListener("test",ct,t)}catch(t){}function dt(){lt||(!function(){if("undefined"==typeof window)return;const t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(e,i,n){return"object"==typeof n&&"signal"in n&&n.signal instanceof AbortSignal&&t.call(n.signal,"abort",()=>{this.removeEventListener(e,i,n)}),t.call(this,e,i,n)}}(),lt=!0)}dt();const ht=[];let ut;function mt({onFocus:t}){const e=document.createElement("span");return e.setAttribute("class","sentinel"),e.setAttribute("tabindex","0"),e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",e.onfocus=t,e}function ft(t,e,i){const n=new AbortController,s=null!=i?i:n.signal;t.setAttribute("data-focus-trap","active");const o=mt({onFocus:()=>{const e=st(t,!0);null==e||e.focus()}}),r=mt({onFocus:()=>{const e=st(t);null==e||e.focus()}});null!==t.querySelector(":scope > span.sentinel")||(t.prepend(o),t.append(r));const a=function(t,e){const i=new MutationObserver(i=>{for(const n of i)if("childList"===n.type&&n.addedNodes.length){for(const t of n.addedNodes)if(t instanceof HTMLElement&&"SPAN"===t.tagName&&t.classList.contains("sentinel"))return;const i=t.firstElementChild,s=t.lastElementChild,[o,r]=e;(null==i?void 0:i.classList.contains("sentinel"))||t.insertAdjacentElement("afterbegin",o),(null==s?void 0:s.classList.contains("sentinel"))||t.insertAdjacentElement("beforeend",r)}});return i.observe(t,{childList:!0}),i}(t,[o,r]);let l;function c(i){if(i instanceof HTMLElement&&document.contains(t)){if(t.contains(i))return void(l=i);if(l&&at(l)&&t.contains(l))return void l.focus();if(e&&t.contains(e))return void e.focus();{const e=st(t);return void(null==e||e.focus())}}}const d=function(t){const e=new AbortController;return t.addEventListener("abort",()=>{e.abort()}),e}(s);if(ut){const t=ut;ut.container.setAttribute("data-focus-trap","suspended"),ut.controller.abort(),ht.push(t)}d.signal.addEventListener("abort",()=>{ut=void 0}),s.addEventListener("abort",()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const i=ht.findIndex(e=>e.container===t);i>=0&&ht.splice(i,1),a.disconnect(),function(){const t=ht.pop();t&&ft(t.container,t.initialFocus,t.originalSignal)}()}),document.addEventListener("focus",t=>{c(t.target)},{signal:d.signal,capture:!0}),c(document.activeElement),ut={container:t,controller:d,initialFocus:e,originalSignal:s};const h=ht.findIndex(e=>e.container===t);if(h>=0&&ht.splice(h,1),!i)return n}let pt;function gt(){return void 0===pt&&(pt=/^mac/i.test(window.navigator.platform)),pt}let bt=1e4;const vt=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);class wt{constructor(){this._items=[],this._itemSet=new Set,this._indexMap=new Map}insertAt(t,e){let i;if(e.length<=100)i=e.filter((t,e,i)=>!this._itemSet.has(t)&&i.indexOf(t)===e);else{const t=new Set;i=[];for(let n=0;n<e.length;n++){const s=e[n];this._itemSet.has(s)||t.has(s)||(t.add(s),i.push(s))}}if(0===i.length)return;const n=Math.max(0,Math.min(t,this._items.length));if(n!==this._items.length)if(0!==n){for(let t=this._items.length-1;t>=n;t--)this._indexMap.set(this._items[t],t+i.length);i.length<=1e4?this._items.splice(n,0,...i):this._chunkedInsert(n,i);for(let t=0;t<i.length;t++){const e=i[t];this._itemSet.add(e),this._indexMap.set(e,n+t)}}else{for(let t=0;t<this._items.length;t++)this._indexMap.set(this._items[t],t+i.length);i.length<=1e4?this._items.splice(0,0,...i):this._chunkedInsert(0,i);for(let t=0;t<i.length;t++)this._itemSet.add(i[t]),this._indexMap.set(i[t],t)}else for(let t=0;t<i.length;t++){const e=i[t];this._indexMap.set(e,this._items.length),this._items.push(e),this._itemSet.add(e)}}_chunkedInsert(t,e){for(let i=0;i<e.length;i+=1e4){const n=e.slice(i,i+1e4);this._items.splice(t+i,0,...n)}}delete(t){if(!this._itemSet.has(t))return!1;const e=this._indexMap.get(t);this._items.splice(e,1),this._itemSet.delete(t),this._indexMap.delete(t);for(let t=e;t<this._items.length;t++)this._indexMap.set(this._items[t],t);return!0}has(t){return this._itemSet.has(t)}indexOf(t){var e;return null!==(e=this._indexMap.get(t))&&void 0!==e?e:-1}get(t){return this._items[t]}get size(){return this._items.length}[Symbol.iterator](){return this._items[Symbol.iterator]()}clear(){this._items=[],this._itemSet.clear(),this._indexMap.clear()}find(t){return this._items.find(t)}}var yt;dt(),function(t){t[t.ArrowHorizontal=1]="ArrowHorizontal",t[t.ArrowVertical=2]="ArrowVertical",t[t.JK=4]="JK",t[t.HL=8]="HL",t[t.HomeAndEnd=16]="HomeAndEnd",t[t.PageUpDown=256]="PageUpDown",t[t.WS=32]="WS",t[t.AD=64]="AD",t[t.Tab=128]="Tab",t[t.Backspace=512]="Backspace",t[t.ArrowAll=3]="ArrowAll",t[t.HJKL=12]="HJKL",t[t.WASD=96]="WASD",t[t.All=511]="All"}(yt||(yt={}));const Et={ArrowLeft:yt.ArrowHorizontal,ArrowDown:yt.ArrowVertical,ArrowUp:yt.ArrowVertical,ArrowRight:yt.ArrowHorizontal,h:yt.HL,j:yt.JK,k:yt.JK,l:yt.HL,a:yt.AD,s:yt.WS,w:yt.WS,d:yt.AD,Tab:yt.Tab,Home:yt.HomeAndEnd,End:yt.HomeAndEnd,PageUp:yt.PageUpDown,PageDown:yt.PageUpDown,Backspace:yt.Backspace},At={ArrowLeft:"previous",ArrowDown:"next",ArrowUp:"previous",ArrowRight:"next",h:"previous",j:"next",k:"previous",l:"next",a:"previous",s:"next",w:"previous",d:"next",Tab:"next",Home:"start",End:"end",PageUp:"start",PageDown:"end",Backspace:"previous"};function kt(t){const e=At[t.key];if("Tab"===t.key&&t.shiftKey)return"previous";const i=gt();if(i&&t.metaKey||!i&&t.ctrlKey){if("ArrowLeft"===t.key||"ArrowUp"===t.key)return"start";if("ArrowRight"===t.key||"ArrowDown"===t.key)return"end"}return e}function Lt(t,e){const i=t.key,n=1===i.length||2===i.length&&i.charCodeAt(0)>=55296&&i.charCodeAt(0)<=56319,s=function(t){var e,i;if(!(t instanceof HTMLElement))return!1;const n=t.nodeName.toLowerCase(),s=null!==(i=null===(e=t.getAttribute("type"))||void 0===e?void 0:e.toLowerCase())&&void 0!==i?i:"text",o="true"===t.ariaReadOnly||"true"===t.getAttribute("aria-readonly")||null!==t.getAttribute("readonly");return("select"===n||"textarea"===n||"input"===n&&!vt.has(s)||t.isContentEditable)&&!o}(e),o=e instanceof HTMLSelectElement;if(s&&(n||"Home"===i||"End"===i))return!0;if(o){const e=gt();return!("ArrowDown"!==i||!e||t.metaKey)||!("ArrowDown"!==i||e||!t.altKey)}if(s&&!o){const t=e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement,n=t&&0===e.selectionStart&&0===e.selectionEnd,s=t&&e.selectionStart===e.value.length&&e.selectionEnd===e.value.length;if("ArrowLeft"===i&&!n)return!0;if("ArrowRight"===i&&!s)return!0;const o=e instanceof HTMLElement&&e.isContentEditable;if(e instanceof HTMLTextAreaElement||o){if("PageUp"===i||"PageDown"===i)return!0;if("ArrowUp"===i&&!n)return!0;if("ArrowDown"===i&&!s)return!0}}return!1}const Tt="data-is-active-descendant",St="data-has-active-descendant";function Ct(t,e){var i,n,s,o,r,a,l;const c=new wt,d=new WeakMap,h=null!==(i=null==e?void 0:e.bindKeys)&&void 0!==i?i:((null==e?void 0:e.getNextFocusable)?yt.ArrowAll:yt.ArrowVertical)|yt.HomeAndEnd,u=null!==(n=null==e?void 0:e.focusOutBehavior)&&void 0!==n?n:"stop",m=null!==(s=null==e?void 0:e.focusInStrategy)&&void 0!==s?s:"previous",f=null==e?void 0:e.activeDescendantControl,p=null==e?void 0:e.onActiveDescendantChanged,g=null!==(o=null==e?void 0:e.ignoreHoverEvents)&&void 0!==o&&o,b=null!==(r=null==e?void 0:e.focusPrependedElements)&&void 0!==r&&r;let v,w=!1;const y=null!==(a=null==e?void 0:e.preventScroll)&&void 0!==a&&a,E="initial"===m&&(null==e?void 0:e.activeDescendantControl);function A(){return c.get(0)}function k(t,e=!1){const i=v;v=t,w=e,f?t&&document.activeElement===f?L(i,t,e):T():(i&&i!==t&&d.has(i)&&i.setAttribute("tabindex","-1"),null==t||t.setAttribute("tabindex","0"))}function L(e,i,n=!1){i.id||i.setAttribute("id","__primer_id_"+bt++),e&&e!==i&&e.removeAttribute(Tt),f&&(n||f.getAttribute("aria-activedescendant")!==i.id)&&(f.setAttribute("aria-activedescendant",i.id),t.setAttribute(St,i.id),i.setAttribute(Tt,n?"activated-directly":"activated-indirectly"),null==p||p(i,e,n))}function T(e=v){"first"===m&&(v=void 0),null==f||f.removeAttribute("aria-activedescendant"),t.removeAttribute(St),null==e||e.removeAttribute(Tt);const i=t.querySelectorAll(`[${Tt}]`);for(let t=0;t<i.length;t++)i[t].removeAttribute(Tt);null==p||p(void 0,e,!1)}function S(...t){const i=(null==e?void 0:e.focusableElementFilter)?t.filter(t=>e.focusableElementFilter(t)):t;if(0===i.length)return;const n=function(t){const e=t[0];if(0===c.size)return 0;let i=0,n=c.size-1;for(;i<=n;){const t=Math.floor((i+n)/2);x(e,c.get(t))?n=t-1:i=t+1}return i}(i);c.insertAt(n,i);for(const t of i)d.has(t)||d.set(t,t.getAttribute("tabindex")),t.setAttribute("tabindex","-1");!E&&(b&&0===n&&!w)?C():E||v||k(A())}function C(){const e=[...nt(t,I)];c.clear(),c.insertAt(0,e);for(const t of e)d.has(t)||d.set(t,t.getAttribute("tabindex")),t.setAttribute("tabindex","-1");k(A())}function x(t,e){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)>0}function M(...t){for(const e of t){c.delete(e);const t=d.get(e);if(void 0!==t&&(null===t?e.removeAttribute("tabindex"):e.setAttribute("tabindex",t),d.delete(e)),e===v){k(A())}}}const I={reverse:null==e?void 0:e.reverse,strict:null==e?void 0:e.strict,onlyTabbable:null==e?void 0:e.onlyTabbable};S(...nt(t,I));const D="function"==typeof m?m(document.body):A();E||k(D);const P=new MutationObserver(t=>{const e=new Set,i=new Set,n=new Set,s=new Set;for(const o of t)if("childList"===o.type){for(const t of o.removedNodes)t instanceof HTMLElement&&e.add(t);for(const t of o.addedNodes)t instanceof HTMLElement&&i.add(t)}else if("attributes"===o.type&&o.target instanceof HTMLElement){const t=o.attributeName;!!t&&o.target.hasAttribute(t)?n.add(o.target):s.add(o.target)}if(e.size>0){const t=[];for(const i of e)for(const e of nt(i))t.push(e);t.length>0&&M(...t)}if(n.size>0&&M(...n),i.size>0){const t=[];for(const e of i)for(const i of nt(e,I))t.push(i);t.length>0&&(b?C():S(...t))}s.size>0&&S(...s)});P.observe(t,{subtree:!0,childList:!0,attributeFilter:["hidden","disabled"],attributeOldValue:!0});const N=new AbortController,O=null!==(l=null==e?void 0:e.abortSignal)&&void 0!==l?l:N.signal;let F;O.addEventListener("abort",()=>{P.disconnect(),M(...c),c.clear()}),t.addEventListener("mousedown",t=>{t.target instanceof HTMLElement&&t.target!==document.activeElement&&(F=c.indexOf(t.target))},{signal:O}),f?(t.addEventListener("focusin",t=>{t.target instanceof HTMLElement&&c.has(t.target)&&(f.focus({preventScroll:y}),k(t.target))},{signal:O}),g||t.addEventListener("mousemove",({target:t})=>{if(!(t instanceof Node))return;if(t instanceof HTMLElement&&c.has(t))return void k(t);const e=c.find(e=>e.contains(t));e&&k(e)},{signal:O,capture:!0}),f.addEventListener("focusin",()=>{v?L(void 0,v):E||k(A())},{signal:O}),f.addEventListener("focusout",()=>{T()},{signal:O})):t.addEventListener("focusin",e=>{if(e.target instanceof HTMLElement)if(void 0!==F){if(F>=0){const t=c.get(F);t&&t!==v&&k(t)}F=void 0}else if("previous"===m)k(e.target);else if("closest"===m||"first"===m){if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t="previous"===V?c.size-1:0,e=c.get(t);return void(null==e||e.focus({preventScroll:y}))}k(e.target)}else if("function"==typeof m)if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t=m(e.relatedTarget);if(t&&c.has(t))return void t.focus({preventScroll:y});console.warn("Element requested is not a known focusable element.")}else k(e.target);V=void 0},{signal:O});const H=null!=f?f:t;let V;return"closest"===m&&document.addEventListener("keydown",t=>{"Tab"===t.key&&(V=kt(t))},{signal:O,capture:!0}),H.addEventListener("keydown",i=>{var n;if(i.key in At){const s=Et[i.key];if(!i.defaultPrevented&&(s&h)>0&&!Lt(i,document.activeElement)){const s=kt(i);let o;if((null==e?void 0:e.getNextFocusable)&&(o=e.getNextFocusable(s,null!==(n=document.activeElement)&&void 0!==n?n:void 0,i)),!o){const e=function(){if(!v)return E?-1:0;const e=c.indexOf(v);return-1!==e?e:v===t?-1:0}();let n=e;"previous"===s?n-=1:"start"===s?n=0:"next"===s?n+=1:n=c.size-1,n<0&&(n="wrap"===u&&"Tab"!==i.key?c.size-1:0),n>=c.size&&(n="wrap"===u&&"Tab"!==i.key?0:c.size-1),e!==n&&(o=c.get(n))}f?k(o||v,!0):o&&(V=s,o.focus({preventScroll:y})),("Tab"!==i.key||o)&&i.preventDefault()}}},{signal:O}),N}var xt,Mt,It,Dt,Pt,Nt,Ot,Ft;const Ht=new IntersectionObserver(t=>{for(const e of t){const t=e.target;e.isIntersecting&&t instanceof qt&&t.update()}}),Vt=new ResizeObserver(t=>{for(const e of t){const t=e.target;t instanceof qt&&t.update()}});let qt=class ActionBarElement extends HTMLElement{constructor(){super(...arguments),xt.add(this),Mt.set(this,null),It.set(this,!1)}connectedCallback(){Vt.observe(this),Ht.observe(this),this.style.overflow="visible",this.update()}disconnectedCallback(){Vt.unobserve(this),Ht.unobserve(this)}menuItemClick(t){const e=t.currentTarget,i=e?.getAttribute("data-for");i&&document.getElementById(i)?.click()}update(){b(this,It,"f")||(v(this,It,!0,"f"),requestAnimationFrame(()=>{v(this,It,!1,"f"),b(this,xt,"m",Dt).call(this)}))}};Mt=new WeakMap,It=new WeakMap,xt=new WeakSet,Dt=function(){const t=b(this,xt,"a",Pt);if(!t)return;const e=t.getBoundingClientRect().top,i=b(this,xt,"a",Ft),n=Array.from(this.items,t=>({top:t.getBoundingClientRect().top,isDivider:t.classList.contains("ActionBar-divider")}));let s=!1;for(let t=0;t<n.length;t++){const o=n[t];o.isDivider?s=!0:(o.top>e?(b(this,xt,"m",Ot).call(this,t,i),this.moreMenu.hidden&&(this.moreMenu.hidden=!1),s&&b(this,xt,"m",Ot).call(this,t-1,i)):(b(this,xt,"m",Nt).call(this,t,i),t===this.items.length-1&&(this.moreMenu.hidden=!0),s&&b(this,xt,"m",Nt).call(this,t-1,i)),s=!1)}b(this,Mt,"f")&&b(this,Mt,"f").abort(),v(this,Mt,Ct(this,{bindKeys:yt.ArrowHorizontal|yt.HomeAndEnd,focusOutBehavior:"wrap",focusableElementFilter:t=>{const e=this.items.indexOf(t.parentElement),i=e>-1&&"visible"===this.items[e].style.visibility,n=t===this.moreMenu.invokerElement&&!this.moreMenu.hidden;return i||n}}),"f")},Pt=function(){return this.items.find(t=>!t.classList.contains("ActionBar-divider"))??null},Nt=function(t,e){const i=this.items[t],n=e[t];i&&n&&(i.style.setProperty("visibility","visible"),n.hidden=!0)},Ot=function(t,e){const i=this.items[t],n=e[t];i&&n&&(i.style.setProperty("visibility","hidden"),n.hidden=!1)},Ft=function(){return this.moreMenu.querySelectorAll('[role="menu"] > li')},g([j],qt.prototype,"items",void 0),g([_],qt.prototype,"itemContainer",void 0),g([_],qt.prototype,"moreMenu",void 0),qt=g([K("action-bar")],qt),window.ActionBarElement=qt;class DetailsMenuElement extends HTMLElement{get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const i=[Bt(t,"compositionstart",t=>Xt(this,t)),Bt(t,"compositionend",t=>Xt(this,t)),Bt(t,"click",e=>zt(t,e)),Bt(t,"change",e=>zt(t,e)),Bt(t,"keydown",e=>function(t,e,i){if(!(i instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const n=Rt.get(e);if(!n||n.isComposing)return;const s=i.target instanceof Element&&"SUMMARY"===i.target.tagName;switch(i.key){case"Escape":t.hasAttribute("open")&&(Gt(t),i.preventDefault(),i.stopPropagation());break;case"ArrowDown":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=jt(t,!0);e&&e.focus(),i.preventDefault()}break;case"ArrowUp":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=jt(t,!1);e&&e.focus(),i.preventDefault()}break;case"n":if(Kt&&i.ctrlKey){const e=jt(t,!0);e&&e.focus(),i.preventDefault()}break;case"p":if(Kt&&i.ctrlKey){const e=jt(t,!1);e&&e.focus(),i.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&Yt(e)&&e.closest("details")===t&&(i.preventDefault(),i.stopPropagation(),e.click())}}}(t,this,e)),Bt(t,"toggle",()=>$t(t,this),{once:!0}),Bt(t,"toggle",()=>function(t){if(!t.hasAttribute("open"))return;for(const e of document.querySelectorAll("details[open] > details-menu")){const i=e.closest("details");i&&i!==t&&!i.contains(t)&&i.removeAttribute("open")}}(t)),this.preload?Bt(t,"mouseover",()=>$t(t,this),{once:!0}):Wt,...Ut(t)];Rt.set(this,{subscriptions:i,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=Rt.get(this);if(t){Rt.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const Rt=new WeakMap,Wt={unsubscribe(){}};function Bt(t,e,i,n=!1){return t.addEventListener(e,i,n),{unsubscribe:()=>{t.removeEventListener(e,i,n)}}}function $t(t,e){const i=e.getAttribute("src");if(!i)return;const n=Rt.get(e);if(!n)return;if(n.loaded)return;n.loaded=!0;const s=e.querySelector("include-fragment");s&&!s.hasAttribute("src")&&(s.addEventListener("loadend",()=>_t(t)),s.setAttribute("src",i))}function Ut(t){let e=!1;return[Bt(t,"mousedown",()=>e=!0),Bt(t,"keydown",()=>e=!1),Bt(t,"toggle",()=>{t.hasAttribute("open")&&(_t(t)||e||function(t){const e=document.activeElement;if(e&&Yt(e)&&t.contains(e))return;const i=jt(t,!0);i&&i.focus()}(t))})]}function _t(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function jt(t,e){const i=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),n=document.activeElement,s=n instanceof HTMLElement?i.indexOf(n):-1,o=e?i[s+1]:i[s-1],r=e?i[0]:i[i.length-1];return o||r}const Kt=navigator.userAgent.match(/Macintosh/);function zt(t,e){const i=e.target;if(i instanceof Element&&i.closest("details")===t)if("click"===e.type){const e=i.closest('[role="menuitem"], [role="menuitemradio"]');if(!e)return;const n=e.querySelector("input");if("LABEL"===e.tagName&&i===n)return;"LABEL"===e.tagName&&n&&!n.checked||Zt(e,t)}else if("change"===e.type){const e=i.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&Zt(e,t)}}function Zt(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const i=t.closest("details-menu");if(!i)return;i.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const i=e.querySelector("[data-menu-button]");if(!i)return;const n=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-text")?t:t.querySelector("[data-menu-button-text]");return e?e.getAttribute("data-menu-button-text")||e.textContent:null}(t);if(n)i.textContent=n;else{const e=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-contents")?t:t.querySelector("[data-menu-button-contents]");return e?e.innerHTML:null}(t);e&&(i.innerHTML=e)}}(t,e),function(t,e){for(const i of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=i.querySelector('input[type="radio"], input[type="checkbox"]');let n=(i===t).toString();e instanceof HTMLInputElement&&(n=e.indeterminate?"mixed":e.checked.toString()),i.setAttribute("aria-checked",n)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&Gt(e),i.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function Yt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function Gt(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Xt(t,e){const i=Rt.get(t);i&&(i.isComposing="compositionstart"===e.type)}var Jt,Qt;window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const te=(()=>{const t=new Set;let e=null,i=null;function n(){for(const e of t)e.update()}return s=>{window.addEventListener("resize",n),window.addEventListener("scroll",n),e||(e=new IntersectionObserver(e=>{for(const i of e){const e=i.target;i.isIntersecting?(e.update(),t.add(e)):t.delete(e)}})),i||(i=new ResizeObserver(()=>{for(const e of t)e.update()})),i.observe(s.ownerDocument.documentElement),e.observe(s)}})();class AnchoredPositionElement extends HTMLElement{constructor(){super(...arguments),Jt.set(this,null),Qt.set(this,void 0)}get align(){const t=this.getAttribute("align");return"center"===t||"end"===t?t:"start"}set align(t){this.setAttribute("align",`${t}`)}get side(){const t=this.getAttribute("side");return"inside-top"===t||"inside-bottom"===t||"inside-left"===t||"inside-right"===t||"inside-center"===t||"outside-top"===t||"outside-left"===t||"outside-right"===t?t:"outside-bottom"}set side(t){this.setAttribute("side",`${t}`)}get anchorOffset(){const t=this.getAttribute("anchor-offset");return"spacious"===t||"8"===t?8:4}set anchorOffset(t){this.setAttribute("anchor-offset",`${t}`)}get anchor(){return this.getAttribute("anchor")||""}set anchor(t){this.setAttribute("anchor",`${t}`)}get anchorElement(){if(b(this,Jt,"f"))return b(this,Jt,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){v(this,Jt,t,"f"),b(this,Jt,"f")||this.removeAttribute("anchor")}get alignmentOffset(){return Number(this.getAttribute("alignment-offset"))}set alignmentOffset(t){this.setAttribute("alignment-offset",`${t}`)}get allowOutOfBounds(){return this.hasAttribute("allow-out-of-bounds")}set allowOutOfBounds(t){this.toggleAttribute("allow-out-of-bounds",t)}connectedCallback(){this.update(),this.addEventListener("beforetoggle",()=>this.update()),te(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(b(this,Qt,"f")),v(this,Qt,requestAnimationFrame(()=>{const t=this.anchorElement;if(this.classList.toggle("not-anchored",!t),t){const{left:e,top:i}=J(this,t,this);this.style.top=`${i}px`,this.style.left=`${e}px`,this.style.bottom="auto",this.style.right="auto"}else this.style.top="0",this.style.left="0",this.style.bottom="0",this.style.right="0"}),"f"))}}var ee,ie,ne;function se(t){t.body.style.getPropertyValue("--dialog-scrollgutter")||t.body.style.setProperty("--dialog-scrollgutter",window.innerWidth-t.body.clientWidth+"px")}function oe(t){const e=t.target,i=e?.closest("button");if(!i||i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled"))return;let n=i?.getAttribute("data-show-dialog-id");if(n){const e=document.getElementById(n);if(e instanceof HTMLDialogElement){se(e.ownerDocument),e.showModal(),t.preventDefault();let n=i,s=!1;for(;n;)n=n.parentElement?.closest("[popover]"),n&&"auto"===n.popover&&(n.classList.add("dialog-inside-popover-fix"),n.popover="manual",n.showPopover(),s=!0);s&&(e.addEventListener("close",t=>t.stopImmediatePropagation(),{once:!0}),e.close(),e.showModal(),e.addEventListener("close",()=>{for(const t of e.ownerDocument.querySelectorAll(".dialog-inside-popover-fix"))t.contains(e)&&(t.classList.remove("dialog-inside-popover-fix"),t.popover="auto",t.showPopover())},{once:!0}))}}if(n=i.getAttribute("data-close-dialog-id")||i.getAttribute("data-submit-dialog-id"),n){const t=document.getElementById(n);t instanceof HTMLDialogElement&&t.open&&t.close()}}Jt=new WeakMap,Qt=new WeakMap,AnchoredPositionElement.observedAttributes=["align","side","anchor","alignment-offset","allow-out-of-bounds"],customElements.get("anchored-position")||(window.AnchoredPositionElement=AnchoredPositionElement,customElements.define("anchored-position",AnchoredPositionElement));class DialogHelperElement extends HTMLElement{constructor(){super(...arguments),ee.add(this),ie.set(this,null)}get dialog(){return this.querySelector("dialog")}connectedCallback(){const{signal:t}=v(this,ie,new AbortController,"f");document.addEventListener("click",oe,!0),document.addEventListener("click",this,{signal:t}),new MutationObserver(t=>{for(const e of t)e.target===this.dialog&&b(this,ee,"m",ne).call(this)}).observe(this,{subtree:!0,attributeFilter:["open"]}),b(this,ee,"m",ne).call(this)}disconnectedCallback(){b(this,ie,"f")?.abort()}handleEvent(t){const e=t.target,i=this.dialog;if(e!==i||!i?.open)return;if(i.querySelector("form"))return;const n=i.getBoundingClientRect();n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width||i.close()}}ie=new WeakMap,ee=new WeakSet,ne=function(){this.dialog&&this.dialog.matches("[open]:not(:modal)")&&(this.dialog.addEventListener("close",t=>t.stopImmediatePropagation(),{once:!0}),this.dialog.close(),se(this.dialog.ownerDocument),this.dialog.showModal())},window.customElements.get("dialog-helper")||(window.DialogHelperElement=DialogHelperElement,window.customElements.define("dialog-helper",DialogHelperElement));var re=class extends Event{oldState;newState;constructor(t,{oldState:e="",newState:i="",...n}={}){super(t,n),this.oldState=String(e||""),this.newState=String(i||"")}},ae=new WeakMap;function le(t,e,i){ae.set(t,setTimeout(()=>{ae.has(t)&&t.dispatchEvent(new re("toggle",{cancelable:!1,oldState:e,newState:i}))},0))}var ce=globalThis.ShadowRoot||function(){},de=globalThis.HTMLDialogElement||function(){},he=new WeakMap,ue=new WeakMap,me=new WeakMap;function fe(t){return me.get(t)||"hidden"}var pe=new WeakMap;function ge(t,e){return("auto"===t.popover||"manual"===t.popover)&&(!!t.isConnected&&((!e||"showing"===fe(t))&&(!(!e&&"hidden"!==fe(t))&&(!(t instanceof de&&t.hasAttribute("open"))&&document.fullscreenElement!==t))))}function be(t){return t?Array.from(ue.get(t.ownerDocument)||[]).indexOf(t)+1:0}function ve(t){const e=Ee(t),i=function(t){for(;t;){const e=t.popoverTargetElement;if(e instanceof HTMLElement)return e;if((t=t.parentElement||ye(t))instanceof ce&&(t=t.host),t instanceof Document)return}}(t);return be(e)>be(i)?e:i}function we(t){const e=ue.get(t);for(const t of e||[]){if(t.isConnected)return t;e.delete(t)}return null}function ye(t){return"function"==typeof t.getRootNode?t.getRootNode():t.parentNode?ye(t.parentNode):t}function Ee(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===me.get(t))return t;if((t=t instanceof Element&&t.assignedSlot||t.parentElement||ye(t))instanceof ce&&(t=t.host),t instanceof Document)return}}function Ae(t){return!(t.hidden||t instanceof ce)&&((!(t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLOptGroupElement||t instanceof HTMLOptionElement||t instanceof HTMLFieldSetElement)||!t.disabled)&&(!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(!(t instanceof HTMLAnchorElement&&""===t.href)&&("number"==typeof t.tabIndex&&-1!==t.tabIndex))))}function ke(t){(function(t){if(t.shadowRoot&&!0!==t.shadowRoot.delegatesFocus)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);let i=e.querySelector("[autofocus]");if(i)return i;{const t=e.querySelectorAll("slot");for(const e of t){const t=e.assignedElements({flatten:!0});for(const e of t){if(e.hasAttribute("autofocus"))return e;if(i=e.querySelector("[autofocus]"),i)return i}}}const n=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let s=n.currentNode;for(;s;){if(Ae(s))return s;s=n.nextNode()}})(t)?.focus()}var Le=new WeakMap;function Te(t){if(!ge(t,!1))return;const e=t.ownerDocument;if(!t.dispatchEvent(new re("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"})))return;if(!ge(t,!1))return;let i=!1;if("auto"===t.popover){const i=t.getAttribute("popover");if(xe(function(t){const e=new Map;let i=0;for(const n of ue.get(t.ownerDocument)||[])e.set(n,i),i+=1;e.set(t,i),i+=1;let n=null;return function(t){const i=Ee(t);if(null===i)return null;const s=e.get(i);(null===n||e.get(n)<s)&&(n=i)}(t.parentElement||ye(t)),n}(t)||e,!1,!0),i!==t.getAttribute("popover")||!ge(t,!1))return}we(e)||(i=!0),Le.delete(t);const n=e.activeElement;t.classList.add(":popover-open"),me.set(t,"showing"),he.has(e)||he.set(e,new Set),he.get(e).add(t),ke(t),"auto"===t.popover&&(ue.has(e)||ue.set(e,new Set),ue.get(e).add(t),Pe(pe.get(t),!0)),i&&n&&"auto"===t.popover&&Le.set(t,n),le(t,"closed","open")}function Se(t,e=!1,i=!1){if(!ge(t,!0))return;const n=t.ownerDocument;if("auto"===t.popover&&(xe(t,e,i),!ge(t,!0)))return;if(Pe(pe.get(t),!1),pe.delete(t),i&&(t.dispatchEvent(new re("beforetoggle",{oldState:"open",newState:"closed"})),!ge(t,!0)))return;he.get(n)?.delete(t),ue.get(n)?.delete(t),t.classList.remove(":popover-open"),me.set(t,"hidden"),i&&le(t,"open","closed");const s=Le.get(t);s&&(Le.delete(t),e&&s.focus())}function Ce(t,e=!1,i=!1){let n=we(t);for(;n;)Se(n,e,i),n=we(t)}function xe(t,e,i){const n=t.ownerDocument||t;if(t instanceof Document)return Ce(n,e,i);let s=null,o=!1;for(const e of ue.get(n)||[])if(e===t)o=!0;else if(o){s=e;break}if(!o)return Ce(n,e,i);for(;s&&"showing"===fe(s)&&ue.get(n)?.size;)Se(s,e,i)}var Me=new WeakMap;function Ie(t){if(!t.isTrusted)return;const e=t.composedPath()[0];if(!e)return;const i=e.ownerDocument;if(!we(i))return;const n=ve(e);if(n&&"pointerdown"===t.type)Me.set(i,n);else if("pointerup"===t.type){const t=Me.get(i)===n;Me.delete(i),t&&xe(n||i,!1,!0)}}var De=new WeakMap;function Pe(t,e=!1){if(!t)return;De.has(t)||De.set(t,t.getAttribute("aria-expanded"));const i=t.popoverTargetElement;if(i instanceof HTMLElement&&"auto"===i.popover)t.setAttribute("aria-expanded",String(e));else{const e=De.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}var Ne=globalThis.ShadowRoot||function(){};function Oe(t,e,i){const n=t[e];Object.defineProperty(t,e,{value(t){return n.call(this,i(t))}})}var Fe=/(^|[^\\]):popover-open\b/g;function He(){const t="function"==typeof globalThis.CSSLayerBlockRule;return`\n${t?"@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${t?"}":""}\n`}var Ve,qe,Re,We,Be=null;function $e(t){const e=He();if(null===Be)try{(Be=new CSSStyleSheet).replaceSync(e)}catch{Be=!1}if(!1===Be){const i=document.createElement("style");i.textContent=e,t instanceof Document?t.head.prepend(i):t.prepend(i)}else t.adoptedStyleSheets=[Be,...t.adoptedStyleSheets]}"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){if("undefined"==typeof window)return;function t(t){return t?.includes(":popover-open")&&(t=t.replace(Fe,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||re,Oe(Document.prototype,"querySelector",t),Oe(Document.prototype,"querySelectorAll",t),Oe(Element.prototype,"querySelector",t),Oe(Element.prototype,"querySelectorAll",t),Oe(Element.prototype,"matches",t),Oe(Element.prototype,"closest",t),Oe(DocumentFragment.prototype,"querySelectorAll",t),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;const t=(this.getAttribute("popover")||"").toLowerCase();return""===t||"auto"==t?"auto":"manual"},set(t){null===t?this.removeAttribute("popover"):this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(){Te(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){Se(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t){"showing"===me.get(this)&&void 0===t||!1===t?Se(this,!0,!0):void 0!==t&&!0!==t||Te(this)}}});const e=Element.prototype.attachShadow;e&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(t){const i=e.call(this,t);return $e(i),i}}});const i=HTMLElement.prototype.attachInternals;i&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){const t=i.call(this);return t.shadowRoot&&$e(t.shadowRoot),t}}});const n=new WeakMap;function s(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),n.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),n.set(this,t)}},get(){if("button"!==this.localName&&"input"!==this.localName)return null;if("input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type)return null;if(this.disabled)return null;if(this.form&&"submit"===this.type)return null;const t=n.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return n.delete(this),null;const e=ye(this),i=this.getAttribute("popovertarget");return(e instanceof Document||e instanceof Ne)&&i&&e.getElementById(i)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){const t=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===t||"hide"===t?t:"toggle"},set(t){this.setAttribute("popovertargetaction",t)}}})}s(HTMLButtonElement),s(HTMLInputElement);const o=t=>{const e=t.composedPath(),i=e[0];if(!(i instanceof Element)||i?.shadowRoot)return;const n=ye(i);if(!(n instanceof Ne||n instanceof Document))return;const s=e.find(t=>t.matches?.("[popovertargetaction],[popovertarget]"));return s?(function(t){const e=t.popoverTargetElement;if(!(e instanceof HTMLElement))return;const i=fe(e);"show"===t.popoverTargetAction&&"showing"===i||"hide"===t.popoverTargetAction&&"hidden"===i||("showing"===i?Se(e,!0,!0):ge(e,!1)&&(pe.set(e,t),Te(e)))}(s),void t.preventDefault()):void 0},r=t=>{const e=t.key,i=t.target;t.defaultPrevented||!i||"Escape"!==e&&"Esc"!==e||xe(i.ownerDocument,!0,!0)};(t=>{t.addEventListener("click",o),t.addEventListener("keydown",r),t.addEventListener("pointerdown",Ie),t.addEventListener("pointerup",Ie)})(document),$e(document)}();const Ue=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]'].map(t=>`:not([hidden]) > ${t}`).join(", "),_e=t=>t.textContent?.trim()[0].toLowerCase(),je=/^\S$/;class FocusGroupElement extends HTMLElement{constructor(){super(...arguments),Ve.add(this),qe.set(this,null),Re.set(this,null)}get nowrap(){return this.hasAttribute("nowrap")}set nowrap(t){this.toggleAttribute("nowrap",t)}get direction(){return"horizontal"===this.getAttribute("direction")?"horizontal":"vertical"}set direction(t){this.setAttribute("direction",`${t}`)}get retain(){return this.hasAttribute("retain")}set retain(t){this.toggleAttribute("retain",t)}get mnemonics(){return this.hasAttribute("mnemonics")}connectedCallback(){v(this,Re,new AbortController,"f");const{signal:t}=b(this,Re,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusin",this,{signal:t})}disconnectedCallback(){b(this,Re,"f")?.abort()}handleEvent(t){const{direction:e,nowrap:i}=this;if("focusin"===t.type){if(this.retain&&t.target instanceof Element&&t.target.matches(Ue)){b(this,qe,"f")?.abort();const{signal:e}=v(this,qe,new AbortController,"f");for(const i of b(this,Ve,"a",We)){i.setAttribute("tabindex",i===t.target?"0":"-1");const n=t.target.closest("[popover]");i===t.target&&"auto"===n?.popover&&n.closest("focus-group")===this&&n.addEventListener("toggle",t=>{if(t.target instanceof Element&&"closed"===t.newState&&(b(this,qe,"f")?.abort(),i.setAttribute("tabindex","-1"),n.id)){const t=this.querySelector(`[popovertarget="${n.id}"]`);t?t.setAttribute("tabindex","0"):b(this,Ve,"a",We)[0]?.setAttribute("tabindex","0")}},{signal:e})}}}else if(t instanceof KeyboardEvent){const n=Array.from(b(this,Ve,"a",We));let s=n.indexOf(t.target);const o=t.key;if("Up"===o||"ArrowUp"===o)"vertical"!==e&&"both"!==e||(s-=s<0?0:1,t.preventDefault());else if("Down"===o||"ArrowDown"===o)"vertical"!==e&&"both"!==e||(s+=1,t.preventDefault());else if("Left"===t.key||"ArrowLeft"===t.key)"horizontal"!==e&&"both"!==e||(s-=1,t.preventDefault());else if("Right"===t.key||"ArrowRight"===t.key)"horizontal"!==e&&"both"!==e||(s+=1,t.preventDefault());else if("Home"===t.key||"PageUp"===t.key)s=0,t.preventDefault();else if("End"===t.key||"PageDown"===t.key)s=n.length-1,t.preventDefault();else{if(!this.mnemonics||!je.test(o))return;{const e=o.toLowerCase(),r=s>0&&_e(t.target)===e?s:0;s=n.findIndex((t,i)=>i>r&&_e(t)===e),s<0&&!i&&(s=n.findIndex(t=>_e(t)===e))}}i&&s<0&&(s=0),!i&&s>=n.length&&(s=0);const r=n.at(Math.min(s,n.length-1));{let e=r;do{e=e.closest("[popover]:not(:popover-open)"),"auto"!==e?.popover||["ArrowRight","ArrowLeft"].includes(t.key)||e.showPopover(),e=e?.parentElement||null}while(e)}r?.focus()}}}qe=new WeakMap,Re=new WeakMap,Ve=new WeakSet,We=function(){return this.querySelectorAll(Ue)},customElements.get("focus-group")||(window.FocusGroupElement=FocusGroupElement,customElements.define("focus-group",FocusGroupElement));let Ke=class ScrollableRegionElement extends HTMLElement{constructor(){super(...arguments),this.hasOverflow=!1,this.labelledBy=""}connectedCallback(){this.style.overflow="auto",this.observer=new ResizeObserver(t=>{for(const e of t)this.hasOverflow=e.target.scrollHeight>e.target.clientHeight||e.target.scrollWidth>e.target.clientWidth}),this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}attributeChangedCallback(t){"data-has-overflow"===t&&(this.hasOverflow?(this.setAttribute("aria-labelledby",this.labelledBy),this.setAttribute("role","region"),this.setAttribute("tabindex","0")):(this.removeAttribute("aria-labelledby"),this.removeAttribute("role"),this.removeAttribute("tabindex")))}};g([I],Ke.prototype,"hasOverflow",void 0),g([I],Ke.prototype,"labelledBy",void 0),Ke=g([K("scrollable-region")],Ke),window.ScrollableRegionElement=Ke;const ze=(t,e,i)=>{if(e())i();else{const n=new MutationObserver(()=>{e()&&(i(),n.disconnect())});n.observe(t,{childList:!0,subtree:!0})}};var Ze,Ye,Ge,Xe;function Je(t){document.activeElement!==t&&t?.focus()}const Qe=[];function ti(t){const e=t.target,i=e?.closest("button");if(!i||i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled"))return;let n=i?.getAttribute("data-show-dialog-id");if(n){t.stopPropagation();const e=document.getElementById(n);if(e instanceof ModalDialogElement)return e.openButton=i,e.show(),void t.preventDefault()}if(Qe.length&&(n=i.getAttribute("data-close-dialog-id")||i.getAttribute("data-submit-dialog-id"),n)){const t=document.getElementById(n);if(t instanceof ModalDialogElement){const e=Qe.findIndex(t=>t.id===n);Qe.splice(e,1),t.close(i.hasAttribute("data-submit-dialog-id"))}}}function ei(t){!(t instanceof KeyboardEvent&&"keydown"===t.type&&"Enter"===t.key)||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey||ti(t)}function ii(t){const e=t.target;if(e?.closest("button"))return;const i=Qe[Qe.length-1];if(!i)return;!e.closest(`#${i.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",t=>{t.target===e&&(Qe.pop(),i.close())},{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),Ze.add(this),Ye.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){if(t){if(this.open)return;this.setAttribute("open",""),this.setAttribute("aria-disabled","false"),document.body.style.paddingRight=window.innerWidth-document.body.clientWidth+"px",document.body.style.overflow="hidden",b(this,Ze,"a",Ge)?.classList.remove("Overlay--hidden"),b(this,Ye,"f").signal.aborted&&v(this,Ye,new AbortController,"f"),ft(this,this.querySelector("[autofocus]"),b(this,Ye,"f").signal),Qe.push(this)}else{if(!this.open)return;this.removeAttribute("open"),this.setAttribute("aria-disabled","true"),b(this,Ze,"a",Ge)?.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",b(this,Ye,"f").abort();const t=this.openButton?.closest("details")||this.openButton?.closest("action-menu");Je(t?st(t):this.openButton),this.openButton=null}}get showButtons(){return document.querySelectorAll(`button[data-show-dialog-id='${this.id}']`)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),document.addEventListener("click",ti),document.addEventListener("keydown",ei),document.addEventListener("mousedown",ii),this.addEventListener("keydown",t=>b(this,Ze,"m",Xe).call(this,t))}show(){this.open=!0}close(t=!1){if(!1===this.open)return;const e=new Event(t?"close":"cancel");this.dispatchEvent(e),this.open=!1}}var ni,si,oi,ri,ai,li,ci,di;Ye=new WeakMap,Ze=new WeakSet,Ge=function(){return this.parentElement?.hasAttribute("data-modal-dialog-overlay")?this.parentElement:null},Xe=function(t){if(t instanceof KeyboardEvent&&!t.isComposing&&this.open)switch(t.key){case"Escape":this.close(),t.preventDefault(),t.stopPropagation();break;case"Enter":t.target.getAttribute("data-close-dialog-id")===this.id&&t.stopPropagation();break}},window.customElements.get("modal-dialog")||(window.ModalDialogElement=ModalDialogElement,window.customElements.define("modal-dialog",ModalDialogElement));let hi=class NavListElement extends HTMLElement{constructor(){super(...arguments),ni.add(this),si.set(this,void 0)}connectedCallback(){this.topLevelList&&v(this,si,new Z(this.topLevelList),"f")}disconnectedCallback(){this.topLevelList&&b(this,si,"f").unobserve(this.topLevelList)}selectItemById(t){if(!t)return!1;const e=b(this,ni,"m",oi).call(this,t);return!!e&&(b(this,ni,"m",li).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=b(this,ni,"m",ri).call(this,t);return!!e&&(b(this,ni,"m",li).call(this,e),!0)}selectItemByCurrentLocation(){const t=b(this,ni,"m",ai).call(this);return!!t&&(b(this,ni,"m",li).call(this,t),!0)}expandItem(t){t.nextElementSibling?.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){t.nextElementSibling?.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false"),t.focus()}itemIsExpanded(t){return"A"===t?.tagName||"true"===t?.getAttribute("aria-expanded")}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const i=e.closest("button");i&&(this.itemIsExpanded(i)?this.collapseItem(i):this.expandItem(i),t.stopPropagation())}handleItemWithSubItemKeydown(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;let i=e.closest("button");if(!i){const t=e.getAttribute("aria-labelledby");if(!t)return;i=document.getElementById(t)}this.itemIsExpanded(i)&&"Escape"===t.key&&this.collapseItem(i),t.stopPropagation()}};var ui,mi,fi;si=new WeakMap,ni=new WeakSet,oi=function(t){for(const e of this.items){if(e.classList.contains("ActionListItem--hasSubItem"))continue;if((e.getAttribute("data-item-id")?.split(" ")||[]).includes(t))return e}return null},ri=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},ai=function(){return b(this,ni,"m",ri).call(this,window.location.pathname)},li=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&b(this,ni,"m",ci).call(this,e),t.classList.add("ActionListItem--navActive"),t.children.length>0&&t.children[0].setAttribute("aria-current","page");const i=b(this,ni,"m",di).call(this,t);i&&(this.expandItem(i),i.classList.add("ActionListContent--hasActiveSubItem"))},ci=function(t){t.classList.remove("ActionListItem--navActive"),t.children.length>0&&t.children[0].removeAttribute("aria-current");const e=b(this,ni,"m",di).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},di=function(t){if(!t.classList.contains("ActionListItem--subItem"))return null;const e=t.closest("li.ActionListItem--hasSubItem")?.querySelector("button.ActionListContent");return e||null},g([j],hi.prototype,"items",void 0),g([_],hi.prototype,"topLevelList",void 0),hi=g([K("nav-list")],hi);let pi=class NavListGroupElement extends HTMLElement{constructor(){super(...arguments),ui.add(this),fi.set(this,new Z(this))}connectedCallback(){this.setShowMoreItemState()}get showMoreDisabled(){return this.showMoreItem.hasAttribute("aria-disabled")}set showMoreDisabled(t){t?this.showMoreItem.setAttribute("aria-disabled","true"):this.showMoreItem.removeAttribute("aria-disabled"),this.showMoreItem.classList.toggle("disabled",t)}set currentPage(t){this.showMoreItem.setAttribute("data-current-page",t.toString())}get currentPage(){return parseInt(this.showMoreItem.getAttribute("data-current-page"))||1}get totalPages(){return parseInt(this.showMoreItem.getAttribute("data-total-pages"))||1}get paginationSrc(){return this.showMoreItem.getAttribute("src")||""}async showMore(t){if(t.preventDefault(),this.showMoreDisabled)return;let e;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const i=await fetch(t);if(!i.ok)return;e=await i.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const i=b(this,ui,"m",mi).call(this,document,e);i?.querySelector("li > a")?.setAttribute("data-targets","nav-list-group.focusMarkers");const n=t.target.closest("button").getAttribute("data-list-id");document.getElementById(n).append(i),this.focusMarkers.pop()?.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}};var gi,bi;fi=new WeakMap,ui=new WeakSet,mi=function(t,e){const i=t.createElement("template");return i.innerHTML=e,t.importNode(i.content,!0)},g([_],pi.prototype,"showMoreItem",void 0),g([j],pi.prototype,"focusMarkers",void 0),pi=g([K("nav-list-group")],pi),window.NavListGroupElement=pi;let vi=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),gi.add(this)}connectedCallback(){b(this,gi,"m",bi).call(this)}select(t){const e=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),t.querySelector("[aria-current]")?.setAttribute("aria-current","false");e.closest("li.SegmentedControl-item")?.classList.add("SegmentedControl-item--selected"),e.setAttribute("aria-current","true"),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:e,checked:!1,value:e.querySelector(".Button-label")?.textContent}}))}get current(){return this.querySelector("[aria-current=true]")}};gi=new WeakSet,bi=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},g([j],vi.prototype,"items",void 0),vi=g([K("segmented-control")],vi),window.customElements.get("segmented-control")||(window.SegmentedControlElement=vi,window.customElements.define("segmented-control",vi));let wi=class ToggleSwitchElement extends HTMLElement{constructor(){super(...arguments),this.turbo=!1,this.toggling=!1}get src(){const t=this.getAttribute("src");if(!t)return null;const e=this.ownerDocument.createElement("a");return e.href=t,e.href}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("data-csrf")||t instanceof HTMLInputElement&&t.value||null}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}isRemote(){return null!=this.src}async toggle(){if(!this.toggling&&(this.toggling=!0,!this.isDisabled())){if(!this.isRemote())return this.performToggle(),void(this.toggling=!1);this.performToggle(),this.setLoadingState();try{await this.submitForm()}catch(t){return void(t instanceof Error&&(this.setErrorState(t.message||"An error occurred, please try again."),this.performToggle()))}finally{this.toggling=!1}this.setSuccessState()}}turnOn(){this.isDisabled()||(this.switch.setAttribute("aria-pressed","true"),this.classList.add("ToggleSwitch--checked"))}turnOff(){this.isDisabled()||(this.switch.setAttribute("aria-pressed","false"),this.classList.remove("ToggleSwitch--checked"))}isOn(){return"true"===this.switch.getAttribute("aria-pressed")}isOff(){return!this.isOn()}isDisabled(){return null!=this.switch.getAttribute("disabled")}disable(){this.switch.setAttribute("disabled","disabled")}enable(){this.switch.removeAttribute("disabled")}performToggle(){this.isOn()?this.turnOff():this.turnOn()}setLoadingState(){this.errorIcon.setAttribute("hidden","hidden"),this.loadingSpinner.removeAttribute("hidden");const t=new CustomEvent("toggleSwitchLoading",{bubbles:!0});this.dispatchEvent(t)}setSuccessState(){const t=new CustomEvent("toggleSwitchSuccess",{bubbles:!0});this.dispatchEvent(t),this.setFinishedState(!1)}setErrorState(t){const e=new CustomEvent("toggleSwitchError",{bubbles:!0,detail:t});this.dispatchEvent(e),this.setFinishedState(!0)}setFinishedState(t){t&&this.errorIcon.removeAttribute("hidden"),this.loadingSpinner.setAttribute("hidden","hidden")}async submitForm(){const t=new FormData;if(this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"1":"0"),!this.src)throw new Error("invalid src");let e;const i={"Requested-With":"XMLHttpRequest","X-Requested-With":"XMLHttpRequest"};this.turbo&&(i.Accept="text/vnd.turbo-stream.html");try{e=await fetch(this.src,{credentials:"same-origin",method:"POST",headers:i,body:t})}catch(t){throw new Error("A network error occurred, please try again.")}if(!e.ok)throw new Error(await e.text());const n=e.headers.get("Content-Type");window.Turbo&&this.turbo&&n?.startsWith("text/vnd.turbo-stream.html")&&window.Turbo.renderStreamMessage(await e.text())}};var yi,Ei,Ai,ki,Li,Ti,Si,Ci,xi,Mi,Ii,Di;g([_],wi.prototype,"switch",void 0),g([_],wi.prototype,"loadingSpinner",void 0),g([_],wi.prototype,"errorIcon",void 0),g([I],wi.prototype,"turbo",void 0),wi=g([K("toggle-switch")],wi),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=wi,window.customElements.define("toggle-switch",wi));const Pi=(()=>{let t;return e=>t?e.matches(t):function(e){try{return t=":popover-open",e.matches(t)}catch{try{return t=":open",e.matches(":open")}catch{return t=".\\:popover-open",e.matches(".\\:popover-open")}}}(e)})(),Ni="sr-only",Oi=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];function Fi(t){for(const e of Ri)e!==t&&(Pi(e)?e.hidePopover():Ri.delete(e))}function Hi(){Fi()}function Vi(t){setTimeout(()=>{for(const e of Ri)Pi(e)&&"focus"===e.showReason&&e.control!==t.target&&e.hidePopover()},0)}const qi=new Set,Ri=new Set;class ToolTipElement extends HTMLElement{constructor(){super(...arguments),yi.add(this),Ei.set(this,void 0),Ai.set(this,"center"),ki.set(this,"outside-bottom"),Li.set(this,!1),Ti.set(this,"mouse"),Si.set(this,!1)}styles(){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: min(var(--overlay-width-small), 100vw);\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 '}get showReason(){return b(this,Ti,"f")}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get type(){return"label"===this.getAttribute("data-type")?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return this.getAttribute("data-direction")||"s"}set direction(t){this.setAttribute("data-direction",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}set hiddenFromView(t){t&&Pi(this)?this.hidePopover():t||Pi(this)||this.showPopover()}get hiddenFromView(){return!Pi(this)}connectedCallback(){if(qi.add(this),b(this,yi,"m",Mi).call(this),b(this,yi,"m",Ii).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}b(this,yi,"m",Ci).call(this,!1),v(this,Li,!0,"f"),b(this,yi,"m",xi).call(this)}disconnectedCallback(){qi.delete(this),Ri.delete(this),b(this,Ei,"f")?.abort()}async handleEvent(t){if(!this.control)return;const e=Pi(this);"beforetoggle"===t.type&&t.currentTarget!==this&&v(this,Si,"open"===t.newState,"f");const i=("mouseenter"===t.type||"focus"===t.type&&(navigator.webdriver||this.control.matches(":focus-visible")))&&!b(this,Si,"f"),n="mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this,s="keydown"===t.type&&"Escape"===t.key,o="mousedown"===t.type&&t.currentTarget===this.control,r="beforetoggle"===t.type&&t.currentTarget!==this&&"open"===t.newState,a=n||s||o||r;e&&s&&(t.stopImmediatePropagation(),t.preventDefault()),await Promise.resolve(),e||!i||Pi(this)?e&&a&&Pi(this)&&this.hidePopover():(v(this,Ti,"mouseenter"===t.type?"mouse":"focus","f"),this.showPopover()),"toggle"===t.type&&b(this,yi,"m",Ci).call(this,"open"===t.newState)}attributeChangedCallback(t){this.isConnected&&("for"===t?b(this,yi,"m",xi).call(this):"id"===t||"data-type"===t?b(this,yi,"m",Mi).call(this):"data-direction"===t&&b(this,yi,"m",Ii).call(this))}}var Wi,Bi;Ei=new WeakMap,Ai=new WeakMap,ki=new WeakMap,Li=new WeakMap,Ti=new WeakMap,Si=new WeakMap,yi=new WeakSet,Ci=function(t){t?(Ri.add(this),this.classList.remove(Ni),Fi(this),b(this,yi,"m",Di).call(this)):(Ri.delete(this),this.classList.remove(...Oi),this.classList.add(Ni))},xi=function(){if(!this.control)return;this.setAttribute("role","tooltip"),b(this,Ei,"f")?.abort(),v(this,Ei,new AbortController,"f");const{signal:t}=b(this,Ei,"f");this.addEventListener("mouseleave",this,{signal:t}),this.addEventListener("toggle",this,{signal:t}),this.control.addEventListener("mouseenter",this,{signal:t}),this.control.addEventListener("mouseleave",this,{signal:t}),this.control.addEventListener("focus",this,{signal:t}),this.control.addEventListener("mousedown",this,{signal:t}),this.control.popoverTargetElement?.addEventListener("beforetoggle",this,{signal:t}),this.ownerDocument.addEventListener("focusout",Hi),this.ownerDocument.addEventListener("focusin",Vi),this.ownerDocument.addEventListener("keydown",this,{signal:t,capture:!0})},Mi=function(){if(this.id&&this.control)if("label"===this.type){let t=this.control.getAttribute("aria-labelledby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-labelledby",t),this.setAttribute("aria-hidden","true")}else{let t=this.control.getAttribute("aria-describedby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-describedby",t)}},Ii=function(){this.classList.remove(...Oi);const t=this.direction;"n"===t?(v(this,Ai,"center","f"),v(this,ki,"outside-top","f")):"ne"===t?(v(this,Ai,"end","f"),v(this,ki,"outside-top","f")):"e"===t?(v(this,Ai,"center","f"),v(this,ki,"outside-right","f")):"se"===t?(v(this,Ai,"end","f"),v(this,ki,"outside-bottom","f")):"s"===t?(v(this,Ai,"center","f"),v(this,ki,"outside-bottom","f")):"sw"===t?(v(this,Ai,"start","f"),v(this,ki,"outside-bottom","f")):"w"===t?(v(this,Ai,"center","f"),v(this,ki,"outside-left","f")):"nw"===t&&(v(this,Ai,"start","f"),v(this,ki,"outside-top","f"))},Di=function(){if(!this.control)return;if(!b(this,Li,"f")||!Pi(this))return;const t=J(this,this.control,{side:b(this,ki,"f"),align:b(this,Ai,"f"),anchorOffset:0}),e=t.anchorSide,i=t.anchorAlign;this.style.setProperty("--tool-tip-position-top",`${t.top}px`),this.style.setProperty("--tool-tip-position-left",`${t.left}px`);let n="s";n="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===i?"n":"start"===i?"ne":"nw":"center"===i?"s":"start"===i?"se":"sw",this.classList.add(`tooltip-${n}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id","for"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let $i=class XBannerElement extends HTMLElement{constructor(){super(...arguments),Wi.add(this)}dismiss(){if("remove"===b(this,Wi,"a",Bi)){const t=this.parentElement;if(!t)return;t.removeChild(this)}else this.hide();this.dispatchEvent(new CustomEvent("banner:dismiss"))}show(){this.style.setProperty("display","initial")}hide(){this.style.setProperty("display","none")}};Wi=new WeakSet,Bi=function(){return this.getAttribute("data-dismiss-scheme")},g([_],$i.prototype,"titleText",void 0),$i=g([K("x-banner")],$i),window.customElements.get("x-banner")||(window.XBannerElement=$i,window.customElements.define("x-banner",$i));class Ui{constructor(t,e,{tabInsertsSuggestions:i,defaultFirstOption:n,scrollIntoViewOptions:s}={}){this.input=t,this.list=e,this.tabInsertsSuggestions=null==i||i,this.defaultFirstOption=null!=n&&n,this.scrollIntoViewOptions=null!=s?s:{block:"nearest",inline:"nearest"},this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=t=>function(t,e){if(t.shiftKey||t.metaKey||t.altKey)return;if(!e.ctrlBindings&&t.ctrlKey)return;if(e.isComposing)return;switch(t.key){case"Enter":ji(e.input,e.list)&&t.preventDefault();break;case"Tab":e.tabInsertsSuggestions&&ji(e.input,e.list)&&t.preventDefault();break;case"Escape":e.clearSelection();break;case"ArrowDown":e.navigate(1),t.preventDefault();break;case"ArrowUp":e.navigate(-1),t.preventDefault();break;case"n":e.ctrlBindings&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":e.ctrlBindings&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.clearSelection()}}(t,this),this.compositionEventHandler=t=>function(t,e){e.isComposing="compositionstart"===t.type;const i=document.getElementById(e.input.getAttribute("aria-controls")||"");if(!i)return;e.clearSelection()}(t,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",_i),this.indicateDefaultOption()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",_i)}indicateDefaultOption(){var t;this.defaultFirstOption&&(null===(t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(zi)[0])||void 0===t||t.setAttribute("data-combobox-option-default","true"))}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(zi)[0],i=Array.from(this.list.querySelectorAll('[role="option"]')).filter(zi),n=i.indexOf(e);if(n===i.length-1&&1===t||0===n&&-1===t)return this.clearSelection(),void this.input.focus();let s=1===t?0:i.length-1;if(e&&n>=0){const e=n+t;e>=0&&e<i.length&&(s=e)}const o=i[s];if(o)for(const t of i)t.removeAttribute("data-combobox-option-default"),o===t?(this.input.setAttribute("aria-activedescendant",o.id),o.setAttribute("aria-selected","true"),Ki(o),o.scrollIntoView(this.scrollIntoViewOptions)):t.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.removeAttribute("aria-selected");this.indicateDefaultOption()}}function _i(t){if(!(t.target instanceof Element))return;const e=t.target.closest('[role="option"]');e&&"true"!==e.getAttribute("aria-disabled")&&function(t,e){t.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0,detail:e}))}(e,{event:t})}function ji(t,e){const i=e.querySelector('[aria-selected="true"], [data-combobox-option-default="true"]');return!!i&&("true"===i.getAttribute("aria-disabled")||i.click(),!0)}function Ki(t){t.dispatchEvent(new Event("combobox-select",{bubbles:!0}))}function zi(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}const Zi=window.testScreenReaderDelay||100;class Yi{constructor(t,e,i,n=!1){var s;if(this.container=t,this.input=e,this.results=i,this.combobox=new Ui(e,i,{defaultFirstOption:n}),this.feedback=t.getRootNode().getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=n,this.clearButton=t.getRootNode().getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=i.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.popover?this.results.matches(":popover-open")&&this.results.hidePopover():this.results.hidden=!0,this.results.getAttribute("aria-label")||this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let i;return function(...n){clearTimeout(i),i=window.setTimeout(()=>{clearTimeout(i),t(...n)},e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(s=this.clearButton)||void 0===s||s.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),"true"===this.input.getAttribute("aria-expanded")&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.close()}onKeydown(t){if("Escape"===t.key&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.open(),t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.interactingWithList||this.fetchResults()}onInputBlur(){this.interactingWithList||this.close()}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(this.close(),e instanceof HTMLAnchorElement)return;const i=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=i,i||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout(()=>{this.feedback&&(this.feedback.textContent=t)},Zi)}fetchResults(){const t=this.input.value.trim();if(!t&&!this.container.fetchOnEmpty)return void this.close();const e=this.container.src;if(!e)return;const i=new URL(e,window.location.href),n=new URLSearchParams(i.search.slice(1));n.append("q",t),i.search=n.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(i).then(t=>{this.results.innerHTML=t,this.identifyOptions(),this.combobox.indicateDefaultOption();const e=this.results.querySelectorAll('[role="option"]'),i=!!e.length||!!this.results.querySelectorAll('[data-no-result-found="true"]').length,n=e.length,[s]=e,o=null==s?void 0:s.textContent;this.autoselectEnabled&&o?this.updateFeedbackForScreenReaders(`${n} results. ${o} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${n||"No"} results.`),i?this.open():this.close(),this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))}).catch(()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))})}open(){(this.results.popover?!this.results.matches(":popover-open"):this.results.hidden)&&(this.combobox.start(),this.results.popover?this.results.showPopover():this.results.hidden=!1),this.container.open=!0,this.interactingWithList=!0}close(){(this.results.popover?this.results.matches(":popover-open"):!this.results.hidden)&&(this.combobox.stop(),this.results.popover?this.results.hidePopover():this.results.hidden=!0),this.container.open=!1,this.interactingWithList=!1}}var Gi,Xi,Ji,Qi,tn,en=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},nn=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i},sn=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const on=globalThis.HTMLElement||null;class rn extends Event{constructor(t,e){var{relatedTarget:i}=e;super(t,sn(e,["relatedTarget"])),this.relatedTarget=i}}const an=new WeakMap;let ln=null;class AutoCompleteElement extends on{constructor(){super(...arguments),Gi.add(this),Xi.set(this,null),Ji.set(this,null),tn.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){ln=null===t?t:Promise.resolve(t)}get forElement(){var t;if(null===(t=en(this,Xi,"f"))||void 0===t?void 0:t.isConnected)return en(this,Xi,"f");const e=this.getAttribute("for"),i=this.getRootNode();return e&&(i instanceof Document||i instanceof ShadowRoot)?i.getElementById(e):null}set forElement(t){nn(this,Xi,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return(null===(t=en(this,Ji,"f"))||void 0===t?void 0:t.isConnected)?en(this,Ji,"f"):this.querySelector("input")}set inputElement(t){nn(this,Ji,t,"f"),en(this,Gi,"m",Qi).call(this)}connectedCallback(){this.isConnected&&(en(this,Gi,"m",Qi).call(this),new MutationObserver(()=>{an.get(this)||en(this,Gi,"m",Qi).call(this)}).observe(this,{subtree:!0,childList:!0}))}disconnectedCallback(){const t=an.get(this);t&&(t.destroy(),an.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}get fetchOnEmpty(){return this.hasAttribute("fetch-on-empty")}set fetchOnEmpty(t){this.toggleAttribute("fetch-on-empty",t)}async fetchResult(t){var e;null===(e=en(this,tn,"f"))||void 0===e||e.abort();const{signal:i}=nn(this,tn,new AbortController,"f"),n=await fetch(t.toString(),{signal:i,headers:{Accept:"text/fragment+html"}});if(!n.ok)throw new Error(await n.text());if(ln){return(await ln).createHTML(await n.text(),n)}return await n.text()}static get observedAttributes(){return["open","value","for"]}attributeChangedCallback(t,e,i){var n,s;if(e===i)return;const o=an.get(this);if(o)switch(this.forElement===(null===(n=an.get(this))||void 0===n?void 0:n.results)&&this.inputElement===(null===(s=an.get(this))||void 0===s?void 0:s.input)||en(this,Gi,"m",Qi).call(this),t){case"open":null===i?o.close():o.open();break;case"value":null!==i&&(o.input.value=i),this.dispatchEvent(new rn("auto-complete-change",{bubbles:!0,relatedTarget:o.input}))}}}Xi=new WeakMap,Ji=new WeakMap,tn=new WeakMap,Gi=new WeakSet,Qi=function(){var t;null===(t=an.get(this))||void 0===t||t.destroy();const{forElement:e,inputElement:i}=this;if(!e||!i)return;const n="true"===this.getAttribute("data-autoselect");an.set(this,new Yi(this,i,e,n)),e.setAttribute("role","listbox")};const cn="undefined"!=typeof globalThis?globalThis:window;try{cn.AutocompleteElement=cn.AutoCompleteElement=AutoCompleteElement.define()}catch(t){if(!(cn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function dn(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t.textContent||"");const e=getSelection();if(null==e)return Promise.reject(new Error);e.removeAllRanges();const i=document.createRange();return i.selectNodeContents(t),e.addRange(i),document.execCommand("copy"),e.removeAllRanges(),Promise.resolve()}function hn(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t);const e=document.body;if(!e)return Promise.reject(new Error);const i=function(t){const e=document.createElement("pre");return e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="5px",e.textContent=t,e}(t);return e.appendChild(i),dn(i),e.removeChild(i),Promise.resolve()}async function un(t){const e=t.getAttribute("for"),i=t.getAttribute("value");function n(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}var s;if("true"!==t.getAttribute("aria-disabled"))if(i)await hn(i),n();else if(e){const i="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(i instanceof Document||"ShadowRoot"in window&&i instanceof ShadowRoot))return;const o=i.getElementById(e);o&&(await(s=o,s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement?hn(s.value):s instanceof HTMLAnchorElement&&s.hasAttribute("href")?hn(s.href):dn(s)),n())}}function mn(t){const e=t.currentTarget;e instanceof HTMLElement&&un(e)}function fn(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),un(e))}}function pn(t){t.currentTarget.addEventListener("keydown",fn)}function gn(t){t.currentTarget.removeEventListener("keydown",fn)}class ClipboardCopyElement extends HTMLElement{static define(t="clipboard-copy",e=customElements){return e.define(t,this),this}constructor(){super(),this.addEventListener("click",mn),this.addEventListener("focus",pn),this.addEventListener("blur",gn)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}const bn="undefined"!=typeof globalThis?globalThis:window;try{bn.ClipboardCopyElement=ClipboardCopyElement.define()}catch(t){if(!(bn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function vn(t){t.style.display="inline-block"}function wn(t){t.style.display="none"}const yn=new WeakMap;document.addEventListener("clipboard-copy",({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=yn.get(t),i=t.parentNode?.querySelector("[data-clipboard-copy-feedback]"),n="Copied!";e?(clearTimeout(e),yn.delete(t)):(!function(t){const[e,i]=t.querySelectorAll(".octicon");e&&i&&(wn(e),vn(i))}(t),i&&(i.textContent===n?i.textContent=`${n} `:i.textContent=n)),yn.set(t,setTimeout(()=>{!function(t){const[e,i]=t.querySelectorAll(".octicon");e&&i&&(vn(e),wn(i))}(t),yn.delete(t)},2e3))});var En,An=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i},kn=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};const Ln="undefined"!=typeof Intl&&Intl.ListFormat||class{formatToParts(t){const e=[];for(const i of t)e.push({type:"element",value:i}),e.push({type:"literal",value:", "});return e.slice(0,-1)}},Tn=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],Sn={minimumIntegerDigits:2};class Cn{constructor(t,e={}){En.set(this,void 0);let i=String(e.style||"short");"long"!==i&&"short"!==i&&"narrow"!==i&&"digital"!==i&&(i="short");let n="digital"===i?"numeric":i;const s=e.hours||n;n="2-digit"===s?"numeric":s;const o=e.minutes||n;n="2-digit"===o?"numeric":o;const r=e.seconds||n;n="2-digit"===r?"numeric":r;const a=e.milliseconds||n;An(this,En,{locale:t,style:i,years:e.years||"digital"===i?"short":i,yearsDisplay:"always"===e.yearsDisplay?"always":"auto",months:e.months||"digital"===i?"short":i,monthsDisplay:"always"===e.monthsDisplay?"always":"auto",weeks:e.weeks||"digital"===i?"short":i,weeksDisplay:"always"===e.weeksDisplay?"always":"auto",days:e.days||"digital"===i?"short":i,daysDisplay:"always"===e.daysDisplay?"always":"auto",hours:s,hoursDisplay:"always"===e.hoursDisplay||"digital"===i?"always":"auto",minutes:o,minutesDisplay:"always"===e.minutesDisplay||"digital"===i?"always":"auto",seconds:r,secondsDisplay:"always"===e.secondsDisplay||"digital"===i?"always":"auto",milliseconds:a,millisecondsDisplay:"always"===e.millisecondsDisplay?"always":"auto"},"f")}resolvedOptions(){return kn(this,En,"f")}formatToParts(t){const e=[],i=kn(this,En,"f"),n=i.style,s=i.locale;for(const[o,r]of Tn){const a=t[o];if("auto"===i[`${o}Display`]&&!a)continue;const l=i[o],c="2-digit"===l?Sn:"numeric"===l?{}:{style:"unit",unit:r,unitDisplay:l};let d=new Intl.NumberFormat(s,c).format(a);"months"===o&&("narrow"===l||"narrow"===n&&d.endsWith("m"))&&(d=d.replace(/(\d+)m$/,"$1mo")),e.push(d)}return new Ln(s,{type:"unit",style:"digital"===n?"short":n}).formatToParts(e)}format(t){return this.formatToParts(t).map(t=>t.value).join("")}}En=new WeakMap;const xn=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,Mn=["year","month","week","day","hour","minute","second","millisecond"];class In{constructor(t=0,e=0,i=0,n=0,s=0,o=0,r=0,a=0){this.years=t,this.months=e,this.weeks=i,this.days=n,this.hours=s,this.minutes=o,this.seconds=r,this.milliseconds=a,this.years||(this.years=0),this.sign||(this.sign=Math.sign(this.years)),this.months||(this.months=0),this.sign||(this.sign=Math.sign(this.months)),this.weeks||(this.weeks=0),this.sign||(this.sign=Math.sign(this.weeks)),this.days||(this.days=0),this.sign||(this.sign=Math.sign(this.days)),this.hours||(this.hours=0),this.sign||(this.sign=Math.sign(this.hours)),this.minutes||(this.minutes=0),this.sign||(this.sign=Math.sign(this.minutes)),this.seconds||(this.seconds=0),this.sign||(this.sign=Math.sign(this.seconds)),this.milliseconds||(this.milliseconds=0),this.sign||(this.sign=Math.sign(this.milliseconds)),this.blank=0===this.sign}abs(){return new In(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))}static from(t){var e;if("string"==typeof t){const i=String(t).trim(),n=i.startsWith("-")?-1:1,s=null===(e=i.match(xn))||void 0===e?void 0:e.slice(1).map(t=>(Number(t)||0)*n);return s?new In(...s):new In}if("object"==typeof t){const{years:e,months:i,weeks:n,days:s,hours:o,minutes:r,seconds:a,milliseconds:l}=t;return new In(e,i,n,s,o,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const i=Date.now(),n=Math.abs(Dn(i,In.from(t)).getTime()-i),s=Math.abs(Dn(i,In.from(e)).getTime()-i);return n>s?-1:n<s?1:0}toLocaleString(t,e){return new Cn(t,e).format(this)}}function Dn(t,e){const i=new Date(t);return e.sign<0?(i.setUTCSeconds(i.getUTCSeconds()+e.seconds),i.setUTCMinutes(i.getUTCMinutes()+e.minutes),i.setUTCHours(i.getUTCHours()+e.hours),i.setUTCDate(i.getUTCDate()+7*e.weeks+e.days),i.setUTCMonth(i.getUTCMonth()+e.months),i.setUTCFullYear(i.getUTCFullYear()+e.years)):(i.setUTCFullYear(i.getUTCFullYear()+e.years),i.setUTCMonth(i.getUTCMonth()+e.months),i.setUTCDate(i.getUTCDate()+7*e.weeks+e.days),i.setUTCHours(i.getUTCHours()+e.hours),i.setUTCMinutes(i.getUTCMinutes()+e.minutes),i.setUTCSeconds(i.getUTCSeconds()+e.seconds)),i}function Pn(t,{relativeTo:e=Date.now()}={}){if(e=new Date(e),t.blank)return t;const i=t.sign;let n=Math.abs(t.years),s=Math.abs(t.months),o=Math.abs(t.weeks),r=Math.abs(t.days),a=Math.abs(t.hours),l=Math.abs(t.minutes),c=Math.abs(t.seconds),d=Math.abs(t.milliseconds);d>=900&&(c+=Math.round(d/1e3)),(c||l||a||r||o||s||n)&&(d=0),c>=55&&(l+=Math.round(c/60)),(l||a||r||o||s||n)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||r||o||s||n)&&(l=0),r&&a>=12&&(r+=Math.round(a/24)),!r&&a>=21&&(r+=Math.round(a/24)),(r||o||s||n)&&(a=0);const h=e.getFullYear(),u=e.getMonth(),m=e.getDate();if(r>=27||n+s+r){const t=new Date(e);t.setDate(1),t.setMonth(u+s*i+1),t.setDate(0);const a=Math.max(0,m-t.getDate()),l=new Date(e);l.setFullYear(h+n*i),l.setDate(m-a),l.setMonth(u+s*i),l.setDate(m-a+r*i);const c=l.getFullYear()-e.getFullYear(),d=l.getMonth()-e.getMonth(),f=Math.abs(Math.round((Number(l)-Number(e))/864e5))+a,p=Math.abs(12*c+d);f<27?(r>=6?(o+=Math.round(r/7),r=0):r=f,s=n=0):p<=11?(s=p,n=0):(s=0,n=c*i),(s||n)&&(r=0)}return n&&(s=0),o>=4&&(s+=Math.round(o/4)),(s||n)&&(o=0),r&&o&&!s&&!n&&(o+=Math.round(r/7),r=0),new In(n*i,s*i,o*i,r*i,a*i,l*i,c*i,d*i)}var Nn,On,Fn,Hn,Vn,qn,Rn,Wn,Bn,$n,Un,_n,jn,Kn,zn,Zn,Yn=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},Gn=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i};const Xn=globalThis.HTMLElement||null,Jn=new In,Qn=new In(0,0,0,0,0,1);class ts extends Event{constructor(t,e,i,n){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=i,this.newTitle=n}}function es(t){if(!t.date)return 1/0;if("duration"===t.format||"elapsed"===t.format){const e=t.precision;if("second"===e)return 1e3;if("minute"===e)return 6e4}const e=Math.abs(Date.now()-t.date.getTime());return e<6e4?1e3:e<36e5?6e4:36e5}const is=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(t){if(this.elements.has(t))return;this.elements.add(t);const e=t.date;if(e&&e.getTime()){const e=es(t),i=Date.now()+e;i<this.time&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.update(),e),this.time=i)}}unobserve(t){this.elements.has(t)&&this.elements.delete(t)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let t=1/0;for(const e of this.elements)t=Math.min(t,es(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout(()=>this.update(),this.time),this.time+=Date.now()}};class RelativeTimeElement extends Xn{constructor(){super(...arguments),Nn.add(this),On.set(this,!1),Fn.set(this,!1),Vn.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),Zn.set(this,null)}static define(t="relative-time",e=customElements){return e.define(t,this),this}get timeZone(){var t;return(null===(t=this.closest("[time-zone]"))||void 0===t?void 0:t.getAttribute("time-zone"))||this.ownerDocument.documentElement.getAttribute("time-zone")||void 0}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","format-style","no-title","datetime","lang","title","aria-hidden","time-zone"]}get onRelativeTimeUpdated(){return Yn(this,Zn,"f")}set onRelativeTimeUpdated(t){Yn(this,Zn,"f")&&this.removeEventListener("relative-time-updated",Yn(this,Zn,"f")),Gn(this,Zn,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("relative-time-updated",t)}get second(){const t=this.getAttribute("second");if("numeric"===t||"2-digit"===t)return t}set second(t){this.setAttribute("second",t||"")}get minute(){const t=this.getAttribute("minute");if("numeric"===t||"2-digit"===t)return t}set minute(t){this.setAttribute("minute",t||"")}get hour(){const t=this.getAttribute("hour");if("numeric"===t||"2-digit"===t)return t}set hour(t){this.setAttribute("hour",t||"")}get weekday(){const t=this.getAttribute("weekday");return"long"===t||"short"===t||"narrow"===t?t:"datetime"===this.format&&""!==t?this.formatStyle:void 0}set weekday(t){this.setAttribute("weekday",t||"")}get day(){var t;const e=null!==(t=this.getAttribute("day"))&&void 0!==t?t:"numeric";if("numeric"===e||"2-digit"===e)return e}set day(t){this.setAttribute("day",t||"")}get month(){const t=this.format;let e=this.getAttribute("month");if(""!==e)return null!=e||(e="datetime"===t?this.formatStyle:"short"),"numeric"===e||"2-digit"===e||"short"===e||"long"===e||"narrow"===e?e:void 0}set month(t){this.setAttribute("month",t||"")}get year(){var t;const e=this.getAttribute("year");return"numeric"===e||"2-digit"===e?e:this.hasAttribute("year")||(new Date).getUTCFullYear()===(null===(t=this.date)||void 0===t?void 0:t.getUTCFullYear())?void 0:"numeric"}set year(t){this.setAttribute("year",t||"")}get timeZoneName(){const t=this.getAttribute("time-zone-name");if("long"===t||"short"===t||"shortOffset"===t||"longOffset"===t||"shortGeneric"===t||"longGeneric"===t)return t}set timeZoneName(t){this.setAttribute("time-zone-name",t||"")}get prefix(){var t;return null!==(t=this.getAttribute("prefix"))&&void 0!==t?t:"datetime"===this.format?"":"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&(e=t,xn.test(e))?t:"P30D";var e}set threshold(t){this.setAttribute("threshold",t)}get tense(){const t=this.getAttribute("tense");return"past"===t?"past":"future"===t?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){const t=this.getAttribute("precision");return Mn.includes(t)?t:"micro"===this.format?"minute":"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return"datetime"===t?"datetime":"relative"===t?"relative":"duration"===t?"duration":"micro"===t?"micro":"elapsed"===t?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get formatStyle(){const t=this.getAttribute("format-style");if("long"===t)return"long";if("short"===t)return"short";if("narrow"===t)return"narrow";const e=this.format;return"elapsed"===e||"micro"===e?"narrow":"datetime"===e?"short":"long"}set formatStyle(t){this.setAttribute("format-style",t)}get noTitle(){return this.hasAttribute("no-title")}set noTitle(t){this.toggleAttribute("no-title",t)}get datetime(){return this.getAttribute("datetime")||""}set datetime(t){this.setAttribute("datetime",t)}get date(){const t=Date.parse(this.datetime);return Number.isNaN(t)?null:new Date(t)}set date(t){this.datetime=(null==t?void 0:t.toISOString())||""}connectedCallback(){this.update()}disconnectedCallback(){is.unobserve(this)}attributeChangedCallback(t,e,i){e!==i&&("title"===t&&Gn(this,On,null!==i&&(this.date&&Yn(this,Nn,"m",qn).call(this,this.date))!==i,"f"),Yn(this,Fn,"f")||"title"===t&&Yn(this,On,"f")||Gn(this,Fn,(async()=>{await Promise.resolve(),this.update(),Gn(this,Fn,!1,"f")})(),"f"))}update(){const t=Yn(this,Vn,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let i=e;const n=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!n)return void(Yn(this,Vn,"f").textContent=t);const s=Date.now();Yn(this,On,"f")||(i=Yn(this,Nn,"m",qn).call(this,n)||"",i&&!this.noTitle&&this.setAttribute("title",i));const o=function(t,e="second",i=Date.now()){const n=t.getTime()-i;if(0===n)return new In;const s=Math.sign(n),o=Math.abs(n),r=Math.floor(o/1e3),a=Math.floor(r/60),l=Math.floor(a/60),c=Math.floor(l/24),d=Math.floor(c/30),h=Math.floor(d/12),u=Mn.indexOf(e)||Mn.length;return new In(u>=0?h*s:0,u>=1?(d-12*h)*s:0,0,u>=3?(c-30*d)*s:0,u>=4?(l-24*c)*s:0,u>=5?(a-60*l)*s:0,u>=6?(r-60*a)*s:0,u>=7?(o-1e3*r)*s:0)}(n,this.precision,s),r=Yn(this,Nn,"m",Rn).call(this,o);let a=t;const l=Yn(this,Nn,"m",zn).call(this,r);a=l?Yn(this,Nn,"m",jn).call(this,n):"duration"===r?Yn(this,Nn,"m",Wn).call(this,o):"relative"===r?Yn(this,Nn,"m",Bn).call(this,o):Yn(this,Nn,"m",$n).call(this,n),a?Yn(this,Nn,"m",Kn).call(this,a):this.shadowRoot===Yn(this,Vn,"f")&&this.textContent&&Yn(this,Nn,"m",Kn).call(this,this.textContent),a===t&&i===e||this.dispatchEvent(new ts(t,a,e,i));"relative"===r||"duration"===r||l&&(Yn(this,Nn,"m",Un).call(this,n)||Yn(this,Nn,"m",_n).call(this,n))?is.observe(this):is.unobserve(this)}}On=new WeakMap,Fn=new WeakMap,Vn=new WeakMap,Zn=new WeakMap,Nn=new WeakSet,Hn=function(){var t;const e=(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang");try{return new Intl.Locale(null!=e?e:"").toString()}catch(t){return"default"}},qn=function(t){return new Intl.DateTimeFormat(Yn(this,Nn,"a",Hn),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short",timeZone:this.timeZone}).format(t)},Rn=function(t){const e=this.format;if("datetime"===e)return"datetime";if("duration"===e)return"duration";if("elapsed"===e)return"duration";if("micro"===e)return"duration";if(("auto"===e||"relative"===e)&&"undefined"!=typeof Intl&&Intl.RelativeTimeFormat){const e=this.tense;if("past"===e||"future"===e)return"relative";if(1===In.compare(t,this.threshold))return"relative"}return"datetime"},Wn=function(t){const e=Yn(this,Nn,"a",Hn),i=this.format,n=this.formatStyle,s=this.tense;let o=Jn;"micro"===i?(t=Pn(t),o=Qn,0===t.months&&("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=Qn)):("past"===s&&-1!==t.sign||"future"===s&&1!==t.sign)&&(t=o);const r=`${this.precision}sDisplay`;return t.blank?o.toLocaleString(e,{style:n,[r]:"always"}):t.abs().toLocaleString(e,{style:n})},Bn=function(t){const e=new Intl.RelativeTimeFormat(Yn(this,Nn,"a",Hn),{numeric:"auto",style:this.formatStyle}),i=this.tense;"future"===i&&1!==t.sign&&(t=Jn),"past"===i&&-1!==t.sign&&(t=Jn);const[n,s]=function(t,e){const i=Pn(t,e);if(i.blank)return[0,"second"];for(const t of Mn){if("millisecond"===t)continue;const e=i[`${t}s`];if(e)return[e,t]}return[0,"second"]}(t);return"second"===s&&n<10?e.format(0,"millisecond"===this.precision?"second":this.precision):e.format(n,s)},$n=function(t){const e=new Intl.DateTimeFormat(Yn(this,Nn,"a",Hn),{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName,timeZone:this.timeZone});return`${this.prefix} ${e.format(t)}`.trim()},Un=function(t){const e=new Date,i=new Intl.DateTimeFormat(Yn(this,Nn,"a",Hn),{timeZone:this.timeZone,year:"numeric",month:"2-digit",day:"2-digit"});return i.format(e)===i.format(t)},_n=function(t){const e=new Date,i=new Intl.DateTimeFormat(Yn(this,Nn,"a",Hn),{timeZone:this.timeZone,year:"numeric"});return i.format(e)===i.format(t)},jn=function(t){const e={hour:"numeric",minute:"2-digit",timeZoneName:"short",timeZone:this.timeZone};if(Yn(this,Nn,"m",Un).call(this,t)){let i=new Intl.RelativeTimeFormat(Yn(this,Nn,"a",Hn),{numeric:"auto"}).format(0,"day");i=i.charAt(0).toLocaleUpperCase(Yn(this,Nn,"a",Hn))+i.slice(1);return`${i} ${new Intl.DateTimeFormat(Yn(this,Nn,"a",Hn),e).format(t)}`}const i=Object.assign(Object.assign({},e),{day:"numeric",month:"short"});return Yn(this,Nn,"m",_n).call(this,t)?new Intl.DateTimeFormat(Yn(this,Nn,"a",Hn),i).format(t):new Intl.DateTimeFormat(Yn(this,Nn,"a",Hn),Object.assign(Object.assign({},i),{year:"numeric"})).format(t)},Kn=function(t){if(this.hasAttribute("aria-hidden")&&"true"===this.getAttribute("aria-hidden")){const e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.textContent=t,Yn(this,Vn,"f").replaceChildren(e)}else Yn(this,Vn,"f").textContent=t},zn=function(t){var e;return"duration"!==t&&("true"===this.ownerDocument.documentElement.getAttribute("data-prefers-absolute-time")||"true"===(null===(e=this.ownerDocument.body)||void 0===e?void 0:e.getAttribute("data-prefers-absolute-time")))};const ns="undefined"!=typeof globalThis?globalThis:window;try{ns.RelativeTimeElement=RelativeTimeElement.define()}catch(t){if(!(ns.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}var ss,os,rs,as,ls=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i},cs=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},ds=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const hs=globalThis.HTMLElement||null;function us(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter(e=>e instanceof hs&&e.closest(t.tagName)===t)}class ms extends Event{constructor(t,e){var{tab:i,panel:n}=e;super(t,ds(e,["tab","panel"])),ss.set(this,null),os.set(this,null),ls(this,os,i||null,"f"),ls(this,ss,n||null,"f")}get detail(){return console.warn("TabContainerElement.detail is deprecated, please use .panel instead"),{relatedTarget:cs(this,ss,"f")}}get panel(){return cs(this,ss,"f")}get tab(){return cs(this,os,"f")}}ss=new WeakMap,os=new WeakMap;class TabContainerElement extends hs{constructor(){super(...arguments),rs.set(this,null),as.set(this,null)}static define(t="tab-container",e=customElements){return e.define(t,this),this}get onTabContainerChange(){return cs(this,rs,"f")}set onTabContainerChange(t){cs(this,rs,"f")&&this.removeEventListener("tab-container-change",cs(this,rs,"f")),ls(this,rs,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("tab-container-change",t)}get onTabContainerChanged(){return cs(this,as,"f")}set onTabContainerChanged(t){cs(this,as,"f")&&this.removeEventListener("tab-container-changed",cs(this,as,"f")),ls(this,as,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("tab-container-changed",t)}connectedCallback(){this.addEventListener("keydown",t=>{var e;const i=t.target;if(!(i instanceof hs))return;if(i.closest(this.tagName)!==this)return;if("tab"!==i.getAttribute("role")&&!i.closest('[role="tablist"]'))return;const n=us(this),s=n.indexOf(n.find(t=>t.matches('[aria-selected="true"]'))),[o,r]="vertical"===(null===(e=i.closest('[role="tablist"]'))||void 0===e?void 0:e.getAttribute("aria-orientation"))?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(o.some(e=>t.code===e)){let t=s+1;t>=n.length&&(t=0),this.selectTab(t)}else if(r.some(e=>t.code===e)){let t=s-1;t<0&&(t=n.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(n.length-1),t.preventDefault())}),this.addEventListener("click",t=>{const e=us(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const i=t.target.closest('[role="tab"]');if(!(i instanceof hs&&i.closest('[role="tablist"]')))return;const n=e.indexOf(i);this.selectTab(n)});for(const t of us(this))t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.hasAttribute("tabindex")||("true"===t.getAttribute("aria-selected")?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"))}selectTab(t){const e=us(this),i=Array.from(this.querySelectorAll('[role="tabpanel"]')).filter(t=>t.closest(this.tagName)===this);if(t>e.length-1)throw new RangeError(`Index "${t}" out of bounds`);const n=e[t],s=i[t];if(!!this.dispatchEvent(new ms("tab-container-change",{bubbles:!0,cancelable:!0,tab:n,panel:s}))){for(const t of e)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of i)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0"),n.focus(),s.hidden=!1,this.dispatchEvent(new ms("tab-container-changed",{bubbles:!0,tab:n,panel:s}))}}}rs=new WeakMap,as=new WeakMap;const fs="undefined"!=typeof globalThis?globalThis:window;try{fs.TabContainerElement=TabContainerElement.define()}catch(t){if(!(fs.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}let ps=class PrimerMultiInputElement extends HTMLElement{activateField(t){const e=this.findField(t);if(e){for(const t of this.fields)t!==e&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),t.parentElement?.setAttribute("hidden","hidden"));e.removeAttribute("disabled"),e.removeAttribute("hidden"),e.parentElement?.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function gs(t,e=0,{start:i=!1,middle:n=!1,once:s=!1}={}){return function(t,e=0,{start:i=!0,middle:n=!0,once:s=!1}={}){let o,r=i,a=0,l=!1;function c(...d){if(l)return;const h=Date.now()-a;a=Date.now(),i&&n&&h>=e&&(r=!0),r?(r=!1,t.apply(this,d),s&&c.cancel()):(n&&h<e||!n)&&(clearTimeout(o),o=setTimeout(()=>{a=Date.now(),t.apply(this,d),s&&c.cancel()},n?e-h:e))}return c.cancel=()=>{clearTimeout(o),l=!0},c}(t,e,{start:i,middle:n,once:s})}g([j],ps.prototype,"fields",void 0),ps=g([K("primer-multi-input")],ps),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:ps}),window.customElements.define("primer-multi-input",ps));var bs,vs,ws=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},ys=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i};!function(t){t.GET="GET",t.POST="POST"}(vs||(vs={}));const Es=new WeakMap;class As extends Event{constructor(t){super(`auto-check-${t}`,{bubbles:!0}),this.phase=t}get detail(){return this}}class ks extends As{constructor(t,e=""){super(t),this.phase=t,this.message=e,this.setValidity=t=>{this.message=t}}}class Ls extends As{constructor(){super("complete")}}class Ts extends As{constructor(t){super("success"),this.response=t}}class Ss extends ks{constructor(){super("start","Verifying…")}}class Cs extends ks{constructor(t){super("error","Validation failed"),this.response=t}}class xs extends As{constructor(t){super("send"),this.body=t}}class AutoCheckElement extends HTMLElement{constructor(){super(...arguments),bs.set(this,null)}static define(t="auto-check",e=customElements){return e.define(t,this),this}get onloadend(){return ws(this,bs,"f")}set onloadend(t){ws(this,bs,"f")&&this.removeEventListener("loadend",ws(this,bs,"f")),ys(this,bs,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("loadend",t)}connectedCallback(){const t=this.input;if(!t)return;const e=gs(Ds.bind(null,this),300),i={check:e,controller:null};Es.set(this,i);const n=Ms.bind(null,e);t.addEventListener("blur",n),t.addEventListener("input",n),t.addEventListener("triggervalidation",n),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=Es.get(this);e&&(Es.delete(this),t.removeEventListener("input",Is),t.removeEventListener("input",e.check),t.setCustomValidity(""))}attributeChangedCallback(t){if("required"===t){const t=this.input;if(!t)return;t.required=this.required}}triggerValidation(){const t=this.input;t&&t.dispatchEvent(new CustomEvent("triggervalidation"))}static get observedAttributes(){return["required"]}get input(){return this.querySelector("input")}get src(){const t=this.getAttribute("src");if(!t)return"";const e=this.ownerDocument.createElement("a");return e.href=t,e.href}set src(t){this.setAttribute("src",t)}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||""}set csrf(t){this.setAttribute("csrf",t)}get required(){return this.hasAttribute("required")}set required(t){t?this.setAttribute("required",""):this.removeAttribute("required")}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}set csrfField(t){this.setAttribute("csrf-field",t)}get httpMethod(){return vs[this.getAttribute("http-method")]||"POST"}set validateOnKeystroke(t){t?this.setAttribute("validate-on-keystroke",""):this.removeAttribute("validate-on-keystroke")}get validateOnKeystroke(){const t=this.getAttribute("validate-on-keystroke");return"true"===t||""===t}}function Ms(t,e){const i=e.currentTarget;if(!(i instanceof HTMLInputElement))return;const n=i.closest("auto-check");n instanceof AutoCheckElement&&("input"===e.type&&n.setAttribute("dirty",""),0!==i.value.length&&("blur"===e.type&&!n.validateOnKeystroke&&n.hasAttribute("dirty")||"input"===e.type&&n.validateOnKeystroke||"triggervalidation"===e.type)&&(Is(e),t()))}function Is(t){const e=t.currentTarget;if(!(e instanceof HTMLInputElement))return;const i=e.closest("auto-check");if(!(i instanceof AutoCheckElement))return;const n=i.src,s=i.csrf,o=i.httpMethod,r=Es.get(i);if(!n||"POST"===o&&!s||!r)return;const a=new Ss;e.dispatchEvent(a),i.required&&e.setCustomValidity(a.message)}async function Ds(t){const e=t.input;if(!e)return;const i=t.csrfField,n=t.src,s=t.csrf,o=Es.get(t),r=t.httpMethod;if(!n||"POST"===r&&!s||!o)return void(t.required&&e.setCustomValidity(""));if(!e.value.trim())return void(t.required&&e.setCustomValidity(""));const a=new FormData,l=new URL(n,window.location.origin);"POST"===r?(a.append(i,s),a.append("value",e.value)):l.search=new URLSearchParams({value:e.value}).toString(),e.dispatchEvent(new xs(a)),o.controller?o.controller.abort():t.dispatchEvent(new Event("loadstart")),o.controller="AbortController"in window?new AbortController:{signal:null,abort(){}},t.removeAttribute("dirty");try{const i=await async function(t,e,i){"GET"===i.method&&delete i.body;try{const n=await fetch(e,i);return t.dispatchEvent(new Event("load")),t.dispatchEvent(new Event("loadend")),n}catch(e){throw"AbortError"!==e.name&&(t.dispatchEvent(new Event("error")),t.dispatchEvent(new Event("loadend"))),e}}(t,l.toString(),{credentials:"same-origin",signal:o.controller.signal,method:r,body:a});if(i.ok)t.required&&e.setCustomValidity(""),t.validateOnKeystroke=!1,e.dispatchEvent(new Ts(i.clone()));else{t.validateOnKeystroke=!0;const n=new Cs(i.clone());e.dispatchEvent(n),t.required&&e.setCustomValidity(n.message)}o.controller=null,e.dispatchEvent(new Ls)}catch(t){"AbortError"!==t.name&&(o.controller=null,e.dispatchEvent(new Ls))}}bs=new WeakMap;const Ps="undefined"!=typeof globalThis?globalThis:window;try{Ps.AutoCheckElement=AutoCheckElement.define()}catch(t){if(!(Ps.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}class Ns{constructor(t,e,i){this.inputElement=t,this.characterLimitElement=e,this.characterLimitSrElement=i,this.SCREEN_READER_DELAY=500,this.announceTimeout=null,this.isInitialLoad=!0}initialize(t){this.inputElement.addEventListener("keyup",()=>this.updateCharacterCount(),t?{signal:t}:void 0),this.inputElement.addEventListener("paste",()=>setTimeout(()=>this.updateCharacterCount(),50),t?{signal:t}:void 0),this.updateCharacterCount(),this.isInitialLoad=!1}cleanup(){this.announceTimeout&&clearTimeout(this.announceTimeout)}pluralize(t,e){return 1===t?e:`${e}s`}updateCharacterCount(){if(!this.characterLimitElement)return;const t=this.characterLimitElement.getAttribute("data-max-length");if(!t)return;const e=parseInt(t,10)-this.inputElement.value.length;let i="";if(e>=0){i=`${e} ${this.pluralize(e,"character")} remaining`;const t=this.characterLimitElement.querySelector(".FormControl-caption-text");t&&(t.textContent=i),this.clearError()}else{const t=-e;i=`${t} ${this.pluralize(t,"character")} over`;const n=this.characterLimitElement.querySelector(".FormControl-caption-text");n&&(n.textContent=i),this.setError()}this.isInitialLoad||this.announceToScreenReader(i)}announceToScreenReader(t){this.announceTimeout&&clearTimeout(this.announceTimeout),this.announceTimeout=window.setTimeout(()=>{this.characterLimitSrElement&&(this.characterLimitSrElement.textContent=t)},this.SCREEN_READER_DELAY)}setError(){this.inputElement.setAttribute("invalid","true"),this.inputElement.setAttribute("aria-invalid","true"),this.characterLimitElement.classList.add("fgColor-danger");const t=this.characterLimitElement.querySelector(".FormControl-caption-icon");t&&t.removeAttribute("hidden")}clearError(){this.inputElement.removeAttribute("invalid"),this.inputElement.removeAttribute("aria-invalid"),this.characterLimitElement.classList.remove("fgColor-danger");const t=this.characterLimitElement.querySelector(".FormControl-caption-icon");t&&t.setAttribute("hidden","")}}var Os,Fs;let Hs=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),Os.set(this,void 0),Fs.set(this,null)}connectedCallback(){b(this,Os,"f")?.abort();const{signal:t}=v(this,Os,new AbortController,"f");this.addEventListener("auto-check-success",async t=>{const e=await t.detail.response.text();e&&e.length>0?this.setSuccess(e):this.clearError()},{signal:t}),this.addEventListener("auto-check-error",async t=>{const e=await t.detail.response.text();this.setError(e)},{signal:t}),this.characterLimitElement&&(v(this,Fs,new Ns(this.inputElement,this.characterLimitElement,this.characterLimitSrElement),"f"),b(this,Fs,"f").initialize(t))}disconnectedCallback(){b(this,Os,"f")?.abort(),b(this,Fs,"f")?.cleanup()}clearContents(){this.inputElement.value="",this.inputElement.focus(),this.inputElement.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!1}))}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.replaceChildren()}setValidationMessage(t){const e=document.createElement("template");e.innerHTML=t;const i=document.importNode(e.content,!0);this.validationMessageElement.replaceChildren(i)}toggleValidationStyling(t){t?this.validationElement.classList.remove("FormControl-inlineValidation--success"):this.validationElement.classList.add("FormControl-inlineValidation--success"),this.validationSuccessIcon.hidden=t,this.validationErrorIcon.hidden=!t,this.inputElement.setAttribute("invalid",t?"true":"false")}setSuccess(t){this.toggleValidationStyling(!1),this.setValidationMessage(t),this.validationElement.hidden=!1}setError(t){this.toggleValidationStyling(!0),this.setValidationMessage(t),this.validationElement.hidden=!1}showLeadingSpinner(){this.leadingSpinner?.removeAttribute("hidden"),this.leadingVisual?.setAttribute("hidden","")}hideLeadingSpinner(){this.leadingSpinner?.setAttribute("hidden",""),this.leadingVisual?.removeAttribute("hidden")}};var Vs;Os=new WeakMap,Fs=new WeakMap,g([_],Hs.prototype,"inputElement",void 0),g([_],Hs.prototype,"validationElement",void 0),g([_],Hs.prototype,"validationMessageElement",void 0),g([_],Hs.prototype,"validationSuccessIcon",void 0),g([_],Hs.prototype,"validationErrorIcon",void 0),g([_],Hs.prototype,"leadingVisual",void 0),g([_],Hs.prototype,"leadingSpinner",void 0),g([_],Hs.prototype,"characterLimitElement",void 0),g([_],Hs.prototype,"characterLimitSrElement",void 0),Hs=g([K("primer-text-field")],Hs);let qs=class PrimerTextAreaElement extends HTMLElement{constructor(){super(...arguments),Vs.set(this,null)}connectedCallback(){this.characterLimitElement&&(v(this,Vs,new Ns(this.inputElement,this.characterLimitElement,this.characterLimitSrElement),"f"),b(this,Vs,"f").initialize())}disconnectedCallback(){b(this,Vs,"f")?.cleanup()}};Vs=new WeakMap,g([_],qs.prototype,"inputElement",void 0),g([_],qs.prototype,"characterLimitElement",void 0),g([_],qs.prototype,"characterLimitSrElement",void 0),qs=g([K("primer-text-area")],qs),window.customElements.get("primer-text-area")||(Object.assign(window,{PrimerTextAreaElement:qs}),window.customElements.define("primer-text-area",qs));let Rs=class ToggleSwitchInputElement extends HTMLElement{connectedCallback(){this.addEventListener("toggleSwitchError",t=>{this.validationMessageElement.textContent=t.detail,this.validationElement.removeAttribute("hidden")}),this.addEventListener("toggleSwitchSuccess",()=>{this.validationMessageElement.textContent="",this.validationElement.setAttribute("hidden","hidden")}),this.addEventListener("toggleSwitchLoading",()=>{this.validationMessageElement.textContent="",this.validationElement.setAttribute("hidden","hidden")})}};var Ws,Bs,$s,Us,_s,js,Ks,zs,Zs,Ys,Gs,Xs,Js,Qs,to,eo,io,no,so,oo,ro,ao,lo,co,ho,uo,mo,fo,po,go,bo,vo,wo;g([_],Rs.prototype,"validationElement",void 0),g([_],Rs.prototype,"validationMessageElement",void 0),Rs=g([K("toggle-switch-input")],Rs);class yo{constructor(){Ws.add(this),Bs.set(this,void 0),v(this,Bs,[],"f")}get current(){return b(this,Bs,"f")[b(this,Bs,"f").length-1]}push(t,e={trapFocus:!0}){const{trapFocus:i}=e;b(this,Bs,"f").push({element:t,abortController:b(this,Ws,"m",$s).call(this,t,i)})}pop(t){if(t)for(;b(this,Bs,"f").length>0&&this.current?.element!==t;){const t=b(this,Bs,"f").pop();t?.abortController?.abort()}const e=b(this,Bs,"f").pop();e?.abortController?.abort()}elementIsMenuItem(t){return b(this,Ws,"a",Us).includes(t.getAttribute("role")||"")}get isEmpty(){return 0===b(this,Bs,"f").length}}Bs=new WeakMap,Ws=new WeakSet,$s=function(t,e){const i=Ct(t,{bindKeys:yt.ArrowVertical|yt.ArrowHorizontal|yt.HomeAndEnd|yt.Backspace,focusOutBehavior:"wrap",focusableElementFilter:e=>this.elementIsMenuItem(e)&&e.closest("anchored-position")===t});if(e){const{signal:e}=i;return ft(t,void 0,e)}return i},Us=function(){return Eo.validItemRoles};let Eo=wo=class ActionMenuElement extends HTMLElement{constructor(){super(...arguments),_s.add(this),js.set(this,void 0),Ks.set(this,""),zs.set(this,""),Zs.set(this,!1),Ys.set(this,void 0),Gs.set(this,void 0)}get selectVariant(){return this.getAttribute("data-select-variant")}set selectVariant(t){t?this.setAttribute("data-select-variant",t):this.removeAttribute("variant")}get dynamicLabelPrefix(){const t=this.getAttribute("data-dynamic-label-prefix");return t?`${t}:`:""}set dynamicLabelPrefix(t){this.setAttribute("data-dynamic-label",t)}get dynamicLabel(){return this.hasAttribute("data-dynamic-label")}set dynamicLabel(t){this.toggleAttribute("data-dynamic-label",t)}get popoverElement(){return this.invokerElement?.popoverTargetElement||null}get childPopoverElements(){return Array.from(this.overlay.querySelectorAll("anchored-position"))}get invokerElement(){const t=this.querySelector("[role=menu]")?.id;if(!t)return null;for(const e of this.querySelectorAll("[aria-controls]"))if(e.getAttribute("aria-controls")===t)return e;return null}get invokerLabel(){return this.invokerElement?this.invokerElement.querySelector(".Button-label"):null}get selectedItems(){const t=this.querySelectorAll("[aria-checked=true]"),e=[];for(const i of t){const t=i.querySelector(".ActionListItem-label");e.push({label:t?.textContent,value:i?.getAttribute("data-value"),element:i})}return e}connectedCallback(){const{signal:t}=v(this,js,new AbortController,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusout",this,{signal:t}),this.addEventListener("mousedown",this,{signal:t}),this.addEventListener("toggle",this,{signal:t,capture:!0}),b(this,_s,"m",fo).call(this),b(this,_s,"m",po).call(this),b(this,_s,"m",Js).call(this),this.includeFragment&&this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t});const e=()=>{b(this,_s,"m",mo).call(this)&&this.overlay?.update()};v(this,Ys,new IntersectionObserver(t=>{for(const i of t){i.target===this.invokerElement&&(i.isIntersecting?window.addEventListener("scroll",e,{capture:!0}):window.removeEventListener("scroll",e,{capture:!0}))}}),"f"),ze(this,()=>Boolean(this.invokerElement),()=>b(this,Ys,"f").observe(this.invokerElement)),this.includeFragment||this.setAttribute("data-ready","true");new MutationObserver(()=>b(this,_s,"m",Xs).call(this)).observe(this,{childList:!0,subtree:!0}),b(this,_s,"m",Xs).call(this),v(this,Gs,new yo,"f")}disconnectedCallback(){b(this,js,"f").abort()}handleEvent(t){const e=this.invokerElement?.contains(t.target),i=b(this,_s,"m",io).call(this,t);if("toggle"===t.type&&t instanceof ToggleEvent)return void b(this,_s,"m",so).call(this,t);if(e&&"mousedown"===t.type)return void v(this,Zs,!0,"f");if("mousedown"===t.type)return void t.preventDefault();if(e&&i)return b(this,_s,"m",oo).call(this,t),void v(this,Zs,!1,"f");if("focusout"===t.type){if(b(this,Zs,"f"))return;return void requestAnimationFrame(()=>{this.contains(document.activeElement)&&document.activeElement!==this.invokerElement||b(this,_s,"m",co).call(this)})}const n=t.target.closest(wo.menuItemSelectors.join(",")),s=null!==n;if(s&&i){if(b(this,_s,"m",Qs).call(this,t))return;const e=n.closest("[data-show-dialog-id]");if(e){const i=this.ownerDocument.getElementById(e.getAttribute("data-show-dialog-id")||"");if(i&&this.contains(e))return void b(this,_s,"m",ro).call(this,t,i)}b(this,_s,"m",to).call(this,t)&&(t.preventDefault(),n.click());const i=b(this,_s,"m",bo).call(this,n);return i?(t.preventDefault(),void i.showPopover()):void b(this,_s,"m",ao).call(this,n)}"include-fragment-replaced"!==t.type?s&&t instanceof KeyboardEvent&&b(this,_s,"m",no).call(this,t,n):b(this,_s,"m",lo).call(this)}get items(){return Array.from(this.querySelectorAll(wo.menuItemSelectors.join(",")))}getItemById(t){return this.querySelector(`li[data-item-id="${t}"`)}isItemDisabled(t){return!!t&&t.classList.contains("ActionListItem--disabled")}disableItem(t){t&&(t.classList.add("ActionListItem--disabled"),t.querySelector(".ActionListContent").setAttribute("aria-disabled","true"))}enableItem(t){t&&(t.classList.remove("ActionListItem--disabled"),t.querySelector(".ActionListContent").removeAttribute("aria-disabled"))}isItemHidden(t){return!!t&&t.hasAttribute("hidden")}hideItem(t){t&&t.setAttribute("hidden","hidden")}showItem(t){t&&t.removeAttribute("hidden")}isItemChecked(t){return!!t&&"true"===t.querySelector(".ActionListContent").getAttribute("aria-checked")}checkItem(t){if(t&&("single"===this.selectVariant||"multiple"===this.selectVariant)){const e=t.querySelector(".ActionListContent");"true"===e.getAttribute("aria-checked")||b(this,_s,"m",ao).call(this,e)}}uncheckItem(t){if(t&&("single"===this.selectVariant||"multiple"===this.selectVariant)){const e=t.querySelector(".ActionListContent");"true"===e.getAttribute("aria-checked")&&b(this,_s,"m",ao).call(this,e)}}};js=new WeakMap,Ks=new WeakMap,zs=new WeakMap,Zs=new WeakMap,Ys=new WeakMap,Gs=new WeakMap,_s=new WeakSet,Xs=function(){let t=1;for(const e of this.querySelectorAll("[role=menu]"))e.setAttribute("data-level",t.toString()),t++},Js=function(){const{signal:t}=b(this,js,"f");for(const e of this.querySelectorAll(wo.validSelectors.join(",")))e.addEventListener("click",b(this,_s,"m",Qs).bind(this),{signal:t}),e.addEventListener("keydown",b(this,_s,"m",Qs).bind(this),{signal:t})},Qs=function(t){if(!b(this,_s,"m",io).call(this,t))return!1;const e=t.target.closest(wo.menuItemSelectors.join(","));return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},to=function(t){return t.target instanceof HTMLAnchorElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},eo=function(t){return t.target instanceof ClipboardCopyElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&(" "===t.key||"Enter"===t.key)},io=function(t){return t instanceof MouseEvent&&"click"===t.type||b(this,_s,"m",to).call(this,t)||b(this,_s,"m",eo).call(this,t)},no=function(t,e){switch(t.key){case"ArrowRight":{const t=b(this,_s,"m",bo).call(this,e);t?.showPopover();break}case"ArrowLeft":if(e.closest("role[menu]")!==this.list){const t=e.closest("anchored-position");t?.hidePopover()}}},so=function(t){const e=t.target;if("open"===t.newState){const t=e===this.overlay;b(this,Gs,"f").push(e,{trapFocus:!t}),window.requestAnimationFrame(()=>{const t=e.querySelector(wo.menuItemSelectors.join(","));t?.focus()})}else{b(this,Gs,"f").pop(e);const t=b(this,_s,"m",vo).call(this,e),i=document.querySelector(":popover-open");t&&!i&&t.focus()}},oo=function(t){t.preventDefault(),t.stopPropagation(),b(this,_s,"m",mo).call(this)?b(this,_s,"m",uo).call(this):b(this,_s,"m",ho).call(this)},ro=function(t,e){this.contains(e)&&(this.querySelector(".ActionListWrap").style.display="none");const i=new AbortController,{signal:n}=i,s=()=>{i.abort(),this.contains(e)&&(this.querySelector(".ActionListWrap").style.display="",b(this,_s,"m",mo).call(this)&&b(this,_s,"m",uo).call(this));const t=this.ownerDocument.activeElement,n=this.ownerDocument.activeElement===this.ownerDocument.body,s=this.contains(t),o=e.contains(t);(n||s||o)&&setTimeout(()=>{const e=this.ownerDocument.activeElement;e!==t&&e!==this.ownerDocument.body||this.invokerElement?.focus()},0)};e.addEventListener("close",s,{signal:n}),e.addEventListener("cancel",s,{signal:n})},ao=function(t){if("multiple"!==this.selectVariant&&setTimeout(()=>{b(this,_s,"m",mo).call(this)&&b(this,_s,"m",uo).call(this)}),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e="true"!==t.getAttribute("aria-checked");if("single"===this.selectVariant){e&&t.setAttribute("aria-checked","true");for(const e of this.querySelectorAll("[aria-checked]"))e!==t&&e.setAttribute("aria-checked","false");b(this,_s,"m",fo).call(this)}else t.setAttribute("aria-checked",`${e}`);b(this,_s,"m",po).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:t.parentElement,checked:this.isItemChecked(t.parentElement)}}))},lo=function(){b(this,_s,"a",go)?.focus(),b(this,_s,"m",Js).call(this),this.setAttribute("data-ready","true")},co=function(){b(this,_s,"m",uo).call(this)},ho=function(){this.popoverElement?.showPopover()},uo=function(){this.popoverElement?.hidePopover();for(const t of this.childPopoverElements)t.hidePopover()},mo=function(){return this.popoverElement?.matches(":popover-open")},fo=function(){if("single"!==this.selectVariant)return;if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;v(this,Ks,b(this,Ks,"f")||t.textContent||"","f");const e=this.querySelector("[aria-checked=true] .ActionListItem-label");if(e&&this.dynamicLabel){const i=document.createElement("span");i.classList.add("color-fg-muted");const n=document.createElement("span");i.textContent=this.dynamicLabelPrefix,n.textContent=e.textContent||"",t.replaceChildren(i,n)}else t.textContent=b(this,Ks,"f")},po=function(){if("single"===this.selectVariant){const t=this.querySelector("[data-list-inputs=true] input");if(!t)return;const e=this.selectedItems[0];e?(t.value=(e.value||e.label||"").trim(),t.removeAttribute("disabled")):t.setAttribute("disabled","disabled")}else if("none"!==this.selectVariant){const t=this.querySelector("[data-list-inputs=true]");if(!t)return;const e=t.querySelectorAll("input");e.length>0&&v(this,zs,b(this,zs,"f")||e[0].name,"f");for(const e of this.selectedItems){const i=document.createElement("input");i.setAttribute("data-list-input","true"),i.type="hidden",i.autocomplete="off",i.name=b(this,zs,"f"),i.value=(e.value||e.label||"").trim(),t.append(i)}for(const t of e)t.remove()}},go=function(){return this.querySelector(wo.menuItemSelectors.join(","))},bo=function(t){const e=t.getAttribute("popovertarget");return e?this.querySelector(`[id="${e}"]`):null},vo=function(t){const e=t.getAttribute("anchor");return e?this.querySelector(`[id="${e}"]`):null},Eo.validItemRoles=["menuitem","menuitemcheckbox","menuitemradio"],Eo.validSelectors=wo.validItemRoles.map(t=>`[role="${t}"]`),Eo.menuItemSelectors=wo.validSelectors.map(t=>`:not([hidden]) > ${t}`),g([_],Eo.prototype,"includeFragment",void 0),g([_],Eo.prototype,"overlay",void 0),g([_],Eo.prototype,"list",void 0),Eo=wo=g([K("action-menu")],Eo),window.customElements.get("action-menu")||(window.ActionMenuElement=Eo,window.customElements.define("action-menu",Eo));const Ao="less",ko="equal",Lo="greater";var To,So,Co,xo,Mo,Io=t=>{throw TypeError(t)},Do=(t,e,i)=>e.has(t)||Io("Cannot "+i),Po=(t,e,i)=>(Do(t,e,"read from private field"),i?i.call(t):e.get(t)),No=(t,e,i)=>e.has(t)?Io("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Oo=(t,e,i,n)=>(Do(t,e,"write to private field"),e.set(t,i),i),Fo=(t,e,i)=>(Do(t,e,"access private method"),i);class Ho{constructor({compareFn:t}){No(this,Co),No(this,To),No(this,So),Oo(this,To,t),Oo(this,So,[])}insert(t){Po(this,So).push(t),Fo(this,Co,Mo).call(this)}pop(){const t=Po(this,So)[0];return Po(this,So)[Po(this,So).length-1]&&(Po(this,So)[0]=Po(this,So)[Po(this,So).length-1],Po(this,So).pop()),Fo(this,Co,xo).call(this),t}peek(){return Po(this,So)[0]}delete(t){const e=Po(this,So).indexOf(t);-1!==e&&(Ko(Po(this,So),e,Po(this,So).length-1),Po(this,So).pop(),Fo(this,Co,xo).call(this))}clear(){Oo(this,So,[])}get size(){return Po(this,So).length}}function Vo(t){return 2*t+1}function qo(t){return 2*t+2}function Ro(t){return Math.floor((t-1)/2)}function Wo(t,e){return Vo(t)<e}function Bo(t,e){return qo(t)<e}function $o(t){return t>0}function Uo(t,e){return t[Vo(e)]}function _o(t,e){return t[qo(e)]}function jo(t,e){return t[Ro(e)]}function Ko(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}To=new WeakMap,So=new WeakMap,Co=new WeakSet,xo=function(){let t=0;for(;Wo(t,Po(this,So).length);){let e=Vo(t);if(Bo(t,Po(this,So).length)&&Po(this,To).call(this,_o(Po(this,So),t),Uo(Po(this,So),t))===Ao&&(e=qo(t)),Po(this,To).call(this,Po(this,So)[t],Po(this,So)[e])===Ao)break;Ko(Po(this,So),t,e),t=e}},Mo=function(){let t=Po(this,So).length-1;for(;$o(t)&&Po(this,To).call(this,Po(this,So)[t],jo(Po(this,So),t))===Ao;)Ko(Po(this,So),t,Ro(t)),t=Ro(t)};var zo,Zo,Yo,Go,Xo=Object.defineProperty,Jo=t=>{throw TypeError(t)},Qo=(t,e,i)=>((t,e,i)=>e in t?Xo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),tr=(t,e,i)=>e.has(t)||Jo("Cannot "+i),er=(t,e,i)=>(tr(t,e,"read from private field"),i?i.call(t):e.get(t)),ir=(t,e,i)=>e.has(t)?Jo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),nr=(t,e,i,n)=>(tr(t,e,"write to private field"),e.set(t,i),i);zo=Symbol.toStringTag;class sr{constructor(){Qo(this,zo,"Deferred"),ir(this,Zo),ir(this,Yo),ir(this,Go),nr(this,Zo,new Promise((t,e)=>{nr(this,Yo,t),nr(this,Go,e)}))}then(t,e){return Promise.prototype.then.apply(er(this,Zo),[t,e])}catch(t){return Promise.prototype.catch.apply(er(this,Zo),[t])}finally(t){return Promise.prototype.finally.apply(er(this,Zo),[t])}resolve(t){er(this,Yo).call(this,t)}reject(t){er(this,Go).call(this,t)}getPromise(){return er(this,Zo)}}Zo=new WeakMap,Yo=new WeakMap,Go=new WeakMap;var or,rr,ar,lr,cr,dr,hr=t=>{throw TypeError(t)},ur=(t,e,i)=>e.has(t)||hr("Cannot "+i),mr=(t,e,i)=>(ur(t,e,"read from private field"),i?i.call(t):e.get(t)),fr=(t,e,i)=>e.has(t)?hr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),pr=(t,e,i,n)=>(ur(t,e,"write to private field"),e.set(t,i),i),gr=(t,e,i)=>(ur(t,e,"access private method"),i);class LiveRegionElement extends HTMLElement{constructor(){if(super(),fr(this,lr),fr(this,or),fr(this,rr),fr(this,ar),!this.shadowRoot){const t=function(){if(br)return br;return br=document.createElement("template"),br.innerHTML=vr,br}();this.attachShadow({mode:"open"}).appendChild(t.content.cloneNode(!0))}pr(this,or,!1),pr(this,ar,null),pr(this,rr,new Ho({compareFn:wr}))}get delay(){const t=this.getAttribute("delay");return t?parseInt(t,10):150}set delay(t){this.setAttribute("delay",`${t}`)}announce(t,e={}){const{delayMs:i,politeness:n="polite"}=e,s=Date.now(),o=new sr,r={deferred:o,politeness:n,contents:t,scheduled:void 0!==i?s+i:s};return mr(this,rr).insert(r),gr(this,lr,cr).call(this),{...o.getPromise(),cancel:()=>{mr(this,rr).delete(r),o.resolve()}}}announceFromElement(t,e){const i=function(t){let e="";t.hasAttribute("aria-label")?e=t.getAttribute("aria-label"):t.innerText?e=t.innerText:t.textContent&&(e=t.textContent);return e?e.trim():""}(t);if(""!==i)return this.announce(i,e);return{...Promise.resolve(),cancel:yr}}getMessage(t="polite"){const e=this.shadowRoot?.getElementById(t);if(!e)throw new Error("Unable to find container for message");return e.textContent}clear(){null!==mr(this,ar)&&(clearTimeout(mr(this,ar)),pr(this,ar,null)),pr(this,or,!1),mr(this,rr).clear()}}or=new WeakMap,rr=new WeakMap,ar=new WeakMap,lr=new WeakSet,cr=function(){if(mr(this,or))return;let t=mr(this,rr).peek();if(!t)return;null!==mr(this,ar)&&(clearTimeout(mr(this,ar)),pr(this,ar,null));const e=Date.now();if(t.scheduled<=e)return t=mr(this,rr).pop(),t&&gr(this,lr,dr).call(this,t),void gr(this,lr,cr).call(this);const i=t.scheduled-e;pr(this,ar,window.setTimeout(()=>{pr(this,ar,null),gr(this,lr,cr).call(this)},i))},dr=function(t){pr(this,or,!0);const{contents:e,deferred:i,politeness:n}=t,s=this.shadowRoot?.getElementById(n);if(!s)throw pr(this,or,!1),new Error(`Unable to find container for message. Expected a container with id="${n}"`);s.textContent===e?s.textContent=`${e} `:s.textContent=e,null!==mr(this,ar)&&clearTimeout(mr(this,ar)),i.resolve(),this.delay>0?pr(this,ar,window.setTimeout(()=>{pr(this,ar,null),pr(this,or,!1),gr(this,lr,cr).call(this)},this.delay)):(pr(this,ar,null),pr(this,or,!1),gr(this,lr,cr).call(this))};let br=null;const vr='\n<style>\n:host {\n border: 0;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n</style>\n<div id="polite" aria-live="polite" aria-atomic="true"></div>\n<div id="assertive" aria-live="assertive" aria-atomic="true"></div>\n';function wr(t,e){return t.politeness===e.politeness?t.scheduled===e.scheduled?ko:t.scheduled<e.scheduled?Ao:Lo:"assertive"===t.politeness&&"assertive"!==e.politeness?Ao:"assertive"!==t.politeness&&"assertive"===e.politeness?Lo:ko}function yr(){}var Er,Ar,kr,Lr,Tr,Sr,Cr,xr,Mr,Ir,Dr,Pr,Nr,Or,Fr,Hr,Vr,qr,Rr,Wr,Br,$r,Ur,_r,jr,Kr,zr,Zr,Yr,Gr,Xr,Jr,Qr,ta,ea,ia,na,sa,oa,ra;customElements.get("live-region")||customElements.define("live-region",LiveRegionElement);const aa=['[role="option"]'],la=aa.join(","),ca=aa.map(t=>`:not([hidden]) > ${t}`).join(",");var da,ha;!function(t){t[t.REMOTE=0]="REMOTE",t[t.EVENTUALLY_LOCAL=1]="EVENTUALLY_LOCAL",t[t.LOCAL=2]="LOCAL"}(da||(da={})),function(t){t[t.BODY=0]="BODY",t[t.BANNER=1]="BANNER"}(ha||(ha={}));const ua=(()=>{const t=new Set;let e=null;function i(){for(const e of t)e.updateAnchorPosition()}return n=>{window.addEventListener("resize",i),window.addEventListener("scroll",i),e||(e=new ResizeObserver(()=>{for(const e of t)e.updateAnchorPosition()})),e.observe(n.ownerDocument.documentElement),n.addEventListener("dialog:close",()=>{n.invokerElement?.setAttribute("aria-expanded","false"),t.delete(n)}),n.addEventListener("dialog:open",()=>{t.add(n)})}})();let ma=class SelectPanelElement extends HTMLElement{constructor(){super(...arguments),Er.add(this),Ar.set(this,void 0),kr.set(this,void 0),Lr.set(this,""),Tr.set(this,""),Sr.set(this,new Map),Cr.set(this,null),xr.set(this,null),Mr.set(this,!1)}get open(){return this.dialog.open}get selectVariant(){return this.getAttribute("data-select-variant")}get ariaSelectionType(){return"aria-selected"}set selectVariant(t){t?this.setAttribute("data-select-variant",t):this.removeAttribute("variant")}get dynamicLabelPrefix(){const t=this.getAttribute("data-dynamic-label-prefix");return t?`${t}:`:""}get dynamicAriaLabelPrefix(){const t=this.getAttribute("data-dynamic-aria-label-prefix");return t?`${t}:`:""}set dynamicLabelPrefix(t){this.setAttribute("data-dynamic-label",t)}get dynamicLabel(){return this.hasAttribute("data-dynamic-label")}set dynamicLabel(t){this.toggleAttribute("data-dynamic-label",t)}get invokerElement(){const t=this.querySelector("dialog")?.id;if(!t)return null;for(const e of this.querySelectorAll("[aria-controls]"))if(e.getAttribute("aria-controls")===t)return e;return null}get closeButton(){return this.querySelector("button[data-close-dialog-id]")}get invokerLabel(){return this.invokerElement?this.invokerElement.querySelector(".Button-label"):null}get selectedItems(){return Array.from(b(this,Sr,"f").values())}get align(){return this.getAttribute("anchor-align")||"start"}get side(){return this.getAttribute("anchor-side")||"outside-bottom"}updateAnchorPosition(){if(this&&null===this.offsetParent&&this.hide(),this.invokerElement){const{top:t,left:e}=J(this.dialog,this.invokerElement,{align:this.align,side:this.side,anchorOffset:4});this.dialog.style.top=`${t}px`,this.dialog.style.left=`${e}px`,this.dialog.style.bottom="auto",this.dialog.style.right="auto"}}connectedCallback(){const{signal:t}=v(this,kr,new AbortController,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mousedown",this,{signal:t}),this.addEventListener("input",this,{signal:t}),this.addEventListener("remote-input-success",this,{signal:t}),this.addEventListener("remote-input-error",this,{signal:t}),this.addEventListener("loadstart",this,{signal:t}),b(this,Er,"m",ea).call(this),b(this,Er,"m",ia).call(this),b(this,Er,"m",Ir).call(this),ua(this),ze(this,()=>Boolean(this.remoteInput),()=>{this.remoteInput.addEventListener("loadstart",this,{signal:t}),this.remoteInput.addEventListener("loadend",this,{signal:t})}),ze(this,()=>Boolean(this.includeFragment),()=>{this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t}),this.includeFragment.addEventListener("error",this,{signal:t}),this.includeFragment.addEventListener("loadend",this,{signal:t})}),v(this,Ar,new IntersectionObserver(t=>{for(const e of t){const t=e.target;e.isIntersecting&&t===this.dialog&&(this.filterInputTextField&&document.activeElement!==this.filterInputTextField&&this.filterInputTextField.focus(),this.dialog.setAttribute("data-ready","true"),this.updateAnchorPosition(),b(this,Er,"a",Yr)===da.LOCAL&&b(this,Er,"m",_r).call(this))}}),"f"),ze(this,()=>Boolean(this.dialog),()=>{b(this,Ar,"f").observe(this.dialog),this.dialog.addEventListener("close",this,{signal:t}),"true"===this.getAttribute("data-open-on-load")&&this.show()}),b(this,Er,"a",Yr)===da.LOCAL&&ze(this,()=>this.items.length>0,()=>{b(this,Er,"m",_r).call(this),b(this,Er,"m",ia).call(this)})}disconnectedCallback(){b(this,kr,"f").abort()}handleEvent(t){if(t.target===this.filterInputTextField)return void b(this,Er,"m",Ur).call(this,t);if(t.target===this.remoteInput)return void b(this,Er,"m",Br).call(this,t);const e=this.invokerElement?.contains(t.target),i=this.closeButton?.contains(t.target),n=b(this,Er,"m",Or).call(this,t);if(e&&"mousedown"===t.type)return;if("mousedown"===t.type&&t.target instanceof HTMLInputElement)return;if("mousedown"===t.type)return void t.preventDefault();if(e&&n)return void b(this,Er,"m",Jr).call(this,t);if(i&&n)return;if("keydown"===t.type&&t instanceof KeyboardEvent&&t.target.closest(ca)){const e=t.ctrlKey||t.altKey||t.metaKey,i=1===t.key.length&&/[a-z\d]/i.test(t.key);!e&&i&&t.stopPropagation()}if(t.target===this.dialog&&"close"===t.type){if(this.dialog.removeAttribute("data-ready"),this.invokerElement?.setAttribute("aria-expanded","false"),this.filterInputTextField){const t=this.filterInputTextField.value.length>0;this.filterInputTextField.value="",t&&this.filterInputTextField.dispatchEvent(new Event("input"))}return void this.dispatchEvent(new CustomEvent("panelClosed",{detail:{panel:this},bubbles:!0}))}const s=t.target.closest(ca)?.parentElement;if(null!=s&&n){if(b(this,Er,"m",Pr).call(this,t))return;const e=s.closest("[data-show-dialog-id]");if(e){const i=this.ownerDocument.getElementById(e.getAttribute("data-show-dialog-id")||"");if(i&&this.contains(e)&&this.contains(i))return void b(this,Er,"m",Qr).call(this,t,i)}return b(this,Er,"m",Nr).call(this,t)&&(t.preventDefault(),b(this,Er,"m",ra).call(this,s)?.click()),void b(this,Er,"m",ta).call(this,s)}if("click"===t.type){const e=this.dialog.getBoundingClientRect();e.top<=t.clientY&&t.clientY<=e.top+e.height&&e.left<=t.clientX&&t.clientX<=e.left+e.width||this.hide()}t.target instanceof IncludeFragmentElement&&b(this,Er,"m",Rr).call(this,t)}show(){this.updateAnchorPosition(),this.dialog.showModal(),this.invokerElement?.setAttribute("aria-expanded","true");const t=new CustomEvent("dialog:open",{detail:{dialog:this.dialog}});this.dispatchEvent(t)}hide(){this.dialog.close()}get visibleItems(){return Array.from(this.querySelectorAll(ca)).map(t=>t.parentElement)}get items(){return Array.from(this.querySelectorAll(la)).map(t=>t.parentElement)}get focusableItem(){for(const t of this.items){const e=b(this,Er,"m",ra).call(this,t);if(e&&"0"===e.getAttribute("tabindex"))return e}}getItemById(t){return this.querySelector(`li[data-item-id="${t}"`)}isItemDisabled(t){return!!t&&t.classList.contains("ActionListItem--disabled")}disableItem(t){t&&(t.classList.add("ActionListItem--disabled"),b(this,Er,"m",ra).call(this,t).setAttribute("aria-disabled","true"))}enableItem(t){t&&(t.classList.remove("ActionListItem--disabled"),b(this,Er,"m",ra).call(this,t).removeAttribute("aria-disabled"))}isItemHidden(t){return!!t&&t.hasAttribute("hidden")}isItemChecked(t){return!!t&&"true"===b(this,Er,"m",ra).call(this,t).getAttribute(this.ariaSelectionType)}checkItem(t){!t||"single"!==this.selectVariant&&"multiple"!==this.selectVariant||this.isItemChecked(t)||b(this,Er,"m",ta).call(this,t)}uncheckItem(t){!t||"single"!==this.selectVariant&&"multiple"!==this.selectVariant||this.isItemChecked(t)&&b(this,Er,"m",ta).call(this,t)}};Ar=new WeakMap,kr=new WeakMap,Lr=new WeakMap,Tr=new WeakMap,Sr=new WeakMap,Cr=new WeakMap,xr=new WeakMap,Mr=new WeakMap,Er=new WeakSet,Ir=function(){const{signal:t}=b(this,kr,"f");for(const e of this.querySelectorAll(aa.join(",")))e.addEventListener("click",b(this,Er,"m",Pr).bind(this),{signal:t}),e.addEventListener("keydown",b(this,Er,"m",Pr).bind(this),{signal:t})},Dr=function(){let t=!1;if("single"===this.selectVariant)for(const e of this.items){const i=b(this,Er,"m",ra).call(this,e);i&&(this.isItemHidden(e)||!this.isItemChecked(e)||t?i.setAttribute("tabindex","-1"):(i.setAttribute("tabindex","0"),t=!0),e.removeAttribute("tabindex"))}else for(const t of this.items){const e=b(this,Er,"m",ra).call(this,t);e&&(e.setAttribute("tabindex","-1"),t.removeAttribute("tabindex"))}!t&&b(this,Er,"a",na)&&b(this,Er,"m",ra).call(this,b(this,Er,"a",na))?.setAttribute("tabindex","0")},Pr=function(t){if(!b(this,Er,"m",Or).call(this,t))return!1;const e=t.target.closest(ca);return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},Nr=function(t){return t.target instanceof HTMLAnchorElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},Or=function(t){return t instanceof MouseEvent&&"click"===t.type||b(this,Er,"m",Nr).call(this,t)},Fr=function(){for(const t of this.items){const e=b(this,Er,"m",ra).call(this,t);if(!e)continue;const i=e.getAttribute("data-value");i&&b(this,Sr,"f").has(i)&&e.setAttribute(this.ariaSelectionType,"true")}b(this,Er,"m",ia).call(this)},Hr=function(t){const e=b(this,Er,"m",ra).call(this,t);if(!e)return;const i=e.getAttribute("data-value");i&&b(this,Sr,"f").set(i,{value:i,label:e.querySelector(".ActionListItem-label")?.textContent?.trim(),inputName:e.getAttribute("data-input-name")})},Vr=function(t){const e=b(this,Er,"m",ra).call(this,t);if(!e)return;const i=e.getAttribute("data-value");i&&b(this,Sr,"f").delete(i)},qr=function(){b(this,Er,"a",Gr)&&(b(this,Cr,"f")&&clearTimeout(b(this,Cr,"f")),b(this,xr,"f")&&clearTimeout(b(this,xr,"f")),v(this,xr,setTimeout(()=>{this.liveRegion.announce("Loading")},2e3),"f"),v(this,Cr,setTimeout(()=>{b(this,Er,"a",Gr)?.showLeadingSpinner()},1e3),"f"))},Rr=function(t){switch(t.type){case"include-fragment-replaced":b(this,Er,"m",_r).call(this);break;case"loadstart":b(this,Er,"m",Wr).call(this,!1);break;case"loadend":b(this,Er,"a",Gr)?.hideLeadingSpinner(),this.dispatchEvent(new CustomEvent("loadend"));break;case"error":{b(this,Er,"m",Wr).call(this,!0);const e=this.fragmentErrorElement;throw e&&!e.hasAttribute("hidden")&&this.liveRegion.announceFromElement(e,{politeness:"assertive"}),new Error(t.detail.error)}}},Wr=function(t){for(const e of this.includeFragment.querySelectorAll("[data-show-on-error]"))e instanceof HTMLElement&&(e.hidden=!t);for(const e of this.includeFragment.querySelectorAll("[data-hide-on-error]"))e instanceof HTMLElement&&(e.hidden=t)},Br=function(t){switch(t.type){case"remote-input-success":b(this,Er,"m",zr).call(this),b(this,Er,"m",_r).call(this),b(this,Er,"m",Fr).call(this);break;case"remote-input-error":this.bodySpinner?.setAttribute("hidden",""),this.includeFragment||0===this.visibleItems.length?b(this,Er,"m",Kr).call(this,ha.BODY):b(this,Er,"m",Kr).call(this,ha.BANNER);break;case"loadstart":if(!b(this,Er,"m",Xr).call(this)){if(b(this,Er,"m",zr).call(this),this.bodySpinner?.removeAttribute("hidden"),this.bodySpinner)break;b(this,Er,"m",qr).call(this)}break;case"loadend":b(this,Er,"a",Gr)?.hideLeadingSpinner(),b(this,xr,"f")&&clearTimeout(b(this,xr,"f")),b(this,Cr,"f")&&clearTimeout(b(this,Cr,"f")),this.dispatchEvent(new CustomEvent("loadend"))}},$r=function(t,e){return(t.getAttribute("data-filter-string")||t.textContent||"").toLowerCase().indexOf(e.toLowerCase())>-1},Ur=function(t){if("keydown"===t.type){const e=t.key;if("Enter"===e){const t=this.visibleItems[0];if(t){const e=b(this,Er,"m",ra).call(this,t);e&&e.click()}}else if("ArrowDown"===e){const e=this.focusableItem||b(this,Er,"m",ra).call(this,this.visibleItems[0]);e&&(e.focus(),t.preventDefault())}else if("Home"===e){const e=this.visibleItems[0];if(e){const i=b(this,Er,"m",ra).call(this,e);i&&i.focus(),t.preventDefault()}}else if("End"===e&&this.visibleItems.length>0){const e=this.visibleItems[this.visibleItems.length-1],i=b(this,Er,"m",ra).call(this,e);i&&i.focus(),t.preventDefault()}}if("input"===t.type&&(this.bodySpinner||b(this,Er,"m",Xr).call(this)||b(this,Er,"m",qr).call(this),b(this,Er,"a",Yr)===da.LOCAL||b(this,Er,"a",Yr)===da.EVENTUALLY_LOCAL)){if(this.includeFragment)return void this.includeFragment.refetch();b(this,Er,"m",_r).call(this)}},_r=function(){if(!this.list)return;let t=!1;if(b(this,Er,"m",Xr).call(this)){const e=this.filterInputTextField?.value??"",i=this.filterFn||b(this,Er,"m",$r);for(const n of this.items)i(n,e)?(b(this,Er,"m",oa).call(this,n),t=!0):b(this,Er,"m",sa).call(this,n)}else t=this.items.length>0;b(this,Er,"m",Dr).call(this),b(this,Er,"m",Zr).call(this);for(const t of this.items){const e=b(this,Er,"m",ra).call(this,t);if(!e)continue;const i=e.getAttribute("data-value");b(this,Mr,"f")?i&&!b(this,Sr,"f").has(i)&&e.setAttribute(this.ariaSelectionType,"false"):i&&!b(this,Sr,"f").has(i)&&this.isItemChecked(t)&&b(this,Er,"m",Hr).call(this,t)}v(this,Mr,!0,"f"),this.noResults&&(b(this,Er,"m",jr).call(this)?this.noResults.setAttribute("hidden",""):t?(this.noResults.setAttribute("hidden",""),this.list?.querySelector(".ActionListWrap")?.removeAttribute("hidden")):(this.list?.querySelector(".ActionListWrap")?.setAttribute("hidden",""),this.noResults.removeAttribute("hidden")))},jr=function(){return!(!this.fragmentErrorElement||this.fragmentErrorElement.hasAttribute("hidden"))||!!this.bannerErrorElement&&!this.bannerErrorElement.hasAttribute("hidden")},Kr=function(t){let e=this.fragmentErrorElement;t===ha.BODY&&this.fragmentErrorElement?(this.fragmentErrorElement.removeAttribute("hidden"),this.bannerErrorElement.setAttribute("hidden","")):(e=this.bannerErrorElement,this.bannerErrorElement?.removeAttribute("hidden"),this.fragmentErrorElement?.setAttribute("hidden","")),!e||e.hasAttribute("hidden")||this.liveRegion.announceFromElement(e,{politeness:"assertive"})},zr=function(){this.fragmentErrorElement?.setAttribute("hidden",""),this.bannerErrorElement.setAttribute("hidden","")},Zr=function(){if(this.open&&this.list){const t=this.visibleItems;if(t.length>0){const e="tab for results";this.liveRegion.announce(`${t.length} result${1===t.length?"":"s"} ${e}`)}else{const t=this.noResults;t&&this.liveRegion.announceFromElement(t)}}},Yr=function(){if(!this.list)return da.REMOTE;switch(this.list.getAttribute("data-fetch-strategy")){case"local":return da.LOCAL;case"eventually_local":return da.EVENTUALLY_LOCAL;default:return da.REMOTE}},Gr=function(){return this.filterInputTextField?.closest("primer-text-field")},Xr=function(){return b(this,Er,"a",Yr)===da.LOCAL||b(this,Er,"a",Yr)===da.EVENTUALLY_LOCAL},Jr=function(t){this.invokerElement?.dispatchEvent(new CustomEvent("invokerClicked",{bubbles:!0})),t.preventDefault(),t.stopPropagation(),this.open?this.hide():this.show()},Qr=function(t,e){this.querySelector(".ActionListWrap").style.display="none";const i=new AbortController,{signal:n}=i,s=()=>{i.abort(),this.querySelector(".ActionListWrap").style.display="",this.open&&this.hide();const t=this.ownerDocument.activeElement,e=this.ownerDocument.activeElement===this.ownerDocument.body,n=this.contains(t);(e||n)&&setTimeout(()=>this.invokerElement?.focus(),0)};e.addEventListener("close",s,{signal:n}),e.addEventListener("cancel",s,{signal:n})},ta=function(t){if("multiple"!==this.selectVariant&&setTimeout(()=>{this.open&&this.hide()}),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e=this.isItemChecked(t),i=!e;if(!this.dispatchEvent(new CustomEvent("beforeItemActivated",{bubbles:!0,cancelable:!0,detail:{item:t,checked:i,value:b(this,Er,"m",ra).call(this,t)?.getAttribute("data-value")}})))return;const n=b(this,Er,"m",ra).call(this,t);if("single"===this.selectVariant){if(n?.getAttribute("href"))return;if(!e){for(const t of this.items)b(this,Er,"m",ra).call(this,t)?.setAttribute(this.ariaSelectionType,"false");b(this,Sr,"f").clear(),i&&(b(this,Er,"m",Hr).call(this,t),n?.setAttribute(this.ariaSelectionType,"true")),b(this,Er,"m",ea).call(this)}}else n?.setAttribute(this.ariaSelectionType,`${i}`),i?b(this,Er,"m",Hr).call(this,t):b(this,Er,"m",Vr).call(this,t);b(this,Er,"m",ia).call(this),b(this,Er,"m",Dr).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:t,checked:i,value:b(this,Er,"m",ra).call(this,t)?.getAttribute("data-value")}}))},ea=function(){if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;v(this,Lr,b(this,Lr,"f")||t.textContent||"","f");const e=this.querySelector(`[${this.ariaSelectionType}=true] .ActionListItem-label`)?.textContent||b(this,Lr,"f");if(e){const i=document.createElement("span");i.classList.add("color-fg-muted");const n=document.createElement("span");i.textContent=`${this.dynamicLabelPrefix} `,n.textContent=e,t.replaceChildren(i,n),this.dynamicAriaLabelPrefix&&this.invokerElement?.setAttribute("aria-label",`${this.dynamicAriaLabelPrefix} ${e.trim()}`)}else t.textContent=b(this,Lr,"f")},ia=function(){if("single"===this.selectVariant){const t=this.querySelector("[data-select-panel-inputs=true] input")??this.querySelector("[data-list-inputs=true] input");if(!t)return;const e=this.selectedItems[0];e?(t.value=(e.value||e.label||"").trim(),e.inputName&&(t.name=e.inputName),t.removeAttribute("disabled")):b(this,Mr,"f")&&t.setAttribute("disabled","disabled")}else if("none"!==this.selectVariant){const t=!!this.querySelector("[data-select-panel-inputs=true]"),e=this.querySelector("[data-select-panel-inputs=true]")??this.querySelector("[data-list-inputs=true]");if(!e)return;const i=e.querySelectorAll("input");i.length>0&&v(this,Tr,b(this,Tr,"f")||i[0].name,"f");for(const i of this.selectedItems){const n=document.createElement("input");n.setAttribute(""+(t?"data-select-panel-input":"data-list-input"),"true"),n.type="hidden",n.autocomplete="off",n.name=i.inputName||b(this,Tr,"f"),n.value=(i.value||i.label||"").trim(),e.append(n)}for(const t of i)t.remove()}},na=function(){return this.querySelector(ca)?.parentElement||null},sa=function(t){t&&t.setAttribute("hidden","hidden")},oa=function(t){t&&t.removeAttribute("hidden")},ra=function(t){return t.querySelector(".ActionListContent")},g([_],ma.prototype,"includeFragment",void 0),g([_],ma.prototype,"dialog",void 0),g([_],ma.prototype,"filterInputTextField",void 0),g([_],ma.prototype,"remoteInput",void 0),g([_],ma.prototype,"list",void 0),g([_],ma.prototype,"noResults",void 0),g([_],ma.prototype,"fragmentErrorElement",void 0),g([_],ma.prototype,"bannerErrorElement",void 0),g([_],ma.prototype,"bodySpinner",void 0),g([_],ma.prototype,"liveRegion",void 0),ma=g([K("select-panel")],ma),window.customElements.get("select-panel")||(window.SelectPanelElement=ma,window.customElements.define("select-panel",ma));let fa=class DetailsToggleElement extends HTMLElement{toggle(){if(this.detailsTarget.hasAttribute("open")){const t=this.summaryTarget.getAttribute("data-aria-label-closed");t&&this.summaryTarget.setAttribute("aria-label",t),this.summaryTarget.setAttribute("aria-expanded","false")}else{const t=this.summaryTarget.getAttribute("data-aria-label-open");t&&this.summaryTarget.setAttribute("aria-label",t),this.summaryTarget.setAttribute("aria-expanded","true")}}};function pa(t){Ct(t,{bindKeys:yt.ArrowVertical|yt.ArrowHorizontal|yt.HomeAndEnd|yt.Backspace,getNextFocusable:(t,e,i)=>{if(e instanceof HTMLElement){try{if(e.closest("dialog:modal"))return}catch{}return function(t,e){switch(`${function(t){if("treeitem"!==t.getAttribute("role"))throw new Error("Element is not a treeitem");switch(t.getAttribute("aria-expanded")){case"true":return"open";case"false":return"closed";default:return"end"}}(t)} ${e.key}`){case"open ArrowRight":return function(t){const e=t.querySelector("[role=treeitem]");return e instanceof HTMLElement?e:void 0}(t);case"open ArrowLeft":case"closed ArrowRight":case"end ArrowRight":return;case"closed ArrowLeft":case"end ArrowLeft":return va(t)}switch(e.key){case"ArrowUp":return ga(t,"previous");case"ArrowDown":return ga(t,"next");case"Backspace":return va(t)}}(e,i)??e}},focusInStrategy:()=>{let e=t.querySelector("[aria-current]");e=e?.checkVisibility()?e:null;const i=t.querySelector('[role="treeitem"]');return e instanceof HTMLElement?e:document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&"treeitem"===document.activeElement.getAttribute("role")?document.activeElement:i instanceof HTMLElement?i:void 0}})}function ga(t,e){const i=t.closest("[role=tree]");if(!i)return;const n=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,t=>t instanceof HTMLElement&&"treeitem"===t.getAttribute("role")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP);let s=n.firstChild();for(;s!==t;)s=n.nextNode();let o="next"===e?n.nextNode():n.previousNode();for(;o instanceof HTMLElement&&ba(o,i);)o="next"===e?n.nextNode():n.previousNode();return o instanceof HTMLElement?o:void 0}function ba(t,e){for(const i of e.querySelectorAll("[role=treeitem][aria-expanded=false]"))if(t!==i&&i.closest("li")?.contains(t))return i;return null}function va(t){const e=t.closest("[role=group]"),i=e?.closest("[role=treeitem]");return i instanceof HTMLElement?i:void 0}var wa,ya,Ea,Aa,ka,La,Ta,Sa,Ca,xa,Ma,Ia;g([_],fa.prototype,"detailsTarget",void 0),g([_],fa.prototype,"summaryTarget",void 0),fa=g([K("details-toggle")],fa),window.DetailsToggleElement=fa;let Da=class TreeViewElement extends HTMLElement{constructor(){super(...arguments),wa.add(this),ya.set(this,void 0)}connectedCallback(){const{signal:t}=v(this,ya,new AbortController,"f");this.addEventListener("click",this,{signal:t}),this.addEventListener("focusin",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),pa(this),new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.querySelector("[aria-expanded=true]")&&b(this,wa,"m",Ea).call(this,t)}).observe(this,{childList:!0,subtree:!0});new MutationObserver(t=>{if(!this.formInputContainer)return;t.some(t=>t.target instanceof HTMLElement&&t.target.getAttribute("aria-checked")!==t.oldValue)&&this.updateHiddenFormInputs()}).observe(this,{childList:!0,subtree:!0,attributeFilter:["aria-checked"]}),this.formInputContainer&&this.updateHiddenFormInputs(),customElements.whenDefined("tree-view-sub-tree-node").then(()=>{b(this,wa,"m",Ea).call(this,this)})}rootLeafNodes(){return this.querySelectorAll(":scope > ul > li > .TreeViewItemContainer [role=treeitem]")}rootSubTreeNodes(){return this.querySelectorAll(":scope > ul > tree-view-sub-tree-node")}disconnectedCallback(){b(this,ya,"f").abort()}handleEvent(t){const e=b(this,wa,"m",ka).call(this,t);e&&b(this,wa,"m",La).call(this,e,t)}handleSingleSelection(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if(!(e instanceof HTMLDivElement))return;const i=this.getNodePath(e),n=this.infoFromNode(e,"true");this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:[n]}))&&("true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.checkOnlyAtPath(i),this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,detail:[n]})))}getFormInputValueForNode(t){return t.getAttribute("data-value")}getNodePath(t){const e=t.getAttribute("data-path");return e?JSON.parse(e):[]}getNodeType(t){return t.getAttribute("data-node-type")}markCurrentAtPath(t){const e=JSON.stringify(t),i=this.querySelector(`[data-path="${CSS.escape(e)}"`);i&&(this.currentNode?.setAttribute("aria-current","false"),i.setAttribute("aria-current","true"))}get currentNode(){return this.querySelector("[aria-current=true]")}get activeNodes(){return document.querySelectorAll('[aria-checked="true"]')}expandAtPath(t){const e=this.subTreeAtPath(t);e&&e.expand()}collapseAtPath(t){const e=this.subTreeAtPath(t);e&&e.collapse()}toggleAtPath(t){const e=this.subTreeAtPath(t);e&&e.toggle()}checkAtPath(t){const e=this.nodeAtPath(t);e&&this.setNodeCheckedValue(e,"true")}uncheckAtPath(t){const e=this.nodeAtPath(t);e&&this.setNodeCheckedValue(e,"false")}checkOnlyAtPath(t){for(const t of this.activeNodes)this.uncheckAtPath(this.getNodePath(t));this.checkAtPath(t)}toggleCheckedAtPath(t){const e=this.nodeAtPath(t);e&&"leaf"===this.getNodeType(e)&&("true"===this.getNodeCheckedValue(e)?this.uncheckAtPath(t):this.checkAtPath(t))}checkedValueAtPath(t){const e=this.nodeAtPath(t);return e?this.getNodeCheckedValue(e):"false"}disabledValueAtPath(t){const e=this.nodeAtPath(t);return!!e&&this.getNodeDisabledValue(e)}nodeAtPath(t,e){const i=JSON.stringify(t);return this.querySelector(`${e||""}[data-path="${CSS.escape(i)}"]`)}subTreeAtPath(t){const e=this.nodeAtPath(t,"[data-node-type=sub-tree]");return e?e.closest("tree-view-sub-tree-node"):null}leafAtPath(t){return this.nodeAtPath(t,"[data-node-type=leaf]")}setNodeCheckedValue(t,e){t.setAttribute("aria-checked",e.toString())}getNodeCheckedValue(t){return t.getAttribute("aria-checked")||"false"}getNodeDisabledValue(t){return"true"===t.getAttribute("aria-disabled")}setNodeDisabledValue(t,e){e?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled")}nodeHasCheckBox(t){return null!==t.querySelector(".TreeViewItemCheckbox")}nodeHasNativeAction(t){return t instanceof HTMLAnchorElement||t instanceof HTMLButtonElement}expandAncestorsForNode(t){const e=t.closest("tree-view-sub-tree-node");if(e)for(const t of e.eachAncestorSubTreeNode())t.expanded||t.expand()}changeSelectStrategy(t){for(const e of this.querySelectorAll("tree-view-sub-tree-node"))e.changeSelectStrategy(t)}infoFromNode(t,e){const i=this.getNodeType(t);if(!i)return null;const n=this.getNodeCheckedValue(t);return{node:t,type:i,path:this.getNodePath(t),checkedValue:e||n,previousCheckedValue:n}}selectVariant(t){return t.getAttribute("data-select-variant")||"none"}updateHiddenFormInputs(){const t=[];for(const e of this.querySelectorAll("[role=treeitem][aria-checked=true]")){const i=this.formInputPrototype.cloneNode();i.removeAttribute("data-target"),i.removeAttribute("form");const n={path:this.getNodePath(e)},s=this.getFormInputValueForNode(e);s&&(n.value=s),i.value=JSON.stringify(n),t.push(i)}this.formInputContainer.replaceChildren(...t)}};var Pa,Na;ya=new WeakMap,wa=new WeakSet,Ea=function(t){for(const e of t.querySelectorAll("[aria-expanded=true]"))this.expandAncestorsForNode(e)},Aa=function(t){return"click"===t.type},ka=function(t){const e=t.target,i=e.closest("[role=treeitem]");return i?e.closest(".TreeViewItemToggle")||e.closest(".TreeViewItemLeadingAction")?null:i:null},La=function(t,e){b(this,wa,"m",Ta).call(this,e,t)?b(this,wa,"m",Sa).call(this,e,t):b(this,wa,"m",Ca).call(this,e,t)?this.handleSingleSelection(e,t):b(this,wa,"m",Aa).call(this,e)?b(this,wa,"m",xa).call(this,e,t):"focusin"===e.type?b(this,wa,"m",Ma).call(this,t):e instanceof KeyboardEvent&&b(this,wa,"m",Ia).call(this,e,t)},Ta=function(t,e){return"click"===t.type&&this.nodeHasCheckBox(e)},Sa=function(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if("leaf"!==this.getNodeType(e))return;const i="false"===this.getNodeCheckedValue(e)?"true":"false",n=this.infoFromNode(e,i);this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:[n]}))&&("true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.setNodeCheckedValue(e,"true"),this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,cancelable:!0,detail:[n]})))},Ca=function(t,e){return"click"===t.type&&"single"===this.selectVariant(e)},xa=function(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if(!(e instanceof HTMLDivElement))return;const i=this.getNodePath(e);this.dispatchEvent(new CustomEvent("treeViewBeforeNodeActivated",{bubbles:!0,cancelable:!0,detail:this.infoFromNode(e)}))&&(this.nodeHasNativeAction(e)||this.toggleAtPath(i),this.dispatchEvent(new CustomEvent("treeViewNodeActivated",{bubbles:!0,detail:this.infoFromNode(e)})))},Ma=function(t){const e=this.querySelector("[aria-selected=true]");e?.setAttribute("aria-selected","false"),t.setAttribute("aria-selected","true")},Ia=function(t,e){if(e&&"leaf"===this.getNodeType(e))switch(t.key){case" ":case"Enter":if(this.getNodeDisabledValue(e)){t.preventDefault();break}"multiple"===this.selectVariant(e)?(t.preventDefault(),"true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.setNodeCheckedValue(e,"true")):"single"===this.selectVariant(e)?(t.preventDefault(),this.checkOnlyAtPath(this.getNodePath(e))):e instanceof HTMLAnchorElement&&e.click()}},g([_],Da.prototype,"formInputContainer",void 0),g([_],Da.prototype,"formInputPrototype",void 0),Da=g([K("tree-view")],Da),window.customElements.get("tree-view")||(window.TreeViewElement=Da,window.customElements.define("tree-view",Da));let Oa=class TreeViewIconPairElement extends HTMLElement{constructor(){super(...arguments),Pa.add(this)}connectedCallback(){ze(this,()=>Boolean(this.collapsedIcon)&&Boolean(this.expandedIcon),()=>{this.expanded=this.collapsedIcon.hidden})}showExpanded(){this.expanded=!0,b(this,Pa,"m",Na).call(this)}showCollapsed(){this.expanded=!1,b(this,Pa,"m",Na).call(this)}toggle(){this.expanded=!this.expanded,b(this,Pa,"m",Na).call(this)}};var Fa,Ha,Va,qa,Ra,Wa,Ba,$a,Ua,_a,ja,Ka,za;Pa=new WeakSet,Na=function(){this.expanded?(this.expandedIcon.hidden=!1,this.collapsedIcon.hidden=!0):(this.expandedIcon.hidden=!0,this.collapsedIcon.hidden=!1)},g([_],Oa.prototype,"expandedIcon",void 0),g([_],Oa.prototype,"collapsedIcon",void 0),Oa=g([K("tree-view-icon-pair")],Oa),window.customElements.get("tree-view-icon-pair")||(window.TreeViewIconPairElement=Oa,window.customElements.define("tree-view-icon-pair",Oa));let Za=class TreeViewSubTreeNodeElement extends HTMLElement{constructor(){super(...arguments),Fa.add(this),Ha.set(this,null),Va.set(this,"success"),qa.set(this,void 0),Ra.set(this,!1)}connectedCallback(){ze(this,()=>Boolean(this.node)&&Boolean(this.subTree),()=>{b(this,Fa,"m",ja).call(this)});const{signal:t}=v(this,qa,new AbortController,"f");this.addEventListener("click",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),ze(this,()=>Boolean(this.includeFragment),()=>{this.includeFragment.addEventListener("loadstart",this,{signal:t}),this.includeFragment.addEventListener("error",this,{signal:t}),this.includeFragment.addEventListener("include-fragment-replace",this,{signal:t}),this.includeFragment.addEventListener("include-fragment-replaced",t=>{b(this,Fa,"m",Ba).call(this,t)},{signal:t})}),ze(this,()=>Boolean(this.retryButton),()=>{this.retryButton.addEventListener("click",t=>{b(this,Fa,"m",$a).call(this,t)},{signal:t})});new MutationObserver(()=>{if("mixed_descendants"!==this.selectStrategy)return;let t="unknown";for(const e of this.eachDirectDescendantNode())switch(`${t} ${e.getAttribute("aria-checked")||"false"}`){case"unknown mixed":case"false mixed":case"true mixed":case"false true":case"true false":t="mixed";break;case"unknown false":t="false";break;case"unknown true":t="true"}"unknown"!==t&&this.node?.getAttribute("aria-checked")!==t&&this.node?.setAttribute("aria-checked",t)}).observe(this,{childList:!0,subtree:!0,attributeFilter:["aria-checked"]})}get expanded(){return null===b(this,Ha,"f")&&v(this,Ha,"true"===this.node.getAttribute("aria-expanded"),"f"),b(this,Ha,"f")}set expanded(t){v(this,Ha,t,"f"),b(this,Fa,"m",ja).call(this)}get loadingState(){return b(this,Va,"f")}set loadingState(t){v(this,Va,t,"f"),b(this,Fa,"m",ja).call(this)}get selectStrategy(){return this.node.getAttribute("data-select-strategy")||"descendants"}get selectVariant(){return this.node.getAttribute("data-select-variant")||"none"}get level(){return parseInt(this.node.getAttribute("aria-level")||"0")}disconnectedCallback(){b(this,qa,"f").abort()}handleEvent(t){t.target===this.toggleButton?b(this,Fa,"m",Wa).call(this,t):t.target===this.includeFragment?b(this,Fa,"m",Ba).call(this,t):t instanceof KeyboardEvent?b(this,Fa,"m",Ua).call(this,t):t.target.closest("[role=treeitem]")===this.node&&"click"===t.type&&b(this,Fa,"a",za)&&b(this,Fa,"m",_a).call(this,t)}expand(){const t=this.expanded;this.expanded=!0,!t&&this.treeView&&this.treeView.dispatchEvent(new CustomEvent("treeViewNodeExpanded",{bubbles:!0,detail:this.treeView?.infoFromNode(this.node)}))}collapse(){const t=!this.expanded;if(this.expanded=!1,!t&&this.treeView){const t=this.subTree.querySelector("[tabindex='0']");t?.setAttribute("tabindex","-1"),b(this,Fa,"m",Ka).call(this)&&"0"===this.subTree.getAttribute("tabindex")&&this.subTree.setAttribute("tabindex","-1"),this.node.setAttribute("tabindex","0"),this.treeView.dispatchEvent(new CustomEvent("treeViewNodeCollapsed",{bubbles:!0,detail:this.treeView?.infoFromNode(this.node)}))}}toggle(){this.expanded?this.collapse():this.expand()}get nodes(){return this.querySelectorAll(":scope > [role=treeitem]")}*eachDirectDescendantNode(){for(const t of this.subTree.querySelectorAll(":scope > li > .TreeViewItemContainer > [role=treeitem]"))yield t;for(const t of this.subTree.querySelectorAll(":scope > tree-view-sub-tree-node > li > .TreeViewItemContainer > [role=treeitem]"))yield t}*eachDirectDescendantSubTreeNode(){for(const t of this.subTree.querySelectorAll(":scope > tree-view-sub-tree-node"))yield t}*eachDescendantNode(){for(const t of this.subTree.querySelectorAll("[role=treeitem]"))yield t}*eachAncestorSubTreeNode(){if(!this.treeView)return;let t=this;for(;t&&this.treeView.contains(t);)yield t,t=t.parentElement?.closest("tree-view-sub-tree-node")}get isEmpty(){return 0===this.nodes.length}get treeView(){return this.closest("tree-view")}toggleChecked(){const t="false"===(this.treeView?.getNodeCheckedValue(this.node)||"false")?"true":"false",e=[],i=this.treeView?.infoFromNode(this.node,t);if(i&&e.push(i),"descendants"===this.selectStrategy||"mixed_descendants"===this.selectStrategy)for(const i of this.eachDescendantNode()){const n=this.treeView?.infoFromNode(i,t);n&&e.push(n)}if(this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:e}))){for(const i of e)i.node.setAttribute("aria-checked",t);this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,cancelable:!0,detail:e}))}}changeSelectStrategy(t){this.node.setAttribute("data-select-strategy",t)}};Ha=new WeakMap,Va=new WeakMap,qa=new WeakMap,Ra=new WeakMap,Fa=new WeakSet,Wa=function(t){"click"===t.type&&(this.toggle(),t.stopPropagation())},Ba=function(t){switch(t.type){case"loadstart":this.loadingState="loading";break;case"error":this.loadingState="error";break;case"include-fragment-replace":v(this,Ra,document.activeElement===this.loadingIndicator.closest("[role=treeitem]"),"f"),!b(this,Ra,"f")&&document.activeElement===this.subTree&&b(this,Fa,"m",Ka).call(this)&&v(this,Ra,!0,"f"),this.loadingState="success";break;case"include-fragment-replaced":if(this.expanded=!0,b(this,Ra,"f")){const t=this.querySelector("[role=group] > :first-child");if(!t)return;const e=t.querySelector("[role=treeitem]");if(!e)return;e.focus()}v(this,Ra,!1,"f")}},$a=function(t){"click"===t.type&&(this.loadingState="loading",this.includeFragment.refetch())},Ua=function(t){const e=t.target.closest("[role=treeitem]");if(e&&"sub-tree"===this.treeView?.getNodeType(e))switch(t.key){case"Enter":if(this.treeView?.getNodeDisabledValue(e)){t.preventDefault();break}t.stopPropagation(),b(this,Fa,"a",za)?this.toggleChecked():"single"===this.selectVariant?this.treeView.handleSingleSelection(t,e):this.treeView?.nodeHasNativeAction(e)||this.toggle();break;case"ArrowRight":t.stopPropagation(),this.expand();break;case"ArrowLeft":t.stopPropagation(),this.collapse();break;case" ":if(this.treeView?.getNodeDisabledValue(e)){t.preventDefault();break}b(this,Fa,"a",za)?(t.stopPropagation(),t.preventDefault(),this.toggleChecked()):"single"===this.selectVariant?this.treeView.handleSingleSelection(t,e):e instanceof HTMLAnchorElement?e.click():this.treeView?.nodeHasNativeAction(e)||this.toggle()}},_a=function(t){this.treeView?.getNodeDisabledValue(this.node)?t.preventDefault():"click"===t.type&&(this.toggleChecked(),t.stopPropagation())},ja=function(){switch(this.expanded?(this.subTree&&(this.subTree.hidden=!1),b(this,Fa,"m",Ka).call(this)&&(this.subTree.setAttribute("role","treeitem"),this.subTree.hasAttribute("tabindex")||this.subTree.setAttribute("tabindex","-1")),this.node.setAttribute("aria-expanded","true"),this.treeView?.expandAncestorsForNode(this),this.iconPair&&this.iconPair.showExpanded(),this.expandedToggleIcon&&this.collapsedToggleIcon&&(this.expandedToggleIcon.removeAttribute("hidden"),this.collapsedToggleIcon.setAttribute("hidden","hidden"))):(this.subTree&&(this.subTree.hidden=!0),b(this,Fa,"m",Ka).call(this)&&(this.subTree.removeAttribute("role"),this.subTree.removeAttribute("tabindex")),this.node.setAttribute("aria-expanded","false"),this.iconPair&&this.iconPair.showCollapsed(),this.expandedToggleIcon&&this.collapsedToggleIcon&&(this.expandedToggleIcon.setAttribute("hidden","hidden"),this.collapsedToggleIcon.removeAttribute("hidden"))),this.loadingState){case"loading":this.loadingFailureMessage&&(this.loadingFailureMessage.hidden=!0),this.loadingIndicator&&(this.loadingIndicator.hidden=!1);break;case"error":this.loadingIndicator&&(this.loadingIndicator.hidden=!0),this.loadingFailureMessage&&(this.loadingFailureMessage.hidden=!1);break;default:this.loadingIndicator&&(this.loadingIndicator.hidden=!0),this.loadingFailureMessage&&(this.loadingFailureMessage.hidden=!0)}},Ka=function(){return this.subTree?.getAttribute("data-target")?.includes("tree-view-sub-tree-node.includeFragment")??!1},za=function(){return this.querySelector(".TreeViewItemCheckbox")},g([_],Za.prototype,"node",void 0),g([_],Za.prototype,"subTree",void 0),g([_],Za.prototype,"iconPair",void 0),g([_],Za.prototype,"toggleButton",void 0),g([_],Za.prototype,"expandedToggleIcon",void 0),g([_],Za.prototype,"collapsedToggleIcon",void 0),g([_],Za.prototype,"includeFragment",void 0),g([_],Za.prototype,"loadingIndicator",void 0),g([_],Za.prototype,"loadingFailureMessage",void 0),g([_],Za.prototype,"retryButton",void 0),Za=g([K("tree-view-sub-tree-node")],Za),window.customElements.get("tree-view-sub-tree-node")||(window.TreeViewSubTreeNodeElement=Za,window.customElements.define("tree-view-sub-tree-node",Za));let Ya=class TreeViewIncludeFragmentElement extends IncludeFragmentElement{request(){const t=super.request(),e=new URL(t.url);return e.searchParams.set("path",this.getAttribute("data-path")||""),new Request(e,{method:t.method,headers:t.headers,credentials:t.credentials})}};Ya=g([K("tree-view-include-fragment")],Ya),window.customElements.get("tree-view-include-fragment")||(window.TreeViewIncludeFragmentElement=Ya,window.customElements.define("tree-view-include-fragment",Ya));let Ga=class AvatarFallbackElement extends HTMLElement{constructor(){super(...arguments),this.img=null,this.testImage=null}connectedCallback(){if(this.img=this.querySelector("img")??null,!this.img)return;const t=this.getAttribute("data-unique-id")||"",e=this.getAttribute("data-alt-text")||"",i=this.getAttribute("data-avatar-src")||"";this.applyColor(this.img,t,e),i&&this.testLoadImage(i)}disconnectedCallback(){this.testImage&&(this.testImage.onload=null,this.testImage=null),this.img=null}testLoadImage(t){this.testImage=new Image,this.testImage.onload=()=>{this.img&&(this.img.src=t)},this.testImage.src=t}applyColor(t,e,i){if(!e||!i)return;const n=`${e}${i}`,s=`hsl(${this.valueHash(n)}, 50%, 30%)`;this.updateSvgColor(t,s)}valueHash(t){let e=0;for(let i=0;i<t.length;i++)e=t.charCodeAt(i)+((e<<5)-e);return e%360}updateSvgColor(t,e){const i=t.src;if(!i.startsWith("data:image/svg+xml;base64,"))return;const n=i.replace("data:image/svg+xml;base64,","");try{const i=atob(n).replace(/fill="hsl\([^"]+\)"/,`fill="${e}"`);t.src=`data:image/svg+xml;base64,${btoa(i)}`}catch{}}};Ga=g([K],Ga);let Xa=class PageHeaderElement extends HTMLElement{menuItemClick(t){const e=t.currentTarget,i=e?.getAttribute("data-for");i&&document.getElementById(i)?.click()}};Xa=g([K],Xa),window.customElements.get("page-header")||(window.PageHeaderElement=Xa,window.customElements.define("page-header",Xa));let Ja=class ZenModeButtonElement extends HTMLElement{constructor(){super(),this.inZenMode=!1,document.addEventListener("fullscreenchange",this.fullscreenChangeEventHandler.bind(this))}disconnectedCallback(){document.removeEventListener("fullscreenchange",this.fullscreenChangeEventHandler.bind(this))}fullscreenChangeEventHandler(){this.changeButtonState(!this.inZenMode),this.dispatchZenModeStatus()}dispatchZenModeStatus(){const t=new CustomEvent("zenModeToggled",{detail:{active:this.inZenMode}});window.dispatchEvent(t)}deactivateZenMode(){document.exitFullscreen&&document.exitFullscreen()}activateZenMode(){document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen()}changeButtonState(t){this.inZenMode=t,this.button.setAttribute("aria-pressed",t.toString())}performAction(){this.inZenMode?this.deactivateZenMode():this.activateZenMode()}};g([_],Ja.prototype,"button",void 0),Ja=g([K],Ja),window.customElements.get("zen-mode-button")||(window.ZenModeButtonElement=Ja,window.customElements.define("zen-mode-button",Ja));let Qa=class SubHeaderElement extends HTMLElement{connectedCallback(){this.setupFilterInputClearButton()}setupFilterInputClearButton(){this.waitForCondition(()=>Boolean(this.filterInput),()=>{this.toggleFilterInputClearButton()})}toggleFilterInputClearButton(){this.filterInput.value.length>0?this.filterInput.classList.remove("SubHeader-filterInput_hiddenClearButton"):this.filterInput.classList.add("SubHeader-filterInput_hiddenClearButton")}expandFilterInput(){for(const t of this.hiddenItemsOnExpandedFilter)t.classList.add("d-none");for(const t of this.shownItemsOnExpandedFilter)t.classList.remove("d-none");this.classList.add("SubHeader--expandedSearch"),this.filterInput.focus()}collapseFilterInput(){for(const t of this.hiddenItemsOnExpandedFilter)t.classList.remove("d-none");for(const t of this.shownItemsOnExpandedFilter)t.classList.add("d-none");this.classList.remove("SubHeader--expandedSearch")}waitForCondition(t,e){if(t())e();else{const i=new MutationObserver(()=>{t()&&(e(),i.disconnect())});i.observe(this,{childList:!0,subtree:!0})}}};var tl,el;g([_],Qa.prototype,"filterInput",void 0),g([j],Qa.prototype,"hiddenItemsOnExpandedFilter",void 0),g([j],Qa.prototype,"shownItemsOnExpandedFilter",void 0),Qa=g([K],Qa),window.customElements.get("sub-header")||(window.SubHeaderElement=Qa,window.customElements.define("sub-header",Qa));let il=class DangerDialogFormHelperElement extends HTMLElement{constructor(){super(...arguments),tl.add(this),this.confirmationLiveMessageChecked="",this.confirmationLiveMessageUnchecked=""}get form(){return this.querySelector("form")}get submitButton(){return this.querySelector("input[type=submit],button[type=submit],button[data-submit-dialog-id]")}connectedCallback(){this.style.display="contents",this.form&&(this.form.style.display="contents"),b(this,tl,"m",el).call(this)}toggle(){if(!this.checkbox||!this.submitButton)return;const t=this.checkbox.checked;if(this.submitButton.disabled=!t,this.liveRegion){const e=t?this.confirmationLiveMessageChecked:this.confirmationLiveMessageUnchecked;this.liveRegion.announce(e,{politeness:"assertive"})}}};tl=new WeakSet,el=function(){this.toggle()},g([_],il.prototype,"checkbox",void 0),g([_],il.prototype,"liveRegion",void 0),g([I],il.prototype,"confirmationLiveMessageChecked",void 0),g([I],il.prototype,"confirmationLiveMessageUnchecked",void 0),il=g([K],il),window.customElements.get("danger-dialog-form-helper")||(window.DangerDialogFormHelperElement=il,window.customElements.define("danger-dialog-form-helper",il));class CollapsibleElement extends HTMLElement{constructor(){super(...arguments),this.collapsed=!1}toggleViaKeyboard(t){"Enter"!==t.code&&"Space"!==t.code||(t.preventDefault(),this.toggle())}toggle(){this.collapsed=!this.collapsed}attributeChangedCallback(t){"data-collapsed"===t&&(this.collapsed?this.hideAll():this.expandAll())}hideAll(){this.arrowDown?.removeAttribute("hidden"),this.arrowUp?.setAttribute("hidden",""),this.triggerElement.setAttribute("aria-expanded","false");for(const t of this.collapsibleElements)t.hidden=!0;this.classList.add(`${this.baseClass}--collapsed`)}expandAll(){this.arrowUp?.removeAttribute("hidden"),this.arrowDown?.setAttribute("hidden",""),this.triggerElement.setAttribute("aria-expanded","true");for(const t of this.collapsibleElements)t.hidden=!1;this.classList.remove(`${this.baseClass}--collapsed`)}}g([_],CollapsibleElement.prototype,"arrowDown",void 0),g([_],CollapsibleElement.prototype,"arrowUp",void 0),g([_],CollapsibleElement.prototype,"triggerElement",void 0),g([j],CollapsibleElement.prototype,"collapsibleElements",void 0),g([I],CollapsibleElement.prototype,"collapsed",void 0);let nl=class CollapsibleHeaderElement extends CollapsibleElement{connectedCallback(){if(!this.closest(".Box"))throw new Error("No surrounding BorderBox found")}get baseClass(){return"CollapsibleHeader"}};nl=g([K],nl);let sl=class CollapsibleSectionElement extends CollapsibleElement{get baseClass(){return"CollapsibleSection"}};var ol,rl,al,ll,cl,dl,hl,ul,ml,fl,pl,gl,bl,vl,wl,yl,El;sl=g([K],sl);let Al=class FilterableTreeViewElement extends HTMLElement{constructor(){super(...arguments),ol.add(this),rl.set(this,void 0),al.set(this,void 0),ll.set(this,new Map)}connectedCallback(){const{signal:t}=v(this,al,new AbortController,"f");this.addEventListener("treeViewNodeChecked",this,{signal:t}),this.addEventListener("itemActivated",this,{signal:t}),this.addEventListener("input",this,{signal:t})}disconnectedCallback(){b(this,al,"f").abort()}handleEvent(t){t.target===this.filterModeControl?b(this,ol,"m",ul).call(this,t):t.target===this.filterInput?b(this,ol,"m",ml).call(this,t):t.target===this.includeSubItemsCheckBox?b(this,ol,"m",fl).call(this,t):(t.target instanceof Da||t.target instanceof Za)&&b(this,ol,"m",cl).call(this,t)}get filterModeControl(){return this.filterModeControlList.closest("segmented-control")}get treeView(){return this.treeViewList.closest("tree-view")}set filterFn(t){v(this,rl,t,"f")}get filterFn(){return b(this,rl,"f")?b(this,rl,"f"):this.defaultFilterFn}defaultFilterFn(t,e,i){const n=[];if(e.length>0){const i=e.toLowerCase(),s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let o=s.nextNode();for(;o;){const t=o.textContent?.toLocaleLowerCase()||"";let e=0;for(;e<t.length;){const s=t.indexOf(i,e);if(-1===s)break;const r=new Range;r.setStart(o,s),r.setEnd(o,s+i.length),n.push(r),e=s+i.length}o=s.nextNode()}}if(0===n.length&&e.length>0)return null;switch(i){case"selected":if("false"!==this.treeView?.getNodeCheckedValue(t))return n;break;case"all":return n}return null}get filterMode(){const t=this.filterModeControl?.current;return t?t.getAttribute("data-name"):null}get queryString(){return this.filterInput.value}*eachDescendantDepthFirst(t,e,i){for(const n of t.querySelectorAll(`[role=treeitem][data-node-type='sub-tree'][aria-level='${e}']`)){const t=n.closest("tree-view-sub-tree-node");yield*this.eachDescendantDepthFirst(t,e+1,[...i,t])}const n=t.querySelectorAll(`[role=treeitem][data-node-type='leaf'][aria-level='${e}']`);yield[n,i]}*eachShallowestCheckedSubTree(t){if("true"!==this.treeView?.getNodeCheckedValue(t.node))for(const e of t.eachDirectDescendantSubTreeNode())yield*this.eachShallowestCheckedSubTree(e);else yield t}};rl=new WeakMap,al=new WeakMap,ll=new WeakMap,ol=new WeakSet,cl=function(t){const e=t;if("treeViewNodeChecked"===t.type)b(this,ol,"m",dl).call(this,e)},dl=function(t){if(!this.treeView)return;if(!this.includeSubItemsCheckBox.checked)return;const e=t.detail[0];if("sub-tree"!==this.treeView.getNodeType(e.node))return;const i=e.node.closest("tree-view-sub-tree-node");"false"===e.checkedValue?b(this,ol,"m",hl).call(this,i):b(this,ol,"m",gl).call(this,i)},hl=function(t){if(!this.treeView)return;if(!b(this,ll,"f").has(t))return;const e=b(this,ll,"f").get(t);for(const[t,i]of e.entries()){let e=t;t instanceof Za&&(e=t.node),this.treeView.setNodeCheckedValue(e,i.checked?"true":"false"),this.treeView.setNodeDisabledValue(e,i.disabled)}b(this,ll,"f").delete(t)},ul=function(t){"itemActivated"===t.type&&b(this,ol,"m",vl).call(this)},ml=function(t){"input"===t.type&&b(this,ol,"m",vl).call(this)},fl=function(t){this.treeView&&"input"===t.type&&(b(this,ol,"m",vl).call(this),this.includeSubItemsCheckBox.checked?b(this,ol,"m",pl).call(this):b(this,ol,"m",bl).call(this))},pl=function(){if(this.treeView)for(const t of this.treeView.rootSubTreeNodes())for(const e of this.eachShallowestCheckedSubTree(t))b(this,ol,"m",gl).call(this,e)},gl=function(t){if(!this.treeView)return;const e=new Map;for(const i of t.eachDescendantNode())e.set(i,{checked:"true"===this.treeView.getNodeCheckedValue(i),disabled:this.treeView.getNodeDisabledValue(i)}),this.treeView.setNodeCheckedValue(i,"true"),this.treeView.setNodeDisabledValue(i,!0);b(this,ll,"f").set(t,e)},bl=function(){for(const t of b(this,ll,"f").keys())b(this,ol,"m",hl).call(this,t)},vl=function(){if(!this.treeView)return;b(this,ol,"m",El).call(this);const t=this.queryString,e=this.filterMode||void 0,i=window.crypto.randomUUID(),n=new Map,s=(...n)=>{for(const s of n)s.expand(),s.removeAttribute("hidden"),s.setAttribute("data-generation",i),o(s.node,t,e)?s.node.removeAttribute("aria-disabled"):s.node.setAttribute("aria-disabled","true")},o=(t,e,i)=>(n.has(t)||n.set(t,this.filterFn(t,e,i)),null!==n.get(t));for(const[n,r]of this.eachDescendantDepthFirst(this.treeViewList,1,[])){const a=r[r.length-1];let l=!1;for(const i of n)o(i,t,e)?(i.closest("li")?.removeAttribute("hidden"),l=!0):i.closest("li")?.setAttribute("hidden","hidden");l?s(...r):a&&(o(a.node,t,e)?s(...r):a.getAttribute("data-generation")!==i&&(a.collapse(),a.setAttribute("hidden","hidden")))}const r=Array.from(n.values()).flat().filter(t=>null!==t);0===r.length&&t.length>0?(this.treeViewList.setAttribute("hidden","hidden"),this.noResultsMessage.removeAttribute("hidden")):(this.treeViewList.removeAttribute("hidden"),this.noResultsMessage.setAttribute("hidden","hidden"),b(this,ol,"m",wl).call(this,r))},wl=function(t){CSS.highlights?CSS.highlights.set("primer-filterable-tree-view-search-results",new Highlight(...t)):b(this,ol,"m",yl).call(this,t)},yl=function(t){const e=t[0].startContainer,i=e.parentNode,n=e.textContent,s=[];let o=0;for(const{startOffset:e,endOffset:i}of t){e>o&&s.push(document.createTextNode(n.slice(o,e)));const t=document.createElement("mark");t.textContent=n.slice(e,i),s.push(t),o=i}o<n.length&&s.push(document.createTextNode(n.slice(o)));for(const t of s.reverse())i.insertBefore(t,e.nextSibling);i.removeChild(e)},El=function(){for(const t of this.querySelectorAll("mark"))t.parentElement&&t.parentElement.replaceChildren(t.parentElement.textContent)},g([_],Al.prototype,"filterInput",void 0),g([_],Al.prototype,"filterModeControlList",void 0),g([_],Al.prototype,"treeViewList",void 0),g([_],Al.prototype,"noResultsMessage",void 0),g([_],Al.prototype,"includeSubItemsCheckBox",void 0),Al=g([K],Al),window.customElements.get("filterable-tree-view")||(window.FilterableTreeViewElement=Al,window.customElements.define("filterable-tree-view",Al))}();
|
|
1
|
+
!function(){"use strict";var t,e,i,n,s,o,r,a,l=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},c=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i};const h=new WeakMap;let d=null;class IncludeFragmentElement extends HTMLElement{constructor(){super(...arguments),t.add(this),e.set(this,!1),i.set(this,new IntersectionObserver(e=>{for(const s of e)if(s.isIntersecting){const{target:e}=s;if(l(this,i,"f").unobserve(e),!(e instanceof IncludeFragmentElement))return;"lazy"===e.loading&&l(this,t,"m",n).call(this)}},{rootMargin:"0px 0px 256px 0px",threshold:.01}))}static define(t="include-fragment",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){d=null===t?t:Promise.resolve(t)}static get observedAttributes(){return["src","loading"]}get src(){const t=this.getAttribute("src");if(t){const e=this.ownerDocument.createElement("a");return e.href=t,e.href}return""}set src(t){this.setAttribute("src",t)}get loading(){return"lazy"===this.getAttribute("loading")?"lazy":"eager"}set loading(t){this.setAttribute("loading",t)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",t)}get data(){return l(this,t,"m",o).call(this)}attributeChangedCallback(e,i){"src"===e?this.isConnected&&"eager"===this.loading&&l(this,t,"m",n).call(this):"loading"===e&&this.isConnected&&"eager"!==i&&"eager"===this.loading&&l(this,t,"m",n).call(this)}connectedCallback(){if(!this.shadowRoot){this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=":host {display: block;}",this.shadowRoot.append(t,document.createElement("slot"))}this.src&&"eager"===this.loading&&l(this,t,"m",n).call(this),"lazy"===this.loading&&l(this,i,"f").observe(this)}request(){const t=this.src;if(!t)throw new Error("missing src");return new Request(t,{method:"GET",credentials:"same-origin",headers:{Accept:this.accept||"text/html"}})}load(){return l(this,t,"m",o).call(this)}fetch(t){return fetch(t)}refetch(){h.delete(this),l(this,t,"m",n).call(this)}}e=new WeakMap,i=new WeakMap,t=new WeakSet,n=async function(){if(!l(this,e,"f")){c(this,e,!0,"f"),l(this,i,"f").unobserve(this);try{const i=await l(this,t,"m",s).call(this);if(i instanceof Error)throw i;const n=i,o=document.createElement("template");o.innerHTML=n;const r=document.importNode(o.content,!0);if(!this.dispatchEvent(new CustomEvent("include-fragment-replace",{cancelable:!0,detail:{fragment:r}})))return void c(this,e,!1,"f");this.replaceWith(r),this.dispatchEvent(new CustomEvent("include-fragment-replaced"))}catch(t){this.classList.add("is-error")}finally{c(this,e,!1,"f")}}},s=async function(){const e=this.src,i=h.get(this);if(i&&i.src===e)return i.data;{let i;return i=e?l(this,t,"m",a).call(this):Promise.reject(new Error("missing src")),h.set(this,{src:e,data:i}),i}},o=async function(){const e=await l(this,t,"m",s).call(this);if(e instanceof Error)throw e;return e.toString()},r=async function(t,e){await new Promise(t=>setTimeout(t,0));for(const i of t)this.dispatchEvent(e?new CustomEvent(i,{detail:{error:e}}):new Event(i))},a=async function(){try{await l(this,t,"m",r).call(this,["loadstart"]);const i=await this.fetch(this.request()),n=i.headers.get("Content-Type");if(!(e=this.accept,e&&e.split(",").find(t=>t.match(/^\s*\*\/\*/))||n&&n.includes(this.accept?this.accept:"text/html")))throw new Error(`Failed to load resource: expected ${this.accept||"text/html"} but was ${n}`);if(200!==i.status)throw new Error(`Failed to load resource: the server responded with a status of ${i.status}`);const s=await i.text();let o=s;if(d){o=(await d).createHTML(s,i)}return l(this,t,"m",r).call(this,["load","loadend"]),o}catch(e){throw l(this,t,"m",r).call(this,["error","loadend"],e),e}var e};const u="undefined"!=typeof globalThis?globalThis:window;try{u.IncludeFragmentElement=IncludeFragmentElement.define()}catch(t){if(!(u.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}const m=new WeakMap;class RemoteInputElement extends HTMLElement{constructor(){super();const t=f.bind(null,this,!0),e={currentQuery:null,oninput:p(e=>t(e)),fetch:t,controller:null};m.set(this,e)}static get observedAttributes(){return["src"]}attributeChangedCallback(t,e){e&&"src"===t&&f(this,!1)}connectedCallback(){const t=this.input;if(!t)return;t.setAttribute("autocomplete","off"),t.setAttribute("spellcheck","false");const e=m.get(this);e&&(t.addEventListener("focus",e.fetch),t.addEventListener("change",e.fetch),t.addEventListener("input",e.oninput))}disconnectedCallback(){const t=this.input;if(!t)return;const e=m.get(this);e&&(t.removeEventListener("focus",e.fetch),t.removeEventListener("change",e.fetch),t.removeEventListener("input",e.oninput))}get input(){const t=this.querySelector("input, textarea");return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t:null}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}}async function f(t,e,i){const n=t.input;if(!n)return;const s=m.get(t);if(!s)return;const o=n.value;if(e&&s.currentQuery===o)return;s.currentQuery=o;const r=t.src;if(!r)return;const a=document.getElementById(t.getAttribute("aria-owns")||"");if(!a)return;const l=new URL(r,window.location.href),c=new URLSearchParams(l.search);let h;c.append(t.getAttribute("param")||"q",o),l.search=c.toString(),s.controller?s.controller.abort():(t.dispatchEvent(new CustomEvent("loadstart")),t.setAttribute("loading","")),s.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};let d="";try{h=await async function(t,e,i){try{const n=await fetch(e,i);return t.dispatchEvent(new CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),n}catch(e){throw e instanceof Error&&"AbortError"!==(null==e?void 0:e.name)&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),e}}(t,l.toString(),{signal:s.controller.signal,credentials:"same-origin",headers:{accept:"text/fragment+html"}}),d=await h.text(),t.removeAttribute("loading"),s.controller=null}catch(e){return void(e instanceof Error&&"AbortError"!==e.name&&(t.removeAttribute("loading"),s.controller=null))}h&&h.ok?(a.innerHTML=d,t.dispatchEvent(new CustomEvent("remote-input-success",{bubbles:!0,detail:{eventType:i?i.type:void 0}}))):t.dispatchEvent(new CustomEvent("remote-input-error",{bubbles:!0}))}function p(t){let e;return function(i){clearTimeout(e),e=setTimeout(()=>{clearTimeout(e),t(i)},300)}}function g(t,e,i,n){var s,o=arguments.length,r=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,i,r):s(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r}function b(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)}function v(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i}window.customElements.get("remote-input")||(window.RemoteInputElement=RemoteInputElement,window.customElements.define("remote-input",RemoteInputElement)),"function"==typeof SuppressedError&&SuppressedError;const w=new WeakSet;function y(t){k(t),A(t)}const E=new WeakMap;function A(t=document){if(E.has(t))return E.get(t);let e=!1;const i=new MutationObserver(t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)T(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&k(t)});i.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const n={get closed(){return e},unsubscribe(){e=!0,E.delete(t),i.disconnect()}};return E.set(t,n),n}function k(t){for(const e of t.querySelectorAll("[data-action]"))T(e);t instanceof Element&&t.hasAttribute("data-action")&&T(t)}function L(t){const e=t.currentTarget;for(const i of S(e))if(t.type===i.type){const n=e.closest(i.tag);w.has(n)&&"function"==typeof n[i.method]&&n[i.method](t);const s=e.getRootNode();if(s instanceof ShadowRoot&&w.has(s.host)&&s.host.matches(i.tag)){const e=s.host;"function"==typeof e[i.method]&&e[i.method](t)}}}function*S(t){for(const e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){const t=e.lastIndexOf(":"),i=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,t),tag:e.slice(t+1,i),method:e.slice(i+1)||"handleEvent"}||"handleEvent"}}function T(t){for(const e of S(t))t.addEventListener(e.type,L)}const C=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),x=(t,e="property")=>{const i=C(t);if(!i.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return i};const M="attr";function I(t,e){_(t,M).add(e)}const D=new WeakSet;function P(t,e){if(D.has(t))return;D.add(t);const i=Object.getPrototypeOf(t),n=i?.constructor?.attrPrefix??"data-";e||(e=_(i,M));for(const i of e){const e=t[i],s=x(`${n}${i}`);let o={configurable:!0,get(){return this.getAttribute(s)||""},set(t){this.setAttribute(s,t||"")}};"number"==typeof e?o={configurable:!0,get(){return Number(this.getAttribute(s)||0)},set(t){this.setAttribute(s,t)}}:"boolean"==typeof e&&(o={configurable:!0,get(){return this.hasAttribute(s)},set(t){this.toggleAttribute(s,t)}}),Object.defineProperty(t,i,o),i in t&&!t.hasAttribute(s)&&o.set.call(t,e)}}const N=new Map,O=new Promise(t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",()=>t(),{once:!0})}),F=new Promise(t=>{const e=new AbortController;e.signal.addEventListener("abort",()=>t());const i={once:!0,passive:!0,signal:e.signal},n=()=>e.abort();document.addEventListener("mousedown",n,i),document.addEventListener("touchstart",n,i),document.addEventListener("keydown",n,i),document.addEventListener("pointerdown",n,i)}),H={ready:()=>O,firstInteraction:()=>F,visible:t=>new Promise(e=>{const i=new IntersectionObserver(t=>{for(const n of t)if(n.isIntersecting)return e(),void i.disconnect()},{rootMargin:"0px 0px 256px 0px",threshold:.01});for(const e of document.querySelectorAll(t))i.observe(e)})},q=new Set;let V,R=null;function W(t){q.add(t),null==R&&(R=requestAnimationFrame(()=>{R=null;const t=new Set(q);if(q.clear(),N.size)t:for(const e of t)for(const t of N.keys()){const i=e instanceof Element&&e.matches(t)?e:e.querySelector(t);if(customElements.get(t)||i){const e=i?.getAttribute("data-load-on")||"ready",n=e in H?H[e]:H.ready;for(const e of N.get(t)||[])n(t).then(e);if(N.delete(t),!N.size)break t}}}))}const B=Symbol.for("catalyst");class ${constructor(t,e){const i=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){i.connectedCallback(this,n)};const s=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){i.disconnectedCallback(this,s)};const o=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,e,n){i.attributeChangedCallback(this,t,e,n,o)};let r=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return i.observedAttributes(this,r)},set(t){r=t}}),function(t){let e=t.observedAttributes||[];const i=t.attrPrefix??"data-",n=t=>x(`${i}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[..._(t.prototype,M)].map(n).concat(e),set(t){e=t}})}(t),function(t,e){const i=e||C(t.name).replace(/-element$/,"");try{window.customElements.define(i,t),window[t.name]=customElements.get(i)}catch(t){if(!(t instanceof DOMException&&"NotSupportedError"===t.name))throw t}}(t,e)}observedAttributes(t,e){return e}connectedCallback(t,e){t.toggleAttribute("data-catalyst",!0),customElements.upgrade(t),function(t){for(const e of t.querySelectorAll("template[data-shadowroot]"))e.parentElement===t&&t.attachShadow({mode:"closed"===e.getAttribute("data-shadowroot")?"closed":"open"}).append(e.content.cloneNode(!0))}(t),P(t),function(t){w.add(t),t.shadowRoot&&y(t.shadowRoot),k(t),A(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&(y(t.shadowRoot),function(t){V||(V=new MutationObserver(t=>{if(N.size)for(const e of t)for(const t of e.addedNodes)t instanceof Element&&W(t)})),W(t),V.observe(t,{subtree:!0,childList:!0})}(t.shadowRoot))}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,i,n,s){P(t),"data-catalyst"!==e&&s&&s.call(t,e,i,n)}}function _(t,e){if(!Object.prototype.hasOwnProperty.call(t,B)){const e=t[B],i=t[B]=new Map;if(e)for(const[t,n]of e)i.set(t,new Set(n))}const i=t[B];return i.has(e)||i.set(e,new Set),i.get(e)}function U(t,e){_(t,"target").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const i=t.tagName.toLowerCase();if(t.shadowRoot)for(const n of t.shadowRoot.querySelectorAll(`[data-target~="${i}.${e}"]`))if(!n.closest(i))return n;for(const n of t.querySelectorAll(`[data-target~="${i}.${e}"]`))if(n.closest(i)===t)return n}(this,e)}})}function j(t,e){_(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const i=t.tagName.toLowerCase(),n=[];if(t.shadowRoot)for(const s of t.shadowRoot.querySelectorAll(`[data-targets~="${i}.${e}"]`))s.closest(i)||n.push(s);for(const s of t.querySelectorAll(`[data-targets~="${i}.${e}"]`))s.closest(i)===t&&n.push(s);return n}(this,e)}})}function K(t){if("string"==typeof t)return e=>{new $(e,t)};new $(t)}var z;class Z{constructor(t){this.resizeObserver=new ResizeObserver(t=>{for(const e of t){const t=e.target;t instanceof HTMLElement&&this.update(t)}}),this.resizeObserver.observe(t)}unobserve(t){this.resizeObserver.unobserve(t)}update(t){const e=t.querySelectorAll("li");for(const t of e){const e=t.querySelector(".ActionListItem-label");if(!e)continue;const i=t.querySelector(".ActionListItem-truncationTooltip");if(!i)continue;const n=e.scrollWidth>e.clientWidth;i.style.display=n?"":"none"}}}let Y=class ActionListElement extends HTMLElement{constructor(){super(...arguments),z.set(this,void 0)}connectedCallback(){v(this,z,new Z(this),"f")}disconnectedCallback(){b(this,z,"f").unobserve(this)}};z=new WeakMap,Y=g([K("action-list")],Y);const G={"outside-top":["outside-bottom","outside-right","outside-left","outside-bottom"],"outside-bottom":["outside-top","outside-right","outside-left","outside-bottom"],"outside-left":["outside-right","outside-bottom","outside-top","outside-bottom"],"outside-right":["outside-left","outside-bottom","outside-top","outside-bottom"]},J={start:["end","center"],end:["start","center"],center:["end","start"]};function X(t,e,i={}){const{positionedParent:n,clippingNode:s,positionedParentStyle:o,clippingNodeStyle:r}=function(t){if(function(t){var e;if("DIALOG"===t.tagName)return!0;try{if(t.matches(":popover-open")&&/native code/.test(null===(e=document.body.showPopover)||void 0===e?void 0:e.toString()))return!0}catch(t){return!1}return!1}(t))return{positionedParent:document.body,clippingNode:document.body,positionedParentStyle:null,clippingNodeStyle:null};let e=null,i=null,n=null,s=null,o=t.parentNode;for(;null!==o&&o!==document.body;){if(o instanceof HTMLElement){const t=getComputedStyle(o);if(e||"static"===t.position||(e=o,n=t),i||"visible"===t.overflow||(i=o,s=t),e&&i)break}o=o.parentNode}return{positionedParent:null!=e?e:document.body,clippingNode:null!=i?i:document.body,positionedParentStyle:n,clippingNodeStyle:s}}(t),a=function(t,e=null){const i=t.getBoundingClientRect(),n=e||getComputedStyle(t),s=parseInt(n.borderTopWidth,10)||0,o=parseInt(n.borderLeftWidth,10)||0,r=parseInt(n.borderRightWidth,10)||0,a=parseInt(n.borderBottomWidth,10)||0;return{top:i.top+s,left:i.left+o,width:i.width-r-o,height:Math.max(i.height-s-a,t===document.body?window.innerHeight:-1/0)}}(s,r),l=o||getComputedStyle(n),c=n.getBoundingClientRect(),[h,d]=[l.borderTopWidth,l.borderLeftWidth].map(t=>parseInt(t,10)||0);return function(t,e,i,n,{side:s,align:o,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:l,displayInViewport:c},h){let d=t;c&&(d={top:0,left:0,width:h.width,height:h.height});const u={top:d.top-e.top,left:d.left-e.left,width:d.width,height:d.height};let m=tt(i,n,s,o,a,l),f=s,p=o;if(m.top-=e.top,m.left-=e.left,!r){const t=G[s];let r=0;if(t){let c=s;for(;r<t.length&&et(c,m,u,i);){const s=t[r++];c=s,m=tt(i,n,s,o,a,l),m.top-=e.top,m.left-=e.left,f=s}}const h=J[o];let g=0;if(h){let t=o;for(;g<h.length&&it(t,m,u,i);){const s=h[g++];t=s,m=tt(i,n,f,s,a,l),m.top-=e.top,m.left-=e.left,p=s}}m.top<u.top&&(m.top=u.top),m.left<u.left&&(m.left=u.left),m.left+i.width>d.width+u.left&&(m.left=d.width+u.left-i.width),(c||t&&r<t.length)&&m.top+i.height>d.height+u.top&&(m.top=Math.max(d.height+u.top-i.height,0))}return Object.assign(Object.assign({},m),{anchorSide:f,anchorAlign:p})}(a,{top:c.top+h,left:c.left+d},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,i,n,s,o,r;const a=null!==(e=t.side)&&void 0!==e?e:Q.side,l=null!==(i=t.align)&&void 0!==i?i:Q.align;return{side:a,align:l,anchorOffset:null!==(n=t.anchorOffset)&&void 0!==n?n:"inside-center"===a?0:Q.anchorOffset,alignmentOffset:null!==(s=t.alignmentOffset)&&void 0!==s?s:"center"!==l&&a.startsWith("inside")?Q.alignmentOffset:0,allowOutOfBounds:null!==(o=t.allowOutOfBounds)&&void 0!==o?o:Q.allowOutOfBounds,displayInViewport:null!==(r=t.displayInViewport)&&void 0!==r?r:Q.displayInViewport}}(i),{width:window.innerWidth,height:window.innerHeight})}const Q={side:"outside-bottom",align:"start",anchorOffset:4,alignmentOffset:4,allowOutOfBounds:!1,displayInViewport:!1};function tt(t,e,i,n,s,o){const r=e.left+e.width,a=e.top+e.height;let l=-1,c=-1;return"outside-top"===i?l=e.top-s-t.height:"outside-bottom"===i?l=a+s:"outside-left"===i?c=e.left-s-t.width:"outside-right"===i&&(c=r+s),"outside-top"!==i&&"outside-bottom"!==i||(c="start"===n?e.left+o:"center"===n?e.left-(t.width-e.width)/2+o:r-t.width-o),"outside-left"!==i&&"outside-right"!==i||(l="start"===n?e.top+o:"center"===n?e.top-(t.height-e.height)/2+o:a-t.height-o),"inside-top"===i?l=e.top+s:"inside-bottom"===i?l=a-s-t.height:"inside-left"===i?c=e.left+s:"inside-right"===i?c=r-s-t.width:"inside-center"===i&&(c=(r+e.left)/2-t.width/2+s),"inside-top"===i||"inside-bottom"===i?c="start"===n?e.left+o:"center"===n?e.left-(t.width-e.width)/2+o:r-t.width-o:"inside-left"!==i&&"inside-right"!==i&&"inside-center"!==i||(l="start"===n?e.top+o:"center"===n?e.top-(t.height-e.height)/2+o:a-t.height-o),{top:l,left:c}}function et(t,e,i,n){return"outside-top"===t||"outside-bottom"===t?e.top<i.top||e.top+n.height>i.height+i.top:e.left<i.left||e.left+n.width>i.width+i.left}function it(t,e,i,n){return"end"===t?e.left<i.left:"start"===t||"center"===t?e.left+n.width>i.left+i.width||e.left<i.left:void 0}function*nt(t,e={}){var i,n;const s=null!==(i=e.strict)&&void 0!==i&&i,o=null!==(n=e.onlyTabbable)&&void 0!==n&&n?at:rt,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&o(t,s)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&o(t,s)&&(yield t),e.reverse){let t=r.lastChild();for(;t;)a=t,t=r.lastChild()}else a=r.firstChild();for(;a instanceof HTMLElement;)yield a,a=e.reverse?r.previousNode():r.nextNode();e.reverse&&o(t,s)&&(yield t)}function st(t,e=!1){return nt(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}const ot=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"]);function rt(t,e=!1){if(t.hidden)return!1;if(t.classList.contains("sentinel"))return!1;if(t instanceof HTMLInputElement&&"hidden"===t.type)return!1;if(ot.has(t.tagName)&&t.disabled)return!1;if(e){const e=t.offsetWidth,i=t.offsetHeight,n=t.offsetParent;if(0===e||0===i)return!1;const s=getComputedStyle(t);if("none"===s.display)return!1;if("hidden"===s.visibility||"collapse"===s.visibility)return!1;const o=s.position;if(!n&&"fixed"!==o&&"sticky"!==o)return!1;if(0===t.getClientRects().length)return!1}return null!=t.getAttribute("tabindex")||("true"===t.getAttribute("contenteditable")||"plaintext-only"===t.getAttribute("contenteditable")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex)}function at(t,e=!1){return rt(t,e)&&"-1"!==t.getAttribute("tabindex")}let lt=!1;function ct(){}try{const t=Object.create({},{signal:{get(){lt=!0}}});window.addEventListener("test",ct,t),window.removeEventListener("test",ct,t)}catch(t){}function ht(){lt||(!function(){if("undefined"==typeof window)return;const t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(e,i,n){return"object"==typeof n&&"signal"in n&&n.signal instanceof AbortSignal&&t.call(n.signal,"abort",()=>{this.removeEventListener(e,i,n)}),t.call(this,e,i,n)}}(),lt=!0)}ht();const dt=[];let ut;function mt(t){if(!t)return;const e=t.hasAttribute("data-prevent-scroll-on-focus");t.focus({preventScroll:e})}function ft({onFocus:t}){const e=document.createElement("span");return e.setAttribute("class","sentinel"),e.setAttribute("tabindex","0"),e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",e.onfocus=t,e}function pt(t,e,i){const n=new AbortController,s=null!=i?i:n.signal;t.setAttribute("data-focus-trap","active");const o=ft({onFocus:()=>{mt(st(t,!0))}}),r=ft({onFocus:()=>{mt(st(t))}});null!==t.querySelector(":scope > span.sentinel")||(t.prepend(o),t.append(r));const a=function(t,e){const i=new MutationObserver(i=>{for(const n of i)if("childList"===n.type&&n.addedNodes.length){for(const t of n.addedNodes)if(t instanceof HTMLElement&&"SPAN"===t.tagName&&t.classList.contains("sentinel"))return;const i=t.firstElementChild,s=t.lastElementChild,[o,r]=e;(null==i?void 0:i.classList.contains("sentinel"))||t.insertAdjacentElement("afterbegin",o),(null==s?void 0:s.classList.contains("sentinel"))||t.insertAdjacentElement("beforeend",r)}});return i.observe(t,{childList:!0}),i}(t,[o,r]);let l;function c(i){if(i instanceof HTMLElement&&document.contains(t)){if(t.contains(i))return void(l=i);if(l&&at(l)&&t.contains(l))return void mt(l);if(e&&t.contains(e))return void mt(e);return void mt(st(t))}}const h=function(t){const e=new AbortController;return t.addEventListener("abort",()=>{e.abort()}),e}(s);if(ut){const t=ut;ut.container.setAttribute("data-focus-trap","suspended"),ut.controller.abort(),dt.push(t)}h.signal.addEventListener("abort",()=>{ut=void 0}),s.addEventListener("abort",()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const i=dt.findIndex(e=>e.container===t);i>=0&&dt.splice(i,1),a.disconnect(),function(){const t=dt.pop();t&&pt(t.container,t.initialFocus,t.originalSignal)}()}),document.addEventListener("focus",t=>{c(t.target)},{signal:h.signal,capture:!0}),c(document.activeElement),ut={container:t,controller:h,initialFocus:e,originalSignal:s};const d=dt.findIndex(e=>e.container===t);if(d>=0&&dt.splice(d,1),!i)return n}let gt;function bt(){return void 0===gt&&(gt=/^mac/i.test(window.navigator.platform)),gt}let vt=1e4;const wt=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);class yt{constructor(){this._items=[],this._itemSet=new Set,this._indexMap=new Map}insertAt(t,e){let i;if(e.length<=100)i=e.filter((t,e,i)=>!this._itemSet.has(t)&&i.indexOf(t)===e);else{const t=new Set;i=[];for(let n=0;n<e.length;n++){const s=e[n];this._itemSet.has(s)||t.has(s)||(t.add(s),i.push(s))}}if(0===i.length)return;const n=Math.max(0,Math.min(t,this._items.length));if(n!==this._items.length)if(0!==n){for(let t=this._items.length-1;t>=n;t--)this._indexMap.set(this._items[t],t+i.length);i.length<=1e4?this._items.splice(n,0,...i):this._chunkedInsert(n,i);for(let t=0;t<i.length;t++){const e=i[t];this._itemSet.add(e),this._indexMap.set(e,n+t)}}else{for(let t=0;t<this._items.length;t++)this._indexMap.set(this._items[t],t+i.length);i.length<=1e4?this._items.splice(0,0,...i):this._chunkedInsert(0,i);for(let t=0;t<i.length;t++)this._itemSet.add(i[t]),this._indexMap.set(i[t],t)}else for(let t=0;t<i.length;t++){const e=i[t];this._indexMap.set(e,this._items.length),this._items.push(e),this._itemSet.add(e)}}_chunkedInsert(t,e){for(let i=0;i<e.length;i+=1e4){const n=e.slice(i,i+1e4);this._items.splice(t+i,0,...n)}}delete(t){if(!this._itemSet.has(t))return!1;const e=this._indexMap.get(t);this._items.splice(e,1),this._itemSet.delete(t),this._indexMap.delete(t);for(let t=e;t<this._items.length;t++)this._indexMap.set(this._items[t],t);return!0}has(t){return this._itemSet.has(t)}indexOf(t){var e;return null!==(e=this._indexMap.get(t))&&void 0!==e?e:-1}get(t){return this._items[t]}get size(){return this._items.length}[Symbol.iterator](){return this._items[Symbol.iterator]()}clear(){this._items=[],this._itemSet.clear(),this._indexMap.clear()}find(t){return this._items.find(t)}}var Et;ht(),function(t){t[t.ArrowHorizontal=1]="ArrowHorizontal",t[t.ArrowVertical=2]="ArrowVertical",t[t.JK=4]="JK",t[t.HL=8]="HL",t[t.HomeAndEnd=16]="HomeAndEnd",t[t.PageUpDown=256]="PageUpDown",t[t.WS=32]="WS",t[t.AD=64]="AD",t[t.Tab=128]="Tab",t[t.Backspace=512]="Backspace",t[t.ArrowAll=3]="ArrowAll",t[t.HJKL=12]="HJKL",t[t.WASD=96]="WASD",t[t.All=511]="All"}(Et||(Et={}));const At={ArrowLeft:Et.ArrowHorizontal,ArrowDown:Et.ArrowVertical,ArrowUp:Et.ArrowVertical,ArrowRight:Et.ArrowHorizontal,h:Et.HL,j:Et.JK,k:Et.JK,l:Et.HL,a:Et.AD,s:Et.WS,w:Et.WS,d:Et.AD,Tab:Et.Tab,Home:Et.HomeAndEnd,End:Et.HomeAndEnd,PageUp:Et.PageUpDown,PageDown:Et.PageUpDown,Backspace:Et.Backspace},kt={ArrowLeft:"previous",ArrowDown:"next",ArrowUp:"previous",ArrowRight:"next",h:"previous",j:"next",k:"previous",l:"next",a:"previous",s:"next",w:"previous",d:"next",Tab:"next",Home:"start",End:"end",PageUp:"start",PageDown:"end",Backspace:"previous"};function Lt(t){const e=kt[t.key];if("Tab"===t.key&&t.shiftKey)return"previous";const i=bt();if(i&&t.metaKey||!i&&t.ctrlKey){if("ArrowLeft"===t.key||"ArrowUp"===t.key)return"start";if("ArrowRight"===t.key||"ArrowDown"===t.key)return"end"}return e}function St(t,e){const i=t.key,n=1===i.length||2===i.length&&i.charCodeAt(0)>=55296&&i.charCodeAt(0)<=56319,s=function(t){var e,i;if(!(t instanceof HTMLElement))return!1;const n=t.nodeName.toLowerCase(),s=null!==(i=null===(e=t.getAttribute("type"))||void 0===e?void 0:e.toLowerCase())&&void 0!==i?i:"text",o="true"===t.ariaReadOnly||"true"===t.getAttribute("aria-readonly")||null!==t.getAttribute("readonly");return("select"===n||"textarea"===n||"input"===n&&!wt.has(s)||t.isContentEditable)&&!o}(e),o=e instanceof HTMLSelectElement;if(s&&(n||"Home"===i||"End"===i))return!0;if(o){const e=bt();return!("ArrowDown"!==i||!e||t.metaKey)||!("ArrowDown"!==i||e||!t.altKey)}if(s&&!o){const t=e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement,n=t&&0===e.selectionStart&&0===e.selectionEnd,s=t&&e.selectionStart===e.value.length&&e.selectionEnd===e.value.length;if("ArrowLeft"===i&&!n)return!0;if("ArrowRight"===i&&!s)return!0;const o=e instanceof HTMLElement&&e.isContentEditable;if(e instanceof HTMLTextAreaElement||o){if("PageUp"===i||"PageDown"===i)return!0;if("ArrowUp"===i&&!n)return!0;if("ArrowDown"===i&&!s)return!0}}return!1}const Tt="data-is-active-descendant",Ct="data-has-active-descendant";function xt(t,e){var i,n,s,o,r,a,l;const c=new yt,h=new WeakMap,d=null!==(i=null==e?void 0:e.bindKeys)&&void 0!==i?i:((null==e?void 0:e.getNextFocusable)?Et.ArrowAll:Et.ArrowVertical)|Et.HomeAndEnd,u=null!==(n=null==e?void 0:e.focusOutBehavior)&&void 0!==n?n:"stop",m=null!==(s=null==e?void 0:e.focusInStrategy)&&void 0!==s?s:"previous",f=null==e?void 0:e.activeDescendantControl,p=null==e?void 0:e.onActiveDescendantChanged,g=null!==(o=null==e?void 0:e.ignoreHoverEvents)&&void 0!==o&&o,b=null!==(r=null==e?void 0:e.focusPrependedElements)&&void 0!==r&&r;let v,w=!1;const y=null!==(a=null==e?void 0:e.preventScroll)&&void 0!==a&&a,E="initial"===m&&(null==e?void 0:e.activeDescendantControl);function A(){return c.get(0)}function k(t,e=!1){const i=v;v=t,w=e,f?t&&document.activeElement===f?L(i,t,e):S():(i&&i!==t&&h.has(i)&&i.setAttribute("tabindex","-1"),null==t||t.setAttribute("tabindex","0"))}function L(e,i,n=!1){i.id||i.setAttribute("id","__primer_id_"+vt++),e&&e!==i&&e.removeAttribute(Tt),f&&(n||f.getAttribute("aria-activedescendant")!==i.id)&&(f.setAttribute("aria-activedescendant",i.id),t.setAttribute(Ct,i.id),i.setAttribute(Tt,n?"activated-directly":"activated-indirectly"),null==p||p(i,e,n))}function S(e=v){"first"===m&&(v=void 0),null==f||f.removeAttribute("aria-activedescendant"),t.removeAttribute(Ct),null==e||e.removeAttribute(Tt);const i=t.querySelectorAll(`[${Tt}]`);for(let t=0;t<i.length;t++)i[t].removeAttribute(Tt);null==p||p(void 0,e,!1)}function T(...t){const i=(null==e?void 0:e.focusableElementFilter)?t.filter(t=>e.focusableElementFilter(t)):t;if(0===i.length)return;const n=function(t){const e=t[0];if(0===c.size)return 0;let i=0,n=c.size-1;for(;i<=n;){const t=Math.floor((i+n)/2);x(e,c.get(t))?n=t-1:i=t+1}return i}(i);c.insertAt(n,i);for(const t of i)h.has(t)||h.set(t,t.getAttribute("tabindex")),t.setAttribute("tabindex","-1");!E&&(b&&0===n&&!w)?C():E||v||k(A())}function C(){const e=[...nt(t,I)];c.clear(),c.insertAt(0,e);for(const t of e)h.has(t)||h.set(t,t.getAttribute("tabindex")),t.setAttribute("tabindex","-1");k(A())}function x(t,e){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)>0}function M(...t){for(const e of t){c.delete(e);const t=h.get(e);if(void 0!==t&&(null===t?e.removeAttribute("tabindex"):e.setAttribute("tabindex",t),h.delete(e)),e===v){k(A())}}}const I={reverse:null==e?void 0:e.reverse,strict:null==e?void 0:e.strict,onlyTabbable:null==e?void 0:e.onlyTabbable};T(...nt(t,I));const D="function"==typeof m?m(document.body):A();E||k(D);const P=new MutationObserver(t=>{const e=new Set,i=new Set,n=new Set,s=new Set;for(const o of t)if("childList"===o.type){for(const t of o.removedNodes)t instanceof HTMLElement&&e.add(t);for(const t of o.addedNodes)t instanceof HTMLElement&&i.add(t)}else if("attributes"===o.type&&o.target instanceof HTMLElement){const t=o.attributeName;!!t&&o.target.hasAttribute(t)?n.add(o.target):s.add(o.target)}if(e.size>0){const t=[];for(const i of e)for(const e of nt(i))t.push(e);t.length>0&&M(...t)}if(n.size>0&&M(...n),i.size>0){const t=[];for(const e of i)for(const i of nt(e,I))t.push(i);t.length>0&&(b?C():T(...t))}s.size>0&&T(...s)});P.observe(t,{subtree:!0,childList:!0,attributeFilter:["hidden","disabled"],attributeOldValue:!0});const N=new AbortController,O=null!==(l=null==e?void 0:e.abortSignal)&&void 0!==l?l:N.signal;let F;O.addEventListener("abort",()=>{P.disconnect(),M(...c),c.clear()}),t.addEventListener("mousedown",t=>{t.target instanceof HTMLElement&&t.target!==document.activeElement&&(F=c.indexOf(t.target))},{signal:O}),f?(t.addEventListener("focusin",t=>{t.target instanceof HTMLElement&&c.has(t.target)&&(f.focus({preventScroll:y}),k(t.target))},{signal:O}),g||t.addEventListener("mousemove",({target:t})=>{if(!(t instanceof Node))return;if(t instanceof HTMLElement&&c.has(t))return void k(t);const e=c.find(e=>e.contains(t));e&&k(e)},{signal:O,capture:!0}),f.addEventListener("focusin",()=>{v?L(void 0,v):E||k(A())},{signal:O}),f.addEventListener("focusout",()=>{S()},{signal:O})):t.addEventListener("focusin",e=>{if(e.target instanceof HTMLElement)if(void 0!==F){if(F>=0){const t=c.get(F);t&&t!==v&&k(t)}F=void 0}else if("previous"===m)k(e.target);else if("closest"===m||"first"===m){if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t="previous"===q?c.size-1:0,e=c.get(t);return void(null==e||e.focus({preventScroll:y}))}k(e.target)}else if("function"==typeof m)if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t=m(e.relatedTarget);if(t&&c.has(t))return void t.focus({preventScroll:y});console.warn("Element requested is not a known focusable element.")}else k(e.target);q=void 0},{signal:O});const H=null!=f?f:t;let q;return"closest"===m&&document.addEventListener("keydown",t=>{"Tab"===t.key&&(q=Lt(t))},{signal:O,capture:!0}),H.addEventListener("keydown",i=>{var n;if(i.key in kt){const s=At[i.key];if(!i.defaultPrevented&&(s&d)>0&&!St(i,document.activeElement)){const s=Lt(i);let o;if((null==e?void 0:e.getNextFocusable)&&(o=e.getNextFocusable(s,null!==(n=document.activeElement)&&void 0!==n?n:void 0,i)),!o){const e=function(){if(!v)return E?-1:0;const e=c.indexOf(v);return-1!==e?e:v===t?-1:0}();let n=e;"previous"===s?n-=1:"start"===s?n=0:"next"===s?n+=1:n=c.size-1,n<0&&(n="wrap"===u&&"Tab"!==i.key?c.size-1:0),n>=c.size&&(n="wrap"===u&&"Tab"!==i.key?0:c.size-1),e!==n&&(o=c.get(n))}f?k(o||v,!0):o&&(q=s,o.focus({preventScroll:y})),("Tab"!==i.key||o)&&i.preventDefault()}}},{signal:O}),N}var Mt,It,Dt,Pt,Nt,Ot,Ft,Ht;const qt=new IntersectionObserver(t=>{for(const e of t){const t=e.target;e.isIntersecting&&t instanceof Rt&&t.update()}}),Vt=new ResizeObserver(t=>{for(const e of t){const t=e.target;t instanceof Rt&&t.update()}});let Rt=class ActionBarElement extends HTMLElement{constructor(){super(...arguments),Mt.add(this),It.set(this,null),Dt.set(this,!1)}connectedCallback(){Vt.observe(this),qt.observe(this),this.style.overflow="visible",this.update()}disconnectedCallback(){Vt.unobserve(this),qt.unobserve(this)}menuItemClick(t){const e=t.currentTarget,i=e?.getAttribute("data-for");i&&document.getElementById(i)?.click()}update(){b(this,Dt,"f")||(v(this,Dt,!0,"f"),requestAnimationFrame(()=>{v(this,Dt,!1,"f"),b(this,Mt,"m",Pt).call(this)}))}};It=new WeakMap,Dt=new WeakMap,Mt=new WeakSet,Pt=function(){const t=b(this,Mt,"a",Nt);if(!t)return;const e=t.getBoundingClientRect().top,i=b(this,Mt,"a",Ht),n=Array.from(this.items,t=>({top:t.getBoundingClientRect().top,isDivider:t.classList.contains("ActionBar-divider")}));let s=!1;for(let t=0;t<n.length;t++){const o=n[t];o.isDivider?s=!0:(o.top>e?(b(this,Mt,"m",Ft).call(this,t,i),this.moreMenu.hidden&&(this.moreMenu.hidden=!1),s&&b(this,Mt,"m",Ft).call(this,t-1,i)):(b(this,Mt,"m",Ot).call(this,t,i),t===this.items.length-1&&(this.moreMenu.hidden=!0),s&&b(this,Mt,"m",Ot).call(this,t-1,i)),s=!1)}b(this,It,"f")&&b(this,It,"f").abort(),v(this,It,xt(this,{bindKeys:Et.ArrowHorizontal|Et.HomeAndEnd,focusOutBehavior:"wrap",focusableElementFilter:t=>{const e=this.items.indexOf(t.parentElement),i=e>-1&&"visible"===this.items[e].style.visibility,n=t===this.moreMenu.invokerElement&&!this.moreMenu.hidden;return i||n}}),"f")},Nt=function(){return this.items.find(t=>!t.classList.contains("ActionBar-divider"))??null},Ot=function(t,e){const i=this.items[t],n=e[t];i&&n&&(i.style.setProperty("visibility","visible"),n.hidden=!0)},Ft=function(t,e){const i=this.items[t],n=e[t];i&&n&&(i.style.setProperty("visibility","hidden"),n.hidden=!1)},Ht=function(){return this.moreMenu.querySelectorAll('[role="menu"] > li')},g([j],Rt.prototype,"items",void 0),g([U],Rt.prototype,"itemContainer",void 0),g([U],Rt.prototype,"moreMenu",void 0),Rt=g([K("action-bar")],Rt),window.ActionBarElement=Rt;class DetailsMenuElement extends HTMLElement{get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const i=[$t(t,"compositionstart",t=>Xt(this,t)),$t(t,"compositionend",t=>Xt(this,t)),$t(t,"click",e=>Zt(t,e)),$t(t,"change",e=>Zt(t,e)),$t(t,"keydown",e=>function(t,e,i){if(!(i instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const n=Wt.get(e);if(!n||n.isComposing)return;const s=i.target instanceof Element&&"SUMMARY"===i.target.tagName;switch(i.key){case"Escape":t.hasAttribute("open")&&(Jt(t),i.preventDefault(),i.stopPropagation());break;case"ArrowDown":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Kt(t,!0);e&&e.focus(),i.preventDefault()}break;case"ArrowUp":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Kt(t,!1);e&&e.focus(),i.preventDefault()}break;case"n":if(zt&&i.ctrlKey){const e=Kt(t,!0);e&&e.focus(),i.preventDefault()}break;case"p":if(zt&&i.ctrlKey){const e=Kt(t,!1);e&&e.focus(),i.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&Gt(e)&&e.closest("details")===t&&(i.preventDefault(),i.stopPropagation(),e.click())}}}(t,this,e)),$t(t,"toggle",()=>_t(t,this),{once:!0}),$t(t,"toggle",()=>function(t){if(!t.hasAttribute("open"))return;for(const e of document.querySelectorAll("details[open] > details-menu")){const i=e.closest("details");i&&i!==t&&!i.contains(t)&&i.removeAttribute("open")}}(t)),this.preload?$t(t,"mouseover",()=>_t(t,this),{once:!0}):Bt,...Ut(t)];Wt.set(this,{subscriptions:i,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=Wt.get(this);if(t){Wt.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const Wt=new WeakMap,Bt={unsubscribe(){}};function $t(t,e,i,n=!1){return t.addEventListener(e,i,n),{unsubscribe:()=>{t.removeEventListener(e,i,n)}}}function _t(t,e){const i=e.getAttribute("src");if(!i)return;const n=Wt.get(e);if(!n)return;if(n.loaded)return;n.loaded=!0;const s=e.querySelector("include-fragment");s&&!s.hasAttribute("src")&&(s.addEventListener("loadend",()=>jt(t)),s.setAttribute("src",i))}function Ut(t){let e=!1;return[$t(t,"mousedown",()=>e=!0),$t(t,"keydown",()=>e=!1),$t(t,"toggle",()=>{t.hasAttribute("open")&&(jt(t)||e||function(t){const e=document.activeElement;if(e&&Gt(e)&&t.contains(e))return;const i=Kt(t,!0);i&&i.focus()}(t))})]}function jt(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function Kt(t,e){const i=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),n=document.activeElement,s=n instanceof HTMLElement?i.indexOf(n):-1,o=e?i[s+1]:i[s-1],r=e?i[0]:i[i.length-1];return o||r}const zt=navigator.userAgent.match(/Macintosh/);function Zt(t,e){const i=e.target;if(i instanceof Element&&i.closest("details")===t)if("click"===e.type){const e=i.closest('[role="menuitem"], [role="menuitemradio"]');if(!e)return;const n=e.querySelector("input");if("LABEL"===e.tagName&&i===n)return;"LABEL"===e.tagName&&n&&!n.checked||Yt(e,t)}else if("change"===e.type){const e=i.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&Yt(e,t)}}function Yt(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const i=t.closest("details-menu");if(!i)return;i.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const i=e.querySelector("[data-menu-button]");if(!i)return;const n=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-text")?t:t.querySelector("[data-menu-button-text]");return e?e.getAttribute("data-menu-button-text")||e.textContent:null}(t);if(n)i.textContent=n;else{const e=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-contents")?t:t.querySelector("[data-menu-button-contents]");return e?e.innerHTML:null}(t);e&&(i.innerHTML=e)}}(t,e),function(t,e){for(const i of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=i.querySelector('input[type="radio"], input[type="checkbox"]');let n=(i===t).toString();e instanceof HTMLInputElement&&(n=e.indeterminate?"mixed":e.checked.toString()),i.setAttribute("aria-checked",n)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&Jt(e),i.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function Gt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function Jt(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Xt(t,e){const i=Wt.get(t);i&&(i.isComposing="compositionstart"===e.type)}var Qt,te;window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const ee=(()=>{const t=new Set;let e=null,i=null;function n(){for(const e of t)e.update()}return s=>{window.addEventListener("resize",n),window.addEventListener("scroll",n),e||(e=new IntersectionObserver(e=>{for(const i of e){const e=i.target;i.isIntersecting?(e.update(),t.add(e)):t.delete(e)}})),i||(i=new ResizeObserver(()=>{for(const e of t)e.update()})),i.observe(s.ownerDocument.documentElement),e.observe(s)}})();class AnchoredPositionElement extends HTMLElement{constructor(){super(...arguments),Qt.set(this,null),te.set(this,void 0)}get align(){const t=this.getAttribute("align");return"center"===t||"end"===t?t:"start"}set align(t){this.setAttribute("align",`${t}`)}get side(){const t=this.getAttribute("side");return"inside-top"===t||"inside-bottom"===t||"inside-left"===t||"inside-right"===t||"inside-center"===t||"outside-top"===t||"outside-left"===t||"outside-right"===t?t:"outside-bottom"}set side(t){this.setAttribute("side",`${t}`)}get anchorOffset(){const t=this.getAttribute("anchor-offset");return"spacious"===t||"8"===t?8:4}set anchorOffset(t){this.setAttribute("anchor-offset",`${t}`)}get anchor(){return this.getAttribute("anchor")||""}set anchor(t){this.setAttribute("anchor",`${t}`)}get anchorElement(){if(b(this,Qt,"f"))return b(this,Qt,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){v(this,Qt,t,"f"),b(this,Qt,"f")||this.removeAttribute("anchor")}get alignmentOffset(){return Number(this.getAttribute("alignment-offset"))}set alignmentOffset(t){this.setAttribute("alignment-offset",`${t}`)}get allowOutOfBounds(){return this.hasAttribute("allow-out-of-bounds")}set allowOutOfBounds(t){this.toggleAttribute("allow-out-of-bounds",t)}connectedCallback(){this.update(),this.addEventListener("beforetoggle",()=>this.update()),ee(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(b(this,te,"f")),v(this,te,requestAnimationFrame(()=>{const t=this.anchorElement;if(this.classList.toggle("not-anchored",!t),t){const{left:e,top:i}=X(this,t,this);this.style.top=`${i}px`,this.style.left=`${e}px`,this.style.bottom="auto",this.style.right="auto"}else this.style.top="0",this.style.left="0",this.style.bottom="0",this.style.right="0"}),"f"))}}var ie,ne,se;function oe(t){t.body.style.getPropertyValue("--dialog-scrollgutter")||t.body.style.setProperty("--dialog-scrollgutter",window.innerWidth-t.body.clientWidth+"px")}function re(t){const e=t.target,i=e?.closest("button");if(!i||i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled"))return;let n=i?.getAttribute("data-show-dialog-id");if(n){const e=document.getElementById(n);if(e instanceof HTMLDialogElement){oe(e.ownerDocument),e.showModal(),t.preventDefault();let n=i,s=!1;for(;n;)n=n.parentElement?.closest("[popover]"),n&&"auto"===n.popover&&(n.classList.add("dialog-inside-popover-fix"),n.popover="manual",n.showPopover(),s=!0);s&&(e.addEventListener("close",t=>t.stopImmediatePropagation(),{once:!0}),e.close(),e.showModal(),e.addEventListener("close",()=>{for(const t of e.ownerDocument.querySelectorAll(".dialog-inside-popover-fix"))t.contains(e)&&(t.classList.remove("dialog-inside-popover-fix"),t.popover="auto",t.showPopover())},{once:!0}))}}if(n=i.getAttribute("data-close-dialog-id")||i.getAttribute("data-submit-dialog-id"),n){const t=document.getElementById(n);t instanceof HTMLDialogElement&&t.open&&t.close()}}Qt=new WeakMap,te=new WeakMap,AnchoredPositionElement.observedAttributes=["align","side","anchor","alignment-offset","allow-out-of-bounds"],customElements.get("anchored-position")||(window.AnchoredPositionElement=AnchoredPositionElement,customElements.define("anchored-position",AnchoredPositionElement));class DialogHelperElement extends HTMLElement{constructor(){super(...arguments),ie.add(this),ne.set(this,null)}get dialog(){return this.querySelector("dialog")}connectedCallback(){const{signal:t}=v(this,ne,new AbortController,"f");document.addEventListener("click",re,!0),document.addEventListener("click",this,{signal:t}),new MutationObserver(t=>{for(const e of t)e.target===this.dialog&&b(this,ie,"m",se).call(this)}).observe(this,{subtree:!0,attributeFilter:["open"]}),b(this,ie,"m",se).call(this)}disconnectedCallback(){b(this,ne,"f")?.abort()}handleEvent(t){const e=t.target,i=this.dialog;if(e!==i||!i?.open)return;if(i.querySelector("form"))return;const n=i.getBoundingClientRect();n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width||i.close()}}ne=new WeakMap,ie=new WeakSet,se=function(){this.dialog&&this.dialog.matches("[open]:not(:modal)")&&(this.dialog.addEventListener("close",t=>t.stopImmediatePropagation(),{once:!0}),this.dialog.close(),oe(this.dialog.ownerDocument),this.dialog.showModal())},window.customElements.get("dialog-helper")||(window.DialogHelperElement=DialogHelperElement,window.customElements.define("dialog-helper",DialogHelperElement));var ae=class extends Event{oldState;newState;constructor(t,{oldState:e="",newState:i="",...n}={}){super(t,n),this.oldState=String(e||""),this.newState=String(i||"")}},le=new WeakMap;function ce(t,e,i){le.set(t,setTimeout(()=>{le.has(t)&&t.dispatchEvent(new ae("toggle",{cancelable:!1,oldState:e,newState:i}))},0))}var he=globalThis.ShadowRoot||function(){},de=globalThis.HTMLDialogElement||function(){},ue=new WeakMap,me=new WeakMap,fe=new WeakMap;function pe(t){return fe.get(t)||"hidden"}var ge=new WeakMap;function be(t,e){return("auto"===t.popover||"manual"===t.popover)&&(!!t.isConnected&&((!e||"showing"===pe(t))&&(!(!e&&"hidden"!==pe(t))&&(!(t instanceof de&&t.hasAttribute("open"))&&document.fullscreenElement!==t))))}function ve(t){return t?Array.from(me.get(t.ownerDocument)||[]).indexOf(t)+1:0}function we(t){const e=Ae(t),i=function(t){for(;t;){const e=t.popoverTargetElement;if(e instanceof HTMLElement)return e;if((t=t.parentElement||Ee(t))instanceof he&&(t=t.host),t instanceof Document)return}}(t);return ve(e)>ve(i)?e:i}function ye(t){const e=me.get(t);for(const t of e||[]){if(t.isConnected)return t;e.delete(t)}return null}function Ee(t){return"function"==typeof t.getRootNode?t.getRootNode():t.parentNode?Ee(t.parentNode):t}function Ae(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===fe.get(t))return t;if((t=t instanceof Element&&t.assignedSlot||t.parentElement||Ee(t))instanceof he&&(t=t.host),t instanceof Document)return}}function ke(t){return!(t.hidden||t instanceof he)&&((!(t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLOptGroupElement||t instanceof HTMLOptionElement||t instanceof HTMLFieldSetElement)||!t.disabled)&&(!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(!(t instanceof HTMLAnchorElement&&""===t.href)&&("number"==typeof t.tabIndex&&-1!==t.tabIndex))))}function Le(t){(function(t){if(t.shadowRoot&&!0!==t.shadowRoot.delegatesFocus)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);let i=e.querySelector("[autofocus]");if(i)return i;{const t=e.querySelectorAll("slot");for(const e of t){const t=e.assignedElements({flatten:!0});for(const e of t){if(e.hasAttribute("autofocus"))return e;if(i=e.querySelector("[autofocus]"),i)return i}}}const n=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let s=n.currentNode;for(;s;){if(ke(s))return s;s=n.nextNode()}})(t)?.focus()}var Se=new WeakMap;function Te(t){if(!be(t,!1))return;const e=t.ownerDocument;if(!t.dispatchEvent(new ae("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"})))return;if(!be(t,!1))return;let i=!1;if("auto"===t.popover){const i=t.getAttribute("popover");if(Me(function(t){const e=new Map;let i=0;for(const n of me.get(t.ownerDocument)||[])e.set(n,i),i+=1;e.set(t,i),i+=1;let n=null;return function(t){const i=Ae(t);if(null===i)return null;const s=e.get(i);(null===n||e.get(n)<s)&&(n=i)}(t.parentElement||Ee(t)),n}(t)||e,!1,!0),i!==t.getAttribute("popover")||!be(t,!1))return}ye(e)||(i=!0),Se.delete(t);const n=e.activeElement;t.classList.add(":popover-open"),fe.set(t,"showing"),ue.has(e)||ue.set(e,new Set),ue.get(e).add(t),Le(t),"auto"===t.popover&&(me.has(e)||me.set(e,new Set),me.get(e).add(t),Ne(ge.get(t),!0)),i&&n&&"auto"===t.popover&&Se.set(t,n),ce(t,"closed","open")}function Ce(t,e=!1,i=!1){if(!be(t,!0))return;const n=t.ownerDocument;if("auto"===t.popover&&(Me(t,e,i),!be(t,!0)))return;if(Ne(ge.get(t),!1),ge.delete(t),i&&(t.dispatchEvent(new ae("beforetoggle",{oldState:"open",newState:"closed"})),!be(t,!0)))return;ue.get(n)?.delete(t),me.get(n)?.delete(t),t.classList.remove(":popover-open"),fe.set(t,"hidden"),i&&ce(t,"open","closed");const s=Se.get(t);s&&(Se.delete(t),e&&s.focus())}function xe(t,e=!1,i=!1){let n=ye(t);for(;n;)Ce(n,e,i),n=ye(t)}function Me(t,e,i){const n=t.ownerDocument||t;if(t instanceof Document)return xe(n,e,i);let s=null,o=!1;for(const e of me.get(n)||[])if(e===t)o=!0;else if(o){s=e;break}if(!o)return xe(n,e,i);for(;s&&"showing"===pe(s)&&me.get(n)?.size;)Ce(s,e,i)}var Ie=new WeakMap;function De(t){if(!t.isTrusted)return;const e=t.composedPath()[0];if(!e)return;const i=e.ownerDocument;if(!ye(i))return;const n=we(e);if(n&&"pointerdown"===t.type)Ie.set(i,n);else if("pointerup"===t.type){const t=Ie.get(i)===n;Ie.delete(i),t&&Me(n||i,!1,!0)}}var Pe=new WeakMap;function Ne(t,e=!1){if(!t)return;Pe.has(t)||Pe.set(t,t.getAttribute("aria-expanded"));const i=t.popoverTargetElement;if(i instanceof HTMLElement&&"auto"===i.popover)t.setAttribute("aria-expanded",String(e));else{const e=Pe.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}var Oe=globalThis.ShadowRoot||function(){};function Fe(t,e,i){const n=t[e];Object.defineProperty(t,e,{value(t){return n.call(this,i(t))}})}var He=/(^|[^\\]):popover-open\b/g;function qe(){const t="function"==typeof globalThis.CSSLayerBlockRule;return`\n${t?"@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${t?"}":""}\n`}var Ve,Re,We,Be,$e=null;function _e(t){const e=qe();if(null===$e)try{($e=new CSSStyleSheet).replaceSync(e)}catch{$e=!1}if(!1===$e){const i=document.createElement("style");i.textContent=e,t instanceof Document?t.head.prepend(i):t.prepend(i)}else t.adoptedStyleSheets=[$e,...t.adoptedStyleSheets]}"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){if("undefined"==typeof window)return;function t(t){return t?.includes(":popover-open")&&(t=t.replace(He,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||ae,Fe(Document.prototype,"querySelector",t),Fe(Document.prototype,"querySelectorAll",t),Fe(Element.prototype,"querySelector",t),Fe(Element.prototype,"querySelectorAll",t),Fe(Element.prototype,"matches",t),Fe(Element.prototype,"closest",t),Fe(DocumentFragment.prototype,"querySelectorAll",t),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;const t=(this.getAttribute("popover")||"").toLowerCase();return""===t||"auto"==t?"auto":"manual"},set(t){null===t?this.removeAttribute("popover"):this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(){Te(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){Ce(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t){"showing"===fe.get(this)&&void 0===t||!1===t?Ce(this,!0,!0):void 0!==t&&!0!==t||Te(this)}}});const e=Element.prototype.attachShadow;e&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(t){const i=e.call(this,t);return _e(i),i}}});const i=HTMLElement.prototype.attachInternals;i&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){const t=i.call(this);return t.shadowRoot&&_e(t.shadowRoot),t}}});const n=new WeakMap;function s(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),n.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),n.set(this,t)}},get(){if("button"!==this.localName&&"input"!==this.localName)return null;if("input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type)return null;if(this.disabled)return null;if(this.form&&"submit"===this.type)return null;const t=n.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return n.delete(this),null;const e=Ee(this),i=this.getAttribute("popovertarget");return(e instanceof Document||e instanceof Oe)&&i&&e.getElementById(i)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){const t=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===t||"hide"===t?t:"toggle"},set(t){this.setAttribute("popovertargetaction",t)}}})}s(HTMLButtonElement),s(HTMLInputElement);const o=t=>{const e=t.composedPath(),i=e[0];if(!(i instanceof Element)||i?.shadowRoot)return;const n=Ee(i);if(!(n instanceof Oe||n instanceof Document))return;const s=e.find(t=>t.matches?.("[popovertargetaction],[popovertarget]"));return s?(function(t){const e=t.popoverTargetElement;if(!(e instanceof HTMLElement))return;const i=pe(e);"show"===t.popoverTargetAction&&"showing"===i||"hide"===t.popoverTargetAction&&"hidden"===i||("showing"===i?Ce(e,!0,!0):be(e,!1)&&(ge.set(e,t),Te(e)))}(s),void t.preventDefault()):void 0},r=t=>{const e=t.key,i=t.target;t.defaultPrevented||!i||"Escape"!==e&&"Esc"!==e||Me(i.ownerDocument,!0,!0)};(t=>{t.addEventListener("click",o),t.addEventListener("keydown",r),t.addEventListener("pointerdown",De),t.addEventListener("pointerup",De)})(document),_e(document)}();const Ue=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]'].map(t=>`:not([hidden]) > ${t}`).join(", "),je=t=>t.textContent?.trim()[0].toLowerCase(),Ke=/^\S$/;class FocusGroupElement extends HTMLElement{constructor(){super(...arguments),Ve.add(this),Re.set(this,null),We.set(this,null)}get nowrap(){return this.hasAttribute("nowrap")}set nowrap(t){this.toggleAttribute("nowrap",t)}get direction(){return"horizontal"===this.getAttribute("direction")?"horizontal":"vertical"}set direction(t){this.setAttribute("direction",`${t}`)}get retain(){return this.hasAttribute("retain")}set retain(t){this.toggleAttribute("retain",t)}get mnemonics(){return this.hasAttribute("mnemonics")}connectedCallback(){v(this,We,new AbortController,"f");const{signal:t}=b(this,We,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusin",this,{signal:t})}disconnectedCallback(){b(this,We,"f")?.abort()}handleEvent(t){const{direction:e,nowrap:i}=this;if("focusin"===t.type){if(this.retain&&t.target instanceof Element&&t.target.matches(Ue)){b(this,Re,"f")?.abort();const{signal:e}=v(this,Re,new AbortController,"f");for(const i of b(this,Ve,"a",Be)){i.setAttribute("tabindex",i===t.target?"0":"-1");const n=t.target.closest("[popover]");i===t.target&&"auto"===n?.popover&&n.closest("focus-group")===this&&n.addEventListener("toggle",t=>{if(t.target instanceof Element&&"closed"===t.newState&&(b(this,Re,"f")?.abort(),i.setAttribute("tabindex","-1"),n.id)){const t=this.querySelector(`[popovertarget="${n.id}"]`);t?t.setAttribute("tabindex","0"):b(this,Ve,"a",Be)[0]?.setAttribute("tabindex","0")}},{signal:e})}}}else if(t instanceof KeyboardEvent){const n=Array.from(b(this,Ve,"a",Be));let s=n.indexOf(t.target);const o=t.key;if("Up"===o||"ArrowUp"===o)"vertical"!==e&&"both"!==e||(s-=s<0?0:1,t.preventDefault());else if("Down"===o||"ArrowDown"===o)"vertical"!==e&&"both"!==e||(s+=1,t.preventDefault());else if("Left"===t.key||"ArrowLeft"===t.key)"horizontal"!==e&&"both"!==e||(s-=1,t.preventDefault());else if("Right"===t.key||"ArrowRight"===t.key)"horizontal"!==e&&"both"!==e||(s+=1,t.preventDefault());else if("Home"===t.key||"PageUp"===t.key)s=0,t.preventDefault();else if("End"===t.key||"PageDown"===t.key)s=n.length-1,t.preventDefault();else{if(!this.mnemonics||!Ke.test(o))return;{const e=o.toLowerCase(),r=s>0&&je(t.target)===e?s:0;s=n.findIndex((t,i)=>i>r&&je(t)===e),s<0&&!i&&(s=n.findIndex(t=>je(t)===e))}}i&&s<0&&(s=0),!i&&s>=n.length&&(s=0);const r=n.at(Math.min(s,n.length-1));{let e=r;do{e=e.closest("[popover]:not(:popover-open)"),"auto"!==e?.popover||["ArrowRight","ArrowLeft"].includes(t.key)||e.showPopover(),e=e?.parentElement||null}while(e)}r?.focus()}}}Re=new WeakMap,We=new WeakMap,Ve=new WeakSet,Be=function(){return this.querySelectorAll(Ue)},customElements.get("focus-group")||(window.FocusGroupElement=FocusGroupElement,customElements.define("focus-group",FocusGroupElement));let ze=class ScrollableRegionElement extends HTMLElement{constructor(){super(...arguments),this.hasOverflow=!1,this.labelledBy=""}connectedCallback(){this.style.overflow="auto",this.observer=new ResizeObserver(t=>{for(const e of t)this.hasOverflow=e.target.scrollHeight>e.target.clientHeight||e.target.scrollWidth>e.target.clientWidth}),this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}attributeChangedCallback(t){"data-has-overflow"===t&&(this.hasOverflow?(this.setAttribute("aria-labelledby",this.labelledBy),this.setAttribute("role","region"),this.setAttribute("tabindex","0")):(this.removeAttribute("aria-labelledby"),this.removeAttribute("role"),this.removeAttribute("tabindex")))}};g([I],ze.prototype,"hasOverflow",void 0),g([I],ze.prototype,"labelledBy",void 0),ze=g([K("scrollable-region")],ze),window.ScrollableRegionElement=ze;const Ze=(t,e,i)=>{if(e())i();else{const n=new MutationObserver(()=>{e()&&(i(),n.disconnect())});n.observe(t,{childList:!0,subtree:!0})}};var Ye,Ge,Je,Xe;function Qe(t){document.activeElement!==t&&t?.focus()}const ti=[];function ei(t){const e=t.target,i=e?.closest("button");if(!i||i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled"))return;let n=i?.getAttribute("data-show-dialog-id");if(n){t.stopPropagation();const e=document.getElementById(n);if(e instanceof ModalDialogElement)return e.openButton=i,e.show(),void t.preventDefault()}if(ti.length&&(n=i.getAttribute("data-close-dialog-id")||i.getAttribute("data-submit-dialog-id"),n)){const t=document.getElementById(n);if(t instanceof ModalDialogElement){const e=ti.findIndex(t=>t.id===n);ti.splice(e,1),t.close(i.hasAttribute("data-submit-dialog-id"))}}}function ii(t){!(t instanceof KeyboardEvent&&"keydown"===t.type&&"Enter"===t.key)||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey||ei(t)}function ni(t){const e=t.target;if(e?.closest("button"))return;const i=ti[ti.length-1];if(!i)return;!e.closest(`#${i.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",t=>{t.target===e&&(ti.pop(),i.close())},{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),Ye.add(this),Ge.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){if(t){if(this.open)return;this.setAttribute("open",""),this.setAttribute("aria-disabled","false"),document.body.style.paddingRight=window.innerWidth-document.body.clientWidth+"px",document.body.style.overflow="hidden",b(this,Ye,"a",Je)?.classList.remove("Overlay--hidden"),b(this,Ge,"f").signal.aborted&&v(this,Ge,new AbortController,"f"),pt(this,this.querySelector("[autofocus]"),b(this,Ge,"f").signal),ti.push(this)}else{if(!this.open)return;this.removeAttribute("open"),this.setAttribute("aria-disabled","true"),b(this,Ye,"a",Je)?.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",b(this,Ge,"f").abort();const t=this.openButton?.closest("details")||this.openButton?.closest("action-menu");Qe(t?st(t):this.openButton),this.openButton=null}}get showButtons(){return document.querySelectorAll(`button[data-show-dialog-id='${this.id}']`)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),document.addEventListener("click",ei),document.addEventListener("keydown",ii),document.addEventListener("mousedown",ni),this.addEventListener("keydown",t=>b(this,Ye,"m",Xe).call(this,t))}show(){this.open=!0}close(t=!1){if(!1===this.open)return;const e=new Event(t?"close":"cancel");this.dispatchEvent(e),this.open=!1}}var si,oi,ri,ai,li,ci,hi,di;Ge=new WeakMap,Ye=new WeakSet,Je=function(){return this.parentElement?.hasAttribute("data-modal-dialog-overlay")?this.parentElement:null},Xe=function(t){if(t instanceof KeyboardEvent&&!t.isComposing&&this.open)switch(t.key){case"Escape":this.close(),t.preventDefault(),t.stopPropagation();break;case"Enter":t.target.getAttribute("data-close-dialog-id")===this.id&&t.stopPropagation();break}},window.customElements.get("modal-dialog")||(window.ModalDialogElement=ModalDialogElement,window.customElements.define("modal-dialog",ModalDialogElement));let ui=class NavListElement extends HTMLElement{constructor(){super(...arguments),si.add(this),oi.set(this,void 0)}connectedCallback(){this.topLevelList&&v(this,oi,new Z(this.topLevelList),"f")}disconnectedCallback(){this.topLevelList&&b(this,oi,"f").unobserve(this.topLevelList)}selectItemById(t){if(!t)return!1;const e=b(this,si,"m",ri).call(this,t);return!!e&&(b(this,si,"m",ci).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=b(this,si,"m",ai).call(this,t);return!!e&&(b(this,si,"m",ci).call(this,e),!0)}selectItemByCurrentLocation(){const t=b(this,si,"m",li).call(this);return!!t&&(b(this,si,"m",ci).call(this,t),!0)}expandItem(t){t.nextElementSibling?.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){t.nextElementSibling?.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false"),t.focus()}itemIsExpanded(t){return"A"===t?.tagName||"true"===t?.getAttribute("aria-expanded")}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const i=e.closest("button");i&&(this.itemIsExpanded(i)?this.collapseItem(i):this.expandItem(i),t.stopPropagation())}handleItemWithSubItemKeydown(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;let i=e.closest("button");if(!i){const t=e.getAttribute("aria-labelledby");if(!t)return;i=document.getElementById(t)}this.itemIsExpanded(i)&&"Escape"===t.key&&this.collapseItem(i),t.stopPropagation()}};var mi,fi,pi;oi=new WeakMap,si=new WeakSet,ri=function(t){for(const e of this.items){if(e.classList.contains("ActionListItem--hasSubItem"))continue;if((e.getAttribute("data-item-id")?.split(" ")||[]).includes(t))return e}return null},ai=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},li=function(){return b(this,si,"m",ai).call(this,window.location.pathname)},ci=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&b(this,si,"m",hi).call(this,e),t.classList.add("ActionListItem--navActive"),t.children.length>0&&t.children[0].setAttribute("aria-current","page");const i=b(this,si,"m",di).call(this,t);i&&(this.expandItem(i),i.classList.add("ActionListContent--hasActiveSubItem"))},hi=function(t){t.classList.remove("ActionListItem--navActive"),t.children.length>0&&t.children[0].removeAttribute("aria-current");const e=b(this,si,"m",di).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},di=function(t){if(!t.classList.contains("ActionListItem--subItem"))return null;const e=t.closest("li.ActionListItem--hasSubItem")?.querySelector("button.ActionListContent");return e||null},g([j],ui.prototype,"items",void 0),g([U],ui.prototype,"topLevelList",void 0),ui=g([K("nav-list")],ui);let gi=class NavListGroupElement extends HTMLElement{constructor(){super(...arguments),mi.add(this),pi.set(this,new Z(this))}connectedCallback(){this.setShowMoreItemState()}get showMoreDisabled(){return this.showMoreItem.hasAttribute("aria-disabled")}set showMoreDisabled(t){t?this.showMoreItem.setAttribute("aria-disabled","true"):this.showMoreItem.removeAttribute("aria-disabled"),this.showMoreItem.classList.toggle("disabled",t)}set currentPage(t){this.showMoreItem.setAttribute("data-current-page",t.toString())}get currentPage(){return parseInt(this.showMoreItem.getAttribute("data-current-page"))||1}get totalPages(){return parseInt(this.showMoreItem.getAttribute("data-total-pages"))||1}get paginationSrc(){return this.showMoreItem.getAttribute("src")||""}async showMore(t){if(t.preventDefault(),this.showMoreDisabled)return;let e;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const i=await fetch(t);if(!i.ok)return;e=await i.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const i=b(this,mi,"m",fi).call(this,document,e);i?.querySelector("li > a")?.setAttribute("data-targets","nav-list-group.focusMarkers");const n=t.target.closest("button").getAttribute("data-list-id");document.getElementById(n).append(i),this.focusMarkers.pop()?.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}};var bi,vi;pi=new WeakMap,mi=new WeakSet,fi=function(t,e){const i=t.createElement("template");return i.innerHTML=e,t.importNode(i.content,!0)},g([U],gi.prototype,"showMoreItem",void 0),g([j],gi.prototype,"focusMarkers",void 0),gi=g([K("nav-list-group")],gi),window.NavListGroupElement=gi;let wi=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),bi.add(this)}connectedCallback(){b(this,bi,"m",vi).call(this)}select(t){const e=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),t.querySelector("[aria-current]")?.setAttribute("aria-current","false");e.closest("li.SegmentedControl-item")?.classList.add("SegmentedControl-item--selected"),e.setAttribute("aria-current","true"),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:e,checked:!1,value:e.querySelector(".Button-label")?.textContent}}))}get current(){return this.querySelector("[aria-current=true]")}};bi=new WeakSet,vi=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},g([j],wi.prototype,"items",void 0),wi=g([K("segmented-control")],wi),window.customElements.get("segmented-control")||(window.SegmentedControlElement=wi,window.customElements.define("segmented-control",wi));let yi=class ToggleSwitchElement extends HTMLElement{constructor(){super(...arguments),this.turbo=!1,this.toggling=!1}get src(){const t=this.getAttribute("src");if(!t)return null;const e=this.ownerDocument.createElement("a");return e.href=t,e.href}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("data-csrf")||t instanceof HTMLInputElement&&t.value||null}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}isRemote(){return null!=this.src}async toggle(){if(!this.toggling&&(this.toggling=!0,!this.isDisabled())){if(!this.isRemote())return this.performToggle(),void(this.toggling=!1);this.performToggle(),this.setLoadingState();try{await this.submitForm()}catch(t){return void(t instanceof Error&&(this.setErrorState(t.message||"An error occurred, please try again."),this.performToggle()))}finally{this.toggling=!1}this.setSuccessState()}}turnOn(){this.isDisabled()||(this.switch.setAttribute("aria-pressed","true"),this.classList.add("ToggleSwitch--checked"))}turnOff(){this.isDisabled()||(this.switch.setAttribute("aria-pressed","false"),this.classList.remove("ToggleSwitch--checked"))}isOn(){return"true"===this.switch.getAttribute("aria-pressed")}isOff(){return!this.isOn()}isDisabled(){return null!=this.switch.getAttribute("disabled")}disable(){this.switch.setAttribute("disabled","disabled")}enable(){this.switch.removeAttribute("disabled")}performToggle(){this.isOn()?this.turnOff():this.turnOn()}setLoadingState(){this.errorIcon.setAttribute("hidden","hidden"),this.loadingSpinner.removeAttribute("hidden");const t=new CustomEvent("toggleSwitchLoading",{bubbles:!0});this.dispatchEvent(t)}setSuccessState(){const t=new CustomEvent("toggleSwitchSuccess",{bubbles:!0});this.dispatchEvent(t),this.setFinishedState(!1)}setErrorState(t){const e=new CustomEvent("toggleSwitchError",{bubbles:!0,detail:t});this.dispatchEvent(e),this.setFinishedState(!0)}setFinishedState(t){t&&this.errorIcon.removeAttribute("hidden"),this.loadingSpinner.setAttribute("hidden","hidden")}async submitForm(){const t=new FormData;if(this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"1":"0"),!this.src)throw new Error("invalid src");let e;const i={"Requested-With":"XMLHttpRequest","X-Requested-With":"XMLHttpRequest"};this.turbo&&(i.Accept="text/vnd.turbo-stream.html");try{e=await fetch(this.src,{credentials:"same-origin",method:"POST",headers:i,body:t})}catch(t){throw new Error("A network error occurred, please try again.")}if(!e.ok)throw new Error(await e.text());const n=e.headers.get("Content-Type");window.Turbo&&this.turbo&&n?.startsWith("text/vnd.turbo-stream.html")&&window.Turbo.renderStreamMessage(await e.text())}};var Ei,Ai,ki,Li,Si,Ti,Ci,xi,Mi,Ii,Di,Pi;g([U],yi.prototype,"switch",void 0),g([U],yi.prototype,"loadingSpinner",void 0),g([U],yi.prototype,"errorIcon",void 0),g([I],yi.prototype,"turbo",void 0),yi=g([K("toggle-switch")],yi),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=yi,window.customElements.define("toggle-switch",yi));const Ni=(()=>{let t;return e=>t?e.matches(t):function(e){try{return t=":popover-open",e.matches(t)}catch{try{return t=":open",e.matches(":open")}catch{return t=".\\:popover-open",e.matches(".\\:popover-open")}}}(e)})(),Oi="sr-only",Fi=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];function Hi(t){for(const e of Wi)e!==t&&(Ni(e)?e.hidePopover():Wi.delete(e))}function qi(){Hi()}function Vi(t){setTimeout(()=>{for(const e of Wi)Ni(e)&&"focus"===e.showReason&&e.control!==t.target&&e.hidePopover()},0)}const Ri=new Set,Wi=new Set;class ToolTipElement extends HTMLElement{constructor(){super(...arguments),Ei.add(this),Ai.set(this,void 0),ki.set(this,"center"),Li.set(this,"outside-bottom"),Si.set(this,!1),Ti.set(this,"mouse"),Ci.set(this,!1)}styles(){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: min(var(--overlay-width-small), 100vw);\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 '}get showReason(){return b(this,Ti,"f")}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get type(){return"label"===this.getAttribute("data-type")?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return this.getAttribute("data-direction")||"s"}set direction(t){this.setAttribute("data-direction",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}set hiddenFromView(t){t&&Ni(this)?this.hidePopover():t||Ni(this)||this.showPopover()}get hiddenFromView(){return!Ni(this)}connectedCallback(){if(Ri.add(this),b(this,Ei,"m",Ii).call(this),b(this,Ei,"m",Di).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}b(this,Ei,"m",xi).call(this,!1),v(this,Si,!0,"f"),b(this,Ei,"m",Mi).call(this)}disconnectedCallback(){Ri.delete(this),Wi.delete(this),b(this,Ai,"f")?.abort()}async handleEvent(t){if(!this.control)return;const e=Ni(this);"beforetoggle"===t.type&&t.currentTarget!==this&&v(this,Ci,"open"===t.newState,"f");const i=("mouseenter"===t.type||"focus"===t.type&&(navigator.webdriver||this.control.matches(":focus-visible")))&&!b(this,Ci,"f"),n="mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this,s="keydown"===t.type&&"Escape"===t.key,o="mousedown"===t.type&&t.currentTarget===this.control,r="beforetoggle"===t.type&&t.currentTarget!==this&&"open"===t.newState,a=n||s||o||r;e&&s&&(t.stopImmediatePropagation(),t.preventDefault()),await Promise.resolve(),e||!i||Ni(this)?e&&a&&Ni(this)&&this.hidePopover():(v(this,Ti,"mouseenter"===t.type?"mouse":"focus","f"),this.showPopover()),"toggle"===t.type&&b(this,Ei,"m",xi).call(this,"open"===t.newState)}attributeChangedCallback(t){this.isConnected&&("for"===t?b(this,Ei,"m",Mi).call(this):"id"===t||"data-type"===t?b(this,Ei,"m",Ii).call(this):"data-direction"===t&&b(this,Ei,"m",Di).call(this))}}var Bi,$i;Ai=new WeakMap,ki=new WeakMap,Li=new WeakMap,Si=new WeakMap,Ti=new WeakMap,Ci=new WeakMap,Ei=new WeakSet,xi=function(t){t?(Wi.add(this),this.classList.remove(Oi),Hi(this),b(this,Ei,"m",Pi).call(this)):(Wi.delete(this),this.classList.remove(...Fi),this.classList.add(Oi))},Mi=function(){if(!this.control)return;this.setAttribute("role","tooltip"),b(this,Ai,"f")?.abort(),v(this,Ai,new AbortController,"f");const{signal:t}=b(this,Ai,"f");this.addEventListener("mouseleave",this,{signal:t}),this.addEventListener("toggle",this,{signal:t}),this.control.addEventListener("mouseenter",this,{signal:t}),this.control.addEventListener("mouseleave",this,{signal:t}),this.control.addEventListener("focus",this,{signal:t}),this.control.addEventListener("mousedown",this,{signal:t}),this.control.popoverTargetElement?.addEventListener("beforetoggle",this,{signal:t}),this.ownerDocument.addEventListener("focusout",qi),this.ownerDocument.addEventListener("focusin",Vi),this.ownerDocument.addEventListener("keydown",this,{signal:t,capture:!0})},Ii=function(){if(this.id&&this.control)if("label"===this.type){let t=this.control.getAttribute("aria-labelledby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-labelledby",t),this.setAttribute("aria-hidden","true")}else{let t=this.control.getAttribute("aria-describedby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-describedby",t)}},Di=function(){this.classList.remove(...Fi);const t=this.direction;"n"===t?(v(this,ki,"center","f"),v(this,Li,"outside-top","f")):"ne"===t?(v(this,ki,"end","f"),v(this,Li,"outside-top","f")):"e"===t?(v(this,ki,"center","f"),v(this,Li,"outside-right","f")):"se"===t?(v(this,ki,"end","f"),v(this,Li,"outside-bottom","f")):"s"===t?(v(this,ki,"center","f"),v(this,Li,"outside-bottom","f")):"sw"===t?(v(this,ki,"start","f"),v(this,Li,"outside-bottom","f")):"w"===t?(v(this,ki,"center","f"),v(this,Li,"outside-left","f")):"nw"===t&&(v(this,ki,"start","f"),v(this,Li,"outside-top","f"))},Pi=function(){if(!this.control)return;if(!b(this,Si,"f")||!Ni(this))return;const t=X(this,this.control,{side:b(this,Li,"f"),align:b(this,ki,"f"),anchorOffset:0}),e=t.anchorSide,i=t.anchorAlign;this.style.setProperty("--tool-tip-position-top",`${t.top}px`),this.style.setProperty("--tool-tip-position-left",`${t.left}px`);let n="s";n="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===i?"n":"start"===i?"ne":"nw":"center"===i?"s":"start"===i?"se":"sw",this.classList.add(`tooltip-${n}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id","for"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let _i=class XBannerElement extends HTMLElement{constructor(){super(...arguments),Bi.add(this)}dismiss(){if("remove"===b(this,Bi,"a",$i)){const t=this.parentElement;if(!t)return;t.removeChild(this)}else this.hide();this.dispatchEvent(new CustomEvent("banner:dismiss"))}show(){this.style.setProperty("display","initial")}hide(){this.style.setProperty("display","none")}};Bi=new WeakSet,$i=function(){return this.getAttribute("data-dismiss-scheme")},g([U],_i.prototype,"titleText",void 0),_i=g([K("x-banner")],_i),window.customElements.get("x-banner")||(window.XBannerElement=_i,window.customElements.define("x-banner",_i));class Ui{constructor(t,e,{tabInsertsSuggestions:i,defaultFirstOption:n,scrollIntoViewOptions:s}={}){this.input=t,this.list=e,this.tabInsertsSuggestions=null==i||i,this.defaultFirstOption=null!=n&&n,this.scrollIntoViewOptions=null!=s?s:{block:"nearest",inline:"nearest"},this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=t=>function(t,e){if(t.shiftKey||t.metaKey||t.altKey)return;if(!e.ctrlBindings&&t.ctrlKey)return;if(e.isComposing)return;switch(t.key){case"Enter":Ki(e.input,e.list)&&t.preventDefault();break;case"Tab":e.tabInsertsSuggestions&&Ki(e.input,e.list)&&t.preventDefault();break;case"Escape":e.clearSelection();break;case"ArrowDown":e.navigate(1),t.preventDefault();break;case"ArrowUp":e.navigate(-1),t.preventDefault();break;case"n":e.ctrlBindings&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":e.ctrlBindings&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.clearSelection()}}(t,this),this.compositionEventHandler=t=>function(t,e){e.isComposing="compositionstart"===t.type;const i=document.getElementById(e.input.getAttribute("aria-controls")||"");if(!i)return;e.clearSelection()}(t,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",ji),this.indicateDefaultOption()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",ji)}indicateDefaultOption(){var t;this.defaultFirstOption&&(null===(t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(Zi)[0])||void 0===t||t.setAttribute("data-combobox-option-default","true"))}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Zi)[0],i=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Zi),n=i.indexOf(e);if(n===i.length-1&&1===t||0===n&&-1===t)return this.clearSelection(),void this.input.focus();let s=1===t?0:i.length-1;if(e&&n>=0){const e=n+t;e>=0&&e<i.length&&(s=e)}const o=i[s];if(o)for(const t of i)t.removeAttribute("data-combobox-option-default"),o===t?(this.input.setAttribute("aria-activedescendant",o.id),o.setAttribute("aria-selected","true"),zi(o),o.scrollIntoView(this.scrollIntoViewOptions)):t.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.removeAttribute("aria-selected");this.indicateDefaultOption()}}function ji(t){if(!(t.target instanceof Element))return;const e=t.target.closest('[role="option"]');e&&"true"!==e.getAttribute("aria-disabled")&&function(t,e){t.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0,detail:e}))}(e,{event:t})}function Ki(t,e){const i=e.querySelector('[aria-selected="true"], [data-combobox-option-default="true"]');return!!i&&("true"===i.getAttribute("aria-disabled")||i.click(),!0)}function zi(t){t.dispatchEvent(new Event("combobox-select",{bubbles:!0}))}function Zi(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}const Yi=window.testScreenReaderDelay||100;class Gi{constructor(t,e,i,n=!1){var s;if(this.container=t,this.input=e,this.results=i,this.combobox=new Ui(e,i,{defaultFirstOption:n}),this.feedback=t.getRootNode().getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=n,this.clearButton=t.getRootNode().getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=i.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.popover?this.results.matches(":popover-open")&&this.results.hidePopover():this.results.hidden=!0,this.results.getAttribute("aria-label")||this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let i;return function(...n){clearTimeout(i),i=window.setTimeout(()=>{clearTimeout(i),t(...n)},e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(s=this.clearButton)||void 0===s||s.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),"true"===this.input.getAttribute("aria-expanded")&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.close()}onKeydown(t){if("Escape"===t.key&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.open(),t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.interactingWithList||this.fetchResults()}onInputBlur(){this.interactingWithList||this.close()}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(this.close(),e instanceof HTMLAnchorElement)return;const i=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=i,i||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout(()=>{this.feedback&&(this.feedback.textContent=t)},Yi)}fetchResults(){const t=this.input.value.trim();if(!t&&!this.container.fetchOnEmpty)return void this.close();const e=this.container.src;if(!e)return;const i=new URL(e,window.location.href),n=new URLSearchParams(i.search.slice(1));n.append("q",t),i.search=n.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(i).then(t=>{this.results.innerHTML=t,this.identifyOptions(),this.combobox.indicateDefaultOption();const e=this.results.querySelectorAll('[role="option"]'),i=!!e.length||!!this.results.querySelectorAll('[data-no-result-found="true"]').length,n=e.length,[s]=e,o=null==s?void 0:s.textContent;this.autoselectEnabled&&o?this.updateFeedbackForScreenReaders(`${n} results. ${o} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${n||"No"} results.`),i?this.open():this.close(),this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))}).catch(()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))})}open(){(this.results.popover?!this.results.matches(":popover-open"):this.results.hidden)&&(this.combobox.start(),this.results.popover?this.results.showPopover():this.results.hidden=!1),this.container.open=!0,this.interactingWithList=!0}close(){(this.results.popover?this.results.matches(":popover-open"):!this.results.hidden)&&(this.combobox.stop(),this.results.popover?this.results.hidePopover():this.results.hidden=!0),this.container.open=!1,this.interactingWithList=!1}}var Ji,Xi,Qi,tn,en,nn=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},sn=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i},on=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const rn=globalThis.HTMLElement||null;class an extends Event{constructor(t,e){var{relatedTarget:i}=e;super(t,on(e,["relatedTarget"])),this.relatedTarget=i}}const ln=new WeakMap;let cn=null;class AutoCompleteElement extends rn{constructor(){super(...arguments),Ji.add(this),Xi.set(this,null),Qi.set(this,null),en.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){cn=null===t?t:Promise.resolve(t)}get forElement(){var t;if(null===(t=nn(this,Xi,"f"))||void 0===t?void 0:t.isConnected)return nn(this,Xi,"f");const e=this.getAttribute("for"),i=this.getRootNode();return e&&(i instanceof Document||i instanceof ShadowRoot)?i.getElementById(e):null}set forElement(t){sn(this,Xi,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return(null===(t=nn(this,Qi,"f"))||void 0===t?void 0:t.isConnected)?nn(this,Qi,"f"):this.querySelector("input")}set inputElement(t){sn(this,Qi,t,"f"),nn(this,Ji,"m",tn).call(this)}connectedCallback(){this.isConnected&&(nn(this,Ji,"m",tn).call(this),new MutationObserver(()=>{ln.get(this)||nn(this,Ji,"m",tn).call(this)}).observe(this,{subtree:!0,childList:!0}))}disconnectedCallback(){const t=ln.get(this);t&&(t.destroy(),ln.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}get fetchOnEmpty(){return this.hasAttribute("fetch-on-empty")}set fetchOnEmpty(t){this.toggleAttribute("fetch-on-empty",t)}async fetchResult(t){var e;null===(e=nn(this,en,"f"))||void 0===e||e.abort();const{signal:i}=sn(this,en,new AbortController,"f"),n=await fetch(t.toString(),{signal:i,headers:{Accept:"text/fragment+html"}});if(!n.ok)throw new Error(await n.text());if(cn){return(await cn).createHTML(await n.text(),n)}return await n.text()}static get observedAttributes(){return["open","value","for"]}attributeChangedCallback(t,e,i){var n,s;if(e===i)return;const o=ln.get(this);if(o)switch(this.forElement===(null===(n=ln.get(this))||void 0===n?void 0:n.results)&&this.inputElement===(null===(s=ln.get(this))||void 0===s?void 0:s.input)||nn(this,Ji,"m",tn).call(this),t){case"open":null===i?o.close():o.open();break;case"value":null!==i&&(o.input.value=i),this.dispatchEvent(new an("auto-complete-change",{bubbles:!0,relatedTarget:o.input}))}}}Xi=new WeakMap,Qi=new WeakMap,en=new WeakMap,Ji=new WeakSet,tn=function(){var t;null===(t=ln.get(this))||void 0===t||t.destroy();const{forElement:e,inputElement:i}=this;if(!e||!i)return;const n="true"===this.getAttribute("data-autoselect");ln.set(this,new Gi(this,i,e,n)),e.setAttribute("role","listbox")};const hn="undefined"!=typeof globalThis?globalThis:window;try{hn.AutocompleteElement=hn.AutoCompleteElement=AutoCompleteElement.define()}catch(t){if(!(hn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function dn(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t.textContent||"");const e=getSelection();if(null==e)return Promise.reject(new Error);e.removeAllRanges();const i=document.createRange();return i.selectNodeContents(t),e.addRange(i),document.execCommand("copy"),e.removeAllRanges(),Promise.resolve()}function un(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t);const e=document.body;if(!e)return Promise.reject(new Error);const i=function(t){const e=document.createElement("pre");return e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="5px",e.textContent=t,e}(t);return e.appendChild(i),dn(i),e.removeChild(i),Promise.resolve()}async function mn(t){const e=t.getAttribute("for"),i=t.getAttribute("value");function n(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}var s;if("true"!==t.getAttribute("aria-disabled"))if(i)await un(i),n();else if(e){const i="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(i instanceof Document||"ShadowRoot"in window&&i instanceof ShadowRoot))return;const o=i.getElementById(e);o&&(await(s=o,s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement?un(s.value):s instanceof HTMLAnchorElement&&s.hasAttribute("href")?un(s.href):dn(s)),n())}}function fn(t){const e=t.currentTarget;e instanceof HTMLElement&&mn(e)}function pn(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),mn(e))}}function gn(t){t.currentTarget.addEventListener("keydown",pn)}function bn(t){t.currentTarget.removeEventListener("keydown",pn)}class ClipboardCopyElement extends HTMLElement{static define(t="clipboard-copy",e=customElements){return e.define(t,this),this}constructor(){super(),this.addEventListener("click",fn),this.addEventListener("focus",gn),this.addEventListener("blur",bn)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}const vn="undefined"!=typeof globalThis?globalThis:window;try{vn.ClipboardCopyElement=ClipboardCopyElement.define()}catch(t){if(!(vn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function wn(t){t.style.display="inline-block"}function yn(t){t.style.display="none"}const En=new WeakMap;document.addEventListener("clipboard-copy",({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=En.get(t),i=t.parentNode?.querySelector("[data-clipboard-copy-feedback]"),n="Copied!";e?(clearTimeout(e),En.delete(t)):(!function(t){const[e,i]=t.querySelectorAll(".octicon");e&&i&&(yn(e),wn(i))}(t),i&&(i.textContent===n?i.textContent=`${n} `:i.textContent=n)),En.set(t,setTimeout(()=>{!function(t){const[e,i]=t.querySelectorAll(".octicon");e&&i&&(wn(e),yn(i))}(t),En.delete(t)},2e3))});var An,kn=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i},Ln=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};const Sn="undefined"!=typeof Intl&&Intl.ListFormat||class{formatToParts(t){const e=[];for(const i of t)e.push({type:"element",value:i}),e.push({type:"literal",value:", "});return e.slice(0,-1)}},Tn=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],Cn={minimumIntegerDigits:2};class xn{constructor(t,e={}){An.set(this,void 0);let i=String(e.style||"short");"long"!==i&&"short"!==i&&"narrow"!==i&&"digital"!==i&&(i="short");let n="digital"===i?"numeric":i;const s=e.hours||n;n="2-digit"===s?"numeric":s;const o=e.minutes||n;n="2-digit"===o?"numeric":o;const r=e.seconds||n;n="2-digit"===r?"numeric":r;const a=e.milliseconds||n;kn(this,An,{locale:t,style:i,years:e.years||"digital"===i?"short":i,yearsDisplay:"always"===e.yearsDisplay?"always":"auto",months:e.months||"digital"===i?"short":i,monthsDisplay:"always"===e.monthsDisplay?"always":"auto",weeks:e.weeks||"digital"===i?"short":i,weeksDisplay:"always"===e.weeksDisplay?"always":"auto",days:e.days||"digital"===i?"short":i,daysDisplay:"always"===e.daysDisplay?"always":"auto",hours:s,hoursDisplay:"always"===e.hoursDisplay||"digital"===i?"always":"auto",minutes:o,minutesDisplay:"always"===e.minutesDisplay||"digital"===i?"always":"auto",seconds:r,secondsDisplay:"always"===e.secondsDisplay||"digital"===i?"always":"auto",milliseconds:a,millisecondsDisplay:"always"===e.millisecondsDisplay?"always":"auto"},"f")}resolvedOptions(){return Ln(this,An,"f")}formatToParts(t){const e=[],i=Ln(this,An,"f"),n=i.style,s=i.locale;for(const[o,r]of Tn){const a=t[o];if("auto"===i[`${o}Display`]&&!a)continue;const l=i[o],c="2-digit"===l?Cn:"numeric"===l?{}:{style:"unit",unit:r,unitDisplay:l};let h=new Intl.NumberFormat(s,c).format(a);"months"===o&&("narrow"===l||"narrow"===n&&h.endsWith("m"))&&(h=h.replace(/(\d+)m$/,"$1mo")),e.push(h)}return new Sn(s,{type:"unit",style:"digital"===n?"short":n}).formatToParts(e)}format(t){return this.formatToParts(t).map(t=>t.value).join("")}}An=new WeakMap;const Mn=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,In=["year","month","week","day","hour","minute","second","millisecond"];class Dn{constructor(t=0,e=0,i=0,n=0,s=0,o=0,r=0,a=0){this.years=t,this.months=e,this.weeks=i,this.days=n,this.hours=s,this.minutes=o,this.seconds=r,this.milliseconds=a,this.years||(this.years=0),this.sign||(this.sign=Math.sign(this.years)),this.months||(this.months=0),this.sign||(this.sign=Math.sign(this.months)),this.weeks||(this.weeks=0),this.sign||(this.sign=Math.sign(this.weeks)),this.days||(this.days=0),this.sign||(this.sign=Math.sign(this.days)),this.hours||(this.hours=0),this.sign||(this.sign=Math.sign(this.hours)),this.minutes||(this.minutes=0),this.sign||(this.sign=Math.sign(this.minutes)),this.seconds||(this.seconds=0),this.sign||(this.sign=Math.sign(this.seconds)),this.milliseconds||(this.milliseconds=0),this.sign||(this.sign=Math.sign(this.milliseconds)),this.blank=0===this.sign}abs(){return new Dn(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))}static from(t){var e;if("string"==typeof t){const i=String(t).trim(),n=i.startsWith("-")?-1:1,s=null===(e=i.match(Mn))||void 0===e?void 0:e.slice(1).map(t=>(Number(t)||0)*n);return s?new Dn(...s):new Dn}if("object"==typeof t){const{years:e,months:i,weeks:n,days:s,hours:o,minutes:r,seconds:a,milliseconds:l}=t;return new Dn(e,i,n,s,o,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const i=Date.now(),n=Math.abs(Pn(i,Dn.from(t)).getTime()-i),s=Math.abs(Pn(i,Dn.from(e)).getTime()-i);return n>s?-1:n<s?1:0}toLocaleString(t,e){return new xn(t,e).format(this)}}function Pn(t,e){const i=new Date(t);return e.sign<0?(i.setUTCSeconds(i.getUTCSeconds()+e.seconds),i.setUTCMinutes(i.getUTCMinutes()+e.minutes),i.setUTCHours(i.getUTCHours()+e.hours),i.setUTCDate(i.getUTCDate()+7*e.weeks+e.days),i.setUTCMonth(i.getUTCMonth()+e.months),i.setUTCFullYear(i.getUTCFullYear()+e.years)):(i.setUTCFullYear(i.getUTCFullYear()+e.years),i.setUTCMonth(i.getUTCMonth()+e.months),i.setUTCDate(i.getUTCDate()+7*e.weeks+e.days),i.setUTCHours(i.getUTCHours()+e.hours),i.setUTCMinutes(i.getUTCMinutes()+e.minutes),i.setUTCSeconds(i.getUTCSeconds()+e.seconds)),i}function Nn(t,{relativeTo:e=Date.now()}={}){if(e=new Date(e),t.blank)return t;const i=t.sign;let n=Math.abs(t.years),s=Math.abs(t.months),o=Math.abs(t.weeks),r=Math.abs(t.days),a=Math.abs(t.hours),l=Math.abs(t.minutes),c=Math.abs(t.seconds),h=Math.abs(t.milliseconds);h>=900&&(c+=Math.round(h/1e3)),(c||l||a||r||o||s||n)&&(h=0),c>=55&&(l+=Math.round(c/60)),(l||a||r||o||s||n)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||r||o||s||n)&&(l=0),r&&a>=12&&(r+=Math.round(a/24)),!r&&a>=21&&(r+=Math.round(a/24)),(r||o||s||n)&&(a=0);const d=e.getFullYear(),u=e.getMonth(),m=e.getDate();if(r>=27||n+s+r){const t=new Date(e);t.setDate(1),t.setMonth(u+s*i+1),t.setDate(0);const a=Math.max(0,m-t.getDate()),l=new Date(e);l.setFullYear(d+n*i),l.setDate(m-a),l.setMonth(u+s*i),l.setDate(m-a+r*i);const c=l.getFullYear()-e.getFullYear(),h=l.getMonth()-e.getMonth(),f=Math.abs(Math.round((Number(l)-Number(e))/864e5))+a,p=Math.abs(12*c+h);f<27?(r>=6?(o+=Math.round(r/7),r=0):r=f,s=n=0):p<=11?(s=p,n=0):(s=0,n=c*i),(s||n)&&(r=0)}return n&&(s=0),o>=4&&(s+=Math.round(o/4)),(s||n)&&(o=0),r&&o&&!s&&!n&&(o+=Math.round(r/7),r=0),new Dn(n*i,s*i,o*i,r*i,a*i,l*i,c*i,h*i)}var On,Fn,Hn,qn,Vn,Rn,Wn,Bn,$n,_n,Un,jn,Kn,zn,Zn,Yn,Gn=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},Jn=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i};const Xn=globalThis.HTMLElement||null,Qn=new Dn,ts=new Dn(0,0,0,0,0,1);class es extends Event{constructor(t,e,i,n){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=i,this.newTitle=n}}function is(t){if(!t.date)return 1/0;if("duration"===t.format||"elapsed"===t.format){const e=t.precision;if("second"===e)return 1e3;if("minute"===e)return 6e4}const e=Math.abs(Date.now()-t.date.getTime());return e<6e4?1e3:e<36e5?6e4:36e5}const ns=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(t){if(this.elements.has(t))return;this.elements.add(t);const e=t.date;if(e&&e.getTime()){const e=is(t),i=Date.now()+e;i<this.time&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.update(),e),this.time=i)}}unobserve(t){this.elements.has(t)&&this.elements.delete(t)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let t=1/0;for(const e of this.elements)t=Math.min(t,is(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout(()=>this.update(),this.time),this.time+=Date.now()}};class RelativeTimeElement extends Xn{constructor(){super(...arguments),On.add(this),Fn.set(this,!1),Hn.set(this,!1),Vn.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),Yn.set(this,null)}static define(t="relative-time",e=customElements){return e.define(t,this),this}get timeZone(){var t;return(null===(t=this.closest("[time-zone]"))||void 0===t?void 0:t.getAttribute("time-zone"))||this.ownerDocument.documentElement.getAttribute("time-zone")||void 0}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","format-style","no-title","datetime","lang","title","aria-hidden","time-zone"]}get onRelativeTimeUpdated(){return Gn(this,Yn,"f")}set onRelativeTimeUpdated(t){Gn(this,Yn,"f")&&this.removeEventListener("relative-time-updated",Gn(this,Yn,"f")),Jn(this,Yn,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("relative-time-updated",t)}get second(){const t=this.getAttribute("second");if("numeric"===t||"2-digit"===t)return t}set second(t){this.setAttribute("second",t||"")}get minute(){const t=this.getAttribute("minute");if("numeric"===t||"2-digit"===t)return t}set minute(t){this.setAttribute("minute",t||"")}get hour(){const t=this.getAttribute("hour");if("numeric"===t||"2-digit"===t)return t}set hour(t){this.setAttribute("hour",t||"")}get weekday(){const t=this.getAttribute("weekday");return"long"===t||"short"===t||"narrow"===t?t:"datetime"===this.format&&""!==t?this.formatStyle:void 0}set weekday(t){this.setAttribute("weekday",t||"")}get day(){var t;const e=null!==(t=this.getAttribute("day"))&&void 0!==t?t:"numeric";if("numeric"===e||"2-digit"===e)return e}set day(t){this.setAttribute("day",t||"")}get month(){const t=this.format;let e=this.getAttribute("month");if(""!==e)return null!=e||(e="datetime"===t?this.formatStyle:"short"),"numeric"===e||"2-digit"===e||"short"===e||"long"===e||"narrow"===e?e:void 0}set month(t){this.setAttribute("month",t||"")}get year(){var t;const e=this.getAttribute("year");return"numeric"===e||"2-digit"===e?e:this.hasAttribute("year")||(new Date).getUTCFullYear()===(null===(t=this.date)||void 0===t?void 0:t.getUTCFullYear())?void 0:"numeric"}set year(t){this.setAttribute("year",t||"")}get timeZoneName(){const t=this.getAttribute("time-zone-name");if("long"===t||"short"===t||"shortOffset"===t||"longOffset"===t||"shortGeneric"===t||"longGeneric"===t)return t}set timeZoneName(t){this.setAttribute("time-zone-name",t||"")}get prefix(){var t;return null!==(t=this.getAttribute("prefix"))&&void 0!==t?t:"datetime"===this.format?"":"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&(e=t,Mn.test(e))?t:"P30D";var e}set threshold(t){this.setAttribute("threshold",t)}get tense(){const t=this.getAttribute("tense");return"past"===t?"past":"future"===t?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){const t=this.getAttribute("precision");return In.includes(t)?t:"micro"===this.format?"minute":"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return"datetime"===t?"datetime":"relative"===t?"relative":"duration"===t?"duration":"micro"===t?"micro":"elapsed"===t?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get formatStyle(){const t=this.getAttribute("format-style");if("long"===t)return"long";if("short"===t)return"short";if("narrow"===t)return"narrow";const e=this.format;return"elapsed"===e||"micro"===e?"narrow":"datetime"===e?"short":"long"}set formatStyle(t){this.setAttribute("format-style",t)}get noTitle(){return this.hasAttribute("no-title")}set noTitle(t){this.toggleAttribute("no-title",t)}get datetime(){return this.getAttribute("datetime")||""}set datetime(t){this.setAttribute("datetime",t)}get date(){const t=Date.parse(this.datetime);return Number.isNaN(t)?null:new Date(t)}set date(t){this.datetime=(null==t?void 0:t.toISOString())||""}connectedCallback(){this.update()}disconnectedCallback(){ns.unobserve(this)}attributeChangedCallback(t,e,i){e!==i&&("title"===t&&Jn(this,Fn,null!==i&&(this.date&&Gn(this,On,"m",Rn).call(this,this.date))!==i,"f"),Gn(this,Hn,"f")||"title"===t&&Gn(this,Fn,"f")||Jn(this,Hn,(async()=>{await Promise.resolve(),this.update(),Jn(this,Hn,!1,"f")})(),"f"))}update(){const t=Gn(this,Vn,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let i=e;const n=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!n)return void(Gn(this,Vn,"f").textContent=t);const s=Date.now();Gn(this,Fn,"f")||(i=Gn(this,On,"m",Rn).call(this,n)||"",i&&!this.noTitle&&this.setAttribute("title",i));const o=function(t,e="second",i=Date.now()){const n=t.getTime()-i;if(0===n)return new Dn;const s=Math.sign(n),o=Math.abs(n),r=Math.floor(o/1e3),a=Math.floor(r/60),l=Math.floor(a/60),c=Math.floor(l/24),h=Math.floor(c/30),d=Math.floor(h/12),u=In.indexOf(e)||In.length;return new Dn(u>=0?d*s:0,u>=1?(h-12*d)*s:0,0,u>=3?(c-30*h)*s:0,u>=4?(l-24*c)*s:0,u>=5?(a-60*l)*s:0,u>=6?(r-60*a)*s:0,u>=7?(o-1e3*r)*s:0)}(n,this.precision,s),r=Gn(this,On,"m",Wn).call(this,o);let a=t;const l=Gn(this,On,"m",Zn).call(this,r);a=l?Gn(this,On,"m",Kn).call(this,n):"duration"===r?Gn(this,On,"m",Bn).call(this,o):"relative"===r?Gn(this,On,"m",$n).call(this,o):Gn(this,On,"m",_n).call(this,n),a?Gn(this,On,"m",zn).call(this,a):this.shadowRoot===Gn(this,Vn,"f")&&this.textContent&&Gn(this,On,"m",zn).call(this,this.textContent),a===t&&i===e||this.dispatchEvent(new es(t,a,e,i));"relative"===r||"duration"===r||l&&(Gn(this,On,"m",Un).call(this,n)||Gn(this,On,"m",jn).call(this,n))?ns.observe(this):ns.unobserve(this)}}Fn=new WeakMap,Hn=new WeakMap,Vn=new WeakMap,Yn=new WeakMap,On=new WeakSet,qn=function(){var t;const e=(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang");try{return new Intl.Locale(null!=e?e:"").toString()}catch(t){return"default"}},Rn=function(t){return new Intl.DateTimeFormat(Gn(this,On,"a",qn),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short",timeZone:this.timeZone}).format(t)},Wn=function(t){const e=this.format;if("datetime"===e)return"datetime";if("duration"===e)return"duration";if("elapsed"===e)return"duration";if("micro"===e)return"duration";if(("auto"===e||"relative"===e)&&"undefined"!=typeof Intl&&Intl.RelativeTimeFormat){const e=this.tense;if("past"===e||"future"===e)return"relative";if(1===Dn.compare(t,this.threshold))return"relative"}return"datetime"},Bn=function(t){const e=Gn(this,On,"a",qn),i=this.format,n=this.formatStyle,s=this.tense;let o=Qn;"micro"===i?(t=Nn(t),o=ts,0===t.months&&("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=ts)):("past"===s&&-1!==t.sign||"future"===s&&1!==t.sign)&&(t=o);const r=`${this.precision}sDisplay`;return t.blank?o.toLocaleString(e,{style:n,[r]:"always"}):t.abs().toLocaleString(e,{style:n})},$n=function(t){const e=new Intl.RelativeTimeFormat(Gn(this,On,"a",qn),{numeric:"auto",style:this.formatStyle}),i=this.tense;"future"===i&&1!==t.sign&&(t=Qn),"past"===i&&-1!==t.sign&&(t=Qn);const[n,s]=function(t,e){const i=Nn(t,e);if(i.blank)return[0,"second"];for(const t of In){if("millisecond"===t)continue;const e=i[`${t}s`];if(e)return[e,t]}return[0,"second"]}(t);return"second"===s&&n<10?e.format(0,"millisecond"===this.precision?"second":this.precision):e.format(n,s)},_n=function(t){const e=new Intl.DateTimeFormat(Gn(this,On,"a",qn),{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName,timeZone:this.timeZone});return`${this.prefix} ${e.format(t)}`.trim()},Un=function(t){const e=new Date,i=new Intl.DateTimeFormat(Gn(this,On,"a",qn),{timeZone:this.timeZone,year:"numeric",month:"2-digit",day:"2-digit"});return i.format(e)===i.format(t)},jn=function(t){const e=new Date,i=new Intl.DateTimeFormat(Gn(this,On,"a",qn),{timeZone:this.timeZone,year:"numeric"});return i.format(e)===i.format(t)},Kn=function(t){const e={hour:"numeric",minute:"2-digit",timeZoneName:"short",timeZone:this.timeZone};if(Gn(this,On,"m",Un).call(this,t)){let i=new Intl.RelativeTimeFormat(Gn(this,On,"a",qn),{numeric:"auto"}).format(0,"day");i=i.charAt(0).toLocaleUpperCase(Gn(this,On,"a",qn))+i.slice(1);return`${i} ${new Intl.DateTimeFormat(Gn(this,On,"a",qn),e).format(t)}`}const i=Object.assign(Object.assign({},e),{day:"numeric",month:"short"});return Gn(this,On,"m",jn).call(this,t)?new Intl.DateTimeFormat(Gn(this,On,"a",qn),i).format(t):new Intl.DateTimeFormat(Gn(this,On,"a",qn),Object.assign(Object.assign({},i),{year:"numeric"})).format(t)},zn=function(t){if(this.hasAttribute("aria-hidden")&&"true"===this.getAttribute("aria-hidden")){const e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.textContent=t,Gn(this,Vn,"f").replaceChildren(e)}else Gn(this,Vn,"f").textContent=t},Zn=function(t){var e;return"duration"!==t&&("true"===this.ownerDocument.documentElement.getAttribute("data-prefers-absolute-time")||"true"===(null===(e=this.ownerDocument.body)||void 0===e?void 0:e.getAttribute("data-prefers-absolute-time")))};const ss="undefined"!=typeof globalThis?globalThis:window;try{ss.RelativeTimeElement=RelativeTimeElement.define()}catch(t){if(!(ss.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}var os,rs,as,ls,cs=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i},hs=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},ds=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const us=globalThis.HTMLElement||null;function ms(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter(e=>e instanceof us&&e.closest(t.tagName)===t)}class fs extends Event{constructor(t,e){var{tab:i,panel:n}=e;super(t,ds(e,["tab","panel"])),os.set(this,null),rs.set(this,null),cs(this,rs,i||null,"f"),cs(this,os,n||null,"f")}get detail(){return console.warn("TabContainerElement.detail is deprecated, please use .panel instead"),{relatedTarget:hs(this,os,"f")}}get panel(){return hs(this,os,"f")}get tab(){return hs(this,rs,"f")}}os=new WeakMap,rs=new WeakMap;class TabContainerElement extends us{constructor(){super(...arguments),as.set(this,null),ls.set(this,null)}static define(t="tab-container",e=customElements){return e.define(t,this),this}get onTabContainerChange(){return hs(this,as,"f")}set onTabContainerChange(t){hs(this,as,"f")&&this.removeEventListener("tab-container-change",hs(this,as,"f")),cs(this,as,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("tab-container-change",t)}get onTabContainerChanged(){return hs(this,ls,"f")}set onTabContainerChanged(t){hs(this,ls,"f")&&this.removeEventListener("tab-container-changed",hs(this,ls,"f")),cs(this,ls,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("tab-container-changed",t)}connectedCallback(){this.addEventListener("keydown",t=>{var e;const i=t.target;if(!(i instanceof us))return;if(i.closest(this.tagName)!==this)return;if("tab"!==i.getAttribute("role")&&!i.closest('[role="tablist"]'))return;const n=ms(this),s=n.indexOf(n.find(t=>t.matches('[aria-selected="true"]'))),[o,r]="vertical"===(null===(e=i.closest('[role="tablist"]'))||void 0===e?void 0:e.getAttribute("aria-orientation"))?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(o.some(e=>t.code===e)){let t=s+1;t>=n.length&&(t=0),this.selectTab(t)}else if(r.some(e=>t.code===e)){let t=s-1;t<0&&(t=n.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(n.length-1),t.preventDefault())}),this.addEventListener("click",t=>{const e=ms(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const i=t.target.closest('[role="tab"]');if(!(i instanceof us&&i.closest('[role="tablist"]')))return;const n=e.indexOf(i);this.selectTab(n)});for(const t of ms(this))t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.hasAttribute("tabindex")||("true"===t.getAttribute("aria-selected")?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"))}selectTab(t){const e=ms(this),i=Array.from(this.querySelectorAll('[role="tabpanel"]')).filter(t=>t.closest(this.tagName)===this);if(t>e.length-1)throw new RangeError(`Index "${t}" out of bounds`);const n=e[t],s=i[t];if(!!this.dispatchEvent(new fs("tab-container-change",{bubbles:!0,cancelable:!0,tab:n,panel:s}))){for(const t of e)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of i)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0"),n.focus(),s.hidden=!1,this.dispatchEvent(new fs("tab-container-changed",{bubbles:!0,tab:n,panel:s}))}}}as=new WeakMap,ls=new WeakMap;const ps="undefined"!=typeof globalThis?globalThis:window;try{ps.TabContainerElement=TabContainerElement.define()}catch(t){if(!(ps.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}let gs=class PrimerMultiInputElement extends HTMLElement{activateField(t){const e=this.findField(t);if(e){for(const t of this.fields)t!==e&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),t.parentElement?.setAttribute("hidden","hidden"));e.removeAttribute("disabled"),e.removeAttribute("hidden"),e.parentElement?.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function bs(t,e=0,{start:i=!1,middle:n=!1,once:s=!1}={}){return function(t,e=0,{start:i=!0,middle:n=!0,once:s=!1}={}){let o,r=i,a=0,l=!1;function c(...h){if(l)return;const d=Date.now()-a;a=Date.now(),i&&n&&d>=e&&(r=!0),r?(r=!1,t.apply(this,h),s&&c.cancel()):(n&&d<e||!n)&&(clearTimeout(o),o=setTimeout(()=>{a=Date.now(),t.apply(this,h),s&&c.cancel()},n?e-d:e))}return c.cancel=()=>{clearTimeout(o),l=!0},c}(t,e,{start:i,middle:n,once:s})}g([j],gs.prototype,"fields",void 0),gs=g([K("primer-multi-input")],gs),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:gs}),window.customElements.define("primer-multi-input",gs));var vs,ws,ys=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},Es=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i};!function(t){t.GET="GET",t.POST="POST"}(ws||(ws={}));const As=new WeakMap;class ks extends Event{constructor(t){super(`auto-check-${t}`,{bubbles:!0}),this.phase=t}get detail(){return this}}class Ls extends ks{constructor(t,e=""){super(t),this.phase=t,this.message=e,this.setValidity=t=>{this.message=t}}}class Ss extends ks{constructor(){super("complete")}}class Ts extends ks{constructor(t){super("success"),this.response=t}}class Cs extends Ls{constructor(){super("start","Verifying…")}}class xs extends Ls{constructor(t){super("error","Validation failed"),this.response=t}}class Ms extends ks{constructor(t){super("send"),this.body=t}}class AutoCheckElement extends HTMLElement{constructor(){super(...arguments),vs.set(this,null)}static define(t="auto-check",e=customElements){return e.define(t,this),this}get onloadend(){return ys(this,vs,"f")}set onloadend(t){ys(this,vs,"f")&&this.removeEventListener("loadend",ys(this,vs,"f")),Es(this,vs,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("loadend",t)}connectedCallback(){const t=this.input;if(!t)return;const e=bs(Ps.bind(null,this),300),i={check:e,controller:null};As.set(this,i);const n=Is.bind(null,e);t.addEventListener("blur",n),t.addEventListener("input",n),t.addEventListener("triggervalidation",n),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=As.get(this);e&&(As.delete(this),t.removeEventListener("input",Ds),t.removeEventListener("input",e.check),t.setCustomValidity(""))}attributeChangedCallback(t){if("required"===t){const t=this.input;if(!t)return;t.required=this.required}}triggerValidation(){const t=this.input;t&&t.dispatchEvent(new CustomEvent("triggervalidation"))}static get observedAttributes(){return["required"]}get input(){return this.querySelector("input")}get src(){const t=this.getAttribute("src");if(!t)return"";const e=this.ownerDocument.createElement("a");return e.href=t,e.href}set src(t){this.setAttribute("src",t)}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||""}set csrf(t){this.setAttribute("csrf",t)}get required(){return this.hasAttribute("required")}set required(t){t?this.setAttribute("required",""):this.removeAttribute("required")}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}set csrfField(t){this.setAttribute("csrf-field",t)}get httpMethod(){return ws[this.getAttribute("http-method")]||"POST"}set validateOnKeystroke(t){t?this.setAttribute("validate-on-keystroke",""):this.removeAttribute("validate-on-keystroke")}get validateOnKeystroke(){const t=this.getAttribute("validate-on-keystroke");return"true"===t||""===t}}function Is(t,e){const i=e.currentTarget;if(!(i instanceof HTMLInputElement))return;const n=i.closest("auto-check");n instanceof AutoCheckElement&&("input"===e.type&&n.setAttribute("dirty",""),0!==i.value.length&&("blur"===e.type&&!n.validateOnKeystroke&&n.hasAttribute("dirty")||"input"===e.type&&n.validateOnKeystroke||"triggervalidation"===e.type)&&(Ds(e),t()))}function Ds(t){const e=t.currentTarget;if(!(e instanceof HTMLInputElement))return;const i=e.closest("auto-check");if(!(i instanceof AutoCheckElement))return;const n=i.src,s=i.csrf,o=i.httpMethod,r=As.get(i);if(!n||"POST"===o&&!s||!r)return;const a=new Cs;e.dispatchEvent(a),i.required&&e.setCustomValidity(a.message)}async function Ps(t){const e=t.input;if(!e)return;const i=t.csrfField,n=t.src,s=t.csrf,o=As.get(t),r=t.httpMethod;if(!n||"POST"===r&&!s||!o)return void(t.required&&e.setCustomValidity(""));if(!e.value.trim())return void(t.required&&e.setCustomValidity(""));const a=new FormData,l=new URL(n,window.location.origin);"POST"===r?(a.append(i,s),a.append("value",e.value)):l.search=new URLSearchParams({value:e.value}).toString(),e.dispatchEvent(new Ms(a)),o.controller?o.controller.abort():t.dispatchEvent(new Event("loadstart")),o.controller="AbortController"in window?new AbortController:{signal:null,abort(){}},t.removeAttribute("dirty");try{const i=await async function(t,e,i){"GET"===i.method&&delete i.body;try{const n=await fetch(e,i);return t.dispatchEvent(new Event("load")),t.dispatchEvent(new Event("loadend")),n}catch(e){throw"AbortError"!==e.name&&(t.dispatchEvent(new Event("error")),t.dispatchEvent(new Event("loadend"))),e}}(t,l.toString(),{credentials:"same-origin",signal:o.controller.signal,method:r,body:a});if(i.ok)t.required&&e.setCustomValidity(""),t.validateOnKeystroke=!1,e.dispatchEvent(new Ts(i.clone()));else{t.validateOnKeystroke=!0;const n=new xs(i.clone());e.dispatchEvent(n),t.required&&e.setCustomValidity(n.message)}o.controller=null,e.dispatchEvent(new Ss)}catch(t){"AbortError"!==t.name&&(o.controller=null,e.dispatchEvent(new Ss))}}vs=new WeakMap;const Ns="undefined"!=typeof globalThis?globalThis:window;try{Ns.AutoCheckElement=AutoCheckElement.define()}catch(t){if(!(Ns.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}class Os{constructor(t,e,i){this.inputElement=t,this.characterLimitElement=e,this.characterLimitSrElement=i,this.SCREEN_READER_DELAY=500,this.announceTimeout=null,this.isInitialLoad=!0}initialize(t){this.inputElement.addEventListener("keyup",()=>this.updateCharacterCount(),t?{signal:t}:void 0),this.inputElement.addEventListener("paste",()=>setTimeout(()=>this.updateCharacterCount(),50),t?{signal:t}:void 0),this.updateCharacterCount(),this.isInitialLoad=!1}cleanup(){this.announceTimeout&&clearTimeout(this.announceTimeout)}pluralize(t,e){return 1===t?e:`${e}s`}updateCharacterCount(){if(!this.characterLimitElement)return;const t=this.characterLimitElement.getAttribute("data-max-length");if(!t)return;const e=parseInt(t,10)-this.inputElement.value.length;let i="";if(e>=0){i=`${e} ${this.pluralize(e,"character")} remaining`;const t=this.characterLimitElement.querySelector(".FormControl-caption-text");t&&(t.textContent=i),this.clearError()}else{const t=-e;i=`${t} ${this.pluralize(t,"character")} over`;const n=this.characterLimitElement.querySelector(".FormControl-caption-text");n&&(n.textContent=i),this.setError()}this.isInitialLoad||this.announceToScreenReader(i)}announceToScreenReader(t){this.announceTimeout&&clearTimeout(this.announceTimeout),this.announceTimeout=window.setTimeout(()=>{this.characterLimitSrElement&&(this.characterLimitSrElement.textContent=t)},this.SCREEN_READER_DELAY)}setError(){this.inputElement.setAttribute("invalid","true"),this.inputElement.setAttribute("aria-invalid","true"),this.characterLimitElement.classList.add("fgColor-danger");const t=this.characterLimitElement.querySelector(".FormControl-caption-icon");t&&t.removeAttribute("hidden")}clearError(){this.inputElement.removeAttribute("invalid"),this.inputElement.removeAttribute("aria-invalid"),this.characterLimitElement.classList.remove("fgColor-danger");const t=this.characterLimitElement.querySelector(".FormControl-caption-icon");t&&t.setAttribute("hidden","")}}var Fs,Hs;let qs=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),Fs.set(this,void 0),Hs.set(this,null)}connectedCallback(){b(this,Fs,"f")?.abort();const{signal:t}=v(this,Fs,new AbortController,"f");this.addEventListener("auto-check-success",async t=>{const e=await t.detail.response.text();e&&e.length>0?this.setSuccess(e):this.clearError()},{signal:t}),this.addEventListener("auto-check-error",async t=>{const e=await t.detail.response.text();this.setError(e)},{signal:t}),this.characterLimitElement&&(v(this,Hs,new Os(this.inputElement,this.characterLimitElement,this.characterLimitSrElement),"f"),b(this,Hs,"f").initialize(t))}disconnectedCallback(){b(this,Fs,"f")?.abort(),b(this,Hs,"f")?.cleanup()}clearContents(){this.inputElement.value="",this.inputElement.focus(),this.inputElement.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!1}))}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.replaceChildren()}setValidationMessage(t){const e=document.createElement("template");e.innerHTML=t;const i=document.importNode(e.content,!0);this.validationMessageElement.replaceChildren(i)}toggleValidationStyling(t){t?this.validationElement.classList.remove("FormControl-inlineValidation--success"):this.validationElement.classList.add("FormControl-inlineValidation--success"),this.validationSuccessIcon.hidden=t,this.validationErrorIcon.hidden=!t,this.inputElement.setAttribute("invalid",t?"true":"false")}setSuccess(t){this.toggleValidationStyling(!1),this.setValidationMessage(t),this.validationElement.hidden=!1}setError(t){this.toggleValidationStyling(!0),this.setValidationMessage(t),this.validationElement.hidden=!1}showLeadingSpinner(){this.leadingSpinner?.removeAttribute("hidden"),this.leadingVisual?.setAttribute("hidden","")}hideLeadingSpinner(){this.leadingSpinner?.setAttribute("hidden",""),this.leadingVisual?.removeAttribute("hidden")}};var Vs;Fs=new WeakMap,Hs=new WeakMap,g([U],qs.prototype,"inputElement",void 0),g([U],qs.prototype,"validationElement",void 0),g([U],qs.prototype,"validationMessageElement",void 0),g([U],qs.prototype,"validationSuccessIcon",void 0),g([U],qs.prototype,"validationErrorIcon",void 0),g([U],qs.prototype,"leadingVisual",void 0),g([U],qs.prototype,"leadingSpinner",void 0),g([U],qs.prototype,"characterLimitElement",void 0),g([U],qs.prototype,"characterLimitSrElement",void 0),qs=g([K("primer-text-field")],qs);let Rs=class PrimerTextAreaElement extends HTMLElement{constructor(){super(...arguments),Vs.set(this,null)}connectedCallback(){this.characterLimitElement&&(v(this,Vs,new Os(this.inputElement,this.characterLimitElement,this.characterLimitSrElement),"f"),b(this,Vs,"f").initialize())}disconnectedCallback(){b(this,Vs,"f")?.cleanup()}};Vs=new WeakMap,g([U],Rs.prototype,"inputElement",void 0),g([U],Rs.prototype,"characterLimitElement",void 0),g([U],Rs.prototype,"characterLimitSrElement",void 0),Rs=g([K("primer-text-area")],Rs),window.customElements.get("primer-text-area")||(Object.assign(window,{PrimerTextAreaElement:Rs}),window.customElements.define("primer-text-area",Rs));let Ws=class ToggleSwitchInputElement extends HTMLElement{connectedCallback(){this.addEventListener("toggleSwitchError",t=>{this.validationMessageElement.textContent=t.detail,this.validationElement.removeAttribute("hidden")}),this.addEventListener("toggleSwitchSuccess",()=>{this.validationMessageElement.textContent="",this.validationElement.setAttribute("hidden","hidden")}),this.addEventListener("toggleSwitchLoading",()=>{this.validationMessageElement.textContent="",this.validationElement.setAttribute("hidden","hidden")})}};var Bs,$s,_s,Us,js,Ks,zs,Zs,Ys,Gs,Js,Xs,Qs,to,eo,io,no,so,oo,ro,ao,lo,co,ho,uo,mo,fo,po,go,bo,vo,wo,yo;g([U],Ws.prototype,"validationElement",void 0),g([U],Ws.prototype,"validationMessageElement",void 0),Ws=g([K("toggle-switch-input")],Ws);class Eo{constructor(){Bs.add(this),$s.set(this,void 0),v(this,$s,[],"f")}get current(){return b(this,$s,"f")[b(this,$s,"f").length-1]}push(t,e={trapFocus:!0}){const{trapFocus:i}=e;b(this,$s,"f").push({element:t,abortController:b(this,Bs,"m",_s).call(this,t,i)})}pop(t){if(t)for(;b(this,$s,"f").length>0&&this.current?.element!==t;){const t=b(this,$s,"f").pop();t?.abortController?.abort()}const e=b(this,$s,"f").pop();e?.abortController?.abort()}elementIsMenuItem(t){return b(this,Bs,"a",Us).includes(t.getAttribute("role")||"")}get isEmpty(){return 0===b(this,$s,"f").length}}$s=new WeakMap,Bs=new WeakSet,_s=function(t,e){const i=xt(t,{bindKeys:Et.ArrowVertical|Et.ArrowHorizontal|Et.HomeAndEnd|Et.Backspace,focusOutBehavior:"wrap",focusableElementFilter:e=>this.elementIsMenuItem(e)&&e.closest("anchored-position")===t});if(e){const{signal:e}=i;return pt(t,void 0,e)}return i},Us=function(){return Ao.validItemRoles};let Ao=yo=class ActionMenuElement extends HTMLElement{constructor(){super(...arguments),js.add(this),Ks.set(this,void 0),zs.set(this,""),Zs.set(this,""),Ys.set(this,!1),Gs.set(this,void 0),Js.set(this,void 0)}get selectVariant(){return this.getAttribute("data-select-variant")}set selectVariant(t){t?this.setAttribute("data-select-variant",t):this.removeAttribute("variant")}get dynamicLabelPrefix(){const t=this.getAttribute("data-dynamic-label-prefix");return t?`${t}:`:""}set dynamicLabelPrefix(t){this.setAttribute("data-dynamic-label",t)}get dynamicLabel(){return this.hasAttribute("data-dynamic-label")}set dynamicLabel(t){this.toggleAttribute("data-dynamic-label",t)}get popoverElement(){return this.invokerElement?.popoverTargetElement||null}get childPopoverElements(){return Array.from(this.overlay.querySelectorAll("anchored-position"))}get invokerElement(){const t=this.querySelector("[role=menu]")?.id;if(!t)return null;for(const e of this.querySelectorAll("[aria-controls]"))if(e.getAttribute("aria-controls")===t)return e;return null}get invokerLabel(){return this.invokerElement?this.invokerElement.querySelector(".Button-label"):null}get selectedItems(){const t=this.querySelectorAll("[aria-checked=true]"),e=[];for(const i of t){const t=i.querySelector(".ActionListItem-label");e.push({label:t?.textContent,value:i?.getAttribute("data-value"),element:i})}return e}connectedCallback(){const{signal:t}=v(this,Ks,new AbortController,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusout",this,{signal:t}),this.addEventListener("mousedown",this,{signal:t}),this.addEventListener("toggle",this,{signal:t,capture:!0}),b(this,js,"m",po).call(this),b(this,js,"m",go).call(this),b(this,js,"m",Qs).call(this),this.includeFragment&&this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t});const e=()=>{b(this,js,"m",fo).call(this)&&this.overlay?.update()};v(this,Gs,new IntersectionObserver(t=>{for(const i of t){i.target===this.invokerElement&&(i.isIntersecting?window.addEventListener("scroll",e,{capture:!0}):window.removeEventListener("scroll",e,{capture:!0}))}}),"f"),Ze(this,()=>Boolean(this.invokerElement),()=>b(this,Gs,"f").observe(this.invokerElement)),this.includeFragment||this.setAttribute("data-ready","true");new MutationObserver(()=>b(this,js,"m",Xs).call(this)).observe(this,{childList:!0,subtree:!0}),b(this,js,"m",Xs).call(this),v(this,Js,new Eo,"f")}disconnectedCallback(){b(this,Ks,"f").abort()}handleEvent(t){const e=this.invokerElement?.contains(t.target),i=b(this,js,"m",no).call(this,t);if("toggle"===t.type&&t instanceof ToggleEvent)return void b(this,js,"m",oo).call(this,t);if(e&&"mousedown"===t.type)return void v(this,Ys,!0,"f");if("mousedown"===t.type)return void t.preventDefault();if(e&&i)return b(this,js,"m",ro).call(this,t),void v(this,Ys,!1,"f");if("focusout"===t.type){if(b(this,Ys,"f"))return;return void requestAnimationFrame(()=>{this.contains(document.activeElement)&&document.activeElement!==this.invokerElement||b(this,js,"m",ho).call(this)})}const n=t.target.closest(yo.menuItemSelectors.join(",")),s=null!==n;if(s&&i){if(b(this,js,"m",to).call(this,t))return;const e=n.closest("[data-show-dialog-id]");if(e){const i=this.ownerDocument.getElementById(e.getAttribute("data-show-dialog-id")||"");if(i&&this.contains(e))return void b(this,js,"m",ao).call(this,t,i)}b(this,js,"m",eo).call(this,t)&&(t.preventDefault(),n.click());const i=b(this,js,"m",vo).call(this,n);return i?(t.preventDefault(),void i.showPopover()):void b(this,js,"m",lo).call(this,n)}"include-fragment-replaced"!==t.type?s&&t instanceof KeyboardEvent&&b(this,js,"m",so).call(this,t,n):b(this,js,"m",co).call(this)}get items(){return Array.from(this.querySelectorAll(yo.menuItemSelectors.join(",")))}getItemById(t){return this.querySelector(`li[data-item-id="${t}"`)}isItemDisabled(t){return!!t&&t.classList.contains("ActionListItem--disabled")}disableItem(t){t&&(t.classList.add("ActionListItem--disabled"),t.querySelector(".ActionListContent").setAttribute("aria-disabled","true"))}enableItem(t){t&&(t.classList.remove("ActionListItem--disabled"),t.querySelector(".ActionListContent").removeAttribute("aria-disabled"))}isItemHidden(t){return!!t&&t.hasAttribute("hidden")}hideItem(t){t&&t.setAttribute("hidden","hidden")}showItem(t){t&&t.removeAttribute("hidden")}isItemChecked(t){return!!t&&"true"===t.querySelector(".ActionListContent").getAttribute("aria-checked")}checkItem(t){if(t&&("single"===this.selectVariant||"multiple"===this.selectVariant)){const e=t.querySelector(".ActionListContent");"true"===e.getAttribute("aria-checked")||b(this,js,"m",lo).call(this,e)}}uncheckItem(t){if(t&&("single"===this.selectVariant||"multiple"===this.selectVariant)){const e=t.querySelector(".ActionListContent");"true"===e.getAttribute("aria-checked")&&b(this,js,"m",lo).call(this,e)}}};Ks=new WeakMap,zs=new WeakMap,Zs=new WeakMap,Ys=new WeakMap,Gs=new WeakMap,Js=new WeakMap,js=new WeakSet,Xs=function(){let t=1;for(const e of this.querySelectorAll("[role=menu]"))e.setAttribute("data-level",t.toString()),t++},Qs=function(){const{signal:t}=b(this,Ks,"f");for(const e of this.querySelectorAll(yo.validSelectors.join(",")))e.addEventListener("click",b(this,js,"m",to).bind(this),{signal:t}),e.addEventListener("keydown",b(this,js,"m",to).bind(this),{signal:t})},to=function(t){if(!b(this,js,"m",no).call(this,t))return!1;const e=t.target.closest(yo.menuItemSelectors.join(","));return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},eo=function(t){return t.target instanceof HTMLAnchorElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},io=function(t){return t.target instanceof ClipboardCopyElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&(" "===t.key||"Enter"===t.key)},no=function(t){return t instanceof MouseEvent&&"click"===t.type||b(this,js,"m",eo).call(this,t)||b(this,js,"m",io).call(this,t)},so=function(t,e){switch(t.key){case"ArrowRight":{const t=b(this,js,"m",vo).call(this,e);t?.showPopover();break}case"ArrowLeft":if(e.closest("role[menu]")!==this.list){const t=e.closest("anchored-position");t?.hidePopover()}}},oo=function(t){const e=t.target;if(t.target instanceof AnchoredPositionElement)if("open"===t.newState){const t=e===this.overlay;b(this,Js,"f").push(e,{trapFocus:!t}),window.requestAnimationFrame(()=>{const t=e.querySelector(yo.menuItemSelectors.join(","));t?.focus()})}else{b(this,Js,"f").pop(e);const t=b(this,js,"m",wo).call(this,e),i=document.querySelector(":popover-open");t&&!i&&t.focus()}},ro=function(t){t.preventDefault(),t.stopPropagation(),b(this,js,"m",fo).call(this)?b(this,js,"m",mo).call(this):b(this,js,"m",uo).call(this)},ao=function(t,e){this.contains(e)&&(this.querySelector(".ActionListWrap").style.display="none");const i=new AbortController,{signal:n}=i,s=()=>{i.abort(),this.contains(e)&&(this.querySelector(".ActionListWrap").style.display="",b(this,js,"m",fo).call(this)&&b(this,js,"m",mo).call(this));const t=this.ownerDocument.activeElement,n=this.ownerDocument.activeElement===this.ownerDocument.body,s=this.contains(t),o=e.contains(t);(n||s||o)&&setTimeout(()=>{const e=this.ownerDocument.activeElement;e!==t&&e!==this.ownerDocument.body||this.invokerElement?.focus()},0)};e.addEventListener("close",s,{signal:n}),e.addEventListener("cancel",s,{signal:n})},lo=function(t){if("multiple"!==this.selectVariant&&setTimeout(()=>{b(this,js,"m",fo).call(this)&&b(this,js,"m",mo).call(this)}),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e="true"!==t.getAttribute("aria-checked");if("single"===this.selectVariant){e&&t.setAttribute("aria-checked","true");for(const e of this.querySelectorAll("[aria-checked]"))e!==t&&e.setAttribute("aria-checked","false");b(this,js,"m",po).call(this)}else t.setAttribute("aria-checked",`${e}`);b(this,js,"m",go).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:t.parentElement,checked:this.isItemChecked(t.parentElement)}}))},co=function(){b(this,js,"a",bo)?.focus(),b(this,js,"m",Qs).call(this),this.setAttribute("data-ready","true")},ho=function(){b(this,js,"m",mo).call(this)},uo=function(){this.popoverElement?.showPopover()},mo=function(){this.popoverElement?.hidePopover();for(const t of this.childPopoverElements)t.hidePopover()},fo=function(){return this.popoverElement?.matches(":popover-open")},po=function(){if("single"!==this.selectVariant)return;if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;v(this,zs,b(this,zs,"f")||t.textContent||"","f");const e=this.querySelector("[aria-checked=true] .ActionListItem-label");if(e&&this.dynamicLabel){const i=document.createElement("span");i.classList.add("color-fg-muted");const n=document.createElement("span");i.textContent=this.dynamicLabelPrefix,n.textContent=e.textContent||"",t.replaceChildren(i,n)}else t.textContent=b(this,zs,"f")},go=function(){if("single"===this.selectVariant){const t=this.querySelector("[data-list-inputs=true] input");if(!t)return;const e=this.selectedItems[0];e?(t.value=(e.value||e.label||"").trim(),t.removeAttribute("disabled")):t.setAttribute("disabled","disabled")}else if("none"!==this.selectVariant){const t=this.querySelector("[data-list-inputs=true]");if(!t)return;const e=t.querySelectorAll("input");e.length>0&&v(this,Zs,b(this,Zs,"f")||e[0].name,"f");for(const e of this.selectedItems){const i=document.createElement("input");i.setAttribute("data-list-input","true"),i.type="hidden",i.autocomplete="off",i.name=b(this,Zs,"f"),i.value=(e.value||e.label||"").trim(),t.append(i)}for(const t of e)t.remove()}},bo=function(){return this.querySelector(yo.menuItemSelectors.join(","))},vo=function(t){const e=t.getAttribute("popovertarget");return e?this.querySelector(`[id="${e}"]`):null},wo=function(t){const e=t.getAttribute("anchor");return e?this.querySelector(`[id="${e}"]`):null},Ao.validItemRoles=["menuitem","menuitemcheckbox","menuitemradio"],Ao.validSelectors=yo.validItemRoles.map(t=>`[role="${t}"]`),Ao.menuItemSelectors=yo.validSelectors.map(t=>`:not([hidden]) > ${t}`),g([U],Ao.prototype,"includeFragment",void 0),g([U],Ao.prototype,"overlay",void 0),g([U],Ao.prototype,"list",void 0),Ao=yo=g([K("action-menu")],Ao),window.customElements.get("action-menu")||(window.ActionMenuElement=Ao,window.customElements.define("action-menu",Ao));const ko="less",Lo="equal",So="greater";var To,Co,xo,Mo,Io,Do=t=>{throw TypeError(t)},Po=(t,e,i)=>e.has(t)||Do("Cannot "+i),No=(t,e,i)=>(Po(t,e,"read from private field"),i?i.call(t):e.get(t)),Oo=(t,e,i)=>e.has(t)?Do("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Fo=(t,e,i,n)=>(Po(t,e,"write to private field"),e.set(t,i),i),Ho=(t,e,i)=>(Po(t,e,"access private method"),i);class qo{constructor({compareFn:t}){Oo(this,xo),Oo(this,To),Oo(this,Co),Fo(this,To,t),Fo(this,Co,[])}insert(t){No(this,Co).push(t),Ho(this,xo,Io).call(this)}pop(){const t=No(this,Co)[0];return No(this,Co)[No(this,Co).length-1]&&(No(this,Co)[0]=No(this,Co)[No(this,Co).length-1],No(this,Co).pop()),Ho(this,xo,Mo).call(this),t}peek(){return No(this,Co)[0]}delete(t){const e=No(this,Co).indexOf(t);-1!==e&&(zo(No(this,Co),e,No(this,Co).length-1),No(this,Co).pop(),Ho(this,xo,Mo).call(this))}clear(){Fo(this,Co,[])}get size(){return No(this,Co).length}}function Vo(t){return 2*t+1}function Ro(t){return 2*t+2}function Wo(t){return Math.floor((t-1)/2)}function Bo(t,e){return Vo(t)<e}function $o(t,e){return Ro(t)<e}function _o(t){return t>0}function Uo(t,e){return t[Vo(e)]}function jo(t,e){return t[Ro(e)]}function Ko(t,e){return t[Wo(e)]}function zo(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}To=new WeakMap,Co=new WeakMap,xo=new WeakSet,Mo=function(){let t=0;for(;Bo(t,No(this,Co).length);){let e=Vo(t);if($o(t,No(this,Co).length)&&No(this,To).call(this,jo(No(this,Co),t),Uo(No(this,Co),t))===ko&&(e=Ro(t)),No(this,To).call(this,No(this,Co)[t],No(this,Co)[e])===ko)break;zo(No(this,Co),t,e),t=e}},Io=function(){let t=No(this,Co).length-1;for(;_o(t)&&No(this,To).call(this,No(this,Co)[t],Ko(No(this,Co),t))===ko;)zo(No(this,Co),t,Wo(t)),t=Wo(t)};var Zo,Yo,Go,Jo,Xo=Object.defineProperty,Qo=t=>{throw TypeError(t)},tr=(t,e,i)=>((t,e,i)=>e in t?Xo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),er=(t,e,i)=>e.has(t)||Qo("Cannot "+i),ir=(t,e,i)=>(er(t,e,"read from private field"),i?i.call(t):e.get(t)),nr=(t,e,i)=>e.has(t)?Qo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),sr=(t,e,i,n)=>(er(t,e,"write to private field"),e.set(t,i),i);Zo=Symbol.toStringTag;class or{constructor(){tr(this,Zo,"Deferred"),nr(this,Yo),nr(this,Go),nr(this,Jo),sr(this,Yo,new Promise((t,e)=>{sr(this,Go,t),sr(this,Jo,e)}))}then(t,e){return Promise.prototype.then.apply(ir(this,Yo),[t,e])}catch(t){return Promise.prototype.catch.apply(ir(this,Yo),[t])}finally(t){return Promise.prototype.finally.apply(ir(this,Yo),[t])}resolve(t){ir(this,Go).call(this,t)}reject(t){ir(this,Jo).call(this,t)}getPromise(){return ir(this,Yo)}}Yo=new WeakMap,Go=new WeakMap,Jo=new WeakMap;var rr,ar,lr,cr,hr,dr,ur=t=>{throw TypeError(t)},mr=(t,e,i)=>e.has(t)||ur("Cannot "+i),fr=(t,e,i)=>(mr(t,e,"read from private field"),i?i.call(t):e.get(t)),pr=(t,e,i)=>e.has(t)?ur("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),gr=(t,e,i,n)=>(mr(t,e,"write to private field"),e.set(t,i),i),br=(t,e,i)=>(mr(t,e,"access private method"),i);class LiveRegionElement extends HTMLElement{constructor(){if(super(),pr(this,cr),pr(this,rr),pr(this,ar),pr(this,lr),!this.shadowRoot){const t=function(){if(vr)return vr;return vr=document.createElement("template"),vr.innerHTML=wr,vr}();this.attachShadow({mode:"open"}).appendChild(t.content.cloneNode(!0))}gr(this,rr,!1),gr(this,lr,null),gr(this,ar,new qo({compareFn:yr}))}get delay(){const t=this.getAttribute("delay");return t?parseInt(t,10):150}set delay(t){this.setAttribute("delay",`${t}`)}announce(t,e={}){const{delayMs:i,politeness:n="polite"}=e,s=Date.now(),o=new or,r={deferred:o,politeness:n,contents:t,scheduled:void 0!==i?s+i:s};return fr(this,ar).insert(r),br(this,cr,hr).call(this),{...o.getPromise(),cancel:()=>{fr(this,ar).delete(r),o.resolve()}}}announceFromElement(t,e){const i=function(t){let e="";t.hasAttribute("aria-label")?e=t.getAttribute("aria-label"):t.innerText?e=t.innerText:t.textContent&&(e=t.textContent);return e?e.trim():""}(t);if(""!==i)return this.announce(i,e);return{...Promise.resolve(),cancel:Er}}getMessage(t="polite"){const e=this.shadowRoot?.getElementById(t);if(!e)throw new Error("Unable to find container for message");return e.textContent}clear(){null!==fr(this,lr)&&(clearTimeout(fr(this,lr)),gr(this,lr,null)),gr(this,rr,!1),fr(this,ar).clear()}}rr=new WeakMap,ar=new WeakMap,lr=new WeakMap,cr=new WeakSet,hr=function(){if(fr(this,rr))return;let t=fr(this,ar).peek();if(!t)return;null!==fr(this,lr)&&(clearTimeout(fr(this,lr)),gr(this,lr,null));const e=Date.now();if(t.scheduled<=e)return t=fr(this,ar).pop(),t&&br(this,cr,dr).call(this,t),void br(this,cr,hr).call(this);const i=t.scheduled-e;gr(this,lr,window.setTimeout(()=>{gr(this,lr,null),br(this,cr,hr).call(this)},i))},dr=function(t){gr(this,rr,!0);const{contents:e,deferred:i,politeness:n}=t,s=this.shadowRoot?.getElementById(n);if(!s)throw gr(this,rr,!1),new Error(`Unable to find container for message. Expected a container with id="${n}"`);s.textContent===e?s.textContent=`${e} `:s.textContent=e,null!==fr(this,lr)&&clearTimeout(fr(this,lr)),i.resolve(),this.delay>0?gr(this,lr,window.setTimeout(()=>{gr(this,lr,null),gr(this,rr,!1),br(this,cr,hr).call(this)},this.delay)):(gr(this,lr,null),gr(this,rr,!1),br(this,cr,hr).call(this))};let vr=null;const wr='\n<style>\n:host {\n border: 0;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n</style>\n<div id="polite" aria-live="polite" aria-atomic="true"></div>\n<div id="assertive" aria-live="assertive" aria-atomic="true"></div>\n';function yr(t,e){return t.politeness===e.politeness?t.scheduled===e.scheduled?Lo:t.scheduled<e.scheduled?ko:So:"assertive"===t.politeness&&"assertive"!==e.politeness?ko:"assertive"!==t.politeness&&"assertive"===e.politeness?So:Lo}function Er(){}var Ar,kr,Lr,Sr,Tr,Cr,xr,Mr,Ir,Dr,Pr,Nr,Or,Fr,Hr,qr,Vr,Rr,Wr,Br,$r,_r,Ur,jr,Kr,zr,Zr,Yr,Gr,Jr,Xr,Qr,ta,ea,ia,na,sa,oa,ra,aa;customElements.get("live-region")||customElements.define("live-region",LiveRegionElement);const la=['[role="option"]'],ca=la.join(","),ha=la.map(t=>`:not([hidden]) > ${t}`).join(",");var da,ua;!function(t){t[t.REMOTE=0]="REMOTE",t[t.EVENTUALLY_LOCAL=1]="EVENTUALLY_LOCAL",t[t.LOCAL=2]="LOCAL"}(da||(da={})),function(t){t[t.BODY=0]="BODY",t[t.BANNER=1]="BANNER"}(ua||(ua={}));const ma=(()=>{const t=new Set;let e=null;function i(){for(const e of t)e.updateAnchorPosition()}return n=>{window.addEventListener("resize",i),window.addEventListener("scroll",i),e||(e=new ResizeObserver(()=>{for(const e of t)e.updateAnchorPosition()})),e.observe(n.ownerDocument.documentElement),n.addEventListener("dialog:close",()=>{n.invokerElement?.setAttribute("aria-expanded","false"),t.delete(n)}),n.addEventListener("dialog:open",()=>{t.add(n)})}})();let fa=class SelectPanelElement extends HTMLElement{constructor(){super(...arguments),Ar.add(this),kr.set(this,void 0),Lr.set(this,void 0),Sr.set(this,""),Tr.set(this,""),Cr.set(this,new Map),xr.set(this,null),Mr.set(this,null),Ir.set(this,!1)}get open(){return this.dialog.open}get selectVariant(){return this.getAttribute("data-select-variant")}get ariaSelectionType(){return"aria-selected"}set selectVariant(t){t?this.setAttribute("data-select-variant",t):this.removeAttribute("variant")}get dynamicLabelPrefix(){const t=this.getAttribute("data-dynamic-label-prefix");return t?`${t}:`:""}get dynamicAriaLabelPrefix(){const t=this.getAttribute("data-dynamic-aria-label-prefix");return t?`${t}:`:""}set dynamicLabelPrefix(t){this.setAttribute("data-dynamic-label",t)}get dynamicLabel(){return this.hasAttribute("data-dynamic-label")}set dynamicLabel(t){this.toggleAttribute("data-dynamic-label",t)}get invokerElement(){const t=this.querySelector("dialog")?.id;if(!t)return null;for(const e of this.querySelectorAll("[aria-controls]"))if(e.getAttribute("aria-controls")===t)return e;return null}get closeButton(){return this.querySelector("button[data-close-dialog-id]")}get invokerLabel(){return this.invokerElement?this.invokerElement.querySelector(".Button-label"):null}get selectedItems(){return Array.from(b(this,Cr,"f").values())}get align(){return this.getAttribute("anchor-align")||"start"}get side(){return this.getAttribute("anchor-side")||"outside-bottom"}updateAnchorPosition(){if(this&&null===this.offsetParent&&this.hide(),this.invokerElement){const{top:t,left:e}=X(this.dialog,this.invokerElement,{align:this.align,side:this.side,anchorOffset:4});this.dialog.style.top=`${Math.round(t)}px`,this.dialog.style.left=`${Math.round(e)}px`,this.dialog.style.bottom="auto",this.dialog.style.right="auto"}}connectedCallback(){const{signal:t}=v(this,Lr,new AbortController,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mousedown",this,{signal:t}),this.addEventListener("input",this,{signal:t}),this.addEventListener("remote-input-success",this,{signal:t}),this.addEventListener("remote-input-error",this,{signal:t}),this.addEventListener("loadstart",this,{signal:t}),b(this,Ar,"m",ia).call(this),b(this,Ar,"m",na).call(this),b(this,Ar,"m",Dr).call(this),ma(this),Ze(this,()=>Boolean(this.remoteInput),()=>{this.remoteInput.addEventListener("loadstart",this,{signal:t}),this.remoteInput.addEventListener("loadend",this,{signal:t})}),Ze(this,()=>Boolean(this.includeFragment),()=>{this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t}),this.includeFragment.addEventListener("error",this,{signal:t}),this.includeFragment.addEventListener("loadend",this,{signal:t})}),v(this,kr,new IntersectionObserver(t=>{for(const e of t){const t=e.target;e.isIntersecting&&t===this.dialog&&(this.filterInputTextField&&document.activeElement!==this.filterInputTextField&&this.filterInputTextField.focus(),this.dialog.setAttribute("data-ready","true"),this.updateAnchorPosition(),b(this,Ar,"a",Gr)===da.LOCAL&&b(this,Ar,"m",jr).call(this))}}),"f"),Ze(this,()=>Boolean(this.dialog),()=>{b(this,kr,"f").observe(this.dialog),this.dialog.addEventListener("close",this,{signal:t}),"true"===this.getAttribute("data-open-on-load")&&this.show()}),b(this,Ar,"a",Gr)===da.LOCAL&&Ze(this,()=>this.items.length>0,()=>{b(this,Ar,"m",jr).call(this),b(this,Ar,"m",na).call(this)})}disconnectedCallback(){b(this,Lr,"f").abort()}handleEvent(t){if(t.target===this.filterInputTextField)return void b(this,Ar,"m",Ur).call(this,t);if(t.target===this.remoteInput)return void b(this,Ar,"m",$r).call(this,t);const e=this.invokerElement?.contains(t.target),i=this.closeButton?.contains(t.target),n=b(this,Ar,"m",Fr).call(this,t);if(e&&"mousedown"===t.type)return;if("mousedown"===t.type&&t.target instanceof HTMLInputElement)return;if("mousedown"===t.type)return void t.preventDefault();if(e&&n)return void b(this,Ar,"m",Qr).call(this,t);if(i&&n)return;if("keydown"===t.type&&t instanceof KeyboardEvent&&t.target.closest(ha)){const e=t.ctrlKey||t.altKey||t.metaKey,i=1===t.key.length&&/[a-z\d]/i.test(t.key);!e&&i&&t.stopPropagation()}if(t.target===this.dialog&&"close"===t.type){if(this.dialog.removeAttribute("data-ready"),this.invokerElement?.setAttribute("aria-expanded","false"),this.filterInputTextField){const t=this.filterInputTextField.value.length>0;this.filterInputTextField.value="",t&&this.filterInputTextField.dispatchEvent(new Event("input"))}return void this.dispatchEvent(new CustomEvent("panelClosed",{detail:{panel:this},bubbles:!0}))}const s=t.target.closest(ha)?.parentElement;if(null!=s&&n){if(b(this,Ar,"m",Nr).call(this,t))return;const e=s.closest("[data-show-dialog-id]");if(e){const i=this.ownerDocument.getElementById(e.getAttribute("data-show-dialog-id")||"");if(i&&this.contains(e)&&this.contains(i))return void b(this,Ar,"m",ta).call(this,t,i)}return b(this,Ar,"m",Or).call(this,t)&&(t.preventDefault(),b(this,Ar,"m",aa).call(this,s)?.click()),void b(this,Ar,"m",ea).call(this,s)}if("click"===t.type){const e=this.dialog.getBoundingClientRect();e.top<=t.clientY&&t.clientY<=e.top+e.height&&e.left<=t.clientX&&t.clientX<=e.left+e.width||this.hide()}t.target instanceof IncludeFragmentElement&&b(this,Ar,"m",Wr).call(this,t)}show(){this.updateAnchorPosition(),this.dialog.showModal(),this.invokerElement?.setAttribute("aria-expanded","true");const t=new CustomEvent("dialog:open",{detail:{dialog:this.dialog}});this.dispatchEvent(t)}hide(){this.dialog.close()}get visibleItems(){return Array.from(this.querySelectorAll(ha)).map(t=>t.parentElement)}get items(){return Array.from(this.querySelectorAll(ca)).map(t=>t.parentElement)}get focusableItem(){for(const t of this.items){const e=b(this,Ar,"m",aa).call(this,t);if(e&&"0"===e.getAttribute("tabindex"))return e}}getItemById(t){return this.querySelector(`li[data-item-id="${t}"`)}isItemDisabled(t){return!!t&&t.classList.contains("ActionListItem--disabled")}disableItem(t){t&&(t.classList.add("ActionListItem--disabled"),b(this,Ar,"m",aa).call(this,t).setAttribute("aria-disabled","true"))}enableItem(t){t&&(t.classList.remove("ActionListItem--disabled"),b(this,Ar,"m",aa).call(this,t).removeAttribute("aria-disabled"))}isItemHidden(t){return!!t&&t.hasAttribute("hidden")}isItemChecked(t){return!!t&&"true"===b(this,Ar,"m",aa).call(this,t).getAttribute(this.ariaSelectionType)}checkItem(t){!t||"single"!==this.selectVariant&&"multiple"!==this.selectVariant||this.isItemChecked(t)||b(this,Ar,"m",ea).call(this,t)}uncheckItem(t){!t||"single"!==this.selectVariant&&"multiple"!==this.selectVariant||this.isItemChecked(t)&&b(this,Ar,"m",ea).call(this,t)}};kr=new WeakMap,Lr=new WeakMap,Sr=new WeakMap,Tr=new WeakMap,Cr=new WeakMap,xr=new WeakMap,Mr=new WeakMap,Ir=new WeakMap,Ar=new WeakSet,Dr=function(){const{signal:t}=b(this,Lr,"f");for(const e of this.querySelectorAll(la.join(",")))e.addEventListener("click",b(this,Ar,"m",Nr).bind(this),{signal:t}),e.addEventListener("keydown",b(this,Ar,"m",Nr).bind(this),{signal:t})},Pr=function(){let t=!1;if("single"===this.selectVariant)for(const e of this.items){const i=b(this,Ar,"m",aa).call(this,e);i&&(this.isItemHidden(e)||!this.isItemChecked(e)||t?i.setAttribute("tabindex","-1"):(i.setAttribute("tabindex","0"),t=!0),e.removeAttribute("tabindex"))}else for(const t of this.items){const e=b(this,Ar,"m",aa).call(this,t);e&&(e.setAttribute("tabindex","-1"),t.removeAttribute("tabindex"))}!t&&b(this,Ar,"a",sa)&&b(this,Ar,"m",aa).call(this,b(this,Ar,"a",sa))?.setAttribute("tabindex","0")},Nr=function(t){if(!b(this,Ar,"m",Fr).call(this,t))return!1;const e=t.target.closest(ha);return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},Or=function(t){return t.target instanceof HTMLAnchorElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},Fr=function(t){return t instanceof MouseEvent&&"click"===t.type||b(this,Ar,"m",Or).call(this,t)},Hr=function(){for(const t of this.items){const e=b(this,Ar,"m",aa).call(this,t);if(!e)continue;const i=e.getAttribute("data-value");i&&b(this,Cr,"f").has(i)&&e.setAttribute(this.ariaSelectionType,"true")}b(this,Ar,"m",na).call(this)},qr=function(t){const e=b(this,Ar,"m",aa).call(this,t);if(!e)return;const i=e.getAttribute("data-value");i&&b(this,Cr,"f").set(i,{value:i,label:e.querySelector(".ActionListItem-label")?.textContent?.trim(),inputName:e.getAttribute("data-input-name")})},Vr=function(t){const e=b(this,Ar,"m",aa).call(this,t);if(!e)return;const i=e.getAttribute("data-value");i&&b(this,Cr,"f").delete(i)},Rr=function(){b(this,Ar,"a",Jr)&&(b(this,xr,"f")&&clearTimeout(b(this,xr,"f")),b(this,Mr,"f")&&clearTimeout(b(this,Mr,"f")),v(this,Mr,setTimeout(()=>{this.liveRegion.announce("Loading")},2e3),"f"),v(this,xr,setTimeout(()=>{b(this,Ar,"a",Jr)?.showLeadingSpinner()},1e3),"f"))},Wr=function(t){switch(t.type){case"include-fragment-replaced":b(this,Ar,"m",jr).call(this);break;case"loadstart":b(this,Ar,"m",Br).call(this,!1);break;case"loadend":b(this,Ar,"a",Jr)?.hideLeadingSpinner(),this.dispatchEvent(new CustomEvent("loadend"));break;case"error":{b(this,Ar,"m",Br).call(this,!0);const e=this.fragmentErrorElement;throw e&&!e.hasAttribute("hidden")&&this.liveRegion.announceFromElement(e,{politeness:"assertive"}),new Error(t.detail.error)}}},Br=function(t){for(const e of this.includeFragment.querySelectorAll("[data-show-on-error]"))e instanceof HTMLElement&&(e.hidden=!t);for(const e of this.includeFragment.querySelectorAll("[data-hide-on-error]"))e instanceof HTMLElement&&(e.hidden=t)},$r=function(t){switch(t.type){case"remote-input-success":b(this,Ar,"m",Zr).call(this),b(this,Ar,"m",jr).call(this),b(this,Ar,"m",Hr).call(this);break;case"remote-input-error":this.bodySpinner?.setAttribute("hidden",""),this.includeFragment||0===this.visibleItems.length?b(this,Ar,"m",zr).call(this,ua.BODY):b(this,Ar,"m",zr).call(this,ua.BANNER);break;case"loadstart":if(!b(this,Ar,"m",Xr).call(this)){if(b(this,Ar,"m",Zr).call(this),this.bodySpinner?.removeAttribute("hidden"),this.bodySpinner)break;b(this,Ar,"m",Rr).call(this)}break;case"loadend":b(this,Ar,"a",Jr)?.hideLeadingSpinner(),b(this,Mr,"f")&&clearTimeout(b(this,Mr,"f")),b(this,xr,"f")&&clearTimeout(b(this,xr,"f")),this.dispatchEvent(new CustomEvent("loadend"))}},_r=function(t,e){return(t.getAttribute("data-filter-string")||t.textContent||"").toLowerCase().indexOf(e.toLowerCase())>-1},Ur=function(t){if("keydown"===t.type){const e=t.key;if("Enter"===e){const t=this.visibleItems[0];if(t){const e=b(this,Ar,"m",aa).call(this,t);e&&e.click()}}else if("ArrowDown"===e){const e=this.focusableItem||b(this,Ar,"m",aa).call(this,this.visibleItems[0]);e&&(e.focus(),t.preventDefault())}else if("Home"===e){const e=this.visibleItems[0];if(e){const i=b(this,Ar,"m",aa).call(this,e);i&&i.focus(),t.preventDefault()}}else if("End"===e&&this.visibleItems.length>0){const e=this.visibleItems[this.visibleItems.length-1],i=b(this,Ar,"m",aa).call(this,e);i&&i.focus(),t.preventDefault()}}if("input"===t.type&&(this.bodySpinner||b(this,Ar,"m",Xr).call(this)||b(this,Ar,"m",Rr).call(this),b(this,Ar,"a",Gr)===da.LOCAL||b(this,Ar,"a",Gr)===da.EVENTUALLY_LOCAL)){if(this.includeFragment)return void this.includeFragment.refetch();b(this,Ar,"m",jr).call(this)}},jr=function(){if(!this.list)return;let t=!1;if(b(this,Ar,"m",Xr).call(this)){const e=this.filterInputTextField?.value??"",i=this.filterFn||b(this,Ar,"m",_r);for(const n of this.items)i(n,e)?(b(this,Ar,"m",ra).call(this,n),t=!0):b(this,Ar,"m",oa).call(this,n)}else t=this.items.length>0;b(this,Ar,"m",Pr).call(this),b(this,Ar,"m",Yr).call(this);for(const t of this.items){const e=b(this,Ar,"m",aa).call(this,t);if(!e)continue;const i=e.getAttribute("data-value");b(this,Ir,"f")?i&&!b(this,Cr,"f").has(i)&&e.setAttribute(this.ariaSelectionType,"false"):i&&!b(this,Cr,"f").has(i)&&this.isItemChecked(t)&&b(this,Ar,"m",qr).call(this,t)}v(this,Ir,!0,"f"),this.noResults&&(b(this,Ar,"m",Kr).call(this)?this.noResults.setAttribute("hidden",""):t?(this.noResults.setAttribute("hidden",""),this.list?.querySelector(".ActionListWrap")?.removeAttribute("hidden")):(this.list?.querySelector(".ActionListWrap")?.setAttribute("hidden",""),this.noResults.removeAttribute("hidden")))},Kr=function(){return!(!this.fragmentErrorElement||this.fragmentErrorElement.hasAttribute("hidden"))||!!this.bannerErrorElement&&!this.bannerErrorElement.hasAttribute("hidden")},zr=function(t){let e=this.fragmentErrorElement;t===ua.BODY&&this.fragmentErrorElement?(this.fragmentErrorElement.removeAttribute("hidden"),this.bannerErrorElement.setAttribute("hidden","")):(e=this.bannerErrorElement,this.bannerErrorElement?.removeAttribute("hidden"),this.fragmentErrorElement?.setAttribute("hidden","")),!e||e.hasAttribute("hidden")||this.liveRegion.announceFromElement(e,{politeness:"assertive"})},Zr=function(){this.fragmentErrorElement?.setAttribute("hidden",""),this.bannerErrorElement.setAttribute("hidden","")},Yr=function(){if(this.open&&this.list){const t=this.visibleItems;if(t.length>0){const e="tab for results";this.liveRegion.announce(`${t.length} result${1===t.length?"":"s"} ${e}`)}else{const t=this.noResults;t&&this.liveRegion.announceFromElement(t)}}},Gr=function(){if(!this.list)return da.REMOTE;switch(this.list.getAttribute("data-fetch-strategy")){case"local":return da.LOCAL;case"eventually_local":return da.EVENTUALLY_LOCAL;default:return da.REMOTE}},Jr=function(){return this.filterInputTextField?.closest("primer-text-field")},Xr=function(){return b(this,Ar,"a",Gr)===da.LOCAL||b(this,Ar,"a",Gr)===da.EVENTUALLY_LOCAL},Qr=function(t){this.invokerElement?.dispatchEvent(new CustomEvent("invokerClicked",{bubbles:!0})),t.preventDefault(),t.stopPropagation(),this.open?this.hide():this.show()},ta=function(t,e){this.querySelector(".ActionListWrap").style.display="none";const i=new AbortController,{signal:n}=i,s=()=>{i.abort(),this.querySelector(".ActionListWrap").style.display="",this.open&&this.hide();const t=this.ownerDocument.activeElement,e=this.ownerDocument.activeElement===this.ownerDocument.body,n=this.contains(t);(e||n)&&setTimeout(()=>this.invokerElement?.focus(),0)};e.addEventListener("close",s,{signal:n}),e.addEventListener("cancel",s,{signal:n})},ea=function(t){if("multiple"!==this.selectVariant&&setTimeout(()=>{this.open&&this.hide()}),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e=this.isItemChecked(t),i=!e;if(!this.dispatchEvent(new CustomEvent("beforeItemActivated",{bubbles:!0,cancelable:!0,detail:{item:t,checked:i,value:b(this,Ar,"m",aa).call(this,t)?.getAttribute("data-value")}})))return;const n=b(this,Ar,"m",aa).call(this,t);if("single"===this.selectVariant){if(n?.getAttribute("href"))return;if(!e){for(const t of this.items)b(this,Ar,"m",aa).call(this,t)?.setAttribute(this.ariaSelectionType,"false");b(this,Cr,"f").clear(),i&&(b(this,Ar,"m",qr).call(this,t),n?.setAttribute(this.ariaSelectionType,"true")),b(this,Ar,"m",ia).call(this)}}else n?.setAttribute(this.ariaSelectionType,`${i}`),i?b(this,Ar,"m",qr).call(this,t):b(this,Ar,"m",Vr).call(this,t);b(this,Ar,"m",na).call(this),b(this,Ar,"m",Pr).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:t,checked:i,value:b(this,Ar,"m",aa).call(this,t)?.getAttribute("data-value")}}))},ia=function(){if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;v(this,Sr,b(this,Sr,"f")||t.textContent||"","f");const e=this.querySelector(`[${this.ariaSelectionType}=true] .ActionListItem-label`)?.textContent||b(this,Sr,"f");if(e){const i=document.createElement("span");i.classList.add("color-fg-muted");const n=document.createElement("span");i.textContent=`${this.dynamicLabelPrefix} `,n.textContent=e,t.replaceChildren(i,n),this.dynamicAriaLabelPrefix&&this.invokerElement?.setAttribute("aria-label",`${this.dynamicAriaLabelPrefix} ${e.trim()}`)}else t.textContent=b(this,Sr,"f")},na=function(){if("single"===this.selectVariant){const t=this.querySelector("[data-select-panel-inputs=true] input")??this.querySelector("[data-list-inputs=true] input");if(!t)return;const e=this.selectedItems[0];e?(t.value=(e.value||e.label||"").trim(),e.inputName&&(t.name=e.inputName),t.removeAttribute("disabled")):b(this,Ir,"f")&&t.setAttribute("disabled","disabled")}else if("none"!==this.selectVariant){const t=!!this.querySelector("[data-select-panel-inputs=true]"),e=this.querySelector("[data-select-panel-inputs=true]")??this.querySelector("[data-list-inputs=true]");if(!e)return;const i=e.querySelectorAll("input");i.length>0&&v(this,Tr,b(this,Tr,"f")||i[0].name,"f");for(const i of this.selectedItems){const n=document.createElement("input");n.setAttribute(""+(t?"data-select-panel-input":"data-list-input"),"true"),n.type="hidden",n.autocomplete="off",n.name=i.inputName||b(this,Tr,"f"),n.value=(i.value||i.label||"").trim(),e.append(n)}for(const t of i)t.remove()}},sa=function(){return this.querySelector(ha)?.parentElement||null},oa=function(t){t&&t.setAttribute("hidden","hidden")},ra=function(t){t&&t.removeAttribute("hidden")},aa=function(t){return t.querySelector(".ActionListContent")},g([U],fa.prototype,"includeFragment",void 0),g([U],fa.prototype,"dialog",void 0),g([U],fa.prototype,"filterInputTextField",void 0),g([U],fa.prototype,"remoteInput",void 0),g([U],fa.prototype,"list",void 0),g([U],fa.prototype,"noResults",void 0),g([U],fa.prototype,"fragmentErrorElement",void 0),g([U],fa.prototype,"bannerErrorElement",void 0),g([U],fa.prototype,"bodySpinner",void 0),g([U],fa.prototype,"liveRegion",void 0),fa=g([K("select-panel")],fa),window.customElements.get("select-panel")||(window.SelectPanelElement=fa,window.customElements.define("select-panel",fa));let pa=class DetailsToggleElement extends HTMLElement{toggle(){if(this.detailsTarget.hasAttribute("open")){const t=this.summaryTarget.getAttribute("data-aria-label-closed");t&&this.summaryTarget.setAttribute("aria-label",t),this.summaryTarget.setAttribute("aria-expanded","false")}else{const t=this.summaryTarget.getAttribute("data-aria-label-open");t&&this.summaryTarget.setAttribute("aria-label",t),this.summaryTarget.setAttribute("aria-expanded","true")}}};function ga(t){xt(t,{bindKeys:Et.ArrowVertical|Et.ArrowHorizontal|Et.HomeAndEnd|Et.Backspace,getNextFocusable:(t,e,i)=>{if(e instanceof HTMLElement){try{if(e.closest("dialog:modal"))return}catch{}return function(t,e){switch(`${function(t){if("treeitem"!==t.getAttribute("role"))throw new Error("Element is not a treeitem");switch(t.getAttribute("aria-expanded")){case"true":return"open";case"false":return"closed";default:return"end"}}(t)} ${e.key}`){case"open ArrowRight":return function(t){const e=t.querySelector("[role=treeitem]");return e instanceof HTMLElement?e:void 0}(t);case"open ArrowLeft":case"closed ArrowRight":case"end ArrowRight":return;case"closed ArrowLeft":case"end ArrowLeft":return wa(t)}switch(e.key){case"ArrowUp":return ba(t,"previous");case"ArrowDown":return ba(t,"next");case"Backspace":return wa(t)}}(e,i)??e}},focusInStrategy:()=>{let e=t.querySelector("[aria-current]");e=e?.checkVisibility()?e:null;const i=t.querySelector('[role="treeitem"]');return e instanceof HTMLElement?e:document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&"treeitem"===document.activeElement.getAttribute("role")?document.activeElement:i instanceof HTMLElement?i:void 0}})}function ba(t,e){const i=t.closest("[role=tree]");if(!i)return;const n=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,t=>t instanceof HTMLElement&&"treeitem"===t.getAttribute("role")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP);let s=n.firstChild();for(;s!==t;)s=n.nextNode();let o="next"===e?n.nextNode():n.previousNode();for(;o instanceof HTMLElement&&va(o,i);)o="next"===e?n.nextNode():n.previousNode();return o instanceof HTMLElement?o:void 0}function va(t,e){for(const i of e.querySelectorAll("[role=treeitem][aria-expanded=false]"))if(t!==i&&i.closest("li")?.contains(t))return i;return null}function wa(t){const e=t.closest("[role=group]"),i=e?.closest("[role=treeitem]");return i instanceof HTMLElement?i:void 0}var ya,Ea,Aa,ka,La,Sa,Ta,Ca,xa,Ma,Ia,Da;g([U],pa.prototype,"detailsTarget",void 0),g([U],pa.prototype,"summaryTarget",void 0),pa=g([K("details-toggle")],pa),window.DetailsToggleElement=pa;let Pa=class TreeViewElement extends HTMLElement{constructor(){super(...arguments),ya.add(this),Ea.set(this,void 0)}connectedCallback(){const{signal:t}=v(this,Ea,new AbortController,"f");this.addEventListener("click",this,{signal:t}),this.addEventListener("focusin",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),ga(this),new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.querySelector("[aria-expanded=true]")&&b(this,ya,"m",Aa).call(this,t)}).observe(this,{childList:!0,subtree:!0});new MutationObserver(t=>{if(!this.formInputContainer)return;t.some(t=>t.target instanceof HTMLElement&&t.target.getAttribute("aria-checked")!==t.oldValue)&&this.updateHiddenFormInputs()}).observe(this,{childList:!0,subtree:!0,attributeFilter:["aria-checked"]}),this.formInputContainer&&this.updateHiddenFormInputs(),customElements.whenDefined("tree-view-sub-tree-node").then(()=>{b(this,ya,"m",Aa).call(this,this)})}rootLeafNodes(){return this.querySelectorAll(":scope > ul > li > .TreeViewItemContainer [role=treeitem]")}rootSubTreeNodes(){return this.querySelectorAll(":scope > ul > tree-view-sub-tree-node")}disconnectedCallback(){b(this,Ea,"f").abort()}handleEvent(t){const e=b(this,ya,"m",La).call(this,t);e&&b(this,ya,"m",Sa).call(this,e,t)}handleSingleSelection(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if(!(e instanceof HTMLDivElement))return;const i=this.getNodePath(e),n=this.infoFromNode(e,"true");this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:[n]}))&&("true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.checkOnlyAtPath(i),this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,detail:[n]})))}getFormInputValueForNode(t){return t.getAttribute("data-value")}getNodePath(t){const e=t.getAttribute("data-path");return e?JSON.parse(e):[]}getNodeType(t){return t.getAttribute("data-node-type")}markCurrentAtPath(t){const e=JSON.stringify(t),i=this.querySelector(`[data-path="${CSS.escape(e)}"`);i&&(this.currentNode?.setAttribute("aria-current","false"),i.setAttribute("aria-current","true"))}get currentNode(){return this.querySelector("[aria-current=true]")}get activeNodes(){return document.querySelectorAll('[aria-checked="true"]')}expandAtPath(t){const e=this.subTreeAtPath(t);e&&e.expand()}collapseAtPath(t){const e=this.subTreeAtPath(t);e&&e.collapse()}toggleAtPath(t){const e=this.subTreeAtPath(t);e&&e.toggle()}checkAtPath(t){const e=this.nodeAtPath(t);e&&this.setNodeCheckedValue(e,"true")}uncheckAtPath(t){const e=this.nodeAtPath(t);e&&this.setNodeCheckedValue(e,"false")}checkOnlyAtPath(t){for(const t of this.activeNodes)this.uncheckAtPath(this.getNodePath(t));this.checkAtPath(t)}toggleCheckedAtPath(t){const e=this.nodeAtPath(t);e&&"leaf"===this.getNodeType(e)&&("true"===this.getNodeCheckedValue(e)?this.uncheckAtPath(t):this.checkAtPath(t))}checkedValueAtPath(t){const e=this.nodeAtPath(t);return e?this.getNodeCheckedValue(e):"false"}disabledValueAtPath(t){const e=this.nodeAtPath(t);return!!e&&this.getNodeDisabledValue(e)}nodeAtPath(t,e){const i=JSON.stringify(t);return this.querySelector(`${e||""}[data-path="${CSS.escape(i)}"]`)}subTreeAtPath(t){const e=this.nodeAtPath(t,"[data-node-type=sub-tree]");return e?e.closest("tree-view-sub-tree-node"):null}leafAtPath(t){return this.nodeAtPath(t,"[data-node-type=leaf]")}setNodeCheckedValue(t,e){t.setAttribute("aria-checked",e.toString())}getNodeCheckedValue(t){return t.getAttribute("aria-checked")||"false"}getNodeDisabledValue(t){return"true"===t.getAttribute("aria-disabled")}setNodeDisabledValue(t,e){e?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled")}nodeHasCheckBox(t){return null!==t.querySelector(".TreeViewItemCheckbox")}nodeHasNativeAction(t){return t instanceof HTMLAnchorElement||t instanceof HTMLButtonElement}expandAncestorsForNode(t){const e=t.closest("tree-view-sub-tree-node");if(e)for(const t of e.eachAncestorSubTreeNode())t.expanded||t.expand()}changeSelectStrategy(t){for(const e of this.querySelectorAll("tree-view-sub-tree-node"))e.changeSelectStrategy(t)}infoFromNode(t,e){const i=this.getNodeType(t);if(!i)return null;const n=this.getNodeCheckedValue(t);return{node:t,type:i,path:this.getNodePath(t),checkedValue:e||n,previousCheckedValue:n}}selectVariant(t){return t.getAttribute("data-select-variant")||"none"}updateHiddenFormInputs(){const t=[];for(const e of this.querySelectorAll("[role=treeitem][aria-checked=true]")){const i=this.formInputPrototype.cloneNode();i.removeAttribute("data-target"),i.removeAttribute("form");const n={path:this.getNodePath(e)},s=this.getFormInputValueForNode(e);s&&(n.value=s),i.value=JSON.stringify(n),t.push(i)}this.formInputContainer.replaceChildren(...t)}};var Na,Oa;Ea=new WeakMap,ya=new WeakSet,Aa=function(t){for(const e of t.querySelectorAll("[aria-expanded=true]"))this.expandAncestorsForNode(e)},ka=function(t){return"click"===t.type},La=function(t){const e=t.target,i=e.closest("[role=treeitem]");return i?e.closest(".TreeViewItemToggle")||e.closest(".TreeViewItemLeadingAction")?null:i:null},Sa=function(t,e){b(this,ya,"m",Ta).call(this,e,t)?b(this,ya,"m",Ca).call(this,e,t):b(this,ya,"m",xa).call(this,e,t)?this.handleSingleSelection(e,t):b(this,ya,"m",ka).call(this,e)?b(this,ya,"m",Ma).call(this,e,t):"focusin"===e.type?b(this,ya,"m",Ia).call(this,t):e instanceof KeyboardEvent&&b(this,ya,"m",Da).call(this,e,t)},Ta=function(t,e){return"click"===t.type&&this.nodeHasCheckBox(e)},Ca=function(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if("leaf"!==this.getNodeType(e))return;const i="false"===this.getNodeCheckedValue(e)?"true":"false",n=this.infoFromNode(e,i);this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:[n]}))&&("true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.setNodeCheckedValue(e,"true"),this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,cancelable:!0,detail:[n]})))},xa=function(t,e){return"click"===t.type&&"single"===this.selectVariant(e)},Ma=function(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if(!(e instanceof HTMLDivElement))return;const i=this.getNodePath(e);this.dispatchEvent(new CustomEvent("treeViewBeforeNodeActivated",{bubbles:!0,cancelable:!0,detail:this.infoFromNode(e)}))&&(this.nodeHasNativeAction(e)||this.toggleAtPath(i),this.dispatchEvent(new CustomEvent("treeViewNodeActivated",{bubbles:!0,detail:this.infoFromNode(e)})))},Ia=function(t){const e=this.querySelector("[aria-selected=true]");e?.setAttribute("aria-selected","false"),t.setAttribute("aria-selected","true")},Da=function(t,e){if(e&&"leaf"===this.getNodeType(e))switch(t.key){case" ":case"Enter":if(this.getNodeDisabledValue(e)){t.preventDefault();break}"multiple"===this.selectVariant(e)?(t.preventDefault(),"true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.setNodeCheckedValue(e,"true")):"single"===this.selectVariant(e)?(t.preventDefault(),this.checkOnlyAtPath(this.getNodePath(e))):e instanceof HTMLAnchorElement&&e.click()}},g([U],Pa.prototype,"formInputContainer",void 0),g([U],Pa.prototype,"formInputPrototype",void 0),Pa=g([K("tree-view")],Pa),window.customElements.get("tree-view")||(window.TreeViewElement=Pa,window.customElements.define("tree-view",Pa));let Fa=class TreeViewIconPairElement extends HTMLElement{constructor(){super(...arguments),Na.add(this)}connectedCallback(){Ze(this,()=>Boolean(this.collapsedIcon)&&Boolean(this.expandedIcon),()=>{this.expanded=this.collapsedIcon.hidden})}showExpanded(){this.expanded=!0,b(this,Na,"m",Oa).call(this)}showCollapsed(){this.expanded=!1,b(this,Na,"m",Oa).call(this)}toggle(){this.expanded=!this.expanded,b(this,Na,"m",Oa).call(this)}};var Ha,qa,Va,Ra,Wa,Ba,$a,_a,Ua,ja,Ka,za,Za;Na=new WeakSet,Oa=function(){this.expanded?(this.expandedIcon.hidden=!1,this.collapsedIcon.hidden=!0):(this.expandedIcon.hidden=!0,this.collapsedIcon.hidden=!1)},g([U],Fa.prototype,"expandedIcon",void 0),g([U],Fa.prototype,"collapsedIcon",void 0),Fa=g([K("tree-view-icon-pair")],Fa),window.customElements.get("tree-view-icon-pair")||(window.TreeViewIconPairElement=Fa,window.customElements.define("tree-view-icon-pair",Fa));let Ya=class TreeViewSubTreeNodeElement extends HTMLElement{constructor(){super(...arguments),Ha.add(this),qa.set(this,null),Va.set(this,"success"),Ra.set(this,void 0),Wa.set(this,!1)}connectedCallback(){Ze(this,()=>Boolean(this.node)&&Boolean(this.subTree),()=>{b(this,Ha,"m",Ka).call(this)});const{signal:t}=v(this,Ra,new AbortController,"f");this.addEventListener("click",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),Ze(this,()=>Boolean(this.includeFragment),()=>{this.includeFragment.addEventListener("loadstart",this,{signal:t}),this.includeFragment.addEventListener("error",this,{signal:t}),this.includeFragment.addEventListener("include-fragment-replace",this,{signal:t}),this.includeFragment.addEventListener("include-fragment-replaced",t=>{b(this,Ha,"m",$a).call(this,t)},{signal:t})}),Ze(this,()=>Boolean(this.retryButton),()=>{this.retryButton.addEventListener("click",t=>{b(this,Ha,"m",_a).call(this,t)},{signal:t})});new MutationObserver(()=>{if("mixed_descendants"!==this.selectStrategy)return;let t="unknown";for(const e of this.eachDirectDescendantNode())switch(`${t} ${e.getAttribute("aria-checked")||"false"}`){case"unknown mixed":case"false mixed":case"true mixed":case"false true":case"true false":t="mixed";break;case"unknown false":t="false";break;case"unknown true":t="true"}"unknown"!==t&&this.node?.getAttribute("aria-checked")!==t&&this.node?.setAttribute("aria-checked",t)}).observe(this,{childList:!0,subtree:!0,attributeFilter:["aria-checked"]})}get expanded(){return null===b(this,qa,"f")&&v(this,qa,"true"===this.node.getAttribute("aria-expanded"),"f"),b(this,qa,"f")}set expanded(t){v(this,qa,t,"f"),b(this,Ha,"m",Ka).call(this)}get loadingState(){return b(this,Va,"f")}set loadingState(t){v(this,Va,t,"f"),b(this,Ha,"m",Ka).call(this)}get selectStrategy(){return this.node.getAttribute("data-select-strategy")||"descendants"}get selectVariant(){return this.node.getAttribute("data-select-variant")||"none"}get level(){return parseInt(this.node.getAttribute("aria-level")||"0")}disconnectedCallback(){b(this,Ra,"f").abort()}handleEvent(t){t.target===this.toggleButton?b(this,Ha,"m",Ba).call(this,t):t.target===this.includeFragment?b(this,Ha,"m",$a).call(this,t):t instanceof KeyboardEvent?b(this,Ha,"m",Ua).call(this,t):t.target.closest("[role=treeitem]")===this.node&&"click"===t.type&&b(this,Ha,"a",Za)&&b(this,Ha,"m",ja).call(this,t)}expand(){const t=this.expanded;this.expanded=!0,!t&&this.treeView&&this.treeView.dispatchEvent(new CustomEvent("treeViewNodeExpanded",{bubbles:!0,detail:this.treeView?.infoFromNode(this.node)}))}collapse(){const t=!this.expanded;if(this.expanded=!1,!t&&this.treeView){const t=this.subTree.querySelector("[tabindex='0']");t?.setAttribute("tabindex","-1"),b(this,Ha,"m",za).call(this)&&"0"===this.subTree.getAttribute("tabindex")&&this.subTree.setAttribute("tabindex","-1"),this.node.setAttribute("tabindex","0"),this.treeView.dispatchEvent(new CustomEvent("treeViewNodeCollapsed",{bubbles:!0,detail:this.treeView?.infoFromNode(this.node)}))}}toggle(){this.expanded?this.collapse():this.expand()}get nodes(){return this.querySelectorAll(":scope > [role=treeitem]")}*eachDirectDescendantNode(){for(const t of this.subTree.querySelectorAll(":scope > li > .TreeViewItemContainer > [role=treeitem]"))yield t;for(const t of this.subTree.querySelectorAll(":scope > tree-view-sub-tree-node > li > .TreeViewItemContainer > [role=treeitem]"))yield t}*eachDirectDescendantSubTreeNode(){for(const t of this.subTree.querySelectorAll(":scope > tree-view-sub-tree-node"))yield t}*eachDescendantNode(){for(const t of this.subTree.querySelectorAll("[role=treeitem]"))yield t}*eachAncestorSubTreeNode(){if(!this.treeView)return;let t=this;for(;t&&this.treeView.contains(t);)yield t,t=t.parentElement?.closest("tree-view-sub-tree-node")}get isEmpty(){return 0===this.nodes.length}get treeView(){return this.closest("tree-view")}toggleChecked(){const t="false"===(this.treeView?.getNodeCheckedValue(this.node)||"false")?"true":"false",e=[],i=this.treeView?.infoFromNode(this.node,t);if(i&&e.push(i),"descendants"===this.selectStrategy||"mixed_descendants"===this.selectStrategy)for(const i of this.eachDescendantNode()){const n=this.treeView?.infoFromNode(i,t);n&&e.push(n)}if(this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:e}))){for(const i of e)i.node.setAttribute("aria-checked",t);this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,cancelable:!0,detail:e}))}}changeSelectStrategy(t){this.node.setAttribute("data-select-strategy",t)}};qa=new WeakMap,Va=new WeakMap,Ra=new WeakMap,Wa=new WeakMap,Ha=new WeakSet,Ba=function(t){"click"===t.type&&(this.toggle(),t.stopPropagation())},$a=function(t){switch(t.type){case"loadstart":this.loadingState="loading";break;case"error":this.loadingState="error";break;case"include-fragment-replace":v(this,Wa,document.activeElement===this.loadingIndicator.closest("[role=treeitem]"),"f"),!b(this,Wa,"f")&&document.activeElement===this.subTree&&b(this,Ha,"m",za).call(this)&&v(this,Wa,!0,"f"),this.loadingState="success";break;case"include-fragment-replaced":if(this.expanded=!0,b(this,Wa,"f")){const t=this.querySelector("[role=group] > :first-child");if(!t)return;const e=t.querySelector("[role=treeitem]");if(!e)return;e.focus()}v(this,Wa,!1,"f")}},_a=function(t){"click"===t.type&&(this.loadingState="loading",this.includeFragment.refetch())},Ua=function(t){const e=t.target.closest("[role=treeitem]");if(e&&"sub-tree"===this.treeView?.getNodeType(e))switch(t.key){case"Enter":if(this.treeView?.getNodeDisabledValue(e)){t.preventDefault();break}t.stopPropagation(),b(this,Ha,"a",Za)?this.toggleChecked():"single"===this.selectVariant?this.treeView.handleSingleSelection(t,e):this.treeView?.nodeHasNativeAction(e)||this.toggle();break;case"ArrowRight":t.stopPropagation(),this.expand();break;case"ArrowLeft":t.stopPropagation(),this.collapse();break;case" ":if(this.treeView?.getNodeDisabledValue(e)){t.preventDefault();break}b(this,Ha,"a",Za)?(t.stopPropagation(),t.preventDefault(),this.toggleChecked()):"single"===this.selectVariant?this.treeView.handleSingleSelection(t,e):e instanceof HTMLAnchorElement?e.click():this.treeView?.nodeHasNativeAction(e)||this.toggle()}},ja=function(t){this.treeView?.getNodeDisabledValue(this.node)?t.preventDefault():"click"===t.type&&(this.toggleChecked(),t.stopPropagation())},Ka=function(){switch(this.expanded?(this.subTree&&(this.subTree.hidden=!1),b(this,Ha,"m",za).call(this)&&(this.subTree.setAttribute("role","treeitem"),this.subTree.hasAttribute("tabindex")||this.subTree.setAttribute("tabindex","-1")),this.node.setAttribute("aria-expanded","true"),this.treeView?.expandAncestorsForNode(this),this.iconPair&&this.iconPair.showExpanded(),this.expandedToggleIcon&&this.collapsedToggleIcon&&(this.expandedToggleIcon.removeAttribute("hidden"),this.collapsedToggleIcon.setAttribute("hidden","hidden"))):(this.subTree&&(this.subTree.hidden=!0),b(this,Ha,"m",za).call(this)&&(this.subTree.removeAttribute("role"),this.subTree.removeAttribute("tabindex")),this.node.setAttribute("aria-expanded","false"),this.iconPair&&this.iconPair.showCollapsed(),this.expandedToggleIcon&&this.collapsedToggleIcon&&(this.expandedToggleIcon.setAttribute("hidden","hidden"),this.collapsedToggleIcon.removeAttribute("hidden"))),this.loadingState){case"loading":this.loadingFailureMessage&&(this.loadingFailureMessage.hidden=!0),this.loadingIndicator&&(this.loadingIndicator.hidden=!1);break;case"error":this.loadingIndicator&&(this.loadingIndicator.hidden=!0),this.loadingFailureMessage&&(this.loadingFailureMessage.hidden=!1);break;default:this.loadingIndicator&&(this.loadingIndicator.hidden=!0),this.loadingFailureMessage&&(this.loadingFailureMessage.hidden=!0)}},za=function(){return this.subTree?.getAttribute("data-target")?.includes("tree-view-sub-tree-node.includeFragment")??!1},Za=function(){return this.querySelector(".TreeViewItemCheckbox")},g([U],Ya.prototype,"node",void 0),g([U],Ya.prototype,"subTree",void 0),g([U],Ya.prototype,"iconPair",void 0),g([U],Ya.prototype,"toggleButton",void 0),g([U],Ya.prototype,"expandedToggleIcon",void 0),g([U],Ya.prototype,"collapsedToggleIcon",void 0),g([U],Ya.prototype,"includeFragment",void 0),g([U],Ya.prototype,"loadingIndicator",void 0),g([U],Ya.prototype,"loadingFailureMessage",void 0),g([U],Ya.prototype,"retryButton",void 0),Ya=g([K("tree-view-sub-tree-node")],Ya),window.customElements.get("tree-view-sub-tree-node")||(window.TreeViewSubTreeNodeElement=Ya,window.customElements.define("tree-view-sub-tree-node",Ya));let Ga=class TreeViewIncludeFragmentElement extends IncludeFragmentElement{request(){const t=super.request(),e=new URL(t.url);return e.searchParams.set("path",this.getAttribute("data-path")||""),new Request(e,{method:t.method,headers:t.headers,credentials:t.credentials})}};Ga=g([K("tree-view-include-fragment")],Ga),window.customElements.get("tree-view-include-fragment")||(window.TreeViewIncludeFragmentElement=Ga,window.customElements.define("tree-view-include-fragment",Ga));let Ja=class AvatarFallbackElement extends HTMLElement{constructor(){super(...arguments),this.img=null,this.testImage=null}connectedCallback(){if(this.img=this.querySelector("img")??null,!this.img)return;const t=this.getAttribute("data-unique-id")||"",e=this.getAttribute("data-alt-text")||"",i=this.getAttribute("data-avatar-src")||"";this.applyColor(this.img,t,e),i&&this.testLoadImage(i)}disconnectedCallback(){this.testImage&&(this.testImage.onload=null,this.testImage=null),this.img=null}testLoadImage(t){this.testImage=new Image,this.testImage.onload=()=>{this.img&&(this.img.src=t)},this.testImage.src=t}applyColor(t,e,i){if(!e||!i)return;const n=`${e}${i}`,s=`hsl(${this.valueHash(n)}, 50%, 30%)`;this.updateSvgColor(t,s)}valueHash(t){let e=0;for(let i=0;i<t.length;i++)e=t.charCodeAt(i)+((e<<5)-e);return e%360}updateSvgColor(t,e){const i=t.src;if(!i.startsWith("data:image/svg+xml;base64,"))return;const n=i.replace("data:image/svg+xml;base64,","");try{const i=atob(n).replace(/fill="hsl\([^"]+\)"/,`fill="${e}"`);t.src=`data:image/svg+xml;base64,${btoa(i)}`}catch{}}};Ja=g([K],Ja);let Xa=class PageHeaderElement extends HTMLElement{menuItemClick(t){const e=t.currentTarget,i=e?.getAttribute("data-for");i&&document.getElementById(i)?.click()}};Xa=g([K],Xa),window.customElements.get("page-header")||(window.PageHeaderElement=Xa,window.customElements.define("page-header",Xa));let Qa=class ZenModeButtonElement extends HTMLElement{constructor(){super(),this.inZenMode=!1,document.addEventListener("fullscreenchange",this.fullscreenChangeEventHandler.bind(this))}disconnectedCallback(){document.removeEventListener("fullscreenchange",this.fullscreenChangeEventHandler.bind(this))}fullscreenChangeEventHandler(){this.changeButtonState(!this.inZenMode),this.dispatchZenModeStatus()}dispatchZenModeStatus(){const t=new CustomEvent("zenModeToggled",{detail:{active:this.inZenMode}});window.dispatchEvent(t)}deactivateZenMode(){document.exitFullscreen&&document.exitFullscreen()}activateZenMode(){document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen()}changeButtonState(t){this.inZenMode=t,this.button.setAttribute("aria-pressed",t.toString())}performAction(){this.inZenMode?this.deactivateZenMode():this.activateZenMode()}};g([U],Qa.prototype,"button",void 0),Qa=g([K],Qa),window.customElements.get("zen-mode-button")||(window.ZenModeButtonElement=Qa,window.customElements.define("zen-mode-button",Qa));let tl=class SubHeaderElement extends HTMLElement{connectedCallback(){this.setupFilterInputClearButton()}setupFilterInputClearButton(){this.waitForCondition(()=>Boolean(this.filterInput),()=>{this.toggleFilterInputClearButton()})}toggleFilterInputClearButton(){this.filterInput.value.length>0?this.filterInput.classList.remove("SubHeader-filterInput_hiddenClearButton"):this.filterInput.classList.add("SubHeader-filterInput_hiddenClearButton")}expandFilterInput(){for(const t of this.shownItemsOnExpandedFilter)t.classList.remove("d-none");for(const t of this.filterExpandButton)t.classList.add("d-none");this.classList.add("SubHeader--expandedSearch"),this.filterInput.focus()}collapseFilterInput(){for(const t of this.filterExpandButton)t.classList.remove("d-none");for(const t of this.shownItemsOnExpandedFilter)t.classList.add("d-none");this.classList.remove("SubHeader--expandedSearch")}waitForCondition(t,e){if(t())e();else{const i=new MutationObserver(()=>{t()&&(e(),i.disconnect())});i.observe(this,{childList:!0,subtree:!0})}}};var el,il;g([U],tl.prototype,"filterInput",void 0),g([j],tl.prototype,"shownItemsOnExpandedFilter",void 0),g([j],tl.prototype,"filterExpandButton",void 0),tl=g([K],tl),window.customElements.get("sub-header")||(window.SubHeaderElement=tl,window.customElements.define("sub-header",tl));let nl=class DangerDialogFormHelperElement extends HTMLElement{constructor(){super(...arguments),el.add(this),this.confirmationLiveMessageChecked="",this.confirmationLiveMessageUnchecked=""}get form(){return this.querySelector("form")}get submitButton(){return this.querySelector("input[type=submit],button[type=submit],button[data-submit-dialog-id]")}connectedCallback(){this.style.display="contents",this.form&&(this.form.style.display="contents"),b(this,el,"m",il).call(this)}toggle(){if(!this.checkbox||!this.submitButton)return;const t=this.checkbox.checked;if(this.submitButton.disabled=!t,this.liveRegion){const e=t?this.confirmationLiveMessageChecked:this.confirmationLiveMessageUnchecked;this.liveRegion.announce(e,{politeness:"assertive"})}}};el=new WeakSet,il=function(){this.toggle()},g([U],nl.prototype,"checkbox",void 0),g([U],nl.prototype,"liveRegion",void 0),g([I],nl.prototype,"confirmationLiveMessageChecked",void 0),g([I],nl.prototype,"confirmationLiveMessageUnchecked",void 0),nl=g([K],nl),window.customElements.get("danger-dialog-form-helper")||(window.DangerDialogFormHelperElement=nl,window.customElements.define("danger-dialog-form-helper",nl));class CollapsibleElement extends HTMLElement{constructor(){super(...arguments),this.collapsed=!1}toggleViaKeyboard(t){"Enter"!==t.code&&"Space"!==t.code||(t.preventDefault(),this.toggle())}toggle(){this.collapsed=!this.collapsed}attributeChangedCallback(t){"data-collapsed"===t&&(this.collapsed?this.hideAll():this.expandAll())}hideAll(){this.arrowDown?.removeAttribute("hidden"),this.arrowUp?.setAttribute("hidden",""),this.triggerElement.setAttribute("aria-expanded","false");for(const t of this.collapsibleElements)t.hidden=!0;this.classList.add(`${this.baseClass}--collapsed`)}expandAll(){this.arrowUp?.removeAttribute("hidden"),this.arrowDown?.setAttribute("hidden",""),this.triggerElement.setAttribute("aria-expanded","true");for(const t of this.collapsibleElements)t.hidden=!1;this.classList.remove(`${this.baseClass}--collapsed`)}}g([U],CollapsibleElement.prototype,"arrowDown",void 0),g([U],CollapsibleElement.prototype,"arrowUp",void 0),g([U],CollapsibleElement.prototype,"triggerElement",void 0),g([j],CollapsibleElement.prototype,"collapsibleElements",void 0),g([I],CollapsibleElement.prototype,"collapsed",void 0);let sl=class CollapsibleHeaderElement extends CollapsibleElement{connectedCallback(){if(!this.closest(".Box"))throw new Error("No surrounding BorderBox found")}get baseClass(){return"CollapsibleHeader"}};sl=g([K],sl);let ol=class CollapsibleSectionElement extends CollapsibleElement{get baseClass(){return"CollapsibleSection"}};var rl,al,ll,cl,hl,dl,ul,ml,fl,pl,gl,bl,vl,wl,yl,El,Al,kl,Ll,Sl,Tl,Cl,xl,Ml,Il,Dl,Pl,Nl,Ol,Fl,Hl,ql,Vl,Rl,Wl,Bl,$l,_l;ol=g([K],ol);let Ul=class FilterableTreeViewElement extends HTMLElement{constructor(){super(...arguments),rl.add(this),al.set(this,void 0),ll.set(this,void 0),cl.set(this,new Map),hl.set(this,null),dl.set(this,null),ul.set(this,null),ml.set(this,null),fl.set(this,new Map),pl.set(this,new Map),gl.set(this,!1)}connectedCallback(){const{signal:t}=v(this,ll,new AbortController,"f");this.addEventListener("treeViewNodeChecked",this,{signal:t}),this.addEventListener("itemActivated",this,{signal:t}),this.addEventListener("input",this,{signal:t}),b(this,rl,"a",vl)&&b(this,rl,"m",Dl).call(this)}disconnectedCallback(){b(this,ll,"f").abort(),b(this,dl,"f")?.abort(),null!==b(this,hl,"f")&&clearTimeout(b(this,hl,"f"))}handleEvent(t){t.target===this.filterModeControl?b(this,rl,"m",kl).call(this,t):t.target===this.filterInput?b(this,rl,"m",Sl).call(this,t):t.target===this.includeSubItemsCheckBox?b(this,rl,"m",Tl).call(this,t):(t.target instanceof Pa||t.target instanceof Ya)&&b(this,rl,"m",wl).call(this,t)}get filterModeControl(){return this.filterModeControlList.closest("segmented-control")}get treeView(){return this.treeViewList.closest("tree-view")}set filterFn(t){v(this,al,t,"f")}get filterFn(){return b(this,al,"f")?b(this,al,"f"):this.defaultFilterFn}defaultFilterFn(t,e,i){const n=[];if(e.length>0){const i=e.toLowerCase(),s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let o=s.nextNode();for(;o;){const t=o.textContent?.toLocaleLowerCase()||"";let e=0;for(;e<t.length;){const s=t.indexOf(i,e);if(-1===s)break;const r=new Range;r.setStart(o,s),r.setEnd(o,s+i.length),n.push(r),e=s+i.length}o=s.nextNode()}}if(0===n.length&&e.length>0)return null;switch(i){case"selected":if("false"!==this.treeView?.getNodeCheckedValue(t))return n;break;case"all":return n}return null}get filterMode(){const t=this.filterModeControl?.current;return t?t.getAttribute("data-name"):null}get queryString(){return this.filterInput.value}*eachDescendantDepthFirst(t,e,i){for(const n of t.querySelectorAll(`[role=treeitem][data-node-type='sub-tree'][aria-level='${e}']`)){const t=n.closest("tree-view-sub-tree-node");yield*this.eachDescendantDepthFirst(t,e+1,[...i,t])}const n=t.querySelectorAll(`[role=treeitem][data-node-type='leaf'][aria-level='${e}']`);yield[n,i]}*eachShallowestCheckedSubTree(t){if("true"!==this.treeView?.getNodeCheckedValue(t.node))for(const e of t.eachDirectDescendantSubTreeNode())yield*this.eachShallowestCheckedSubTree(e);else yield t}};al=new WeakMap,ll=new WeakMap,cl=new WeakMap,hl=new WeakMap,dl=new WeakMap,ul=new WeakMap,ml=new WeakMap,fl=new WeakMap,pl=new WeakMap,gl=new WeakMap,rl=new WeakSet,bl=function(){return this.getAttribute("src")},vl=function(){return!!b(this,rl,"a",bl)},wl=function(t){const e=t;if("treeViewNodeChecked"===t.type)b(this,rl,"m",yl).call(this,e),b(this,rl,"m",El).call(this,e)},yl=function(t){if(b(this,rl,"a",vl)){for(const e of t.detail){const t=e.node,i=t.getAttribute("data-node-id");if(i)if("false"===e.checkedValue)b(this,fl,"f").delete(i),b(this,pl,"f").delete(i);else{"single"===t.getAttribute("data-select-variant")&&(b(this,fl,"f").clear(),b(this,pl,"f").clear()),b(this,fl,"f").set(i,e.checkedValue);const n={path:e.path},s=t.getAttribute("data-value");s&&(n.value=s),b(this,pl,"f").set(i,n)}}b(this,rl,"m",Rl).call(this)}},El=function(t){if(!this.treeView)return;if(!this.includeSubItemsCheckBox.checked)return;const e=t.detail[0];if("sub-tree"!==this.treeView.getNodeType(e.node))return;const i=e.node.closest("tree-view-sub-tree-node");"false"===e.checkedValue?b(this,rl,"m",Al).call(this,i):b(this,rl,"m",xl).call(this,i)},Al=function(t){if(!this.treeView)return;if(!b(this,cl,"f").has(t))return;const e=b(this,cl,"f").get(t);for(const[t,i]of e.entries()){let e=t;t instanceof Ya&&(e=t.node),this.treeView.setNodeCheckedValue(e,i.checked?"true":"false"),this.treeView.setNodeDisabledValue(e,i.disabled)}b(this,cl,"f").delete(t)},kl=function(t){"itemActivated"===t.type&&(b(this,rl,"a",vl)?"selected"===this.filterMode?(v(this,ml,b(this,rl,"m",Pl).call(this),"f"),b(this,rl,"m",Wl).call(this)):null!==b(this,ml,"f")&&0===this.queryString.length?(b(this,rl,"m",Ll).call(this),b(this,rl,"m",Nl).call(this,b(this,ml,"f")),v(this,ml,null,"f")):(v(this,ml,null,"f"),b(this,rl,"m",Il).call(this)):b(this,rl,"m",Wl).call(this))},Ll=function(){for(const t of this.querySelectorAll("tree-view li[hidden], tree-view-sub-tree-node[hidden]"))t.removeAttribute("hidden")},Sl=function(t){"input"===t.type&&(b(this,rl,"a",vl)&&"selected"!==this.filterMode?b(this,rl,"m",Il).call(this):b(this,rl,"m",Wl).call(this))},Tl=function(t){this.treeView&&"input"===t.type&&(b(this,rl,"a",vl)||b(this,rl,"m",Wl).call(this),this.includeSubItemsCheckBox.checked?b(this,rl,"m",Cl).call(this):b(this,rl,"m",Ml).call(this))},Cl=function(){if(this.treeView)for(const t of this.treeView.rootSubTreeNodes())for(const e of this.eachShallowestCheckedSubTree(t))b(this,rl,"m",xl).call(this,e)},xl=function(t){if(!this.treeView)return;const e=new Map;for(const i of t.eachDescendantNode())e.set(i,{checked:"true"===this.treeView.getNodeCheckedValue(i),disabled:this.treeView.getNodeDisabledValue(i)}),this.treeView.setNodeCheckedValue(i,"true"),this.treeView.setNodeDisabledValue(i,!0);b(this,cl,"f").set(t,e)},Ml=function(){for(const t of b(this,cl,"f").keys())b(this,rl,"m",Al).call(this,t)},Il=function(){null!==b(this,hl,"f")&&clearTimeout(b(this,hl,"f")),v(this,hl,setTimeout(()=>{v(this,hl,null,"f"),b(this,rl,"m",Dl).call(this)},300),"f")},Dl=async function(){const t=b(this,rl,"a",bl);if(!t)return;const e=this.queryString,i=this.filterMode||"all",n=this.includeSubItemsCheckBox?.checked??!1;!b(this,gl,"f")&&e.length>0?(b(this,rl,"m",Ol).call(this),v(this,gl,!0,"f")):b(this,gl,"f")&&0===e.length&&v(this,gl,!1,"f");const s=e.length>0;b(this,dl,"f")?.abort();const{signal:o}=v(this,dl,new AbortController,"f"),r=new URL(t,window.location.href);r.searchParams.set("query",e),r.searchParams.set("filter_mode",i),r.searchParams.set("include_sub_items",String(n));for(const t of b(this,fl,"f").keys())r.searchParams.append("checked_ids[]",t);this.setAttribute("data-loading",""),this.setAttribute("aria-busy","true");try{const t=await fetch(r.toString(),{signal:o,headers:{Accept:"text/html"},credentials:"same-origin",method:"GET"});if(!t.ok)return;const i=await t.text(),a=(new DOMParser).parseFromString(i,"text/html").querySelector("tree-view");if(!a)return;const l=this.treeViewList?.closest("tree-view");if(!l)return;if(b(this,cl,"f").clear(),l.replaceWith(a),b(this,rl,"m",Hl).call(this),n&&b(this,rl,"m",Cl).call(this),s){b(this,rl,"m",ql).call(this),b(this,rl,"m",Vl).call(this,e);const t=!!this.treeViewList?.querySelector("[role=treeitem]");this.noResultsMessage.toggleAttribute("hidden",t),this.treeViewList?.toggleAttribute("hidden",!t)}else b(this,rl,"m",_l).call(this),b(this,rl,"m",Fl).call(this),this.noResultsMessage.setAttribute("hidden","hidden"),this.treeViewList?.removeAttribute("hidden");b(this,rl,"m",Rl).call(this)}catch(t){if("AbortError"===t.name)return;throw t}finally{this.removeAttribute("data-loading"),this.setAttribute("aria-busy","false")}},Pl=function(){const t=new Map;for(const e of this.querySelectorAll("[role=treeitem][data-node-id][data-node-type=sub-tree]"))t.set(e.getAttribute("data-node-id"),"true"===e.getAttribute("aria-expanded"));return t},Nl=function(t){for(const[e,i]of t){const t=this.querySelector(`[role=treeitem][data-node-id="${CSS.escape(e)}"]`),n=t?.closest("tree-view-sub-tree-node");n&&(i?n.expand():n.collapse())}},Ol=function(){v(this,ul,b(this,rl,"m",Pl).call(this),"f")},Fl=function(){b(this,ul,"f")&&(b(this,rl,"m",Nl).call(this,b(this,ul,"f")),v(this,ul,null,"f"))},Hl=function(){if(this.treeView)for(const t of this.querySelectorAll("[role=treeitem][data-node-id]")){const e=t.getAttribute("data-node-id"),i=b(this,fl,"f").get(e);void 0!==i&&this.treeView.setNodeCheckedValue(t,i)}},ql=function(){for(const t of this.querySelectorAll("tree-view-sub-tree-node"))t.expand()},Vl=function(t){b(this,rl,"m",_l).call(this);const e=[];for(const i of this.querySelectorAll("[role=treeitem]")){const n=this.defaultFilterFn(i,t,"all");n&&e.push(...n)}e.length>0&&b(this,rl,"m",Bl).call(this,e)},Rl=function(){const t=this.treeView?.formInputPrototype;if(t){for(const t of this.querySelectorAll("[data-filterable-tree-view-retained]"))t.remove();for(const[e,i]of b(this,pl,"f")){if(!!this.querySelector(`[role=treeitem][data-node-id="${CSS.escape(e)}"]`))continue;const n=document.createElement("input");n.type="hidden",n.name=t.name,n.value=JSON.stringify(i),n.setAttribute("data-filterable-tree-view-retained",""),this.appendChild(n)}}},Wl=function(){if(!this.treeView)return;b(this,rl,"m",_l).call(this);const t=this.queryString,e=this.filterMode||void 0,i=window.crypto.randomUUID(),n=new Map,s=(...n)=>{for(const s of n)s.expand(),s.removeAttribute("hidden"),s.setAttribute("data-generation",i),o(s.node,t,e)?s.node.removeAttribute("aria-disabled"):s.node.setAttribute("aria-disabled","true")},o=(t,e,i)=>(n.has(t)||n.set(t,this.filterFn(t,e,i)),null!==n.get(t));for(const[n,r]of this.eachDescendantDepthFirst(this.treeViewList,1,[])){const a=r[r.length-1];let l=!1;for(const i of n)o(i,t,e)?(i.closest("li")?.removeAttribute("hidden"),l=!0):i.closest("li")?.setAttribute("hidden","hidden");l?s(...r):a&&(o(a.node,t,e)?s(...r):a.getAttribute("data-generation")!==i&&(a.collapse(),a.setAttribute("hidden","hidden")))}const r=Array.from(n.values()).flat().filter(t=>null!==t);0===r.length&&t.length>0?(this.treeViewList.setAttribute("hidden","hidden"),this.noResultsMessage.removeAttribute("hidden")):(this.treeViewList.removeAttribute("hidden"),this.noResultsMessage.setAttribute("hidden","hidden"),b(this,rl,"m",Bl).call(this,r))},Bl=function(t){CSS.highlights?CSS.highlights.set("primer-filterable-tree-view-search-results",new Highlight(...t)):b(this,rl,"m",$l).call(this,t)},$l=function(t){const e=t[0].startContainer,i=e.parentNode,n=e.textContent,s=[];let o=0;for(const{startOffset:e,endOffset:i}of t){e>o&&s.push(document.createTextNode(n.slice(o,e)));const t=document.createElement("mark");t.textContent=n.slice(e,i),s.push(t),o=i}o<n.length&&s.push(document.createTextNode(n.slice(o)));for(const t of s.reverse())i.insertBefore(t,e.nextSibling);i.removeChild(e)},_l=function(){for(const t of this.querySelectorAll("mark"))t.parentElement&&t.parentElement.replaceChildren(t.parentElement.textContent)},g([U],Ul.prototype,"filterInput",void 0),g([U],Ul.prototype,"filterModeControlList",void 0),g([U],Ul.prototype,"treeViewList",void 0),g([U],Ul.prototype,"noResultsMessage",void 0),g([U],Ul.prototype,"includeSubItemsCheckBox",void 0),Ul=g([K],Ul),window.customElements.get("filterable-tree-view")||(window.FilterableTreeViewElement=Ul,window.customElements.define("filterable-tree-view",Ul))}();
|
|
2
2
|
//# sourceMappingURL=primer_view_components.js.map
|