mirror of
https://github.com/dekuNukem/USB4VC.git
synced 2025-10-31 11:26:46 -07:00
3 lines
18 KiB
JavaScript
3 lines
18 KiB
JavaScript
"use strict";(()=>{var O=Object.defineProperty;var o=(v,y)=>O(v,"name",{value:y,configurable:!0});(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[6791],{52134:(v,y,l)=>{l.d(y,{H:()=>h,v:()=>c});var d=l(59753);function c(){const s=document.getElementById("ajax-error-message");s&&(s.hidden=!1)}o(c,"showGlobalError");function h(){const s=document.getElementById("ajax-error-message");s&&(s.hidden=!0)}o(h,"hideGlobalError"),(0,d.on)("deprecatedAjaxError","[data-remote]",function(s){const i=s.detail,{error:t,text:r}=i;s.currentTarget===s.target&&(t==="abort"||t==="canceled"||(/<html/.test(r)?(c(),s.stopImmediatePropagation()):setTimeout(function(){s.defaultPrevented||c()},0)))}),(0,d.on)("deprecatedAjaxSend","[data-remote]",function(){h()}),(0,d.on)("click",".js-ajax-error-dismiss",function(){h()})},52660:(v,y,l)=>{l.d(y,{D:()=>s,a:()=>h});var d=l(2699),c=l(10900);async function h(i,t,r){const f=new Request(t,r);f.headers.append("X-Requested-With","XMLHttpRequest");const u=await self.fetch(f);if(u.status<200||u.status>=300)throw new Error(`HTTP ${u.status}${u.statusText||""}`);return(0,d.t)((0,d.P)(i),u),(0,c.r)(i,await u.text())}o(h,"fetchSafeDocumentFragment");function s(i,t,r=1e3){return o(async function f(u){const m=new Request(i,t);m.headers.append("X-Requested-With","XMLHttpRequest");const p=await self.fetch(m);if(p.status<200||p.status>=300)throw new Error(`HTTP ${p.status}${p.statusText||""}`);if(p.status===200)return p;if(p.status===202)return await new Promise(_=>setTimeout(_,u)),f(u*1.5);throw new Error(`Unexpected ${p.status} response status from poll endpoint`)},"poll")(r)}o(s,"fetchPoll")},82036:(v,y,l)=>{l.d(y,{Bt:()=>i,DN:()=>f,KL:()=>p,Se:()=>r,qC:()=>_,sw:()=>u});var d=l(59753),c=l(90137),h=l(52134);(0,d.on)("click",".js-remote-submit-button",async function(a){const b=a.currentTarget.form;a.preventDefault();let e;try{e=await fetch(b.action,{method:b.method,body:new FormData(b),headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}catch{}e&&!e.ok&&(0,h.v)()});function s(a,w,b){return a.dispatchEvent(new CustomEvent(w,{bubbles:!0,cancelable:b}))}o(s,"fire");function i(a,w){w&&(t(a,w),(0,c.j)(w)),s(a,"submit",!0)&&a.submit()}o(i,"requestSubmit");function t(a,w){if(!(a instanceof HTMLFormElement))throw new TypeError("The specified element is not of type HTMLFormElement.");if(!(w instanceof HTMLElement))throw new TypeError("The specified element is not of type HTMLElement.");if(w.type!=="submit")throw new TypeError("The specified element is not a submit button.");if(!a||a!==w.form)throw new Error("The specified element is not owned by the form element.")}o(t,"checkButtonValidity");function r(a,w){if(typeof w=="boolean")if(a instanceof HTMLInputElement)a.checked=w;else throw new TypeError("only checkboxes can be set to boolean value");else{if(a.type==="checkbox")throw new TypeError("checkbox can't be set to string value");a.value=w}s(a,"change",!1)}o(r,"changeValue");function f(a,w){for(const b in w){const e=w[b],n=a.elements.namedItem(b);(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&(n.value=e)}}o(f,"fillFormValues");function u(a){if(!(a instanceof HTMLElement))return!1;const w=a.nodeName.toLowerCase(),b=(a.getAttribute("type")||"").toLowerCase();return w==="select"||w==="textarea"||w==="input"&&b!=="submit"&&b!=="reset"||a.isContentEditable}o(u,"isFormField");function m(a){return new URLSearchParams(a)}o(m,"searchParamsFromFormData");function p(a,w){const b=new URLSearchParams(a.search),e=m(w);for(const[n,E]of e)b.append(n,E);return b.toString()}o(p,"combineGetFormSearchParams");function _(a){return m(new FormData(a)).toString()}o(_,"serialize")},2699:(v,y,l)=>{l.d(y,{P:()=>d,t:()=>h});function d(s){const i=[...s.querySelectorAll("meta[name=html-safe-nonce]")].map(t=>t.content);if(i.length<1)throw new Error("could not find html-safe-nonce on document");return i}o(d,"getDocumentHtmlSafeNonces");class c extends Error{constructor(i,t){super(`${i} for HTTP ${t.status}`);this.response=t}}o(c,"ResponseError");function h(s,i,t=!1){const r=i.headers.get("content-type")||"";if(!t&&!r.startsWith("text/html"))throw new c(`expected response with text/html, but was ${r}`,i);if(t&&!(r.startsWith("text/html")||r.startsWith("application/json")))throw new c(`expected response with text/html or application/json, but was ${r}`,i);const f=i.headers.get("x-html-safe");if(f){if(!s.includes(f))throw new c("response X-HTML-Safe nonce did not match",i)}else throw new c("missing X-HTML-Safe nonce",i)}o(h,"verifyResponseHtmlSafeNonce")},9115:(v,y,l)=>{var d=l(90420),c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,s=o((t,r,f,u)=>{for(var m=u>1?void 0:u?h(r,f):r,p=t.length-1,_;p>=0;p--)(_=t[p])&&(m=(u?_(r,f,m):_(m))||m);return u&&m&&c(r,f,m),m},"__decorateClass");let i=o(class extends HTMLElement{connectedCallback(){this.control&&(this.storedInput=Array(this.control.children.length).fill("")),this.addEventListener("input",this.relayInput.bind(this)),this.addEventListener("keydown",this.relayKeydown.bind(this));const t=this.closest("details");t&&t.addEventListener("toggle",()=>{t.open&&this.source.focus()})}relayKeydown(t){if((this.isControlTab(t.target)||t.target===this.source)&&(t.key==="ArrowDown"||t.key==="Tab"))t.preventDefault(),t.stopPropagation(),this.routeCustomEvent(new CustomEvent("focus-list"));else if(t.key==="Escape"){const r=this.closest("details");r&&r.removeAttribute("open")}}isControlTab(t){return!t||!this.control?!1:Array.from(this.control.children).includes(t)}relayInput(t){if(!t.target)return;const f=t.target.value;this.routeCustomEvent(new CustomEvent("input-entered",{detail:f}))}routeCustomEvent(t){this.sinks[this.selectedIndex].dispatchEvent(t)}get selectedIndex(){if(!this.control)return 0;const t=this.control.querySelector('[aria-selected="true"]');return t?Array.from(this.control.children).indexOf(t):0}storeInput(){this.storedInput[this.selectedIndex]=this.source.value}updateInput(t){this.source.value=this.storedInput[this.selectedIndex];const r=t.detail.relatedTarget.getAttribute("data-filter-placeholder");this.source.placeholder=r,this.source.setAttribute("aria-label",r),this.notifySelected()}notifySelected(){const t=this.sinks[this.selectedIndex],r=new CustomEvent("tab-selected");t.dispatchEvent(r)}},"InputDemuxElement");s([d.fA],i.prototype,"source",2),s([d.GO],i.prototype,"sinks",2),s([d.fA],i.prototype,"control",2),i=s([d.Ih],i)},84570:(v,y,l)=>{l.d(y,{ZG:()=>i,q6:()=>r,w4:()=>t});var d=l(8439);let c=!1;const h=new d.Z;function s(f){const u=f.target;if(u instanceof HTMLElement&&u.nodeType!==Node.DOCUMENT_NODE)for(const m of h.matches(u))m.data.call(null,u)}o(s,"handleFocus");function i(f,u){c||(c=!0,document.addEventListener("focus",s,!0)),h.add(f,u),document.activeElement instanceof HTMLElement&&document.activeElement.matches(f)&&u(document.activeElement)}o(i,"onFocus");function t(f,u,m){function p(_){const a=_.currentTarget;!a||(a.removeEventListener(f,m),a.removeEventListener("blur",p))}o(p,"blurHandler"),i(u,function(_){_.addEventListener(f,m),_.addEventListener("blur",p)})}o(t,"onKey");function r(f,u){function m(p){const{currentTarget:_}=p;!_||(_.removeEventListener("input",u),_.removeEventListener("blur",m))}o(m,"blurHandler"),i(f,function(p){p.addEventListener("input",u),p.addEventListener("blur",m)})}o(r,"onInput")},68906:(v,y,l)=>{var d=l(60785),c=l(83476);const{getItem:h,setItem:s,removeItem:i}=(0,d.Z)("localStorage",{throwQuotaErrorsOnSet:!0});var t=(e=>(e.Branch="branch",e.Tag="tag",e))(t||{});const r=o(class{constructor(e,n,E,L,g){this.knownItems=[],this.currentSearchResult=[],this.exactMatchFound=!1,this.isLoading=!0,this.fetchInProgress=!1,this.fetchFailed=!1,this.refType=e,this.selector=n,this.refEndpoint=E,this.cacheKey=L,this.nameWithOwner=g}render(){this.selector.render()}async fetchData(){try{if(!this.isLoading||this.fetchInProgress)return;if(!this.bootstrapFromLocalStorage()){this.fetchInProgress=!0,this.fetchFailed=!1;const e=await fetch(`${this.refEndpoint}?type=${this.refType}`,{headers:{Accept:"application/json"}});await this.processResponse(e)}this.isLoading=!1,this.fetchInProgress=!1,this.render()}catch{this.fetchInProgress=!1,this.fetchFailed=!0}}async processResponse(e){if(this.emitStats(e),!e.ok){this.fetchFailed=!0;return}const n=e.clone(),E=await e.json();this.knownItems=E.refs,this.cacheKey=E.cacheKey,this.flushToLocalStorage(await n.text())}emitStats(e){if(!e.ok){(0,c.b)({incrementKey:"REF_SELECTOR_BOOT_FAILED"},!0);return}switch(e.status){case 200:{(0,c.b)({incrementKey:"REF_SELECTOR_BOOTED_FROM_UNCACHED_HTTP"});break}case 304:{(0,c.b)({incrementKey:"REF_SELECTOR_BOOTED_FROM_HTTP_CACHE"});break}default:(0,c.b)({incrementKey:"REF_SELECTOR_UNEXPECTED_RESPONSE"})}}search(e){if(e===""){this.currentSearchResult=this.knownItems;return}const n=[],E=[];this.exactMatchFound=!1;let L;for(const g of this.knownItems)if(L=g.indexOf(e),!(L<0)){if(L===0){e===g?(E.unshift(g),this.exactMatchFound=!0):E.push(g);continue}n.push(g)}this.currentSearchResult=[...E,...n]}bootstrapFromLocalStorage(){const e=h(this.localStorageKey);if(!e)return!1;const n=JSON.parse(e);return n.cacheKey!==this.cacheKey||!("refs"in n)?(i(this.localStorageKey),!1):(this.knownItems=n.refs,this.isLoading=!1,(0,c.b)({incrementKey:"REF_SELECTOR_BOOTED_FROM_LOCALSTORAGE"}),!0)}async flushToLocalStorage(e){try{s(this.localStorageKey,e)}catch(n){if(n.message.toLowerCase().includes("quota")){this.clearSiblingLocalStorage(),(0,c.b)({incrementKey:"REF_SELECTOR_LOCALSTORAGE_OVERFLOWED"});try{s(this.localStorageKey,e)}catch(E){E.message.toLowerCase().includes("quota")&&(0,c.b)({incrementKey:"REF_SELECTOR_LOCALSTORAGE_GAVE_UP"})}}else throw n}}clearSiblingLocalStorage(){for(const e of Object.keys(localStorage))e.startsWith(r.LocalStoragePrefix)&&i(e)}get localStorageKey(){return`${r.LocalStoragePrefix}:${this.nameWithOwner}:${this.refType}`}},"_SearchIndex");let f=r;f.LocalStoragePrefix="ref-selector";var u=l(69567),m=l(90420),p=l(17945),_=Object.defineProperty,a=Object.getOwnPropertyDescriptor,w=o((e,n,E,L)=>{for(var g=L>1?void 0:L?a(n,E):n,C=e.length-1,T;C>=0;C--)(T=e[C])&&(g=(L?T(n,E,g):T(g))||g);return L&&g&&_(n,E,g),g},"__decorateClass");let b=o(class extends HTMLElement{constructor(){super(...arguments);this.isCurrentVisible=!1,this.currentSelectionIndex=null,this.handleWindowResize=()=>{if(!this.virtualizedList)return;const e=this.isMobileViewport,n=this.windowHeight;this.updateViewportSize();const E=e!==this.isMobileViewport,L=n!==this.windowHeight;if(E){this.virtualizedList.destroy(),this.setupVirtualizedList();return}!this.isMobileViewport||!L||(this.listContainer.style.maxHeight=`${this.listHeight}px`,this.virtualizedList.resize(this.listHeight))},this.windowResized=()=>{this.resizeAnimationRequest&&cancelAnimationFrame(this.resizeAnimationRequest),this.resizeAnimationRequest=requestAnimationFrame(this.handleWindowResize)}}connectedCallback(){window.addEventListener("resize",this.windowResized),this.refType=this.getRequiredAttr("type")==="branch"?t.Branch:t.Tag;const e=this.getAttribute("current-committish");this.currentCommittish=e?atob(e):null,this.input=this.hasAttribute("initial-filter")&&this.currentCommittish||"",this.defaultBranch=atob(this.getRequiredAttr("default-branch")),this.nameWithOwner=atob(this.getRequiredAttr("name-with-owner")),this.canCreate=this.hasAttribute("can-create"),this.prefetchOnMouseover=this.hasAttribute("prefetch-on-mouseover");const n=this.getRequiredAttr("query-endpoint"),E=this.getRequiredAttr("cache-key");this.index=new f(this.refType,this,n,E,this.nameWithOwner),this.updateViewportSize(),this.setupFetchListeners()}disconnectedCallback(){this.resizeAnimationRequest&&cancelAnimationFrame(this.resizeAnimationRequest),window.removeEventListener("resize",this.windowResized)}updateViewportSize(){this.isMobileViewport=window.innerWidth<544,this.windowHeight=window.innerHeight}inputEntered(e){this.input=e.detail,this.render()}tabSelected(){this.index.fetchData()}renderTemplate(e,n){return new u.R(e,n,u.XK)}renderRow(e){const n=this.index.currentSearchResult[e];if(!n&&e>=this.listLength)return document.createElement("span");if(this.index.fetchFailed)return this.renderTemplate(this.fetchFailedTemplate,{index:e,refName:this.input});if(!n){const T=this.input===this.currentCommittish;return this.isCurrentVisible||(this.isCurrentVisible=T),this.renderTemplate(this.noMatchTemplate,{index:e,isCurrent:T,refName:this.input})}const E=this.input.length>0,L=E?"is-filtering":"",g=n===this.currentCommittish;this.isCurrentVisible||(this.isCurrentVisible=g);const C=this.renderTemplate(this.itemTemplate,{refName:n,index:e,isFilteringClass:L,urlEncodedRefName:this.urlEncodeRef(n),isCurrent:g,isNotDefault:n!==this.defaultBranch});if(E){const T=C.querySelector("span");T.textContent="";const S=n.split(this.input),R=S.length-1;for(let I=0;I<S.length;I++){const A=S[I];if(T.appendChild(document.createTextNode(A)),I<R){const x=document.createElement("b");x.textContent=this.input,T.appendChild(x)}}}return C}urlEncodeRef(e){return encodeURIComponent(e).replaceAll("%2F","/").replaceAll("%3A",":").replaceAll("%2B","+")}render(){if(this.currentSelectionIndex=null,!this.index.isLoading){if(!this.virtualizedList){this.index.search(this.input),this.setupVirtualizedList();return}this.listContainer.scrollTop=0,this.index.search(this.input),this.virtualizedList.setRowCount(this.listLength)}}get listHeight(){return this.isMobileViewport?this.windowHeight*.3:330}get listLength(){const e=this.index.currentSearchResult.length;return this.showCreateRow?e+1:e||1}get showCreateRow(){return!this.index.fetchFailed&&!this.index.exactMatchFound&&this.input!==""&&this.canCreate}getRequiredAttr(e,n=this){const E=n.getAttribute(e);if(!E)throw new Error(`Missing attribute for ${n}: ${e}`);return E}setupFetchListeners(){const e=this.closest("details");let n=!1;const E=o(()=>{n||(this.index.fetchData(),n=!0)},"fetch");if(!e||e.open){E();return}this.prefetchOnMouseover&&e.addEventListener("mouseover",E,{once:!0}),this.addEventListener("keydown",this.keydown),this.addEventListener("change",this.updateCurrent);const L=e.querySelector("input[data-ref-filter]");L&&(L.addEventListener("input",()=>{this.input=L.value,this.render()}),L.addEventListener("keydown",g=>{if(g.key==="ArrowDown"||g.key==="Tab")g.preventDefault(),g.stopPropagation(),this.focusFirstListMember();else if(g.key==="Enter"){let C=this.index.currentSearchResult.indexOf(this.input);if(C===-1)if(this.showCreateRow)C=this.listLength-1;else return;e.querySelector(`[data-index="${C}"]`).click(),g.preventDefault()}}))}focusFirstListMember(){!this.virtualizedList||(this.currentSelectionIndex=0,this.focusItemAtIndex(this.currentSelectionIndex))}updateCurrent(e){e.target instanceof HTMLInputElement&&e.target.checked&&e.target.value&&(this.currentCommittish=e.target.value)}keydown(e){if(this.currentSelectionIndex!==null){if(e.key==="Enter"){const n=document.activeElement;if(!n)return;n.click(),e.preventDefault();return}if(!(e.key==="Tab"&&e.shiftKey)&&e.key!=="Escape")switch(e.preventDefault(),e.stopPropagation(),e.key){case"ArrowUp":{this.currentSelectionIndex--,this.currentSelectionIndex<0&&(this.currentSelectionIndex=this.listLength-1),this.focusItemAtIndex(this.currentSelectionIndex);break}case"Home":{this.currentSelectionIndex=0,this.focusItemAtIndex(this.currentSelectionIndex);break}case"End":{this.currentSelectionIndex=this.listLength-1,this.focusItemAtIndex(this.currentSelectionIndex);break}case"Tab":case"ArrowDown":{this.currentSelectionIndex++,this.currentSelectionIndex>this.listLength-1&&(this.currentSelectionIndex=0),this.focusItemAtIndex(this.currentSelectionIndex);break}}}}focusItemAtIndex(e){this.virtualizedList.scrollToIndex(e,"center"),setTimeout(()=>{const n=this.listContainer.querySelector(`[data-index="${e}"]`);n&&n.focus()},20)}setupVirtualizedList(){this.listContainer.innerHTML="",this.listContainer.style.maxHeight=`${this.listHeight}px`,this.virtualizedList=new p.Z(this.listContainer,{height:this.listHeight,rowCount:this.listLength,renderRow:this.renderRow.bind(this),rowHeight:e=>{const n=this.isMobileViewport?54:33;return this.showCreateRow&&e===this.listLength-1?51:n},onRowsRendered:()=>{var e;this.hiddenCurrentElement&&(this.listContainer.removeChild(this.hiddenCurrentElement),delete this.hiddenCurrentElement),this.isCurrentVisible?this.isCurrentVisible=!1:this.hiddenCurrentItemTemplate&&(this.hiddenCurrentElement=document.createElement("div"),(e=this.hiddenCurrentElement)==null||e.appendChild(this.renderTemplate(this.hiddenCurrentItemTemplate,{refName:this.currentCommittish})),this.listContainer.appendChild(this.hiddenCurrentElement))},initialIndex:0,overscanCount:6}),this.virtualizedList.resize.bind(this.virtualizedList)}},"RefSelectorElement");w([m.fA],b.prototype,"listContainer",2),w([m.fA],b.prototype,"itemTemplate",2),w([m.fA],b.prototype,"noMatchTemplate",2),w([m.fA],b.prototype,"fetchFailedTemplate",2),w([m.fA],b.prototype,"hiddenCurrentItemTemplate",2),b=w([m.Ih],b)},90137:(v,y,l)=>{l.d(y,{j:()=>d,u:()=>c});function d(h){const s=h.closest("form");if(!(s instanceof HTMLFormElement))return;let i=c(s);if(h.name){const t=h.matches("input[type=submit]")?"Submit":"",r=h.value||t;i||(i=document.createElement("input"),i.type="hidden",i.classList.add("is-submit-button-value"),s.prepend(i)),i.name=h.name,i.value=r}else i&&i.remove()}o(d,"persistSubmitButtonValue");function c(h){const s=h.querySelector("input.is-submit-button-value");return s instanceof HTMLInputElement?s:null}o(c,"findPersistedSubmitButtonValue")},60785:(v,y,l)=>{l.d(y,{Z:()=>c});class d{getItem(){return null}setItem(){}removeItem(){}clear(){}key(){return null}get length(){return 0}}o(d,"NoOpStorage");function c(h,s={throwQuotaErrorsOnSet:!1},i=window){let t;try{t=i[h]}catch{t=new d}const{throwQuotaErrorsOnSet:r}=s;function f(p){try{return t.getItem(p)}catch{return null}}o(f,"getItem");function u(p,_){try{t.setItem(p,_)}catch(a){if(r&&a.message.toLowerCase().includes("quota"))throw a}}o(u,"setItem");function m(p){try{t.removeItem(p)}catch{}}return o(m,"removeItem"),{getItem:f,setItem:u,removeItem:m}}o(c,"safeStorage")},63355:(v,y,l)=>{var d=l(64463);const c=o(()=>{const h=document.getElementById("spoof-warning");if(!h)return;const s=document.querySelector(".commit-title");s&&s.classList.add("pb-1"),h.hidden=!1,h.removeAttribute("aria-hidden")},"showSpoofCommitBanner");(0,d.N7)("#js-spoofed-commit-warning-trigger",{add:c})},86404:(v,y,l)=>{l.d(y,{RB:()=>c,qC:()=>h,w0:()=>d});class d{constructor(i){this.closed=!1,this.unsubscribe=()=>{i(),this.closed=!0}}}o(d,"Subscription");function c(s,i,t,r={capture:!1}){return s.addEventListener(i,t,r),new d(()=>{s.removeEventListener(i,t,r)})}o(c,"fromEvent");function h(...s){return new d(()=>{for(const i of s)i.unsubscribe()})}o(h,"compose")}}]);})();
|
|
|
|
//# sourceMappingURL=6791-40da105ae8ef.js.map
|