@primer/view-components 0.3.0-rc.4cd86fc0 → 0.3.0-rc.580c3e37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var t,e,n,i,o,s,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,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n};const u=new WeakMap;let d=null;class IncludeFragmentElement extends HTMLElement{static setCSPTrustedTypesPolicy(t){d=null===t?t:Promise.resolve(t)}static get observedAttributes(){return["src","loading"]}get src(){const t=this.getAttribute("src");if(t){const e=this.ownerDocument.createElement("a");return e.href=t,e.href}return""}set src(t){this.setAttribute("src",t)}get loading(){return"lazy"===this.getAttribute("loading")?"lazy":"eager"}set loading(t){this.setAttribute("loading",t)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",t)}get data(){return l(this,t,"m",s).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)}constructor(){super(),t.add(this),e.set(this,!1),n.set(this,new IntersectionObserver((e=>{for(const o of e)if(o.isIntersecting){const{target:e}=o;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}));const o=this.attachShadow({mode:"open"}),s=document.createElement("style");s.textContent=":host {display: block;}",o.append(s,document.createElement("slot"))}connectedCallback(){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",s).call(this)}fetch(t){return fetch(t)}refetch(){u.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",o).call(this);if(n instanceof Error)throw n;const i=n,s=document.createElement("template");s.innerHTML=i;const r=document.importNode(s.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")}}},o=async function(){const e=this.src,n=u.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")),u.set(this,{src:e,data:n}),n}},s=async function(){const e=await l(this,t,"m",o).call(this);if(e instanceof Error)throw e;return e.toString()},r=async function(t){await new Promise((t=>setTimeout(t,0)));for(const e of t)this.dispatchEvent(new Event(e))},a=async function(){try{await l(this,t,"m",r).call(this,["loadstart"]);const n=await this.fetch(this.request());if(200!==n.status)throw new Error(`Failed to load resource: the server responded with a status of ${n.status}`);const 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}`);const o=await n.text();let s=o;if(d){s=(await d).createHTML(o,n)}return l(this,t,"m",r).call(this,["load","loadend"]),s}catch(e){throw l(this,t,"m",r).call(this,["error","loadend"]),e}var e},window.customElements.get("include-fragment")||(window.IncludeFragmentElement=IncludeFragmentElement,window.customElements.define("include-fragment",IncludeFragmentElement));var h=class extends Event{constructor(t,{oldState:e="",newState:n="",...i}={}){super(t,i),this.oldState=String(e||""),this.newState=String(n||"")}},f=new WeakMap;function m(t,e,n){f.set(t,setTimeout((()=>{f.has(t)&&t.dispatchEvent(new h("toggle",{cancelable:!1,oldState:e,newState:n}))}),0))}var p=new WeakMap,g=new WeakMap,b=new WeakMap;function v(t){return b.get(t)||"hidden"}var w=new WeakMap;function y(t,e){return("auto"===t.popover||"manual"===t.popover)&&(!!t.isConnected&&((!e||"showing"===v(t))&&(!(!e&&"hidden"!==v(t))&&(!(t instanceof HTMLDialogElement&&t.hasAttribute("open"))&&document.fullscreenElement!==t))))}function E(t){return t?Array.from(g.get(t.ownerDocument)||[]).indexOf(t)+1:0}function A(t){const e=L(t),n=function(t){for(;t;){const e=t.popoverTargetElement;if(e)return e;if((t=t.parentElement||t.getRootNode())instanceof ShadowRoot&&(t=t.host),t instanceof Document)return}}(t);return E(e)>E(n)?e:n}function k(t){const e=g.get(t);for(const t of e||[]){if(t.isConnected)return t;e.delete(t)}return null}function L(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===b.get(t))return t;if((t=t.parentElement||t.getRootNode())instanceof ShadowRoot&&(t=t.host),t instanceof Document)return}}function T(t){return!t.hidden&&((!(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)&&-1!==t.tabIndex)))}function M(t){(function(t){if(t.shadowRoot&&!0!==t.shadowRoot.delegatesFocus)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);const n=e.querySelector("[autofocus]");if(n)return n;const i=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let o=i.currentNode;for(;o;){if(T(o))return o;o=i.nextNode()}})(t)?.focus()}var x=new WeakMap;function S(t){if(!y(t,!1))return;const e=t.ownerDocument;if(!t.dispatchEvent(new h("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"})))return;if(!y(t,!1))return;let n=!1;if("auto"===t.popover){const n=t.getAttribute("popover");if(I(function(t){const e=new Map;let n=0;const i=t.ownerDocument;for(const t of g.get(i)||[])e.set(t,n),n+=1;e.set(t,n),n+=1;let o=null;return function(t){const n=L(t);if(null===n)return null;const i=e.get(n);(null===o||e.get(o)<i)&&(o=n)}(t?.parentElement),o}(t)||e,!1,!0),n!==t.getAttribute("popover")||!y(t,!1))return}k(e)||(n=!0),x.delete(t);const i=e.activeElement;t.classList.add(":popover-open"),b.set(t,"showing"),p.has(e)||p.set(e,new Set),p.get(e).add(t),M(t),"auto"===t.popover&&(g.has(e)||g.set(e,new Set),g.get(e).add(t),R(w.get(t),!0)),n&&i&&"auto"===t.popover&&x.set(t,i),m(t,"closed","open")}function C(t,e=!1,n=!1){if(!y(t,!0))return;const i=t.ownerDocument;if("auto"===t.popover&&(I(t,e,n),!y(t,!0)))return;if(R(w.get(t),!1),w.delete(t),n&&(t.dispatchEvent(new h("beforetoggle",{oldState:"open",newState:"closed"})),!y(t,!0)))return;p.get(i)?.delete(t),g.get(i)?.delete(t),t.classList.remove(":popover-open"),b.set(t,"hidden"),n&&m(t,"open","closed");const o=x.get(t);o&&(x.delete(t),e&&o.focus())}function D(t,e=!1,n=!1){let i=k(t);for(;i;)C(i,e,n),i=k(t)}function I(t,e,n){const i=t.ownerDocument||t;if(t instanceof Document)return D(i,e,n);let o=null,s=!1;for(const e of g.get(i)||[])if(e===t)s=!0;else if(s){o=e;break}if(!s)return D(i,e,n);for(;o&&"showing"===v(o)&&g.get(i)?.size;)C(o,e,n)}var O=new WeakMap;function H(t){if(!t.isTrusted)return;const e=t.composedPath()[0];if(!e)return;const n=e.ownerDocument;if(!k(n))return;const i=A(e);if(i&&"pointerdown"===t.type)O.set(n,i);else if("pointerup"===t.type){const t=O.get(n)===i;O.delete(n),t&&I(i||n,!1,!0)}}var P=new WeakMap;function R(t,e=!1){if(!t)return;P.has(t)||P.set(t,t.getAttribute("aria-expanded"));const n=t.popoverTargetElement;if(n&&"auto"===n.popover)t.setAttribute("aria-expanded",String(e));else{const e=P.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}function F(t,e,n){const i=t[e];Object.defineProperty(t,e,{value(t){return i.call(this,n(t))}})}var q=/(^|[^\\]):popover-open\b/g;"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){function t(t){return t.includes(":popover-open")&&(t=t.replace(q,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||h,F(Document.prototype,"querySelector",t),F(Document.prototype,"querySelectorAll",t),F(Element.prototype,"querySelector",t),F(Element.prototype,"querySelectorAll",t),F(Element.prototype,"matches",t),F(Element.prototype,"closest",t),F(DocumentFragment.prototype,"querySelectorAll",t),F(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){this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(){S(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){C(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t){"showing"===b.get(this)&&void 0===t||!1===t?C(this,!0,!0):void 0!==t&&!0!==t||S(this)}}});const e=new WeakMap;function n(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),e.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),e.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=e.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return e.delete(this),null;const n=this.getRootNode(),i=this.getAttribute("popovertarget");return(n instanceof Document||n instanceof ShadowRoot)&&i&&n.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)}}})}n(HTMLButtonElement),n(HTMLInputElement);const i=t=>{if(!t.isTrusted)return;const e=t.composedPath()[0];if(!(e instanceof Element)||e?.shadowRoot)return;const n=e.getRootNode();if(!(n instanceof ShadowRoot||n instanceof Document))return;const i=e.closest("[popovertargetaction],[popovertarget]");i&&function(t){const e=t.popoverTargetElement;if(!e)return;const n=v(e);"show"===t.popoverTargetAction&&"showing"===n||"hide"===t.popoverTargetAction&&"hidden"===n||("showing"===n?C(e,!0,!0):y(e,!1)&&(w.set(e,t),S(e)))}(i)},o=t=>{const e=t.key,n=t.target;!n||"Escape"!==e&&"Esc"!==e||I(n.ownerDocument,!0,!0)};(t=>{t.addEventListener("click",i),t.addEventListener("keydown",o),t.addEventListener("pointerdown",H),t.addEventListener("pointerup",H)})(document)}();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=[N(t,"compositionstart",(t=>Z(this,t))),N(t,"compositionend",(t=>Z(this,t))),N(t,"click",(e=>V(t,e))),N(t,"change",(e=>V(t,e))),N(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=W.get(e);if(!i||i.isComposing)return;const o=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(G(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Y(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Y(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(z&&n.ctrlKey){const e=Y(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(z&&n.ctrlKey){const e=Y(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&U(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),N(t,"toggle",(()=>B(t,this)),{once:!0}),N(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?N(t,"mouseover",(()=>B(t,this)),{once:!0}):$,...j(t)];W.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=W.get(this);if(t){W.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const W=new WeakMap,$={unsubscribe(){}};function N(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function B(t,e){const n=e.getAttribute("src");if(!n)return;const i=W.get(e);if(!i)return;if(i.loaded)return;i.loaded=!0;const o=e.querySelector("include-fragment");o&&!o.hasAttribute("src")&&(o.addEventListener("loadend",(()=>K(t))),o.setAttribute("src",n))}function j(t){let e=!1;return[N(t,"mousedown",(()=>e=!0)),N(t,"keydown",(()=>e=!1)),N(t,"toggle",(()=>{t.hasAttribute("open")&&(K(t)||e||function(t){const e=document.activeElement;if(e&&U(e)&&t.contains(e))return;const n=Y(t,!0);n&&n.focus()}(t))}))]}function K(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function Y(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),i=document.activeElement,o=i instanceof HTMLElement?n.indexOf(i):-1,s=e?n[o+1]:n[o-1],r=e?n[0]:n[n.length-1];return s||r}const z=navigator.userAgent.match(/Macintosh/);function V(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||X(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&X(e,t)}}function X(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")&&G(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function U(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function G(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Z(t,e){const n=W.get(t);n&&(n.isComposing="compositionstart"===e.type)}function _(t,e,n,i){var o,s=arguments.length,r=s<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--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,n,r):o(e,n))||r);return s>3&&r&&Object.defineProperty(e,n,r),r}function J(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 Q(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const tt={"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"]},et={start:["end","center"],end:["start","center"],center:["end","start"]};function nt(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),o=function(t){let e=t;for(;null!==e&&e!==document.body;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const n=e!==document.body&&e instanceof HTMLElement?e:document.body,i=n.getBoundingClientRect(),o=getComputedStyle(n),[s,r,a,l]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:i.top+s,left:i.left+r,width:i.width-a-r,height:Math.max(i.height-s-l,n===document.body?window.innerHeight:-1/0)}}(i),s=getComputedStyle(i),r=i.getBoundingClientRect(),[a,l]=[s.borderTopWidth,s.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,i,{side:o,align:s,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 u=lt(n,i,o,s,a,l),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=tt[o];let f=0;if(r){let t=o;for(;f<r.length&&ct(t,u,c,n);){const o=r[f++];t=o,u=lt(n,i,o,s,a,l),u.top-=e.top,u.left-=e.left,d=o}}const m=et[s];let p=0;if(m){let t=s;for(;p<m.length&&ut(t,u,c,n);){const o=m[p++];t=o,u=lt(n,i,d,o,a,l),u.top-=e.top,u.left-=e.left,h=o}}u.top<c.top&&(u.top=c.top),u.left<c.left&&(u.left=c.left),u.left+n.width>t.width+c.left&&(u.left=t.width+c.left-n.width),r&&f<r.length&&u.top+n.height>t.height+c.top&&(u.top=t.height+c.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(o,{top:r.top+a,left:r.left+l},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,i,o,s;const r=null!==(e=t.side)&&void 0!==e?e:it,a=null!==(n=t.align)&&void 0!==n?n:ot;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:st,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?rt:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:at}}(n))}const it="outside-bottom",ot="start",st=4,rt=4,at=!1;function lt(t,e,n,i,o,s){const r=e.left+e.width,a=e.top+e.height;let l=-1,c=-1;return"outside-top"===n?l=e.top-o-t.height:"outside-bottom"===n?l=a+o:"outside-left"===n?c=e.left-o-t.width:"outside-right"===n&&(c=r+o),"outside-top"!==n&&"outside-bottom"!==n||(c="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s),"outside-left"!==n&&"outside-right"!==n||(l="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?l=e.top+o:"inside-bottom"===n?l=a-o-t.height:"inside-left"===n?c=e.left+o:"inside-right"===n?c=r-o-t.width:"inside-center"===n&&(c=(r+e.left)/2-t.width/2+o),"inside-top"===n||"inside-bottom"===n?c="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s:"inside-left"!==n&&"inside-right"!==n&&"inside-center"!==n||(l="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:l,left:c}}function ct(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 ut(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 dt(t,e=!1){return function*(t,e={}){var n,i;const o=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(i=e.onlyTabbable)&&void 0!==i&&i?ft:ht,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&s(t,o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&s(t,o)&&(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&&s(t,o)&&(yield t)}(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function ht(t,e=!1){const n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,i=t.hidden,o=t instanceof HTMLInputElement&&"hidden"===t.type,s=t.classList.contains("sentinel");if(n||i||o||s)return!1;if(e){const e=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(getComputedStyle(t).visibility),i=0===t.getClientRects().length;if(e||n||i)return!1}return null!=t.getAttribute("tabindex")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex}function ft(t,e=!1){return ht(t,e)&&"-1"!==t.getAttribute("tabindex")}let mt=!1;function pt(){}try{const t=Object.create({},{signal:{get(){mt=!0}}});window.addEventListener("test",pt,t),window.removeEventListener("test",pt,t)}catch(t){}mt||(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)}}(),mt=!0);const gt=[];let bt;function vt(t,e,n){const i=new AbortController,o=null!=n?n:i.signal;t.setAttribute("data-focus-trap","active");const s=document.createElement("span");s.setAttribute("class","sentinel"),s.setAttribute("tabindex","0"),s.setAttribute("aria-hidden","true"),s.onfocus=()=>{const e=dt(t,!0);null==e||e.focus()};const r=document.createElement("span");let a;function l(n){if(n instanceof HTMLElement&&document.contains(t)){if(t.contains(n))return void(a=n);if(a&&ft(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=dt(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=dt(t);null==e||e.focus()},t.prepend(s),t.append(r);const c=function(t){const e=new AbortController;return t.addEventListener("abort",(()=>{e.abort()})),e}(o);if(bt){const t=bt;bt.container.setAttribute("data-focus-trap","suspended"),bt.controller.abort(),gt.push(t)}c.signal.addEventListener("abort",(()=>{bt=void 0})),o.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=gt.findIndex((e=>e.container===t));n>=0&&gt.splice(n,1),function(){const t=gt.pop();t&&vt(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{l(t.target)}),{signal:c.signal,capture:!0}),l(document.activeElement),bt={container:t,controller:c,initialFocus:e,originalSignal:o};const u=gt.findIndex((e=>e.container===t));if(u>=0&&gt.splice(u,1),!n)return i}var wt,yt;const Et=(()=>{const t=new Set;let e=null,n=null;function i(){for(const e of t)e.update()}return o=>{window.addEventListener("resize",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(o.ownerDocument.documentElement),e.observe(o)}})();class AnchoredPositionElement extends HTMLElement{constructor(){super(...arguments),wt.set(this,null),yt.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(J(this,wt,"f"))return J(this,wt,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){Q(this,wt,t,"f"),J(this,wt,"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())),Et(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(J(this,yt,"f")),Q(this,yt,requestAnimationFrame((()=>{const t=this.anchorElement;if(!t)return;const{left:e,top:n,anchorSide:i,anchorAlign:o}=nt(this,t,this);this.style.top=`${n}px`,this.style.left=`${e}px`,this.classList.remove("Overlay--anchorAlign-start","Overlay--anchorAlign-center","Overlay--anchorAlign-end","Overlay--anchorSide-insideTop","Overlay--anchorSide-insideBottom","Overlay--anchorSide-insideLeft","Overlay--anchorSide-insideRight","Overlay--anchorSide-insideCenter","Overlay--anchorSide-outsideTop","Overlay--anchorSide-outsideLeft","Overlay--anchorSide-outsideRight"),this.classList.add(`Overlay--anchorAlign-${o}`,`Overlay--anchorSide-${i}`)})),"f"))}}var At,kt,Lt;wt=new WeakMap,yt=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));const Tt='[role="menuitem"],[role="menuitemcheckbox"],[role="menuitemradio"]',Mt=t=>{var e;return null===(e=t.textContent)||void 0===e?void 0:e.trim()[0].toLowerCase()},xt=/^\S$/;class FocusGroupElement extends HTMLElement{constructor(){super(...arguments),At.add(this),kt.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(){Q(this,kt,new AbortController,"f");const{signal:t}=J(this,kt,"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(){var t;null===(t=J(this,kt,"f"))||void 0===t||t.abort()}handleEvent(t){const{direction:e,nowrap:n}=this;if("focusin"===t.type){if(this.retain&&t.target instanceof Element&&t.target.matches(Tt))for(const e of J(this,At,"a",Lt))e.setAttribute("tabindex",e===t.target?"0":"-1")}else if(t instanceof KeyboardEvent){const i=Array.from(J(this,At,"a",Lt));let o=i.indexOf(t.target);const s=t.key;if("Up"===s||"ArrowUp"===s)"vertical"!==e&&"both"!==e||(o-=o<0?0:1,t.preventDefault());else if("Down"===s||"ArrowDown"===s)"vertical"!==e&&"both"!==e||(o+=1,t.preventDefault());else if("Left"===t.key||"ArrowLeft"===t.key)"horizontal"!==e&&"both"!==e||(o-=1,t.preventDefault());else if("Right"===t.key||"ArrowRight"===t.key)"horizontal"!==e&&"both"!==e||(o+=1,t.preventDefault());else if("Home"===t.key||"PageUp"===t.key)o=0,t.preventDefault();else if("End"===t.key||"PageDown"===t.key)o=i.length-1,t.preventDefault();else{if(!this.mnemonics||!xt.test(s))return;{const e=s.toLowerCase(),r=o>0&&Mt(t.target)===e?o:0;o=i.findIndex(((t,n)=>n>r&&Mt(t)===e)),o<0&&!n&&(o=i.findIndex((t=>Mt(t)===e)))}}n&&o<0&&(o=0),!n&&o>=i.length&&(o=0);const r=i.at(Math.min(o,i.length-1));{let t=r;do{t=t.closest("[popover]:not(:popover-open)"),"auto"===(null==t?void 0:t.popover)&&t.showPopover(),t=(null==t?void 0:t.parentElement)||null}while(t)}null==r||r.focus()}}}kt=new WeakMap,At=new WeakSet,Lt=function(){return this.querySelectorAll(Tt)},customElements.get("focus-group")||(window.FocusGroupElement=FocusGroupElement,customElements.define("focus-group",FocusGroupElement));const St=new WeakMap,Ct=new WeakMap,Dt=new WeakMap;function It(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=Dt.get(e)||{};if(!n||!i)return;let o=0,s=0;if(t instanceof KeyboardEvent)"ArrowUp"===t.key?s=-1:"ArrowDown"===t.key?s=1:"ArrowLeft"===t.key?o=-1:"ArrowRight"===t.key&&(o=1);else if(Ct.has(e)&&t instanceof MouseEvent){const n=Ct.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(Ct.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=Ct.get(e);o=n-r,s=i-a}if(0!==o||0!==s){const t=Math.min(Math.max(0,n.offsetLeft+o),i.width-n.offsetWidth),r=Math.min(Math.max(0,n.offsetTop+s),i.height-n.offsetHeight);n.style.left=`${t}px`,n.style.top=`${r}px`,Wt(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)Ct.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];Ct.set(e,{dragStartX:n,dragStartY:i})}}function Ot(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=Ht(e);if(!(n instanceof ImageCropElement))return;const{box:i}=Dt.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return Ft(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,St.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=St.get(n);if(!e)return;s=t.pageX-e.startX-o.left-window.pageXOffset,r=t.pageY-e.startY-o.top-window.pageYOffset}else if(t instanceof TouchEvent){const e=St.get(n);if(!e)return;s=t.changedTouches[0].pageX-e.startX-o.left-window.pageXOffset,r=t.changedTouches[0].pageY-e.startY-o.top-window.pageYOffset}s&&r&&Rt(n,s,r,!(t instanceof KeyboardEvent))}function Ht(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function Pt(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=Ht(e);if(!(n instanceof ImageCropElement))return;const{box:i}=Dt.get(n)||{};if(!i)return;const o=t.target;if(o instanceof HTMLElement)if(o.hasAttribute("data-direction")){const e=o.getAttribute("data-direction")||"";n.addEventListener("mousemove",Ot),n.addEventListener("touchmove",Ot,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),St.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),Ot(t)}else n.addEventListener("mousemove",It),n.addEventListener("touchmove",It,{passive:!0})}function Rt(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=St.get(t);if(!s)return;const{box:r,image:a}=Dt.get(t)||{};if(!r||!a)return;o=Math.min(o,n>0?a.height-s.startY:s.startY,e>0?a.width-s.startX:s.startX);const l=i?Math.round(Math.max(0,e>0?s.startX:s.startX-o)):r.offsetLeft,c=i?Math.round(Math.max(0,n>0?s.startY:s.startY-o)):r.offsetTop;r.style.left=`${l}px`,r.style.top=`${c}px`,r.style.width=`${o}px`,r.style.height=`${o}px`,Wt(t,{x:l,y:c,width:o,height:o})}function Ft(t){const{image:e}=Dt.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);St.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),Rt(t,n,n)}function qt(t){const e=t.currentTarget;e instanceof ImageCropElement&&(Ct.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",Ot),e.removeEventListener("mousemove",It),e.removeEventListener("touchmove",Ot),e.removeEventListener("touchmove",It))}function Wt(t,e){const{image:n}=Dt.get(t)||{};if(!n)return;const i=n.naturalWidth/n.width;for(const n in e){const o=Math.round(e[n]*i);e[n]=o;const s=t.querySelector(`[data-image-crop-input='${n}']`);s instanceof HTMLInputElement&&(s.value=o.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class ImageCropElement extends HTMLElement{connectedCallback(){if(Dt.has(this))return;const t=this.attachShadow({mode:"open"});t.innerHTML='\n<style>\n :host { touch-action: none; display: block; }\n :host(.nesw) { cursor: nesw-resize; }\n :host(.nwse) { cursor: nwse-resize; }\n :host(.nesw) .crop-box, :host(.nwse) .crop-box { cursor: inherit; }\n :host([loaded]) .crop-image { display: block; }\n :host([loaded]) ::slotted([data-loading-slot]), .crop-image { display: none; }\n\n .crop-wrapper {\n position: relative;\n font-size: 0;\n }\n .crop-container {\n user-select: none;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n overflow: hidden;\n z-index: 1;\n top: 0;\n width: 100%;\n height: 100%;\n }\n\n :host([rounded]) .crop-box {\n border-radius: 50%;\n box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.3);\n }\n .crop-box {\n position: absolute;\n border: 1px dashed #fff;\n box-sizing: border-box;\n cursor: move;\n }\n\n :host([rounded]) .crop-outline {\n outline: none;\n }\n .crop-outline {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n outline: 4000px solid rgba(0, 0, 0, .3);\n }\n\n .handle { position: absolute; }\n :host([rounded]) .handle::before { border-radius: 50%; }\n .handle:before {\n position: absolute;\n display: block;\n padding: 4px;\n transform: translate(-50%, -50%);\n content: \' \';\n background: #fff;\n border: 1px solid #767676;\n }\n .ne { top: 0; right: 0; cursor: nesw-resize; }\n .nw { top: 0; left: 0; cursor: nwse-resize; }\n .se { bottom: 0; right: 0; cursor: nwse-resize; }\n .sw { bottom: 0; left: 0; cursor: nesw-resize; }\n</style>\n<slot></slot>\n<div class="crop-wrapper">\n <img width="100%" class="crop-image" alt="">\n <div class="crop-container">\n <div data-crop-box class="crop-box">\n <div class="crop-outline"></div>\n <div data-direction="nw" class="handle nw"></div>\n <div data-direction="ne" class="handle ne"></div>\n <div data-direction="sw" class="handle sw"></div>\n <div data-direction="se" class="handle se"></div>\n </div>\n </div>\n</div>\n';const e=t.querySelector("[data-crop-box]");if(!(e instanceof HTMLElement))return;const n=t.querySelector("img");n instanceof HTMLImageElement&&(Dt.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,Ft(this)})),this.addEventListener("mouseleave",qt),this.addEventListener("touchend",qt),this.addEventListener("mouseup",qt),e.addEventListener("mousedown",Pt),e.addEventListener("touchstart",Pt,{passive:!0}),this.addEventListener("keydown",It),this.addEventListener("keydown",Ot),this.src&&(n.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,n){const{image:i}=Dt.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}var $t,Nt,Bt,jt;function Kt(t){document.activeElement!==t&&(null==t||t.focus())}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const Yt=[];function zt(t){const e=t.target,n=null==e?void 0:e.closest("button");if(!n||n.hasAttribute("disabled")||"true"===n.getAttribute("aria-disabled"))return;let i=null==n?void 0: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()}const o=Yt[Yt.length-1];o&&(i=n.getAttribute("data-close-dialog-id"),i===o.id&&(Yt.pop(),o.close()),i=n.getAttribute("data-submit-dialog-id"),i===o.id&&(Yt.pop(),o.close(!0)))}function Vt(t){!(t instanceof KeyboardEvent&&"keydown"===t.type&&"Enter"===t.key)||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey||zt(t)}function Xt(t){const e=t.target;if(null==e?void 0:e.closest("button"))return;const n=Yt[Yt.length-1];if(!n)return;!e.closest(`#${n.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",(t=>{t.target===e&&(Yt.pop(),n.close())}),{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),$t.add(this),Nt.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){var e,n,i,o;if(t){if(this.open)return;this.setAttribute("open",""),this.setAttribute("aria-disabled","false"),null===(e=J(this,$t,"a",Bt))||void 0===e||e.classList.remove("Overlay--hidden"),document.body.style.paddingRight=window.innerWidth-document.body.clientWidth+"px",document.body.style.overflow="hidden",J(this,Nt,"f").signal.aborted&&Q(this,Nt,new AbortController,"f"),vt(this,void 0,J(this,Nt,"f").signal),Yt.push(this)}else{if(!this.open)return;this.removeAttribute("open"),this.setAttribute("aria-disabled","true"),null===(n=J(this,$t,"a",Bt))||void 0===n||n.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",J(this,Nt,"f").abort();const t=(null===(i=this.openButton)||void 0===i?void 0:i.closest("details"))||(null===(o=this.openButton)||void 0===o?void 0:o.closest("action-menu"));Kt(t?dt(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",zt),document.addEventListener("keydown",Vt),document.addEventListener("mousedown",Xt),this.addEventListener("keydown",(t=>J(this,$t,"m",jt).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}}Nt=new WeakMap,$t=new WeakSet,Bt=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},jt=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));const Ut=new WeakSet;function Gt(t){Jt(t),_t(t)}const Zt=new WeakMap;function _t(t=document){if(Zt.has(t))return Zt.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)ee(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&Jt(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const i={get closed(){return e},unsubscribe(){e=!0,Zt.delete(t),n.disconnect()}};return Zt.set(t,i),i}function Jt(t){for(const e of t.querySelectorAll("[data-action]"))ee(e);t instanceof Element&&t.hasAttribute("data-action")&&ee(t)}function Qt(t){const e=t.currentTarget;for(const n of te(e))if(t.type===n.type){const i=e.closest(n.tag);Ut.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const o=e.getRootNode();if(o instanceof ShadowRoot&&Ut.has(o.host)&&o.host.matches(n.tag)){const e=o.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*te(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 ee(t){for(const e of te(t))t.addEventListener(e.type,Qt)}const ne=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),ie=(t,e="property")=>{const n=ne(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const oe="attr",se=new WeakSet;function re(t,e){if(se.has(t))return;se.add(t);const n=Object.getPrototypeOf(t),i=n?.constructor?.attrPrefix??"data-";e||(e=ce(n,oe));for(const n of e){const e=t[n],o=ie(`${i}${n}`);let s={configurable:!0,get(){return this.getAttribute(o)||""},set(t){this.setAttribute(o,t||"")}};"number"==typeof e?s={configurable:!0,get(){return Number(this.getAttribute(o)||0)},set(t){this.setAttribute(o,t)}}:"boolean"==typeof e&&(s={configurable:!0,get(){return this.hasAttribute(o)},set(t){this.toggleAttribute(o,t)}}),Object.defineProperty(t,n,s),n in t&&!t.hasAttribute(o)&&s.set.call(t,e)}}const ae=Symbol.for("catalyst");class le{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 o=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,n,i){e.attributeChangedCallback(this,t,n,i,o)};let s=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return e.observedAttributes(this,s)},set(t){s=t}}),function(t){let e=t.observedAttributes||[];const n=t.attrPrefix??"data-",i=t=>ie(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...ce(t.prototype,oe)].map(i).concat(e),set(t){e=t}})}(t),function(t){const e=ne(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),re(t),function(t){Ut.add(t),t.shadowRoot&&Gt(t.shadowRoot),Jt(t),_t(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&Gt(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,i,o){re(t),"data-catalyst"!==e&&o&&o.call(t,e,n,i)}}function ce(t,e){if(!Object.prototype.hasOwnProperty.call(t,ae)){const e=t[ae],n=t[ae]=new Map;if(e)for(const[t,i]of e)n.set(t,new Set(i))}const n=t[ae];return n.has(e)||n.set(e,new Set),n.get(e)}function ue(t,e){ce(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 de(t,e){ce(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 o of t.shadowRoot.querySelectorAll(`[data-targets~="${n}.${e}"]`))o.closest(n)||i.push(o);for(const o of t.querySelectorAll(`[data-targets~="${n}.${e}"]`))o.closest(n)===t&&i.push(o);return i}(this,e)}})}function he(t){new le(t)}var fe,me,pe,ge,be,ve,we,ye;new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),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)}));let Ee=class NavListElement extends HTMLElement{constructor(){super(...arguments),fe.add(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")||""}selectItemById(t){if(!t)return!1;const e=J(this,fe,"m",pe).call(this,t);return!!e&&(J(this,fe,"m",ve).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=J(this,fe,"m",ge).call(this,t);return!!e&&(J(this,fe,"m",ve).call(this,e),!0)}selectItemByCurrentLocation(){const t=J(this,fe,"m",be).call(this);return!!t&&(J(this,fe,"m",ve).call(this,t),!0)}expandItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false"),t.focus()}itemIsExpanded(t){return"A"===(null==t?void 0:t.tagName)||"true"===(null==t?void 0: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()}async showMore(t){var e,n;if(t.preventDefault(),this.showMoreDisabled)return;let i;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const e=await fetch(t);if(!e.ok)return;i=await e.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const o=J(this,fe,"m",me).call(this,document,i);null===(e=null==o?void 0:o.querySelector("li > a"))||void 0===e||e.setAttribute("data-targets","nav-list.focusMarkers");const s=t.target.closest("button").getAttribute("data-list-id");document.getElementById(s).append(o),null===(n=this.focusMarkers.pop())||void 0===n||n.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}};var Ae,ke;fe=new WeakSet,me=function(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)},pe=function(t){var e;for(const n of this.items){if(n.classList.contains("ActionListItem--hasSubItem"))continue;if(((null===(e=n.getAttribute("data-item-id"))||void 0===e?void 0:e.split(" "))||[]).includes(t))return n}return null},ge=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},be=function(){return J(this,fe,"m",ge).call(this,window.location.pathname)},ve=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&J(this,fe,"m",we).call(this,e),t.classList.add("ActionListItem--navActive"),t.children.length>0&&t.children[0].setAttribute("aria-current","page");const n=J(this,fe,"m",ye).call(this,t);n&&(this.expandItem(n),n.classList.add("ActionListContent--hasActiveSubItem"))},we=function(t){t.classList.remove("ActionListItem--navActive"),t.children.length>0&&t.children[0].removeAttribute("aria-current");const e=J(this,fe,"m",ye).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},ye=function(t){var e;if(!t.classList.contains("ActionListItem--subItem"))return null;const n=null===(e=t.closest("li.ActionListItem--hasSubItem"))||void 0===e?void 0:e.querySelector("button.ActionListContent");return n||null},_([de],Ee.prototype,"items",void 0),_([ue],Ee.prototype,"showMoreItem",void 0),_([de],Ee.prototype,"focusMarkers",void 0),Ee=_([he],Ee);let Le=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),Ae.add(this)}connectedCallback(){J(this,Ae,"m",ke).call(this)}select(t){var e,n;const i=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),null===(e=t.querySelector("[aria-current]"))||void 0===e||e.setAttribute("aria-current","false");null===(n=i.closest("li.SegmentedControl-item"))||void 0===n||n.classList.add("SegmentedControl-item--selected"),i.setAttribute("aria-current","true")}};Ae=new WeakSet,ke=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},_([de],Le.prototype,"items",void 0),Le=_([he],Le),window.customElements.get("segmented-control")||(window.SegmentedControlElement=Le,window.customElements.define("segmented-control",Le));let Te=class ToggleSwitchElement extends HTMLElement{constructor(){super(...arguments),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("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;try{e=await fetch(this.src,{credentials:"same-origin",method:"POST",headers:{"Requested-With":"XMLHttpRequest"},body:t})}catch(t){throw new Error("A network error occurred, please try again.")}if(!e.ok)throw new Error(await e.text())}};var Me,xe,Se,Ce,De,Ie,Oe,He,Pe;_([ue],Te.prototype,"switch",void 0),_([ue],Te.prototype,"loadingSpinner",void 0),_([ue],Te.prototype,"errorIcon",void 0),Te=_([he],Te),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=Te,window.customElements.define("toggle-switch",Te));const Re="tooltip-open",Fe="sr-only",qe=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class ToolTipElement extends HTMLElement{constructor(){super(...arguments),Me.add(this),xe.set(this,void 0),Se.set(this,"center"),Ce.set(this,"outside-bottom"),De.set(this,!1)}styles(){return'\n :host {\n position: absolute;\n z-index: 1000000;\n padding: .5em .75em;\n font: normal normal 11px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";\n -webkit-font-smoothing: subpixel-antialiased;\n color: var(--color-fg-on-emphasis);\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(--color-neutral-emphasis-plus);\n border-radius: 6px;\n opacity: 0;\n max-width: 250px;\n word-wrap: break-word;\n white-space: normal;\n width: max-content;\n }\n\n :host:before{\n position: absolute;\n z-index: 1000001;\n color: var(--color-neutral-emphasis-plus);\n content: "";\n border: 6px solid transparent;\n opacity: 0\n }\n\n @keyframes tooltip-appear {\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n }\n\n :host:after{\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: 12px;\n content: ""\n }\n\n :host(.tooltip-open),\n :host(.tooltip-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n animation-delay: .4s\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-n):before {\n right: 50%;\n margin-right: -6px;\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-se):before,\n :host(.tooltip-sw):before {\n bottom: 100%;\n border-bottom-color: var(--color-neutral-emphasis-plus)\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):before,\n :host(.tooltip-ne):before,\n :host(.tooltip-nw):before {\n top: 100%;\n border-top-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%\n }\n\n :host(.tooltip-se):before,\n :host(.tooltip-ne):before {\n left: 0;\n margin-left: 6px;\n }\n\n :host(.tooltip-sw):before,\n :host(.tooltip-nw):before {\n right: 0;\n margin-right: 6px;\n }\n\n :host(.tooltip-w):before {\n top: 50%;\n bottom: 50%;\n left: 100%;\n margin-top: -6px;\n border-left-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-e):before {\n top: 50%;\n right: 100%;\n bottom: 50%;\n margin-top: -6px;\n border-right-color: var(--color-neutral-emphasis-plus)\n }\n '}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){this.classList.toggle(Fe,t),this.isConnected&&J(this,Me,"m",Ie).call(this)}get hiddenFromView(){return this.classList.contains(Fe)}connectedCallback(){var t;if(J(this,Me,"m",Oe).call(this),J(this,Me,"m",He).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}if(this.hiddenFromView=!0,Q(this,De,!0,"f"),!this.control)return;this.setAttribute("role","tooltip"),null===(t=J(this,xe,"f"))||void 0===t||t.abort(),Q(this,xe,new AbortController,"f");const{signal:e}=J(this,xe,"f");this.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("mouseenter",this,{signal:e}),this.control.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("focus",this,{signal:e}),this.control.addEventListener("blur",this,{signal:e}),this.ownerDocument.addEventListener("keydown",this,{signal:e}),J(this,Me,"m",Ie).call(this)}disconnectedCallback(){var t;null===(t=J(this,xe,"f"))||void 0===t||t.abort()}handleEvent(t){this.control&&("mouseenter"!==t.type&&"focus"!==t.type||!this.hiddenFromView?"blur"===t.type||"mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hiddenFromView=!0:"keydown"!==t.type||"Escape"!==t.key||this.hiddenFromView||(this.hiddenFromView=!0):this.hiddenFromView=!1)}attributeChangedCallback(t){this.isConnected&&("id"===t||"data-type"===t?J(this,Me,"m",Oe).call(this):"data-direction"===t&&J(this,Me,"m",He).call(this))}}xe=new WeakMap,Se=new WeakMap,Ce=new WeakMap,De=new WeakMap,Me=new WeakSet,Ie=function(){if(this.hiddenFromView)this.classList.remove(Re,...qe);else{this.classList.add(Re);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);J(this,Me,"m",Pe).call(this)}},Oe=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)}},He=function(){this.classList.remove(...qe);const t=this.direction;"n"===t?(Q(this,Se,"center","f"),Q(this,Ce,"outside-top","f")):"ne"===t?(Q(this,Se,"start","f"),Q(this,Ce,"outside-top","f")):"e"===t?(Q(this,Se,"center","f"),Q(this,Ce,"outside-right","f")):"se"===t?(Q(this,Se,"start","f"),Q(this,Ce,"outside-bottom","f")):"s"===t?(Q(this,Se,"center","f"),Q(this,Ce,"outside-bottom","f")):"sw"===t?(Q(this,Se,"end","f"),Q(this,Ce,"outside-bottom","f")):"w"===t?(Q(this,Se,"center","f"),Q(this,Ce,"outside-left","f")):"nw"===t&&(Q(this,Se,"end","f"),Q(this,Ce,"outside-top","f"))},Pe=function(){if(!this.control)return;if(!J(this,De,"f")||this.hiddenFromView)return;this.style.left="0px";const t=nt(this,this.control,{side:J(this,Ce,"f"),align:J(this,Se,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.top=`${t.top}px`,this.style.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"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let We=class XBannerElement extends HTMLElement{dismiss(){if(this.shouldReappear())return this.style.setProperty("visibility","hidden"),void setTimeout((()=>{this.style.setProperty("visibility","visible")}),2e3);const t=this.parentElement;t&&t.removeChild(this)}shouldReappear(){return"true"===this.getAttribute("data-reappear")}};_([ue],We.prototype,"titleText",void 0),We=_([he],We),window.customElements.get("x-banner")||(window.XBannerElement=We,window.customElements.define("x-banner",We));class $e{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":Be(e.input,e.list)&&t.preventDefault();break;case"Tab":e.tabInsertsSuggestions&&Be(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;if(!document.getElementById(e.input.getAttribute("aria-controls")||""))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",Ne),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",Ne)}indicateDefaultOption(){var t;this.defaultFirstOption&&(null===(t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(je)[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(je)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(je),i=n.indexOf(e);if(i===n.length-1&&1===t||0===i&&-1===t)return this.clearSelection(),void this.input.focus();let o=1===t?0:n.length-1;if(e&&i>=0){const e=i+t;e>=0&&e<n.length&&(o=e)}const s=n[o];if(s)for(const t of n)t.removeAttribute("data-combobox-option-default"),s===t?(this.input.setAttribute("aria-activedescendant",s.id),s.setAttribute("aria-selected","true"),Ke(this.list,s)):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 Ne(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 Be(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 je(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function Ke(t,e){(function(t,e){const n=t.scrollTop,i=n+t.clientHeight,o=e.offsetTop,s=o+e.clientHeight;return o>=n&&s<=i})(t,e)||(t.scrollTop=e.offsetTop)}const Ye=window.testScreenReaderDelay||100;class ze{constructor(t,e,n,i=!1){var o;if(this.container=t,this.input=e,this.results=n,this.combobox=new $e(e,n),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.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===(o=this.clearButton)||void 0===o||o.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.container.open=!1}onKeydown(t){if("Enter"===t.key&&this.container.open&&this.autoselectEnabled){const e=this.results.children[0];e&&(t.stopPropagation(),t.preventDefault(),this.onCommit({target:e}))}if("Escape"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.container.open=!0,t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.fetchResults()}onInputBlur(){this.interactingWithList?this.interactingWithList=!1:this.container.open=!1}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(this.container.open=!1,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)}),Ye)}fetchResults(){const t=this.input.value.trim();if(!t&&!this.container.fetchOnEmpty)return void(this.container.open=!1);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();const e=this.results.querySelectorAll('[role="option"]'),n=!!e.length,i=e.length,[o]=e,s=null==o?void 0:o.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${i} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${i||"No"} results.`),this.container.open=n,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.hidden&&(this.combobox.start(),this.results.hidden=!1)}close(){this.results.hidden||(this.combobox.stop(),this.results.hidden=!0)}}var Ve,Xe,Ue,Ge,Ze,_e=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)},Je=function(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n},Qe=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 o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n};const tn=globalThis.HTMLElement||null;class en extends Event{constructor(t,e){var{relatedTarget:n}=e;super(t,Qe(e,["relatedTarget"])),this.relatedTarget=n}}const nn=new WeakMap;let on=null;class AutoCompleteElement extends tn{constructor(){super(...arguments),Ve.add(this),Xe.set(this,null),Ue.set(this,null),Ze.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){on=null===t?t:Promise.resolve(t)}get forElement(){var t;if(null===(t=_e(this,Xe,"f"))||void 0===t?void 0:t.isConnected)return _e(this,Xe,"f");const e=this.getAttribute("for"),n=this.getRootNode();return e&&(n instanceof Document||n instanceof ShadowRoot)?n.getElementById(e):null}set forElement(t){Je(this,Xe,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return(null===(t=_e(this,Ue,"f"))||void 0===t?void 0:t.isConnected)?_e(this,Ue,"f"):this.querySelector("input")}set inputElement(t){Je(this,Ue,t,"f"),_e(this,Ve,"m",Ge).call(this)}connectedCallback(){this.isConnected&&_e(this,Ve,"m",Ge).call(this)}disconnectedCallback(){const t=nn.get(this);t&&(t.destroy(),nn.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=_e(this,Ze,"f"))||void 0===e||e.abort();const{signal:n}=Je(this,Ze,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(on){return(await on).createHTML(await i.text(),i)}return await i.text()}static get observedAttributes(){return["open","value","for"]}attributeChangedCallback(t,e,n){var i,o;if(e===n)return;const s=nn.get(this);if(s)switch(this.forElement===(null===(i=nn.get(this))||void 0===i?void 0:i.results)&&this.inputElement===(null===(o=nn.get(this))||void 0===o?void 0:o.input)||_e(this,Ve,"m",Ge).call(this),t){case"open":null===n?s.close():s.open();break;case"value":null!==n&&(s.input.value=n),this.dispatchEvent(new en("auto-complete-change",{bubbles:!0,relatedTarget:s.input}))}}}Xe=new WeakMap,Ue=new WeakMap,Ze=new WeakMap,Ve=new WeakSet,Ge=function(){var t;null===(t=nn.get(this))||void 0===t||t.destroy();const{forElement:e,inputElement:n}=this;if(!e||!n)return;const i="true"===this.getAttribute("data-autoselect");nn.set(this,new ze(this,n,e,i)),e.setAttribute("role","listbox")};const sn="undefined"!=typeof globalThis?globalThis:window;try{sn.AutocompleteElement=sn.AutoCompleteElement=AutoCompleteElement.define()}catch(t){if(!(sn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function rn(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 an(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),rn(n),e.removeChild(n),Promise.resolve()}function ln(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)an(n).then(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 s=n.getElementById(e);s&&(o=s,o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?an(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?an(o.href):rn(o)).then(i)}var o}function cn(t){const e=t.currentTarget;e instanceof HTMLElement&&ln(e)}function un(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),ln(e))}}function dn(t){t.currentTarget.addEventListener("keydown",un)}function hn(t){t.currentTarget.removeEventListener("keydown",un)}class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",cn),this.addEventListener("focus",dn),this.addEventListener("blur",hn)}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)}}window.customElements.get("clipboard-copy")||(window.ClipboardCopyElement=ClipboardCopyElement,window.customElements.define("clipboard-copy",ClipboardCopyElement));function fn(t){t.style.display="inline-block"}function mn(t){t.style.display="none"}const pn=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=pn.get(t);e?(clearTimeout(e),pn.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(mn(e),fn(n))}(t),pn.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(fn(e),mn(n))}(t),pn.delete(t)}),2e3))}));var gn,bn=function(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n},vn=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 wn="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)}},yn=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],En={minimumIntegerDigits:2};class An{constructor(t,e={}){gn.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 o=e.hours||i;i="2-digit"===o?"numeric":o;const s=e.minutes||i;i="2-digit"===s?"numeric":s;const r=e.seconds||i;i="2-digit"===r?"numeric":r;const a=e.milliseconds||i;bn(this,gn,{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:o,hoursDisplay:"always"===e.hoursDisplay||"digital"===n?"always":"auto",minutes:s,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 vn(this,gn,"f")}formatToParts(t){const e=[],n=vn(this,gn,"f"),i=n.style,o=n.locale;for(const[i,s]of yn){const r=t[i];if("auto"===n[`${i}Display`]&&!r)continue;const a=n[i],l="2-digit"===a?En:"numeric"===a?{}:{style:"unit",unit:s,unitDisplay:a};e.push(new Intl.NumberFormat(o,l).format(r))}return new wn(o,{type:"unit",style:"digital"===i?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map((t=>t.value)).join("")}}gn=new WeakMap;const kn=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,Ln=["year","month","week","day","hour","minute","second","millisecond"];class Tn{constructor(t=0,e=0,n=0,i=0,o=0,s=0,r=0,a=0){this.years=t,this.months=e,this.weeks=n,this.days=i,this.hours=o,this.minutes=s,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 Tn(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,o=null===(e=n.match(kn))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return o?new Tn(...o):new Tn}if("object"==typeof t){const{years:e,months:n,weeks:i,days:o,hours:s,minutes:r,seconds:a,milliseconds:l}=t;return new Tn(e,n,i,o,s,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const n=Date.now(),i=Math.abs(Mn(n,Tn.from(t)).getTime()-n),o=Math.abs(Mn(n,Tn.from(e)).getTime()-n);return i>o?-1:i<o?1:0}toLocaleString(t,e){return new An(t,e).format(this)}}function Mn(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e.years),n.setMonth(n.getMonth()+e.months),n.setDate(n.getDate()+7*e.weeks+e.days),n.setHours(n.getHours()+e.hours),n.setMinutes(n.getMinutes()+e.minutes),n.setSeconds(n.getSeconds()+e.seconds),n}function xn(t,{relativeTo:e=Date.now()}={}){if(e=new Date(e),t.blank)return t;const n=t.sign;let i=Math.abs(t.years),o=Math.abs(t.months),s=Math.abs(t.weeks),r=Math.abs(t.days),a=Math.abs(t.hours),l=Math.abs(t.minutes),c=Math.abs(t.seconds),u=Math.abs(t.milliseconds);u>=900&&(c+=Math.round(u/1e3)),(c||l||a||r||s||o||i)&&(u=0),c>=55&&(l+=Math.round(c/60)),(l||a||r||s||o||i)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||r||s||o||i)&&(l=0),r&&a>=12&&(r+=Math.round(a/24)),!r&&a>=21&&(r+=Math.round(a/24)),(r||s||o||i)&&(a=0);const d=e.getFullYear();let h=e.getMonth();const f=e.getDate();return(r>=27||i+o&&r)&&(e.setDate(f+r*n),o+=Math.abs(e.getFullYear()>=d?e.getMonth()-h:e.getMonth()-h-12),o&&(r=0),h=e.getMonth()),r>=6&&(s+=Math.round(r/7)),(s||o||i)&&(r=0),s>=4&&(o+=Math.round(s/4)),(o||i)&&(s=0),(o>=11||i&&o)&&(e.setMonth(e.getMonth()+o*n),i+=Math.abs(d-e.getFullYear())),i&&(o=0),new Tn(i*n,o*n,s*n,r*n,a*n,l*n,c*n,u*n)}var Sn,Cn,Dn,In,On,Hn,Pn,Rn,Fn,qn,Wn,$n=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)},Nn=function(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n};const Bn=globalThis.HTMLElement||null,jn=new Tn,Kn=new Tn(0,0,0,0,0,1);class Yn 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 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 Vn=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),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,zn(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends Bn{constructor(){super(...arguments),Sn.add(this),Cn.set(this,!1),Dn.set(this,!1),On.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),Wn.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","datetime","lang","title"]}get onRelativeTimeUpdated(){return $n(this,Wn,"f")}set onRelativeTimeUpdated(t){$n(this,Wn,"f")&&this.removeEventListener("relative-time-updated",$n(this,Wn,"f")),Nn(this,Wn,"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,kn.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 Ln.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 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(){Vn.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&Nn(this,Cn,null!==n&&(this.date&&$n(this,Sn,"m",Hn).call(this,this.date))!==n,"f"),$n(this,Dn,"f")||"title"===t&&$n(this,Cn,"f")||Nn(this,Dn,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){const t=$n(this,On,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let n=e;const i=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!i)return void($n(this,On,"f").textContent=t);const o=Date.now();$n(this,Cn,"f")||(n=$n(this,Sn,"m",Hn).call(this,i)||"",n&&this.setAttribute("title",n));const s=function(t,e="second",n=Date.now()){const i=t.getTime()-n;if(0===i)return new Tn;const o=Math.sign(i),s=Math.abs(i),r=Math.floor(s/1e3),a=Math.floor(r/60),l=Math.floor(a/60),c=Math.floor(l/24),u=Math.floor(c/30),d=Math.floor(u/12),h=Ln.indexOf(e)||Ln.length;return new Tn(h>=0?d*o:0,h>=1?(u-12*d)*o:0,0,h>=3?(c-30*u)*o:0,h>=4?(l-24*c)*o:0,h>=5?(a-60*l)*o:0,h>=6?(r-60*a)*o:0,h>=7?(s-1e3*r)*o:0)}(i,this.precision,o),r=$n(this,Sn,"m",Pn).call(this,s);let a=t;a="duration"===r?$n(this,Sn,"m",Rn).call(this,s):"relative"===r?$n(this,Sn,"m",Fn).call(this,s):$n(this,Sn,"m",qn).call(this,i),a?$n(this,On,"f").textContent=a:this.shadowRoot===$n(this,On,"f")&&this.textContent&&($n(this,On,"f").textContent=this.textContent),a===t&&n===e||this.dispatchEvent(new Yn(t,a,e,n)),"relative"===r||"duration"===r?Vn.observe(this):Vn.unobserve(this),Nn(this,Dn,!1,"f")}}Cn=new WeakMap,Dn=new WeakMap,On=new WeakMap,Wn=new WeakMap,Sn=new WeakSet,In=function(){var t;return(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang")||"default"},Hn=function(t){return new Intl.DateTimeFormat($n(this,Sn,"a",In),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},Pn=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===Tn.compare(t,this.threshold))return"relative"}return"datetime"},Rn=function(t){const e=$n(this,Sn,"a",In),n=this.format,i=this.formatStyle,o=this.tense;let s=jn;"micro"===n?(t=xn(t),s=Kn,("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=Kn)):("past"===o&&-1!==t.sign||"future"===o&&1!==t.sign)&&(t=s);const r=`${this.precision}sDisplay`;return t.blank?s.toLocaleString(e,{style:i,[r]:"always"}):t.abs().toLocaleString(e,{style:i})},Fn=function(t){const e=new Intl.RelativeTimeFormat($n(this,Sn,"a",In),{numeric:"auto",style:this.formatStyle}),n=this.tense;"future"===n&&1!==t.sign&&(t=jn),"past"===n&&-1!==t.sign&&(t=jn);const[i,o]=function(t,e){const n=xn(t,e);if(n.blank)return[0,"second"];for(const t of Ln){if("millisecond"===t)continue;const e=n[`${t}s`];if(e)return[e,t]}return[0,"second"]}(t);return"second"===o&&i<10?e.format(0,"second"):e.format(i,o)},qn=function(t){const e=new Intl.DateTimeFormat($n(this,Sn,"a",In),{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()};const Xn="undefined"!=typeof globalThis?globalThis:window;try{Xn.RelativeTimeElement=RelativeTimeElement.define()}catch(t){if(!(Xn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function Un(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if(e.closest(this.tagName)!==this)return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Un(this),i=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]')))),[o,s]="vertical"===e.closest('[role="tablist"]')?.getAttribute("aria-orientation")?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(o.some((e=>t.code===e))){let t=i+1;t>=n.length&&(t=0),this.selectTab(t)}else if(s.some((e=>t.code===e))){let t=i-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=Un(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)}))}connectedCallback(){for(const t of Un(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=Un(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],o=n[t];if(!!this.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:o}}))){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(),o.hidden=!1,this.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:o}}))}}}window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement));let Gn=class PrimerMultiInputElement extends HTMLElement{activateField(t){var e,n;const i=this.findField(t);if(i){for(const t of this.fields)t!==i&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),null===(e=t.parentElement)||void 0===e||e.setAttribute("hidden","hidden"));i.removeAttribute("disabled"),i.removeAttribute("hidden"),null===(n=i.parentElement)||void 0===n||n.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function Zn(t,e=0,{start:n=!1,middle:i=!1,once:o=!1}={}){return function(t,e=0,{start:n=!0,middle:i=!0,once:o=!1}={}){let s,r=0,a=!1;function l(...c){if(a)return;const u=Date.now()-r;r=Date.now(),n?(n=!1,t.apply(this,c),o&&l.cancel()):(i&&u<e||!i)&&(clearTimeout(s),s=setTimeout((()=>{r=Date.now(),t.apply(this,c),o&&l.cancel()}),i?e-u:e))}return l.cancel=()=>{clearTimeout(s),a=!0},l}(t,e,{start:n,middle:i,once:o})}_([de],Gn.prototype,"fields",void 0),Gn=_([he],Gn),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:Gn}),window.customElements.define("primer-multi-input",Gn));var _n,Jn=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)},Qn=function(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n};const ti=new WeakMap;class ei extends Event{constructor(t){super(`auto-check-${t}`,{bubbles:!0}),this.phase=t}get detail(){return this}}class ni extends ei{constructor(t,e=""){super(t),this.phase=t,this.message=e}setValidity(t){this.message=t}}class ii extends ei{constructor(){super("complete")}}class oi extends ei{constructor(t){super("success"),this.response=t}}class si extends ni{constructor(){super("start","Verifying…")}}class ri extends ni{constructor(t){super("error","Validation failed"),this.response=t}}class ai extends ei{constructor(t){super("send"),this.body=t}}class AutoCheckElement extends HTMLElement{constructor(){super(...arguments),_n.set(this,null)}static define(t="auto-check",e=customElements){return e.define(t,this),this}get onloadend(){return Jn(this,_n,"f")}set onloadend(t){Jn(this,_n,"f")&&this.removeEventListener("loadend",Jn(this,_n,"f")),Qn(this,_n,"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=Zn(ci.bind(null,this),300),n={check:e,controller:null};ti.set(this,n),t.addEventListener("input",li),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=ti.get(this);e&&(ti.delete(this),t.removeEventListener("input",li),t.removeEventListener("input",e.check),t.setCustomValidity(""))}attributeChangedCallback(t){if("required"===t){const t=this.input;if(!t)return;t.required=this.required}}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)}}function li(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,o=n.csrf,s=ti.get(n);if(!i||!o||!s)return;const r=new si;e.dispatchEvent(r),n.required&&e.setCustomValidity(r.message)}async function ci(t){const e=t.input;if(!e)return;const n=t.csrfField,i=t.src,o=t.csrf,s=ti.get(t);if(!i||!o||!s)return void(t.required&&e.setCustomValidity(""));if(!e.value.trim())return void(t.required&&e.setCustomValidity(""));const r=new FormData;r.append(n,o),r.append("value",e.value),e.dispatchEvent(new ai(r)),s.controller?s.controller.abort():t.dispatchEvent(new Event("loadstart")),s.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};try{const n=await async function(t,e,n){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,i,{credentials:"same-origin",signal:s.controller.signal,method:"POST",body:r});if(n.ok)t.required&&e.setCustomValidity(""),e.dispatchEvent(new oi(n.clone()));else{const i=new ri(n.clone());e.dispatchEvent(i),t.required&&e.setCustomValidity(i.message)}s.controller=null,e.dispatchEvent(new ii)}catch(t){"AbortError"!==t.name&&(s.controller=null,e.dispatchEvent(new ii))}}_n=new WeakMap;const ui="undefined"!=typeof globalThis?globalThis:window;try{ui.AutoCheckElement=AutoCheckElement.define()}catch(t){if(!(ui.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}var di;let hi=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),di.set(this,void 0)}connectedCallback(){var t;null===(t=J(this,di,"f"))||void 0===t||t.abort();const{signal:e}=Q(this,di,new AbortController,"f");this.inputElement.addEventListener("auto-check-success",(()=>{this.clearError()}),{signal:e}),this.inputElement.addEventListener("auto-check-error",(async t=>{const e=await t.detail.response.text();this.setError(e)}),{signal:e})}disconnectedCallback(){var t;null===(t=J(this,di,"f"))||void 0===t||t.abort()}clearContents(){this.inputElement.value="",this.inputElement.focus()}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.textContent=""}setError(t){this.validationMessageElement.textContent=t,this.validationElement.hidden=!1,this.inputElement.setAttribute("invalid","true")}};di=new WeakMap,_([ue],hi.prototype,"inputElement",void 0),_([ue],hi.prototype,"validationElement",void 0),_([ue],hi.prototype,"validationMessageElement",void 0),hi=_([he],hi);let fi=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 mi,pi,gi,bi,vi,wi,yi,Ei;_([ue],fi.prototype,"validationElement",void 0),_([ue],fi.prototype,"validationMessageElement",void 0),fi=_([he],fi);const Ai=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]'];let ki=class ActionMenuElement extends HTMLElement{constructor(){super(...arguments),mi.add(this),pi.set(this,void 0),gi.set(this,""),bi.set(this,"")}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.querySelector("[popover]")}get invokerElement(){var t;const e=null===(t=this.querySelector("[role=menu]"))||void 0===t?void 0:t.id;if(!e)return null;for(const t of this.querySelectorAll("[aria-controls]"))if(t.getAttribute("aria-controls")===e)return t;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:null==t?void 0:t.textContent,value:null==n?void 0:n.getAttribute("data-value"),element:n})}return e}connectedCallback(){const{signal:t}=Q(this,pi,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}),J(this,mi,"m",vi).call(this),J(this,mi,"m",wi).call(this),this.includeFragment&&this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t})}disconnectedCallback(){J(this,pi,"f").abort()}handleEvent(t){var e,n;if(t.target===this.invokerElement&&J(this,mi,"m",yi).call(this,t)&&J(this,mi,"a",Ei))return t.preventDefault(),null===(e=this.popoverElement)||void 0===e||e.showPopover(),void J(this,mi,"a",Ei).focus();if(null===(n=this.popoverElement)||void 0===n?void 0:n.matches(":popover-open"))if("include-fragment-replaced"===t.type)J(this,mi,"a",Ei)&&J(this,mi,"a",Ei).focus();else if(J(this,mi,"m",yi).call(this,t)||t instanceof MouseEvent&&"click"===t.type){if("multiple"!==this.selectVariant&&setTimeout((()=>{var t;return null===(t=this.popoverElement)||void 0===t?void 0:t.hidePopover()})),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e=t.target.closest(Ai.join(","));if(!e)return;const n="true"!==e.getAttribute("aria-checked");if(e.setAttribute("aria-checked",`${n}`),"single"===this.selectVariant){for(const t of this.querySelectorAll("[aria-checked]"))t!==e&&t.setAttribute("aria-checked","false");J(this,mi,"m",vi).call(this)}J(this,mi,"m",wi).call(this),t instanceof KeyboardEvent&&t.target instanceof HTMLButtonElement&&t.preventDefault()}}};pi=new WeakMap,gi=new WeakMap,bi=new WeakMap,mi=new WeakSet,vi=function(){if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;Q(this,gi,J(this,gi,"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=J(this,gi,"f")},wi=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&&Q(this,bi,J(this,bi,"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=J(this,bi,"f"),n.value=(e.value||e.label||"").trim(),t.append(n)}for(const t of e)t.remove()}},yi=function(t){return t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&("Enter"===t.key||" "===t.key)},Ei=function(){return this.querySelector(Ai.join(","))},_([ue],ki.prototype,"includeFragment",void 0),ki=_([he],ki),window.customElements.get("action-menu")||(window.ActionMenuElement=ki,window.customElements.define("action-menu",ki))}();
1
+ !function(){"use strict";var t,e,n,i,o,s,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,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n};const u=new WeakMap;let d=null;class IncludeFragmentElement extends HTMLElement{static setCSPTrustedTypesPolicy(t){d=null===t?t:Promise.resolve(t)}static get observedAttributes(){return["src","loading"]}get src(){const t=this.getAttribute("src");if(t){const e=this.ownerDocument.createElement("a");return e.href=t,e.href}return""}set src(t){this.setAttribute("src",t)}get loading(){return"lazy"===this.getAttribute("loading")?"lazy":"eager"}set loading(t){this.setAttribute("loading",t)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",t)}get data(){return l(this,t,"m",s).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)}constructor(){super(),t.add(this),e.set(this,!1),n.set(this,new IntersectionObserver((e=>{for(const o of e)if(o.isIntersecting){const{target:e}=o;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}));const o=this.attachShadow({mode:"open"}),s=document.createElement("style");s.textContent=":host {display: block;}",o.append(s,document.createElement("slot"))}connectedCallback(){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",s).call(this)}fetch(t){return fetch(t)}refetch(){u.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",o).call(this);if(n instanceof Error)throw n;const i=n,s=document.createElement("template");s.innerHTML=i;const r=document.importNode(s.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")}}},o=async function(){const e=this.src,n=u.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")),u.set(this,{src:e,data:n}),n}},s=async function(){const e=await l(this,t,"m",o).call(this);if(e instanceof Error)throw e;return e.toString()},r=async function(t){await new Promise((t=>setTimeout(t,0)));for(const e of t)this.dispatchEvent(new Event(e))},a=async function(){try{await l(this,t,"m",r).call(this,["loadstart"]);const n=await this.fetch(this.request());if(200!==n.status)throw new Error(`Failed to load resource: the server responded with a status of ${n.status}`);const 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}`);const o=await n.text();let s=o;if(d){s=(await d).createHTML(o,n)}return l(this,t,"m",r).call(this,["load","loadend"]),s}catch(e){throw l(this,t,"m",r).call(this,["error","loadend"]),e}var e},window.customElements.get("include-fragment")||(window.IncludeFragmentElement=IncludeFragmentElement,window.customElements.define("include-fragment",IncludeFragmentElement));var h=class extends Event{constructor(t,{oldState:e="",newState:n="",...i}={}){super(t,i),this.oldState=String(e||""),this.newState=String(n||"")}},f=new WeakMap;function m(t,e,n){f.set(t,setTimeout((()=>{f.has(t)&&t.dispatchEvent(new h("toggle",{cancelable:!1,oldState:e,newState:n}))}),0))}var p=globalThis.ShadowRoot||function(){},g=globalThis.HTMLDialogElement||function(){},b=new WeakMap,v=new WeakMap,w=new WeakMap;function y(t){return w.get(t)||"hidden"}var E=new WeakMap;function A(t,e){return("auto"===t.popover||"manual"===t.popover)&&(!!t.isConnected&&((!e||"showing"===y(t))&&(!(!e&&"hidden"!==y(t))&&(!(t instanceof g&&t.hasAttribute("open"))&&document.fullscreenElement!==t))))}function k(t){return t?Array.from(v.get(t.ownerDocument)||[]).indexOf(t)+1:0}function L(t){const e=x(t),n=function(t){for(;t;){const e=t.popoverTargetElement;if(e)return e;if((t=t.parentElement||M(t))instanceof p&&(t=t.host),t instanceof Document)return}}(t);return k(e)>k(n)?e:n}function T(t){const e=v.get(t);for(const t of e||[]){if(t.isConnected)return t;e.delete(t)}return null}function M(t){return"function"==typeof t.getRootNode?t.getRootNode():t.parentNode?M(t.parentNode):t}function x(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===w.get(t))return t;if((t=t.parentElement||M(t))instanceof p&&(t=t.host),t instanceof Document)return}}function S(t){return!t.hidden&&((!(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)&&-1!==t.tabIndex)))}function C(t){(function(t){if(t.shadowRoot&&!0!==t.shadowRoot.delegatesFocus)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);const n=e.querySelector("[autofocus]");if(n)return n;const i=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let o=i.currentNode;for(;o;){if(S(o))return o;o=i.nextNode()}})(t)?.focus()}var D=new WeakMap;function I(t){if(!A(t,!1))return;const e=t.ownerDocument;if(!t.dispatchEvent(new h("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"})))return;if(!A(t,!1))return;let n=!1;if("auto"===t.popover){const n=t.getAttribute("popover");if(P(function(t){const e=new Map;let n=0;const i=t.ownerDocument;for(const t of v.get(i)||[])e.set(t,n),n+=1;e.set(t,n),n+=1;let o=null;return function(t){const n=x(t);if(null===n)return null;const i=e.get(n);(null===o||e.get(o)<i)&&(o=n)}(t?.parentElement),o}(t)||e,!1,!0),n!==t.getAttribute("popover")||!A(t,!1))return}T(e)||(n=!0),D.delete(t);const i=e.activeElement;t.classList.add(":popover-open"),w.set(t,"showing"),b.has(e)||b.set(e,new Set),b.get(e).add(t),C(t),"auto"===t.popover&&(v.has(e)||v.set(e,new Set),v.get(e).add(t),W(E.get(t),!0)),n&&i&&"auto"===t.popover&&D.set(t,i),m(t,"closed","open")}function O(t,e=!1,n=!1){if(!A(t,!0))return;const i=t.ownerDocument;if("auto"===t.popover&&(P(t,e,n),!A(t,!0)))return;if(W(E.get(t),!1),E.delete(t),n&&(t.dispatchEvent(new h("beforetoggle",{oldState:"open",newState:"closed"})),!A(t,!0)))return;b.get(i)?.delete(t),v.get(i)?.delete(t),t.classList.remove(":popover-open"),w.set(t,"hidden"),n&&m(t,"open","closed");const o=D.get(t);o&&(D.delete(t),e&&o.focus())}function H(t,e=!1,n=!1){let i=T(t);for(;i;)O(i,e,n),i=T(t)}function P(t,e,n){const i=t.ownerDocument||t;if(t instanceof Document)return H(i,e,n);let o=null,s=!1;for(const e of v.get(i)||[])if(e===t)s=!0;else if(s){o=e;break}if(!s)return H(i,e,n);for(;o&&"showing"===y(o)&&v.get(i)?.size;)O(o,e,n)}var R=new WeakMap;function F(t){if(!t.isTrusted)return;const e=t.composedPath()[0];if(!e)return;const n=e.ownerDocument;if(!T(n))return;const i=L(e);if(i&&"pointerdown"===t.type)R.set(n,i);else if("pointerup"===t.type){const t=R.get(n)===i;R.delete(n),t&&P(i||n,!1,!0)}}var q=new WeakMap;function W(t,e=!1){if(!t)return;q.has(t)||q.set(t,t.getAttribute("aria-expanded"));const n=t.popoverTargetElement;if(n&&"auto"===n.popover)t.setAttribute("aria-expanded",String(e));else{const e=q.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}var $=globalThis.ShadowRoot||function(){};function N(t,e,n){const i=t[e];Object.defineProperty(t,e,{value(t){return i.call(this,n(t))}})}var B=/(^|[^\\]):popover-open\b/g;"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){function t(t){return t?.includes(":popover-open")&&(t=t.replace(B,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||h,N(Document.prototype,"querySelector",t),N(Document.prototype,"querySelectorAll",t),N(Element.prototype,"querySelector",t),N(Element.prototype,"querySelectorAll",t),N(Element.prototype,"matches",t),N(Element.prototype,"closest",t),N(DocumentFragment.prototype,"querySelectorAll",t),N(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){this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(){I(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){O(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t){"showing"===w.get(this)&&void 0===t||!1===t?O(this,!0,!0):void 0!==t&&!0!==t||I(this)}}});const e=new WeakMap;function n(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),e.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),e.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=e.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return e.delete(this),null;const n=M(this),i=this.getAttribute("popovertarget");return(n instanceof Document||n instanceof $)&&i&&n.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)}}})}n(HTMLButtonElement),n(HTMLInputElement);const i=t=>{if(!t.isTrusted)return;const e=t.composedPath()[0];if(!(e instanceof Element)||e?.shadowRoot)return;const n=M(e);if(!(n instanceof $||n instanceof Document))return;const i=e.closest("[popovertargetaction],[popovertarget]");i&&function(t){const e=t.popoverTargetElement;if(!e)return;const n=y(e);"show"===t.popoverTargetAction&&"showing"===n||"hide"===t.popoverTargetAction&&"hidden"===n||("showing"===n?O(e,!0,!0):A(e,!1)&&(E.set(e,t),I(e)))}(i)},o=t=>{const e=t.key,n=t.target;!n||"Escape"!==e&&"Esc"!==e||P(n.ownerDocument,!0,!0)};(t=>{t.addEventListener("click",i),t.addEventListener("keydown",o),t.addEventListener("pointerdown",F),t.addEventListener("pointerup",F)})(document)}();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=[Y(t,"compositionstart",(t=>tt(this,t))),Y(t,"compositionend",(t=>tt(this,t))),Y(t,"click",(e=>Z(t,e))),Y(t,"change",(e=>Z(t,e))),Y(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=j.get(e);if(!i||i.isComposing)return;const o=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(Q(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=U(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=U(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(G&&n.ctrlKey){const e=U(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(G&&n.ctrlKey){const e=U(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&J(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),Y(t,"toggle",(()=>z(t,this)),{once:!0}),Y(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?Y(t,"mouseover",(()=>z(t,this)),{once:!0}):K,...V(t)];j.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=j.get(this);if(t){j.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const j=new WeakMap,K={unsubscribe(){}};function Y(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function z(t,e){const n=e.getAttribute("src");if(!n)return;const i=j.get(e);if(!i)return;if(i.loaded)return;i.loaded=!0;const o=e.querySelector("include-fragment");o&&!o.hasAttribute("src")&&(o.addEventListener("loadend",(()=>X(t))),o.setAttribute("src",n))}function V(t){let e=!1;return[Y(t,"mousedown",(()=>e=!0)),Y(t,"keydown",(()=>e=!1)),Y(t,"toggle",(()=>{t.hasAttribute("open")&&(X(t)||e||function(t){const e=document.activeElement;if(e&&J(e)&&t.contains(e))return;const n=U(t,!0);n&&n.focus()}(t))}))]}function X(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function U(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),i=document.activeElement,o=i instanceof HTMLElement?n.indexOf(i):-1,s=e?n[o+1]:n[o-1],r=e?n[0]:n[n.length-1];return s||r}const G=navigator.userAgent.match(/Macintosh/);function Z(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||_(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&_(e,t)}}function _(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")&&Q(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function J(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function Q(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function tt(t,e){const n=j.get(t);n&&(n.isComposing="compositionstart"===e.type)}function et(t,e,n,i){var o,s=arguments.length,r=s<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--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,n,r):o(e,n))||r);return s>3&&r&&Object.defineProperty(e,n,r),r}function nt(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 it(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const ot={"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"]},st={start:["end","center"],end:["start","center"],center:["end","start"]};function rt(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),o=function(t){let e=t;for(;null!==e&&e!==document.body;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const n=e!==document.body&&e instanceof HTMLElement?e:document.body,i=n.getBoundingClientRect(),o=getComputedStyle(n),[s,r,a,l]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:i.top+s,left:i.left+r,width:i.width-a-r,height:Math.max(i.height-s-l,n===document.body?window.innerHeight:-1/0)}}(i),s=getComputedStyle(i),r=i.getBoundingClientRect(),[a,l]=[s.borderTopWidth,s.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,i,{side:o,align:s,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 u=ht(n,i,o,s,a,l),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=ot[o];let f=0;if(r){let t=o;for(;f<r.length&&ft(t,u,c,n);){const o=r[f++];t=o,u=ht(n,i,o,s,a,l),u.top-=e.top,u.left-=e.left,d=o}}const m=st[s];let p=0;if(m){let t=s;for(;p<m.length&&mt(t,u,c,n);){const o=m[p++];t=o,u=ht(n,i,d,o,a,l),u.top-=e.top,u.left-=e.left,h=o}}u.top<c.top&&(u.top=c.top),u.left<c.left&&(u.left=c.left),u.left+n.width>t.width+c.left&&(u.left=t.width+c.left-n.width),r&&f<r.length&&u.top+n.height>t.height+c.top&&(u.top=t.height+c.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(o,{top:r.top+a,left:r.left+l},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,i,o,s;const r=null!==(e=t.side)&&void 0!==e?e:at,a=null!==(n=t.align)&&void 0!==n?n:lt;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:ct,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?ut:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:dt}}(n))}const at="outside-bottom",lt="start",ct=4,ut=4,dt=!1;function ht(t,e,n,i,o,s){const r=e.left+e.width,a=e.top+e.height;let l=-1,c=-1;return"outside-top"===n?l=e.top-o-t.height:"outside-bottom"===n?l=a+o:"outside-left"===n?c=e.left-o-t.width:"outside-right"===n&&(c=r+o),"outside-top"!==n&&"outside-bottom"!==n||(c="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s),"outside-left"!==n&&"outside-right"!==n||(l="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?l=e.top+o:"inside-bottom"===n?l=a-o-t.height:"inside-left"===n?c=e.left+o:"inside-right"===n?c=r-o-t.width:"inside-center"===n&&(c=(r+e.left)/2-t.width/2+o),"inside-top"===n||"inside-bottom"===n?c="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s:"inside-left"!==n&&"inside-right"!==n&&"inside-center"!==n||(l="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:l,left:c}}function ft(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 mt(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 pt(t,e=!1){return function*(t,e={}){var n,i;const o=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(i=e.onlyTabbable)&&void 0!==i&&i?bt:gt,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&s(t,o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&s(t,o)&&(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&&s(t,o)&&(yield t)}(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function gt(t,e=!1){const n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,i=t.hidden,o=t instanceof HTMLInputElement&&"hidden"===t.type,s=t.classList.contains("sentinel");if(n||i||o||s)return!1;if(e){const e=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(getComputedStyle(t).visibility),i=0===t.getClientRects().length;if(e||n||i)return!1}return null!=t.getAttribute("tabindex")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex}function bt(t,e=!1){return gt(t,e)&&"-1"!==t.getAttribute("tabindex")}let vt=!1;function wt(){}try{const t=Object.create({},{signal:{get(){vt=!0}}});window.addEventListener("test",wt,t),window.removeEventListener("test",wt,t)}catch(t){}vt||(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)}}(),vt=!0);const yt=[];let Et;function At(t,e,n){const i=new AbortController,o=null!=n?n:i.signal;t.setAttribute("data-focus-trap","active");const s=document.createElement("span");s.setAttribute("class","sentinel"),s.setAttribute("tabindex","0"),s.setAttribute("aria-hidden","true"),s.onfocus=()=>{const e=pt(t,!0);null==e||e.focus()};const r=document.createElement("span");let a;function l(n){if(n instanceof HTMLElement&&document.contains(t)){if(t.contains(n))return void(a=n);if(a&&bt(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=pt(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=pt(t);null==e||e.focus()},t.prepend(s),t.append(r);const c=function(t){const e=new AbortController;return t.addEventListener("abort",(()=>{e.abort()})),e}(o);if(Et){const t=Et;Et.container.setAttribute("data-focus-trap","suspended"),Et.controller.abort(),yt.push(t)}c.signal.addEventListener("abort",(()=>{Et=void 0})),o.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=yt.findIndex((e=>e.container===t));n>=0&&yt.splice(n,1),function(){const t=yt.pop();t&&At(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{l(t.target)}),{signal:c.signal,capture:!0}),l(document.activeElement),Et={container:t,controller:c,initialFocus:e,originalSignal:o};const u=yt.findIndex((e=>e.container===t));if(u>=0&&yt.splice(u,1),!n)return i}var kt,Lt;const Tt=(()=>{const t=new Set;let e=null,n=null;function i(){for(const e of t)e.update()}return o=>{window.addEventListener("resize",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(o.ownerDocument.documentElement),e.observe(o)}})();class AnchoredPositionElement extends HTMLElement{constructor(){super(...arguments),kt.set(this,null),Lt.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(nt(this,kt,"f"))return nt(this,kt,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){it(this,kt,t,"f"),nt(this,kt,"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())),Tt(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(nt(this,Lt,"f")),it(this,Lt,requestAnimationFrame((()=>{const t=this.anchorElement;if(!t)return;const{left:e,top:n,anchorSide:i,anchorAlign:o}=rt(this,t,this);this.style.top=`${n}px`,this.style.left=`${e}px`,this.classList.remove("Overlay--anchorAlign-start","Overlay--anchorAlign-center","Overlay--anchorAlign-end","Overlay--anchorSide-insideTop","Overlay--anchorSide-insideBottom","Overlay--anchorSide-insideLeft","Overlay--anchorSide-insideRight","Overlay--anchorSide-insideCenter","Overlay--anchorSide-outsideTop","Overlay--anchorSide-outsideLeft","Overlay--anchorSide-outsideRight"),this.classList.add(`Overlay--anchorAlign-${o}`,`Overlay--anchorSide-${i}`)})),"f"))}}var Mt,xt,St;kt=new WeakMap,Lt=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));const Ct='[role="menuitem"],[role="menuitemcheckbox"],[role="menuitemradio"]',Dt=t=>{var e;return null===(e=t.textContent)||void 0===e?void 0:e.trim()[0].toLowerCase()},It=/^\S$/;class FocusGroupElement extends HTMLElement{constructor(){super(...arguments),Mt.add(this),xt.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(){it(this,xt,new AbortController,"f");const{signal:t}=nt(this,xt,"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(){var t;null===(t=nt(this,xt,"f"))||void 0===t||t.abort()}handleEvent(t){const{direction:e,nowrap:n}=this;if("focusin"===t.type){if(this.retain&&t.target instanceof Element&&t.target.matches(Ct))for(const e of nt(this,Mt,"a",St))e.setAttribute("tabindex",e===t.target?"0":"-1")}else if(t instanceof KeyboardEvent){const i=Array.from(nt(this,Mt,"a",St));let o=i.indexOf(t.target);const s=t.key;if("Up"===s||"ArrowUp"===s)"vertical"!==e&&"both"!==e||(o-=o<0?0:1,t.preventDefault());else if("Down"===s||"ArrowDown"===s)"vertical"!==e&&"both"!==e||(o+=1,t.preventDefault());else if("Left"===t.key||"ArrowLeft"===t.key)"horizontal"!==e&&"both"!==e||(o-=1,t.preventDefault());else if("Right"===t.key||"ArrowRight"===t.key)"horizontal"!==e&&"both"!==e||(o+=1,t.preventDefault());else if("Home"===t.key||"PageUp"===t.key)o=0,t.preventDefault();else if("End"===t.key||"PageDown"===t.key)o=i.length-1,t.preventDefault();else{if(!this.mnemonics||!It.test(s))return;{const e=s.toLowerCase(),r=o>0&&Dt(t.target)===e?o:0;o=i.findIndex(((t,n)=>n>r&&Dt(t)===e)),o<0&&!n&&(o=i.findIndex((t=>Dt(t)===e)))}}n&&o<0&&(o=0),!n&&o>=i.length&&(o=0);const r=i.at(Math.min(o,i.length-1));{let t=r;do{t=t.closest("[popover]:not(:popover-open)"),"auto"===(null==t?void 0:t.popover)&&t.showPopover(),t=(null==t?void 0:t.parentElement)||null}while(t)}null==r||r.focus()}}}xt=new WeakMap,Mt=new WeakSet,St=function(){return this.querySelectorAll(Ct)},customElements.get("focus-group")||(window.FocusGroupElement=FocusGroupElement,customElements.define("focus-group",FocusGroupElement));const Ot=new WeakMap,Ht=new WeakMap,Pt=new WeakMap;function Rt(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=Pt.get(e)||{};if(!n||!i)return;let o=0,s=0;if(t instanceof KeyboardEvent)"ArrowUp"===t.key?s=-1:"ArrowDown"===t.key?s=1:"ArrowLeft"===t.key?o=-1:"ArrowRight"===t.key&&(o=1);else if(Ht.has(e)&&t instanceof MouseEvent){const n=Ht.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(Ht.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=Ht.get(e);o=n-r,s=i-a}if(0!==o||0!==s){const t=Math.min(Math.max(0,n.offsetLeft+o),i.width-n.offsetWidth),r=Math.min(Math.max(0,n.offsetTop+s),i.height-n.offsetHeight);n.style.left=`${t}px`,n.style.top=`${r}px`,jt(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)Ht.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];Ht.set(e,{dragStartX:n,dragStartY:i})}}function Ft(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=qt(e);if(!(n instanceof ImageCropElement))return;const{box:i}=Pt.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return Nt(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,Ot.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=Ot.get(n);if(!e)return;s=t.pageX-e.startX-o.left-window.pageXOffset,r=t.pageY-e.startY-o.top-window.pageYOffset}else if(t instanceof TouchEvent){const e=Ot.get(n);if(!e)return;s=t.changedTouches[0].pageX-e.startX-o.left-window.pageXOffset,r=t.changedTouches[0].pageY-e.startY-o.top-window.pageYOffset}s&&r&&$t(n,s,r,!(t instanceof KeyboardEvent))}function qt(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function Wt(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=qt(e);if(!(n instanceof ImageCropElement))return;const{box:i}=Pt.get(n)||{};if(!i)return;const o=t.target;if(o instanceof HTMLElement)if(o.hasAttribute("data-direction")){const e=o.getAttribute("data-direction")||"";n.addEventListener("mousemove",Ft),n.addEventListener("touchmove",Ft,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),Ot.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),Ft(t)}else n.addEventListener("mousemove",Rt),n.addEventListener("touchmove",Rt,{passive:!0})}function $t(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=Ot.get(t);if(!s)return;const{box:r,image:a}=Pt.get(t)||{};if(!r||!a)return;o=Math.min(o,n>0?a.height-s.startY:s.startY,e>0?a.width-s.startX:s.startX);const l=i?Math.round(Math.max(0,e>0?s.startX:s.startX-o)):r.offsetLeft,c=i?Math.round(Math.max(0,n>0?s.startY:s.startY-o)):r.offsetTop;r.style.left=`${l}px`,r.style.top=`${c}px`,r.style.width=`${o}px`,r.style.height=`${o}px`,jt(t,{x:l,y:c,width:o,height:o})}function Nt(t){const{image:e}=Pt.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);Ot.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),$t(t,n,n)}function Bt(t){const e=t.currentTarget;e instanceof ImageCropElement&&(Ht.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",Ft),e.removeEventListener("mousemove",Rt),e.removeEventListener("touchmove",Ft),e.removeEventListener("touchmove",Rt))}function jt(t,e){const{image:n}=Pt.get(t)||{};if(!n)return;const i=n.naturalWidth/n.width;for(const n in e){const o=Math.round(e[n]*i);e[n]=o;const s=t.querySelector(`[data-image-crop-input='${n}']`);s instanceof HTMLInputElement&&(s.value=o.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class ImageCropElement extends HTMLElement{connectedCallback(){if(Pt.has(this))return;const t=this.attachShadow({mode:"open"});t.innerHTML='\n<style>\n :host { touch-action: none; display: block; }\n :host(.nesw) { cursor: nesw-resize; }\n :host(.nwse) { cursor: nwse-resize; }\n :host(.nesw) .crop-box, :host(.nwse) .crop-box { cursor: inherit; }\n :host([loaded]) .crop-image { display: block; }\n :host([loaded]) ::slotted([data-loading-slot]), .crop-image { display: none; }\n\n .crop-wrapper {\n position: relative;\n font-size: 0;\n }\n .crop-container {\n user-select: none;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n overflow: hidden;\n z-index: 1;\n top: 0;\n width: 100%;\n height: 100%;\n }\n\n :host([rounded]) .crop-box {\n border-radius: 50%;\n box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.3);\n }\n .crop-box {\n position: absolute;\n border: 1px dashed #fff;\n box-sizing: border-box;\n cursor: move;\n }\n\n :host([rounded]) .crop-outline {\n outline: none;\n }\n .crop-outline {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n outline: 4000px solid rgba(0, 0, 0, .3);\n }\n\n .handle { position: absolute; }\n :host([rounded]) .handle::before { border-radius: 50%; }\n .handle:before {\n position: absolute;\n display: block;\n padding: 4px;\n transform: translate(-50%, -50%);\n content: \' \';\n background: #fff;\n border: 1px solid #767676;\n }\n .ne { top: 0; right: 0; cursor: nesw-resize; }\n .nw { top: 0; left: 0; cursor: nwse-resize; }\n .se { bottom: 0; right: 0; cursor: nwse-resize; }\n .sw { bottom: 0; left: 0; cursor: nesw-resize; }\n</style>\n<slot></slot>\n<div class="crop-wrapper">\n <img width="100%" class="crop-image" alt="">\n <div class="crop-container">\n <div data-crop-box class="crop-box">\n <div class="crop-outline"></div>\n <div data-direction="nw" class="handle nw"></div>\n <div data-direction="ne" class="handle ne"></div>\n <div data-direction="sw" class="handle sw"></div>\n <div data-direction="se" class="handle se"></div>\n </div>\n </div>\n</div>\n';const e=t.querySelector("[data-crop-box]");if(!(e instanceof HTMLElement))return;const n=t.querySelector("img");n instanceof HTMLImageElement&&(Pt.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,Nt(this)})),this.addEventListener("mouseleave",Bt),this.addEventListener("touchend",Bt),this.addEventListener("mouseup",Bt),e.addEventListener("mousedown",Wt),e.addEventListener("touchstart",Wt,{passive:!0}),this.addEventListener("keydown",Rt),this.addEventListener("keydown",Ft),this.src&&(n.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,n){const{image:i}=Pt.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}var Kt,Yt,zt,Vt;function Xt(t){document.activeElement!==t&&(null==t||t.focus())}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const Ut=[];function Gt(t){const e=t.target,n=null==e?void 0:e.closest("button");if(!n||n.hasAttribute("disabled")||"true"===n.getAttribute("aria-disabled"))return;let i=null==n?void 0: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()}const o=Ut[Ut.length-1];o&&(i=n.getAttribute("data-close-dialog-id"),i===o.id&&(Ut.pop(),o.close()),i=n.getAttribute("data-submit-dialog-id"),i===o.id&&(Ut.pop(),o.close(!0)))}function Zt(t){!(t instanceof KeyboardEvent&&"keydown"===t.type&&"Enter"===t.key)||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey||Gt(t)}function _t(t){const e=t.target;if(null==e?void 0:e.closest("button"))return;const n=Ut[Ut.length-1];if(!n)return;!e.closest(`#${n.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",(t=>{t.target===e&&(Ut.pop(),n.close())}),{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),Kt.add(this),Yt.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){var e,n,i,o;if(t){if(this.open)return;this.setAttribute("open",""),this.setAttribute("aria-disabled","false"),null===(e=nt(this,Kt,"a",zt))||void 0===e||e.classList.remove("Overlay--hidden"),document.body.style.paddingRight=window.innerWidth-document.body.clientWidth+"px",document.body.style.overflow="hidden",nt(this,Yt,"f").signal.aborted&&it(this,Yt,new AbortController,"f"),At(this,void 0,nt(this,Yt,"f").signal),Ut.push(this)}else{if(!this.open)return;this.removeAttribute("open"),this.setAttribute("aria-disabled","true"),null===(n=nt(this,Kt,"a",zt))||void 0===n||n.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",nt(this,Yt,"f").abort();const t=(null===(i=this.openButton)||void 0===i?void 0:i.closest("details"))||(null===(o=this.openButton)||void 0===o?void 0:o.closest("action-menu"));Xt(t?pt(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",Gt),document.addEventListener("keydown",Zt),document.addEventListener("mousedown",_t),this.addEventListener("keydown",(t=>nt(this,Kt,"m",Vt).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}}Yt=new WeakMap,Kt=new WeakSet,zt=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},Vt=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));const Jt=new WeakSet;function Qt(t){ne(t),ee(t)}const te=new WeakMap;function ee(t=document){if(te.has(t))return te.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)se(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&ne(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const i={get closed(){return e},unsubscribe(){e=!0,te.delete(t),n.disconnect()}};return te.set(t,i),i}function ne(t){for(const e of t.querySelectorAll("[data-action]"))se(e);t instanceof Element&&t.hasAttribute("data-action")&&se(t)}function ie(t){const e=t.currentTarget;for(const n of oe(e))if(t.type===n.type){const i=e.closest(n.tag);Jt.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const o=e.getRootNode();if(o instanceof ShadowRoot&&Jt.has(o.host)&&o.host.matches(n.tag)){const e=o.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*oe(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 se(t){for(const e of oe(t))t.addEventListener(e.type,ie)}const re=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),ae=(t,e="property")=>{const n=re(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const le="attr",ce=new WeakSet;function ue(t,e){if(ce.has(t))return;ce.add(t);const n=Object.getPrototypeOf(t),i=n?.constructor?.attrPrefix??"data-";e||(e=fe(n,le));for(const n of e){const e=t[n],o=ae(`${i}${n}`);let s={configurable:!0,get(){return this.getAttribute(o)||""},set(t){this.setAttribute(o,t||"")}};"number"==typeof e?s={configurable:!0,get(){return Number(this.getAttribute(o)||0)},set(t){this.setAttribute(o,t)}}:"boolean"==typeof e&&(s={configurable:!0,get(){return this.hasAttribute(o)},set(t){this.toggleAttribute(o,t)}}),Object.defineProperty(t,n,s),n in t&&!t.hasAttribute(o)&&s.set.call(t,e)}}const de=Symbol.for("catalyst");class he{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 o=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,n,i){e.attributeChangedCallback(this,t,n,i,o)};let s=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return e.observedAttributes(this,s)},set(t){s=t}}),function(t){let e=t.observedAttributes||[];const n=t.attrPrefix??"data-",i=t=>ae(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...fe(t.prototype,le)].map(i).concat(e),set(t){e=t}})}(t),function(t){const e=re(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),ue(t),function(t){Jt.add(t),t.shadowRoot&&Qt(t.shadowRoot),ne(t),ee(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&Qt(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,i,o){ue(t),"data-catalyst"!==e&&o&&o.call(t,e,n,i)}}function fe(t,e){if(!Object.prototype.hasOwnProperty.call(t,de)){const e=t[de],n=t[de]=new Map;if(e)for(const[t,i]of e)n.set(t,new Set(i))}const n=t[de];return n.has(e)||n.set(e,new Set),n.get(e)}function me(t,e){fe(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 pe(t,e){fe(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 o of t.shadowRoot.querySelectorAll(`[data-targets~="${n}.${e}"]`))o.closest(n)||i.push(o);for(const o of t.querySelectorAll(`[data-targets~="${n}.${e}"]`))o.closest(n)===t&&i.push(o);return i}(this,e)}})}function ge(t){new he(t)}var be,ve,we,ye,Ee,Ae,ke,Le;new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),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)}));let Te=class NavListElement extends HTMLElement{constructor(){super(...arguments),be.add(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")||""}selectItemById(t){if(!t)return!1;const e=nt(this,be,"m",we).call(this,t);return!!e&&(nt(this,be,"m",Ae).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=nt(this,be,"m",ye).call(this,t);return!!e&&(nt(this,be,"m",Ae).call(this,e),!0)}selectItemByCurrentLocation(){const t=nt(this,be,"m",Ee).call(this);return!!t&&(nt(this,be,"m",Ae).call(this,t),!0)}expandItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false"),t.focus()}itemIsExpanded(t){return"A"===(null==t?void 0:t.tagName)||"true"===(null==t?void 0: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()}async showMore(t){var e,n;if(t.preventDefault(),this.showMoreDisabled)return;let i;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const e=await fetch(t);if(!e.ok)return;i=await e.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const o=nt(this,be,"m",ve).call(this,document,i);null===(e=null==o?void 0:o.querySelector("li > a"))||void 0===e||e.setAttribute("data-targets","nav-list.focusMarkers");const s=t.target.closest("button").getAttribute("data-list-id");document.getElementById(s).append(o),null===(n=this.focusMarkers.pop())||void 0===n||n.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}};var Me,xe;be=new WeakSet,ve=function(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)},we=function(t){var e;for(const n of this.items){if(n.classList.contains("ActionListItem--hasSubItem"))continue;if(((null===(e=n.getAttribute("data-item-id"))||void 0===e?void 0:e.split(" "))||[]).includes(t))return n}return null},ye=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},Ee=function(){return nt(this,be,"m",ye).call(this,window.location.pathname)},Ae=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&nt(this,be,"m",ke).call(this,e),t.classList.add("ActionListItem--navActive"),t.children.length>0&&t.children[0].setAttribute("aria-current","page");const n=nt(this,be,"m",Le).call(this,t);n&&(this.expandItem(n),n.classList.add("ActionListContent--hasActiveSubItem"))},ke=function(t){t.classList.remove("ActionListItem--navActive"),t.children.length>0&&t.children[0].removeAttribute("aria-current");const e=nt(this,be,"m",Le).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},Le=function(t){var e;if(!t.classList.contains("ActionListItem--subItem"))return null;const n=null===(e=t.closest("li.ActionListItem--hasSubItem"))||void 0===e?void 0:e.querySelector("button.ActionListContent");return n||null},et([pe],Te.prototype,"items",void 0),et([me],Te.prototype,"showMoreItem",void 0),et([pe],Te.prototype,"focusMarkers",void 0),Te=et([ge],Te);let Se=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),Me.add(this)}connectedCallback(){nt(this,Me,"m",xe).call(this)}select(t){var e,n;const i=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),null===(e=t.querySelector("[aria-current]"))||void 0===e||e.setAttribute("aria-current","false");null===(n=i.closest("li.SegmentedControl-item"))||void 0===n||n.classList.add("SegmentedControl-item--selected"),i.setAttribute("aria-current","true")}};Me=new WeakSet,xe=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},et([pe],Se.prototype,"items",void 0),Se=et([ge],Se),window.customElements.get("segmented-control")||(window.SegmentedControlElement=Se,window.customElements.define("segmented-control",Se));let Ce=class ToggleSwitchElement extends HTMLElement{constructor(){super(...arguments),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("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;try{e=await fetch(this.src,{credentials:"same-origin",method:"POST",headers:{"Requested-With":"XMLHttpRequest"},body:t})}catch(t){throw new Error("A network error occurred, please try again.")}if(!e.ok)throw new Error(await e.text())}};var De,Ie,Oe,He,Pe,Re,Fe,qe,We;et([me],Ce.prototype,"switch",void 0),et([me],Ce.prototype,"loadingSpinner",void 0),et([me],Ce.prototype,"errorIcon",void 0),Ce=et([ge],Ce),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=Ce,window.customElements.define("toggle-switch",Ce));const $e="tooltip-open",Ne="sr-only",Be=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class ToolTipElement extends HTMLElement{constructor(){super(...arguments),De.add(this),Ie.set(this,void 0),Oe.set(this,"center"),He.set(this,"outside-bottom"),Pe.set(this,!1)}styles(){return'\n :host {\n position: absolute;\n z-index: 1000000;\n padding: .5em .75em;\n font: normal normal 11px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";\n -webkit-font-smoothing: subpixel-antialiased;\n color: var(--color-fg-on-emphasis);\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(--color-neutral-emphasis-plus);\n border-radius: 6px;\n opacity: 0;\n max-width: 250px;\n word-wrap: break-word;\n white-space: normal;\n width: max-content;\n }\n\n :host:before{\n position: absolute;\n z-index: 1000001;\n color: var(--color-neutral-emphasis-plus);\n content: "";\n border: 6px solid transparent;\n opacity: 0\n }\n\n @keyframes tooltip-appear {\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n }\n\n :host:after{\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: 12px;\n content: ""\n }\n\n :host(.tooltip-open),\n :host(.tooltip-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n animation-delay: .4s\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-n):before {\n right: 50%;\n margin-right: -6px;\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-se):before,\n :host(.tooltip-sw):before {\n bottom: 100%;\n border-bottom-color: var(--color-neutral-emphasis-plus)\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):before,\n :host(.tooltip-ne):before,\n :host(.tooltip-nw):before {\n top: 100%;\n border-top-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%\n }\n\n :host(.tooltip-se):before,\n :host(.tooltip-ne):before {\n left: 0;\n margin-left: 6px;\n }\n\n :host(.tooltip-sw):before,\n :host(.tooltip-nw):before {\n right: 0;\n margin-right: 6px;\n }\n\n :host(.tooltip-w):before {\n top: 50%;\n bottom: 50%;\n left: 100%;\n margin-top: -6px;\n border-left-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-e):before {\n top: 50%;\n right: 100%;\n bottom: 50%;\n margin-top: -6px;\n border-right-color: var(--color-neutral-emphasis-plus)\n }\n '}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){this.classList.toggle(Ne,t),this.isConnected&&nt(this,De,"m",Re).call(this)}get hiddenFromView(){return this.classList.contains(Ne)}connectedCallback(){var t;if(nt(this,De,"m",Fe).call(this),nt(this,De,"m",qe).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}if(this.hiddenFromView=!0,it(this,Pe,!0,"f"),!this.control)return;this.setAttribute("role","tooltip"),null===(t=nt(this,Ie,"f"))||void 0===t||t.abort(),it(this,Ie,new AbortController,"f");const{signal:e}=nt(this,Ie,"f");this.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("mouseenter",this,{signal:e}),this.control.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("focus",this,{signal:e}),this.control.addEventListener("blur",this,{signal:e}),this.ownerDocument.addEventListener("keydown",this,{signal:e}),nt(this,De,"m",Re).call(this)}disconnectedCallback(){var t;null===(t=nt(this,Ie,"f"))||void 0===t||t.abort()}handleEvent(t){this.control&&("mouseenter"!==t.type&&"focus"!==t.type||!this.hiddenFromView?"blur"===t.type||"mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hiddenFromView=!0:"keydown"!==t.type||"Escape"!==t.key||this.hiddenFromView||(this.hiddenFromView=!0):this.hiddenFromView=!1)}attributeChangedCallback(t){this.isConnected&&("id"===t||"data-type"===t?nt(this,De,"m",Fe).call(this):"data-direction"===t&&nt(this,De,"m",qe).call(this))}}Ie=new WeakMap,Oe=new WeakMap,He=new WeakMap,Pe=new WeakMap,De=new WeakSet,Re=function(){if(this.hiddenFromView)this.classList.remove($e,...Be);else{this.classList.add($e);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);nt(this,De,"m",We).call(this)}},Fe=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)}},qe=function(){this.classList.remove(...Be);const t=this.direction;"n"===t?(it(this,Oe,"center","f"),it(this,He,"outside-top","f")):"ne"===t?(it(this,Oe,"start","f"),it(this,He,"outside-top","f")):"e"===t?(it(this,Oe,"center","f"),it(this,He,"outside-right","f")):"se"===t?(it(this,Oe,"start","f"),it(this,He,"outside-bottom","f")):"s"===t?(it(this,Oe,"center","f"),it(this,He,"outside-bottom","f")):"sw"===t?(it(this,Oe,"end","f"),it(this,He,"outside-bottom","f")):"w"===t?(it(this,Oe,"center","f"),it(this,He,"outside-left","f")):"nw"===t&&(it(this,Oe,"end","f"),it(this,He,"outside-top","f"))},We=function(){if(!this.control)return;if(!nt(this,Pe,"f")||this.hiddenFromView)return;this.style.left="0px";const t=rt(this,this.control,{side:nt(this,He,"f"),align:nt(this,Oe,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.top=`${t.top}px`,this.style.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"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let je=class XBannerElement extends HTMLElement{dismiss(){if(this.shouldReappear())return this.style.setProperty("visibility","hidden"),void setTimeout((()=>{this.style.setProperty("visibility","visible")}),2e3);const t=this.parentElement;t&&t.removeChild(this)}shouldReappear(){return"true"===this.getAttribute("data-reappear")}};et([me],je.prototype,"titleText",void 0),je=et([ge],je),window.customElements.get("x-banner")||(window.XBannerElement=je,window.customElements.define("x-banner",je));class Ke{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":ze(e.input,e.list)&&t.preventDefault();break;case"Tab":e.tabInsertsSuggestions&&ze(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;if(!document.getElementById(e.input.getAttribute("aria-controls")||""))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",Ye),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",Ye)}indicateDefaultOption(){var t;this.defaultFirstOption&&(null===(t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(Ve)[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(Ve)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Ve),i=n.indexOf(e);if(i===n.length-1&&1===t||0===i&&-1===t)return this.clearSelection(),void this.input.focus();let o=1===t?0:n.length-1;if(e&&i>=0){const e=i+t;e>=0&&e<n.length&&(o=e)}const s=n[o];if(s)for(const t of n)t.removeAttribute("data-combobox-option-default"),s===t?(this.input.setAttribute("aria-activedescendant",s.id),s.setAttribute("aria-selected","true"),Xe(this.list,s)):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 Ye(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 ze(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 Ve(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function Xe(t,e){(function(t,e){const n=t.scrollTop,i=n+t.clientHeight,o=e.offsetTop,s=o+e.clientHeight;return o>=n&&s<=i})(t,e)||(t.scrollTop=e.offsetTop)}const Ue=window.testScreenReaderDelay||100;class Ge{constructor(t,e,n,i=!1){var o;if(this.container=t,this.input=e,this.results=n,this.combobox=new Ke(e,n),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.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===(o=this.clearButton)||void 0===o||o.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.container.open=!1}onKeydown(t){if("Enter"===t.key&&this.container.open&&this.autoselectEnabled){const e=this.results.children[0];e&&(t.stopPropagation(),t.preventDefault(),this.onCommit({target:e}))}if("Escape"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.container.open=!0,t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.fetchResults()}onInputBlur(){this.interactingWithList?this.interactingWithList=!1:this.container.open=!1}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(this.container.open=!1,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)}),Ue)}fetchResults(){const t=this.input.value.trim();if(!t&&!this.container.fetchOnEmpty)return void(this.container.open=!1);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();const e=this.results.querySelectorAll('[role="option"]'),n=!!e.length,i=e.length,[o]=e,s=null==o?void 0:o.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${i} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${i||"No"} results.`),this.container.open=n,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.hidden&&(this.combobox.start(),this.results.hidden=!1)}close(){this.results.hidden||(this.combobox.stop(),this.results.hidden=!0)}}var Ze,_e,Je,Qe,tn,en=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)},nn=function(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n},on=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 o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n};const sn=globalThis.HTMLElement||null;class rn extends Event{constructor(t,e){var{relatedTarget:n}=e;super(t,on(e,["relatedTarget"])),this.relatedTarget=n}}const an=new WeakMap;let ln=null;class AutoCompleteElement extends sn{constructor(){super(...arguments),Ze.add(this),_e.set(this,null),Je.set(this,null),tn.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){ln=null===t?t:Promise.resolve(t)}get forElement(){var t;if(null===(t=en(this,_e,"f"))||void 0===t?void 0:t.isConnected)return en(this,_e,"f");const e=this.getAttribute("for"),n=this.getRootNode();return e&&(n instanceof Document||n instanceof ShadowRoot)?n.getElementById(e):null}set forElement(t){nn(this,_e,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return(null===(t=en(this,Je,"f"))||void 0===t?void 0:t.isConnected)?en(this,Je,"f"):this.querySelector("input")}set inputElement(t){nn(this,Je,t,"f"),en(this,Ze,"m",Qe).call(this)}connectedCallback(){this.isConnected&&en(this,Ze,"m",Qe).call(this)}disconnectedCallback(){const t=an.get(this);t&&(t.destroy(),an.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}get fetchOnEmpty(){return this.hasAttribute("fetch-on-empty")}set fetchOnEmpty(t){this.toggleAttribute("fetch-on-empty",t)}async fetchResult(t){var e;null===(e=en(this,tn,"f"))||void 0===e||e.abort();const{signal:n}=nn(this,tn,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(ln){return(await ln).createHTML(await i.text(),i)}return await i.text()}static get observedAttributes(){return["open","value","for"]}attributeChangedCallback(t,e,n){var i,o;if(e===n)return;const s=an.get(this);if(s)switch(this.forElement===(null===(i=an.get(this))||void 0===i?void 0:i.results)&&this.inputElement===(null===(o=an.get(this))||void 0===o?void 0:o.input)||en(this,Ze,"m",Qe).call(this),t){case"open":null===n?s.close():s.open();break;case"value":null!==n&&(s.input.value=n),this.dispatchEvent(new rn("auto-complete-change",{bubbles:!0,relatedTarget:s.input}))}}}_e=new WeakMap,Je=new WeakMap,tn=new WeakMap,Ze=new WeakSet,Qe=function(){var t;null===(t=an.get(this))||void 0===t||t.destroy();const{forElement:e,inputElement:n}=this;if(!e||!n)return;const i="true"===this.getAttribute("data-autoselect");an.set(this,new Ge(this,n,e,i)),e.setAttribute("role","listbox")};const cn="undefined"!=typeof globalThis?globalThis:window;try{cn.AutocompleteElement=cn.AutoCompleteElement=AutoCompleteElement.define()}catch(t){if(!(cn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function 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 n=document.createRange();return n.selectNodeContents(t),e.addRange(n),document.execCommand("copy"),e.removeAllRanges(),Promise.resolve()}function dn(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),un(n),e.removeChild(n),Promise.resolve()}function hn(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)dn(n).then(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 s=n.getElementById(e);s&&(o=s,o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?dn(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?dn(o.href):un(o)).then(i)}var o}function fn(t){const e=t.currentTarget;e instanceof HTMLElement&&hn(e)}function mn(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),hn(e))}}function pn(t){t.currentTarget.addEventListener("keydown",mn)}function gn(t){t.currentTarget.removeEventListener("keydown",mn)}class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",fn),this.addEventListener("focus",pn),this.addEventListener("blur",gn)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}window.customElements.get("clipboard-copy")||(window.ClipboardCopyElement=ClipboardCopyElement,window.customElements.define("clipboard-copy",ClipboardCopyElement));function bn(t){t.style.display="inline-block"}function vn(t){t.style.display="none"}const wn=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=wn.get(t);e?(clearTimeout(e),wn.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(vn(e),bn(n))}(t),wn.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(bn(e),vn(n))}(t),wn.delete(t)}),2e3))}));var yn,En=function(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n},An=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 kn="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)}},Ln=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],Tn={minimumIntegerDigits:2};class Mn{constructor(t,e={}){yn.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 o=e.hours||i;i="2-digit"===o?"numeric":o;const s=e.minutes||i;i="2-digit"===s?"numeric":s;const r=e.seconds||i;i="2-digit"===r?"numeric":r;const a=e.milliseconds||i;En(this,yn,{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:o,hoursDisplay:"always"===e.hoursDisplay||"digital"===n?"always":"auto",minutes:s,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 An(this,yn,"f")}formatToParts(t){const e=[],n=An(this,yn,"f"),i=n.style,o=n.locale;for(const[i,s]of Ln){const r=t[i];if("auto"===n[`${i}Display`]&&!r)continue;const a=n[i],l="2-digit"===a?Tn:"numeric"===a?{}:{style:"unit",unit:s,unitDisplay:a};e.push(new Intl.NumberFormat(o,l).format(r))}return new kn(o,{type:"unit",style:"digital"===i?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map((t=>t.value)).join("")}}yn=new WeakMap;const xn=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,Sn=["year","month","week","day","hour","minute","second","millisecond"];class Cn{constructor(t=0,e=0,n=0,i=0,o=0,s=0,r=0,a=0){this.years=t,this.months=e,this.weeks=n,this.days=i,this.hours=o,this.minutes=s,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 Cn(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,o=null===(e=n.match(xn))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return o?new Cn(...o):new Cn}if("object"==typeof t){const{years:e,months:n,weeks:i,days:o,hours:s,minutes:r,seconds:a,milliseconds:l}=t;return new Cn(e,n,i,o,s,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const n=Date.now(),i=Math.abs(Dn(n,Cn.from(t)).getTime()-n),o=Math.abs(Dn(n,Cn.from(e)).getTime()-n);return i>o?-1:i<o?1:0}toLocaleString(t,e){return new Mn(t,e).format(this)}}function Dn(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e.years),n.setMonth(n.getMonth()+e.months),n.setDate(n.getDate()+7*e.weeks+e.days),n.setHours(n.getHours()+e.hours),n.setMinutes(n.getMinutes()+e.minutes),n.setSeconds(n.getSeconds()+e.seconds),n}function In(t,{relativeTo:e=Date.now()}={}){if(e=new Date(e),t.blank)return t;const n=t.sign;let i=Math.abs(t.years),o=Math.abs(t.months),s=Math.abs(t.weeks),r=Math.abs(t.days),a=Math.abs(t.hours),l=Math.abs(t.minutes),c=Math.abs(t.seconds),u=Math.abs(t.milliseconds);u>=900&&(c+=Math.round(u/1e3)),(c||l||a||r||s||o||i)&&(u=0),c>=55&&(l+=Math.round(c/60)),(l||a||r||s||o||i)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||r||s||o||i)&&(l=0),r&&a>=12&&(r+=Math.round(a/24)),!r&&a>=21&&(r+=Math.round(a/24)),(r||s||o||i)&&(a=0);const d=e.getFullYear();let h=e.getMonth();const f=e.getDate();return(r>=27||i+o&&r)&&(e.setDate(f+r*n),o+=Math.abs(e.getFullYear()>=d?e.getMonth()-h:e.getMonth()-h-12),o&&(r=0),h=e.getMonth()),r>=6&&(s+=Math.round(r/7)),(s||o||i)&&(r=0),s>=4&&(o+=Math.round(s/4)),(o||i)&&(s=0),(o>=11||i&&o)&&(e.setMonth(e.getMonth()+o*n),i+=Math.abs(d-e.getFullYear())),i&&(o=0),new Cn(i*n,o*n,s*n,r*n,a*n,l*n,c*n,u*n)}var On,Hn,Pn,Rn,Fn,qn,Wn,$n,Nn,Bn,jn,Kn=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)},Yn=function(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n};const zn=globalThis.HTMLElement||null,Vn=new Cn,Xn=new Cn(0,0,0,0,0,1);class Un 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 Gn(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 Zn=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=Gn(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,Gn(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends zn{constructor(){super(...arguments),On.add(this),Hn.set(this,!1),Pn.set(this,!1),Fn.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","datetime","lang","title"]}get onRelativeTimeUpdated(){return Kn(this,jn,"f")}set onRelativeTimeUpdated(t){Kn(this,jn,"f")&&this.removeEventListener("relative-time-updated",Kn(this,jn,"f")),Yn(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,xn.test(e))?t:"P30D";var e}set threshold(t){this.setAttribute("threshold",t)}get tense(){const t=this.getAttribute("tense");return"past"===t?"past":"future"===t?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){const t=this.getAttribute("precision");return Sn.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 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(){Zn.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&Yn(this,Hn,null!==n&&(this.date&&Kn(this,On,"m",qn).call(this,this.date))!==n,"f"),Kn(this,Pn,"f")||"title"===t&&Kn(this,Hn,"f")||Yn(this,Pn,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){const t=Kn(this,Fn,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let n=e;const i=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!i)return void(Kn(this,Fn,"f").textContent=t);const o=Date.now();Kn(this,Hn,"f")||(n=Kn(this,On,"m",qn).call(this,i)||"",n&&this.setAttribute("title",n));const s=function(t,e="second",n=Date.now()){const i=t.getTime()-n;if(0===i)return new Cn;const o=Math.sign(i),s=Math.abs(i),r=Math.floor(s/1e3),a=Math.floor(r/60),l=Math.floor(a/60),c=Math.floor(l/24),u=Math.floor(c/30),d=Math.floor(u/12),h=Sn.indexOf(e)||Sn.length;return new Cn(h>=0?d*o:0,h>=1?(u-12*d)*o:0,0,h>=3?(c-30*u)*o:0,h>=4?(l-24*c)*o:0,h>=5?(a-60*l)*o:0,h>=6?(r-60*a)*o:0,h>=7?(s-1e3*r)*o:0)}(i,this.precision,o),r=Kn(this,On,"m",Wn).call(this,s);let a=t;a="duration"===r?Kn(this,On,"m",$n).call(this,s):"relative"===r?Kn(this,On,"m",Nn).call(this,s):Kn(this,On,"m",Bn).call(this,i),a?Kn(this,Fn,"f").textContent=a:this.shadowRoot===Kn(this,Fn,"f")&&this.textContent&&(Kn(this,Fn,"f").textContent=this.textContent),a===t&&n===e||this.dispatchEvent(new Un(t,a,e,n)),"relative"===r||"duration"===r?Zn.observe(this):Zn.unobserve(this),Yn(this,Pn,!1,"f")}}Hn=new WeakMap,Pn=new WeakMap,Fn=new WeakMap,jn=new WeakMap,On=new WeakSet,Rn=function(){var t;return(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang")||"default"},qn=function(t){return new Intl.DateTimeFormat(Kn(this,On,"a",Rn),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},Wn=function(t){const e=this.format;if("datetime"===e)return"datetime";if("duration"===e)return"duration";if("elapsed"===e)return"duration";if("micro"===e)return"duration";if(("auto"===e||"relative"===e)&&"undefined"!=typeof Intl&&Intl.RelativeTimeFormat){const e=this.tense;if("past"===e||"future"===e)return"relative";if(1===Cn.compare(t,this.threshold))return"relative"}return"datetime"},$n=function(t){const e=Kn(this,On,"a",Rn),n=this.format,i=this.formatStyle,o=this.tense;let s=Vn;"micro"===n?(t=In(t),s=Xn,("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=Xn)):("past"===o&&-1!==t.sign||"future"===o&&1!==t.sign)&&(t=s);const r=`${this.precision}sDisplay`;return t.blank?s.toLocaleString(e,{style:i,[r]:"always"}):t.abs().toLocaleString(e,{style:i})},Nn=function(t){const e=new Intl.RelativeTimeFormat(Kn(this,On,"a",Rn),{numeric:"auto",style:this.formatStyle}),n=this.tense;"future"===n&&1!==t.sign&&(t=Vn),"past"===n&&-1!==t.sign&&(t=Vn);const[i,o]=function(t,e){const n=In(t,e);if(n.blank)return[0,"second"];for(const t of Sn){if("millisecond"===t)continue;const e=n[`${t}s`];if(e)return[e,t]}return[0,"second"]}(t);return"second"===o&&i<10?e.format(0,"second"):e.format(i,o)},Bn=function(t){const e=new Intl.DateTimeFormat(Kn(this,On,"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()};const _n="undefined"!=typeof globalThis?globalThis:window;try{_n.RelativeTimeElement=RelativeTimeElement.define()}catch(t){if(!(_n.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function Jn(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if(e.closest(this.tagName)!==this)return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Jn(this),i=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]')))),[o,s]="vertical"===e.closest('[role="tablist"]')?.getAttribute("aria-orientation")?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(o.some((e=>t.code===e))){let t=i+1;t>=n.length&&(t=0),this.selectTab(t)}else if(s.some((e=>t.code===e))){let t=i-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=Jn(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)}))}connectedCallback(){for(const t of Jn(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=Jn(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],o=n[t];if(!!this.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:o}}))){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(),o.hidden=!1,this.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:o}}))}}}window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement));let Qn=class PrimerMultiInputElement extends HTMLElement{activateField(t){var e,n;const i=this.findField(t);if(i){for(const t of this.fields)t!==i&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),null===(e=t.parentElement)||void 0===e||e.setAttribute("hidden","hidden"));i.removeAttribute("disabled"),i.removeAttribute("hidden"),null===(n=i.parentElement)||void 0===n||n.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function ti(t,e=0,{start:n=!1,middle:i=!1,once:o=!1}={}){return function(t,e=0,{start:n=!0,middle:i=!0,once:o=!1}={}){let s,r=0,a=!1;function l(...c){if(a)return;const u=Date.now()-r;r=Date.now(),n?(n=!1,t.apply(this,c),o&&l.cancel()):(i&&u<e||!i)&&(clearTimeout(s),s=setTimeout((()=>{r=Date.now(),t.apply(this,c),o&&l.cancel()}),i?e-u:e))}return l.cancel=()=>{clearTimeout(s),a=!0},l}(t,e,{start:n,middle:i,once:o})}et([pe],Qn.prototype,"fields",void 0),Qn=et([ge],Qn),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:Qn}),window.customElements.define("primer-multi-input",Qn));var ei,ni=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)},ii=function(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n};const oi=new WeakMap;class si extends Event{constructor(t){super(`auto-check-${t}`,{bubbles:!0}),this.phase=t}get detail(){return this}}class ri extends si{constructor(t,e=""){super(t),this.phase=t,this.message=e}setValidity(t){this.message=t}}class ai extends si{constructor(){super("complete")}}class li extends si{constructor(t){super("success"),this.response=t}}class ci extends ri{constructor(){super("start","Verifying…")}}class ui extends ri{constructor(t){super("error","Validation failed"),this.response=t}}class di extends si{constructor(t){super("send"),this.body=t}}class AutoCheckElement extends HTMLElement{constructor(){super(...arguments),ei.set(this,null)}static define(t="auto-check",e=customElements){return e.define(t,this),this}get onloadend(){return ni(this,ei,"f")}set onloadend(t){ni(this,ei,"f")&&this.removeEventListener("loadend",ni(this,ei,"f")),ii(this,ei,"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=ti(fi.bind(null,this),300),n={check:e,controller:null};oi.set(this,n),t.addEventListener("input",hi),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=oi.get(this);e&&(oi.delete(this),t.removeEventListener("input",hi),t.removeEventListener("input",e.check),t.setCustomValidity(""))}attributeChangedCallback(t){if("required"===t){const t=this.input;if(!t)return;t.required=this.required}}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)}}function hi(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,o=n.csrf,s=oi.get(n);if(!i||!o||!s)return;const r=new ci;e.dispatchEvent(r),n.required&&e.setCustomValidity(r.message)}async function fi(t){const e=t.input;if(!e)return;const n=t.csrfField,i=t.src,o=t.csrf,s=oi.get(t);if(!i||!o||!s)return void(t.required&&e.setCustomValidity(""));if(!e.value.trim())return void(t.required&&e.setCustomValidity(""));const r=new FormData;r.append(n,o),r.append("value",e.value),e.dispatchEvent(new di(r)),s.controller?s.controller.abort():t.dispatchEvent(new Event("loadstart")),s.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};try{const n=await async function(t,e,n){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,i,{credentials:"same-origin",signal:s.controller.signal,method:"POST",body:r});if(n.ok)t.required&&e.setCustomValidity(""),e.dispatchEvent(new li(n.clone()));else{const i=new ui(n.clone());e.dispatchEvent(i),t.required&&e.setCustomValidity(i.message)}s.controller=null,e.dispatchEvent(new ai)}catch(t){"AbortError"!==t.name&&(s.controller=null,e.dispatchEvent(new ai))}}ei=new WeakMap;const mi="undefined"!=typeof globalThis?globalThis:window;try{mi.AutoCheckElement=AutoCheckElement.define()}catch(t){if(!(mi.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}var pi;let gi=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),pi.set(this,void 0)}connectedCallback(){var t;null===(t=nt(this,pi,"f"))||void 0===t||t.abort();const{signal:e}=it(this,pi,new AbortController,"f");this.inputElement.addEventListener("auto-check-success",(()=>{this.clearError()}),{signal:e}),this.inputElement.addEventListener("auto-check-error",(async t=>{const e=await t.detail.response.text();this.setError(e)}),{signal:e})}disconnectedCallback(){var t;null===(t=nt(this,pi,"f"))||void 0===t||t.abort()}clearContents(){this.inputElement.value="",this.inputElement.focus()}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.textContent=""}setError(t){this.validationMessageElement.textContent=t,this.validationElement.hidden=!1,this.inputElement.setAttribute("invalid","true")}};pi=new WeakMap,et([me],gi.prototype,"inputElement",void 0),et([me],gi.prototype,"validationElement",void 0),et([me],gi.prototype,"validationMessageElement",void 0),gi=et([ge],gi);let bi=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 vi,wi,yi,Ei,Ai,ki,Li,Ti;et([me],bi.prototype,"validationElement",void 0),et([me],bi.prototype,"validationMessageElement",void 0),bi=et([ge],bi);const Mi=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]'];let xi=class ActionMenuElement extends HTMLElement{constructor(){super(...arguments),vi.add(this),wi.set(this,void 0),yi.set(this,""),Ei.set(this,"")}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.querySelector("[popover]")}get invokerElement(){var t;const e=null===(t=this.querySelector("[role=menu]"))||void 0===t?void 0:t.id;if(!e)return null;for(const t of this.querySelectorAll("[aria-controls]"))if(t.getAttribute("aria-controls")===e)return t;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:null==t?void 0:t.textContent,value:null==n?void 0:n.getAttribute("data-value"),element:n})}return e}connectedCallback(){const{signal:t}=it(this,wi,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}),nt(this,vi,"m",Ai).call(this),nt(this,vi,"m",ki).call(this),this.includeFragment&&this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t})}disconnectedCallback(){nt(this,wi,"f").abort()}handleEvent(t){var e,n;if(t.target===this.invokerElement&&nt(this,vi,"m",Li).call(this,t)&&nt(this,vi,"a",Ti))return t.preventDefault(),null===(e=this.popoverElement)||void 0===e||e.showPopover(),void nt(this,vi,"a",Ti).focus();if(null===(n=this.popoverElement)||void 0===n?void 0:n.matches(":popover-open"))if("include-fragment-replaced"===t.type)nt(this,vi,"a",Ti)&&nt(this,vi,"a",Ti).focus();else if(nt(this,vi,"m",Li).call(this,t)||t instanceof MouseEvent&&"click"===t.type){if("multiple"!==this.selectVariant&&setTimeout((()=>{var t;return null===(t=this.popoverElement)||void 0===t?void 0:t.hidePopover()})),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e=t.target.closest(Mi.join(","));if(!e)return;const n="true"!==e.getAttribute("aria-checked");if(e.setAttribute("aria-checked",`${n}`),"single"===this.selectVariant){for(const t of this.querySelectorAll("[aria-checked]"))t!==e&&t.setAttribute("aria-checked","false");nt(this,vi,"m",Ai).call(this)}nt(this,vi,"m",ki).call(this),t instanceof KeyboardEvent&&t.target instanceof HTMLButtonElement&&t.preventDefault()}}};wi=new WeakMap,yi=new WeakMap,Ei=new WeakMap,vi=new WeakSet,Ai=function(){if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;it(this,yi,nt(this,yi,"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=nt(this,yi,"f")},ki=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&&it(this,Ei,nt(this,Ei,"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=nt(this,Ei,"f"),n.value=(e.value||e.label||"").trim(),t.append(n)}for(const t of e)t.remove()}},Li=function(t){return t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&("Enter"===t.key||" "===t.key)},Ti=function(){return this.querySelector(Mi.join(","))},et([me],xi.prototype,"includeFragment",void 0),xi=et([ge],xi),window.customElements.get("action-menu")||(window.ActionMenuElement=xi,window.customElements.define("action-menu",xi))}();
2
2
  //# sourceMappingURL=primer_view_components.js.map