primer_view_components 0.49.0 → 0.50.0

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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +20 -1
  4. data/app/assets/javascripts/primer_view_components.js +1 -1
  5. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  6. data/app/assets/styles/primer_view_components.css +1 -1
  7. data/app/assets/styles/primer_view_components.css.map +1 -1
  8. data/app/components/primer/alpha/action_list/item.rb +2 -1
  9. data/app/components/primer/alpha/select_panel.rb +1 -1
  10. data/app/components/primer/alpha/select_panel_element.js +1 -1
  11. data/app/components/primer/alpha/select_panel_element.ts +1 -1
  12. data/app/components/primer/alpha/stack.rb +1 -0
  13. data/app/components/primer/alpha/tab_nav.css +1 -1
  14. data/app/components/primer/alpha/tab_nav.css.json +1 -0
  15. data/app/components/primer/alpha/tab_nav.css.map +1 -1
  16. data/app/components/primer/alpha/tab_nav.pcss +7 -1
  17. data/app/controllers/primer/view_components/toggle_switch_controller.rb +2 -2
  18. data/app/forms/check_box_with_nested_form.rb +9 -5
  19. data/app/lib/primer/forms/check_box.rb +28 -0
  20. data/app/lib/primer/forms/dsl/multi_input.rb +3 -1
  21. data/app/lib/primer/forms/dsl/text_field_input.rb +2 -1
  22. data/app/lib/primer/forms/form_control.html.erb +2 -1
  23. data/app/lib/primer/forms/text_field.html.erb +1 -1
  24. data/lib/primer/accessibility.rb +9 -3
  25. data/lib/primer/view_components/engine.rb +1 -4
  26. data/lib/primer/view_components/version.rb +1 -1
  27. data/previews/primer/alpha/form_control_preview/playground.html.erb +4 -2
  28. data/previews/primer/alpha/octicon_symbols_preview/playground.html.erb +1 -1
  29. data/previews/primer/alpha/overlay_preview.rb +0 -25
  30. data/previews/primer/alpha/text_area_preview.rb +11 -11
  31. data/previews/primer/alpha/text_field_preview.rb +9 -0
  32. data/previews/primer/alpha/toggle_switch_preview.rb +14 -14
  33. data/previews/primer/beta/button_preview/all_schemes.html.erb +1 -1
  34. data/previews/primer/beta/button_preview/invisible_all_visuals.html.erb +1 -1
  35. data/previews/primer/beta/button_preview/summary_as_button.html.erb +10 -1
  36. data/static/arguments.json +1 -1
  37. data/static/info_arch.json +16 -15
  38. data/static/previews.json +15 -14
  39. metadata +2 -2
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var t,e,n,i,s,o,r,a,l=function(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)},c=function(t,e,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!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"===i?s.call(t,n):s?s.value=n:e.set(t,n),n};const d=new WeakMap;let u=null;class IncludeFragmentElement extends HTMLElement{constructor(){super(...arguments),t.add(this),e.set(this,!1),n.set(this,new IntersectionObserver((e=>{for(const s of e)if(s.isIntersecting){const{target:e}=s;if(l(this,n,"f").unobserve(e),!(e instanceof IncludeFragmentElement))return;"lazy"===e.loading&&l(this,t,"m",i).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){u=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,n){"src"===e?this.isConnected&&"eager"===this.loading&&l(this,t,"m",i).call(this):"loading"===e&&this.isConnected&&"eager"!==n&&"eager"===this.loading&&l(this,t,"m",i).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",i).call(this),"lazy"===this.loading&&l(this,n,"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",i).call(this)}}e=new WeakMap,n=new WeakMap,t=new WeakSet,i=async function(){if(!l(this,e,"f")){c(this,e,!0,"f"),l(this,n,"f").unobserve(this);try{const n=await l(this,t,"m",s).call(this);if(n instanceof Error)throw n;const i=n,o=document.createElement("template");o.innerHTML=i;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,n=d.get(this);if(n&&n.src===e)return n.data;{let n;return n=e?l(this,t,"m",a).call(this):Promise.reject(new Error("missing src")),d.set(this,{src:e,data:n}),n}},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 n of t)this.dispatchEvent(e?new CustomEvent(n,{detail:{error:e}}):new Event(n))},a=async function(){try{await l(this,t,"m",r).call(this,["loadstart"]);const n=await this.fetch(this.request()),i=n.headers.get("Content-Type");if(!(e=this.accept,e&&e.split(",").find((t=>t.match(/^\s*\*\/\*/)))||i&&i.includes(this.accept?this.accept:"text/html")))throw new Error(`Failed to load resource: expected ${this.accept||"text/html"} but was ${i}`);if(200!==n.status)throw new Error(`Failed to load resource: the server responded with a status of ${n.status}`);const s=await n.text();let o=s;if(u){o=(await u).createHTML(s,n)}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 h="undefined"!=typeof globalThis?globalThis:window;try{h.IncludeFragmentElement=IncludeFragmentElement.define()}catch(t){if(!(h.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,n){const i=t.input;if(!i)return;const s=m.get(t);if(!s)return;const o=i.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 u="";try{d=await async function(t,e,n){try{const i=await fetch(e,n);return t.dispatchEvent(new CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),i}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"}}),u=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=u,t.dispatchEvent(new CustomEvent("remote-input-success",{bubbles:!0,detail:{eventType:n?n.type:void 0}}))):t.dispatchEvent(new CustomEvent("remote-input-error",{bubbles:!0}))}function p(t){let e;return function(n){clearTimeout(e),e=setTimeout((()=>{clearTimeout(e),t(n)}),300)}}function g(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r}function b(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function v(t,e,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!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"===i?s.call(t,n):s?s.value=n:e.set(t,n),n}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){L(t),A(t)}const E=new WeakMap;function A(t=document){if(E.has(t))return E.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)C(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&L(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const i={get closed(){return e},unsubscribe(){e=!0,E.delete(t),n.disconnect()}};return E.set(t,i),i}function L(t){for(const e of t.querySelectorAll("[data-action]"))C(e);t instanceof Element&&t.hasAttribute("data-action")&&C(t)}function k(t){const e=t.currentTarget;for(const n of T(e))if(t.type===n.type){const i=e.closest(n.tag);w.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const s=e.getRootNode();if(s instanceof ShadowRoot&&w.has(s.host)&&s.host.matches(n.tag)){const e=s.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*T(t){for(const e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){const t=e.lastIndexOf(":"),n=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,t),tag:e.slice(t+1,n),method:e.slice(n+1)||"handleEvent"}||"handleEvent"}}function C(t){for(const e of T(t))t.addEventListener(e.type,k)}const S=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),x=(t,e="property")=>{const n=S(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};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 n=Object.getPrototypeOf(t),i=n?.constructor?.attrPrefix??"data-";e||(e=$(n,M));for(const n of e){const e=t[n],s=x(`${i}${n}`);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,n,o),n in t&&!t.hasAttribute(s)&&o.set.call(t,e)}}const O=new Map,H=new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),N=new Promise((t=>{const e=new AbortController;e.signal.addEventListener("abort",(()=>t()));const n={once:!0,passive:!0,signal:e.signal},i=()=>e.abort();document.addEventListener("mousedown",i,n),document.addEventListener("touchstart",i,n),document.addEventListener("keydown",i,n),document.addEventListener("pointerdown",i,n)})),F={ready:()=>H,firstInteraction:()=>N,visible:t=>new Promise((e=>{const n=new IntersectionObserver((t=>{for(const i of t)if(i.isIntersecting)return e(),void n.disconnect()}),{rootMargin:"0px 0px 256px 0px",threshold:.01});for(const e of document.querySelectorAll(t))n.observe(e)}))},R=new WeakMap;function q(t){cancelAnimationFrame(R.get(t)||0),R.set(t,requestAnimationFrame((()=>{for(const e of O.keys()){const n=t instanceof Element&&t.matches(e)?t:t.querySelector(e);if(customElements.get(e)||n){const i=n?.getAttribute("data-load-on")||"ready",s=i in F?F[i]:F.ready;for(const t of O.get(e)||[])s(e).then(t);O.delete(e),R.delete(t)}}})))}let W;const V=Symbol.for("catalyst");class B{constructor(t){const e=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){e.connectedCallback(this,n)};const i=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){e.disconnectedCallback(this,i)};const s=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,n,i){e.attributeChangedCallback(this,t,n,i,s)};let o=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return e.observedAttributes(this,o)},set(t){o=t}}),function(t){let e=t.observedAttributes||[];const n=t.attrPrefix??"data-",i=t=>x(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...$(t.prototype,M)].map(i).concat(e),set(t){e=t}})}(t),function(t){const e=S(t.name).replace(/-element$/,"");try{window.customElements.define(e,t),window[t.name]=customElements.get(e)}catch(t){if(!(t instanceof DOMException&&"NotSupportedError"===t.name))throw t}}(t)}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),L(t),A(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&(y(t.shadowRoot),function(t){W||(W=new MutationObserver((t=>{if(O.size)for(const e of t)for(const t of e.addedNodes)t instanceof Element&&q(t)}))),q(t),W.observe(t,{subtree:!0,childList:!0})}(t.shadowRoot))}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,i,s){P(t),"data-catalyst"!==e&&s&&s.call(t,e,n,i)}}function $(t,e){if(!Object.prototype.hasOwnProperty.call(t,V)){const e=t[V],n=t[V]=new Map;if(e)for(const[t,i]of e)n.set(t,new Set(i))}const n=t[V];return n.has(e)||n.set(e,new Set),n.get(e)}function U(t,e){$(t,"target").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase();if(t.shadowRoot)for(const i of t.shadowRoot.querySelectorAll(`[data-target~="${n}.${e}"]`))if(!i.closest(n))return i;for(const i of t.querySelectorAll(`[data-target~="${n}.${e}"]`))if(i.closest(n)===t)return i}(this,e)}})}function K(t,e){$(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase(),i=[];if(t.shadowRoot)for(const s of t.shadowRoot.querySelectorAll(`[data-targets~="${n}.${e}"]`))s.closest(n)||i.push(s);for(const s of t.querySelectorAll(`[data-targets~="${n}.${e}"]`))s.closest(n)===t&&i.push(s);return i}(this,e)}})}function j(t){new B(t)}var z;class Y{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 n=t.querySelector(".ActionListItem-truncationTooltip");if(!n)continue;const i=e.scrollWidth>e.clientWidth;n.style.display=i?"":"none"}}}let _=class ActionListElement extends HTMLElement{constructor(){super(...arguments),z.set(this,void 0)}connectedCallback(){v(this,z,new Y(this),"f")}disconnectedCallback(){b(this,z,"f").unobserve(this)}};z=new WeakMap,_=g([j],_);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,n={}){const i=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 document.body;let e=t.parentNode;for(;null!==e;){if(e instanceof HTMLElement&&"static"!==getComputedStyle(e).position)return e;e=e.parentNode}return document.body}(t),s=function(t){let e=t;for(;null!==e&&e instanceof Element;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const n=e!==document.body&&e instanceof HTMLElement?e:document.body,i=n.getBoundingClientRect(),s=getComputedStyle(n),[o,r,a,l]=[s.borderTopWidth,s.borderLeftWidth,s.borderRightWidth,s.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:i.top+o,left:i.left+r,width:i.width-a-r,height:Math.max(i.height-o-l,n===document.body?window.innerHeight:-1/0)}}(i),o=getComputedStyle(i),r=i.getBoundingClientRect(),[a,l]=[o.borderTopWidth,o.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,i,{side:s,align:o,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:l}){const c={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let d=Q(n,i,s,o,a,l),u=s,h=o;if(d.top-=e.top,d.left-=e.left,!r){const r=G[s];let m=0;if(r){let t=s;for(;m<r.length&&tt(t,d,c,n);){const s=r[m++];t=s,d=Q(n,i,s,o,a,l),d.top-=e.top,d.left-=e.left,u=s}}const f=J[o];let p=0;if(f){let t=o;for(;p<f.length&&et(t,d,c,n);){const s=f[p++];t=s,d=Q(n,i,u,s,a,l),d.top-=e.top,d.left-=e.left,h=s}}d.top<c.top&&(d.top=c.top),d.left<c.left&&(d.left=c.left),d.left+n.width>t.width+c.left&&(d.left=t.width+c.left-n.width),r&&m<r.length&&d.top+n.height>t.height+c.top&&(d.top=Math.max(t.height+c.top-n.height,0))}return Object.assign(Object.assign({},d),{anchorSide:u,anchorAlign:h})}(s,{top:r.top+a,left:r.left+l},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,i,s,o;const r=null!==(e=t.side)&&void 0!==e?e:Z.side,a=null!==(n=t.align)&&void 0!==n?n:Z.align;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:Z.anchorOffset,alignmentOffset:null!==(s=t.alignmentOffset)&&void 0!==s?s:"center"!==a&&r.startsWith("inside")?Z.alignmentOffset:0,allowOutOfBounds:null!==(o=t.allowOutOfBounds)&&void 0!==o?o:Z.allowOutOfBounds}}(n))}const Z={side:"outside-bottom",align:"start",anchorOffset:4,alignmentOffset:4,allowOutOfBounds:!1};function Q(t,e,n,i,s,o){const r=e.left+e.width,a=e.top+e.height;let l=-1,c=-1;return"outside-top"===n?l=e.top-s-t.height:"outside-bottom"===n?l=a+s:"outside-left"===n?c=e.left-s-t.width:"outside-right"===n&&(c=r+s),"outside-top"!==n&&"outside-bottom"!==n||(c="start"===i?e.left+o:"center"===i?e.left-(t.width-e.width)/2+o:r-t.width-o),"outside-left"!==n&&"outside-right"!==n||(l="start"===i?e.top+o:"center"===i?e.top-(t.height-e.height)/2+o:a-t.height-o),"inside-top"===n?l=e.top+s:"inside-bottom"===n?l=a-s-t.height:"inside-left"===n?c=e.left+s:"inside-right"===n?c=r-s-t.width:"inside-center"===n&&(c=(r+e.left)/2-t.width/2+s),"inside-top"===n||"inside-bottom"===n?c="start"===i?e.left+o:"center"===i?e.left-(t.width-e.width)/2+o:r-t.width-o:"inside-left"!==n&&"inside-right"!==n&&"inside-center"!==n||(l="start"===i?e.top+o:"center"===i?e.top-(t.height-e.height)/2+o:a-t.height-o),{top:l,left:c}}function tt(t,e,n,i){return"outside-top"===t||"outside-bottom"===t?e.top<n.top||e.top+i.height>n.height+n.top:e.left<n.left||e.left+i.width>n.width+n.left}function et(t,e,n,i){return"end"===t?e.left<n.left:"start"===t||"center"===t?e.left+i.width>n.left+n.width||e.left<n.left:void 0}function*nt(t,e={}){var n,i;const s=null!==(n=e.strict)&&void 0!==n&&n,o=null!==(i=e.onlyTabbable)&&void 0!==i&&i?ot:st,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 it(t,e=!1){return nt(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function st(t,e=!1){const n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,i=t.hidden,s=t instanceof HTMLInputElement&&"hidden"===t.type,o=t.classList.contains("sentinel");if(n||i||s||o)return!1;if(e){const e=getComputedStyle(t),n=0===t.offsetWidth||0===t.offsetHeight,i=["hidden","collapse"].includes(e.visibility),s="none"===e.display||!t.offsetParent,o=0===t.getClientRects().length;if(n||i||o||s)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 ot(t,e=!1){return st(t,e)&&"-1"!==t.getAttribute("tabindex")}let rt=!1;function at(){}try{const t=Object.create({},{signal:{get(){rt=!0}}});window.addEventListener("test",at,t),window.removeEventListener("test",at,t)}catch(t){}function lt(){rt||(!function(){if("undefined"==typeof window)return;const t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(e,n,i){return"object"==typeof i&&"signal"in i&&i.signal instanceof AbortSignal&&t.call(i.signal,"abort",(()=>{this.removeEventListener(e,n,i)})),t.call(this,e,n,i)}}(),rt=!0)}lt();const ct=[];let dt,ut;function ht(t,e,n){const i=new AbortController,s=null!=n?n:i.signal;t.setAttribute("data-focus-trap","active");const o=document.createElement("span");o.setAttribute("class","sentinel"),o.setAttribute("tabindex","0"),o.setAttribute("aria-hidden","true"),o.onfocus=()=>{const e=it(t,!0);null==e||e.focus()};const r=document.createElement("span");r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=it(t);null==e||e.focus()};Array.from(t.children).filter((t=>t.classList.contains("sentinel")&&"SPAN"===t.tagName)).length||(t.prepend(o),t.append(r));const a=function(t,e){const n=new MutationObserver((n=>{for(const i of n)if("childList"===i.type&&i.addedNodes.length){if(Array.from(i.addedNodes).filter((t=>t instanceof HTMLElement&&t.classList.contains("sentinel")&&"SPAN"===t.tagName)).length)return;const n=t.firstElementChild,s=t.lastElementChild,[o,r]=e;(null==n?void 0:n.classList.contains("sentinel"))||t.insertAdjacentElement("afterbegin",o),(null==s?void 0:s.classList.contains("sentinel"))||t.insertAdjacentElement("beforeend",r)}}));return n.observe(t,{childList:!0}),n}(t,[o,r]);let l;function c(n){if(n instanceof HTMLElement&&document.contains(t)){if(t.contains(n))return void(l=n);if(l&&ot(l)&&t.contains(l))return void l.focus();if(e&&t.contains(e))return void e.focus();{const e=it(t);return void(null==e||e.focus())}}}const d=function(t){const e=new AbortController;return t.addEventListener("abort",(()=>{e.abort()})),e}(s);if(dt){const t=dt;dt.container.setAttribute("data-focus-trap","suspended"),dt.controller.abort(),ct.push(t)}d.signal.addEventListener("abort",(()=>{dt=void 0})),s.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=ct.findIndex((e=>e.container===t));n>=0&&ct.splice(n,1),a.disconnect(),function(){const t=ct.pop();t&&ht(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{c(t.target)}),{signal:d.signal,capture:!0}),c(document.activeElement),dt={container:t,controller:d,initialFocus:e,originalSignal:s};const u=ct.findIndex((e=>e.container===t));if(u>=0&&ct.splice(u,1),!n)return i}function mt(){return void 0===ut&&(ut=/^mac/i.test(window.navigator.platform)),ut}let ft=1e4;const pt=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);var gt;lt(),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"}(gt||(gt={}));const bt={ArrowLeft:gt.ArrowHorizontal,ArrowDown:gt.ArrowVertical,ArrowUp:gt.ArrowVertical,ArrowRight:gt.ArrowHorizontal,h:gt.HL,j:gt.JK,k:gt.JK,l:gt.HL,a:gt.AD,s:gt.WS,w:gt.WS,d:gt.AD,Tab:gt.Tab,Home:gt.HomeAndEnd,End:gt.HomeAndEnd,PageUp:gt.PageUpDown,PageDown:gt.PageUpDown,Backspace:gt.Backspace},vt={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 wt(t){const e=vt[t.key];if("Tab"===t.key&&t.shiftKey)return"previous";const n=mt();if(n&&t.metaKey||!n&&t.ctrlKey){if("ArrowLeft"===t.key||"ArrowUp"===t.key)return"start";if("ArrowRight"===t.key||"ArrowDown"===t.key)return"end"}return e}function yt(t,e){const n=t.key,i=[...n].length,s=function(t){var e,n;if(!(t instanceof HTMLElement))return!1;const i=t.nodeName.toLowerCase(),s=null!==(n=null===(e=t.getAttribute("type"))||void 0===e?void 0:e.toLowerCase())&&void 0!==n?n:"text",o="true"===t.ariaReadOnly||"true"===t.getAttribute("aria-readonly")||null!==t.getAttribute("readonly");return("select"===i||"textarea"===i||"input"===i&&!pt.has(s)||t.isContentEditable)&&!o}(e),o=e instanceof HTMLSelectElement;if(s&&(1===i||"Home"===n||"End"===n))return!0;if(o)return!("ArrowDown"!==n||!mt()||t.metaKey)||!("ArrowDown"!==n||mt()||!t.altKey);if(s&&!o){const t=e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement,i=t&&0===e.selectionStart&&0===e.selectionEnd,s=t&&e.selectionStart===e.value.length&&e.selectionEnd===e.value.length;if("ArrowLeft"===n&&!i)return!0;if("ArrowRight"===n&&!s)return!0;const o=e instanceof HTMLElement&&e.isContentEditable;if(e instanceof HTMLTextAreaElement||o){if("PageUp"===n||"PageDown"===n)return!0;if("ArrowUp"===n&&!i)return!0;if("ArrowDown"===n&&!s)return!0}}return!1}const Et="data-is-active-descendant",At="activated-directly",Lt="activated-indirectly",kt="data-has-active-descendant";function Tt(t,e){var n,i,s,o,r;const a=[],l=new WeakMap,c=null!==(n=null==e?void 0:e.bindKeys)&&void 0!==n?n:((null==e?void 0:e.getNextFocusable)?gt.ArrowAll:gt.ArrowVertical)|gt.HomeAndEnd,d=null!==(i=null==e?void 0:e.focusOutBehavior)&&void 0!==i?i:"stop",u=null!==(s=null==e?void 0:e.focusInStrategy)&&void 0!==s?s:"previous",h=null==e?void 0:e.activeDescendantControl,m=null==e?void 0:e.onActiveDescendantChanged;let f;const p=null!==(o=null==e?void 0:e.preventScroll)&&void 0!==o&&o;function g(){return a[0]}function b(t,e=!1){const n=f;f=t,h?t&&document.activeElement===h?v(n,t,e):w():(n&&n!==t&&l.has(n)&&n.setAttribute("tabindex","-1"),null==t||t.setAttribute("tabindex","0"))}function v(e,n,i=!1){n.id||n.setAttribute("id","__primer_id_"+ft++),e&&e!==n&&e.removeAttribute(Et),h&&(i||h.getAttribute("aria-activedescendant")!==n.id)&&(h.setAttribute("aria-activedescendant",n.id),t.setAttribute(kt,n.id),n.setAttribute(Et,i?At:Lt),null==m||m(n,e,i))}function w(e=f){"first"===u&&(f=void 0),null==h||h.removeAttribute("aria-activedescendant"),t.removeAttribute(kt),null==e||e.removeAttribute(Et);for(const e of t.querySelectorAll(`[${Et}]`))null==e||e.removeAttribute(Et);null==m||m(void 0,e,!1)}function y(...t){const n=t.filter((t=>{var n,i;return null===(i=null===(n=null==e?void 0:e.focusableElementFilter)||void 0===n?void 0:n.call(e,t))||void 0===i||i}));if(0!==n.length){a.splice(function(t){const e=t[0];if(0===a.length)return 0;let n=0,i=a.length-1;for(;n<=i;){const t=Math.floor((n+i)/2);E(e,a[t])?i=t-1:n=t+1}return n}(n),0,...n);for(const t of n)l.has(t)||l.set(t,t.getAttribute("tabindex")),t.setAttribute("tabindex","-1");f||b(g())}}function E(t,e){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)>0}function A(...t){for(const e of t){const t=a.indexOf(e);t>=0&&a.splice(t,1);const n=l.get(e);if(void 0!==n&&(null===n?e.removeAttribute("tabindex"):e.setAttribute("tabindex",n),l.delete(e)),e===f){b(g())}}}const L={reverse:null==e?void 0:e.reverse,strict:null==e?void 0:e.strict,onlyTabbable:null==e?void 0:e.onlyTabbable};y(...nt(t,L));b("function"==typeof u?u(document.body):g());new MutationObserver((t=>{for(const e of t){for(const t of e.removedNodes)t instanceof HTMLElement&&A(...nt(t));"attributes"===e.type&&null===e.oldValue&&e.target instanceof HTMLElement&&A(e.target)}for(const e of t){for(const t of e.addedNodes)t instanceof HTMLElement&&y(...nt(t,L));"attributes"===e.type&&null!==e.oldValue&&e.target instanceof HTMLElement&&y(e.target)}})).observe(t,{subtree:!0,childList:!0,attributeFilter:["hidden","disabled"],attributeOldValue:!0});const k=new AbortController,T=null!==(r=null==e?void 0:e.abortSignal)&&void 0!==r?r:k.signal;let C;T.addEventListener("abort",(()=>{A(...a)})),t.addEventListener("mousedown",(t=>{t.target instanceof HTMLElement&&t.target!==document.activeElement&&(C=a.indexOf(t.target))}),{signal:T}),h?(t.addEventListener("focusin",(t=>{t.target instanceof HTMLElement&&a.includes(t.target)&&(h.focus({preventScroll:p}),b(t.target))}),{signal:T}),t.addEventListener("mousemove",(({target:t})=>{if(!(t instanceof Node))return;const e=a.find((e=>e.contains(t)));e&&b(e)}),{signal:T,capture:!0}),h.addEventListener("focusin",(()=>{f?v(void 0,f):b(g())}),{signal:T}),h.addEventListener("focusout",(()=>{w()}),{signal:T})):t.addEventListener("focusin",(e=>{if(e.target instanceof HTMLElement)if(void 0!==C)C>=0&&a[C]!==f&&b(a[C]),C=void 0;else if("previous"===u)b(e.target);else if("closest"===u||"first"===u){if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t="previous"===x?a.length-1:0,e=a[t];return void(null==e||e.focus({preventScroll:p}))}b(e.target)}else if("function"==typeof u)if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t=u(e.relatedTarget);if((t?a.indexOf(t):-1)>=0&&t instanceof HTMLElement)return void t.focus({preventScroll:p});console.warn("Element requested is not a known focusable element.")}else b(e.target);x=void 0}),{signal:T});const S=null!=h?h:t;let x;return"closest"===u&&document.addEventListener("keydown",(t=>{"Tab"===t.key&&(x=wt(t))}),{signal:T,capture:!0}),S.addEventListener("keydown",(n=>{var i;if(n.key in vt){const s=bt[n.key];if(!n.defaultPrevented&&(s&c)>0&&!yt(n,document.activeElement)){const s=wt(n);let o;if((null==e?void 0:e.getNextFocusable)&&(o=e.getNextFocusable(s,null!==(i=document.activeElement)&&void 0!==i?i:void 0,n)),!o){const e=function(){if(!f)return 0;const e=a.indexOf(f);return-1!==e?e:f===t?-1:0}();let i=e;"previous"===s?i-=1:"start"===s?i=0:"next"===s?i+=1:i=a.length-1,i<0&&(i="wrap"===d&&"Tab"!==n.key?a.length-1:0),i>=a.length&&(i="wrap"===d&&"Tab"!==n.key?0:a.length-1),e!==i&&(o=a[i])}h?b(o||f,!0):o&&(x=s,o.focus({preventScroll:p})),("Tab"!==n.key||o)&&n.preventDefault()}}}),{signal:T}),k}var Ct,St,xt,Mt,It,Dt,Pt;const Ot=new IntersectionObserver((t=>{for(const e of t){const t=e.target;e.isIntersecting&&t instanceof Ft&&t.update()}})),Ht=new ResizeObserver((t=>{for(const e of t){const t=e.target;t instanceof Ft&&t.update()}}));var Nt;!function(t){t[t.Item=0]="Item",t[t.Divider=1]="Divider"}(Nt||(Nt={}));let Ft=class ActionBarElement extends HTMLElement{constructor(){super(...arguments),Ct.add(this),St.set(this,null)}connectedCallback(){Ht.observe(this),Ot.observe(this),requestAnimationFrame((()=>{this.style.overflow="visible",this.update()}))}disconnectedCallback(){Ht.unobserve(this),Ot.unobserve(this)}menuItemClick(t){const e=t.currentTarget,n=e?.getAttribute("data-for");n&&document.getElementById(n)?.click()}update(){const t=b(this,Ct,"a",xt);if(!t)return;const e=t.getBoundingClientRect().top;let n=null;b(this,Ct,"m",Pt).call(this,((t,i,s)=>{const o=t.getBoundingClientRect().top;return s===Nt.Item&&(o>e?(b(this,Ct,"m",It).call(this,i),this.moreMenu.hidden&&(this.moreMenu.hidden=!1),n===Nt.Divider&&b(this,Ct,"m",It).call(this,i-1)):(b(this,Ct,"m",Mt).call(this,i),i===this.items.length-1&&(this.moreMenu.hidden=!0),n===Nt.Divider&&b(this,Ct,"m",Mt).call(this,i-1))),n=s,!0})),b(this,St,"f")&&b(this,St,"f").abort(),v(this,St,Tt(this,{bindKeys:gt.ArrowHorizontal|gt.HomeAndEnd,focusOutBehavior:"wrap",focusableElementFilter:t=>{const e=this.items.indexOf(t.parentElement),n=e>-1&&"visible"===this.items[e].style.visibility,i=t===this.moreMenu.invokerElement&&!this.moreMenu.hidden;return n||i}}),"f")}};St=new WeakMap,Ct=new WeakSet,xt=function(){let t=null;return b(this,Ct,"m",Pt).call(this,((e,n,i)=>i!==Nt.Item||(t=e,!1))),t},Mt=function(t){const e=this.items[t],n=b(this,Ct,"a",Dt)[t];e&&n&&(e.style.setProperty("visibility","visible"),n.hidden=!0)},It=function(t){const e=this.items[t],n=b(this,Ct,"a",Dt)[t];e&&n&&(e.style.setProperty("visibility","hidden"),n.hidden=!1)},Dt=function(){return this.moreMenu.querySelectorAll('[role="menu"] > li')},Pt=function(t){for(let e=0;e<this.items.length;e++){const n=this.items[e],i=n.classList.contains("ActionBar-divider")?Nt.Divider:Nt.Item;if(!t(n,e,i))break}},g([K],Ft.prototype,"items",void 0),g([U],Ft.prototype,"itemContainer",void 0),g([U],Ft.prototype,"moreMenu",void 0),Ft=g([j],Ft),window.ActionBarElement=Ft;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 n=[Wt(t,"compositionstart",(t=>Gt(this,t))),Wt(t,"compositionend",(t=>Gt(this,t))),Wt(t,"click",(e=>jt(t,e))),Wt(t,"change",(e=>jt(t,e))),Wt(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=Rt.get(e);if(!i||i.isComposing)return;const s=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(_t(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Ut(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Ut(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(Kt&&n.ctrlKey){const e=Ut(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(Kt&&n.ctrlKey){const e=Ut(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&Yt(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),Wt(t,"toggle",(()=>Vt(t,this)),{once:!0}),Wt(t,"toggle",(()=>function(t){if(!t.hasAttribute("open"))return;for(const e of document.querySelectorAll("details[open] > details-menu")){const n=e.closest("details");n&&n!==t&&!n.contains(t)&&n.removeAttribute("open")}}(t))),this.preload?Wt(t,"mouseover",(()=>Vt(t,this)),{once:!0}):qt,...Bt(t)];Rt.set(this,{subscriptions:n,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,qt={unsubscribe(){}};function Wt(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function Vt(t,e){const n=e.getAttribute("src");if(!n)return;const i=Rt.get(e);if(!i)return;if(i.loaded)return;i.loaded=!0;const s=e.querySelector("include-fragment");s&&!s.hasAttribute("src")&&(s.addEventListener("loadend",(()=>$t(t))),s.setAttribute("src",n))}function Bt(t){let e=!1;return[Wt(t,"mousedown",(()=>e=!0)),Wt(t,"keydown",(()=>e=!1)),Wt(t,"toggle",(()=>{t.hasAttribute("open")&&($t(t)||e||function(t){const e=document.activeElement;if(e&&Yt(e)&&t.contains(e))return;const n=Ut(t,!0);n&&n.focus()}(t))}))]}function $t(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function Ut(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),i=document.activeElement,s=i instanceof HTMLElement?n.indexOf(i):-1,o=e?n[s+1]:n[s-1],r=e?n[0]:n[n.length-1];return o||r}const Kt=navigator.userAgent.match(/Macintosh/);function jt(t,e){const n=e.target;if(n instanceof Element&&n.closest("details")===t)if("click"===e.type){const e=n.closest('[role="menuitem"], [role="menuitemradio"]');if(!e)return;const i=e.querySelector("input");if("LABEL"===e.tagName&&n===i)return;"LABEL"===e.tagName&&i&&!i.checked||zt(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&zt(e,t)}}function zt(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const n=t.closest("details-menu");if(!n)return;n.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const n=e.querySelector("[data-menu-button]");if(!n)return;const i=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(i)n.textContent=i;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&&(n.innerHTML=e)}}(t,e),function(t,e){for(const n of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=n.querySelector('input[type="radio"], input[type="checkbox"]');let i=(n===t).toString();e instanceof HTMLInputElement&&(i=e.indeterminate?"mixed":e.checked.toString()),n.setAttribute("aria-checked",i)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&_t(e),n.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 _t(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Gt(t,e){const n=Rt.get(t);n&&(n.isComposing="compositionstart"===e.type)}var Jt,Xt;window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const Zt=(()=>{const t=new Set;let e=null,n=null;function i(){for(const e of t)e.update()}return s=>{window.addEventListener("resize",i),window.addEventListener("scroll",i),e||(e=new IntersectionObserver((e=>{for(const n of e){const e=n.target;n.isIntersecting?(e.update(),t.add(e)):t.delete(e)}}))),n||(n=new ResizeObserver((()=>{for(const e of t)e.update()}))),n.observe(s.ownerDocument.documentElement),e.observe(s)}})();class AnchoredPositionElement extends HTMLElement{constructor(){super(...arguments),Jt.set(this,null),Xt.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())),Zt(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(b(this,Xt,"f")),v(this,Xt,requestAnimationFrame((()=>{const t=this.anchorElement;if(this.classList.toggle("not-anchored",!t),t){const{left:e,top:n}=X(this,t,this);this.style.top=`${n}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 Qt,te,ee;function ne(t){const e=t.target,n=e?.closest("button");if(!n||n.hasAttribute("disabled")||"true"===n.getAttribute("aria-disabled"))return;let i=n?.getAttribute("data-show-dialog-id");if(i){const e=document.getElementById(i);if(e instanceof HTMLDialogElement){e.showModal(),t.preventDefault();let i=n,s=!1;for(;i;)i=i.parentElement?.closest("[popover]:not(:popover-open)"),i&&"auto"===i.popover&&(i.classList.add("dialog-inside-popover-fix"),i.popover="manual",i.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(i=n.getAttribute("data-close-dialog-id")||n.getAttribute("data-submit-dialog-id"),i){const t=document.getElementById(i);t instanceof HTMLDialogElement&&t.open&&t.close()}}Jt=new WeakMap,Xt=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),Qt.add(this),te.set(this,null)}get dialog(){return this.querySelector("dialog")}connectedCallback(){const{signal:t}=v(this,te,new AbortController,"f");document.addEventListener("click",ne,!0),document.addEventListener("click",this,{signal:t}),this.ownerDocument.body.style.setProperty("--dialog-scrollgutter",window.innerWidth-this.ownerDocument.body.clientWidth+"px"),new MutationObserver((t=>{for(const e of t)e.target===this.dialog&&b(this,Qt,"m",ee).call(this)})).observe(this,{subtree:!0,attributeFilter:["open"]}),b(this,Qt,"m",ee).call(this)}disconnectedCallback(){b(this,te,"f")?.abort()}handleEvent(t){const e=t.target,n=this.dialog;if(e!==n||!n?.open)return;if(n.querySelector("form"))return;const i=n.getBoundingClientRect();i.top<=t.clientY&&t.clientY<=i.top+i.height&&i.left<=t.clientX&&t.clientX<=i.left+i.width||n.close()}}te=new WeakMap,Qt=new WeakSet,ee=function(){this.dialog&&this.dialog.matches("[open]:not(:modal)")&&(this.dialog.addEventListener("close",(t=>t.stopImmediatePropagation()),{once:!0}),this.dialog.close(),this.dialog.showModal())},window.customElements.get("dialog-helper")||(window.DialogHelperElement=DialogHelperElement,window.customElements.define("dialog-helper",DialogHelperElement));var ie=class extends Event{oldState;newState;constructor(t,{oldState:e="",newState:n="",...i}={}){super(t,i),this.oldState=String(e||""),this.newState=String(n||"")}},se=new WeakMap;function oe(t,e,n){se.set(t,setTimeout((()=>{se.has(t)&&t.dispatchEvent(new ie("toggle",{cancelable:!1,oldState:e,newState:n}))}),0))}var re=globalThis.ShadowRoot||function(){},ae=globalThis.HTMLDialogElement||function(){},le=new WeakMap,ce=new WeakMap,de=new WeakMap;function ue(t){return de.get(t)||"hidden"}var he=new WeakMap;function me(t,e){return("auto"===t.popover||"manual"===t.popover)&&(!!t.isConnected&&((!e||"showing"===ue(t))&&(!(!e&&"hidden"!==ue(t))&&(!(t instanceof ae&&t.hasAttribute("open"))&&document.fullscreenElement!==t))))}function fe(t){return t?Array.from(ce.get(t.ownerDocument)||[]).indexOf(t)+1:0}function pe(t){const e=ve(t),n=function(t){for(;t;){const e=t.popoverTargetElement;if(e instanceof HTMLElement)return e;if((t=t.parentElement||be(t))instanceof re&&(t=t.host),t instanceof Document)return}}(t);return fe(e)>fe(n)?e:n}function ge(t){const e=ce.get(t);for(const t of e||[]){if(t.isConnected)return t;e.delete(t)}return null}function be(t){return"function"==typeof t.getRootNode?t.getRootNode():t.parentNode?be(t.parentNode):t}function ve(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===de.get(t))return t;if((t=t instanceof Element&&t.assignedSlot||t.parentElement||be(t))instanceof re&&(t=t.host),t instanceof Document)return}}function we(t){return!(t.hidden||t instanceof re)&&((!(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 ye(t){(function(t){if(t.shadowRoot&&!0!==t.shadowRoot.delegatesFocus)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);let n=e.querySelector("[autofocus]");if(n)return n;{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(n=e.querySelector("[autofocus]"),n)return n}}}const i=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let s=i.currentNode;for(;s;){if(we(s))return s;s=i.nextNode()}})(t)?.focus()}var Ee=new WeakMap;function Ae(t){if(!me(t,!1))return;const e=t.ownerDocument;if(!t.dispatchEvent(new ie("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"})))return;if(!me(t,!1))return;let n=!1;if("auto"===t.popover){const n=t.getAttribute("popover");if(Te(function(t){const e=new Map;let n=0;for(const i of ce.get(t.ownerDocument)||[])e.set(i,n),n+=1;e.set(t,n),n+=1;let i=null;return function(t){const n=ve(t);if(null===n)return null;const s=e.get(n);(null===i||e.get(i)<s)&&(i=n)}(t.parentElement||be(t)),i}(t)||e,!1,!0),n!==t.getAttribute("popover")||!me(t,!1))return}ge(e)||(n=!0),Ee.delete(t);const i=e.activeElement;t.classList.add(":popover-open"),de.set(t,"showing"),le.has(e)||le.set(e,new Set),le.get(e).add(t),ye(t),"auto"===t.popover&&(ce.has(e)||ce.set(e,new Set),ce.get(e).add(t),Me(he.get(t),!0)),n&&i&&"auto"===t.popover&&Ee.set(t,i),oe(t,"closed","open")}function Le(t,e=!1,n=!1){if(!me(t,!0))return;const i=t.ownerDocument;if("auto"===t.popover&&(Te(t,e,n),!me(t,!0)))return;if(Me(he.get(t),!1),he.delete(t),n&&(t.dispatchEvent(new ie("beforetoggle",{oldState:"open",newState:"closed"})),!me(t,!0)))return;le.get(i)?.delete(t),ce.get(i)?.delete(t),t.classList.remove(":popover-open"),de.set(t,"hidden"),n&&oe(t,"open","closed");const s=Ee.get(t);s&&(Ee.delete(t),e&&s.focus())}function ke(t,e=!1,n=!1){let i=ge(t);for(;i;)Le(i,e,n),i=ge(t)}function Te(t,e,n){const i=t.ownerDocument||t;if(t instanceof Document)return ke(i,e,n);let s=null,o=!1;for(const e of ce.get(i)||[])if(e===t)o=!0;else if(o){s=e;break}if(!o)return ke(i,e,n);for(;s&&"showing"===ue(s)&&ce.get(i)?.size;)Le(s,e,n)}var Ce=new WeakMap;function Se(t){if(!t.isTrusted)return;const e=t.composedPath()[0];if(!e)return;const n=e.ownerDocument;if(!ge(n))return;const i=pe(e);if(i&&"pointerdown"===t.type)Ce.set(n,i);else if("pointerup"===t.type){const t=Ce.get(n)===i;Ce.delete(n),t&&Te(i||n,!1,!0)}}var xe=new WeakMap;function Me(t,e=!1){if(!t)return;xe.has(t)||xe.set(t,t.getAttribute("aria-expanded"));const n=t.popoverTargetElement;if(n instanceof HTMLElement&&"auto"===n.popover)t.setAttribute("aria-expanded",String(e));else{const e=xe.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}var Ie=globalThis.ShadowRoot||function(){};function De(t,e,n){const i=t[e];Object.defineProperty(t,e,{value(t){return i.call(this,n(t))}})}var Pe=/(^|[^\\]):popover-open\b/g;function Oe(){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 He,Ne,Fe,Re,qe=null;function We(t){const e=Oe();if(null===qe)try{(qe=new CSSStyleSheet).replaceSync(e)}catch{qe=!1}if(!1===qe){const n=document.createElement("style");n.textContent=e,t instanceof Document?t.head.prepend(n):t.prepend(n)}else t.adoptedStyleSheets=[qe,...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(Pe,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||ie,De(Document.prototype,"querySelector",t),De(Document.prototype,"querySelectorAll",t),De(Element.prototype,"querySelector",t),De(Element.prototype,"querySelectorAll",t),De(Element.prototype,"matches",t),De(Element.prototype,"closest",t),De(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(){Ae(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){Le(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t){"showing"===de.get(this)&&void 0===t||!1===t?Le(this,!0,!0):void 0!==t&&!0!==t||Ae(this)}}});const e=Element.prototype.attachShadow;e&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(t){const n=e.call(this,t);return We(n),n}}});const n=HTMLElement.prototype.attachInternals;n&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){const t=n.call(this);return t.shadowRoot&&We(t.shadowRoot),t}}});const i=new WeakMap;function s(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),i.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),i.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=i.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return i.delete(this),null;const e=be(this),n=this.getAttribute("popovertarget");return(e instanceof Document||e instanceof Ie)&&n&&e.getElementById(n)||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(),n=e[0];if(!(n instanceof Element)||n?.shadowRoot)return;const i=be(n);if(!(i instanceof Ie||i 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 n=ue(e);"show"===t.popoverTargetAction&&"showing"===n||"hide"===t.popoverTargetAction&&"hidden"===n||("showing"===n?Le(e,!0,!0):me(e,!1)&&(he.set(e,t),Ae(e)))}(s),void t.preventDefault()):void 0},r=t=>{const e=t.key,n=t.target;t.defaultPrevented||!n||"Escape"!==e&&"Esc"!==e||Te(n.ownerDocument,!0,!0)};(t=>{t.addEventListener("click",o),t.addEventListener("keydown",r),t.addEventListener("pointerdown",Se),t.addEventListener("pointerup",Se)})(document),We(document)}();const Ve=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]'].map((t=>`:not([hidden]) > ${t}`)).join(", "),Be=t=>t.textContent?.trim()[0].toLowerCase(),$e=/^\S$/;class FocusGroupElement extends HTMLElement{constructor(){super(...arguments),He.add(this),Ne.set(this,null),Fe.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,Fe,new AbortController,"f");const{signal:t}=b(this,Fe,"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,Fe,"f")?.abort()}handleEvent(t){const{direction:e,nowrap:n}=this;if("focusin"===t.type){if(this.retain&&t.target instanceof Element&&t.target.matches(Ve)){b(this,Ne,"f")?.abort();const{signal:e}=v(this,Ne,new AbortController,"f");for(const n of b(this,He,"a",Re)){n.setAttribute("tabindex",n===t.target?"0":"-1");const i=t.target.closest("[popover]");n===t.target&&"auto"===i?.popover&&i.closest("focus-group")===this&&i.addEventListener("toggle",(t=>{if(t.target instanceof Element&&"closed"===t.newState&&(b(this,Ne,"f")?.abort(),n.setAttribute("tabindex","-1"),i.id)){const t=this.querySelector(`[popovertarget="${i.id}"]`);t?t.setAttribute("tabindex","0"):b(this,He,"a",Re)[0]?.setAttribute("tabindex","0")}}),{signal:e})}}}else if(t instanceof KeyboardEvent){const i=Array.from(b(this,He,"a",Re));let s=i.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=i.length-1,t.preventDefault();else{if(!this.mnemonics||!$e.test(o))return;{const e=o.toLowerCase(),r=s>0&&Be(t.target)===e?s:0;s=i.findIndex(((t,n)=>n>r&&Be(t)===e)),s<0&&!n&&(s=i.findIndex((t=>Be(t)===e)))}}n&&s<0&&(s=0),!n&&s>=i.length&&(s=0);const r=i.at(Math.min(s,i.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()}}}Ne=new WeakMap,Fe=new WeakMap,He=new WeakSet,Re=function(){return this.querySelectorAll(Ve)},customElements.get("focus-group")||(window.FocusGroupElement=FocusGroupElement,customElements.define("focus-group",FocusGroupElement));let Ue=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],Ue.prototype,"hasOverflow",void 0),g([I],Ue.prototype,"labelledBy",void 0),Ue=g([j],Ue),window.ScrollableRegionElement=Ue;const Ke=(t,e,n)=>{if(e())n();else{const i=new MutationObserver((()=>{e()&&(n(),i.disconnect())}));i.observe(t,{childList:!0,subtree:!0})}};var je,ze,Ye,_e;function Ge(t){document.activeElement!==t&&t?.focus()}const Je=[];function Xe(t){const e=t.target,n=e?.closest("button");if(!n||n.hasAttribute("disabled")||"true"===n.getAttribute("aria-disabled"))return;let i=n?.getAttribute("data-show-dialog-id");if(i){t.stopPropagation();const e=document.getElementById(i);if(e instanceof ModalDialogElement)return e.openButton=n,e.show(),void t.preventDefault()}if(Je.length&&(i=n.getAttribute("data-close-dialog-id")||n.getAttribute("data-submit-dialog-id"),i)){const t=document.getElementById(i);if(t instanceof ModalDialogElement){const e=Je.findIndex((t=>t.id===i));Je.splice(e,1),t.close(n.hasAttribute("data-submit-dialog-id"))}}}function Ze(t){!(t instanceof KeyboardEvent&&"keydown"===t.type&&"Enter"===t.key)||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey||Xe(t)}function Qe(t){const e=t.target;if(e?.closest("button"))return;const n=Je[Je.length-1];if(!n)return;!e.closest(`#${n.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",(t=>{t.target===e&&(Je.pop(),n.close())}),{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),je.add(this),ze.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,je,"a",Ye)?.classList.remove("Overlay--hidden"),b(this,ze,"f").signal.aborted&&v(this,ze,new AbortController,"f"),ht(this,this.querySelector("[autofocus]"),b(this,ze,"f").signal),Je.push(this)}else{if(!this.open)return;this.removeAttribute("open"),this.setAttribute("aria-disabled","true"),b(this,je,"a",Ye)?.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",b(this,ze,"f").abort();const t=this.openButton?.closest("details")||this.openButton?.closest("action-menu");Ge(t?it(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",Xe),document.addEventListener("keydown",Ze),document.addEventListener("mousedown",Qe),this.addEventListener("keydown",(t=>b(this,je,"m",_e).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 tn,en,nn,sn,on,rn,an,ln;ze=new WeakMap,je=new WeakSet,Ye=function(){return this.parentElement?.hasAttribute("data-modal-dialog-overlay")?this.parentElement:null},_e=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 cn=class NavListElement extends HTMLElement{constructor(){super(...arguments),tn.add(this),en.set(this,void 0)}connectedCallback(){this.topLevelList&&v(this,en,new Y(this.topLevelList),"f")}disconnectedCallback(){this.topLevelList&&b(this,en,"f").unobserve(this.topLevelList)}selectItemById(t){if(!t)return!1;const e=b(this,tn,"m",nn).call(this,t);return!!e&&(b(this,tn,"m",rn).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=b(this,tn,"m",sn).call(this,t);return!!e&&(b(this,tn,"m",rn).call(this,e),!0)}selectItemByCurrentLocation(){const t=b(this,tn,"m",on).call(this);return!!t&&(b(this,tn,"m",rn).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 n=e.closest("button");n&&(this.itemIsExpanded(n)?this.collapseItem(n):this.expandItem(n),t.stopPropagation())}handleItemWithSubItemKeydown(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;let n=e.closest("button");if(!n){const t=e.getAttribute("aria-labelledby");if(!t)return;n=document.getElementById(t)}this.itemIsExpanded(n)&&"Escape"===t.key&&this.collapseItem(n),t.stopPropagation()}};var dn,un,hn;en=new WeakMap,tn=new WeakSet,nn=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},sn=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},on=function(){return b(this,tn,"m",sn).call(this,window.location.pathname)},rn=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&b(this,tn,"m",an).call(this,e),t.classList.add("ActionListItem--navActive"),t.children.length>0&&t.children[0].setAttribute("aria-current","page");const n=b(this,tn,"m",ln).call(this,t);n&&(this.expandItem(n),n.classList.add("ActionListContent--hasActiveSubItem"))},an=function(t){t.classList.remove("ActionListItem--navActive"),t.children.length>0&&t.children[0].removeAttribute("aria-current");const e=b(this,tn,"m",ln).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},ln=function(t){if(!t.classList.contains("ActionListItem--subItem"))return null;const e=t.closest("li.ActionListItem--hasSubItem")?.querySelector("button.ActionListContent");return e||null},g([K],cn.prototype,"items",void 0),g([U],cn.prototype,"topLevelList",void 0),cn=g([j],cn);let mn=class NavListGroupElement extends HTMLElement{constructor(){super(...arguments),dn.add(this),hn.set(this,new Y(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 n=await fetch(t);if(!n.ok)return;e=await n.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const n=b(this,dn,"m",un).call(this,document,e);n?.querySelector("li > a")?.setAttribute("data-targets","nav-list-group.focusMarkers");const i=t.target.closest("button").getAttribute("data-list-id");document.getElementById(i).append(n),this.focusMarkers.pop()?.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}};var fn,pn;hn=new WeakMap,dn=new WeakSet,un=function(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)},g([U],mn.prototype,"showMoreItem",void 0),g([K],mn.prototype,"focusMarkers",void 0),mn=g([j],mn),window.NavListGroupElement=mn;let gn=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),fn.add(this)}connectedCallback(){b(this,fn,"m",pn).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")}};fn=new WeakSet,pn=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},g([K],gn.prototype,"items",void 0),gn=g([j],gn),window.customElements.get("segmented-control")||(window.SegmentedControlElement=gn,window.customElements.define("segmented-control",gn));let bn=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 n={"Requested-With":"XMLHttpRequest","X-Requested-With":"XMLHttpRequest"};this.turbo&&(n.Accept="text/vnd.turbo-stream.html");try{e=await fetch(this.src,{credentials:"same-origin",method:"POST",headers:n,body:t})}catch(t){throw new Error("A network error occurred, please try again.")}if(!e.ok)throw new Error(await e.text());const i=e.headers.get("Content-Type");window.Turbo&&this.turbo&&i?.startsWith("text/vnd.turbo-stream.html")&&window.Turbo.renderStreamMessage(await e.text())}};var vn,wn,yn,En,An,Ln,kn,Tn,Cn,Sn,xn,Mn;g([U],bn.prototype,"switch",void 0),g([U],bn.prototype,"loadingSpinner",void 0),g([U],bn.prototype,"errorIcon",void 0),g([I],bn.prototype,"turbo",void 0),bn=g([j],bn),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=bn,window.customElements.define("toggle-switch",bn));const In=(()=>{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)})(),Dn="sr-only",Pn=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];function On(t){for(const e of Rn)e!==t&&(In(e)?e.hidePopover():Rn.delete(e))}function Hn(){On()}function Nn(t){setTimeout((()=>{for(const e of Rn)In(e)&&"focus"===e.showReason&&e.control!==t.target&&e.hidePopover()}),0)}const Fn=new Set,Rn=new Set;class ToolTipElement extends HTMLElement{constructor(){super(...arguments),vn.add(this),wn.set(this,void 0),yn.set(this,"center"),En.set(this,"outside-bottom"),An.set(this,!1),Ln.set(this,"mouse"),kn.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: var(--overlay-width-small);\n word-wrap: break-word;\n white-space: normal;\n width: max-content !important;\n inset: var(--tooltip-top) auto auto var(--tooltip-left) !important;\n overflow: visible !important;\n text-wrap: balance;\n }\n\n :host(:is(.tooltip-n, .tooltip-nw, .tooltip-ne)) {\n --tooltip-top: calc(var(--tool-tip-position-top, 0) - var(--overlay-offset, 0.25rem));\n --tooltip-left: var(--tool-tip-position-left);\n }\n\n :host(:is(.tooltip-s, .tooltip-sw, .tooltip-se)) {\n --tooltip-top: calc(var(--tool-tip-position-top, 0) + var(--overlay-offset, 0.25rem));\n --tooltip-left: var(--tool-tip-position-left);\n }\n\n :host(.tooltip-w) {\n --tooltip-top: var(--tool-tip-position-top);\n --tooltip-left: calc(var(--tool-tip-position-left, 0) - var(--overlay-offset, 0.25rem));\n }\n\n :host(.tooltip-e) {\n --tooltip-top: var(--tool-tip-position-top);\n --tooltip-left: calc(var(--tool-tip-position-left, 0) + var(--overlay-offset, 0.25rem));\n }\n\n :host:after{\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: var(--overlay-offset, 0.25rem);\n content: "";\n }\n\n :host(.tooltip-s):after,\n :host(.tooltip-se):after,\n :host(.tooltip-sw):after {\n bottom: 100%\n }\n\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%;\n }\n\n @keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n :host(:popover-open),\n :host(:popover-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n }\n\n :host(.\\:popover-open) {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n }\n\n @media (forced-colors: active) {\n :host {\n outline: solid 1px transparent;\n }\n\n :host:before {\n display: none;\n }\n }\n '}get showReason(){return b(this,Ln,"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&&In(this)?this.hidePopover():t||In(this)||this.showPopover()}get hiddenFromView(){return!In(this)}connectedCallback(){if(Fn.add(this),b(this,vn,"m",Sn).call(this),b(this,vn,"m",xn).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,vn,"m",Tn).call(this,!1),v(this,An,!0,"f"),b(this,vn,"m",Cn).call(this)}disconnectedCallback(){Fn.delete(this),Rn.delete(this),b(this,wn,"f")?.abort()}async handleEvent(t){if(!this.control)return;const e=In(this);"beforetoggle"===t.type&&t.currentTarget!==this&&v(this,kn,"open"===t.newState,"f");const n=("mouseenter"===t.type||"focus"===t.type&&(navigator.webdriver||this.control.matches(":focus-visible")))&&!b(this,kn,"f"),i="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=i||s||o||r;e&&s&&(t.stopImmediatePropagation(),t.preventDefault()),await Promise.resolve(),e||!n||In(this)?e&&a&&In(this)&&this.hidePopover():(v(this,Ln,"mouseenter"===t.type?"mouse":"focus","f"),this.showPopover()),"toggle"===t.type&&b(this,vn,"m",Tn).call(this,"open"===t.newState)}attributeChangedCallback(t){this.isConnected&&("for"===t?b(this,vn,"m",Cn).call(this):"id"===t||"data-type"===t?b(this,vn,"m",Sn).call(this):"data-direction"===t&&b(this,vn,"m",xn).call(this))}}var qn,Wn;wn=new WeakMap,yn=new WeakMap,En=new WeakMap,An=new WeakMap,Ln=new WeakMap,kn=new WeakMap,vn=new WeakSet,Tn=function(t){t?(Rn.add(this),this.classList.remove(Dn),On(this),b(this,vn,"m",Mn).call(this)):(Rn.delete(this),this.classList.remove(...Pn),this.classList.add(Dn))},Cn=function(){if(!this.control)return;this.setAttribute("role","tooltip"),b(this,wn,"f")?.abort(),v(this,wn,new AbortController,"f");const{signal:t}=b(this,wn,"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",Hn),this.ownerDocument.addEventListener("focusin",Nn),this.ownerDocument.addEventListener("keydown",this,{signal:t,capture:!0})},Sn=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)}},xn=function(){this.classList.remove(...Pn);const t=this.direction;"n"===t?(v(this,yn,"center","f"),v(this,En,"outside-top","f")):"ne"===t?(v(this,yn,"end","f"),v(this,En,"outside-top","f")):"e"===t?(v(this,yn,"center","f"),v(this,En,"outside-right","f")):"se"===t?(v(this,yn,"end","f"),v(this,En,"outside-bottom","f")):"s"===t?(v(this,yn,"center","f"),v(this,En,"outside-bottom","f")):"sw"===t?(v(this,yn,"start","f"),v(this,En,"outside-bottom","f")):"w"===t?(v(this,yn,"center","f"),v(this,En,"outside-left","f")):"nw"===t&&(v(this,yn,"start","f"),v(this,En,"outside-top","f"))},Mn=function(){if(!this.control)return;if(!b(this,An,"f")||!In(this))return;const t=X(this,this.control,{side:b(this,En,"f"),align:b(this,yn,"f"),anchorOffset:0}),e=t.anchorSide,n=t.anchorAlign;this.style.setProperty("--tool-tip-position-top",`${t.top}px`),this.style.setProperty("--tool-tip-position-left",`${t.left}px`);let i="s";i="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===n?"n":"start"===n?"ne":"nw":"center"===n?"s":"start"===n?"se":"sw",this.classList.add(`tooltip-${i}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id","for"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let Vn=class XBannerElement extends HTMLElement{constructor(){super(...arguments),qn.add(this)}dismiss(){if("remove"===b(this,qn,"a",Wn)){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")}};qn=new WeakSet,Wn=function(){return this.getAttribute("data-dismiss-scheme")},g([U],Vn.prototype,"titleText",void 0),Vn=g([j],Vn),window.customElements.get("x-banner")||(window.XBannerElement=Vn,window.customElements.define("x-banner",Vn));class Bn{constructor(t,e,{tabInsertsSuggestions:n,defaultFirstOption:i}={}){this.input=t,this.list=e,this.tabInsertsSuggestions=null==n||n,this.defaultFirstOption=null!=i&&i,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":Un(e.input,e.list)&&t.preventDefault();break;case"Tab":e.tabInsertsSuggestions&&Un(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 n=document.getElementById(e.input.getAttribute("aria-controls")||"");if(!n)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",$n),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",$n)}indicateDefaultOption(){var t;this.defaultFirstOption&&(null===(t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(Kn)[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(Kn)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Kn),i=n.indexOf(e);if(i===n.length-1&&1===t||0===i&&-1===t)return this.clearSelection(),void this.input.focus();let s=1===t?0:n.length-1;if(e&&i>=0){const e=i+t;e>=0&&e<n.length&&(s=e)}const o=n[s];if(o)for(const t of n)t.removeAttribute("data-combobox-option-default"),o===t?(this.input.setAttribute("aria-activedescendant",o.id),o.setAttribute("aria-selected","true"),jn(this.list,o)):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 $n(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 Un(t,e){const n=e.querySelector('[aria-selected="true"], [data-combobox-option-default="true"]');return!!n&&("true"===n.getAttribute("aria-disabled")||n.click(),!0)}function Kn(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function jn(t,e){(function(t,e){const n=t.scrollTop,i=n+t.clientHeight,s=e.offsetTop,o=s+e.clientHeight;return s>=n&&o<=i})(t,e)||(t.scrollTop=e.offsetTop)}const zn=window.testScreenReaderDelay||100;class Yn{constructor(t,e,n,i=!1){var s;if(this.container=t,this.input=e,this.results=n,this.combobox=new Bn(e,n,{defaultFirstOption:i}),this.feedback=t.getRootNode().getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=i,this.clearButton=t.getRootNode().getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=n.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 n;return function(...i){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...i)}),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 n=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=n,n||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)}),zn)}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 n=new URL(e,window.location.href),i=new URLSearchParams(n.search.slice(1));i.append("q",t),n.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(n).then((t=>{this.results.innerHTML=t,this.identifyOptions(),this.combobox.indicateDefaultOption();const e=this.results.querySelectorAll('[role="option"]'),n=!!e.length||!!this.results.querySelectorAll('[data-no-result-found="true"]').length,i=e.length,[s]=e,o=null==s?void 0:s.textContent;this.autoselectEnabled&&o?this.updateFeedbackForScreenReaders(`${i} results. ${o} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${i||"No"} results.`),n?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 _n,Gn,Jn,Xn,Zn,Qn=function(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)},ti=function(t,e,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!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"===i?s.call(t,n):s?s.value=n:e.set(t,n),n},ei=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const ni=globalThis.HTMLElement||null;class ii extends Event{constructor(t,e){var{relatedTarget:n}=e;super(t,ei(e,["relatedTarget"])),this.relatedTarget=n}}const si=new WeakMap;let oi=null;class AutoCompleteElement extends ni{constructor(){super(...arguments),_n.add(this),Gn.set(this,null),Jn.set(this,null),Zn.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){oi=null===t?t:Promise.resolve(t)}get forElement(){var t;if(null===(t=Qn(this,Gn,"f"))||void 0===t?void 0:t.isConnected)return Qn(this,Gn,"f");const e=this.getAttribute("for"),n=this.getRootNode();return e&&(n instanceof Document||n instanceof ShadowRoot)?n.getElementById(e):null}set forElement(t){ti(this,Gn,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return(null===(t=Qn(this,Jn,"f"))||void 0===t?void 0:t.isConnected)?Qn(this,Jn,"f"):this.querySelector("input")}set inputElement(t){ti(this,Jn,t,"f"),Qn(this,_n,"m",Xn).call(this)}connectedCallback(){this.isConnected&&(Qn(this,_n,"m",Xn).call(this),new MutationObserver((()=>{si.get(this)||Qn(this,_n,"m",Xn).call(this)})).observe(this,{subtree:!0,childList:!0}))}disconnectedCallback(){const t=si.get(this);t&&(t.destroy(),si.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=Qn(this,Zn,"f"))||void 0===e||e.abort();const{signal:n}=ti(this,Zn,new AbortController,"f"),i=await fetch(t.toString(),{signal:n,headers:{Accept:"text/fragment+html"}});if(!i.ok)throw new Error(await i.text());if(oi){return(await oi).createHTML(await i.text(),i)}return await i.text()}static get observedAttributes(){return["open","value","for"]}attributeChangedCallback(t,e,n){var i,s;if(e===n)return;const o=si.get(this);if(o)switch(this.forElement===(null===(i=si.get(this))||void 0===i?void 0:i.results)&&this.inputElement===(null===(s=si.get(this))||void 0===s?void 0:s.input)||Qn(this,_n,"m",Xn).call(this),t){case"open":null===n?o.close():o.open();break;case"value":null!==n&&(o.input.value=n),this.dispatchEvent(new ii("auto-complete-change",{bubbles:!0,relatedTarget:o.input}))}}}Gn=new WeakMap,Jn=new WeakMap,Zn=new WeakMap,_n=new WeakSet,Xn=function(){var t;null===(t=si.get(this))||void 0===t||t.destroy();const{forElement:e,inputElement:n}=this;if(!e||!n)return;const i="true"===this.getAttribute("data-autoselect");si.set(this,new Yn(this,n,e,i)),e.setAttribute("role","listbox")};const ri="undefined"!=typeof globalThis?globalThis:window;try{ri.AutocompleteElement=ri.AutoCompleteElement=AutoCompleteElement.define()}catch(t){if(!(ri.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function ai(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 n=document.createRange();return n.selectNodeContents(t),e.addRange(n),document.execCommand("copy"),e.removeAllRanges(),Promise.resolve()}function li(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t);const e=document.body;if(!e)return Promise.reject(new Error);const n=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(n),ai(n),e.removeChild(n),Promise.resolve()}async function ci(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}var s;if("true"!==t.getAttribute("aria-disabled"))if(n)await li(n),i();else if(e){const n="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(n instanceof Document||"ShadowRoot"in window&&n instanceof ShadowRoot))return;const o=n.getElementById(e);o&&(await(s=o,s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement?li(s.value):s instanceof HTMLAnchorElement&&s.hasAttribute("href")?li(s.href):ai(s)),i())}}function di(t){const e=t.currentTarget;e instanceof HTMLElement&&ci(e)}function ui(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),ci(e))}}function hi(t){t.currentTarget.addEventListener("keydown",ui)}function mi(t){t.currentTarget.removeEventListener("keydown",ui)}class ClipboardCopyElement extends HTMLElement{static define(t="clipboard-copy",e=customElements){return e.define(t,this),this}constructor(){super(),this.addEventListener("click",di),this.addEventListener("focus",hi),this.addEventListener("blur",mi)}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 fi="undefined"!=typeof globalThis?globalThis:window;try{fi.ClipboardCopyElement=ClipboardCopyElement.define()}catch(t){if(!(fi.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function pi(t){t.style.display="inline-block"}function gi(t){t.style.display="none"}const bi=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=bi.get(t),n=t.parentNode?.querySelector("[data-clipboard-copy-feedback]"),i="Copied!";e?(clearTimeout(e),bi.delete(t)):(!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(gi(e),pi(n))}(t),n&&(n.textContent===i?n.textContent=`${i} `:n.textContent=i)),bi.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(pi(e),gi(n))}(t),bi.delete(t)}),2e3))}));var vi,wi=function(t,e,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!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"===i?s.call(t,n):s?s.value=n:e.set(t,n),n},yi=function(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)};const Ei="undefined"!=typeof Intl&&Intl.ListFormat||class{formatToParts(t){const e=[];for(const n of t)e.push({type:"element",value:n}),e.push({type:"literal",value:", "});return e.slice(0,-1)}},Ai=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],Li={minimumIntegerDigits:2};class ki{constructor(t,e={}){vi.set(this,void 0);let n=String(e.style||"short");"long"!==n&&"short"!==n&&"narrow"!==n&&"digital"!==n&&(n="short");let i="digital"===n?"numeric":n;const s=e.hours||i;i="2-digit"===s?"numeric":s;const o=e.minutes||i;i="2-digit"===o?"numeric":o;const r=e.seconds||i;i="2-digit"===r?"numeric":r;const a=e.milliseconds||i;wi(this,vi,{locale:t,style:n,years:e.years||"digital"===n?"short":n,yearsDisplay:"always"===e.yearsDisplay?"always":"auto",months:e.months||"digital"===n?"short":n,monthsDisplay:"always"===e.monthsDisplay?"always":"auto",weeks:e.weeks||"digital"===n?"short":n,weeksDisplay:"always"===e.weeksDisplay?"always":"auto",days:e.days||"digital"===n?"short":n,daysDisplay:"always"===e.daysDisplay?"always":"auto",hours:s,hoursDisplay:"always"===e.hoursDisplay||"digital"===n?"always":"auto",minutes:o,minutesDisplay:"always"===e.minutesDisplay||"digital"===n?"always":"auto",seconds:r,secondsDisplay:"always"===e.secondsDisplay||"digital"===n?"always":"auto",milliseconds:a,millisecondsDisplay:"always"===e.millisecondsDisplay?"always":"auto"},"f")}resolvedOptions(){return yi(this,vi,"f")}formatToParts(t){const e=[],n=yi(this,vi,"f"),i=n.style,s=n.locale;for(const[i,o]of Ai){const r=t[i];if("auto"===n[`${i}Display`]&&!r)continue;const a=n[i],l="2-digit"===a?Li:"numeric"===a?{}:{style:"unit",unit:o,unitDisplay:a};e.push(new Intl.NumberFormat(s,l).format(r))}return new Ei(s,{type:"unit",style:"digital"===i?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map((t=>t.value)).join("")}}vi=new WeakMap;const Ti=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,Ci=["year","month","week","day","hour","minute","second","millisecond"];class Si{constructor(t=0,e=0,n=0,i=0,s=0,o=0,r=0,a=0){this.years=t,this.months=e,this.weeks=n,this.days=i,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 Si(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 n=String(t).trim(),i=n.startsWith("-")?-1:1,s=null===(e=n.match(Ti))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return s?new Si(...s):new Si}if("object"==typeof t){const{years:e,months:n,weeks:i,days:s,hours:o,minutes:r,seconds:a,milliseconds:l}=t;return new Si(e,n,i,s,o,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const n=Date.now(),i=Math.abs(xi(n,Si.from(t)).getTime()-n),s=Math.abs(xi(n,Si.from(e)).getTime()-n);return i>s?-1:i<s?1:0}toLocaleString(t,e){return new ki(t,e).format(this)}}function xi(t,e){const n=new Date(t);return e.sign<0?(n.setUTCSeconds(n.getUTCSeconds()+e.seconds),n.setUTCMinutes(n.getUTCMinutes()+e.minutes),n.setUTCHours(n.getUTCHours()+e.hours),n.setUTCDate(n.getUTCDate()+7*e.weeks+e.days),n.setUTCMonth(n.getUTCMonth()+e.months),n.setUTCFullYear(n.getUTCFullYear()+e.years)):(n.setUTCFullYear(n.getUTCFullYear()+e.years),n.setUTCMonth(n.getUTCMonth()+e.months),n.setUTCDate(n.getUTCDate()+7*e.weeks+e.days),n.setUTCHours(n.getUTCHours()+e.hours),n.setUTCMinutes(n.getUTCMinutes()+e.minutes),n.setUTCSeconds(n.getUTCSeconds()+e.seconds)),n}function Mi(t,{relativeTo:e=Date.now()}={}){if(e=new Date(e),t.blank)return t;const n=t.sign;let i=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||i)&&(d=0),c>=55&&(l+=Math.round(c/60)),(l||a||r||o||s||i)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||r||o||s||i)&&(l=0),r&&a>=12&&(r+=Math.round(a/24)),!r&&a>=21&&(r+=Math.round(a/24)),(r||o||s||i)&&(a=0);const u=e.getFullYear(),h=e.getMonth(),m=e.getDate();if(r>=27||i+s+r){const t=new Date(e);t.setDate(1),t.setMonth(h+s*n+1),t.setDate(0);const a=Math.max(0,m-t.getDate()),l=new Date(e);l.setFullYear(u+i*n),l.setDate(m-a),l.setMonth(h+s*n),l.setDate(m-a+r*n);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=i=0):p<=11?(s=p,i=0):(s=0,i=c*n),(s||i)&&(r=0)}return i&&(s=0),o>=4&&(s+=Math.round(o/4)),(s||i)&&(o=0),r&&o&&!s&&!i&&(o+=Math.round(r/7),r=0),new Si(i*n,s*n,o*n,r*n,a*n,l*n,c*n,d*n)}var Ii,Di,Pi,Oi,Hi,Ni,Fi,Ri,qi,Wi,Vi,Bi,$i=function(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)},Ui=function(t,e,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!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"===i?s.call(t,n):s?s.value=n:e.set(t,n),n};const Ki=globalThis.HTMLElement||null,ji=new Si,zi=new Si(0,0,0,0,0,1);class Yi extends Event{constructor(t,e,n,i){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=n,this.newTitle=i}}function _i(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 Gi=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=_i(t),n=Date.now()+e;n<this.time&&(clearTimeout(this.timer),this.timer=setTimeout((()=>this.update()),e),this.time=n)}}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,_i(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends Ki{constructor(){super(...arguments),Ii.add(this),Di.set(this,!1),Pi.set(this,!1),Hi.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),Bi.set(this,null)}static define(t="relative-time",e=customElements){return e.define(t,this),this}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"]}get onRelativeTimeUpdated(){return $i(this,Bi,"f")}set onRelativeTimeUpdated(t){$i(this,Bi,"f")&&this.removeEventListener("relative-time-updated",$i(this,Bi,"f")),Ui(this,Bi,"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,Ti.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 Ci.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(){Gi.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&Ui(this,Di,null!==n&&(this.date&&$i(this,Ii,"m",Ni).call(this,this.date))!==n,"f"),$i(this,Pi,"f")||"title"===t&&$i(this,Di,"f")||Ui(this,Pi,(async()=>{await Promise.resolve(),this.update(),Ui(this,Pi,!1,"f")})(),"f"))}update(){const t=$i(this,Hi,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let n=e;const i=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!i)return void($i(this,Hi,"f").textContent=t);const s=Date.now();$i(this,Di,"f")||(n=$i(this,Ii,"m",Ni).call(this,i)||"",n&&!this.noTitle&&this.setAttribute("title",n));const o=function(t,e="second",n=Date.now()){const i=t.getTime()-n;if(0===i)return new Si;const s=Math.sign(i),o=Math.abs(i),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),u=Math.floor(d/12),h=Ci.indexOf(e)||Ci.length;return new Si(h>=0?u*s:0,h>=1?(d-12*u)*s:0,0,h>=3?(c-30*d)*s:0,h>=4?(l-24*c)*s:0,h>=5?(a-60*l)*s:0,h>=6?(r-60*a)*s:0,h>=7?(o-1e3*r)*s:0)}(i,this.precision,s),r=$i(this,Ii,"m",Fi).call(this,o);let a=t;a="duration"===r?$i(this,Ii,"m",Ri).call(this,o):"relative"===r?$i(this,Ii,"m",qi).call(this,o):$i(this,Ii,"m",Wi).call(this,i),a?$i(this,Ii,"m",Vi).call(this,a):this.shadowRoot===$i(this,Hi,"f")&&this.textContent&&$i(this,Ii,"m",Vi).call(this,this.textContent),a===t&&n===e||this.dispatchEvent(new Yi(t,a,e,n)),"relative"===r||"duration"===r?Gi.observe(this):Gi.unobserve(this)}}Di=new WeakMap,Pi=new WeakMap,Hi=new WeakMap,Bi=new WeakMap,Ii=new WeakSet,Oi=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"}},Ni=function(t){return new Intl.DateTimeFormat($i(this,Ii,"a",Oi),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},Fi=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===Si.compare(t,this.threshold))return"relative"}return"datetime"},Ri=function(t){const e=$i(this,Ii,"a",Oi),n=this.format,i=this.formatStyle,s=this.tense;let o=ji;"micro"===n?(t=Mi(t),o=zi,("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=zi)):("past"===s&&-1!==t.sign||"future"===s&&1!==t.sign)&&(t=o);const r=`${this.precision}sDisplay`;return t.blank?o.toLocaleString(e,{style:i,[r]:"always"}):t.abs().toLocaleString(e,{style:i})},qi=function(t){const e=new Intl.RelativeTimeFormat($i(this,Ii,"a",Oi),{numeric:"auto",style:this.formatStyle}),n=this.tense;"future"===n&&1!==t.sign&&(t=ji),"past"===n&&-1!==t.sign&&(t=ji);const[i,s]=function(t,e){const n=Mi(t,e);if(n.blank)return[0,"second"];for(const t of Ci){if("millisecond"===t)continue;const e=n[`${t}s`];if(e)return[e,t]}return[0,"second"]}(t);return"second"===s&&i<10?e.format(0,"millisecond"===this.precision?"second":this.precision):e.format(i,s)},Wi=function(t){const e=new Intl.DateTimeFormat($i(this,Ii,"a",Oi),{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName});return`${this.prefix} ${e.format(t)}`.trim()},Vi=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,$i(this,Hi,"f").replaceChildren(e)}else $i(this,Hi,"f").textContent=t};const Ji="undefined"!=typeof globalThis?globalThis:window;try{Ji.RelativeTimeElement=RelativeTimeElement.define()}catch(t){if(!(Ji.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function Xi(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{static define(t="tab-container",e=customElements){return e.define(t,this),this}connectedCallback(){this.addEventListener("keydown",(t=>{var e;const n=t.target;if(!(n instanceof HTMLElement))return;if(n.closest(this.tagName)!==this)return;if("tab"!==n.getAttribute("role")&&!n.closest('[role="tablist"]'))return;const i=Xi(this),s=i.indexOf(i.find((t=>t.matches('[aria-selected="true"]')))),[o,r]="vertical"===(null===(e=n.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>=i.length&&(t=0),this.selectTab(t)}else if(r.some((e=>t.code===e))){let t=s-1;t<0&&(t=i.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(i.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=Xi(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const n=t.target.closest('[role="tab"]');if(!(n instanceof HTMLElement&&n.closest('[role="tablist"]')))return;const i=e.indexOf(n);this.selectTab(i)}));for(const t of Xi(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=Xi(this),n=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 i=e[t],s=n[t];if(!!this.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:s}}))){for(const t of e)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of n)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");i.setAttribute("aria-selected","true"),i.setAttribute("tabindex","0"),i.focus(),s.hidden=!1,this.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:s}}))}}}const Zi="undefined"!=typeof globalThis?globalThis:window;try{Zi.TabContainerElement=TabContainerElement.define()}catch(t){if(!(Zi.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}let Qi=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 ts(t,e=0,{start:n=!1,middle:i=!1,once:s=!1}={}){return function(t,e=0,{start:n=!0,middle:i=!0,once:s=!1}={}){let o,r=0,a=!1;function l(...c){if(a)return;const d=Date.now()-r;r=Date.now(),n?(n=!1,t.apply(this,c),s&&l.cancel()):(i&&d<e||!i)&&(clearTimeout(o),o=setTimeout((()=>{r=Date.now(),t.apply(this,c),s&&l.cancel()}),i?e-d:e))}return l.cancel=()=>{clearTimeout(o),a=!0},l}(t,e,{start:n,middle:i,once:s})}g([K],Qi.prototype,"fields",void 0),Qi=g([j],Qi),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:Qi}),window.customElements.define("primer-multi-input",Qi));var es,ns,is=function(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)},ss=function(t,e,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!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"===i?s.call(t,n):s?s.value=n:e.set(t,n),n};!function(t){t.GET="GET",t.POST="POST"}(ns||(ns={}));const os=new WeakMap;class rs extends Event{constructor(t){super(`auto-check-${t}`,{bubbles:!0}),this.phase=t}get detail(){return this}}class as extends rs{constructor(t,e=""){super(t),this.phase=t,this.message=e,this.setValidity=t=>{this.message=t}}}class ls extends rs{constructor(){super("complete")}}class cs extends rs{constructor(t){super("success"),this.response=t}}class ds extends as{constructor(){super("start","Verifying…")}}class us extends as{constructor(t){super("error","Validation failed"),this.response=t}}class hs extends rs{constructor(t){super("send"),this.body=t}}class AutoCheckElement extends HTMLElement{constructor(){super(...arguments),es.set(this,null)}static define(t="auto-check",e=customElements){return e.define(t,this),this}get onloadend(){return is(this,es,"f")}set onloadend(t){is(this,es,"f")&&this.removeEventListener("loadend",is(this,es,"f")),ss(this,es,"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=ts(ps.bind(null,this),300),n={check:e,controller:null};os.set(this,n);const i=ms.bind(null,e);t.addEventListener("blur",i),t.addEventListener("input",i),t.addEventListener("triggervalidation",i),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=os.get(this);e&&(os.delete(this),t.removeEventListener("input",fs),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 ns[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 n=e.currentTarget;if(!(n instanceof HTMLInputElement))return;const i=n.closest("auto-check");i instanceof AutoCheckElement&&("input"===e.type&&i.setAttribute("dirty",""),0!==n.value.length&&("blur"===e.type&&!i.validateOnKeystroke&&i.hasAttribute("dirty")||"input"===e.type&&i.validateOnKeystroke||"triggervalidation"===e.type)&&(fs(e),t()))}function fs(t){const e=t.currentTarget;if(!(e instanceof HTMLInputElement))return;const n=e.closest("auto-check");if(!(n instanceof AutoCheckElement))return;const i=n.src,s=n.csrf,o=n.httpMethod,r=os.get(n);if(!i||"POST"===o&&!s||!r)return;const a=new ds;e.dispatchEvent(a),n.required&&e.setCustomValidity(a.message)}async function ps(t){const e=t.input;if(!e)return;const n=t.csrfField,i=t.src,s=t.csrf,o=os.get(t),r=t.httpMethod;if(!i||"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(i,window.location.origin);"POST"===r?(a.append(n,s),a.append("value",e.value)):l.search=new URLSearchParams({value:e.value}).toString(),e.dispatchEvent(new hs(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 n=await async function(t,e,n){"GET"===n.method&&delete n.body;try{const i=await fetch(e,n);return t.dispatchEvent(new Event("load")),t.dispatchEvent(new Event("loadend")),i}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(n.ok)t.required&&e.setCustomValidity(""),t.validateOnKeystroke=!1,e.dispatchEvent(new cs(n.clone()));else{t.validateOnKeystroke=!0;const i=new us(n.clone());e.dispatchEvent(i),t.required&&e.setCustomValidity(i.message)}o.controller=null,e.dispatchEvent(new ls)}catch(t){"AbortError"!==t.name&&(o.controller=null,e.dispatchEvent(new ls))}}es=new WeakMap;const gs="undefined"!=typeof globalThis?globalThis:window;try{gs.AutoCheckElement=AutoCheckElement.define()}catch(t){if(!(gs.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}class bs{constructor(t,e,n){this.inputElement=t,this.characterLimitElement=e,this.characterLimitSrElement=n,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 n="";if(e>=0){n=`${e} ${this.pluralize(e,"character")} remaining`;const t=this.characterLimitElement.querySelector(".FormControl-caption-text");t&&(t.textContent=n),this.clearError()}else{const t=-e;n=`${t} ${this.pluralize(t,"character")} over`;const i=this.characterLimitElement.querySelector(".FormControl-caption-text");i&&(i.textContent=n),this.setError()}this.isInitialLoad||this.announceToScreenReader(n)}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 vs,ws;let ys=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),vs.set(this,void 0),ws.set(this,null)}connectedCallback(){b(this,vs,"f")?.abort();const{signal:t}=v(this,vs,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,ws,new bs(this.inputElement,this.characterLimitElement,this.characterLimitSrElement),"f"),b(this,ws,"f").initialize(t))}disconnectedCallback(){b(this,vs,"f")?.abort(),b(this,ws,"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 n=document.importNode(e.content,!0);this.validationMessageElement.replaceChildren(n)}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 Es;vs=new WeakMap,ws=new WeakMap,g([U],ys.prototype,"inputElement",void 0),g([U],ys.prototype,"validationElement",void 0),g([U],ys.prototype,"validationMessageElement",void 0),g([U],ys.prototype,"validationSuccessIcon",void 0),g([U],ys.prototype,"validationErrorIcon",void 0),g([U],ys.prototype,"leadingVisual",void 0),g([U],ys.prototype,"leadingSpinner",void 0),g([U],ys.prototype,"characterLimitElement",void 0),g([U],ys.prototype,"characterLimitSrElement",void 0),ys=g([j],ys);let As=class PrimerTextAreaElement extends HTMLElement{constructor(){super(...arguments),Es.set(this,null)}connectedCallback(){this.characterLimitElement&&(v(this,Es,new bs(this.inputElement,this.characterLimitElement,this.characterLimitSrElement),"f"),b(this,Es,"f").initialize())}disconnectedCallback(){b(this,Es,"f")?.cleanup()}};Es=new WeakMap,g([U],As.prototype,"inputElement",void 0),g([U],As.prototype,"characterLimitElement",void 0),g([U],As.prototype,"characterLimitSrElement",void 0),As=g([j],As),window.customElements.get("primer-text-area")||(Object.assign(window,{PrimerTextAreaElement:As}),window.customElements.define("primer-text-area",As));let Ls=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 ks,Ts,Cs,Ss,xs,Ms,Is,Ds,Ps,Os,Hs,Ns,Fs,Rs,qs,Ws,Vs,Bs,$s,Us,Ks;g([U],Ls.prototype,"validationElement",void 0),g([U],Ls.prototype,"validationMessageElement",void 0),Ls=g([j],Ls);const js=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]'],zs=js.map((t=>`:not([hidden]) > ${t}`));let Ys=class ActionMenuElement extends HTMLElement{constructor(){super(...arguments),ks.add(this),Ts.set(this,void 0),Cs.set(this,""),Ss.set(this,""),xs.set(this,!1),Ms.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 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 n of t){const t=n.querySelector(".ActionListItem-label");e.push({label:t?.textContent,value:n?.getAttribute("data-value"),element:n})}return e}connectedCallback(){const{signal:t}=v(this,Ts,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.popoverElement?.addEventListener("toggle",this,{signal:t}),b(this,ks,"m",$s).call(this),b(this,ks,"m",Us).call(this),b(this,ks,"m",Is).call(this),this.includeFragment&&this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t});const e=()=>{b(this,ks,"m",Bs).call(this)&&this.overlay?.update()};v(this,Ms,new IntersectionObserver((t=>{for(const n of t){n.target===this.invokerElement&&(n.isIntersecting?window.addEventListener("scroll",e,{capture:!0}):window.removeEventListener("scroll",e,{capture:!0}))}})),"f"),Ke(this,(()=>Boolean(this.invokerElement)),(()=>b(this,Ms,"f").observe(this.invokerElement))),this.includeFragment||this.setAttribute("data-ready","true")}disconnectedCallback(){b(this,Ts,"f").abort()}handleEvent(t){const e=this.invokerElement?.contains(t.target),n=b(this,ks,"m",Os).call(this,t);if("toggle"===t.type&&"open"===t.newState&&window.requestAnimationFrame((()=>{b(this,ks,"a",Ks)?.focus()})),e&&"mousedown"===t.type)return void v(this,xs,!0,"f");if("mousedown"===t.type)return void t.preventDefault();if(e&&n)return b(this,ks,"m",Hs).call(this,t),void v(this,xs,!1,"f");if("focusout"===t.type){if(b(this,xs,"f"))return;return void requestAnimationFrame((()=>{this.contains(document.activeElement)&&document.activeElement!==this.invokerElement||b(this,ks,"m",qs).call(this)}))}const i=t.target.closest(zs.join(","));if(null!==i&&n){if(b(this,ks,"m",Ds).call(this,t))return;const e=i.closest("[data-show-dialog-id]");if(e){const n=this.ownerDocument.getElementById(e.getAttribute("data-show-dialog-id")||"");if(n&&this.contains(e))return void b(this,ks,"m",Ns).call(this,t,n)}return b(this,ks,"m",Ps).call(this,t)&&(t.preventDefault(),i.click()),void b(this,ks,"m",Fs).call(this,i)}"include-fragment-replaced"===t.type&&b(this,ks,"m",Rs).call(this)}get items(){return Array.from(this.querySelectorAll(zs.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,ks,"m",Fs).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,ks,"m",Fs).call(this,e)}}};Ts=new WeakMap,Cs=new WeakMap,Ss=new WeakMap,xs=new WeakMap,Ms=new WeakMap,ks=new WeakSet,Is=function(){const{signal:t}=b(this,Ts,"f");for(const e of this.querySelectorAll(js.join(",")))e.addEventListener("click",b(this,ks,"m",Ds).bind(this),{signal:t}),e.addEventListener("keydown",b(this,ks,"m",Ds).bind(this),{signal:t})},Ds=function(t){if(!b(this,ks,"m",Os).call(this,t))return!1;const e=t.target.closest(zs.join(","));return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},Ps=function(t){return t.target instanceof HTMLAnchorElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},Os=function(t){return t instanceof MouseEvent&&"click"===t.type||b(this,ks,"m",Ps).call(this,t)},Hs=function(t){t.preventDefault(),t.stopPropagation(),b(this,ks,"m",Bs).call(this)?b(this,ks,"m",Vs).call(this):b(this,ks,"m",Ws).call(this)},Ns=function(t,e){this.contains(e)&&(this.querySelector(".ActionListWrap").style.display="none");const n=new AbortController,{signal:i}=n,s=()=>{n.abort(),this.contains(e)&&(this.querySelector(".ActionListWrap").style.display="",b(this,ks,"m",Bs).call(this)&&b(this,ks,"m",Vs).call(this));const t=this.ownerDocument.activeElement,i=this.ownerDocument.activeElement===this.ownerDocument.body,s=this.contains(t),o=e.contains(t);(i||s||o)&&setTimeout((()=>{const e=this.ownerDocument.activeElement;e!==t&&e!==this.ownerDocument.body||this.invokerElement?.focus()}),0)};e.addEventListener("close",s,{signal:i}),e.addEventListener("cancel",s,{signal:i})},Fs=function(t){if("multiple"!==this.selectVariant&&setTimeout((()=>{b(this,ks,"m",Bs).call(this)&&b(this,ks,"m",Vs).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,ks,"m",$s).call(this)}else t.setAttribute("aria-checked",`${e}`);b(this,ks,"m",Us).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:t.parentElement,checked:this.isItemChecked(t.parentElement)}}))},Rs=function(){b(this,ks,"a",Ks)?.focus(),b(this,ks,"m",Is).call(this),this.setAttribute("data-ready","true")},qs=function(){b(this,ks,"m",Vs).call(this)},Ws=function(){this.popoverElement?.showPopover()},Vs=function(){this.popoverElement?.hidePopover()},Bs=function(){return this.popoverElement?.matches(":popover-open")},$s=function(){if("single"!==this.selectVariant)return;if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;v(this,Cs,b(this,Cs,"f")||t.textContent||"","f");const e=this.querySelector("[aria-checked=true] .ActionListItem-label");if(e&&this.dynamicLabel){const n=document.createElement("span");n.classList.add("color-fg-muted");const i=document.createElement("span");n.textContent=this.dynamicLabelPrefix,i.textContent=e.textContent||"",t.replaceChildren(n,i)}else t.textContent=b(this,Cs,"f")},Us=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,Ss,b(this,Ss,"f")||e[0].name,"f");for(const e of this.selectedItems){const n=document.createElement("input");n.setAttribute("data-list-input","true"),n.type="hidden",n.autocomplete="off",n.name=b(this,Ss,"f"),n.value=(e.value||e.label||"").trim(),t.append(n)}for(const t of e)t.remove()}},Ks=function(){return this.querySelector(zs.join(","))},g([U],Ys.prototype,"includeFragment",void 0),g([U],Ys.prototype,"overlay",void 0),Ys=g([j],Ys),window.customElements.get("action-menu")||(window.ActionMenuElement=Ys,window.customElements.define("action-menu",Ys));const _s="less",Gs="equal",Js="greater";var Xs,Zs,Qs,to,eo,no=t=>{throw TypeError(t)},io=(t,e,n)=>e.has(t)||no("Cannot "+n),so=(t,e,n)=>(io(t,e,"read from private field"),n?n.call(t):e.get(t)),oo=(t,e,n)=>e.has(t)?no("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ro=(t,e,n,i)=>(io(t,e,"write to private field"),e.set(t,n),n),ao=(t,e,n)=>(io(t,e,"access private method"),n);class lo{constructor({compareFn:t}){oo(this,Qs),oo(this,Xs),oo(this,Zs),ro(this,Xs,t),ro(this,Zs,[])}insert(t){so(this,Zs).push(t),ao(this,Qs,eo).call(this)}pop(){const t=so(this,Zs)[0];return so(this,Zs)[so(this,Zs).length-1]&&(so(this,Zs)[0]=so(this,Zs)[so(this,Zs).length-1],so(this,Zs).pop()),ao(this,Qs,to).call(this),t}peek(){return so(this,Zs)[0]}delete(t){const e=so(this,Zs).indexOf(t);-1!==e&&(wo(so(this,Zs),e,so(this,Zs).length-1),so(this,Zs).pop(),ao(this,Qs,to).call(this))}clear(){ro(this,Zs,[])}get size(){return so(this,Zs).length}}function co(t){return 2*t+1}function uo(t){return 2*t+2}function ho(t){return Math.floor((t-1)/2)}function mo(t,e){return co(t)<e}function fo(t,e){return uo(t)<e}function po(t){return t>0}function go(t,e){return t[co(e)]}function bo(t,e){return t[uo(e)]}function vo(t,e){return t[ho(e)]}function wo(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}Xs=new WeakMap,Zs=new WeakMap,Qs=new WeakSet,to=function(){let t=0;for(;mo(t,so(this,Zs).length);){let e=co(t);if(fo(t,so(this,Zs).length)&&so(this,Xs).call(this,bo(so(this,Zs),t),go(so(this,Zs),t))===_s&&(e=uo(t)),so(this,Xs).call(this,so(this,Zs)[t],so(this,Zs)[e])===_s)break;wo(so(this,Zs),t,e),t=e}},eo=function(){let t=so(this,Zs).length-1;for(;po(t)&&so(this,Xs).call(this,so(this,Zs)[t],vo(so(this,Zs),t))===_s;)wo(so(this,Zs),t,ho(t)),t=ho(t)};var yo,Eo,Ao,Lo,ko=Object.defineProperty,To=t=>{throw TypeError(t)},Co=(t,e,n)=>((t,e,n)=>e in t?ko(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n),So=(t,e,n)=>e.has(t)||To("Cannot "+n),xo=(t,e,n)=>(So(t,e,"read from private field"),n?n.call(t):e.get(t)),Mo=(t,e,n)=>e.has(t)?To("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Io=(t,e,n,i)=>(So(t,e,"write to private field"),e.set(t,n),n);yo=Symbol.toStringTag;class Do{constructor(){Co(this,yo,"Deferred"),Mo(this,Eo),Mo(this,Ao),Mo(this,Lo),Io(this,Eo,new Promise(((t,e)=>{Io(this,Ao,t),Io(this,Lo,e)})))}then(t,e){return Promise.prototype.then.apply(xo(this,Eo),[t,e])}catch(t){return Promise.prototype.catch.apply(xo(this,Eo),[t])}finally(t){return Promise.prototype.finally.apply(xo(this,Eo),[t])}resolve(t){xo(this,Ao).call(this,t)}reject(t){xo(this,Lo).call(this,t)}getPromise(){return xo(this,Eo)}}Eo=new WeakMap,Ao=new WeakMap,Lo=new WeakMap;var Po,Oo,Ho,No,Fo,Ro,qo=t=>{throw TypeError(t)},Wo=(t,e,n)=>e.has(t)||qo("Cannot "+n),Vo=(t,e,n)=>(Wo(t,e,"read from private field"),n?n.call(t):e.get(t)),Bo=(t,e,n)=>e.has(t)?qo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),$o=(t,e,n,i)=>(Wo(t,e,"write to private field"),e.set(t,n),n),Uo=(t,e,n)=>(Wo(t,e,"access private method"),n);class LiveRegionElement extends HTMLElement{constructor(){if(super(),Bo(this,No),Bo(this,Po),Bo(this,Oo),Bo(this,Ho),!this.shadowRoot){const t=function(){if(Ko)return Ko;return Ko=document.createElement("template"),Ko.innerHTML=jo,Ko}();this.attachShadow({mode:"open"}).appendChild(t.content.cloneNode(!0))}$o(this,Po,!1),$o(this,Ho,null),$o(this,Oo,new lo({compareFn:zo}))}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:n,politeness:i="polite"}=e,s=Date.now(),o=new Do,r={deferred:o,politeness:i,contents:t,scheduled:void 0!==n?s+n:s};return Vo(this,Oo).insert(r),Uo(this,No,Fo).call(this),{...o.getPromise(),cancel:()=>{Vo(this,Oo).delete(r),o.resolve()}}}announceFromElement(t,e){const n=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(""!==n)return this.announce(n,e);return{...Promise.resolve(),cancel:Yo}}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!==Vo(this,Ho)&&(clearTimeout(Vo(this,Ho)),$o(this,Ho,null)),$o(this,Po,!1),Vo(this,Oo).clear()}}Po=new WeakMap,Oo=new WeakMap,Ho=new WeakMap,No=new WeakSet,Fo=function(){if(Vo(this,Po))return;let t=Vo(this,Oo).peek();if(!t)return;null!==Vo(this,Ho)&&(clearTimeout(Vo(this,Ho)),$o(this,Ho,null));const e=Date.now();if(t.scheduled<=e)return t=Vo(this,Oo).pop(),t&&Uo(this,No,Ro).call(this,t),void Uo(this,No,Fo).call(this);const n=t.scheduled-e;$o(this,Ho,window.setTimeout((()=>{$o(this,Ho,null),Uo(this,No,Fo).call(this)}),n))},Ro=function(t){$o(this,Po,!0);const{contents:e,deferred:n,politeness:i}=t,s=this.shadowRoot?.getElementById(i);if(!s)throw $o(this,Po,!1),new Error(`Unable to find container for message. Expected a container with id="${i}"`);s.textContent===e?s.textContent=`${e} `:s.textContent=e,null!==Vo(this,Ho)&&clearTimeout(Vo(this,Ho)),n.resolve(),this.delay>0?$o(this,Ho,window.setTimeout((()=>{$o(this,Ho,null),$o(this,Po,!1),Uo(this,No,Fo).call(this)}),this.delay)):($o(this,Ho,null),$o(this,Po,!1),Uo(this,No,Fo).call(this))};let Ko=null;const jo='\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 zo(t,e){return t.politeness===e.politeness?t.scheduled===e.scheduled?Gs:t.scheduled<e.scheduled?_s:Js:"assertive"===t.politeness&&"assertive"!==e.politeness?_s:"assertive"!==t.politeness&&"assertive"===e.politeness?Js:Gs}function Yo(){}var _o,Go,Jo,Xo,Zo,Qo,tr,er,nr,ir,sr,or,rr,ar,lr,cr,dr,ur,hr,mr,fr,pr,gr,br,vr,wr,yr,Er,Ar,Lr,kr,Tr,Cr,Sr,xr,Mr,Ir,Dr,Pr,Or;customElements.get("live-region")||customElements.define("live-region",LiveRegionElement);const Hr=['[role="option"]'],Nr=Hr.join(","),Fr=Hr.map((t=>`:not([hidden]) > ${t}`)).join(",");var Rr,qr;!function(t){t[t.REMOTE=0]="REMOTE",t[t.EVENTUALLY_LOCAL=1]="EVENTUALLY_LOCAL",t[t.LOCAL=2]="LOCAL"}(Rr||(Rr={})),function(t){t[t.BODY=0]="BODY",t[t.BANNER=1]="BANNER"}(qr||(qr={}));const Wr=(()=>{const t=new Set;let e=null;function n(){for(const e of t)e.updateAnchorPosition()}return i=>{window.addEventListener("resize",n),window.addEventListener("scroll",n),e||(e=new ResizeObserver((()=>{for(const e of t)e.updateAnchorPosition()}))),e.observe(i.ownerDocument.documentElement),i.addEventListener("dialog:close",(()=>{i.invokerElement?.setAttribute("aria-expanded","false"),t.delete(i)})),i.addEventListener("dialog:open",(()=>{t.add(i)}))}})();let Vr=class SelectPanelElement extends HTMLElement{constructor(){super(...arguments),_o.add(this),Go.set(this,void 0),Jo.set(this,void 0),Xo.set(this,""),Zo.set(this,""),Qo.set(this,new Map),tr.set(this,null),er.set(this,null),nr.set(this,!1)}get open(){return this.dialog.open}get selectVariant(){return this.getAttribute("data-select-variant")}get ariaSelectionType(){return"multiple"===this.selectVariant?"aria-checked":"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,Qo,"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=`${t}px`,this.dialog.style.left=`${e}px`,this.dialog.style.bottom="auto",this.dialog.style.right="auto"}}connectedCallback(){const{signal:t}=v(this,Jo,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,_o,"m",xr).call(this),b(this,_o,"m",Mr).call(this),b(this,_o,"m",ir).call(this),Wr(this),Ke(this,(()=>Boolean(this.remoteInput)),(()=>{this.remoteInput.addEventListener("loadstart",this,{signal:t}),this.remoteInput.addEventListener("loadend",this,{signal:t})})),Ke(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,Go,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,_o,"a",Ar)===Rr.LOCAL&&b(this,_o,"m",br).call(this))}})),"f"),Ke(this,(()=>Boolean(this.dialog)),(()=>{b(this,Go,"f").observe(this.dialog),this.dialog.addEventListener("close",this,{signal:t}),"true"===this.getAttribute("data-open-on-load")&&this.show()})),b(this,_o,"a",Ar)===Rr.LOCAL&&Ke(this,(()=>this.items.length>0),(()=>{b(this,_o,"m",br).call(this),b(this,_o,"m",Mr).call(this)}))}disconnectedCallback(){b(this,Jo,"f").abort()}handleEvent(t){if(t.target===this.filterInputTextField)return void b(this,_o,"m",gr).call(this,t);if(t.target===this.remoteInput)return void b(this,_o,"m",fr).call(this,t);const e=this.invokerElement?.contains(t.target),n=this.closeButton?.contains(t.target),i=b(this,_o,"m",ar).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&&i)return void b(this,_o,"m",Tr).call(this,t);if(n&&i)return;if("keydown"===t.type&&t instanceof KeyboardEvent&&t.target.closest(Fr)){const e=t.ctrlKey||t.altKey||t.metaKey,n=1===t.key.length&&/[a-z\d]/i.test(t.key);!e&&n&&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(Fr)?.parentElement;if(null!=s&&i){if(b(this,_o,"m",or).call(this,t))return;const e=s.closest("[data-show-dialog-id]");if(e){const n=this.ownerDocument.getElementById(e.getAttribute("data-show-dialog-id")||"");if(n&&this.contains(e)&&this.contains(n))return void b(this,_o,"m",Cr).call(this,t,n)}return b(this,_o,"m",rr).call(this,t)&&(t.preventDefault(),b(this,_o,"m",Or).call(this,s)?.click()),void b(this,_o,"m",Sr).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,_o,"m",hr).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(Fr)).map((t=>t.parentElement))}get items(){return Array.from(this.querySelectorAll(Nr)).map((t=>t.parentElement))}get focusableItem(){for(const t of this.items){const e=b(this,_o,"m",Or).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,_o,"m",Or).call(this,t).setAttribute("aria-disabled","true"))}enableItem(t){t&&(t.classList.remove("ActionListItem--disabled"),b(this,_o,"m",Or).call(this,t).removeAttribute("aria-disabled"))}isItemHidden(t){return!!t&&t.hasAttribute("hidden")}isItemChecked(t){return!!t&&"true"===b(this,_o,"m",Or).call(this,t).getAttribute(this.ariaSelectionType)}checkItem(t){!t||"single"!==this.selectVariant&&"multiple"!==this.selectVariant||this.isItemChecked(t)||b(this,_o,"m",Sr).call(this,t)}uncheckItem(t){!t||"single"!==this.selectVariant&&"multiple"!==this.selectVariant||this.isItemChecked(t)&&b(this,_o,"m",Sr).call(this,t)}};Go=new WeakMap,Jo=new WeakMap,Xo=new WeakMap,Zo=new WeakMap,Qo=new WeakMap,tr=new WeakMap,er=new WeakMap,nr=new WeakMap,_o=new WeakSet,ir=function(){const{signal:t}=b(this,Jo,"f");for(const e of this.querySelectorAll(Hr.join(",")))e.addEventListener("click",b(this,_o,"m",or).bind(this),{signal:t}),e.addEventListener("keydown",b(this,_o,"m",or).bind(this),{signal:t})},sr=function(){let t=!1;if("single"===this.selectVariant)for(const e of this.items){const n=b(this,_o,"m",Or).call(this,e);n&&(this.isItemHidden(e)||!this.isItemChecked(e)||t?n.setAttribute("tabindex","-1"):(n.setAttribute("tabindex","0"),t=!0),e.removeAttribute("tabindex"))}else for(const t of this.items){const e=b(this,_o,"m",Or).call(this,t);e&&(e.setAttribute("tabindex","-1"),t.removeAttribute("tabindex"))}!t&&b(this,_o,"a",Ir)&&b(this,_o,"m",Or).call(this,b(this,_o,"a",Ir))?.setAttribute("tabindex","0")},or=function(t){if(!b(this,_o,"m",ar).call(this,t))return!1;const e=t.target.closest(Fr);return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},rr=function(t){return t.target instanceof HTMLAnchorElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},ar=function(t){return t instanceof MouseEvent&&"click"===t.type||b(this,_o,"m",rr).call(this,t)},lr=function(){for(const t of this.items){const e=b(this,_o,"m",Or).call(this,t);if(!e)continue;const n=e.getAttribute("data-value");n&&b(this,Qo,"f").has(n)&&e.setAttribute(this.ariaSelectionType,"true")}b(this,_o,"m",Mr).call(this)},cr=function(t){const e=b(this,_o,"m",Or).call(this,t);if(!e)return;const n=e.getAttribute("data-value");n&&b(this,Qo,"f").set(n,{value:n,label:e.querySelector(".ActionListItem-label")?.textContent?.trim(),inputName:e.getAttribute("data-input-name")})},dr=function(t){const e=b(this,_o,"m",Or).call(this,t);if(!e)return;const n=e.getAttribute("data-value");n&&b(this,Qo,"f").delete(n)},ur=function(){b(this,_o,"a",Lr)&&(b(this,tr,"f")&&clearTimeout(b(this,tr,"f")),b(this,er,"f")&&clearTimeout(b(this,er,"f")),v(this,er,setTimeout((()=>{this.liveRegion.announce("Loading")}),2e3),"f"),v(this,tr,setTimeout((()=>{b(this,_o,"a",Lr)?.showLeadingSpinner()}),1e3),"f"))},hr=function(t){switch(t.type){case"include-fragment-replaced":b(this,_o,"m",br).call(this);break;case"loadstart":b(this,_o,"m",mr).call(this,!1);break;case"loadend":b(this,_o,"a",Lr)?.hideLeadingSpinner(),this.dispatchEvent(new CustomEvent("loadend"));break;case"error":{b(this,_o,"m",mr).call(this,!0);const e=this.fragmentErrorElement;throw e&&!e.hasAttribute("hidden")&&this.liveRegion.announceFromElement(e,{politeness:"assertive"}),new Error(t.detail.error)}}},mr=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)},fr=function(t){switch(t.type){case"remote-input-success":b(this,_o,"m",yr).call(this),b(this,_o,"m",br).call(this),b(this,_o,"m",lr).call(this);break;case"remote-input-error":this.bodySpinner?.setAttribute("hidden",""),this.includeFragment||0===this.visibleItems.length?b(this,_o,"m",wr).call(this,qr.BODY):b(this,_o,"m",wr).call(this,qr.BANNER);break;case"loadstart":if(!b(this,_o,"m",kr).call(this)){if(b(this,_o,"m",yr).call(this),this.bodySpinner?.removeAttribute("hidden"),this.bodySpinner)break;b(this,_o,"m",ur).call(this)}break;case"loadend":b(this,_o,"a",Lr)?.hideLeadingSpinner(),b(this,er,"f")&&clearTimeout(b(this,er,"f")),b(this,tr,"f")&&clearTimeout(b(this,tr,"f")),this.dispatchEvent(new CustomEvent("loadend"))}},pr=function(t,e){return(t.getAttribute("data-filter-string")||t.textContent||"").toLowerCase().indexOf(e.toLowerCase())>-1},gr=function(t){if("keydown"===t.type){const e=t.key;if("Enter"===e){const t=this.visibleItems[0];if(t){const e=b(this,_o,"m",Or).call(this,t);e&&e.click()}}else if("ArrowDown"===e){const e=this.focusableItem||b(this,_o,"m",Or).call(this,this.visibleItems[0]);e&&(e.focus(),t.preventDefault())}else if("Home"===e){const e=this.visibleItems[0];if(e){const n=b(this,_o,"m",Or).call(this,e);n&&n.focus(),t.preventDefault()}}else if("End"===e&&this.visibleItems.length>0){const e=this.visibleItems[this.visibleItems.length-1],n=b(this,_o,"m",Or).call(this,e);n&&n.focus(),t.preventDefault()}}if("input"===t.type&&(this.bodySpinner||b(this,_o,"m",kr).call(this)||b(this,_o,"m",ur).call(this),b(this,_o,"a",Ar)===Rr.LOCAL||b(this,_o,"a",Ar)===Rr.EVENTUALLY_LOCAL)){if(this.includeFragment)return void this.includeFragment.refetch();b(this,_o,"m",br).call(this)}},br=function(){if(!this.list)return;let t=!1;if(b(this,_o,"m",kr).call(this)){const e=this.filterInputTextField?.value??"",n=this.filterFn||b(this,_o,"m",pr);for(const i of this.items)n(i,e)?(b(this,_o,"m",Pr).call(this,i),t=!0):b(this,_o,"m",Dr).call(this,i)}else t=this.items.length>0;b(this,_o,"m",sr).call(this),b(this,_o,"m",Er).call(this);for(const t of this.items){const e=b(this,_o,"m",Or).call(this,t);if(!e)continue;const n=e.getAttribute("data-value");b(this,nr,"f")?n&&!b(this,Qo,"f").has(n)&&e.setAttribute(this.ariaSelectionType,"false"):n&&!b(this,Qo,"f").has(n)&&this.isItemChecked(t)&&b(this,_o,"m",cr).call(this,t)}v(this,nr,!0,"f"),this.noResults&&(b(this,_o,"m",vr).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")))},vr=function(){return!(!this.fragmentErrorElement||this.fragmentErrorElement.hasAttribute("hidden"))||!!this.bannerErrorElement&&!this.bannerErrorElement.hasAttribute("hidden")},wr=function(t){let e=this.fragmentErrorElement;t===qr.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"})},yr=function(){this.fragmentErrorElement?.setAttribute("hidden",""),this.bannerErrorElement.setAttribute("hidden","")},Er=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)}}},Ar=function(){if(!this.list)return Rr.REMOTE;switch(this.list.getAttribute("data-fetch-strategy")){case"local":return Rr.LOCAL;case"eventually_local":return Rr.EVENTUALLY_LOCAL;default:return Rr.REMOTE}},Lr=function(){return this.filterInputTextField?.closest("primer-text-field")},kr=function(){return b(this,_o,"a",Ar)===Rr.LOCAL||b(this,_o,"a",Ar)===Rr.EVENTUALLY_LOCAL},Tr=function(t){t.preventDefault(),t.stopPropagation(),this.open?this.hide():this.show()},Cr=function(t,e){this.querySelector(".ActionListWrap").style.display="none";const n=new AbortController,{signal:i}=n,s=()=>{n.abort(),this.querySelector(".ActionListWrap").style.display="",this.open&&this.hide();const t=this.ownerDocument.activeElement,e=this.ownerDocument.activeElement===this.ownerDocument.body,i=this.contains(t);(e||i)&&setTimeout((()=>this.invokerElement?.focus()),0)};e.addEventListener("close",s,{signal:i}),e.addEventListener("cancel",s,{signal:i})},Sr=function(t){if("multiple"!==this.selectVariant&&setTimeout((()=>{this.open&&this.hide()})),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e=this.isItemChecked(t),n=!e;if(!this.dispatchEvent(new CustomEvent("beforeItemActivated",{bubbles:!0,cancelable:!0,detail:{item:t,checked:n,value:b(this,_o,"m",Or).call(this,t)?.getAttribute("data-value")}})))return;const i=b(this,_o,"m",Or).call(this,t);if("single"===this.selectVariant){if(i?.getAttribute("href"))return;if(!e){for(const t of this.items)b(this,_o,"m",Or).call(this,t)?.setAttribute(this.ariaSelectionType,"false");b(this,Qo,"f").clear(),n&&(b(this,_o,"m",cr).call(this,t),i?.setAttribute(this.ariaSelectionType,"true")),b(this,_o,"m",xr).call(this)}}else i?.setAttribute(this.ariaSelectionType,`${n}`),n?b(this,_o,"m",cr).call(this,t):b(this,_o,"m",dr).call(this,t);b(this,_o,"m",Mr).call(this),b(this,_o,"m",sr).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:t,checked:n,value:b(this,_o,"m",Or).call(this,t)?.getAttribute("data-value")}}))},xr=function(){if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;v(this,Xo,b(this,Xo,"f")||t.textContent||"","f");const e=this.querySelector(`[${this.ariaSelectionType}=true] .ActionListItem-label`)?.textContent||b(this,Xo,"f");if(e){const n=document.createElement("span");n.classList.add("color-fg-muted");const i=document.createElement("span");n.textContent=`${this.dynamicLabelPrefix} `,i.textContent=e,t.replaceChildren(n,i),this.dynamicAriaLabelPrefix&&this.invokerElement?.setAttribute("aria-label",`${this.dynamicAriaLabelPrefix} ${e.trim()}`)}else t.textContent=b(this,Xo,"f")},Mr=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,nr,"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 n=e.querySelectorAll("input");n.length>0&&v(this,Zo,b(this,Zo,"f")||n[0].name,"f");for(const n of this.selectedItems){const i=document.createElement("input");i.setAttribute(""+(t?"data-select-panel-input":"data-list-input"),"true"),i.type="hidden",i.autocomplete="off",i.name=n.inputName||b(this,Zo,"f"),i.value=(n.value||n.label||"").trim(),e.append(i)}for(const t of n)t.remove()}},Ir=function(){return this.querySelector(Fr)?.parentElement||null},Dr=function(t){t&&t.setAttribute("hidden","hidden")},Pr=function(t){t&&t.removeAttribute("hidden")},Or=function(t){return t.querySelector(".ActionListContent")},g([U],Vr.prototype,"includeFragment",void 0),g([U],Vr.prototype,"dialog",void 0),g([U],Vr.prototype,"filterInputTextField",void 0),g([U],Vr.prototype,"remoteInput",void 0),g([U],Vr.prototype,"list",void 0),g([U],Vr.prototype,"noResults",void 0),g([U],Vr.prototype,"fragmentErrorElement",void 0),g([U],Vr.prototype,"bannerErrorElement",void 0),g([U],Vr.prototype,"bodySpinner",void 0),g([U],Vr.prototype,"liveRegion",void 0),Vr=g([j],Vr),window.customElements.get("select-panel")||(window.SelectPanelElement=Vr,window.customElements.define("select-panel",Vr));let Br=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 $r(t){Tt(t,{bindKeys:gt.ArrowVertical|gt.ArrowHorizontal|gt.HomeAndEnd|gt.Backspace,getNextFocusable:(t,e,n)=>{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 jr(t)}switch(e.key){case"ArrowUp":return Ur(t,"previous");case"ArrowDown":return Ur(t,"next");case"Backspace":return jr(t)}}(e,n)??e}},focusInStrategy:()=>{let e=t.querySelector("[aria-current]");e=e?.checkVisibility()?e:null;const n=t.querySelector('[role="treeitem"]');return e instanceof HTMLElement?e:document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&"treeitem"===document.activeElement.getAttribute("role")?document.activeElement:n instanceof HTMLElement?n:void 0}})}function Ur(t,e){const n=t.closest("[role=tree]");if(!n)return;const i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,(t=>t instanceof HTMLElement&&"treeitem"===t.getAttribute("role")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));let s=i.firstChild();for(;s!==t;)s=i.nextNode();let o="next"===e?i.nextNode():i.previousNode();for(;o instanceof HTMLElement&&Kr(o,n);)o="next"===e?i.nextNode():i.previousNode();return o instanceof HTMLElement?o:void 0}function Kr(t,e){for(const n of e.querySelectorAll("[role=treeitem][aria-expanded=false]"))if(t!==n&&n.closest("li")?.contains(t))return n;return null}function jr(t){const e=t.closest("[role=group]"),n=e?.closest("[role=treeitem]");return n instanceof HTMLElement?n:void 0}var zr,Yr,_r,Gr,Jr,Xr,Zr,Qr,ta,ea,na;g([U],Br.prototype,"detailsTarget",void 0),g([U],Br.prototype,"summaryTarget",void 0),Br=g([j],Br),window.DetailsToggleElement=Br;let ia=class TreeViewElement extends HTMLElement{constructor(){super(...arguments),zr.add(this),Yr.set(this,void 0)}connectedCallback(){const{signal:t}=v(this,Yr,new AbortController,"f");this.addEventListener("click",this,{signal:t}),this.addEventListener("focusin",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),$r(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,zr,"m",_r).call(this,t)})).observe(this,{childList:!0,subtree:!0});new MutationObserver((t=>{if(!this.formInputContainer)return;if(!t.some((t=>t.target instanceof HTMLElement&&t.target.getAttribute("aria-checked")!==t.oldValue)))return;const e=[];for(const t of this.querySelectorAll("[role=treeitem][aria-checked=true]")){const n=this.formInputPrototype.cloneNode();n.removeAttribute("data-target"),n.removeAttribute("form");const i={path:this.getNodePath(t)},s=this.getFormInputValueForNode(t);s&&(i.value=s),n.value=JSON.stringify(i),e.push(n)}this.formInputContainer.replaceChildren(...e)})).observe(this,{childList:!0,subtree:!0,attributeFilter:["aria-checked"]}),customElements.whenDefined("tree-view-sub-tree-node").then((()=>{b(this,zr,"m",_r).call(this,this)}))}disconnectedCallback(){b(this,Yr,"f").abort()}handleEvent(t){const e=b(this,zr,"m",Jr).call(this,t);e&&b(this,zr,"m",Xr).call(this,e,t)}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),n=this.querySelector(`[data-path="${CSS.escape(e)}"`);n&&(this.currentNode?.setAttribute("aria-current","false"),n.setAttribute("aria-current","true"))}get currentNode(){return this.querySelector("[aria-current=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")}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 n=JSON.stringify(t);return this.querySelector(`${e||""}[data-path="${CSS.escape(n)}"]`)}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()}infoFromNode(t,e){const n=this.getNodeType(t);if(!n)return null;const i=this.getNodeCheckedValue(t);return{node:t,type:n,path:this.getNodePath(t),checkedValue:e||i,previousCheckedValue:i}}};var sa,oa;Yr=new WeakMap,zr=new WeakSet,_r=function(t){for(const e of t.querySelectorAll("[aria-expanded=true]"))this.expandAncestorsForNode(e)},Gr=function(t){return"click"===t.type},Jr=function(t){const e=t.target,n=e.closest("[role=treeitem]");return n?e.closest(".TreeViewItemToggle")||e.closest(".TreeViewItemLeadingAction")?null:n:null},Xr=function(t,e){b(this,zr,"m",Zr).call(this,e,t)?b(this,zr,"m",Qr).call(this,e,t):b(this,zr,"m",Gr).call(this,e)?b(this,zr,"m",ta).call(this,e,t):"focusin"===e.type?b(this,zr,"m",ea).call(this,t):e instanceof KeyboardEvent&&b(this,zr,"m",na).call(this,e,t)},Zr=function(t,e){return"click"===t.type&&this.nodeHasCheckBox(e)},Qr=function(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();"leaf"===this.getNodeType(e)&&("true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.setNodeCheckedValue(e,"true"))},ta=function(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if(!(e instanceof HTMLDivElement))return;const n=this.getNodePath(e);this.dispatchEvent(new CustomEvent("treeViewBeforeNodeActivated",{bubbles:!0,cancelable:!0,detail:this.infoFromNode(e)}))&&(this.nodeHasNativeAction(e)||this.toggleAtPath(n),this.dispatchEvent(new CustomEvent("treeViewNodeActivated",{bubbles:!0,detail:this.infoFromNode(e)})))},ea=function(t){const e=this.querySelector("[aria-selected=true]");e?.setAttribute("aria-selected","false"),t.setAttribute("aria-selected","true")},na=function(t,e){if(e&&"leaf"===this.getNodeType(e))switch(t.key){case" ":case"Enter":if(this.getNodeDisabledValue(e)){t.preventDefault();break}this.nodeHasCheckBox(e)?(t.preventDefault(),"true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.setNodeCheckedValue(e,"true")):e instanceof HTMLAnchorElement&&e.click()}},g([U],ia.prototype,"formInputContainer",void 0),g([U],ia.prototype,"formInputPrototype",void 0),ia=g([j],ia),window.customElements.get("tree-view")||(window.TreeViewElement=ia,window.customElements.define("tree-view",ia));let ra=class TreeViewIconPairElement extends HTMLElement{constructor(){super(...arguments),sa.add(this)}connectedCallback(){Ke(this,(()=>Boolean(this.collapsedIcon)&&Boolean(this.expandedIcon)),(()=>{this.expanded=this.collapsedIcon.hidden}))}showExpanded(){this.expanded=!0,b(this,sa,"m",oa).call(this)}showCollapsed(){this.expanded=!1,b(this,sa,"m",oa).call(this)}toggle(){this.expanded=!this.expanded,b(this,sa,"m",oa).call(this)}};var aa,la,ca,da,ua,ha,ma,fa,pa,ga,ba,va;sa=new WeakSet,oa=function(){this.expanded?(this.expandedIcon.hidden=!1,this.collapsedIcon.hidden=!0):(this.expandedIcon.hidden=!0,this.collapsedIcon.hidden=!1)},g([U],ra.prototype,"expandedIcon",void 0),g([U],ra.prototype,"collapsedIcon",void 0),ra=g([j],ra),window.customElements.get("tree-view-icon-pair")||(window.TreeViewIconPairElement=ra,window.customElements.define("tree-view-icon-pair",ra));let wa=class TreeViewSubTreeNodeElement extends HTMLElement{constructor(){super(...arguments),aa.add(this),la.set(this,null),ca.set(this,"success"),da.set(this,void 0),ua.set(this,!1)}connectedCallback(){Ke(this,(()=>Boolean(this.node)&&Boolean(this.subTree)),(()=>{b(this,aa,"m",ba).call(this)}));const{signal:t}=v(this,da,new AbortController,"f");this.addEventListener("click",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),Ke(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,aa,"m",ma).call(this,t)}),{signal:t})})),Ke(this,(()=>Boolean(this.retryButton)),(()=>{this.retryButton.addEventListener("click",(t=>{b(this,aa,"m",fa).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,la,"f")&&v(this,la,"true"===this.node.getAttribute("aria-expanded"),"f"),b(this,la,"f")}set expanded(t){v(this,la,t,"f"),b(this,aa,"m",ba).call(this)}get loadingState(){return b(this,ca,"f")}set loadingState(t){v(this,ca,t,"f"),b(this,aa,"m",ba).call(this)}get selectStrategy(){return this.node.getAttribute("data-select-strategy")||"descendants"}disconnectedCallback(){b(this,da,"f").abort()}handleEvent(t){t.target===this.toggleButton?b(this,aa,"m",ha).call(this,t):t.target===this.includeFragment?b(this,aa,"m",ma).call(this,t):t instanceof KeyboardEvent?b(this,aa,"m",pa).call(this,t):t.target.closest("[role=treeitem]")===this.node&&"click"===t.type&&b(this,aa,"a",va)&&b(this,aa,"m",ga).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"),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}*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=[],n=this.treeView?.infoFromNode(this.node,t);if(n&&e.push(n),"descendants"===this.selectStrategy||"mixed_descendants"===this.selectStrategy)for(const n of this.eachDescendantNode()){const i=this.treeView?.infoFromNode(n,t);i&&e.push(i)}if(this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:e}))){for(const n of e)n.node.setAttribute("aria-checked",t);this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,cancelable:!0,detail:e}))}}};la=new WeakMap,ca=new WeakMap,da=new WeakMap,ua=new WeakMap,aa=new WeakSet,ha=function(t){"click"===t.type&&(this.toggle(),t.stopPropagation())},ma=function(t){switch(t.type){case"loadstart":this.loadingState="loading";break;case"error":this.loadingState="error";break;case"include-fragment-replace":v(this,ua,document.activeElement===this.loadingIndicator.closest("[role=treeitem]"),"f"),this.loadingState="success";break;case"include-fragment-replaced":if(this.expanded=!0,b(this,ua,"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,ua,!1,"f")}},fa=function(t){"click"===t.type&&(this.loadingState="loading",this.includeFragment.refetch())},pa=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,aa,"a",va)?this.toggleChecked():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,aa,"a",va)?(t.stopPropagation(),t.preventDefault(),this.toggleChecked()):e instanceof HTMLAnchorElement?e.click():this.treeView?.nodeHasNativeAction(e)||this.toggle()}},ga=function(t){this.treeView?.getNodeDisabledValue(this.node)?t.preventDefault():"click"===t.type&&(this.toggleChecked(),t.stopPropagation())},ba=function(){switch(this.expanded?(this.subTree&&(this.subTree.hidden=!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),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)}},va=function(){return this.querySelector(".TreeViewItemCheckbox")},g([U],wa.prototype,"node",void 0),g([U],wa.prototype,"subTree",void 0),g([U],wa.prototype,"iconPair",void 0),g([U],wa.prototype,"toggleButton",void 0),g([U],wa.prototype,"expandedToggleIcon",void 0),g([U],wa.prototype,"collapsedToggleIcon",void 0),g([U],wa.prototype,"includeFragment",void 0),g([U],wa.prototype,"loadingIndicator",void 0),g([U],wa.prototype,"loadingFailureMessage",void 0),g([U],wa.prototype,"retryButton",void 0),wa=g([j],wa),window.customElements.get("tree-view-sub-tree-node")||(window.TreeViewSubTreeNodeElement=wa,window.customElements.define("tree-view-sub-tree-node",wa));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([j],ya),window.customElements.get("tree-view-include-fragment")||(window.TreeViewIncludeFragmentElement=ya,window.customElements.define("tree-view-include-fragment",ya))}();
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 u=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){u=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(u){o=(await u).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 h="undefined"!=typeof globalThis?globalThis:window;try{h.IncludeFragmentElement=IncludeFragmentElement.define()}catch(t){if(!(h.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 u="";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"}}),u=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=u,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){L(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&&L(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 L(t){for(const e of t.querySelectorAll("[data-action]"))S(e);t instanceof Element&&t.hasAttribute("data-action")&&S(t)}function k(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,k)}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 O=new Map,H=new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),N=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)})),F={ready:()=>H,firstInteraction:()=>N,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)}))},R=new WeakMap;function q(t){cancelAnimationFrame(R.get(t)||0),R.set(t,requestAnimationFrame((()=>{for(const e of O.keys()){const i=t instanceof Element&&t.matches(e)?t:t.querySelector(e);if(customElements.get(e)||i){const n=i?.getAttribute("data-load-on")||"ready",s=n in F?F[n]:F.ready;for(const t of O.get(e)||[])s(e).then(t);O.delete(e),R.delete(t)}}})))}let W;const V=Symbol.for("catalyst");class B{constructor(t){const e=this,i=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){e.connectedCallback(this,i)};const n=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){e.disconnectedCallback(this,n)};const s=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,i,n){e.attributeChangedCallback(this,t,i,n,s)};let o=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return e.observedAttributes(this,o)},set(t){o=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){const e=C(t.name).replace(/-element$/,"");try{window.customElements.define(e,t),window[t.name]=customElements.get(e)}catch(t){if(!(t instanceof DOMException&&"NotSupportedError"===t.name))throw t}}(t)}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),L(t),A(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&(y(t.shadowRoot),function(t){W||(W=new MutationObserver((t=>{if(O.size)for(const e of t)for(const t of e.addedNodes)t instanceof Element&&q(t)}))),q(t),W.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,V)){const e=t[V],i=t[V]=new Map;if(e)for(const[t,n]of e)i.set(t,new Set(n))}const i=t[V];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 K(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 j(t){new B(t)}var z;class _{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 _(this),"f")}disconnectedCallback(){b(this,z,"f").unobserve(this)}};z=new WeakMap,Y=g([j],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(),[d,u]=[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}){const c={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let d=Q(i,n,s,o,a,l),u=s,h=o;if(d.top-=e.top,d.left-=e.left,!r){const r=G[s];let m=0;if(r){let t=s;for(;m<r.length&&tt(t,d,c,i);){const s=r[m++];t=s,d=Q(i,n,s,o,a,l),d.top-=e.top,d.left-=e.left,u=s}}const f=J[o];let p=0;if(f){let t=o;for(;p<f.length&&et(t,d,c,i);){const s=f[p++];t=s,d=Q(i,n,u,s,a,l),d.top-=e.top,d.left-=e.left,h=s}}d.top<c.top&&(d.top=c.top),d.left<c.left&&(d.left=c.left),d.left+i.width>t.width+c.left&&(d.left=t.width+c.left-i.width),r&&m<r.length&&d.top+i.height>t.height+c.top&&(d.top=Math.max(t.height+c.top-i.height,0))}return Object.assign(Object.assign({},d),{anchorSide:u,anchorAlign:h})}(a,{top:c.top+d,left:c.left+u},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,i,n,s,o;const r=null!==(e=t.side)&&void 0!==e?e:Z.side,a=null!==(i=t.align)&&void 0!==i?i:Z.align;return{side:r,align:a,anchorOffset:null!==(n=t.anchorOffset)&&void 0!==n?n:"inside-center"===r?0:Z.anchorOffset,alignmentOffset:null!==(s=t.alignmentOffset)&&void 0!==s?s:"center"!==a&&r.startsWith("inside")?Z.alignmentOffset:0,allowOutOfBounds:null!==(o=t.allowOutOfBounds)&&void 0!==o?o:Z.allowOutOfBounds}}(i))}const Z={side:"outside-bottom",align:"start",anchorOffset:4,alignmentOffset:4,allowOutOfBounds:!1};function Q(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 tt(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 et(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*it(t,e={}){var i,n;const s=null!==(i=e.strict)&&void 0!==i&&i,o=null!==(n=e.onlyTabbable)&&void 0!==n&&n?rt:ot,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 nt(t,e=!1){return it(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}const st=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"]);function ot(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(st.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 rt(t,e=!1){return ot(t,e)&&"-1"!==t.getAttribute("tabindex")}let at=!1;function lt(){}try{const t=Object.create({},{signal:{get(){at=!0}}});window.addEventListener("test",lt,t),window.removeEventListener("test",lt,t)}catch(t){}function ct(){at||(!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)}}(),at=!0)}ct();const dt=[];let ut;const ht="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";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=ht,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=nt(t,!0);null==e||e.focus()}}),r=mt({onFocus:()=>{const e=nt(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&&rt(l)&&t.contains(l))return void l.focus();if(e&&t.contains(e))return void e.focus();{const e=nt(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(),dt.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=dt.findIndex((e=>e.container===t));i>=0&&dt.splice(i,1),a.disconnect(),function(){const t=dt.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 u=dt.findIndex((e=>e.container===t));if(u>=0&&dt.splice(u,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}insertAt(t,...e){const i=e.filter((t=>!this._itemSet.has(t)));if(0!==i.length){this._items.splice(t,0,...i);for(const t of i)this._itemSet.add(t)}}delete(t){if(!this._itemSet.has(t))return!1;const e=this._items.indexOf(t);return e>=0&&this._items.splice(e,1),this._itemSet.delete(t),!0}has(t){return this._itemSet.has(t)}indexOf(t){return this._itemSet.has(t)?this._items.indexOf(t):-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()}find(t){return this._items.find(t)}}var yt;ct(),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 Lt(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 kt(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="activated-directly",Ct="activated-indirectly",xt="data-has-active-descendant";function Mt(t,e){var i,n,s,o,r,a,l;const c=new wt,d=new WeakMap,u=null!==(i=null==e?void 0:e.bindKeys)&&void 0!==i?i:((null==e?void 0:e.getNextFocusable)?yt.ArrowAll:yt.ArrowVertical)|yt.HomeAndEnd,h=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 L(t,e=!1){const i=v;v=t,w=e,f?t&&document.activeElement===f?k(i,t,e):T():(i&&i!==t&&d.has(i)&&i.setAttribute("tabindex","-1"),null==t||t.setAttribute("tabindex","0"))}function k(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(xt,i.id),i.setAttribute(Tt,n?St:Ct),null==p||p(i,e,n))}function T(e=v){"first"===m&&(v=void 0),null==f||f.removeAttribute("aria-activedescendant"),t.removeAttribute(xt),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||L(A())}function C(){const e=[...it(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");L(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){L(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(...it(t,I));const D="function"==typeof m?m(document.body):A();E||L(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 it(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 it(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 O=new AbortController,H=null!==(l=null==e?void 0:e.abortSignal)&&void 0!==l?l:O.signal;let N;H.addEventListener("abort",(()=>{P.disconnect(),M(...c),c.clear()})),t.addEventListener("mousedown",(t=>{t.target instanceof HTMLElement&&t.target!==document.activeElement&&(N=c.indexOf(t.target))}),{signal:H}),f?(t.addEventListener("focusin",(t=>{t.target instanceof HTMLElement&&c.has(t.target)&&(f.focus({preventScroll:y}),L(t.target))}),{signal:H}),g||t.addEventListener("mousemove",(({target:t})=>{if(!(t instanceof Node))return;if(t instanceof HTMLElement&&c.has(t))return void L(t);const e=c.find((e=>e.contains(t)));e&&L(e)}),{signal:H,capture:!0}),f.addEventListener("focusin",(()=>{v?k(void 0,v):E||L(A())}),{signal:H}),f.addEventListener("focusout",(()=>{T()}),{signal:H})):t.addEventListener("focusin",(e=>{if(e.target instanceof HTMLElement)if(void 0!==N){if(N>=0){const t=c.get(N);t&&t!==v&&L(t)}N=void 0}else if("previous"===m)L(e.target);else if("closest"===m||"first"===m){if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t="previous"===R?c.size-1:0,e=c.get(t);return void(null==e||e.focus({preventScroll:y}))}L(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 L(e.target);R=void 0}),{signal:H});const F=null!=f?f:t;let R;return"closest"===m&&document.addEventListener("keydown",(t=>{"Tab"===t.key&&(R=Lt(t))}),{signal:H,capture:!0}),F.addEventListener("keydown",(i=>{var n;if(i.key in At){const s=Et[i.key];if(!i.defaultPrevented&&(s&u)>0&&!kt(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"===h&&"Tab"!==i.key?c.size-1:0),n>=c.size&&(n="wrap"===h&&"Tab"!==i.key?0:c.size-1),e!==n&&(o=c.get(n))}f?L(o||v,!0):o&&(R=s,o.focus({preventScroll:y})),("Tab"!==i.key||o)&&i.preventDefault()}}}),{signal:H}),O}var It,Dt,Pt,Ot,Ht,Nt,Ft;const Rt=new IntersectionObserver((t=>{for(const e of t){const t=e.target;e.isIntersecting&&t instanceof Vt&&t.update()}})),qt=new ResizeObserver((t=>{for(const e of t){const t=e.target;t instanceof Vt&&t.update()}}));var Wt;!function(t){t[t.Item=0]="Item",t[t.Divider=1]="Divider"}(Wt||(Wt={}));let Vt=class ActionBarElement extends HTMLElement{constructor(){super(...arguments),It.add(this),Dt.set(this,null)}connectedCallback(){qt.observe(this),Rt.observe(this),requestAnimationFrame((()=>{this.style.overflow="visible",this.update()}))}disconnectedCallback(){qt.unobserve(this),Rt.unobserve(this)}menuItemClick(t){const e=t.currentTarget,i=e?.getAttribute("data-for");i&&document.getElementById(i)?.click()}update(){const t=b(this,It,"a",Pt);if(!t)return;const e=t.getBoundingClientRect().top;let i=null;b(this,It,"m",Ft).call(this,((t,n,s)=>{const o=t.getBoundingClientRect().top;return s===Wt.Item&&(o>e?(b(this,It,"m",Ht).call(this,n),this.moreMenu.hidden&&(this.moreMenu.hidden=!1),i===Wt.Divider&&b(this,It,"m",Ht).call(this,n-1)):(b(this,It,"m",Ot).call(this,n),n===this.items.length-1&&(this.moreMenu.hidden=!0),i===Wt.Divider&&b(this,It,"m",Ot).call(this,n-1))),i=s,!0})),b(this,Dt,"f")&&b(this,Dt,"f").abort(),v(this,Dt,Mt(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")}};Dt=new WeakMap,It=new WeakSet,Pt=function(){let t=null;return b(this,It,"m",Ft).call(this,((e,i,n)=>n!==Wt.Item||(t=e,!1))),t},Ot=function(t){const e=this.items[t],i=b(this,It,"a",Nt)[t];e&&i&&(e.style.setProperty("visibility","visible"),i.hidden=!0)},Ht=function(t){const e=this.items[t],i=b(this,It,"a",Nt)[t];e&&i&&(e.style.setProperty("visibility","hidden"),i.hidden=!1)},Nt=function(){return this.moreMenu.querySelectorAll('[role="menu"] > li')},Ft=function(t){for(let e=0;e<this.items.length;e++){const i=this.items[e],n=i.classList.contains("ActionBar-divider")?Wt.Divider:Wt.Item;if(!t(i,e,n))break}},g([K],Vt.prototype,"items",void 0),g([U],Vt.prototype,"itemContainer",void 0),g([U],Vt.prototype,"moreMenu",void 0),Vt=g([j],Vt),window.ActionBarElement=Vt;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=[Ut(t,"compositionstart",(t=>Qt(this,t))),Ut(t,"compositionend",(t=>Qt(this,t))),Ut(t,"click",(e=>Gt(t,e))),Ut(t,"change",(e=>Gt(t,e))),Ut(t,"keydown",(e=>function(t,e,i){if(!(i instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const n=Bt.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")&&(Zt(t),i.preventDefault(),i.stopPropagation());break;case"ArrowDown":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=_t(t,!0);e&&e.focus(),i.preventDefault()}break;case"ArrowUp":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=_t(t,!1);e&&e.focus(),i.preventDefault()}break;case"n":if(Yt&&i.ctrlKey){const e=_t(t,!0);e&&e.focus(),i.preventDefault()}break;case"p":if(Yt&&i.ctrlKey){const e=_t(t,!1);e&&e.focus(),i.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&Xt(e)&&e.closest("details")===t&&(i.preventDefault(),i.stopPropagation(),e.click())}}}(t,this,e))),Ut(t,"toggle",(()=>Kt(t,this)),{once:!0}),Ut(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?Ut(t,"mouseover",(()=>Kt(t,this)),{once:!0}):$t,...jt(t)];Bt.set(this,{subscriptions:i,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=Bt.get(this);if(t){Bt.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const Bt=new WeakMap,$t={unsubscribe(){}};function Ut(t,e,i,n=!1){return t.addEventListener(e,i,n),{unsubscribe:()=>{t.removeEventListener(e,i,n)}}}function Kt(t,e){const i=e.getAttribute("src");if(!i)return;const n=Bt.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",(()=>zt(t))),s.setAttribute("src",i))}function jt(t){let e=!1;return[Ut(t,"mousedown",(()=>e=!0)),Ut(t,"keydown",(()=>e=!1)),Ut(t,"toggle",(()=>{t.hasAttribute("open")&&(zt(t)||e||function(t){const e=document.activeElement;if(e&&Xt(e)&&t.contains(e))return;const i=_t(t,!0);i&&i.focus()}(t))}))]}function zt(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function _t(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 Yt=navigator.userAgent.match(/Macintosh/);function Gt(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||Jt(e,t)}else if("change"===e.type){const e=i.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&Jt(e,t)}}function Jt(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")&&Zt(e),i.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function Xt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function Zt(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Qt(t,e){const i=Bt.get(t);i&&(i.isComposing="compositionstart"===e.type)}var te,ee;window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const ie=(()=>{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),te.set(this,null),ee.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,te,"f"))return b(this,te,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){v(this,te,t,"f"),b(this,te,"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())),ie(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(b(this,ee,"f")),v(this,ee,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 ne,se,oe;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){e.showModal(),t.preventDefault();let n=i,s=!1;for(;n;)n=n.parentElement?.closest("[popover]:not(:popover-open)"),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()}}te=new WeakMap,ee=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),ne.add(this),se.set(this,null)}get dialog(){return this.querySelector("dialog")}connectedCallback(){const{signal:t}=v(this,se,new AbortController,"f");document.addEventListener("click",re,!0),document.addEventListener("click",this,{signal:t}),this.ownerDocument.body.style.setProperty("--dialog-scrollgutter",window.innerWidth-this.ownerDocument.body.clientWidth+"px"),new MutationObserver((t=>{for(const e of t)e.target===this.dialog&&b(this,ne,"m",oe).call(this)})).observe(this,{subtree:!0,attributeFilter:["open"]}),b(this,ne,"m",oe).call(this)}disconnectedCallback(){b(this,se,"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()}}se=new WeakMap,ne=new WeakSet,oe=function(){this.dialog&&this.dialog.matches("[open]:not(:modal)")&&(this.dialog.addEventListener("close",(t=>t.stopImmediatePropagation()),{once:!0}),this.dialog.close(),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 de=globalThis.ShadowRoot||function(){},ue=globalThis.HTMLDialogElement||function(){},he=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 ue&&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 de&&(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 de&&(t=t.host),t instanceof Document)return}}function Le(t){return!(t.hidden||t instanceof de)&&((!(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(Le(s))return s;s=n.nextNode()}})(t)?.focus()}var Te=new WeakMap;function Se(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),Te.delete(t);const n=e.activeElement;t.classList.add(":popover-open"),fe.set(t,"showing"),he.has(e)||he.set(e,new Set),he.get(e).add(t),ke(t),"auto"===t.popover&&(me.has(e)||me.set(e,new Set),me.get(e).add(t),Oe(ge.get(t),!0)),i&&n&&"auto"===t.popover&&Te.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(Oe(ge.get(t),!1),ge.delete(t),i&&(t.dispatchEvent(new ae("beforetoggle",{oldState:"open",newState:"closed"})),!be(t,!0)))return;he.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=Te.get(t);s&&(Te.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 Oe(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 He=globalThis.ShadowRoot||function(){};function Ne(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 Re(){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 qe,We,Ve,Be,$e=null;function Ue(t){const e=Re();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(Fe,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||ae,Ne(Document.prototype,"querySelector",t),Ne(Document.prototype,"querySelectorAll",t),Ne(Element.prototype,"querySelector",t),Ne(Element.prototype,"querySelectorAll",t),Ne(Element.prototype,"matches",t),Ne(Element.prototype,"closest",t),Ne(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(){Se(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||Se(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 Ue(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&&Ue(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 He)&&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 He||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),Se(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),Ue(document)}();const Ke=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]'].map((t=>`:not([hidden]) > ${t}`)).join(", "),je=t=>t.textContent?.trim()[0].toLowerCase(),ze=/^\S$/;class FocusGroupElement extends HTMLElement{constructor(){super(...arguments),qe.add(this),We.set(this,null),Ve.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,Ve,new AbortController,"f");const{signal:t}=b(this,Ve,"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,Ve,"f")?.abort()}handleEvent(t){const{direction:e,nowrap:i}=this;if("focusin"===t.type){if(this.retain&&t.target instanceof Element&&t.target.matches(Ke)){b(this,We,"f")?.abort();const{signal:e}=v(this,We,new AbortController,"f");for(const i of b(this,qe,"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,We,"f")?.abort(),i.setAttribute("tabindex","-1"),n.id)){const t=this.querySelector(`[popovertarget="${n.id}"]`);t?t.setAttribute("tabindex","0"):b(this,qe,"a",Be)[0]?.setAttribute("tabindex","0")}}),{signal:e})}}}else if(t instanceof KeyboardEvent){const n=Array.from(b(this,qe,"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||!ze.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()}}}We=new WeakMap,Ve=new WeakMap,qe=new WeakSet,Be=function(){return this.querySelectorAll(Ke)},customElements.get("focus-group")||(window.FocusGroupElement=FocusGroupElement,customElements.define("focus-group",FocusGroupElement));let _e=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],_e.prototype,"hasOverflow",void 0),g([I],_e.prototype,"labelledBy",void 0),_e=g([j],_e),window.ScrollableRegionElement=_e;const Ye=(t,e,i)=>{if(e())i();else{const n=new MutationObserver((()=>{e()&&(i(),n.disconnect())}));n.observe(t,{childList:!0,subtree:!0})}};var Ge,Je,Xe,Ze;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),Ge.add(this),Je.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,Ge,"a",Xe)?.classList.remove("Overlay--hidden"),b(this,Je,"f").signal.aborted&&v(this,Je,new AbortController,"f"),ft(this,this.querySelector("[autofocus]"),b(this,Je,"f").signal),ti.push(this)}else{if(!this.open)return;this.removeAttribute("open"),this.setAttribute("aria-disabled","true"),b(this,Ge,"a",Xe)?.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",b(this,Je,"f").abort();const t=this.openButton?.closest("details")||this.openButton?.closest("action-menu");Qe(t?nt(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,Ge,"m",Ze).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,di,ui;Je=new WeakMap,Ge=new WeakSet,Xe=function(){return this.parentElement?.hasAttribute("data-modal-dialog-overlay")?this.parentElement:null},Ze=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),si.add(this),oi.set(this,void 0)}connectedCallback(){this.topLevelList&&v(this,oi,new _(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",di).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",ui).call(this,t);i&&(this.expandItem(i),i.classList.add("ActionListContent--hasActiveSubItem"))},di=function(t){t.classList.remove("ActionListItem--navActive"),t.children.length>0&&t.children[0].removeAttribute("aria-current");const e=b(this,si,"m",ui).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},ui=function(t){if(!t.classList.contains("ActionListItem--subItem"))return null;const e=t.closest("li.ActionListItem--hasSubItem")?.querySelector("button.ActionListContent");return e||null},g([K],hi.prototype,"items",void 0),g([U],hi.prototype,"topLevelList",void 0),hi=g([j],hi);let gi=class NavListGroupElement extends HTMLElement{constructor(){super(...arguments),mi.add(this),pi.set(this,new _(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([K],gi.prototype,"focusMarkers",void 0),gi=g([j],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")}};bi=new WeakSet,vi=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},g([K],wi.prototype,"items",void 0),wi=g([j],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,Li,ki,Ti,Si,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([j],yi),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=yi,window.customElements.define("toggle-switch",yi));const Oi=(()=>{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)})(),Hi="sr-only",Ni=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];function Fi(t){for(const e of Vi)e!==t&&(Oi(e)?e.hidePopover():Vi.delete(e))}function Ri(){Fi()}function qi(t){setTimeout((()=>{for(const e of Vi)Oi(e)&&"focus"===e.showReason&&e.control!==t.target&&e.hidePopover()}),0)}const Wi=new Set,Vi=new Set;class ToolTipElement extends HTMLElement{constructor(){super(...arguments),Ei.add(this),Ai.set(this,void 0),Li.set(this,"center"),ki.set(this,"outside-bottom"),Ti.set(this,!1),Si.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: var(--overlay-width-small);\n word-wrap: break-word;\n white-space: normal;\n width: max-content !important;\n inset: var(--tooltip-top) auto auto var(--tooltip-left) !important;\n overflow: visible !important;\n text-wrap: balance;\n }\n\n :host(:is(.tooltip-n, .tooltip-nw, .tooltip-ne)) {\n --tooltip-top: calc(var(--tool-tip-position-top, 0) - var(--overlay-offset, 0.25rem));\n --tooltip-left: var(--tool-tip-position-left);\n }\n\n :host(:is(.tooltip-s, .tooltip-sw, .tooltip-se)) {\n --tooltip-top: calc(var(--tool-tip-position-top, 0) + var(--overlay-offset, 0.25rem));\n --tooltip-left: var(--tool-tip-position-left);\n }\n\n :host(.tooltip-w) {\n --tooltip-top: var(--tool-tip-position-top);\n --tooltip-left: calc(var(--tool-tip-position-left, 0) - var(--overlay-offset, 0.25rem));\n }\n\n :host(.tooltip-e) {\n --tooltip-top: var(--tool-tip-position-top);\n --tooltip-left: calc(var(--tool-tip-position-left, 0) + var(--overlay-offset, 0.25rem));\n }\n\n :host:after{\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: var(--overlay-offset, 0.25rem);\n content: "";\n }\n\n :host(.tooltip-s):after,\n :host(.tooltip-se):after,\n :host(.tooltip-sw):after {\n bottom: 100%\n }\n\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%;\n }\n\n @keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n :host(:popover-open),\n :host(:popover-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n }\n\n :host(.\\:popover-open) {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n }\n\n @media (forced-colors: active) {\n :host {\n outline: solid 1px transparent;\n }\n\n :host:before {\n display: none;\n }\n }\n '}get showReason(){return b(this,Si,"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&&Oi(this)?this.hidePopover():t||Oi(this)||this.showPopover()}get hiddenFromView(){return!Oi(this)}connectedCallback(){if(Wi.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,Ti,!0,"f"),b(this,Ei,"m",Mi).call(this)}disconnectedCallback(){Wi.delete(this),Vi.delete(this),b(this,Ai,"f")?.abort()}async handleEvent(t){if(!this.control)return;const e=Oi(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||Oi(this)?e&&a&&Oi(this)&&this.hidePopover():(v(this,Si,"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,Li=new WeakMap,ki=new WeakMap,Ti=new WeakMap,Si=new WeakMap,Ci=new WeakMap,Ei=new WeakSet,xi=function(t){t?(Vi.add(this),this.classList.remove(Hi),Fi(this),b(this,Ei,"m",Pi).call(this)):(Vi.delete(this),this.classList.remove(...Ni),this.classList.add(Hi))},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",Ri),this.ownerDocument.addEventListener("focusin",qi),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(...Ni);const t=this.direction;"n"===t?(v(this,Li,"center","f"),v(this,ki,"outside-top","f")):"ne"===t?(v(this,Li,"end","f"),v(this,ki,"outside-top","f")):"e"===t?(v(this,Li,"center","f"),v(this,ki,"outside-right","f")):"se"===t?(v(this,Li,"end","f"),v(this,ki,"outside-bottom","f")):"s"===t?(v(this,Li,"center","f"),v(this,ki,"outside-bottom","f")):"sw"===t?(v(this,Li,"start","f"),v(this,ki,"outside-bottom","f")):"w"===t?(v(this,Li,"center","f"),v(this,ki,"outside-left","f")):"nw"===t&&(v(this,Li,"start","f"),v(this,ki,"outside-top","f"))},Pi=function(){if(!this.control)return;if(!b(this,Ti,"f")||!Oi(this))return;const t=X(this,this.control,{side:b(this,ki,"f"),align:b(this,Li,"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 Ui=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],Ui.prototype,"titleText",void 0),Ui=g([j],Ui),window.customElements.get("x-banner")||(window.XBannerElement=Ui,window.customElements.define("x-banner",Ui));class Ki{constructor(t,e,{tabInsertsSuggestions:i,defaultFirstOption:n}={}){this.input=t,this.list=e,this.tabInsertsSuggestions=null==i||i,this.defaultFirstOption=null!=n&&n,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":zi(e.input,e.list)&&t.preventDefault();break;case"Tab":e.tabInsertsSuggestions&&zi(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(_i)[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(_i)[0],i=Array.from(this.list.querySelectorAll('[role="option"]')).filter(_i),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"),Yi(this.list,o)):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 zi(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 _i(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function Yi(t,e){(function(t,e){const i=t.scrollTop,n=i+t.clientHeight,s=e.offsetTop,o=s+e.clientHeight;return s>=i&&o<=n})(t,e)||(t.scrollTop=e.offsetTop)}const Gi=window.testScreenReaderDelay||100;class Ji{constructor(t,e,i,n=!1){var s;if(this.container=t,this.input=e,this.results=i,this.combobox=new Ki(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)}),Gi)}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 Xi,Zi,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),Xi.add(this),Zi.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,Zi,"f"))||void 0===t?void 0:t.isConnected)return nn(this,Zi,"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,Zi,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,Xi,"m",tn).call(this)}connectedCallback(){this.isConnected&&(nn(this,Xi,"m",tn).call(this),new MutationObserver((()=>{ln.get(this)||nn(this,Xi,"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,Xi,"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}))}}}Zi=new WeakMap,Qi=new WeakMap,en=new WeakMap,Xi=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 Ji(this,i,e,n)),e.setAttribute("role","listbox")};const dn="undefined"!=typeof globalThis?globalThis:window;try{dn.AutocompleteElement=dn.AutoCompleteElement=AutoCompleteElement.define()}catch(t){if(!(dn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function un(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),un(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 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):un(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,Ln=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 Tn="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)}},Sn=[["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;Ln(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 kn(this,An,"f")}formatToParts(t){const e=[],i=kn(this,An,"f"),n=i.style,s=i.locale;for(const[n,o]of Sn){const r=t[n];if("auto"===i[`${n}Display`]&&!r)continue;const a=i[n],l="2-digit"===a?Cn:"numeric"===a?{}:{style:"unit",unit:o,unitDisplay:a};e.push(new Intl.NumberFormat(s,l).format(r))}return new Tn(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 On(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 u=e.getFullYear(),h=e.getMonth(),m=e.getDate();if(r>=27||n+s+r){const t=new Date(e);t.setDate(1),t.setMonth(h+s*i+1),t.setDate(0);const a=Math.max(0,m-t.getDate()),l=new Date(e);l.setFullYear(u+n*i),l.setDate(m-a),l.setMonth(h+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 Dn(n*i,s*i,o*i,r*i,a*i,l*i,c*i,d*i)}var Hn,Nn,Fn,Rn,qn,Wn,Vn,Bn,$n,Un,Kn,jn,zn=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)},_n=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 Yn=globalThis.HTMLElement||null,Gn=new Dn,Jn=new Dn(0,0,0,0,0,1);class Xn 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 Zn(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 Qn=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=Zn(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,Zn(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends Yn{constructor(){super(...arguments),Hn.add(this),Nn.set(this,!1),Fn.set(this,!1),qn.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),jn.set(this,null)}static define(t="relative-time",e=customElements){return e.define(t,this),this}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"]}get onRelativeTimeUpdated(){return zn(this,jn,"f")}set onRelativeTimeUpdated(t){zn(this,jn,"f")&&this.removeEventListener("relative-time-updated",zn(this,jn,"f")),_n(this,jn,"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(){Qn.unobserve(this)}attributeChangedCallback(t,e,i){e!==i&&("title"===t&&_n(this,Nn,null!==i&&(this.date&&zn(this,Hn,"m",Wn).call(this,this.date))!==i,"f"),zn(this,Fn,"f")||"title"===t&&zn(this,Nn,"f")||_n(this,Fn,(async()=>{await Promise.resolve(),this.update(),_n(this,Fn,!1,"f")})(),"f"))}update(){const t=zn(this,qn,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let i=e;const n=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!n)return void(zn(this,qn,"f").textContent=t);const s=Date.now();zn(this,Nn,"f")||(i=zn(this,Hn,"m",Wn).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),d=Math.floor(c/30),u=Math.floor(d/12),h=In.indexOf(e)||In.length;return new Dn(h>=0?u*s:0,h>=1?(d-12*u)*s:0,0,h>=3?(c-30*d)*s:0,h>=4?(l-24*c)*s:0,h>=5?(a-60*l)*s:0,h>=6?(r-60*a)*s:0,h>=7?(o-1e3*r)*s:0)}(n,this.precision,s),r=zn(this,Hn,"m",Vn).call(this,o);let a=t;a="duration"===r?zn(this,Hn,"m",Bn).call(this,o):"relative"===r?zn(this,Hn,"m",$n).call(this,o):zn(this,Hn,"m",Un).call(this,n),a?zn(this,Hn,"m",Kn).call(this,a):this.shadowRoot===zn(this,qn,"f")&&this.textContent&&zn(this,Hn,"m",Kn).call(this,this.textContent),a===t&&i===e||this.dispatchEvent(new Xn(t,a,e,i)),"relative"===r||"duration"===r?Qn.observe(this):Qn.unobserve(this)}}Nn=new WeakMap,Fn=new WeakMap,qn=new WeakMap,jn=new WeakMap,Hn=new WeakSet,Rn=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"}},Wn=function(t){return new Intl.DateTimeFormat(zn(this,Hn,"a",Rn),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},Vn=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=zn(this,Hn,"a",Rn),i=this.format,n=this.formatStyle,s=this.tense;let o=Gn;"micro"===i?(t=On(t),o=Jn,("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=Jn)):("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(zn(this,Hn,"a",Rn),{numeric:"auto",style:this.formatStyle}),i=this.tense;"future"===i&&1!==t.sign&&(t=Gn),"past"===i&&-1!==t.sign&&(t=Gn);const[n,s]=function(t,e){const i=On(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)},Un=function(t){const e=new Intl.DateTimeFormat(zn(this,Hn,"a",Rn),{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName});return`${this.prefix} ${e.format(t)}`.trim()},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,zn(this,qn,"f").replaceChildren(e)}else zn(this,qn,"f").textContent=t};const ts="undefined"!=typeof globalThis?globalThis:window;try{ts.RelativeTimeElement=RelativeTimeElement.define()}catch(t){if(!(ts.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function es(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{static define(t="tab-container",e=customElements){return e.define(t,this),this}connectedCallback(){this.addEventListener("keydown",(t=>{var e;const i=t.target;if(!(i instanceof HTMLElement))return;if(i.closest(this.tagName)!==this)return;if("tab"!==i.getAttribute("role")&&!i.closest('[role="tablist"]'))return;const n=es(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=es(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 HTMLElement&&i.closest('[role="tablist"]')))return;const n=e.indexOf(i);this.selectTab(n)}));for(const t of es(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=es(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 CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget: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 CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:s}}))}}}const is="undefined"!=typeof globalThis?globalThis:window;try{is.TabContainerElement=TabContainerElement.define()}catch(t){if(!(is.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}let ns=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 ss(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=0,a=!1;function l(...c){if(a)return;const d=Date.now()-r;r=Date.now(),i?(i=!1,t.apply(this,c),s&&l.cancel()):(n&&d<e||!n)&&(clearTimeout(o),o=setTimeout((()=>{r=Date.now(),t.apply(this,c),s&&l.cancel()}),n?e-d:e))}return l.cancel=()=>{clearTimeout(o),a=!0},l}(t,e,{start:i,middle:n,once:s})}g([K],ns.prototype,"fields",void 0),ns=g([j],ns),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:ns}),window.customElements.define("primer-multi-input",ns));var os,rs,as=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)},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};!function(t){t.GET="GET",t.POST="POST"}(rs||(rs={}));const cs=new WeakMap;class ds extends Event{constructor(t){super(`auto-check-${t}`,{bubbles:!0}),this.phase=t}get detail(){return this}}class us extends ds{constructor(t,e=""){super(t),this.phase=t,this.message=e,this.setValidity=t=>{this.message=t}}}class hs extends ds{constructor(){super("complete")}}class ms extends ds{constructor(t){super("success"),this.response=t}}class fs extends us{constructor(){super("start","Verifying…")}}class ps extends us{constructor(t){super("error","Validation failed"),this.response=t}}class gs extends ds{constructor(t){super("send"),this.body=t}}class AutoCheckElement extends HTMLElement{constructor(){super(...arguments),os.set(this,null)}static define(t="auto-check",e=customElements){return e.define(t,this),this}get onloadend(){return as(this,os,"f")}set onloadend(t){as(this,os,"f")&&this.removeEventListener("loadend",as(this,os,"f")),ls(this,os,"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=ss(ws.bind(null,this),300),i={check:e,controller:null};cs.set(this,i);const n=bs.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=cs.get(this);e&&(cs.delete(this),t.removeEventListener("input",vs),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 rs[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 bs(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)&&(vs(e),t()))}function vs(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=cs.get(i);if(!n||"POST"===o&&!s||!r)return;const a=new fs;e.dispatchEvent(a),i.required&&e.setCustomValidity(a.message)}async function ws(t){const e=t.input;if(!e)return;const i=t.csrfField,n=t.src,s=t.csrf,o=cs.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 gs(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 ms(i.clone()));else{t.validateOnKeystroke=!0;const n=new ps(i.clone());e.dispatchEvent(n),t.required&&e.setCustomValidity(n.message)}o.controller=null,e.dispatchEvent(new hs)}catch(t){"AbortError"!==t.name&&(o.controller=null,e.dispatchEvent(new hs))}}os=new WeakMap;const ys="undefined"!=typeof globalThis?globalThis:window;try{ys.AutoCheckElement=AutoCheckElement.define()}catch(t){if(!(ys.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}class Es{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 As,Ls;let ks=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),As.set(this,void 0),Ls.set(this,null)}connectedCallback(){b(this,As,"f")?.abort();const{signal:t}=v(this,As,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,Ls,new Es(this.inputElement,this.characterLimitElement,this.characterLimitSrElement),"f"),b(this,Ls,"f").initialize(t))}disconnectedCallback(){b(this,As,"f")?.abort(),b(this,Ls,"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 Ts;As=new WeakMap,Ls=new WeakMap,g([U],ks.prototype,"inputElement",void 0),g([U],ks.prototype,"validationElement",void 0),g([U],ks.prototype,"validationMessageElement",void 0),g([U],ks.prototype,"validationSuccessIcon",void 0),g([U],ks.prototype,"validationErrorIcon",void 0),g([U],ks.prototype,"leadingVisual",void 0),g([U],ks.prototype,"leadingSpinner",void 0),g([U],ks.prototype,"characterLimitElement",void 0),g([U],ks.prototype,"characterLimitSrElement",void 0),ks=g([j],ks);let Ss=class PrimerTextAreaElement extends HTMLElement{constructor(){super(...arguments),Ts.set(this,null)}connectedCallback(){this.characterLimitElement&&(v(this,Ts,new Es(this.inputElement,this.characterLimitElement,this.characterLimitSrElement),"f"),b(this,Ts,"f").initialize())}disconnectedCallback(){b(this,Ts,"f")?.cleanup()}};Ts=new WeakMap,g([U],Ss.prototype,"inputElement",void 0),g([U],Ss.prototype,"characterLimitElement",void 0),g([U],Ss.prototype,"characterLimitSrElement",void 0),Ss=g([j],Ss),window.customElements.get("primer-text-area")||(Object.assign(window,{PrimerTextAreaElement:Ss}),window.customElements.define("primer-text-area",Ss));let Cs=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 xs,Ms,Is,Ds,Ps,Os,Hs,Ns,Fs,Rs,qs,Ws,Vs,Bs,$s,Us,Ks,js,zs,_s,Ys;g([U],Cs.prototype,"validationElement",void 0),g([U],Cs.prototype,"validationMessageElement",void 0),Cs=g([j],Cs);const Gs=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]'],Js=Gs.map((t=>`:not([hidden]) > ${t}`));let Xs=class ActionMenuElement extends HTMLElement{constructor(){super(...arguments),xs.add(this),Ms.set(this,void 0),Is.set(this,""),Ds.set(this,""),Ps.set(this,!1),Os.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 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,Ms,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.popoverElement?.addEventListener("toggle",this,{signal:t}),b(this,xs,"m",zs).call(this),b(this,xs,"m",_s).call(this),b(this,xs,"m",Hs).call(this),this.includeFragment&&this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t});const e=()=>{b(this,xs,"m",js).call(this)&&this.overlay?.update()};v(this,Os,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"),Ye(this,(()=>Boolean(this.invokerElement)),(()=>b(this,Os,"f").observe(this.invokerElement))),this.includeFragment||this.setAttribute("data-ready","true")}disconnectedCallback(){b(this,Ms,"f").abort()}handleEvent(t){const e=this.invokerElement?.contains(t.target),i=b(this,xs,"m",Rs).call(this,t);if("toggle"===t.type&&"open"===t.newState&&window.requestAnimationFrame((()=>{b(this,xs,"a",Ys)?.focus()})),e&&"mousedown"===t.type)return void v(this,Ps,!0,"f");if("mousedown"===t.type)return void t.preventDefault();if(e&&i)return b(this,xs,"m",qs).call(this,t),void v(this,Ps,!1,"f");if("focusout"===t.type){if(b(this,Ps,"f"))return;return void requestAnimationFrame((()=>{this.contains(document.activeElement)&&document.activeElement!==this.invokerElement||b(this,xs,"m",$s).call(this)}))}const n=t.target.closest(Js.join(","));if(null!==n&&i){if(b(this,xs,"m",Ns).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,xs,"m",Ws).call(this,t,i)}return b(this,xs,"m",Fs).call(this,t)&&(t.preventDefault(),n.click()),void b(this,xs,"m",Vs).call(this,n)}"include-fragment-replaced"===t.type&&b(this,xs,"m",Bs).call(this)}get items(){return Array.from(this.querySelectorAll(Js.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,xs,"m",Vs).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,xs,"m",Vs).call(this,e)}}};Ms=new WeakMap,Is=new WeakMap,Ds=new WeakMap,Ps=new WeakMap,Os=new WeakMap,xs=new WeakSet,Hs=function(){const{signal:t}=b(this,Ms,"f");for(const e of this.querySelectorAll(Gs.join(",")))e.addEventListener("click",b(this,xs,"m",Ns).bind(this),{signal:t}),e.addEventListener("keydown",b(this,xs,"m",Ns).bind(this),{signal:t})},Ns=function(t){if(!b(this,xs,"m",Rs).call(this,t))return!1;const e=t.target.closest(Js.join(","));return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},Fs=function(t){return t.target instanceof HTMLAnchorElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},Rs=function(t){return t instanceof MouseEvent&&"click"===t.type||b(this,xs,"m",Fs).call(this,t)},qs=function(t){t.preventDefault(),t.stopPropagation(),b(this,xs,"m",js).call(this)?b(this,xs,"m",Ks).call(this):b(this,xs,"m",Us).call(this)},Ws=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,xs,"m",js).call(this)&&b(this,xs,"m",Ks).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})},Vs=function(t){if("multiple"!==this.selectVariant&&setTimeout((()=>{b(this,xs,"m",js).call(this)&&b(this,xs,"m",Ks).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,xs,"m",zs).call(this)}else t.setAttribute("aria-checked",`${e}`);b(this,xs,"m",_s).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:t.parentElement,checked:this.isItemChecked(t.parentElement)}}))},Bs=function(){b(this,xs,"a",Ys)?.focus(),b(this,xs,"m",Hs).call(this),this.setAttribute("data-ready","true")},$s=function(){b(this,xs,"m",Ks).call(this)},Us=function(){this.popoverElement?.showPopover()},Ks=function(){this.popoverElement?.hidePopover()},js=function(){return this.popoverElement?.matches(":popover-open")},zs=function(){if("single"!==this.selectVariant)return;if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;v(this,Is,b(this,Is,"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,Is,"f")},_s=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,Ds,b(this,Ds,"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,Ds,"f"),i.value=(e.value||e.label||"").trim(),t.append(i)}for(const t of e)t.remove()}},Ys=function(){return this.querySelector(Js.join(","))},g([U],Xs.prototype,"includeFragment",void 0),g([U],Xs.prototype,"overlay",void 0),Xs=g([j],Xs),window.customElements.get("action-menu")||(window.ActionMenuElement=Xs,window.customElements.define("action-menu",Xs));const Zs="less",Qs="equal",to="greater";var eo,io,no,so,oo,ro=t=>{throw TypeError(t)},ao=(t,e,i)=>e.has(t)||ro("Cannot "+i),lo=(t,e,i)=>(ao(t,e,"read from private field"),i?i.call(t):e.get(t)),co=(t,e,i)=>e.has(t)?ro("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),uo=(t,e,i,n)=>(ao(t,e,"write to private field"),e.set(t,i),i),ho=(t,e,i)=>(ao(t,e,"access private method"),i);class mo{constructor({compareFn:t}){co(this,no),co(this,eo),co(this,io),uo(this,eo,t),uo(this,io,[])}insert(t){lo(this,io).push(t),ho(this,no,oo).call(this)}pop(){const t=lo(this,io)[0];return lo(this,io)[lo(this,io).length-1]&&(lo(this,io)[0]=lo(this,io)[lo(this,io).length-1],lo(this,io).pop()),ho(this,no,so).call(this),t}peek(){return lo(this,io)[0]}delete(t){const e=lo(this,io).indexOf(t);-1!==e&&(Lo(lo(this,io),e,lo(this,io).length-1),lo(this,io).pop(),ho(this,no,so).call(this))}clear(){uo(this,io,[])}get size(){return lo(this,io).length}}function fo(t){return 2*t+1}function po(t){return 2*t+2}function go(t){return Math.floor((t-1)/2)}function bo(t,e){return fo(t)<e}function vo(t,e){return po(t)<e}function wo(t){return t>0}function yo(t,e){return t[fo(e)]}function Eo(t,e){return t[po(e)]}function Ao(t,e){return t[go(e)]}function Lo(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}eo=new WeakMap,io=new WeakMap,no=new WeakSet,so=function(){let t=0;for(;bo(t,lo(this,io).length);){let e=fo(t);if(vo(t,lo(this,io).length)&&lo(this,eo).call(this,Eo(lo(this,io),t),yo(lo(this,io),t))===Zs&&(e=po(t)),lo(this,eo).call(this,lo(this,io)[t],lo(this,io)[e])===Zs)break;Lo(lo(this,io),t,e),t=e}},oo=function(){let t=lo(this,io).length-1;for(;wo(t)&&lo(this,eo).call(this,lo(this,io)[t],Ao(lo(this,io),t))===Zs;)Lo(lo(this,io),t,go(t)),t=go(t)};var ko,To,So,Co,xo=Object.defineProperty,Mo=t=>{throw TypeError(t)},Io=(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),Do=(t,e,i)=>e.has(t)||Mo("Cannot "+i),Po=(t,e,i)=>(Do(t,e,"read from private field"),i?i.call(t):e.get(t)),Oo=(t,e,i)=>e.has(t)?Mo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Ho=(t,e,i,n)=>(Do(t,e,"write to private field"),e.set(t,i),i);ko=Symbol.toStringTag;class No{constructor(){Io(this,ko,"Deferred"),Oo(this,To),Oo(this,So),Oo(this,Co),Ho(this,To,new Promise(((t,e)=>{Ho(this,So,t),Ho(this,Co,e)})))}then(t,e){return Promise.prototype.then.apply(Po(this,To),[t,e])}catch(t){return Promise.prototype.catch.apply(Po(this,To),[t])}finally(t){return Promise.prototype.finally.apply(Po(this,To),[t])}resolve(t){Po(this,So).call(this,t)}reject(t){Po(this,Co).call(this,t)}getPromise(){return Po(this,To)}}To=new WeakMap,So=new WeakMap,Co=new WeakMap;var Fo,Ro,qo,Wo,Vo,Bo,$o=t=>{throw TypeError(t)},Uo=(t,e,i)=>e.has(t)||$o("Cannot "+i),Ko=(t,e,i)=>(Uo(t,e,"read from private field"),i?i.call(t):e.get(t)),jo=(t,e,i)=>e.has(t)?$o("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),zo=(t,e,i,n)=>(Uo(t,e,"write to private field"),e.set(t,i),i),_o=(t,e,i)=>(Uo(t,e,"access private method"),i);class LiveRegionElement extends HTMLElement{constructor(){if(super(),jo(this,Wo),jo(this,Fo),jo(this,Ro),jo(this,qo),!this.shadowRoot){const t=function(){if(Yo)return Yo;return Yo=document.createElement("template"),Yo.innerHTML=Go,Yo}();this.attachShadow({mode:"open"}).appendChild(t.content.cloneNode(!0))}zo(this,Fo,!1),zo(this,qo,null),zo(this,Ro,new mo({compareFn:Jo}))}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 No,r={deferred:o,politeness:n,contents:t,scheduled:void 0!==i?s+i:s};return Ko(this,Ro).insert(r),_o(this,Wo,Vo).call(this),{...o.getPromise(),cancel:()=>{Ko(this,Ro).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:Xo}}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!==Ko(this,qo)&&(clearTimeout(Ko(this,qo)),zo(this,qo,null)),zo(this,Fo,!1),Ko(this,Ro).clear()}}Fo=new WeakMap,Ro=new WeakMap,qo=new WeakMap,Wo=new WeakSet,Vo=function(){if(Ko(this,Fo))return;let t=Ko(this,Ro).peek();if(!t)return;null!==Ko(this,qo)&&(clearTimeout(Ko(this,qo)),zo(this,qo,null));const e=Date.now();if(t.scheduled<=e)return t=Ko(this,Ro).pop(),t&&_o(this,Wo,Bo).call(this,t),void _o(this,Wo,Vo).call(this);const i=t.scheduled-e;zo(this,qo,window.setTimeout((()=>{zo(this,qo,null),_o(this,Wo,Vo).call(this)}),i))},Bo=function(t){zo(this,Fo,!0);const{contents:e,deferred:i,politeness:n}=t,s=this.shadowRoot?.getElementById(n);if(!s)throw zo(this,Fo,!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!==Ko(this,qo)&&clearTimeout(Ko(this,qo)),i.resolve(),this.delay>0?zo(this,qo,window.setTimeout((()=>{zo(this,qo,null),zo(this,Fo,!1),_o(this,Wo,Vo).call(this)}),this.delay)):(zo(this,qo,null),zo(this,Fo,!1),_o(this,Wo,Vo).call(this))};let Yo=null;const Go='\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 Jo(t,e){return t.politeness===e.politeness?t.scheduled===e.scheduled?Qs:t.scheduled<e.scheduled?Zs:to:"assertive"===t.politeness&&"assertive"!==e.politeness?Zs:"assertive"!==t.politeness&&"assertive"===e.politeness?to:Qs}function Xo(){}var Zo,Qo,tr,er,ir,nr,sr,or,rr,ar,lr,cr,dr,ur,hr,mr,fr,pr,gr,br,vr,wr,yr,Er,Ar,Lr,kr,Tr,Sr,Cr,xr,Mr,Ir,Dr,Pr,Or,Hr,Nr,Fr,Rr;customElements.get("live-region")||customElements.define("live-region",LiveRegionElement);const qr=['[role="option"]'],Wr=qr.join(","),Vr=qr.map((t=>`:not([hidden]) > ${t}`)).join(",");var Br,$r;!function(t){t[t.REMOTE=0]="REMOTE",t[t.EVENTUALLY_LOCAL=1]="EVENTUALLY_LOCAL",t[t.LOCAL=2]="LOCAL"}(Br||(Br={})),function(t){t[t.BODY=0]="BODY",t[t.BANNER=1]="BANNER"}($r||($r={}));const Ur=(()=>{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 Kr=class SelectPanelElement extends HTMLElement{constructor(){super(...arguments),Zo.add(this),Qo.set(this,void 0),tr.set(this,void 0),er.set(this,""),ir.set(this,""),nr.set(this,new Map),sr.set(this,null),or.set(this,null),rr.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,nr,"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=`${t}px`,this.dialog.style.left=`${e}px`,this.dialog.style.bottom="auto",this.dialog.style.right="auto"}}connectedCallback(){const{signal:t}=v(this,tr,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,Zo,"m",Pr).call(this),b(this,Zo,"m",Or).call(this),b(this,Zo,"m",ar).call(this),Ur(this),Ye(this,(()=>Boolean(this.remoteInput)),(()=>{this.remoteInput.addEventListener("loadstart",this,{signal:t}),this.remoteInput.addEventListener("loadend",this,{signal:t})})),Ye(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,Qo,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,Zo,"a",Sr)===Br.LOCAL&&b(this,Zo,"m",Er).call(this))}})),"f"),Ye(this,(()=>Boolean(this.dialog)),(()=>{b(this,Qo,"f").observe(this.dialog),this.dialog.addEventListener("close",this,{signal:t}),"true"===this.getAttribute("data-open-on-load")&&this.show()})),b(this,Zo,"a",Sr)===Br.LOCAL&&Ye(this,(()=>this.items.length>0),(()=>{b(this,Zo,"m",Er).call(this),b(this,Zo,"m",Or).call(this)}))}disconnectedCallback(){b(this,tr,"f").abort()}handleEvent(t){if(t.target===this.filterInputTextField)return void b(this,Zo,"m",yr).call(this,t);if(t.target===this.remoteInput)return void b(this,Zo,"m",vr).call(this,t);const e=this.invokerElement?.contains(t.target),i=this.closeButton?.contains(t.target),n=b(this,Zo,"m",ur).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,Zo,"m",Mr).call(this,t);if(i&&n)return;if("keydown"===t.type&&t instanceof KeyboardEvent&&t.target.closest(Vr)){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(Vr)?.parentElement;if(null!=s&&n){if(b(this,Zo,"m",cr).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,Zo,"m",Ir).call(this,t,i)}return b(this,Zo,"m",dr).call(this,t)&&(t.preventDefault(),b(this,Zo,"m",Rr).call(this,s)?.click()),void b(this,Zo,"m",Dr).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,Zo,"m",gr).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(Vr)).map((t=>t.parentElement))}get items(){return Array.from(this.querySelectorAll(Wr)).map((t=>t.parentElement))}get focusableItem(){for(const t of this.items){const e=b(this,Zo,"m",Rr).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,Zo,"m",Rr).call(this,t).setAttribute("aria-disabled","true"))}enableItem(t){t&&(t.classList.remove("ActionListItem--disabled"),b(this,Zo,"m",Rr).call(this,t).removeAttribute("aria-disabled"))}isItemHidden(t){return!!t&&t.hasAttribute("hidden")}isItemChecked(t){return!!t&&"true"===b(this,Zo,"m",Rr).call(this,t).getAttribute(this.ariaSelectionType)}checkItem(t){!t||"single"!==this.selectVariant&&"multiple"!==this.selectVariant||this.isItemChecked(t)||b(this,Zo,"m",Dr).call(this,t)}uncheckItem(t){!t||"single"!==this.selectVariant&&"multiple"!==this.selectVariant||this.isItemChecked(t)&&b(this,Zo,"m",Dr).call(this,t)}};Qo=new WeakMap,tr=new WeakMap,er=new WeakMap,ir=new WeakMap,nr=new WeakMap,sr=new WeakMap,or=new WeakMap,rr=new WeakMap,Zo=new WeakSet,ar=function(){const{signal:t}=b(this,tr,"f");for(const e of this.querySelectorAll(qr.join(",")))e.addEventListener("click",b(this,Zo,"m",cr).bind(this),{signal:t}),e.addEventListener("keydown",b(this,Zo,"m",cr).bind(this),{signal:t})},lr=function(){let t=!1;if("single"===this.selectVariant)for(const e of this.items){const i=b(this,Zo,"m",Rr).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,Zo,"m",Rr).call(this,t);e&&(e.setAttribute("tabindex","-1"),t.removeAttribute("tabindex"))}!t&&b(this,Zo,"a",Hr)&&b(this,Zo,"m",Rr).call(this,b(this,Zo,"a",Hr))?.setAttribute("tabindex","0")},cr=function(t){if(!b(this,Zo,"m",ur).call(this,t))return!1;const e=t.target.closest(Vr);return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},dr=function(t){return t.target instanceof HTMLAnchorElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},ur=function(t){return t instanceof MouseEvent&&"click"===t.type||b(this,Zo,"m",dr).call(this,t)},hr=function(){for(const t of this.items){const e=b(this,Zo,"m",Rr).call(this,t);if(!e)continue;const i=e.getAttribute("data-value");i&&b(this,nr,"f").has(i)&&e.setAttribute(this.ariaSelectionType,"true")}b(this,Zo,"m",Or).call(this)},mr=function(t){const e=b(this,Zo,"m",Rr).call(this,t);if(!e)return;const i=e.getAttribute("data-value");i&&b(this,nr,"f").set(i,{value:i,label:e.querySelector(".ActionListItem-label")?.textContent?.trim(),inputName:e.getAttribute("data-input-name")})},fr=function(t){const e=b(this,Zo,"m",Rr).call(this,t);if(!e)return;const i=e.getAttribute("data-value");i&&b(this,nr,"f").delete(i)},pr=function(){b(this,Zo,"a",Cr)&&(b(this,sr,"f")&&clearTimeout(b(this,sr,"f")),b(this,or,"f")&&clearTimeout(b(this,or,"f")),v(this,or,setTimeout((()=>{this.liveRegion.announce("Loading")}),2e3),"f"),v(this,sr,setTimeout((()=>{b(this,Zo,"a",Cr)?.showLeadingSpinner()}),1e3),"f"))},gr=function(t){switch(t.type){case"include-fragment-replaced":b(this,Zo,"m",Er).call(this);break;case"loadstart":b(this,Zo,"m",br).call(this,!1);break;case"loadend":b(this,Zo,"a",Cr)?.hideLeadingSpinner(),this.dispatchEvent(new CustomEvent("loadend"));break;case"error":{b(this,Zo,"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)},vr=function(t){switch(t.type){case"remote-input-success":b(this,Zo,"m",kr).call(this),b(this,Zo,"m",Er).call(this),b(this,Zo,"m",hr).call(this);break;case"remote-input-error":this.bodySpinner?.setAttribute("hidden",""),this.includeFragment||0===this.visibleItems.length?b(this,Zo,"m",Lr).call(this,$r.BODY):b(this,Zo,"m",Lr).call(this,$r.BANNER);break;case"loadstart":if(!b(this,Zo,"m",xr).call(this)){if(b(this,Zo,"m",kr).call(this),this.bodySpinner?.removeAttribute("hidden"),this.bodySpinner)break;b(this,Zo,"m",pr).call(this)}break;case"loadend":b(this,Zo,"a",Cr)?.hideLeadingSpinner(),b(this,or,"f")&&clearTimeout(b(this,or,"f")),b(this,sr,"f")&&clearTimeout(b(this,sr,"f")),this.dispatchEvent(new CustomEvent("loadend"))}},wr=function(t,e){return(t.getAttribute("data-filter-string")||t.textContent||"").toLowerCase().indexOf(e.toLowerCase())>-1},yr=function(t){if("keydown"===t.type){const e=t.key;if("Enter"===e){const t=this.visibleItems[0];if(t){const e=b(this,Zo,"m",Rr).call(this,t);e&&e.click()}}else if("ArrowDown"===e){const e=this.focusableItem||b(this,Zo,"m",Rr).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,Zo,"m",Rr).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,Zo,"m",Rr).call(this,e);i&&i.focus(),t.preventDefault()}}if("input"===t.type&&(this.bodySpinner||b(this,Zo,"m",xr).call(this)||b(this,Zo,"m",pr).call(this),b(this,Zo,"a",Sr)===Br.LOCAL||b(this,Zo,"a",Sr)===Br.EVENTUALLY_LOCAL)){if(this.includeFragment)return void this.includeFragment.refetch();b(this,Zo,"m",Er).call(this)}},Er=function(){if(!this.list)return;let t=!1;if(b(this,Zo,"m",xr).call(this)){const e=this.filterInputTextField?.value??"",i=this.filterFn||b(this,Zo,"m",wr);for(const n of this.items)i(n,e)?(b(this,Zo,"m",Fr).call(this,n),t=!0):b(this,Zo,"m",Nr).call(this,n)}else t=this.items.length>0;b(this,Zo,"m",lr).call(this),b(this,Zo,"m",Tr).call(this);for(const t of this.items){const e=b(this,Zo,"m",Rr).call(this,t);if(!e)continue;const i=e.getAttribute("data-value");b(this,rr,"f")?i&&!b(this,nr,"f").has(i)&&e.setAttribute(this.ariaSelectionType,"false"):i&&!b(this,nr,"f").has(i)&&this.isItemChecked(t)&&b(this,Zo,"m",mr).call(this,t)}v(this,rr,!0,"f"),this.noResults&&(b(this,Zo,"m",Ar).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")))},Ar=function(){return!(!this.fragmentErrorElement||this.fragmentErrorElement.hasAttribute("hidden"))||!!this.bannerErrorElement&&!this.bannerErrorElement.hasAttribute("hidden")},Lr=function(t){let e=this.fragmentErrorElement;t===$r.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"})},kr=function(){this.fragmentErrorElement?.setAttribute("hidden",""),this.bannerErrorElement.setAttribute("hidden","")},Tr=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)}}},Sr=function(){if(!this.list)return Br.REMOTE;switch(this.list.getAttribute("data-fetch-strategy")){case"local":return Br.LOCAL;case"eventually_local":return Br.EVENTUALLY_LOCAL;default:return Br.REMOTE}},Cr=function(){return this.filterInputTextField?.closest("primer-text-field")},xr=function(){return b(this,Zo,"a",Sr)===Br.LOCAL||b(this,Zo,"a",Sr)===Br.EVENTUALLY_LOCAL},Mr=function(t){t.preventDefault(),t.stopPropagation(),this.open?this.hide():this.show()},Ir=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})},Dr=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,Zo,"m",Rr).call(this,t)?.getAttribute("data-value")}})))return;const n=b(this,Zo,"m",Rr).call(this,t);if("single"===this.selectVariant){if(n?.getAttribute("href"))return;if(!e){for(const t of this.items)b(this,Zo,"m",Rr).call(this,t)?.setAttribute(this.ariaSelectionType,"false");b(this,nr,"f").clear(),i&&(b(this,Zo,"m",mr).call(this,t),n?.setAttribute(this.ariaSelectionType,"true")),b(this,Zo,"m",Pr).call(this)}}else n?.setAttribute(this.ariaSelectionType,`${i}`),i?b(this,Zo,"m",mr).call(this,t):b(this,Zo,"m",fr).call(this,t);b(this,Zo,"m",Or).call(this),b(this,Zo,"m",lr).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:t,checked:i,value:b(this,Zo,"m",Rr).call(this,t)?.getAttribute("data-value")}}))},Pr=function(){if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;v(this,er,b(this,er,"f")||t.textContent||"","f");const e=this.querySelector(`[${this.ariaSelectionType}=true] .ActionListItem-label`)?.textContent||b(this,er,"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,er,"f")},Or=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,rr,"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,ir,b(this,ir,"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,ir,"f"),n.value=(i.value||i.label||"").trim(),e.append(n)}for(const t of i)t.remove()}},Hr=function(){return this.querySelector(Vr)?.parentElement||null},Nr=function(t){t&&t.setAttribute("hidden","hidden")},Fr=function(t){t&&t.removeAttribute("hidden")},Rr=function(t){return t.querySelector(".ActionListContent")},g([U],Kr.prototype,"includeFragment",void 0),g([U],Kr.prototype,"dialog",void 0),g([U],Kr.prototype,"filterInputTextField",void 0),g([U],Kr.prototype,"remoteInput",void 0),g([U],Kr.prototype,"list",void 0),g([U],Kr.prototype,"noResults",void 0),g([U],Kr.prototype,"fragmentErrorElement",void 0),g([U],Kr.prototype,"bannerErrorElement",void 0),g([U],Kr.prototype,"bodySpinner",void 0),g([U],Kr.prototype,"liveRegion",void 0),Kr=g([j],Kr),window.customElements.get("select-panel")||(window.SelectPanelElement=Kr,window.customElements.define("select-panel",Kr));let jr=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 zr(t){Mt(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 Gr(t)}switch(e.key){case"ArrowUp":return _r(t,"previous");case"ArrowDown":return _r(t,"next");case"Backspace":return Gr(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 _r(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&&Yr(o,i);)o="next"===e?n.nextNode():n.previousNode();return o instanceof HTMLElement?o:void 0}function Yr(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 Gr(t){const e=t.closest("[role=group]"),i=e?.closest("[role=treeitem]");return i instanceof HTMLElement?i:void 0}var Jr,Xr,Zr,Qr,ta,ea,ia,na,sa,oa,ra;g([U],jr.prototype,"detailsTarget",void 0),g([U],jr.prototype,"summaryTarget",void 0),jr=g([j],jr),window.DetailsToggleElement=jr;let aa=class TreeViewElement extends HTMLElement{constructor(){super(...arguments),Jr.add(this),Xr.set(this,void 0)}connectedCallback(){const{signal:t}=v(this,Xr,new AbortController,"f");this.addEventListener("click",this,{signal:t}),this.addEventListener("focusin",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),zr(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,Jr,"m",Zr).call(this,t)})).observe(this,{childList:!0,subtree:!0});new MutationObserver((t=>{if(!this.formInputContainer)return;if(!t.some((t=>t.target instanceof HTMLElement&&t.target.getAttribute("aria-checked")!==t.oldValue)))return;const e=[];for(const t 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(t)},s=this.getFormInputValueForNode(t);s&&(n.value=s),i.value=JSON.stringify(n),e.push(i)}this.formInputContainer.replaceChildren(...e)})).observe(this,{childList:!0,subtree:!0,attributeFilter:["aria-checked"]}),customElements.whenDefined("tree-view-sub-tree-node").then((()=>{b(this,Jr,"m",Zr).call(this,this)}))}disconnectedCallback(){b(this,Xr,"f").abort()}handleEvent(t){const e=b(this,Jr,"m",ta).call(this,t);e&&b(this,Jr,"m",ea).call(this,e,t)}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]")}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")}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()}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}}};var la,ca;Xr=new WeakMap,Jr=new WeakSet,Zr=function(t){for(const e of t.querySelectorAll("[aria-expanded=true]"))this.expandAncestorsForNode(e)},Qr=function(t){return"click"===t.type},ta=function(t){const e=t.target,i=e.closest("[role=treeitem]");return i?e.closest(".TreeViewItemToggle")||e.closest(".TreeViewItemLeadingAction")?null:i:null},ea=function(t,e){b(this,Jr,"m",ia).call(this,e,t)?b(this,Jr,"m",na).call(this,e,t):b(this,Jr,"m",Qr).call(this,e)?b(this,Jr,"m",sa).call(this,e,t):"focusin"===e.type?b(this,Jr,"m",oa).call(this,t):e instanceof KeyboardEvent&&b(this,Jr,"m",ra).call(this,e,t)},ia=function(t,e){return"click"===t.type&&this.nodeHasCheckBox(e)},na=function(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();"leaf"===this.getNodeType(e)&&("true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.setNodeCheckedValue(e,"true"))},sa=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)})))},oa=function(t){const e=this.querySelector("[aria-selected=true]");e?.setAttribute("aria-selected","false"),t.setAttribute("aria-selected","true")},ra=function(t,e){if(e&&"leaf"===this.getNodeType(e))switch(t.key){case" ":case"Enter":if(this.getNodeDisabledValue(e)){t.preventDefault();break}this.nodeHasCheckBox(e)?(t.preventDefault(),"true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.setNodeCheckedValue(e,"true")):e instanceof HTMLAnchorElement&&e.click()}},g([U],aa.prototype,"formInputContainer",void 0),g([U],aa.prototype,"formInputPrototype",void 0),aa=g([j],aa),window.customElements.get("tree-view")||(window.TreeViewElement=aa,window.customElements.define("tree-view",aa));let da=class TreeViewIconPairElement extends HTMLElement{constructor(){super(...arguments),la.add(this)}connectedCallback(){Ye(this,(()=>Boolean(this.collapsedIcon)&&Boolean(this.expandedIcon)),(()=>{this.expanded=this.collapsedIcon.hidden}))}showExpanded(){this.expanded=!0,b(this,la,"m",ca).call(this)}showCollapsed(){this.expanded=!1,b(this,la,"m",ca).call(this)}toggle(){this.expanded=!this.expanded,b(this,la,"m",ca).call(this)}};var ua,ha,ma,fa,pa,ga,ba,va,wa,ya,Ea,Aa;la=new WeakSet,ca=function(){this.expanded?(this.expandedIcon.hidden=!1,this.collapsedIcon.hidden=!0):(this.expandedIcon.hidden=!0,this.collapsedIcon.hidden=!1)},g([U],da.prototype,"expandedIcon",void 0),g([U],da.prototype,"collapsedIcon",void 0),da=g([j],da),window.customElements.get("tree-view-icon-pair")||(window.TreeViewIconPairElement=da,window.customElements.define("tree-view-icon-pair",da));let La=class TreeViewSubTreeNodeElement extends HTMLElement{constructor(){super(...arguments),ua.add(this),ha.set(this,null),ma.set(this,"success"),fa.set(this,void 0),pa.set(this,!1)}connectedCallback(){Ye(this,(()=>Boolean(this.node)&&Boolean(this.subTree)),(()=>{b(this,ua,"m",Ea).call(this)}));const{signal:t}=v(this,fa,new AbortController,"f");this.addEventListener("click",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),Ye(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,ua,"m",ba).call(this,t)}),{signal:t})})),Ye(this,(()=>Boolean(this.retryButton)),(()=>{this.retryButton.addEventListener("click",(t=>{b(this,ua,"m",va).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,ua,"m",Ea).call(this)}get loadingState(){return b(this,ma,"f")}set loadingState(t){v(this,ma,t,"f"),b(this,ua,"m",Ea).call(this)}get selectStrategy(){return this.node.getAttribute("data-select-strategy")||"descendants"}disconnectedCallback(){b(this,fa,"f").abort()}handleEvent(t){t.target===this.toggleButton?b(this,ua,"m",ga).call(this,t):t.target===this.includeFragment?b(this,ua,"m",ba).call(this,t):t instanceof KeyboardEvent?b(this,ua,"m",wa).call(this,t):t.target.closest("[role=treeitem]")===this.node&&"click"===t.type&&b(this,ua,"a",Aa)&&b(this,ua,"m",ya).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"),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}*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}))}}};ha=new WeakMap,ma=new WeakMap,fa=new WeakMap,pa=new WeakMap,ua=new WeakSet,ga=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,pa,document.activeElement===this.loadingIndicator.closest("[role=treeitem]"),"f"),this.loadingState="success";break;case"include-fragment-replaced":if(this.expanded=!0,b(this,pa,"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,pa,!1,"f")}},va=function(t){"click"===t.type&&(this.loadingState="loading",this.includeFragment.refetch())},wa=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,ua,"a",Aa)?this.toggleChecked():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,ua,"a",Aa)?(t.stopPropagation(),t.preventDefault(),this.toggleChecked()):e instanceof HTMLAnchorElement?e.click():this.treeView?.nodeHasNativeAction(e)||this.toggle()}},ya=function(t){this.treeView?.getNodeDisabledValue(this.node)?t.preventDefault():"click"===t.type&&(this.toggleChecked(),t.stopPropagation())},Ea=function(){switch(this.expanded?(this.subTree&&(this.subTree.hidden=!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),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)}},Aa=function(){return this.querySelector(".TreeViewItemCheckbox")},g([U],La.prototype,"node",void 0),g([U],La.prototype,"subTree",void 0),g([U],La.prototype,"iconPair",void 0),g([U],La.prototype,"toggleButton",void 0),g([U],La.prototype,"expandedToggleIcon",void 0),g([U],La.prototype,"collapsedToggleIcon",void 0),g([U],La.prototype,"includeFragment",void 0),g([U],La.prototype,"loadingIndicator",void 0),g([U],La.prototype,"loadingFailureMessage",void 0),g([U],La.prototype,"retryButton",void 0),La=g([j],La),window.customElements.get("tree-view-sub-tree-node")||(window.TreeViewSubTreeNodeElement=La,window.customElements.define("tree-view-sub-tree-node",La));let ka=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})}};ka=g([j],ka),window.customElements.get("tree-view-include-fragment")||(window.TreeViewIncludeFragmentElement=ka,window.customElements.define("tree-view-include-fragment",ka))}();
2
2
  //# sourceMappingURL=primer_view_components.js.map