primer_view_components 0.19.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/app/assets/javascripts/app/components/primer/alpha/action_list.d.ts +16 -0
  4. data/app/assets/javascripts/app/components/primer/beta/nav_list.d.ts +3 -0
  5. data/app/assets/javascripts/app/components/primer/primer.d.ts +1 -0
  6. data/app/assets/javascripts/primer_view_components.js +1 -1
  7. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  8. data/app/assets/styles/primer_view_components.css +1 -1
  9. data/app/assets/styles/primer_view_components.css.map +1 -1
  10. data/app/components/primer/alpha/action_list/item.rb +19 -6
  11. data/app/components/primer/alpha/action_list.css +1 -1
  12. data/app/components/primer/alpha/action_list.css.json +2 -0
  13. data/app/components/primer/alpha/action_list.css.map +1 -1
  14. data/app/components/primer/alpha/action_list.d.ts +16 -0
  15. data/app/components/primer/alpha/action_list.html.erb +19 -17
  16. data/app/components/primer/alpha/action_list.js +69 -0
  17. data/app/components/primer/alpha/action_list.pcss +8 -0
  18. data/app/components/primer/alpha/action_list.ts +58 -0
  19. data/app/components/primer/alpha/banner.css +1 -1
  20. data/app/components/primer/alpha/banner.css.map +1 -1
  21. data/app/components/primer/alpha/banner.pcss +4 -4
  22. data/app/components/primer/alpha/dialog.css +1 -1
  23. data/app/components/primer/alpha/dialog.css.json +2 -0
  24. data/app/components/primer/alpha/dialog.css.map +1 -1
  25. data/app/components/primer/alpha/dialog.pcss +9 -0
  26. data/app/components/primer/alpha/dropdown.css +1 -1
  27. data/app/components/primer/alpha/dropdown.css.map +1 -1
  28. data/app/components/primer/alpha/dropdown.pcss +1 -1
  29. data/app/components/primer/alpha/text_field.css +1 -1
  30. data/app/components/primer/alpha/text_field.css.json +2 -0
  31. data/app/components/primer/alpha/text_field.css.map +1 -1
  32. data/app/components/primer/alpha/text_field.pcss +10 -0
  33. data/app/components/primer/alpha/toggle_switch.rb +2 -2
  34. data/app/components/primer/beta/auto_complete/auto_complete.html.erb +9 -9
  35. data/app/components/primer/beta/breadcrumbs.css +1 -1
  36. data/app/components/primer/beta/breadcrumbs.css.map +1 -1
  37. data/app/components/primer/beta/breadcrumbs.pcss +3 -1
  38. data/app/components/primer/beta/button.css +1 -1
  39. data/app/components/primer/beta/button.css.json +1 -0
  40. data/app/components/primer/beta/button.css.map +1 -1
  41. data/app/components/primer/beta/button.pcss +4 -0
  42. data/app/components/primer/beta/flash.css +1 -1
  43. data/app/components/primer/beta/flash.css.map +1 -1
  44. data/app/components/primer/beta/flash.pcss +4 -4
  45. data/app/components/primer/beta/nav_list.d.ts +3 -0
  46. data/app/components/primer/beta/nav_list.html.erb +1 -1
  47. data/app/components/primer/beta/nav_list.js +25 -2
  48. data/app/components/primer/beta/nav_list.ts +18 -1
  49. data/app/components/primer/beta/nav_list_group_element.js +4 -1
  50. data/app/components/primer/beta/nav_list_group_element.ts +3 -0
  51. data/app/components/primer/beta/popover.css +1 -1
  52. data/app/components/primer/beta/popover.css.map +1 -1
  53. data/app/components/primer/beta/popover.pcss +3 -0
  54. data/app/components/primer/beta/popover.rb +0 -1
  55. data/app/components/primer/primer.d.ts +1 -0
  56. data/app/components/primer/primer.js +1 -0
  57. data/app/components/primer/primer.ts +1 -0
  58. data/app/forms/auto_complete_form.rb +18 -0
  59. data/app/forms/select_form.rb +10 -0
  60. data/lib/primer/forms/auto_complete.html.erb +6 -0
  61. data/lib/primer/forms/auto_complete.rb +56 -0
  62. data/lib/primer/forms/builder.rb +19 -0
  63. data/lib/primer/forms/check_box_group.html.erb +4 -4
  64. data/lib/primer/forms/check_box_group.rb +0 -3
  65. data/lib/primer/forms/dsl/auto_complete_input.rb +33 -0
  66. data/lib/primer/forms/dsl/check_box_group_input.rb +8 -0
  67. data/lib/primer/forms/dsl/input.rb +8 -2
  68. data/lib/primer/forms/dsl/input_methods.rb +9 -0
  69. data/lib/primer/forms/dsl/radio_button_group_input.rb +8 -0
  70. data/lib/primer/forms/dsl/select_input.rb +5 -1
  71. data/lib/primer/forms/form_control.rb +1 -2
  72. data/lib/primer/forms/primer_text_field.js +2 -2
  73. data/lib/primer/forms/primer_text_field.ts +2 -2
  74. data/lib/primer/forms/radio_button_group.html.erb +4 -4
  75. data/lib/primer/forms/radio_button_group.rb +0 -3
  76. data/lib/primer/forms/select.html.erb +1 -0
  77. data/lib/primer/forms/select.rb +9 -5
  78. data/lib/primer/view_components/version.rb +1 -1
  79. data/previews/primer/alpha/action_list_preview.rb +42 -0
  80. data/previews/primer/alpha/select_preview.rb +12 -1
  81. data/previews/primer/alpha/text_area_preview.rb +7 -1
  82. data/previews/primer/alpha/text_field_preview.rb +7 -1
  83. data/previews/primer/beta/nav_list_preview.rb +43 -0
  84. data/previews/primer/forms_preview/auto_complete_form.html.erb +3 -0
  85. data/previews/primer/forms_preview/select_form.html.erb +1 -1
  86. data/previews/primer/forms_preview.rb +2 -0
  87. data/static/arguments.json +7 -7
  88. data/static/constants.json +15 -0
  89. data/static/info_arch.json +150 -7
  90. data/static/previews.json +143 -0
  91. metadata +11 -2
@@ -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{constructor(){super(...arguments),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}))}static define(t="include-fragment",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){d=null===t?t:Promise.resolve(t)}static get observedAttributes(){return["src","loading"]}get src(){const t=this.getAttribute("src");if(t){const e=this.ownerDocument.createElement("a");return e.href=t,e.href}return""}set src(t){this.setAttribute("src",t)}get loading(){return"lazy"===this.getAttribute("loading")?"lazy":"eager"}set loading(t){this.setAttribute("loading",t)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",t)}get data(){return l(this,t,"m",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)}connectedCallback(){if(!this.shadowRoot){this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=":host {display: block;}",this.shadowRoot.append(t,document.createElement("slot"))}this.src&&"eager"===this.loading&&l(this,t,"m",i).call(this),"lazy"===this.loading&&l(this,n,"f").observe(this)}request(){const t=this.src;if(!t)throw new Error("missing src");return new Request(t,{method:"GET",credentials:"same-origin",headers:{Accept:this.accept||"text/html"}})}load(){return l(this,t,"m",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};const h="undefined"!=typeof globalThis?globalThis:window;try{h.IncludeFragmentElement=IncludeFragmentElement.define()}catch(t){if(!(h.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function f(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 p(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 m(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}"function"==typeof SuppressedError&&SuppressedError;const g=new WeakSet;function b(t){y(t),w(t)}const v=new WeakMap;function w(t=document){if(v.has(t))return v.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)L(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&y(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const i={get closed(){return e},unsubscribe(){e=!0,v.delete(t),n.disconnect()}};return v.set(t,i),i}function y(t){for(const e of t.querySelectorAll("[data-action]"))L(e);t instanceof Element&&t.hasAttribute("data-action")&&L(t)}function E(t){const e=t.currentTarget;for(const n of A(e))if(t.type===n.type){const i=e.closest(n.tag);g.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const o=e.getRootNode();if(o instanceof ShadowRoot&&g.has(o.host)&&o.host.matches(n.tag)){const e=o.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*A(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 L(t){for(const e of A(t))t.addEventListener(e.type,E)}const k=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),T=(t,e="property")=>{const n=k(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const M="attr";function S(t,e){H(t,M).add(e)}const x=new WeakSet;function C(t,e){if(x.has(t))return;x.add(t);const n=Object.getPrototypeOf(t),i=n?.constructor?.attrPrefix??"data-";e||(e=H(n,M));for(const n of e){const e=t[n],o=T(`${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 D=Symbol.for("catalyst");class I{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=>T(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...H(t.prototype,M)].map(i).concat(e),set(t){e=t}})}(t),function(t){const e=k(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),C(t),function(t){g.add(t),t.shadowRoot&&b(t.shadowRoot),y(t),w(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&b(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,i,o){C(t),"data-catalyst"!==e&&o&&o.call(t,e,n,i)}}function H(t,e){if(!Object.prototype.hasOwnProperty.call(t,D)){const e=t[D],n=t[D]=new Map;if(e)for(const[t,i]of e)n.set(t,new Set(i))}const n=t[D];return n.has(e)||n.set(e,new Set),n.get(e)}function O(t,e){H(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 P(t,e){H(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 R(t){new I(t)}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)}));const q={"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"]},W={start:["end","center"],end:["start","center"],center:["end","start"]};function F(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 instanceof Element;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const n=e!==document.body&&e instanceof HTMLElement?e:document.body,i=n.getBoundingClientRect(),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=B(n,i,o,s,a,l),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=q[o];let f=0;if(r){let t=o;for(;f<r.length&&$(t,u,c,n);){const o=r[f++];t=o,u=B(n,i,o,s,a,l),u.top-=e.top,u.left-=e.left,d=o}}const p=W[s];let m=0;if(p){let t=s;for(;m<p.length&&K(t,u,c,n);){const o=p[m++];t=o,u=B(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=Math.max(t.height+c.top-n.height,0))}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:N.side,a=null!==(n=t.align)&&void 0!==n?n:N.align;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:N.anchorOffset,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?N.alignmentOffset:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:N.allowOutOfBounds}}(n))}const N={side:"outside-bottom",align:"start",anchorOffset:4,alignmentOffset:4,allowOutOfBounds:!1};function B(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 $(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 K(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*j(t,e={}){var n,i;const o=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(i=e.onlyTabbable)&&void 0!==i&&i?Y:V,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)}function z(t,e=!1){return j(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function V(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=getComputedStyle(t),n=0===t.offsetWidth||0===t.offsetHeight,i=["hidden","collapse"].includes(e.visibility),o="none"===e.display||!t.offsetParent,s=0===t.getClientRects().length;if(n||i||s||o)return!1}return null!=t.getAttribute("tabindex")||("true"===t.getAttribute("contenteditable")||"plaintext-only"===t.getAttribute("contenteditable")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex)}function Y(t,e=!1){return V(t,e)&&"-1"!==t.getAttribute("tabindex")}let U=!1;function X(){}try{const t=Object.create({},{signal:{get(){U=!0}}});window.addEventListener("test",X,t),window.removeEventListener("test",X,t)}catch(t){}function G(){U||(!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)}}(),U=!0)}G();const _=[];let J,Z;function Q(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=z(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&&Y(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=z(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=z(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(J){const t=J;J.container.setAttribute("data-focus-trap","suspended"),J.controller.abort(),_.push(t)}c.signal.addEventListener("abort",(()=>{J=void 0})),o.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=_.findIndex((e=>e.container===t));n>=0&&_.splice(n,1),function(){const t=_.pop();t&&Q(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{l(t.target)}),{signal:c.signal,capture:!0}),l(document.activeElement),J={container:t,controller:c,initialFocus:e,originalSignal:o};const u=_.findIndex((e=>e.container===t));if(u>=0&&_.splice(u,1),!n)return i}function tt(){return void 0===Z&&(Z=/^mac/i.test(window.navigator.platform)),Z}let et=1e4;var nt;G(),function(t){t[t.ArrowHorizontal=1]="ArrowHorizontal",t[t.ArrowVertical=2]="ArrowVertical",t[t.JK=4]="JK",t[t.HL=8]="HL",t[t.HomeAndEnd=16]="HomeAndEnd",t[t.PageUpDown=256]="PageUpDown",t[t.WS=32]="WS",t[t.AD=64]="AD",t[t.Tab=128]="Tab",t[t.Backspace=512]="Backspace",t[t.ArrowAll=3]="ArrowAll",t[t.HJKL=12]="HJKL",t[t.WASD=96]="WASD",t[t.All=511]="All"}(nt||(nt={}));const it={ArrowLeft:nt.ArrowHorizontal,ArrowDown:nt.ArrowVertical,ArrowUp:nt.ArrowVertical,ArrowRight:nt.ArrowHorizontal,h:nt.HL,j:nt.JK,k:nt.JK,l:nt.HL,a:nt.AD,s:nt.WS,w:nt.WS,d:nt.AD,Tab:nt.Tab,Home:nt.HomeAndEnd,End:nt.HomeAndEnd,PageUp:nt.PageUpDown,PageDown:nt.PageUpDown,Backspace:nt.Backspace},ot={ArrowLeft:"previous",ArrowDown:"next",ArrowUp:"previous",ArrowRight:"next",h:"previous",j:"next",k:"previous",l:"next",a:"previous",s:"next",w:"previous",d:"next",Tab:"next",Home:"start",End:"end",PageUp:"start",PageDown:"end",Backspace:"previous"};function st(t){const e=ot[t.key];if("Tab"===t.key&&t.shiftKey)return"previous";const n=tt();if(n&&t.metaKey||!n&&t.ctrlKey){if("ArrowLeft"===t.key||"ArrowUp"===t.key)return"start";if("ArrowRight"===t.key||"ArrowDown"===t.key)return"end"}return e}const rt="data-is-active-descendant",at="data-has-active-descendant";function lt(t,e){var n,i,o,s,r;const a=[],l=new WeakMap,c=null!==(n=null==e?void 0:e.bindKeys)&&void 0!==n?n:((null==e?void 0:e.getNextFocusable)?nt.ArrowAll:nt.ArrowVertical)|nt.HomeAndEnd,u=null!==(i=null==e?void 0:e.focusOutBehavior)&&void 0!==i?i:"stop",d=null!==(o=null==e?void 0:e.focusInStrategy)&&void 0!==o?o:"previous",h=null==e?void 0:e.activeDescendantControl,f=null==e?void 0:e.onActiveDescendantChanged;let p;const m=null!==(s=null==e?void 0:e.preventScroll)&&void 0!==s&&s;function g(){return a[0]}function b(t,e=!1){const n=p;p=t,h?t&&document.activeElement===h?v(n,t,e):w():(n&&n!==t&&l.has(n)&&n.setAttribute("tabindex","-1"),null==t||t.setAttribute("tabindex","0"))}function v(e,n,i=!1){n.id||n.setAttribute("id","__primer_id_"+et++),e&&e!==n&&e.removeAttribute(rt),h&&(i||h.getAttribute("aria-activedescendant")!==n.id)&&(h.setAttribute("aria-activedescendant",n.id),t.setAttribute(at,n.id),n.setAttribute(rt,i?"activated-directly":"activated-indirectly"),null==f||f(n,e,i))}function w(e=p){"first"===d&&(p=void 0),null==h||h.removeAttribute("aria-activedescendant"),t.removeAttribute(at),null==e||e.removeAttribute(rt),null==f||f(void 0,e,!1)}function y(...t){const n=t.filter((t=>{var n,i;return null===(i=null===(n=null==e?void 0:e.focusableElementFilter)||void 0===n?void 0:n.call(e,t))||void 0===i||i}));if(0!==n.length){a.splice(function(t){const e=t[0];if(0===a.length)return 0;let n=0,i=a.length-1;for(;n<=i;){const t=Math.floor((n+i)/2);E(e,a[t])?i=t-1:n=t+1}return n}(n),0,...n);for(const t of n)l.has(t)||l.set(t,t.getAttribute("tabindex")),t.setAttribute("tabindex","-1");p||b(g())}}function E(t,e){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)>0}function A(...t){for(const e of t){const t=a.indexOf(e);t>=0&&a.splice(t,1);const n=l.get(e);if(void 0!==n&&(null===n?e.removeAttribute("tabindex"):e.setAttribute("tabindex",n),l.delete(e)),e===p){b(g())}}}const L={reverse:null==e?void 0:e.reverse,strict:null==e?void 0:e.strict,onlyTabbable:null==e?void 0:e.onlyTabbable};y(...j(t,L));b("function"==typeof d?d(document.body):g());new MutationObserver((t=>{for(const e of t)for(const t of e.removedNodes)t instanceof HTMLElement&&A(...j(t,L));for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&y(...j(t,L))})).observe(t,{subtree:!0,childList:!0});const k=new AbortController,T=null!==(r=null==e?void 0:e.abortSignal)&&void 0!==r?r:k.signal;let M;T.addEventListener("abort",(()=>{A(...a)})),t.addEventListener("mousedown",(t=>{t.target instanceof HTMLElement&&t.target!==document.activeElement&&(M=a.indexOf(t.target))}),{signal:T}),h?(t.addEventListener("focusin",(t=>{t.target instanceof HTMLElement&&a.includes(t.target)&&(h.focus({preventScroll:m}),b(t.target))})),t.addEventListener("mousemove",(({target:t})=>{if(!(t instanceof Node))return;const e=a.find((e=>e.contains(t)));e&&b(e)}),{signal:T,capture:!0}),h.addEventListener("focusin",(()=>{p?v(void 0,p):b(g())})),h.addEventListener("focusout",(()=>{w()}))):t.addEventListener("focusin",(e=>{if(e.target instanceof HTMLElement)if(void 0!==M)M>=0&&a[M]!==p&&b(a[M]),M=void 0;else if("previous"===d)b(e.target);else if("closest"===d||"first"===d){if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t="previous"===x?a.length-1:0,e=a[t];return void(null==e||e.focus({preventScroll:m}))}b(e.target)}else if("function"==typeof d)if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t=d(e.relatedTarget);if((t?a.indexOf(t):-1)>=0&&t instanceof HTMLElement)return void t.focus({preventScroll:m});console.warn("Element requested is not a known focusable element.")}else b(e.target);x=void 0}),{signal:T});const S=null!=h?h:t;let x;return"closest"===d&&document.addEventListener("keydown",(t=>{"Tab"===t.key&&(x=st(t))}),{signal:T,capture:!0}),S.addEventListener("keydown",(n=>{var i;if(n.key in ot){const o=it[n.key];if(!n.defaultPrevented&&(o&c)>0&&!function(t,e){const n=t.key,i=[...n].length,o=e instanceof HTMLInputElement&&"text"===e.type||e instanceof HTMLTextAreaElement;if(o&&(1===i||"Home"===n||"End"===n))return!0;if(e instanceof HTMLSelectElement){if(1===i)return!0;if("ArrowDown"===n&&tt()&&!t.metaKey)return!0;if("ArrowDown"===n&&!tt()&&t.altKey)return!0}if(e instanceof HTMLTextAreaElement&&("PageUp"===n||"PageDown"===n))return!0;if(o){const t=e,i=0===t.selectionStart&&0===t.selectionEnd,o=t.selectionStart===t.value.length&&t.selectionEnd===t.value.length;if("ArrowLeft"===n&&!i)return!0;if("ArrowRight"===n&&!o)return!0;if(t instanceof HTMLTextAreaElement){if("ArrowUp"===n&&!i)return!0;if("ArrowDown"===n&&!o)return!0}}return!1}(n,document.activeElement)){const o=st(n);let s;if((null==e?void 0:e.getNextFocusable)&&(s=e.getNextFocusable(o,null!==(i=document.activeElement)&&void 0!==i?i:void 0,n)),!s){const e=function(){if(!p)return 0;const e=a.indexOf(p);return-1!==e?e:p===t?-1:0}();let i=e;"previous"===o?i-=1:"start"===o?i=0:"next"===o?i+=1:i=a.length-1,i<0&&(i="wrap"===u&&"Tab"!==n.key?a.length-1:0),i>=a.length&&(i="wrap"===u&&"Tab"!==n.key?0:a.length-1),e!==i&&(s=a[i])}h?b(s||p,!0):s&&(x=o,s.focus({preventScroll:m})),("Tab"!==n.key||s)&&n.preventDefault()}}}),{signal:T}),k}var ct,ut,dt,ht,ft,pt,mt;const gt=new IntersectionObserver((t=>{for(const e of t){const t=e.target;e.isIntersecting&&t instanceof wt&&t.update()}})),bt=new ResizeObserver((t=>{for(const e of t){const t=e.target;t instanceof wt&&t.update()}}));var vt;!function(t){t[t.Item=0]="Item",t[t.Divider=1]="Divider"}(vt||(vt={}));let wt=class ActionBarElement extends HTMLElement{constructor(){super(...arguments),ct.add(this),ut.set(this,null)}connectedCallback(){for(const t of this.items){const e=t.getBoundingClientRect().width,n=parseInt(window.getComputedStyle(t)?.marginLeft,10),i=parseInt(window.getComputedStyle(t)?.marginRight,10);t.setAttribute("data-offset-width",`${e+n+i}`)}bt.observe(this),gt.observe(this),requestAnimationFrame((()=>{this.style.overflow="visible",this.update()}))}disconnectedCallback(){bt.unobserve(this),gt.unobserve(this)}menuItemClick(t){const e=t.currentTarget,n=e?.getAttribute("data-for");n&&document.getElementById(n)?.click()}update(){const t=p(this,ct,"a",dt);if(!t)return;const e=t.getBoundingClientRect().top;let n=null;p(this,ct,"m",mt).call(this,((t,i,o)=>{const s=t.getBoundingClientRect().top;return o===vt.Item&&(s>e?(p(this,ct,"m",ft).call(this,i),this.moreMenu.hidden&&(this.moreMenu.hidden=!1),n===vt.Divider&&p(this,ct,"m",ft).call(this,i-1)):(p(this,ct,"m",ht).call(this,i),i===this.items.length-1&&(this.moreMenu.hidden=!0),n===vt.Divider&&p(this,ct,"m",ht).call(this,i-1))),n=o,!0})),p(this,ut,"f")&&p(this,ut,"f").abort(),m(this,ut,lt(this,{bindKeys:nt.ArrowHorizontal|nt.HomeAndEnd,focusOutBehavior:"wrap",focusableElementFilter:t=>{const e=this.items.indexOf(t.parentElement),n=e>-1&&"visible"===this.items[e].style.visibility,i=t===this.moreMenu.invokerElement&&!this.moreMenu.hidden;return n||i}}),"f")}};ut=new WeakMap,ct=new WeakSet,dt=function(){let t=null;return p(this,ct,"m",mt).call(this,((e,n,i)=>i!==vt.Item||(t=e,!1))),t},ht=function(t){const e=this.items[t],n=p(this,ct,"a",pt)[t];e&&n&&(e.style.setProperty("visibility","visible"),n.hidden=!0)},ft=function(t){const e=this.items[t],n=p(this,ct,"a",pt)[t];e&&n&&(e.style.setProperty("visibility","hidden"),n.hidden=!1)},pt=function(){return this.moreMenu.querySelectorAll('[role="menu"] > li')},mt=function(t){for(let e=0;e<this.items.length;e++){const n=this.items[e],i=n.classList.contains("ActionBar-divider")?vt.Divider:vt.Item;if(!t(n,e,i))break}},f([P],wt.prototype,"items",void 0),f([O],wt.prototype,"itemContainer",void 0),f([O],wt.prototype,"moreMenu",void 0),wt=f([R],wt),window.ActionBarElement=wt;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=[At(t,"compositionstart",(t=>Ht(this,t))),At(t,"compositionend",(t=>Ht(this,t))),At(t,"click",(e=>xt(t,e))),At(t,"change",(e=>xt(t,e))),At(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=yt.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")&&(It(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Mt(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Mt(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(St&&n.ctrlKey){const e=Mt(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(St&&n.ctrlKey){const e=Mt(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&Dt(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),At(t,"toggle",(()=>Lt(t,this)),{once:!0}),At(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?At(t,"mouseover",(()=>Lt(t,this)),{once:!0}):Et,...kt(t)];yt.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=yt.get(this);if(t){yt.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const yt=new WeakMap,Et={unsubscribe(){}};function At(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function Lt(t,e){const n=e.getAttribute("src");if(!n)return;const i=yt.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",(()=>Tt(t))),o.setAttribute("src",n))}function kt(t){let e=!1;return[At(t,"mousedown",(()=>e=!0)),At(t,"keydown",(()=>e=!1)),At(t,"toggle",(()=>{t.hasAttribute("open")&&(Tt(t)||e||function(t){const e=document.activeElement;if(e&&Dt(e)&&t.contains(e))return;const n=Mt(t,!0);n&&n.focus()}(t))}))]}function Tt(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function Mt(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 St=navigator.userAgent.match(/Macintosh/);function xt(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||Ct(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&Ct(e,t)}}function Ct(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")&&It(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function Dt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function It(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Ht(t,e){const n=yt.get(t);n&&(n.isComposing="compositionstart"===e.type)}var Ot,Pt;window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const Rt=(()=>{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),Ot.set(this,null),Pt.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(p(this,Ot,"f"))return p(this,Ot,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){m(this,Ot,t,"f"),p(this,Ot,"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())),Rt(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(p(this,Pt,"f")),m(this,Pt,requestAnimationFrame((()=>{const t=this.anchorElement;if(this.classList.toggle("not-anchored",!t),t){const{left:e,top:n}=F(this,t,this);this.style.top=`${n}px`,this.style.left=`${e}px`,this.style.bottom="auto",this.style.right="auto"}else this.style.top="0",this.style.left="0",this.style.bottom="0",this.style.right="0"})),"f"))}}var qt;function Wt(t){const e=t.target,n=e?.closest("button");if(!n||n.hasAttribute("disabled")||"true"===n.getAttribute("aria-disabled"))return;let i=n?.getAttribute("data-show-dialog-id");if(i){const e=document.getElementById(i);if(e instanceof HTMLDialogElement){e.showModal(),t.preventDefault();let i=n,o=!1;for(;i;)i=i.parentElement?.closest("[popover]:not(:popover-open)"),i&&"auto"===i.popover&&(i.classList.add("dialog-inside-popover-fix"),i.popover="manual",i.showPopover(),o=!0);o&&(e.addEventListener("close",(t=>t.stopImmediatePropagation()),{once:!0}),e.close(),e.showModal(),e.addEventListener("close",(()=>{for(const t of e.ownerDocument.querySelectorAll(".dialog-inside-popover-fix"))t.contains(e)&&(t.classList.remove("dialog-inside-popover-fix"),t.popover="auto",t.showPopover())}),{once:!0}))}}if(i=n.getAttribute("data-close-dialog-id")||n.getAttribute("data-submit-dialog-id"),i){const t=document.getElementById(i);t instanceof HTMLDialogElement&&t.open&&t.close()}}Ot=new WeakMap,Pt=new WeakMap,AnchoredPositionElement.observedAttributes=["align","side","anchor","alignment-offset","allow-out-of-bounds"],customElements.get("anchored-position")||(window.AnchoredPositionElement=AnchoredPositionElement,customElements.define("anchored-position",AnchoredPositionElement));class DialogHelperElement extends HTMLElement{constructor(){super(...arguments),qt.set(this,null)}get dialog(){return this.querySelector("dialog")}connectedCallback(){const{signal:t}=m(this,qt,new AbortController,"f");document.addEventListener("click",Wt,!0),document.addEventListener("click",this,{signal:t}),this.ownerDocument.body.style.setProperty("--dialog-scrollgutter",window.innerWidth-this.ownerDocument.body.clientWidth+"px"),new MutationObserver((t=>{for(const e of t)e.target===this.dialog&&this.ownerDocument.body.classList.toggle("has-modal",this.dialog.hasAttribute("open"))})).observe(this,{subtree:!0,attributeFilter:["open"]})}disconnectedCallback(){p(this,qt,"f")?.abort()}handleEvent(t){const e=t.target,n=this.dialog;if(e!==n||!n?.open)return;const i=n.getBoundingClientRect();i.top<=t.clientY&&t.clientY<=i.top+i.height&&i.left<=t.clientX&&t.clientX<=i.left+i.width||n.close()}}qt=new WeakMap,window.customElements.get("dialog-helper")||(window.DialogHelperElement=DialogHelperElement,window.customElements.define("dialog-helper",DialogHelperElement));var Ft=class extends Event{oldState;newState;constructor(t,{oldState:e="",newState:n="",...i}={}){super(t,i),this.oldState=String(e||""),this.newState=String(n||"")}},Nt=new WeakMap;function Bt(t,e,n){Nt.set(t,setTimeout((()=>{Nt.has(t)&&t.dispatchEvent(new Ft("toggle",{cancelable:!1,oldState:e,newState:n}))}),0))}var $t=globalThis.ShadowRoot||function(){},Kt=globalThis.HTMLDialogElement||function(){},jt=new WeakMap,zt=new WeakMap,Vt=new WeakMap;function Yt(t){return Vt.get(t)||"hidden"}var Ut=new WeakMap;function Xt(t,e){return("auto"===t.popover||"manual"===t.popover)&&(!!t.isConnected&&((!e||"showing"===Yt(t))&&(!(!e&&"hidden"!==Yt(t))&&(!(t instanceof Kt&&t.hasAttribute("open"))&&document.fullscreenElement!==t))))}function Gt(t){return t?Array.from(zt.get(t.ownerDocument)||[]).indexOf(t)+1:0}function _t(t){const e=Qt(t),n=function(t){for(;t;){const e=t.popoverTargetElement;if(e instanceof HTMLElement)return e;if((t=t.parentElement||Zt(t))instanceof $t&&(t=t.host),t instanceof Document)return}}(t);return Gt(e)>Gt(n)?e:n}function Jt(t){const e=zt.get(t);for(const t of e||[]){if(t.isConnected)return t;e.delete(t)}return null}function Zt(t){return"function"==typeof t.getRootNode?t.getRootNode():t.parentNode?Zt(t.parentNode):t}function Qt(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===Vt.get(t))return t;if((t=t.parentElement||Zt(t))instanceof $t&&(t=t.host),t instanceof Document)return}}function te(t){return!(t.hidden||t instanceof $t)&&((!(t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLOptGroupElement||t instanceof HTMLOptionElement||t instanceof HTMLFieldSetElement)||!t.disabled)&&(!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(!(t instanceof HTMLAnchorElement&&""===t.href)&&("number"==typeof t.tabIndex&&-1!==t.tabIndex))))}function ee(t){(function(t){if(t.shadowRoot&&!0!==t.shadowRoot.delegatesFocus)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);let n=e.querySelector("[autofocus]");if(n)return n;{const t=e.querySelectorAll("slot");for(const e of t){const t=e.assignedElements({flatten:!0});for(const e of t){if(e.hasAttribute("autofocus"))return e;if(n=e.querySelector("[autofocus]"),n)return n}}}const i=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let o=i.currentNode;for(;o;){if(te(o))return o;o=i.nextNode()}})(t)?.focus()}var ne=new WeakMap;function ie(t){if(!Xt(t,!1))return;const e=t.ownerDocument;if(!t.dispatchEvent(new Ft("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"})))return;if(!Xt(t,!1))return;let n=!1;if("auto"===t.popover){const n=t.getAttribute("popover");if(re(function(t){const e=new Map;let n=0;const i=t.ownerDocument;for(const t of zt.get(i)||[])e.set(t,n),n+=1;e.set(t,n),n+=1;let o=null;return function(t){const n=Qt(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")||!Xt(t,!1))return}Jt(e)||(n=!0),ne.delete(t);const i=e.activeElement;t.classList.add(":popover-open"),Vt.set(t,"showing"),jt.has(e)||jt.set(e,new Set),jt.get(e).add(t),ee(t),"auto"===t.popover&&(zt.has(e)||zt.set(e,new Set),zt.get(e).add(t),ue(Ut.get(t),!0)),n&&i&&"auto"===t.popover&&ne.set(t,i),Bt(t,"closed","open")}function oe(t,e=!1,n=!1){if(!Xt(t,!0))return;const i=t.ownerDocument;if("auto"===t.popover&&(re(t,e,n),!Xt(t,!0)))return;if(ue(Ut.get(t),!1),Ut.delete(t),n&&(t.dispatchEvent(new Ft("beforetoggle",{oldState:"open",newState:"closed"})),!Xt(t,!0)))return;jt.get(i)?.delete(t),zt.get(i)?.delete(t),t.classList.remove(":popover-open"),Vt.set(t,"hidden"),n&&Bt(t,"open","closed");const o=ne.get(t);o&&(ne.delete(t),e&&o.focus())}function se(t,e=!1,n=!1){let i=Jt(t);for(;i;)oe(i,e,n),i=Jt(t)}function re(t,e,n){const i=t.ownerDocument||t;if(t instanceof Document)return se(i,e,n);let o=null,s=!1;for(const e of zt.get(i)||[])if(e===t)s=!0;else if(s){o=e;break}if(!s)return se(i,e,n);for(;o&&"showing"===Yt(o)&&zt.get(i)?.size;)oe(o,e,n)}var ae=new WeakMap;function le(t){if(!t.isTrusted)return;const e=t.composedPath()[0];if(!e)return;const n=e.ownerDocument;if(!Jt(n))return;const i=_t(e);if(i&&"pointerdown"===t.type)ae.set(n,i);else if("pointerup"===t.type){const t=ae.get(n)===i;ae.delete(n),t&&re(i||n,!1,!0)}}var ce=new WeakMap;function ue(t,e=!1){if(!t)return;ce.has(t)||ce.set(t,t.getAttribute("aria-expanded"));const n=t.popoverTargetElement;if(n instanceof HTMLElement&&"auto"===n.popover)t.setAttribute("aria-expanded",String(e));else{const e=ce.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}var de=globalThis.ShadowRoot||function(){};function he(t,e,n){const i=t[e];Object.defineProperty(t,e,{value(t){return i.call(this,n(t))}})}var fe,pe,me,ge,be=/(^|[^\\]):popover-open\b/g,ve="function"==typeof window.CSSLayerBlockRule,we=`\n${ve?"@layer popover-polyfill {":""}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n\n :where([popover]:not(.\\:popover-open)) {\n display: none;\n }\n${ve?"}":""}\n`,ye=null;function Ee(t){if(null===ye)try{(ye=new CSSStyleSheet).replaceSync(we)}catch{ye=!1}if(!1===ye){const e=document.createElement("style");e.textContent=we,t instanceof Document?t.head.prepend(e):t.prepend(e)}else t.adoptedStyleSheets=[ye,...t.adoptedStyleSheets]}"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){function t(t){return t?.includes(":popover-open")&&(t=t.replace(be,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||Ft,he(Document.prototype,"querySelector",t),he(Document.prototype,"querySelectorAll",t),he(Element.prototype,"querySelector",t),he(Element.prototype,"querySelectorAll",t),he(Element.prototype,"matches",t),he(Element.prototype,"closest",t),he(DocumentFragment.prototype,"querySelectorAll",t),he(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(){ie(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){oe(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t){"showing"===Vt.get(this)&&void 0===t||!1===t?oe(this,!0,!0):void 0!==t&&!0!==t||ie(this)}}});const e=Element.prototype.attachShadow;e&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(t){const n=e.call(this,t);return Ee(n),n}}});const n=HTMLElement.prototype.attachInternals;n&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){const t=n.call(this);return t.shadowRoot&&Ee(t.shadowRoot),t}}});const i=new WeakMap;function o(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),i.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),i.set(this,t)}},get(){if("button"!==this.localName&&"input"!==this.localName)return null;if("input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type)return null;if(this.disabled)return null;if(this.form&&"submit"===this.type)return null;const t=i.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return i.delete(this),null;const e=Zt(this),n=this.getAttribute("popovertarget");return(e instanceof Document||e instanceof de)&&n&&e.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){const t=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===t||"hide"===t?t:"toggle"},set(t){this.setAttribute("popovertargetaction",t)}}})}o(HTMLButtonElement),o(HTMLInputElement);const s=t=>{const e=t.composedPath(),n=e[0];if(!(n instanceof Element)||n?.shadowRoot)return;const i=Zt(n);if(!(i instanceof de||i instanceof Document))return;const o=e.find((t=>t.matches?.("[popovertargetaction],[popovertarget]")));return o?(function(t){const e=t.popoverTargetElement;if(!(e instanceof HTMLElement))return;const n=Yt(e);"show"===t.popoverTargetAction&&"showing"===n||"hide"===t.popoverTargetAction&&"hidden"===n||("showing"===n?oe(e,!0,!0):Xt(e,!1)&&(Ut.set(e,t),ie(e)))}(o),void t.preventDefault()):void 0},r=t=>{const e=t.key,n=t.target;t.defaultPrevented||!n||"Escape"!==e&&"Esc"!==e||re(n.ownerDocument,!0,!0)};(t=>{t.addEventListener("click",s),t.addEventListener("keydown",r),t.addEventListener("pointerdown",le),t.addEventListener("pointerup",le)})(document),Ee(document)}();const Ae=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]'].map((t=>`:not([hidden]) > ${t}`)).join(", "),Le=t=>t.textContent?.trim()[0].toLowerCase(),ke=/^\S$/;class FocusGroupElement extends HTMLElement{constructor(){super(...arguments),fe.add(this),pe.set(this,null),me.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(){m(this,me,new AbortController,"f");const{signal:t}=p(this,me,"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(){p(this,me,"f")?.abort()}handleEvent(t){const{direction:e,nowrap:n}=this;if("focusin"===t.type){if(this.retain&&t.target instanceof Element&&t.target.matches(Ae)){p(this,pe,"f")?.abort();const{signal:e}=m(this,pe,new AbortController,"f");for(const n of p(this,fe,"a",ge)){n.setAttribute("tabindex",n===t.target?"0":"-1");const i=t.target.closest("[popover]");n===t.target&&"auto"===i?.popover&&i.closest("focus-group")===this&&i.addEventListener("toggle",(t=>{if(t.target instanceof Element&&"closed"===t.newState&&(p(this,pe,"f")?.abort(),n.setAttribute("tabindex","-1"),i.id)){const t=this.querySelector(`[popovertarget="${i.id}"]`);t?t.setAttribute("tabindex","0"):p(this,fe,"a",ge)[0]?.setAttribute("tabindex","0")}}),{signal:e})}}}else if(t instanceof KeyboardEvent){const i=Array.from(p(this,fe,"a",ge));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||!ke.test(s))return;{const e=s.toLowerCase(),r=o>0&&Le(t.target)===e?o:0;o=i.findIndex(((t,n)=>n>r&&Le(t)===e)),o<0&&!n&&(o=i.findIndex((t=>Le(t)===e)))}}n&&o<0&&(o=0),!n&&o>=i.length&&(o=0);const r=i.at(Math.min(o,i.length-1));{let e=r;do{e=e.closest("[popover]:not(:popover-open)"),"auto"!==e?.popover||["ArrowRight","ArrowLeft"].includes(t.key)||e.showPopover(),e=e?.parentElement||null}while(e)}r?.focus()}}}pe=new WeakMap,me=new WeakMap,fe=new WeakSet,ge=function(){return this.querySelectorAll(Ae)},customElements.get("focus-group")||(window.FocusGroupElement=FocusGroupElement,customElements.define("focus-group",FocusGroupElement));let Te=class ScrollableRegionElement extends HTMLElement{constructor(){super(...arguments),this.hasOverflow=!1,this.labelledBy=""}connectedCallback(){this.style.overflow="auto",this.observer=new ResizeObserver((t=>{for(const e of t)this.hasOverflow=e.target.scrollHeight>e.target.clientHeight||e.target.scrollWidth>e.target.clientWidth})),this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}attributeChangedCallback(t){"data-has-overflow"===t&&(this.hasOverflow?(this.setAttribute("aria-labelledby",this.labelledBy),this.setAttribute("role","region"),this.setAttribute("tabindex","0")):(this.removeAttribute("aria-labelledby"),this.removeAttribute("role"),this.removeAttribute("tabindex")))}};f([S],Te.prototype,"hasOverflow",void 0),f([S],Te.prototype,"labelledBy",void 0),Te=f([R],Te),window.ScrollableRegionElement=Te;const Me=new WeakMap,Se=new WeakMap,xe=new WeakMap;function Ce(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=xe.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(Se.has(e)&&t instanceof MouseEvent){const n=Se.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(Se.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=Se.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`,qe(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)Se.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];Se.set(e,{dragStartX:n,dragStartY:i})}}function De(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=Ie(e);if(!(n instanceof ImageCropElement))return;const{box:i}=xe.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return Pe(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,Me.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=Me.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=Me.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&&Oe(n,s,r,!(t instanceof KeyboardEvent))}function Ie(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function He(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=Ie(e);if(!(n instanceof ImageCropElement))return;const{box:i}=xe.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",De),n.addEventListener("touchmove",De,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),Me.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),De(t)}else n.addEventListener("mousemove",Ce),n.addEventListener("touchmove",Ce,{passive:!0})}function Oe(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=Me.get(t);if(!s)return;const{box:r,image:a}=xe.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`,qe(t,{x:l,y:c,width:o,height:o})}function Pe(t){const{image:e}=xe.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);Me.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),Oe(t,n,n)}function Re(t){const e=t.currentTarget;e instanceof ImageCropElement&&(Se.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",De),e.removeEventListener("mousemove",Ce),e.removeEventListener("touchmove",De),e.removeEventListener("touchmove",Ce))}function qe(t,e){const{image:n}=xe.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(xe.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&&(xe.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,Pe(this)})),this.addEventListener("mouseleave",Re),this.addEventListener("touchend",Re),this.addEventListener("mouseup",Re),e.addEventListener("mousedown",He),e.addEventListener("touchstart",He,{passive:!0}),this.addEventListener("keydown",Ce),this.addEventListener("keydown",De),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}=xe.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}var We,Fe,Ne,Be;function $e(t){document.activeElement!==t&&t?.focus()}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const Ke=[];function je(t){const e=t.target,n=e?.closest("button");if(!n||n.hasAttribute("disabled")||"true"===n.getAttribute("aria-disabled"))return;let i=n?.getAttribute("data-show-dialog-id");if(i){t.stopPropagation();const e=document.getElementById(i);if(e instanceof ModalDialogElement)return e.openButton=n,e.show(),void t.preventDefault()}if(Ke.length&&(i=n.getAttribute("data-close-dialog-id")||n.getAttribute("data-submit-dialog-id"),i)){const t=document.getElementById(i);if(t instanceof ModalDialogElement){const e=Ke.findIndex((t=>t.id===i));Ke.splice(e,1),t.close(n.hasAttribute("data-submit-dialog-id"))}}}function ze(t){!(t instanceof KeyboardEvent&&"keydown"===t.type&&"Enter"===t.key)||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey||je(t)}function Ve(t){const e=t.target;if(e?.closest("button"))return;const n=Ke[Ke.length-1];if(!n)return;!e.closest(`#${n.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",(t=>{t.target===e&&(Ke.pop(),n.close())}),{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),We.add(this),Fe.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){if(t){if(this.open)return;this.setAttribute("open",""),this.setAttribute("aria-disabled","false"),document.body.style.paddingRight=window.innerWidth-document.body.clientWidth+"px",document.body.style.overflow="hidden",p(this,We,"a",Ne)?.classList.remove("Overlay--hidden"),p(this,Fe,"f").signal.aborted&&m(this,Fe,new AbortController,"f"),Q(this,this.querySelector("[autofocus]"),p(this,Fe,"f").signal),Ke.push(this)}else{if(!this.open)return;this.removeAttribute("open"),this.setAttribute("aria-disabled","true"),p(this,We,"a",Ne)?.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",p(this,Fe,"f").abort();const t=this.openButton?.closest("details")||this.openButton?.closest("action-menu");$e(t?z(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",je),document.addEventListener("keydown",ze),document.addEventListener("mousedown",Ve),this.addEventListener("keydown",(t=>p(this,We,"m",Be).call(this,t)))}show(){this.open=!0}close(t=!1){if(!1===this.open)return;const e=new Event(t?"close":"cancel");this.dispatchEvent(e),this.open=!1}}var Ye,Ue,Xe,Ge,_e,Je,Ze;Fe=new WeakMap,We=new WeakSet,Ne=function(){return this.parentElement?.hasAttribute("data-modal-dialog-overlay")?this.parentElement:null},Be=function(t){if(t instanceof KeyboardEvent&&!t.isComposing&&this.open)switch(t.key){case"Escape":this.close(),t.preventDefault(),t.stopPropagation();break;case"Enter":t.target.getAttribute("data-close-dialog-id")===this.id&&t.stopPropagation();break}},window.customElements.get("modal-dialog")||(window.ModalDialogElement=ModalDialogElement,window.customElements.define("modal-dialog",ModalDialogElement));let Qe=class NavListElement extends HTMLElement{constructor(){super(...arguments),Ye.add(this)}selectItemById(t){if(!t)return!1;const e=p(this,Ye,"m",Ue).call(this,t);return!!e&&(p(this,Ye,"m",_e).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=p(this,Ye,"m",Xe).call(this,t);return!!e&&(p(this,Ye,"m",_e).call(this,e),!0)}selectItemByCurrentLocation(){const t=p(this,Ye,"m",Ge).call(this);return!!t&&(p(this,Ye,"m",_e).call(this,t),!0)}expandItem(t){t.nextElementSibling?.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){t.nextElementSibling?.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false"),t.focus()}itemIsExpanded(t){return"A"===t?.tagName||"true"===t?.getAttribute("aria-expanded")}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=e.closest("button");n&&(this.itemIsExpanded(n)?this.collapseItem(n):this.expandItem(n),t.stopPropagation())}handleItemWithSubItemKeydown(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;let n=e.closest("button");if(!n){const t=e.getAttribute("aria-labelledby");if(!t)return;n=document.getElementById(t)}this.itemIsExpanded(n)&&"Escape"===t.key&&this.collapseItem(n),t.stopPropagation()}};var tn,en;Ye=new WeakSet,Ue=function(t){for(const e of this.items){if(e.classList.contains("ActionListItem--hasSubItem"))continue;if((e.getAttribute("data-item-id")?.split(" ")||[]).includes(t))return e}return null},Xe=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},Ge=function(){return p(this,Ye,"m",Xe).call(this,window.location.pathname)},_e=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&p(this,Ye,"m",Je).call(this,e),t.classList.add("ActionListItem--navActive"),t.children.length>0&&t.children[0].setAttribute("aria-current","page");const n=p(this,Ye,"m",Ze).call(this,t);n&&(this.expandItem(n),n.classList.add("ActionListContent--hasActiveSubItem"))},Je=function(t){t.classList.remove("ActionListItem--navActive"),t.children.length>0&&t.children[0].removeAttribute("aria-current");const e=p(this,Ye,"m",Ze).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},Ze=function(t){if(!t.classList.contains("ActionListItem--subItem"))return null;const e=t.closest("li.ActionListItem--hasSubItem")?.querySelector("button.ActionListContent");return e||null},f([P],Qe.prototype,"items",void 0),Qe=f([R],Qe);let nn=class NavListGroupElement extends HTMLElement{constructor(){super(...arguments),tn.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")||""}async showMore(t){if(t.preventDefault(),this.showMoreDisabled)return;let e;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const n=await fetch(t);if(!n.ok)return;e=await n.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const n=p(this,tn,"m",en).call(this,document,e);n?.querySelector("li > a")?.setAttribute("data-targets","nav-list-group.focusMarkers");const i=t.target.closest("button").getAttribute("data-list-id");document.getElementById(i).append(n),this.focusMarkers.pop()?.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}};var on,sn;tn=new WeakSet,en=function(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)},f([O],nn.prototype,"showMoreItem",void 0),f([P],nn.prototype,"focusMarkers",void 0),nn=f([R],nn),window.NavListGroupElement=nn;let rn=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),on.add(this)}connectedCallback(){p(this,on,"m",sn).call(this)}select(t){const e=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),t.querySelector("[aria-current]")?.setAttribute("aria-current","false");e.closest("li.SegmentedControl-item")?.classList.add("SegmentedControl-item--selected"),e.setAttribute("aria-current","true")}};on=new WeakSet,sn=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},f([P],rn.prototype,"items",void 0),rn=f([R],rn),window.customElements.get("segmented-control")||(window.SegmentedControlElement=rn,window.customElements.define("segmented-control",rn));let an=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 ln,cn,un,dn,hn,fn,pn,mn,gn,bn;f([O],an.prototype,"switch",void 0),f([O],an.prototype,"loadingSpinner",void 0),f([O],an.prototype,"errorIcon",void 0),an=f([R],an),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=an,window.customElements.define("toggle-switch",an));const vn=(()=>{let t;return e=>t?e.matches(t):function(e){try{return t=":popover-open",e.matches(t)}catch{try{return t=":open",e.matches(":open")}catch{return t=".\\:popover-open",e.matches(".\\:popover-open")}}}(e)})(),wn="sr-only",yn=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];function En(t){for(const e of Tn)e!==t&&(vn(e)?e.hidePopover():Tn.delete(e))}function An(){En()}function Ln(t){setTimeout((()=>{for(const e of Tn)vn(e)&&"focus"===e.showReason&&e.control!==t.target&&e.hidePopover()}),0)}const kn=new Set,Tn=new Set;class ToolTipElement extends HTMLElement{constructor(){super(...arguments),ln.add(this),cn.set(this,void 0),un.set(this,"center"),dn.set(this,"outside-bottom"),hn.set(this,!1),fn.set(this,"mouse")}styles(){return'\n :host {\n padding: var(--overlay-paddingBlock-condensed) var(--overlay-padding-condensed) !important;\n font: var(--text-body-shorthand-small);\n color: var(--fgColor-onEmphasis, var(--color-fg-on-emphasis)) !important;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n background: var(--bgColor-emphasis, var(--color-neutral-emphasis-plus)) !important;\n border-radius: var(--borderRadius-medium);\n border: 0 !important;\n opacity: 0;\n max-width: var(--overlay-width-small);\n word-wrap: break-word;\n white-space: normal;\n width: max-content !important;\n inset: var(--tool-tip-position-top, 0) auto auto var(--tool-tip-position-left, 0) !important;\n overflow: visible !important;\n text-wrap: balance;\n }\n\n :host:before{\n position: absolute;\n z-index: 1000001;\n color: var(--bgColor-emphasis, 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(:popover-open),\n :host(:popover-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n }\n\n :host(.\\:popover-open),\n :host(.\\:popover-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n animation-delay: .4s;\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-n):before {\n right: 50%;\n margin-right: -6px;\n }\n :host(.tooltip-s):before,\n :host(.tooltip-se):before,\n :host(.tooltip-sw):before {\n bottom: 100%;\n border-bottom-color: var(--bgColor-emphasis, var(--color-neutral-emphasis-plus));\n }\n :host(.tooltip-s):after,\n :host(.tooltip-se):after,\n :host(.tooltip-sw):after {\n bottom: 100%\n }\n :host(.tooltip-n):before,\n :host(.tooltip-ne):before,\n :host(.tooltip-nw):before {\n top: 100%;\n border-top-color: var(--bgColor-emphasis, var(--color-neutral-emphasis-plus));\n }\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%;\n }\n :host(.tooltip-se):before,\n :host(.tooltip-ne):before {\n left: 0;\n margin-left: 6px;\n }\n :host(.tooltip-sw):before,\n :host(.tooltip-nw):before {\n right: 0;\n margin-right: 6px;\n }\n :host(.tooltip-w):before {\n top: 50%;\n bottom: 50%;\n left: 100%;\n margin-top: -6px;\n border-left-color: var(--bgColor-emphasis, var(--color-neutral-emphasis-plus));\n }\n :host(.tooltip-e):before {\n top: 50%;\n right: 100%;\n bottom: 50%;\n margin-top: -6px;\n border-right-color: var(--bgColor-emphasis, var(--color-neutral-emphasis-plus));\n }\n\n @media (forced-colors: active) {\n :host {\n outline: solid 1px transparent;\n }\n\n :host:before {\n display: none;\n }\n }\n '}get showReason(){return p(this,fn,"f")}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get type(){return"label"===this.getAttribute("data-type")?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return this.getAttribute("data-direction")||"s"}set direction(t){this.setAttribute("data-direction",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}set hiddenFromView(t){t&&vn(this)?this.hidePopover():t||vn(this)||this.showPopover()}get hiddenFromView(){return!vn(this)}connectedCallback(){if(kn.add(this),p(this,ln,"m",mn).call(this),p(this,ln,"m",gn).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}if(p(this,ln,"m",pn).call(this,!1),m(this,hn,!0,"f"),!this.control)return;this.setAttribute("role","tooltip"),p(this,cn,"f")?.abort(),m(this,cn,new AbortController,"f");const{signal:t}=p(this,cn,"f");this.addEventListener("mouseleave",this,{signal:t}),this.addEventListener("toggle",this,{signal:t}),this.control.addEventListener("mouseenter",this,{signal:t}),this.control.addEventListener("mouseleave",this,{signal:t}),this.control.addEventListener("focus",this,{signal:t}),this.control.addEventListener("mousedown",this,{signal:t}),this.control.popoverTargetElement?.addEventListener("beforetoggle",this,{signal:t}),this.ownerDocument.addEventListener("focusout",An),this.ownerDocument.addEventListener("focusin",Ln),this.ownerDocument.addEventListener("keydown",this,{signal:t,capture:!0})}disconnectedCallback(){kn.delete(this),Tn.delete(this),p(this,cn,"f")?.abort()}async handleEvent(t){if(!this.control)return;const e=vn(this),n="mouseenter"===t.type||"focus"===t.type&&(navigator.webdriver||this.control.matches(":focus-visible")),i="mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this,o="keydown"===t.type&&"Escape"===t.key,s="mousedown"===t.type&&t.currentTarget===this.control,r="beforetoggle"===t.type&&t.currentTarget!==this,a=i||o||s||r;e&&o&&(t.stopImmediatePropagation(),t.preventDefault()),await Promise.resolve(),e||!n||vn(this)?e&&a&&vn(this)&&this.hidePopover():(m(this,fn,"mouseenter"===t.type?"mouse":"focus","f"),this.showPopover()),"toggle"===t.type&&p(this,ln,"m",pn).call(this,"open"===t.newState)}attributeChangedCallback(t){this.isConnected&&("id"===t||"data-type"===t?p(this,ln,"m",mn).call(this):"data-direction"===t&&p(this,ln,"m",gn).call(this))}}var Mn,Sn;cn=new WeakMap,un=new WeakMap,dn=new WeakMap,hn=new WeakMap,fn=new WeakMap,ln=new WeakSet,pn=function(t){t?(Tn.add(this),this.classList.remove(wn),En(this),p(this,ln,"m",bn).call(this)):(Tn.delete(this),this.classList.remove(...yn),this.classList.add(wn))},mn=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)}},gn=function(){this.classList.remove(...yn);const t=this.direction;"n"===t?(m(this,un,"center","f"),m(this,dn,"outside-top","f")):"ne"===t?(m(this,un,"start","f"),m(this,dn,"outside-top","f")):"e"===t?(m(this,un,"center","f"),m(this,dn,"outside-right","f")):"se"===t?(m(this,un,"start","f"),m(this,dn,"outside-bottom","f")):"s"===t?(m(this,un,"center","f"),m(this,dn,"outside-bottom","f")):"sw"===t?(m(this,un,"end","f"),m(this,dn,"outside-bottom","f")):"w"===t?(m(this,un,"center","f"),m(this,dn,"outside-left","f")):"nw"===t&&(m(this,un,"end","f"),m(this,dn,"outside-top","f"))},bn=function(){if(!this.control)return;if(!p(this,hn,"f")||!vn(this))return;const t=F(this,this.control,{side:p(this,dn,"f"),align:p(this,un,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.setProperty("--tool-tip-position-top",`${t.top}px`),this.style.setProperty("--tool-tip-position-left",`${t.left}px`);let i="s";i="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===n?"n":"start"===n?"ne":"nw":"center"===n?"s":"start"===n?"se":"sw",this.classList.add(`tooltip-${i}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let xn=class XBannerElement extends HTMLElement{constructor(){super(...arguments),Mn.add(this)}dismiss(){const t=this.parentElement;t&&("remove"===p(this,Mn,"a",Sn)?t.removeChild(this):this.hide())}show(){this.style.setProperty("display","initial")}hide(){this.style.setProperty("display","none")}};Mn=new WeakSet,Sn=function(){return this.getAttribute("data-dismiss-scheme")},f([O],xn.prototype,"titleText",void 0),xn=f([R],xn),window.customElements.get("x-banner")||(window.XBannerElement=xn,window.customElements.define("x-banner",xn));class Cn{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":In(e.input,e.list)&&t.preventDefault();break;case"Tab":e.tabInsertsSuggestions&&In(e.input,e.list)&&t.preventDefault();break;case"Escape":e.clearSelection();break;case"ArrowDown":e.navigate(1),t.preventDefault();break;case"ArrowUp":e.navigate(-1),t.preventDefault();break;case"n":e.ctrlBindings&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":e.ctrlBindings&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.clearSelection()}}(t,this),this.compositionEventHandler=t=>function(t,e){e.isComposing="compositionstart"===t.type;const n=document.getElementById(e.input.getAttribute("aria-controls")||"");if(!n)return;e.clearSelection()}(t,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",Dn),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",Dn)}indicateDefaultOption(){var t;this.defaultFirstOption&&(null===(t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(Hn)[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(Hn)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Hn),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"),On(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 Dn(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 In(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 Hn(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function On(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 Pn=window.testScreenReaderDelay||100;class Rn{constructor(t,e,n,i=!1){var o;if(this.container=t,this.input=e,this.results=n,this.combobox=new Cn(e,n,{defaultFirstOption:i}),this.feedback=t.getRootNode().getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=i,this.clearButton=t.getRootNode().getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=n.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.popover?this.results.matches(":popover-open")&&this.results.hidePopover():this.results.hidden=!0,this.results.getAttribute("aria-label")||this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let n;return function(...i){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...i)}),e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(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("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)}),Pn)}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(),this.combobox.indicateDefaultOption();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.popover?!this.results.matches(":popover-open"):this.results.hidden)&&(this.combobox.start(),this.results.popover?this.results.showPopover():this.results.hidden=!1)}close(){(this.results.popover?this.results.matches(":popover-open"):!this.results.hidden)&&(this.combobox.stop(),this.results.popover?this.results.hidePopover():this.results.hidden=!0)}}var qn,Wn,Fn,Nn,Bn,$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)},Kn=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},jn=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 zn=globalThis.HTMLElement||null;class Vn extends Event{constructor(t,e){var{relatedTarget:n}=e;super(t,jn(e,["relatedTarget"])),this.relatedTarget=n}}const Yn=new WeakMap;let Un=null;class AutoCompleteElement extends zn{constructor(){super(...arguments),qn.add(this),Wn.set(this,null),Fn.set(this,null),Bn.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){Un=null===t?t:Promise.resolve(t)}get forElement(){var t;if(null===(t=$n(this,Wn,"f"))||void 0===t?void 0:t.isConnected)return $n(this,Wn,"f");const e=this.getAttribute("for"),n=this.getRootNode();return e&&(n instanceof Document||n instanceof ShadowRoot)?n.getElementById(e):null}set forElement(t){Kn(this,Wn,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return(null===(t=$n(this,Fn,"f"))||void 0===t?void 0:t.isConnected)?$n(this,Fn,"f"):this.querySelector("input")}set inputElement(t){Kn(this,Fn,t,"f"),$n(this,qn,"m",Nn).call(this)}connectedCallback(){this.isConnected&&$n(this,qn,"m",Nn).call(this)}disconnectedCallback(){const t=Yn.get(this);t&&(t.destroy(),Yn.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=$n(this,Bn,"f"))||void 0===e||e.abort();const{signal:n}=Kn(this,Bn,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(Un){return(await Un).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=Yn.get(this);if(s)switch(this.forElement===(null===(i=Yn.get(this))||void 0===i?void 0:i.results)&&this.inputElement===(null===(o=Yn.get(this))||void 0===o?void 0:o.input)||$n(this,qn,"m",Nn).call(this),t){case"open":null===n?s.close():s.open();break;case"value":null!==n&&(s.input.value=n),this.dispatchEvent(new Vn("auto-complete-change",{bubbles:!0,relatedTarget:s.input}))}}}Wn=new WeakMap,Fn=new WeakMap,Bn=new WeakMap,qn=new WeakSet,Nn=function(){var t;null===(t=Yn.get(this))||void 0===t||t.destroy();const{forElement:e,inputElement:n}=this;if(!e||!n)return;const i="true"===this.getAttribute("data-autoselect");Yn.set(this,new Rn(this,n,e,i)),e.setAttribute("role","listbox")};const Xn="undefined"!=typeof globalThis?globalThis:window;try{Xn.AutocompleteElement=Xn.AutoCompleteElement=AutoCompleteElement.define()}catch(t){if(!(Xn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function Gn(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 _n(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),Gn(n),e.removeChild(n),Promise.resolve()}async function Jn(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}var o;if("true"!==t.getAttribute("aria-disabled"))if(n)await _n(n),i();else if(e){const n="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(n instanceof Document||"ShadowRoot"in window&&n instanceof ShadowRoot))return;const s=n.getElementById(e);s&&(await(o=s,o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?_n(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?_n(o.href):Gn(o)),i())}}function Zn(t){const e=t.currentTarget;e instanceof HTMLElement&&Jn(e)}function Qn(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),Jn(e))}}function ti(t){t.currentTarget.addEventListener("keydown",Qn)}function ei(t){t.currentTarget.removeEventListener("keydown",Qn)}class ClipboardCopyElement extends HTMLElement{static define(t="clipboard-copy",e=customElements){return e.define(t,this),this}constructor(){super(),this.addEventListener("click",Zn),this.addEventListener("focus",ti),this.addEventListener("blur",ei)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}const ni="undefined"!=typeof globalThis?globalThis:window;try{ni.ClipboardCopyElement=ClipboardCopyElement.define()}catch(t){if(!(ni.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function ii(t){t.style.display="inline-block"}function oi(t){t.style.display="none"}const si=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=si.get(t);e?(clearTimeout(e),si.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(oi(e),ii(n))}(t),si.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(ii(e),oi(n))}(t),si.delete(t)}),2e3))}));var ri,ai=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},li=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 ci="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)}},ui=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],di={minimumIntegerDigits:2};class hi{constructor(t,e={}){ri.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;ai(this,ri,{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 li(this,ri,"f")}formatToParts(t){const e=[],n=li(this,ri,"f"),i=n.style,o=n.locale;for(const[i,s]of ui){const r=t[i];if("auto"===n[`${i}Display`]&&!r)continue;const a=n[i],l="2-digit"===a?di:"numeric"===a?{}:{style:"unit",unit:s,unitDisplay:a};e.push(new Intl.NumberFormat(o,l).format(r))}return new ci(o,{type:"unit",style:"digital"===i?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map((t=>t.value)).join("")}}ri=new WeakMap;const fi=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,pi=["year","month","week","day","hour","minute","second","millisecond"];class mi{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 mi(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(fi))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return o?new mi(...o):new mi}if("object"==typeof t){const{years:e,months:n,weeks:i,days:o,hours:s,minutes:r,seconds:a,milliseconds:l}=t;return new mi(e,n,i,o,s,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const n=Date.now(),i=Math.abs(gi(n,mi.from(t)).getTime()-n),o=Math.abs(gi(n,mi.from(e)).getTime()-n);return i>o?-1:i<o?1:0}toLocaleString(t,e){return new hi(t,e).format(this)}}function gi(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 bi(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();if(r>=27||i+o+r){const t=new Date(e);t.setFullYear(d+i*n),t.setMonth(h+o*n),t.setDate(f+r*n);const a=t.getFullYear()-e.getFullYear(),l=t.getMonth()-e.getMonth(),c=Math.abs(Math.round((Number(t)-Number(e))/864e5)),u=Math.abs(12*a+l);c<27?(r>=6?(s+=Math.round(r/7),r=0):r=c,o=i=0):u<11?(o=u,i=0):(o=0,i=a*n),(o||i)&&(r=0),h=e.getMonth()}return i&&(o=0),s>=4&&(o+=Math.round(s/4)),(o||i)&&(s=0),r&&s&&!o&&!i&&(s+=Math.round(r/7),r=0),new mi(i*n,o*n,s*n,r*n,a*n,l*n,c*n,u*n)}var vi,wi,yi,Ei,Ai,Li,ki,Ti,Mi,Si,xi,Ci=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)},Di=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 Ii=globalThis.HTMLElement||null,Hi=new mi,Oi=new mi(0,0,0,0,0,1);class Pi 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 Ri(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 qi=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=Ri(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,Ri(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends Ii{constructor(){super(...arguments),vi.add(this),wi.set(this,!1),yi.set(this,!1),Ai.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),xi.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 Ci(this,xi,"f")}set onRelativeTimeUpdated(t){Ci(this,xi,"f")&&this.removeEventListener("relative-time-updated",Ci(this,xi,"f")),Di(this,xi,"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,fi.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 pi.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(){qi.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&Di(this,wi,null!==n&&(this.date&&Ci(this,vi,"m",Li).call(this,this.date))!==n,"f"),Ci(this,yi,"f")||"title"===t&&Ci(this,wi,"f")||Di(this,yi,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){const t=Ci(this,Ai,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let n=e;const i=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!i)return void(Ci(this,Ai,"f").textContent=t);const o=Date.now();Ci(this,wi,"f")||(n=Ci(this,vi,"m",Li).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 mi;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=pi.indexOf(e)||pi.length;return new mi(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=Ci(this,vi,"m",ki).call(this,s);let a=t;a="duration"===r?Ci(this,vi,"m",Ti).call(this,s):"relative"===r?Ci(this,vi,"m",Mi).call(this,s):Ci(this,vi,"m",Si).call(this,i),a?Ci(this,Ai,"f").textContent=a:this.shadowRoot===Ci(this,Ai,"f")&&this.textContent&&(Ci(this,Ai,"f").textContent=this.textContent),a===t&&n===e||this.dispatchEvent(new Pi(t,a,e,n)),"relative"===r||"duration"===r?qi.observe(this):qi.unobserve(this),Di(this,yi,!1,"f")}}wi=new WeakMap,yi=new WeakMap,Ai=new WeakMap,xi=new WeakMap,vi=new WeakSet,Ei=function(){var t;return(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang")||"default"},Li=function(t){return new Intl.DateTimeFormat(Ci(this,vi,"a",Ei),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},ki=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===mi.compare(t,this.threshold))return"relative"}return"datetime"},Ti=function(t){const e=Ci(this,vi,"a",Ei),n=this.format,i=this.formatStyle,o=this.tense;let s=Hi;"micro"===n?(t=bi(t),s=Oi,("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=Oi)):("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})},Mi=function(t){const e=new Intl.RelativeTimeFormat(Ci(this,vi,"a",Ei),{numeric:"auto",style:this.formatStyle}),n=this.tense;"future"===n&&1!==t.sign&&(t=Hi),"past"===n&&-1!==t.sign&&(t=Hi);const[i,o]=function(t,e){const n=bi(t,e);if(n.blank)return[0,"second"];for(const t of pi){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)},Si=function(t){const e=new Intl.DateTimeFormat(Ci(this,vi,"a",Ei),{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 Wi="undefined"!=typeof globalThis?globalThis:window;try{Wi.RelativeTimeElement=RelativeTimeElement.define()}catch(t){if(!(Wi.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function Fi(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{static define(t="tab-container",e=customElements){return e.define(t,this),this}connectedCallback(){this.addEventListener("keydown",(t=>{var e;const n=t.target;if(!(n instanceof HTMLElement))return;if(n.closest(this.tagName)!==this)return;if("tab"!==n.getAttribute("role")&&!n.closest('[role="tablist"]'))return;const i=Fi(this),o=i.indexOf(i.find((t=>t.matches('[aria-selected="true"]')))),[s,r]="vertical"===(null===(e=n.closest('[role="tablist"]'))||void 0===e?void 0:e.getAttribute("aria-orientation"))?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(s.some((e=>t.code===e))){let t=o+1;t>=i.length&&(t=0),this.selectTab(t)}else if(r.some((e=>t.code===e))){let t=o-1;t<0&&(t=i.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(i.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=Fi(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const n=t.target.closest('[role="tab"]');if(!(n instanceof HTMLElement&&n.closest('[role="tablist"]')))return;const i=e.indexOf(n);this.selectTab(i)}));for(const t of Fi(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=Fi(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}}))}}}const Ni="undefined"!=typeof globalThis?globalThis:window;try{Ni.TabContainerElement=TabContainerElement.define()}catch(t){if(!(Ni.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}let Bi=class PrimerMultiInputElement extends HTMLElement{activateField(t){const e=this.findField(t);if(e){for(const t of this.fields)t!==e&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),t.parentElement?.setAttribute("hidden","hidden"));e.removeAttribute("disabled"),e.removeAttribute("hidden"),e.parentElement?.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function $i(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})}f([P],Bi.prototype,"fields",void 0),Bi=f([R],Bi),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:Bi}),window.customElements.define("primer-multi-input",Bi));var Ki,ji=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)},zi=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 Vi=new WeakMap;class Yi extends Event{constructor(t){super(`auto-check-${t}`,{bubbles:!0}),this.phase=t}get detail(){return this}}class Ui extends Yi{constructor(t,e=""){super(t),this.phase=t,this.message=e,this.setValidity=t=>{this.message=t}}}class Xi extends Yi{constructor(){super("complete")}}class Gi extends Yi{constructor(t){super("success"),this.response=t}}class _i extends Ui{constructor(){super("start","Verifying…")}}class Ji extends Ui{constructor(t){super("error","Validation failed"),this.response=t}}class Zi extends Yi{constructor(t){super("send"),this.body=t}}class AutoCheckElement extends HTMLElement{constructor(){super(...arguments),Ki.set(this,null)}static define(t="auto-check",e=customElements){return e.define(t,this),this}get onloadend(){return ji(this,Ki,"f")}set onloadend(t){ji(this,Ki,"f")&&this.removeEventListener("loadend",ji(this,Ki,"f")),zi(this,Ki,"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=$i(to.bind(null,this),300),n={check:e,controller:null};Vi.set(this,n),t.addEventListener("input",Qi),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=Vi.get(this);e&&(Vi.delete(this),t.removeEventListener("input",Qi),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 Qi(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=Vi.get(n);if(!i||!o||!s)return;const r=new _i;e.dispatchEvent(r),n.required&&e.setCustomValidity(r.message)}async function to(t){const e=t.input;if(!e)return;const n=t.csrfField,i=t.src,o=t.csrf,s=Vi.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 Zi(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 Gi(n.clone()));else{const i=new Ji(n.clone());e.dispatchEvent(i),t.required&&e.setCustomValidity(i.message)}s.controller=null,e.dispatchEvent(new Xi)}catch(t){"AbortError"!==t.name&&(s.controller=null,e.dispatchEvent(new Xi))}}Ki=new WeakMap;const eo="undefined"!=typeof globalThis?globalThis:window;try{eo.AutoCheckElement=AutoCheckElement.define()}catch(t){if(!(eo.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}var no;let io=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),no.set(this,void 0)}connectedCallback(){p(this,no,"f")?.abort();const{signal:t}=m(this,no,new AbortController,"f");this.inputElement.addEventListener("auto-check-success",(async t=>{const e=await t.detail.response.text();e&&e.length>0?this.setSuccess(e):this.clearError()}),{signal:t}),this.inputElement.addEventListener("auto-check-error",(async t=>{const e=await t.detail.response.text();this.setError(e)}),{signal:t})}disconnectedCallback(){p(this,no,"f")?.abort()}clearContents(){this.inputElement.value="",this.inputElement.focus()}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.replaceChildren()}setValidationMessage(t){const e=document.createElement("template");e.innerHTML=t;const n=document.importNode(e.content,!0);this.validationMessageElement.replaceChildren(n)}toggleValidationStyling(t){t?this.validationElement.classList.remove("FormControl-inlineValidation--success"):this.validationElement.classList.add("FormControl-inlineValidation--success"),this.validationSuccessIcon.hidden=t,this.validationErrorIcon.hidden=!t,this.inputElement.setAttribute("invalid",t?"true":"false")}setSuccess(t){this.toggleValidationStyling(!1),this.setValidationMessage(t),this.validationElement.hidden=!1}setError(t){this.toggleValidationStyling(!0),this.setValidationMessage(t),this.validationElement.hidden=!1}};no=new WeakMap,f([O],io.prototype,"inputElement",void 0),f([O],io.prototype,"validationElement",void 0),f([O],io.prototype,"validationMessageElement",void 0),f([O],io.prototype,"validationSuccessIcon",void 0),f([O],io.prototype,"validationErrorIcon",void 0),io=f([R],io);let oo=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 so,ro,ao,lo,co,uo,ho,fo,po,mo,go,bo,vo,wo,yo,Eo,Ao,Lo,ko,To,Mo,So,xo,Co;f([O],oo.prototype,"validationElement",void 0),f([O],oo.prototype,"validationMessageElement",void 0),oo=f([R],oo);const Do=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]'],Io=Do.map((t=>`:not([hidden]) > ${t}`));let Ho=class ActionMenuElement extends HTMLElement{constructor(){super(...arguments),so.add(this),ro.set(this,void 0),ao.set(this,""),lo.set(this,""),co.set(this,!1)}get selectVariant(){return this.getAttribute("data-select-variant")}set selectVariant(t){t?this.setAttribute("data-select-variant",t):this.removeAttribute("variant")}get dynamicLabelPrefix(){const t=this.getAttribute("data-dynamic-label-prefix");return t?`${t}:`:""}set dynamicLabelPrefix(t){this.setAttribute("data-dynamic-label",t)}get dynamicLabel(){return this.hasAttribute("data-dynamic-label")}set dynamicLabel(t){this.toggleAttribute("data-dynamic-label",t)}get popoverElement(){return this.invokerElement?.popoverTargetElement||null}get invokerElement(){const t=this.querySelector("[role=menu]")?.id;if(!t)return null;for(const e of this.querySelectorAll("[aria-controls]"))if(e.getAttribute("aria-controls")===t)return e;return null}get invokerLabel(){return this.invokerElement?this.invokerElement.querySelector(".Button-label"):null}get selectedItems(){const t=this.querySelectorAll("[aria-checked=true]"),e=[];for(const n of t){const t=n.querySelector(".ActionListItem-label");e.push({label:t?.textContent,value:n?.getAttribute("data-value"),element:n})}return e}connectedCallback(){const{signal:t}=m(this,ro,new AbortController,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusout",this,{signal:t}),this.addEventListener("mousedown",this,{signal:t}),this.popoverElement?.addEventListener("toggle",this,{signal:t}),p(this,so,"m",So).call(this),p(this,so,"m",xo).call(this),p(this,so,"m",uo).call(this),this.includeFragment&&this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t})}disconnectedCallback(){p(this,ro,"f").abort()}handleEvent(t){const e=this.invokerElement?.contains(t.target),n=p(this,so,"m",bo).call(this,t);if("toggle"===t.type&&"open"===t.newState&&p(this,so,"a",Co)?.focus(),e&&"mousedown"===t.type)return void m(this,co,!0,"f");if("mousedown"===t.type)return void t.preventDefault();if(e&&n)return p(this,so,"m",vo).call(this,t),void m(this,co,!1,"f");if("focusout"===t.type){if(p(this,co,"f"))return;return void requestAnimationFrame((()=>{this.contains(document.activeElement)&&document.activeElement!==this.invokerElement||p(this,so,"m",Lo).call(this)}))}const i=t.target.closest(Io.join(","));if(null!==i&&n){if(p(this,so,"m",ho).call(this,t))return;const e=i.closest("[data-show-dialog-id]");if(e){const n=this.ownerDocument.getElementById(e.getAttribute("data-show-dialog-id")||"");if(n&&this.contains(e)&&this.contains(n))return void p(this,so,"m",wo).call(this,t,n)}return p(this,so,"m",Eo).call(this,t,i),p(this,so,"m",yo).call(this,i),void(p(this,so,"m",mo).call(this,t)&&(t.preventDefault(),"submit"===i.getAttribute("type")&&i.closest("form")?.submit()))}"include-fragment-replaced"===t.type&&p(this,so,"m",Ao).call(this)}get items(){return Array.from(this.querySelectorAll(Io.join(",")))}getItemById(t){return this.querySelector(`li[data-item-id="${t}"`)}isItemDisabled(t){return!!t&&t.classList.contains("ActionListItem--disabled")}disableItem(t){t&&(t.classList.add("ActionListItem--disabled"),t.querySelector(".ActionListContent").setAttribute("aria-disabled","true"))}enableItem(t){t&&(t.classList.remove("ActionListItem--disabled"),t.querySelector(".ActionListContent").removeAttribute("aria-disabled"))}isItemHidden(t){return!!t&&t.hasAttribute("hidden")}hideItem(t){t&&t.setAttribute("hidden","hidden")}showItem(t){t&&t.removeAttribute("hidden")}isItemChecked(t){return!!t&&"true"===t.querySelector(".ActionListContent").getAttribute("aria-checked")}checkItem(t){if(t&&("single"===this.selectVariant||"multiple"===this.selectVariant)){const e=t.querySelector(".ActionListContent");"true"===e.getAttribute("aria-checked")||p(this,so,"m",yo).call(this,e)}}uncheckItem(t){if(t&&("single"===this.selectVariant||"multiple"===this.selectVariant)){const e=t.querySelector(".ActionListContent");"true"===e.getAttribute("aria-checked")&&p(this,so,"m",yo).call(this,e)}}};ro=new WeakMap,ao=new WeakMap,lo=new WeakMap,co=new WeakMap,so=new WeakSet,uo=function(){const{signal:t}=p(this,ro,"f");for(const e of this.querySelectorAll(Do.join(",")))e.addEventListener("click",p(this,so,"m",ho).bind(this),{signal:t}),e.addEventListener("keydown",p(this,so,"m",ho).bind(this),{signal:t})},ho=function(t){if(!p(this,so,"m",bo).call(this,t))return!1;const e=t.target.closest(Io.join(","));return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},fo=function(t){return p(this,so,"m",po).call(this,t)||p(this,so,"m",mo).call(this,t)},po=function(t){return t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&"Enter"===t.key},mo=function(t){return t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},go=function(t){return t instanceof MouseEvent&&"click"===t.type},bo=function(t){return p(this,so,"m",go).call(this,t)||p(this,so,"m",fo).call(this,t)},vo=function(t){t.preventDefault(),t.stopPropagation(),p(this,so,"m",Mo).call(this)?p(this,so,"m",To).call(this):p(this,so,"m",ko).call(this)},wo=function(t,e){this.querySelector(".ActionListWrap").style.display="none";const n=new AbortController,{signal:i}=n,o=()=>{n.abort(),this.querySelector(".ActionListWrap").style.display="",p(this,so,"m",Mo).call(this)&&p(this,so,"m",To).call(this);const t=this.ownerDocument.activeElement,e=this.ownerDocument.activeElement===this.ownerDocument.body,i=this.contains(t);(e||i)&&setTimeout((()=>this.invokerElement?.focus()),0)};e.addEventListener("close",o,{signal:i}),e.addEventListener("cancel",o,{signal:i})},yo=function(t){if("multiple"!==this.selectVariant&&setTimeout((()=>{p(this,so,"m",Mo).call(this)&&p(this,so,"m",To).call(this)})),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e="true"!==t.getAttribute("aria-checked");if("single"===this.selectVariant){e&&t.setAttribute("aria-checked","true");for(const e of this.querySelectorAll("[aria-checked]"))e!==t&&e.setAttribute("aria-checked","false");p(this,so,"m",So).call(this)}else t.setAttribute("aria-checked",`${e}`);p(this,so,"m",xo).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{detail:{item:t.parentElement,checked:this.isItemChecked(t.parentElement)}}))},Eo=function(t,e){if(t instanceof MouseEvent&&"click"===t.type||t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&"Enter"===t.key)return;t.stopPropagation();e.click()},Ao=function(){p(this,so,"a",Co)&&p(this,so,"a",Co).focus(),p(this,so,"m",uo).call(this)},Lo=function(){p(this,so,"m",To).call(this)},ko=function(){this.popoverElement?.showPopover()},To=function(){this.popoverElement?.hidePopover()},Mo=function(){return this.popoverElement?.matches(":popover-open")},So=function(){if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;m(this,ao,p(this,ao,"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=p(this,ao,"f")},xo=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&&m(this,lo,p(this,lo,"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=p(this,lo,"f"),n.value=(e.value||e.label||"").trim(),t.append(n)}for(const t of e)t.remove()}},Co=function(){return this.querySelector(Io.join(","))},f([O],Ho.prototype,"includeFragment",void 0),Ho=f([R],Ho),window.customElements.get("action-menu")||(window.ActionMenuElement=Ho,window.customElements.define("action-menu",Ho))}();
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{constructor(){super(...arguments),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}))}static define(t="include-fragment",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){d=null===t?t:Promise.resolve(t)}static get observedAttributes(){return["src","loading"]}get src(){const t=this.getAttribute("src");if(t){const e=this.ownerDocument.createElement("a");return e.href=t,e.href}return""}set src(t){this.setAttribute("src",t)}get loading(){return"lazy"===this.getAttribute("loading")?"lazy":"eager"}set loading(t){this.setAttribute("loading",t)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",t)}get data(){return l(this,t,"m",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)}connectedCallback(){if(!this.shadowRoot){this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=":host {display: block;}",this.shadowRoot.append(t,document.createElement("slot"))}this.src&&"eager"===this.loading&&l(this,t,"m",i).call(this),"lazy"===this.loading&&l(this,n,"f").observe(this)}request(){const t=this.src;if(!t)throw new Error("missing src");return new Request(t,{method:"GET",credentials:"same-origin",headers:{Accept:this.accept||"text/html"}})}load(){return l(this,t,"m",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};const h="undefined"!=typeof globalThis?globalThis:window;try{h.IncludeFragmentElement=IncludeFragmentElement.define()}catch(t){if(!(h.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function f(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 p(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 m(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}"function"==typeof SuppressedError&&SuppressedError;const g=new WeakSet;function b(t){y(t),w(t)}const v=new WeakMap;function w(t=document){if(v.has(t))return v.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)L(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&y(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const i={get closed(){return e},unsubscribe(){e=!0,v.delete(t),n.disconnect()}};return v.set(t,i),i}function y(t){for(const e of t.querySelectorAll("[data-action]"))L(e);t instanceof Element&&t.hasAttribute("data-action")&&L(t)}function E(t){const e=t.currentTarget;for(const n of A(e))if(t.type===n.type){const i=e.closest(n.tag);g.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const o=e.getRootNode();if(o instanceof ShadowRoot&&g.has(o.host)&&o.host.matches(n.tag)){const e=o.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*A(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 L(t){for(const e of A(t))t.addEventListener(e.type,E)}const k=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),T=(t,e="property")=>{const n=k(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const M="attr";function S(t,e){H(t,M).add(e)}const x=new WeakSet;function C(t,e){if(x.has(t))return;x.add(t);const n=Object.getPrototypeOf(t),i=n?.constructor?.attrPrefix??"data-";e||(e=H(n,M));for(const n of e){const e=t[n],o=T(`${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 D=Symbol.for("catalyst");class I{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=>T(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...H(t.prototype,M)].map(i).concat(e),set(t){e=t}})}(t),function(t){const e=k(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),C(t),function(t){g.add(t),t.shadowRoot&&b(t.shadowRoot),y(t),w(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&b(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,i,o){C(t),"data-catalyst"!==e&&o&&o.call(t,e,n,i)}}function H(t,e){if(!Object.prototype.hasOwnProperty.call(t,D)){const e=t[D],n=t[D]=new Map;if(e)for(const[t,i]of e)n.set(t,new Set(i))}const n=t[D];return n.has(e)||n.set(e,new Set),n.get(e)}function O(t,e){H(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 P(t,e){H(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 R(t){new I(t)}var W;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)}));class q{constructor(t){this.resizeObserver=new ResizeObserver((t=>{for(const e of t){const t=e.target;t instanceof HTMLElement&&this.update(t)}})),this.resizeObserver.observe(t)}unobserve(t){this.resizeObserver.unobserve(t)}update(t){const e=t.querySelector(".ActionListItem-label");if(!e)return;const n=t.querySelector(".ActionListItem-truncationTooltip");if(!n)return;const i=e.scrollWidth>e.clientWidth;n.style.display=i?"":"none"}}let F=class ActionListElement extends HTMLElement{constructor(){super(...arguments),W.set(this,void 0)}connectedCallback(){m(this,W,new q(this),"f")}disconnectedCallback(){p(this,W,"f").unobserve(this)}};W=new WeakMap,F=f([R],F);const N={"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"]},B={start:["end","center"],end:["start","center"],center:["end","start"]};function $(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 instanceof Element;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const n=e!==document.body&&e instanceof HTMLElement?e:document.body,i=n.getBoundingClientRect(),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=j(n,i,o,s,a,l),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=N[o];let f=0;if(r){let t=o;for(;f<r.length&&z(t,u,c,n);){const o=r[f++];t=o,u=j(n,i,o,s,a,l),u.top-=e.top,u.left-=e.left,d=o}}const p=B[s];let m=0;if(p){let t=s;for(;m<p.length&&V(t,u,c,n);){const o=p[m++];t=o,u=j(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=Math.max(t.height+c.top-n.height,0))}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:K.side,a=null!==(n=t.align)&&void 0!==n?n:K.align;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:K.anchorOffset,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?K.alignmentOffset:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:K.allowOutOfBounds}}(n))}const K={side:"outside-bottom",align:"start",anchorOffset:4,alignmentOffset:4,allowOutOfBounds:!1};function j(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 z(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 V(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*Y(t,e={}){var n,i;const o=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(i=e.onlyTabbable)&&void 0!==i&&i?G:X,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)}function U(t,e=!1){return Y(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function X(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=getComputedStyle(t),n=0===t.offsetWidth||0===t.offsetHeight,i=["hidden","collapse"].includes(e.visibility),o="none"===e.display||!t.offsetParent,s=0===t.getClientRects().length;if(n||i||s||o)return!1}return null!=t.getAttribute("tabindex")||("true"===t.getAttribute("contenteditable")||"plaintext-only"===t.getAttribute("contenteditable")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex)}function G(t,e=!1){return X(t,e)&&"-1"!==t.getAttribute("tabindex")}let _=!1;function J(){}try{const t=Object.create({},{signal:{get(){_=!0}}});window.addEventListener("test",J,t),window.removeEventListener("test",J,t)}catch(t){}function Z(){_||(!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)}}(),_=!0)}Z();const Q=[];let tt,et;function nt(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=U(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&&G(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=U(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=U(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(tt){const t=tt;tt.container.setAttribute("data-focus-trap","suspended"),tt.controller.abort(),Q.push(t)}c.signal.addEventListener("abort",(()=>{tt=void 0})),o.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=Q.findIndex((e=>e.container===t));n>=0&&Q.splice(n,1),function(){const t=Q.pop();t&&nt(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{l(t.target)}),{signal:c.signal,capture:!0}),l(document.activeElement),tt={container:t,controller:c,initialFocus:e,originalSignal:o};const u=Q.findIndex((e=>e.container===t));if(u>=0&&Q.splice(u,1),!n)return i}function it(){return void 0===et&&(et=/^mac/i.test(window.navigator.platform)),et}let ot=1e4;var st;Z(),function(t){t[t.ArrowHorizontal=1]="ArrowHorizontal",t[t.ArrowVertical=2]="ArrowVertical",t[t.JK=4]="JK",t[t.HL=8]="HL",t[t.HomeAndEnd=16]="HomeAndEnd",t[t.PageUpDown=256]="PageUpDown",t[t.WS=32]="WS",t[t.AD=64]="AD",t[t.Tab=128]="Tab",t[t.Backspace=512]="Backspace",t[t.ArrowAll=3]="ArrowAll",t[t.HJKL=12]="HJKL",t[t.WASD=96]="WASD",t[t.All=511]="All"}(st||(st={}));const rt={ArrowLeft:st.ArrowHorizontal,ArrowDown:st.ArrowVertical,ArrowUp:st.ArrowVertical,ArrowRight:st.ArrowHorizontal,h:st.HL,j:st.JK,k:st.JK,l:st.HL,a:st.AD,s:st.WS,w:st.WS,d:st.AD,Tab:st.Tab,Home:st.HomeAndEnd,End:st.HomeAndEnd,PageUp:st.PageUpDown,PageDown:st.PageUpDown,Backspace:st.Backspace},at={ArrowLeft:"previous",ArrowDown:"next",ArrowUp:"previous",ArrowRight:"next",h:"previous",j:"next",k:"previous",l:"next",a:"previous",s:"next",w:"previous",d:"next",Tab:"next",Home:"start",End:"end",PageUp:"start",PageDown:"end",Backspace:"previous"};function lt(t){const e=at[t.key];if("Tab"===t.key&&t.shiftKey)return"previous";const n=it();if(n&&t.metaKey||!n&&t.ctrlKey){if("ArrowLeft"===t.key||"ArrowUp"===t.key)return"start";if("ArrowRight"===t.key||"ArrowDown"===t.key)return"end"}return e}const ct="data-is-active-descendant",ut="data-has-active-descendant";function dt(t,e){var n,i,o,s,r;const a=[],l=new WeakMap,c=null!==(n=null==e?void 0:e.bindKeys)&&void 0!==n?n:((null==e?void 0:e.getNextFocusable)?st.ArrowAll:st.ArrowVertical)|st.HomeAndEnd,u=null!==(i=null==e?void 0:e.focusOutBehavior)&&void 0!==i?i:"stop",d=null!==(o=null==e?void 0:e.focusInStrategy)&&void 0!==o?o:"previous",h=null==e?void 0:e.activeDescendantControl,f=null==e?void 0:e.onActiveDescendantChanged;let p;const m=null!==(s=null==e?void 0:e.preventScroll)&&void 0!==s&&s;function g(){return a[0]}function b(t,e=!1){const n=p;p=t,h?t&&document.activeElement===h?v(n,t,e):w():(n&&n!==t&&l.has(n)&&n.setAttribute("tabindex","-1"),null==t||t.setAttribute("tabindex","0"))}function v(e,n,i=!1){n.id||n.setAttribute("id","__primer_id_"+ot++),e&&e!==n&&e.removeAttribute(ct),h&&(i||h.getAttribute("aria-activedescendant")!==n.id)&&(h.setAttribute("aria-activedescendant",n.id),t.setAttribute(ut,n.id),n.setAttribute(ct,i?"activated-directly":"activated-indirectly"),null==f||f(n,e,i))}function w(e=p){"first"===d&&(p=void 0),null==h||h.removeAttribute("aria-activedescendant"),t.removeAttribute(ut),null==e||e.removeAttribute(ct),null==f||f(void 0,e,!1)}function y(...t){const n=t.filter((t=>{var n,i;return null===(i=null===(n=null==e?void 0:e.focusableElementFilter)||void 0===n?void 0:n.call(e,t))||void 0===i||i}));if(0!==n.length){a.splice(function(t){const e=t[0];if(0===a.length)return 0;let n=0,i=a.length-1;for(;n<=i;){const t=Math.floor((n+i)/2);E(e,a[t])?i=t-1:n=t+1}return n}(n),0,...n);for(const t of n)l.has(t)||l.set(t,t.getAttribute("tabindex")),t.setAttribute("tabindex","-1");p||b(g())}}function E(t,e){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)>0}function A(...t){for(const e of t){const t=a.indexOf(e);t>=0&&a.splice(t,1);const n=l.get(e);if(void 0!==n&&(null===n?e.removeAttribute("tabindex"):e.setAttribute("tabindex",n),l.delete(e)),e===p){b(g())}}}const L={reverse:null==e?void 0:e.reverse,strict:null==e?void 0:e.strict,onlyTabbable:null==e?void 0:e.onlyTabbable};y(...Y(t,L));b("function"==typeof d?d(document.body):g());new MutationObserver((t=>{for(const e of t)for(const t of e.removedNodes)t instanceof HTMLElement&&A(...Y(t,L));for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&y(...Y(t,L))})).observe(t,{subtree:!0,childList:!0});const k=new AbortController,T=null!==(r=null==e?void 0:e.abortSignal)&&void 0!==r?r:k.signal;let M;T.addEventListener("abort",(()=>{A(...a)})),t.addEventListener("mousedown",(t=>{t.target instanceof HTMLElement&&t.target!==document.activeElement&&(M=a.indexOf(t.target))}),{signal:T}),h?(t.addEventListener("focusin",(t=>{t.target instanceof HTMLElement&&a.includes(t.target)&&(h.focus({preventScroll:m}),b(t.target))})),t.addEventListener("mousemove",(({target:t})=>{if(!(t instanceof Node))return;const e=a.find((e=>e.contains(t)));e&&b(e)}),{signal:T,capture:!0}),h.addEventListener("focusin",(()=>{p?v(void 0,p):b(g())})),h.addEventListener("focusout",(()=>{w()}))):t.addEventListener("focusin",(e=>{if(e.target instanceof HTMLElement)if(void 0!==M)M>=0&&a[M]!==p&&b(a[M]),M=void 0;else if("previous"===d)b(e.target);else if("closest"===d||"first"===d){if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t="previous"===x?a.length-1:0,e=a[t];return void(null==e||e.focus({preventScroll:m}))}b(e.target)}else if("function"==typeof d)if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t=d(e.relatedTarget);if((t?a.indexOf(t):-1)>=0&&t instanceof HTMLElement)return void t.focus({preventScroll:m});console.warn("Element requested is not a known focusable element.")}else b(e.target);x=void 0}),{signal:T});const S=null!=h?h:t;let x;return"closest"===d&&document.addEventListener("keydown",(t=>{"Tab"===t.key&&(x=lt(t))}),{signal:T,capture:!0}),S.addEventListener("keydown",(n=>{var i;if(n.key in at){const o=rt[n.key];if(!n.defaultPrevented&&(o&c)>0&&!function(t,e){const n=t.key,i=[...n].length,o=e instanceof HTMLInputElement&&"text"===e.type||e instanceof HTMLTextAreaElement;if(o&&(1===i||"Home"===n||"End"===n))return!0;if(e instanceof HTMLSelectElement){if(1===i)return!0;if("ArrowDown"===n&&it()&&!t.metaKey)return!0;if("ArrowDown"===n&&!it()&&t.altKey)return!0}if(e instanceof HTMLTextAreaElement&&("PageUp"===n||"PageDown"===n))return!0;if(o){const t=e,i=0===t.selectionStart&&0===t.selectionEnd,o=t.selectionStart===t.value.length&&t.selectionEnd===t.value.length;if("ArrowLeft"===n&&!i)return!0;if("ArrowRight"===n&&!o)return!0;if(t instanceof HTMLTextAreaElement){if("ArrowUp"===n&&!i)return!0;if("ArrowDown"===n&&!o)return!0}}return!1}(n,document.activeElement)){const o=lt(n);let s;if((null==e?void 0:e.getNextFocusable)&&(s=e.getNextFocusable(o,null!==(i=document.activeElement)&&void 0!==i?i:void 0,n)),!s){const e=function(){if(!p)return 0;const e=a.indexOf(p);return-1!==e?e:p===t?-1:0}();let i=e;"previous"===o?i-=1:"start"===o?i=0:"next"===o?i+=1:i=a.length-1,i<0&&(i="wrap"===u&&"Tab"!==n.key?a.length-1:0),i>=a.length&&(i="wrap"===u&&"Tab"!==n.key?0:a.length-1),e!==i&&(s=a[i])}h?b(s||p,!0):s&&(x=o,s.focus({preventScroll:m})),("Tab"!==n.key||s)&&n.preventDefault()}}}),{signal:T}),k}var ht,ft,pt,mt,gt,bt,vt;const wt=new IntersectionObserver((t=>{for(const e of t){const t=e.target;e.isIntersecting&&t instanceof At&&t.update()}})),yt=new ResizeObserver((t=>{for(const e of t){const t=e.target;t instanceof At&&t.update()}}));var Et;!function(t){t[t.Item=0]="Item",t[t.Divider=1]="Divider"}(Et||(Et={}));let At=class ActionBarElement extends HTMLElement{constructor(){super(...arguments),ht.add(this),ft.set(this,null)}connectedCallback(){for(const t of this.items){const e=t.getBoundingClientRect().width,n=parseInt(window.getComputedStyle(t)?.marginLeft,10),i=parseInt(window.getComputedStyle(t)?.marginRight,10);t.setAttribute("data-offset-width",`${e+n+i}`)}yt.observe(this),wt.observe(this),requestAnimationFrame((()=>{this.style.overflow="visible",this.update()}))}disconnectedCallback(){yt.unobserve(this),wt.unobserve(this)}menuItemClick(t){const e=t.currentTarget,n=e?.getAttribute("data-for");n&&document.getElementById(n)?.click()}update(){const t=p(this,ht,"a",pt);if(!t)return;const e=t.getBoundingClientRect().top;let n=null;p(this,ht,"m",vt).call(this,((t,i,o)=>{const s=t.getBoundingClientRect().top;return o===Et.Item&&(s>e?(p(this,ht,"m",gt).call(this,i),this.moreMenu.hidden&&(this.moreMenu.hidden=!1),n===Et.Divider&&p(this,ht,"m",gt).call(this,i-1)):(p(this,ht,"m",mt).call(this,i),i===this.items.length-1&&(this.moreMenu.hidden=!0),n===Et.Divider&&p(this,ht,"m",mt).call(this,i-1))),n=o,!0})),p(this,ft,"f")&&p(this,ft,"f").abort(),m(this,ft,dt(this,{bindKeys:st.ArrowHorizontal|st.HomeAndEnd,focusOutBehavior:"wrap",focusableElementFilter:t=>{const e=this.items.indexOf(t.parentElement),n=e>-1&&"visible"===this.items[e].style.visibility,i=t===this.moreMenu.invokerElement&&!this.moreMenu.hidden;return n||i}}),"f")}};ft=new WeakMap,ht=new WeakSet,pt=function(){let t=null;return p(this,ht,"m",vt).call(this,((e,n,i)=>i!==Et.Item||(t=e,!1))),t},mt=function(t){const e=this.items[t],n=p(this,ht,"a",bt)[t];e&&n&&(e.style.setProperty("visibility","visible"),n.hidden=!0)},gt=function(t){const e=this.items[t],n=p(this,ht,"a",bt)[t];e&&n&&(e.style.setProperty("visibility","hidden"),n.hidden=!1)},bt=function(){return this.moreMenu.querySelectorAll('[role="menu"] > li')},vt=function(t){for(let e=0;e<this.items.length;e++){const n=this.items[e],i=n.classList.contains("ActionBar-divider")?Et.Divider:Et.Item;if(!t(n,e,i))break}},f([P],At.prototype,"items",void 0),f([O],At.prototype,"itemContainer",void 0),f([O],At.prototype,"moreMenu",void 0),At=f([R],At),window.ActionBarElement=At;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=[Tt(t,"compositionstart",(t=>Rt(this,t))),Tt(t,"compositionend",(t=>Rt(this,t))),Tt(t,"click",(e=>It(t,e))),Tt(t,"change",(e=>It(t,e))),Tt(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=Lt.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")&&(Pt(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Ct(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Ct(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(Dt&&n.ctrlKey){const e=Ct(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(Dt&&n.ctrlKey){const e=Ct(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&Ot(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),Tt(t,"toggle",(()=>Mt(t,this)),{once:!0}),Tt(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?Tt(t,"mouseover",(()=>Mt(t,this)),{once:!0}):kt,...St(t)];Lt.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=Lt.get(this);if(t){Lt.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const Lt=new WeakMap,kt={unsubscribe(){}};function Tt(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function Mt(t,e){const n=e.getAttribute("src");if(!n)return;const i=Lt.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",(()=>xt(t))),o.setAttribute("src",n))}function St(t){let e=!1;return[Tt(t,"mousedown",(()=>e=!0)),Tt(t,"keydown",(()=>e=!1)),Tt(t,"toggle",(()=>{t.hasAttribute("open")&&(xt(t)||e||function(t){const e=document.activeElement;if(e&&Ot(e)&&t.contains(e))return;const n=Ct(t,!0);n&&n.focus()}(t))}))]}function xt(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function Ct(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 Dt=navigator.userAgent.match(/Macintosh/);function It(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||Ht(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&Ht(e,t)}}function Ht(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")&&Pt(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function Ot(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function Pt(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Rt(t,e){const n=Lt.get(t);n&&(n.isComposing="compositionstart"===e.type)}var Wt,qt;window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const Ft=(()=>{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),qt.set(this,void 0)}get align(){const t=this.getAttribute("align");return"center"===t||"end"===t?t:"start"}set align(t){this.setAttribute("align",`${t}`)}get side(){const t=this.getAttribute("side");return"inside-top"===t||"inside-bottom"===t||"inside-left"===t||"inside-right"===t||"inside-center"===t||"outside-top"===t||"outside-left"===t||"outside-right"===t?t:"outside-bottom"}set side(t){this.setAttribute("side",`${t}`)}get anchorOffset(){const t=this.getAttribute("anchor-offset");return"spacious"===t||"8"===t?8:4}set anchorOffset(t){this.setAttribute("anchor-offset",`${t}`)}get anchor(){return this.getAttribute("anchor")||""}set anchor(t){this.setAttribute("anchor",`${t}`)}get anchorElement(){if(p(this,Wt,"f"))return p(this,Wt,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){m(this,Wt,t,"f"),p(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())),Ft(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(p(this,qt,"f")),m(this,qt,requestAnimationFrame((()=>{const t=this.anchorElement;if(this.classList.toggle("not-anchored",!t),t){const{left:e,top:n}=$(this,t,this);this.style.top=`${n}px`,this.style.left=`${e}px`,this.style.bottom="auto",this.style.right="auto"}else this.style.top="0",this.style.left="0",this.style.bottom="0",this.style.right="0"})),"f"))}}var Nt;function Bt(t){const e=t.target,n=e?.closest("button");if(!n||n.hasAttribute("disabled")||"true"===n.getAttribute("aria-disabled"))return;let i=n?.getAttribute("data-show-dialog-id");if(i){const e=document.getElementById(i);if(e instanceof HTMLDialogElement){e.showModal(),t.preventDefault();let i=n,o=!1;for(;i;)i=i.parentElement?.closest("[popover]:not(:popover-open)"),i&&"auto"===i.popover&&(i.classList.add("dialog-inside-popover-fix"),i.popover="manual",i.showPopover(),o=!0);o&&(e.addEventListener("close",(t=>t.stopImmediatePropagation()),{once:!0}),e.close(),e.showModal(),e.addEventListener("close",(()=>{for(const t of e.ownerDocument.querySelectorAll(".dialog-inside-popover-fix"))t.contains(e)&&(t.classList.remove("dialog-inside-popover-fix"),t.popover="auto",t.showPopover())}),{once:!0}))}}if(i=n.getAttribute("data-close-dialog-id")||n.getAttribute("data-submit-dialog-id"),i){const t=document.getElementById(i);t instanceof HTMLDialogElement&&t.open&&t.close()}}Wt=new WeakMap,qt=new WeakMap,AnchoredPositionElement.observedAttributes=["align","side","anchor","alignment-offset","allow-out-of-bounds"],customElements.get("anchored-position")||(window.AnchoredPositionElement=AnchoredPositionElement,customElements.define("anchored-position",AnchoredPositionElement));class DialogHelperElement extends HTMLElement{constructor(){super(...arguments),Nt.set(this,null)}get dialog(){return this.querySelector("dialog")}connectedCallback(){const{signal:t}=m(this,Nt,new AbortController,"f");document.addEventListener("click",Bt,!0),document.addEventListener("click",this,{signal:t}),this.ownerDocument.body.style.setProperty("--dialog-scrollgutter",window.innerWidth-this.ownerDocument.body.clientWidth+"px"),new MutationObserver((t=>{for(const e of t)e.target===this.dialog&&this.ownerDocument.body.classList.toggle("has-modal",this.dialog.hasAttribute("open"))})).observe(this,{subtree:!0,attributeFilter:["open"]})}disconnectedCallback(){p(this,Nt,"f")?.abort()}handleEvent(t){const e=t.target,n=this.dialog;if(e!==n||!n?.open)return;const i=n.getBoundingClientRect();i.top<=t.clientY&&t.clientY<=i.top+i.height&&i.left<=t.clientX&&t.clientX<=i.left+i.width||n.close()}}Nt=new WeakMap,window.customElements.get("dialog-helper")||(window.DialogHelperElement=DialogHelperElement,window.customElements.define("dialog-helper",DialogHelperElement));var $t=class extends Event{oldState;newState;constructor(t,{oldState:e="",newState:n="",...i}={}){super(t,i),this.oldState=String(e||""),this.newState=String(n||"")}},Kt=new WeakMap;function jt(t,e,n){Kt.set(t,setTimeout((()=>{Kt.has(t)&&t.dispatchEvent(new $t("toggle",{cancelable:!1,oldState:e,newState:n}))}),0))}var zt=globalThis.ShadowRoot||function(){},Vt=globalThis.HTMLDialogElement||function(){},Yt=new WeakMap,Ut=new WeakMap,Xt=new WeakMap;function Gt(t){return Xt.get(t)||"hidden"}var _t=new WeakMap;function Jt(t,e){return("auto"===t.popover||"manual"===t.popover)&&(!!t.isConnected&&((!e||"showing"===Gt(t))&&(!(!e&&"hidden"!==Gt(t))&&(!(t instanceof Vt&&t.hasAttribute("open"))&&document.fullscreenElement!==t))))}function Zt(t){return t?Array.from(Ut.get(t.ownerDocument)||[]).indexOf(t)+1:0}function Qt(t){const e=ne(t),n=function(t){for(;t;){const e=t.popoverTargetElement;if(e instanceof HTMLElement)return e;if((t=t.parentElement||ee(t))instanceof zt&&(t=t.host),t instanceof Document)return}}(t);return Zt(e)>Zt(n)?e:n}function te(t){const e=Ut.get(t);for(const t of e||[]){if(t.isConnected)return t;e.delete(t)}return null}function ee(t){return"function"==typeof t.getRootNode?t.getRootNode():t.parentNode?ee(t.parentNode):t}function ne(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===Xt.get(t))return t;if((t=t.parentElement||ee(t))instanceof zt&&(t=t.host),t instanceof Document)return}}function ie(t){return!(t.hidden||t instanceof zt)&&((!(t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLOptGroupElement||t instanceof HTMLOptionElement||t instanceof HTMLFieldSetElement)||!t.disabled)&&(!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(!(t instanceof HTMLAnchorElement&&""===t.href)&&("number"==typeof t.tabIndex&&-1!==t.tabIndex))))}function oe(t){(function(t){if(t.shadowRoot&&!0!==t.shadowRoot.delegatesFocus)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);let n=e.querySelector("[autofocus]");if(n)return n;{const t=e.querySelectorAll("slot");for(const e of t){const t=e.assignedElements({flatten:!0});for(const e of t){if(e.hasAttribute("autofocus"))return e;if(n=e.querySelector("[autofocus]"),n)return n}}}const i=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let o=i.currentNode;for(;o;){if(ie(o))return o;o=i.nextNode()}})(t)?.focus()}var se=new WeakMap;function re(t){if(!Jt(t,!1))return;const e=t.ownerDocument;if(!t.dispatchEvent(new $t("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"})))return;if(!Jt(t,!1))return;let n=!1;if("auto"===t.popover){const n=t.getAttribute("popover");if(ce(function(t){const e=new Map;let n=0;const i=t.ownerDocument;for(const t of Ut.get(i)||[])e.set(t,n),n+=1;e.set(t,n),n+=1;let o=null;return function(t){const n=ne(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")||!Jt(t,!1))return}te(e)||(n=!0),se.delete(t);const i=e.activeElement;t.classList.add(":popover-open"),Xt.set(t,"showing"),Yt.has(e)||Yt.set(e,new Set),Yt.get(e).add(t),oe(t),"auto"===t.popover&&(Ut.has(e)||Ut.set(e,new Set),Ut.get(e).add(t),fe(_t.get(t),!0)),n&&i&&"auto"===t.popover&&se.set(t,i),jt(t,"closed","open")}function ae(t,e=!1,n=!1){if(!Jt(t,!0))return;const i=t.ownerDocument;if("auto"===t.popover&&(ce(t,e,n),!Jt(t,!0)))return;if(fe(_t.get(t),!1),_t.delete(t),n&&(t.dispatchEvent(new $t("beforetoggle",{oldState:"open",newState:"closed"})),!Jt(t,!0)))return;Yt.get(i)?.delete(t),Ut.get(i)?.delete(t),t.classList.remove(":popover-open"),Xt.set(t,"hidden"),n&&jt(t,"open","closed");const o=se.get(t);o&&(se.delete(t),e&&o.focus())}function le(t,e=!1,n=!1){let i=te(t);for(;i;)ae(i,e,n),i=te(t)}function ce(t,e,n){const i=t.ownerDocument||t;if(t instanceof Document)return le(i,e,n);let o=null,s=!1;for(const e of Ut.get(i)||[])if(e===t)s=!0;else if(s){o=e;break}if(!s)return le(i,e,n);for(;o&&"showing"===Gt(o)&&Ut.get(i)?.size;)ae(o,e,n)}var ue=new WeakMap;function de(t){if(!t.isTrusted)return;const e=t.composedPath()[0];if(!e)return;const n=e.ownerDocument;if(!te(n))return;const i=Qt(e);if(i&&"pointerdown"===t.type)ue.set(n,i);else if("pointerup"===t.type){const t=ue.get(n)===i;ue.delete(n),t&&ce(i||n,!1,!0)}}var he=new WeakMap;function fe(t,e=!1){if(!t)return;he.has(t)||he.set(t,t.getAttribute("aria-expanded"));const n=t.popoverTargetElement;if(n instanceof HTMLElement&&"auto"===n.popover)t.setAttribute("aria-expanded",String(e));else{const e=he.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}var pe=globalThis.ShadowRoot||function(){};function me(t,e,n){const i=t[e];Object.defineProperty(t,e,{value(t){return i.call(this,n(t))}})}var ge,be,ve,we,ye=/(^|[^\\]):popover-open\b/g,Ee="function"==typeof window.CSSLayerBlockRule,Ae=`\n${Ee?"@layer popover-polyfill {":""}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n\n :where([popover]:not(.\\:popover-open)) {\n display: none;\n }\n${Ee?"}":""}\n`,Le=null;function ke(t){if(null===Le)try{(Le=new CSSStyleSheet).replaceSync(Ae)}catch{Le=!1}if(!1===Le){const e=document.createElement("style");e.textContent=Ae,t instanceof Document?t.head.prepend(e):t.prepend(e)}else t.adoptedStyleSheets=[Le,...t.adoptedStyleSheets]}"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){function t(t){return t?.includes(":popover-open")&&(t=t.replace(ye,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||$t,me(Document.prototype,"querySelector",t),me(Document.prototype,"querySelectorAll",t),me(Element.prototype,"querySelector",t),me(Element.prototype,"querySelectorAll",t),me(Element.prototype,"matches",t),me(Element.prototype,"closest",t),me(DocumentFragment.prototype,"querySelectorAll",t),me(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(){re(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){ae(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t){"showing"===Xt.get(this)&&void 0===t||!1===t?ae(this,!0,!0):void 0!==t&&!0!==t||re(this)}}});const e=Element.prototype.attachShadow;e&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(t){const n=e.call(this,t);return ke(n),n}}});const n=HTMLElement.prototype.attachInternals;n&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){const t=n.call(this);return t.shadowRoot&&ke(t.shadowRoot),t}}});const i=new WeakMap;function o(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),i.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),i.set(this,t)}},get(){if("button"!==this.localName&&"input"!==this.localName)return null;if("input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type)return null;if(this.disabled)return null;if(this.form&&"submit"===this.type)return null;const t=i.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return i.delete(this),null;const e=ee(this),n=this.getAttribute("popovertarget");return(e instanceof Document||e instanceof pe)&&n&&e.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){const t=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===t||"hide"===t?t:"toggle"},set(t){this.setAttribute("popovertargetaction",t)}}})}o(HTMLButtonElement),o(HTMLInputElement);const s=t=>{const e=t.composedPath(),n=e[0];if(!(n instanceof Element)||n?.shadowRoot)return;const i=ee(n);if(!(i instanceof pe||i instanceof Document))return;const o=e.find((t=>t.matches?.("[popovertargetaction],[popovertarget]")));return o?(function(t){const e=t.popoverTargetElement;if(!(e instanceof HTMLElement))return;const n=Gt(e);"show"===t.popoverTargetAction&&"showing"===n||"hide"===t.popoverTargetAction&&"hidden"===n||("showing"===n?ae(e,!0,!0):Jt(e,!1)&&(_t.set(e,t),re(e)))}(o),void t.preventDefault()):void 0},r=t=>{const e=t.key,n=t.target;t.defaultPrevented||!n||"Escape"!==e&&"Esc"!==e||ce(n.ownerDocument,!0,!0)};(t=>{t.addEventListener("click",s),t.addEventListener("keydown",r),t.addEventListener("pointerdown",de),t.addEventListener("pointerup",de)})(document),ke(document)}();const Te=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]'].map((t=>`:not([hidden]) > ${t}`)).join(", "),Me=t=>t.textContent?.trim()[0].toLowerCase(),Se=/^\S$/;class FocusGroupElement extends HTMLElement{constructor(){super(...arguments),ge.add(this),be.set(this,null),ve.set(this,null)}get nowrap(){return this.hasAttribute("nowrap")}set nowrap(t){this.toggleAttribute("nowrap",t)}get direction(){return"horizontal"===this.getAttribute("direction")?"horizontal":"vertical"}set direction(t){this.setAttribute("direction",`${t}`)}get retain(){return this.hasAttribute("retain")}set retain(t){this.toggleAttribute("retain",t)}get mnemonics(){return this.hasAttribute("mnemonics")}connectedCallback(){m(this,ve,new AbortController,"f");const{signal:t}=p(this,ve,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusin",this,{signal:t})}disconnectedCallback(){p(this,ve,"f")?.abort()}handleEvent(t){const{direction:e,nowrap:n}=this;if("focusin"===t.type){if(this.retain&&t.target instanceof Element&&t.target.matches(Te)){p(this,be,"f")?.abort();const{signal:e}=m(this,be,new AbortController,"f");for(const n of p(this,ge,"a",we)){n.setAttribute("tabindex",n===t.target?"0":"-1");const i=t.target.closest("[popover]");n===t.target&&"auto"===i?.popover&&i.closest("focus-group")===this&&i.addEventListener("toggle",(t=>{if(t.target instanceof Element&&"closed"===t.newState&&(p(this,be,"f")?.abort(),n.setAttribute("tabindex","-1"),i.id)){const t=this.querySelector(`[popovertarget="${i.id}"]`);t?t.setAttribute("tabindex","0"):p(this,ge,"a",we)[0]?.setAttribute("tabindex","0")}}),{signal:e})}}}else if(t instanceof KeyboardEvent){const i=Array.from(p(this,ge,"a",we));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||!Se.test(s))return;{const e=s.toLowerCase(),r=o>0&&Me(t.target)===e?o:0;o=i.findIndex(((t,n)=>n>r&&Me(t)===e)),o<0&&!n&&(o=i.findIndex((t=>Me(t)===e)))}}n&&o<0&&(o=0),!n&&o>=i.length&&(o=0);const r=i.at(Math.min(o,i.length-1));{let e=r;do{e=e.closest("[popover]:not(:popover-open)"),"auto"!==e?.popover||["ArrowRight","ArrowLeft"].includes(t.key)||e.showPopover(),e=e?.parentElement||null}while(e)}r?.focus()}}}be=new WeakMap,ve=new WeakMap,ge=new WeakSet,we=function(){return this.querySelectorAll(Te)},customElements.get("focus-group")||(window.FocusGroupElement=FocusGroupElement,customElements.define("focus-group",FocusGroupElement));let xe=class ScrollableRegionElement extends HTMLElement{constructor(){super(...arguments),this.hasOverflow=!1,this.labelledBy=""}connectedCallback(){this.style.overflow="auto",this.observer=new ResizeObserver((t=>{for(const e of t)this.hasOverflow=e.target.scrollHeight>e.target.clientHeight||e.target.scrollWidth>e.target.clientWidth})),this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}attributeChangedCallback(t){"data-has-overflow"===t&&(this.hasOverflow?(this.setAttribute("aria-labelledby",this.labelledBy),this.setAttribute("role","region"),this.setAttribute("tabindex","0")):(this.removeAttribute("aria-labelledby"),this.removeAttribute("role"),this.removeAttribute("tabindex")))}};f([S],xe.prototype,"hasOverflow",void 0),f([S],xe.prototype,"labelledBy",void 0),xe=f([R],xe),window.ScrollableRegionElement=xe;const Ce=new WeakMap,De=new WeakMap,Ie=new WeakMap;function He(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=Ie.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(De.has(e)&&t instanceof MouseEvent){const n=De.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(De.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=De.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`,Ne(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)De.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];De.set(e,{dragStartX:n,dragStartY:i})}}function Oe(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=Pe(e);if(!(n instanceof ImageCropElement))return;const{box:i}=Ie.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return qe(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,Ce.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=Ce.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=Ce.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&&We(n,s,r,!(t instanceof KeyboardEvent))}function Pe(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function Re(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=Pe(e);if(!(n instanceof ImageCropElement))return;const{box:i}=Ie.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",Oe),n.addEventListener("touchmove",Oe,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),Ce.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),Oe(t)}else n.addEventListener("mousemove",He),n.addEventListener("touchmove",He,{passive:!0})}function We(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=Ce.get(t);if(!s)return;const{box:r,image:a}=Ie.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`,Ne(t,{x:l,y:c,width:o,height:o})}function qe(t){const{image:e}=Ie.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);Ce.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),We(t,n,n)}function Fe(t){const e=t.currentTarget;e instanceof ImageCropElement&&(De.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",Oe),e.removeEventListener("mousemove",He),e.removeEventListener("touchmove",Oe),e.removeEventListener("touchmove",He))}function Ne(t,e){const{image:n}=Ie.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(Ie.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&&(Ie.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,qe(this)})),this.addEventListener("mouseleave",Fe),this.addEventListener("touchend",Fe),this.addEventListener("mouseup",Fe),e.addEventListener("mousedown",Re),e.addEventListener("touchstart",Re,{passive:!0}),this.addEventListener("keydown",He),this.addEventListener("keydown",Oe),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}=Ie.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}var Be,$e,Ke,je;function ze(t){document.activeElement!==t&&t?.focus()}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const Ve=[];function Ye(t){const e=t.target,n=e?.closest("button");if(!n||n.hasAttribute("disabled")||"true"===n.getAttribute("aria-disabled"))return;let i=n?.getAttribute("data-show-dialog-id");if(i){t.stopPropagation();const e=document.getElementById(i);if(e instanceof ModalDialogElement)return e.openButton=n,e.show(),void t.preventDefault()}if(Ve.length&&(i=n.getAttribute("data-close-dialog-id")||n.getAttribute("data-submit-dialog-id"),i)){const t=document.getElementById(i);if(t instanceof ModalDialogElement){const e=Ve.findIndex((t=>t.id===i));Ve.splice(e,1),t.close(n.hasAttribute("data-submit-dialog-id"))}}}function Ue(t){!(t instanceof KeyboardEvent&&"keydown"===t.type&&"Enter"===t.key)||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey||Ye(t)}function Xe(t){const e=t.target;if(e?.closest("button"))return;const n=Ve[Ve.length-1];if(!n)return;!e.closest(`#${n.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",(t=>{t.target===e&&(Ve.pop(),n.close())}),{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),Be.add(this),$e.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){if(t){if(this.open)return;this.setAttribute("open",""),this.setAttribute("aria-disabled","false"),document.body.style.paddingRight=window.innerWidth-document.body.clientWidth+"px",document.body.style.overflow="hidden",p(this,Be,"a",Ke)?.classList.remove("Overlay--hidden"),p(this,$e,"f").signal.aborted&&m(this,$e,new AbortController,"f"),nt(this,this.querySelector("[autofocus]"),p(this,$e,"f").signal),Ve.push(this)}else{if(!this.open)return;this.removeAttribute("open"),this.setAttribute("aria-disabled","true"),p(this,Be,"a",Ke)?.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",p(this,$e,"f").abort();const t=this.openButton?.closest("details")||this.openButton?.closest("action-menu");ze(t?U(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",Ye),document.addEventListener("keydown",Ue),document.addEventListener("mousedown",Xe),this.addEventListener("keydown",(t=>p(this,Be,"m",je).call(this,t)))}show(){this.open=!0}close(t=!1){if(!1===this.open)return;const e=new Event(t?"close":"cancel");this.dispatchEvent(e),this.open=!1}}var Ge,_e,Je,Ze,Qe,tn,en,nn;$e=new WeakMap,Be=new WeakSet,Ke=function(){return this.parentElement?.hasAttribute("data-modal-dialog-overlay")?this.parentElement:null},je=function(t){if(t instanceof KeyboardEvent&&!t.isComposing&&this.open)switch(t.key){case"Escape":this.close(),t.preventDefault(),t.stopPropagation();break;case"Enter":t.target.getAttribute("data-close-dialog-id")===this.id&&t.stopPropagation();break}},window.customElements.get("modal-dialog")||(window.ModalDialogElement=ModalDialogElement,window.customElements.define("modal-dialog",ModalDialogElement));let on=class NavListElement extends HTMLElement{constructor(){super(...arguments),Ge.add(this),_e.set(this,void 0)}connectedCallback(){this.topLevelList&&m(this,_e,new q(this.topLevelList),"f")}disconnectedCallback(){this.topLevelList&&p(this,_e,"f").unobserve(this.topLevelList)}selectItemById(t){if(!t)return!1;const e=p(this,Ge,"m",Je).call(this,t);return!!e&&(p(this,Ge,"m",tn).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=p(this,Ge,"m",Ze).call(this,t);return!!e&&(p(this,Ge,"m",tn).call(this,e),!0)}selectItemByCurrentLocation(){const t=p(this,Ge,"m",Qe).call(this);return!!t&&(p(this,Ge,"m",tn).call(this,t),!0)}expandItem(t){t.nextElementSibling?.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){t.nextElementSibling?.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false"),t.focus()}itemIsExpanded(t){return"A"===t?.tagName||"true"===t?.getAttribute("aria-expanded")}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=e.closest("button");n&&(this.itemIsExpanded(n)?this.collapseItem(n):this.expandItem(n),t.stopPropagation())}handleItemWithSubItemKeydown(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;let n=e.closest("button");if(!n){const t=e.getAttribute("aria-labelledby");if(!t)return;n=document.getElementById(t)}this.itemIsExpanded(n)&&"Escape"===t.key&&this.collapseItem(n),t.stopPropagation()}};var sn,rn,an;_e=new WeakMap,Ge=new WeakSet,Je=function(t){for(const e of this.items){if(e.classList.contains("ActionListItem--hasSubItem"))continue;if((e.getAttribute("data-item-id")?.split(" ")||[]).includes(t))return e}return null},Ze=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},Qe=function(){return p(this,Ge,"m",Ze).call(this,window.location.pathname)},tn=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&p(this,Ge,"m",en).call(this,e),t.classList.add("ActionListItem--navActive"),t.children.length>0&&t.children[0].setAttribute("aria-current","page");const n=p(this,Ge,"m",nn).call(this,t);n&&(this.expandItem(n),n.classList.add("ActionListContent--hasActiveSubItem"))},en=function(t){t.classList.remove("ActionListItem--navActive"),t.children.length>0&&t.children[0].removeAttribute("aria-current");const e=p(this,Ge,"m",nn).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},nn=function(t){if(!t.classList.contains("ActionListItem--subItem"))return null;const e=t.closest("li.ActionListItem--hasSubItem")?.querySelector("button.ActionListContent");return e||null},f([P],on.prototype,"items",void 0),f([O],on.prototype,"topLevelList",void 0),on=f([R],on);let ln=class NavListGroupElement extends HTMLElement{constructor(){super(...arguments),sn.add(this),an.set(this,new q(this))}connectedCallback(){this.setShowMoreItemState()}get showMoreDisabled(){return this.showMoreItem.hasAttribute("aria-disabled")}set showMoreDisabled(t){t?this.showMoreItem.setAttribute("aria-disabled","true"):this.showMoreItem.removeAttribute("aria-disabled"),this.showMoreItem.classList.toggle("disabled",t)}set currentPage(t){this.showMoreItem.setAttribute("data-current-page",t.toString())}get currentPage(){return parseInt(this.showMoreItem.getAttribute("data-current-page"))||1}get totalPages(){return parseInt(this.showMoreItem.getAttribute("data-total-pages"))||1}get paginationSrc(){return this.showMoreItem.getAttribute("src")||""}async showMore(t){if(t.preventDefault(),this.showMoreDisabled)return;let e;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const n=await fetch(t);if(!n.ok)return;e=await n.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const n=p(this,sn,"m",rn).call(this,document,e);n?.querySelector("li > a")?.setAttribute("data-targets","nav-list-group.focusMarkers");const i=t.target.closest("button").getAttribute("data-list-id");document.getElementById(i).append(n),this.focusMarkers.pop()?.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}};var cn,un;an=new WeakMap,sn=new WeakSet,rn=function(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)},f([O],ln.prototype,"showMoreItem",void 0),f([P],ln.prototype,"focusMarkers",void 0),ln=f([R],ln),window.NavListGroupElement=ln;let dn=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),cn.add(this)}connectedCallback(){p(this,cn,"m",un).call(this)}select(t){const e=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),t.querySelector("[aria-current]")?.setAttribute("aria-current","false");e.closest("li.SegmentedControl-item")?.classList.add("SegmentedControl-item--selected"),e.setAttribute("aria-current","true")}};cn=new WeakSet,un=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},f([P],dn.prototype,"items",void 0),dn=f([R],dn),window.customElements.get("segmented-control")||(window.SegmentedControlElement=dn,window.customElements.define("segmented-control",dn));let hn=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 fn,pn,mn,gn,bn,vn,wn,yn,En,An;f([O],hn.prototype,"switch",void 0),f([O],hn.prototype,"loadingSpinner",void 0),f([O],hn.prototype,"errorIcon",void 0),hn=f([R],hn),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=hn,window.customElements.define("toggle-switch",hn));const Ln=(()=>{let t;return e=>t?e.matches(t):function(e){try{return t=":popover-open",e.matches(t)}catch{try{return t=":open",e.matches(":open")}catch{return t=".\\:popover-open",e.matches(".\\:popover-open")}}}(e)})(),kn="sr-only",Tn=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];function Mn(t){for(const e of Dn)e!==t&&(Ln(e)?e.hidePopover():Dn.delete(e))}function Sn(){Mn()}function xn(t){setTimeout((()=>{for(const e of Dn)Ln(e)&&"focus"===e.showReason&&e.control!==t.target&&e.hidePopover()}),0)}const Cn=new Set,Dn=new Set;class ToolTipElement extends HTMLElement{constructor(){super(...arguments),fn.add(this),pn.set(this,void 0),mn.set(this,"center"),gn.set(this,"outside-bottom"),bn.set(this,!1),vn.set(this,"mouse")}styles(){return'\n :host {\n padding: var(--overlay-paddingBlock-condensed) var(--overlay-padding-condensed) !important;\n font: var(--text-body-shorthand-small);\n color: var(--fgColor-onEmphasis, var(--color-fg-on-emphasis)) !important;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n background: var(--bgColor-emphasis, var(--color-neutral-emphasis-plus)) !important;\n border-radius: var(--borderRadius-medium);\n border: 0 !important;\n opacity: 0;\n max-width: var(--overlay-width-small);\n word-wrap: break-word;\n white-space: normal;\n width: max-content !important;\n inset: var(--tool-tip-position-top, 0) auto auto var(--tool-tip-position-left, 0) !important;\n overflow: visible !important;\n text-wrap: balance;\n }\n\n :host:before{\n position: absolute;\n z-index: 1000001;\n color: var(--bgColor-emphasis, 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(:popover-open),\n :host(:popover-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n }\n\n :host(.\\:popover-open),\n :host(.\\:popover-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n animation-delay: .4s;\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-n):before {\n right: 50%;\n margin-right: -6px;\n }\n :host(.tooltip-s):before,\n :host(.tooltip-se):before,\n :host(.tooltip-sw):before {\n bottom: 100%;\n border-bottom-color: var(--bgColor-emphasis, var(--color-neutral-emphasis-plus));\n }\n :host(.tooltip-s):after,\n :host(.tooltip-se):after,\n :host(.tooltip-sw):after {\n bottom: 100%\n }\n :host(.tooltip-n):before,\n :host(.tooltip-ne):before,\n :host(.tooltip-nw):before {\n top: 100%;\n border-top-color: var(--bgColor-emphasis, var(--color-neutral-emphasis-plus));\n }\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%;\n }\n :host(.tooltip-se):before,\n :host(.tooltip-ne):before {\n left: 0;\n margin-left: 6px;\n }\n :host(.tooltip-sw):before,\n :host(.tooltip-nw):before {\n right: 0;\n margin-right: 6px;\n }\n :host(.tooltip-w):before {\n top: 50%;\n bottom: 50%;\n left: 100%;\n margin-top: -6px;\n border-left-color: var(--bgColor-emphasis, var(--color-neutral-emphasis-plus));\n }\n :host(.tooltip-e):before {\n top: 50%;\n right: 100%;\n bottom: 50%;\n margin-top: -6px;\n border-right-color: var(--bgColor-emphasis, var(--color-neutral-emphasis-plus));\n }\n\n @media (forced-colors: active) {\n :host {\n outline: solid 1px transparent;\n }\n\n :host:before {\n display: none;\n }\n }\n '}get showReason(){return p(this,vn,"f")}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get type(){return"label"===this.getAttribute("data-type")?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return this.getAttribute("data-direction")||"s"}set direction(t){this.setAttribute("data-direction",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}set hiddenFromView(t){t&&Ln(this)?this.hidePopover():t||Ln(this)||this.showPopover()}get hiddenFromView(){return!Ln(this)}connectedCallback(){if(Cn.add(this),p(this,fn,"m",yn).call(this),p(this,fn,"m",En).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}if(p(this,fn,"m",wn).call(this,!1),m(this,bn,!0,"f"),!this.control)return;this.setAttribute("role","tooltip"),p(this,pn,"f")?.abort(),m(this,pn,new AbortController,"f");const{signal:t}=p(this,pn,"f");this.addEventListener("mouseleave",this,{signal:t}),this.addEventListener("toggle",this,{signal:t}),this.control.addEventListener("mouseenter",this,{signal:t}),this.control.addEventListener("mouseleave",this,{signal:t}),this.control.addEventListener("focus",this,{signal:t}),this.control.addEventListener("mousedown",this,{signal:t}),this.control.popoverTargetElement?.addEventListener("beforetoggle",this,{signal:t}),this.ownerDocument.addEventListener("focusout",Sn),this.ownerDocument.addEventListener("focusin",xn),this.ownerDocument.addEventListener("keydown",this,{signal:t,capture:!0})}disconnectedCallback(){Cn.delete(this),Dn.delete(this),p(this,pn,"f")?.abort()}async handleEvent(t){if(!this.control)return;const e=Ln(this),n="mouseenter"===t.type||"focus"===t.type&&(navigator.webdriver||this.control.matches(":focus-visible")),i="mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this,o="keydown"===t.type&&"Escape"===t.key,s="mousedown"===t.type&&t.currentTarget===this.control,r="beforetoggle"===t.type&&t.currentTarget!==this,a=i||o||s||r;e&&o&&(t.stopImmediatePropagation(),t.preventDefault()),await Promise.resolve(),e||!n||Ln(this)?e&&a&&Ln(this)&&this.hidePopover():(m(this,vn,"mouseenter"===t.type?"mouse":"focus","f"),this.showPopover()),"toggle"===t.type&&p(this,fn,"m",wn).call(this,"open"===t.newState)}attributeChangedCallback(t){this.isConnected&&("id"===t||"data-type"===t?p(this,fn,"m",yn).call(this):"data-direction"===t&&p(this,fn,"m",En).call(this))}}var In,Hn;pn=new WeakMap,mn=new WeakMap,gn=new WeakMap,bn=new WeakMap,vn=new WeakMap,fn=new WeakSet,wn=function(t){t?(Dn.add(this),this.classList.remove(kn),Mn(this),p(this,fn,"m",An).call(this)):(Dn.delete(this),this.classList.remove(...Tn),this.classList.add(kn))},yn=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)}},En=function(){this.classList.remove(...Tn);const t=this.direction;"n"===t?(m(this,mn,"center","f"),m(this,gn,"outside-top","f")):"ne"===t?(m(this,mn,"start","f"),m(this,gn,"outside-top","f")):"e"===t?(m(this,mn,"center","f"),m(this,gn,"outside-right","f")):"se"===t?(m(this,mn,"start","f"),m(this,gn,"outside-bottom","f")):"s"===t?(m(this,mn,"center","f"),m(this,gn,"outside-bottom","f")):"sw"===t?(m(this,mn,"end","f"),m(this,gn,"outside-bottom","f")):"w"===t?(m(this,mn,"center","f"),m(this,gn,"outside-left","f")):"nw"===t&&(m(this,mn,"end","f"),m(this,gn,"outside-top","f"))},An=function(){if(!this.control)return;if(!p(this,bn,"f")||!Ln(this))return;const t=$(this,this.control,{side:p(this,gn,"f"),align:p(this,mn,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.setProperty("--tool-tip-position-top",`${t.top}px`),this.style.setProperty("--tool-tip-position-left",`${t.left}px`);let i="s";i="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===n?"n":"start"===n?"ne":"nw":"center"===n?"s":"start"===n?"se":"sw",this.classList.add(`tooltip-${i}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let On=class XBannerElement extends HTMLElement{constructor(){super(...arguments),In.add(this)}dismiss(){const t=this.parentElement;t&&("remove"===p(this,In,"a",Hn)?t.removeChild(this):this.hide())}show(){this.style.setProperty("display","initial")}hide(){this.style.setProperty("display","none")}};In=new WeakSet,Hn=function(){return this.getAttribute("data-dismiss-scheme")},f([O],On.prototype,"titleText",void 0),On=f([R],On),window.customElements.get("x-banner")||(window.XBannerElement=On,window.customElements.define("x-banner",On));class Pn{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":Wn(e.input,e.list)&&t.preventDefault();break;case"Tab":e.tabInsertsSuggestions&&Wn(e.input,e.list)&&t.preventDefault();break;case"Escape":e.clearSelection();break;case"ArrowDown":e.navigate(1),t.preventDefault();break;case"ArrowUp":e.navigate(-1),t.preventDefault();break;case"n":e.ctrlBindings&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":e.ctrlBindings&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.clearSelection()}}(t,this),this.compositionEventHandler=t=>function(t,e){e.isComposing="compositionstart"===t.type;const n=document.getElementById(e.input.getAttribute("aria-controls")||"");if(!n)return;e.clearSelection()}(t,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",Rn),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",Rn)}indicateDefaultOption(){var t;this.defaultFirstOption&&(null===(t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(qn)[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(qn)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(qn),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"),Fn(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 Rn(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 Wn(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 qn(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function Fn(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 Nn=window.testScreenReaderDelay||100;class Bn{constructor(t,e,n,i=!1){var o;if(this.container=t,this.input=e,this.results=n,this.combobox=new Pn(e,n,{defaultFirstOption:i}),this.feedback=t.getRootNode().getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=i,this.clearButton=t.getRootNode().getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=n.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.popover?this.results.matches(":popover-open")&&this.results.hidePopover():this.results.hidden=!0,this.results.getAttribute("aria-label")||this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let n;return function(...i){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...i)}),e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(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.close()}onKeydown(t){if("Escape"===t.key&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.open(),t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.interactingWithList||this.fetchResults()}onInputBlur(){this.interactingWithList||this.close()}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(this.close(),e instanceof HTMLAnchorElement)return;const n=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=n,n||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout((()=>{this.feedback&&(this.feedback.textContent=t)}),Nn)}fetchResults(){const t=this.input.value.trim();if(!t&&!this.container.fetchOnEmpty)return void this.close();const e=this.container.src;if(!e)return;const n=new URL(e,window.location.href),i=new URLSearchParams(n.search.slice(1));i.append("q",t),n.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(n).then((t=>{this.results.innerHTML=t,this.identifyOptions(),this.combobox.indicateDefaultOption();const e=this.results.querySelectorAll('[role="option"]'),n=!!e.length,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.`),n?this.open():this.close(),this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))})).catch((()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))}))}open(){(this.results.popover?!this.results.matches(":popover-open"):this.results.hidden)&&(this.combobox.start(),this.results.popover?this.results.showPopover():this.results.hidden=!1),this.container.open=!0,this.interactingWithList=!0}close(){(this.results.popover?this.results.matches(":popover-open"):!this.results.hidden)&&(this.combobox.stop(),this.results.popover?this.results.hidePopover():this.results.hidden=!0),this.container.open=!1,this.interactingWithList=!1}}var $n,Kn,jn,zn,Vn,Yn=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)},Un=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},Xn=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 Gn=globalThis.HTMLElement||null;class _n extends Event{constructor(t,e){var{relatedTarget:n}=e;super(t,Xn(e,["relatedTarget"])),this.relatedTarget=n}}const Jn=new WeakMap;let Zn=null;class AutoCompleteElement extends Gn{constructor(){super(...arguments),$n.add(this),Kn.set(this,null),jn.set(this,null),Vn.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){Zn=null===t?t:Promise.resolve(t)}get forElement(){var t;if(null===(t=Yn(this,Kn,"f"))||void 0===t?void 0:t.isConnected)return Yn(this,Kn,"f");const e=this.getAttribute("for"),n=this.getRootNode();return e&&(n instanceof Document||n instanceof ShadowRoot)?n.getElementById(e):null}set forElement(t){Un(this,Kn,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return(null===(t=Yn(this,jn,"f"))||void 0===t?void 0:t.isConnected)?Yn(this,jn,"f"):this.querySelector("input")}set inputElement(t){Un(this,jn,t,"f"),Yn(this,$n,"m",zn).call(this)}connectedCallback(){this.isConnected&&(Yn(this,$n,"m",zn).call(this),new MutationObserver((()=>{Jn.get(this)||Yn(this,$n,"m",zn).call(this)})).observe(this,{subtree:!0,childList:!0}))}disconnectedCallback(){const t=Jn.get(this);t&&(t.destroy(),Jn.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=Yn(this,Vn,"f"))||void 0===e||e.abort();const{signal:n}=Un(this,Vn,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(Zn){return(await Zn).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=Jn.get(this);if(s)switch(this.forElement===(null===(i=Jn.get(this))||void 0===i?void 0:i.results)&&this.inputElement===(null===(o=Jn.get(this))||void 0===o?void 0:o.input)||Yn(this,$n,"m",zn).call(this),t){case"open":null===n?s.close():s.open();break;case"value":null!==n&&(s.input.value=n),this.dispatchEvent(new _n("auto-complete-change",{bubbles:!0,relatedTarget:s.input}))}}}Kn=new WeakMap,jn=new WeakMap,Vn=new WeakMap,$n=new WeakSet,zn=function(){var t;null===(t=Jn.get(this))||void 0===t||t.destroy();const{forElement:e,inputElement:n}=this;if(!e||!n)return;const i="true"===this.getAttribute("data-autoselect");Jn.set(this,new Bn(this,n,e,i)),e.setAttribute("role","listbox")};const Qn="undefined"!=typeof globalThis?globalThis:window;try{Qn.AutocompleteElement=Qn.AutoCompleteElement=AutoCompleteElement.define()}catch(t){if(!(Qn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function ti(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 ei(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),ti(n),e.removeChild(n),Promise.resolve()}async function ni(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}var o;if("true"!==t.getAttribute("aria-disabled"))if(n)await ei(n),i();else if(e){const n="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(n instanceof Document||"ShadowRoot"in window&&n instanceof ShadowRoot))return;const s=n.getElementById(e);s&&(await(o=s,o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?ei(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?ei(o.href):ti(o)),i())}}function ii(t){const e=t.currentTarget;e instanceof HTMLElement&&ni(e)}function oi(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),ni(e))}}function si(t){t.currentTarget.addEventListener("keydown",oi)}function ri(t){t.currentTarget.removeEventListener("keydown",oi)}class ClipboardCopyElement extends HTMLElement{static define(t="clipboard-copy",e=customElements){return e.define(t,this),this}constructor(){super(),this.addEventListener("click",ii),this.addEventListener("focus",si),this.addEventListener("blur",ri)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}const ai="undefined"!=typeof globalThis?globalThis:window;try{ai.ClipboardCopyElement=ClipboardCopyElement.define()}catch(t){if(!(ai.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function li(t){t.style.display="inline-block"}function ci(t){t.style.display="none"}const ui=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=ui.get(t);e?(clearTimeout(e),ui.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(ci(e),li(n))}(t),ui.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(li(e),ci(n))}(t),ui.delete(t)}),2e3))}));var di,hi=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},fi=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 pi="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)}},mi=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],gi={minimumIntegerDigits:2};class bi{constructor(t,e={}){di.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;hi(this,di,{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 fi(this,di,"f")}formatToParts(t){const e=[],n=fi(this,di,"f"),i=n.style,o=n.locale;for(const[i,s]of mi){const r=t[i];if("auto"===n[`${i}Display`]&&!r)continue;const a=n[i],l="2-digit"===a?gi:"numeric"===a?{}:{style:"unit",unit:s,unitDisplay:a};e.push(new Intl.NumberFormat(o,l).format(r))}return new pi(o,{type:"unit",style:"digital"===i?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map((t=>t.value)).join("")}}di=new WeakMap;const vi=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,wi=["year","month","week","day","hour","minute","second","millisecond"];class yi{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 yi(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(vi))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return o?new yi(...o):new yi}if("object"==typeof t){const{years:e,months:n,weeks:i,days:o,hours:s,minutes:r,seconds:a,milliseconds:l}=t;return new yi(e,n,i,o,s,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const n=Date.now(),i=Math.abs(Ei(n,yi.from(t)).getTime()-n),o=Math.abs(Ei(n,yi.from(e)).getTime()-n);return i>o?-1:i<o?1:0}toLocaleString(t,e){return new bi(t,e).format(this)}}function Ei(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 Ai(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();if(r>=27||i+o+r){const t=new Date(e);t.setFullYear(d+i*n),t.setMonth(h+o*n),t.setDate(f+r*n);const a=t.getFullYear()-e.getFullYear(),l=t.getMonth()-e.getMonth(),c=Math.abs(Math.round((Number(t)-Number(e))/864e5)),u=Math.abs(12*a+l);c<27?(r>=6?(s+=Math.round(r/7),r=0):r=c,o=i=0):u<11?(o=u,i=0):(o=0,i=a*n),(o||i)&&(r=0),h=e.getMonth()}return i&&(o=0),s>=4&&(o+=Math.round(s/4)),(o||i)&&(s=0),r&&s&&!o&&!i&&(s+=Math.round(r/7),r=0),new yi(i*n,o*n,s*n,r*n,a*n,l*n,c*n,u*n)}var Li,ki,Ti,Mi,Si,xi,Ci,Di,Ii,Hi,Oi,Pi=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)},Ri=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 Wi=globalThis.HTMLElement||null,qi=new yi,Fi=new yi(0,0,0,0,0,1);class Ni 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 Bi(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 $i=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=Bi(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,Bi(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends Wi{constructor(){super(...arguments),Li.add(this),ki.set(this,!1),Ti.set(this,!1),Si.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),Oi.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 Pi(this,Oi,"f")}set onRelativeTimeUpdated(t){Pi(this,Oi,"f")&&this.removeEventListener("relative-time-updated",Pi(this,Oi,"f")),Ri(this,Oi,"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,vi.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 wi.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(){$i.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&Ri(this,ki,null!==n&&(this.date&&Pi(this,Li,"m",xi).call(this,this.date))!==n,"f"),Pi(this,Ti,"f")||"title"===t&&Pi(this,ki,"f")||Ri(this,Ti,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){const t=Pi(this,Si,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let n=e;const i=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!i)return void(Pi(this,Si,"f").textContent=t);const o=Date.now();Pi(this,ki,"f")||(n=Pi(this,Li,"m",xi).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 yi;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=wi.indexOf(e)||wi.length;return new yi(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=Pi(this,Li,"m",Ci).call(this,s);let a=t;a="duration"===r?Pi(this,Li,"m",Di).call(this,s):"relative"===r?Pi(this,Li,"m",Ii).call(this,s):Pi(this,Li,"m",Hi).call(this,i),a?Pi(this,Si,"f").textContent=a:this.shadowRoot===Pi(this,Si,"f")&&this.textContent&&(Pi(this,Si,"f").textContent=this.textContent),a===t&&n===e||this.dispatchEvent(new Ni(t,a,e,n)),"relative"===r||"duration"===r?$i.observe(this):$i.unobserve(this),Ri(this,Ti,!1,"f")}}ki=new WeakMap,Ti=new WeakMap,Si=new WeakMap,Oi=new WeakMap,Li=new WeakSet,Mi=function(){var t;return(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang")||"default"},xi=function(t){return new Intl.DateTimeFormat(Pi(this,Li,"a",Mi),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},Ci=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===yi.compare(t,this.threshold))return"relative"}return"datetime"},Di=function(t){const e=Pi(this,Li,"a",Mi),n=this.format,i=this.formatStyle,o=this.tense;let s=qi;"micro"===n?(t=Ai(t),s=Fi,("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=Fi)):("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})},Ii=function(t){const e=new Intl.RelativeTimeFormat(Pi(this,Li,"a",Mi),{numeric:"auto",style:this.formatStyle}),n=this.tense;"future"===n&&1!==t.sign&&(t=qi),"past"===n&&-1!==t.sign&&(t=qi);const[i,o]=function(t,e){const n=Ai(t,e);if(n.blank)return[0,"second"];for(const t of wi){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)},Hi=function(t){const e=new Intl.DateTimeFormat(Pi(this,Li,"a",Mi),{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 Ki="undefined"!=typeof globalThis?globalThis:window;try{Ki.RelativeTimeElement=RelativeTimeElement.define()}catch(t){if(!(Ki.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function ji(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{static define(t="tab-container",e=customElements){return e.define(t,this),this}connectedCallback(){this.addEventListener("keydown",(t=>{var e;const n=t.target;if(!(n instanceof HTMLElement))return;if(n.closest(this.tagName)!==this)return;if("tab"!==n.getAttribute("role")&&!n.closest('[role="tablist"]'))return;const i=ji(this),o=i.indexOf(i.find((t=>t.matches('[aria-selected="true"]')))),[s,r]="vertical"===(null===(e=n.closest('[role="tablist"]'))||void 0===e?void 0:e.getAttribute("aria-orientation"))?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(s.some((e=>t.code===e))){let t=o+1;t>=i.length&&(t=0),this.selectTab(t)}else if(r.some((e=>t.code===e))){let t=o-1;t<0&&(t=i.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(i.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=ji(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const n=t.target.closest('[role="tab"]');if(!(n instanceof HTMLElement&&n.closest('[role="tablist"]')))return;const i=e.indexOf(n);this.selectTab(i)}));for(const t of ji(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=ji(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}}))}}}const zi="undefined"!=typeof globalThis?globalThis:window;try{zi.TabContainerElement=TabContainerElement.define()}catch(t){if(!(zi.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}let Vi=class PrimerMultiInputElement extends HTMLElement{activateField(t){const e=this.findField(t);if(e){for(const t of this.fields)t!==e&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),t.parentElement?.setAttribute("hidden","hidden"));e.removeAttribute("disabled"),e.removeAttribute("hidden"),e.parentElement?.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function Yi(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})}f([P],Vi.prototype,"fields",void 0),Vi=f([R],Vi),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:Vi}),window.customElements.define("primer-multi-input",Vi));var Ui,Xi=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)},Gi=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 _i=new WeakMap;class Ji extends Event{constructor(t){super(`auto-check-${t}`,{bubbles:!0}),this.phase=t}get detail(){return this}}class Zi extends Ji{constructor(t,e=""){super(t),this.phase=t,this.message=e,this.setValidity=t=>{this.message=t}}}class Qi extends Ji{constructor(){super("complete")}}class to extends Ji{constructor(t){super("success"),this.response=t}}class eo extends Zi{constructor(){super("start","Verifying…")}}class no extends Zi{constructor(t){super("error","Validation failed"),this.response=t}}class io extends Ji{constructor(t){super("send"),this.body=t}}class AutoCheckElement extends HTMLElement{constructor(){super(...arguments),Ui.set(this,null)}static define(t="auto-check",e=customElements){return e.define(t,this),this}get onloadend(){return Xi(this,Ui,"f")}set onloadend(t){Xi(this,Ui,"f")&&this.removeEventListener("loadend",Xi(this,Ui,"f")),Gi(this,Ui,"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=Yi(so.bind(null,this),300),n={check:e,controller:null};_i.set(this,n),t.addEventListener("input",oo),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=_i.get(this);e&&(_i.delete(this),t.removeEventListener("input",oo),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 oo(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=_i.get(n);if(!i||!o||!s)return;const r=new eo;e.dispatchEvent(r),n.required&&e.setCustomValidity(r.message)}async function so(t){const e=t.input;if(!e)return;const n=t.csrfField,i=t.src,o=t.csrf,s=_i.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 io(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 to(n.clone()));else{const i=new no(n.clone());e.dispatchEvent(i),t.required&&e.setCustomValidity(i.message)}s.controller=null,e.dispatchEvent(new Qi)}catch(t){"AbortError"!==t.name&&(s.controller=null,e.dispatchEvent(new Qi))}}Ui=new WeakMap;const ro="undefined"!=typeof globalThis?globalThis:window;try{ro.AutoCheckElement=AutoCheckElement.define()}catch(t){if(!(ro.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}var ao;let lo=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),ao.set(this,void 0)}connectedCallback(){p(this,ao,"f")?.abort();const{signal:t}=m(this,ao,new AbortController,"f");this.addEventListener("auto-check-success",(async t=>{const e=await t.detail.response.text();e&&e.length>0?this.setSuccess(e):this.clearError()}),{signal:t}),this.addEventListener("auto-check-error",(async t=>{const e=await t.detail.response.text();this.setError(e)}),{signal:t})}disconnectedCallback(){p(this,ao,"f")?.abort()}clearContents(){this.inputElement.value="",this.inputElement.focus()}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.replaceChildren()}setValidationMessage(t){const e=document.createElement("template");e.innerHTML=t;const n=document.importNode(e.content,!0);this.validationMessageElement.replaceChildren(n)}toggleValidationStyling(t){t?this.validationElement.classList.remove("FormControl-inlineValidation--success"):this.validationElement.classList.add("FormControl-inlineValidation--success"),this.validationSuccessIcon.hidden=t,this.validationErrorIcon.hidden=!t,this.inputElement.setAttribute("invalid",t?"true":"false")}setSuccess(t){this.toggleValidationStyling(!1),this.setValidationMessage(t),this.validationElement.hidden=!1}setError(t){this.toggleValidationStyling(!0),this.setValidationMessage(t),this.validationElement.hidden=!1}};ao=new WeakMap,f([O],lo.prototype,"inputElement",void 0),f([O],lo.prototype,"validationElement",void 0),f([O],lo.prototype,"validationMessageElement",void 0),f([O],lo.prototype,"validationSuccessIcon",void 0),f([O],lo.prototype,"validationErrorIcon",void 0),lo=f([R],lo);let co=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 uo,ho,fo,po,mo,go,bo,vo,wo,yo,Eo,Ao,Lo,ko,To,Mo,So,xo,Co,Do,Io,Ho,Oo,Po;f([O],co.prototype,"validationElement",void 0),f([O],co.prototype,"validationMessageElement",void 0),co=f([R],co);const Ro=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]'],Wo=Ro.map((t=>`:not([hidden]) > ${t}`));let qo=class ActionMenuElement extends HTMLElement{constructor(){super(...arguments),uo.add(this),ho.set(this,void 0),fo.set(this,""),po.set(this,""),mo.set(this,!1)}get selectVariant(){return this.getAttribute("data-select-variant")}set selectVariant(t){t?this.setAttribute("data-select-variant",t):this.removeAttribute("variant")}get dynamicLabelPrefix(){const t=this.getAttribute("data-dynamic-label-prefix");return t?`${t}:`:""}set dynamicLabelPrefix(t){this.setAttribute("data-dynamic-label",t)}get dynamicLabel(){return this.hasAttribute("data-dynamic-label")}set dynamicLabel(t){this.toggleAttribute("data-dynamic-label",t)}get popoverElement(){return this.invokerElement?.popoverTargetElement||null}get invokerElement(){const t=this.querySelector("[role=menu]")?.id;if(!t)return null;for(const e of this.querySelectorAll("[aria-controls]"))if(e.getAttribute("aria-controls")===t)return e;return null}get invokerLabel(){return this.invokerElement?this.invokerElement.querySelector(".Button-label"):null}get selectedItems(){const t=this.querySelectorAll("[aria-checked=true]"),e=[];for(const n of t){const t=n.querySelector(".ActionListItem-label");e.push({label:t?.textContent,value:n?.getAttribute("data-value"),element:n})}return e}connectedCallback(){const{signal:t}=m(this,ho,new AbortController,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusout",this,{signal:t}),this.addEventListener("mousedown",this,{signal:t}),this.popoverElement?.addEventListener("toggle",this,{signal:t}),p(this,uo,"m",Ho).call(this),p(this,uo,"m",Oo).call(this),p(this,uo,"m",go).call(this),this.includeFragment&&this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t})}disconnectedCallback(){p(this,ho,"f").abort()}handleEvent(t){const e=this.invokerElement?.contains(t.target),n=p(this,uo,"m",Ao).call(this,t);if("toggle"===t.type&&"open"===t.newState&&p(this,uo,"a",Po)?.focus(),e&&"mousedown"===t.type)return void m(this,mo,!0,"f");if("mousedown"===t.type)return void t.preventDefault();if(e&&n)return p(this,uo,"m",Lo).call(this,t),void m(this,mo,!1,"f");if("focusout"===t.type){if(p(this,mo,"f"))return;return void requestAnimationFrame((()=>{this.contains(document.activeElement)&&document.activeElement!==this.invokerElement||p(this,uo,"m",xo).call(this)}))}const i=t.target.closest(Wo.join(","));if(null!==i&&n){if(p(this,uo,"m",bo).call(this,t))return;const e=i.closest("[data-show-dialog-id]");if(e){const n=this.ownerDocument.getElementById(e.getAttribute("data-show-dialog-id")||"");if(n&&this.contains(e)&&this.contains(n))return void p(this,uo,"m",ko).call(this,t,n)}return p(this,uo,"m",Mo).call(this,t,i),p(this,uo,"m",To).call(this,i),void(p(this,uo,"m",yo).call(this,t)&&(t.preventDefault(),"submit"===i.getAttribute("type")&&i.closest("form")?.submit()))}"include-fragment-replaced"===t.type&&p(this,uo,"m",So).call(this)}get items(){return Array.from(this.querySelectorAll(Wo.join(",")))}getItemById(t){return this.querySelector(`li[data-item-id="${t}"`)}isItemDisabled(t){return!!t&&t.classList.contains("ActionListItem--disabled")}disableItem(t){t&&(t.classList.add("ActionListItem--disabled"),t.querySelector(".ActionListContent").setAttribute("aria-disabled","true"))}enableItem(t){t&&(t.classList.remove("ActionListItem--disabled"),t.querySelector(".ActionListContent").removeAttribute("aria-disabled"))}isItemHidden(t){return!!t&&t.hasAttribute("hidden")}hideItem(t){t&&t.setAttribute("hidden","hidden")}showItem(t){t&&t.removeAttribute("hidden")}isItemChecked(t){return!!t&&"true"===t.querySelector(".ActionListContent").getAttribute("aria-checked")}checkItem(t){if(t&&("single"===this.selectVariant||"multiple"===this.selectVariant)){const e=t.querySelector(".ActionListContent");"true"===e.getAttribute("aria-checked")||p(this,uo,"m",To).call(this,e)}}uncheckItem(t){if(t&&("single"===this.selectVariant||"multiple"===this.selectVariant)){const e=t.querySelector(".ActionListContent");"true"===e.getAttribute("aria-checked")&&p(this,uo,"m",To).call(this,e)}}};ho=new WeakMap,fo=new WeakMap,po=new WeakMap,mo=new WeakMap,uo=new WeakSet,go=function(){const{signal:t}=p(this,ho,"f");for(const e of this.querySelectorAll(Ro.join(",")))e.addEventListener("click",p(this,uo,"m",bo).bind(this),{signal:t}),e.addEventListener("keydown",p(this,uo,"m",bo).bind(this),{signal:t})},bo=function(t){if(!p(this,uo,"m",Ao).call(this,t))return!1;const e=t.target.closest(Wo.join(","));return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},vo=function(t){return p(this,uo,"m",wo).call(this,t)||p(this,uo,"m",yo).call(this,t)},wo=function(t){return t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&"Enter"===t.key},yo=function(t){return t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},Eo=function(t){return t instanceof MouseEvent&&"click"===t.type},Ao=function(t){return p(this,uo,"m",Eo).call(this,t)||p(this,uo,"m",vo).call(this,t)},Lo=function(t){t.preventDefault(),t.stopPropagation(),p(this,uo,"m",Io).call(this)?p(this,uo,"m",Do).call(this):p(this,uo,"m",Co).call(this)},ko=function(t,e){this.querySelector(".ActionListWrap").style.display="none";const n=new AbortController,{signal:i}=n,o=()=>{n.abort(),this.querySelector(".ActionListWrap").style.display="",p(this,uo,"m",Io).call(this)&&p(this,uo,"m",Do).call(this);const t=this.ownerDocument.activeElement,e=this.ownerDocument.activeElement===this.ownerDocument.body,i=this.contains(t);(e||i)&&setTimeout((()=>this.invokerElement?.focus()),0)};e.addEventListener("close",o,{signal:i}),e.addEventListener("cancel",o,{signal:i})},To=function(t){if("multiple"!==this.selectVariant&&setTimeout((()=>{p(this,uo,"m",Io).call(this)&&p(this,uo,"m",Do).call(this)})),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e="true"!==t.getAttribute("aria-checked");if("single"===this.selectVariant){e&&t.setAttribute("aria-checked","true");for(const e of this.querySelectorAll("[aria-checked]"))e!==t&&e.setAttribute("aria-checked","false");p(this,uo,"m",Ho).call(this)}else t.setAttribute("aria-checked",`${e}`);p(this,uo,"m",Oo).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{detail:{item:t.parentElement,checked:this.isItemChecked(t.parentElement)}}))},Mo=function(t,e){if(t instanceof MouseEvent&&"click"===t.type||t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&"Enter"===t.key)return;t.stopPropagation();e.click()},So=function(){p(this,uo,"a",Po)&&p(this,uo,"a",Po).focus(),p(this,uo,"m",go).call(this)},xo=function(){p(this,uo,"m",Do).call(this)},Co=function(){this.popoverElement?.showPopover()},Do=function(){this.popoverElement?.hidePopover()},Io=function(){return this.popoverElement?.matches(":popover-open")},Ho=function(){if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;m(this,fo,p(this,fo,"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=p(this,fo,"f")},Oo=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&&m(this,po,p(this,po,"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=p(this,po,"f"),n.value=(e.value||e.label||"").trim(),t.append(n)}for(const t of e)t.remove()}},Po=function(){return this.querySelector(Wo.join(","))},f([O],qo.prototype,"includeFragment",void 0),qo=f([R],qo),window.customElements.get("action-menu")||(window.ActionMenuElement=qo,window.customElements.define("action-menu",qo))}();
2
2
  //# sourceMappingURL=primer_view_components.js.map