pint/github-css/fuwaa_fuwaa_ 🥞 comfy fuwaffle pancakes are being served here_files/topic-suggestions-3ededa85c6e4.js.download

3 lines
No EOL
12 KiB
Text

"use strict";(()=>{var z=Object.defineProperty;var s=(q,C)=>z(q,"name",{value:C,configurable:!0});(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([["topic-suggestions","node_modules_delegated-events_dist_index_js","vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-3bc7580","vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-3bc7581"],{65935:(q,C,k)=>{k.d(C,{AC:()=>S,rK:()=>u,uT:()=>d});function m(i,o){const h=i.createElement("template");return h.innerHTML=o,i.importNode(h.content,!0)}s(m,"parseHTML");function b(i){const o=new URLSearchParams,h=new FormData(i).entries();for(const[E,y]of[...h])o.append(E,y.toString());return o.toString()}s(b,"serialize");class L extends Error{constructor(o,h){super(o);this.response=h}}s(L,"ErrorWithResponse");function x(){let i,o;return[new Promise(function(E,y){i=E,o=y}),i,o]}s(x,"makeDeferred");let f;const j=[],l=[];function d(i){j.push(i)}s(d,"afterRemote");function u(i){l.push(i)}s(u,"beforeRemote");function S(i,o){f||(f=new Map,document.addEventListener("submit",P));const h=f.get(i)||[];f.set(i,[...h,o])}s(S,"remoteForm");function T(i,o){if(f){const h=f.get(i)||[];f.set(i,h.filter(E=>E!==o))}}s(T,"remoteUninstall");function R(i){const o=[];for(const h of f.keys())if(i.matches(h)){const E=f.get(h)||[];o.push(...E)}return o}s(R,"getMatches");function P(i){if(!(i.target instanceof HTMLFormElement)||i.defaultPrevented)return;const o=i.target,h=R(o);if(h.length===0)return;const E=U(o),[y,A,F]=x();i.preventDefault(),O(h,o,E,y).then(async H=>{if(H){for(const D of l)await D(o);W(E).then(A,F).catch(()=>{}).then(()=>{for(const D of j)D(o)})}else o.submit()},H=>{o.submit(),setTimeout(()=>{throw H})})}s(P,"handleSubmit");async function O(i,o,h,E){let y=!1;for(const A of i){const[F,H]=x(),D=s(()=>(y=!0,H(),E),"kick"),X={text:D,json:()=>(h.headers.set("Accept","application/json"),D()),html:()=>(h.headers.set("Accept","text/html"),D())};await Promise.race([F,A(o,X,h)])}return y}s(O,"processHandlers");function U(i){const o={method:i.method||"GET",url:i.action,headers:new Headers({"X-Requested-With":"XMLHttpRequest"}),body:null};if(o.method.toUpperCase()==="GET"){const h=b(i);h&&(o.url+=(~o.url.indexOf("?")?"&":"?")+h)}else o.body=new FormData(i);return o}s(U,"buildRequest");async function W(i){const o=await window.fetch(i.url,{method:i.method,body:i.body!==null?i.body:void 0,headers:i.headers,credentials:"same-origin"}),h={url:o.url,status:o.status,statusText:o.statusText,headers:o.headers,text:"",get json(){const y=this,A=JSON.parse(y.text);return delete y.json,y.json=A,y.json},get html(){const y=this;return delete y.html,y.html=m(document,y.text),y.html}},E=await o.text();if(h.text=E,o.ok)return h;throw new L("request failed",h)}s(W,"remoteSubmit")},59753:(q,C,k)=>{k.d(C,{f:()=>B,on:()=>X});function m(){if(!(this instanceof m))return new m;this.size=0,this.uid=0,this.selectors=[],this.selectorObjects={},this.indexes=Object.create(this.indexes),this.activeIndexes=[]}s(m,"SelectorSet");var b=window.document.documentElement,L=b.matches||b.webkitMatchesSelector||b.mozMatchesSelector||b.oMatchesSelector||b.msMatchesSelector;m.prototype.matchesSelector=function(e,t){return L.call(e,t)},m.prototype.querySelectorAll=function(e,t){return t.querySelectorAll(e)},m.prototype.indexes=[];var x=/^#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;m.prototype.indexes.push({name:"ID",selector:s(function(t){var n;if(n=t.match(x))return n[0].slice(1)},"matchIdSelector"),element:s(function(t){if(t.id)return[t.id]},"getElementId")});var f=/^\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;m.prototype.indexes.push({name:"CLASS",selector:s(function(t){var n;if(n=t.match(f))return n[0].slice(1)},"matchClassSelector"),element:s(function(t){var n=t.className;if(n){if(typeof n=="string")return n.split(/\s/);if(typeof n=="object"&&"baseVal"in n)return n.baseVal.split(/\s/)}},"getElementClassNames")});var j=/^((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;m.prototype.indexes.push({name:"TAG",selector:s(function(t){var n;if(n=t.match(j))return n[0].toUpperCase()},"matchTagSelector"),element:s(function(t){return[t.nodeName.toUpperCase()]},"getElementTagName")}),m.prototype.indexes.default={name:"UNIVERSAL",selector:function(){return!0},element:function(){return[!0]}};var l;typeof window.Map=="function"?l=window.Map:l=function(){function e(){this.map={}}return s(e,"Map"),e.prototype.get=function(t){return this.map[t+" "]},e.prototype.set=function(t,n){this.map[t+" "]=n},e}();var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;function u(e,t){e=e.slice(0).concat(e.default);var n=e.length,c,r,p,a,g=t,v,w,_=[];do if(d.exec(""),(p=d.exec(g))&&(g=p[3],p[2]||!g)){for(c=0;c<n;c++)if(w=e[c],v=w.selector(p[1])){for(r=_.length,a=!1;r--;)if(_[r].index===w&&_[r].key===v){a=!0;break}a||_.push({index:w,key:v});break}}while(p);return _}s(u,"parseSelectorIndexes");function S(e,t){var n,c,r;for(n=0,c=e.length;n<c;n++)if(r=e[n],t.isPrototypeOf(r))return r}s(S,"findByPrototype"),m.prototype.logDefaultIndexUsed=function(){},m.prototype.add=function(e,t){var n,c,r,p,a,g,v,w,_=this.activeIndexes,M=this.selectors,I=this.selectorObjects;if(typeof e=="string"){for(n={id:this.uid++,selector:e,data:t},I[n.id]=n,v=u(this.indexes,e),c=0;c<v.length;c++)w=v[c],p=w.key,r=w.index,a=S(_,r),a||(a=Object.create(r),a.map=new l,_.push(a)),r===this.indexes.default&&this.logDefaultIndexUsed(n),g=a.map.get(p),g||(g=[],a.map.set(p,g)),g.push(n);this.size++,M.push(e)}},m.prototype.remove=function(e,t){if(typeof e=="string"){var n,c,r,p,a,g,v,w,_=this.activeIndexes,M=this.selectors=[],I=this.selectorObjects,N={},$=arguments.length===1;for(n=u(this.indexes,e),r=0;r<n.length;r++)for(c=n[r],p=_.length;p--;)if(g=_[p],c.index.isPrototypeOf(g)){if(v=g.map.get(c.key),v)for(a=v.length;a--;)w=v[a],w.selector===e&&($||w.data===t)&&(v.splice(a,1),N[w.id]=!0);break}for(r in N)delete I[r],this.size--;for(r in I)M.push(I[r].selector)}};function T(e,t){return e.id-t.id}s(T,"sortById"),m.prototype.queryAll=function(e){if(!this.selectors.length)return[];var t={},n=[],c=this.querySelectorAll(this.selectors.join(", "),e),r,p,a,g,v,w,_,M;for(r=0,a=c.length;r<a;r++)for(v=c[r],w=this.matches(v),p=0,g=w.length;p<g;p++)M=w[p],t[M.id]?_=t[M.id]:(_={id:M.id,selector:M.selector,data:M.data,elements:[]},t[M.id]=_,n.push(_)),_.elements.push(v);return n.sort(T)},m.prototype.matches=function(e){if(!e)return[];var t,n,c,r,p,a,g,v,w,_,M,I=this.activeIndexes,N={},$=[];for(t=0,r=I.length;t<r;t++)if(g=I[t],v=g.element(e),v){for(n=0,p=v.length;n<p;n++)if(w=g.map.get(v[n]))for(c=0,a=w.length;c<a;c++)_=w[c],M=_.id,!N[M]&&this.matchesSelector(e,_.selector)&&(N[M]=!0,$.push(_))}return $.sort(T)};var R={},P={},O=new WeakMap,U=new WeakMap,W=new WeakMap,i=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function o(e,t,n){var c=e[t];return e[t]=function(){return n.apply(e,arguments),c.apply(e,arguments)},e}s(o,"before");function h(e,t,n){var c=[],r=t;do{if(r.nodeType!==1)break;var p=e.matches(r);if(p.length){var a={node:r,observers:p};n?c.unshift(a):c.push(a)}}while(r=r.parentElement);return c}s(h,"dist_matches");function E(){O.set(this,!0)}s(E,"trackPropagation");function y(){O.set(this,!0),U.set(this,!0)}s(y,"trackImmediate");function A(){return W.get(this)||null}s(A,"getCurrentTarget");function F(e,t){!i||Object.defineProperty(e,"currentTarget",{configurable:!0,enumerable:!0,get:t||i.get})}s(F,"defineCurrentTarget");function H(e){try{return e.eventPhase,!0}catch{return!1}}s(H,"canDispatch");function D(e){if(!!H(e)){var t=e.eventPhase===1?P:R,n=t[e.type];if(!!n){var c=h(n,e.target,e.eventPhase===1);if(!!c.length){o(e,"stopPropagation",E),o(e,"stopImmediatePropagation",y),F(e,A);for(var r=0,p=c.length;r<p&&!O.get(e);r++){var a=c[r];W.set(e,a.node);for(var g=0,v=a.observers.length;g<v&&!U.get(e);g++)a.observers[g].data.call(a.node,e)}W.delete(e),F(e)}}}}s(D,"dispatch");function X(e,t,n){var c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=!!c.capture,p=r?P:R,a=p[e];a||(a=new m,p[e]=a,document.addEventListener(e,D,r)),a.add(t,n)}s(X,"on");function K(e,t,n){var c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=!!c.capture,p=r?P:R,a=p[e];!a||(a.remove(t,n),!a.size&&(delete p[e],document.removeEventListener(e,D,r)))}s(K,"off");function B(e,t,n){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}))}s(B,"fire")},29719:(q,C,k)=>{k.d(C,{D:()=>x,a:()=>L});var m=k(17463),b=k(12981);async function L(f,j,l){const d=new Request(j,l);d.headers.append("X-Requested-With","XMLHttpRequest");const u=await self.fetch(d);if(u.status<200||u.status>=300)throw new Error(`HTTP ${u.status}${u.statusText||""}`);return(0,m.t)((0,m.P)(f),u),(0,b.r)(f,await u.text())}s(L,"fetchSafeDocumentFragment");function x(f,j,l=1e3){return s(async function d(u){const S=new Request(f,j);S.headers.append("X-Requested-With","XMLHttpRequest");const T=await self.fetch(S);if(T.status<200||T.status>=300)throw new Error(`HTTP ${T.status}${T.statusText||""}`);if(T.status===200)return T;if(T.status===202)return await new Promise(R=>setTimeout(R,u)),d(u*1.5);throw new Error(`Unexpected ${T.status} response status from poll endpoint`)},"poll")(l)}s(x,"fetchPoll")},17463:(q,C,k)=>{k.d(C,{P:()=>m,t:()=>L});function m(x){const f=[...x.querySelectorAll("meta[name=html-safe-nonce]")].map(j=>j.content);if(f.length<1)throw new Error("could not find html-safe-nonce on document");return f}s(m,"getDocumentHtmlSafeNonces");class b extends Error{constructor(f,j){super(`${f} for HTTP ${j.status}`);this.response=j}}s(b,"ResponseError");function L(x,f,j=!1){const l=f.headers.get("content-type")||"";if(!j&&!l.startsWith("text/html"))throw new b(`expected response with text/html, but was ${l}`,f);if(j&&!(l.startsWith("text/html")||l.startsWith("application/json")))throw new b(`expected response with text/html or application/json, but was ${l}`,f);const d=f.headers.get("x-html-safe");if(d){if(!x.includes(d))throw new b("response X-HTML-Safe nonce did not match",f)}else throw new b("missing X-HTML-Safe nonce",f)}s(L,"verifyResponseHtmlSafeNonce")},12981:(q,C,k)=>{k.d(C,{r:()=>m});function m(b,L){const x=b.createElement("template");return x.innerHTML=L,b.importNode(x.content,!0)}s(m,"parseHTML")},52514:(q,C,k)=>{var m=k(29719),b=k(59753),L=k(65935);(0,b.on)("click",".js-accept-topic-button",function(l){const d=l.currentTarget,u=d.closest(".js-topic-form-area"),S=d.closest(".js-topic-suggestion"),T=u.querySelector(".js-template"),R=u.querySelector(".js-tag-input-selected-tags"),P=T.cloneNode(!0),O=d.getAttribute("data-topic-name")||"";P.querySelector("input").value=O,P.querySelector(".js-placeholder-tag-name").replaceWith(O),P.classList.remove("d-none","js-template"),R.appendChild(P),S.remove(),x(u)}),(0,L.AC)(".js-accept-topic-form",async function(l,d){await d.html();const u=l.closest(".js-topic-form-area"),S=l.closest(".js-topic-suggestion"),T=u.querySelector(".js-template"),R=u.querySelector(".js-tag-input-selected-tags"),P=T.cloneNode(!0),O=S.querySelector('input[name="input[name]"]').value;P.querySelector("input").value=O,P.querySelector(".js-placeholder-tag-name").replaceWith(O),P.classList.remove("d-none","js-template"),R.appendChild(P),S.remove(),j(u),x(u),f(l)}),(0,b.on)("click",".js-decline-topic-button",function(l){const d=l.currentTarget,u=d.closest(".js-topic-form-area"),S=d.closest(".js-topic-suggestion");setTimeout(()=>{S.remove(),x(u)},0)}),(0,L.AC)(".js-decline-topic-form",async function(l,d){await d.html(),f(l);const u=l.closest(".js-topic-form-area");l.closest(".js-topic-suggestion").remove(),j(u),x(u)});function x(l){const d=l.querySelector(".js-topic-suggestions-box");d.querySelector(".js-topic-suggestion")||d.remove()}s(x,"removeEmptySuggestionList");function f(l){const u=l.closest(".js-topic-save-notice-container").querySelector(".js-repo-topics-save-notice");u.classList.remove("d-none"),u.classList.add("d-inline-block","anim-fade-in"),setTimeout(()=>{u.classList.remove("d-inline-block"),u.classList.add("d-none")},1900)}s(f,"flashNotice");async function j(l){const d=l.querySelector(".js-topic-suggestions-container");if(!d)return;const u=d.getAttribute("data-url");if(!u)throw new Error("could not get url");const S=await(0,m.a)(document,u);d.innerHTML="",d.appendChild(S)}s(j,"refreshSuggestions")}},q=>{var C=s(m=>q(q.s=m),"__webpack_exec__"),k=C(52514)}]);})();
//# sourceMappingURL=topic-suggestions-8c778cca7033.js.map