"use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([[96384],{18651:(e,t,n)=>{n.d(t,{Fr:()=>c,R0:()=>a,U0:()=>d,xl:()=>u});var i=n(56038);let r="Android",l="macOS",s="Windows",o="Linux";function a(){let e="Unknown",t=!1;if(i.cg){let n=i.cg.navigator,a="";try{a=n.userAgent}catch{}let c="";try{c=n?.userAgentData?.platform||n.platform}catch{}-1!==["Macintosh","MacIntel","MacPPC","Mac68K","macOS"].indexOf(c)?e=l:-1!==["iPhone","iPad","iPod"].indexOf(c)?e="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(c)?e=s:/Android/.test(a)?e=r:/Linux/.test(c)&&(e=o),t=n?.userAgentData?.mobile??(e===r||"iOS"===e)}return{os:e,isAndroid:e===r,isIOS:"iOS"===e,isMacOS:e===l,isWindows:e===s,isLinux:e===o,isDesktop:e===l||e===s||e===o,isMobile:t}}function c(){return a().isMobile}function u(){return a().isDesktop}function d(){return a().isMacOS}},19117:(e,t,n)=>{n.d(t,{NB:()=>c,Up:()=>a,pk:()=>u});let i=new WeakMap;function r(e){let t=i.get(e);t&&(null!=t.timer&&clearTimeout(t.timer),t.timer=window.setTimeout(()=>{null!=t.timer&&(t.timer=null),t.inputed=!1,t.listener.call(null,e)},t.wait))}function l(e){let t=e.currentTarget,n=i.get(t);n&&(n.keypressed=!0,null!=n.timer&&clearTimeout(n.timer))}function s(e){let t=e.currentTarget,n=i.get(t);n&&(n.keypressed=!1,n.inputed&&r(t))}function o(e){let t=e.currentTarget,n=i.get(t);n&&(n.inputed=!0,n.keypressed||r(t))}function a(e,t,n={wait:null}){i.set(e,{keypressed:!1,inputed:!1,timer:void 0,listener:t,wait:null!=n.wait?n.wait:100}),e.addEventListener("keydown",l),e.addEventListener("keyup",s),e.addEventListener("input",o)}function c(e,t){e.removeEventListener("keydown",l),e.removeEventListener("keyup",s),e.removeEventListener("input",o);let n=i.get(e);n&&(null!=n.timer&&n.listener===t&&clearTimeout(n.timer),i.delete(e))}function u(e){let t=i.get(e);t&&t.listener.call(null,e)}},33303:(e,t,n)=>{function i(){return Promise.resolve()}function r(){return new Promise(window.requestAnimationFrame)}async function l(e,t){let n,i=new Promise(t=>{n=self.setTimeout(t,e)});if(!t)return i;try{var r;await Promise.race([i,(r=t,new Promise((e,t)=>{let n=Error("aborted");n.name="AbortError",r.aborted?t(n):r.addEventListener("abort",()=>t(n))}))])}catch(e){throw self.clearTimeout(n),e}}function s(e){let t=[];return function(n){t.push(n),1===t.length&&queueMicrotask(()=>{let n=t.slice(0);t.length=0,e(n)})}}n.d(t,{G$:()=>r,k2:()=>i,rK:()=>s,uk:()=>l})},44569:(e,t,n)=>{n.d(t,{$$:()=>c,GI:()=>s,fg:()=>a,zw:()=>l});var i=n(18651),r=n(87465);let l=()=>{if("undefined"==typeof document)return!1;let e=document.querySelector("meta[name=keyboard-shortcuts-preference]");return!e||"all"===e.content},s=e=>/Enter|Arrow|Escape|Meta|Control|Mod|Esc|Tab/.test(e)||!(0,i.U0)()&&e.includes("Alt")&&e.includes("Shift"),o=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);function a(e){if(!(e instanceof HTMLElement))return!1;let t=e.nodeName.toLowerCase(),n=e.getAttribute("type")?.toLowerCase()??"text",i="true"===e.ariaReadOnly||"true"===e.getAttribute("aria-readonly")||null!==e.getAttribute("readonly");return("select"===t||"textarea"===t||"input"===t&&!o.has(n)||e.isContentEditable)&&!i}let c=e=>{let t=(0,r.Vy)(e),n=l()&&!a(e.target);return s(t)||n}},74868:(e,t,n)=>{n.d(t,{df:()=>c});var i=n(96123),r=n(97797),l=n(72705),s=n(21403),o=n(58371),a=n(46865);function c(e){if(e.querySelector(".js-task-list-field")){for(let t of e.querySelectorAll("task-lists"))if(t instanceof l.A)for(let e of(t.disabled=!1,t.querySelectorAll("button")))e.disabled=!1}}function u(e,t,n){let i=e.querySelector(".js-comment-update");for(let t of e.querySelectorAll("task-lists"))if(t instanceof l.A)for(let e of(t.disabled=!0,t.querySelectorAll("button")))e.disabled=!0;E(e);let r=i.elements.namedItem("task_list_track");r instanceof Element&&r.remove();let s=i.elements.namedItem("task_list_operation");s instanceof Element&&s.remove();let o=document.createElement("input");o.setAttribute("type","hidden"),o.setAttribute("name","task_list_track"),o.setAttribute("value",t),i.appendChild(o);let c=document.createElement("input");if(c.setAttribute("type","hidden"),c.setAttribute("name","task_list_operation"),c.setAttribute("value",JSON.stringify(n)),i.appendChild(c),!i.elements.namedItem("task_list_key")){let e=i.querySelector(".js-task-list-field").getAttribute("name").split("[")[0],t=document.createElement("input");t.setAttribute("type","hidden"),t.setAttribute("name","task_list_key"),t.setAttribute("value",e),i.appendChild(t)}e.classList.remove("is-comment-stale"),(0,a.k_)(i)}(0,s.lB)(".js-task-list-container .js-task-list-field",function(e){let t=e.closest(".js-task-list-container");c(t),E(t)}),(0,s.lB)(".js-convert-tasklist-to-block-enabled .contains-task-list",function(e){let t=x(e);if(!t||Array.from(t.children).some(e=>e.classList.contains("task-list-item-convert-container")))return;let n=e.ownerDocument.querySelector(".js-convert-to-block-template"),i=n?.content.cloneNode(!0);i&&t.appendChild(i)}),(0,r.on)("task-lists-move","task-lists",function(e){let{src:t,dst:n}=e.detail;u(e.currentTarget.closest(".js-task-list-container"),"reordered",{operation:"move",src:t,dst:n})}),(0,r.on)("task-lists-check","task-lists",function(e){let{position:t,checked:n}=e.detail;u(e.currentTarget.closest(".js-task-list-container"),`checked:${+!!n}`,{operation:"check",position:t,checked:n})}),(0,r.on)("click",".js-convert-to-block-button",function(e){let t=x(e.target);if(!t)return;if(!t.closest("task-lists"))throw Error("parent not found");let n=function(e){let t=e.closest("task-lists");if(!t)throw Error("parent not found");return Array.from(t.querySelectorAll("ol, ul")).filter(e=>!e.closest("tracking-block")).indexOf(e)}(t);u(e.currentTarget.closest(".js-task-list-container"),"converted",{operation:"convert_to_block",position:n})}),(0,o.JW)(".js-task-list-container .js-comment-update",async function(e,t){let n,i=e.closest(".js-task-list-container"),r=e.elements.namedItem("task_list_track");r instanceof Element&&r.remove();let l=e.elements.namedItem("task_list_operation");l instanceof Element&&l.remove();try{n=await t.json()}catch(t){let e;try{e=JSON.parse(t.response.text)}catch{}if(e&&e.stale){let e=i.querySelector(".js-task-list-field");e.classList.add("session-resumable-canceled"),e.classList.remove("js-session-resumable")}else 422===t.response.status||window.location.reload()}n&&(l&&n.json.source&&(i.querySelector(".js-task-list-field").value=n.json.source),c(i),requestAnimationFrame(()=>E(i)))});let d=!1,m=!1,f=null;function p(e){d="insertLineBreak"===e.inputType}function k(e){if(d||"insertLineBreak"===e.inputType){var t;let n;void 0!==(n=function(e,t){let n=t[0];if(!n||!e)return;let i=e.substring(0,n).split(` `),r=i[i.length-2],l=r?.match(A);if(!l)return;let s=l[0],o=l[1],a=l[2],c=parseInt(l[3],10),u=!!l[4],d=!isNaN(c),m=d?`${c+1}.`:a,f=`${m} ${u?"[ ] ":""}`,p=e.indexOf(` `,n);p<0&&(p=e.length);let k=e.substring(n,p);if(k.startsWith(f)&&(f=""),r.replace(s,"").trim().length>0||k.trim().length>0){let t=`${o}${f}`,i=e.substring(n),r=t.length,l=[null,null],s=e.substring(0,n)+t+i;if(d&&!e.substring(n).match(/^\s*$/g)){var g,b;g=e.substring(n),b=c+1,t+=i=g.split(` `).map(e=>{if(e.replace(/^\s+/,"").startsWith(`${b}.`)){let t=e.replace(`${b}`,`${b+1}`);return b+=1,t}return e}).join(` `),l=[n,n+t.length],s=e.substring(0,n)+t}return{text:s,autocompletePrefix:t,selection:[n+r,n+r],commandId:w.insertText,writeSelection:l}}{let t=n-` ${s}`.length;return{autocompletePrefix:"",text:e.substring(0,t)+e.substring(n),selection:[t,t],commandId:w.delete,writeSelection:[null,null]}}}((t=e.target).value,[t.selectionStart,t.selectionEnd]))&&g(t,n),d=!1}}function g(e,t){if(null===f||!0===f){e.contentEditable="true";try{let n;d=!1,t.commandId===w.insertText?(n=t.autocompletePrefix,null!==t.writeSelection[0]&&null!==t.writeSelection[1]&&(e.selectionStart=t.writeSelection[0],e.selectionEnd=t.writeSelection[1])):e.selectionStart=t.selection[0],f=document.execCommand(t.commandId,!1,n)}catch{f=!1}e.contentEditable="false"}if(!f){try{document.execCommand("ms-beginUndoUnit")}catch{}e.value=t.text;try{document.execCommand("ms-endUndoUnit")}catch{}e.dispatchEvent(new CustomEvent("input",{bubbles:!0,cancelable:!0}))}null!=t.selection[0]&&null!=t.selection[1]&&(e.selectionStart=t.selection[0],e.selectionEnd=t.selection[1])}function b(e){if(!m&&"Enter"===e.key&&e.shiftKey&&!e.metaKey){let t=e.target,n=function(e,t){let n=t[0];if(!n||!e)return;let i=e.substring(0,n).split(` `),r=i[i.length-1],l=r?.match(S);if(!l)return;let s=l[1]||"",o=` ${s}`;return{text:e.substring(0,n)+o+e.substring(n),autocompletePrefix:o,selection:[n+o.length,n+o.length],commandId:w.insertText,writeSelection:[null,null]}}(t.value,[t.selectionStart,t.selectionEnd]);if(void 0!==n)g(t,n),e.preventDefault(),(0,r.h)(t,"change")}}function h(){m=!0}function y(){m=!1}function v(e){if(m)return;if("Escape"===e.key){let t;return void("backward"===(t=e.target).selectionDirection?t.selectionEnd=t.selectionStart:t.selectionStart=t.selectionEnd)}if("Tab"!==e.key)return;let t=e.target,n=function(e,t,n){let i=t[0]||0,r=t[1]||i;if(null===t[0]||i===r)return;let l=e.substring(0,i).lastIndexOf(` `)+1,s=e.indexOf(` `,r-1),o=s>0?s:e.length-1,a=e.substring(l,o).split(` `),c=!1,u=0,d=0,m=[];for(let e of a){let t=e.match(/^\s*/);if(t){let i=t[0],r=e.substring(i.length);if(n){let e=i.length;i=i.slice(0,-2),u=c?u:i.length-e,c=!0,d+=i.length-e}else i+=" ",u=2,d+=2;m.push(i+r)}}let f=m.join(` `);return{text:e.substring(0,l)+f+e.substring(o),selection:[Math.max(l,i+u),r+d],autocompletePrefix:f,commandId:w.insertText,writeSelection:[l,o]}}(t.value,[t.selectionStart,t.selectionEnd],e.shiftKey);void 0!==n&&(e.preventDefault(),g(t,n))}(0,s.lB)(".js-task-list-field",{subscribe:e=>(0,i.Zz)((0,i.Rt)(e,"keydown",v),(0,i.Rt)(e,"keydown",b),(0,i.Rt)(e,"beforeinput",p),(0,i.Rt)(e,"input",k),(0,i.Rt)(e,"compositionstart",h),(0,i.Rt)(e,"compositionend",y))});let w={insertText:"insertText",delete:"delete"},S=/^(\s*)?/,A=/^(\s*)([*-]|(\d+)\.)\s(\[[\sx]\]\s)?/;function E(e){if(0===document.querySelectorAll("tracked-issues-progress").length||e.closest(".js-timeline-item"))return;let t=e.querySelectorAll(".js-comment-body [type=checkbox]"),n=t.length,i=Array.from(t).filter(e=>e.checked).length;for(let e of document.querySelectorAll("tracked-issues-progress[data-type=checklist]"))e.setAttribute("data-completed",String(i)),e.setAttribute("data-total",String(n))}function x(e){let t=e.closest(".contains-task-list"),n=t;for(;(n=n.parentElement.closest(".contains-task-list"))!==t&&null!==n;)t=n;return t}}}]); //# sourceMappingURL=96384-ec0150627950.js.map