primer_view_components 0.0.72 → 0.0.73
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/components/primer/alpha/tool-tip-element.js +9 -7
- data/app/components/primer/alpha/tool-tip-element.ts +9 -7
- data/lib/primer/view_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 360520e82ed3b675176993d07d7cd293fc7ac094580c8409391aa640a3dc2659
|
4
|
+
data.tar.gz: 5443e46dc1ee9e900ec891b202a65e9fd6542e9eb3e190fb5b71ac29359f650b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34fe9c8220f17ae7f8e9f5816c3ac0f88d7edcf255d08fc838ebd206cba9f1986c2da8a6d6ab1b251ae47edd1477b308ed4d0595ea3e397edc4042a5d50fd7f7
|
7
|
+
data.tar.gz: 6897b304a345d5e4c05b321a786f251ffabba4dd6d5578f3e8604a72d0b3ab81817de5d8bf77416853cd1b718833024e53da5c4d4b53fa178fb30d1b061c3d55
|
data/CHANGELOG.md
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
const t=!!navigator.userAgent.match(/Macintosh/);class e{constructor(e,n){this.input=e,this.list=n,this.isComposing=!1,n.id||(n.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=e=>function(e,n){if(e.shiftKey||e.metaKey||e.altKey)return;if(!t&&e.ctrlKey)return;if(n.isComposing)return;switch(e.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)})(n.input,n.list)&&e.preventDefault();break;case"Escape":n.clearSelection();break;case"ArrowDown":n.navigate(1),e.preventDefault();break;case"ArrowUp":n.navigate(-1),e.preventDefault();break;case"n":t&&e.ctrlKey&&(n.navigate(1),e.preventDefault());break;case"p":t&&e.ctrlKey&&(n.navigate(-1),e.preventDefault());break;default:if(e.ctrlKey)break;n.clearSelection()}}(e,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),e.setAttribute("role","combobox"),e.setAttribute("aria-controls",n.id),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",n)}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",n)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(i)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(i),s=n.indexOf(e);if(s===n.length-1&&1===t||0===s&&-1===t)return this.clearSelection(),void this.input.focus();let r=1===t?0:n.length-1;if(e&&s>=0){const e=s+t;e>=0&&e<n.length&&(r=e)}const a=n[r];if(a)for(const t of n)a===t?(this.input.setAttribute("aria-activedescendant",a.id),a.setAttribute("aria-selected","true"),o(this.list,a)):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 n(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 i(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function o(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)}class s extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const r=new WeakMap;function a(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=r.get(t);n&&n.abort();r.set(t,e);const i=()=>r.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 c=window.testScreenReaderDelay||100;class l{constructor(t,n,i,o=!1){var s;if(this.container=t,this.input=n,this.results=i,this.combobox=new e(n,i),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=o,this.clearButton=document.getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=i.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.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===(s=this.clearButton)||void 0===s||s.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),"true"===this.input.getAttribute("aria-expanded")&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.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.innerHTML&&(this.feedback.innerHTML=""),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.innerHTML=t)}),c)}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")),a(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)}}const u=new WeakMap;class d extends HTMLElement{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");u.set(this,new l(this,e,n,i)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=u.get(this);t&&(t.destroy(),u.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=u.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 s("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function h(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 f(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),h(n),e.removeChild(n),Promise.resolve()}function m(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)f(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?f(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?f(o.href):h(o)).then(i)}var o}function p(t){const e=t.currentTarget;e instanceof HTMLElement&&m(e)}function b(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),m(e))}}function g(t){t.currentTarget.addEventListener("keydown",b)}function w(t){t.currentTarget.removeEventListener("keydown",b)}window.customElements.get("auto-complete")||(window.AutocompleteElement=d,window.customElements.define("auto-complete",d));class v extends HTMLElement{constructor(){super(),this.addEventListener("click",p),this.addEventListener("focus",g),this.addEventListener("blur",w)}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=v,window.customElements.define("clipboard-copy",v));function y(t){t.style.display="inline-block"}function E(t){t.style.display="none"}const A=new WeakMap;document.addEventListener("clipboard-copy",(function({target:t}){if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=A.get(t);e?(clearTimeout(e),A.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(E(e),y(n))}(t),A.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(y(e),E(n))}(t),A.delete(t)}),2e3))}));class x extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Array.from(this.querySelectorAll('[role="tablist"] [role="tab"]')),i=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]'))));if("ArrowRight"===t.code){let t=i+1;t>=n.length&&(t=0),k(this,t)}else if("ArrowLeft"===t.code){let t=i-1;t<0&&(t=n.length-1),k(this,t)}else"Home"===t.code?(k(this,0),t.preventDefault()):"End"===t.code&&(k(this,n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=Array.from(this.querySelectorAll('[role="tablist"] [role="tab"]'));if(!(t.target instanceof Element))return;const n=t.target.closest('[role="tab"]');if(!n||!n.closest('[role="tablist"]'))return;k(this,e.indexOf(n))}))}connectedCallback(){for(const t of this.querySelectorAll('[role="tablist"] [role="tab"]'))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"))}}function k(t,e){const n=t.querySelectorAll('[role="tablist"] [role="tab"]'),i=t.querySelectorAll('[role="tabpanel"]'),o=n[e],s=i[e];if(!!t.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:s}}))){for(const t of n)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of i)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");o.setAttribute("aria-selected","true"),o.setAttribute("tabindex","0"),o.focus(),s.hidden=!1,t.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:s}}))}}window.customElements.get("tab-container")||(window.TabContainerElement=x,window.customElements.define("tab-container",x));const M=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],T=["January","February","March","April","May","June","July","August","September","October","November","December"];function L(t){return`0${t}`.slice(-2)}function S(t,e){const n=t.getDay(),i=t.getDate(),o=t.getMonth(),s=t.getFullYear(),r=t.getHours(),a=t.getMinutes(),c=t.getSeconds();return e.replace(/%([%aAbBcdeHIlmMpPSwyYZz])/g,(function(e){let l;switch(e[1]){case"%":return"%";case"a":return M[n].slice(0,3);case"A":return M[n];case"b":return T[o].slice(0,3);case"B":return T[o];case"c":return t.toString();case"d":return L(i);case"e":return String(i);case"H":return L(r);case"I":return L(S(t,"%l"));case"l":return String(0===r||12===r?12:(r+12)%12);case"m":return L(o+1);case"M":return L(a);case"p":return r>11?"PM":"AM";case"P":return r>11?"pm":"am";case"S":return L(c);case"w":return String(n);case"y":return L(s%100);case"Y":return String(s);case"Z":return l=t.toString().match(/\((\w+)\)$/),l?l[1]:"";case"z":return l=t.toString().match(/\w([+-]\d\d\d\d) /),l?l[1]:""}return""}))}function C(t){let e;return function(){if(e)return e;if("Intl"in window)try{return e=new Intl.DateTimeFormat(void 0,t),e}catch(t){if(!(t instanceof RangeError))throw t}}}let H=null;const D=C({day:"numeric",month:"short"});function $(){if(null!==H)return H;const t=D();if(t){const e=t.format(new Date(0));return H=!!e.match(/^\d/),H}return!1}let F=null;const R=C({day:"numeric",month:"short",year:"numeric"});function I(t){const e=t.closest("[lang]");return e instanceof HTMLElement&&e.lang?e.lang:"default"}const q=new WeakMap;class W extends HTMLElement{static get observedAttributes(){return["datetime","day","format","lang","hour","minute","month","second","title","weekday","year","time-zone-name"]}connectedCallback(){const t=this.getFormattedTitle();t&&!this.hasAttribute("title")&&this.setAttribute("title",t);const e=this.getFormattedDate();e&&(this.textContent=e)}attributeChangedCallback(t,e,n){const i=this.getFormattedTitle();if("datetime"===t){const t=Date.parse(n);isNaN(t)?q.delete(this):q.set(this,new Date(t))}const o=this.getFormattedTitle(),s=this.getAttribute("title");"title"===t||!o||s&&s!==i||this.setAttribute("title",o);const r=this.getFormattedDate();r&&(this.textContent=r)}get date(){return q.get(this)}getFormattedTitle(){const t=this.date;if(!t)return;const e=B();if(e)return e.format(t);try{return t.toLocaleString()}catch(e){if(e instanceof RangeError)return t.toString();throw e}}getFormattedDate(){}}const B=C({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),O=new WeakMap;class Y extends W{attributeChangedCallback(t,e,n){"hour"!==t&&"minute"!==t&&"second"!==t&&"time-zone-name"!==t||O.delete(this),super.attributeChangedCallback(t,e,n)}getFormattedDate(){const t=this.date;if(!t)return;return`${function(t,e){const n={weekday:{short:"%a",long:"%A"},day:{numeric:"%e","2-digit":"%d"},month:{short:"%b",long:"%B"},year:{numeric:"%Y","2-digit":"%y"}};let i=$()?"weekday day month year":"weekday month day, year";for(const e in n){const o=n[e][t.getAttribute(e)||""];i=i.replace(e,o||"")}return i=i.replace(/(\s,)|(,\s$)/,""),S(e,i).replace(/\s+/," ").trim()}(this,t)||""} ${function(t,e){const n={},i=t.getAttribute("hour");"numeric"!==i&&"2-digit"!==i||(n.hour=i);const o=t.getAttribute("minute");"numeric"!==o&&"2-digit"!==o||(n.minute=o);const s=t.getAttribute("second");"numeric"!==s&&"2-digit"!==s||(n.second=s);const r=t.getAttribute("time-zone-name");"short"!==r&&"long"!==r||(n.timeZoneName=r);if(0===Object.keys(n).length)return;let a=O.get(t);a||(a=C(n),O.set(t,a));const c=a();if(c)return c.format(e);return S(e,n.second?"%H:%M:%S":"%H:%M")}(this,t)||""}`.trim()}}window.customElements.get("local-time")||(window.LocalTimeElement=Y,window.customElements.define("local-time",Y));class X{constructor(t,e){this.date=t,this.locale=e}toString(){const t=this.timeElapsed();if(t)return t;{const t=this.timeAhead();return t||`on ${this.formatDate()}`}}timeElapsed(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24);return t>=0&&o<30?this.timeAgoFromMs(t):null}timeAhead(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24);return t>=0&&o<30?this.timeUntil():null}timeAgo(){const t=(new Date).getTime()-this.date.getTime();return this.timeAgoFromMs(t)}timeAgoFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return t<0||e<10?K(this.locale,0,"second"):e<45?K(this.locale,-e,"second"):e<90||n<45?K(this.locale,-n,"minute"):n<90||i<24?K(this.locale,-i,"hour"):i<36||o<30?K(this.locale,-o,"day"):s<18?K(this.locale,-s,"month"):K(this.locale,-r,"year")}microTimeAgo(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return n<1?"1m":n<60?`${n}m`:i<24?`${i}h`:o<365?`${o}d`:`${r}y`}timeUntil(){const t=this.date.getTime()-(new Date).getTime();return this.timeUntilFromMs(t)}timeUntilFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return s>=18||s>=12?K(this.locale,r,"year"):o>=45||o>=30?K(this.locale,s,"month"):i>=36||i>=24?K(this.locale,o,"day"):n>=90||n>=45?K(this.locale,i,"hour"):e>=90||e>=45?K(this.locale,n,"minute"):K(this.locale,e>=10?e:0,"second")}microTimeUntil(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return o>=365?`${r}y`:i>=24?`${o}d`:n>=60?`${i}h`:n>1?`${n}m`:"1m"}formatDate(){let t=$()?"%e %b":"%b %e";var e;return e=this.date,(new Date).getUTCFullYear()!==e.getUTCFullYear()&&(t+=function(){if(null!==F)return F;const t=R();if(t){const e=t.format(new Date(0));return F=!!e.match(/\d,/),F}return!0}()?", %Y":" %Y"),S(this.date,t)}formatTime(){const t=P();return t?t.format(this.date):S(this.date,"%l:%M%P")}}function K(t,e,n){const i=function(t,e){if("Intl"in window&&"RelativeTimeFormat"in window.Intl)try{return new Intl.RelativeTimeFormat(t,e)}catch(t){if(!(t instanceof RangeError))throw t}}(t,{numeric:"auto"});return i?i.format(e,n):function(t,e){if(0===t)switch(e){case"year":case"quarter":case"month":case"week":return`this ${e}`;case"day":return"today";case"hour":case"minute":return`in 0 ${e}s`;case"second":return"now"}else if(1===t)switch(e){case"year":case"quarter":case"month":case"week":return`next ${e}`;case"day":return"tomorrow";case"hour":case"minute":case"second":return`in 1 ${e}`}else if(-1===t)switch(e){case"year":case"quarter":case"month":case"week":return`last ${e}`;case"day":return"yesterday";case"hour":case"minute":case"second":return`1 ${e} ago`}else if(t>1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return`in ${t} ${e}s`}else if(t<-1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return`${-t} ${e}s ago`}throw new RangeError(`Invalid unit argument for format() '${e}'`)}(e,n)}const P=C({hour:"numeric",minute:"2-digit"});class U extends W{getFormattedDate(){const t=this.date;if(t)return new X(t,I(this)).toString()}connectedCallback(){z.push(this),N||(j(),N=window.setInterval(j,6e4)),super.connectedCallback()}disconnectedCallback(){const t=z.indexOf(this);-1!==t&&z.splice(t,1),z.length||N&&(clearInterval(N),N=null)}}const z=[];let N;function j(){let t,e,n;for(e=0,n=z.length;e<n;e++)t=z[e],t.textContent=t.getFormattedDate()||""}window.customElements.get("relative-time")||(window.RelativeTimeElement=U,window.customElements.define("relative-time",U));class Z extends U{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new X(e,I(this)).microTimeAgo():new X(e,I(this)).timeAgo()}}window.customElements.get("time-ago")||(window.TimeAgoElement=Z,window.customElements.define("time-ago",Z));class J extends U{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new X(e,I(this)).microTimeUntil():new X(e,I(this)).timeUntil()}}window.customElements.get("time-until")||(window.TimeUntilElement=J,window.customElements.define("time-until",J));const G=new WeakMap,Q=new WeakMap,V=new WeakMap;function _(t){const e=t.currentTarget;if(!(e instanceof at))return;const{box:n,image:i}=V.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(Q.has(e)&&t instanceof MouseEvent){const n=Q.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(Q.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=Q.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`,rt(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)Q.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];Q.set(e,{dragStartX:n,dragStartY:i})}}function tt(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=et(e);if(!(n instanceof at))return;const{box:i}=V.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return ot(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,G.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=G.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=G.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&&it(n,s,r,!(t instanceof KeyboardEvent))}function et(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function nt(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=et(e);if(!(n instanceof at))return;const{box:i}=V.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",tt),n.addEventListener("touchmove",tt,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),G.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),tt(t)}else n.addEventListener("mousemove",_),n.addEventListener("touchmove",_,{passive:!0})}function it(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=G.get(t);if(!s)return;const{box:r,image:a}=V.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 c=i?Math.round(Math.max(0,e>0?s.startX:s.startX-o)):r.offsetLeft,l=i?Math.round(Math.max(0,n>0?s.startY:s.startY-o)):r.offsetTop;r.style.left=`${c}px`,r.style.top=`${l}px`,r.style.width=`${o}px`,r.style.height=`${o}px`,rt(t,{x:c,y:l,width:o,height:o})}function ot(t){const{image:e}=V.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);G.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),it(t,n,n)}function st(t){const e=t.currentTarget;e instanceof at&&(Q.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",tt),e.removeEventListener("mousemove",_),e.removeEventListener("touchmove",tt),e.removeEventListener("touchmove",_))}function rt(t,e){const{image:n}=V.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 at extends HTMLElement{connectedCallback(){if(V.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&&(V.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,ot(this)})),this.addEventListener("mouseleave",st),this.addEventListener("touchend",st),this.addEventListener("mouseup",st),e.addEventListener("mousedown",nt),e.addEventListener("touchstart",nt,{passive:!0}),this.addEventListener("keydown",_),this.addEventListener("keydown",tt),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}=V.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}window.customElements.get("image-crop")||(window.ImageCropElement=at,window.customElements.define("image-crop",at));class ct 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=[dt(t,"compositionstart",(t=>Et(this,t))),dt(t,"compositionend",(t=>Et(this,t))),dt(t,"click",(e=>gt(t,e))),dt(t,"change",(e=>gt(t,e))),dt(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=lt.get(e);if(!i||i.isComposing)return;const o=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(yt(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=pt(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=pt(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(bt&&n.ctrlKey){const e=pt(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(bt&&n.ctrlKey){const e=pt(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&vt(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),dt(t,"toggle",(()=>ht(t,this)),{once:!0}),dt(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?dt(t,"mouseover",(()=>ht(t,this)),{once:!0}):ut,...ft(t)];lt.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=lt.get(this);if(t){lt.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const lt=new WeakMap,ut={unsubscribe(){}};function dt(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function ht(t,e){const n=e.getAttribute("src");if(!n)return;const i=lt.get(e);if(!i)return;if(i.loaded)return;i.loaded=!0;const o=e.querySelector("include-fragment");o&&!o.hasAttribute("src")&&(o.addEventListener("loadend",(()=>mt(t))),o.setAttribute("src",n))}function ft(t){let e=!1;return[dt(t,"mousedown",(()=>e=!0)),dt(t,"keydown",(()=>e=!1)),dt(t,"toggle",(()=>{t.hasAttribute("open")&&(mt(t)||e||function(t){const e=document.activeElement;if(e&&vt(e)&&t.contains(e))return;const n=pt(t,!0);n&&n.focus()}(t))}))]}function mt(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function pt(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled]):not([aria-disabled="true"])')),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 bt=navigator.userAgent.match(/Macintosh/);function gt(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||wt(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&wt(e,t)}}function wt(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")&&yt(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function vt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function yt(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Et(t,e){const n=lt.get(t);n&&(n.isComposing="compositionstart"===e.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=ct,window.customElements.define("details-menu",ct));const At={"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"]},xt={start:["end","center"],end:["start","center"],center:["end","start"]};function kt(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,c]=[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-c,n===document.body?window.innerHeight:-1/0)}}(i),s=getComputedStyle(i),r=i.getBoundingClientRect(),[a,c]=[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:c}){const l={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let u=Ht(n,i,o,s,a,c),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=At[o];let f=0;if(r){let t=o;for(;f<r.length&&Dt(t,u,l,n);){const o=r[f++];t=o,u=Ht(n,i,o,s,a,c),u.top-=e.top,u.left-=e.left,d=o}}const m=xt[s];let p=0;if(m){let t=s;for(;p<m.length&&$t(t,u,l,n);){const o=m[p++];t=o,u=Ht(n,i,d,o,a,c),u.top-=e.top,u.left-=e.left,h=o}}u.top<l.top&&(u.top=l.top),u.left<l.left&&(u.left=l.left),u.left+n.width>t.width+l.left&&(u.left=t.width+l.left-n.width),r&&f<r.length&&u.top+n.height>t.height+l.top&&(u.top=t.height+l.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(o,{top:r.top+a,left:r.left+c},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:Mt,a=null!==(n=t.align)&&void 0!==n?n:Tt;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:Lt,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?St:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:Ct}}(n))}const Mt="outside-bottom",Tt="start",Lt=4,St=4,Ct=!1;function Ht(t,e,n,i,o,s){const r=e.left+e.width,a=e.top+e.height;let c=-1,l=-1;return"outside-top"===n?c=e.top-o-t.height:"outside-bottom"===n?c=a+o:"outside-left"===n?l=e.left-o-t.width:"outside-right"===n&&(l=r+o),"outside-top"!==n&&"outside-bottom"!==n||(l="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||(c="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?c=e.top+o:"inside-bottom"===n?c=a-o-t.height:"inside-left"===n?l=e.left+o:"inside-right"===n?l=r-o-t.width:"inside-center"===n&&(l=(r+e.left)/2-t.width/2+o),"inside-top"===n||"inside-bottom"===n?l="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||(c="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:c,left:l}}function Dt(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 $t(t,e,n,i){return"end"===t?e.left<n.left:"start"===t||"center"===t?e.left+i.width>n.left+n.width:void 0}var Ft,Rt,It,qt,Wt,Bt,Ot,Yt=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},Xt=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 Kt=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class Pt extends HTMLElement{constructor(){super(...arguments),Ft.add(this),Rt.set(this,void 0),It.set(this,"center"),qt.set(this,"outside-bottom"),Wt.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)}connectedCallback(){var t;if(this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n ${this.styles()}\n </style>\n <slot></slot>\n `,this.hidden=!0,Yt(this,Wt,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=Xt(this,Rt,"f"))||void 0===t||t.abort(),Yt(this,Rt,new AbortController,"f");const{signal:e}=Xt(this,Rt,"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}),Xt(this,Ft,"m",Bt).call(this)}disconnectedCallback(){var t;null===(t=Xt(this,Rt,"f"))||void 0===t||t.abort()}handleEvent(t){this.control&&("mouseenter"!==t.type&&"focus"!==t.type||!this.hidden?"blur"===t.type||"mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hidden=!0:"keydown"!==t.type||"Escape"!==t.key||this.hidden||(this.hidden=!0):this.hidden=!1)}attributeChangedCallback(t){if("id"===t||"data-type"===t){if(!this.id||!this.control)return;if("label"===this.type)this.control.setAttribute("aria-labelledby",this.id);else{let t=this.control.getAttribute("aria-describedby");t=t?`${t} ${this.id}`:this.id,this.control.setAttribute("aria-describedby",t)}}else if(this.isConnected&&"hidden"===t)Xt(this,Ft,"m",Bt).call(this);else if("data-direction"===t){this.classList.remove(...Kt);const t=this.direction;"n"===t?(Yt(this,It,"center","f"),Yt(this,qt,"outside-top","f")):"ne"===t?(Yt(this,It,"start","f"),Yt(this,qt,"outside-top","f")):"e"===t?(Yt(this,It,"center","f"),Yt(this,qt,"outside-right","f")):"se"===t?(Yt(this,It,"start","f"),Yt(this,qt,"outside-bottom","f")):"s"===t?(Yt(this,It,"center","f"),Yt(this,qt,"outside-bottom","f")):"sw"===t?(Yt(this,It,"end","f"),Yt(this,qt,"outside-bottom","f")):"w"===t?(Yt(this,It,"center","f"),Yt(this,qt,"outside-left","f")):"nw"===t&&(Yt(this,It,"end","f"),Yt(this,qt,"outside-top","f"))}}}Rt=new WeakMap,It=new WeakMap,qt=new WeakMap,Wt=new WeakMap,Ft=new WeakSet,Bt=function(){if(this.hidden)this.classList.remove("tooltip-open",...Kt);else{this.classList.add("tooltip-open");for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hidden=!0);Xt(this,Ft,"m",Ot).call(this)}},Ot=function(){if(!this.control)return;if(!Xt(this,Wt,"f")||this.hidden)return;this.style.left="0px";const t=kt(this,this.control,{side:Xt(this,qt,"f"),align:Xt(this,It,"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}`)},Pt.observedAttributes=["data-type","data-direction","id","hidden"],window.customElements.get("tool-tip")||(window.ToolTipElement=Pt,window.customElements.define("tool-tip",Pt));
|
1
|
+
const t=!!navigator.userAgent.match(/Macintosh/);class e{constructor(e,n){this.input=e,this.list=n,this.isComposing=!1,n.id||(n.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=e=>function(e,n){if(e.shiftKey||e.metaKey||e.altKey)return;if(!t&&e.ctrlKey)return;if(n.isComposing)return;switch(e.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)})(n.input,n.list)&&e.preventDefault();break;case"Escape":n.clearSelection();break;case"ArrowDown":n.navigate(1),e.preventDefault();break;case"ArrowUp":n.navigate(-1),e.preventDefault();break;case"n":t&&e.ctrlKey&&(n.navigate(1),e.preventDefault());break;case"p":t&&e.ctrlKey&&(n.navigate(-1),e.preventDefault());break;default:if(e.ctrlKey)break;n.clearSelection()}}(e,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),e.setAttribute("role","combobox"),e.setAttribute("aria-controls",n.id),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",n)}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",n)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(i)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(i),s=n.indexOf(e);if(s===n.length-1&&1===t||0===s&&-1===t)return this.clearSelection(),void this.input.focus();let r=1===t?0:n.length-1;if(e&&s>=0){const e=s+t;e>=0&&e<n.length&&(r=e)}const a=n[r];if(a)for(const t of n)a===t?(this.input.setAttribute("aria-activedescendant",a.id),a.setAttribute("aria-selected","true"),o(this.list,a)):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 n(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 i(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function o(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)}class s extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const r=new WeakMap;function a(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=r.get(t);n&&n.abort();r.set(t,e);const i=()=>r.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 c=window.testScreenReaderDelay||100;class l{constructor(t,n,i,o=!1){var s;if(this.container=t,this.input=n,this.results=i,this.combobox=new e(n,i),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=o,this.clearButton=document.getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=i.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.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===(s=this.clearButton)||void 0===s||s.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),"true"===this.input.getAttribute("aria-expanded")&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.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.innerHTML&&(this.feedback.innerHTML=""),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.innerHTML=t)}),c)}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")),a(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)}}const u=new WeakMap;class d extends HTMLElement{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");u.set(this,new l(this,e,n,i)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=u.get(this);t&&(t.destroy(),u.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=u.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 s("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function h(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 f(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),h(n),e.removeChild(n),Promise.resolve()}function m(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)f(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?f(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?f(o.href):h(o)).then(i)}var o}function p(t){const e=t.currentTarget;e instanceof HTMLElement&&m(e)}function b(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),m(e))}}function g(t){t.currentTarget.addEventListener("keydown",b)}function w(t){t.currentTarget.removeEventListener("keydown",b)}window.customElements.get("auto-complete")||(window.AutocompleteElement=d,window.customElements.define("auto-complete",d));class v extends HTMLElement{constructor(){super(),this.addEventListener("click",p),this.addEventListener("focus",g),this.addEventListener("blur",w)}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=v,window.customElements.define("clipboard-copy",v));function y(t){t.style.display="inline-block"}function E(t){t.style.display="none"}const A=new WeakMap;document.addEventListener("clipboard-copy",(function({target:t}){if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=A.get(t);e?(clearTimeout(e),A.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(E(e),y(n))}(t),A.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(y(e),E(n))}(t),A.delete(t)}),2e3))}));class x extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Array.from(this.querySelectorAll('[role="tablist"] [role="tab"]')),i=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]'))));if("ArrowRight"===t.code){let t=i+1;t>=n.length&&(t=0),k(this,t)}else if("ArrowLeft"===t.code){let t=i-1;t<0&&(t=n.length-1),k(this,t)}else"Home"===t.code?(k(this,0),t.preventDefault()):"End"===t.code&&(k(this,n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=Array.from(this.querySelectorAll('[role="tablist"] [role="tab"]'));if(!(t.target instanceof Element))return;const n=t.target.closest('[role="tab"]');if(!n||!n.closest('[role="tablist"]'))return;k(this,e.indexOf(n))}))}connectedCallback(){for(const t of this.querySelectorAll('[role="tablist"] [role="tab"]'))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"))}}function k(t,e){const n=t.querySelectorAll('[role="tablist"] [role="tab"]'),i=t.querySelectorAll('[role="tabpanel"]'),o=n[e],s=i[e];if(!!t.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:s}}))){for(const t of n)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of i)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");o.setAttribute("aria-selected","true"),o.setAttribute("tabindex","0"),o.focus(),s.hidden=!1,t.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:s}}))}}window.customElements.get("tab-container")||(window.TabContainerElement=x,window.customElements.define("tab-container",x));const M=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],T=["January","February","March","April","May","June","July","August","September","October","November","December"];function L(t){return`0${t}`.slice(-2)}function S(t,e){const n=t.getDay(),i=t.getDate(),o=t.getMonth(),s=t.getFullYear(),r=t.getHours(),a=t.getMinutes(),c=t.getSeconds();return e.replace(/%([%aAbBcdeHIlmMpPSwyYZz])/g,(function(e){let l;switch(e[1]){case"%":return"%";case"a":return M[n].slice(0,3);case"A":return M[n];case"b":return T[o].slice(0,3);case"B":return T[o];case"c":return t.toString();case"d":return L(i);case"e":return String(i);case"H":return L(r);case"I":return L(S(t,"%l"));case"l":return String(0===r||12===r?12:(r+12)%12);case"m":return L(o+1);case"M":return L(a);case"p":return r>11?"PM":"AM";case"P":return r>11?"pm":"am";case"S":return L(c);case"w":return String(n);case"y":return L(s%100);case"Y":return String(s);case"Z":return l=t.toString().match(/\((\w+)\)$/),l?l[1]:"";case"z":return l=t.toString().match(/\w([+-]\d\d\d\d) /),l?l[1]:""}return""}))}function C(t){let e;return function(){if(e)return e;if("Intl"in window)try{return e=new Intl.DateTimeFormat(void 0,t),e}catch(t){if(!(t instanceof RangeError))throw t}}}let H=null;const D=C({day:"numeric",month:"short"});function $(){if(null!==H)return H;const t=D();if(t){const e=t.format(new Date(0));return H=!!e.match(/^\d/),H}return!1}let R=null;const F=C({day:"numeric",month:"short",year:"numeric"});function I(t){const e=t.closest("[lang]");return e instanceof HTMLElement&&e.lang?e.lang:"default"}const q=new WeakMap;class W extends HTMLElement{static get observedAttributes(){return["datetime","day","format","lang","hour","minute","month","second","title","weekday","year","time-zone-name"]}connectedCallback(){const t=this.getFormattedTitle();t&&!this.hasAttribute("title")&&this.setAttribute("title",t);const e=this.getFormattedDate();e&&(this.textContent=e)}attributeChangedCallback(t,e,n){const i=this.getFormattedTitle();if("datetime"===t){const t=Date.parse(n);isNaN(t)?q.delete(this):q.set(this,new Date(t))}const o=this.getFormattedTitle(),s=this.getAttribute("title");"title"===t||!o||s&&s!==i||this.setAttribute("title",o);const r=this.getFormattedDate();r&&(this.textContent=r)}get date(){return q.get(this)}getFormattedTitle(){const t=this.date;if(!t)return;const e=B();if(e)return e.format(t);try{return t.toLocaleString()}catch(e){if(e instanceof RangeError)return t.toString();throw e}}getFormattedDate(){}}const B=C({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),O=new WeakMap;class Y extends W{attributeChangedCallback(t,e,n){"hour"!==t&&"minute"!==t&&"second"!==t&&"time-zone-name"!==t||O.delete(this),super.attributeChangedCallback(t,e,n)}getFormattedDate(){const t=this.date;if(!t)return;return`${function(t,e){const n={weekday:{short:"%a",long:"%A"},day:{numeric:"%e","2-digit":"%d"},month:{short:"%b",long:"%B"},year:{numeric:"%Y","2-digit":"%y"}};let i=$()?"weekday day month year":"weekday month day, year";for(const e in n){const o=n[e][t.getAttribute(e)||""];i=i.replace(e,o||"")}return i=i.replace(/(\s,)|(,\s$)/,""),S(e,i).replace(/\s+/," ").trim()}(this,t)||""} ${function(t,e){const n={},i=t.getAttribute("hour");"numeric"!==i&&"2-digit"!==i||(n.hour=i);const o=t.getAttribute("minute");"numeric"!==o&&"2-digit"!==o||(n.minute=o);const s=t.getAttribute("second");"numeric"!==s&&"2-digit"!==s||(n.second=s);const r=t.getAttribute("time-zone-name");"short"!==r&&"long"!==r||(n.timeZoneName=r);if(0===Object.keys(n).length)return;let a=O.get(t);a||(a=C(n),O.set(t,a));const c=a();if(c)return c.format(e);return S(e,n.second?"%H:%M:%S":"%H:%M")}(this,t)||""}`.trim()}}window.customElements.get("local-time")||(window.LocalTimeElement=Y,window.customElements.define("local-time",Y));class X{constructor(t,e){this.date=t,this.locale=e}toString(){const t=this.timeElapsed();if(t)return t;{const t=this.timeAhead();return t||`on ${this.formatDate()}`}}timeElapsed(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24);return t>=0&&o<30?this.timeAgoFromMs(t):null}timeAhead(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24);return t>=0&&o<30?this.timeUntil():null}timeAgo(){const t=(new Date).getTime()-this.date.getTime();return this.timeAgoFromMs(t)}timeAgoFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return t<0||e<10?K(this.locale,0,"second"):e<45?K(this.locale,-e,"second"):e<90||n<45?K(this.locale,-n,"minute"):n<90||i<24?K(this.locale,-i,"hour"):i<36||o<30?K(this.locale,-o,"day"):s<18?K(this.locale,-s,"month"):K(this.locale,-r,"year")}microTimeAgo(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return n<1?"1m":n<60?`${n}m`:i<24?`${i}h`:o<365?`${o}d`:`${r}y`}timeUntil(){const t=this.date.getTime()-(new Date).getTime();return this.timeUntilFromMs(t)}timeUntilFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return s>=18||s>=12?K(this.locale,r,"year"):o>=45||o>=30?K(this.locale,s,"month"):i>=36||i>=24?K(this.locale,o,"day"):n>=90||n>=45?K(this.locale,i,"hour"):e>=90||e>=45?K(this.locale,n,"minute"):K(this.locale,e>=10?e:0,"second")}microTimeUntil(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return o>=365?`${r}y`:i>=24?`${o}d`:n>=60?`${i}h`:n>1?`${n}m`:"1m"}formatDate(){let t=$()?"%e %b":"%b %e";var e;return e=this.date,(new Date).getUTCFullYear()!==e.getUTCFullYear()&&(t+=function(){if(null!==R)return R;const t=F();if(t){const e=t.format(new Date(0));return R=!!e.match(/\d,/),R}return!0}()?", %Y":" %Y"),S(this.date,t)}formatTime(){const t=P();return t?t.format(this.date):S(this.date,"%l:%M%P")}}function K(t,e,n){const i=function(t,e){if("Intl"in window&&"RelativeTimeFormat"in window.Intl)try{return new Intl.RelativeTimeFormat(t,e)}catch(t){if(!(t instanceof RangeError))throw t}}(t,{numeric:"auto"});return i?i.format(e,n):function(t,e){if(0===t)switch(e){case"year":case"quarter":case"month":case"week":return`this ${e}`;case"day":return"today";case"hour":case"minute":return`in 0 ${e}s`;case"second":return"now"}else if(1===t)switch(e){case"year":case"quarter":case"month":case"week":return`next ${e}`;case"day":return"tomorrow";case"hour":case"minute":case"second":return`in 1 ${e}`}else if(-1===t)switch(e){case"year":case"quarter":case"month":case"week":return`last ${e}`;case"day":return"yesterday";case"hour":case"minute":case"second":return`1 ${e} ago`}else if(t>1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return`in ${t} ${e}s`}else if(t<-1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return`${-t} ${e}s ago`}throw new RangeError(`Invalid unit argument for format() '${e}'`)}(e,n)}const P=C({hour:"numeric",minute:"2-digit"});class U extends W{getFormattedDate(){const t=this.date;if(t)return new X(t,I(this)).toString()}connectedCallback(){z.push(this),N||(j(),N=window.setInterval(j,6e4)),super.connectedCallback()}disconnectedCallback(){const t=z.indexOf(this);-1!==t&&z.splice(t,1),z.length||N&&(clearInterval(N),N=null)}}const z=[];let N;function j(){let t,e,n;for(e=0,n=z.length;e<n;e++)t=z[e],t.textContent=t.getFormattedDate()||""}window.customElements.get("relative-time")||(window.RelativeTimeElement=U,window.customElements.define("relative-time",U));class Z extends U{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new X(e,I(this)).microTimeAgo():new X(e,I(this)).timeAgo()}}window.customElements.get("time-ago")||(window.TimeAgoElement=Z,window.customElements.define("time-ago",Z));class J extends U{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new X(e,I(this)).microTimeUntil():new X(e,I(this)).timeUntil()}}window.customElements.get("time-until")||(window.TimeUntilElement=J,window.customElements.define("time-until",J));const G=new WeakMap,Q=new WeakMap,V=new WeakMap;function _(t){const e=t.currentTarget;if(!(e instanceof at))return;const{box:n,image:i}=V.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(Q.has(e)&&t instanceof MouseEvent){const n=Q.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(Q.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=Q.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`,rt(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)Q.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];Q.set(e,{dragStartX:n,dragStartY:i})}}function tt(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=et(e);if(!(n instanceof at))return;const{box:i}=V.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return ot(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,G.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=G.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=G.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&&it(n,s,r,!(t instanceof KeyboardEvent))}function et(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function nt(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=et(e);if(!(n instanceof at))return;const{box:i}=V.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",tt),n.addEventListener("touchmove",tt,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),G.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),tt(t)}else n.addEventListener("mousemove",_),n.addEventListener("touchmove",_,{passive:!0})}function it(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=G.get(t);if(!s)return;const{box:r,image:a}=V.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 c=i?Math.round(Math.max(0,e>0?s.startX:s.startX-o)):r.offsetLeft,l=i?Math.round(Math.max(0,n>0?s.startY:s.startY-o)):r.offsetTop;r.style.left=`${c}px`,r.style.top=`${l}px`,r.style.width=`${o}px`,r.style.height=`${o}px`,rt(t,{x:c,y:l,width:o,height:o})}function ot(t){const{image:e}=V.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);G.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),it(t,n,n)}function st(t){const e=t.currentTarget;e instanceof at&&(Q.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",tt),e.removeEventListener("mousemove",_),e.removeEventListener("touchmove",tt),e.removeEventListener("touchmove",_))}function rt(t,e){const{image:n}=V.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 at extends HTMLElement{connectedCallback(){if(V.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&&(V.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,ot(this)})),this.addEventListener("mouseleave",st),this.addEventListener("touchend",st),this.addEventListener("mouseup",st),e.addEventListener("mousedown",nt),e.addEventListener("touchstart",nt,{passive:!0}),this.addEventListener("keydown",_),this.addEventListener("keydown",tt),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}=V.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}window.customElements.get("image-crop")||(window.ImageCropElement=at,window.customElements.define("image-crop",at));class ct 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=[dt(t,"compositionstart",(t=>Et(this,t))),dt(t,"compositionend",(t=>Et(this,t))),dt(t,"click",(e=>gt(t,e))),dt(t,"change",(e=>gt(t,e))),dt(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=lt.get(e);if(!i||i.isComposing)return;const o=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(yt(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=pt(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=pt(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(bt&&n.ctrlKey){const e=pt(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(bt&&n.ctrlKey){const e=pt(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&vt(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),dt(t,"toggle",(()=>ht(t,this)),{once:!0}),dt(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?dt(t,"mouseover",(()=>ht(t,this)),{once:!0}):ut,...ft(t)];lt.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=lt.get(this);if(t){lt.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const lt=new WeakMap,ut={unsubscribe(){}};function dt(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function ht(t,e){const n=e.getAttribute("src");if(!n)return;const i=lt.get(e);if(!i)return;if(i.loaded)return;i.loaded=!0;const o=e.querySelector("include-fragment");o&&!o.hasAttribute("src")&&(o.addEventListener("loadend",(()=>mt(t))),o.setAttribute("src",n))}function ft(t){let e=!1;return[dt(t,"mousedown",(()=>e=!0)),dt(t,"keydown",(()=>e=!1)),dt(t,"toggle",(()=>{t.hasAttribute("open")&&(mt(t)||e||function(t){const e=document.activeElement;if(e&&vt(e)&&t.contains(e))return;const n=pt(t,!0);n&&n.focus()}(t))}))]}function mt(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function pt(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled]):not([aria-disabled="true"])')),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 bt=navigator.userAgent.match(/Macintosh/);function gt(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||wt(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&wt(e,t)}}function wt(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")&&yt(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function vt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function yt(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Et(t,e){const n=lt.get(t);n&&(n.isComposing="compositionstart"===e.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=ct,window.customElements.define("details-menu",ct));const At={"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"]},xt={start:["end","center"],end:["start","center"],center:["end","start"]};function kt(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,c]=[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-c,n===document.body?window.innerHeight:-1/0)}}(i),s=getComputedStyle(i),r=i.getBoundingClientRect(),[a,c]=[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:c}){const l={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let u=Ht(n,i,o,s,a,c),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=At[o];let f=0;if(r){let t=o;for(;f<r.length&&Dt(t,u,l,n);){const o=r[f++];t=o,u=Ht(n,i,o,s,a,c),u.top-=e.top,u.left-=e.left,d=o}}const m=xt[s];let p=0;if(m){let t=s;for(;p<m.length&&$t(t,u,l,n);){const o=m[p++];t=o,u=Ht(n,i,d,o,a,c),u.top-=e.top,u.left-=e.left,h=o}}u.top<l.top&&(u.top=l.top),u.left<l.left&&(u.left=l.left),u.left+n.width>t.width+l.left&&(u.left=t.width+l.left-n.width),r&&f<r.length&&u.top+n.height>t.height+l.top&&(u.top=t.height+l.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(o,{top:r.top+a,left:r.left+c},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:Mt,a=null!==(n=t.align)&&void 0!==n?n:Tt;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:Lt,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?St:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:Ct}}(n))}const Mt="outside-bottom",Tt="start",Lt=4,St=4,Ct=!1;function Ht(t,e,n,i,o,s){const r=e.left+e.width,a=e.top+e.height;let c=-1,l=-1;return"outside-top"===n?c=e.top-o-t.height:"outside-bottom"===n?c=a+o:"outside-left"===n?l=e.left-o-t.width:"outside-right"===n&&(l=r+o),"outside-top"!==n&&"outside-bottom"!==n||(l="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||(c="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?c=e.top+o:"inside-bottom"===n?c=a-o-t.height:"inside-left"===n?l=e.left+o:"inside-right"===n?l=r-o-t.width:"inside-center"===n&&(l=(r+e.left)/2-t.width/2+o),"inside-top"===n||"inside-bottom"===n?l="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||(c="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:c,left:l}}function Dt(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 $t(t,e,n,i){return"end"===t?e.left<n.left:"start"===t||"center"===t?e.left+i.width>n.left+n.width:void 0}var Rt,Ft,It,qt,Wt,Bt,Ot,Yt=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},Xt=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 Kt=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class Pt extends HTMLElement{constructor(){super(...arguments),Rt.add(this),Ft.set(this,void 0),It.set(this,"center"),qt.set(this,"outside-bottom"),Wt.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)}connectedCallback(){var t;if(!this.shadowRoot){this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n ${this.styles()}\n </style>\n <slot></slot>\n `}if(this.hidden=!0,Yt(this,Wt,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=Xt(this,Ft,"f"))||void 0===t||t.abort(),Yt(this,Ft,new AbortController,"f");const{signal:e}=Xt(this,Ft,"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}),Xt(this,Rt,"m",Bt).call(this)}disconnectedCallback(){var t;null===(t=Xt(this,Ft,"f"))||void 0===t||t.abort()}handleEvent(t){this.control&&("mouseenter"!==t.type&&"focus"!==t.type||!this.hidden?"blur"===t.type||"mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hidden=!0:"keydown"!==t.type||"Escape"!==t.key||this.hidden||(this.hidden=!0):this.hidden=!1)}attributeChangedCallback(t){if("id"===t||"data-type"===t){if(!this.id||!this.control)return;if("label"===this.type)this.control.setAttribute("aria-labelledby",this.id);else{let t=this.control.getAttribute("aria-describedby");t=t?`${t} ${this.id}`:this.id,this.control.setAttribute("aria-describedby",t)}}else if(this.isConnected&&"hidden"===t)Xt(this,Rt,"m",Bt).call(this);else if("data-direction"===t){this.classList.remove(...Kt);const t=this.direction;"n"===t?(Yt(this,It,"center","f"),Yt(this,qt,"outside-top","f")):"ne"===t?(Yt(this,It,"start","f"),Yt(this,qt,"outside-top","f")):"e"===t?(Yt(this,It,"center","f"),Yt(this,qt,"outside-right","f")):"se"===t?(Yt(this,It,"start","f"),Yt(this,qt,"outside-bottom","f")):"s"===t?(Yt(this,It,"center","f"),Yt(this,qt,"outside-bottom","f")):"sw"===t?(Yt(this,It,"end","f"),Yt(this,qt,"outside-bottom","f")):"w"===t?(Yt(this,It,"center","f"),Yt(this,qt,"outside-left","f")):"nw"===t&&(Yt(this,It,"end","f"),Yt(this,qt,"outside-top","f"))}}}Ft=new WeakMap,It=new WeakMap,qt=new WeakMap,Wt=new WeakMap,Rt=new WeakSet,Bt=function(){if(this.hidden)this.classList.remove("tooltip-open",...Kt);else{this.classList.add("tooltip-open");for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hidden=!0);Xt(this,Rt,"m",Ot).call(this)}},Ot=function(){if(!this.control)return;if(!Xt(this,Wt,"f")||this.hidden)return;this.style.left="0px";const t=kt(this,this.control,{side:Xt(this,qt,"f"),align:Xt(this,It,"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}`)},Pt.observedAttributes=["data-type","data-direction","id","hidden"],window.customElements.get("tool-tip")||(window.ToolTipElement=Pt,window.customElements.define("tool-tip",Pt));
|
2
2
|
//# sourceMappingURL=primer_view_components.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"primer_view_components.js","sources":["../../../node_modules/@github/combobox-nav/dist/index.js","../../../node_modules/@github/auto-complete-element/dist/index.js","../../../node_modules/@github/clipboard-copy-element/dist/index.esm.js","../../components/primer/clipboard_copy_component.js","../../../node_modules/@github/tab-container-element/dist/index.js","../../../node_modules/@github/time-elements/dist/index.js","../../../node_modules/@github/image-crop-element/dist/index.js","../../../node_modules/@github/details-menu-element/dist/index.js","../../../node_modules/@primer/behaviors/dist/esm/anchored-position.js","../../components/primer/alpha/tool-tip-element.js"],"sourcesContent":["const ctrlBindings = !!navigator.userAgent.match(/Macintosh/);\nexport default class Combobox {\n constructor(input, list) {\n this.input = input;\n this.list = list;\n this.isComposing = false;\n if (!list.id) {\n list.id = `combobox-${Math.random()\n .toString()\n .slice(2, 6)}`;\n }\n this.keyboardEventHandler = event => keyboardBindings(event, this);\n this.compositionEventHandler = event => trackComposition(event, this);\n this.inputHandler = this.clearSelection.bind(this);\n input.setAttribute('role', 'combobox');\n input.setAttribute('aria-controls', list.id);\n input.setAttribute('aria-expanded', 'false');\n input.setAttribute('aria-autocomplete', 'list');\n input.setAttribute('aria-haspopup', 'listbox');\n }\n destroy() {\n this.clearSelection();\n this.stop();\n this.input.removeAttribute('role');\n this.input.removeAttribute('aria-controls');\n this.input.removeAttribute('aria-expanded');\n this.input.removeAttribute('aria-autocomplete');\n this.input.removeAttribute('aria-haspopup');\n }\n start() {\n this.input.setAttribute('aria-expanded', 'true');\n this.input.addEventListener('compositionstart', this.compositionEventHandler);\n this.input.addEventListener('compositionend', this.compositionEventHandler);\n this.input.addEventListener('input', this.inputHandler);\n this.input.addEventListener('keydown', this.keyboardEventHandler);\n this.list.addEventListener('click', commitWithElement);\n }\n stop() {\n this.clearSelection();\n this.input.setAttribute('aria-expanded', 'false');\n this.input.removeEventListener('compositionstart', this.compositionEventHandler);\n this.input.removeEventListener('compositionend', this.compositionEventHandler);\n this.input.removeEventListener('input', this.inputHandler);\n this.input.removeEventListener('keydown', this.keyboardEventHandler);\n this.list.removeEventListener('click', commitWithElement);\n }\n navigate(indexDiff = 1) {\n const focusEl = Array.from(this.list.querySelectorAll('[aria-selected=\"true\"]')).filter(visible)[0];\n const els = Array.from(this.list.querySelectorAll('[role=\"option\"]')).filter(visible);\n const focusIndex = els.indexOf(focusEl);\n if ((focusIndex === els.length - 1 && indexDiff === 1) || (focusIndex === 0 && indexDiff === -1)) {\n this.clearSelection();\n this.input.focus();\n return;\n }\n let indexOfItem = indexDiff === 1 ? 0 : els.length - 1;\n if (focusEl && focusIndex >= 0) {\n const newIndex = focusIndex + indexDiff;\n if (newIndex >= 0 && newIndex < els.length)\n indexOfItem = newIndex;\n }\n const target = els[indexOfItem];\n if (!target)\n return;\n for (const el of els) {\n if (target === el) {\n this.input.setAttribute('aria-activedescendant', target.id);\n target.setAttribute('aria-selected', 'true');\n scrollTo(this.list, target);\n }\n else {\n el.setAttribute('aria-selected', 'false');\n }\n }\n }\n clearSelection() {\n this.input.removeAttribute('aria-activedescendant');\n for (const el of this.list.querySelectorAll('[aria-selected=\"true\"]')) {\n el.setAttribute('aria-selected', 'false');\n }\n }\n}\nfunction keyboardBindings(event, combobox) {\n if (event.shiftKey || event.metaKey || event.altKey)\n return;\n if (!ctrlBindings && event.ctrlKey)\n return;\n if (combobox.isComposing)\n return;\n switch (event.key) {\n case 'Enter':\n case 'Tab':\n if (commit(combobox.input, combobox.list)) {\n event.preventDefault();\n }\n break;\n case 'Escape':\n combobox.clearSelection();\n break;\n case 'ArrowDown':\n combobox.navigate(1);\n event.preventDefault();\n break;\n case 'ArrowUp':\n combobox.navigate(-1);\n event.preventDefault();\n break;\n case 'n':\n if (ctrlBindings && event.ctrlKey) {\n combobox.navigate(1);\n event.preventDefault();\n }\n break;\n case 'p':\n if (ctrlBindings && event.ctrlKey) {\n combobox.navigate(-1);\n event.preventDefault();\n }\n break;\n default:\n if (event.ctrlKey)\n break;\n combobox.clearSelection();\n }\n}\nfunction commitWithElement(event) {\n if (!(event.target instanceof Element))\n return;\n const target = event.target.closest('[role=\"option\"]');\n if (!target)\n return;\n if (target.getAttribute('aria-disabled') === 'true')\n return;\n fireCommitEvent(target);\n}\nfunction commit(input, list) {\n const target = list.querySelector('[aria-selected=\"true\"]');\n if (!target)\n return false;\n if (target.getAttribute('aria-disabled') === 'true')\n return true;\n target.click();\n return true;\n}\nfunction fireCommitEvent(target) {\n target.dispatchEvent(new CustomEvent('combobox-commit', { bubbles: true }));\n}\nfunction visible(el) {\n return (!el.hidden &&\n !(el instanceof HTMLInputElement && el.type === 'hidden') &&\n (el.offsetWidth > 0 || el.offsetHeight > 0));\n}\nfunction trackComposition(event, combobox) {\n combobox.isComposing = event.type === 'compositionstart';\n const list = document.getElementById(combobox.input.getAttribute('aria-controls') || '');\n if (!list)\n return;\n combobox.clearSelection();\n}\nfunction scrollTo(container, target) {\n if (!inViewport(container, target)) {\n container.scrollTop = target.offsetTop;\n }\n}\nfunction inViewport(container, element) {\n const scrollTop = container.scrollTop;\n const containerBottom = scrollTop + container.clientHeight;\n const top = element.offsetTop;\n const bottom = top + element.clientHeight;\n return top >= scrollTop && bottom <= containerBottom;\n}\n","import Combobox from '@github/combobox-nav';\n\nclass AutocompleteEvent extends CustomEvent {\n constructor(type, init) {\n super(type, init);\n this.relatedTarget = init.relatedTarget;\n }\n}\n\nfunction debounce(callback, wait = 0) {\n let timeout;\n return function (...Rest) {\n clearTimeout(timeout);\n timeout = window.setTimeout(() => {\n clearTimeout(timeout);\n callback(...Rest);\n }, wait);\n };\n}\n\nconst requests = new WeakMap();\nfunction fragment(el, url) {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.setRequestHeader('Accept', 'text/fragment+html');\n return request(el, xhr);\n}\nfunction request(el, xhr) {\n const pending = requests.get(el);\n if (pending)\n pending.abort();\n requests.set(el, xhr);\n const clear = () => requests.delete(el);\n const result = send(xhr);\n result.then(clear, clear);\n return result;\n}\nfunction send(xhr) {\n return new Promise((resolve, reject) => {\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.responseText);\n }\n else {\n reject(new Error(xhr.responseText));\n }\n };\n xhr.onerror = reject;\n xhr.send();\n });\n}\n\nconst SCREEN_READER_DELAY = window.testScreenReaderDelay || 100;\nclass Autocomplete {\n constructor(container, input, results, autoselectEnabled = false) {\n var _a;\n this.container = container;\n this.input = input;\n this.results = results;\n this.combobox = new Combobox(input, results);\n this.feedback = document.getElementById(`${this.results.id}-feedback`);\n this.autoselectEnabled = autoselectEnabled;\n this.clearButton = document.getElementById(`${this.input.id || this.input.name}-clear`);\n this.clientOptions = results.querySelectorAll('[role=option]');\n if (this.feedback) {\n this.feedback.setAttribute('aria-live', 'polite');\n this.feedback.setAttribute('aria-atomic', 'true');\n }\n if (this.clearButton && !this.clearButton.getAttribute('aria-label')) {\n const labelElem = document.querySelector(`label[for=\"${this.input.name}\"]`);\n this.clearButton.setAttribute('aria-label', `clear:`);\n this.clearButton.setAttribute('aria-labelledby', `${this.clearButton.id} ${(labelElem === null || labelElem === void 0 ? void 0 : labelElem.id) || ''}`);\n }\n if (!this.input.getAttribute('aria-expanded')) {\n this.input.setAttribute('aria-expanded', 'false');\n }\n this.results.hidden = true;\n this.results.setAttribute('aria-label', 'results');\n this.input.setAttribute('autocomplete', 'off');\n this.input.setAttribute('spellcheck', 'false');\n this.interactingWithList = false;\n this.onInputChange = debounce(this.onInputChange.bind(this), 300);\n this.onResultsMouseDown = this.onResultsMouseDown.bind(this);\n this.onInputBlur = this.onInputBlur.bind(this);\n this.onInputFocus = this.onInputFocus.bind(this);\n this.onKeydown = this.onKeydown.bind(this);\n this.onCommit = this.onCommit.bind(this);\n this.handleClear = this.handleClear.bind(this);\n this.input.addEventListener('keydown', this.onKeydown);\n this.input.addEventListener('focus', this.onInputFocus);\n this.input.addEventListener('blur', this.onInputBlur);\n this.input.addEventListener('input', this.onInputChange);\n this.results.addEventListener('mousedown', this.onResultsMouseDown);\n this.results.addEventListener('combobox-commit', this.onCommit);\n (_a = this.clearButton) === null || _a === void 0 ? void 0 : _a.addEventListener('click', this.handleClear);\n }\n destroy() {\n this.input.removeEventListener('keydown', this.onKeydown);\n this.input.removeEventListener('focus', this.onInputFocus);\n this.input.removeEventListener('blur', this.onInputBlur);\n this.input.removeEventListener('input', this.onInputChange);\n this.results.removeEventListener('mousedown', this.onResultsMouseDown);\n this.results.removeEventListener('combobox-commit', this.onCommit);\n }\n handleClear(event) {\n event.preventDefault();\n if (this.input.getAttribute('aria-expanded') === 'true') {\n this.input.setAttribute('aria-expanded', 'false');\n this.updateFeedbackForScreenReaders('Results hidden.');\n }\n this.input.value = '';\n this.container.value = '';\n this.input.focus();\n this.input.dispatchEvent(new Event('change'));\n this.container.open = false;\n }\n onKeydown(event) {\n if (event.key === 'Enter' && this.container.open && this.autoselectEnabled) {\n const firstOption = this.results.children[0];\n if (firstOption) {\n event.stopPropagation();\n event.preventDefault();\n this.onCommit({ target: firstOption });\n }\n }\n if (event.key === 'Escape' && this.container.open) {\n this.container.open = false;\n event.stopPropagation();\n event.preventDefault();\n }\n else if (event.altKey && event.key === 'ArrowUp' && this.container.open) {\n this.container.open = false;\n event.stopPropagation();\n event.preventDefault();\n }\n else if (event.altKey && event.key === 'ArrowDown' && !this.container.open) {\n if (!this.input.value.trim())\n return;\n this.container.open = true;\n event.stopPropagation();\n event.preventDefault();\n }\n }\n onInputFocus() {\n this.fetchResults();\n }\n onInputBlur() {\n if (this.interactingWithList) {\n this.interactingWithList = false;\n return;\n }\n this.container.open = false;\n }\n onCommit({ target }) {\n const selected = target;\n if (!(selected instanceof HTMLElement))\n return;\n this.container.open = false;\n if (selected instanceof HTMLAnchorElement)\n return;\n const value = selected.getAttribute('data-autocomplete-value') || selected.textContent;\n this.updateFeedbackForScreenReaders(`${selected.textContent || ''} selected.`);\n this.container.value = value;\n if (!value) {\n this.updateFeedbackForScreenReaders(`Results hidden.`);\n }\n }\n onResultsMouseDown() {\n this.interactingWithList = true;\n }\n onInputChange() {\n if (this.feedback && this.feedback.innerHTML) {\n this.feedback.innerHTML = '';\n }\n this.container.removeAttribute('value');\n this.fetchResults();\n }\n identifyOptions() {\n let id = 0;\n for (const el of this.results.querySelectorAll('[role=\"option\"]:not([id])')) {\n el.id = `${this.results.id}-option-${id++}`;\n }\n }\n updateFeedbackForScreenReaders(inputString) {\n setTimeout(() => {\n if (this.feedback) {\n this.feedback.innerHTML = inputString;\n }\n }, SCREEN_READER_DELAY);\n }\n fetchResults() {\n const query = this.input.value.trim();\n if (!query) {\n this.container.open = false;\n return;\n }\n const src = this.container.src;\n if (!src)\n return;\n const url = new URL(src, window.location.href);\n const params = new URLSearchParams(url.search.slice(1));\n params.append('q', query);\n url.search = params.toString();\n this.container.dispatchEvent(new CustomEvent('loadstart'));\n fragment(this.input, url.toString())\n .then(html => {\n this.results.innerHTML = html;\n this.identifyOptions();\n const allNewOptions = this.results.querySelectorAll('[role=\"option\"]');\n const hasResults = !!allNewOptions.length;\n const numOptions = allNewOptions.length;\n const [firstOption] = allNewOptions;\n const firstOptionValue = firstOption === null || firstOption === void 0 ? void 0 : firstOption.textContent;\n if (this.autoselectEnabled && firstOptionValue) {\n this.updateFeedbackForScreenReaders(`${numOptions} results. ${firstOptionValue} is the top result: Press Enter to activate.`);\n }\n else {\n this.updateFeedbackForScreenReaders(`${numOptions || 'No'} results.`);\n }\n this.container.open = hasResults;\n this.container.dispatchEvent(new CustomEvent('load'));\n this.container.dispatchEvent(new CustomEvent('loadend'));\n })\n .catch(() => {\n this.container.dispatchEvent(new CustomEvent('error'));\n this.container.dispatchEvent(new CustomEvent('loadend'));\n });\n }\n open() {\n if (!this.results.hidden)\n return;\n this.combobox.start();\n this.results.hidden = false;\n }\n close() {\n if (this.results.hidden)\n return;\n this.combobox.stop();\n this.results.hidden = true;\n }\n}\n\nconst state = new WeakMap();\nclass AutocompleteElement extends HTMLElement {\n connectedCallback() {\n const listId = this.getAttribute('for');\n if (!listId)\n return;\n const input = this.querySelector('input');\n const results = document.getElementById(listId);\n if (!(input instanceof HTMLInputElement) || !results)\n return;\n const autoselectEnabled = this.getAttribute('data-autoselect') === 'true';\n state.set(this, new Autocomplete(this, input, results, autoselectEnabled));\n results.setAttribute('role', 'listbox');\n }\n disconnectedCallback() {\n const autocomplete = state.get(this);\n if (autocomplete) {\n autocomplete.destroy();\n state.delete(this);\n }\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(url) {\n this.setAttribute('src', url);\n }\n get value() {\n return this.getAttribute('value') || '';\n }\n set value(value) {\n this.setAttribute('value', value);\n }\n get open() {\n return this.hasAttribute('open');\n }\n set open(value) {\n if (value) {\n this.setAttribute('open', '');\n }\n else {\n this.removeAttribute('open');\n }\n }\n static get observedAttributes() {\n return ['open', 'value'];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (oldValue === newValue)\n return;\n const autocomplete = state.get(this);\n if (!autocomplete)\n return;\n switch (name) {\n case 'open':\n newValue === null ? autocomplete.close() : autocomplete.open();\n break;\n case 'value':\n if (newValue !== null) {\n autocomplete.input.value = newValue;\n }\n this.dispatchEvent(new AutocompleteEvent('auto-complete-change', {\n bubbles: true,\n relatedTarget: autocomplete.input\n }));\n break;\n }\n }\n}\nif (!window.customElements.get('auto-complete')) {\n window.AutocompleteElement = AutocompleteElement;\n window.customElements.define('auto-complete', AutocompleteElement);\n}\n\nexport default AutocompleteElement;\nexport { AutocompleteEvent };\n","function createNode(text) {\n const node = document.createElement('pre');\n node.style.width = '1px';\n node.style.height = '1px';\n node.style.position = 'fixed';\n node.style.top = '5px';\n node.textContent = text;\n return node;\n}\n\nfunction copyNode(node) {\n if ('clipboard' in navigator) {\n // eslint-disable-next-line flowtype/no-flow-fix-me-comments\n // $FlowFixMe Clipboard is not defined in Flow yet.\n return navigator.clipboard.writeText(node.textContent);\n }\n\n const selection = getSelection();\n\n if (selection == null) {\n return Promise.reject(new Error());\n }\n\n selection.removeAllRanges();\n const range = document.createRange();\n range.selectNodeContents(node);\n selection.addRange(range);\n document.execCommand('copy');\n selection.removeAllRanges();\n return Promise.resolve();\n}\nfunction copyText(text) {\n if ('clipboard' in navigator) {\n // eslint-disable-next-line flowtype/no-flow-fix-me-comments\n // $FlowFixMe Clipboard is not defined in Flow yet.\n return navigator.clipboard.writeText(text);\n }\n\n const body = document.body;\n\n if (!body) {\n return Promise.reject(new Error());\n }\n\n const node = createNode(text);\n body.appendChild(node);\n copyNode(node);\n body.removeChild(node);\n return Promise.resolve();\n}\n\nfunction copy(button) {\n const id = button.getAttribute('for');\n const text = button.getAttribute('value');\n\n function trigger() {\n button.dispatchEvent(new CustomEvent('clipboard-copy', {\n bubbles: true\n }));\n }\n\n if (text) {\n copyText(text).then(trigger);\n } else if (id) {\n const root = 'getRootNode' in Element.prototype ? button.getRootNode() : button.ownerDocument;\n if (!(root instanceof Document || 'ShadowRoot' in window && root instanceof ShadowRoot)) return;\n const node = root.getElementById(id);\n if (node) copyTarget(node).then(trigger);\n }\n}\n\nfunction copyTarget(content) {\n if (content instanceof HTMLInputElement || content instanceof HTMLTextAreaElement) {\n return copyText(content.value);\n } else if (content instanceof HTMLAnchorElement && content.hasAttribute('href')) {\n return copyText(content.href);\n } else {\n return copyNode(content);\n }\n}\n\nfunction clicked(event) {\n const button = event.currentTarget;\n\n if (button instanceof HTMLElement) {\n copy(button);\n }\n}\n\nfunction keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n const button = event.currentTarget;\n\n if (button instanceof HTMLElement) {\n event.preventDefault();\n copy(button);\n }\n }\n}\n\nfunction focused(event) {\n event.currentTarget.addEventListener('keydown', keydown);\n}\n\nfunction blurred(event) {\n event.currentTarget.removeEventListener('keydown', keydown);\n}\n\nclass ClipboardCopyElement extends HTMLElement {\n constructor() {\n super();\n this.addEventListener('click', clicked);\n this.addEventListener('focus', focused);\n this.addEventListener('blur', blurred);\n }\n\n connectedCallback() {\n if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', '0');\n }\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'button');\n }\n }\n\n get value() {\n return this.getAttribute('value') || '';\n }\n\n set value(text) {\n this.setAttribute('value', text);\n }\n\n}\n\nif (!window.customElements.get('clipboard-copy')) {\n window.ClipboardCopyElement = ClipboardCopyElement;\n window.customElements.define('clipboard-copy', ClipboardCopyElement);\n}\n\nexport default ClipboardCopyElement;\n","import '@github/clipboard-copy-element';\nconst CLIPBOARD_COPY_TIMER_DURATION = 2000;\nfunction showSVG(svg) {\n svg.style.display = 'inline-block';\n}\nfunction hideSVG(svg) {\n svg.style.display = 'none';\n}\n// Toggle a copy button.\nfunction showCopy(button) {\n const [copyIcon, checkIcon] = button.querySelectorAll('.octicon');\n if (!copyIcon || !checkIcon)\n return;\n showSVG(copyIcon);\n hideSVG(checkIcon);\n}\n// Toggle a copy button.\nfunction showCheck(button) {\n const [copyIcon, checkIcon] = button.querySelectorAll('.octicon');\n if (!copyIcon || !checkIcon)\n return;\n hideSVG(copyIcon);\n showSVG(checkIcon);\n}\nconst clipboardCopyElementTimers = new WeakMap();\ndocument.addEventListener('clipboard-copy', function ({ target }) {\n if (!(target instanceof HTMLElement))\n return;\n if (!target.hasAttribute('data-view-component'))\n return;\n const currentTimeout = clipboardCopyElementTimers.get(target);\n if (currentTimeout) {\n clearTimeout(currentTimeout);\n clipboardCopyElementTimers.delete(target);\n }\n else {\n showCheck(target);\n }\n clipboardCopyElementTimers.set(target, setTimeout(() => {\n showCopy(target);\n clipboardCopyElementTimers.delete(target);\n }, CLIPBOARD_COPY_TIMER_DURATION));\n});\n","export default class TabContainerElement extends HTMLElement {\n constructor() {\n super();\n this.addEventListener('keydown', (event) => {\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n if (target.getAttribute('role') !== 'tab' && !target.closest('[role=\"tablist\"]'))\n return;\n const tabs = Array.from(this.querySelectorAll('[role=\"tablist\"] [role=\"tab\"]'));\n const currentIndex = tabs.indexOf(tabs.find(tab => tab.matches('[aria-selected=\"true\"]')));\n if (event.code === 'ArrowRight') {\n let index = currentIndex + 1;\n if (index >= tabs.length)\n index = 0;\n selectTab(this, index);\n }\n else if (event.code === 'ArrowLeft') {\n let index = currentIndex - 1;\n if (index < 0)\n index = tabs.length - 1;\n selectTab(this, index);\n }\n else if (event.code === 'Home') {\n selectTab(this, 0);\n event.preventDefault();\n }\n else if (event.code === 'End') {\n selectTab(this, tabs.length - 1);\n event.preventDefault();\n }\n });\n this.addEventListener('click', (event) => {\n const tabs = Array.from(this.querySelectorAll('[role=\"tablist\"] [role=\"tab\"]'));\n if (!(event.target instanceof Element))\n return;\n const tab = event.target.closest('[role=\"tab\"]');\n if (!tab || !tab.closest('[role=\"tablist\"]'))\n return;\n const index = tabs.indexOf(tab);\n selectTab(this, index);\n });\n }\n connectedCallback() {\n for (const tab of this.querySelectorAll('[role=\"tablist\"] [role=\"tab\"]')) {\n if (!tab.hasAttribute('aria-selected')) {\n tab.setAttribute('aria-selected', 'false');\n }\n if (!tab.hasAttribute('tabindex')) {\n if (tab.getAttribute('aria-selected') === 'true') {\n tab.setAttribute('tabindex', '0');\n }\n else {\n tab.setAttribute('tabindex', '-1');\n }\n }\n }\n }\n}\nfunction selectTab(tabContainer, index) {\n const tabs = tabContainer.querySelectorAll('[role=\"tablist\"] [role=\"tab\"]');\n const panels = tabContainer.querySelectorAll('[role=\"tabpanel\"]');\n const selectedTab = tabs[index];\n const selectedPanel = panels[index];\n const cancelled = !tabContainer.dispatchEvent(new CustomEvent('tab-container-change', {\n bubbles: true,\n cancelable: true,\n detail: { relatedTarget: selectedPanel }\n }));\n if (cancelled)\n return;\n for (const tab of tabs) {\n tab.setAttribute('aria-selected', 'false');\n tab.setAttribute('tabindex', '-1');\n }\n for (const panel of panels) {\n panel.hidden = true;\n if (!panel.hasAttribute('tabindex') && !panel.hasAttribute('data-tab-container-no-tabstop')) {\n panel.setAttribute('tabindex', '0');\n }\n }\n selectedTab.setAttribute('aria-selected', 'true');\n selectedTab.setAttribute('tabindex', '0');\n selectedTab.focus();\n selectedPanel.hidden = false;\n tabContainer.dispatchEvent(new CustomEvent('tab-container-changed', {\n bubbles: true,\n detail: { relatedTarget: selectedPanel }\n }));\n}\nif (!window.customElements.get('tab-container')) {\n window.TabContainerElement = TabContainerElement;\n window.customElements.define('tab-container', TabContainerElement);\n}\n//# sourceMappingURL=index.js.map","const weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\nconst months = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n];\nfunction pad(num) {\n return `0${num}`.slice(-2);\n}\nfunction strftime(time, formatString) {\n const day = time.getDay();\n const date = time.getDate();\n const month = time.getMonth();\n const year = time.getFullYear();\n const hour = time.getHours();\n const minute = time.getMinutes();\n const second = time.getSeconds();\n return formatString.replace(/%([%aAbBcdeHIlmMpPSwyYZz])/g, function (_arg) {\n let match;\n const modifier = _arg[1];\n switch (modifier) {\n case '%':\n return '%';\n case 'a':\n return weekdays[day].slice(0, 3);\n case 'A':\n return weekdays[day];\n case 'b':\n return months[month].slice(0, 3);\n case 'B':\n return months[month];\n case 'c':\n return time.toString();\n case 'd':\n return pad(date);\n case 'e':\n return String(date);\n case 'H':\n return pad(hour);\n case 'I':\n return pad(strftime(time, '%l'));\n case 'l':\n if (hour === 0 || hour === 12) {\n return String(12);\n }\n else {\n return String((hour + 12) % 12);\n }\n case 'm':\n return pad(month + 1);\n case 'M':\n return pad(minute);\n case 'p':\n if (hour > 11) {\n return 'PM';\n }\n else {\n return 'AM';\n }\n case 'P':\n if (hour > 11) {\n return 'pm';\n }\n else {\n return 'am';\n }\n case 'S':\n return pad(second);\n case 'w':\n return String(day);\n case 'y':\n return pad(year % 100);\n case 'Y':\n return String(year);\n case 'Z':\n match = time.toString().match(/\\((\\w+)\\)$/);\n return match ? match[1] : '';\n case 'z':\n match = time.toString().match(/\\w([+-]\\d\\d\\d\\d) /);\n return match ? match[1] : '';\n }\n return '';\n });\n}\nfunction makeFormatter(options) {\n let format;\n return function () {\n if (format)\n return format;\n if ('Intl' in window) {\n try {\n format = new Intl.DateTimeFormat(undefined, options);\n return format;\n }\n catch (e) {\n if (!(e instanceof RangeError)) {\n throw e;\n }\n }\n }\n };\n}\nlet dayFirst = null;\nconst dayFirstFormatter = makeFormatter({ day: 'numeric', month: 'short' });\nfunction isDayFirst() {\n if (dayFirst !== null) {\n return dayFirst;\n }\n const formatter = dayFirstFormatter();\n if (formatter) {\n const output = formatter.format(new Date(0));\n dayFirst = !!output.match(/^\\d/);\n return dayFirst;\n }\n else {\n return false;\n }\n}\nlet yearSeparator = null;\nconst yearFormatter = makeFormatter({ day: 'numeric', month: 'short', year: 'numeric' });\nfunction isYearSeparator() {\n if (yearSeparator !== null) {\n return yearSeparator;\n }\n const formatter = yearFormatter();\n if (formatter) {\n const output = formatter.format(new Date(0));\n yearSeparator = !!output.match(/\\d,/);\n return yearSeparator;\n }\n else {\n return true;\n }\n}\nfunction isThisYear(date) {\n const now = new Date();\n return now.getUTCFullYear() === date.getUTCFullYear();\n}\nfunction makeRelativeFormat(locale, options) {\n if ('Intl' in window && 'RelativeTimeFormat' in window.Intl) {\n try {\n return new Intl.RelativeTimeFormat(locale, options);\n }\n catch (e) {\n if (!(e instanceof RangeError)) {\n throw e;\n }\n }\n }\n}\nfunction localeFromElement(el) {\n const container = el.closest('[lang]');\n if (container instanceof HTMLElement && container.lang) {\n return container.lang;\n }\n return 'default';\n}\n\nconst datetimes = new WeakMap();\nclass ExtendedTimeElement extends HTMLElement {\n static get observedAttributes() {\n return [\n 'datetime',\n 'day',\n 'format',\n 'lang',\n 'hour',\n 'minute',\n 'month',\n 'second',\n 'title',\n 'weekday',\n 'year',\n 'time-zone-name'\n ];\n }\n connectedCallback() {\n const title = this.getFormattedTitle();\n if (title && !this.hasAttribute('title')) {\n this.setAttribute('title', title);\n }\n const text = this.getFormattedDate();\n if (text) {\n this.textContent = text;\n }\n }\n attributeChangedCallback(attrName, oldValue, newValue) {\n const oldTitle = this.getFormattedTitle();\n if (attrName === 'datetime') {\n const millis = Date.parse(newValue);\n if (isNaN(millis)) {\n datetimes.delete(this);\n }\n else {\n datetimes.set(this, new Date(millis));\n }\n }\n const title = this.getFormattedTitle();\n const currentTitle = this.getAttribute('title');\n if (attrName !== 'title' && title && (!currentTitle || currentTitle === oldTitle)) {\n this.setAttribute('title', title);\n }\n const text = this.getFormattedDate();\n if (text) {\n this.textContent = text;\n }\n }\n get date() {\n return datetimes.get(this);\n }\n getFormattedTitle() {\n const date = this.date;\n if (!date)\n return;\n const formatter = titleFormatter();\n if (formatter) {\n return formatter.format(date);\n }\n else {\n try {\n return date.toLocaleString();\n }\n catch (e) {\n if (e instanceof RangeError) {\n return date.toString();\n }\n else {\n throw e;\n }\n }\n }\n }\n getFormattedDate() {\n return;\n }\n}\nconst titleFormatter = makeFormatter({\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short'\n});\n\nconst formatters = new WeakMap();\nclass LocalTimeElement extends ExtendedTimeElement {\n attributeChangedCallback(attrName, oldValue, newValue) {\n if (attrName === 'hour' || attrName === 'minute' || attrName === 'second' || attrName === 'time-zone-name') {\n formatters.delete(this);\n }\n super.attributeChangedCallback(attrName, oldValue, newValue);\n }\n getFormattedDate() {\n const d = this.date;\n if (!d)\n return;\n const date = formatDate(this, d) || '';\n const time = formatTime(this, d) || '';\n return `${date} ${time}`.trim();\n }\n}\nfunction formatDate(el, date) {\n const props = {\n weekday: {\n short: '%a',\n long: '%A'\n },\n day: {\n numeric: '%e',\n '2-digit': '%d'\n },\n month: {\n short: '%b',\n long: '%B'\n },\n year: {\n numeric: '%Y',\n '2-digit': '%y'\n }\n };\n let format = isDayFirst() ? 'weekday day month year' : 'weekday month day, year';\n for (const prop in props) {\n const value = props[prop][el.getAttribute(prop) || ''];\n format = format.replace(prop, value || '');\n }\n format = format.replace(/(\\s,)|(,\\s$)/, '');\n return strftime(date, format).replace(/\\s+/, ' ').trim();\n}\nfunction formatTime(el, date) {\n const options = {};\n const hour = el.getAttribute('hour');\n if (hour === 'numeric' || hour === '2-digit')\n options.hour = hour;\n const minute = el.getAttribute('minute');\n if (minute === 'numeric' || minute === '2-digit')\n options.minute = minute;\n const second = el.getAttribute('second');\n if (second === 'numeric' || second === '2-digit')\n options.second = second;\n const tz = el.getAttribute('time-zone-name');\n if (tz === 'short' || tz === 'long')\n options.timeZoneName = tz;\n if (Object.keys(options).length === 0) {\n return;\n }\n let factory = formatters.get(el);\n if (!factory) {\n factory = makeFormatter(options);\n formatters.set(el, factory);\n }\n const formatter = factory();\n if (formatter) {\n return formatter.format(date);\n }\n else {\n const timef = options.second ? '%H:%M:%S' : '%H:%M';\n return strftime(date, timef);\n }\n}\nif (!window.customElements.get('local-time')) {\n window.LocalTimeElement = LocalTimeElement;\n window.customElements.define('local-time', LocalTimeElement);\n}\n\nclass RelativeTime {\n constructor(date, locale) {\n this.date = date;\n this.locale = locale;\n }\n toString() {\n const ago = this.timeElapsed();\n if (ago) {\n return ago;\n }\n else {\n const ahead = this.timeAhead();\n if (ahead) {\n return ahead;\n }\n else {\n return `on ${this.formatDate()}`;\n }\n }\n }\n timeElapsed() {\n const ms = new Date().getTime() - this.date.getTime();\n const sec = Math.round(ms / 1000);\n const min = Math.round(sec / 60);\n const hr = Math.round(min / 60);\n const day = Math.round(hr / 24);\n if (ms >= 0 && day < 30) {\n return this.timeAgoFromMs(ms);\n }\n else {\n return null;\n }\n }\n timeAhead() {\n const ms = this.date.getTime() - new Date().getTime();\n const sec = Math.round(ms / 1000);\n const min = Math.round(sec / 60);\n const hr = Math.round(min / 60);\n const day = Math.round(hr / 24);\n if (ms >= 0 && day < 30) {\n return this.timeUntil();\n }\n else {\n return null;\n }\n }\n timeAgo() {\n const ms = new Date().getTime() - this.date.getTime();\n return this.timeAgoFromMs(ms);\n }\n timeAgoFromMs(ms) {\n const sec = Math.round(ms / 1000);\n const min = Math.round(sec / 60);\n const hr = Math.round(min / 60);\n const day = Math.round(hr / 24);\n const month = Math.round(day / 30);\n const year = Math.round(month / 12);\n if (ms < 0) {\n return formatRelativeTime(this.locale, 0, 'second');\n }\n else if (sec < 10) {\n return formatRelativeTime(this.locale, 0, 'second');\n }\n else if (sec < 45) {\n return formatRelativeTime(this.locale, -sec, 'second');\n }\n else if (sec < 90) {\n return formatRelativeTime(this.locale, -min, 'minute');\n }\n else if (min < 45) {\n return formatRelativeTime(this.locale, -min, 'minute');\n }\n else if (min < 90) {\n return formatRelativeTime(this.locale, -hr, 'hour');\n }\n else if (hr < 24) {\n return formatRelativeTime(this.locale, -hr, 'hour');\n }\n else if (hr < 36) {\n return formatRelativeTime(this.locale, -day, 'day');\n }\n else if (day < 30) {\n return formatRelativeTime(this.locale, -day, 'day');\n }\n else if (month < 18) {\n return formatRelativeTime(this.locale, -month, 'month');\n }\n else {\n return formatRelativeTime(this.locale, -year, 'year');\n }\n }\n microTimeAgo() {\n const ms = new Date().getTime() - this.date.getTime();\n const sec = Math.round(ms / 1000);\n const min = Math.round(sec / 60);\n const hr = Math.round(min / 60);\n const day = Math.round(hr / 24);\n const month = Math.round(day / 30);\n const year = Math.round(month / 12);\n if (min < 1) {\n return '1m';\n }\n else if (min < 60) {\n return `${min}m`;\n }\n else if (hr < 24) {\n return `${hr}h`;\n }\n else if (day < 365) {\n return `${day}d`;\n }\n else {\n return `${year}y`;\n }\n }\n timeUntil() {\n const ms = this.date.getTime() - new Date().getTime();\n return this.timeUntilFromMs(ms);\n }\n timeUntilFromMs(ms) {\n const sec = Math.round(ms / 1000);\n const min = Math.round(sec / 60);\n const hr = Math.round(min / 60);\n const day = Math.round(hr / 24);\n const month = Math.round(day / 30);\n const year = Math.round(month / 12);\n if (month >= 18) {\n return formatRelativeTime(this.locale, year, 'year');\n }\n else if (month >= 12) {\n return formatRelativeTime(this.locale, year, 'year');\n }\n else if (day >= 45) {\n return formatRelativeTime(this.locale, month, 'month');\n }\n else if (day >= 30) {\n return formatRelativeTime(this.locale, month, 'month');\n }\n else if (hr >= 36) {\n return formatRelativeTime(this.locale, day, 'day');\n }\n else if (hr >= 24) {\n return formatRelativeTime(this.locale, day, 'day');\n }\n else if (min >= 90) {\n return formatRelativeTime(this.locale, hr, 'hour');\n }\n else if (min >= 45) {\n return formatRelativeTime(this.locale, hr, 'hour');\n }\n else if (sec >= 90) {\n return formatRelativeTime(this.locale, min, 'minute');\n }\n else if (sec >= 45) {\n return formatRelativeTime(this.locale, min, 'minute');\n }\n else if (sec >= 10) {\n return formatRelativeTime(this.locale, sec, 'second');\n }\n else {\n return formatRelativeTime(this.locale, 0, 'second');\n }\n }\n microTimeUntil() {\n const ms = this.date.getTime() - new Date().getTime();\n const sec = Math.round(ms / 1000);\n const min = Math.round(sec / 60);\n const hr = Math.round(min / 60);\n const day = Math.round(hr / 24);\n const month = Math.round(day / 30);\n const year = Math.round(month / 12);\n if (day >= 365) {\n return `${year}y`;\n }\n else if (hr >= 24) {\n return `${day}d`;\n }\n else if (min >= 60) {\n return `${hr}h`;\n }\n else if (min > 1) {\n return `${min}m`;\n }\n else {\n return '1m';\n }\n }\n formatDate() {\n let format = isDayFirst() ? '%e %b' : '%b %e';\n if (!isThisYear(this.date)) {\n format += isYearSeparator() ? ', %Y' : ' %Y';\n }\n return strftime(this.date, format);\n }\n formatTime() {\n const formatter = timeFormatter();\n if (formatter) {\n return formatter.format(this.date);\n }\n else {\n return strftime(this.date, '%l:%M%P');\n }\n }\n}\nfunction formatRelativeTime(locale, value, unit) {\n const formatter = makeRelativeFormat(locale, { numeric: 'auto' });\n if (formatter) {\n return formatter.format(value, unit);\n }\n else {\n return formatEnRelativeTime(value, unit);\n }\n}\nfunction formatEnRelativeTime(value, unit) {\n if (value === 0) {\n switch (unit) {\n case 'year':\n case 'quarter':\n case 'month':\n case 'week':\n return `this ${unit}`;\n case 'day':\n return 'today';\n case 'hour':\n case 'minute':\n return `in 0 ${unit}s`;\n case 'second':\n return 'now';\n }\n }\n else if (value === 1) {\n switch (unit) {\n case 'year':\n case 'quarter':\n case 'month':\n case 'week':\n return `next ${unit}`;\n case 'day':\n return 'tomorrow';\n case 'hour':\n case 'minute':\n case 'second':\n return `in 1 ${unit}`;\n }\n }\n else if (value === -1) {\n switch (unit) {\n case 'year':\n case 'quarter':\n case 'month':\n case 'week':\n return `last ${unit}`;\n case 'day':\n return 'yesterday';\n case 'hour':\n case 'minute':\n case 'second':\n return `1 ${unit} ago`;\n }\n }\n else if (value > 1) {\n switch (unit) {\n case 'year':\n case 'quarter':\n case 'month':\n case 'week':\n case 'day':\n case 'hour':\n case 'minute':\n case 'second':\n return `in ${value} ${unit}s`;\n }\n }\n else if (value < -1) {\n switch (unit) {\n case 'year':\n case 'quarter':\n case 'month':\n case 'week':\n case 'day':\n case 'hour':\n case 'minute':\n case 'second':\n return `${-value} ${unit}s ago`;\n }\n }\n throw new RangeError(`Invalid unit argument for format() '${unit}'`);\n}\nconst timeFormatter = makeFormatter({ hour: 'numeric', minute: '2-digit' });\n\nclass RelativeTimeElement extends ExtendedTimeElement {\n getFormattedDate() {\n const date = this.date;\n if (!date)\n return;\n return new RelativeTime(date, localeFromElement(this)).toString();\n }\n connectedCallback() {\n nowElements.push(this);\n if (!updateNowElementsId) {\n updateNowElements();\n updateNowElementsId = window.setInterval(updateNowElements, 60 * 1000);\n }\n super.connectedCallback();\n }\n disconnectedCallback() {\n const ix = nowElements.indexOf(this);\n if (ix !== -1) {\n nowElements.splice(ix, 1);\n }\n if (!nowElements.length) {\n if (updateNowElementsId) {\n clearInterval(updateNowElementsId);\n updateNowElementsId = null;\n }\n }\n }\n}\nconst nowElements = [];\nlet updateNowElementsId;\nfunction updateNowElements() {\n let time, i, len;\n for (i = 0, len = nowElements.length; i < len; i++) {\n time = nowElements[i];\n time.textContent = time.getFormattedDate() || '';\n }\n}\nif (!window.customElements.get('relative-time')) {\n window.RelativeTimeElement = RelativeTimeElement;\n window.customElements.define('relative-time', RelativeTimeElement);\n}\n\nclass TimeAgoElement extends RelativeTimeElement {\n getFormattedDate() {\n const format = this.getAttribute('format');\n const date = this.date;\n if (!date)\n return;\n if (format === 'micro') {\n return new RelativeTime(date, localeFromElement(this)).microTimeAgo();\n }\n else {\n return new RelativeTime(date, localeFromElement(this)).timeAgo();\n }\n }\n}\nif (!window.customElements.get('time-ago')) {\n window.TimeAgoElement = TimeAgoElement;\n window.customElements.define('time-ago', TimeAgoElement);\n}\n\nclass TimeUntilElement extends RelativeTimeElement {\n getFormattedDate() {\n const format = this.getAttribute('format');\n const date = this.date;\n if (!date)\n return;\n if (format === 'micro') {\n return new RelativeTime(date, localeFromElement(this)).microTimeUntil();\n }\n else {\n return new RelativeTime(date, localeFromElement(this)).timeUntil();\n }\n }\n}\nif (!window.customElements.get('time-until')) {\n window.TimeUntilElement = TimeUntilElement;\n window.customElements.define('time-until', TimeUntilElement);\n}\n\nexport { LocalTimeElement, RelativeTimeElement, TimeAgoElement, TimeUntilElement };\n","const startPositions = new WeakMap();\nconst dragStartPositions = new WeakMap();\nconst constructedElements = new WeakMap();\nfunction moveCropArea(event) {\n const el = event.currentTarget;\n if (!(el instanceof ImageCropElement))\n return;\n const { box, image } = constructedElements.get(el) || {};\n if (!box || !image)\n return;\n let deltaX = 0;\n let deltaY = 0;\n if (event instanceof KeyboardEvent) {\n if (event.key === 'ArrowUp') {\n deltaY = -1;\n }\n else if (event.key === 'ArrowDown') {\n deltaY = 1;\n }\n else if (event.key === 'ArrowLeft') {\n deltaX = -1;\n }\n else if (event.key === 'ArrowRight') {\n deltaX = 1;\n }\n }\n else if (dragStartPositions.has(el) && event instanceof MouseEvent) {\n const pos = dragStartPositions.get(el);\n deltaX = event.pageX - pos.dragStartX;\n deltaY = event.pageY - pos.dragStartY;\n }\n else if (dragStartPositions.has(el) && event instanceof TouchEvent) {\n const { pageX, pageY } = event.changedTouches[0];\n const { dragStartX, dragStartY } = dragStartPositions.get(el);\n deltaX = pageX - dragStartX;\n deltaY = pageY - dragStartY;\n }\n if (deltaX !== 0 || deltaY !== 0) {\n const x = Math.min(Math.max(0, box.offsetLeft + deltaX), image.width - box.offsetWidth);\n const y = Math.min(Math.max(0, box.offsetTop + deltaY), image.height - box.offsetHeight);\n box.style.left = `${x}px`;\n box.style.top = `${y}px`;\n fireChangeEvent(el, { x, y, width: box.offsetWidth, height: box.offsetHeight });\n }\n if (event instanceof MouseEvent) {\n dragStartPositions.set(el, {\n dragStartX: event.pageX,\n dragStartY: event.pageY\n });\n }\n else if (event instanceof TouchEvent) {\n const { pageX, pageY } = event.changedTouches[0];\n dragStartPositions.set(el, {\n dragStartX: pageX,\n dragStartY: pageY\n });\n }\n}\nfunction updateCropArea(event) {\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n const el = getShadowHost(target);\n if (!(el instanceof ImageCropElement))\n return;\n const { box } = constructedElements.get(el) || {};\n if (!box)\n return;\n const rect = el.getBoundingClientRect();\n let deltaX, deltaY, delta;\n if (event instanceof KeyboardEvent) {\n if (event.key === 'Escape')\n return setInitialPosition(el);\n if (event.key === '-')\n delta = -10;\n if (event.key === '=')\n delta = +10;\n if (!delta)\n return;\n deltaX = box.offsetWidth + delta;\n deltaY = box.offsetHeight + delta;\n startPositions.set(el, { startX: box.offsetLeft, startY: box.offsetTop });\n }\n else if (event instanceof MouseEvent) {\n const pos = startPositions.get(el);\n if (!pos)\n return;\n deltaX = event.pageX - pos.startX - rect.left - window.pageXOffset;\n deltaY = event.pageY - pos.startY - rect.top - window.pageYOffset;\n }\n else if (event instanceof TouchEvent) {\n const pos = startPositions.get(el);\n if (!pos)\n return;\n deltaX = event.changedTouches[0].pageX - pos.startX - rect.left - window.pageXOffset;\n deltaY = event.changedTouches[0].pageY - pos.startY - rect.top - window.pageYOffset;\n }\n if (deltaX && deltaY)\n updateDimensions(el, deltaX, deltaY, !(event instanceof KeyboardEvent));\n}\nfunction getShadowHost(el) {\n const rootNode = el.getRootNode();\n if (!(rootNode instanceof ShadowRoot))\n return el;\n return rootNode.host;\n}\nfunction startUpdate(event) {\n const currentTarget = event.currentTarget;\n if (!(currentTarget instanceof HTMLElement))\n return;\n const el = getShadowHost(currentTarget);\n if (!(el instanceof ImageCropElement))\n return;\n const { box } = constructedElements.get(el) || {};\n if (!box)\n return;\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n if (target.hasAttribute('data-direction')) {\n const direction = target.getAttribute('data-direction') || '';\n el.addEventListener('mousemove', updateCropArea);\n el.addEventListener('touchmove', updateCropArea, { passive: true });\n if (['nw', 'se'].indexOf(direction) >= 0)\n el.classList.add('nwse');\n if (['ne', 'sw'].indexOf(direction) >= 0)\n el.classList.add('nesw');\n startPositions.set(el, {\n startX: box.offsetLeft + (['se', 'ne'].indexOf(direction) >= 0 ? 0 : box.offsetWidth),\n startY: box.offsetTop + (['se', 'sw'].indexOf(direction) >= 0 ? 0 : box.offsetHeight)\n });\n updateCropArea(event);\n }\n else {\n el.addEventListener('mousemove', moveCropArea);\n el.addEventListener('touchmove', moveCropArea, { passive: true });\n }\n}\nfunction updateDimensions(target, deltaX, deltaY, reposition = true) {\n let newSide = Math.max(Math.abs(deltaX), Math.abs(deltaY), 10);\n const pos = startPositions.get(target);\n if (!pos)\n return;\n const { box, image } = constructedElements.get(target) || {};\n if (!box || !image)\n return;\n newSide = Math.min(newSide, deltaY > 0 ? image.height - pos.startY : pos.startY, deltaX > 0 ? image.width - pos.startX : pos.startX);\n const x = reposition ? Math.round(Math.max(0, deltaX > 0 ? pos.startX : pos.startX - newSide)) : box.offsetLeft;\n const y = reposition ? Math.round(Math.max(0, deltaY > 0 ? pos.startY : pos.startY - newSide)) : box.offsetTop;\n box.style.left = `${x}px`;\n box.style.top = `${y}px`;\n box.style.width = `${newSide}px`;\n box.style.height = `${newSide}px`;\n fireChangeEvent(target, { x, y, width: newSide, height: newSide });\n}\nfunction setInitialPosition(el) {\n const { image } = constructedElements.get(el) || {};\n if (!image)\n return;\n const side = Math.round(image.clientWidth > image.clientHeight ? image.clientHeight : image.clientWidth);\n startPositions.set(el, {\n startX: (image.clientWidth - side) / 2,\n startY: (image.clientHeight - side) / 2\n });\n updateDimensions(el, side, side);\n}\nfunction stopUpdate(event) {\n const el = event.currentTarget;\n if (!(el instanceof ImageCropElement))\n return;\n dragStartPositions.delete(el);\n el.classList.remove('nwse', 'nesw');\n el.removeEventListener('mousemove', updateCropArea);\n el.removeEventListener('mousemove', moveCropArea);\n el.removeEventListener('touchmove', updateCropArea);\n el.removeEventListener('touchmove', moveCropArea);\n}\nfunction fireChangeEvent(target, result) {\n const { image } = constructedElements.get(target) || {};\n if (!image)\n return;\n const ratio = image.naturalWidth / image.width;\n for (const key in result) {\n const value = Math.round(result[key] * ratio);\n result[key] = value;\n const slottedInput = target.querySelector(`[data-image-crop-input='${key}']`);\n if (slottedInput instanceof HTMLInputElement)\n slottedInput.value = value.toString();\n }\n target.dispatchEvent(new CustomEvent('image-crop-change', { bubbles: true, detail: result }));\n}\nclass ImageCropElement extends HTMLElement {\n connectedCallback() {\n if (constructedElements.has(this))\n return;\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.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`;\n const box = shadowRoot.querySelector('[data-crop-box]');\n if (!(box instanceof HTMLElement))\n return;\n const image = shadowRoot.querySelector('img');\n if (!(image instanceof HTMLImageElement))\n return;\n constructedElements.set(this, { box, image });\n image.addEventListener('load', () => {\n this.loaded = true;\n setInitialPosition(this);\n });\n this.addEventListener('mouseleave', stopUpdate);\n this.addEventListener('touchend', stopUpdate);\n this.addEventListener('mouseup', stopUpdate);\n box.addEventListener('mousedown', startUpdate);\n box.addEventListener('touchstart', startUpdate, { passive: true });\n this.addEventListener('keydown', moveCropArea);\n this.addEventListener('keydown', updateCropArea);\n if (this.src)\n image.src = this.src;\n }\n static get observedAttributes() {\n return ['src'];\n }\n get src() {\n return this.getAttribute('src');\n }\n set src(val) {\n if (val) {\n this.setAttribute('src', val);\n }\n else {\n this.removeAttribute('src');\n }\n }\n get loaded() {\n return this.hasAttribute('loaded');\n }\n set loaded(val) {\n if (val) {\n this.setAttribute('loaded', '');\n }\n else {\n this.removeAttribute('loaded');\n }\n }\n attributeChangedCallback(attribute, oldValue, newValue) {\n const { image } = constructedElements.get(this) || {};\n if (attribute === 'src') {\n this.loaded = false;\n if (image)\n image.src = newValue;\n }\n }\n}\nexport default ImageCropElement;\nif (!window.customElements.get('image-crop')) {\n window.ImageCropElement = ImageCropElement;\n window.customElements.define('image-crop', ImageCropElement);\n}\n","class DetailsMenuElement extends HTMLElement {\n get preload() {\n return this.hasAttribute('preload');\n }\n set preload(value) {\n if (value) {\n this.setAttribute('preload', '');\n }\n else {\n this.removeAttribute('preload');\n }\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(value) {\n this.setAttribute('src', value);\n }\n connectedCallback() {\n if (!this.hasAttribute('role'))\n this.setAttribute('role', 'menu');\n const details = this.parentElement;\n if (!details)\n return;\n const summary = details.querySelector('summary');\n if (summary) {\n summary.setAttribute('aria-haspopup', 'menu');\n if (!summary.hasAttribute('role'))\n summary.setAttribute('role', 'button');\n }\n const subscriptions = [\n fromEvent(details, 'compositionstart', e => trackComposition(this, e)),\n fromEvent(details, 'compositionend', e => trackComposition(this, e)),\n fromEvent(details, 'click', e => shouldCommit(details, e)),\n fromEvent(details, 'change', e => shouldCommit(details, e)),\n fromEvent(details, 'keydown', e => keydown(details, this, e)),\n fromEvent(details, 'toggle', () => loadFragment(details, this), { once: true }),\n fromEvent(details, 'toggle', () => closeCurrentMenu(details)),\n this.preload\n ? fromEvent(details, 'mouseover', () => loadFragment(details, this), { once: true })\n : NullSubscription,\n ...focusOnOpen(details)\n ];\n states.set(this, { subscriptions, loaded: false, isComposing: false });\n }\n disconnectedCallback() {\n const state = states.get(this);\n if (!state)\n return;\n states.delete(this);\n for (const sub of state.subscriptions) {\n sub.unsubscribe();\n }\n }\n}\nconst states = new WeakMap();\nconst NullSubscription = {\n unsubscribe() {\n }\n};\nfunction fromEvent(target, eventName, onNext, options = false) {\n target.addEventListener(eventName, onNext, options);\n return {\n unsubscribe: () => {\n target.removeEventListener(eventName, onNext, options);\n }\n };\n}\nfunction loadFragment(details, menu) {\n const src = menu.getAttribute('src');\n if (!src)\n return;\n const state = states.get(menu);\n if (!state)\n return;\n if (state.loaded)\n return;\n state.loaded = true;\n const loader = menu.querySelector('include-fragment');\n if (loader && !loader.hasAttribute('src')) {\n loader.addEventListener('loadend', () => autofocus(details));\n loader.setAttribute('src', src);\n }\n}\nfunction focusOnOpen(details) {\n let isMouse = false;\n const onmousedown = () => (isMouse = true);\n const onkeydown = () => (isMouse = false);\n const ontoggle = () => {\n if (!details.hasAttribute('open'))\n return;\n if (autofocus(details))\n return;\n if (!isMouse)\n focusFirstItem(details);\n };\n return [\n fromEvent(details, 'mousedown', onmousedown),\n fromEvent(details, 'keydown', onkeydown),\n fromEvent(details, 'toggle', ontoggle)\n ];\n}\nfunction closeCurrentMenu(details) {\n if (!details.hasAttribute('open'))\n return;\n for (const menu of document.querySelectorAll('details[open] > details-menu')) {\n const opened = menu.closest('details');\n if (opened && opened !== details && !opened.contains(details)) {\n opened.removeAttribute('open');\n }\n }\n}\nfunction autofocus(details) {\n if (!details.hasAttribute('open'))\n return false;\n const input = details.querySelector('details-menu [autofocus]');\n if (input) {\n input.focus();\n return true;\n }\n else {\n return false;\n }\n}\nfunction focusFirstItem(details) {\n const selected = document.activeElement;\n if (selected && isMenuItem(selected) && details.contains(selected))\n return;\n const target = sibling(details, true);\n if (target)\n target.focus();\n}\nfunction sibling(details, next) {\n const options = Array.from(details.querySelectorAll('[role^=\"menuitem\"]:not([hidden]):not([disabled]):not([aria-disabled=\"true\"])'));\n const selected = document.activeElement;\n const index = selected instanceof HTMLElement ? options.indexOf(selected) : -1;\n const found = next ? options[index + 1] : options[index - 1];\n const def = next ? options[0] : options[options.length - 1];\n return found || def;\n}\nconst ctrlBindings = navigator.userAgent.match(/Macintosh/);\nfunction shouldCommit(details, event) {\n const target = event.target;\n if (!(target instanceof Element))\n return;\n if (target.closest('details') !== details)\n return;\n if (event.type === 'click') {\n const menuitem = target.closest('[role=\"menuitem\"], [role=\"menuitemradio\"]');\n if (!menuitem)\n return;\n const input = menuitem.querySelector('input');\n if (menuitem.tagName === 'LABEL' && target === input)\n return;\n const onlyCommitOnChangeEvent = menuitem.tagName === 'LABEL' && input && !input.checked;\n if (!onlyCommitOnChangeEvent) {\n commit(menuitem, details);\n }\n }\n else if (event.type === 'change') {\n const menuitem = target.closest('[role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]');\n if (menuitem)\n commit(menuitem, details);\n }\n}\nfunction updateChecked(selected, details) {\n for (const el of details.querySelectorAll('[role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]')) {\n const input = el.querySelector('input[type=\"radio\"], input[type=\"checkbox\"]');\n let checkState = (el === selected).toString();\n if (input instanceof HTMLInputElement) {\n checkState = input.indeterminate ? 'mixed' : input.checked.toString();\n }\n el.setAttribute('aria-checked', checkState);\n }\n}\nfunction commit(selected, details) {\n if (selected.hasAttribute('disabled') || selected.getAttribute('aria-disabled') === 'true')\n return;\n const menu = selected.closest('details-menu');\n if (!menu)\n return;\n const dispatched = menu.dispatchEvent(new CustomEvent('details-menu-select', {\n cancelable: true,\n detail: { relatedTarget: selected }\n }));\n if (!dispatched)\n return;\n updateLabel(selected, details);\n updateChecked(selected, details);\n if (selected.getAttribute('role') !== 'menuitemcheckbox')\n close(details);\n menu.dispatchEvent(new CustomEvent('details-menu-selected', {\n detail: { relatedTarget: selected }\n }));\n}\nfunction keydown(details, menu, event) {\n if (!(event instanceof KeyboardEvent))\n return;\n if (details.querySelector('details[open]'))\n return;\n const state = states.get(menu);\n if (!state || state.isComposing)\n return;\n const isSummaryFocused = event.target instanceof Element && event.target.tagName === 'SUMMARY';\n switch (event.key) {\n case 'Escape':\n if (details.hasAttribute('open')) {\n close(details);\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n case 'ArrowDown':\n {\n if (isSummaryFocused && !details.hasAttribute('open')) {\n details.setAttribute('open', '');\n }\n const target = sibling(details, true);\n if (target)\n target.focus();\n event.preventDefault();\n }\n break;\n case 'ArrowUp':\n {\n if (isSummaryFocused && !details.hasAttribute('open')) {\n details.setAttribute('open', '');\n }\n const target = sibling(details, false);\n if (target)\n target.focus();\n event.preventDefault();\n }\n break;\n case 'n':\n {\n if (ctrlBindings && event.ctrlKey) {\n const target = sibling(details, true);\n if (target)\n target.focus();\n event.preventDefault();\n }\n }\n break;\n case 'p':\n {\n if (ctrlBindings && event.ctrlKey) {\n const target = sibling(details, false);\n if (target)\n target.focus();\n event.preventDefault();\n }\n }\n break;\n case ' ':\n case 'Enter':\n {\n const selected = document.activeElement;\n if (selected instanceof HTMLElement && isMenuItem(selected) && selected.closest('details') === details) {\n event.preventDefault();\n event.stopPropagation();\n selected.click();\n }\n }\n break;\n }\n}\nfunction isMenuItem(el) {\n const role = el.getAttribute('role');\n return role === 'menuitem' || role === 'menuitemcheckbox' || role === 'menuitemradio';\n}\nfunction close(details) {\n const wasOpen = details.hasAttribute('open');\n if (!wasOpen)\n return;\n details.removeAttribute('open');\n const summary = details.querySelector('summary');\n if (summary)\n summary.focus();\n}\nfunction updateLabel(item, details) {\n const button = details.querySelector('[data-menu-button]');\n if (!button)\n return;\n const text = labelText(item);\n if (text) {\n button.textContent = text;\n }\n else {\n const html = labelHTML(item);\n if (html)\n button.innerHTML = html;\n }\n}\nfunction labelText(el) {\n if (!el)\n return null;\n const textEl = el.hasAttribute('data-menu-button-text') ? el : el.querySelector('[data-menu-button-text]');\n if (!textEl)\n return null;\n return textEl.getAttribute('data-menu-button-text') || textEl.textContent;\n}\nfunction labelHTML(el) {\n if (!el)\n return null;\n const contentsEl = el.hasAttribute('data-menu-button-contents') ? el : el.querySelector('[data-menu-button-contents]');\n return contentsEl ? contentsEl.innerHTML : null;\n}\nfunction trackComposition(menu, event) {\n const state = states.get(menu);\n if (!state)\n return;\n state.isComposing = event.type === 'compositionstart';\n}\nexport default DetailsMenuElement;\nif (!window.customElements.get('details-menu')) {\n window.DetailsMenuElement = DetailsMenuElement;\n window.customElements.define('details-menu', DetailsMenuElement);\n}\n","const alternateOrders = {\n 'outside-top': ['outside-bottom', 'outside-right', 'outside-left', 'outside-bottom'],\n 'outside-bottom': ['outside-top', 'outside-right', 'outside-left', 'outside-bottom'],\n 'outside-left': ['outside-right', 'outside-bottom', 'outside-top', 'outside-bottom'],\n 'outside-right': ['outside-left', 'outside-bottom', 'outside-top', 'outside-bottom']\n};\nconst alternateAlignments = {\n start: ['end', 'center'],\n end: ['start', 'center'],\n center: ['end', 'start']\n};\nexport function getAnchoredPosition(floatingElement, anchorElement, settings = {}) {\n const parentElement = getPositionedParent(floatingElement);\n const clippingRect = getClippingRect(parentElement);\n const parentElementStyle = getComputedStyle(parentElement);\n const parentElementRect = parentElement.getBoundingClientRect();\n const [borderTop, borderLeft] = [parentElementStyle.borderTopWidth, parentElementStyle.borderLeftWidth].map(v => parseInt(v, 10) || 0);\n const relativeRect = {\n top: parentElementRect.top + borderTop,\n left: parentElementRect.left + borderLeft\n };\n return pureCalculateAnchoredPosition(clippingRect, relativeRect, floatingElement.getBoundingClientRect(), anchorElement instanceof Element ? anchorElement.getBoundingClientRect() : anchorElement, getDefaultSettings(settings));\n}\nfunction getPositionedParent(element) {\n let parentNode = element.parentNode;\n while (parentNode !== null) {\n if (parentNode instanceof HTMLElement && getComputedStyle(parentNode).position !== 'static') {\n return parentNode;\n }\n parentNode = parentNode.parentNode;\n }\n return document.body;\n}\nfunction getClippingRect(element) {\n let parentNode = element;\n while (parentNode !== null) {\n if (parentNode === document.body) {\n break;\n }\n const parentNodeStyle = getComputedStyle(parentNode);\n if (parentNodeStyle.overflow !== 'visible') {\n break;\n }\n parentNode = parentNode.parentNode;\n }\n const clippingNode = parentNode === document.body || !(parentNode instanceof HTMLElement) ? document.body : parentNode;\n const elemRect = clippingNode.getBoundingClientRect();\n const elemStyle = getComputedStyle(clippingNode);\n const [borderTop, borderLeft, borderRight, borderBottom] = [\n elemStyle.borderTopWidth,\n elemStyle.borderLeftWidth,\n elemStyle.borderRightWidth,\n elemStyle.borderBottomWidth\n ].map(v => parseInt(v, 10) || 0);\n return {\n top: elemRect.top + borderTop,\n left: elemRect.left + borderLeft,\n width: elemRect.width - borderRight - borderLeft,\n height: Math.max(elemRect.height - borderTop - borderBottom, clippingNode === document.body ? window.innerHeight : -Infinity)\n };\n}\nconst positionDefaults = {\n side: 'outside-bottom',\n align: 'start',\n anchorOffset: 4,\n alignmentOffset: 4,\n allowOutOfBounds: false\n};\nfunction getDefaultSettings(settings = {}) {\n var _a, _b, _c, _d, _e;\n const side = (_a = settings.side) !== null && _a !== void 0 ? _a : positionDefaults.side;\n const align = (_b = settings.align) !== null && _b !== void 0 ? _b : positionDefaults.align;\n return {\n side,\n align,\n anchorOffset: (_c = settings.anchorOffset) !== null && _c !== void 0 ? _c : (side === 'inside-center' ? 0 : positionDefaults.anchorOffset),\n alignmentOffset: (_d = settings.alignmentOffset) !== null && _d !== void 0 ? _d : (align !== 'center' && side.startsWith('inside') ? positionDefaults.alignmentOffset : 0),\n allowOutOfBounds: (_e = settings.allowOutOfBounds) !== null && _e !== void 0 ? _e : positionDefaults.allowOutOfBounds\n };\n}\nfunction pureCalculateAnchoredPosition(viewportRect, relativePosition, floatingRect, anchorRect, { side, align, allowOutOfBounds, anchorOffset, alignmentOffset }) {\n const relativeViewportRect = {\n top: viewportRect.top - relativePosition.top,\n left: viewportRect.left - relativePosition.left,\n width: viewportRect.width,\n height: viewportRect.height\n };\n let pos = calculatePosition(floatingRect, anchorRect, side, align, anchorOffset, alignmentOffset);\n let anchorSide = side;\n let anchorAlign = align;\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n if (!allowOutOfBounds) {\n const alternateOrder = alternateOrders[side];\n let positionAttempt = 0;\n if (alternateOrder) {\n let prevSide = side;\n while (positionAttempt < alternateOrder.length &&\n shouldRecalculatePosition(prevSide, pos, relativeViewportRect, floatingRect)) {\n const nextSide = alternateOrder[positionAttempt++];\n prevSide = nextSide;\n pos = calculatePosition(floatingRect, anchorRect, nextSide, align, anchorOffset, alignmentOffset);\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n anchorSide = nextSide;\n }\n }\n const alternateAlignment = alternateAlignments[align];\n let alignmentAttempt = 0;\n if (alternateAlignment) {\n let prevAlign = align;\n while (alignmentAttempt < alternateAlignment.length &&\n shouldRecalculateAlignment(prevAlign, pos, relativeViewportRect, floatingRect)) {\n const nextAlign = alternateAlignment[alignmentAttempt++];\n prevAlign = nextAlign;\n pos = calculatePosition(floatingRect, anchorRect, anchorSide, nextAlign, anchorOffset, alignmentOffset);\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n anchorAlign = nextAlign;\n }\n }\n if (pos.top < relativeViewportRect.top) {\n pos.top = relativeViewportRect.top;\n }\n if (pos.left < relativeViewportRect.left) {\n pos.left = relativeViewportRect.left;\n }\n if (pos.left + floatingRect.width > viewportRect.width + relativeViewportRect.left) {\n pos.left = viewportRect.width + relativeViewportRect.left - floatingRect.width;\n }\n if (alternateOrder && positionAttempt < alternateOrder.length) {\n if (pos.top + floatingRect.height > viewportRect.height + relativeViewportRect.top) {\n pos.top = viewportRect.height + relativeViewportRect.top - floatingRect.height;\n }\n }\n }\n return Object.assign(Object.assign({}, pos), { anchorSide, anchorAlign });\n}\nfunction calculatePosition(elementDimensions, anchorPosition, side, align, anchorOffset, alignmentOffset) {\n const anchorRight = anchorPosition.left + anchorPosition.width;\n const anchorBottom = anchorPosition.top + anchorPosition.height;\n let top = -1;\n let left = -1;\n if (side === 'outside-top') {\n top = anchorPosition.top - anchorOffset - elementDimensions.height;\n }\n else if (side === 'outside-bottom') {\n top = anchorBottom + anchorOffset;\n }\n else if (side === 'outside-left') {\n left = anchorPosition.left - anchorOffset - elementDimensions.width;\n }\n else if (side === 'outside-right') {\n left = anchorRight + anchorOffset;\n }\n if (side === 'outside-top' || side === 'outside-bottom') {\n if (align === 'start') {\n left = anchorPosition.left + alignmentOffset;\n }\n else if (align === 'center') {\n left = anchorPosition.left - (elementDimensions.width - anchorPosition.width) / 2 + alignmentOffset;\n }\n else {\n left = anchorRight - elementDimensions.width - alignmentOffset;\n }\n }\n if (side === 'outside-left' || side === 'outside-right') {\n if (align === 'start') {\n top = anchorPosition.top + alignmentOffset;\n }\n else if (align === 'center') {\n top = anchorPosition.top - (elementDimensions.height - anchorPosition.height) / 2 + alignmentOffset;\n }\n else {\n top = anchorBottom - elementDimensions.height - alignmentOffset;\n }\n }\n if (side === 'inside-top') {\n top = anchorPosition.top + anchorOffset;\n }\n else if (side === 'inside-bottom') {\n top = anchorBottom - anchorOffset - elementDimensions.height;\n }\n else if (side === 'inside-left') {\n left = anchorPosition.left + anchorOffset;\n }\n else if (side === 'inside-right') {\n left = anchorRight - anchorOffset - elementDimensions.width;\n }\n else if (side === 'inside-center') {\n left = (anchorRight + anchorPosition.left) / 2 - elementDimensions.width / 2 + anchorOffset;\n }\n if (side === 'inside-top' || side === 'inside-bottom') {\n if (align === 'start') {\n left = anchorPosition.left + alignmentOffset;\n }\n else if (align === 'center') {\n left = anchorPosition.left - (elementDimensions.width - anchorPosition.width) / 2 + alignmentOffset;\n }\n else {\n left = anchorRight - elementDimensions.width - alignmentOffset;\n }\n }\n else if (side === 'inside-left' || side === 'inside-right' || side === 'inside-center') {\n if (align === 'start') {\n top = anchorPosition.top + alignmentOffset;\n }\n else if (align === 'center') {\n top = anchorPosition.top - (elementDimensions.height - anchorPosition.height) / 2 + alignmentOffset;\n }\n else {\n top = anchorBottom - elementDimensions.height - alignmentOffset;\n }\n }\n return { top, left };\n}\nfunction shouldRecalculatePosition(side, currentPos, containerDimensions, elementDimensions) {\n if (side === 'outside-top' || side === 'outside-bottom') {\n return (currentPos.top < containerDimensions.top ||\n currentPos.top + elementDimensions.height > containerDimensions.height + containerDimensions.top);\n }\n else {\n return (currentPos.left < containerDimensions.left ||\n currentPos.left + elementDimensions.width > containerDimensions.width + containerDimensions.left);\n }\n}\nfunction shouldRecalculateAlignment(align, currentPos, containerDimensions, elementDimensions) {\n if (align === 'end') {\n return currentPos.left < containerDimensions.left;\n }\n else if (align === 'start' || align === 'center') {\n return currentPos.left + elementDimensions.width > containerDimensions.left + containerDimensions.width;\n }\n}\n","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _ToolTipElement_instances, _ToolTipElement_abortController, _ToolTipElement_align, _ToolTipElement_side, _ToolTipElement_allowUpdatePosition, _ToolTipElement_update, _ToolTipElement_updatePosition;\nimport { getAnchoredPosition } from '@primer/behaviors';\nconst TOOLTIP_OPEN_CLASS = 'tooltip-open';\nconst TOOLTIP_ARROW_EDGE_OFFSET = 6;\nconst DIRECTION_CLASSES = [\n 'tooltip-n',\n 'tooltip-s',\n 'tooltip-e',\n 'tooltip-w',\n 'tooltip-ne',\n 'tooltip-se',\n 'tooltip-nw',\n 'tooltip-sw'\n];\nclass ToolTipElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _ToolTipElement_instances.add(this);\n _ToolTipElement_abortController.set(this, void 0);\n _ToolTipElement_align.set(this, 'center');\n _ToolTipElement_side.set(this, 'outside-bottom');\n _ToolTipElement_allowUpdatePosition.set(this, false);\n }\n styles() {\n 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_CLASS}),\n :host(.${TOOLTIP_OPEN_CLASS}):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: -${TOOLTIP_ARROW_EDGE_OFFSET}px;\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: ${TOOLTIP_ARROW_EDGE_OFFSET}px;\n }\n \n :host(.tooltip-sw):before,\n :host(.tooltip-nw):before {\n right: 0;\n margin-right: ${TOOLTIP_ARROW_EDGE_OFFSET}px;\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 `;\n }\n get htmlFor() {\n return this.getAttribute('for') || '';\n }\n set htmlFor(value) {\n this.setAttribute('for', value);\n }\n get type() {\n const type = this.getAttribute('data-type');\n return type === 'label' ? 'label' : 'description';\n }\n set type(value) {\n this.setAttribute('data-type', value);\n }\n get direction() {\n return (this.getAttribute('data-direction') || 's');\n }\n set direction(value) {\n this.setAttribute('data-direction', value);\n }\n get control() {\n return this.ownerDocument.getElementById(this.htmlFor);\n }\n connectedCallback() {\n var _a;\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.innerHTML = `\n <style>\n ${this.styles()}\n </style>\n <slot></slot>\n `;\n this.hidden = true;\n __classPrivateFieldSet(this, _ToolTipElement_allowUpdatePosition, true, \"f\");\n if (!this.id) {\n this.id = `tooltip-${Date.now()}-${(Math.random() * 10000).toFixed(0)}`;\n }\n if (!this.control)\n return;\n this.setAttribute('role', 'tooltip');\n (_a = __classPrivateFieldGet(this, _ToolTipElement_abortController, \"f\")) === null || _a === void 0 ? void 0 : _a.abort();\n __classPrivateFieldSet(this, _ToolTipElement_abortController, new AbortController(), \"f\");\n const { signal } = __classPrivateFieldGet(this, _ToolTipElement_abortController, \"f\");\n this.addEventListener('mouseleave', this, { signal });\n this.control.addEventListener('mouseenter', this, { signal });\n this.control.addEventListener('mouseleave', this, { signal });\n this.control.addEventListener('focus', this, { signal });\n this.control.addEventListener('blur', this, { signal });\n this.ownerDocument.addEventListener('keydown', this, { signal });\n __classPrivateFieldGet(this, _ToolTipElement_instances, \"m\", _ToolTipElement_update).call(this);\n }\n disconnectedCallback() {\n var _a;\n (_a = __classPrivateFieldGet(this, _ToolTipElement_abortController, \"f\")) === null || _a === void 0 ? void 0 : _a.abort();\n }\n handleEvent(event) {\n if (!this.control)\n return;\n // Ensures that tooltip stays open when hovering between tooltip and element\n // WCAG Success Criterion 1.4.13 Hoverable\n if ((event.type === 'mouseenter' || event.type === 'focus') && this.hidden) {\n this.hidden = false;\n }\n else if (event.type === 'blur') {\n this.hidden = true;\n }\n else if (event.type === 'mouseleave' &&\n event.relatedTarget !== this.control &&\n event.relatedTarget !== this) {\n this.hidden = true;\n }\n else if (event.type === 'keydown' && event.key === 'Escape' && !this.hidden) {\n this.hidden = true;\n }\n }\n attributeChangedCallback(name) {\n if (name === 'id' || name === 'data-type') {\n if (!this.id || !this.control)\n return;\n if (this.type === 'label') {\n this.control.setAttribute('aria-labelledby', this.id);\n }\n else {\n let describedBy = this.control.getAttribute('aria-describedby');\n describedBy ? (describedBy = `${describedBy} ${this.id}`) : (describedBy = this.id);\n this.control.setAttribute('aria-describedby', describedBy);\n }\n }\n else if (this.isConnected && name === 'hidden') {\n __classPrivateFieldGet(this, _ToolTipElement_instances, \"m\", _ToolTipElement_update).call(this);\n }\n else if (name === 'data-direction') {\n this.classList.remove(...DIRECTION_CLASSES);\n const direction = this.direction;\n if (direction === 'n') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'center', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-top', \"f\");\n }\n else if (direction === 'ne') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'start', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-top', \"f\");\n }\n else if (direction === 'e') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'center', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-right', \"f\");\n }\n else if (direction === 'se') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'start', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-bottom', \"f\");\n }\n else if (direction === 's') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'center', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-bottom', \"f\");\n }\n else if (direction === 'sw') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'end', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-bottom', \"f\");\n }\n else if (direction === 'w') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'center', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-left', \"f\");\n }\n else if (direction === 'nw') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'end', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-top', \"f\");\n }\n }\n }\n}\n_ToolTipElement_abortController = new WeakMap(), _ToolTipElement_align = new WeakMap(), _ToolTipElement_side = new WeakMap(), _ToolTipElement_allowUpdatePosition = new WeakMap(), _ToolTipElement_instances = new WeakSet(), _ToolTipElement_update = function _ToolTipElement_update() {\n if (this.hidden) {\n this.classList.remove(TOOLTIP_OPEN_CLASS, ...DIRECTION_CLASSES);\n }\n else {\n this.classList.add(TOOLTIP_OPEN_CLASS);\n for (const tooltip of this.ownerDocument.querySelectorAll(this.tagName)) {\n if (tooltip !== this)\n tooltip.hidden = true;\n }\n __classPrivateFieldGet(this, _ToolTipElement_instances, \"m\", _ToolTipElement_updatePosition).call(this);\n }\n}, _ToolTipElement_updatePosition = function _ToolTipElement_updatePosition() {\n if (!this.control)\n return;\n if (!__classPrivateFieldGet(this, _ToolTipElement_allowUpdatePosition, \"f\") || this.hidden)\n return;\n const TOOLTIP_OFFSET = 10;\n this.style.left = `0px`; // Ensures we have reliable tooltip width in `getAnchoredPosition`\n const position = getAnchoredPosition(this, this.control, {\n side: __classPrivateFieldGet(this, _ToolTipElement_side, \"f\"),\n align: __classPrivateFieldGet(this, _ToolTipElement_align, \"f\"),\n anchorOffset: TOOLTIP_OFFSET\n });\n const anchorSide = position.anchorSide;\n const align = position.anchorAlign;\n this.style.top = `${position.top}px`;\n this.style.left = `${position.left}px`;\n let direction = 's';\n if (anchorSide === 'outside-left') {\n direction = 'w';\n }\n else if (anchorSide === 'outside-right') {\n direction = 'e';\n }\n else if (anchorSide === 'outside-top') {\n if (align === 'center') {\n direction = 'n';\n }\n else if (align === 'start') {\n direction = 'ne';\n }\n else {\n direction = 'nw';\n }\n }\n else {\n if (align === 'center') {\n direction = 's';\n }\n else if (align === 'start') {\n direction = 'se';\n }\n else {\n direction = 'sw';\n }\n }\n this.classList.add(`tooltip-${direction}`);\n};\nToolTipElement.observedAttributes = ['data-type', 'data-direction', 'id', 'hidden'];\nif (!window.customElements.get('tool-tip')) {\n window.ToolTipElement = ToolTipElement;\n window.customElements.define('tool-tip', ToolTipElement);\n}\n"],"names":["ctrlBindings","navigator","userAgent","match","Combobox","[object Object]","input","list","this","isComposing","id","Math","random","toString","slice","keyboardEventHandler","event","combobox","shiftKey","metaKey","altKey","ctrlKey","key","target","querySelector","getAttribute","click","commit","preventDefault","clearSelection","navigate","keyboardBindings","compositionEventHandler","type","document","getElementById","trackComposition","inputHandler","bind","setAttribute","stop","removeAttribute","addEventListener","commitWithElement","removeEventListener","indexDiff","focusEl","Array","from","querySelectorAll","filter","visible","els","focusIndex","indexOf","length","focus","indexOfItem","newIndex","el","scrollTo","Element","closest","dispatchEvent","CustomEvent","bubbles","fireCommitEvent","hidden","HTMLInputElement","offsetWidth","offsetHeight","container","element","scrollTop","containerBottom","clientHeight","top","offsetTop","bottom","inViewport","AutocompleteEvent","init","super","relatedTarget","requests","WeakMap","fragment","url","xhr","XMLHttpRequest","open","setRequestHeader","pending","get","abort","set","clear","delete","result","Promise","resolve","reject","onload","status","responseText","Error","onerror","send","then","request","SCREEN_READER_DELAY","window","testScreenReaderDelay","Autocomplete","results","autoselectEnabled","_a","feedback","clearButton","name","clientOptions","labelElem","interactingWithList","onInputChange","callback","wait","timeout","Rest","clearTimeout","setTimeout","debounce","onResultsMouseDown","onInputBlur","onInputFocus","onKeydown","onCommit","handleClear","updateFeedbackForScreenReaders","value","Event","firstOption","children","stopPropagation","trim","fetchResults","selected","HTMLElement","HTMLAnchorElement","textContent","innerHTML","inputString","query","src","URL","location","href","params","URLSearchParams","search","append","html","identifyOptions","allNewOptions","hasResults","numOptions","firstOptionValue","catch","start","state","AutocompleteElement","listId","autocomplete","destroy","hasAttribute","observedAttributes","oldValue","newValue","close","copyNode","node","clipboard","writeText","selection","getSelection","removeAllRanges","range","createRange","selectNodeContents","addRange","execCommand","copyText","text","body","createElement","style","width","height","position","createNode","appendChild","removeChild","copy","button","trigger","root","prototype","getRootNode","ownerDocument","Document","ShadowRoot","content","HTMLTextAreaElement","clicked","currentTarget","keydown","focused","blurred","customElements","define","ClipboardCopyElement","showSVG","svg","display","hideSVG","clipboardCopyElementTimers","currentTimeout","copyIcon","checkIcon","showCheck","showCopy","TabContainerElement","tabs","currentIndex","find","tab","matches","code","index","selectTab","tabContainer","panels","selectedTab","selectedPanel","cancelable","detail","panel","weekdays","months","pad","num","strftime","time","formatString","day","getDay","date","getDate","month","getMonth","year","getFullYear","hour","getHours","minute","getMinutes","second","getSeconds","replace","_arg","String","makeFormatter","options","format","Intl","DateTimeFormat","undefined","e","RangeError","dayFirst","dayFirstFormatter","isDayFirst","formatter","output","Date","yearSeparator","yearFormatter","localeFromElement","lang","datetimes","ExtendedTimeElement","title","getFormattedTitle","getFormattedDate","attrName","oldTitle","millis","parse","isNaN","currentTitle","titleFormatter","toLocaleString","timeZoneName","formatters","LocalTimeElement","attributeChangedCallback","d","props","weekday","short","long","numeric","2-digit","prop","formatDate","tz","Object","keys","factory","formatTime","RelativeTime","locale","ago","timeElapsed","ahead","timeAhead","ms","getTime","sec","round","min","hr","timeAgoFromMs","timeUntil","formatRelativeTime","timeUntilFromMs","getUTCFullYear","isYearSeparator","timeFormatter","unit","RelativeTimeFormat","makeRelativeFormat","formatEnRelativeTime","RelativeTimeElement","nowElements","push","updateNowElementsId","updateNowElements","setInterval","connectedCallback","ix","splice","clearInterval","i","len","TimeAgoElement","microTimeAgo","timeAgo","TimeUntilElement","microTimeUntil","startPositions","dragStartPositions","constructedElements","moveCropArea","ImageCropElement","box","image","deltaX","deltaY","KeyboardEvent","has","MouseEvent","pos","pageX","dragStartX","pageY","dragStartY","TouchEvent","changedTouches","x","max","offsetLeft","y","left","fireChangeEvent","updateCropArea","getShadowHost","rect","getBoundingClientRect","delta","setInitialPosition","startX","startY","pageXOffset","pageYOffset","updateDimensions","rootNode","host","startUpdate","direction","passive","classList","add","reposition","newSide","abs","side","clientWidth","stopUpdate","remove","ratio","naturalWidth","slottedInput","shadowRoot","attachShadow","mode","HTMLImageElement","loaded","val","attribute","DetailsMenuElement","preload","details","parentElement","summary","subscriptions","fromEvent","shouldCommit","menu","states","isSummaryFocused","tagName","sibling","activeElement","isMenuItem","loadFragment","once","opened","contains","closeCurrentMenu","NullSubscription","focusOnOpen","sub","unsubscribe","eventName","onNext","loader","autofocus","isMouse","focusFirstItem","next","found","def","menuitem","checked","item","textEl","labelText","contentsEl","labelHTML","updateLabel","checkState","indeterminate","updateChecked","role","alternateOrders","outside-top","outside-bottom","outside-left","outside-right","alternateAlignments","end","center","getAnchoredPosition","floatingElement","anchorElement","settings","parentNode","getComputedStyle","getPositionedParent","clippingRect","overflow","clippingNode","elemRect","elemStyle","borderTop","borderLeft","borderRight","borderBottom","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","map","v","parseInt","innerHeight","Infinity","getClippingRect","parentElementStyle","parentElementRect","viewportRect","relativePosition","floatingRect","anchorRect","align","allowOutOfBounds","anchorOffset","alignmentOffset","relativeViewportRect","calculatePosition","anchorSide","anchorAlign","alternateOrder","positionAttempt","prevSide","shouldRecalculatePosition","nextSide","alternateAlignment","alignmentAttempt","prevAlign","shouldRecalculateAlignment","nextAlign","assign","pureCalculateAnchoredPosition","_b","_c","_d","_e","positionDefaults","startsWith","getDefaultSettings","elementDimensions","anchorPosition","anchorRight","anchorBottom","currentPos","containerDimensions","_ToolTipElement_instances","_ToolTipElement_abortController","_ToolTipElement_align","_ToolTipElement_side","_ToolTipElement_allowUpdatePosition","_ToolTipElement_update","_ToolTipElement_updatePosition","__classPrivateFieldSet","receiver","kind","f","TypeError","call","__classPrivateFieldGet","DIRECTION_CLASSES","ToolTipElement","arguments","htmlFor","control","styles","now","toFixed","AbortController","signal","describedBy","isConnected","WeakSet","tooltip"],"mappings":"AAAA,MAAMA,IAAiBC,UAAUC,UAAUC,MAAM,aAClC,MAAMC,EACjBC,YAAYC,EAAOC,GACfC,KAAKF,MAAQA,EACbE,KAAKD,KAAOA,EACZC,KAAKC,aAAc,EACdF,EAAKG,KACNH,EAAKG,GAAK,YAAYC,KAAKC,SACtBC,WACAC,MAAM,EAAG,MAElBN,KAAKO,qBAAuBC,GAuEpC,SAA0BA,EAAOC,GAC7B,GAAID,EAAME,UAAYF,EAAMG,SAAWH,EAAMI,OACzC,OACJ,IAAKpB,GAAgBgB,EAAMK,QACvB,OACJ,GAAIJ,EAASR,YACT,OACJ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GA,KAIF,WAAVA,EACY,IAEG,UAAVA,EACO,KAGA,KAGpBhf,KAAKwY,UAAUC,IAAI,WAAWH,MAElC0J,GAAe1X,mBAAqB,CAAC,YAAa,iBAAkB,KAAM,UACrE/D,OAAO0G,eAAe5H,IAAI,cAC3BkB,OAAOyb,eAAiBA,GACxBzb,OAAO0G,eAAeC,OAAO,WAAY8U"}
|
1
|
+
{"version":3,"file":"primer_view_components.js","sources":["../../../node_modules/@github/combobox-nav/dist/index.js","../../../node_modules/@github/auto-complete-element/dist/index.js","../../../node_modules/@github/clipboard-copy-element/dist/index.esm.js","../../components/primer/clipboard_copy_component.js","../../../node_modules/@github/tab-container-element/dist/index.js","../../../node_modules/@github/time-elements/dist/index.js","../../../node_modules/@github/image-crop-element/dist/index.js","../../../node_modules/@github/details-menu-element/dist/index.js","../../../node_modules/@primer/behaviors/dist/esm/anchored-position.js","../../components/primer/alpha/tool-tip-element.js"],"sourcesContent":["const ctrlBindings = !!navigator.userAgent.match(/Macintosh/);\nexport default class Combobox {\n constructor(input, list) {\n this.input = input;\n this.list = list;\n this.isComposing = false;\n if (!list.id) {\n list.id = `combobox-${Math.random()\n .toString()\n .slice(2, 6)}`;\n }\n this.keyboardEventHandler = event => keyboardBindings(event, this);\n this.compositionEventHandler = event => trackComposition(event, this);\n this.inputHandler = this.clearSelection.bind(this);\n input.setAttribute('role', 'combobox');\n input.setAttribute('aria-controls', list.id);\n input.setAttribute('aria-expanded', 'false');\n input.setAttribute('aria-autocomplete', 'list');\n input.setAttribute('aria-haspopup', 'listbox');\n }\n destroy() {\n this.clearSelection();\n this.stop();\n this.input.removeAttribute('role');\n this.input.removeAttribute('aria-controls');\n this.input.removeAttribute('aria-expanded');\n this.input.removeAttribute('aria-autocomplete');\n this.input.removeAttribute('aria-haspopup');\n }\n start() {\n this.input.setAttribute('aria-expanded', 'true');\n this.input.addEventListener('compositionstart', this.compositionEventHandler);\n this.input.addEventListener('compositionend', this.compositionEventHandler);\n this.input.addEventListener('input', this.inputHandler);\n this.input.addEventListener('keydown', this.keyboardEventHandler);\n this.list.addEventListener('click', commitWithElement);\n }\n stop() {\n this.clearSelection();\n this.input.setAttribute('aria-expanded', 'false');\n this.input.removeEventListener('compositionstart', this.compositionEventHandler);\n this.input.removeEventListener('compositionend', this.compositionEventHandler);\n this.input.removeEventListener('input', this.inputHandler);\n this.input.removeEventListener('keydown', this.keyboardEventHandler);\n this.list.removeEventListener('click', commitWithElement);\n }\n navigate(indexDiff = 1) {\n const focusEl = Array.from(this.list.querySelectorAll('[aria-selected=\"true\"]')).filter(visible)[0];\n const els = Array.from(this.list.querySelectorAll('[role=\"option\"]')).filter(visible);\n const focusIndex = els.indexOf(focusEl);\n if ((focusIndex === els.length - 1 && indexDiff === 1) || (focusIndex === 0 && indexDiff === -1)) {\n this.clearSelection();\n this.input.focus();\n return;\n }\n let indexOfItem = indexDiff === 1 ? 0 : els.length - 1;\n if (focusEl && focusIndex >= 0) {\n const newIndex = focusIndex + indexDiff;\n if (newIndex >= 0 && newIndex < els.length)\n indexOfItem = newIndex;\n }\n const target = els[indexOfItem];\n if (!target)\n return;\n for (const el of els) {\n if (target === el) {\n this.input.setAttribute('aria-activedescendant', target.id);\n target.setAttribute('aria-selected', 'true');\n scrollTo(this.list, target);\n }\n else {\n el.setAttribute('aria-selected', 'false');\n }\n }\n }\n clearSelection() {\n this.input.removeAttribute('aria-activedescendant');\n for (const el of this.list.querySelectorAll('[aria-selected=\"true\"]')) {\n el.setAttribute('aria-selected', 'false');\n }\n }\n}\nfunction keyboardBindings(event, combobox) {\n if (event.shiftKey || event.metaKey || event.altKey)\n return;\n if (!ctrlBindings && event.ctrlKey)\n return;\n if (combobox.isComposing)\n return;\n switch (event.key) {\n case 'Enter':\n case 'Tab':\n if (commit(combobox.input, combobox.list)) {\n event.preventDefault();\n }\n break;\n case 'Escape':\n combobox.clearSelection();\n break;\n case 'ArrowDown':\n combobox.navigate(1);\n event.preventDefault();\n break;\n case 'ArrowUp':\n combobox.navigate(-1);\n event.preventDefault();\n break;\n case 'n':\n if (ctrlBindings && event.ctrlKey) {\n combobox.navigate(1);\n event.preventDefault();\n }\n break;\n case 'p':\n if (ctrlBindings && event.ctrlKey) {\n combobox.navigate(-1);\n event.preventDefault();\n }\n break;\n default:\n if (event.ctrlKey)\n break;\n combobox.clearSelection();\n }\n}\nfunction commitWithElement(event) {\n if (!(event.target instanceof Element))\n return;\n const target = event.target.closest('[role=\"option\"]');\n if (!target)\n return;\n if (target.getAttribute('aria-disabled') === 'true')\n return;\n fireCommitEvent(target);\n}\nfunction commit(input, list) {\n const target = list.querySelector('[aria-selected=\"true\"]');\n if (!target)\n return false;\n if (target.getAttribute('aria-disabled') === 'true')\n return true;\n target.click();\n return true;\n}\nfunction fireCommitEvent(target) {\n target.dispatchEvent(new CustomEvent('combobox-commit', { bubbles: true }));\n}\nfunction visible(el) {\n return (!el.hidden &&\n !(el instanceof HTMLInputElement && el.type === 'hidden') &&\n (el.offsetWidth > 0 || el.offsetHeight > 0));\n}\nfunction trackComposition(event, combobox) {\n combobox.isComposing = event.type === 'compositionstart';\n const list = document.getElementById(combobox.input.getAttribute('aria-controls') || '');\n if (!list)\n return;\n combobox.clearSelection();\n}\nfunction scrollTo(container, target) {\n if (!inViewport(container, target)) {\n container.scrollTop = target.offsetTop;\n }\n}\nfunction inViewport(container, element) {\n const scrollTop = container.scrollTop;\n const containerBottom = scrollTop + container.clientHeight;\n const top = element.offsetTop;\n const bottom = top + element.clientHeight;\n return top >= scrollTop && bottom <= containerBottom;\n}\n","import Combobox from '@github/combobox-nav';\n\nclass AutocompleteEvent extends CustomEvent {\n constructor(type, init) {\n super(type, init);\n this.relatedTarget = init.relatedTarget;\n }\n}\n\nfunction debounce(callback, wait = 0) {\n let timeout;\n return function (...Rest) {\n clearTimeout(timeout);\n timeout = window.setTimeout(() => {\n clearTimeout(timeout);\n callback(...Rest);\n }, wait);\n };\n}\n\nconst requests = new WeakMap();\nfunction fragment(el, url) {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.setRequestHeader('Accept', 'text/fragment+html');\n return request(el, xhr);\n}\nfunction request(el, xhr) {\n const pending = requests.get(el);\n if (pending)\n pending.abort();\n requests.set(el, xhr);\n const clear = () => requests.delete(el);\n const result = send(xhr);\n result.then(clear, clear);\n return result;\n}\nfunction send(xhr) {\n return new Promise((resolve, reject) => {\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.responseText);\n }\n else {\n reject(new Error(xhr.responseText));\n }\n };\n xhr.onerror = reject;\n xhr.send();\n });\n}\n\nconst SCREEN_READER_DELAY = window.testScreenReaderDelay || 100;\nclass Autocomplete {\n constructor(container, input, results, autoselectEnabled = false) {\n var _a;\n this.container = container;\n this.input = input;\n this.results = results;\n this.combobox = new Combobox(input, results);\n this.feedback = document.getElementById(`${this.results.id}-feedback`);\n this.autoselectEnabled = autoselectEnabled;\n this.clearButton = document.getElementById(`${this.input.id || this.input.name}-clear`);\n this.clientOptions = results.querySelectorAll('[role=option]');\n if (this.feedback) {\n this.feedback.setAttribute('aria-live', 'polite');\n this.feedback.setAttribute('aria-atomic', 'true');\n }\n if (this.clearButton && !this.clearButton.getAttribute('aria-label')) {\n const labelElem = document.querySelector(`label[for=\"${this.input.name}\"]`);\n this.clearButton.setAttribute('aria-label', `clear:`);\n this.clearButton.setAttribute('aria-labelledby', `${this.clearButton.id} ${(labelElem === null || labelElem === void 0 ? void 0 : labelElem.id) || ''}`);\n }\n if (!this.input.getAttribute('aria-expanded')) {\n this.input.setAttribute('aria-expanded', 'false');\n }\n this.results.hidden = true;\n this.results.setAttribute('aria-label', 'results');\n this.input.setAttribute('autocomplete', 'off');\n this.input.setAttribute('spellcheck', 'false');\n this.interactingWithList = false;\n this.onInputChange = debounce(this.onInputChange.bind(this), 300);\n this.onResultsMouseDown = this.onResultsMouseDown.bind(this);\n this.onInputBlur = this.onInputBlur.bind(this);\n this.onInputFocus = this.onInputFocus.bind(this);\n this.onKeydown = this.onKeydown.bind(this);\n this.onCommit = this.onCommit.bind(this);\n this.handleClear = this.handleClear.bind(this);\n this.input.addEventListener('keydown', this.onKeydown);\n this.input.addEventListener('focus', this.onInputFocus);\n this.input.addEventListener('blur', this.onInputBlur);\n this.input.addEventListener('input', this.onInputChange);\n this.results.addEventListener('mousedown', this.onResultsMouseDown);\n this.results.addEventListener('combobox-commit', this.onCommit);\n (_a = this.clearButton) === null || _a === void 0 ? void 0 : _a.addEventListener('click', this.handleClear);\n }\n destroy() {\n this.input.removeEventListener('keydown', this.onKeydown);\n this.input.removeEventListener('focus', this.onInputFocus);\n this.input.removeEventListener('blur', this.onInputBlur);\n this.input.removeEventListener('input', this.onInputChange);\n this.results.removeEventListener('mousedown', this.onResultsMouseDown);\n this.results.removeEventListener('combobox-commit', this.onCommit);\n }\n handleClear(event) {\n event.preventDefault();\n if (this.input.getAttribute('aria-expanded') === 'true') {\n this.input.setAttribute('aria-expanded', 'false');\n this.updateFeedbackForScreenReaders('Results hidden.');\n }\n this.input.value = '';\n this.container.value = '';\n this.input.focus();\n this.input.dispatchEvent(new Event('change'));\n this.container.open = false;\n }\n onKeydown(event) {\n if (event.key === 'Enter' && this.container.open && this.autoselectEnabled) {\n const firstOption = this.results.children[0];\n if (firstOption) {\n event.stopPropagation();\n event.preventDefault();\n this.onCommit({ target: firstOption });\n }\n }\n if (event.key === 'Escape' && this.container.open) {\n this.container.open = false;\n event.stopPropagation();\n event.preventDefault();\n }\n else if (event.altKey && event.key === 'ArrowUp' && this.container.open) {\n this.container.open = false;\n event.stopPropagation();\n event.preventDefault();\n }\n else if (event.altKey && event.key === 'ArrowDown' && !this.container.open) {\n if (!this.input.value.trim())\n return;\n this.container.open = true;\n event.stopPropagation();\n event.preventDefault();\n }\n }\n onInputFocus() {\n this.fetchResults();\n }\n onInputBlur() {\n if (this.interactingWithList) {\n this.interactingWithList = false;\n return;\n }\n this.container.open = false;\n }\n onCommit({ target }) {\n const selected = target;\n if (!(selected instanceof HTMLElement))\n return;\n this.container.open = false;\n if (selected instanceof HTMLAnchorElement)\n return;\n const value = selected.getAttribute('data-autocomplete-value') || selected.textContent;\n this.updateFeedbackForScreenReaders(`${selected.textContent || ''} selected.`);\n this.container.value = value;\n if (!value) {\n this.updateFeedbackForScreenReaders(`Results hidden.`);\n }\n }\n onResultsMouseDown() {\n this.interactingWithList = true;\n }\n onInputChange() {\n if (this.feedback && this.feedback.innerHTML) {\n this.feedback.innerHTML = '';\n }\n this.container.removeAttribute('value');\n this.fetchResults();\n }\n identifyOptions() {\n let id = 0;\n for (const el of this.results.querySelectorAll('[role=\"option\"]:not([id])')) {\n el.id = `${this.results.id}-option-${id++}`;\n }\n }\n updateFeedbackForScreenReaders(inputString) {\n setTimeout(() => {\n if (this.feedback) {\n this.feedback.innerHTML = inputString;\n }\n }, SCREEN_READER_DELAY);\n }\n fetchResults() {\n const query = this.input.value.trim();\n if (!query) {\n this.container.open = false;\n return;\n }\n const src = this.container.src;\n if (!src)\n return;\n const url = new URL(src, window.location.href);\n const params = new URLSearchParams(url.search.slice(1));\n params.append('q', query);\n url.search = params.toString();\n this.container.dispatchEvent(new CustomEvent('loadstart'));\n fragment(this.input, url.toString())\n .then(html => {\n this.results.innerHTML = html;\n this.identifyOptions();\n const allNewOptions = this.results.querySelectorAll('[role=\"option\"]');\n const hasResults = !!allNewOptions.length;\n const numOptions = allNewOptions.length;\n const [firstOption] = allNewOptions;\n const firstOptionValue = firstOption === null || firstOption === void 0 ? void 0 : firstOption.textContent;\n if (this.autoselectEnabled && firstOptionValue) {\n this.updateFeedbackForScreenReaders(`${numOptions} results. ${firstOptionValue} is the top result: Press Enter to activate.`);\n }\n else {\n this.updateFeedbackForScreenReaders(`${numOptions || 'No'} results.`);\n }\n this.container.open = hasResults;\n this.container.dispatchEvent(new CustomEvent('load'));\n this.container.dispatchEvent(new CustomEvent('loadend'));\n })\n .catch(() => {\n this.container.dispatchEvent(new CustomEvent('error'));\n this.container.dispatchEvent(new CustomEvent('loadend'));\n });\n }\n open() {\n if (!this.results.hidden)\n return;\n this.combobox.start();\n this.results.hidden = false;\n }\n close() {\n if (this.results.hidden)\n return;\n this.combobox.stop();\n this.results.hidden = true;\n }\n}\n\nconst state = new WeakMap();\nclass AutocompleteElement extends HTMLElement {\n connectedCallback() {\n const listId = this.getAttribute('for');\n if (!listId)\n return;\n const input = this.querySelector('input');\n const results = document.getElementById(listId);\n if (!(input instanceof HTMLInputElement) || !results)\n return;\n const autoselectEnabled = this.getAttribute('data-autoselect') === 'true';\n state.set(this, new Autocomplete(this, input, results, autoselectEnabled));\n results.setAttribute('role', 'listbox');\n }\n disconnectedCallback() {\n const autocomplete = state.get(this);\n if (autocomplete) {\n autocomplete.destroy();\n state.delete(this);\n }\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(url) {\n this.setAttribute('src', url);\n }\n get value() {\n return this.getAttribute('value') || '';\n }\n set value(value) {\n this.setAttribute('value', value);\n }\n get open() {\n return this.hasAttribute('open');\n }\n set open(value) {\n if (value) {\n this.setAttribute('open', '');\n }\n else {\n this.removeAttribute('open');\n }\n }\n static get observedAttributes() {\n return ['open', 'value'];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (oldValue === newValue)\n return;\n const autocomplete = state.get(this);\n if (!autocomplete)\n return;\n switch (name) {\n case 'open':\n newValue === null ? autocomplete.close() : autocomplete.open();\n break;\n case 'value':\n if (newValue !== null) {\n autocomplete.input.value = newValue;\n }\n this.dispatchEvent(new AutocompleteEvent('auto-complete-change', {\n bubbles: true,\n relatedTarget: autocomplete.input\n }));\n break;\n }\n }\n}\nif (!window.customElements.get('auto-complete')) {\n window.AutocompleteElement = AutocompleteElement;\n window.customElements.define('auto-complete', AutocompleteElement);\n}\n\nexport default AutocompleteElement;\nexport { AutocompleteEvent };\n","function createNode(text) {\n const node = document.createElement('pre');\n node.style.width = '1px';\n node.style.height = '1px';\n node.style.position = 'fixed';\n node.style.top = '5px';\n node.textContent = text;\n return node;\n}\n\nfunction copyNode(node) {\n if ('clipboard' in navigator) {\n // eslint-disable-next-line flowtype/no-flow-fix-me-comments\n // $FlowFixMe Clipboard is not defined in Flow yet.\n return navigator.clipboard.writeText(node.textContent);\n }\n\n const selection = getSelection();\n\n if (selection == null) {\n return Promise.reject(new Error());\n }\n\n selection.removeAllRanges();\n const range = document.createRange();\n range.selectNodeContents(node);\n selection.addRange(range);\n document.execCommand('copy');\n selection.removeAllRanges();\n return Promise.resolve();\n}\nfunction copyText(text) {\n if ('clipboard' in navigator) {\n // eslint-disable-next-line flowtype/no-flow-fix-me-comments\n // $FlowFixMe Clipboard is not defined in Flow yet.\n return navigator.clipboard.writeText(text);\n }\n\n const body = document.body;\n\n if (!body) {\n return Promise.reject(new Error());\n }\n\n const node = createNode(text);\n body.appendChild(node);\n copyNode(node);\n body.removeChild(node);\n return Promise.resolve();\n}\n\nfunction copy(button) {\n const id = button.getAttribute('for');\n const text = button.getAttribute('value');\n\n function trigger() {\n button.dispatchEvent(new CustomEvent('clipboard-copy', {\n bubbles: true\n }));\n }\n\n if (text) {\n copyText(text).then(trigger);\n } else if (id) {\n const root = 'getRootNode' in Element.prototype ? button.getRootNode() : button.ownerDocument;\n if (!(root instanceof Document || 'ShadowRoot' in window && root instanceof ShadowRoot)) return;\n const node = root.getElementById(id);\n if (node) copyTarget(node).then(trigger);\n }\n}\n\nfunction copyTarget(content) {\n if (content instanceof HTMLInputElement || content instanceof HTMLTextAreaElement) {\n return copyText(content.value);\n } else if (content instanceof HTMLAnchorElement && content.hasAttribute('href')) {\n return copyText(content.href);\n } else {\n return copyNode(content);\n }\n}\n\nfunction clicked(event) {\n const button = event.currentTarget;\n\n if (button instanceof HTMLElement) {\n copy(button);\n }\n}\n\nfunction keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n const button = event.currentTarget;\n\n if (button instanceof HTMLElement) {\n event.preventDefault();\n copy(button);\n }\n }\n}\n\nfunction focused(event) {\n event.currentTarget.addEventListener('keydown', keydown);\n}\n\nfunction blurred(event) {\n event.currentTarget.removeEventListener('keydown', keydown);\n}\n\nclass ClipboardCopyElement extends HTMLElement {\n constructor() {\n super();\n this.addEventListener('click', clicked);\n this.addEventListener('focus', focused);\n this.addEventListener('blur', blurred);\n }\n\n connectedCallback() {\n if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', '0');\n }\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'button');\n }\n }\n\n get value() {\n return this.getAttribute('value') || '';\n }\n\n set value(text) {\n this.setAttribute('value', text);\n }\n\n}\n\nif (!window.customElements.get('clipboard-copy')) {\n window.ClipboardCopyElement = ClipboardCopyElement;\n window.customElements.define('clipboard-copy', ClipboardCopyElement);\n}\n\nexport default ClipboardCopyElement;\n","import '@github/clipboard-copy-element';\nconst CLIPBOARD_COPY_TIMER_DURATION = 2000;\nfunction showSVG(svg) {\n svg.style.display = 'inline-block';\n}\nfunction hideSVG(svg) {\n svg.style.display = 'none';\n}\n// Toggle a copy button.\nfunction showCopy(button) {\n const [copyIcon, checkIcon] = button.querySelectorAll('.octicon');\n if (!copyIcon || !checkIcon)\n return;\n showSVG(copyIcon);\n hideSVG(checkIcon);\n}\n// Toggle a copy button.\nfunction showCheck(button) {\n const [copyIcon, checkIcon] = button.querySelectorAll('.octicon');\n if (!copyIcon || !checkIcon)\n return;\n hideSVG(copyIcon);\n showSVG(checkIcon);\n}\nconst clipboardCopyElementTimers = new WeakMap();\ndocument.addEventListener('clipboard-copy', function ({ target }) {\n if (!(target instanceof HTMLElement))\n return;\n if (!target.hasAttribute('data-view-component'))\n return;\n const currentTimeout = clipboardCopyElementTimers.get(target);\n if (currentTimeout) {\n clearTimeout(currentTimeout);\n clipboardCopyElementTimers.delete(target);\n }\n else {\n showCheck(target);\n }\n clipboardCopyElementTimers.set(target, setTimeout(() => {\n showCopy(target);\n clipboardCopyElementTimers.delete(target);\n }, CLIPBOARD_COPY_TIMER_DURATION));\n});\n","export default class TabContainerElement extends HTMLElement {\n constructor() {\n super();\n this.addEventListener('keydown', (event) => {\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n if (target.getAttribute('role') !== 'tab' && !target.closest('[role=\"tablist\"]'))\n return;\n const tabs = Array.from(this.querySelectorAll('[role=\"tablist\"] [role=\"tab\"]'));\n const currentIndex = tabs.indexOf(tabs.find(tab => tab.matches('[aria-selected=\"true\"]')));\n if (event.code === 'ArrowRight') {\n let index = currentIndex + 1;\n if (index >= tabs.length)\n index = 0;\n selectTab(this, index);\n }\n else if (event.code === 'ArrowLeft') {\n let index = currentIndex - 1;\n if (index < 0)\n index = tabs.length - 1;\n selectTab(this, index);\n }\n else if (event.code === 'Home') {\n selectTab(this, 0);\n event.preventDefault();\n }\n else if (event.code === 'End') {\n selectTab(this, tabs.length - 1);\n event.preventDefault();\n }\n });\n this.addEventListener('click', (event) => {\n const tabs = Array.from(this.querySelectorAll('[role=\"tablist\"] [role=\"tab\"]'));\n if (!(event.target instanceof Element))\n return;\n const tab = event.target.closest('[role=\"tab\"]');\n if (!tab || !tab.closest('[role=\"tablist\"]'))\n return;\n const index = tabs.indexOf(tab);\n selectTab(this, index);\n });\n }\n connectedCallback() {\n for (const tab of this.querySelectorAll('[role=\"tablist\"] [role=\"tab\"]')) {\n if (!tab.hasAttribute('aria-selected')) {\n tab.setAttribute('aria-selected', 'false');\n }\n if (!tab.hasAttribute('tabindex')) {\n if (tab.getAttribute('aria-selected') === 'true') {\n tab.setAttribute('tabindex', '0');\n }\n else {\n tab.setAttribute('tabindex', '-1');\n }\n }\n }\n }\n}\nfunction selectTab(tabContainer, index) {\n const tabs = tabContainer.querySelectorAll('[role=\"tablist\"] [role=\"tab\"]');\n const panels = tabContainer.querySelectorAll('[role=\"tabpanel\"]');\n const selectedTab = tabs[index];\n const selectedPanel = panels[index];\n const cancelled = !tabContainer.dispatchEvent(new CustomEvent('tab-container-change', {\n bubbles: true,\n cancelable: true,\n detail: { relatedTarget: selectedPanel }\n }));\n if (cancelled)\n return;\n for (const tab of tabs) {\n tab.setAttribute('aria-selected', 'false');\n tab.setAttribute('tabindex', '-1');\n }\n for (const panel of panels) {\n panel.hidden = true;\n if (!panel.hasAttribute('tabindex') && !panel.hasAttribute('data-tab-container-no-tabstop')) {\n panel.setAttribute('tabindex', '0');\n }\n }\n selectedTab.setAttribute('aria-selected', 'true');\n selectedTab.setAttribute('tabindex', '0');\n selectedTab.focus();\n selectedPanel.hidden = false;\n tabContainer.dispatchEvent(new CustomEvent('tab-container-changed', {\n bubbles: true,\n detail: { relatedTarget: selectedPanel }\n }));\n}\nif (!window.customElements.get('tab-container')) {\n window.TabContainerElement = TabContainerElement;\n window.customElements.define('tab-container', TabContainerElement);\n}\n//# sourceMappingURL=index.js.map","const weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\nconst months = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n];\nfunction pad(num) {\n return `0${num}`.slice(-2);\n}\nfunction strftime(time, formatString) {\n const day = time.getDay();\n const date = time.getDate();\n const month = time.getMonth();\n const year = time.getFullYear();\n const hour = time.getHours();\n const minute = time.getMinutes();\n const second = time.getSeconds();\n return formatString.replace(/%([%aAbBcdeHIlmMpPSwyYZz])/g, function (_arg) {\n let match;\n const modifier = _arg[1];\n switch (modifier) {\n case '%':\n return '%';\n case 'a':\n return weekdays[day].slice(0, 3);\n case 'A':\n return weekdays[day];\n case 'b':\n return months[month].slice(0, 3);\n case 'B':\n return months[month];\n case 'c':\n return time.toString();\n case 'd':\n return pad(date);\n case 'e':\n return String(date);\n case 'H':\n return pad(hour);\n case 'I':\n return pad(strftime(time, '%l'));\n case 'l':\n if (hour === 0 || hour === 12) {\n return String(12);\n }\n else {\n return String((hour + 12) % 12);\n }\n case 'm':\n return pad(month + 1);\n case 'M':\n return pad(minute);\n case 'p':\n if (hour > 11) {\n return 'PM';\n }\n else {\n return 'AM';\n }\n case 'P':\n if (hour > 11) {\n return 'pm';\n }\n else {\n return 'am';\n }\n case 'S':\n return pad(second);\n case 'w':\n return String(day);\n case 'y':\n return pad(year % 100);\n case 'Y':\n return String(year);\n case 'Z':\n match = time.toString().match(/\\((\\w+)\\)$/);\n return match ? match[1] : '';\n case 'z':\n match = time.toString().match(/\\w([+-]\\d\\d\\d\\d) /);\n return match ? match[1] : '';\n }\n return '';\n });\n}\nfunction makeFormatter(options) {\n let format;\n return function () {\n if (format)\n return format;\n if ('Intl' in window) {\n try {\n format = new Intl.DateTimeFormat(undefined, options);\n return format;\n }\n catch (e) {\n if (!(e instanceof RangeError)) {\n throw e;\n }\n }\n }\n };\n}\nlet dayFirst = null;\nconst dayFirstFormatter = makeFormatter({ day: 'numeric', month: 'short' });\nfunction isDayFirst() {\n if (dayFirst !== null) {\n return dayFirst;\n }\n const formatter = dayFirstFormatter();\n if (formatter) {\n const output = formatter.format(new Date(0));\n dayFirst = !!output.match(/^\\d/);\n return dayFirst;\n }\n else {\n return false;\n }\n}\nlet yearSeparator = null;\nconst yearFormatter = makeFormatter({ day: 'numeric', month: 'short', year: 'numeric' });\nfunction isYearSeparator() {\n if (yearSeparator !== null) {\n return yearSeparator;\n }\n const formatter = yearFormatter();\n if (formatter) {\n const output = formatter.format(new Date(0));\n yearSeparator = !!output.match(/\\d,/);\n return yearSeparator;\n }\n else {\n return true;\n }\n}\nfunction isThisYear(date) {\n const now = new Date();\n return now.getUTCFullYear() === date.getUTCFullYear();\n}\nfunction makeRelativeFormat(locale, options) {\n if ('Intl' in window && 'RelativeTimeFormat' in window.Intl) {\n try {\n return new Intl.RelativeTimeFormat(locale, options);\n }\n catch (e) {\n if (!(e instanceof RangeError)) {\n throw e;\n }\n }\n }\n}\nfunction localeFromElement(el) {\n const container = el.closest('[lang]');\n if (container instanceof HTMLElement && container.lang) {\n return container.lang;\n }\n return 'default';\n}\n\nconst datetimes = new WeakMap();\nclass ExtendedTimeElement extends HTMLElement {\n static get observedAttributes() {\n return [\n 'datetime',\n 'day',\n 'format',\n 'lang',\n 'hour',\n 'minute',\n 'month',\n 'second',\n 'title',\n 'weekday',\n 'year',\n 'time-zone-name'\n ];\n }\n connectedCallback() {\n const title = this.getFormattedTitle();\n if (title && !this.hasAttribute('title')) {\n this.setAttribute('title', title);\n }\n const text = this.getFormattedDate();\n if (text) {\n this.textContent = text;\n }\n }\n attributeChangedCallback(attrName, oldValue, newValue) {\n const oldTitle = this.getFormattedTitle();\n if (attrName === 'datetime') {\n const millis = Date.parse(newValue);\n if (isNaN(millis)) {\n datetimes.delete(this);\n }\n else {\n datetimes.set(this, new Date(millis));\n }\n }\n const title = this.getFormattedTitle();\n const currentTitle = this.getAttribute('title');\n if (attrName !== 'title' && title && (!currentTitle || currentTitle === oldTitle)) {\n this.setAttribute('title', title);\n }\n const text = this.getFormattedDate();\n if (text) {\n this.textContent = text;\n }\n }\n get date() {\n return datetimes.get(this);\n }\n getFormattedTitle() {\n const date = this.date;\n if (!date)\n return;\n const formatter = titleFormatter();\n if (formatter) {\n return formatter.format(date);\n }\n else {\n try {\n return date.toLocaleString();\n }\n catch (e) {\n if (e instanceof RangeError) {\n return date.toString();\n }\n else {\n throw e;\n }\n }\n }\n }\n getFormattedDate() {\n return;\n }\n}\nconst titleFormatter = makeFormatter({\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short'\n});\n\nconst formatters = new WeakMap();\nclass LocalTimeElement extends ExtendedTimeElement {\n attributeChangedCallback(attrName, oldValue, newValue) {\n if (attrName === 'hour' || attrName === 'minute' || attrName === 'second' || attrName === 'time-zone-name') {\n formatters.delete(this);\n }\n super.attributeChangedCallback(attrName, oldValue, newValue);\n }\n getFormattedDate() {\n const d = this.date;\n if (!d)\n return;\n const date = formatDate(this, d) || '';\n const time = formatTime(this, d) || '';\n return `${date} ${time}`.trim();\n }\n}\nfunction formatDate(el, date) {\n const props = {\n weekday: {\n short: '%a',\n long: '%A'\n },\n day: {\n numeric: '%e',\n '2-digit': '%d'\n },\n month: {\n short: '%b',\n long: '%B'\n },\n year: {\n numeric: '%Y',\n '2-digit': '%y'\n }\n };\n let format = isDayFirst() ? 'weekday day month year' : 'weekday month day, year';\n for (const prop in props) {\n const value = props[prop][el.getAttribute(prop) || ''];\n format = format.replace(prop, value || '');\n }\n format = format.replace(/(\\s,)|(,\\s$)/, '');\n return strftime(date, format).replace(/\\s+/, ' ').trim();\n}\nfunction formatTime(el, date) {\n const options = {};\n const hour = el.getAttribute('hour');\n if (hour === 'numeric' || hour === '2-digit')\n options.hour = hour;\n const minute = el.getAttribute('minute');\n if (minute === 'numeric' || minute === '2-digit')\n options.minute = minute;\n const second = el.getAttribute('second');\n if (second === 'numeric' || second === '2-digit')\n options.second = second;\n const tz = el.getAttribute('time-zone-name');\n if (tz === 'short' || tz === 'long')\n options.timeZoneName = tz;\n if (Object.keys(options).length === 0) {\n return;\n }\n let factory = formatters.get(el);\n if (!factory) {\n factory = makeFormatter(options);\n formatters.set(el, factory);\n }\n const formatter = factory();\n if (formatter) {\n return formatter.format(date);\n }\n else {\n const timef = options.second ? '%H:%M:%S' : '%H:%M';\n return strftime(date, timef);\n }\n}\nif (!window.customElements.get('local-time')) {\n window.LocalTimeElement = LocalTimeElement;\n window.customElements.define('local-time', LocalTimeElement);\n}\n\nclass RelativeTime {\n constructor(date, locale) {\n this.date = date;\n this.locale = locale;\n }\n toString() {\n const ago = this.timeElapsed();\n if (ago) {\n return ago;\n }\n else {\n const ahead = this.timeAhead();\n if (ahead) {\n return ahead;\n }\n else {\n return `on ${this.formatDate()}`;\n }\n }\n }\n timeElapsed() {\n const ms = new Date().getTime() - this.date.getTime();\n const sec = Math.round(ms / 1000);\n const min = Math.round(sec / 60);\n const hr = Math.round(min / 60);\n const day = Math.round(hr / 24);\n if (ms >= 0 && day < 30) {\n return this.timeAgoFromMs(ms);\n }\n else {\n return null;\n }\n }\n timeAhead() {\n const ms = this.date.getTime() - new Date().getTime();\n const sec = Math.round(ms / 1000);\n const min = Math.round(sec / 60);\n const hr = Math.round(min / 60);\n const day = Math.round(hr / 24);\n if (ms >= 0 && day < 30) {\n return this.timeUntil();\n }\n else {\n return null;\n }\n }\n timeAgo() {\n const ms = new Date().getTime() - this.date.getTime();\n return this.timeAgoFromMs(ms);\n }\n timeAgoFromMs(ms) {\n const sec = Math.round(ms / 1000);\n const min = Math.round(sec / 60);\n const hr = Math.round(min / 60);\n const day = Math.round(hr / 24);\n const month = Math.round(day / 30);\n const year = Math.round(month / 12);\n if (ms < 0) {\n return formatRelativeTime(this.locale, 0, 'second');\n }\n else if (sec < 10) {\n return formatRelativeTime(this.locale, 0, 'second');\n }\n else if (sec < 45) {\n return formatRelativeTime(this.locale, -sec, 'second');\n }\n else if (sec < 90) {\n return formatRelativeTime(this.locale, -min, 'minute');\n }\n else if (min < 45) {\n return formatRelativeTime(this.locale, -min, 'minute');\n }\n else if (min < 90) {\n return formatRelativeTime(this.locale, -hr, 'hour');\n }\n else if (hr < 24) {\n return formatRelativeTime(this.locale, -hr, 'hour');\n }\n else if (hr < 36) {\n return formatRelativeTime(this.locale, -day, 'day');\n }\n else if (day < 30) {\n return formatRelativeTime(this.locale, -day, 'day');\n }\n else if (month < 18) {\n return formatRelativeTime(this.locale, -month, 'month');\n }\n else {\n return formatRelativeTime(this.locale, -year, 'year');\n }\n }\n microTimeAgo() {\n const ms = new Date().getTime() - this.date.getTime();\n const sec = Math.round(ms / 1000);\n const min = Math.round(sec / 60);\n const hr = Math.round(min / 60);\n const day = Math.round(hr / 24);\n const month = Math.round(day / 30);\n const year = Math.round(month / 12);\n if (min < 1) {\n return '1m';\n }\n else if (min < 60) {\n return `${min}m`;\n }\n else if (hr < 24) {\n return `${hr}h`;\n }\n else if (day < 365) {\n return `${day}d`;\n }\n else {\n return `${year}y`;\n }\n }\n timeUntil() {\n const ms = this.date.getTime() - new Date().getTime();\n return this.timeUntilFromMs(ms);\n }\n timeUntilFromMs(ms) {\n const sec = Math.round(ms / 1000);\n const min = Math.round(sec / 60);\n const hr = Math.round(min / 60);\n const day = Math.round(hr / 24);\n const month = Math.round(day / 30);\n const year = Math.round(month / 12);\n if (month >= 18) {\n return formatRelativeTime(this.locale, year, 'year');\n }\n else if (month >= 12) {\n return formatRelativeTime(this.locale, year, 'year');\n }\n else if (day >= 45) {\n return formatRelativeTime(this.locale, month, 'month');\n }\n else if (day >= 30) {\n return formatRelativeTime(this.locale, month, 'month');\n }\n else if (hr >= 36) {\n return formatRelativeTime(this.locale, day, 'day');\n }\n else if (hr >= 24) {\n return formatRelativeTime(this.locale, day, 'day');\n }\n else if (min >= 90) {\n return formatRelativeTime(this.locale, hr, 'hour');\n }\n else if (min >= 45) {\n return formatRelativeTime(this.locale, hr, 'hour');\n }\n else if (sec >= 90) {\n return formatRelativeTime(this.locale, min, 'minute');\n }\n else if (sec >= 45) {\n return formatRelativeTime(this.locale, min, 'minute');\n }\n else if (sec >= 10) {\n return formatRelativeTime(this.locale, sec, 'second');\n }\n else {\n return formatRelativeTime(this.locale, 0, 'second');\n }\n }\n microTimeUntil() {\n const ms = this.date.getTime() - new Date().getTime();\n const sec = Math.round(ms / 1000);\n const min = Math.round(sec / 60);\n const hr = Math.round(min / 60);\n const day = Math.round(hr / 24);\n const month = Math.round(day / 30);\n const year = Math.round(month / 12);\n if (day >= 365) {\n return `${year}y`;\n }\n else if (hr >= 24) {\n return `${day}d`;\n }\n else if (min >= 60) {\n return `${hr}h`;\n }\n else if (min > 1) {\n return `${min}m`;\n }\n else {\n return '1m';\n }\n }\n formatDate() {\n let format = isDayFirst() ? '%e %b' : '%b %e';\n if (!isThisYear(this.date)) {\n format += isYearSeparator() ? ', %Y' : ' %Y';\n }\n return strftime(this.date, format);\n }\n formatTime() {\n const formatter = timeFormatter();\n if (formatter) {\n return formatter.format(this.date);\n }\n else {\n return strftime(this.date, '%l:%M%P');\n }\n }\n}\nfunction formatRelativeTime(locale, value, unit) {\n const formatter = makeRelativeFormat(locale, { numeric: 'auto' });\n if (formatter) {\n return formatter.format(value, unit);\n }\n else {\n return formatEnRelativeTime(value, unit);\n }\n}\nfunction formatEnRelativeTime(value, unit) {\n if (value === 0) {\n switch (unit) {\n case 'year':\n case 'quarter':\n case 'month':\n case 'week':\n return `this ${unit}`;\n case 'day':\n return 'today';\n case 'hour':\n case 'minute':\n return `in 0 ${unit}s`;\n case 'second':\n return 'now';\n }\n }\n else if (value === 1) {\n switch (unit) {\n case 'year':\n case 'quarter':\n case 'month':\n case 'week':\n return `next ${unit}`;\n case 'day':\n return 'tomorrow';\n case 'hour':\n case 'minute':\n case 'second':\n return `in 1 ${unit}`;\n }\n }\n else if (value === -1) {\n switch (unit) {\n case 'year':\n case 'quarter':\n case 'month':\n case 'week':\n return `last ${unit}`;\n case 'day':\n return 'yesterday';\n case 'hour':\n case 'minute':\n case 'second':\n return `1 ${unit} ago`;\n }\n }\n else if (value > 1) {\n switch (unit) {\n case 'year':\n case 'quarter':\n case 'month':\n case 'week':\n case 'day':\n case 'hour':\n case 'minute':\n case 'second':\n return `in ${value} ${unit}s`;\n }\n }\n else if (value < -1) {\n switch (unit) {\n case 'year':\n case 'quarter':\n case 'month':\n case 'week':\n case 'day':\n case 'hour':\n case 'minute':\n case 'second':\n return `${-value} ${unit}s ago`;\n }\n }\n throw new RangeError(`Invalid unit argument for format() '${unit}'`);\n}\nconst timeFormatter = makeFormatter({ hour: 'numeric', minute: '2-digit' });\n\nclass RelativeTimeElement extends ExtendedTimeElement {\n getFormattedDate() {\n const date = this.date;\n if (!date)\n return;\n return new RelativeTime(date, localeFromElement(this)).toString();\n }\n connectedCallback() {\n nowElements.push(this);\n if (!updateNowElementsId) {\n updateNowElements();\n updateNowElementsId = window.setInterval(updateNowElements, 60 * 1000);\n }\n super.connectedCallback();\n }\n disconnectedCallback() {\n const ix = nowElements.indexOf(this);\n if (ix !== -1) {\n nowElements.splice(ix, 1);\n }\n if (!nowElements.length) {\n if (updateNowElementsId) {\n clearInterval(updateNowElementsId);\n updateNowElementsId = null;\n }\n }\n }\n}\nconst nowElements = [];\nlet updateNowElementsId;\nfunction updateNowElements() {\n let time, i, len;\n for (i = 0, len = nowElements.length; i < len; i++) {\n time = nowElements[i];\n time.textContent = time.getFormattedDate() || '';\n }\n}\nif (!window.customElements.get('relative-time')) {\n window.RelativeTimeElement = RelativeTimeElement;\n window.customElements.define('relative-time', RelativeTimeElement);\n}\n\nclass TimeAgoElement extends RelativeTimeElement {\n getFormattedDate() {\n const format = this.getAttribute('format');\n const date = this.date;\n if (!date)\n return;\n if (format === 'micro') {\n return new RelativeTime(date, localeFromElement(this)).microTimeAgo();\n }\n else {\n return new RelativeTime(date, localeFromElement(this)).timeAgo();\n }\n }\n}\nif (!window.customElements.get('time-ago')) {\n window.TimeAgoElement = TimeAgoElement;\n window.customElements.define('time-ago', TimeAgoElement);\n}\n\nclass TimeUntilElement extends RelativeTimeElement {\n getFormattedDate() {\n const format = this.getAttribute('format');\n const date = this.date;\n if (!date)\n return;\n if (format === 'micro') {\n return new RelativeTime(date, localeFromElement(this)).microTimeUntil();\n }\n else {\n return new RelativeTime(date, localeFromElement(this)).timeUntil();\n }\n }\n}\nif (!window.customElements.get('time-until')) {\n window.TimeUntilElement = TimeUntilElement;\n window.customElements.define('time-until', TimeUntilElement);\n}\n\nexport { LocalTimeElement, RelativeTimeElement, TimeAgoElement, TimeUntilElement };\n","const startPositions = new WeakMap();\nconst dragStartPositions = new WeakMap();\nconst constructedElements = new WeakMap();\nfunction moveCropArea(event) {\n const el = event.currentTarget;\n if (!(el instanceof ImageCropElement))\n return;\n const { box, image } = constructedElements.get(el) || {};\n if (!box || !image)\n return;\n let deltaX = 0;\n let deltaY = 0;\n if (event instanceof KeyboardEvent) {\n if (event.key === 'ArrowUp') {\n deltaY = -1;\n }\n else if (event.key === 'ArrowDown') {\n deltaY = 1;\n }\n else if (event.key === 'ArrowLeft') {\n deltaX = -1;\n }\n else if (event.key === 'ArrowRight') {\n deltaX = 1;\n }\n }\n else if (dragStartPositions.has(el) && event instanceof MouseEvent) {\n const pos = dragStartPositions.get(el);\n deltaX = event.pageX - pos.dragStartX;\n deltaY = event.pageY - pos.dragStartY;\n }\n else if (dragStartPositions.has(el) && event instanceof TouchEvent) {\n const { pageX, pageY } = event.changedTouches[0];\n const { dragStartX, dragStartY } = dragStartPositions.get(el);\n deltaX = pageX - dragStartX;\n deltaY = pageY - dragStartY;\n }\n if (deltaX !== 0 || deltaY !== 0) {\n const x = Math.min(Math.max(0, box.offsetLeft + deltaX), image.width - box.offsetWidth);\n const y = Math.min(Math.max(0, box.offsetTop + deltaY), image.height - box.offsetHeight);\n box.style.left = `${x}px`;\n box.style.top = `${y}px`;\n fireChangeEvent(el, { x, y, width: box.offsetWidth, height: box.offsetHeight });\n }\n if (event instanceof MouseEvent) {\n dragStartPositions.set(el, {\n dragStartX: event.pageX,\n dragStartY: event.pageY\n });\n }\n else if (event instanceof TouchEvent) {\n const { pageX, pageY } = event.changedTouches[0];\n dragStartPositions.set(el, {\n dragStartX: pageX,\n dragStartY: pageY\n });\n }\n}\nfunction updateCropArea(event) {\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n const el = getShadowHost(target);\n if (!(el instanceof ImageCropElement))\n return;\n const { box } = constructedElements.get(el) || {};\n if (!box)\n return;\n const rect = el.getBoundingClientRect();\n let deltaX, deltaY, delta;\n if (event instanceof KeyboardEvent) {\n if (event.key === 'Escape')\n return setInitialPosition(el);\n if (event.key === '-')\n delta = -10;\n if (event.key === '=')\n delta = +10;\n if (!delta)\n return;\n deltaX = box.offsetWidth + delta;\n deltaY = box.offsetHeight + delta;\n startPositions.set(el, { startX: box.offsetLeft, startY: box.offsetTop });\n }\n else if (event instanceof MouseEvent) {\n const pos = startPositions.get(el);\n if (!pos)\n return;\n deltaX = event.pageX - pos.startX - rect.left - window.pageXOffset;\n deltaY = event.pageY - pos.startY - rect.top - window.pageYOffset;\n }\n else if (event instanceof TouchEvent) {\n const pos = startPositions.get(el);\n if (!pos)\n return;\n deltaX = event.changedTouches[0].pageX - pos.startX - rect.left - window.pageXOffset;\n deltaY = event.changedTouches[0].pageY - pos.startY - rect.top - window.pageYOffset;\n }\n if (deltaX && deltaY)\n updateDimensions(el, deltaX, deltaY, !(event instanceof KeyboardEvent));\n}\nfunction getShadowHost(el) {\n const rootNode = el.getRootNode();\n if (!(rootNode instanceof ShadowRoot))\n return el;\n return rootNode.host;\n}\nfunction startUpdate(event) {\n const currentTarget = event.currentTarget;\n if (!(currentTarget instanceof HTMLElement))\n return;\n const el = getShadowHost(currentTarget);\n if (!(el instanceof ImageCropElement))\n return;\n const { box } = constructedElements.get(el) || {};\n if (!box)\n return;\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n if (target.hasAttribute('data-direction')) {\n const direction = target.getAttribute('data-direction') || '';\n el.addEventListener('mousemove', updateCropArea);\n el.addEventListener('touchmove', updateCropArea, { passive: true });\n if (['nw', 'se'].indexOf(direction) >= 0)\n el.classList.add('nwse');\n if (['ne', 'sw'].indexOf(direction) >= 0)\n el.classList.add('nesw');\n startPositions.set(el, {\n startX: box.offsetLeft + (['se', 'ne'].indexOf(direction) >= 0 ? 0 : box.offsetWidth),\n startY: box.offsetTop + (['se', 'sw'].indexOf(direction) >= 0 ? 0 : box.offsetHeight)\n });\n updateCropArea(event);\n }\n else {\n el.addEventListener('mousemove', moveCropArea);\n el.addEventListener('touchmove', moveCropArea, { passive: true });\n }\n}\nfunction updateDimensions(target, deltaX, deltaY, reposition = true) {\n let newSide = Math.max(Math.abs(deltaX), Math.abs(deltaY), 10);\n const pos = startPositions.get(target);\n if (!pos)\n return;\n const { box, image } = constructedElements.get(target) || {};\n if (!box || !image)\n return;\n newSide = Math.min(newSide, deltaY > 0 ? image.height - pos.startY : pos.startY, deltaX > 0 ? image.width - pos.startX : pos.startX);\n const x = reposition ? Math.round(Math.max(0, deltaX > 0 ? pos.startX : pos.startX - newSide)) : box.offsetLeft;\n const y = reposition ? Math.round(Math.max(0, deltaY > 0 ? pos.startY : pos.startY - newSide)) : box.offsetTop;\n box.style.left = `${x}px`;\n box.style.top = `${y}px`;\n box.style.width = `${newSide}px`;\n box.style.height = `${newSide}px`;\n fireChangeEvent(target, { x, y, width: newSide, height: newSide });\n}\nfunction setInitialPosition(el) {\n const { image } = constructedElements.get(el) || {};\n if (!image)\n return;\n const side = Math.round(image.clientWidth > image.clientHeight ? image.clientHeight : image.clientWidth);\n startPositions.set(el, {\n startX: (image.clientWidth - side) / 2,\n startY: (image.clientHeight - side) / 2\n });\n updateDimensions(el, side, side);\n}\nfunction stopUpdate(event) {\n const el = event.currentTarget;\n if (!(el instanceof ImageCropElement))\n return;\n dragStartPositions.delete(el);\n el.classList.remove('nwse', 'nesw');\n el.removeEventListener('mousemove', updateCropArea);\n el.removeEventListener('mousemove', moveCropArea);\n el.removeEventListener('touchmove', updateCropArea);\n el.removeEventListener('touchmove', moveCropArea);\n}\nfunction fireChangeEvent(target, result) {\n const { image } = constructedElements.get(target) || {};\n if (!image)\n return;\n const ratio = image.naturalWidth / image.width;\n for (const key in result) {\n const value = Math.round(result[key] * ratio);\n result[key] = value;\n const slottedInput = target.querySelector(`[data-image-crop-input='${key}']`);\n if (slottedInput instanceof HTMLInputElement)\n slottedInput.value = value.toString();\n }\n target.dispatchEvent(new CustomEvent('image-crop-change', { bubbles: true, detail: result }));\n}\nclass ImageCropElement extends HTMLElement {\n connectedCallback() {\n if (constructedElements.has(this))\n return;\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.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`;\n const box = shadowRoot.querySelector('[data-crop-box]');\n if (!(box instanceof HTMLElement))\n return;\n const image = shadowRoot.querySelector('img');\n if (!(image instanceof HTMLImageElement))\n return;\n constructedElements.set(this, { box, image });\n image.addEventListener('load', () => {\n this.loaded = true;\n setInitialPosition(this);\n });\n this.addEventListener('mouseleave', stopUpdate);\n this.addEventListener('touchend', stopUpdate);\n this.addEventListener('mouseup', stopUpdate);\n box.addEventListener('mousedown', startUpdate);\n box.addEventListener('touchstart', startUpdate, { passive: true });\n this.addEventListener('keydown', moveCropArea);\n this.addEventListener('keydown', updateCropArea);\n if (this.src)\n image.src = this.src;\n }\n static get observedAttributes() {\n return ['src'];\n }\n get src() {\n return this.getAttribute('src');\n }\n set src(val) {\n if (val) {\n this.setAttribute('src', val);\n }\n else {\n this.removeAttribute('src');\n }\n }\n get loaded() {\n return this.hasAttribute('loaded');\n }\n set loaded(val) {\n if (val) {\n this.setAttribute('loaded', '');\n }\n else {\n this.removeAttribute('loaded');\n }\n }\n attributeChangedCallback(attribute, oldValue, newValue) {\n const { image } = constructedElements.get(this) || {};\n if (attribute === 'src') {\n this.loaded = false;\n if (image)\n image.src = newValue;\n }\n }\n}\nexport default ImageCropElement;\nif (!window.customElements.get('image-crop')) {\n window.ImageCropElement = ImageCropElement;\n window.customElements.define('image-crop', ImageCropElement);\n}\n","class DetailsMenuElement extends HTMLElement {\n get preload() {\n return this.hasAttribute('preload');\n }\n set preload(value) {\n if (value) {\n this.setAttribute('preload', '');\n }\n else {\n this.removeAttribute('preload');\n }\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(value) {\n this.setAttribute('src', value);\n }\n connectedCallback() {\n if (!this.hasAttribute('role'))\n this.setAttribute('role', 'menu');\n const details = this.parentElement;\n if (!details)\n return;\n const summary = details.querySelector('summary');\n if (summary) {\n summary.setAttribute('aria-haspopup', 'menu');\n if (!summary.hasAttribute('role'))\n summary.setAttribute('role', 'button');\n }\n const subscriptions = [\n fromEvent(details, 'compositionstart', e => trackComposition(this, e)),\n fromEvent(details, 'compositionend', e => trackComposition(this, e)),\n fromEvent(details, 'click', e => shouldCommit(details, e)),\n fromEvent(details, 'change', e => shouldCommit(details, e)),\n fromEvent(details, 'keydown', e => keydown(details, this, e)),\n fromEvent(details, 'toggle', () => loadFragment(details, this), { once: true }),\n fromEvent(details, 'toggle', () => closeCurrentMenu(details)),\n this.preload\n ? fromEvent(details, 'mouseover', () => loadFragment(details, this), { once: true })\n : NullSubscription,\n ...focusOnOpen(details)\n ];\n states.set(this, { subscriptions, loaded: false, isComposing: false });\n }\n disconnectedCallback() {\n const state = states.get(this);\n if (!state)\n return;\n states.delete(this);\n for (const sub of state.subscriptions) {\n sub.unsubscribe();\n }\n }\n}\nconst states = new WeakMap();\nconst NullSubscription = {\n unsubscribe() {\n }\n};\nfunction fromEvent(target, eventName, onNext, options = false) {\n target.addEventListener(eventName, onNext, options);\n return {\n unsubscribe: () => {\n target.removeEventListener(eventName, onNext, options);\n }\n };\n}\nfunction loadFragment(details, menu) {\n const src = menu.getAttribute('src');\n if (!src)\n return;\n const state = states.get(menu);\n if (!state)\n return;\n if (state.loaded)\n return;\n state.loaded = true;\n const loader = menu.querySelector('include-fragment');\n if (loader && !loader.hasAttribute('src')) {\n loader.addEventListener('loadend', () => autofocus(details));\n loader.setAttribute('src', src);\n }\n}\nfunction focusOnOpen(details) {\n let isMouse = false;\n const onmousedown = () => (isMouse = true);\n const onkeydown = () => (isMouse = false);\n const ontoggle = () => {\n if (!details.hasAttribute('open'))\n return;\n if (autofocus(details))\n return;\n if (!isMouse)\n focusFirstItem(details);\n };\n return [\n fromEvent(details, 'mousedown', onmousedown),\n fromEvent(details, 'keydown', onkeydown),\n fromEvent(details, 'toggle', ontoggle)\n ];\n}\nfunction closeCurrentMenu(details) {\n if (!details.hasAttribute('open'))\n return;\n for (const menu of document.querySelectorAll('details[open] > details-menu')) {\n const opened = menu.closest('details');\n if (opened && opened !== details && !opened.contains(details)) {\n opened.removeAttribute('open');\n }\n }\n}\nfunction autofocus(details) {\n if (!details.hasAttribute('open'))\n return false;\n const input = details.querySelector('details-menu [autofocus]');\n if (input) {\n input.focus();\n return true;\n }\n else {\n return false;\n }\n}\nfunction focusFirstItem(details) {\n const selected = document.activeElement;\n if (selected && isMenuItem(selected) && details.contains(selected))\n return;\n const target = sibling(details, true);\n if (target)\n target.focus();\n}\nfunction sibling(details, next) {\n const options = Array.from(details.querySelectorAll('[role^=\"menuitem\"]:not([hidden]):not([disabled]):not([aria-disabled=\"true\"])'));\n const selected = document.activeElement;\n const index = selected instanceof HTMLElement ? options.indexOf(selected) : -1;\n const found = next ? options[index + 1] : options[index - 1];\n const def = next ? options[0] : options[options.length - 1];\n return found || def;\n}\nconst ctrlBindings = navigator.userAgent.match(/Macintosh/);\nfunction shouldCommit(details, event) {\n const target = event.target;\n if (!(target instanceof Element))\n return;\n if (target.closest('details') !== details)\n return;\n if (event.type === 'click') {\n const menuitem = target.closest('[role=\"menuitem\"], [role=\"menuitemradio\"]');\n if (!menuitem)\n return;\n const input = menuitem.querySelector('input');\n if (menuitem.tagName === 'LABEL' && target === input)\n return;\n const onlyCommitOnChangeEvent = menuitem.tagName === 'LABEL' && input && !input.checked;\n if (!onlyCommitOnChangeEvent) {\n commit(menuitem, details);\n }\n }\n else if (event.type === 'change') {\n const menuitem = target.closest('[role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]');\n if (menuitem)\n commit(menuitem, details);\n }\n}\nfunction updateChecked(selected, details) {\n for (const el of details.querySelectorAll('[role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]')) {\n const input = el.querySelector('input[type=\"radio\"], input[type=\"checkbox\"]');\n let checkState = (el === selected).toString();\n if (input instanceof HTMLInputElement) {\n checkState = input.indeterminate ? 'mixed' : input.checked.toString();\n }\n el.setAttribute('aria-checked', checkState);\n }\n}\nfunction commit(selected, details) {\n if (selected.hasAttribute('disabled') || selected.getAttribute('aria-disabled') === 'true')\n return;\n const menu = selected.closest('details-menu');\n if (!menu)\n return;\n const dispatched = menu.dispatchEvent(new CustomEvent('details-menu-select', {\n cancelable: true,\n detail: { relatedTarget: selected }\n }));\n if (!dispatched)\n return;\n updateLabel(selected, details);\n updateChecked(selected, details);\n if (selected.getAttribute('role') !== 'menuitemcheckbox')\n close(details);\n menu.dispatchEvent(new CustomEvent('details-menu-selected', {\n detail: { relatedTarget: selected }\n }));\n}\nfunction keydown(details, menu, event) {\n if (!(event instanceof KeyboardEvent))\n return;\n if (details.querySelector('details[open]'))\n return;\n const state = states.get(menu);\n if (!state || state.isComposing)\n return;\n const isSummaryFocused = event.target instanceof Element && event.target.tagName === 'SUMMARY';\n switch (event.key) {\n case 'Escape':\n if (details.hasAttribute('open')) {\n close(details);\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n case 'ArrowDown':\n {\n if (isSummaryFocused && !details.hasAttribute('open')) {\n details.setAttribute('open', '');\n }\n const target = sibling(details, true);\n if (target)\n target.focus();\n event.preventDefault();\n }\n break;\n case 'ArrowUp':\n {\n if (isSummaryFocused && !details.hasAttribute('open')) {\n details.setAttribute('open', '');\n }\n const target = sibling(details, false);\n if (target)\n target.focus();\n event.preventDefault();\n }\n break;\n case 'n':\n {\n if (ctrlBindings && event.ctrlKey) {\n const target = sibling(details, true);\n if (target)\n target.focus();\n event.preventDefault();\n }\n }\n break;\n case 'p':\n {\n if (ctrlBindings && event.ctrlKey) {\n const target = sibling(details, false);\n if (target)\n target.focus();\n event.preventDefault();\n }\n }\n break;\n case ' ':\n case 'Enter':\n {\n const selected = document.activeElement;\n if (selected instanceof HTMLElement && isMenuItem(selected) && selected.closest('details') === details) {\n event.preventDefault();\n event.stopPropagation();\n selected.click();\n }\n }\n break;\n }\n}\nfunction isMenuItem(el) {\n const role = el.getAttribute('role');\n return role === 'menuitem' || role === 'menuitemcheckbox' || role === 'menuitemradio';\n}\nfunction close(details) {\n const wasOpen = details.hasAttribute('open');\n if (!wasOpen)\n return;\n details.removeAttribute('open');\n const summary = details.querySelector('summary');\n if (summary)\n summary.focus();\n}\nfunction updateLabel(item, details) {\n const button = details.querySelector('[data-menu-button]');\n if (!button)\n return;\n const text = labelText(item);\n if (text) {\n button.textContent = text;\n }\n else {\n const html = labelHTML(item);\n if (html)\n button.innerHTML = html;\n }\n}\nfunction labelText(el) {\n if (!el)\n return null;\n const textEl = el.hasAttribute('data-menu-button-text') ? el : el.querySelector('[data-menu-button-text]');\n if (!textEl)\n return null;\n return textEl.getAttribute('data-menu-button-text') || textEl.textContent;\n}\nfunction labelHTML(el) {\n if (!el)\n return null;\n const contentsEl = el.hasAttribute('data-menu-button-contents') ? el : el.querySelector('[data-menu-button-contents]');\n return contentsEl ? contentsEl.innerHTML : null;\n}\nfunction trackComposition(menu, event) {\n const state = states.get(menu);\n if (!state)\n return;\n state.isComposing = event.type === 'compositionstart';\n}\nexport default DetailsMenuElement;\nif (!window.customElements.get('details-menu')) {\n window.DetailsMenuElement = DetailsMenuElement;\n window.customElements.define('details-menu', DetailsMenuElement);\n}\n","const alternateOrders = {\n 'outside-top': ['outside-bottom', 'outside-right', 'outside-left', 'outside-bottom'],\n 'outside-bottom': ['outside-top', 'outside-right', 'outside-left', 'outside-bottom'],\n 'outside-left': ['outside-right', 'outside-bottom', 'outside-top', 'outside-bottom'],\n 'outside-right': ['outside-left', 'outside-bottom', 'outside-top', 'outside-bottom']\n};\nconst alternateAlignments = {\n start: ['end', 'center'],\n end: ['start', 'center'],\n center: ['end', 'start']\n};\nexport function getAnchoredPosition(floatingElement, anchorElement, settings = {}) {\n const parentElement = getPositionedParent(floatingElement);\n const clippingRect = getClippingRect(parentElement);\n const parentElementStyle = getComputedStyle(parentElement);\n const parentElementRect = parentElement.getBoundingClientRect();\n const [borderTop, borderLeft] = [parentElementStyle.borderTopWidth, parentElementStyle.borderLeftWidth].map(v => parseInt(v, 10) || 0);\n const relativeRect = {\n top: parentElementRect.top + borderTop,\n left: parentElementRect.left + borderLeft\n };\n return pureCalculateAnchoredPosition(clippingRect, relativeRect, floatingElement.getBoundingClientRect(), anchorElement instanceof Element ? anchorElement.getBoundingClientRect() : anchorElement, getDefaultSettings(settings));\n}\nfunction getPositionedParent(element) {\n let parentNode = element.parentNode;\n while (parentNode !== null) {\n if (parentNode instanceof HTMLElement && getComputedStyle(parentNode).position !== 'static') {\n return parentNode;\n }\n parentNode = parentNode.parentNode;\n }\n return document.body;\n}\nfunction getClippingRect(element) {\n let parentNode = element;\n while (parentNode !== null) {\n if (parentNode === document.body) {\n break;\n }\n const parentNodeStyle = getComputedStyle(parentNode);\n if (parentNodeStyle.overflow !== 'visible') {\n break;\n }\n parentNode = parentNode.parentNode;\n }\n const clippingNode = parentNode === document.body || !(parentNode instanceof HTMLElement) ? document.body : parentNode;\n const elemRect = clippingNode.getBoundingClientRect();\n const elemStyle = getComputedStyle(clippingNode);\n const [borderTop, borderLeft, borderRight, borderBottom] = [\n elemStyle.borderTopWidth,\n elemStyle.borderLeftWidth,\n elemStyle.borderRightWidth,\n elemStyle.borderBottomWidth\n ].map(v => parseInt(v, 10) || 0);\n return {\n top: elemRect.top + borderTop,\n left: elemRect.left + borderLeft,\n width: elemRect.width - borderRight - borderLeft,\n height: Math.max(elemRect.height - borderTop - borderBottom, clippingNode === document.body ? window.innerHeight : -Infinity)\n };\n}\nconst positionDefaults = {\n side: 'outside-bottom',\n align: 'start',\n anchorOffset: 4,\n alignmentOffset: 4,\n allowOutOfBounds: false\n};\nfunction getDefaultSettings(settings = {}) {\n var _a, _b, _c, _d, _e;\n const side = (_a = settings.side) !== null && _a !== void 0 ? _a : positionDefaults.side;\n const align = (_b = settings.align) !== null && _b !== void 0 ? _b : positionDefaults.align;\n return {\n side,\n align,\n anchorOffset: (_c = settings.anchorOffset) !== null && _c !== void 0 ? _c : (side === 'inside-center' ? 0 : positionDefaults.anchorOffset),\n alignmentOffset: (_d = settings.alignmentOffset) !== null && _d !== void 0 ? _d : (align !== 'center' && side.startsWith('inside') ? positionDefaults.alignmentOffset : 0),\n allowOutOfBounds: (_e = settings.allowOutOfBounds) !== null && _e !== void 0 ? _e : positionDefaults.allowOutOfBounds\n };\n}\nfunction pureCalculateAnchoredPosition(viewportRect, relativePosition, floatingRect, anchorRect, { side, align, allowOutOfBounds, anchorOffset, alignmentOffset }) {\n const relativeViewportRect = {\n top: viewportRect.top - relativePosition.top,\n left: viewportRect.left - relativePosition.left,\n width: viewportRect.width,\n height: viewportRect.height\n };\n let pos = calculatePosition(floatingRect, anchorRect, side, align, anchorOffset, alignmentOffset);\n let anchorSide = side;\n let anchorAlign = align;\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n if (!allowOutOfBounds) {\n const alternateOrder = alternateOrders[side];\n let positionAttempt = 0;\n if (alternateOrder) {\n let prevSide = side;\n while (positionAttempt < alternateOrder.length &&\n shouldRecalculatePosition(prevSide, pos, relativeViewportRect, floatingRect)) {\n const nextSide = alternateOrder[positionAttempt++];\n prevSide = nextSide;\n pos = calculatePosition(floatingRect, anchorRect, nextSide, align, anchorOffset, alignmentOffset);\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n anchorSide = nextSide;\n }\n }\n const alternateAlignment = alternateAlignments[align];\n let alignmentAttempt = 0;\n if (alternateAlignment) {\n let prevAlign = align;\n while (alignmentAttempt < alternateAlignment.length &&\n shouldRecalculateAlignment(prevAlign, pos, relativeViewportRect, floatingRect)) {\n const nextAlign = alternateAlignment[alignmentAttempt++];\n prevAlign = nextAlign;\n pos = calculatePosition(floatingRect, anchorRect, anchorSide, nextAlign, anchorOffset, alignmentOffset);\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n anchorAlign = nextAlign;\n }\n }\n if (pos.top < relativeViewportRect.top) {\n pos.top = relativeViewportRect.top;\n }\n if (pos.left < relativeViewportRect.left) {\n pos.left = relativeViewportRect.left;\n }\n if (pos.left + floatingRect.width > viewportRect.width + relativeViewportRect.left) {\n pos.left = viewportRect.width + relativeViewportRect.left - floatingRect.width;\n }\n if (alternateOrder && positionAttempt < alternateOrder.length) {\n if (pos.top + floatingRect.height > viewportRect.height + relativeViewportRect.top) {\n pos.top = viewportRect.height + relativeViewportRect.top - floatingRect.height;\n }\n }\n }\n return Object.assign(Object.assign({}, pos), { anchorSide, anchorAlign });\n}\nfunction calculatePosition(elementDimensions, anchorPosition, side, align, anchorOffset, alignmentOffset) {\n const anchorRight = anchorPosition.left + anchorPosition.width;\n const anchorBottom = anchorPosition.top + anchorPosition.height;\n let top = -1;\n let left = -1;\n if (side === 'outside-top') {\n top = anchorPosition.top - anchorOffset - elementDimensions.height;\n }\n else if (side === 'outside-bottom') {\n top = anchorBottom + anchorOffset;\n }\n else if (side === 'outside-left') {\n left = anchorPosition.left - anchorOffset - elementDimensions.width;\n }\n else if (side === 'outside-right') {\n left = anchorRight + anchorOffset;\n }\n if (side === 'outside-top' || side === 'outside-bottom') {\n if (align === 'start') {\n left = anchorPosition.left + alignmentOffset;\n }\n else if (align === 'center') {\n left = anchorPosition.left - (elementDimensions.width - anchorPosition.width) / 2 + alignmentOffset;\n }\n else {\n left = anchorRight - elementDimensions.width - alignmentOffset;\n }\n }\n if (side === 'outside-left' || side === 'outside-right') {\n if (align === 'start') {\n top = anchorPosition.top + alignmentOffset;\n }\n else if (align === 'center') {\n top = anchorPosition.top - (elementDimensions.height - anchorPosition.height) / 2 + alignmentOffset;\n }\n else {\n top = anchorBottom - elementDimensions.height - alignmentOffset;\n }\n }\n if (side === 'inside-top') {\n top = anchorPosition.top + anchorOffset;\n }\n else if (side === 'inside-bottom') {\n top = anchorBottom - anchorOffset - elementDimensions.height;\n }\n else if (side === 'inside-left') {\n left = anchorPosition.left + anchorOffset;\n }\n else if (side === 'inside-right') {\n left = anchorRight - anchorOffset - elementDimensions.width;\n }\n else if (side === 'inside-center') {\n left = (anchorRight + anchorPosition.left) / 2 - elementDimensions.width / 2 + anchorOffset;\n }\n if (side === 'inside-top' || side === 'inside-bottom') {\n if (align === 'start') {\n left = anchorPosition.left + alignmentOffset;\n }\n else if (align === 'center') {\n left = anchorPosition.left - (elementDimensions.width - anchorPosition.width) / 2 + alignmentOffset;\n }\n else {\n left = anchorRight - elementDimensions.width - alignmentOffset;\n }\n }\n else if (side === 'inside-left' || side === 'inside-right' || side === 'inside-center') {\n if (align === 'start') {\n top = anchorPosition.top + alignmentOffset;\n }\n else if (align === 'center') {\n top = anchorPosition.top - (elementDimensions.height - anchorPosition.height) / 2 + alignmentOffset;\n }\n else {\n top = anchorBottom - elementDimensions.height - alignmentOffset;\n }\n }\n return { top, left };\n}\nfunction shouldRecalculatePosition(side, currentPos, containerDimensions, elementDimensions) {\n if (side === 'outside-top' || side === 'outside-bottom') {\n return (currentPos.top < containerDimensions.top ||\n currentPos.top + elementDimensions.height > containerDimensions.height + containerDimensions.top);\n }\n else {\n return (currentPos.left < containerDimensions.left ||\n currentPos.left + elementDimensions.width > containerDimensions.width + containerDimensions.left);\n }\n}\nfunction shouldRecalculateAlignment(align, currentPos, containerDimensions, elementDimensions) {\n if (align === 'end') {\n return currentPos.left < containerDimensions.left;\n }\n else if (align === 'start' || align === 'center') {\n return currentPos.left + elementDimensions.width > containerDimensions.left + containerDimensions.width;\n }\n}\n","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _ToolTipElement_instances, _ToolTipElement_abortController, _ToolTipElement_align, _ToolTipElement_side, _ToolTipElement_allowUpdatePosition, _ToolTipElement_update, _ToolTipElement_updatePosition;\nimport { getAnchoredPosition } from '@primer/behaviors';\nconst TOOLTIP_OPEN_CLASS = 'tooltip-open';\nconst TOOLTIP_ARROW_EDGE_OFFSET = 6;\nconst DIRECTION_CLASSES = [\n 'tooltip-n',\n 'tooltip-s',\n 'tooltip-e',\n 'tooltip-w',\n 'tooltip-ne',\n 'tooltip-se',\n 'tooltip-nw',\n 'tooltip-sw'\n];\nclass ToolTipElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _ToolTipElement_instances.add(this);\n _ToolTipElement_abortController.set(this, void 0);\n _ToolTipElement_align.set(this, 'center');\n _ToolTipElement_side.set(this, 'outside-bottom');\n _ToolTipElement_allowUpdatePosition.set(this, false);\n }\n styles() {\n 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_CLASS}),\n :host(.${TOOLTIP_OPEN_CLASS}):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: -${TOOLTIP_ARROW_EDGE_OFFSET}px;\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: ${TOOLTIP_ARROW_EDGE_OFFSET}px;\n }\n \n :host(.tooltip-sw):before,\n :host(.tooltip-nw):before {\n right: 0;\n margin-right: ${TOOLTIP_ARROW_EDGE_OFFSET}px;\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 `;\n }\n get htmlFor() {\n return this.getAttribute('for') || '';\n }\n set htmlFor(value) {\n this.setAttribute('for', value);\n }\n get type() {\n const type = this.getAttribute('data-type');\n return type === 'label' ? 'label' : 'description';\n }\n set type(value) {\n this.setAttribute('data-type', value);\n }\n get direction() {\n return (this.getAttribute('data-direction') || 's');\n }\n set direction(value) {\n this.setAttribute('data-direction', value);\n }\n get control() {\n return this.ownerDocument.getElementById(this.htmlFor);\n }\n connectedCallback() {\n var _a;\n if (!this.shadowRoot) {\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.innerHTML = `\n <style>\n ${this.styles()}\n </style>\n <slot></slot>\n `;\n }\n this.hidden = true;\n __classPrivateFieldSet(this, _ToolTipElement_allowUpdatePosition, true, \"f\");\n if (!this.id) {\n this.id = `tooltip-${Date.now()}-${(Math.random() * 10000).toFixed(0)}`;\n }\n if (!this.control)\n return;\n this.setAttribute('role', 'tooltip');\n (_a = __classPrivateFieldGet(this, _ToolTipElement_abortController, \"f\")) === null || _a === void 0 ? void 0 : _a.abort();\n __classPrivateFieldSet(this, _ToolTipElement_abortController, new AbortController(), \"f\");\n const { signal } = __classPrivateFieldGet(this, _ToolTipElement_abortController, \"f\");\n this.addEventListener('mouseleave', this, { signal });\n this.control.addEventListener('mouseenter', this, { signal });\n this.control.addEventListener('mouseleave', this, { signal });\n this.control.addEventListener('focus', this, { signal });\n this.control.addEventListener('blur', this, { signal });\n this.ownerDocument.addEventListener('keydown', this, { signal });\n __classPrivateFieldGet(this, _ToolTipElement_instances, \"m\", _ToolTipElement_update).call(this);\n }\n disconnectedCallback() {\n var _a;\n (_a = __classPrivateFieldGet(this, _ToolTipElement_abortController, \"f\")) === null || _a === void 0 ? void 0 : _a.abort();\n }\n handleEvent(event) {\n if (!this.control)\n return;\n // Ensures that tooltip stays open when hovering between tooltip and element\n // WCAG Success Criterion 1.4.13 Hoverable\n if ((event.type === 'mouseenter' || event.type === 'focus') && this.hidden) {\n this.hidden = false;\n }\n else if (event.type === 'blur') {\n this.hidden = true;\n }\n else if (event.type === 'mouseleave' &&\n event.relatedTarget !== this.control &&\n event.relatedTarget !== this) {\n this.hidden = true;\n }\n else if (event.type === 'keydown' && event.key === 'Escape' && !this.hidden) {\n this.hidden = true;\n }\n }\n attributeChangedCallback(name) {\n if (name === 'id' || name === 'data-type') {\n if (!this.id || !this.control)\n return;\n if (this.type === 'label') {\n this.control.setAttribute('aria-labelledby', this.id);\n }\n else {\n let describedBy = this.control.getAttribute('aria-describedby');\n describedBy ? (describedBy = `${describedBy} ${this.id}`) : (describedBy = this.id);\n this.control.setAttribute('aria-describedby', describedBy);\n }\n }\n else if (this.isConnected && name === 'hidden') {\n __classPrivateFieldGet(this, _ToolTipElement_instances, \"m\", _ToolTipElement_update).call(this);\n }\n else if (name === 'data-direction') {\n this.classList.remove(...DIRECTION_CLASSES);\n const direction = this.direction;\n if (direction === 'n') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'center', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-top', \"f\");\n }\n else if (direction === 'ne') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'start', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-top', \"f\");\n }\n else if (direction === 'e') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'center', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-right', \"f\");\n }\n else if (direction === 'se') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'start', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-bottom', \"f\");\n }\n else if (direction === 's') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'center', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-bottom', \"f\");\n }\n else if (direction === 'sw') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'end', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-bottom', \"f\");\n }\n else if (direction === 'w') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'center', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-left', \"f\");\n }\n else if (direction === 'nw') {\n __classPrivateFieldSet(this, _ToolTipElement_align, 'end', \"f\");\n __classPrivateFieldSet(this, _ToolTipElement_side, 'outside-top', \"f\");\n }\n }\n }\n}\n_ToolTipElement_abortController = new WeakMap(), _ToolTipElement_align = new WeakMap(), _ToolTipElement_side = new WeakMap(), _ToolTipElement_allowUpdatePosition = new WeakMap(), _ToolTipElement_instances = new WeakSet(), _ToolTipElement_update = function _ToolTipElement_update() {\n if (this.hidden) {\n this.classList.remove(TOOLTIP_OPEN_CLASS, ...DIRECTION_CLASSES);\n }\n else {\n this.classList.add(TOOLTIP_OPEN_CLASS);\n for (const tooltip of this.ownerDocument.querySelectorAll(this.tagName)) {\n if (tooltip !== this)\n tooltip.hidden = true;\n }\n __classPrivateFieldGet(this, _ToolTipElement_instances, \"m\", _ToolTipElement_updatePosition).call(this);\n }\n}, _ToolTipElement_updatePosition = function _ToolTipElement_updatePosition() {\n if (!this.control)\n return;\n if (!__classPrivateFieldGet(this, _ToolTipElement_allowUpdatePosition, \"f\") || this.hidden)\n return;\n const TOOLTIP_OFFSET = 10;\n this.style.left = `0px`; // Ensures we have reliable tooltip width in `getAnchoredPosition`\n const position = getAnchoredPosition(this, this.control, {\n side: __classPrivateFieldGet(this, _ToolTipElement_side, \"f\"),\n align: __classPrivateFieldGet(this, _ToolTipElement_align, \"f\"),\n anchorOffset: TOOLTIP_OFFSET\n });\n const anchorSide = position.anchorSide;\n const align = position.anchorAlign;\n this.style.top = `${position.top}px`;\n this.style.left = `${position.left}px`;\n let direction = 's';\n if (anchorSide === 'outside-left') {\n direction = 'w';\n }\n else if (anchorSide === 'outside-right') {\n direction = 'e';\n }\n else if (anchorSide === 'outside-top') {\n if (align === 'center') {\n direction = 'n';\n }\n else if (align === 'start') {\n direction = 'ne';\n }\n else {\n direction = 'nw';\n }\n }\n else {\n if (align === 'center') {\n direction = 's';\n }\n else if (align === 'start') {\n direction = 'se';\n }\n else {\n direction = 'sw';\n }\n }\n this.classList.add(`tooltip-${direction}`);\n};\nToolTipElement.observedAttributes = ['data-type', 'data-direction', 'id', 'hidden'];\nif (!window.customElements.get('tool-tip')) {\n window.ToolTipElement = ToolTipElement;\n window.customElements.define('tool-tip', ToolTipElement);\n}\n"],"names":["ctrlBindings","navigator","userAgent","match","Combobox","[object Object]","input","list","this","isComposing","id","Math","random","toString","slice","keyboardEventHandler","event","combobox","shiftKey","metaKey","altKey","ctrlKey","key","target","querySelector","getAttribute","click","commit","preventDefault","clearSelection","navigate","keyboardBindings","compositionEventHandler","type","document","getElementById","trackComposition","inputHandler","bind","setAttribute","stop","removeAttribute","addEventListener","commitWithElement","removeEventListener","indexDiff","focusEl","Array","from","querySelectorAll","filter","visible","els","focusIndex","indexOf","length","focus","indexOfItem","newIndex","el","scrollTo","Element","closest","dispatchEvent","CustomEvent","bubbles","fireCommitEvent","hidden","HTMLInputElement","offsetWidth","offsetHeight","container","element","scrollTop","containerBottom","clientHeight","top","offsetTop","bottom","inViewport","AutocompleteEvent","init","super","relatedTarget","requests","WeakMap","fragment","url","xhr","XMLHttpRequest","open","setRequestHeader","pending","get","abort","set","clear","delete","result","Promise","resolve","reject","onload","status","responseText","Error","onerror","send","then","request","SCREEN_READER_DELAY","window","testScreenReaderDelay","Autocomplete","results","autoselectEnabled","_a","feedback","clearButton","name","clientOptions","labelElem","interactingWithList","onInputChange","callback","wait","timeout","Rest","clearTimeout","setTimeout","debounce","onResultsMouseDown","onInputBlur","onInputFocus","onKeydown","onCommit","handleClear","updateFeedbackForScreenReaders","value","Event","firstOption","children","stopPropagation","trim","fetchResults","selected","HTMLElement","HTMLAnchorElement","textContent","innerHTML","inputString","query","src","URL","location","href","params","URLSearchParams","search","append","html","identifyOptions","allNewOptions","hasResults","numOptions","firstOptionValue","catch","start","state","AutocompleteElement","listId","autocomplete","destroy","hasAttribute","observedAttributes","oldValue","newValue","close","copyNode","node","clipboard","writeText","selection","getSelection","removeAllRanges","range","createRange","selectNodeContents","addRange","execCommand","copyText","text","body","createElement","style","width","height","position","createNode","appendChild","removeChild","copy","button","trigger","root","prototype","getRootNode","ownerDocument","Document","ShadowRoot","content","HTMLTextAreaElement","clicked","currentTarget","keydown","focused","blurred","customElements","define","ClipboardCopyElement","showSVG","svg","display","hideSVG","clipboardCopyElementTimers","currentTimeout","copyIcon","checkIcon","showCheck","showCopy","TabContainerElement","tabs","currentIndex","find","tab","matches","code","index","selectTab","tabContainer","panels","selectedTab","selectedPanel","cancelable","detail","panel","weekdays","months","pad","num","strftime","time","formatString","day","getDay","date","getDate","month","getMonth","year","getFullYear","hour","getHours","minute","getMinutes","second","getSeconds","replace","_arg","String","makeFormatter","options","format","Intl","DateTimeFormat","undefined","e","RangeError","dayFirst","dayFirstFormatter","isDayFirst","formatter","output","Date","yearSeparator","yearFormatter","localeFromElement","lang","datetimes","ExtendedTimeElement","title","getFormattedTitle","getFormattedDate","attrName","oldTitle","millis","parse","isNaN","currentTitle","titleFormatter","toLocaleString","timeZoneName","formatters","LocalTimeElement","attributeChangedCallback","d","props","weekday","short","long","numeric","2-digit","prop","formatDate","tz","Object","keys","factory","formatTime","RelativeTime","locale","ago","timeElapsed","ahead","timeAhead","ms","getTime","sec","round","min","hr","timeAgoFromMs","timeUntil","formatRelativeTime","timeUntilFromMs","getUTCFullYear","isYearSeparator","timeFormatter","unit","RelativeTimeFormat","makeRelativeFormat","formatEnRelativeTime","RelativeTimeElement","nowElements","push","updateNowElementsId","updateNowElements","setInterval","connectedCallback","ix","splice","clearInterval","i","len","TimeAgoElement","microTimeAgo","timeAgo","TimeUntilElement","microTimeUntil","startPositions","dragStartPositions","constructedElements","moveCropArea","ImageCropElement","box","image","deltaX","deltaY","KeyboardEvent","has","MouseEvent","pos","pageX","dragStartX","pageY","dragStartY","TouchEvent","changedTouches","x","max","offsetLeft","y","left","fireChangeEvent","updateCropArea","getShadowHost","rect","getBoundingClientRect","delta","setInitialPosition","startX","startY","pageXOffset","pageYOffset","updateDimensions","rootNode","host","startUpdate","direction","passive","classList","add","reposition","newSide","abs","side","clientWidth","stopUpdate","remove","ratio","naturalWidth","slottedInput","shadowRoot","attachShadow","mode","HTMLImageElement","loaded","val","attribute","DetailsMenuElement","preload","details","parentElement","summary","subscriptions","fromEvent","shouldCommit","menu","states","isSummaryFocused","tagName","sibling","activeElement","isMenuItem","loadFragment","once","opened","contains","closeCurrentMenu","NullSubscription","focusOnOpen","sub","unsubscribe","eventName","onNext","loader","autofocus","isMouse","focusFirstItem","next","found","def","menuitem","checked","item","textEl","labelText","contentsEl","labelHTML","updateLabel","checkState","indeterminate","updateChecked","role","alternateOrders","outside-top","outside-bottom","outside-left","outside-right","alternateAlignments","end","center","getAnchoredPosition","floatingElement","anchorElement","settings","parentNode","getComputedStyle","getPositionedParent","clippingRect","overflow","clippingNode","elemRect","elemStyle","borderTop","borderLeft","borderRight","borderBottom","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","map","v","parseInt","innerHeight","Infinity","getClippingRect","parentElementStyle","parentElementRect","viewportRect","relativePosition","floatingRect","anchorRect","align","allowOutOfBounds","anchorOffset","alignmentOffset","relativeViewportRect","calculatePosition","anchorSide","anchorAlign","alternateOrder","positionAttempt","prevSide","shouldRecalculatePosition","nextSide","alternateAlignment","alignmentAttempt","prevAlign","shouldRecalculateAlignment","nextAlign","assign","pureCalculateAnchoredPosition","_b","_c","_d","_e","positionDefaults","startsWith","getDefaultSettings","elementDimensions","anchorPosition","anchorRight","anchorBottom","currentPos","containerDimensions","_ToolTipElement_instances","_ToolTipElement_abortController","_ToolTipElement_align","_ToolTipElement_side","_ToolTipElement_allowUpdatePosition","_ToolTipElement_update","_ToolTipElement_updatePosition","__classPrivateFieldSet","receiver","kind","f","TypeError","call","__classPrivateFieldGet","DIRECTION_CLASSES","ToolTipElement","arguments","htmlFor","control","styles","now","toFixed","AbortController","signal","describedBy","isConnected","WeakSet","tooltip"],"mappings":"AAAA,MAAMA,IAAiBC,UAAUC,UAAUC,MAAM,aAClC,MAAMC,EACjBC,YAAYC,EAAOC,GACfC,KAAKF,MAAQA,EACbE,KAAKD,KAAOA,EACZC,KAAKC,aAAc,EACdF,EAAKG,KACNH,EAAKG,GAAK,YAAYC,KAAKC,SACtBC,WACAC,MAAM,EAAG,MAElBN,KAAKO,qBAAuBC,GAuEpC,SAA0BA,EAAOC,GAC7B,GAAID,EAAME,UAAYF,EAAMG,SAAWH,EAAMI,OACzC,OACJ,IAAKpB,GAAgBgB,EAAMK,QACvB,OACJ,GAAIJ,EAASR,YACT,OACJ,OAAQO,EAAMM,KACV,IAAK,QACL,IAAK,OA4Cb,SAAgBhB,EAAOC,GACnB,MAAMgB,EAAShB,EAAKiB,cAAc,0BAClC,QAAKD,IAEwC,SAAzCA,EAAOE,aAAa,kBAExBF,EAAOG,SADI,IAhDCC,CAAOV,EAASX,MAAOW,EAASV,OAChCS,EAAMY,iBAEV,MACJ,IAAK,SACDX,EAASY,iBACT,MACJ,IAAK,YACDZ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 -178,13 +178,15 @@ class ToolTipElement extends HTMLElement {
|
|
178
178
|
}
|
179
179
|
connectedCallback() {
|
180
180
|
var _a;
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
181
|
+
if (!this.shadowRoot) {
|
182
|
+
const shadow = this.attachShadow({ mode: 'open' });
|
183
|
+
shadow.innerHTML = `
|
184
|
+
<style>
|
185
|
+
${this.styles()}
|
186
|
+
</style>
|
187
|
+
<slot></slot>
|
188
|
+
`;
|
189
|
+
}
|
188
190
|
this.hidden = true;
|
189
191
|
__classPrivateFieldSet(this, _ToolTipElement_allowUpdatePosition, true, "f");
|
190
192
|
if (!this.id) {
|
@@ -176,13 +176,15 @@ class ToolTipElement extends HTMLElement {
|
|
176
176
|
}
|
177
177
|
|
178
178
|
connectedCallback() {
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
179
|
+
if (!this.shadowRoot) {
|
180
|
+
const shadow = this.attachShadow({mode: 'open'})
|
181
|
+
shadow.innerHTML = `
|
182
|
+
<style>
|
183
|
+
${this.styles()}
|
184
|
+
</style>
|
185
|
+
<slot></slot>
|
186
|
+
`
|
187
|
+
}
|
186
188
|
this.hidden = true
|
187
189
|
this.#allowUpdatePosition = true
|
188
190
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: primer_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.73
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|