User:Eejit43/scripts/rmtr-helper.js
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// <nowiki>
// Note: This script was compiled and minified from TypeScript. For a more readable version, see https://github.com/Eejit43/wikipedia-scripts/blob/main/scripts/rmtr-helper.ts
"use strict";(()=>{mw.loader.using(["mediawiki.util"],()=>{if(mw.config.get("wgPageName")!=="Wikipedia:Requested_moves/Technical_requests")return;importStylesheet("User:Eejit43/scripts/rmtr-helper.css");let b=mw.config.get("wgNamespaceIds"),L=!1;mw.util.addPortletLink(mw.config.get("skin")==="minerva"?"p-tb":"p-cactions","#","Review move requests","review-rmtr-requests").addEventListener("click",async T=>{if(T.preventDefault(),L)return document.querySelector("#rmtr-review-result")?.scrollIntoView();L=!0;let N=await I(),P=N.revid,k=N.slots.main.content,q=["Uncontroversial technical requests","Requests to revert undiscussed moves","Contested technical requests","Administrator needed"],o={};for(let a of q){let n=k.split(new RegExp(`={3,} ?${a} ?={3,}`))[1].split(/={3,}/m)[0].trim().match(/(?:\* ?\n)?[ *:]*{{rmassist\/core.+?(?=[ *:]*{{rmassist\/core|$)/gis);if(n)o[a]=n.map(i=>{i=i.trim();let c=i,s=i.replaceAll(/(?:\* ?\n)?[ *:]*{{rmassist\/core \||}}.*/gis,"").split(/\s*\|\s*/).map(r=>r.trim()),e=Object.fromEntries(s.map(r=>r.split(" = ").map(l=>l.trim())));return e.full=c,e.original=e[1]?.replace(/^\[+/,"").replace(/]+$/,"")??"UNKNOWN",e.destination=e[2]?.replace(/^\[+/,"").replace(/]+$/,"")??"UNKNOWN",delete e[1],delete e[2],e});else{o[a]=[];continue}}await Promise.all(Object.entries(o).map(async([,a])=>{await Promise.all(a.map(async t=>{let n=mw.Title.newFromText(t.original),i=mw.Title.newFromText(t.destination);if(!n)return mw.notify(`Invalid title "${t.original}"!`,{type:"error"});if(!i)return mw.notify(`Invalid title "${t.destination}"!`,{type:"error"});let c=!/[#<>[\]{|}]/.test(t.destination)&&i,s=document.createElement("span");s.classList.add("rmtr-review-invalid-warning"),s.textContent=`Invalid title "${t.destination}"!`;let e=![b.file,b.category].some(d=>n.getNamespaceId()===d||i.getNamespaceId()===d),r=document.createElement("span");r.classList.add("rmtr-review-invalid-warning"),r.textContent=`Warning: original or destination page is in namespace "${i.getNamespaceId()===b.file?"file":"category"}"!`;let l=await new mw.Api().parse(`[[:${t.original}]] \u2192 ${c?`[[:${t.destination}]]`:s.outerHTML} requested by ${t.requester?mw.util.isIPAddress(t.requester)?`[[Special:Contributions/${t.requester}|${t.requester}]]`:`[[User:${t.requester}|${t.requester}]]`:/(\[{2}Special:Contributions\/(.*?)\|\2]{2})/.exec(t.sig)?.[1]??"(unknown)"} with reasoning "${t.reason}"`),m=new DOMParser().parseFromString(l,"text/html"),w=document.createElement("li");w.innerHTML=m.querySelector("div.mw-parser-output").firstElementChild.innerHTML,e||w.append(r),t.element=w}))}));let v=document.createElement("div");v.id="rmtr-review-result";let x=document.createElement("div");x.id="rmtr-review-header",x.textContent="Technical move requests review",v.append(x);for(let[a,[t,n]]of Object.entries(o).entries()){let i=document.createElement("div");i.classList.add("rmtr-review-header"),i.textContent=t,v.append(i);let c=document.createElement("div");if(c.classList.add("rmtr-review-section-content"),n.length===0){let s=document.createElement("div");s.textContent="No requests in this section",c.append(s)}else{let s=document.createElement("ul");for(let[e,r]of n.entries()){let l=r.element,m=document.createElement("input");m.type="checkbox",m.classList.add("rmtr-review-request-checkbox"),m.id=`rmtr-review-remove-request-${a}-${e}`,m.addEventListener("change",()=>{m.checked?(o[t][e].result={remove:!0,reason:y.value},d.style.display="inline",p.disabled=!0):(delete o[t][e].result,d.style.display="none",p.disabled=!1)});let w=document.createElement("label");w.htmlFor=`rmtr-review-remove-request-${a}-${e}`,w.textContent="Remove request",l.append(m),l.append(w);let d=document.createElement("span");d.style.display="none",d.append(document.createTextNode(" as "));let y=document.createElement("select");t==="Contested technical requests"&&(y.value="Contested"),y.addEventListener("change",()=>{o[t][e].result.reason=y.value});let j=["Completed","Contested","Already done","Invalid page name","Incorrect venue","Withdrawn","Not done"];for(let R of j){let f=document.createElement("option");f.value=R,f.textContent=R,y.append(f)}d.append(y),l.append(d);let p=document.createElement("input");p.type="checkbox",p.classList.add("rmtr-review-request-checkbox"),p.id=`rmtr-review-move-request-${a}-${e}`,p.addEventListener("change",()=>{p.checked?(o[t][e].result={move:!0,section:$.value},u.style.display="inline",m.disabled=!0):(delete o[t][e].result,u.style.display="none",m.disabled=!1)});let C=document.createElement("label");C.htmlFor=`rmtr-review-move-request-${a}-${e}`,C.textContent="Switch section",l.append(p),l.append(C);let u=document.createElement("span");u.style.display="none",u.append(document.createTextNode(" to "));let $=document.createElement("select");$.addEventListener("change",()=>{o[t][e].result.section=$.value});for(let R of q){if(R===t)continue;let f=document.createElement("option");f.value=R,f.textContent=R,$.append(f)}u.append($),u.append(document.createTextNode(" with reasoning "));let E=document.createElement("input");E.type="text",E.addEventListener("input",()=>{o[t][e].result.reason=E.value}),u.append(E),u.append(document.createTextNode(" (optional, automatically pings requestor and signs)")),l.append(u),s.append(l)}c.append(s)}v.append(c)}let g=document.createElement("button");g.id="rmtr-review-submit",g.textContent="Submit",g.addEventListener("click",async()=>{if((await I()).revid!==P)return mw.notify("rmtr-helper: An edit conflict occurred, please start over!",{type:"error"});g.disabled=!0,h.style.display="inline-block";let t=k,n={remove:{},move:{},total:0};for(let s of Object.values(o))for(let e of s)if(e.result){if("remove"in e.result)t=t.replace(e.full+`
`,"").replace(e.full,""),e.result.reason in n.remove||(n.remove[e.result.reason]=[]),n.remove[e.result.reason].push(e),n.total++;else if("move"in e.result){let r=q[q.indexOf(e.result.section)+1];t=t.replace(e.full+`
`,"").replace(e.full,""),t=t.replace(new RegExp(`(
?
?(?:={3,} ?${r} ?={3,}|$))`),`
${e.full}${e.result.reason?`
:: ${e.requester&&e.requester.length>0?mw.util.isIPAddress(e.requester)?"":`@[[User:${e.requester}|${e.requester}]] `:""} ${e.result.reason} ~~~~`:""}$1`),e.result.section in n.move||(n.move[e.result.section]=[]),n.move[e.result.section].push(e),n.total++}}if(n.total===0)return g.disabled=!1,h.style.display="none",mw.notify("No changes to make!",{type:"error"});let i=Object.values(o).every(s=>s.every(e=>e.result&&"remove"in e.result)),c=`Handled ${n.total} request${n.total>1?"s":""}: ${Object.entries(n.remove).length>0?`Removed ${Object.entries(n.remove).map(([s,e])=>`${e.map(r=>`[[${r.original}]]`).join(", ")} as ${s.toLowerCase()}`).join(", ")}`:""}${Object.entries(n.move).length>0?`${Object.entries(n.remove).length>0?", ":""}Moved ${Object.entries(n.move).map(([s,e])=>`${e.map(r=>`[[${r.original}]]`).join(", ")} to "${s}"`).join(", ")}`:""}${i?" (no requests remain)":""} (via [[User:Eejit43/scripts/rmtr-helper|script]])`;await new mw.Api().edit(mw.config.get("wgPageName"),()=>({text:t,summary:c})),mw.notify(`Successfully handled ${n.total} requests, reloading...`,{type:"success"}),window.location.reload()});let h=document.createElement("span");h.id="rmtr-review-loading",h.style.display="none",g.append(h),v.append(g),mw.util.$content[0].prepend(v),v.scrollIntoView()})});async function I(){return(await new mw.Api().get({action:"query",formatversion:"2",prop:"revisions",rvprop:["content","ids"],rvslots:"main",titles:mw.config.get("wgPageName")})).query.pages[0].revisions[0]}})();
// </nowiki>
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc2NyaXB0cy9ybXRyLWhlbHBlci50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiaW1wb3J0IHR5cGUgeyBBcGlRdWVyeVJldmlzaW9uc1BhcmFtcyB9IGZyb20gJ3R5cGVzLW1lZGlhd2lraS9hcGlfcGFyYW1zJztcbmltcG9ydCB0eXBlIHsgUGFnZVJldmlzaW9uc1Jlc3VsdCB9IGZyb20gJy4uL2dsb2JhbC10eXBlcyc7XG5cbm13LmxvYWRlci51c2luZ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WdlQ29udGVudCA9IHBhZ2VSZXZpc2lvbi5zbG90cy5tYWluLmNvbnRlbnQ7XG5cbiAgICAgICAgY29uc3Qgc2VjdGlvbnMgPSBbXG4gICAgICAgICAgICAnVW5jb250cm92ZXJzaWFsIHRlY2huaWNhbCByZXF1ZXN0cycsXG4gICAgICAgICAgICAnUmVxdWVzdHMgdG8gcmV2ZXJ0IHVuZGlzY3Vzc2VkIG1vdmVzJyxcbiAgICAgICAgICAgICdDb250ZXN0ZWQgdGVjaG5pY2FsIHJlcXVlc3RzJyxcbiAgICAgICAgICAgICdBZG1pbmlzdHJhdG9yIG5lZWRlZCcsXG4gICAgICAgIF07XG5cbiAgICAgICAgaW50ZXJmYWNlIFJlcXVlc3Qge1xuICAgICAgICAgICAgc2lnOiBzdHJpbmc7XG4gICAgICAgICAgICByZXF1ZXN0ZXI/OiBzdHJpbmc7XG4gICAgICAgICAgICByZWFzb246IHN0cmluZztcbiAgICAgICAgICAgIGZ1bGw6IHN0cmluZztcbiAgICAgICAgICAgIG9yaWdpbmFsOiBzdHJpbmc7XG4gICAgICAgICAgICBkZXN0aW5hdGlvbjogc3RyaW5nO1xuICAgICAgICAgICAgZWxlbWVudDogSFRNTExJRWxlbWVudDtcbiAgICAgICAgICAgIHJlc3VsdD86IFJlcXVlc3RSZXN1bHRNb3ZlIHwgUmVxdWVzdFJlc3VsdFJlbW92ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGludGVyZmFjZSBSZXF1ZXN0UmVzdWx0TW92ZSB7XG4gICAgICAgICAgICBtb3ZlOiBib29sZWFuO1xuICAgICAgICAgICAgc2VjdGlvbjogc3RyaW5nO1xuICAgICAgICAgICAgcmVhc29uPzogc3RyaW5nO1xuICAgICAgICB9XG5cbiAgICAgICAgaW50ZXJmYWNlIFJlcXVlc3RSZXN1bHRSZW1vdmUge1xuICAgICAgICAgICAgcmVtb3ZlOiBib29sZWFuO1xuICAgICAgICAgICAgcmVhc29uOiBzdHJpbmc7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBhbGxSZXF1ZXN0czogUmVjb3JkPHN0cmluZywgUmVxdWVzdFtdPiA9IHt9O1xuXG4gICAgICAgIGZvciAoY29uc3Qgc2VjdGlvbiBvZiBzZWN0aW9ucykge1xuICAgICAgICAgICAgY29uc3Qgc2VjdGlvbkNvbnRlbnQgPSBwYWdlQ29udGVudFxuICAgICAgICAgICAgICAgIC5zcGxpdChuZXcgUmVnRXhwKGA9ezMsfSA/JHtzZWN0aW9ufSA/PXszLH1gKSlbMV1cbiAgICAgICAgICAgICAgICAuc3BsaXQoLz17Myx9L20pWzBdXG4gICAgICAgICAgICAgICAgLnRyaW0oKTtcblxuICAgICAgICAgICAgY29uc3QgbWF0Y2hlZFJlcXVlc3RzID0gc2VjdGlvbkNvbnRlbnQubWF0Y2goLyg/OlxcKiA/XFxuKT9bICo6XSp7e3JtYXNzaXN0XFwvY29yZS4rPyg/PVsgKjpdKnt7cm1hc3Npc3RcXC9jb3JlfCQpL2dpcyk7XG5cbiAgICAgICAgICAgIGlmIChtYXRjaGVkUmVxdWVzdHMpXG4gICAgICAgICAgICAgICAgYWxsUmVxdWVzdHNbc2VjdGlvbl0gPSBtYXRjaGVkUmVxdWVzdHMubWFwKChyZXF1ZXN0KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHJlcXVlc3QgPSByZXF1ZXN0LnRyaW0oKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZnVsbCA9IHJlcXVlc3Q7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhcmFtZXRlcnMgPSByZXF1ZXN0XG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZUFsbCgvKD86XFwqID9cXG4pP1sgKjpdKnt7cm1hc3Npc3RcXC9jb3JlIFxcfHx9fS4qL2dpcywgJycpXG4gICAgICAgICAgICAgICAgICAgICAgICAuc3BsaXQoL1xccypcXHxcXHMqLylcbiAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoKHBhcmFtZXRlcikgPT4gcGFyYW1ldGVyLnRyaW0oKSk7XG5cbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZmluYWxQYXJhbWV0ZXJzID0gT2JqZWN0LmZyb21FbnRyaWVzKFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVycy5tYXAoKHBhcmFtZXRlcikgPT4gcGFyYW1ldGVyLnNwbGl0KCcgPSAnKS5tYXAoKHZhbHVlKSA9PiB2YWx1ZS50cmltKCkpKSxcbiAgICAgICAgICAgICAgICAgICAgKSBhcyBSZWNvcmQ8c3RyaW5nLCBzdHJpbmcgfCB1bmRlZmluZWQ+O1xuXG4gICAgICAgICAgICAgICAgICAgIGZpbmFsUGFyYW1ldGVycy5mdWxsID0gZnVsbDtcblxuICAgICAgICAgICAgICAgICAgICBmaW5hbFBhcmFtZXRlcnMub3JpZ2luYWwgPSBmaW5hbFBhcmFtZXRlcnNbMV0/LnJlcGxhY2UoL15cXFsrLywgJycpLnJlcGxhY2UoL10rJC8sICcnKSA/PyAnVU5LTk9XTic7XG4gICAgICAgICAgICAgICAgICAgIGZpbmFsUGFyYW1ldGVycy5kZXN0aW5hdGlvbiA9IGZpbmFsUGFyYW1ldGVyc1syXT8ucmVwbGFjZSgvXlxcWysvLCAnJykucmVwbGFjZSgvXSskLywgJycpID8/ICdVTktOT1dOJztcblxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgZmluYWxQYXJhbWV0ZXJzWzFdO1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgZmluYWxQYXJhbWV0ZXJzWzJdO1xuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaW5hbFBhcmFtZXRlcnMgYXMgdW5rbm93biBhcyBSZXF1ZXN0O1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgYWxsUmVxdWVzdHNbc2VjdGlvbl0gPSBbXTtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGF3YWl0IFByb21pc2UuYWxsKFxuICAgICAgICAgICAgT2JqZWN0LmVudHJpZXMoYWxsUmVxdWVzdHMpLm1hcChhc3luYyAoWywgcmVxdWVzdHNdKSA9PiB7XG4gICAgICAgICAgICAgICAgYXdhaXQgUHJvbWlzZS5hbGwoXG4gICAgICAgICAgICAgICAgICAgIHJlcXVlc3RzLm1hcChhc3luYyAocmVxdWVzdCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbXdPbGRUaXRsZSA9IG13LlRpdGxlLm5ld0Zyb21UZXh0KHJlcXVlc3Qub3JpZ2luYWwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbXdOZXdUaXRsZSA9IG13LlRpdGxlLm5ld0Zyb21UZXh0KHJlcXVlc3QuZGVzdGluYXRpb24pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW13T2xkVGl0bGUpIHJldHVybiBtdy5ub3RpZnkoYEludmFsaWQgdGl0bGUgXCIke3JlcXVlc3Qub3JpZ2luYWx9XCIhYCwgeyB0eXBlOiAnZXJyb3InIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtd05ld1RpdGxlKSByZXR1cm4gbXcubm90aWZ5KGBJbnZhbGlkIHRpdGxlIFwiJHtyZXF1ZXN0LmRlc3RpbmF0aW9ufVwiIWAsIHsgdHlwZTogJ2Vycm9yJyB9KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsaWRUaXRsZSA9ICEvWyM8PltcXF17fH1dLy50ZXN0KHJlcXVlc3QuZGVzdGluYXRpb24pICYmIG13TmV3VGl0bGU7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGludmFsaWRUaXRsZVdhcm5pbmcgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzcGFuJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkV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pdGV4dCA9IGF3YWl0IG5ldyBtdy5BcGkoKS5wYXJzZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgW1s6JHtyZXF1ZXN0Lm9yaWdpbmFsfV1dIFx1MjE5MiAke3ZhbGlkVGl0bGUgPyBgW1s6JHtyZXF1ZXN0LmRlc3RpbmF0aW9ufV1dYCA6IGludmFsaWRUaXRsZVdhcm5pbmcub3V0ZXJIVE1MfSByZXF1ZXN0ZWQgYnkgJHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5yZXF1ZXN0ZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbXcudXRpbC5pc0lQQWRkcmVzcyhyZXF1ZXN0LnJlcXVlc3RlcilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGBbW1NwZWNpYWw6Q29udHJpYnV0aW9ucy8ke3JlcXVlc3QucmVxdWVzdGVyfXwke3JlcXVlc3QucmVxdWVzdGVyfV1dYFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogYFtbVXNlcjoke3JlcXVlc3QucmVxdWVzdGVyfXwke3JlcXVlc3QucmVxdWVzdGVyfV1dYFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoLyhcXFt7Mn1TcGVjaWFsOkNvbnRyaWJ1dGlvbnNcXC8oLio/KVxcfFxcMl17Mn0pLy5leGVjKHJlcXVlc3Quc2lnKT8uWzFdID8/ICcodW5rbm93biknKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2l0aCByZWFzb25pbmcgXCIke3JlcXVlc3QucmVhc29ufVwiYCxcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBwYXJzZWRIdG1sID0gbmV3IERPTVBhcnNlcigpLnBhcnNlRnJvbVN0cmluZyhwYXJzZWRXaWtpdGV4dCwgJ3RleHQvaHR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b25zdCByZXF1ZXN0RWxlbWVudCA9IHJlcXVlc3QuZWxlbWVudDtcblxuICAgICAgICAgICAgICAgICAgICBjb25zdCByZW1vdmVSZXF1ZXN0Q2hlY2tib3ggPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdpbnB1dCcpO1xuICAgICAgICAgICAgICAgICAgICByZW1vdmVSZXF1ZXN0Q2hlY2tib3gudHlwZSA9ICdjaGVja2JveCc7XG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZVJlcXVlc3RDaGVja2JveC5jbGFzc0xpc3QuYWRkKCdybXRyLXJldmlldy1yZXF1ZXN0LWNoZWNrYm94Jyk7XG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZVJlcXVlc3RDaGVja2JveC5pZCA9IGBybXRyLXJldmlldy1yZW1vdmUtcmVxdWVzdC0ke3NlY3Rpb25JbmRleH0tJHtyZXF1ZXN0SW5kZXh9YDtcbiAgICAgICAgICAgICAgICAgICAgcmVtb3ZlUmVxdWVzdENoZWNrYm94LmFkZEV2ZW50TGlzdGVuZXIoJ2NoYW5nZScsICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZW1vdmVSZXF1ZXN0Q2hlY2tib3guY2hlY2tlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsbFJlcXVlc3RzW3NlY3Rpb25dW3JlcXVlc3RJbmRleF0ucmVzdWx0ID0geyByZW1vdmU6IHRydWUsIHJlYXNvbjogcmVtb3ZlUmVxdWVzdERyb3Bkb3duLnZhbHVlIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlUmVxdWVzdEV4dHJhSW5wdXRzLnN0eWxlLmRpc3BsYXkgPSAnaW5saW5lJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hTZWN0aW9uQ2hlY2tib3guZGlzYWJsZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgYWxsUmVxdWVzdHNbc2VjdGlvbl1bcmVxdWVzdEluZGV4XS5yZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlUmVxdWVzdEV4dHJhSW5wdXRzLnN0eWxlLmRpc3BsYXkgPSAnbm9uZSc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoU2VjdGlvbkNoZWNrYm94LmRpc2FibGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlbW92ZVJlcXVlc3RMYWJlbCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2xhYmVsJyk7XG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZVJlcXVlc3RMYWJlbC5odG1sRm9yID0gYHJtdHItcmV2aWV3LXJlbW92ZS1yZXF1ZXN0LSR7c2VjdGlvbkluZGV4fS0ke3JlcXVlc3RJbmRleH1gO1xuICAgICAgICAgICAgICAgICAgICByZW1vdmVSZXF1ZXN0TGFiZWwudGV4dENvbnRlbnQgPSAnUmVtb3ZlIHJlcXVlc3QnO1xuXG4gICAgICAgICAgICAgICAgICAgIHJlcXVlc3RFbGVtZW50LmFwcGVuZChyZW1vdmVSZXF1ZXN0Q2hlY2tib3gpO1xuICAgICAgICAgICAgICAgICAgICByZXF1ZXN0RWxlbWVudC5hcHBlbmQocmVtb3ZlUmVxdWVzdExhYmVsKTtcblxuICAgICAgICAgICAgICAgICAgICBjb25zdCByZW1vdmVSZXF1ZXN0RXh0cmFJbnB1dHMgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzcGFuJyk7XG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZVJlcXVlc3RFeHRyYUlucHV0cy5zdHlsZS5kaXNwbGF5ID0gJ25vbmUnO1xuXG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZVJlcXVlc3RFeHRyYUlucHV0cy5hcHBlbmQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUoJyBhcyAnKSk7XG5cbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVtb3ZlUmVxdWVzdERyb3Bkb3duID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc2VsZWN0Jyk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzZWN0aW9uID09PSAnQ29udGVzdGVkIHRlY2huaWNhbCByZXF1ZXN0cycpIHJlbW92ZVJlcXVlc3REcm9wZG93bi52YWx1ZSA9ICdDb250ZXN0ZWQnO1xuICAgICAgICAgICAgICAgICAgICByZW1vdmVSZXF1ZXN0RHJvcGRvd24uYWRkRXZlbnRMaXN0ZW5lcignY2hhbmdlJywgKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgKGFsbFJlcXVlc3RzW3NlY3Rpb25dW3JlcXVlc3RJbmRleF0ucmVzdWx0IGFzIFJlcXVlc3RSZXN1bHRSZW1vdmUpLnJlYXNvbiA9IHJlbW92ZVJlcXVlc3REcm9wZG93bi52YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVtb3ZlUmVxdWVzdERyb3Bkb3duT3B0aW9ucyA9IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlc3RlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWxyZWFkeSBkb25lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJbnZhbGlkIHBhZ2UgbmFtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSW5jb3JyZWN0IHZlbnVlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05vdCBkb25lJyxcbiAgICAgICAgICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IG9wdGlvbiBvZiByZW1vdmVSZXF1ZXN0RHJvcGRvd25PcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBvcHRpb25FbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnb3B0aW9uJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25FbGVtZW50LnZhbHVlID0gb3B0aW9uO1xuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uRWxlbWVudC50ZXh0Q29udGVudCA9IG9wdGlvbjtcblxuICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlUmVxdWVzdERyb3Bkb3duLmFwcGVuZChvcHRpb25FbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZVJlcXVlc3RFeHRyYUlucHV0cy5hcHBlbmQocmVtb3ZlUmVxdWVzdERyb3Bkb3duKTtcblxuICAgICAgICAgICAgICAgICAgICByZXF1ZXN0RWxlbWVudC5hcHBlbmQocmVtb3ZlUmVxdWVzdEV4dHJhSW5wdXRzKTtcblxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzd2l0Y2hTZWN0aW9uQ2hlY2tib3ggPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdpbnB1dCcpO1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2hTZWN0aW9uQ2hlY2tib3gudHlwZSA9ICdjaGVja2JveCc7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaFNlY3Rpb25DaGVja2JveC5jbGFzc0xpc3QuYWRkKCdybXRyLXJldmlldy1yZXF1ZXN0LWNoZWNrYm94Jyk7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaFNlY3Rpb25DaGVja2JveC5pZCA9IGBybXRyLXJldmlldy1tb3ZlLXJlcXVlc3QtJHtzZWN0aW9uSW5kZXh9LSR7cmVxdWVzdEluZGV4fWA7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaFNlY3Rpb25DaGVja2JveC5hZGRFdmVudExpc3RlbmVyKCdjaGFuZ2UnLCAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3dpdGNoU2VjdGlvbkNoZWNrYm94LmNoZWNrZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWxsUmVxdWVzdHNbc2VjdGlvbl1bcmVxdWVzdEluZGV4XS5yZXN1bHQgYXMgUmVxdWVzdFJlc3VsdE1vdmUpID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3ZlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWN0aW9uOiBzd2l0Y2hTZWN0aW9uRHJvcGRvd24udmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hTZWN0aW9uRXh0cmFJbnB1dHMuc3R5bGUuZGlzcGxheSA9ICdpbmxpbmUnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZVJlcXVlc3RDaGVja2JveC5kaXNhYmxlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBhbGxSZXF1ZXN0c1tzZWN0aW9uXVtyZXF1ZXN0SW5kZXhdLnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hTZWN0aW9uRXh0cmFJbnB1dHMuc3R5bGUuZGlzcGxheSA9ICdub25lJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVSZXF1ZXN0Q2hlY2tib3guZGlzYWJsZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbi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WxsUmVxdWVzdHNbc2VjdGlvbl1bcmVxdWVzdEluZGV4XS5yZXN1bHQgYXMgUmVxdWVzdFJlc3VsdE1vdmUpLnNlY3Rpb24gPSBzd2l0Y2hTZWN0aW9uRHJvcGRvd24udmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgIGZvciAoY29uc3Qgb3B0aW9uIG9mIHNlY3Rpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9uID09PSBzZWN0aW9uKSBjb250aW51ZTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgb3B0aW9uRWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ29wdGlvbicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uRWxlbWVudC52YWx1ZSA9IG9wdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbkVsZW1lbnQudGV4dENvbnRlbnQgPSBvcHRpb247XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaFNlY3Rpb25Ecm9wZG93bi5hcHBlbmQob3B0aW9uRWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2hTZWN0aW9uRXh0cmFJbnB1dHMuYXBwZW5kKHN3aXRjaFNlY3Rpb25Ecm9wZG93bik7XG5cbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoU2VjdGlvbkV4dHJhSW5wdXRzLmFwcGVuZChkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZSgnIHdpdGggcmVhc29uaW5nICcpKTtcblxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzd2l0Y2hTZWN0aW9uUmVhc29uaW5nID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnaW5wdXQnKTtcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoU2VjdGlvblJlYXNvbmluZy50eXBlID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cykpXG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCByZXF1ZXN0IG9mIHNlY3Rpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyZXF1ZXN0LnJlc3VsdCkgY29udGludWU7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCdyZW1vdmUnIGluIHJlcXVlc3QucmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbmRSZXN1bHQgPSBlbmRSZXN1bHQucmVwbGFjZShyZXF1ZXN0LmZ1bGwgKyAnXFxuJywgJycpLnJlcGxhY2UocmVxdWVzdC5mdWxsLCAnJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShyZXF1ZXN0LnJlc3VsdC5yZWFzb24gaW4gY2hhbmdlcy5yZW1vdmUpKSBjaGFuZ2VzLnJlbW92ZVtyZXF1ZXN0LnJlc3VsdC5yZWFzb25dID0gW107XG4gICAgICAgICAgICAgICAgICAgICAgICBjaGFuZ2VzLnJlbW92ZVtyZXF1ZXN0LnJlc3VsdC5yZWFzb25dLnB1c2gocmVxdWVzdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjaGFuZ2VzLnRvdGFsKys7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJ21vdmUnIGluIHJlcXVlc3QucmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWN0aW9uVGl0bGVBZnRlciA9IHNlY3Rpb25zW3NlY3Rpb25zLmluZGV4T2YocmVxdWVzdC5yZXN1bHQuc2VjdGlvbikgKyAxXTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgZW5kUmVzdWx0ID0gZW5kUmVzdWx0LnJlcGxhY2UocmVxdWVzdC5mdWxsICsgJ1xcbicsICcnKS5yZXBsYWNlKHJlcXVlc3QuZnVsbCwgJycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZW5kUmVzdWx0ID0gZW5kUmVzdWx0LnJlcGxhY2UoXG4gICAgICA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