aboutsummaryrefslogtreecommitdiff
path: root/archive/Problem 6 Find the Prime · Discussion #7 · Ta180m_Idiot-Code-Golf_files/app_assets_modules_github_behaviors_keyboard-shortcuts-helper.js
diff options
context:
space:
mode:
authorAnthony Wang2022-06-22 12:21:25 -0500
committerAnthony Wang2022-06-22 12:21:25 -0500
commitfc2626585a6d30e58220783bcca73d2a724e12c9 (patch)
tree48afe4df2e80f8587cfd98ea7e93250c4004da6f /archive/Problem 6 Find the Prime · Discussion #7 · Ta180m_Idiot-Code-Golf_files/app_assets_modules_github_behaviors_keyboard-shortcuts-helper.js
parented81135660700743dc43cc8c649f368639eb41ef (diff)
Add archives of chatroom and discussionsHEADmaster
Diffstat (limited to 'archive/Problem 6 Find the Prime · Discussion #7 · Ta180m_Idiot-Code-Golf_files/app_assets_modules_github_behaviors_keyboard-shortcuts-helper.js')
-rw-r--r--archive/Problem 6 Find the Prime · Discussion #7 · Ta180m_Idiot-Code-Golf_files/app_assets_modules_github_behaviors_keyboard-shortcuts-helper.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/archive/Problem 6 Find the Prime · Discussion #7 · Ta180m_Idiot-Code-Golf_files/app_assets_modules_github_behaviors_keyboard-shortcuts-helper.js b/archive/Problem 6 Find the Prime · Discussion #7 · Ta180m_Idiot-Code-Golf_files/app_assets_modules_github_behaviors_keyboard-shortcuts-helper.js
new file mode 100644
index 0000000..005869f
--- /dev/null
+++ b/archive/Problem 6 Find the Prime · Discussion #7 · Ta180m_Idiot-Code-Golf_files/app_assets_modules_github_behaviors_keyboard-shortcuts-helper.js
@@ -0,0 +1,14 @@
+"use strict";(()=>{var ne=Object.defineProperty;var s=(M,w)=>ne(M,"name",{value:w,configurable:!0});(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([["app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-af52ef"],{7679:(M,w,c)=>{c.d(w,{H:()=>f,v:()=>p});var h=c(59753);function p(){const l=document.getElementById("ajax-error-message");l&&(l.hidden=!1)}s(p,"showGlobalError");function f(){const l=document.getElementById("ajax-error-message");l&&(l.hidden=!0)}s(f,"hideGlobalError"),(0,h.on)("deprecatedAjaxError","[data-remote]",function(l){const r=l.detail,{error:d,text:E}=r;l.currentTarget===l.target&&(d==="abort"||d==="canceled"||(/<html/.test(E)?(p(),l.stopImmediatePropagation()):setTimeout(function(){l.defaultPrevented||p()},0)))}),(0,h.on)("deprecatedAjaxSend","[data-remote]",function(){f()}),(0,h.on)("click",".js-ajax-error-dismiss",function(){f()})},5287:(M,w,c)=>{c.d(w,{Ty:()=>p,YE:()=>f,Zf:()=>l});var h=c(11793);const p=s(()=>{const r=document.querySelector("meta[name=keyboard-shortcuts-preference]");return r?r.content==="all":!0},"areCharacterKeyShortcutsEnabled"),f=s(r=>/Enter|Arrow|Escape|Meta|Control|Esc/.test(r)||r.includes("Alt")&&r.includes("Shift"),"isNonCharacterKeyShortcut"),l=s(r=>{const d=(0,h.EL)(r);return p()?!0:f(d)},"isShortcutAllowed")},72669:(M,w,c)=>{c.d(w,{L$:()=>E,nj:()=>g});var h=c(6741),p=c(59753),f=c(40987),l=c(64463),r=c(65935),d=c(56238);(0,l.N7)(".js-task-list-container .js-task-list-field",function(e){const o=e.closest(".js-task-list-container");E(o),q(o)}),(0,p.on)("task-lists-move","task-lists",function(e){const{src:o,dst:t}=e.detail,u=e.currentTarget.closest(".js-task-list-container");m(u,"reordered",{operation:"move",src:o,dst:t})}),(0,p.on)("task-lists-check","task-lists",function(e){const{position:o,checked:t}=e.detail,u=e.currentTarget.closest(".js-task-list-container");m(u,`checked:${t?1:0}`,{operation:"check",position:o,checked:t})});function E(e){if(e.querySelector(".js-task-list-field")){const o=e.querySelectorAll("task-lists");for(const t of o)if(t instanceof f.Z){t.disabled=!1;const u=t.querySelectorAll("button");for(const T of u)T.disabled=!1}}}s(E,"enableTaskList");function g(e){for(const o of e.querySelectorAll("task-lists"))if(o instanceof f.Z){o.disabled=!0;const t=o.querySelectorAll("button");for(const u of t)u.disabled=!0}}s(g,"disableTaskList");function m(e,o,t){const u=e.querySelector(".js-comment-update");g(e),q(e);const T=u.elements.namedItem("task_list_track");T instanceof Element&&T.remove();const y=u.elements.namedItem("task_list_operation");y instanceof Element&&y.remove();const A=document.createElement("input");A.setAttribute("type","hidden"),A.setAttribute("name","task_list_track"),A.setAttribute("value",o),u.appendChild(A);const k=document.createElement("input");if(k.setAttribute("type","hidden"),k.setAttribute("name","task_list_operation"),k.setAttribute("value",JSON.stringify(t)),u.appendChild(k),!u.elements.namedItem("task_list_key")){const O=u.querySelector(".js-task-list-field").getAttribute("name").split("[")[0],I=document.createElement("input");I.setAttribute("type","hidden"),I.setAttribute("name","task_list_key"),I.setAttribute("value",O),u.appendChild(I)}e.classList.remove("is-comment-stale"),(0,d.Bt)(u)}s(m,"saveTaskList"),(0,r.AC)(".js-task-list-container .js-comment-update",async function(e,o){const t=e.closest(".js-task-list-container"),u=e.elements.namedItem("task_list_track");u instanceof Element&&u.remove();const T=e.elements.namedItem("task_list_operation");T instanceof Element&&T.remove();let y;try{y=await o.json()}catch(A){let k;try{k=JSON.parse(A.response.text)}catch{}if(k&&k.stale){const C=t.querySelector(".js-task-list-field");C.classList.add("session-resumable-canceled"),C.classList.remove("js-session-resumable")}else A.response.status===422||window.location.reload()}y&&(T&&y.json.source&&(t.querySelector(".js-task-list-field").value=y.json.source),E(t),requestAnimationFrame(()=>q(t)))});let v=!1,_=!1,L=null;function i(e){e.inputType==="insertLineBreak"?v=!0:v=!1}s(i,"tryAutoCompleteOnBeforeInput");function a(e){const o=e;if(!v&&!(o.inputType==="insertLineBreak"))return;const t=o.target;n(t),v=!1}s(a,"autoCompleteOnInput");function n(e){const o=Y(e.value,[e.selectionStart,e.selectionEnd]);o!==void 0&&b(e,o)}s(n,"listAutocomplete");function b(e,o){if(L===null||L===!0){e.contentEditable="true";try{v=!1;let t;o.commandId===X.insertText?(t=o.autocompletePrefix,o.writeSelection[0]!==null&&o.writeSelection[1]!==null&&(e.selectionStart=o.writeSelection[0],e.selectionEnd=o.writeSelection[1])):e.selectionStart=o.selection[0],L=document.execCommand(o.commandId,!1,t)}catch{L=!1}e.contentEditable="false"}if(!L){try{document.execCommand("ms-beginUndoUnit")}catch{}e.value=o.text;try{document.execCommand("ms-endUndoUnit")}catch{}e.dispatchEvent(new CustomEvent("input",{bubbles:!0,cancelable:!0}))}o.selection[0]!=null&&o.selection[1]!=null&&(e.selectionStart=o.selection[0],e.selectionEnd=o.selection[1])}s(b,"updateElementText");function S(e){if(_)return;const o=e;if(o.key==="Enter"&&o.shiftKey&&!o.metaKey){const t=o.target,u=G(t.value,[t.selectionStart,t.selectionEnd]);if(u===void 0)return;b(t,u),o.preventDefault(),(0,p.f)(t,"change")}}s(S,"handleShiftEnter");function R(){_=!0}s(R,"onCompositionStart");function j(){_=!1}s(j,"onCompositionEnd");function H(e){if(_)return;const o=e;if(o.key==="Escape"){ee(e);return}if(o.key!=="Tab")return;const t=o.target,u=Q(t.value,[t.selectionStart,t.selectionEnd],o.shiftKey);u!==void 0&&(o.preventDefault(),b(t,u))}s(H,"updateIndentation"),(0,l.N7)(".js-task-list-field",{subscribe:e=>(0,h.qC)((0,h.RB)(e,"keydown",H),(0,h.RB)(e,"keydown",S),(0,h.RB)(e,"beforeinput",i),(0,h.RB)(e,"input",a),(0,h.RB)(e,"compositionstart",R),(0,h.RB)(e,"compositionend",j))});var X=(e=>(e.insertText="insertText",e.delete="delete",e))(X||{});const Z=/^(\s*)?/;function G(e,o){const t=o[0];if(!t||!e)return;const u=e.substring(0,t).split(`
+`),T=u[u.length-1],y=T==null?void 0:T.match(Z);if(!y)return;const k=`
+${y[1]||""}`;return{text:e.substring(0,t)+k+e.substring(t),autocompletePrefix:k,selection:[t+k.length,t+k.length],commandId:"insertText",writeSelection:[null,null]}}s(G,"addSoftNewline");const z=/^(\s*)([*-]|(\d+)\.)\s(\[[\sx]\]\s)?/;function J(e,o){let t=e.split(`
+`);return t=t.map(u=>{if(u.replace(/^\s+/,"").startsWith(`${o}.`)){const T=u.replace(`${o}`,`${o+1}`);return o+=1,T}return u}),t.join(`
+`)}s(J,"updateRemainingNumberBullets");function Y(e,o){const t=o[0];if(!t||!e)return;const u=e.substring(0,t).split(`
+`),T=u[u.length-2],y=T==null?void 0:T.match(z);if(!y)return;const A=y[0],k=y[1],C=y[2],x=parseInt(y[3],10),O=Boolean(y[4]),I=!isNaN(x);let B=`${I?`${x+1}.`:C} ${O?"[ ] ":""}`,W=e.indexOf(`
+`,t);W<0&&(W=e.length);const K=e.substring(t,W);if(K.startsWith(B)&&(B=""),T.replace(A,"").trim().length>0||K.trim().length>0){let P=`${k}${B}`,D=e.substring(t);const F=P.length;let U=[null,null];const te=/^\s*$/g;let V=e.substring(0,t)+P+D;return I&&!e.substring(t).match(te)&&(D=J(e.substring(t),x+1),P+=D,U=[t,t+P.length],V=e.substring(0,t)+P),{text:V,autocompletePrefix:P,selection:[t+F,t+F],commandId:"insertText",writeSelection:U}}else{const P=t-`
+${A}`.length;return{autocompletePrefix:"",text:e.substring(0,P)+e.substring(t),selection:[P,P],commandId:"delete",writeSelection:[null,null]}}}s(Y,"autocompletedList");function Q(e,o,t){const u=o[0]||0,T=o[1]||u;if(o[0]===null||u===T)return;const y=e.substring(0,u).lastIndexOf(`
+`)+1,A=e.indexOf(`
+`,T-1),k=A>0?A:e.length-1,C=e.substring(y,k).split(`
+`);let x=!1,O=0,I=0;const N=[];for(const $ of C){const P=$.match(/^\s*/);if(P){let D=P[0];const F=$.substring(D.length);if(t){const U=D.length;D=D.slice(0,-2),O=x?O:D.length-U,x=!0,I+=D.length-U}else D+=" ",O=2,I+=2;N.push(D+F)}}const B=N.join(`
+`),W=e.substring(0,y)+B+e.substring(k),K=[Math.max(y,u+O),T+I];return{text:W,selection:K,autocompletePrefix:B,commandId:"insertText",writeSelection:[y,k]}}s(Q,"indent");function ee(e){const t=e.target;t.selectionDirection==="backward"?t.selectionEnd=t.selectionStart:t.selectionStart=t.selectionEnd}s(ee,"deselectText");function q(e){if(document.querySelectorAll("tracked-issues-progress").length===0||e.closest(".js-timeline-item"))return;const t=e.querySelectorAll(".js-comment-body [type=checkbox]"),u=t.length,T=Array.from(t).filter(A=>A.checked).length,y=document.querySelectorAll("tracked-issues-progress[data-type=checklist]");for(const A of y)A.setAttribute("data-completed",String(T)),A.setAttribute("data-total",String(u))}s(q,"updateProgress")},12737:(M,w,c)=>{c.d(w,{W:()=>p});var h=c(59753);async function p(f){const r=document.querySelector("#site-details-dialog").content.cloneNode(!0),d=r.querySelector("details"),E=d.querySelector("details-dialog"),g=d.querySelector(".js-details-dialog-spinner");f.detailsClass&&d.classList.add(...f.detailsClass.split(" ")),f.dialogClass&&E.classList.add(...f.dialogClass.split(" ")),f.label?E.setAttribute("aria-label",f.label):f.labelledBy&&E.setAttribute("aria-labelledby",f.labelledBy),document.body.append(r);const m=await f.content;return g.remove(),E.prepend(m),d.addEventListener("toggle",()=>{d.hasAttribute("open")||((0,h.f)(E,"dialog:remove"),d.remove())}),E}s(p,"dialog")},29719:(M,w,c)=>{c.d(w,{D:()=>l,a:()=>f});var h=c(17463),p=c(12981);async function f(r,d,E){const g=new Request(d,E);g.headers.append("X-Requested-With","XMLHttpRequest");const m=await self.fetch(g);if(m.status<200||m.status>=300)throw new Error(`HTTP ${m.status}${m.statusText||""}`);return(0,h.t)((0,h.P)(r),m),(0,p.r)(r,await m.text())}s(f,"fetchSafeDocumentFragment");function l(r,d,E=1e3){return s(async function g(m){const v=new Request(r,d);v.headers.append("X-Requested-With","XMLHttpRequest");const _=await self.fetch(v);if(_.status<200||_.status>=300)throw new Error(`HTTP ${_.status}${_.statusText||""}`);if(_.status===200)return _;if(_.status===202)return await new Promise(L=>setTimeout(L,m)),g(m*1.5);throw new Error(`Unexpected ${_.status} response status from poll endpoint`)},"poll")(E)}s(l,"fetchPoll")},56238:(M,w,c)=>{c.d(w,{Bt:()=>r,DN:()=>g,KL:()=>_,Se:()=>E,qC:()=>L,sw:()=>m});var h=c(59753),p=c(2061),f=c(7679);(0,h.on)("click",".js-remote-submit-button",async function(i){const n=i.currentTarget.form;i.preventDefault();let b;try{b=await fetch(n.action,{method:n.method,body:new FormData(n),headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}catch{}b&&!b.ok&&(0,f.v)()});function l(i,a,n){return i.dispatchEvent(new CustomEvent(a,{bubbles:!0,cancelable:n}))}s(l,"fire");function r(i,a){a&&(d(i,a),(0,p.j)(a)),l(i,"submit",!0)&&i.submit()}s(r,"requestSubmit");function d(i,a){if(!(i instanceof HTMLFormElement))throw new TypeError("The specified element is not of type HTMLFormElement.");if(!(a instanceof HTMLElement))throw new TypeError("The specified element is not of type HTMLElement.");if(a.type!=="submit")throw new TypeError("The specified element is not a submit button.");if(!i||i!==a.form)throw new Error("The specified element is not owned by the form element.")}s(d,"checkButtonValidity");function E(i,a){if(typeof a=="boolean")if(i instanceof HTMLInputElement)i.checked=a;else throw new TypeError("only checkboxes can be set to boolean value");else{if(i.type==="checkbox")throw new TypeError("checkbox can't be set to string value");i.value=a}l(i,"change",!1)}s(E,"changeValue");function g(i,a){for(const n in a){const b=a[n],S=i.elements.namedItem(n);(S instanceof HTMLInputElement||S instanceof HTMLTextAreaElement)&&(S.value=b)}}s(g,"fillFormValues");function m(i){if(!(i instanceof HTMLElement))return!1;const a=i.nodeName.toLowerCase(),n=(i.getAttribute("type")||"").toLowerCase();return a==="select"||a==="textarea"||a==="input"&&n!=="submit"&&n!=="reset"||i.isContentEditable}s(m,"isFormField");function v(i){return new URLSearchParams(i)}s(v,"searchParamsFromFormData");function _(i,a){const n=new URLSearchParams(i.search),b=v(a);for(const[S,R]of b)n.append(S,R);return n.toString()}s(_,"combineGetFormSearchParams");function L(i){return v(new FormData(i)).toString()}s(L,"serialize")},55741:(M,w,c)=>{c.d(w,{M:()=>f,T:()=>l});var h=c(14840),p=c(56238);function f(n,b=!1){return l(n)||v(n,b)||i(n)||a(n)}s(f,"hasInteractions");function l(n){for(const b of n.querySelectorAll("input, textarea"))if((b instanceof HTMLInputElement||b instanceof HTMLTextAreaElement)&&r(b))return!0;return!1}s(l,"hasDirtyFields");function r(n){if(n instanceof HTMLInputElement&&(n.type==="checkbox"||n.type==="radio")){if(n.checked!==n.defaultChecked)return!0}else if(n.value!==n.defaultValue)return!0;return!1}s(r,"formFieldValueChanged");let d;async function E(n,b){d=n;try{await b()}finally{d=null}}s(E,"withActiveElement");function g(n){return d instanceof Element?d:n&&n.ownerDocument&&n.ownerDocument.activeElement?n.ownerDocument.activeElement:null}s(g,"getActiveElement");let m;document.addEventListener("mouseup",function(n){m=n.target});function v(n,b){const S=g(n);return S===null||b&&S===n?!1:S===n&&(0,p.sw)(S)||n.contains(S)&&!L(S)?!0:m instanceof Element&&n.contains(m)&&!!m.closest("details[open] > summary")}s(v,"hasFocus");const _="a[href], button";function L(n){var b;if(n instanceof h.Z)return!0;const S=n instanceof HTMLAnchorElement||n instanceof HTMLButtonElement,R=(b=n.parentElement)==null?void 0:b.classList.contains("task-list-item");if(S&&R)return!0;if(!(m instanceof Element))return!1;const j=n.closest(_);if(!j)return!1;const H=m.closest(_);return j===H}s(L,"activeElementIsSafe");function i(n){return n.matches(":active:enabled")}s(i,"hasMousedown");function a(n){return!!(n.closest(".is-dirty")||n.querySelector(".is-dirty"))}s(a,"markedAsDirty")},17463:(M,w,c)=>{c.d(w,{P:()=>h,t:()=>f});function h(l){const r=[...l.querySelectorAll("meta[name=html-safe-nonce]")].map(d=>d.content);if(r.length<1)throw new Error("could not find html-safe-nonce on document");return r}s(h,"getDocumentHtmlSafeNonces");class p extends Error{constructor(r,d){super(`${r} for HTTP ${d.status}`);this.response=d}}s(p,"ResponseError");function f(l,r,d=!1){const E=r.headers.get("content-type")||"";if(!d&&!E.startsWith("text/html"))throw new p(`expected response with text/html, but was ${E}`,r);if(d&&!(E.startsWith("text/html")||E.startsWith("application/json")))throw new p(`expected response with text/html or application/json, but was ${E}`,r);const g=r.headers.get("x-html-safe");if(g){if(!l.includes(g))throw new p("response X-HTML-Safe nonce did not match",r)}else throw new p("missing X-HTML-Safe nonce",r)}s(f,"verifyResponseHtmlSafeNonce")},45075:(M,w,c)=>{c.d(w,{ZG:()=>r,q6:()=>E,w4:()=>d});var h=c(8439);let p=!1;const f=new h.Z;function l(g){const m=g.target;if(m instanceof HTMLElement&&m.nodeType!==Node.DOCUMENT_NODE)for(const v of f.matches(m))v.data.call(null,m)}s(l,"handleFocus");function r(g,m){p||(p=!0,document.addEventListener("focus",l,!0)),f.add(g,m),document.activeElement instanceof HTMLElement&&document.activeElement.matches(g)&&m(document.activeElement)}s(r,"onFocus");function d(g,m,v){function _(L){const i=L.currentTarget;!i||(i.removeEventListener(g,v),i.removeEventListener("blur",_))}s(_,"blurHandler"),r(m,function(L){L.addEventListener(g,v),L.addEventListener("blur",_)})}s(d,"onKey");function E(g,m){function v(_){const{currentTarget:L}=_;!L||(L.removeEventListener("input",m),L.removeEventListener("blur",v))}s(v,"blurHandler"),r(g,function(_){_.addEventListener("input",m),_.addEventListener("blur",v)})}s(E,"onInput")},2061:(M,w,c)=>{c.d(w,{j:()=>h,u:()=>p});function h(f){const l=f.closest("form");if(!(l instanceof HTMLFormElement))return;let r=p(l);if(f.name){const d=f.matches("input[type=submit]")?"Submit":"",E=f.value||d;r||(r=document.createElement("input"),r.type="hidden",r.classList.add("is-submit-button-value"),l.prepend(r)),r.name=f.name,r.value=E}else r&&r.remove()}s(h,"persistSubmitButtonValue");function p(f){const l=f.querySelector("input.is-submit-button-value");return l instanceof HTMLInputElement?l:null}s(p,"findPersistedSubmitButtonValue")},25833:(M,w,c)=>{c.d(w,{Z:()=>L});var h=c(12737),p=c(29719),f=c(64463);function l(i){return new Promise(a=>{i.addEventListener("dialog:remove",a,{once:!0})})}s(l,"waitForDialogClose");function r(i){const a=document.querySelector(".sso-modal");!a||(a.classList.remove("success","error"),i?a.classList.add("success"):a.classList.add("error"))}s(r,"setModalStatus");function d(i){const a=document.querySelector("meta[name=sso-expires-around]");a&&a.setAttribute("content",i)}s(d,"updateExpiresAroundTag");async function E(){const i=document.querySelector("link[rel=sso-modal]"),a=await(0,h.W)({content:(0,p.a)(document,i.href),dialogClass:"sso-modal"});let n=null;const b=window.external;if(b.ssoComplete=function(S){S.error?(n=!1,r(n)):(n=!0,r(n),d(S.expiresAround),window.focus()),b.ssoComplete=null},await l(a),!n)throw new Error("sso prompt canceled")}s(E,"ssoPrompt"),(0,f.N7)(".js-sso-modal-complete",function(i){if(window.opener&&window.opener.external.ssoComplete){const a=i.getAttribute("data-error"),n=i.getAttribute("data-expires-around");window.opener.external.ssoComplete({error:a,expiresAround:n}),window.close()}else{const a=i.getAttribute("data-fallback-url");a&&(window.location.href=a)}});function g(i){if(!(i instanceof HTMLMetaElement))return!0;const a=parseInt(i.content);return new Date().getTime()/1e3>a}s(g,"expiresSoon");async function m(){const i=document.querySelector("link[rel=sso-session]"),a=document.querySelector("meta[name=sso-expires-around]");if(!(i instanceof HTMLLinkElement)||!g(a))return!0;const n=i.href;return await(await fetch(n,{headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})).json()}s(m,"fetchSsoStatus");let v=null;function _(){v=null}s(_,"clearActiveSsoPrompt");async function L(){await m()||(v||(v=E().then(_).catch(_)),await v)}s(L,"__WEBPACK_DEFAULT_EXPORT__")},6741:(M,w,c)=>{c.d(w,{RB:()=>p,qC:()=>f,w0:()=>h});class h{constructor(r){this.closed=!1,this.unsubscribe=()=>{r(),this.closed=!0}}}s(h,"Subscription");function p(l,r,d,E={capture:!1}){return l.addEventListener(r,d,E),new h(()=>{l.removeEventListener(r,d,E)})}s(p,"fromEvent");function f(...l){return new h(()=>{for(const r of l)r.unsubscribe()})}s(f,"compose")}}]);})();
+
+//# sourceMappingURL=app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-af52ef-e439d69777c7.js.map \ No newline at end of file