primer_view_components 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/app/assets/javascripts/primer_view_components.js +1 -1
  4. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  5. data/app/assets/styles/primer_view_components.css +1 -1
  6. data/app/assets/styles/primer_view_components.css.map +1 -1
  7. data/app/components/primer/alpha/action_list/divider.rb +2 -2
  8. data/app/components/primer/alpha/action_list/heading.html.erb +1 -1
  9. data/app/components/primer/alpha/action_list/heading.rb +10 -4
  10. data/app/components/primer/alpha/action_list/item.rb +3 -3
  11. data/app/components/primer/alpha/action_list.html.erb +6 -8
  12. data/app/components/primer/alpha/action_list.rb +5 -10
  13. data/app/components/primer/alpha/nav_list/{section.rb → group.rb} +5 -5
  14. data/app/components/primer/alpha/nav_list/item.html.erb +1 -1
  15. data/app/components/primer/alpha/nav_list/item.rb +15 -1
  16. data/app/components/primer/alpha/nav_list.d.ts +1 -0
  17. data/app/components/primer/alpha/nav_list.html.erb +8 -8
  18. data/app/components/primer/alpha/nav_list.js +21 -0
  19. data/app/components/primer/alpha/nav_list.rb +28 -32
  20. data/app/components/primer/alpha/nav_list.ts +23 -0
  21. data/app/components/primer/alpha/navigation/tab.rb +168 -0
  22. data/app/components/primer/alpha/overlay.rb +19 -6
  23. data/app/components/primer/alpha/tab_nav.rb +10 -3
  24. data/app/components/primer/alpha/tab_panels.rb +2 -2
  25. data/app/components/primer/alpha/underline_nav.css +1 -1
  26. data/app/components/primer/alpha/underline_nav.css.map +1 -1
  27. data/app/components/primer/alpha/underline_nav.pcss +1 -0
  28. data/app/components/primer/alpha/underline_nav.rb +2 -2
  29. data/app/components/primer/alpha/underline_panels.rb +2 -2
  30. data/app/components/primer/beta/button.html.erb +1 -1
  31. data/app/components/primer/beta/button.rb +2 -1
  32. data/app/components/primer/component.rb +34 -0
  33. data/app/components/primer/navigation/tab_component.rb +3 -157
  34. data/lib/primer/deprecations.yml +4 -0
  35. data/lib/primer/view_components/version.rb +1 -1
  36. data/lib/primer/yard/component_manifest.rb +2 -1
  37. data/lib/tasks/docs.rake +1 -1
  38. data/previews/primer/alpha/action_list_preview.rb +6 -14
  39. data/previews/primer/alpha/nav_list_preview/trailing_action.html.erb +19 -0
  40. data/previews/primer/alpha/nav_list_preview.rb +19 -30
  41. data/previews/primer/alpha/overlay_preview.rb +7 -2
  42. data/previews/primer/alpha/tab_nav_preview/with_extra.html.erb +8 -0
  43. data/previews/primer/alpha/tab_nav_preview.rb +5 -0
  44. data/previews/primer/alpha/tab_panels_preview/with_extra.html.erb +17 -0
  45. data/previews/primer/alpha/tab_panels_preview.rb +5 -0
  46. data/static/arguments.json +63 -7
  47. data/static/audited_at.json +2 -1
  48. data/static/constants.json +20 -8
  49. data/static/previews.json +10 -0
  50. data/static/statuses.json +3 -2
  51. metadata +8 -6
  52. data/app/components/primer/alpha/nav_list/section.html.erb +0 -3
  53. data/previews/primer/alpha/action_list_preview/heading.html.erb +0 -4
  54. /data/app/components/primer/{navigation/tab_component.html.erb → alpha/navigation/tab.html.erb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5cb9529bccad05d18efe17ce2767a69287cef77feec54b88415fe3436ab23e6b
4
- data.tar.gz: ed9cc214cf242332e0ca9c3cddc9a9fb9b1018ccb7a9fdd24c1e5e353b1f89ef
3
+ metadata.gz: 0cca2ca82c0341d15cc2e2b1000b2b9a5dc4ba10e6c08f80c33df9038847b207
4
+ data.tar.gz: 61cd29883163ab979c8beb7064fd71441b19b385e495b8558509ea7bb2f4d368
5
5
  SHA512:
6
- metadata.gz: cb0dcd9f9f36bf5c3e394122b0dc299a1f5bc240cb87a7a0f710e6c8f980f362bc5d716ca7de8ecff00b1120dde9ff42e36d51044671162a7010368a4f9a2587
7
- data.tar.gz: f747e39fee7b3d08f7122ebc26fae53aa81746a7c3748a7b42df2aadde11f95204dc6c38ed72ea29882b8987b66b20d647d4a6bb9308819ee5aade213406807a
6
+ metadata.gz: e6c4e8f99950224f26183abd3068831ced911014541f57e14583bf7765c4c94aa9dfafd592363496778d0c551f73075fd2faeab3943c1e6e0962eb5f8294a3d7
7
+ data.tar.gz: f3cf0be3742e206b41b52018f4d8d480a33c2d32ef7cceb5a1343b4269ed5d38a5e8609edd05171145124ce1932ff3d9e37a795ffd2f0b9811be0460a13b0e25
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1864](https://github.com/primer/view_components/pull/1864) [`1476b869`](https://github.com/primer/view_components/commit/1476b869db27a6ed50b7e8d83db6ef475efb31de) Thanks [@simurai](https://github.com/simurai)! - Fix underline of UnderlineNav being cut off when followed by a flash banner
8
+
9
+ * [#1865](https://github.com/primer/view_components/pull/1865) [`df8dcced`](https://github.com/primer/view_components/commit/df8dcceda484c2582f9085e11e5678c1f0bd446d) Thanks [@keithamus](https://github.com/keithamus)! - Add aria attributes to Overlay show_button
10
+
11
+ - [#1865](https://github.com/primer/view_components/pull/1865) [`df8dcced`](https://github.com/primer/view_components/commit/df8dcceda484c2582f9085e11e5678c1f0bd446d) Thanks [@keithamus](https://github.com/keithamus)! - Allow for IconButtons in overlay show_button
12
+
13
+ * [#1867](https://github.com/primer/view_components/pull/1867) [`c6bfce04`](https://github.com/primer/view_components/commit/c6bfce043a9cf197a7b212e96bc0178bc5310246) Thanks [@jonrohan](https://github.com/jonrohan)! - Fixing TabNav double render of extra content
14
+
15
+ - [#1828](https://github.com/primer/view_components/pull/1828) [`4e6201d4`](https://github.com/primer/view_components/commit/4e6201d4307f923f24a2fd04b6bb30ddb1cf5337) Thanks [@camertron](https://github.com/camertron)! - Address accessibility issues in NavList and ActionList
16
+
17
+ * [#1730](https://github.com/primer/view_components/pull/1730) [`8c77e133`](https://github.com/primer/view_components/commit/8c77e133ba2507e6dd70d0666ea78b50a57d4144) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Move Primer::Navigation::TabComponent to Primer::Alpha::Navigation::Tab
18
+
19
+ - [#1850](https://github.com/primer/view_components/pull/1850) [`a909eae0`](https://github.com/primer/view_components/commit/a909eae016c1716387799c76a00019b5a03cc25c) Thanks [@mayamessinger](https://github.com/mayamessinger)! - Fix beta button tooltip compatibility with display :block
20
+
21
+ * [#1847](https://github.com/primer/view_components/pull/1847) [`16b16264`](https://github.com/primer/view_components/commit/16b162646fb51422d6604addbd27cb6bf0978106) Thanks [@keithamus](https://github.com/keithamus)! - Remove animation from Overlay component
22
+
3
23
  ## 0.1.0
4
24
 
5
25
  ### Minor Changes
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var t=new Set,e=t=>e=>{e instanceof HTMLElement&&(e.hasAttribute("popover")&&t(e),e.querySelectorAll("[popover]").forEach((e=>{e instanceof HTMLElement&&t(e)})))},n=e(t.add.bind(t)),i=e(t.delete.bind(t)),o=new MutationObserver((e=>{e.forEach((e=>{switch(e.type){case"attributes":switch(e.attributeName){case"popover":(e=>{e.target instanceof HTMLElement&&(e.target.hasAttribute("popover")?t.add(e.target):t.delete(e.target))})(e)}break;case"childList":(t=>{t.addedNodes.length>0&&t.addedNodes.forEach(n),t.removedNodes.length>0&&t.removedNodes.forEach(i)})(e)}}))})),s=e=>{e===document&&e.querySelectorAll("[popover]").forEach((e=>{e instanceof HTMLElement&&t.add(e)})),o.observe(e,{attributeFilter:["popover"],childList:!0,subtree:!0})};function r(t){const e=Element.prototype.attachShadow;Element.prototype.attachShadow=function(n){const i=e.call(this,n);return t(i),i}}var a=(t,e)=>{const n=e.closest(t);if(n)return n;const i=e.getRootNode();return i!==document&&i instanceof ShadowRoot?a(t,i.host):null};"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){const e=new WeakSet;function n(t,n){if(!function(t,n){return!("auto"!==t.popover&&"manual"!==t.popover||!t.isConnected||t instanceof HTMLDialogElement&&t.hasAttribute("open")||n&&!e.has(t)||!n&&e.has(t)||document.fullscreenElement===t)}(t,n))throw new DOMException("Cannot show or hide popover on invalid or already visible element","InvalidStateError")}class i extends Event{constructor(t,{currentState:e="",newState:n="",...i}={}){super(t,i),this.currentState=String(e||""),this.newState=String(n||"")}}window.BeforeToggleEvent=window.BeforeToggleEvent||i,Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){const t=(this.getAttribute("popover")||"").toLowerCase();return"manual"===t?"manual":""===t||"auto"==t?"auto":null},set(t){this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(){n(this,!1);const t=new i("beforetoggle",{cancelable:!0,currentState:"closed",newState:"open"});if(this.dispatchEvent(t)&&(n(this,!1),this.classList.add(":open"),e.add(this),"auto"===this.popover)){(this.hasAttribute("autofocus")?this:this.querySelector("[autofocus]"))?.focus()}}},hidePopover:{enumerable:!0,configurable:!0,value(){n(this,!0),this.dispatchEvent(new i("beforetoggle",{cancelable:!1,currentState:"open",newState:"closed"})),n(this,!0),this.classList.remove(":open"),e.delete(this)}}});const o=(l=n=>{const i=n.target;if(!(i instanceof Element)||i?.shadowRoot)return;const o=i.getRootNode();if(!(o instanceof ShadowRoot||o instanceof Document))return;let s=a("[popover]",i);const r=i.closest("[popovertoggletarget],[popoverhidetarget],[popovershowtarget]"),l=r instanceof HTMLButtonElement;l&&r.hasAttribute("popovershowtarget")?(s=o.getElementById(r.getAttribute("popovershowtarget")||""),s&&s.popover&&!e.has(s)&&s.showPopover()):l&&r.hasAttribute("popoverhidetarget")?(s=o.getElementById(r.getAttribute("popoverhidetarget")||""),s&&s.popover&&e.has(s)&&s.hidePopover()):l&&r.hasAttribute("popovertoggletarget")&&(s=o.getElementById(r.getAttribute("popovertoggletarget")||""),s&&s.popover&&(e.has(s)?s.hidePopover():s.showPopover()));for(const e of[...t])e.matches('[popover="" i].\\:open, [popover=auto i].\\:open')&&e!==s&&e.hidePopover()},t=>{t.addEventListener("click",l)});var l;s(document),o(document),r(s),r(o)}();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=[u(t,"compositionstart",(t=>y(this,t))),u(t,"compositionend",(t=>y(this,t))),u(t,"click",(e=>b(t,e))),u(t,"change",(e=>b(t,e))),u(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=l.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")&&(w(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=m(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=m(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(p&&n.ctrlKey){const e=m(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(p&&n.ctrlKey){const e=m(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&v(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),u(t,"toggle",(()=>d(t,this)),{once:!0}),u(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?u(t,"mouseover",(()=>d(t,this)),{once:!0}):c,...h(t)];l.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=l.get(this);if(t){l.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const l=new WeakMap,c={unsubscribe(){}};function u(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function d(t,e){const n=e.getAttribute("src");if(!n)return;const i=l.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",(()=>f(t))),o.setAttribute("src",n))}function h(t){let e=!1;return[u(t,"mousedown",(()=>e=!0)),u(t,"keydown",(()=>e=!1)),u(t,"toggle",(()=>{t.hasAttribute("open")&&(f(t)||e||function(t){const e=document.activeElement;if(e&&v(e)&&t.contains(e))return;const n=m(t,!0);n&&n.focus()}(t))}))]}function f(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function m(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 p=navigator.userAgent.match(/Macintosh/);function b(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||g(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&g(e,t)}}function g(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")&&w(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function v(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function w(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function y(t,e){const n=l.get(t);n&&(n.isComposing="compositionstart"===e.type)}function E(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 A(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 L(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const k={"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"]},T={start:["end","center"],end:["start","center"],center:["end","start"]};function M(t,e,n={}){const i=function(t){let e=t.parentNode;for(;null!==e;){if(e instanceof HTMLElement&&"static"!==getComputedStyle(e).position)return e;e=e.parentNode}return document.body}(t),o=function(t){let e=t;for(;null!==e&&e!==document.body;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const n=e!==document.body&&e instanceof HTMLElement?e:document.body,i=n.getBoundingClientRect(),o=getComputedStyle(n),[s,r,a,l]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:i.top+s,left:i.left+r,width:i.width-a-r,height:Math.max(i.height-s-l,n===document.body?window.innerHeight:-1/0)}}(i),s=getComputedStyle(i),r=i.getBoundingClientRect(),[a,l]=[s.borderTopWidth,s.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,i,{side:o,align:s,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:l}){const c={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let u=O(n,i,o,s,a,l),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=k[o];let f=0;if(r){let t=o;for(;f<r.length&&H(t,u,c,n);){const o=r[f++];t=o,u=O(n,i,o,s,a,l),u.top-=e.top,u.left-=e.left,d=o}}const m=T[s];let p=0;if(m){let t=s;for(;p<m.length&&R(t,u,c,n);){const o=m[p++];t=o,u=O(n,i,d,o,a,l),u.top-=e.top,u.left-=e.left,h=o}}u.top<c.top&&(u.top=c.top),u.left<c.left&&(u.left=c.left),u.left+n.width>t.width+c.left&&(u.left=t.width+c.left-n.width),r&&f<r.length&&u.top+n.height>t.height+c.top&&(u.top=t.height+c.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(o,{top:r.top+a,left:r.left+l},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,i,o,s;const r=null!==(e=t.side)&&void 0!==e?e:S,a=null!==(n=t.align)&&void 0!==n?n:C;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:x,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?I:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:D}}(n))}const S="outside-bottom",C="start",x=4,I=4,D=!1;function O(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 H(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 R(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 P(t,e=!1){return function*(t,e={}){var n,i;const o=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(i=e.onlyTabbable)&&void 0!==i&&i?q:F,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&s(t,o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&s(t,o)&&(yield t),e.reverse){let t=r.lastChild();for(;t;)a=t,t=r.lastChild()}else a=r.firstChild();for(;a instanceof HTMLElement;)yield a,a=e.reverse?r.previousNode():r.nextNode();e.reverse&&s(t,o)&&(yield t)}(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function F(t,e=!1){const n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,i=t.hidden,o=t instanceof HTMLInputElement&&"hidden"===t.type,s=t.classList.contains("sentinel");if(n||i||o||s)return!1;if(e){const e=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(getComputedStyle(t).visibility),i=0===t.getClientRects().length;if(e||n||i)return!1}return null!=t.getAttribute("tabindex")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex}function q(t,e=!1){return F(t,e)&&"-1"!==t.getAttribute("tabindex")}let $=!1;function N(){}try{const t=Object.create({},{signal:{get(){$=!0}}});window.addEventListener("test",N,t),window.removeEventListener("test",N,t)}catch(t){}$||(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);const W=[];let B;function j(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=P(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&&q(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=P(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=P(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(B){const t=B;B.container.setAttribute("data-focus-trap","suspended"),B.controller.abort(),W.push(t)}c.signal.addEventListener("abort",(()=>{B=void 0})),o.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=W.findIndex((e=>e.container===t));n>=0&&W.splice(n,1),function(){const t=W.pop();t&&j(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{l(t.target)}),{signal:c.signal,capture:!0}),l(document.activeElement),B={container:t,controller:c,initialFocus:e,originalSignal:o};const u=W.findIndex((e=>e.container===t));if(u>=0&&W.splice(u,1),!n)return i}var Y,X;const K=(()=>{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),Y.set(this,null),X.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(A(this,Y,"f"))return A(this,Y,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){L(this,Y,t,"f"),A(this,Y,"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())),K(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(A(this,X,"f")),L(this,X,requestAnimationFrame((()=>{const t=this.anchorElement;if(!t)return;const{left:e,top:n,anchorSide:i,anchorAlign:o}=M(this,t,this);this.style.top=`${n}px`,this.style.left=`${e}px`,this.classList.remove("Overlay--anchorAlign-start","Overlay--anchorAlign-center","Overlay--anchorAlign-end","Overlay--anchorSide-insideTop","Overlay--anchorSide-insideBottom","Overlay--anchorSide-insideLeft","Overlay--anchorSide-insideRight","Overlay--anchorSide-insideCenter","Overlay--anchorSide-outsideTop","Overlay--anchorSide-outsideLeft","Overlay--anchorSide-outsideRight"),this.classList.add(`Overlay--anchorAlign-${o}`,`Overlay--anchorSide-${i}`)})),"f"))}}Y=new WeakMap,X=new WeakMap,AnchoredPositionElement.observedAttributes=["align","side","anchor","alignment-offset","allow-out-of-bounds"],customElements.get("anchored-position")||(window.AnchoredPositionElement=AnchoredPositionElement,customElements.define("anchored-position",AnchoredPositionElement));const V=new WeakMap,z=new WeakMap,U=new WeakMap;function Z(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=U.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(z.has(e)&&t instanceof MouseEvent){const n=z.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(z.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=z.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`,nt(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)z.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];z.set(e,{dragStartX:n,dragStartY:i})}}function _(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=G(e);if(!(n instanceof ImageCropElement))return;const{box:i}=U.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return tt(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,V.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=V.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=V.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&&Q(n,s,r,!(t instanceof KeyboardEvent))}function G(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function J(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=G(e);if(!(n instanceof ImageCropElement))return;const{box:i}=U.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",_),n.addEventListener("touchmove",_,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),V.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),_(t)}else n.addEventListener("mousemove",Z),n.addEventListener("touchmove",Z,{passive:!0})}function Q(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=V.get(t);if(!s)return;const{box:r,image:a}=U.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`,nt(t,{x:l,y:c,width:o,height:o})}function tt(t){const{image:e}=U.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);V.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),Q(t,n,n)}function et(t){const e=t.currentTarget;e instanceof ImageCropElement&&(z.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",_),e.removeEventListener("mousemove",Z),e.removeEventListener("touchmove",_),e.removeEventListener("touchmove",Z))}function nt(t,e){const{image:n}=U.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(U.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&&(U.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,tt(this)})),this.addEventListener("mouseleave",et),this.addEventListener("touchend",et),this.addEventListener("mouseup",et),e.addEventListener("mousedown",J),e.addEventListener("touchstart",J,{passive:!0}),this.addEventListener("keydown",Z),this.addEventListener("keydown",_),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}=U.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}var it,ot,st,rt;function at(t){document.activeElement!==t&&(null==t||t.focus())}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const lt=[];function ct(t){const e=t.target,n=null==e?void 0:e.closest("button");if(!n)return;let i=null==n?void 0:n.getAttribute("data-show-dialog-id");if(i){t.stopPropagation();const e=document.getElementById(i);if(e instanceof ModalDialogElement)return e.openButton=n,void e.show()}const o=lt[lt.length-1];o&&(i=n.getAttribute("data-close-dialog-id"),i===o.id&&(lt.pop(),o.close()),i=n.getAttribute("data-submit-dialog-id"),i===o.id&&(lt.pop(),o.close(!0)))}function ut(t){const e=t.target;if(null==e?void 0:e.closest("button"))return;const n=lt[lt.length-1];if(!n)return;!e.closest(`#${n.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",(t=>{t.target===e&&(lt.pop(),n.close())}),{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),it.add(this),ot.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){var e,n,i,o;if(t){if(this.open)return;this.setAttribute("open",""),null===(e=A(this,it,"a",st))||void 0===e||e.classList.remove("Overlay--hidden"),document.body.style.paddingRight=window.innerWidth-document.body.clientWidth+"px",document.body.style.overflow="hidden",A(this,ot,"f").signal.aborted&&L(this,ot,new AbortController,"f"),j(this,void 0,A(this,ot,"f").signal),lt.push(this)}else{if(!this.open)return;this.removeAttribute("open"),null===(n=A(this,it,"a",st))||void 0===n||n.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",A(this,ot,"f").abort();const t=(null===(i=this.openButton)||void 0===i?void 0:i.closest("details"))||(null===(o=this.openButton)||void 0===o?void 0:o.closest("action-menu"));at(t?P(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",ct),document.addEventListener("mousedown",ut),this.addEventListener("keydown",(t=>A(this,it,"m",rt).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}}ot=new WeakMap,it=new WeakSet,st=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},rt=function(t){if(t instanceof KeyboardEvent&&!t.isComposing)switch(t.key){case"Escape":this.open&&(this.close(),t.preventDefault(),t.stopPropagation())}},window.customElements.get("modal-dialog")||(window.ModalDialogElement=ModalDialogElement,window.customElements.define("modal-dialog",ModalDialogElement));const dt=new WeakSet;function ht(t){pt(t),mt(t)}const ft=new WeakMap;function mt(t=document){if(ft.has(t))return ft.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)vt(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&pt(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const i={get closed(){return e},unsubscribe(){e=!0,ft.delete(t),n.disconnect()}};return ft.set(t,i),i}function pt(t){for(const e of t.querySelectorAll("[data-action]"))vt(e);t instanceof Element&&t.hasAttribute("data-action")&&vt(t)}function bt(t){const e=t.currentTarget;for(const n of gt(e))if(t.type===n.type){const i=e.closest(n.tag);dt.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const o=e.getRootNode();if(o instanceof ShadowRoot&&dt.has(o.host)&&o.host.matches(n.tag)){const e=o.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*gt(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 vt(t){for(const e of gt(t))t.addEventListener(e.type,bt)}const wt=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),yt=(t,e="property")=>{const n=wt(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const Et="attr",At=new WeakSet;function Lt(t,e){if(At.has(t))return;At.add(t);const n=Object.getPrototypeOf(t),i=n?.constructor?.attrPrefix??"data-";e||(e=Mt(n,Et));for(const n of e){const e=t[n],o=yt(`${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 kt=Symbol.for("catalyst");class Tt{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=>yt(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...Mt(t.prototype,Et)].map(i).concat(e),set(t){e=t}})}(t),function(t){const e=wt(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),Lt(t),function(t){dt.add(t),t.shadowRoot&&ht(t.shadowRoot),pt(t),mt(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&ht(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,i,o){Lt(t),"data-catalyst"!==e&&o&&o.call(t,e,n,i)}}function Mt(t,e){if(!Object.prototype.hasOwnProperty.call(t,kt)){const e=t[kt],n=t[kt]=new Map;if(e)for(const[t,i]of e)n.set(t,new Set(i))}const n=t[kt];return n.has(e)||n.set(e,new Set),n.get(e)}function St(t,e){Mt(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 Ct(t,e){Mt(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 xt(t){new Tt(t)}var It,Dt,Ot,Ht,Rt,Pt,Ft,qt;new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),new Promise((t=>{const e=new AbortController;e.signal.addEventListener("abort",(()=>t()));const n={once:!0,passive:!0,signal:e.signal},i=()=>e.abort();document.addEventListener("mousedown",i,n),document.addEventListener("touchstart",i,n),document.addEventListener("keydown",i,n),document.addEventListener("pointerdown",i,n)}));let $t=class NavListElement extends HTMLElement{constructor(){super(...arguments),It.add(this)}connectedCallback(){this.setShowMoreItemState()}get showMoreDisabled(){return this.showMoreItem.hasAttribute("aria-disabled")}set showMoreDisabled(t){t?this.showMoreItem.setAttribute("aria-disabled","true"):this.showMoreItem.removeAttribute("aria-disabled"),this.showMoreItem.classList.toggle("disabled",t)}set currentPage(t){this.showMoreItem.setAttribute("data-current-page",t.toString())}get currentPage(){return parseInt(this.showMoreItem.getAttribute("data-current-page"))||1}get totalPages(){return parseInt(this.showMoreItem.getAttribute("data-total-pages"))||1}get paginationSrc(){return this.showMoreItem.getAttribute("src")||""}selectItemById(t){if(!t)return!1;const e=A(this,It,"m",Ot).call(this,t);return!!e&&(A(this,It,"m",Pt).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=A(this,It,"m",Ht).call(this,t);return!!e&&(A(this,It,"m",Pt).call(this,e),!0)}selectItemByCurrentLocation(){const t=A(this,It,"m",Rt).call(this);return!!t&&(A(this,It,"m",Pt).call(this,t),!0)}expandItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false")}itemIsExpanded(t){return"A"===(null==t?void 0:t.tagName)||"true"===(null==t?void 0:t.getAttribute("aria-expanded"))}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=e.closest("button");n&&(this.itemIsExpanded(n)?this.collapseItem(n):this.expandItem(n),t.stopPropagation())}async showMore(t){var e,n;if(t.preventDefault(),this.showMoreDisabled)return;let i;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const e=await fetch(t);if(!e.ok)return;i=await e.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const o=A(this,It,"m",Dt).call(this,document,i);null===(e=null==o?void 0:o.querySelector("li > a"))||void 0===e||e.setAttribute("data-targets","nav-list.focusMarkers"),this.list.insertBefore(o,this.showMoreItem),null===(n=this.focusMarkers.pop())||void 0===n||n.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}};var Nt,Wt;It=new WeakSet,Dt=function(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)},Ot=function(t){var e;for(const n of this.items){if(n.classList.contains("ActionListItem--hasSubItem"))continue;if(((null===(e=n.getAttribute("data-item-id"))||void 0===e?void 0:e.split(" "))||[]).includes(t))return n}return null},Ht=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},Rt=function(){return A(this,It,"m",Ht).call(this,window.location.pathname)},Pt=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&A(this,It,"m",Ft).call(this,e),t.classList.add("ActionListItem--navActive");const n=A(this,It,"m",qt).call(this,t);n&&(this.expandItem(n),n.classList.add("ActionListContent--hasActiveSubItem"))},Ft=function(t){t.classList.remove("ActionListItem--navActive");const e=A(this,It,"m",qt).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},qt=function(t){var e;if(!t.classList.contains("ActionListItem--subItem"))return null;const n=null===(e=t.closest("li.ActionListItem--hasSubItem"))||void 0===e?void 0:e.querySelector("button.ActionListContent");return n||null},E([St],$t.prototype,"list",void 0),E([Ct],$t.prototype,"items",void 0),E([St],$t.prototype,"showMoreItem",void 0),E([Ct],$t.prototype,"focusMarkers",void 0),$t=E([xt],$t);let Bt=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),Nt.add(this)}connectedCallback(){A(this,Nt,"m",Wt).call(this)}select(t){var e,n;const i=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),null===(e=t.querySelector("[aria-current]"))||void 0===e||e.setAttribute("aria-current","false");null===(n=i.closest("li.SegmentedControl-item"))||void 0===n||n.classList.add("SegmentedControl-item--selected"),i.setAttribute("aria-current","true")}};function jt(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})}Nt=new WeakSet,Wt=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},E([Ct],Bt.prototype,"items",void 0),Bt=E([xt],Bt),window.customElements.get("segmented-control")||(window.SegmentedControlElement=Bt,window.customElements.define("segmented-control",Bt));let Yt=class ToggleSwitchElement extends HTMLElement{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}toggle(){this.isDisabled()||(this.isRemote()?(this.setLoadingState(),this.submitForm()):this.performToggle())}turnOn(){this.isDisabled()||(this.switch.setAttribute("aria-checked","true"),this.classList.add("ToggleSwitch--checked"))}turnOff(){this.isDisabled()||(this.switch.setAttribute("aria-checked","false"),this.classList.remove("ToggleSwitch--checked"))}isOn(){return"true"===this.switch.getAttribute("aria-checked")}isOff(){return!this.isOn()}isDisabled(){return"true"===this.switch.getAttribute("aria-disabled")}disable(){this.switch.setAttribute("aria-disabled","true")}enable(){this.switch.setAttribute("aria-disabled","false")}performToggle(){this.isOn()?this.turnOff():this.turnOn()}setLoadingState(){this.disable(),this.errorIcon.setAttribute("hidden","hidden"),this.loadingSpinner.removeAttribute("hidden")}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"),this.enable()}async submitForm(){const t=new FormData;this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"0":"1");try{if(!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());this.setSuccessState(),this.performToggle()}catch(t){t instanceof Error&&this.setErrorState(t.message||"An error occurred, please try again.")}}};var Xt,Kt,Vt,zt,Ut,Zt,_t,Gt,Jt;E([St],Yt.prototype,"switch",void 0),E([St],Yt.prototype,"loadingSpinner",void 0),E([St],Yt.prototype,"errorIcon",void 0),E([function(t=0,e={}){return(n,i,o)=>{if(!o||"function"!=typeof o.value)throw new Error("debounce can only decorate functions");const s=o.value;o.value=jt(s,t,e),Object.defineProperty(n,i,o)}}(300)],Yt.prototype,"submitForm",null),Yt=E([xt],Yt),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=Yt,window.customElements.define("toggle-switch",Yt));const Qt="tooltip-open",te="sr-only",ee=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class ToolTipElement extends HTMLElement{constructor(){super(...arguments),Xt.add(this),Kt.set(this,void 0),Vt.set(this,"center"),zt.set(this,"outside-bottom"),Ut.set(this,!1)}styles(){return'\n :host {\n position: absolute;\n z-index: 1000000;\n padding: .5em .75em;\n font: normal normal 11px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";\n -webkit-font-smoothing: subpixel-antialiased;\n color: var(--color-fg-on-emphasis);\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n background: var(--color-neutral-emphasis-plus);\n border-radius: 6px;\n opacity: 0;\n max-width: 250px;\n word-wrap: break-word;\n white-space: normal;\n width: max-content;\n }\n\n :host:before{\n position: absolute;\n z-index: 1000001;\n color: var(--color-neutral-emphasis-plus);\n content: "";\n border: 6px solid transparent;\n opacity: 0\n }\n\n @keyframes tooltip-appear {\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n }\n\n :host:after{\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: 12px;\n content: ""\n }\n\n :host(.tooltip-open),\n :host(.tooltip-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n animation-delay: .4s\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-n):before {\n right: 50%;\n margin-right: -6px;\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-se):before,\n :host(.tooltip-sw):before {\n bottom: 100%;\n border-bottom-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-s):after,\n :host(.tooltip-se):after,\n :host(.tooltip-sw):after {\n bottom: 100%\n }\n\n :host(.tooltip-n):before,\n :host(.tooltip-ne):before,\n :host(.tooltip-nw):before {\n top: 100%;\n border-top-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%\n }\n\n :host(.tooltip-se):before,\n :host(.tooltip-ne):before {\n left: 0;\n margin-left: 6px;\n }\n\n :host(.tooltip-sw):before,\n :host(.tooltip-nw):before {\n right: 0;\n margin-right: 6px;\n }\n\n :host(.tooltip-w):before {\n top: 50%;\n bottom: 50%;\n left: 100%;\n margin-top: -6px;\n border-left-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-e):before {\n top: 50%;\n right: 100%;\n bottom: 50%;\n margin-top: -6px;\n border-right-color: var(--color-neutral-emphasis-plus)\n }\n '}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get type(){return"label"===this.getAttribute("data-type")?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return this.getAttribute("data-direction")||"s"}set direction(t){this.setAttribute("data-direction",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}set hiddenFromView(t){this.classList.toggle(te,t),this.isConnected&&A(this,Xt,"m",Zt).call(this)}get hiddenFromView(){return this.classList.contains(te)}connectedCallback(){var t;if(A(this,Xt,"m",_t).call(this),A(this,Xt,"m",Gt).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}if(this.hiddenFromView=!0,L(this,Ut,!0,"f"),!this.control)return;this.setAttribute("role","tooltip"),null===(t=A(this,Kt,"f"))||void 0===t||t.abort(),L(this,Kt,new AbortController,"f");const{signal:e}=A(this,Kt,"f");this.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("mouseenter",this,{signal:e}),this.control.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("focus",this,{signal:e}),this.control.addEventListener("blur",this,{signal:e}),this.ownerDocument.addEventListener("keydown",this,{signal:e}),A(this,Xt,"m",Zt).call(this)}disconnectedCallback(){var t;null===(t=A(this,Kt,"f"))||void 0===t||t.abort()}handleEvent(t){this.control&&("mouseenter"!==t.type&&"focus"!==t.type||!this.hiddenFromView?"blur"===t.type||"mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hiddenFromView=!0:"keydown"!==t.type||"Escape"!==t.key||this.hiddenFromView||(this.hiddenFromView=!0):this.hiddenFromView=!1)}attributeChangedCallback(t){this.isConnected&&("id"===t||"data-type"===t?A(this,Xt,"m",_t).call(this):"data-direction"===t&&A(this,Xt,"m",Gt).call(this))}}Kt=new WeakMap,Vt=new WeakMap,zt=new WeakMap,Ut=new WeakMap,Xt=new WeakSet,Zt=function(){if(this.hiddenFromView)this.classList.remove(Qt,...ee);else{this.classList.add(Qt);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);A(this,Xt,"m",Jt).call(this)}},_t=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)}},Gt=function(){this.classList.remove(...ee);const t=this.direction;"n"===t?(L(this,Vt,"center","f"),L(this,zt,"outside-top","f")):"ne"===t?(L(this,Vt,"start","f"),L(this,zt,"outside-top","f")):"e"===t?(L(this,Vt,"center","f"),L(this,zt,"outside-right","f")):"se"===t?(L(this,Vt,"start","f"),L(this,zt,"outside-bottom","f")):"s"===t?(L(this,Vt,"center","f"),L(this,zt,"outside-bottom","f")):"sw"===t?(L(this,Vt,"end","f"),L(this,zt,"outside-bottom","f")):"w"===t?(L(this,Vt,"center","f"),L(this,zt,"outside-left","f")):"nw"===t&&(L(this,Vt,"end","f"),L(this,zt,"outside-top","f"))},Jt=function(){if(!this.control)return;if(!A(this,Ut,"f")||this.hiddenFromView)return;this.style.left="0px";const t=M(this,this.control,{side:A(this,zt,"f"),align:A(this,Vt,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.top=`${t.top}px`,this.style.left=`${t.left}px`;let i="s";i="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===n?"n":"start"===n?"ne":"nw":"center"===n?"s":"start"===n?"se":"sw",this.classList.add(`tooltip-${i}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let ne=class XBannerElement extends HTMLElement{dismiss(){if(this.shouldReappear())return this.style.setProperty("visibility","hidden"),void setTimeout((()=>{this.style.setProperty("visibility","visible")}),2e3);const t=this.parentElement;t&&t.removeChild(this)}shouldReappear(){return"true"===this.getAttribute("data-reappear")}};E([St],ne.prototype,"titleText",void 0),ne=E([xt],ne),window.customElements.get("x-banner")||(window.XBannerElement=ne,window.customElements.define("x-banner",ne));const ie=!!navigator.userAgent.match(/Macintosh/);class oe{constructor(t,e){this.input=t,this.list=e,this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=t=>function(t,e){if(t.shiftKey||t.metaKey||t.altKey)return;if(!ie&&t.ctrlKey)return;if(e.isComposing)return;switch(t.key){case"Enter":case"Tab":(function(t,e){const n=e.querySelector('[aria-selected="true"]');return!!n&&("true"===n.getAttribute("aria-disabled")||n.click(),!0)})(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":ie&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":ie&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.clearSelection()}}(t,this),this.compositionEventHandler=t=>function(t,e){e.isComposing="compositionstart"===t.type;if(!document.getElementById(e.input.getAttribute("aria-controls")||""))return;e.clearSelection()}(t,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",se)}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",se)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(re)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(re),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)s===t?(this.input.setAttribute("aria-activedescendant",s.id),s.setAttribute("aria-selected","true"),ae(this.list,s)):t.setAttribute("aria-selected","false")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.setAttribute("aria-selected","false")}}function se(t){if(!(t.target instanceof Element))return;const e=t.target.closest('[role="option"]');e&&"true"!==e.getAttribute("aria-disabled")&&function(t){t.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0}))}(e)}function re(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function ae(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 le=window.testScreenReaderDelay||100;class ce{constructor(t,e,n,i=!1){var o;if(this.container=t,this.input=e,this.results=n,this.combobox=new oe(e,n),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=i,this.clearButton=document.getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=n.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.hidden=!0,this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let n;return function(...i){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...i)}),e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(o=this.clearButton)||void 0===o||o.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),"true"===this.input.getAttribute("aria-expanded")&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.container.open=!1}onKeydown(t){if("Enter"===t.key&&this.container.open&&this.autoselectEnabled){const e=this.results.children[0];e&&(t.stopPropagation(),t.preventDefault(),this.onCommit({target:e}))}if("Escape"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.container.open=!0,t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.fetchResults()}onInputBlur(){this.interactingWithList?this.interactingWithList=!1:this.container.open=!1}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(this.container.open=!1,e instanceof HTMLAnchorElement)return;const n=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=n,n||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout((()=>{this.feedback&&(this.feedback.textContent=t)}),le)}fetchResults(){const t=this.input.value.trim();if(!t)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(this.input,n.toString()).then((t=>{this.results.innerHTML=t,this.identifyOptions();const e=this.results.querySelectorAll('[role="option"]'),n=!!e.length,i=e.length,[o]=e,s=null==o?void 0:o.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${i} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${i||"No"} results.`),this.container.open=n,this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))})).catch((()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))}))}open(){this.results.hidden&&(this.combobox.start(),this.results.hidden=!1)}close(){this.results.hidden||(this.combobox.stop(),this.results.hidden=!0)}}class ue extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const de=new WeakMap;function he(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=de.get(t);n&&n.abort();de.set(t,e);const i=()=>de.delete(t),o=function(t){return new Promise(((e,n)=>{t.onload=function(){t.status>=200&&t.status<300?e(t.responseText):n(new Error(t.responseText))},t.onerror=n,t.send()}))}(e);return o.then(i,i),o}(t,n)}const fe=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super(...arguments),this.fetchResult=he}connectedCallback(){const t=this.getAttribute("for");if(!t)return;const e=this.querySelector("input"),n=document.getElementById(t);if(!(e instanceof HTMLInputElement&&n))return;const i="true"===this.getAttribute("data-autoselect");fe.set(this,new ce(this,e,n,i)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=fe.get(this);t&&(t.destroy(),fe.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")}static get observedAttributes(){return["open","value"]}attributeChangedCallback(t,e,n){if(e===n)return;const i=fe.get(this);if(i)switch(t){case"open":null===n?i.close():i.open();break;case"value":null!==n&&(i.input.value=n),this.dispatchEvent(new ue("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function me(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 pe(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),me(n),e.removeChild(n),Promise.resolve()}function be(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)pe(n).then(i);else if(e){const n="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(n instanceof Document||"ShadowRoot"in window&&n instanceof ShadowRoot))return;const s=n.getElementById(e);s&&(o=s,o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?pe(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?pe(o.href):me(o)).then(i)}var o}function ge(t){const e=t.currentTarget;e instanceof HTMLElement&&be(e)}function ve(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),be(e))}}function we(t){t.currentTarget.addEventListener("keydown",ve)}function ye(t){t.currentTarget.removeEventListener("keydown",ve)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",ge),this.addEventListener("focus",we),this.addEventListener("blur",ye)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}window.customElements.get("clipboard-copy")||(window.ClipboardCopyElement=ClipboardCopyElement,window.customElements.define("clipboard-copy",ClipboardCopyElement));function Ee(t){t.style.display="inline-block"}function Ae(t){t.style.display="none"}const Le=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=Le.get(t);e?(clearTimeout(e),Le.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(Ae(e),Ee(n))}(t),Le.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(Ee(e),Ae(n))}(t),Le.delete(t)}),2e3))}));var ke,Te=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},Me=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 Se="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)}},Ce=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],xe={minimumIntegerDigits:2};class Ie{constructor(t,e={}){ke.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;Te(this,ke,{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 Me(this,ke,"f")}formatToParts(t){const e=[],n=Me(this,ke,"f"),i=n.style,o=n.locale;for(const[i,s]of Ce){const r=t[i];if("auto"===n[`${i}Display`]&&!r)continue;const a=n[i],l="2-digit"===a?xe:"numeric"===a?{}:{style:"unit",unit:s,unitDisplay:a};e.push(new Intl.NumberFormat(o,l).format(r))}return new Se(o,{type:"unit",style:"digital"===i?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map((t=>t.value)).join("")}}ke=new WeakMap;const De=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,Oe=["year","month","week","day","hour","minute","second","millisecond"];class He{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 He(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(De))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return o?new He(...o):new He}if("object"==typeof t){const{years:e,months:n,weeks:i,days:o,hours:s,minutes:r,seconds:a,milliseconds:l}=t;return new He(e,n,i,o,s,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const n=Date.now(),i=Math.abs(Re(n,He.from(t)).getTime()-n),o=Math.abs(Re(n,He.from(e)).getTime()-n);return i>o?-1:i<o?1:0}toLocaleString(t,e){return new Ie(t,e).format(this)}}function Re(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 Pe(t){if(t.blank)return t;let e=Math.abs(t.years),n=Math.abs(t.months),i=Math.abs(t.weeks),o=Math.abs(t.days),s=Math.abs(t.hours),r=Math.abs(t.minutes),a=Math.abs(t.seconds),l=Math.abs(t.milliseconds);l>=900&&(a+=Math.round(l/1e3)),(a||r||s||o||i||n||e)&&(l=0),a>=55&&(r+=Math.round(a/60)),(r||s||o||i||n||e)&&(a=0),r>=55&&(s+=Math.round(r/60)),(s||o||i||n||e)&&(r=0),s>=21&&(o+=Math.round(s/24)),(o||i||n||e)&&(s=0),o>=6&&(i+=Math.round(o/7)),(i||n||e)&&(o=0),i>=4&&(n+=Math.round(i/4)),(n||e)&&(i=0),n>=11&&(e+=Math.round(n/12)),e&&(n=0);const c=t.sign;return new He(e*c,n*c,i*c,o*c,s*c,r*c,a*c,l*c)}var Fe,qe,$e,Ne,We,Be,je,Ye,Xe,Ke,Ve=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)},ze=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 Ue=("undefined"!=typeof globalThis?globalThis:window).HTMLElement||null,Ze=new He,_e=new He(0,0,0,0,0,1);class Ge 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 Je(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 Qe=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=Je(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,Je(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends Ue{constructor(){super(...arguments),Fe.add(this),qe.set(this,!1),$e.set(this,!1),We.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):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 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("day",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,De.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 Oe.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(){Qe.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&ze(this,qe,null!==n&&(this.date&&Ve(this,Fe,"m",Be).call(this,this.date))!==n,"f"),Ve(this,$e,"f")||"title"===t&&Ve(this,qe,"f")||ze(this,$e,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){const t=Ve(this,We,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let n=e;const i=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!i)return void(Ve(this,We,"f").textContent=t);const o=Date.now();Ve(this,qe,"f")||(n=Ve(this,Fe,"m",Be).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 He;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=Oe.indexOf(e)||Oe.length;return new He(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=Ve(this,Fe,"m",je).call(this,s);let a=t;a="duration"===r?Ve(this,Fe,"m",Ye).call(this,s):"relative"===r?Ve(this,Fe,"m",Xe).call(this,s):Ve(this,Fe,"m",Ke).call(this,i),a?Ve(this,We,"f").textContent=a:this.shadowRoot===Ve(this,We,"f")&&this.textContent&&(Ve(this,We,"f").textContent=this.textContent),a===t&&n===e||this.dispatchEvent(new Ge(t,a,e,n)),"relative"===r||"duration"===r?Qe.observe(this):Qe.unobserve(this),ze(this,$e,!1,"f")}}qe=new WeakMap,$e=new WeakMap,We=new WeakMap,Fe=new WeakSet,Ne=function(){var t;return(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang")||"default"},Be=function(t){return new Intl.DateTimeFormat(Ve(this,Fe,"a",Ne),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},je=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===He.compare(t,this.threshold))return"relative"}return"datetime"},Ye=function(t){const e=Ve(this,Fe,"a",Ne),n=this.format,i=this.formatStyle,o=this.tense;let s=Ze;"micro"===n?(t=Pe(t),s=_e,("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=_e)):("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})},Xe=function(t){const e=new Intl.RelativeTimeFormat(Ve(this,Fe,"a",Ne),{numeric:"auto",style:this.formatStyle}),n=this.tense;"future"===n&&1!==t.sign&&(t=Ze),"past"===n&&-1!==t.sign&&(t=Ze);const[i,o]=function(t){const e=Pe(t);if(e.blank)return[0,"second"];for(const t of Oe){if("millisecond"===t)continue;const n=e[`${t}s`];if(n)return[n,t]}return[0,"second"]}(t);return"second"===o&&i<10?e.format(0,"second"):e.format(i,o)},Ke=function(t){const e=new Intl.DateTimeFormat(Ve(this,Fe,"a",Ne),{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 tn="undefined"!=typeof globalThis?globalThis:window;try{customElements.define("relative-time",RelativeTimeElement),tn.RelativeTimeElement=RelativeTimeElement}catch(t){if(!(tn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function en(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if(e.closest(this.tagName)!==this)return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=en(this),i=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]')))),[o,s]="vertical"===e.closest('[role="tablist"]')?.getAttribute("aria-orientation")?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(o.some((e=>t.code===e))){let t=i+1;t>=n.length&&(t=0),this.selectTab(t)}else if(s.some((e=>t.code===e))){let t=i-1;t<0&&(t=n.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=en(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const n=t.target.closest('[role="tab"]');if(!(n instanceof HTMLElement&&n.closest('[role="tablist"]')))return;const i=e.indexOf(n);this.selectTab(i)}))}connectedCallback(){for(const t of en(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=en(this),n=Array.from(this.querySelectorAll('[role="tabpanel"]')).filter((t=>t.closest(this.tagName)===this));if(t>e.length-1)throw new RangeError(`Index "${t}" out of bounds`);const i=e[t],o=n[t];if(!!this.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:o}}))){for(const t of e)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of n)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");i.setAttribute("aria-selected","true"),i.setAttribute("tabindex","0"),i.focus(),o.hidden=!1,this.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:o}}))}}}window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement));let nn=class PrimerMultiInputElement extends HTMLElement{activateField(t){var e,n;const i=this.findField(t);if(i){for(const t of this.fields)t!==i&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),null===(e=t.parentElement)||void 0===e||e.setAttribute("hidden","hidden"));i.removeAttribute("disabled"),i.removeAttribute("hidden"),null===(n=i.parentElement)||void 0===n||n.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function on(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}={}){var s,r=0,a=!1,l=function l(...c){if(!a){var u=Date.now()-r;r=Date.now(),n?(n=!1,t(...c),o&&l.cancel()):(i&&u<e||!i)&&(clearTimeout(s),s=setTimeout((function(){r=Date.now(),t(...c),o&&l.cancel()}),i?e-u:e))}};return l.cancel=function(){clearTimeout(s),a=!0},l}(t,e,{start:n,middle:i,once:o})}E([Ct],nn.prototype,"fields",void 0),nn=E([xt],nn),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:nn}),window.customElements.define("primer-multi-input",nn));const sn=new WeakMap;class AutoCheckElement extends HTMLElement{connectedCallback(){const t=this.input;if(!t)return;const e=on(an.bind(null,this),300),n={check:e,controller:null};sn.set(this,n),t.addEventListener("input",rn),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=sn.get(this);e&&(sn.delete(this),t.removeEventListener("input",rn),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 rn(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=sn.get(n);if(!i||!o||!s)return;let r="Verifying…";e.dispatchEvent(new CustomEvent("auto-check-start",{bubbles:!0,detail:{setValidity:t=>r=t}})),n.required&&e.setCustomValidity(r)}async function an(t){const e=t.input;if(!e)return;const n=t.csrfField,i=t.src,o=t.csrf,s=sn.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 CustomEvent("auto-check-send",{bubbles:!0,detail:{body:r}})),s.controller?s.controller.abort():t.dispatchEvent(new CustomEvent("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 CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),i}catch(e){throw"AbortError"!==e.name&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),e}}(t,i,{credentials:"same-origin",signal:s.controller.signal,method:"POST",body:r});n.ok?function(t,e,n){n&&e.setCustomValidity("");e.dispatchEvent(new CustomEvent("auto-check-success",{bubbles:!0,detail:{response:t.clone()}}))}(n,e,t.required):function(t,e,n){let i="Validation failed";const o=t=>i=t;e.dispatchEvent(new CustomEvent("auto-check-error",{bubbles:!0,detail:{response:t.clone(),setValidity:o}})),n&&e.setCustomValidity(i)}(n,e,t.required),s.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0}))}catch(t){"AbortError"!==t.name&&(s.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0})))}}var ln;window.customElements.get("auto-check")||(window.AutoCheckElement=AutoCheckElement,window.customElements.define("auto-check",AutoCheckElement));let cn=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),ln.set(this,void 0)}connectedCallback(){var t;null===(t=A(this,ln,"f"))||void 0===t||t.abort();const{signal:e}=L(this,ln,new AbortController,"f");this.inputElement.addEventListener("auto-check-success",(()=>{this.clearError()}),{signal:e}),this.inputElement.addEventListener("auto-check-error",(t=>{t.detail.response.text().then((t=>{this.setError(t)}))}),{signal:e})}disconnectedCallback(){var t;null===(t=A(this,ln,"f"))||void 0===t||t.abort()}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.innerText=""}setError(t){this.validationMessageElement.innerText=t,this.validationElement.hidden=!1,this.inputElement.setAttribute("invalid","true")}};ln=new WeakMap,E([St],cn.prototype,"inputElement",void 0),E([St],cn.prototype,"validationElement",void 0),E([St],cn.prototype,"validationMessageElement",void 0),cn=E([xt],cn);let un=class ToggleSwitchInputElement extends HTMLElement{connectedCallback(){this.addEventListener("toggleSwitchError",(t=>{this.validationMessageElement.innerText=t.detail,this.validationElement.removeAttribute("hidden")})),this.addEventListener("toggleSwitchSuccess",(()=>{this.validationMessageElement.innerText="",this.validationElement.setAttribute("hidden","hidden")}))}};E([St],un.prototype,"validationElement",void 0),E([St],un.prototype,"validationMessageElement",void 0),un=E([xt],un)}();
1
+ !function(){"use strict";var t=new Set,e=new Set,n=["popoverToggleTarget","popoverShowTarget","popoverHideTarget"],i=["button",'input[type="button"]','input[type="submit"]','input[type="image"]','input[type="reset"]'].flatMap((t=>n.map((e=>`${t}[${e}]`)))).join(", "),o=new WeakMap;function*s(n){if(t.has(n))for(const t of e)r(t)===n&&(yield t)}function r(t){return t.popoverToggleTargetElement||t.popoverShowTargetElement||t.popoverHideTargetElement}function a(t){o.has(t)||o.set(t,t.getAttribute("aria-expanded"));const n=r(t);if(n?e.add(t):e.delete(t),n&&"auto"===n.popover)t.setAttribute("aria-expanded",String(n.classList.contains(":open")));else{const e=o.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}function*l(t){if(t instanceof HTMLElement&&t.hasAttribute("popover")&&(yield t),t instanceof Document||t instanceof ShadowRoot||t instanceof HTMLElement)for(const e of t.querySelectorAll("[popover]"))e instanceof HTMLElement&&(yield e)}function*c(t){if((t instanceof HTMLInputElement||t instanceof HTMLButtonElement)&&t.matches(i)&&(yield t),t instanceof Document||t instanceof ShadowRoot||t instanceof HTMLElement)for(const e of t.querySelectorAll(i))(e instanceof HTMLInputElement||e instanceof HTMLButtonElement)&&(yield e)}var u=new MutationObserver((n=>{n.forEach((n=>{switch(n.type){case"attributes":switch(n.attributeName){case"popover":(e=>{const n=e.target;n instanceof HTMLElement&&(n.hasAttribute("popover")?t.add(n):t.delete(n))})(n);break;default:(t=>{const e=t.target;(e instanceof HTMLButtonElement||e instanceof HTMLInputElement)&&a(e)})(n)}break;case"childList":(n=>{for(const e of n.addedNodes){for(const t of c(e))a(t);for(const n of l(e))t.add(n)}for(const i of n.removedNodes){for(const t of c(i))e.delete(t);for(const e of l(i))t.delete(e)}})(n)}}))})),d=e=>{if(e===document){for(const n of l(e))t.add(n);for(const t of c(e))a(t)}u.observe(e,{attributeFilter:["popover",...n],childList:!0,subtree:!0})};function h(t){const e=Element.prototype.attachShadow;Element.prototype.attachShadow=function(n){const i=e.call(this,n);return t(i),i}}var f=(t,e)=>{const n=e.closest(t);if(n)return n;const i=e.getRootNode();return i!==document&&i instanceof ShadowRoot?f(t,i.host):null},m=(t,e,n=[])=>{const i=f(e,t),o=i?.parentElement||i?.getRootNode()?.host;return i&&o?m(o,e,[i,...n]):n};"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){const e=new WeakSet;function n(t,n){if(!function(t,n){return!("auto"!==t.popover&&"manual"!==t.popover||!t.isConnected||t instanceof HTMLDialogElement&&t.hasAttribute("open")||n&&!e.has(t)||!n&&e.has(t)||document.fullscreenElement===t)}(t,n))throw new DOMException("Cannot show or hide popover on invalid or already visible element","InvalidStateError")}class o extends Event{constructor(t,{currentState:e="",newState:n="",...i}={}){super(t,i),this.currentState=String(e||""),this.newState=String(n||"")}}window.BeforeToggleEvent=window.BeforeToggleEvent||o,Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){const t=(this.getAttribute("popover")||"").toLowerCase();return"manual"===t?"manual":""===t||"auto"==t?"auto":null},set(t){this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(){n(this,!1);const t=new o("beforetoggle",{cancelable:!0,currentState:"closed",newState:"open"});if(this.dispatchEvent(t)&&(n(this,!1),this.classList.add(":open"),e.add(this),"auto"===this.popover)){(this.hasAttribute("autofocus")?this:this.querySelector("[autofocus]"))?.focus();for(const t of s(this))a(t)}}},hidePopover:{enumerable:!0,configurable:!0,value(){if(n(this,!0),this.dispatchEvent(new o("beforetoggle",{cancelable:!1,currentState:"open",newState:"closed"})),n(this,!0),this.classList.remove(":open"),e.delete(this),"auto"===this.popover)for(const t of s(this))a(t)}}});const r=t=>{const e=new WeakMap,n={set(n){if(null===n)this.removeAttribute(t.toLowerCase()),e.delete(this);else{if(!(n instanceof Element))throw new TypeError(`${t}Element must be an element or null`);this.setAttribute(t.toLowerCase(),""),e.set(this,n)}},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 n=e.get(this);if(n?.isConnected||e.delete(this),n)return n;const i=this.getRootNode(),o=this.getAttribute(t.toLowerCase());return(i instanceof Document||i instanceof ShadowRoot)&&o&&i.getElementById(o)||null}};Object.defineProperty(HTMLButtonElement.prototype,`${t}Element`,n),Object.defineProperty(HTMLInputElement.prototype,`${t}Element`,n)};r("popoverToggleTarget"),r("popoverShowTarget"),r("popoverHideTarget");const l=(c=n=>{const o=n.target;if(!(o instanceof Element)||o?.shadowRoot)return;const s=o.getRootNode();if(!(s instanceof ShadowRoot||s instanceof Document))return;const r=(t=>{if(!(t instanceof HTMLButtonElement||t instanceof HTMLInputElement))return;let n=null;return t.popoverToggleTargetElement?(n=t.popoverToggleTargetElement,n&&(e.has(n)?n.hidePopover():n.showPopover())):t.popoverShowTargetElement?(n=t.popoverShowTargetElement,n?.showPopover()):t.popoverHideTargetElement&&(n=t.popoverHideTargetElement,n?.hidePopover()),n})(o.closest(i));for(const e of[...t])e.matches('[popover="" i].\\:open, [popover=auto i].\\:open')&&e!==r&&!m(o,"[popover]").includes(e)&&e.hidePopover()},t=>{t.addEventListener("click",c)});var c;d(document),l(document),h(d),h(l)}();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=[g(t,"compositionstart",(t=>S(this,t))),g(t,"compositionend",(t=>S(this,t))),g(t,"click",(e=>T(t,e))),g(t,"change",(e=>T(t,e))),g(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=p.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")&&(k(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=E(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=E(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(A&&n.ctrlKey){const e=E(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(A&&n.ctrlKey){const e=E(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&M(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),g(t,"toggle",(()=>w(t,this)),{once:!0}),g(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?g(t,"mouseover",(()=>w(t,this)),{once:!0}):b,...v(t)];p.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=p.get(this);if(t){p.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const p=new WeakMap,b={unsubscribe(){}};function g(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function w(t,e){const n=e.getAttribute("src");if(!n)return;const i=p.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",(()=>y(t))),o.setAttribute("src",n))}function v(t){let e=!1;return[g(t,"mousedown",(()=>e=!0)),g(t,"keydown",(()=>e=!1)),g(t,"toggle",(()=>{t.hasAttribute("open")&&(y(t)||e||function(t){const e=document.activeElement;if(e&&M(e)&&t.contains(e))return;const n=E(t,!0);n&&n.focus()}(t))}))]}function y(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function E(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 A=navigator.userAgent.match(/Macintosh/);function T(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||L(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&L(e,t)}}function L(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")&&k(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function M(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function k(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function S(t,e){const n=p.get(t);n&&(n.isComposing="compositionstart"===e.type)}function C(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 x(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 I(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const D={"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"]},H={start:["end","center"],end:["start","center"],center:["end","start"]};function O(t,e,n={}){const i=function(t){let e=t.parentNode;for(;null!==e;){if(e instanceof HTMLElement&&"static"!==getComputedStyle(e).position)return e;e=e.parentNode}return document.body}(t),o=function(t){let e=t;for(;null!==e&&e!==document.body;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const n=e!==document.body&&e instanceof HTMLElement?e:document.body,i=n.getBoundingClientRect(),o=getComputedStyle(n),[s,r,a,l]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:i.top+s,left:i.left+r,width:i.width-a-r,height:Math.max(i.height-s-l,n===document.body?window.innerHeight:-1/0)}}(i),s=getComputedStyle(i),r=i.getBoundingClientRect(),[a,l]=[s.borderTopWidth,s.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,i,{side:o,align:s,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:l}){const c={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let u=W(n,i,o,s,a,l),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=D[o];let f=0;if(r){let t=o;for(;f<r.length&&N(t,u,c,n);){const o=r[f++];t=o,u=W(n,i,o,s,a,l),u.top-=e.top,u.left-=e.left,d=o}}const m=H[s];let p=0;if(m){let t=s;for(;p<m.length&&B(t,u,c,n);){const o=m[p++];t=o,u=W(n,i,d,o,a,l),u.top-=e.top,u.left-=e.left,h=o}}u.top<c.top&&(u.top=c.top),u.left<c.left&&(u.left=c.left),u.left+n.width>t.width+c.left&&(u.left=t.width+c.left-n.width),r&&f<r.length&&u.top+n.height>t.height+c.top&&(u.top=t.height+c.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(o,{top:r.top+a,left:r.left+l},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,i,o,s;const r=null!==(e=t.side)&&void 0!==e?e:R,a=null!==(n=t.align)&&void 0!==n?n:P;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:F,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?$:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:q}}(n))}const R="outside-bottom",P="start",F=4,$=4,q=!1;function W(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 N(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 B(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=!1){return function*(t,e={}){var n,i;const o=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(i=e.onlyTabbable)&&void 0!==i&&i?X:Y,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&s(t,o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&s(t,o)&&(yield t),e.reverse){let t=r.lastChild();for(;t;)a=t,t=r.lastChild()}else a=r.firstChild();for(;a instanceof HTMLElement;)yield a,a=e.reverse?r.previousNode():r.nextNode();e.reverse&&s(t,o)&&(yield t)}(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function Y(t,e=!1){const n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,i=t.hidden,o=t instanceof HTMLInputElement&&"hidden"===t.type,s=t.classList.contains("sentinel");if(n||i||o||s)return!1;if(e){const e=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(getComputedStyle(t).visibility),i=0===t.getClientRects().length;if(e||n||i)return!1}return null!=t.getAttribute("tabindex")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex}function X(t,e=!1){return Y(t,e)&&"-1"!==t.getAttribute("tabindex")}let K=!1;function V(){}try{const t=Object.create({},{signal:{get(){K=!0}}});window.addEventListener("test",V,t),window.removeEventListener("test",V,t)}catch(t){}K||(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)}}(),K=!0);const z=[];let U;function Z(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=j(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&&X(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=j(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=j(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(U){const t=U;U.container.setAttribute("data-focus-trap","suspended"),U.controller.abort(),z.push(t)}c.signal.addEventListener("abort",(()=>{U=void 0})),o.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=z.findIndex((e=>e.container===t));n>=0&&z.splice(n,1),function(){const t=z.pop();t&&Z(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{l(t.target)}),{signal:c.signal,capture:!0}),l(document.activeElement),U={container:t,controller:c,initialFocus:e,originalSignal:o};const u=z.findIndex((e=>e.container===t));if(u>=0&&z.splice(u,1),!n)return i}var _,G;const J=(()=>{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),_.set(this,null),G.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(x(this,_,"f"))return x(this,_,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){I(this,_,t,"f"),x(this,_,"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())),J(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(x(this,G,"f")),I(this,G,requestAnimationFrame((()=>{const t=this.anchorElement;if(!t)return;const{left:e,top:n,anchorSide:i,anchorAlign:o}=O(this,t,this);this.style.top=`${n}px`,this.style.left=`${e}px`,this.classList.remove("Overlay--anchorAlign-start","Overlay--anchorAlign-center","Overlay--anchorAlign-end","Overlay--anchorSide-insideTop","Overlay--anchorSide-insideBottom","Overlay--anchorSide-insideLeft","Overlay--anchorSide-insideRight","Overlay--anchorSide-insideCenter","Overlay--anchorSide-outsideTop","Overlay--anchorSide-outsideLeft","Overlay--anchorSide-outsideRight"),this.classList.add(`Overlay--anchorAlign-${o}`,`Overlay--anchorSide-${i}`)})),"f"))}}_=new WeakMap,G=new WeakMap,AnchoredPositionElement.observedAttributes=["align","side","anchor","alignment-offset","allow-out-of-bounds"],customElements.get("anchored-position")||(window.AnchoredPositionElement=AnchoredPositionElement,customElements.define("anchored-position",AnchoredPositionElement));const Q=new WeakMap,tt=new WeakMap,et=new WeakMap;function nt(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=et.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(tt.has(e)&&t instanceof MouseEvent){const n=tt.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(tt.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=tt.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`,ct(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)tt.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];tt.set(e,{dragStartX:n,dragStartY:i})}}function it(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=ot(e);if(!(n instanceof ImageCropElement))return;const{box:i}=et.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return at(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,Q.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=Q.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=Q.get(n);if(!e)return;s=t.changedTouches[0].pageX-e.startX-o.left-window.pageXOffset,r=t.changedTouches[0].pageY-e.startY-o.top-window.pageYOffset}s&&r&&rt(n,s,r,!(t instanceof KeyboardEvent))}function ot(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function st(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=ot(e);if(!(n instanceof ImageCropElement))return;const{box:i}=et.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",it),n.addEventListener("touchmove",it,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),Q.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),it(t)}else n.addEventListener("mousemove",nt),n.addEventListener("touchmove",nt,{passive:!0})}function rt(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=Q.get(t);if(!s)return;const{box:r,image:a}=et.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`,ct(t,{x:l,y:c,width:o,height:o})}function at(t){const{image:e}=et.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);Q.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),rt(t,n,n)}function lt(t){const e=t.currentTarget;e instanceof ImageCropElement&&(tt.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",it),e.removeEventListener("mousemove",nt),e.removeEventListener("touchmove",it),e.removeEventListener("touchmove",nt))}function ct(t,e){const{image:n}=et.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(et.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&&(et.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,at(this)})),this.addEventListener("mouseleave",lt),this.addEventListener("touchend",lt),this.addEventListener("mouseup",lt),e.addEventListener("mousedown",st),e.addEventListener("touchstart",st,{passive:!0}),this.addEventListener("keydown",nt),this.addEventListener("keydown",it),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}=et.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}var ut,dt,ht,ft;function mt(t){document.activeElement!==t&&(null==t||t.focus())}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const pt=[];function bt(t){const e=t.target,n=null==e?void 0:e.closest("button");if(!n)return;let i=null==n?void 0:n.getAttribute("data-show-dialog-id");if(i){t.stopPropagation();const e=document.getElementById(i);if(e instanceof ModalDialogElement)return e.openButton=n,void e.show()}const o=pt[pt.length-1];o&&(i=n.getAttribute("data-close-dialog-id"),i===o.id&&(pt.pop(),o.close()),i=n.getAttribute("data-submit-dialog-id"),i===o.id&&(pt.pop(),o.close(!0)))}function gt(t){const e=t.target;if(null==e?void 0:e.closest("button"))return;const n=pt[pt.length-1];if(!n)return;!e.closest(`#${n.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",(t=>{t.target===e&&(pt.pop(),n.close())}),{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),ut.add(this),dt.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){var e,n,i,o;if(t){if(this.open)return;this.setAttribute("open",""),null===(e=x(this,ut,"a",ht))||void 0===e||e.classList.remove("Overlay--hidden"),document.body.style.paddingRight=window.innerWidth-document.body.clientWidth+"px",document.body.style.overflow="hidden",x(this,dt,"f").signal.aborted&&I(this,dt,new AbortController,"f"),Z(this,void 0,x(this,dt,"f").signal),pt.push(this)}else{if(!this.open)return;this.removeAttribute("open"),null===(n=x(this,ut,"a",ht))||void 0===n||n.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",x(this,dt,"f").abort();const t=(null===(i=this.openButton)||void 0===i?void 0:i.closest("details"))||(null===(o=this.openButton)||void 0===o?void 0:o.closest("action-menu"));mt(t?j(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",bt),document.addEventListener("mousedown",gt),this.addEventListener("keydown",(t=>x(this,ut,"m",ft).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}}dt=new WeakMap,ut=new WeakSet,ht=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},ft=function(t){if(t instanceof KeyboardEvent&&!t.isComposing)switch(t.key){case"Escape":this.open&&(this.close(),t.preventDefault(),t.stopPropagation())}},window.customElements.get("modal-dialog")||(window.ModalDialogElement=ModalDialogElement,window.customElements.define("modal-dialog",ModalDialogElement));const wt=new WeakSet;function vt(t){At(t),Et(t)}const yt=new WeakMap;function Et(t=document){if(yt.has(t))return yt.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)Mt(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&At(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const i={get closed(){return e},unsubscribe(){e=!0,yt.delete(t),n.disconnect()}};return yt.set(t,i),i}function At(t){for(const e of t.querySelectorAll("[data-action]"))Mt(e);t instanceof Element&&t.hasAttribute("data-action")&&Mt(t)}function Tt(t){const e=t.currentTarget;for(const n of Lt(e))if(t.type===n.type){const i=e.closest(n.tag);wt.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const o=e.getRootNode();if(o instanceof ShadowRoot&&wt.has(o.host)&&o.host.matches(n.tag)){const e=o.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*Lt(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 Mt(t){for(const e of Lt(t))t.addEventListener(e.type,Tt)}const kt=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),St=(t,e="property")=>{const n=kt(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const Ct="attr",xt=new WeakSet;function It(t,e){if(xt.has(t))return;xt.add(t);const n=Object.getPrototypeOf(t),i=n?.constructor?.attrPrefix??"data-";e||(e=Ot(n,Ct));for(const n of e){const e=t[n],o=St(`${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 Dt=Symbol.for("catalyst");class Ht{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=>St(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...Ot(t.prototype,Ct)].map(i).concat(e),set(t){e=t}})}(t),function(t){const e=kt(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),It(t),function(t){wt.add(t),t.shadowRoot&&vt(t.shadowRoot),At(t),Et(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&vt(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,i,o){It(t),"data-catalyst"!==e&&o&&o.call(t,e,n,i)}}function Ot(t,e){if(!Object.prototype.hasOwnProperty.call(t,Dt)){const e=t[Dt],n=t[Dt]=new Map;if(e)for(const[t,i]of e)n.set(t,new Set(i))}const n=t[Dt];return n.has(e)||n.set(e,new Set),n.get(e)}function Rt(t,e){Ot(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 Pt(t,e){Ot(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 Ft(t){new Ht(t)}var $t,qt,Wt,Nt,Bt,jt,Yt,Xt;new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),new Promise((t=>{const e=new AbortController;e.signal.addEventListener("abort",(()=>t()));const n={once:!0,passive:!0,signal:e.signal},i=()=>e.abort();document.addEventListener("mousedown",i,n),document.addEventListener("touchstart",i,n),document.addEventListener("keydown",i,n),document.addEventListener("pointerdown",i,n)}));let Kt=class NavListElement extends HTMLElement{constructor(){super(...arguments),$t.add(this)}connectedCallback(){this.setShowMoreItemState()}get showMoreDisabled(){return this.showMoreItem.hasAttribute("aria-disabled")}set showMoreDisabled(t){t?this.showMoreItem.setAttribute("aria-disabled","true"):this.showMoreItem.removeAttribute("aria-disabled"),this.showMoreItem.classList.toggle("disabled",t)}set currentPage(t){this.showMoreItem.setAttribute("data-current-page",t.toString())}get currentPage(){return parseInt(this.showMoreItem.getAttribute("data-current-page"))||1}get totalPages(){return parseInt(this.showMoreItem.getAttribute("data-total-pages"))||1}get paginationSrc(){return this.showMoreItem.getAttribute("src")||""}selectItemById(t){if(!t)return!1;const e=x(this,$t,"m",Wt).call(this,t);return!!e&&(x(this,$t,"m",jt).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=x(this,$t,"m",Nt).call(this,t);return!!e&&(x(this,$t,"m",jt).call(this,e),!0)}selectItemByCurrentLocation(){const t=x(this,$t,"m",Bt).call(this);return!!t&&(x(this,$t,"m",jt).call(this,t),!0)}expandItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false"),t.focus()}itemIsExpanded(t){return"A"===(null==t?void 0:t.tagName)||"true"===(null==t?void 0:t.getAttribute("aria-expanded"))}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=e.closest("button");n&&(this.itemIsExpanded(n)?this.collapseItem(n):this.expandItem(n),t.stopPropagation())}handleItemWithSubItemKeydown(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;let n=e.closest("button");if(!n){const t=e.getAttribute("aria-labelledby");if(!t)return;n=document.getElementById(t)}this.itemIsExpanded(n)&&"Escape"===t.key&&this.collapseItem(n),t.stopPropagation()}async showMore(t){var e,n;if(t.preventDefault(),this.showMoreDisabled)return;let i;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const e=await fetch(t);if(!e.ok)return;i=await e.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const o=x(this,$t,"m",qt).call(this,document,i);null===(e=null==o?void 0:o.querySelector("li > a"))||void 0===e||e.setAttribute("data-targets","nav-list.focusMarkers"),this.list.insertBefore(o,this.showMoreItem),null===(n=this.focusMarkers.pop())||void 0===n||n.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}};var Vt,zt;$t=new WeakSet,qt=function(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)},Wt=function(t){var e;for(const n of this.items){if(n.classList.contains("ActionListItem--hasSubItem"))continue;if(((null===(e=n.getAttribute("data-item-id"))||void 0===e?void 0:e.split(" "))||[]).includes(t))return n}return null},Nt=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},Bt=function(){return x(this,$t,"m",Nt).call(this,window.location.pathname)},jt=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&x(this,$t,"m",Yt).call(this,e),t.classList.add("ActionListItem--navActive");const n=x(this,$t,"m",Xt).call(this,t);n&&(this.expandItem(n),n.classList.add("ActionListContent--hasActiveSubItem"))},Yt=function(t){t.classList.remove("ActionListItem--navActive");const e=x(this,$t,"m",Xt).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},Xt=function(t){var e;if(!t.classList.contains("ActionListItem--subItem"))return null;const n=null===(e=t.closest("li.ActionListItem--hasSubItem"))||void 0===e?void 0:e.querySelector("button.ActionListContent");return n||null},C([Rt],Kt.prototype,"list",void 0),C([Pt],Kt.prototype,"items",void 0),C([Rt],Kt.prototype,"showMoreItem",void 0),C([Pt],Kt.prototype,"focusMarkers",void 0),Kt=C([Ft],Kt);let Ut=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),Vt.add(this)}connectedCallback(){x(this,Vt,"m",zt).call(this)}select(t){var e,n;const i=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),null===(e=t.querySelector("[aria-current]"))||void 0===e||e.setAttribute("aria-current","false");null===(n=i.closest("li.SegmentedControl-item"))||void 0===n||n.classList.add("SegmentedControl-item--selected"),i.setAttribute("aria-current","true")}};function Zt(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})}Vt=new WeakSet,zt=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},C([Pt],Ut.prototype,"items",void 0),Ut=C([Ft],Ut),window.customElements.get("segmented-control")||(window.SegmentedControlElement=Ut,window.customElements.define("segmented-control",Ut));let _t=class ToggleSwitchElement extends HTMLElement{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}toggle(){this.isDisabled()||(this.isRemote()?(this.setLoadingState(),this.submitForm()):this.performToggle())}turnOn(){this.isDisabled()||(this.switch.setAttribute("aria-checked","true"),this.classList.add("ToggleSwitch--checked"))}turnOff(){this.isDisabled()||(this.switch.setAttribute("aria-checked","false"),this.classList.remove("ToggleSwitch--checked"))}isOn(){return"true"===this.switch.getAttribute("aria-checked")}isOff(){return!this.isOn()}isDisabled(){return"true"===this.switch.getAttribute("aria-disabled")}disable(){this.switch.setAttribute("aria-disabled","true")}enable(){this.switch.setAttribute("aria-disabled","false")}performToggle(){this.isOn()?this.turnOff():this.turnOn()}setLoadingState(){this.disable(),this.errorIcon.setAttribute("hidden","hidden"),this.loadingSpinner.removeAttribute("hidden")}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"),this.enable()}async submitForm(){const t=new FormData;this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"0":"1");try{if(!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());this.setSuccessState(),this.performToggle()}catch(t){t instanceof Error&&this.setErrorState(t.message||"An error occurred, please try again.")}}};var Gt,Jt,Qt,te,ee,ne,ie,oe,se;C([Rt],_t.prototype,"switch",void 0),C([Rt],_t.prototype,"loadingSpinner",void 0),C([Rt],_t.prototype,"errorIcon",void 0),C([function(t=0,e={}){return(n,i,o)=>{if(!o||"function"!=typeof o.value)throw new Error("debounce can only decorate functions");const s=o.value;o.value=Zt(s,t,e),Object.defineProperty(n,i,o)}}(300)],_t.prototype,"submitForm",null),_t=C([Ft],_t),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=_t,window.customElements.define("toggle-switch",_t));const re="tooltip-open",ae="sr-only",le=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class ToolTipElement extends HTMLElement{constructor(){super(...arguments),Gt.add(this),Jt.set(this,void 0),Qt.set(this,"center"),te.set(this,"outside-bottom"),ee.set(this,!1)}styles(){return'\n :host {\n position: absolute;\n z-index: 1000000;\n padding: .5em .75em;\n font: normal normal 11px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";\n -webkit-font-smoothing: subpixel-antialiased;\n color: var(--color-fg-on-emphasis);\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n background: var(--color-neutral-emphasis-plus);\n border-radius: 6px;\n opacity: 0;\n max-width: 250px;\n word-wrap: break-word;\n white-space: normal;\n width: max-content;\n }\n\n :host:before{\n position: absolute;\n z-index: 1000001;\n color: var(--color-neutral-emphasis-plus);\n content: "";\n border: 6px solid transparent;\n opacity: 0\n }\n\n @keyframes tooltip-appear {\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n }\n\n :host:after{\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: 12px;\n content: ""\n }\n\n :host(.tooltip-open),\n :host(.tooltip-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n animation-delay: .4s\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-n):before {\n right: 50%;\n margin-right: -6px;\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-se):before,\n :host(.tooltip-sw):before {\n bottom: 100%;\n border-bottom-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-s):after,\n :host(.tooltip-se):after,\n :host(.tooltip-sw):after {\n bottom: 100%\n }\n\n :host(.tooltip-n):before,\n :host(.tooltip-ne):before,\n :host(.tooltip-nw):before {\n top: 100%;\n border-top-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%\n }\n\n :host(.tooltip-se):before,\n :host(.tooltip-ne):before {\n left: 0;\n margin-left: 6px;\n }\n\n :host(.tooltip-sw):before,\n :host(.tooltip-nw):before {\n right: 0;\n margin-right: 6px;\n }\n\n :host(.tooltip-w):before {\n top: 50%;\n bottom: 50%;\n left: 100%;\n margin-top: -6px;\n border-left-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-e):before {\n top: 50%;\n right: 100%;\n bottom: 50%;\n margin-top: -6px;\n border-right-color: var(--color-neutral-emphasis-plus)\n }\n '}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get type(){return"label"===this.getAttribute("data-type")?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return this.getAttribute("data-direction")||"s"}set direction(t){this.setAttribute("data-direction",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}set hiddenFromView(t){this.classList.toggle(ae,t),this.isConnected&&x(this,Gt,"m",ne).call(this)}get hiddenFromView(){return this.classList.contains(ae)}connectedCallback(){var t;if(x(this,Gt,"m",ie).call(this),x(this,Gt,"m",oe).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}if(this.hiddenFromView=!0,I(this,ee,!0,"f"),!this.control)return;this.setAttribute("role","tooltip"),null===(t=x(this,Jt,"f"))||void 0===t||t.abort(),I(this,Jt,new AbortController,"f");const{signal:e}=x(this,Jt,"f");this.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("mouseenter",this,{signal:e}),this.control.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("focus",this,{signal:e}),this.control.addEventListener("blur",this,{signal:e}),this.ownerDocument.addEventListener("keydown",this,{signal:e}),x(this,Gt,"m",ne).call(this)}disconnectedCallback(){var t;null===(t=x(this,Jt,"f"))||void 0===t||t.abort()}handleEvent(t){this.control&&("mouseenter"!==t.type&&"focus"!==t.type||!this.hiddenFromView?"blur"===t.type||"mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hiddenFromView=!0:"keydown"!==t.type||"Escape"!==t.key||this.hiddenFromView||(this.hiddenFromView=!0):this.hiddenFromView=!1)}attributeChangedCallback(t){this.isConnected&&("id"===t||"data-type"===t?x(this,Gt,"m",ie).call(this):"data-direction"===t&&x(this,Gt,"m",oe).call(this))}}Jt=new WeakMap,Qt=new WeakMap,te=new WeakMap,ee=new WeakMap,Gt=new WeakSet,ne=function(){if(this.hiddenFromView)this.classList.remove(re,...le);else{this.classList.add(re);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);x(this,Gt,"m",se).call(this)}},ie=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)}},oe=function(){this.classList.remove(...le);const t=this.direction;"n"===t?(I(this,Qt,"center","f"),I(this,te,"outside-top","f")):"ne"===t?(I(this,Qt,"start","f"),I(this,te,"outside-top","f")):"e"===t?(I(this,Qt,"center","f"),I(this,te,"outside-right","f")):"se"===t?(I(this,Qt,"start","f"),I(this,te,"outside-bottom","f")):"s"===t?(I(this,Qt,"center","f"),I(this,te,"outside-bottom","f")):"sw"===t?(I(this,Qt,"end","f"),I(this,te,"outside-bottom","f")):"w"===t?(I(this,Qt,"center","f"),I(this,te,"outside-left","f")):"nw"===t&&(I(this,Qt,"end","f"),I(this,te,"outside-top","f"))},se=function(){if(!this.control)return;if(!x(this,ee,"f")||this.hiddenFromView)return;this.style.left="0px";const t=O(this,this.control,{side:x(this,te,"f"),align:x(this,Qt,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.top=`${t.top}px`,this.style.left=`${t.left}px`;let i="s";i="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===n?"n":"start"===n?"ne":"nw":"center"===n?"s":"start"===n?"se":"sw",this.classList.add(`tooltip-${i}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let ce=class XBannerElement extends HTMLElement{dismiss(){if(this.shouldReappear())return this.style.setProperty("visibility","hidden"),void setTimeout((()=>{this.style.setProperty("visibility","visible")}),2e3);const t=this.parentElement;t&&t.removeChild(this)}shouldReappear(){return"true"===this.getAttribute("data-reappear")}};C([Rt],ce.prototype,"titleText",void 0),ce=C([Ft],ce),window.customElements.get("x-banner")||(window.XBannerElement=ce,window.customElements.define("x-banner",ce));const ue=!!navigator.userAgent.match(/Macintosh/);class de{constructor(t,e){this.input=t,this.list=e,this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=t=>function(t,e){if(t.shiftKey||t.metaKey||t.altKey)return;if(!ue&&t.ctrlKey)return;if(e.isComposing)return;switch(t.key){case"Enter":case"Tab":(function(t,e){const n=e.querySelector('[aria-selected="true"]');return!!n&&("true"===n.getAttribute("aria-disabled")||n.click(),!0)})(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":ue&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":ue&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.clearSelection()}}(t,this),this.compositionEventHandler=t=>function(t,e){e.isComposing="compositionstart"===t.type;if(!document.getElementById(e.input.getAttribute("aria-controls")||""))return;e.clearSelection()}(t,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",he)}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",he)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(fe)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(fe),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)s===t?(this.input.setAttribute("aria-activedescendant",s.id),s.setAttribute("aria-selected","true"),me(this.list,s)):t.setAttribute("aria-selected","false")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.setAttribute("aria-selected","false")}}function he(t){if(!(t.target instanceof Element))return;const e=t.target.closest('[role="option"]');e&&"true"!==e.getAttribute("aria-disabled")&&function(t){t.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0}))}(e)}function fe(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function me(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 pe=window.testScreenReaderDelay||100;class be{constructor(t,e,n,i=!1){var o;if(this.container=t,this.input=e,this.results=n,this.combobox=new de(e,n),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=i,this.clearButton=document.getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=n.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.hidden=!0,this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let n;return function(...i){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...i)}),e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(o=this.clearButton)||void 0===o||o.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),"true"===this.input.getAttribute("aria-expanded")&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.container.open=!1}onKeydown(t){if("Enter"===t.key&&this.container.open&&this.autoselectEnabled){const e=this.results.children[0];e&&(t.stopPropagation(),t.preventDefault(),this.onCommit({target:e}))}if("Escape"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.container.open=!0,t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.fetchResults()}onInputBlur(){this.interactingWithList?this.interactingWithList=!1:this.container.open=!1}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(this.container.open=!1,e instanceof HTMLAnchorElement)return;const n=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=n,n||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout((()=>{this.feedback&&(this.feedback.textContent=t)}),pe)}fetchResults(){const t=this.input.value.trim();if(!t)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(this.input,n.toString()).then((t=>{this.results.innerHTML=t,this.identifyOptions();const e=this.results.querySelectorAll('[role="option"]'),n=!!e.length,i=e.length,[o]=e,s=null==o?void 0:o.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${i} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${i||"No"} results.`),this.container.open=n,this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))})).catch((()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))}))}open(){this.results.hidden&&(this.combobox.start(),this.results.hidden=!1)}close(){this.results.hidden||(this.combobox.stop(),this.results.hidden=!0)}}class ge extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const we=new WeakMap;function ve(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=we.get(t);n&&n.abort();we.set(t,e);const i=()=>we.delete(t),o=function(t){return new Promise(((e,n)=>{t.onload=function(){t.status>=200&&t.status<300?e(t.responseText):n(new Error(t.responseText))},t.onerror=n,t.send()}))}(e);return o.then(i,i),o}(t,n)}const ye=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super(...arguments),this.fetchResult=ve}connectedCallback(){const t=this.getAttribute("for");if(!t)return;const e=this.querySelector("input"),n=document.getElementById(t);if(!(e instanceof HTMLInputElement&&n))return;const i="true"===this.getAttribute("data-autoselect");ye.set(this,new be(this,e,n,i)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=ye.get(this);t&&(t.destroy(),ye.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")}static get observedAttributes(){return["open","value"]}attributeChangedCallback(t,e,n){if(e===n)return;const i=ye.get(this);if(i)switch(t){case"open":null===n?i.close():i.open();break;case"value":null!==n&&(i.input.value=n),this.dispatchEvent(new ge("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function Ee(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 Ae(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),Ee(n),e.removeChild(n),Promise.resolve()}function Te(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)Ae(n).then(i);else if(e){const n="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(n instanceof Document||"ShadowRoot"in window&&n instanceof ShadowRoot))return;const s=n.getElementById(e);s&&(o=s,o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?Ae(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?Ae(o.href):Ee(o)).then(i)}var o}function Le(t){const e=t.currentTarget;e instanceof HTMLElement&&Te(e)}function Me(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),Te(e))}}function ke(t){t.currentTarget.addEventListener("keydown",Me)}function Se(t){t.currentTarget.removeEventListener("keydown",Me)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",Le),this.addEventListener("focus",ke),this.addEventListener("blur",Se)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}window.customElements.get("clipboard-copy")||(window.ClipboardCopyElement=ClipboardCopyElement,window.customElements.define("clipboard-copy",ClipboardCopyElement));function Ce(t){t.style.display="inline-block"}function xe(t){t.style.display="none"}const Ie=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=Ie.get(t);e?(clearTimeout(e),Ie.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(xe(e),Ce(n))}(t),Ie.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(Ce(e),xe(n))}(t),Ie.delete(t)}),2e3))}));var De,He=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},Oe=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 Re="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)}},Pe=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],Fe={minimumIntegerDigits:2};class $e{constructor(t,e={}){De.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;He(this,De,{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 Oe(this,De,"f")}formatToParts(t){const e=[],n=Oe(this,De,"f"),i=n.style,o=n.locale;for(const[i,s]of Pe){const r=t[i];if("auto"===n[`${i}Display`]&&!r)continue;const a=n[i],l="2-digit"===a?Fe:"numeric"===a?{}:{style:"unit",unit:s,unitDisplay:a};e.push(new Intl.NumberFormat(o,l).format(r))}return new Re(o,{type:"unit",style:"digital"===i?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map((t=>t.value)).join("")}}De=new WeakMap;const qe=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,We=["year","month","week","day","hour","minute","second","millisecond"];class Ne{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 Ne(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(qe))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return o?new Ne(...o):new Ne}if("object"==typeof t){const{years:e,months:n,weeks:i,days:o,hours:s,minutes:r,seconds:a,milliseconds:l}=t;return new Ne(e,n,i,o,s,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const n=Date.now(),i=Math.abs(Be(n,Ne.from(t)).getTime()-n),o=Math.abs(Be(n,Ne.from(e)).getTime()-n);return i>o?-1:i<o?1:0}toLocaleString(t,e){return new $e(t,e).format(this)}}function Be(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 je(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),a>=21&&(r+=Math.round(a/24)),(r||s||o||i)&&(a=0);const d=e.getFullYear();let h=e.getMonth();const f=e.getDate();return(r>=27||i+o&&r)&&(e.setDate(f+r*n),r=0,o+=Math.abs(e.getFullYear()>=d?e.getMonth()-h:e.getMonth()-h-12),h=e.getMonth()),r>=6&&(s+=Math.round(r/7)),(s||o||i)&&(r=0),s>=4&&(o+=Math.round(s/4)),(o||i)&&(s=0),(o>=11||i&&o)&&(e.setMonth(e.getMonth()+o*n),i+=Math.abs(d-e.getFullYear())),i&&(o=0),new Ne(i*n,o*n,s*n,r*n,a*n,l*n,c*n,u*n)}var Ye,Xe,Ke,Ve,ze,Ue,Ze,_e,Ge,Je,Qe,tn=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)},en=function(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n};const nn=("undefined"!=typeof globalThis?globalThis:window).HTMLElement||null,on=new Ne,sn=new Ne(0,0,0,0,0,1);class rn 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 an(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 ln=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=an(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,an(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends nn{constructor(){super(...arguments),Ye.add(this),Xe.set(this,!1),Ke.set(this,!1),ze.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),Qe.set(this,null)}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 tn(this,Qe,"f")}set onRelativeTimeUpdated(t){tn(this,Qe,"f")&&this.removeEventListener("relative-time-updated",tn(this,Qe,"f")),en(this,Qe,"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,qe.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 We.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(){ln.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&en(this,Xe,null!==n&&(this.date&&tn(this,Ye,"m",Ue).call(this,this.date))!==n,"f"),tn(this,Ke,"f")||"title"===t&&tn(this,Xe,"f")||en(this,Ke,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){const t=tn(this,ze,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let n=e;const i=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!i)return void(tn(this,ze,"f").textContent=t);const o=Date.now();tn(this,Xe,"f")||(n=tn(this,Ye,"m",Ue).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 Ne;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=We.indexOf(e)||We.length;return new Ne(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=tn(this,Ye,"m",Ze).call(this,s);let a=t;a="duration"===r?tn(this,Ye,"m",_e).call(this,s):"relative"===r?tn(this,Ye,"m",Ge).call(this,s):tn(this,Ye,"m",Je).call(this,i),a?tn(this,ze,"f").textContent=a:this.shadowRoot===tn(this,ze,"f")&&this.textContent&&(tn(this,ze,"f").textContent=this.textContent),a===t&&n===e||this.dispatchEvent(new rn(t,a,e,n)),"relative"===r||"duration"===r?ln.observe(this):ln.unobserve(this),en(this,Ke,!1,"f")}}Xe=new WeakMap,Ke=new WeakMap,ze=new WeakMap,Qe=new WeakMap,Ye=new WeakSet,Ve=function(){var t;return(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang")||"default"},Ue=function(t){return new Intl.DateTimeFormat(tn(this,Ye,"a",Ve),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},Ze=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===Ne.compare(t,this.threshold))return"relative"}return"datetime"},_e=function(t){const e=tn(this,Ye,"a",Ve),n=this.format,i=this.formatStyle,o=this.tense;let s=on;"micro"===n?(t=je(t),s=sn,("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=sn)):("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})},Ge=function(t){const e=new Intl.RelativeTimeFormat(tn(this,Ye,"a",Ve),{numeric:"auto",style:this.formatStyle}),n=this.tense;"future"===n&&1!==t.sign&&(t=on),"past"===n&&-1!==t.sign&&(t=on);const[i,o]=function(t,e){const n=je(t,e);if(n.blank)return[0,"second"];for(const t of We){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)},Je=function(t){const e=new Intl.DateTimeFormat(tn(this,Ye,"a",Ve),{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 cn="undefined"!=typeof globalThis?globalThis:window;try{customElements.define("relative-time",RelativeTimeElement),cn.RelativeTimeElement=RelativeTimeElement}catch(t){if(!(cn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function un(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if(e.closest(this.tagName)!==this)return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=un(this),i=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]')))),[o,s]="vertical"===e.closest('[role="tablist"]')?.getAttribute("aria-orientation")?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(o.some((e=>t.code===e))){let t=i+1;t>=n.length&&(t=0),this.selectTab(t)}else if(s.some((e=>t.code===e))){let t=i-1;t<0&&(t=n.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=un(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const n=t.target.closest('[role="tab"]');if(!(n instanceof HTMLElement&&n.closest('[role="tablist"]')))return;const i=e.indexOf(n);this.selectTab(i)}))}connectedCallback(){for(const t of un(this))t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.hasAttribute("tabindex")||("true"===t.getAttribute("aria-selected")?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"))}selectTab(t){const e=un(this),n=Array.from(this.querySelectorAll('[role="tabpanel"]')).filter((t=>t.closest(this.tagName)===this));if(t>e.length-1)throw new RangeError(`Index "${t}" out of bounds`);const i=e[t],o=n[t];if(!!this.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:o}}))){for(const t of e)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of n)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");i.setAttribute("aria-selected","true"),i.setAttribute("tabindex","0"),i.focus(),o.hidden=!1,this.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:o}}))}}}window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement));let dn=class PrimerMultiInputElement extends HTMLElement{activateField(t){var e,n;const i=this.findField(t);if(i){for(const t of this.fields)t!==i&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),null===(e=t.parentElement)||void 0===e||e.setAttribute("hidden","hidden"));i.removeAttribute("disabled"),i.removeAttribute("hidden"),null===(n=i.parentElement)||void 0===n||n.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function hn(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}={}){var s,r=0,a=!1,l=function l(...c){if(!a){var u=Date.now()-r;r=Date.now(),n?(n=!1,t(...c),o&&l.cancel()):(i&&u<e||!i)&&(clearTimeout(s),s=setTimeout((function(){r=Date.now(),t(...c),o&&l.cancel()}),i?e-u:e))}};return l.cancel=function(){clearTimeout(s),a=!0},l}(t,e,{start:n,middle:i,once:o})}C([Pt],dn.prototype,"fields",void 0),dn=C([Ft],dn),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:dn}),window.customElements.define("primer-multi-input",dn));const fn=new WeakMap;class AutoCheckElement extends HTMLElement{connectedCallback(){const t=this.input;if(!t)return;const e=hn(pn.bind(null,this),300),n={check:e,controller:null};fn.set(this,n),t.addEventListener("input",mn),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=fn.get(this);e&&(fn.delete(this),t.removeEventListener("input",mn),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 mn(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=fn.get(n);if(!i||!o||!s)return;let r="Verifying…";e.dispatchEvent(new CustomEvent("auto-check-start",{bubbles:!0,detail:{setValidity:t=>r=t}})),n.required&&e.setCustomValidity(r)}async function pn(t){const e=t.input;if(!e)return;const n=t.csrfField,i=t.src,o=t.csrf,s=fn.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 CustomEvent("auto-check-send",{bubbles:!0,detail:{body:r}})),s.controller?s.controller.abort():t.dispatchEvent(new CustomEvent("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 CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),i}catch(e){throw"AbortError"!==e.name&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),e}}(t,i,{credentials:"same-origin",signal:s.controller.signal,method:"POST",body:r});n.ok?function(t,e,n){n&&e.setCustomValidity("");e.dispatchEvent(new CustomEvent("auto-check-success",{bubbles:!0,detail:{response:t.clone()}}))}(n,e,t.required):function(t,e,n){let i="Validation failed";const o=t=>i=t;e.dispatchEvent(new CustomEvent("auto-check-error",{bubbles:!0,detail:{response:t.clone(),setValidity:o}})),n&&e.setCustomValidity(i)}(n,e,t.required),s.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0}))}catch(t){"AbortError"!==t.name&&(s.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0})))}}var bn;window.customElements.get("auto-check")||(window.AutoCheckElement=AutoCheckElement,window.customElements.define("auto-check",AutoCheckElement));let gn=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),bn.set(this,void 0)}connectedCallback(){var t;null===(t=x(this,bn,"f"))||void 0===t||t.abort();const{signal:e}=I(this,bn,new AbortController,"f");this.inputElement.addEventListener("auto-check-success",(()=>{this.clearError()}),{signal:e}),this.inputElement.addEventListener("auto-check-error",(t=>{t.detail.response.text().then((t=>{this.setError(t)}))}),{signal:e})}disconnectedCallback(){var t;null===(t=x(this,bn,"f"))||void 0===t||t.abort()}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.innerText=""}setError(t){this.validationMessageElement.innerText=t,this.validationElement.hidden=!1,this.inputElement.setAttribute("invalid","true")}};bn=new WeakMap,C([Rt],gn.prototype,"inputElement",void 0),C([Rt],gn.prototype,"validationElement",void 0),C([Rt],gn.prototype,"validationMessageElement",void 0),gn=C([Ft],gn);let wn=class ToggleSwitchInputElement extends HTMLElement{connectedCallback(){this.addEventListener("toggleSwitchError",(t=>{this.validationMessageElement.innerText=t.detail,this.validationElement.removeAttribute("hidden")})),this.addEventListener("toggleSwitchSuccess",(()=>{this.validationMessageElement.innerText="",this.validationElement.setAttribute("hidden","hidden")}))}};C([Rt],wn.prototype,"validationElement",void 0),C([Rt],wn.prototype,"validationMessageElement",void 0),wn=C([Ft],wn)}();
2
2
  //# sourceMappingURL=primer_view_components.js.map