 M scripts/migrate_minio_to_local.py
448399a replace MinIO with local file storage
d610ad9 Harden admin session authentication
2b92d8c Use configured admin credentials for login
./scripts/migrate_minio_to_local.py:25:DEFAULT_PUBLIC_BASE_URL = "https://api.beenglish.eu.org/DesignScreenshot/files"
./scripts/migrate_minio_to_local.py:170:SET name = 'Rust 本地磁盘',
./output/git.buildapp.eu.org_run/git.buildapp.eu.org_2_login_page.html:302:</div>`);t.addEventListener("click",async i=>{i.preventDefault();const n=await Ii(Xf(e));Dt(i.target,n?Kf.copy_success:Kf.copy_error)}),e.previewTemplate.append(t)}async function Qf(e){const t=e.closest("[data-attachment-url]")?.getAttribute("data-attachment-url"),i=e.getAttribute("data-remove-url"),n=e.getAttribute("data-link-url");let s=!1,l={};const u={url:e.getAttribute("data-upload-url"),headers:{"X-Csrf-Token":Ng},acceptedFiles:["*/*",""].includes(e.getAttribute("data-accepts"))?null:e.getAttribute("data-accepts"),addRemoveLinks:!0,dictDefaultMessage:e.getAttribute("data-default-message"),dictInvalidFileType:e.getAttribute("data-invalid-input-type"),dictFileTooBig:e.getAttribute("data-file-too-big"),dictRemoveFile:e.getAttribute("data-remove-file"),timeout:0,thumbnailMethod:"contain",thumbnailWidth:480,thumbnailHeight:480};e.hasAttribute("data-max-file")&&(u.maxFiles=Number(e.getAttribute("data-max-file"))),e.hasAttribute("data-max-size")&&(u.maxFilesize=Number(e.getAttribute("data-max-size")));const m=await Hg(e,u);return m.on("success",(y,A)=>{y.uuid=A.uuid,l[y.uuid]={submitted:!1};const L=(0,C.tw)("input",{name:"files",type:"hidden",id:`dropzone-file-${A.uuid}`,value:A.uuid});e.querySelector(".files").append(L),Gf(y),m.emit(Uu,{file:y})}),m.on("removedfile",async y=>{s||(m.emit($u,{fileUuid:y.uuid}),document.querySelector(`#dropzone-file-${y.uuid}`)?.remove(),i&&l[y.uuid]&&!l[y.uuid].submitted&&await(0,Ae.LO)(i,{data:new URLSearchParams({file:y.uuid})}))}),m.on("submit",()=>{for(const y of Object.keys(l))l[y].submitted=!0}),m.on(Ac,async()=>{try{const A=await(await(0,Ae.fG)(t)).json();s=!0,m.removeAllFiles(!0),s=!1,e.querySelector(".files").innerHTML="";for(const L of e.querySelectorAll(".dz-preview"))L.remove();l={};for(const L of A){const z={name:L.name,uuid:L.uuid,size:L.size};if(m.emit("addedfile",z),m.emit("complete",z),(0,St.u)(z.name)){const _e=`${n}/${z.uuid}`;m.emit("thumbnail",z,_e)}Gf(z),l[z.uuid]={submitted:!0};const X=(0,C.tw)("input",{name:"files",type:"hidden",id:`dropzone-file-${z.uuid}`,value:z.uuid});e.querySelector(".files").append(X)}e.querySelector(".dz-preview")||e.classList.remove("dz-started")}catch(y){gt(`Failed to load attachments: ${y}`),console.error(y)}}),m.on("error",(y,A)=>{gt(`Dropzone upload error: ${A}`),m.removeFile(y)}),t&&m.emit(Ac),m}var Bg=Object.defineProperty,$g=(e,t,i)=>t in e?Bg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Yf=(e,t,i)=>$g(e,typeof t!="symbol"?t+"":t,i);let Ug=0;const Jf="ce-upload-state-changed";function Vu(e){e.dispatchEvent(new CustomEvent(Jf,{bubbles:!0}))}function Vg(e,t){return new Promise(i=>{const n=Ug++;t._giteaUploadId=n;const s=e.dropzone,l=({file:u})=>{u._giteaUploadId===n&&(s.off(Uu,l),i(u))};s.on(Uu,l),s.addFile(t)})}class Zf{constructor(t){Yf(this,"editor"),this.editor=t}insertPlaceholder(t){Wf(this.editor,t)}replacePlaceholder(t,i){const n=this.editor,s=n.selectionStart,l=n.selectionEnd;n.value.substring(s,l)===t?(n.value=n.value.substring(0,s)+i+n.value.substring(l),n.selectionEnd=s+i.length):(n.value=n.value.replace(t,i),n.selectionEnd-=t.length,n.selectionEnd+=i.length),n.selectionStart=n.selectionEnd,n.focus(),Lo(n)}}class Wg{constructor(t){Yf(this,"editor"),this.editor=t}insertPlaceholder(t){const i=this.editor,n=i.getCursor("start"),s=i.getCursor("end");i.replaceSelection(t),s.ch=n.ch+t.length,i.setSelection(n,s),i.focus(),Lo(i.getTextArea())}replacePlaceholder(t,i){const n=this.editor,s=n.getCursor("end");n.getSelection()===t?n.replaceSelection(i):n.setValue(n.getValue().replace(t,i)),s.ch-=t.length,s.ch+=i.length,n.setSelection(s,s),n.focus(),Lo(n.getTextArea())}}async function Cc(e,t,i,n){n.preventDefault();for(const s of i){const l=s.name.slice(0,s.name.lastIndexOf(".")),{width:u,dppx:m}=await Rg(s),y=`[${l}](uploading ...)`;e.insertPlaceholder(y),await Vg(t,s),e.replacePlaceholder(y,Xf(s,{width:u,dppx:m}))}}function eh(e,t){return e=e.replace(new RegExp(`!?\\[([^\\]]+)\\]\\(/?attachments/${t}\\)`,"g"),""),e=e.replace(new RegExp(`<img[^>]+src="/?attachments/${t}"[^>]*>`,"g"),""),e}function zg(e,t){const{value:i,selectionStart:n,selectionEnd:s}=e,l=i.substring(n,s),u=t.trim(),m=i.substring(0,n),y=i.substring(s),A=m.endsWith("](")&&y.startsWith(")");return l&&(0,pr.gU)(u)&&!(0,pr.gU)(l)&&!A?`[${l}](${u})`:null}function Kg(e,t,i,n){if(n)return;const s=zg(e,i);s&&(t.preventDefault(),(0,C.Pj)(e,s))}function th(e){const t=[];for(const n of e.clipboardData?.items??[])n.type?.startsWith("image/")&&t.push(n.getAsFile());return{text:e.clipboardData?.getData?.("text")??"",images:t}}function Xg(e,t){const i=new Wg(e.codemirror);e.codemirror.on("paste",(n,s)=>{const{images:l}=th(s);l.length&&Cc(i,t,l,s)}),e.codemirror.on("drop",(n,s)=>{s.dataTransfer.files.length&&Cc(i,t,s.dataTransfer.files,s)}),t.dropzone.on($u,({fileUuid:n})=>{const s=e.codemirror.getValue(),l=eh(s,n);s!==l&&e.codemirror.setValue(l)})}function Gg(e,t){let i=!1;e.addEventListener("keydown",n=>{n.shiftKey&&(i=!0)}),e.addEventListener("keyup",n=>{n.shiftKey||(i=!1)}),e.addEventListener("paste",n=>{const{images:s,text:l}=th(n);s.length&&t?Cc(new Zf(e),t,s,n):l&&Kg(e,n,l,i)}),e.addEventListener("drop",n=>{n.dataTransfer.files.length&&t&&Cc(new Zf(e),t,n.dataTransfer.files,n)}),t?.dropzone.on($u,({fileUuid:n})=>{const s=eh(e.value,n);e.value!==s&&(e.value=s)})}function kc(e){let t=e.closest("form");return t?(t.checkValidity()?t.dispatchEvent(new SubmitEvent("submit",{bubbles:!0,cancelable:!0})):t.reportValidity(),!0):(t=e.closest(".ui.form"),t?((0,C.gD)(t,".ui.primary.button")?.click(),!0):!1)}var Qg=__webpack_require__("./node_modules/tinycolor2/esm/tinycolor.js");const ih={},nh={},Yg={fontFamily:"var(--fonts-monospace)",fontSize:14,guides:{bracketPairs:!1,indentation:!1},links:!1,minimap:{enabled:!1},occurrencesHighlight:"off",overviewRulerLanes:0,renderLineHighlight:"all",renderLineHighlightOnlyWhenFocus:!0,rulers:[],scrollbar:{horizontalScrollbarSize:6,verticalScrollbarSize:6},scrollBeyondLastLine:!1,automaticLayout:!0};function Jg(e){const t=e.getAttribute("data-editorconfig");if(!t)return null;try{return JSON.parse(t)}catch{return null}}function Zg(e){for(const{filenames:t,extensions:i,id:n}of e.languages.getLanguages()){for(const s of t||[])ih[s]=n;for(const s of i||[])nh[s]=n;n==="typescript"&&e.languages.typescript.typescriptDefaults.setCompilerOptions({jsx:e.languages.typescript.JsxEmit.Preserve})}}function sh(e){return ih[e]||nh[(0,St.LC)(e)]||"plaintext"}function e0(e,t,i,n){t.updateOptions(ah(i,n));const s=t.getModel();if(!s)return;const l=s.getLanguageId(),u=sh(i);l!==u&&e.editor.setModelLanguage(s,u)}function t0(e){window.codeEditors||(window.codeEditors=[]),window.codeEditors.includes(e)||window.codeEditors.push(e)}function rh(e){const t=window.getComputedStyle(document.documentElement),i=n=>(0,Qg.A)(t.getPropertyValue(n).trim()).toString("hex6");e.editor.defineTheme("gitea",{base:(0,St.g4)()?"vs-dark":"vs",inherit:!0,rules:[{background:i("--color-code-bg"),token:""}],colors:{"editor.background":i("--color-code-bg"),"editor.foreground":i("--color-text"),"editor.inactiveSelectionBackground":i("--color-primary-light-4"),"editor.lineHighlightBackground":i("--color-editor-line-highlight"),"editor.selectionBackground":i("--color-primary-light-3"),"editor.selectionForeground":i("--color-primary-light-3"),"editorLineNumber.background":i("--color-code-bg"),"editorLineNumber.foreground":i("--color-secondary-dark-6"),"editorWidget.background":i("--color-body"),"editorWidget.border":i("--color-secondary"),"input.background":i("--color-input-background"),"input.border":i("--color-input-border"),"input.foreground":i("--color-input-text"),"scrollbar.shadow":i("--color-shadow-opaque"),"progressBar.background":i("--color-primary"),focusBorder:"#0000"}})}async function oh(e,t,i){const n=await __webpack_require__.e("monaco").then(__webpack_require__.bind(__webpack_require__,"include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.main.js"));Zg(n);let{language:s,...l}=i;s||(s=sh(t));const u=document.createElement("div");if(u.className="monaco-editor-container",!e.parentNode)throw new Error("Parent node absent");e.parentNode.append(u),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{rh(n)}),rh(n);const m=n.editor.createModel(e.value,s,n.Uri.file(t)),y=n.editor.create(u,{model:m,theme:"gitea",...l});n.editor.addKeybindingRules([{keybinding:n.KeyCode.Enter,command:null}]),m.onDidChangeContent(()=>{e.value=y.getValue({preserveBOM:!0,lineEnding:""}),e.dispatchEvent(new Event("change"))}),t0(y);const A=document.querySelector(".editor-loading");return A&&A.remove(),{monaco:n,editor:y}}function ah(e,t){return{wordWrap:(t||[]).includes((0,St.LC)(e))?"on":"off"}}function lh(e){const t=document.querySelector('a[data-tab="preview"]');t&&(e?t.style.display="":(t.style.display="none",t.classList.contains("active")&&document.querySelector('a[data-tab="write"]')?.click()))}async function i0(e,t){const i=(0,St.P8)(t.value),n=new Set((e.getAttribute("data-previewable-extensions")||"").split(",")),s=(e.getAttribute("data-line-wrap-extensions")||"").split(","),l=n.has((0,St.LC)(i)),u=Jg(t);lh(l);const{monaco:m,editor:y}=await oh(e,i,{...Yg,...ah(t.value,s),...n0(u)});return t.addEventListener("input",(0,C.nm)(()=>{const A=t.value,L=n.has((0,St.LC)(A));lh(L),e0(m,y,A,s)})),y}function n0(e){if(!e||!(0,St.Gv)(e))return{};const t={};return t.detectIndentation=!("indent_style"in e)||!("indent_size"in e),"indent_size"in e&&(t.indentSize=Number(e.indent_size)),"tab_width"in e&&(t.tabSize=Number(e.tab_width)||Number(e.indent_size)),"max_line_length"in e&&(t.rulers=[Number(e.max_line_length)]),t.trimAutoWhitespace=e.trim_trailing_whitespace===!0,t.insertSpaces=e.indent_style==="space",t.useTabStops=e.indent_style==="tab",t}const{i18n:ch}=window.config;function Wu({header:e="",content:t="",confirmButtonColor:i="primary"}={}){return new Promise(n=>{const s=e?`<div class="header">${R(e)}</div>`:"",l=(0,C.SL)(`
./output/git.buildapp.eu.org_run/git.buildapp.eu.org_2_login_page.html:329:_Originally posted by @${u} in ${m}_`,(0,ke.mD)(A).modal("show")})}function q0(){(0,C.jB)(document,".title_wip_desc > a",e=>e.addEventListener("click",t=>{t.preventDefault();const i=JSON.parse(e.closest(".title_wip_desc").getAttribute("data-wip-prefixes")),n=document.querySelector("#issue_title"),s=n.value;for(const l of i)if(s.startsWith(l.toUpperCase()))return;n.value=`${i[0]} ${s}`}))}function P0(){(0,C.jB)(document,".toggle-wip",e=>e.addEventListener("click",async t=>{t.preventDefault();const i=e,n=i.getAttribute("data-title"),s=i.getAttribute("data-wip-prefix"),l=i.getAttribute("data-update-url");try{const u=new URLSearchParams;if(u.append("title",n?.startsWith(s)?n.slice(s.length).trim():`${s.trim()} ${n}`),!(await(0,Ae.LO)(l,{data:u})).ok)throw new Error("Failed to toggle WIP status");window.location.reload()}catch(u){console.error(u)}}))}function F0(){const e=document.querySelector("#issue-title-display"),t=document.querySelector("#issue-title-editor");if(!t)return;const i=t.querySelector("input"),n=i.getAttribute("data-old-title");e.querySelector("#issue-title-edit-show").addEventListener("click",()=>{(0,C.y9)(e),(0,C.y9)("#pull-desc-display"),(0,C.fi)(t),(0,C.fi)("#pull-desc-editor"),i.value.trim()||(i.value=n),i.focus()}),t.querySelector(".ui.cancel.button").addEventListener("click",()=>{(0,C.y9)(t),(0,C.y9)("#pull-desc-editor"),(0,C.fi)(e),(0,C.fi)("#pull-desc-display")});const l=document.querySelector("#pull-desc-editor")?.getAttribute("data-target-update-url"),u=t.querySelector(".ui.primary.button");t.addEventListener("submit",async m=>{m.preventDefault();const y=i.value.trim();try{if(y&&y!==n){const A=await(0,Ae.LO)(u.getAttribute("data-update-url"),{data:new URLSearchParams({title:y})});if(!A.ok)throw new Error(`Failed to update issue title: ${A.statusText}`)}if(l){const A=document.querySelector("#pull-target-branch").getAttribute("data-branch"),L=document.querySelector("#branch_target").textContent;if(A!==L){const z=await(0,Ae.LO)(l,{data:new URLSearchParams({target_branch:A})});if(!z.ok)throw new Error(`Failed to update PR target branch: ${z.statusText}`)}}Ku(t),window.location.reload()}catch(A){console.error(A),gt(A.message)}})}function I0(){document.querySelector("#branch-select")?.addEventListener("click",e=>{const t=e.target.closest(".item[data-branch]");if(!t)return;const i=document.querySelector("#pull-target-branch"),n=i.getAttribute("data-basename"),s=t.getAttribute("data-branch"),l=i.getAttribute("data-branch");i.textContent=i.textContent.replace(`${n}:${l}`,`${n}:${s}`),i.setAttribute("data-branch",s)})}async function N0(e){const t=await ma(e.querySelector(".combo-markdown-editor")),i=document.querySelector("#status-button"),n=document.querySelector("#comment-button"),s=()=>{const l=t.value().trim(),u=t.isUploading();i&&(i.textContent=i.getAttribute(l?"data-status-and-comment":"data-status"),i.disabled=u),n&&(n.disabled=!l||u)};t.container.addEventListener(ha.EventUploadStateChanged,s),t.container.addEventListener(ha.EventEditorContentChanged,s),s()}function H0(e){const t=e.querySelectorAll(".combo-editor-dropzone"),i=async n=>{const s=n.querySelector(".form-field-real"),l=n.querySelector(".form-field-dropzone"),u=n.querySelector(".combo-markdown-editor"),m=await ma(u);m.container.addEventListener(ha.EventEditorContentChanged,()=>s.value=m.value()),s.addEventListener("focus",async()=>{(0,C.fi)(e.querySelectorAll(".combo-editor-dropzone .form-field-real")),(0,C.y9)(e.querySelectorAll(".combo-editor-dropzone .combo-markdown-editor")),(0,C.jB)(e,".combo-editor-dropzone .form-field-dropzone",y=>{const L=y.querySelector(".dropzone").dropzone.files.length!==0;(0,C.oi)(y,L)}),(0,C.y9)(s),(0,C.fi)(u),(0,C.fi)(l),await m.switchToUserPreference(),m.focus()})};for(const n of t)i(n)}function B0(){const e=document.querySelector(".comment.form");e&&(e.querySelector(".field.combo-editor-dropzone")?H0(e):e.querySelector(".combo-markdown-editor")&&N0(e),E0())}function $0(){_c("click","onRepoEllipsisButtonClick",async(e,t)=>{t.preventDefault();const i=e.getAttribute("aria-expanded")==="true";(0,C.oi)(e.parentElement.querySelector(".commit-body")),e.setAttribute("aria-expanded",String(!i))})}function U0(){Ha("initCommitStatuses",e=>{const t=e.nextElementSibling;if(!t.matches(".tippy-target"))throw new Error("Expected next element to be a tippy target");Ie(e,{content:t,placement:"bottom-start",interactive:!0,role:"dialog",theme:"box-with-header"})})}const{appSubUrl:ph}=window.config;function V0(){const e=document.querySelector("#manage_topic");if(!e)return;const t=document.querySelector("#topic_edit"),i=document.querySelector("#repo-topics"),n=t.querySelector(".ui.dropdown");let s;e.addEventListener("click",()=>{(0,C.y9)([i,e]),(0,C.fi)(t),n.querySelector("input.search").focus()}),document.querySelector("#cancel_topic_edit").addEventListener("click",()=>{s?.hideToast(),(0,C.y9)(t),(0,C.fi)([i,e]),e.focus()}),document.querySelector("#save_topic").addEventListener("click",async l=>{s?.hideToast();const u=t.querySelector("input[name=topics]").value,m=new FormData;m.append("topics",u);const y=await(0,Ae.LO)(l.target.getAttribute("data-link"),{data:m});if(y.ok){if((await y.json()).status==="ok"){if((0,C.xP)(i,".repo-topic",L=>L.remove()),u.length){const L=u.split(",");L.sort();for(const z of L){const X=document.createElement("a");X.classList.add("repo-topic","ui","large","label","gt-ellipsis"),X.href=`${ph}/explore/repos?q=${encodeURIComponent(z)}&topic=1`,X.textContent=z,i.append(X)}}(0,C.y9)(t),(0,C.fi)([i,e])}}else if(y.status===422){const A=await y.json();if(s=gt(A.message,{duration:5e3}),A.invalidTopics&&A.invalidTopics.length>0){const{invalidTopics:L}=A,z=(0,C.xP)(n,"a.ui.label");for(const[X,_e]of u.split(",").entries())L.includes(_e)&&(z[X].classList.remove("green"),z[X].classList.add("red"))}}}),(0,ke.mD)(n).dropdown({allowAdditions:!0,forceSelection:!1,fullTextSearch:"exact",fields:{name:"description",value:"data-value"},saveRemoteData:!1,label:{transition:"horizontal flip",duration:200,variation:!1},apiSettings:{url:`${ph}/explore/topics/search?q={query}`,throttle:500,cache:!1,onResponse(l){const u={success:!1,results:[]},m=(0,St.Kq)(this.urlData.query.trim());let y=!1;const A=[];for(const L of(0,C.xP)(n,"a.ui.label.visible"))A.push(L.getAttribute("data-value"));if(l.topics){let L=!1;for(const{topic_name:z}of l.topics)A.includes(z)||(z.toLowerCase()===m.toLowerCase()&&(y=!0),u.results.push({description:z,"data-value":z}),L=!0);u.success=L}return m.length>0&&!y?(u.success=!0,u.results.unshift({description:m,"data-value":m})):m.length>0&&y&&u.results.sort((L,z)=>L.description.toLowerCase()===m.toLowerCase()?-1:z.description.toLowerCase()===m.toLowerCase()?1:L.description>z.description?-1:L.description<z.description?1:0),u}},onLabelCreate(l){return l=l.toLowerCase().trim(),this.attr("data-value",l).contents().first().replaceWith(l),(0,ke.mD)(this)},onAdd(l,u,m){l=l.toLowerCase().trim(),m[0].setAttribute("data-value",l),m[0].setAttribute("data-text",l)}})}const{appSubUrl:W0}=window.config;function Qu(){Number(document.querySelector("#security_protocol")?.value)>0?(0,C.fi)(".has-tls"):(0,C.y9)(".has-tls")}function z0(){document.querySelector(".page-content.admin")&&(hf(),K0(),X0(),G0())}function K0(){document.querySelector(".page-content.admin.edit.user, .page-content.admin.new.user")&&document.querySelector("#login_type")?.addEventListener("change",function(){this.value?.startsWith("0")?(document.querySelector("#user_name")?.removeAttribute("disabled"),document.querySelector("#login_name")?.removeAttribute("required"),(0,C.y9)(".non-local"),(0,C.fi)(".local"),document.querySelector("#user_name")?.focus(),this.getAttribute("data-password")==="required"&&document.querySelector("#password")?.setAttribute("required","required")):(document.querySelector(".admin.edit.user")&&document.querySelector("#user_name")?.setAttribute("disabled","disabled"),document.querySelector("#login_name")?.setAttribute("required","required"),(0,C.fi)(".non-local"),(0,C.y9)(".local"),document.querySelector("#login_name")?.focus(),document.querySelector("#password")?.removeAttribute("required"))})}function X0(){const e=document.querySelector(".page-content.admin.authentication");if(!e)return;const t=e.classList.contains("new"),i=e.classList.contains("edit");if(!t&&!i)return;function n(){const L=document.querySelectorAll(".search-page-size");if(document.querySelector("#use_paged_search").checked){(0,C.fi)(".search-page-size");for(const z of L)z.querySelector("input")?.setAttribute("required","required")}else{(0,C.y9)(".search-page-size");for(const z of L)z.querySelector("input")?.removeAttribute("required")}}function s(L){(0,C.y9)(".open_id_connect_auto_discovery_url, .oauth2_use_custom_url");for(const X of document.querySelectorAll(".open_id_connect_auto_discovery_url input[required]"))X.removeAttribute("required");const z=document.querySelector("#oauth2_provider").value;switch(z){case"openidConnect":document.querySelector(".open_id_connect_auto_discovery_url input").setAttribute("required","required"),(0,C.fi)(".open_id_connect_auto_discovery_url");break;default:{const X=document.querySelector(`#${z}_customURLSettings`);if(!X)break;const _e=X.getAttribute("data-available")==="true",pe=X.getAttribute("data-required")==="true";_e&&(0,C.fi)(".oauth2_use_custom_url"),pe&&(document.querySelector("#oauth2_use_custom_url").checked=!0);break}}l(L)}function l(L){const z=document.querySelector("#oauth2_provider").value;(0,C.y9)(".oauth2_use_custom_url_field");for(const _e of document.querySelectorAll(".oauth2_use_custom_url_field input[required]"))_e.removeAttribute("required");if(document.querySelector(`#${z}_customURLSettings`)&&document.querySelector("#oauth2_use_custom_url").checked)for(const _e of["token_url","auth_url","profile_url","email_url","tenant"]){L&&(document.querySelector(`#oauth2_${_e}`).value=document.querySelector(`#${z}_${_e}`).value);const pe=document.querySelector(`#${z}_${_e}`);if(pe&&pe.getAttribute("data-available")==="true"){for(const de of document.querySelectorAll(`.oauth2_${_e} input`))de.setAttribute("required","required");(0,C.fi)(`.oauth2_${_e}`)}}}function u(){const L=document.querySelector(".js-ldap-group-toggle")?.checked;(0,C.oi)(document.querySelector("#ldap-group-options"),L)}const m=document.querySelector("#auth_type");if(t){const L=function(){(0,C.y9)(".ldap, .dldap, .smtp, .pam, .oauth2, .has-tls, .search-page-size, .sspi");for(const X of document.querySelectorAll(".ldap input[required], .binddnrequired input[required], .dldap input[required], .smtp input[required], .pam input[required], .oauth2 input[required], .has-tls input[required], .sspi input[required]"))X.removeAttribute("required");document.querySelector(".binddnrequired")?.classList.remove("required");const z=m.value;switch(z){case"2":(0,C.fi)(".ldap");for(const X of document.querySelectorAll(".binddnrequired input, .ldap div.required:not(.dldap) input"))X.setAttribute("required","required");document.querySelector(".binddnrequired")?.classList.add("required");break;case"3":(0,C.fi)(".smtp"),(0,C.fi)(".has-tls");for(const X of document.querySelectorAll(".smtp div.required input, .has-tls"))X.setAttribute("required","required");break;case"4":(0,C.fi)(".pam");for(const X of document.querySelectorAll(".pam input"))X.setAttribute("required","required");break;case"5":(0,C.fi)(".dldap");for(const X of document.querySelectorAll(".dldap div.required:not(.ldap) input"))X.setAttribute("required","required");break;case"6":(0,C.fi)(".oauth2");for(const X of document.querySelectorAll(".oauth2 div.required:not(.oauth2_use_custom_url,.oauth2_use_custom_url_field,.open_id_connect_auto_discovery_url) input"))X.setAttribute("required","required");s(!0);break;case"7":(0,C.fi)(".sspi");for(const X of document.querySelectorAll(".sspi div.required input"))X.setAttribute("required","required");break}(z==="2"||z==="5")&&(Qu(),u()),z==="2"&&n()};m.addEventListener("change",L),L(),document.querySelector("#security_protocol")?.addEventListener("change",Qu),document.querySelector("#use_paged_search")?.addEventListener("change",n),document.querySelector("#oauth2_provider")?.addEventListener("change",()=>s(!0)),document.querySelector("#oauth2_use_custom_url")?.addEventListener("change",()=>l(!0)),document.querySelector(".js-ldap-group-toggle").addEventListener("change",u)}if(i){const L=m.value;L==="2"||L==="5"?(document.querySelector("#security_protocol")?.addEventListener("change",Qu),document.querySelector(".js-ldap-group-toggle").addEventListener("change",u),u(),L==="2"&&document.querySelector("#use_paged_search")?.addEventListener("change",n)):L==="6"&&(document.querySelector("#oauth2_provider")?.addEventListener("change",()=>s(!0)),document.querySelector("#oauth2_use_custom_url")?.addEventListener("change",()=>l(!1)),s(!1))}const y=document.querySelector("#auth_name"),A=function(){document.querySelector("#oauth2-callback-url").textContent=`${window.location.origin}${W0}/user/oauth2/${encodeURIComponent(y.value)}/callback`};y.addEventListener("input",A),A()}function G0(){const e=document.querySelector(".page-content.admin.notice");if(!e)return;const t=document.querySelector("#detail-modal");(0,C.jB)(e,".view-detail",n=>n.addEventListener("click",s=>{s.preventDefault();const l=n.closest("tr").querySelector(".notice-description"),u=t.querySelector(".content pre");u.textContent=l.textContent,(0,ke.mD)(t).modal("show")}));const i=document.querySelectorAll(".select.table .ui.checkbox input");(0,C.jB)(e,".select.action",n=>n.addEventListener("click",()=>{switch(n.getAttribute("data-action")){case"select-all":for(const s of i)s.checked=!0;break;case"deselect-all":for(const s of i)s.checked=!1;break;case"inverse":for(const s of i)s.checked=!s.checked;break}})),document.querySelector("#delete-selection")?.addEventListener("click",async function(n){n.preventDefault(),this.classList.add("is-loading","disabled");const s=new FormData;for(const l of i)l.checked&&s.append("ids[]",l.closest(".ui.checkbox").getAttribute("data-id"));await(0,Ae.LO)(this.getAttribute("data-link"),{data:s}),window.location.href=this.getAttribute("data-redirect")})}function Q0(e){window.history.pushState?window.history.pushState(null,null,e):window.location.hash=e}function Yu(e){for(const pe of document.querySelectorAll(".code-view tr.active"))pe.classList.remove("active");const t=document.querySelectorAll(".code-view td.lines-num span[data-line-number]"),i=document.querySelector("a.ref-in-new-issue"),n=document.querySelector("a.copy-line-permalink"),s=document.querySelector("a.view_git_blame"),l=function(pe){if(!i)return;const de=i.getAttribute("data-url-issue-new"),Pe=i.getAttribute("data-url-param-body-link"),Le=`${(0,St.oK)(Pe)}#${pe}`;i.setAttribute("href",`${de}?body=${encodeURIComponent(Le)}`)},u=function(pe){if(!s)return;let de=s.getAttribute("href");de=`${de.replace(/#L\d+$|#L\d+-L\d+$/,"")}`,pe.length!==0&&(de=`${de}#${pe}`),s.setAttribute("href",de)},m=function(pe){if(!n)return;let de=n.getAttribute("data-url");de=`${de.replace(/#L\d+$|#L\d+-L\d+$/,"")}#${pe}`,n.setAttribute("data-clipboard-text",de),n.setAttribute("data-clipboard-text-type","url")},y=e?e.split("-"):[],A=y[0]??"";if(!A)return null;const L=y[1]||A;let z=parseInt(A.substring(1)),X=parseInt(L.substring(1));if(z>X){const pe=z;z=X,X=pe,e=`${L}-${A}`}const _e=t[z-1]??null;for(let pe=z-1;pe<=X-1&&pe<t.length;pe++)t[pe].closest("tr").classList.add("active");return Q0(`#${e}`),l(e),u(e),m(e),_e}function gh(){const e=document.querySelector(".code-line-menu");if(!e)return;for(const s of document.querySelectorAll(".code-line-button"))s.remove();const t=document.querySelector(".code-view tr.active");if(!t)return;const i=t.querySelector("td.lines-num"),n=document.createElement("button");n.classList.add("code-line-button","ui","basic","button"),n.innerHTML=(0,Z.JW)("octicon-kebab-horizontal"),i.prepend(n),n.closest(".code-view").append(e.cloneNode(!0)),Ie(n,{theme:"menu",trigger:"click",hideOnClick:!0,content:e,placement:"right-start",interactive:!0,onShow:s=>{s.popper.addEventListener("click",()=>{s.hide()},{once:!0})}})}function Y0(){if(!document.querySelector(".repo-view-container .file-view"))return;let e;(0,C.ny)(document,"click",".code-view .lines-num span",(i,n)=>{if(!e||!n.shiftKey)e=i.getAttribute("id"),Yu(e);else{const s=i.getAttribute("id");Yu(`${e}-${s}`)}window.getSelection().removeAllRanges(),gh()});const t=()=>{if(!window.location.hash||!document.querySelector(".code-view .lines-num"))return;const i=window.location.hash.substring(1),n=Yu(i);n&&(window.history.scrollRestoration!=="manual"&&(window.history.scrollRestoration="manual"),n.scrollIntoView({block:"start"}),gh())};t(),window.addEventListener("hashchange",t)}function J0(){document.querySelector("#ssh-key-content")?.addEventListener("input",function(){const e=this.value.split(" "),t=document.querySelector("#ssh-key-title");!t.value&&e.length===3&&e[2]!==""&&(t.value=e[2])})}function Z0(){if(!document.querySelector(".user.settings.profile"))return;const e=document.querySelector("#username");e&&e.addEventListener("input",function(){const t=document.querySelector("#name-change-prompt"),i=document.querySelector("#name-change-redirect-prompt");this.value.toLowerCase()!==this.getAttribute("data-name").toLowerCase()?((0,C.fi)(t),(0,C.fi)(i)):((0,C.y9)(t),(0,C.y9)(i))})}function ev(){const e=document.querySelector("#repo_migrating");if(!e)return;document.querySelector("#repo_migrating_retry")?.addEventListener("click",tv);const t=e.getAttribute("data-migrating-repo-link"),i=async()=>{const s=await(0,Ae.fG)(`${t}/-/migrate/status`);if(s.status!==200)return!0;const l=await s.json();return l.message&&(document.querySelector("#repo_migrating_progress_message").textContent=l.message),l.status===4?(window.location.reload(),!1):l.status===3?((0,C.y9)("#repo_migrating_progress"),(0,C.y9)("#repo_migrating"),(0,C.fi)("#repo_migrating_retry"),(0,C.fi)("#repo_migrating_failed"),(0,C.fi)("#repo_migrating_failed_image"),document.querySelector("#repo_migrating_failed_error").textContent=l.message,!1):!0},n=async()=>{let s=!0;try{s=await i()}finally{s&&setTimeout(n,2e3)}};n()}async function tv(e){await(0,Ae.LO)(e.target.getAttribute("data-migrating-task-retry-url")),window.location.reload()}const{pageData:Ju}=window.config;let Zu;function ed(){return Zu||(Zu=nv(Ju.DiffFileTree,Ju.FolderIcon,Ju.FolderOpenIcon)),Zu}function iv(e,t,i){const n=e.fullNameMap[t];if(n){n.IsViewed=i;for(let s=n.ParentEntry;s;s=s.ParentEntry)s.IsViewed=bh(s)}}function vh(e,t){if(e[t.FullName]=t,!!t.Children){t.IsViewed=bh(t);for(const i of t.Children)i.ParentEntry=t,vh(e,i)}}function nv(e,t,i){const n=(0,Re.Kh)({diffFileTree:e,folderIcon:t,folderOpenIcon:i,fileTreeIsVisible:!1,selectedItem:"",fullNameMap:{}});return vh(n.fullNameMap,e.TreeRoot),n}function bh(e){if(e.Children){let t=0;for(const i of e.Children)i.IsViewed&&t++;return t===e.Children.length}return e.IsViewed}const sv=["title"],rv=["innerHTML"],ov={class:"gt-ellipsis"},av={class:"sub-items"},lv=["title","href"],cv=["innerHTML"],uv={class:"gt-ellipsis tw-flex-1"};var dv=(0,c.pM)({__name:"DiffFileTreeItem",props:{item:{}},setup(e){const t=e,i=ed(),n=(0,Re.KR)(t.item.IsViewed);function s(l){const u={"":{name:"octicon-blocked",classes:["text","red"]},added:{name:"octicon-diff-added",classes:["text","green"]},modified:{name:"octicon-diff-modified",classes:["text","yellow"]},deleted:{name:"octicon-diff-removed",classes:["text","red"]},renamed:{name:"octicon-diff-renamed",classes:["text","teal"]},copied:{name:"octicon-diff-renamed",classes:["text","green"]},typechange:{name:"octicon-diff-modified",classes:["text","green"]}};return u[l]??u[""]}return(l,u)=>{const m=(0,c.g2)("DiffFileTreeItem",!0);return l.item.EntryMode==="tree"?((0,c.uX)(),(0,c.CE)(c.FK,{key:0},[(0,c.Lk)("div",{class:(0,W.C4)(["item-directory",{viewed:l.item.IsViewed}]),title:l.item.DisplayName,onClick:u[0]||(u[0]=Di(y=>n.value=!n.value,["stop"]))},[(0,c.Q3)(" directory "),(0,c.bF)((0,Re.R1)(Z.Ah),{name:n.value?"octicon-chevron-right":"octicon-chevron-down"},null,8,["name"]),(0,c.Q3)(" eslint-disable-next-line vue/no-v-html "),(0,c.Lk)("span",{class:"tw-contents",innerHTML:n.value?(0,Re.R1)(i).folderIcon:(0,Re.R1)(i).folderOpenIcon},null,8,rv),(0,c.Lk)("span",ov,(0,W.v_)(l.item.DisplayName),1)],10,sv),(0,c.bo)((0,c.Lk)("div",av,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(l.item.Children,y=>((0,c.uX)(),(0,c.Wv)(m,{key:y.DisplayName,item:y},null,8,["item"]))),128))],512),[[ti,!n.value]])],64)):((0,c.uX)(),(0,c.CE)("a",{key:1,class:(0,W.C4)(["item-file",{selected:(0,Re.R1)(i).selectedItem==="#diff-"+l.item.NameHash,viewed:l.item.IsViewed}]),title:l.item.DisplayName,href:"#diff-"+l.item.NameHash},[(0,c.Q3)(" file "),(0,c.Q3)(" eslint-disable-next-line vue/no-v-html "),(0,c.Lk)("span",{class:"tw-contents",innerHTML:l.item.FileIcon},null,8,cv),(0,c.Lk)("span",uv,(0,W.v_)(l.item.DisplayName),1),(0,c.bF)((0,Re.R1)(Z.Ah),{name:s(l.item.DiffStatus).name,class:(0,W.C4)(s(l.item.DiffStatus).classes)},null,8,["name","class"])],10,lv))}}}),fv=(0,Xi.A)(dv,[["__scopeId","data-v-a138c97c"]]);const hv={key:0,class:"diff-file-tree-items"},_h="diff_file_tree_visible";var mv=(0,c.pM)({__name:"DiffFileTree",setup(e){const t=ed();(0,c.sV)(()=>{t.fileTreeIsVisible=localStorage.getItem(_h)!=="false",document.querySelector(".diff-toggle-file-tree-button").addEventListener("click",s),i(),window.addEventListener("hashchange",i)}),(0,c.hi)(()=>{document.querySelector(".diff-toggle-file-tree-button").removeEventListener("click",s),window.removeEventListener("hashchange",i)});function i(){t.selectedItem=window.location.hash,n()}function n(){if(t.selectedItem){const m=document.querySelector(t.selectedItem);m?.getAttribute("data-folded")==="true"&&Ba(m,m.querySelector(".fold-file"),!1)}}function s(){l(!t.fileTreeIsVisible)}function l(m){t.fileTreeIsVisible=m,localStorage.setItem(_h,t.fileTreeIsVisible.toString()),u(t.fileTreeIsVisible)}function u(m){const y=document.querySelector(".diff-toggle-file-tree-button"),[A,L]=y.querySelectorAll(".icon"),z=document.querySelector("#diff-file-tree"),X=y.getAttribute(m?"data-hide-text":"data-show-text");y.setAttribute("data-tooltip-content",X),(0,C.oi)(z,m),(0,C.oi)(A,!m),(0,C.oi)(L,m)}return(m,y)=>(0,Re.R1)(t).fileTreeIsVisible?((0,c.uX)(),(0,c.CE)("div",hv,[(0,c.Q3)(" only render the tree if we're visible. in many cases this is something that doesn't change very often "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,Re.R1)(t).diffFileTree.TreeRoot.Children,A=>((0,c.uX)(),(0,c.Wv)(fv,{key:A.FullName,item:A},null,8,["item"]))),128))])):(0,c.Q3)("v-if",!0)}}),pv=(0,Xi.A)(mv,[["__scopeId","data-v-12a35ef6"]]);function gv(){const e=document.querySelector("#diff-file-tree");if(!e)return;Ai(pv).mount(e)}const vv={class:"ui scrolling dropdown custom diff-commit-selector"},bv=["data-tooltip-content","aria-label","aria-controls","aria-activedescendant"],_v=["id","aria-expanded"],yv={key:0,class:"loading-indicator is-loading"},wv=["id"],Sv={class:"gt-ellipsis"},xv={class:"gt-ellipsis text light-2 tw-mb-0"},jv={class:"gt-ellipsis"},Ev={class:"gt-ellipsis text light-2"},Av={key:3,class:"info text light-2"},Cv=["data-commit-idx","onKeydown","onMouseover","onClick"],kv={class:"tw-flex-1 tw-flex tw-flex-col tw-gap-1"},Tv={class:"gt-ellipsis commit-list-summary"},Lv={class:"gt-ellipsis text light-2"},Rv={class:"text right"},Mv=["datetime"],Dv={class:"tw-font-mono"};function Ov(e,t,i,n,s,l){const u=(0,c.g2)("svg-icon");return(0,c.uX)(),(0,c.CE)("div",vv,[(0,c.Lk)("button",{ref:"expandBtn",class:"ui tiny basic button",onClick:t[0]||(t[0]=Di(m=>e.toggleMenu(),["stop"])),"data-tooltip-content":e.locale.filter_changes_by_commit,"aria-haspopup":"true","aria-label":e.locale.filter_changes_by_commit,"aria-controls":e.uniqueIdMenu,"aria-activedescendant":e.uniqueIdShowAll},[(0,c.bF)(u,{name:"octicon-git-commit"})],8,bv),(0,c.Q3)(' this dropdown is not managed by Fomantic UI, so it needs some classes like "transition" explicitly '),(0,c.bo)((0,c.Lk)("div",{class:(0,W.C4)(["left menu transition",{visible:e.menuVisible}]),id:e.uniqueIdMenu,"aria-expanded":e.menuVisible?"true":"false"},[e.isLoading?((0,c.uX)(),(0,c.CE)("div",yv)):(0,c.Q3)("v-if",!0),e.isLoading?(0,c.Q3)("v-if",!0):((0,c.uX)(),(0,c.CE)("div",{key:1,class:"item",id:e.uniqueIdShowAll,ref:"showAllChanges",role:"menuitem",onKeydown:t[1]||(t[1]=se(m=>e.showAllChanges(),["enter"])),onClick:t[2]||(t[2]=m=>e.showAllChanges())},[(0,c.Lk)("div",Sv,(0,W.v_)(e.locale.show_all_commits),1),(0,c.Lk)("div",xv,(0,W.v_)(e.locale.stats_num_commits),1)],40,wv)),(0,c.Q3)(" only show the show changes since last review if there is a review AND we are commits ahead of the last review "),e.lastReviewCommitSha!=null?((0,c.uX)(),(0,c.CE)("div",{key:2,class:(0,W.C4)(["item",{disabled:!e.commitsSinceLastReview}]),role:"menuitem",onKeydown:t[3]||(t[3]=se(m=>e.changesSinceLastReviewClick(),["enter"])),onClick:t[4]||(t[4]=m=>e.changesSinceLastReviewClick())},[(0,c.Lk)("div",jv,(0,W.v_)(e.locale.show_changes_since_your_last_review),1),(0,c.Lk)("div",Ev,(0,W.v_)(e.commitsSinceLastReview)+" commits ",1)],34)):(0,c.Q3)("v-if",!0),e.isLoading?(0,c.Q3)("v-if",!0):((0,c.uX)(),(0,c.CE)("span",Av,(0,W.v_)(e.locale.select_commit_hold_shift_for_range),1)),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.commits,(m,y)=>((0,c.uX)(),(0,c.CE)("div",{key:m.id,class:(0,W.C4)(["item",{selected:m.selected,hovered:m.hovered}]),role:"menuitem","data-commit-idx":y,onKeydown:[se(Di(A=>e.commitClicked(m.id),["exact"]),["enter"]),se(Di(A=>e.commitClickedShift(m),["shift","exact"]),["enter"])],onMouseover:Di(A=>e.highlight(m),["shift"]),onClick:[Di(A=>e.commitClicked(m.id),["exact"]),Di(A=>e.commitClicked(m.id,!0),["ctrl","exact"]),Di(A=>e.commitClicked(m.id,!0),["meta","exact"]),Di(A=>e.commitClickedShift(m),["shift","exact","stop","prevent"])]},[(0,c.Lk)("div",kv,[(0,c.Lk)("div",Tv,(0,W.v_)(m.summary),1),(0,c.Lk)("div",Lv,[(0,c.eW)((0,W.v_)(m.committer_or_author_name)+" ",1),(0,c.Lk)("span",Rv,[(0,c.Q3)(" TODO: make this respect the PreferredTimestampTense setting "),(0,c.Lk)("relative-time",{prefix:"",datetime:m.time,"data-tooltip-content":"","data-tooltip-interactive":"true"},(0,W.v_)(m.time),9,Mv)])])]),(0,c.Lk)("div",Dv,(0,W.v_)(m.short_sha),1)],42,Cv))),128))],10,_v),[[ti,e.menuVisible]])])}var qv=(0,c.pM)({components:{SvgIcon:Z.Ah},data:()=>{const e=document.querySelector("#diff-commit-select");return{menuVisible:!1,isLoading:!1,queryParams:e.getAttribute("data-queryparams"),issueLink:e.getAttribute("data-issuelink"),locale:{filter_changes_by_commit:e.getAttribute("data-filter_changes_by_commit")},mergeBase:e.getAttribute("data-merge-base"),commits:[],hoverActivated:!1,lastReviewCommitSha:"",uniqueIdMenu:(0,ke.Ae)(),uniqueIdShowAll:(0,ke.Ae)()}},computed:{commitsSinceLastReview(){return this.lastReviewCommitSha?this.commits.length-this.commits.findIndex(e=>e.id===this.lastReviewCommitSha)-1:0}},mounted(){document.body.addEventListener("click",this.onBodyClick),this.$el.addEventListener("keydown",this.onKeyDown),this.$el.addEventListener("keyup",this.onKeyUp)},unmounted(){document.body.removeEventListener("click",this.onBodyClick),this.$el.removeEventListener("keydown",this.onKeyDown),this.$el.removeEventListener("keyup",this.onKeyUp)},methods:{onBodyClick(e){this.$el.contains(e.target)||this.menuVisible&&this.toggleMenu()},onKeyDown(e){if(!this.menuVisible)return;const t=document.activeElement;if(this.$el.contains(t)){switch(e.key){case"ArrowDown":e.preventDefault(),this.focusElem(t.nextElementSibling,t);break;case"ArrowUp":e.preventDefault(),this.focusElem(t.previousElementSibling,t);break;case"Escape":e.preventDefault(),t.tabIndex=-1,this.toggleMenu();break}if(e.key==="ArrowDown"||e.key==="ArrowUp"){const i=document.activeElement,n=i?.matches(".item")?i.getAttribute("data-commit-idx"):null;n&&this.highlight(this.commits[Number(n)])}}},onKeyUp(e){if(!this.menuVisible)return;const t=document.activeElement;if(this.$el.contains(t)&&e.key==="Shift"&&this.hoverActivated){this.hoverActivated=!1;for(const i of this.commits)i.hovered=!1,i.selected=!1}},highlight(e){if(!this.hoverActivated)return;const t=this.commits.findIndex(n=>n.selected),i=this.commits.findIndex(n=>n.id===e.id);for(const[n,s]of this.commits.entries())s.hovered=Math.min(t,i)<=n&&n<=Math.max(t,i)},focusElem(e,t){e&&(e.tabIndex=0,t&&(t.tabIndex=-1),e.focus())},async toggleMenu(){if(this.menuVisible=!this.menuVisible,!this.commits.length&&this.menuVisible&&!this.isLoading){this.isLoading=!0;try{await this.fetchCommits()}finally{this.isLoading=!1}}this.$nextTick(()=>{this.menuVisible?this.focusElem(this.$refs.showAllChanges,this.$refs.expandBtn):this.focusElem(this.$refs.expandBtn,this.$refs.showAllChanges)})},async fetchCommits(){const t=await(await(0,Ae.fG)(`${this.issueLink}/commits/list`)).json();this.commits.push(...t.commits.map(i=>(i.hovered=!1,i))),this.commits.reverse(),this.lastReviewCommitSha=t.last_review_commit_sha||null,this.lastReviewCommitSha&&!this.commits.some(i=>i.id===this.lastReviewCommitSha)&&(this.lastReviewCommitSha=null),Object.assign(this.locale,t.locale)},showAllChanges(){window.location.assign(`${this.issueLink}/files${this.queryParams}`)},changesSinceLastReviewClick(){window.location.assign(`${this.issueLink}/files/${this.lastReviewCommitSha}..${this.commits.at(-1).id}${this.queryParams}`)},commitClicked(e,t=!1){const i=`${this.issueLink}/commits/${e}${this.queryParams}`;t?window.open(i):window.location.assign(i)},commitClickedShift(e){if(this.hoverActivated=!this.hoverActivated,e.selected=!0,!this.hoverActivated){const t=this.commits.findIndex(l=>l.selected),i=this.commits.findLastIndex(l=>l.selected);let n;t===0?n=this.mergeBase:n=this.commits[t-1].id;const s=this.commits[i].id;t===i?window.location.assign(`${this.issueLink}/commits/${s}${this.queryParams}`):n===this.mergeBase&&s===this.commits.at(-1).id?window.location.assign(`${this.issueLink}/files${this.queryParams}`):window.location.assign(`${this.issueLink}/files/${n}..${s}${this.queryParams}`)}}}}),Pv=(0,Xi.A)(qv,[["render",Ov],["__scopeId","data-v-c589fa0e"]]);function Fv(){const e=document.querySelector("#diff-commit-select");if(!e)return;Ai(Pv).mount(e)}const{pageData:Iv}=window.config,Ua=Iv.prReview||{},yh="viewed-file-checked-form",wh=".viewed-file-form",Nv="#expand-files-btn",Hv="#collapse-files-btn";function Sh(){document.querySelector("#viewed-files-summary")?.setAttribute("value",Ua.numberOfViewedFiles);const t=document.querySelector("#viewed-files-summary-label");t&&(t.innerHTML=t.getAttribute("data-text-changed-template").replace("%[1]d",Ua.numberOfViewedFiles).replace("%[2]d",Ua.numberOfFiles))}function Bv(){Ua.numberOfViewedFiles=document.querySelectorAll(`${wh} > input[type=checkbox][checked]`).length,Sh()}function xh(){for(const e of document.querySelectorAll(`${wh}:not([data-has-viewed-checkbox-listener="true"])`)){e.setAttribute("data-has-viewed-checkbox-listener",String(!0));const t=e.querySelector("input[type=checkbox]");t.addEventListener("input",function(){this.checked?(e.classList.add(yh),t.setAttribute("checked",""),Ua.numberOfViewedFiles++):(e.classList.remove(yh),t.removeAttribute("checked"),Ua.numberOfViewedFiles--),Sh(),e.parentNode.querySelector(".changed-since-last-review")?.remove();const n=t.getAttribute("name");iv(ed(),n,this.checked);const s={};s[n]=this.checked;const l={files:s},u=e.getAttribute("data-headcommit");u&&(l.headCommitSHA=u),(0,Ae.LO)(e.getAttribute("data-link"),{data:l});const m=e.closest(".diff-file-header");Ba(m.closest(".file-content"),m.querySelector(".fold-file"),this.checked)})}}function $v(){document.querySelector(Nv)?.addEventListener("click",()=>{for(const e of document.querySelectorAll('.file-content[data-folded="true"]'))Ba(e,e.querySelector(".fold-file"),!1)}),document.querySelector(Hv)?.addEventListener("click",()=>{for(const e of document.querySelectorAll('.file-content:not([data-folded="true"])'))e.getAttribute("id")!=="diff-incomplete"&&Ba(e,e.querySelector(".fold-file"),!0)})}const{i18n:Uv}=window.config;function Vv(e){(0,C.jB)(e,".file-view-toggle",t=>t.addEventListener("click",()=>{(0,C.D6)(t,".file-view-toggle",n=>n.classList.remove("active")),t.classList.add("active");const i=document.querySelector(t.getAttribute("data-toggle-selector"));if(!i)throw new Error("Target element not found");(0,C.y9)((0,C.D6)(i)),(0,C.fi)(i)}))}function Wv(){(0,C.ny)(document,"submit",".conversation-holder form",async(e,t)=>{t.preventDefault();const i=e.querySelector("textarea");if(hh(i)&&!e.classList.contains("is-loading"))try{e.classList.add("is-loading");const n=new FormData(e),s=(0,C.IU)(t);(s?.nodeName==="BUTTON"||s?.nodeName==="INPUT"&&s.type==="submit")&&s.name&&n.append(s.name,s.value);const u=e.closest("tr")?.getAttribute("data-line-type"),m=await(0,Ae.LO)(e.getAttribute("action"),{data:n}),y=(0,C.SL)(await m.text()),A=y.getAttribute("data-path"),L=y.getAttribute("data-side"),z=y.getAttribute("data-idx");if(e.closest(".conversation-holder").replaceWith(y),e=null,u){let X;u==="same"?X=`[data-path="${A}"] .add-code-comment[data-idx="${z}"]`:X=`[data-path="${A}"] .add-code-comment[data-side="${L}"][data-idx="${z}"]`;for(const _e of document.querySelectorAll(X))_e.classList.add("tw-invisible")}if(!s||s?.matches('button[name="pending_review"]')){const X=document.querySelector("#review-box"),_e=X?.querySelector(".review-comments-counter");if(!_e)return;const pe=parseInt(_e.getAttribute("data-pending-comment-number"))+1||1;_e.setAttribute("data-pending-comment-number",String(pe)),_e.textContent=String(pe),(0,C.b7)(X,"pulse-1p5-200")}}catch(n){console.error("Error:",n),gt(Uv.network_error)}finally{e?.classList.remove("is-loading")}}),(0,C.ny)(document,"click",".resolve-conversation",async(e,t)=>{t.preventDefault();const i=e.getAttribute("data-comment-id"),n=e.getAttribute("data-origin"),s=e.getAttribute("data-action"),l=e.getAttribute("data-update-url");try{const m=await(await(0,Ae.LO)(l,{data:new URLSearchParams({origin:n,action:s,comment_id:i})})).text(),y=e.closest(".conversation-holder");if(y){const A=(0,C.SL)(m);y.replaceWith(A)}else window.location.reload()}catch(u){console.error("Error:",u)}})}function zv(){(0,C.ny)(document,"click",".previous-conversation, .next-conversation",(e,t)=>{t.preventDefault();const i=e.matches(".previous-conversation"),n=e.closest(".comment-code-cloud"),s=document.querySelectorAll(".comment-code-cloud:not(.tw-hidden)"),l=Array.from(s).indexOf(n),u=l>0?l-1:s.length-1,m=l<s.length-1?l+1:0,L=s[i?u:m].querySelector(".comment").id;window.location.href=`#${L}`})}function jh(){for(const e of document.querySelectorAll(".diff-header-popup-btn:not([data-header-popup-initialized])")){e.setAttribute("data-header-popup-initialized","");const t=e.nextElementSibling;if(!t?.matches(".tippy-target"))throw new Error("Popup element not found");Ie(e,{content:t,theme:"menu",placement:"bottom",trigger:"click",interactive:!0,hideOnClick:!0})}}function Eh(){tf(),xh(),Bv(),Ld(),jh()}async function Ah(e){if(e.classList.contains("disabled"))return!1;e.classList.add("disabled");const t=e.getAttribute("data-href");try{const n=await(await(0,Ae.fG)(t)).text(),l=(0,St.a8)(n,"text/html").querySelector("#diff-file-boxes");return document.querySelector("#diff-incomplete").replaceWith(...Array.from(l.children)),Eh(),!0}catch(i){console.error("Error:",i),gt("An error occurred while loading more files.")}finally{e.classList.remove("disabled")}return!1}function Kv(){(0,C.ny)(document,"click","a#diff-show-more-files",(e,t)=>{t.preventDefault(),Ah(e)}),(0,C.ny)(document,"click","a.diff-load-button",async(e,t)=>{if(t.preventDefault(),e.classList.contains("disabled"))return;e.classList.add("disabled");const i=e.getAttribute("data-href");try{const s=await(await(0,Ae.fG)(i)).text(),u=(0,St.a8)(s,"text/html").querySelector("#diff-file-boxes .diff-file-body .file-body"),m=Array.from(u.children);e.parentElement.replaceWith(...m);for(const y of m)window.htmx.process(y);Eh()}catch(n){console.error("Error:",n)}finally{e.classList.remove("disabled")}})}async function Ch(){const e=window.location.hash;if(!(!e.startsWith("#diff-")&&!e.startsWith("#issuecomment-")))for(;;){const t=document.getElementById(e.substring(1));if(t){t.scrollIntoView();return}const i=document.querySelector("#diff-show-more-files");if(!i||!await Ah(i))return}}function Xv(){window.addEventListener("hashchange",Ch),Ch()}function Gv(){Wv(),document.querySelector("#diff-file-boxes")&&(zv(),gv(),Fv(),Kv(),jh(),xh(),$v(),Xv(),yc("#diff-file-boxes .diff-file-box",Vv),(0,C.ny)(document,"click",".fold-file",e=>{ng(e.closest(".file-content"),e)}))}const{appSubUrl:Qv}=window.config;function Yv(){const e=document.querySelector(".page-content.organization.new.team");e&&(0,C.jB)(e,"input[name=permission]",t=>t.addEventListener("change",()=>{const i=e.querySelector("input[name=permission]:checked")?.value;(0,C.oi)(e.querySelectorAll(".team-units"),i!=="admin")}))}function Jv(){const e=(0,ke.mD)("#search-repo-box");e.search({minCharacters:2,apiSettings:{url:`${Qv}/repo/search?q={query}&uid=${e.data("uid")}`,onResponse(t){const i=[];for(const n of t.data)i.push({title:n.repository.full_name.split("/")[1],description:n.repository.full_name});return{results:i}}},searchFields:["full_name"],showNoResults:!1})}function Zv(){document.querySelector(".page-content.organization")&&(Yv(),Jv())}const{appSubUrl:Mo}=window.config;async function eb(){const e=document.querySelector(".user.signin.webauthn-prompt"),t=document.querySelector(".signin-passkey");if(!(!e&&!t)){if(!window.isSecureContext){(0,C.y9)(t);return}Th()&&(t&&t.addEventListener("click",tb),e&&ib())}}async function tb(){const e=await(0,Ae.fG)(`${Mo}/user/webauthn/passkey/assertion`);if(!e.ok){Ds("unknown");return}const t=await e.json();t.publicKey.challenge=(0,St.vd)(t.publicKey.challenge);for(const i of t.publicKey.allowCredentials??[])i.id=(0,St.vd)(i.id);try{const i=await navigator.credentials.get({publicKey:t.publicKey}),n=i.response,s=new Uint8Array(n.authenticatorData),l=new Uint8Array(n.clientDataJSON),u=new Uint8Array(i.rawId),m=new Uint8Array(n.signature),y=new Uint8Array(n.userHandle),A=await(0,Ae.LO)(`${Mo}/user/webauthn/passkey/login`,{data:{id:i.id,rawId:(0,St.vh)(u),type:i.type,clientExtensionResults:i.getClientExtensionResults(),response:{authenticatorData:(0,St.vh)(s),clientDataJSON:(0,St.vh)(l),signature:(0,St.vh)(m),userHandle:(0,St.vh)(y)}}});if(A.status===500){Ds("unknown");return}else if(!A.ok){Ds("unable-to-process");return}const L=await A.json();window.location.href=L?.redirect??`${Mo}/`}catch(i){Ds("general",i.message)}}async function ib(){const e=await(0,Ae.fG)(`${Mo}/user/webauthn/assertion`);if(!e.ok){Ds("unknown");return}const t=await e.json();t.publicKey.challenge=(0,St.vd)(t.publicKey.challenge);for(const i of t.publicKey.allowCredentials??[])i.id=(0,St.vd)(i.id);try{const i=await navigator.credentials.get({publicKey:t.publicKey});await kh(i)}catch(i){if(!t.publicKey.extensions?.appid){Ds("general",i.message);return}delete t.publicKey.extensions.appid;try{const n=await navigator.credentials.get({publicKey:t.publicKey});await kh(n)}catch(n){Ds("general",n.message)}}}async function kh(e){const t=new Uint8Array(e.response.authenticatorData),i=new Uint8Array(e.response.clientDataJSON),n=new Uint8Array(e.rawId),s=new Uint8Array(e.response.signature),l=new Uint8Array(e.response.userHandle),u=await(0,Ae.LO)(`${Mo}/user/webauthn/assertion`,{data:{id:e.id,rawId:(0,St.vh)(n),type:e.type,clientExtensionResults:e.getClientExtensionResults(),response:{authenticatorData:(0,St.vh)(t),clientDataJSON:(0,St.vh)(i),signature:(0,St.vh)(s),userHandle:(0,St.vh)(l)}}});if(u.status===500){Ds("unknown");return}else if(!u.ok){Ds("unable-to-process");return}const m=await u.json();window.location.href=m?.redirect??`${Mo}/`}async function nb(e){const t=new Uint8Array(e.response.attestationObject),i=new Uint8Array(e.response.clientDataJSON),n=new Uint8Array(e.rawId),s=await(0,Ae.LO)(`${Mo}/user/settings/security/webauthn/register`,{data:{id:e.id,rawId:(0,St.vh)(n),type:e.type,response:{attestationObject:(0,St.vh)(t),clientDataJSON:(0,St.vh)(i)}}});if(s.status===409){Ds("duplicated");return}else if(s.status!==201){Ds("unknown");return}window.location.reload()}function Ds(e,t=""){const i=document.querySelector("#webauthn-error-msg");if(e==="general")i.textContent=t||"unknown error";else{const n=document.querySelector(`#webauthn-error [data-webauthn-error-msg=${e}]`);n?i.textContent=`${n.textContent}${t?` ${t}`:""}`:i.textContent=`unknown error type: ${e}${t?` ${t}`:""}`}(0,C.fi)("#webauthn-error")}function Th(){return window.isSecureContext?typeof window.PublicKeyCredential!="function"?(Ds("browser"),!1):!0:(Ds("insecure"),!1)}function sb(){const e=document.querySelector("#register-webauthn");if(e){if(!Th()){e.disabled=!0;return}e.addEventListener("click",async t=>{t.preventDefault(),await rb()})}}async function rb(){const e=document.querySelector("#nickname"),t=new FormData;t.append("name",e.value);const i=await(0,Ae.LO)(`${Mo}/user/settings/security/webauthn/request_register`,{data:t});if(i.status===409){Ds("duplicated");return}else if(!i.ok){Ds("unknown");return}const n=await i.json();if(e.closest("div.field").classList.remove("error"),n.publicKey.challenge=(0,St.vd)(n.publicKey.challenge),n.publicKey.user.id=(0,St.vd)(n.publicKey.user.id),n.publicKey.excludeCredentials)for(const s of n.publicKey.excludeCredentials)s.id=(0,St.vd)(s.id);try{const s=await navigator.credentials.create({publicKey:n.publicKey});await nb(s)}catch(s){Ds("unknown",s)}}function ob(){document.addEventListener("click",e=>{if(e.target.matches(".remove-rel-attach")){const t=e.target.getAttribute("data-uuid"),i=e.target.getAttribute("data-id");document.querySelector(`input[name='attachment-del-${t}']`).value="true",(0,C.y9)(`#attachment-${i}`)}})}function ab(){document.querySelector(".repository.new.release")&&lb()}function lb(){const e=document.querySelector("#tag-name-editor");if(!e)return;const t=JSON.parse(e.getAttribute("data-existing-tags"));if(!Array.isArray(t))return;const i=e.getAttribute("data-tag-helper"),n=e.getAttribute("data-tag-helper-new"),s=e.getAttribute("data-tag-helper-existing"),l=document.querySelector("#tag-name"),u=function(m){const y=m.value,A=document.querySelector("#tag-helper");t.includes(y)?((0,C.y9)("#tag-target-selector"),A.textContent=s):((0,C.fi)("#tag-target-selector"),A.textContent=y?n:i)};u(l),l.addEventListener("input",m=>{u(m.target)})}const{appSubUrl:cb}=window.config,ub=/^\S+@\S+$/;function db(){const e=document.querySelector("#search-user-box");if(!e)return;const t=e.getAttribute("data-allow-email")==="true",i=e.getAttribute("data-allow-email-description")??void 0;(0,ke.mD)(e).search({minCharacters:2,apiSettings:{url:`${cb}/user/search_candidates?q={query}`,onResponse(n){const s=[],l=e.querySelector("input").value,u=l.toUpperCase();for(const m of n.data){const y={title:m.login,image:m.avatar_url,description:R(m.full_name)};u===m.login.toUpperCase()?s.unshift(y):s.push(y)}if(t&&!s.length&&ub.test(l)){const m={title:l,description:i};s.push(m)}return{results:s}}},searchFields:["login","full_name"],showNoResults:!1})}function fb(){const e=document.querySelector(".page-content.install");e&&(e.classList.contains("post-install")?mb():hb())}function hb(){const e="gitea",t="gitea",i={mysql:"127.0.0.1:3306",postgres:"127.0.0.1:5432",mssql:"127.0.0.1:1433"},n=document.querySelector("#db_host"),s=document.querySelector("#db_user"),l=document.querySelector("#db_name");document.querySelector("#db_type").addEventListener("change",function(){const y=this.value;if((0,C.y9)("div[data-db-setting-for]"),(0,C.fi)(`div[data-db-setting-for=${y}]`),y!=="sqlite3"){(0,C.fi)("div[data-db-setting-for=common-host]");const A=n.value;(!A||Object.values(i).includes(A))&&(n.value=i[y]??""),!s.value&&!l.value&&(s.value=e,l.value=t)}}),document.querySelector("#db_type").dispatchEvent(new Event("change"));const u=document.querySelector("#app_url");u.value.includes("://localhost")&&(u.value=window.location.href);const m=document.querySelector("#domain");m.value.trim()==="localhost"&&(m.value=window.location.hostname),document.querySelector("#offline-mode input").addEventListener("change",function(){this.checked&&(document.querySelector("#disable-gravatar input").checked=!0,document.querySelector("#federated-avatar-lookup input").checked=!1)}),document.querySelector("#disable-gravatar input").addEventListener("change",function(){this.checked?document.querySelector("#federated-avatar-lookup input").checked=!1:document.querySelector("#offline-mode input").checked=!1}),document.querySelector("#federated-avatar-lookup input").addEventListener("change",function(){this.checked&&(document.querySelector("#disable-gravatar input").checked=!1,document.querySelector("#offline-mode input").checked=!1)}),document.querySelector("#enable-openid-signin input").addEventListener("change",function(){this.checked?document.querySelector("#disable-registration input").checked||(document.querySelector("#enable-openid-signup input").checked=!0):document.querySelector("#enable-openid-signup input").checked=!1}),document.querySelector("#disable-registration input").addEventListener("change",function(){this.checked?(document.querySelector("#enable-captcha input").checked=!1,document.querySelector("#enable-openid-signup input").checked=!1):document.querySelector("#enable-openid-signup input").checked=!0}),document.querySelector("#enable-captcha input").addEventListener("change",function(){this.checked&&(document.querySelector("#disable-registration input").checked=!1)})}function mb(){const e=document.querySelector("#goto-user-login");if(!e)return;const t=e.getAttribute("href");let i=setInterval(async()=>{try{const n=await(0,Ae.fG)(t);i&&n.status===200&&(clearInterval(i),i=null,window.location.href=t)}catch{}},1e3)}function pb(){if(!document.querySelectorAll(".new.webhook").length)return;for(const t of document.querySelectorAll(".events.checkbox input"))t.addEventListener("change",function(){this.checked&&(0,C.fi)(".events.fields")});for(const t of document.querySelectorAll(".non-events.checkbox input"))t.addEventListener("change",function(){this.checked&&(0,C.y9)(".events.fields")});const e=document.querySelector("#http_method");if(e){const t=function(){const i=e.value==="POST";(0,C.oi)(document.querySelector("#content_type").closest(".field"),i)};t(),e.addEventListener("change",t)}document.querySelector("#test-delivery")?.addEventListener("click",async function(){this.classList.add("is-loading","disabled"),await(0,Ae.LO)(this.getAttribute("data-link")),setTimeout(()=>{window.location.href=this.getAttribute("data-redirect")},5e3)})}function gb(){vb(),bb()}function vb(){for(const e of document.querySelectorAll(".show-create-branch-modal"))e.addEventListener("click",()=>{const t=e.getAttribute("data-modal-form")||"#create-branch-form",i=document.querySelector(t);if(!i)return;i.action=`${i.getAttribute("data-base-action")}${e.getAttribute("data-branch-from-urlcomponent")}`;const n=e.getAttribute("data-modal-from-span")||"#modal-create-branch-from-span";document.querySelector(n).textContent=e.getAttribute("data-branch-from"),(0,ke.mD)(e.getAttribute("data-modal")).modal("show")})}function bb(){for(const e of document.querySelectorAll(".show-rename-branch-modal"))e.addEventListener("click",()=>{const t=e.getAttribute("data-modal"),i=document.querySelector(t),n=e.getAttribute("data-old-branch-name");i.querySelector("input[name=from]").value=n;const s=i.querySelector(".default-branch-warning");(0,C.oi)(s,e.getAttribute("data-is-default-branch")==="true");const l=i.querySelector("[data-rename-branch-to]");l.textContent=l.getAttribute("data-rename-branch-to").replace("%s",n)})}function _b(e){return/.*[^/]\/[^/].*/.test(e)}function Lh(e){const t=document.querySelector(e);if(!t)return;const i=t.querySelector("#issue-label-edit-modal");if(!i)return;const n=i.querySelector('input[name="id"]'),s=i.querySelector(".label-name-input"),l=i.querySelector(".label-exclusive-input-field"),u=i.querySelector(".label-exclusive-input"),m=i.querySelector(".label-exclusive-warning"),y=i.querySelector(".label-exclusive-order-input-field"),A=i.querySelector(".label-exclusive-order-input"),L=i.querySelector(".label-is-archived-input-field"),z=i.querySelector(".label-is-archived-input"),X=i.querySelector(".label-desc-input"),_e=i.querySelector(".js-color-picker-input input"),pe=()=>{const Te=_b(s.value);l.classList.toggle("disabled",!Te);const He=Te&&u.checked&&i.hasAttribute("data-need-warn-exclusive");(0,C.oi)(m,He),Te||(u.checked=!1),(0,C.oi)(y,u.checked),parseInt(A.value)<=0?A.style.color="var(--color-placeholder-text) !important":A.style.color=null},de=Te=>{const He=i.querySelector("form");n.value=Te.getAttribute("data-label-id")||"",s.value=Te.getAttribute("data-label-name")||"",A.value=Te.getAttribute("data-label-exclusive-order")||"0",z.checked=Te.getAttribute("data-label-is-archived")==="true",u.checked=Te.getAttribute("data-label-exclusive")==="true",X.value=Te.getAttribute("data-label-description")||"",_e.value=Te.getAttribute("data-label-color")||"",_e.dispatchEvent(new Event("input",{bubbles:!0}));const U=!!n.value,Se=parseInt(Te.getAttribute("data-label-num-issues")||"0");i.toggleAttribute("data-need-warn-exclusive",!u.checked&&Se>0),i.querySelector(".header").textContent=U?i.getAttribute("data-text-edit-label"):i.getAttribute("data-text-new-label");const ze=i.getAttribute("data-current-page-link");He.action=U?`${ze}/edit`:`${ze}/new`,(0,C.oi)(L,U),pe(),(0,ke.mD)(i).modal({onApprove(){if(!He.checkValidity())return He.reportValidity(),!1;He.submit()}}).modal("show")};i.addEventListener("input",()=>pe());const Pe=t.querySelector(".ui.button.new-label");Pe?.addEventListener("click",()=>de(Pe));const Le=t.querySelectorAll(".edit-label-button");for(const Te of Le)Te.addEventListener("click",He=>{He.preventDefault(),de(Te)})}function yb(){document.querySelectorAll(".organization").length&&(document.querySelector(".organization.settings.options #org_name")?.addEventListener("input",function(){const e=this.value.toLowerCase()!==this.getAttribute("data-org-name").toLowerCase();(0,C.oi)("#org-name-change-prompt",e)}),Lh(".page-content.organization.settings.labels"))}var wb=__webpack_require__("./node_modules/jquery/dist/jquery.js"),Mn=__webpack_require__.n(wb);function Sb(){for(const e of document.querySelectorAll(".ui.checkbox")){if(e.hasAttribute("data-checkbox-patched"))continue;const t=e.querySelector("label"),i=e.querySelector("input");!t||!i||((0,ke.iZ)(t,i),e.setAttribute("data-checkbox-patched","true"))}}function xb(){for(const e of document.querySelectorAll(".ui.form .field")){if(e.hasAttribute("data-field-patched"))continue;const t=e.querySelector(":scope > label"),i=e.querySelector(":scope > input");!t||!i||((0,ke.iZ)(t,i),e.setAttribute("data-field-patched","true"))}}const Ar="_giteaAriaPatchDropdown",td=Mn().fn.dropdown;function jb(){if(Mn().fn.dropdown===id)throw new Error("initAriaDropdownPatch could only be called once");Mn().fn.dropdown.settings.onAfterFiltered=Eb,Mn().fn.dropdown=id,Mn().fn.fomanticExt.onResponseKeepSelectedItem=Rb,id.settings=td.settings}function id(...e){const t=td.apply(this,e);for(let i of this){i=i.closest(".ui.dropdown"),i[Ar]||kb(i);const n=Mn()(i),s=n.data("module-dropdown");s.giteaDelegated||(s.giteaDelegated=!0,Ab(n))}return t}function Rh(e,t){t.id||(t.id=(0,ke.Ae)()),t.setAttribute("role",e[Ar].listItemRole),t.setAttribute("tabindex","-1");for(const i of t.querySelectorAll("a, input, button"))i.setAttribute("tabindex","-1")}function Mh(e){e.id||(e.id=(0,ke.Ae)()),e.tabIndex=-1;const t=e.querySelector(".delete.icon");t&&(t.setAttribute("aria-hidden","false"),t.setAttribute("aria-label",window.config.i18n.remove_label_str.replace("%s",e.getAttribute("data-value"))),t.setAttribute("role","button"))}function Eb(){const e=Mn()(this).closest(".ui.dropdown"),t=e.dropdown("setting","hideDividers")==="empty",i=e[0].querySelector(".scrolling.menu")||e[0].querySelector(".menu");t&&i&&Lb(i)}function Ab(e){const t=td.bind(e),i={...t("setting","templates"),t:performance.now()},n=i.menu;i.menu=function(m,y,A,L){const z=n(m,y,A,L),X=document.createElement("div");X.innerHTML=z;const _e=Mn()(X);return _e.find("> .item").each((de,Pe)=>Rh(e[0],Pe)),e[0][Ar].deferredRefreshAriaActiveItem(),_e.html()},t("setting","templates",i);const s=t("setting","onLabelCreate");t("setting","onLabelCreate",function(m,y){const A=s.call(this,m,y);return Mh(A[0]),A});const l=t("internal","set"),u=l.direction;l.direction=function(m){u.call(this,m);const y=t("setting","className");m=m||e.find("> .menu");const A=m[0];A.classList.add(y.loading),A.getBoundingClientRect().right>document.documentElement.clientWidth&&A.classList.add(y.leftward),A.classList.remove(y.loading)}}function Cb(e,t,i){i.id||(i.id=(0,ke.Ae)()),Mn()(i).find("> .item").each((s,l)=>Rh(e,l)),i.setAttribute("role",e[Ar].listPopupRole);for(const s of e.querySelectorAll(".ui.label"))Mh(s);t.setAttribute("role",t.getAttribute("role")??e[Ar].focusableRole),t.setAttribute("aria-haspopup",e[Ar].listPopupRole),t.setAttribute("aria-controls",i.id),t.setAttribute("aria-expanded","false");const n=e.getAttribute("data-tooltip-content");n&&!e.getAttribute("aria-label")&&e.setAttribute("aria-label",n)}function kb(e){e[Ar]={};const t=e.querySelector("input.search"),i=t||e;if(!i)return;t&&!t.getAttribute("autocomplete")&&t.setAttribute("autocomplete","off");let n=Mn()(e).find("> .menu")[0];n||(n=document.createElement("div"),n.classList.add("menu"),e.append(n));const s=e.querySelectorAll("input").length>0;e[Ar].focusableRole=s?"combobox":"menu",e[Ar].listPopupRole=s?"listbox":"",e[Ar].listItemRole=s?"option":"menuitem",Tb(e,i,n),Cb(e,i,n)}function Tb(e,t,i){const n=()=>i.classList.contains("visible")&&!i.classList.contains("out")||i.classList.contains("in"),s=()=>{const y=n();t.setAttribute("aria-expanded",y?"true":"false");const A=Mn()(i).find("> .item.active, > .item.selected")[0];A&&(y?t.setAttribute("aria-activedescendant",A.id):e[Ar].listPopupRole==="menu"&&(t.removeAttribute("aria-activedescendant"),A.classList.remove("active","selected")))};e.addEventListener("keydown",y=>{if(y.key==="Enter"){const A=i.querySelector(":scope > .item.selected, .menu > .item.selected");A?.matches("a, .js-aria-clickable")&&!A.matches(".tw-hidden, .filtered")&&(y.preventDefault(),A.click())}});const l=(y=0)=>{setTimeout(s,y)};e[Ar].deferredRefreshAriaActiveItem=l,e.addEventListener("keyup",y=>{y.key.startsWith("Arrow")&&l()});let u=0,m=0;e.addEventListener("mousedown",()=>{m+=n()?1:0,u++},!0),e.addEventListener("focus",()=>{m+=n()?1:0,u++,l()},!0),e.addEventListener("blur",()=>{m=u=0,l(100)},!0),e.addEventListener("mouseup",()=>{setTimeout(()=>{m=u=0,l(100)},0)},!0),e.addEventListener("click",y=>{n()&&m!==2&&u===2&&y.stopPropagation(),u=m=0},!0)}function Lb(e){const t=[],i=[];let n="",s="";const l=z=>z.classList.contains("divider"),u=z=>l(z)&&z.hasAttribute("data-scope"),m=z=>z.classList.add("hidden","transition"),y=z=>z.classList.remove("hidden","transition"),A=z=>z.classList.contains("hidden")||z.classList.contains("filtered")||z.classList.contains("tw-hidden"),L=z=>{i.length===1&&u(i[0])?m(i[0]):i.length&&(u(i[0])&&s===n&&(m(i[0]),i.shift()),t.push(...i),s=n),n=z,i.length=0};(0,C.jB)(e,".divider",y);for(const z of e.children){const X=z.getAttribute("data-scope")||"";X!==n&&L(X),A(z)||i.push(z)}for(L("");t.length&&l(t[0]);)m(t[0]),t.shift();for(;t.length&&l(t[t.length-1]);)m(t[t.length-1]),t.pop();for(let z=0;z<t.length-1;z++)t[z].matches(".divider")&&t[z+1].matches(".divider")&&m(t[z])}function Rb(e,t){const i=e instanceof HTMLElement?e:e[0];setTimeout(()=>{(0,C.jB)(i,`.menu .item[data-value="${CSS.escape(t)}"].filtered`,n=>n.classList.remove("filtered")),Mn()(i).dropdown("set selected",t??"")},10)}const Dh=Mn().fn.modal;function Mb(){if(Mn().fn.modal===nd)throw new Error("initAriaModalPatch could only be called once");Mn().fn.modal=nd,nd.settings=Dh.settings}function nd(...e){const t=Dh.apply(this,e);if(e[0]==="show"||e[0]?.autoShow)for(const i of this)for(const n of i.querySelectorAll("form button.cancel:not([type])"))n.setAttribute("type","button");return t}function Db(){const e=new Set(["clear queue","stop","stop all","destroy","force repaint","repaint","reset","looping","remove looping","disable","enable","set duration","save conditions","restore conditions"]);Mn().fn.transition=function(t,i,n){if(t==="is supported")return!0;if(t==="is animating"||t==="is inward"||t==="is outward")return!1;let s;if(typeof t=="string"){if(e.has(t))return this;s={animation:t,...i&&{duration:i},...n&&{onComplete:n}}}else if(typeof t=="object")s=t;else throw new Error(`invalid argument: ${t}`);const l=s.animation?.startsWith("show")||s.animation?.endsWith(" in"),u=s.animation?.startsWith("hide")||s.animation?.endsWith(" out");return this.each((m,y)=>{let A=l;!l&&!u&&(A=this.hasClass("hidden")),s.onStart?.call(y),A?(y.classList.remove("hidden"),y.classList.add("visible","transition"),s.displayType&&y.style.setProperty("display",s.displayType,"important"),s.onShow?.call(y)):(y.classList.add("hidden"),y.classList.remove("visible"),y.style.removeProperty("display"),s.onHidden?.call(y)),s.onComplete?.call(y)}),this}}function Ob(){Mn().fn.dimmer=function(e,t){if(e==="add content"){const i=t,n=document.querySelector("body > .ui.dimmer");n?((0,C.xP)(n,"*",s=>s.classList.add("hidden")),this._dimmer=n):(this._dimmer=document.createElement("div"),this._dimmer.classList.add("ui","dimmer"),document.body.append(this._dimmer)),this._dimmer.append(i[0])}else{if(e==="get dimmer")return Mn()(this._dimmer);if(e==="show")this._dimmer.classList.add("active"),document.body.classList.add("tw-overflow-hidden");else if(e==="hide"){const i=t;this._dimmer.classList.remove("active"),document.body.classList.remove("tw-overflow-hidden"),i()}}return this}}function qb(){Mn().fn.tab=function(){for(const e of this){const t=e.getAttribute("data-tab");t&&e.addEventListener("click",()=>{const i=document.querySelector(`.ui.tab[data-tab="${t}"]`);(0,C.D6)(i,".ui.tab",n=>n.classList.remove("active")),(0,C.D6)(e,"[data-tab]",n=>n.classList.remove("active")),e.classList.add("active"),i.classList.add("active")})}return this}}const Oh=window.matchMedia("only screen and (max-width: 767.98px)");function Pb(){Mn().fn.fomanticExt={},Mn().fn.dropdown.settings.fullTextSearch="exact",Mn().fn.dropdown.settings.className.label+=" tw-cursor-default",Mn().fn.dropdown.settings.templates.label=function(e,t,i,n){const s=Mn().fn.dropdown.settings.templates.escape;return s(t,i)+(0,Z.JW)("octicon-x",16,`${n.delete} icon`)},Db(),Ob(),qb(),Sb(),xb(),jb(),Mb()}async function Fb(){const e=document.querySelector(".repository.wiki .combo-markdown-editor textarea");if(!e)return;const t=document.querySelector(".repository.wiki.new .ui.form"),i=t.querySelector(".combo-markdown-editor");let n,s=!1,l="";const u=async function(){if(s)return;const m=i.querySelector(".EasyMDEContainer .editor-preview-active"),A=i.querySelector(".EasyMDEContainer .editor-preview-active-side")||m,L=e.value;if(n&&A&&l!==L){s=!0;const z=new FormData;z.append("mode",n.previewMode),z.append("context",n.previewContext),z.append("text",L);try{const _e=await(await(0,Ae.LO)(n.previewUrl,{data:z})).text();l=L,A.innerHTML=`<div class="render-content markup ui segment">${_e}</div>`}catch(X){console.error("Error rendering preview:",X)}finally{s=!1,setTimeout(u,1e3)}}else setTimeout(u,1e3)};u(),n=await ma(i,{editorHeights:{minHeight:"300px",height:"calc(100vh - 600px)"},easyMDEOptions:{previewRender:(m,y)=>y.innerHTML,toolbar:["bold","italic","strikethrough","|","heading-1","heading-2","heading-3","heading-bigger","heading-smaller","|","gitea-code-inline","code","quote","|","gitea-checkbox-empty","gitea-checkbox-checked","|","unordered-list","ordered-list","|","link","image","table","horizontal-rule","|","preview","fullscreen","side-by-side","|","gitea-switch-to-textarea"]}}),t.addEventListener("submit",m=>{hh(e)||(m.preventDefault(),m.stopPropagation())})}function qh(e){e&&document.querySelector(".wiki-content-toc details")?.removeAttribute("open")}function Ib(){document.querySelector(".page-content.repository.wiki")&&(Oh.addEventListener("change",e=>qh(e.matches)),qh(Oh.matches),Fb())}function Nb(){(0,C.ny)(document,"click",".escape-button, .unescape-button, .toggle-escape-button",(e,t)=>{t.preventDefault();const i=e.getAttribute("data-unicode-content-selector"),n=i?document.querySelector(i):e.closest(".file-content, .non-diff-file-content"),s=n.querySelector(".file-code, .file-view")??n;if(e.matches(".escape-button"))s.classList.add("unicode-escaped"),(0,C.y9)(e),(0,C.fi)((0,C.D6)(e,".unescape-button"));else if(e.matches(".unescape-button"))s.classList.remove("unicode-escaped"),(0,C.y9)(e),(0,C.fi)((0,C.D6)(e,".escape-button"));else if(e.matches(".toggle-escape-button")){const l=s.classList.contains("unicode-escaped");s.classList.toggle("unicode-escaped",!l),(0,C.oi)(n.querySelectorAll(".unescape-button"),!l),(0,C.oi)(n.querySelectorAll(".escape-button"),l)}})}const{pageData:Ph}=window.config;async function Hb(e,t){const[{Cite:i,plugins:n}]=await Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl").then(__webpack_require__.bind(__webpack_require__,"./node_modules/@citation-js/core/lib-mjs/index.js")),Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl"),__webpack_require__.e("citation-js-formats")]).then(__webpack_require__.t.bind(__webpack_require__,"./node_modules/@citation-js/plugin-software-formats/lib/index.js",23)),Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl"),__webpack_require__.e("citation-js-bibtex")]).then(__webpack_require__.bind(__webpack_require__,"./node_modules/@citation-js/plugin-bibtex/lib-mjs/index.js")),Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl"),__webpack_require__.e("citation-js-csl")]).then(__webpack_require__.bind(__webpack_require__,"./node_modules/@citation-js/plugin-csl/lib-mjs/index.js"))]),{citationFileContent:s}=Ph,l=n.config.get("@bibtex");l.constants.fieldTypes.doi=["field","literal"],l.constants.fieldTypes.version=["field","literal"];const u=new i(s),m=(0,St.kk)()||"en-US",y=u.format("bibliography",{template:"apa",lang:m}),A=u.format("bibtex",{lang:m});t.setAttribute("data-text",A),e.setAttribute("data-text",y)}async function Bb(){const e="apa";if(!Ph.citationFileContent)return;const t=document.querySelector("#citation-copy-apa"),i=document.querySelector("#citation-copy-bibtex"),n=document.querySelector("#citation-copy-content");if(!t&&!i||!n)return;const s=()=>{const l=(localStorage.getItem("citation-copy-format")||e)==="bibtex",u=(l?i:t).getAttribute("data-text");n.value=u,i.classList.toggle("primary",l),t.classList.toggle("primary",!l)};document.querySelector("#cite-repo-button")?.addEventListener("click",async()=>{try{await Hb(t,i)}catch(l){console.error(`initCitationFileCopyContent error: ${l}`,l);return}s(),t.addEventListener("click",()=>{localStorage.setItem("citation-copy-format","apa"),s()}),i.addEventListener("click",()=>{localStorage.setItem("citation-copy-format","bibtex"),s()}),n.addEventListener("click",()=>{n.select()}),(0,ke.mD)("#cite-repo-modal").modal("show")})}function $b(){_c("click","onCommentReactionButtonClick",async(e,t)=>{if(t.preventDefault(),e.classList.contains("disabled"))return;const i=e.closest("[data-action-url]").getAttribute("data-action-url"),n=e.getAttribute("data-reaction-content"),s=e.closest(".comment-container"),l=s.querySelector(".bottom-reactions"),m=l?.querySelector(`a[data-reaction-content="${CSS.escape(n)}"]`)?.getAttribute("data-has-reacted")==="true",A=await(await(0,Ae.LO)(`${i}/${m?"unreact":"react"}`,{data:new URLSearchParams({content:n})})).json();l?.remove(),A.html&&s.insertAdjacentHTML("beforeend",A.html)})}var Ub=__webpack_require__("./node_modules/brace-expansion/index.js");const Vb=1024*64,Tc=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>Vb)throw new TypeError("pattern is too long")},Wb={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Tl=e=>e.replace(/[[\]\\-]/g,"\\$&"),zb=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Fh=e=>e.join(""),Kb=(e,t)=>{const i=t;if(e.charAt(i)!=="[")throw new Error("not in a brace expression");const n=[],s=[];let l=i+1,u=!1,m=!1,y=!1,A=!1,L=i,z="";e:for(;l<e.length;){const de=e.charAt(l);if((de==="!"||de==="^")&&l===i+1){A=!0,l++;continue}if(de==="]"&&u&&!y){L=l+1;break}if(u=!0,de==="\\"&&!y){y=!0,l++;continue}if(de==="["&&!y){for(const[Pe,[Le,Te,He]]of Object.entries(Wb))if(e.startsWith(Pe,l)){if(z)return["$.",!1,e.length-i,!0];l+=Pe.length,He?s.push(Le):n.push(Le),m=m||Te;continue e}}if(y=!1,z){de>z?n.push(Tl(z)+"-"+Tl(de)):de===z&&n.push(Tl(de)),z="",l++;continue}if(e.startsWith("-]",l+1)){n.push(Tl(de+"-")),l+=2;continue}if(e.startsWith("-",l+1)){z=de,l+=2;continue}n.push(Tl(de)),l++}if(L<l)return["",!1,0,!1];if(!n.length&&!s.length)return["$.",!1,e.length-i,!0];if(s.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!A){const de=n[0].length===2?n[0].slice(-1):n[0];return[zb(de),!1,L-i,!1]}const X="["+(A?"^":"")+Fh(n)+"]",_e="["+(A?"":"^")+Fh(s)+"]";return[n.length&&s.length?"("+X+"|"+_e+")":n.length?X:_e,m,L-i,!0]},Ll=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),Xb=new Set(["!","?","+","*","@"]),Ih=e=>Xb.has(e),Gb="(?!(?:^|/)\\.\\.?(?:$|/))",Lc="(?!\\.)",Qb=new Set(["[","."]),Yb=new Set(["..","."]),Jb=new Set("().*{}+?[]^$\\!"),Zb=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),sd="[^/]",Nh=sd+"*?",Hh=sd+"+?",Ks=class Ks{constructor(t,i,n={}){wn(this,ba);rs(this,"type");wn(this,is);wn(this,bs);wn(this,lo,!1);wn(this,Dn,[]);wn(this,Gn);wn(this,Do);wn(this,ga);wn(this,Oo,!1);wn(this,Gr);wn(this,va);wn(this,Pl,!1);this.type=t,t&&tn(this,bs,!0),tn(this,Gn,i),tn(this,is,pt(this,Gn)?pt(pt(this,Gn),is):this),tn(this,Gr,pt(this,is)===this?n:pt(pt(this,is),Gr)),tn(this,ga,pt(this,is)===this?[]:pt(pt(this,is),ga)),t==="!"&&!pt(pt(this,is),Oo)&&pt(this,ga).push(this),tn(this,Do,pt(this,Gn)?pt(pt(this,Gn),Dn).length:0)}get hasMagic(){if(pt(this,bs)!==void 0)return pt(this,bs);for(const t of pt(this,Dn))if(typeof t!="string"&&(t.type||t.hasMagic))return tn(this,bs,!0);return pt(this,bs)}toString(){return pt(this,va)!==void 0?pt(this,va):this.type?tn(this,va,this.type+"("+pt(this,Dn).map(t=>String(t)).join("|")+")"):tn(this,va,pt(this,Dn).map(t=>String(t)).join(""))}push(...t){for(const i of t)if(i!==""){if(typeof i!="string"&&!(i instanceof Ks&&pt(i,Gn)===this))throw new Error("invalid part: "+i);pt(this,Dn).push(i)}}toJSON(){const t=this.type===null?pt(this,Dn).slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...pt(this,Dn).map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===pt(this,is)||pt(pt(this,is),Oo)&&pt(this,Gn)?.type==="!")&&t.push({}),t}isStart(){if(pt(this,is)===this)return!0;if(!pt(this,Gn)?.isStart())return!1;if(pt(this,Do)===0)return!0;const t=pt(this,Gn);for(let i=0;i<pt(this,Do);i++){const n=pt(t,Dn)[i];if(!(n instanceof Ks&&n.type==="!"))return!1}return!0}isEnd(){if(pt(this,is)===this||pt(this,Gn)?.type==="!")return!0;if(!pt(this,Gn)?.isEnd())return!1;if(!this.type)return pt(this,Gn)?.isEnd();const t=pt(this,Gn)?pt(pt(this,Gn),Dn).length:0;return pt(this,Do)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const i=new Ks(this.type,t);for(const n of pt(this,Dn))i.copyIn(n);return i}static fromGlob(t,i={}){var s;const n=new Ks(null,void 0,i);return dn(s=Ks,qo,Gc).call(s,t,n,0,i),n}toMMPattern(){if(this!==pt(this,is))return pt(this,is).toMMPattern();const t=this.toString(),[i,n,s,l]=this.toRegExpSource();if(!(s||pt(this,bs)||pt(this,Gr).nocase&&!pt(this,Gr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const m=(pt(this,Gr).nocase?"i":"")+(l?"u":"");return Object.assign(new RegExp(`^${i}$`,m),{_src:i,_glob:t})}get options(){return pt(this,Gr)}toRegExpSource(t){const i=t??!!pt(this,Gr).dot;if(pt(this,is)===this&&dn(this,ba,sm).call(this),!this.type){const y=this.isStart()&&this.isEnd(),A=pt(this,Dn).map(_e=>{var Te;const[pe,de,Pe,Le]=typeof _e=="string"?dn(Te=Ks,qo,rm).call(Te,_e,pt(this,bs),y):_e.toRegExpSource(t);return tn(this,bs,pt(this,bs)||Pe),tn(this,lo,pt(this,lo)||Le),pe}).join("");let L="";if(this.isStart()&&typeof pt(this,Dn)[0]=="string"&&!(pt(this,Dn).length===1&&Yb.has(pt(this,Dn)[0]))){const pe=Qb,de=i&&pe.has(A.charAt(0))||A.startsWith("\\.")&&pe.has(A.charAt(2))||A.startsWith("\\.\\.")&&pe.has(A.charAt(4)),Pe=!i&&!t&&pe.has(A.charAt(0));L=de?Gb:Pe?Lc:""}let z="";return this.isEnd()&&pt(pt(this,is),Oo)&&pt(this,Gn)?.type==="!"&&(z="(?:$|\\/)"),[L+A+z,Ll(A),tn(this,bs,!!pt(this,bs)),pt(this,lo)]}const n=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:";let l=dn(this,ba,pd).call(this,i);if(this.isStart()&&this.isEnd()&&!l&&this.type!=="!"){const y=this.toString();return tn(this,Dn,[y]),this.type=null,tn(this,bs,void 0),[y,Ll(this.toString()),!1,!1]}let u=!n||t||i||!Lc?"":dn(this,ba,pd).call(this,!0);u===l&&(u=""),u&&(l=`(?:${l})(?:${u})*?`);let m="";if(this.type==="!"&&pt(this,Pl))m=(this.isStart()&&!i?Lc:"")+Hh;else{const y=this.type==="!"?"))"+(this.isStart()&&!i&&!t?Lc:"")+Nh+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&u?")":this.type==="*"&&u?")?":`)${this.type}`;m=s+l+y}return[m,Ll(l),tn(this,bs,!!pt(this,bs)),pt(this,lo)]}};is=new WeakMap,bs=new WeakMap,lo=new WeakMap,Dn=new WeakMap,Gn=new WeakMap,Do=new WeakMap,ga=new WeakMap,Oo=new WeakMap,Gr=new WeakMap,va=new WeakMap,Pl=new WeakMap,ba=new WeakSet,sm=function(){if(this!==pt(this,is))throw new Error("should only call on root");if(pt(this,Oo))return this;this.toString(),tn(this,Oo,!0);let t;for(;t=pt(this,ga).pop();){if(t.type!=="!")continue;let i=t,n=pt(i,Gn);for(;n;){for(let s=pt(i,Do)+1;!n.type&&s<pt(n,Dn).length;s++)for(const l of pt(t,Dn)){if(typeof l=="string")throw new Error("string part in extglob AST??");l.copyIn(pt(n,Dn)[s])}i=n,n=pt(i,Gn)}}return this},qo=new WeakSet,Gc=function(t,i,n,s){var _e,pe;let l=!1,u=!1,m=-1,y=!1;if(i.type===null){let de=n,Pe="";for(;de<t.length;){const Le=t.charAt(de++);if(l||Le==="\\"){l=!l,Pe+=Le;continue}if(u){de===m+1?(Le==="^"||Le==="!")&&(y=!0):Le==="]"&&!(de===m+2&&y)&&(u=!1),Pe+=Le;continue}else if(Le==="["){u=!0,m=de,y=!1,Pe+=Le;continue}if(!s.noext&&Ih(Le)&&t.charAt(de)==="("){i.push(Pe),Pe="";const Te=new Ks(Le,i);de=dn(_e=Ks,qo,Gc).call(_e,t,Te,de,s),i.push(Te);continue}Pe+=Le}return i.push(Pe),de}let A=n+1,L=new Ks(null,i);const z=[];let X="";for(;A<t.length;){const de=t.charAt(A++);if(l||de==="\\"){l=!l,X+=de;continue}if(u){A===m+1?(de==="^"||de==="!")&&(y=!0):de==="]"&&!(A===m+2&&y)&&(u=!1),X+=de;continue}else if(de==="["){u=!0,m=A,y=!1,X+=de;continue}if(Ih(de)&&t.charAt(A)==="("){L.push(X),X="";const Pe=new Ks(de,L);L.push(Pe),A=dn(pe=Ks,qo,Gc).call(pe,t,Pe,A,s);continue}if(de==="|"){L.push(X),X="",z.push(L),L=new Ks(null,i);continue}if(de===")")return X===""&&pt(i,Dn).length===0&&tn(i,Pl,!0),L.push(X),X="",i.push(...z,L),A;X+=de}return i.type=null,tn(i,bs,void 0),tn(i,Dn,[t.substring(n-1)]),A},pd=function(t){return pt(this,Dn).map(i=>{if(typeof i=="string")throw new Error("string type in extglob ast??");const[n,s,l,u]=i.toRegExpSource(t);return tn(this,lo,pt(this,lo)||u),n}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")},rm=function(t,i,n=!1){let s=!1,l="",u=!1;for(let m=0;m<t.length;m++){const y=t.charAt(m);if(s){s=!1,l+=(Jb.has(y)?"\\":"")+y;continue}if(y==="\\"){m===t.length-1?l+="\\\\":s=!0;continue}if(y==="["){const[A,L,z,X]=Kb(t,m);if(z){l+=A,u=u||L,m+=z-1,i=i||X;continue}}if(y==="*"){n&&t==="*"?l+=Hh:l+=Nh,i=!0;continue}if(y==="?"){l+=sd,i=!0;continue}l+=Zb(y)}return[l,Ll(t),!!i,u]},wn(Ks,qo);let Rc=Ks;const e_=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),Os=(e,t,i={})=>(Tc(t),!i.nocomment&&t.charAt(0)==="#"?!1:new Mc(t,i).match(e)),t_=/^\*+([^+@!?\*\[\(]*)$/,i_=e=>t=>!t.startsWith(".")&&t.endsWith(e),n_=e=>t=>t.endsWith(e),s_=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),r_=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),o_=/^\*+\.\*+$/,a_=e=>!e.startsWith(".")&&e.includes("."),l_=e=>e!=="."&&e!==".."&&e.includes("."),c_=/^\.\*+$/,u_=e=>e!=="."&&e!==".."&&e.startsWith("."),d_=/^\*+$/,f_=e=>e.length!==0&&!e.startsWith("."),h_=e=>e.length!==0&&e!=="."&&e!=="..",m_=/^\?+([^+@!?\*\[\(]*)?$/,p_=([e,t=""])=>{const i=Bh([e]);return t?(t=t.toLowerCase(),n=>i(n)&&n.toLowerCase().endsWith(t)):i},g_=([e,t=""])=>{const i=$h([e]);return t?(t=t.toLowerCase(),n=>i(n)&&n.toLowerCase().endsWith(t)):i},v_=([e,t=""])=>{const i=$h([e]);return t?n=>i(n)&&n.endsWith(t):i},b_=([e,t=""])=>{const i=Bh([e]);return t?n=>i(n)&&n.endsWith(t):i},Bh=([e])=>{const t=e.length;return i=>i.length===t&&!i.startsWith(".")},$h=([e])=>{const t=e.length;return i=>i.length===t&&i!=="."&&i!==".."},Uh=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Vh={win32:{sep:"\\"},posix:{sep:"/"}},__=Uh==="win32"?Vh.win32.sep:Vh.posix.sep;Os.sep=__;const Cr=Symbol("globstar **");Os.GLOBSTAR=Cr;const y_="[^/]"+"*?",w_="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",S_="(?:(?!(?:\\/|^)\\.).)*?",x_=(e,t={})=>i=>Os(i,e,t);Os.filter=x_;const kr=(e,t={})=>Object.assign({},e,t),j_=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Os;const t=Os;return Object.assign((n,s,l={})=>t(n,s,kr(e,l)),{Minimatch:class extends t.Minimatch{constructor(s,l={}){super(s,kr(e,l))}static defaults(s){return t.defaults(kr(e,s)).Minimatch}},AST:class extends t.AST{constructor(s,l,u={}){super(s,l,kr(e,u))}static fromGlob(s,l={}){return t.AST.fromGlob(s,kr(e,l))}},unescape:(n,s={})=>t.unescape(n,kr(e,s)),escape:(n,s={})=>t.escape(n,kr(e,s)),filter:(n,s={})=>t.filter(n,kr(e,s)),defaults:n=>t.defaults(kr(e,n)),makeRe:(n,s={})=>t.makeRe(n,kr(e,s)),braceExpand:(n,s={})=>t.braceExpand(n,kr(e,s)),match:(n,s,l={})=>t.match(n,s,kr(e,l)),sep:t.sep,GLOBSTAR:Cr})};Os.defaults=j_;const Wh=(e,t={})=>(Tc(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ub(e));Os.braceExpand=Wh;const E_=(e,t={})=>new Mc(e,t).makeRe();Os.makeRe=E_;const A_=(e,t,i={})=>{const n=new Mc(t,i);return e=e.filter(s=>n.match(s)),n.options.nonull&&!e.length&&e.push(t),e};Os.match=A_;const zh=/[?*]|[+@!]\(.*?\)|\[|\]/,C_=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Mc{constructor(t,i={}){rs(this,"options");rs(this,"set");rs(this,"pattern");rs(this,"windowsPathsNoEscape");rs(this,"nonegate");rs(this,"negate");rs(this,"comment");rs(this,"empty");rs(this,"preserveMultipleSlashes");rs(this,"partial");rs(this,"globSet");rs(this,"globParts");rs(this,"nocase");rs(this,"isWindows");rs(this,"platform");rs(this,"windowsNoMagicRoot");rs(this,"regexp");Tc(t),i=i||{},this.options=i,this.pattern=t,this.platform=i.platform||Uh,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!i.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!i.nonegate,this.comment=!1,this.empty=!1,this.partial=!!i.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=i.windowsNoMagicRoot!==void 0?i.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const i of t)if(typeof i!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,i=this.options;if(!i.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],i.debug&&(this.debug=(...l)=>console.error(...l)),this.debug(this.pattern,this.globSet);const n=this.globSet.map(l=>this.slashSplit(l));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let s=this.globParts.map((l,u,m)=>{if(this.isWindows&&this.windowsNoMagicRoot){const y=l[0]===""&&l[1]===""&&(l[2]==="?"||!zh.test(l[2]))&&!zh.test(l[3]),A=/^[a-z]:/i.test(l[0]);if(y)return[...l.slice(0,4),...l.slice(4).map(L=>this.parse(L))];if(A)return[l[0],...l.slice(1).map(L=>this.parse(L))]}return l.map(y=>this.parse(y))});if(this.debug(this.pattern,s),this.set=s.filter(l=>l.indexOf(!1)===-1),this.isWindows)for(let l=0;l<this.set.length;l++){const u=this.set[l];u[0]===""&&u[1]===""&&this.globParts[l][2]==="?"&&typeof u[3]=="string"&&/^[a-z]:$/i.test(u[3])&&(u[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let s=0;s<t[n].length;s++)t[n][s]==="**"&&(t[n][s]="*");const{optimizationLevel:i=1}=this.options;return i>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):i>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(i=>{let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let s=n;for(;i[s+1]==="**";)s++;s!==n&&i.splice(n,s-n)}return i})}levelOneOptimize(t){return t.map(i=>(i=i.reduce((n,s)=>{const l=n[n.length-1];return s==="**"&&l==="**"?n:s===".."&&l&&l!==".."&&l!=="."&&l!=="**"?(n.pop(),n):(n.push(s),n)},[]),i.length===0?[""]:i))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let i=!1;do{if(i=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const l=t[s];s===1&&l===""&&t[0]===""||(l==="."||l==="")&&(i=!0,t.splice(s,1),s--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(i=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){const s=t[n-1];s&&s!=="."&&s!==".."&&s!=="**"&&(i=!0,t.splice(n-1,2),n-=2)}}while(i);return t.length===0?[""]:t}firstPhasePreProcess(t){let i=!1;do{i=!1;for(let n of t){let s=-1;for(;(s=n.indexOf("**",s+1))!==-1;){let u=s;for(;n[u+1]==="**";)u++;u>s&&n.splice(s+1,u-s);let m=n[s+1];const y=n[s+2],A=n[s+3];if(m!==".."||!y||y==="."||y===".."||!A||A==="."||A==="..")continue;i=!0,n.splice(s,1);const L=n.slice(0);L[s]="**",t.push(L),s--}if(!this.preserveMultipleSlashes){for(let u=1;u<n.length-1;u++){const m=n[u];u===1&&m===""&&n[0]===""||(m==="."||m==="")&&(i=!0,n.splice(u,1),u--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(i=!0,n.pop())}let l=0;for(;(l=n.indexOf("..",l+1))!==-1;){const u=n[l-1];if(u&&u!=="."&&u!==".."&&u!=="**"){i=!0;const y=l===1&&n[l+1]==="**"?["."]:[];n.splice(l-1,2,...y),n.length===0&&n.push(""),l-=2}}}}while(i);return t}secondPhasePreProcess(t){for(let i=0;i<t.length-1;i++)for(let n=i+1;n<t.length;n++){const s=this.partsMatch(t[i],t[n],!this.preserveMultipleSlashes);if(s){t[i]=[],t[n]=s;break}}return t.filter(i=>i.length)}partsMatch(t,i,n=!1){let s=0,l=0,u=[],m="";for(;s<t.length&&l<i.length;)if(t[s]===i[l])u.push(m==="b"?i[l]:t[s]),s++,l++;else if(n&&t[s]==="**"&&i[l]===t[s+1])u.push(t[s]),s++;else if(n&&i[l]==="**"&&t[s]===i[l+1])u.push(i[l]),l++;else if(t[s]==="*"&&i[l]&&(this.options.dot||!i[l].startsWith("."))&&i[l]!=="**"){if(m==="b")return!1;m="a",u.push(t[s]),s++,l++}else if(i[l]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(m==="a")return!1;m="b",u.push(i[l]),s++,l++}else return!1;return t.length===i.length&&u}parseNegate(){if(this.nonegate)return;const t=this.pattern;let i=!1,n=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)i=!i,n++;n&&(this.pattern=t.slice(n)),this.negate=i}matchOne(t,i,n=!1){const s=this.options;if(this.isWindows){const de=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),Pe=!de&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),Le=typeof i[0]=="string"&&/^[a-z]:$/i.test(i[0]),Te=!Le&&i[0]===""&&i[1]===""&&i[2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3]),He=Pe?3:de?0:void 0,U=Te?3:Le?0:void 0;if(typeof He=="number"&&typeof U=="number"){const[Se,ze]=[t[He],i[U]];Se.toLowerCase()===ze.toLowerCase()&&(i[U]=Se,U>He?i=i.slice(U):He>U&&(t=t.slice(He)))}}const{optimizationLevel:l=1}=this.options;l>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:i}),this.debug("matchOne",t.length,i.length);for(var u=0,m=0,y=t.length,A=i.length;u<y&&m<A;u++,m++){this.debug("matchOne loop");var L=i[m],z=t[u];if(this.debug(i,L,z),L===!1)return!1;if(L===Cr){this.debug("GLOBSTAR",[i,L,z]);var X=u,_e=m+1;if(_e===A){for(this.debug("** at the end");u<y;u++)if(t[u]==="."||t[u]===".."||!s.dot&&t[u].charAt(0)===".")return!1;return!0}for(;X<y;){var pe=t[X];if(this.debug(`
./output/git.buildapp.eu.org_run/git.buildapp.eu.org_4_after_login.html:305:</div>`);t.addEventListener("click",async i=>{i.preventDefault();const n=await Ii(Xf(e));Dt(i.target,n?Kf.copy_success:Kf.copy_error)}),e.previewTemplate.append(t)}async function Qf(e){const t=e.closest("[data-attachment-url]")?.getAttribute("data-attachment-url"),i=e.getAttribute("data-remove-url"),n=e.getAttribute("data-link-url");let s=!1,l={};const u={url:e.getAttribute("data-upload-url"),headers:{"X-Csrf-Token":Ng},acceptedFiles:["*/*",""].includes(e.getAttribute("data-accepts"))?null:e.getAttribute("data-accepts"),addRemoveLinks:!0,dictDefaultMessage:e.getAttribute("data-default-message"),dictInvalidFileType:e.getAttribute("data-invalid-input-type"),dictFileTooBig:e.getAttribute("data-file-too-big"),dictRemoveFile:e.getAttribute("data-remove-file"),timeout:0,thumbnailMethod:"contain",thumbnailWidth:480,thumbnailHeight:480};e.hasAttribute("data-max-file")&&(u.maxFiles=Number(e.getAttribute("data-max-file"))),e.hasAttribute("data-max-size")&&(u.maxFilesize=Number(e.getAttribute("data-max-size")));const m=await Hg(e,u);return m.on("success",(y,A)=>{y.uuid=A.uuid,l[y.uuid]={submitted:!1};const L=(0,C.tw)("input",{name:"files",type:"hidden",id:`dropzone-file-${A.uuid}`,value:A.uuid});e.querySelector(".files").append(L),Gf(y),m.emit(Uu,{file:y})}),m.on("removedfile",async y=>{s||(m.emit($u,{fileUuid:y.uuid}),document.querySelector(`#dropzone-file-${y.uuid}`)?.remove(),i&&l[y.uuid]&&!l[y.uuid].submitted&&await(0,Ae.LO)(i,{data:new URLSearchParams({file:y.uuid})}))}),m.on("submit",()=>{for(const y of Object.keys(l))l[y].submitted=!0}),m.on(Ac,async()=>{try{const A=await(await(0,Ae.fG)(t)).json();s=!0,m.removeAllFiles(!0),s=!1,e.querySelector(".files").innerHTML="";for(const L of e.querySelectorAll(".dz-preview"))L.remove();l={};for(const L of A){const z={name:L.name,uuid:L.uuid,size:L.size};if(m.emit("addedfile",z),m.emit("complete",z),(0,St.u)(z.name)){const _e=`${n}/${z.uuid}`;m.emit("thumbnail",z,_e)}Gf(z),l[z.uuid]={submitted:!0};const X=(0,C.tw)("input",{name:"files",type:"hidden",id:`dropzone-file-${z.uuid}`,value:z.uuid});e.querySelector(".files").append(X)}e.querySelector(".dz-preview")||e.classList.remove("dz-started")}catch(y){gt(`Failed to load attachments: ${y}`),console.error(y)}}),m.on("error",(y,A)=>{gt(`Dropzone upload error: ${A}`),m.removeFile(y)}),t&&m.emit(Ac),m}var Bg=Object.defineProperty,$g=(e,t,i)=>t in e?Bg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Yf=(e,t,i)=>$g(e,typeof t!="symbol"?t+"":t,i);let Ug=0;const Jf="ce-upload-state-changed";function Vu(e){e.dispatchEvent(new CustomEvent(Jf,{bubbles:!0}))}function Vg(e,t){return new Promise(i=>{const n=Ug++;t._giteaUploadId=n;const s=e.dropzone,l=({file:u})=>{u._giteaUploadId===n&&(s.off(Uu,l),i(u))};s.on(Uu,l),s.addFile(t)})}class Zf{constructor(t){Yf(this,"editor"),this.editor=t}insertPlaceholder(t){Wf(this.editor,t)}replacePlaceholder(t,i){const n=this.editor,s=n.selectionStart,l=n.selectionEnd;n.value.substring(s,l)===t?(n.value=n.value.substring(0,s)+i+n.value.substring(l),n.selectionEnd=s+i.length):(n.value=n.value.replace(t,i),n.selectionEnd-=t.length,n.selectionEnd+=i.length),n.selectionStart=n.selectionEnd,n.focus(),Lo(n)}}class Wg{constructor(t){Yf(this,"editor"),this.editor=t}insertPlaceholder(t){const i=this.editor,n=i.getCursor("start"),s=i.getCursor("end");i.replaceSelection(t),s.ch=n.ch+t.length,i.setSelection(n,s),i.focus(),Lo(i.getTextArea())}replacePlaceholder(t,i){const n=this.editor,s=n.getCursor("end");n.getSelection()===t?n.replaceSelection(i):n.setValue(n.getValue().replace(t,i)),s.ch-=t.length,s.ch+=i.length,n.setSelection(s,s),n.focus(),Lo(n.getTextArea())}}async function Cc(e,t,i,n){n.preventDefault();for(const s of i){const l=s.name.slice(0,s.name.lastIndexOf(".")),{width:u,dppx:m}=await Rg(s),y=`[${l}](uploading ...)`;e.insertPlaceholder(y),await Vg(t,s),e.replacePlaceholder(y,Xf(s,{width:u,dppx:m}))}}function eh(e,t){return e=e.replace(new RegExp(`!?\\[([^\\]]+)\\]\\(/?attachments/${t}\\)`,"g"),""),e=e.replace(new RegExp(`<img[^>]+src="/?attachments/${t}"[^>]*>`,"g"),""),e}function zg(e,t){const{value:i,selectionStart:n,selectionEnd:s}=e,l=i.substring(n,s),u=t.trim(),m=i.substring(0,n),y=i.substring(s),A=m.endsWith("](")&&y.startsWith(")");return l&&(0,pr.gU)(u)&&!(0,pr.gU)(l)&&!A?`[${l}](${u})`:null}function Kg(e,t,i,n){if(n)return;const s=zg(e,i);s&&(t.preventDefault(),(0,C.Pj)(e,s))}function th(e){const t=[];for(const n of e.clipboardData?.items??[])n.type?.startsWith("image/")&&t.push(n.getAsFile());return{text:e.clipboardData?.getData?.("text")??"",images:t}}function Xg(e,t){const i=new Wg(e.codemirror);e.codemirror.on("paste",(n,s)=>{const{images:l}=th(s);l.length&&Cc(i,t,l,s)}),e.codemirror.on("drop",(n,s)=>{s.dataTransfer.files.length&&Cc(i,t,s.dataTransfer.files,s)}),t.dropzone.on($u,({fileUuid:n})=>{const s=e.codemirror.getValue(),l=eh(s,n);s!==l&&e.codemirror.setValue(l)})}function Gg(e,t){let i=!1;e.addEventListener("keydown",n=>{n.shiftKey&&(i=!0)}),e.addEventListener("keyup",n=>{n.shiftKey||(i=!1)}),e.addEventListener("paste",n=>{const{images:s,text:l}=th(n);s.length&&t?Cc(new Zf(e),t,s,n):l&&Kg(e,n,l,i)}),e.addEventListener("drop",n=>{n.dataTransfer.files.length&&t&&Cc(new Zf(e),t,n.dataTransfer.files,n)}),t?.dropzone.on($u,({fileUuid:n})=>{const s=eh(e.value,n);e.value!==s&&(e.value=s)})}function kc(e){let t=e.closest("form");return t?(t.checkValidity()?t.dispatchEvent(new SubmitEvent("submit",{bubbles:!0,cancelable:!0})):t.reportValidity(),!0):(t=e.closest(".ui.form"),t?((0,C.gD)(t,".ui.primary.button")?.click(),!0):!1)}var Qg=__webpack_require__("./node_modules/tinycolor2/esm/tinycolor.js");const ih={},nh={},Yg={fontFamily:"var(--fonts-monospace)",fontSize:14,guides:{bracketPairs:!1,indentation:!1},links:!1,minimap:{enabled:!1},occurrencesHighlight:"off",overviewRulerLanes:0,renderLineHighlight:"all",renderLineHighlightOnlyWhenFocus:!0,rulers:[],scrollbar:{horizontalScrollbarSize:6,verticalScrollbarSize:6},scrollBeyondLastLine:!1,automaticLayout:!0};function Jg(e){const t=e.getAttribute("data-editorconfig");if(!t)return null;try{return JSON.parse(t)}catch{return null}}function Zg(e){for(const{filenames:t,extensions:i,id:n}of e.languages.getLanguages()){for(const s of t||[])ih[s]=n;for(const s of i||[])nh[s]=n;n==="typescript"&&e.languages.typescript.typescriptDefaults.setCompilerOptions({jsx:e.languages.typescript.JsxEmit.Preserve})}}function sh(e){return ih[e]||nh[(0,St.LC)(e)]||"plaintext"}function e0(e,t,i,n){t.updateOptions(ah(i,n));const s=t.getModel();if(!s)return;const l=s.getLanguageId(),u=sh(i);l!==u&&e.editor.setModelLanguage(s,u)}function t0(e){window.codeEditors||(window.codeEditors=[]),window.codeEditors.includes(e)||window.codeEditors.push(e)}function rh(e){const t=window.getComputedStyle(document.documentElement),i=n=>(0,Qg.A)(t.getPropertyValue(n).trim()).toString("hex6");e.editor.defineTheme("gitea",{base:(0,St.g4)()?"vs-dark":"vs",inherit:!0,rules:[{background:i("--color-code-bg"),token:""}],colors:{"editor.background":i("--color-code-bg"),"editor.foreground":i("--color-text"),"editor.inactiveSelectionBackground":i("--color-primary-light-4"),"editor.lineHighlightBackground":i("--color-editor-line-highlight"),"editor.selectionBackground":i("--color-primary-light-3"),"editor.selectionForeground":i("--color-primary-light-3"),"editorLineNumber.background":i("--color-code-bg"),"editorLineNumber.foreground":i("--color-secondary-dark-6"),"editorWidget.background":i("--color-body"),"editorWidget.border":i("--color-secondary"),"input.background":i("--color-input-background"),"input.border":i("--color-input-border"),"input.foreground":i("--color-input-text"),"scrollbar.shadow":i("--color-shadow-opaque"),"progressBar.background":i("--color-primary"),focusBorder:"#0000"}})}async function oh(e,t,i){const n=await __webpack_require__.e("monaco").then(__webpack_require__.bind(__webpack_require__,"include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.main.js"));Zg(n);let{language:s,...l}=i;s||(s=sh(t));const u=document.createElement("div");if(u.className="monaco-editor-container",!e.parentNode)throw new Error("Parent node absent");e.parentNode.append(u),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{rh(n)}),rh(n);const m=n.editor.createModel(e.value,s,n.Uri.file(t)),y=n.editor.create(u,{model:m,theme:"gitea",...l});n.editor.addKeybindingRules([{keybinding:n.KeyCode.Enter,command:null}]),m.onDidChangeContent(()=>{e.value=y.getValue({preserveBOM:!0,lineEnding:""}),e.dispatchEvent(new Event("change"))}),t0(y);const A=document.querySelector(".editor-loading");return A&&A.remove(),{monaco:n,editor:y}}function ah(e,t){return{wordWrap:(t||[]).includes((0,St.LC)(e))?"on":"off"}}function lh(e){const t=document.querySelector('a[data-tab="preview"]');t&&(e?t.style.display="":(t.style.display="none",t.classList.contains("active")&&document.querySelector('a[data-tab="write"]')?.click()))}async function i0(e,t){const i=(0,St.P8)(t.value),n=new Set((e.getAttribute("data-previewable-extensions")||"").split(",")),s=(e.getAttribute("data-line-wrap-extensions")||"").split(","),l=n.has((0,St.LC)(i)),u=Jg(t);lh(l);const{monaco:m,editor:y}=await oh(e,i,{...Yg,...ah(t.value,s),...n0(u)});return t.addEventListener("input",(0,C.nm)(()=>{const A=t.value,L=n.has((0,St.LC)(A));lh(L),e0(m,y,A,s)})),y}function n0(e){if(!e||!(0,St.Gv)(e))return{};const t={};return t.detectIndentation=!("indent_style"in e)||!("indent_size"in e),"indent_size"in e&&(t.indentSize=Number(e.indent_size)),"tab_width"in e&&(t.tabSize=Number(e.tab_width)||Number(e.indent_size)),"max_line_length"in e&&(t.rulers=[Number(e.max_line_length)]),t.trimAutoWhitespace=e.trim_trailing_whitespace===!0,t.insertSpaces=e.indent_style==="space",t.useTabStops=e.indent_style==="tab",t}const{i18n:ch}=window.config;function Wu({header:e="",content:t="",confirmButtonColor:i="primary"}={}){return new Promise(n=>{const s=e?`<div class="header">${R(e)}</div>`:"",l=(0,C.SL)(`
./output/git.buildapp.eu.org_run/git.buildapp.eu.org_4_after_login.html:332:_Originally posted by @${u} in ${m}_`,(0,ke.mD)(A).modal("show")})}function q0(){(0,C.jB)(document,".title_wip_desc > a",e=>e.addEventListener("click",t=>{t.preventDefault();const i=JSON.parse(e.closest(".title_wip_desc").getAttribute("data-wip-prefixes")),n=document.querySelector("#issue_title"),s=n.value;for(const l of i)if(s.startsWith(l.toUpperCase()))return;n.value=`${i[0]} ${s}`}))}function P0(){(0,C.jB)(document,".toggle-wip",e=>e.addEventListener("click",async t=>{t.preventDefault();const i=e,n=i.getAttribute("data-title"),s=i.getAttribute("data-wip-prefix"),l=i.getAttribute("data-update-url");try{const u=new URLSearchParams;if(u.append("title",n?.startsWith(s)?n.slice(s.length).trim():`${s.trim()} ${n}`),!(await(0,Ae.LO)(l,{data:u})).ok)throw new Error("Failed to toggle WIP status");window.location.reload()}catch(u){console.error(u)}}))}function F0(){const e=document.querySelector("#issue-title-display"),t=document.querySelector("#issue-title-editor");if(!t)return;const i=t.querySelector("input"),n=i.getAttribute("data-old-title");e.querySelector("#issue-title-edit-show").addEventListener("click",()=>{(0,C.y9)(e),(0,C.y9)("#pull-desc-display"),(0,C.fi)(t),(0,C.fi)("#pull-desc-editor"),i.value.trim()||(i.value=n),i.focus()}),t.querySelector(".ui.cancel.button").addEventListener("click",()=>{(0,C.y9)(t),(0,C.y9)("#pull-desc-editor"),(0,C.fi)(e),(0,C.fi)("#pull-desc-display")});const l=document.querySelector("#pull-desc-editor")?.getAttribute("data-target-update-url"),u=t.querySelector(".ui.primary.button");t.addEventListener("submit",async m=>{m.preventDefault();const y=i.value.trim();try{if(y&&y!==n){const A=await(0,Ae.LO)(u.getAttribute("data-update-url"),{data:new URLSearchParams({title:y})});if(!A.ok)throw new Error(`Failed to update issue title: ${A.statusText}`)}if(l){const A=document.querySelector("#pull-target-branch").getAttribute("data-branch"),L=document.querySelector("#branch_target").textContent;if(A!==L){const z=await(0,Ae.LO)(l,{data:new URLSearchParams({target_branch:A})});if(!z.ok)throw new Error(`Failed to update PR target branch: ${z.statusText}`)}}Ku(t),window.location.reload()}catch(A){console.error(A),gt(A.message)}})}function I0(){document.querySelector("#branch-select")?.addEventListener("click",e=>{const t=e.target.closest(".item[data-branch]");if(!t)return;const i=document.querySelector("#pull-target-branch"),n=i.getAttribute("data-basename"),s=t.getAttribute("data-branch"),l=i.getAttribute("data-branch");i.textContent=i.textContent.replace(`${n}:${l}`,`${n}:${s}`),i.setAttribute("data-branch",s)})}async function N0(e){const t=await ma(e.querySelector(".combo-markdown-editor")),i=document.querySelector("#status-button"),n=document.querySelector("#comment-button"),s=()=>{const l=t.value().trim(),u=t.isUploading();i&&(i.textContent=i.getAttribute(l?"data-status-and-comment":"data-status"),i.disabled=u),n&&(n.disabled=!l||u)};t.container.addEventListener(ha.EventUploadStateChanged,s),t.container.addEventListener(ha.EventEditorContentChanged,s),s()}function H0(e){const t=e.querySelectorAll(".combo-editor-dropzone"),i=async n=>{const s=n.querySelector(".form-field-real"),l=n.querySelector(".form-field-dropzone"),u=n.querySelector(".combo-markdown-editor"),m=await ma(u);m.container.addEventListener(ha.EventEditorContentChanged,()=>s.value=m.value()),s.addEventListener("focus",async()=>{(0,C.fi)(e.querySelectorAll(".combo-editor-dropzone .form-field-real")),(0,C.y9)(e.querySelectorAll(".combo-editor-dropzone .combo-markdown-editor")),(0,C.jB)(e,".combo-editor-dropzone .form-field-dropzone",y=>{const L=y.querySelector(".dropzone").dropzone.files.length!==0;(0,C.oi)(y,L)}),(0,C.y9)(s),(0,C.fi)(u),(0,C.fi)(l),await m.switchToUserPreference(),m.focus()})};for(const n of t)i(n)}function B0(){const e=document.querySelector(".comment.form");e&&(e.querySelector(".field.combo-editor-dropzone")?H0(e):e.querySelector(".combo-markdown-editor")&&N0(e),E0())}function $0(){_c("click","onRepoEllipsisButtonClick",async(e,t)=>{t.preventDefault();const i=e.getAttribute("aria-expanded")==="true";(0,C.oi)(e.parentElement.querySelector(".commit-body")),e.setAttribute("aria-expanded",String(!i))})}function U0(){Ha("initCommitStatuses",e=>{const t=e.nextElementSibling;if(!t.matches(".tippy-target"))throw new Error("Expected next element to be a tippy target");Ie(e,{content:t,placement:"bottom-start",interactive:!0,role:"dialog",theme:"box-with-header"})})}const{appSubUrl:ph}=window.config;function V0(){const e=document.querySelector("#manage_topic");if(!e)return;const t=document.querySelector("#topic_edit"),i=document.querySelector("#repo-topics"),n=t.querySelector(".ui.dropdown");let s;e.addEventListener("click",()=>{(0,C.y9)([i,e]),(0,C.fi)(t),n.querySelector("input.search").focus()}),document.querySelector("#cancel_topic_edit").addEventListener("click",()=>{s?.hideToast(),(0,C.y9)(t),(0,C.fi)([i,e]),e.focus()}),document.querySelector("#save_topic").addEventListener("click",async l=>{s?.hideToast();const u=t.querySelector("input[name=topics]").value,m=new FormData;m.append("topics",u);const y=await(0,Ae.LO)(l.target.getAttribute("data-link"),{data:m});if(y.ok){if((await y.json()).status==="ok"){if((0,C.xP)(i,".repo-topic",L=>L.remove()),u.length){const L=u.split(",");L.sort();for(const z of L){const X=document.createElement("a");X.classList.add("repo-topic","ui","large","label","gt-ellipsis"),X.href=`${ph}/explore/repos?q=${encodeURIComponent(z)}&topic=1`,X.textContent=z,i.append(X)}}(0,C.y9)(t),(0,C.fi)([i,e])}}else if(y.status===422){const A=await y.json();if(s=gt(A.message,{duration:5e3}),A.invalidTopics&&A.invalidTopics.length>0){const{invalidTopics:L}=A,z=(0,C.xP)(n,"a.ui.label");for(const[X,_e]of u.split(",").entries())L.includes(_e)&&(z[X].classList.remove("green"),z[X].classList.add("red"))}}}),(0,ke.mD)(n).dropdown({allowAdditions:!0,forceSelection:!1,fullTextSearch:"exact",fields:{name:"description",value:"data-value"},saveRemoteData:!1,label:{transition:"horizontal flip",duration:200,variation:!1},apiSettings:{url:`${ph}/explore/topics/search?q={query}`,throttle:500,cache:!1,onResponse(l){const u={success:!1,results:[]},m=(0,St.Kq)(this.urlData.query.trim());let y=!1;const A=[];for(const L of(0,C.xP)(n,"a.ui.label.visible"))A.push(L.getAttribute("data-value"));if(l.topics){let L=!1;for(const{topic_name:z}of l.topics)A.includes(z)||(z.toLowerCase()===m.toLowerCase()&&(y=!0),u.results.push({description:z,"data-value":z}),L=!0);u.success=L}return m.length>0&&!y?(u.success=!0,u.results.unshift({description:m,"data-value":m})):m.length>0&&y&&u.results.sort((L,z)=>L.description.toLowerCase()===m.toLowerCase()?-1:z.description.toLowerCase()===m.toLowerCase()?1:L.description>z.description?-1:L.description<z.description?1:0),u}},onLabelCreate(l){return l=l.toLowerCase().trim(),this.attr("data-value",l).contents().first().replaceWith(l),(0,ke.mD)(this)},onAdd(l,u,m){l=l.toLowerCase().trim(),m[0].setAttribute("data-value",l),m[0].setAttribute("data-text",l)}})}const{appSubUrl:W0}=window.config;function Qu(){Number(document.querySelector("#security_protocol")?.value)>0?(0,C.fi)(".has-tls"):(0,C.y9)(".has-tls")}function z0(){document.querySelector(".page-content.admin")&&(hf(),K0(),X0(),G0())}function K0(){document.querySelector(".page-content.admin.edit.user, .page-content.admin.new.user")&&document.querySelector("#login_type")?.addEventListener("change",function(){this.value?.startsWith("0")?(document.querySelector("#user_name")?.removeAttribute("disabled"),document.querySelector("#login_name")?.removeAttribute("required"),(0,C.y9)(".non-local"),(0,C.fi)(".local"),document.querySelector("#user_name")?.focus(),this.getAttribute("data-password")==="required"&&document.querySelector("#password")?.setAttribute("required","required")):(document.querySelector(".admin.edit.user")&&document.querySelector("#user_name")?.setAttribute("disabled","disabled"),document.querySelector("#login_name")?.setAttribute("required","required"),(0,C.fi)(".non-local"),(0,C.y9)(".local"),document.querySelector("#login_name")?.focus(),document.querySelector("#password")?.removeAttribute("required"))})}function X0(){const e=document.querySelector(".page-content.admin.authentication");if(!e)return;const t=e.classList.contains("new"),i=e.classList.contains("edit");if(!t&&!i)return;function n(){const L=document.querySelectorAll(".search-page-size");if(document.querySelector("#use_paged_search").checked){(0,C.fi)(".search-page-size");for(const z of L)z.querySelector("input")?.setAttribute("required","required")}else{(0,C.y9)(".search-page-size");for(const z of L)z.querySelector("input")?.removeAttribute("required")}}function s(L){(0,C.y9)(".open_id_connect_auto_discovery_url, .oauth2_use_custom_url");for(const X of document.querySelectorAll(".open_id_connect_auto_discovery_url input[required]"))X.removeAttribute("required");const z=document.querySelector("#oauth2_provider").value;switch(z){case"openidConnect":document.querySelector(".open_id_connect_auto_discovery_url input").setAttribute("required","required"),(0,C.fi)(".open_id_connect_auto_discovery_url");break;default:{const X=document.querySelector(`#${z}_customURLSettings`);if(!X)break;const _e=X.getAttribute("data-available")==="true",pe=X.getAttribute("data-required")==="true";_e&&(0,C.fi)(".oauth2_use_custom_url"),pe&&(document.querySelector("#oauth2_use_custom_url").checked=!0);break}}l(L)}function l(L){const z=document.querySelector("#oauth2_provider").value;(0,C.y9)(".oauth2_use_custom_url_field");for(const _e of document.querySelectorAll(".oauth2_use_custom_url_field input[required]"))_e.removeAttribute("required");if(document.querySelector(`#${z}_customURLSettings`)&&document.querySelector("#oauth2_use_custom_url").checked)for(const _e of["token_url","auth_url","profile_url","email_url","tenant"]){L&&(document.querySelector(`#oauth2_${_e}`).value=document.querySelector(`#${z}_${_e}`).value);const pe=document.querySelector(`#${z}_${_e}`);if(pe&&pe.getAttribute("data-available")==="true"){for(const de of document.querySelectorAll(`.oauth2_${_e} input`))de.setAttribute("required","required");(0,C.fi)(`.oauth2_${_e}`)}}}function u(){const L=document.querySelector(".js-ldap-group-toggle")?.checked;(0,C.oi)(document.querySelector("#ldap-group-options"),L)}const m=document.querySelector("#auth_type");if(t){const L=function(){(0,C.y9)(".ldap, .dldap, .smtp, .pam, .oauth2, .has-tls, .search-page-size, .sspi");for(const X of document.querySelectorAll(".ldap input[required], .binddnrequired input[required], .dldap input[required], .smtp input[required], .pam input[required], .oauth2 input[required], .has-tls input[required], .sspi input[required]"))X.removeAttribute("required");document.querySelector(".binddnrequired")?.classList.remove("required");const z=m.value;switch(z){case"2":(0,C.fi)(".ldap");for(const X of document.querySelectorAll(".binddnrequired input, .ldap div.required:not(.dldap) input"))X.setAttribute("required","required");document.querySelector(".binddnrequired")?.classList.add("required");break;case"3":(0,C.fi)(".smtp"),(0,C.fi)(".has-tls");for(const X of document.querySelectorAll(".smtp div.required input, .has-tls"))X.setAttribute("required","required");break;case"4":(0,C.fi)(".pam");for(const X of document.querySelectorAll(".pam input"))X.setAttribute("required","required");break;case"5":(0,C.fi)(".dldap");for(const X of document.querySelectorAll(".dldap div.required:not(.ldap) input"))X.setAttribute("required","required");break;case"6":(0,C.fi)(".oauth2");for(const X of document.querySelectorAll(".oauth2 div.required:not(.oauth2_use_custom_url,.oauth2_use_custom_url_field,.open_id_connect_auto_discovery_url) input"))X.setAttribute("required","required");s(!0);break;case"7":(0,C.fi)(".sspi");for(const X of document.querySelectorAll(".sspi div.required input"))X.setAttribute("required","required");break}(z==="2"||z==="5")&&(Qu(),u()),z==="2"&&n()};m.addEventListener("change",L),L(),document.querySelector("#security_protocol")?.addEventListener("change",Qu),document.querySelector("#use_paged_search")?.addEventListener("change",n),document.querySelector("#oauth2_provider")?.addEventListener("change",()=>s(!0)),document.querySelector("#oauth2_use_custom_url")?.addEventListener("change",()=>l(!0)),document.querySelector(".js-ldap-group-toggle").addEventListener("change",u)}if(i){const L=m.value;L==="2"||L==="5"?(document.querySelector("#security_protocol")?.addEventListener("change",Qu),document.querySelector(".js-ldap-group-toggle").addEventListener("change",u),u(),L==="2"&&document.querySelector("#use_paged_search")?.addEventListener("change",n)):L==="6"&&(document.querySelector("#oauth2_provider")?.addEventListener("change",()=>s(!0)),document.querySelector("#oauth2_use_custom_url")?.addEventListener("change",()=>l(!1)),s(!1))}const y=document.querySelector("#auth_name"),A=function(){document.querySelector("#oauth2-callback-url").textContent=`${window.location.origin}${W0}/user/oauth2/${encodeURIComponent(y.value)}/callback`};y.addEventListener("input",A),A()}function G0(){const e=document.querySelector(".page-content.admin.notice");if(!e)return;const t=document.querySelector("#detail-modal");(0,C.jB)(e,".view-detail",n=>n.addEventListener("click",s=>{s.preventDefault();const l=n.closest("tr").querySelector(".notice-description"),u=t.querySelector(".content pre");u.textContent=l.textContent,(0,ke.mD)(t).modal("show")}));const i=document.querySelectorAll(".select.table .ui.checkbox input");(0,C.jB)(e,".select.action",n=>n.addEventListener("click",()=>{switch(n.getAttribute("data-action")){case"select-all":for(const s of i)s.checked=!0;break;case"deselect-all":for(const s of i)s.checked=!1;break;case"inverse":for(const s of i)s.checked=!s.checked;break}})),document.querySelector("#delete-selection")?.addEventListener("click",async function(n){n.preventDefault(),this.classList.add("is-loading","disabled");const s=new FormData;for(const l of i)l.checked&&s.append("ids[]",l.closest(".ui.checkbox").getAttribute("data-id"));await(0,Ae.LO)(this.getAttribute("data-link"),{data:s}),window.location.href=this.getAttribute("data-redirect")})}function Q0(e){window.history.pushState?window.history.pushState(null,null,e):window.location.hash=e}function Yu(e){for(const pe of document.querySelectorAll(".code-view tr.active"))pe.classList.remove("active");const t=document.querySelectorAll(".code-view td.lines-num span[data-line-number]"),i=document.querySelector("a.ref-in-new-issue"),n=document.querySelector("a.copy-line-permalink"),s=document.querySelector("a.view_git_blame"),l=function(pe){if(!i)return;const de=i.getAttribute("data-url-issue-new"),Pe=i.getAttribute("data-url-param-body-link"),Le=`${(0,St.oK)(Pe)}#${pe}`;i.setAttribute("href",`${de}?body=${encodeURIComponent(Le)}`)},u=function(pe){if(!s)return;let de=s.getAttribute("href");de=`${de.replace(/#L\d+$|#L\d+-L\d+$/,"")}`,pe.length!==0&&(de=`${de}#${pe}`),s.setAttribute("href",de)},m=function(pe){if(!n)return;let de=n.getAttribute("data-url");de=`${de.replace(/#L\d+$|#L\d+-L\d+$/,"")}#${pe}`,n.setAttribute("data-clipboard-text",de),n.setAttribute("data-clipboard-text-type","url")},y=e?e.split("-"):[],A=y[0]??"";if(!A)return null;const L=y[1]||A;let z=parseInt(A.substring(1)),X=parseInt(L.substring(1));if(z>X){const pe=z;z=X,X=pe,e=`${L}-${A}`}const _e=t[z-1]??null;for(let pe=z-1;pe<=X-1&&pe<t.length;pe++)t[pe].closest("tr").classList.add("active");return Q0(`#${e}`),l(e),u(e),m(e),_e}function gh(){const e=document.querySelector(".code-line-menu");if(!e)return;for(const s of document.querySelectorAll(".code-line-button"))s.remove();const t=document.querySelector(".code-view tr.active");if(!t)return;const i=t.querySelector("td.lines-num"),n=document.createElement("button");n.classList.add("code-line-button","ui","basic","button"),n.innerHTML=(0,Z.JW)("octicon-kebab-horizontal"),i.prepend(n),n.closest(".code-view").append(e.cloneNode(!0)),Ie(n,{theme:"menu",trigger:"click",hideOnClick:!0,content:e,placement:"right-start",interactive:!0,onShow:s=>{s.popper.addEventListener("click",()=>{s.hide()},{once:!0})}})}function Y0(){if(!document.querySelector(".repo-view-container .file-view"))return;let e;(0,C.ny)(document,"click",".code-view .lines-num span",(i,n)=>{if(!e||!n.shiftKey)e=i.getAttribute("id"),Yu(e);else{const s=i.getAttribute("id");Yu(`${e}-${s}`)}window.getSelection().removeAllRanges(),gh()});const t=()=>{if(!window.location.hash||!document.querySelector(".code-view .lines-num"))return;const i=window.location.hash.substring(1),n=Yu(i);n&&(window.history.scrollRestoration!=="manual"&&(window.history.scrollRestoration="manual"),n.scrollIntoView({block:"start"}),gh())};t(),window.addEventListener("hashchange",t)}function J0(){document.querySelector("#ssh-key-content")?.addEventListener("input",function(){const e=this.value.split(" "),t=document.querySelector("#ssh-key-title");!t.value&&e.length===3&&e[2]!==""&&(t.value=e[2])})}function Z0(){if(!document.querySelector(".user.settings.profile"))return;const e=document.querySelector("#username");e&&e.addEventListener("input",function(){const t=document.querySelector("#name-change-prompt"),i=document.querySelector("#name-change-redirect-prompt");this.value.toLowerCase()!==this.getAttribute("data-name").toLowerCase()?((0,C.fi)(t),(0,C.fi)(i)):((0,C.y9)(t),(0,C.y9)(i))})}function ev(){const e=document.querySelector("#repo_migrating");if(!e)return;document.querySelector("#repo_migrating_retry")?.addEventListener("click",tv);const t=e.getAttribute("data-migrating-repo-link"),i=async()=>{const s=await(0,Ae.fG)(`${t}/-/migrate/status`);if(s.status!==200)return!0;const l=await s.json();return l.message&&(document.querySelector("#repo_migrating_progress_message").textContent=l.message),l.status===4?(window.location.reload(),!1):l.status===3?((0,C.y9)("#repo_migrating_progress"),(0,C.y9)("#repo_migrating"),(0,C.fi)("#repo_migrating_retry"),(0,C.fi)("#repo_migrating_failed"),(0,C.fi)("#repo_migrating_failed_image"),document.querySelector("#repo_migrating_failed_error").textContent=l.message,!1):!0},n=async()=>{let s=!0;try{s=await i()}finally{s&&setTimeout(n,2e3)}};n()}async function tv(e){await(0,Ae.LO)(e.target.getAttribute("data-migrating-task-retry-url")),window.location.reload()}const{pageData:Ju}=window.config;let Zu;function ed(){return Zu||(Zu=nv(Ju.DiffFileTree,Ju.FolderIcon,Ju.FolderOpenIcon)),Zu}function iv(e,t,i){const n=e.fullNameMap[t];if(n){n.IsViewed=i;for(let s=n.ParentEntry;s;s=s.ParentEntry)s.IsViewed=bh(s)}}function vh(e,t){if(e[t.FullName]=t,!!t.Children){t.IsViewed=bh(t);for(const i of t.Children)i.ParentEntry=t,vh(e,i)}}function nv(e,t,i){const n=(0,Re.Kh)({diffFileTree:e,folderIcon:t,folderOpenIcon:i,fileTreeIsVisible:!1,selectedItem:"",fullNameMap:{}});return vh(n.fullNameMap,e.TreeRoot),n}function bh(e){if(e.Children){let t=0;for(const i of e.Children)i.IsViewed&&t++;return t===e.Children.length}return e.IsViewed}const sv=["title"],rv=["innerHTML"],ov={class:"gt-ellipsis"},av={class:"sub-items"},lv=["title","href"],cv=["innerHTML"],uv={class:"gt-ellipsis tw-flex-1"};var dv=(0,c.pM)({__name:"DiffFileTreeItem",props:{item:{}},setup(e){const t=e,i=ed(),n=(0,Re.KR)(t.item.IsViewed);function s(l){const u={"":{name:"octicon-blocked",classes:["text","red"]},added:{name:"octicon-diff-added",classes:["text","green"]},modified:{name:"octicon-diff-modified",classes:["text","yellow"]},deleted:{name:"octicon-diff-removed",classes:["text","red"]},renamed:{name:"octicon-diff-renamed",classes:["text","teal"]},copied:{name:"octicon-diff-renamed",classes:["text","green"]},typechange:{name:"octicon-diff-modified",classes:["text","green"]}};return u[l]??u[""]}return(l,u)=>{const m=(0,c.g2)("DiffFileTreeItem",!0);return l.item.EntryMode==="tree"?((0,c.uX)(),(0,c.CE)(c.FK,{key:0},[(0,c.Lk)("div",{class:(0,W.C4)(["item-directory",{viewed:l.item.IsViewed}]),title:l.item.DisplayName,onClick:u[0]||(u[0]=Di(y=>n.value=!n.value,["stop"]))},[(0,c.Q3)(" directory "),(0,c.bF)((0,Re.R1)(Z.Ah),{name:n.value?"octicon-chevron-right":"octicon-chevron-down"},null,8,["name"]),(0,c.Q3)(" eslint-disable-next-line vue/no-v-html "),(0,c.Lk)("span",{class:"tw-contents",innerHTML:n.value?(0,Re.R1)(i).folderIcon:(0,Re.R1)(i).folderOpenIcon},null,8,rv),(0,c.Lk)("span",ov,(0,W.v_)(l.item.DisplayName),1)],10,sv),(0,c.bo)((0,c.Lk)("div",av,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(l.item.Children,y=>((0,c.uX)(),(0,c.Wv)(m,{key:y.DisplayName,item:y},null,8,["item"]))),128))],512),[[ti,!n.value]])],64)):((0,c.uX)(),(0,c.CE)("a",{key:1,class:(0,W.C4)(["item-file",{selected:(0,Re.R1)(i).selectedItem==="#diff-"+l.item.NameHash,viewed:l.item.IsViewed}]),title:l.item.DisplayName,href:"#diff-"+l.item.NameHash},[(0,c.Q3)(" file "),(0,c.Q3)(" eslint-disable-next-line vue/no-v-html "),(0,c.Lk)("span",{class:"tw-contents",innerHTML:l.item.FileIcon},null,8,cv),(0,c.Lk)("span",uv,(0,W.v_)(l.item.DisplayName),1),(0,c.bF)((0,Re.R1)(Z.Ah),{name:s(l.item.DiffStatus).name,class:(0,W.C4)(s(l.item.DiffStatus).classes)},null,8,["name","class"])],10,lv))}}}),fv=(0,Xi.A)(dv,[["__scopeId","data-v-a138c97c"]]);const hv={key:0,class:"diff-file-tree-items"},_h="diff_file_tree_visible";var mv=(0,c.pM)({__name:"DiffFileTree",setup(e){const t=ed();(0,c.sV)(()=>{t.fileTreeIsVisible=localStorage.getItem(_h)!=="false",document.querySelector(".diff-toggle-file-tree-button").addEventListener("click",s),i(),window.addEventListener("hashchange",i)}),(0,c.hi)(()=>{document.querySelector(".diff-toggle-file-tree-button").removeEventListener("click",s),window.removeEventListener("hashchange",i)});function i(){t.selectedItem=window.location.hash,n()}function n(){if(t.selectedItem){const m=document.querySelector(t.selectedItem);m?.getAttribute("data-folded")==="true"&&Ba(m,m.querySelector(".fold-file"),!1)}}function s(){l(!t.fileTreeIsVisible)}function l(m){t.fileTreeIsVisible=m,localStorage.setItem(_h,t.fileTreeIsVisible.toString()),u(t.fileTreeIsVisible)}function u(m){const y=document.querySelector(".diff-toggle-file-tree-button"),[A,L]=y.querySelectorAll(".icon"),z=document.querySelector("#diff-file-tree"),X=y.getAttribute(m?"data-hide-text":"data-show-text");y.setAttribute("data-tooltip-content",X),(0,C.oi)(z,m),(0,C.oi)(A,!m),(0,C.oi)(L,m)}return(m,y)=>(0,Re.R1)(t).fileTreeIsVisible?((0,c.uX)(),(0,c.CE)("div",hv,[(0,c.Q3)(" only render the tree if we're visible. in many cases this is something that doesn't change very often "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,Re.R1)(t).diffFileTree.TreeRoot.Children,A=>((0,c.uX)(),(0,c.Wv)(fv,{key:A.FullName,item:A},null,8,["item"]))),128))])):(0,c.Q3)("v-if",!0)}}),pv=(0,Xi.A)(mv,[["__scopeId","data-v-12a35ef6"]]);function gv(){const e=document.querySelector("#diff-file-tree");if(!e)return;Ai(pv).mount(e)}const vv={class:"ui scrolling dropdown custom diff-commit-selector"},bv=["data-tooltip-content","aria-label","aria-controls","aria-activedescendant"],_v=["id","aria-expanded"],yv={key:0,class:"loading-indicator is-loading"},wv=["id"],Sv={class:"gt-ellipsis"},xv={class:"gt-ellipsis text light-2 tw-mb-0"},jv={class:"gt-ellipsis"},Ev={class:"gt-ellipsis text light-2"},Av={key:3,class:"info text light-2"},Cv=["data-commit-idx","onKeydown","onMouseover","onClick"],kv={class:"tw-flex-1 tw-flex tw-flex-col tw-gap-1"},Tv={class:"gt-ellipsis commit-list-summary"},Lv={class:"gt-ellipsis text light-2"},Rv={class:"text right"},Mv=["datetime"],Dv={class:"tw-font-mono"};function Ov(e,t,i,n,s,l){const u=(0,c.g2)("svg-icon");return(0,c.uX)(),(0,c.CE)("div",vv,[(0,c.Lk)("button",{ref:"expandBtn",class:"ui tiny basic button",onClick:t[0]||(t[0]=Di(m=>e.toggleMenu(),["stop"])),"data-tooltip-content":e.locale.filter_changes_by_commit,"aria-haspopup":"true","aria-label":e.locale.filter_changes_by_commit,"aria-controls":e.uniqueIdMenu,"aria-activedescendant":e.uniqueIdShowAll},[(0,c.bF)(u,{name:"octicon-git-commit"})],8,bv),(0,c.Q3)(' this dropdown is not managed by Fomantic UI, so it needs some classes like "transition" explicitly '),(0,c.bo)((0,c.Lk)("div",{class:(0,W.C4)(["left menu transition",{visible:e.menuVisible}]),id:e.uniqueIdMenu,"aria-expanded":e.menuVisible?"true":"false"},[e.isLoading?((0,c.uX)(),(0,c.CE)("div",yv)):(0,c.Q3)("v-if",!0),e.isLoading?(0,c.Q3)("v-if",!0):((0,c.uX)(),(0,c.CE)("div",{key:1,class:"item",id:e.uniqueIdShowAll,ref:"showAllChanges",role:"menuitem",onKeydown:t[1]||(t[1]=se(m=>e.showAllChanges(),["enter"])),onClick:t[2]||(t[2]=m=>e.showAllChanges())},[(0,c.Lk)("div",Sv,(0,W.v_)(e.locale.show_all_commits),1),(0,c.Lk)("div",xv,(0,W.v_)(e.locale.stats_num_commits),1)],40,wv)),(0,c.Q3)(" only show the show changes since last review if there is a review AND we are commits ahead of the last review "),e.lastReviewCommitSha!=null?((0,c.uX)(),(0,c.CE)("div",{key:2,class:(0,W.C4)(["item",{disabled:!e.commitsSinceLastReview}]),role:"menuitem",onKeydown:t[3]||(t[3]=se(m=>e.changesSinceLastReviewClick(),["enter"])),onClick:t[4]||(t[4]=m=>e.changesSinceLastReviewClick())},[(0,c.Lk)("div",jv,(0,W.v_)(e.locale.show_changes_since_your_last_review),1),(0,c.Lk)("div",Ev,(0,W.v_)(e.commitsSinceLastReview)+" commits ",1)],34)):(0,c.Q3)("v-if",!0),e.isLoading?(0,c.Q3)("v-if",!0):((0,c.uX)(),(0,c.CE)("span",Av,(0,W.v_)(e.locale.select_commit_hold_shift_for_range),1)),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.commits,(m,y)=>((0,c.uX)(),(0,c.CE)("div",{key:m.id,class:(0,W.C4)(["item",{selected:m.selected,hovered:m.hovered}]),role:"menuitem","data-commit-idx":y,onKeydown:[se(Di(A=>e.commitClicked(m.id),["exact"]),["enter"]),se(Di(A=>e.commitClickedShift(m),["shift","exact"]),["enter"])],onMouseover:Di(A=>e.highlight(m),["shift"]),onClick:[Di(A=>e.commitClicked(m.id),["exact"]),Di(A=>e.commitClicked(m.id,!0),["ctrl","exact"]),Di(A=>e.commitClicked(m.id,!0),["meta","exact"]),Di(A=>e.commitClickedShift(m),["shift","exact","stop","prevent"])]},[(0,c.Lk)("div",kv,[(0,c.Lk)("div",Tv,(0,W.v_)(m.summary),1),(0,c.Lk)("div",Lv,[(0,c.eW)((0,W.v_)(m.committer_or_author_name)+" ",1),(0,c.Lk)("span",Rv,[(0,c.Q3)(" TODO: make this respect the PreferredTimestampTense setting "),(0,c.Lk)("relative-time",{prefix:"",datetime:m.time,"data-tooltip-content":"","data-tooltip-interactive":"true"},(0,W.v_)(m.time),9,Mv)])])]),(0,c.Lk)("div",Dv,(0,W.v_)(m.short_sha),1)],42,Cv))),128))],10,_v),[[ti,e.menuVisible]])])}var qv=(0,c.pM)({components:{SvgIcon:Z.Ah},data:()=>{const e=document.querySelector("#diff-commit-select");return{menuVisible:!1,isLoading:!1,queryParams:e.getAttribute("data-queryparams"),issueLink:e.getAttribute("data-issuelink"),locale:{filter_changes_by_commit:e.getAttribute("data-filter_changes_by_commit")},mergeBase:e.getAttribute("data-merge-base"),commits:[],hoverActivated:!1,lastReviewCommitSha:"",uniqueIdMenu:(0,ke.Ae)(),uniqueIdShowAll:(0,ke.Ae)()}},computed:{commitsSinceLastReview(){return this.lastReviewCommitSha?this.commits.length-this.commits.findIndex(e=>e.id===this.lastReviewCommitSha)-1:0}},mounted(){document.body.addEventListener("click",this.onBodyClick),this.$el.addEventListener("keydown",this.onKeyDown),this.$el.addEventListener("keyup",this.onKeyUp)},unmounted(){document.body.removeEventListener("click",this.onBodyClick),this.$el.removeEventListener("keydown",this.onKeyDown),this.$el.removeEventListener("keyup",this.onKeyUp)},methods:{onBodyClick(e){this.$el.contains(e.target)||this.menuVisible&&this.toggleMenu()},onKeyDown(e){if(!this.menuVisible)return;const t=document.activeElement;if(this.$el.contains(t)){switch(e.key){case"ArrowDown":e.preventDefault(),this.focusElem(t.nextElementSibling,t);break;case"ArrowUp":e.preventDefault(),this.focusElem(t.previousElementSibling,t);break;case"Escape":e.preventDefault(),t.tabIndex=-1,this.toggleMenu();break}if(e.key==="ArrowDown"||e.key==="ArrowUp"){const i=document.activeElement,n=i?.matches(".item")?i.getAttribute("data-commit-idx"):null;n&&this.highlight(this.commits[Number(n)])}}},onKeyUp(e){if(!this.menuVisible)return;const t=document.activeElement;if(this.$el.contains(t)&&e.key==="Shift"&&this.hoverActivated){this.hoverActivated=!1;for(const i of this.commits)i.hovered=!1,i.selected=!1}},highlight(e){if(!this.hoverActivated)return;const t=this.commits.findIndex(n=>n.selected),i=this.commits.findIndex(n=>n.id===e.id);for(const[n,s]of this.commits.entries())s.hovered=Math.min(t,i)<=n&&n<=Math.max(t,i)},focusElem(e,t){e&&(e.tabIndex=0,t&&(t.tabIndex=-1),e.focus())},async toggleMenu(){if(this.menuVisible=!this.menuVisible,!this.commits.length&&this.menuVisible&&!this.isLoading){this.isLoading=!0;try{await this.fetchCommits()}finally{this.isLoading=!1}}this.$nextTick(()=>{this.menuVisible?this.focusElem(this.$refs.showAllChanges,this.$refs.expandBtn):this.focusElem(this.$refs.expandBtn,this.$refs.showAllChanges)})},async fetchCommits(){const t=await(await(0,Ae.fG)(`${this.issueLink}/commits/list`)).json();this.commits.push(...t.commits.map(i=>(i.hovered=!1,i))),this.commits.reverse(),this.lastReviewCommitSha=t.last_review_commit_sha||null,this.lastReviewCommitSha&&!this.commits.some(i=>i.id===this.lastReviewCommitSha)&&(this.lastReviewCommitSha=null),Object.assign(this.locale,t.locale)},showAllChanges(){window.location.assign(`${this.issueLink}/files${this.queryParams}`)},changesSinceLastReviewClick(){window.location.assign(`${this.issueLink}/files/${this.lastReviewCommitSha}..${this.commits.at(-1).id}${this.queryParams}`)},commitClicked(e,t=!1){const i=`${this.issueLink}/commits/${e}${this.queryParams}`;t?window.open(i):window.location.assign(i)},commitClickedShift(e){if(this.hoverActivated=!this.hoverActivated,e.selected=!0,!this.hoverActivated){const t=this.commits.findIndex(l=>l.selected),i=this.commits.findLastIndex(l=>l.selected);let n;t===0?n=this.mergeBase:n=this.commits[t-1].id;const s=this.commits[i].id;t===i?window.location.assign(`${this.issueLink}/commits/${s}${this.queryParams}`):n===this.mergeBase&&s===this.commits.at(-1).id?window.location.assign(`${this.issueLink}/files${this.queryParams}`):window.location.assign(`${this.issueLink}/files/${n}..${s}${this.queryParams}`)}}}}),Pv=(0,Xi.A)(qv,[["render",Ov],["__scopeId","data-v-c589fa0e"]]);function Fv(){const e=document.querySelector("#diff-commit-select");if(!e)return;Ai(Pv).mount(e)}const{pageData:Iv}=window.config,Ua=Iv.prReview||{},yh="viewed-file-checked-form",wh=".viewed-file-form",Nv="#expand-files-btn",Hv="#collapse-files-btn";function Sh(){document.querySelector("#viewed-files-summary")?.setAttribute("value",Ua.numberOfViewedFiles);const t=document.querySelector("#viewed-files-summary-label");t&&(t.innerHTML=t.getAttribute("data-text-changed-template").replace("%[1]d",Ua.numberOfViewedFiles).replace("%[2]d",Ua.numberOfFiles))}function Bv(){Ua.numberOfViewedFiles=document.querySelectorAll(`${wh} > input[type=checkbox][checked]`).length,Sh()}function xh(){for(const e of document.querySelectorAll(`${wh}:not([data-has-viewed-checkbox-listener="true"])`)){e.setAttribute("data-has-viewed-checkbox-listener",String(!0));const t=e.querySelector("input[type=checkbox]");t.addEventListener("input",function(){this.checked?(e.classList.add(yh),t.setAttribute("checked",""),Ua.numberOfViewedFiles++):(e.classList.remove(yh),t.removeAttribute("checked"),Ua.numberOfViewedFiles--),Sh(),e.parentNode.querySelector(".changed-since-last-review")?.remove();const n=t.getAttribute("name");iv(ed(),n,this.checked);const s={};s[n]=this.checked;const l={files:s},u=e.getAttribute("data-headcommit");u&&(l.headCommitSHA=u),(0,Ae.LO)(e.getAttribute("data-link"),{data:l});const m=e.closest(".diff-file-header");Ba(m.closest(".file-content"),m.querySelector(".fold-file"),this.checked)})}}function $v(){document.querySelector(Nv)?.addEventListener("click",()=>{for(const e of document.querySelectorAll('.file-content[data-folded="true"]'))Ba(e,e.querySelector(".fold-file"),!1)}),document.querySelector(Hv)?.addEventListener("click",()=>{for(const e of document.querySelectorAll('.file-content:not([data-folded="true"])'))e.getAttribute("id")!=="diff-incomplete"&&Ba(e,e.querySelector(".fold-file"),!0)})}const{i18n:Uv}=window.config;function Vv(e){(0,C.jB)(e,".file-view-toggle",t=>t.addEventListener("click",()=>{(0,C.D6)(t,".file-view-toggle",n=>n.classList.remove("active")),t.classList.add("active");const i=document.querySelector(t.getAttribute("data-toggle-selector"));if(!i)throw new Error("Target element not found");(0,C.y9)((0,C.D6)(i)),(0,C.fi)(i)}))}function Wv(){(0,C.ny)(document,"submit",".conversation-holder form",async(e,t)=>{t.preventDefault();const i=e.querySelector("textarea");if(hh(i)&&!e.classList.contains("is-loading"))try{e.classList.add("is-loading");const n=new FormData(e),s=(0,C.IU)(t);(s?.nodeName==="BUTTON"||s?.nodeName==="INPUT"&&s.type==="submit")&&s.name&&n.append(s.name,s.value);const u=e.closest("tr")?.getAttribute("data-line-type"),m=await(0,Ae.LO)(e.getAttribute("action"),{data:n}),y=(0,C.SL)(await m.text()),A=y.getAttribute("data-path"),L=y.getAttribute("data-side"),z=y.getAttribute("data-idx");if(e.closest(".conversation-holder").replaceWith(y),e=null,u){let X;u==="same"?X=`[data-path="${A}"] .add-code-comment[data-idx="${z}"]`:X=`[data-path="${A}"] .add-code-comment[data-side="${L}"][data-idx="${z}"]`;for(const _e of document.querySelectorAll(X))_e.classList.add("tw-invisible")}if(!s||s?.matches('button[name="pending_review"]')){const X=document.querySelector("#review-box"),_e=X?.querySelector(".review-comments-counter");if(!_e)return;const pe=parseInt(_e.getAttribute("data-pending-comment-number"))+1||1;_e.setAttribute("data-pending-comment-number",String(pe)),_e.textContent=String(pe),(0,C.b7)(X,"pulse-1p5-200")}}catch(n){console.error("Error:",n),gt(Uv.network_error)}finally{e?.classList.remove("is-loading")}}),(0,C.ny)(document,"click",".resolve-conversation",async(e,t)=>{t.preventDefault();const i=e.getAttribute("data-comment-id"),n=e.getAttribute("data-origin"),s=e.getAttribute("data-action"),l=e.getAttribute("data-update-url");try{const m=await(await(0,Ae.LO)(l,{data:new URLSearchParams({origin:n,action:s,comment_id:i})})).text(),y=e.closest(".conversation-holder");if(y){const A=(0,C.SL)(m);y.replaceWith(A)}else window.location.reload()}catch(u){console.error("Error:",u)}})}function zv(){(0,C.ny)(document,"click",".previous-conversation, .next-conversation",(e,t)=>{t.preventDefault();const i=e.matches(".previous-conversation"),n=e.closest(".comment-code-cloud"),s=document.querySelectorAll(".comment-code-cloud:not(.tw-hidden)"),l=Array.from(s).indexOf(n),u=l>0?l-1:s.length-1,m=l<s.length-1?l+1:0,L=s[i?u:m].querySelector(".comment").id;window.location.href=`#${L}`})}function jh(){for(const e of document.querySelectorAll(".diff-header-popup-btn:not([data-header-popup-initialized])")){e.setAttribute("data-header-popup-initialized","");const t=e.nextElementSibling;if(!t?.matches(".tippy-target"))throw new Error("Popup element not found");Ie(e,{content:t,theme:"menu",placement:"bottom",trigger:"click",interactive:!0,hideOnClick:!0})}}function Eh(){tf(),xh(),Bv(),Ld(),jh()}async function Ah(e){if(e.classList.contains("disabled"))return!1;e.classList.add("disabled");const t=e.getAttribute("data-href");try{const n=await(await(0,Ae.fG)(t)).text(),l=(0,St.a8)(n,"text/html").querySelector("#diff-file-boxes");return document.querySelector("#diff-incomplete").replaceWith(...Array.from(l.children)),Eh(),!0}catch(i){console.error("Error:",i),gt("An error occurred while loading more files.")}finally{e.classList.remove("disabled")}return!1}function Kv(){(0,C.ny)(document,"click","a#diff-show-more-files",(e,t)=>{t.preventDefault(),Ah(e)}),(0,C.ny)(document,"click","a.diff-load-button",async(e,t)=>{if(t.preventDefault(),e.classList.contains("disabled"))return;e.classList.add("disabled");const i=e.getAttribute("data-href");try{const s=await(await(0,Ae.fG)(i)).text(),u=(0,St.a8)(s,"text/html").querySelector("#diff-file-boxes .diff-file-body .file-body"),m=Array.from(u.children);e.parentElement.replaceWith(...m);for(const y of m)window.htmx.process(y);Eh()}catch(n){console.error("Error:",n)}finally{e.classList.remove("disabled")}})}async function Ch(){const e=window.location.hash;if(!(!e.startsWith("#diff-")&&!e.startsWith("#issuecomment-")))for(;;){const t=document.getElementById(e.substring(1));if(t){t.scrollIntoView();return}const i=document.querySelector("#diff-show-more-files");if(!i||!await Ah(i))return}}function Xv(){window.addEventListener("hashchange",Ch),Ch()}function Gv(){Wv(),document.querySelector("#diff-file-boxes")&&(zv(),gv(),Fv(),Kv(),jh(),xh(),$v(),Xv(),yc("#diff-file-boxes .diff-file-box",Vv),(0,C.ny)(document,"click",".fold-file",e=>{ng(e.closest(".file-content"),e)}))}const{appSubUrl:Qv}=window.config;function Yv(){const e=document.querySelector(".page-content.organization.new.team");e&&(0,C.jB)(e,"input[name=permission]",t=>t.addEventListener("change",()=>{const i=e.querySelector("input[name=permission]:checked")?.value;(0,C.oi)(e.querySelectorAll(".team-units"),i!=="admin")}))}function Jv(){const e=(0,ke.mD)("#search-repo-box");e.search({minCharacters:2,apiSettings:{url:`${Qv}/repo/search?q={query}&uid=${e.data("uid")}`,onResponse(t){const i=[];for(const n of t.data)i.push({title:n.repository.full_name.split("/")[1],description:n.repository.full_name});return{results:i}}},searchFields:["full_name"],showNoResults:!1})}function Zv(){document.querySelector(".page-content.organization")&&(Yv(),Jv())}const{appSubUrl:Mo}=window.config;async function eb(){const e=document.querySelector(".user.signin.webauthn-prompt"),t=document.querySelector(".signin-passkey");if(!(!e&&!t)){if(!window.isSecureContext){(0,C.y9)(t);return}Th()&&(t&&t.addEventListener("click",tb),e&&ib())}}async function tb(){const e=await(0,Ae.fG)(`${Mo}/user/webauthn/passkey/assertion`);if(!e.ok){Ds("unknown");return}const t=await e.json();t.publicKey.challenge=(0,St.vd)(t.publicKey.challenge);for(const i of t.publicKey.allowCredentials??[])i.id=(0,St.vd)(i.id);try{const i=await navigator.credentials.get({publicKey:t.publicKey}),n=i.response,s=new Uint8Array(n.authenticatorData),l=new Uint8Array(n.clientDataJSON),u=new Uint8Array(i.rawId),m=new Uint8Array(n.signature),y=new Uint8Array(n.userHandle),A=await(0,Ae.LO)(`${Mo}/user/webauthn/passkey/login`,{data:{id:i.id,rawId:(0,St.vh)(u),type:i.type,clientExtensionResults:i.getClientExtensionResults(),response:{authenticatorData:(0,St.vh)(s),clientDataJSON:(0,St.vh)(l),signature:(0,St.vh)(m),userHandle:(0,St.vh)(y)}}});if(A.status===500){Ds("unknown");return}else if(!A.ok){Ds("unable-to-process");return}const L=await A.json();window.location.href=L?.redirect??`${Mo}/`}catch(i){Ds("general",i.message)}}async function ib(){const e=await(0,Ae.fG)(`${Mo}/user/webauthn/assertion`);if(!e.ok){Ds("unknown");return}const t=await e.json();t.publicKey.challenge=(0,St.vd)(t.publicKey.challenge);for(const i of t.publicKey.allowCredentials??[])i.id=(0,St.vd)(i.id);try{const i=await navigator.credentials.get({publicKey:t.publicKey});await kh(i)}catch(i){if(!t.publicKey.extensions?.appid){Ds("general",i.message);return}delete t.publicKey.extensions.appid;try{const n=await navigator.credentials.get({publicKey:t.publicKey});await kh(n)}catch(n){Ds("general",n.message)}}}async function kh(e){const t=new Uint8Array(e.response.authenticatorData),i=new Uint8Array(e.response.clientDataJSON),n=new Uint8Array(e.rawId),s=new Uint8Array(e.response.signature),l=new Uint8Array(e.response.userHandle),u=await(0,Ae.LO)(`${Mo}/user/webauthn/assertion`,{data:{id:e.id,rawId:(0,St.vh)(n),type:e.type,clientExtensionResults:e.getClientExtensionResults(),response:{authenticatorData:(0,St.vh)(t),clientDataJSON:(0,St.vh)(i),signature:(0,St.vh)(s),userHandle:(0,St.vh)(l)}}});if(u.status===500){Ds("unknown");return}else if(!u.ok){Ds("unable-to-process");return}const m=await u.json();window.location.href=m?.redirect??`${Mo}/`}async function nb(e){const t=new Uint8Array(e.response.attestationObject),i=new Uint8Array(e.response.clientDataJSON),n=new Uint8Array(e.rawId),s=await(0,Ae.LO)(`${Mo}/user/settings/security/webauthn/register`,{data:{id:e.id,rawId:(0,St.vh)(n),type:e.type,response:{attestationObject:(0,St.vh)(t),clientDataJSON:(0,St.vh)(i)}}});if(s.status===409){Ds("duplicated");return}else if(s.status!==201){Ds("unknown");return}window.location.reload()}function Ds(e,t=""){const i=document.querySelector("#webauthn-error-msg");if(e==="general")i.textContent=t||"unknown error";else{const n=document.querySelector(`#webauthn-error [data-webauthn-error-msg=${e}]`);n?i.textContent=`${n.textContent}${t?` ${t}`:""}`:i.textContent=`unknown error type: ${e}${t?` ${t}`:""}`}(0,C.fi)("#webauthn-error")}function Th(){return window.isSecureContext?typeof window.PublicKeyCredential!="function"?(Ds("browser"),!1):!0:(Ds("insecure"),!1)}function sb(){const e=document.querySelector("#register-webauthn");if(e){if(!Th()){e.disabled=!0;return}e.addEventListener("click",async t=>{t.preventDefault(),await rb()})}}async function rb(){const e=document.querySelector("#nickname"),t=new FormData;t.append("name",e.value);const i=await(0,Ae.LO)(`${Mo}/user/settings/security/webauthn/request_register`,{data:t});if(i.status===409){Ds("duplicated");return}else if(!i.ok){Ds("unknown");return}const n=await i.json();if(e.closest("div.field").classList.remove("error"),n.publicKey.challenge=(0,St.vd)(n.publicKey.challenge),n.publicKey.user.id=(0,St.vd)(n.publicKey.user.id),n.publicKey.excludeCredentials)for(const s of n.publicKey.excludeCredentials)s.id=(0,St.vd)(s.id);try{const s=await navigator.credentials.create({publicKey:n.publicKey});await nb(s)}catch(s){Ds("unknown",s)}}function ob(){document.addEventListener("click",e=>{if(e.target.matches(".remove-rel-attach")){const t=e.target.getAttribute("data-uuid"),i=e.target.getAttribute("data-id");document.querySelector(`input[name='attachment-del-${t}']`).value="true",(0,C.y9)(`#attachment-${i}`)}})}function ab(){document.querySelector(".repository.new.release")&&lb()}function lb(){const e=document.querySelector("#tag-name-editor");if(!e)return;const t=JSON.parse(e.getAttribute("data-existing-tags"));if(!Array.isArray(t))return;const i=e.getAttribute("data-tag-helper"),n=e.getAttribute("data-tag-helper-new"),s=e.getAttribute("data-tag-helper-existing"),l=document.querySelector("#tag-name"),u=function(m){const y=m.value,A=document.querySelector("#tag-helper");t.includes(y)?((0,C.y9)("#tag-target-selector"),A.textContent=s):((0,C.fi)("#tag-target-selector"),A.textContent=y?n:i)};u(l),l.addEventListener("input",m=>{u(m.target)})}const{appSubUrl:cb}=window.config,ub=/^\S+@\S+$/;function db(){const e=document.querySelector("#search-user-box");if(!e)return;const t=e.getAttribute("data-allow-email")==="true",i=e.getAttribute("data-allow-email-description")??void 0;(0,ke.mD)(e).search({minCharacters:2,apiSettings:{url:`${cb}/user/search_candidates?q={query}`,onResponse(n){const s=[],l=e.querySelector("input").value,u=l.toUpperCase();for(const m of n.data){const y={title:m.login,image:m.avatar_url,description:R(m.full_name)};u===m.login.toUpperCase()?s.unshift(y):s.push(y)}if(t&&!s.length&&ub.test(l)){const m={title:l,description:i};s.push(m)}return{results:s}}},searchFields:["login","full_name"],showNoResults:!1})}function fb(){const e=document.querySelector(".page-content.install");e&&(e.classList.contains("post-install")?mb():hb())}function hb(){const e="gitea",t="gitea",i={mysql:"127.0.0.1:3306",postgres:"127.0.0.1:5432",mssql:"127.0.0.1:1433"},n=document.querySelector("#db_host"),s=document.querySelector("#db_user"),l=document.querySelector("#db_name");document.querySelector("#db_type").addEventListener("change",function(){const y=this.value;if((0,C.y9)("div[data-db-setting-for]"),(0,C.fi)(`div[data-db-setting-for=${y}]`),y!=="sqlite3"){(0,C.fi)("div[data-db-setting-for=common-host]");const A=n.value;(!A||Object.values(i).includes(A))&&(n.value=i[y]??""),!s.value&&!l.value&&(s.value=e,l.value=t)}}),document.querySelector("#db_type").dispatchEvent(new Event("change"));const u=document.querySelector("#app_url");u.value.includes("://localhost")&&(u.value=window.location.href);const m=document.querySelector("#domain");m.value.trim()==="localhost"&&(m.value=window.location.hostname),document.querySelector("#offline-mode input").addEventListener("change",function(){this.checked&&(document.querySelector("#disable-gravatar input").checked=!0,document.querySelector("#federated-avatar-lookup input").checked=!1)}),document.querySelector("#disable-gravatar input").addEventListener("change",function(){this.checked?document.querySelector("#federated-avatar-lookup input").checked=!1:document.querySelector("#offline-mode input").checked=!1}),document.querySelector("#federated-avatar-lookup input").addEventListener("change",function(){this.checked&&(document.querySelector("#disable-gravatar input").checked=!1,document.querySelector("#offline-mode input").checked=!1)}),document.querySelector("#enable-openid-signin input").addEventListener("change",function(){this.checked?document.querySelector("#disable-registration input").checked||(document.querySelector("#enable-openid-signup input").checked=!0):document.querySelector("#enable-openid-signup input").checked=!1}),document.querySelector("#disable-registration input").addEventListener("change",function(){this.checked?(document.querySelector("#enable-captcha input").checked=!1,document.querySelector("#enable-openid-signup input").checked=!1):document.querySelector("#enable-openid-signup input").checked=!0}),document.querySelector("#enable-captcha input").addEventListener("change",function(){this.checked&&(document.querySelector("#disable-registration input").checked=!1)})}function mb(){const e=document.querySelector("#goto-user-login");if(!e)return;const t=e.getAttribute("href");let i=setInterval(async()=>{try{const n=await(0,Ae.fG)(t);i&&n.status===200&&(clearInterval(i),i=null,window.location.href=t)}catch{}},1e3)}function pb(){if(!document.querySelectorAll(".new.webhook").length)return;for(const t of document.querySelectorAll(".events.checkbox input"))t.addEventListener("change",function(){this.checked&&(0,C.fi)(".events.fields")});for(const t of document.querySelectorAll(".non-events.checkbox input"))t.addEventListener("change",function(){this.checked&&(0,C.y9)(".events.fields")});const e=document.querySelector("#http_method");if(e){const t=function(){const i=e.value==="POST";(0,C.oi)(document.querySelector("#content_type").closest(".field"),i)};t(),e.addEventListener("change",t)}document.querySelector("#test-delivery")?.addEventListener("click",async function(){this.classList.add("is-loading","disabled"),await(0,Ae.LO)(this.getAttribute("data-link")),setTimeout(()=>{window.location.href=this.getAttribute("data-redirect")},5e3)})}function gb(){vb(),bb()}function vb(){for(const e of document.querySelectorAll(".show-create-branch-modal"))e.addEventListener("click",()=>{const t=e.getAttribute("data-modal-form")||"#create-branch-form",i=document.querySelector(t);if(!i)return;i.action=`${i.getAttribute("data-base-action")}${e.getAttribute("data-branch-from-urlcomponent")}`;const n=e.getAttribute("data-modal-from-span")||"#modal-create-branch-from-span";document.querySelector(n).textContent=e.getAttribute("data-branch-from"),(0,ke.mD)(e.getAttribute("data-modal")).modal("show")})}function bb(){for(const e of document.querySelectorAll(".show-rename-branch-modal"))e.addEventListener("click",()=>{const t=e.getAttribute("data-modal"),i=document.querySelector(t),n=e.getAttribute("data-old-branch-name");i.querySelector("input[name=from]").value=n;const s=i.querySelector(".default-branch-warning");(0,C.oi)(s,e.getAttribute("data-is-default-branch")==="true");const l=i.querySelector("[data-rename-branch-to]");l.textContent=l.getAttribute("data-rename-branch-to").replace("%s",n)})}function _b(e){return/.*[^/]\/[^/].*/.test(e)}function Lh(e){const t=document.querySelector(e);if(!t)return;const i=t.querySelector("#issue-label-edit-modal");if(!i)return;const n=i.querySelector('input[name="id"]'),s=i.querySelector(".label-name-input"),l=i.querySelector(".label-exclusive-input-field"),u=i.querySelector(".label-exclusive-input"),m=i.querySelector(".label-exclusive-warning"),y=i.querySelector(".label-exclusive-order-input-field"),A=i.querySelector(".label-exclusive-order-input"),L=i.querySelector(".label-is-archived-input-field"),z=i.querySelector(".label-is-archived-input"),X=i.querySelector(".label-desc-input"),_e=i.querySelector(".js-color-picker-input input"),pe=()=>{const Te=_b(s.value);l.classList.toggle("disabled",!Te);const He=Te&&u.checked&&i.hasAttribute("data-need-warn-exclusive");(0,C.oi)(m,He),Te||(u.checked=!1),(0,C.oi)(y,u.checked),parseInt(A.value)<=0?A.style.color="var(--color-placeholder-text) !important":A.style.color=null},de=Te=>{const He=i.querySelector("form");n.value=Te.getAttribute("data-label-id")||"",s.value=Te.getAttribute("data-label-name")||"",A.value=Te.getAttribute("data-label-exclusive-order")||"0",z.checked=Te.getAttribute("data-label-is-archived")==="true",u.checked=Te.getAttribute("data-label-exclusive")==="true",X.value=Te.getAttribute("data-label-description")||"",_e.value=Te.getAttribute("data-label-color")||"",_e.dispatchEvent(new Event("input",{bubbles:!0}));const U=!!n.value,Se=parseInt(Te.getAttribute("data-label-num-issues")||"0");i.toggleAttribute("data-need-warn-exclusive",!u.checked&&Se>0),i.querySelector(".header").textContent=U?i.getAttribute("data-text-edit-label"):i.getAttribute("data-text-new-label");const ze=i.getAttribute("data-current-page-link");He.action=U?`${ze}/edit`:`${ze}/new`,(0,C.oi)(L,U),pe(),(0,ke.mD)(i).modal({onApprove(){if(!He.checkValidity())return He.reportValidity(),!1;He.submit()}}).modal("show")};i.addEventListener("input",()=>pe());const Pe=t.querySelector(".ui.button.new-label");Pe?.addEventListener("click",()=>de(Pe));const Le=t.querySelectorAll(".edit-label-button");for(const Te of Le)Te.addEventListener("click",He=>{He.preventDefault(),de(Te)})}function yb(){document.querySelectorAll(".organization").length&&(document.querySelector(".organization.settings.options #org_name")?.addEventListener("input",function(){const e=this.value.toLowerCase()!==this.getAttribute("data-org-name").toLowerCase();(0,C.oi)("#org-name-change-prompt",e)}),Lh(".page-content.organization.settings.labels"))}var wb=__webpack_require__("./node_modules/jquery/dist/jquery.js"),Mn=__webpack_require__.n(wb);function Sb(){for(const e of document.querySelectorAll(".ui.checkbox")){if(e.hasAttribute("data-checkbox-patched"))continue;const t=e.querySelector("label"),i=e.querySelector("input");!t||!i||((0,ke.iZ)(t,i),e.setAttribute("data-checkbox-patched","true"))}}function xb(){for(const e of document.querySelectorAll(".ui.form .field")){if(e.hasAttribute("data-field-patched"))continue;const t=e.querySelector(":scope > label"),i=e.querySelector(":scope > input");!t||!i||((0,ke.iZ)(t,i),e.setAttribute("data-field-patched","true"))}}const Ar="_giteaAriaPatchDropdown",td=Mn().fn.dropdown;function jb(){if(Mn().fn.dropdown===id)throw new Error("initAriaDropdownPatch could only be called once");Mn().fn.dropdown.settings.onAfterFiltered=Eb,Mn().fn.dropdown=id,Mn().fn.fomanticExt.onResponseKeepSelectedItem=Rb,id.settings=td.settings}function id(...e){const t=td.apply(this,e);for(let i of this){i=i.closest(".ui.dropdown"),i[Ar]||kb(i);const n=Mn()(i),s=n.data("module-dropdown");s.giteaDelegated||(s.giteaDelegated=!0,Ab(n))}return t}function Rh(e,t){t.id||(t.id=(0,ke.Ae)()),t.setAttribute("role",e[Ar].listItemRole),t.setAttribute("tabindex","-1");for(const i of t.querySelectorAll("a, input, button"))i.setAttribute("tabindex","-1")}function Mh(e){e.id||(e.id=(0,ke.Ae)()),e.tabIndex=-1;const t=e.querySelector(".delete.icon");t&&(t.setAttribute("aria-hidden","false"),t.setAttribute("aria-label",window.config.i18n.remove_label_str.replace("%s",e.getAttribute("data-value"))),t.setAttribute("role","button"))}function Eb(){const e=Mn()(this).closest(".ui.dropdown"),t=e.dropdown("setting","hideDividers")==="empty",i=e[0].querySelector(".scrolling.menu")||e[0].querySelector(".menu");t&&i&&Lb(i)}function Ab(e){const t=td.bind(e),i={...t("setting","templates"),t:performance.now()},n=i.menu;i.menu=function(m,y,A,L){const z=n(m,y,A,L),X=document.createElement("div");X.innerHTML=z;const _e=Mn()(X);return _e.find("> .item").each((de,Pe)=>Rh(e[0],Pe)),e[0][Ar].deferredRefreshAriaActiveItem(),_e.html()},t("setting","templates",i);const s=t("setting","onLabelCreate");t("setting","onLabelCreate",function(m,y){const A=s.call(this,m,y);return Mh(A[0]),A});const l=t("internal","set"),u=l.direction;l.direction=function(m){u.call(this,m);const y=t("setting","className");m=m||e.find("> .menu");const A=m[0];A.classList.add(y.loading),A.getBoundingClientRect().right>document.documentElement.clientWidth&&A.classList.add(y.leftward),A.classList.remove(y.loading)}}function Cb(e,t,i){i.id||(i.id=(0,ke.Ae)()),Mn()(i).find("> .item").each((s,l)=>Rh(e,l)),i.setAttribute("role",e[Ar].listPopupRole);for(const s of e.querySelectorAll(".ui.label"))Mh(s);t.setAttribute("role",t.getAttribute("role")??e[Ar].focusableRole),t.setAttribute("aria-haspopup",e[Ar].listPopupRole),t.setAttribute("aria-controls",i.id),t.setAttribute("aria-expanded","false");const n=e.getAttribute("data-tooltip-content");n&&!e.getAttribute("aria-label")&&e.setAttribute("aria-label",n)}function kb(e){e[Ar]={};const t=e.querySelector("input.search"),i=t||e;if(!i)return;t&&!t.getAttribute("autocomplete")&&t.setAttribute("autocomplete","off");let n=Mn()(e).find("> .menu")[0];n||(n=document.createElement("div"),n.classList.add("menu"),e.append(n));const s=e.querySelectorAll("input").length>0;e[Ar].focusableRole=s?"combobox":"menu",e[Ar].listPopupRole=s?"listbox":"",e[Ar].listItemRole=s?"option":"menuitem",Tb(e,i,n),Cb(e,i,n)}function Tb(e,t,i){const n=()=>i.classList.contains("visible")&&!i.classList.contains("out")||i.classList.contains("in"),s=()=>{const y=n();t.setAttribute("aria-expanded",y?"true":"false");const A=Mn()(i).find("> .item.active, > .item.selected")[0];A&&(y?t.setAttribute("aria-activedescendant",A.id):e[Ar].listPopupRole==="menu"&&(t.removeAttribute("aria-activedescendant"),A.classList.remove("active","selected")))};e.addEventListener("keydown",y=>{if(y.key==="Enter"){const A=i.querySelector(":scope > .item.selected, .menu > .item.selected");A?.matches("a, .js-aria-clickable")&&!A.matches(".tw-hidden, .filtered")&&(y.preventDefault(),A.click())}});const l=(y=0)=>{setTimeout(s,y)};e[Ar].deferredRefreshAriaActiveItem=l,e.addEventListener("keyup",y=>{y.key.startsWith("Arrow")&&l()});let u=0,m=0;e.addEventListener("mousedown",()=>{m+=n()?1:0,u++},!0),e.addEventListener("focus",()=>{m+=n()?1:0,u++,l()},!0),e.addEventListener("blur",()=>{m=u=0,l(100)},!0),e.addEventListener("mouseup",()=>{setTimeout(()=>{m=u=0,l(100)},0)},!0),e.addEventListener("click",y=>{n()&&m!==2&&u===2&&y.stopPropagation(),u=m=0},!0)}function Lb(e){const t=[],i=[];let n="",s="";const l=z=>z.classList.contains("divider"),u=z=>l(z)&&z.hasAttribute("data-scope"),m=z=>z.classList.add("hidden","transition"),y=z=>z.classList.remove("hidden","transition"),A=z=>z.classList.contains("hidden")||z.classList.contains("filtered")||z.classList.contains("tw-hidden"),L=z=>{i.length===1&&u(i[0])?m(i[0]):i.length&&(u(i[0])&&s===n&&(m(i[0]),i.shift()),t.push(...i),s=n),n=z,i.length=0};(0,C.jB)(e,".divider",y);for(const z of e.children){const X=z.getAttribute("data-scope")||"";X!==n&&L(X),A(z)||i.push(z)}for(L("");t.length&&l(t[0]);)m(t[0]),t.shift();for(;t.length&&l(t[t.length-1]);)m(t[t.length-1]),t.pop();for(let z=0;z<t.length-1;z++)t[z].matches(".divider")&&t[z+1].matches(".divider")&&m(t[z])}function Rb(e,t){const i=e instanceof HTMLElement?e:e[0];setTimeout(()=>{(0,C.jB)(i,`.menu .item[data-value="${CSS.escape(t)}"].filtered`,n=>n.classList.remove("filtered")),Mn()(i).dropdown("set selected",t??"")},10)}const Dh=Mn().fn.modal;function Mb(){if(Mn().fn.modal===nd)throw new Error("initAriaModalPatch could only be called once");Mn().fn.modal=nd,nd.settings=Dh.settings}function nd(...e){const t=Dh.apply(this,e);if(e[0]==="show"||e[0]?.autoShow)for(const i of this)for(const n of i.querySelectorAll("form button.cancel:not([type])"))n.setAttribute("type","button");return t}function Db(){const e=new Set(["clear queue","stop","stop all","destroy","force repaint","repaint","reset","looping","remove looping","disable","enable","set duration","save conditions","restore conditions"]);Mn().fn.transition=function(t,i,n){if(t==="is supported")return!0;if(t==="is animating"||t==="is inward"||t==="is outward")return!1;let s;if(typeof t=="string"){if(e.has(t))return this;s={animation:t,...i&&{duration:i},...n&&{onComplete:n}}}else if(typeof t=="object")s=t;else throw new Error(`invalid argument: ${t}`);const l=s.animation?.startsWith("show")||s.animation?.endsWith(" in"),u=s.animation?.startsWith("hide")||s.animation?.endsWith(" out");return this.each((m,y)=>{let A=l;!l&&!u&&(A=this.hasClass("hidden")),s.onStart?.call(y),A?(y.classList.remove("hidden"),y.classList.add("visible","transition"),s.displayType&&y.style.setProperty("display",s.displayType,"important"),s.onShow?.call(y)):(y.classList.add("hidden"),y.classList.remove("visible"),y.style.removeProperty("display"),s.onHidden?.call(y)),s.onComplete?.call(y)}),this}}function Ob(){Mn().fn.dimmer=function(e,t){if(e==="add content"){const i=t,n=document.querySelector("body > .ui.dimmer");n?((0,C.xP)(n,"*",s=>s.classList.add("hidden")),this._dimmer=n):(this._dimmer=document.createElement("div"),this._dimmer.classList.add("ui","dimmer"),document.body.append(this._dimmer)),this._dimmer.append(i[0])}else{if(e==="get dimmer")return Mn()(this._dimmer);if(e==="show")this._dimmer.classList.add("active"),document.body.classList.add("tw-overflow-hidden");else if(e==="hide"){const i=t;this._dimmer.classList.remove("active"),document.body.classList.remove("tw-overflow-hidden"),i()}}return this}}function qb(){Mn().fn.tab=function(){for(const e of this){const t=e.getAttribute("data-tab");t&&e.addEventListener("click",()=>{const i=document.querySelector(`.ui.tab[data-tab="${t}"]`);(0,C.D6)(i,".ui.tab",n=>n.classList.remove("active")),(0,C.D6)(e,"[data-tab]",n=>n.classList.remove("active")),e.classList.add("active"),i.classList.add("active")})}return this}}const Oh=window.matchMedia("only screen and (max-width: 767.98px)");function Pb(){Mn().fn.fomanticExt={},Mn().fn.dropdown.settings.fullTextSearch="exact",Mn().fn.dropdown.settings.className.label+=" tw-cursor-default",Mn().fn.dropdown.settings.templates.label=function(e,t,i,n){const s=Mn().fn.dropdown.settings.templates.escape;return s(t,i)+(0,Z.JW)("octicon-x",16,`${n.delete} icon`)},Db(),Ob(),qb(),Sb(),xb(),jb(),Mb()}async function Fb(){const e=document.querySelector(".repository.wiki .combo-markdown-editor textarea");if(!e)return;const t=document.querySelector(".repository.wiki.new .ui.form"),i=t.querySelector(".combo-markdown-editor");let n,s=!1,l="";const u=async function(){if(s)return;const m=i.querySelector(".EasyMDEContainer .editor-preview-active"),A=i.querySelector(".EasyMDEContainer .editor-preview-active-side")||m,L=e.value;if(n&&A&&l!==L){s=!0;const z=new FormData;z.append("mode",n.previewMode),z.append("context",n.previewContext),z.append("text",L);try{const _e=await(await(0,Ae.LO)(n.previewUrl,{data:z})).text();l=L,A.innerHTML=`<div class="render-content markup ui segment">${_e}</div>`}catch(X){console.error("Error rendering preview:",X)}finally{s=!1,setTimeout(u,1e3)}}else setTimeout(u,1e3)};u(),n=await ma(i,{editorHeights:{minHeight:"300px",height:"calc(100vh - 600px)"},easyMDEOptions:{previewRender:(m,y)=>y.innerHTML,toolbar:["bold","italic","strikethrough","|","heading-1","heading-2","heading-3","heading-bigger","heading-smaller","|","gitea-code-inline","code","quote","|","gitea-checkbox-empty","gitea-checkbox-checked","|","unordered-list","ordered-list","|","link","image","table","horizontal-rule","|","preview","fullscreen","side-by-side","|","gitea-switch-to-textarea"]}}),t.addEventListener("submit",m=>{hh(e)||(m.preventDefault(),m.stopPropagation())})}function qh(e){e&&document.querySelector(".wiki-content-toc details")?.removeAttribute("open")}function Ib(){document.querySelector(".page-content.repository.wiki")&&(Oh.addEventListener("change",e=>qh(e.matches)),qh(Oh.matches),Fb())}function Nb(){(0,C.ny)(document,"click",".escape-button, .unescape-button, .toggle-escape-button",(e,t)=>{t.preventDefault();const i=e.getAttribute("data-unicode-content-selector"),n=i?document.querySelector(i):e.closest(".file-content, .non-diff-file-content"),s=n.querySelector(".file-code, .file-view")??n;if(e.matches(".escape-button"))s.classList.add("unicode-escaped"),(0,C.y9)(e),(0,C.fi)((0,C.D6)(e,".unescape-button"));else if(e.matches(".unescape-button"))s.classList.remove("unicode-escaped"),(0,C.y9)(e),(0,C.fi)((0,C.D6)(e,".escape-button"));else if(e.matches(".toggle-escape-button")){const l=s.classList.contains("unicode-escaped");s.classList.toggle("unicode-escaped",!l),(0,C.oi)(n.querySelectorAll(".unescape-button"),!l),(0,C.oi)(n.querySelectorAll(".escape-button"),l)}})}const{pageData:Ph}=window.config;async function Hb(e,t){const[{Cite:i,plugins:n}]=await Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl").then(__webpack_require__.bind(__webpack_require__,"./node_modules/@citation-js/core/lib-mjs/index.js")),Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl"),__webpack_require__.e("citation-js-formats")]).then(__webpack_require__.t.bind(__webpack_require__,"./node_modules/@citation-js/plugin-software-formats/lib/index.js",23)),Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl"),__webpack_require__.e("citation-js-bibtex")]).then(__webpack_require__.bind(__webpack_require__,"./node_modules/@citation-js/plugin-bibtex/lib-mjs/index.js")),Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl"),__webpack_require__.e("citation-js-csl")]).then(__webpack_require__.bind(__webpack_require__,"./node_modules/@citation-js/plugin-csl/lib-mjs/index.js"))]),{citationFileContent:s}=Ph,l=n.config.get("@bibtex");l.constants.fieldTypes.doi=["field","literal"],l.constants.fieldTypes.version=["field","literal"];const u=new i(s),m=(0,St.kk)()||"en-US",y=u.format("bibliography",{template:"apa",lang:m}),A=u.format("bibtex",{lang:m});t.setAttribute("data-text",A),e.setAttribute("data-text",y)}async function Bb(){const e="apa";if(!Ph.citationFileContent)return;const t=document.querySelector("#citation-copy-apa"),i=document.querySelector("#citation-copy-bibtex"),n=document.querySelector("#citation-copy-content");if(!t&&!i||!n)return;const s=()=>{const l=(localStorage.getItem("citation-copy-format")||e)==="bibtex",u=(l?i:t).getAttribute("data-text");n.value=u,i.classList.toggle("primary",l),t.classList.toggle("primary",!l)};document.querySelector("#cite-repo-button")?.addEventListener("click",async()=>{try{await Hb(t,i)}catch(l){console.error(`initCitationFileCopyContent error: ${l}`,l);return}s(),t.addEventListener("click",()=>{localStorage.setItem("citation-copy-format","apa"),s()}),i.addEventListener("click",()=>{localStorage.setItem("citation-copy-format","bibtex"),s()}),n.addEventListener("click",()=>{n.select()}),(0,ke.mD)("#cite-repo-modal").modal("show")})}function $b(){_c("click","onCommentReactionButtonClick",async(e,t)=>{if(t.preventDefault(),e.classList.contains("disabled"))return;const i=e.closest("[data-action-url]").getAttribute("data-action-url"),n=e.getAttribute("data-reaction-content"),s=e.closest(".comment-container"),l=s.querySelector(".bottom-reactions"),m=l?.querySelector(`a[data-reaction-content="${CSS.escape(n)}"]`)?.getAttribute("data-has-reacted")==="true",A=await(await(0,Ae.LO)(`${i}/${m?"unreact":"react"}`,{data:new URLSearchParams({content:n})})).json();l?.remove(),A.html&&s.insertAdjacentHTML("beforeend",A.html)})}var Ub=__webpack_require__("./node_modules/brace-expansion/index.js");const Vb=1024*64,Tc=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>Vb)throw new TypeError("pattern is too long")},Wb={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Tl=e=>e.replace(/[[\]\\-]/g,"\\$&"),zb=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Fh=e=>e.join(""),Kb=(e,t)=>{const i=t;if(e.charAt(i)!=="[")throw new Error("not in a brace expression");const n=[],s=[];let l=i+1,u=!1,m=!1,y=!1,A=!1,L=i,z="";e:for(;l<e.length;){const de=e.charAt(l);if((de==="!"||de==="^")&&l===i+1){A=!0,l++;continue}if(de==="]"&&u&&!y){L=l+1;break}if(u=!0,de==="\\"&&!y){y=!0,l++;continue}if(de==="["&&!y){for(const[Pe,[Le,Te,He]]of Object.entries(Wb))if(e.startsWith(Pe,l)){if(z)return["$.",!1,e.length-i,!0];l+=Pe.length,He?s.push(Le):n.push(Le),m=m||Te;continue e}}if(y=!1,z){de>z?n.push(Tl(z)+"-"+Tl(de)):de===z&&n.push(Tl(de)),z="",l++;continue}if(e.startsWith("-]",l+1)){n.push(Tl(de+"-")),l+=2;continue}if(e.startsWith("-",l+1)){z=de,l+=2;continue}n.push(Tl(de)),l++}if(L<l)return["",!1,0,!1];if(!n.length&&!s.length)return["$.",!1,e.length-i,!0];if(s.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!A){const de=n[0].length===2?n[0].slice(-1):n[0];return[zb(de),!1,L-i,!1]}const X="["+(A?"^":"")+Fh(n)+"]",_e="["+(A?"":"^")+Fh(s)+"]";return[n.length&&s.length?"("+X+"|"+_e+")":n.length?X:_e,m,L-i,!0]},Ll=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),Xb=new Set(["!","?","+","*","@"]),Ih=e=>Xb.has(e),Gb="(?!(?:^|/)\\.\\.?(?:$|/))",Lc="(?!\\.)",Qb=new Set(["[","."]),Yb=new Set(["..","."]),Jb=new Set("().*{}+?[]^$\\!"),Zb=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),sd="[^/]",Nh=sd+"*?",Hh=sd+"+?",Ks=class Ks{constructor(t,i,n={}){wn(this,ba);rs(this,"type");wn(this,is);wn(this,bs);wn(this,lo,!1);wn(this,Dn,[]);wn(this,Gn);wn(this,Do);wn(this,ga);wn(this,Oo,!1);wn(this,Gr);wn(this,va);wn(this,Pl,!1);this.type=t,t&&tn(this,bs,!0),tn(this,Gn,i),tn(this,is,pt(this,Gn)?pt(pt(this,Gn),is):this),tn(this,Gr,pt(this,is)===this?n:pt(pt(this,is),Gr)),tn(this,ga,pt(this,is)===this?[]:pt(pt(this,is),ga)),t==="!"&&!pt(pt(this,is),Oo)&&pt(this,ga).push(this),tn(this,Do,pt(this,Gn)?pt(pt(this,Gn),Dn).length:0)}get hasMagic(){if(pt(this,bs)!==void 0)return pt(this,bs);for(const t of pt(this,Dn))if(typeof t!="string"&&(t.type||t.hasMagic))return tn(this,bs,!0);return pt(this,bs)}toString(){return pt(this,va)!==void 0?pt(this,va):this.type?tn(this,va,this.type+"("+pt(this,Dn).map(t=>String(t)).join("|")+")"):tn(this,va,pt(this,Dn).map(t=>String(t)).join(""))}push(...t){for(const i of t)if(i!==""){if(typeof i!="string"&&!(i instanceof Ks&&pt(i,Gn)===this))throw new Error("invalid part: "+i);pt(this,Dn).push(i)}}toJSON(){const t=this.type===null?pt(this,Dn).slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...pt(this,Dn).map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===pt(this,is)||pt(pt(this,is),Oo)&&pt(this,Gn)?.type==="!")&&t.push({}),t}isStart(){if(pt(this,is)===this)return!0;if(!pt(this,Gn)?.isStart())return!1;if(pt(this,Do)===0)return!0;const t=pt(this,Gn);for(let i=0;i<pt(this,Do);i++){const n=pt(t,Dn)[i];if(!(n instanceof Ks&&n.type==="!"))return!1}return!0}isEnd(){if(pt(this,is)===this||pt(this,Gn)?.type==="!")return!0;if(!pt(this,Gn)?.isEnd())return!1;if(!this.type)return pt(this,Gn)?.isEnd();const t=pt(this,Gn)?pt(pt(this,Gn),Dn).length:0;return pt(this,Do)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const i=new Ks(this.type,t);for(const n of pt(this,Dn))i.copyIn(n);return i}static fromGlob(t,i={}){var s;const n=new Ks(null,void 0,i);return dn(s=Ks,qo,Gc).call(s,t,n,0,i),n}toMMPattern(){if(this!==pt(this,is))return pt(this,is).toMMPattern();const t=this.toString(),[i,n,s,l]=this.toRegExpSource();if(!(s||pt(this,bs)||pt(this,Gr).nocase&&!pt(this,Gr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const m=(pt(this,Gr).nocase?"i":"")+(l?"u":"");return Object.assign(new RegExp(`^${i}$`,m),{_src:i,_glob:t})}get options(){return pt(this,Gr)}toRegExpSource(t){const i=t??!!pt(this,Gr).dot;if(pt(this,is)===this&&dn(this,ba,sm).call(this),!this.type){const y=this.isStart()&&this.isEnd(),A=pt(this,Dn).map(_e=>{var Te;const[pe,de,Pe,Le]=typeof _e=="string"?dn(Te=Ks,qo,rm).call(Te,_e,pt(this,bs),y):_e.toRegExpSource(t);return tn(this,bs,pt(this,bs)||Pe),tn(this,lo,pt(this,lo)||Le),pe}).join("");let L="";if(this.isStart()&&typeof pt(this,Dn)[0]=="string"&&!(pt(this,Dn).length===1&&Yb.has(pt(this,Dn)[0]))){const pe=Qb,de=i&&pe.has(A.charAt(0))||A.startsWith("\\.")&&pe.has(A.charAt(2))||A.startsWith("\\.\\.")&&pe.has(A.charAt(4)),Pe=!i&&!t&&pe.has(A.charAt(0));L=de?Gb:Pe?Lc:""}let z="";return this.isEnd()&&pt(pt(this,is),Oo)&&pt(this,Gn)?.type==="!"&&(z="(?:$|\\/)"),[L+A+z,Ll(A),tn(this,bs,!!pt(this,bs)),pt(this,lo)]}const n=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:";let l=dn(this,ba,pd).call(this,i);if(this.isStart()&&this.isEnd()&&!l&&this.type!=="!"){const y=this.toString();return tn(this,Dn,[y]),this.type=null,tn(this,bs,void 0),[y,Ll(this.toString()),!1,!1]}let u=!n||t||i||!Lc?"":dn(this,ba,pd).call(this,!0);u===l&&(u=""),u&&(l=`(?:${l})(?:${u})*?`);let m="";if(this.type==="!"&&pt(this,Pl))m=(this.isStart()&&!i?Lc:"")+Hh;else{const y=this.type==="!"?"))"+(this.isStart()&&!i&&!t?Lc:"")+Nh+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&u?")":this.type==="*"&&u?")?":`)${this.type}`;m=s+l+y}return[m,Ll(l),tn(this,bs,!!pt(this,bs)),pt(this,lo)]}};is=new WeakMap,bs=new WeakMap,lo=new WeakMap,Dn=new WeakMap,Gn=new WeakMap,Do=new WeakMap,ga=new WeakMap,Oo=new WeakMap,Gr=new WeakMap,va=new WeakMap,Pl=new WeakMap,ba=new WeakSet,sm=function(){if(this!==pt(this,is))throw new Error("should only call on root");if(pt(this,Oo))return this;this.toString(),tn(this,Oo,!0);let t;for(;t=pt(this,ga).pop();){if(t.type!=="!")continue;let i=t,n=pt(i,Gn);for(;n;){for(let s=pt(i,Do)+1;!n.type&&s<pt(n,Dn).length;s++)for(const l of pt(t,Dn)){if(typeof l=="string")throw new Error("string part in extglob AST??");l.copyIn(pt(n,Dn)[s])}i=n,n=pt(i,Gn)}}return this},qo=new WeakSet,Gc=function(t,i,n,s){var _e,pe;let l=!1,u=!1,m=-1,y=!1;if(i.type===null){let de=n,Pe="";for(;de<t.length;){const Le=t.charAt(de++);if(l||Le==="\\"){l=!l,Pe+=Le;continue}if(u){de===m+1?(Le==="^"||Le==="!")&&(y=!0):Le==="]"&&!(de===m+2&&y)&&(u=!1),Pe+=Le;continue}else if(Le==="["){u=!0,m=de,y=!1,Pe+=Le;continue}if(!s.noext&&Ih(Le)&&t.charAt(de)==="("){i.push(Pe),Pe="";const Te=new Ks(Le,i);de=dn(_e=Ks,qo,Gc).call(_e,t,Te,de,s),i.push(Te);continue}Pe+=Le}return i.push(Pe),de}let A=n+1,L=new Ks(null,i);const z=[];let X="";for(;A<t.length;){const de=t.charAt(A++);if(l||de==="\\"){l=!l,X+=de;continue}if(u){A===m+1?(de==="^"||de==="!")&&(y=!0):de==="]"&&!(A===m+2&&y)&&(u=!1),X+=de;continue}else if(de==="["){u=!0,m=A,y=!1,X+=de;continue}if(Ih(de)&&t.charAt(A)==="("){L.push(X),X="";const Pe=new Ks(de,L);L.push(Pe),A=dn(pe=Ks,qo,Gc).call(pe,t,Pe,A,s);continue}if(de==="|"){L.push(X),X="",z.push(L),L=new Ks(null,i);continue}if(de===")")return X===""&&pt(i,Dn).length===0&&tn(i,Pl,!0),L.push(X),X="",i.push(...z,L),A;X+=de}return i.type=null,tn(i,bs,void 0),tn(i,Dn,[t.substring(n-1)]),A},pd=function(t){return pt(this,Dn).map(i=>{if(typeof i=="string")throw new Error("string type in extglob ast??");const[n,s,l,u]=i.toRegExpSource(t);return tn(this,lo,pt(this,lo)||u),n}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")},rm=function(t,i,n=!1){let s=!1,l="",u=!1;for(let m=0;m<t.length;m++){const y=t.charAt(m);if(s){s=!1,l+=(Jb.has(y)?"\\":"")+y;continue}if(y==="\\"){m===t.length-1?l+="\\\\":s=!0;continue}if(y==="["){const[A,L,z,X]=Kb(t,m);if(z){l+=A,u=u||L,m+=z-1,i=i||X;continue}}if(y==="*"){n&&t==="*"?l+=Hh:l+=Nh,i=!0;continue}if(y==="?"){l+=sd,i=!0;continue}l+=Zb(y)}return[l,Ll(t),!!i,u]},wn(Ks,qo);let Rc=Ks;const e_=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),Os=(e,t,i={})=>(Tc(t),!i.nocomment&&t.charAt(0)==="#"?!1:new Mc(t,i).match(e)),t_=/^\*+([^+@!?\*\[\(]*)$/,i_=e=>t=>!t.startsWith(".")&&t.endsWith(e),n_=e=>t=>t.endsWith(e),s_=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),r_=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),o_=/^\*+\.\*+$/,a_=e=>!e.startsWith(".")&&e.includes("."),l_=e=>e!=="."&&e!==".."&&e.includes("."),c_=/^\.\*+$/,u_=e=>e!=="."&&e!==".."&&e.startsWith("."),d_=/^\*+$/,f_=e=>e.length!==0&&!e.startsWith("."),h_=e=>e.length!==0&&e!=="."&&e!=="..",m_=/^\?+([^+@!?\*\[\(]*)?$/,p_=([e,t=""])=>{const i=Bh([e]);return t?(t=t.toLowerCase(),n=>i(n)&&n.toLowerCase().endsWith(t)):i},g_=([e,t=""])=>{const i=$h([e]);return t?(t=t.toLowerCase(),n=>i(n)&&n.toLowerCase().endsWith(t)):i},v_=([e,t=""])=>{const i=$h([e]);return t?n=>i(n)&&n.endsWith(t):i},b_=([e,t=""])=>{const i=Bh([e]);return t?n=>i(n)&&n.endsWith(t):i},Bh=([e])=>{const t=e.length;return i=>i.length===t&&!i.startsWith(".")},$h=([e])=>{const t=e.length;return i=>i.length===t&&i!=="."&&i!==".."},Uh=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Vh={win32:{sep:"\\"},posix:{sep:"/"}},__=Uh==="win32"?Vh.win32.sep:Vh.posix.sep;Os.sep=__;const Cr=Symbol("globstar **");Os.GLOBSTAR=Cr;const y_="[^/]"+"*?",w_="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",S_="(?:(?!(?:\\/|^)\\.).)*?",x_=(e,t={})=>i=>Os(i,e,t);Os.filter=x_;const kr=(e,t={})=>Object.assign({},e,t),j_=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Os;const t=Os;return Object.assign((n,s,l={})=>t(n,s,kr(e,l)),{Minimatch:class extends t.Minimatch{constructor(s,l={}){super(s,kr(e,l))}static defaults(s){return t.defaults(kr(e,s)).Minimatch}},AST:class extends t.AST{constructor(s,l,u={}){super(s,l,kr(e,u))}static fromGlob(s,l={}){return t.AST.fromGlob(s,kr(e,l))}},unescape:(n,s={})=>t.unescape(n,kr(e,s)),escape:(n,s={})=>t.escape(n,kr(e,s)),filter:(n,s={})=>t.filter(n,kr(e,s)),defaults:n=>t.defaults(kr(e,n)),makeRe:(n,s={})=>t.makeRe(n,kr(e,s)),braceExpand:(n,s={})=>t.braceExpand(n,kr(e,s)),match:(n,s,l={})=>t.match(n,s,kr(e,l)),sep:t.sep,GLOBSTAR:Cr})};Os.defaults=j_;const Wh=(e,t={})=>(Tc(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ub(e));Os.braceExpand=Wh;const E_=(e,t={})=>new Mc(e,t).makeRe();Os.makeRe=E_;const A_=(e,t,i={})=>{const n=new Mc(t,i);return e=e.filter(s=>n.match(s)),n.options.nonull&&!e.length&&e.push(t),e};Os.match=A_;const zh=/[?*]|[+@!]\(.*?\)|\[|\]/,C_=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Mc{constructor(t,i={}){rs(this,"options");rs(this,"set");rs(this,"pattern");rs(this,"windowsPathsNoEscape");rs(this,"nonegate");rs(this,"negate");rs(this,"comment");rs(this,"empty");rs(this,"preserveMultipleSlashes");rs(this,"partial");rs(this,"globSet");rs(this,"globParts");rs(this,"nocase");rs(this,"isWindows");rs(this,"platform");rs(this,"windowsNoMagicRoot");rs(this,"regexp");Tc(t),i=i||{},this.options=i,this.pattern=t,this.platform=i.platform||Uh,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!i.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!i.nonegate,this.comment=!1,this.empty=!1,this.partial=!!i.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=i.windowsNoMagicRoot!==void 0?i.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const i of t)if(typeof i!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,i=this.options;if(!i.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],i.debug&&(this.debug=(...l)=>console.error(...l)),this.debug(this.pattern,this.globSet);const n=this.globSet.map(l=>this.slashSplit(l));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let s=this.globParts.map((l,u,m)=>{if(this.isWindows&&this.windowsNoMagicRoot){const y=l[0]===""&&l[1]===""&&(l[2]==="?"||!zh.test(l[2]))&&!zh.test(l[3]),A=/^[a-z]:/i.test(l[0]);if(y)return[...l.slice(0,4),...l.slice(4).map(L=>this.parse(L))];if(A)return[l[0],...l.slice(1).map(L=>this.parse(L))]}return l.map(y=>this.parse(y))});if(this.debug(this.pattern,s),this.set=s.filter(l=>l.indexOf(!1)===-1),this.isWindows)for(let l=0;l<this.set.length;l++){const u=this.set[l];u[0]===""&&u[1]===""&&this.globParts[l][2]==="?"&&typeof u[3]=="string"&&/^[a-z]:$/i.test(u[3])&&(u[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let s=0;s<t[n].length;s++)t[n][s]==="**"&&(t[n][s]="*");const{optimizationLevel:i=1}=this.options;return i>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):i>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(i=>{let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let s=n;for(;i[s+1]==="**";)s++;s!==n&&i.splice(n,s-n)}return i})}levelOneOptimize(t){return t.map(i=>(i=i.reduce((n,s)=>{const l=n[n.length-1];return s==="**"&&l==="**"?n:s===".."&&l&&l!==".."&&l!=="."&&l!=="**"?(n.pop(),n):(n.push(s),n)},[]),i.length===0?[""]:i))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let i=!1;do{if(i=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const l=t[s];s===1&&l===""&&t[0]===""||(l==="."||l==="")&&(i=!0,t.splice(s,1),s--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(i=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){const s=t[n-1];s&&s!=="."&&s!==".."&&s!=="**"&&(i=!0,t.splice(n-1,2),n-=2)}}while(i);return t.length===0?[""]:t}firstPhasePreProcess(t){let i=!1;do{i=!1;for(let n of t){let s=-1;for(;(s=n.indexOf("**",s+1))!==-1;){let u=s;for(;n[u+1]==="**";)u++;u>s&&n.splice(s+1,u-s);let m=n[s+1];const y=n[s+2],A=n[s+3];if(m!==".."||!y||y==="."||y===".."||!A||A==="."||A==="..")continue;i=!0,n.splice(s,1);const L=n.slice(0);L[s]="**",t.push(L),s--}if(!this.preserveMultipleSlashes){for(let u=1;u<n.length-1;u++){const m=n[u];u===1&&m===""&&n[0]===""||(m==="."||m==="")&&(i=!0,n.splice(u,1),u--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(i=!0,n.pop())}let l=0;for(;(l=n.indexOf("..",l+1))!==-1;){const u=n[l-1];if(u&&u!=="."&&u!==".."&&u!=="**"){i=!0;const y=l===1&&n[l+1]==="**"?["."]:[];n.splice(l-1,2,...y),n.length===0&&n.push(""),l-=2}}}}while(i);return t}secondPhasePreProcess(t){for(let i=0;i<t.length-1;i++)for(let n=i+1;n<t.length;n++){const s=this.partsMatch(t[i],t[n],!this.preserveMultipleSlashes);if(s){t[i]=[],t[n]=s;break}}return t.filter(i=>i.length)}partsMatch(t,i,n=!1){let s=0,l=0,u=[],m="";for(;s<t.length&&l<i.length;)if(t[s]===i[l])u.push(m==="b"?i[l]:t[s]),s++,l++;else if(n&&t[s]==="**"&&i[l]===t[s+1])u.push(t[s]),s++;else if(n&&i[l]==="**"&&t[s]===i[l+1])u.push(i[l]),l++;else if(t[s]==="*"&&i[l]&&(this.options.dot||!i[l].startsWith("."))&&i[l]!=="**"){if(m==="b")return!1;m="a",u.push(t[s]),s++,l++}else if(i[l]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(m==="a")return!1;m="b",u.push(i[l]),s++,l++}else return!1;return t.length===i.length&&u}parseNegate(){if(this.nonegate)return;const t=this.pattern;let i=!1,n=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)i=!i,n++;n&&(this.pattern=t.slice(n)),this.negate=i}matchOne(t,i,n=!1){const s=this.options;if(this.isWindows){const de=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),Pe=!de&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),Le=typeof i[0]=="string"&&/^[a-z]:$/i.test(i[0]),Te=!Le&&i[0]===""&&i[1]===""&&i[2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3]),He=Pe?3:de?0:void 0,U=Te?3:Le?0:void 0;if(typeof He=="number"&&typeof U=="number"){const[Se,ze]=[t[He],i[U]];Se.toLowerCase()===ze.toLowerCase()&&(i[U]=Se,U>He?i=i.slice(U):He>U&&(t=t.slice(He)))}}const{optimizationLevel:l=1}=this.options;l>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:i}),this.debug("matchOne",t.length,i.length);for(var u=0,m=0,y=t.length,A=i.length;u<y&&m<A;u++,m++){this.debug("matchOne loop");var L=i[m],z=t[u];if(this.debug(i,L,z),L===!1)return!1;if(L===Cr){this.debug("GLOBSTAR",[i,L,z]);var X=u,_e=m+1;if(_e===A){for(this.debug("** at the end");u<y;u++)if(t[u]==="."||t[u]===".."||!s.dot&&t[u].charAt(0)===".")return!1;return!0}for(;X<y;){var pe=t[X];if(this.debug(`
./output/git.buildapp.eu.org_run/git.buildapp.eu.org_3_credentials_filled.html:302:</div>`);t.addEventListener("click",async i=>{i.preventDefault();const n=await Ii(Xf(e));Dt(i.target,n?Kf.copy_success:Kf.copy_error)}),e.previewTemplate.append(t)}async function Qf(e){const t=e.closest("[data-attachment-url]")?.getAttribute("data-attachment-url"),i=e.getAttribute("data-remove-url"),n=e.getAttribute("data-link-url");let s=!1,l={};const u={url:e.getAttribute("data-upload-url"),headers:{"X-Csrf-Token":Ng},acceptedFiles:["*/*",""].includes(e.getAttribute("data-accepts"))?null:e.getAttribute("data-accepts"),addRemoveLinks:!0,dictDefaultMessage:e.getAttribute("data-default-message"),dictInvalidFileType:e.getAttribute("data-invalid-input-type"),dictFileTooBig:e.getAttribute("data-file-too-big"),dictRemoveFile:e.getAttribute("data-remove-file"),timeout:0,thumbnailMethod:"contain",thumbnailWidth:480,thumbnailHeight:480};e.hasAttribute("data-max-file")&&(u.maxFiles=Number(e.getAttribute("data-max-file"))),e.hasAttribute("data-max-size")&&(u.maxFilesize=Number(e.getAttribute("data-max-size")));const m=await Hg(e,u);return m.on("success",(y,A)=>{y.uuid=A.uuid,l[y.uuid]={submitted:!1};const L=(0,C.tw)("input",{name:"files",type:"hidden",id:`dropzone-file-${A.uuid}`,value:A.uuid});e.querySelector(".files").append(L),Gf(y),m.emit(Uu,{file:y})}),m.on("removedfile",async y=>{s||(m.emit($u,{fileUuid:y.uuid}),document.querySelector(`#dropzone-file-${y.uuid}`)?.remove(),i&&l[y.uuid]&&!l[y.uuid].submitted&&await(0,Ae.LO)(i,{data:new URLSearchParams({file:y.uuid})}))}),m.on("submit",()=>{for(const y of Object.keys(l))l[y].submitted=!0}),m.on(Ac,async()=>{try{const A=await(await(0,Ae.fG)(t)).json();s=!0,m.removeAllFiles(!0),s=!1,e.querySelector(".files").innerHTML="";for(const L of e.querySelectorAll(".dz-preview"))L.remove();l={};for(const L of A){const z={name:L.name,uuid:L.uuid,size:L.size};if(m.emit("addedfile",z),m.emit("complete",z),(0,St.u)(z.name)){const _e=`${n}/${z.uuid}`;m.emit("thumbnail",z,_e)}Gf(z),l[z.uuid]={submitted:!0};const X=(0,C.tw)("input",{name:"files",type:"hidden",id:`dropzone-file-${z.uuid}`,value:z.uuid});e.querySelector(".files").append(X)}e.querySelector(".dz-preview")||e.classList.remove("dz-started")}catch(y){gt(`Failed to load attachments: ${y}`),console.error(y)}}),m.on("error",(y,A)=>{gt(`Dropzone upload error: ${A}`),m.removeFile(y)}),t&&m.emit(Ac),m}var Bg=Object.defineProperty,$g=(e,t,i)=>t in e?Bg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Yf=(e,t,i)=>$g(e,typeof t!="symbol"?t+"":t,i);let Ug=0;const Jf="ce-upload-state-changed";function Vu(e){e.dispatchEvent(new CustomEvent(Jf,{bubbles:!0}))}function Vg(e,t){return new Promise(i=>{const n=Ug++;t._giteaUploadId=n;const s=e.dropzone,l=({file:u})=>{u._giteaUploadId===n&&(s.off(Uu,l),i(u))};s.on(Uu,l),s.addFile(t)})}class Zf{constructor(t){Yf(this,"editor"),this.editor=t}insertPlaceholder(t){Wf(this.editor,t)}replacePlaceholder(t,i){const n=this.editor,s=n.selectionStart,l=n.selectionEnd;n.value.substring(s,l)===t?(n.value=n.value.substring(0,s)+i+n.value.substring(l),n.selectionEnd=s+i.length):(n.value=n.value.replace(t,i),n.selectionEnd-=t.length,n.selectionEnd+=i.length),n.selectionStart=n.selectionEnd,n.focus(),Lo(n)}}class Wg{constructor(t){Yf(this,"editor"),this.editor=t}insertPlaceholder(t){const i=this.editor,n=i.getCursor("start"),s=i.getCursor("end");i.replaceSelection(t),s.ch=n.ch+t.length,i.setSelection(n,s),i.focus(),Lo(i.getTextArea())}replacePlaceholder(t,i){const n=this.editor,s=n.getCursor("end");n.getSelection()===t?n.replaceSelection(i):n.setValue(n.getValue().replace(t,i)),s.ch-=t.length,s.ch+=i.length,n.setSelection(s,s),n.focus(),Lo(n.getTextArea())}}async function Cc(e,t,i,n){n.preventDefault();for(const s of i){const l=s.name.slice(0,s.name.lastIndexOf(".")),{width:u,dppx:m}=await Rg(s),y=`[${l}](uploading ...)`;e.insertPlaceholder(y),await Vg(t,s),e.replacePlaceholder(y,Xf(s,{width:u,dppx:m}))}}function eh(e,t){return e=e.replace(new RegExp(`!?\\[([^\\]]+)\\]\\(/?attachments/${t}\\)`,"g"),""),e=e.replace(new RegExp(`<img[^>]+src="/?attachments/${t}"[^>]*>`,"g"),""),e}function zg(e,t){const{value:i,selectionStart:n,selectionEnd:s}=e,l=i.substring(n,s),u=t.trim(),m=i.substring(0,n),y=i.substring(s),A=m.endsWith("](")&&y.startsWith(")");return l&&(0,pr.gU)(u)&&!(0,pr.gU)(l)&&!A?`[${l}](${u})`:null}function Kg(e,t,i,n){if(n)return;const s=zg(e,i);s&&(t.preventDefault(),(0,C.Pj)(e,s))}function th(e){const t=[];for(const n of e.clipboardData?.items??[])n.type?.startsWith("image/")&&t.push(n.getAsFile());return{text:e.clipboardData?.getData?.("text")??"",images:t}}function Xg(e,t){const i=new Wg(e.codemirror);e.codemirror.on("paste",(n,s)=>{const{images:l}=th(s);l.length&&Cc(i,t,l,s)}),e.codemirror.on("drop",(n,s)=>{s.dataTransfer.files.length&&Cc(i,t,s.dataTransfer.files,s)}),t.dropzone.on($u,({fileUuid:n})=>{const s=e.codemirror.getValue(),l=eh(s,n);s!==l&&e.codemirror.setValue(l)})}function Gg(e,t){let i=!1;e.addEventListener("keydown",n=>{n.shiftKey&&(i=!0)}),e.addEventListener("keyup",n=>{n.shiftKey||(i=!1)}),e.addEventListener("paste",n=>{const{images:s,text:l}=th(n);s.length&&t?Cc(new Zf(e),t,s,n):l&&Kg(e,n,l,i)}),e.addEventListener("drop",n=>{n.dataTransfer.files.length&&t&&Cc(new Zf(e),t,n.dataTransfer.files,n)}),t?.dropzone.on($u,({fileUuid:n})=>{const s=eh(e.value,n);e.value!==s&&(e.value=s)})}function kc(e){let t=e.closest("form");return t?(t.checkValidity()?t.dispatchEvent(new SubmitEvent("submit",{bubbles:!0,cancelable:!0})):t.reportValidity(),!0):(t=e.closest(".ui.form"),t?((0,C.gD)(t,".ui.primary.button")?.click(),!0):!1)}var Qg=__webpack_require__("./node_modules/tinycolor2/esm/tinycolor.js");const ih={},nh={},Yg={fontFamily:"var(--fonts-monospace)",fontSize:14,guides:{bracketPairs:!1,indentation:!1},links:!1,minimap:{enabled:!1},occurrencesHighlight:"off",overviewRulerLanes:0,renderLineHighlight:"all",renderLineHighlightOnlyWhenFocus:!0,rulers:[],scrollbar:{horizontalScrollbarSize:6,verticalScrollbarSize:6},scrollBeyondLastLine:!1,automaticLayout:!0};function Jg(e){const t=e.getAttribute("data-editorconfig");if(!t)return null;try{return JSON.parse(t)}catch{return null}}function Zg(e){for(const{filenames:t,extensions:i,id:n}of e.languages.getLanguages()){for(const s of t||[])ih[s]=n;for(const s of i||[])nh[s]=n;n==="typescript"&&e.languages.typescript.typescriptDefaults.setCompilerOptions({jsx:e.languages.typescript.JsxEmit.Preserve})}}function sh(e){return ih[e]||nh[(0,St.LC)(e)]||"plaintext"}function e0(e,t,i,n){t.updateOptions(ah(i,n));const s=t.getModel();if(!s)return;const l=s.getLanguageId(),u=sh(i);l!==u&&e.editor.setModelLanguage(s,u)}function t0(e){window.codeEditors||(window.codeEditors=[]),window.codeEditors.includes(e)||window.codeEditors.push(e)}function rh(e){const t=window.getComputedStyle(document.documentElement),i=n=>(0,Qg.A)(t.getPropertyValue(n).trim()).toString("hex6");e.editor.defineTheme("gitea",{base:(0,St.g4)()?"vs-dark":"vs",inherit:!0,rules:[{background:i("--color-code-bg"),token:""}],colors:{"editor.background":i("--color-code-bg"),"editor.foreground":i("--color-text"),"editor.inactiveSelectionBackground":i("--color-primary-light-4"),"editor.lineHighlightBackground":i("--color-editor-line-highlight"),"editor.selectionBackground":i("--color-primary-light-3"),"editor.selectionForeground":i("--color-primary-light-3"),"editorLineNumber.background":i("--color-code-bg"),"editorLineNumber.foreground":i("--color-secondary-dark-6"),"editorWidget.background":i("--color-body"),"editorWidget.border":i("--color-secondary"),"input.background":i("--color-input-background"),"input.border":i("--color-input-border"),"input.foreground":i("--color-input-text"),"scrollbar.shadow":i("--color-shadow-opaque"),"progressBar.background":i("--color-primary"),focusBorder:"#0000"}})}async function oh(e,t,i){const n=await __webpack_require__.e("monaco").then(__webpack_require__.bind(__webpack_require__,"include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.main.js"));Zg(n);let{language:s,...l}=i;s||(s=sh(t));const u=document.createElement("div");if(u.className="monaco-editor-container",!e.parentNode)throw new Error("Parent node absent");e.parentNode.append(u),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{rh(n)}),rh(n);const m=n.editor.createModel(e.value,s,n.Uri.file(t)),y=n.editor.create(u,{model:m,theme:"gitea",...l});n.editor.addKeybindingRules([{keybinding:n.KeyCode.Enter,command:null}]),m.onDidChangeContent(()=>{e.value=y.getValue({preserveBOM:!0,lineEnding:""}),e.dispatchEvent(new Event("change"))}),t0(y);const A=document.querySelector(".editor-loading");return A&&A.remove(),{monaco:n,editor:y}}function ah(e,t){return{wordWrap:(t||[]).includes((0,St.LC)(e))?"on":"off"}}function lh(e){const t=document.querySelector('a[data-tab="preview"]');t&&(e?t.style.display="":(t.style.display="none",t.classList.contains("active")&&document.querySelector('a[data-tab="write"]')?.click()))}async function i0(e,t){const i=(0,St.P8)(t.value),n=new Set((e.getAttribute("data-previewable-extensions")||"").split(",")),s=(e.getAttribute("data-line-wrap-extensions")||"").split(","),l=n.has((0,St.LC)(i)),u=Jg(t);lh(l);const{monaco:m,editor:y}=await oh(e,i,{...Yg,...ah(t.value,s),...n0(u)});return t.addEventListener("input",(0,C.nm)(()=>{const A=t.value,L=n.has((0,St.LC)(A));lh(L),e0(m,y,A,s)})),y}function n0(e){if(!e||!(0,St.Gv)(e))return{};const t={};return t.detectIndentation=!("indent_style"in e)||!("indent_size"in e),"indent_size"in e&&(t.indentSize=Number(e.indent_size)),"tab_width"in e&&(t.tabSize=Number(e.tab_width)||Number(e.indent_size)),"max_line_length"in e&&(t.rulers=[Number(e.max_line_length)]),t.trimAutoWhitespace=e.trim_trailing_whitespace===!0,t.insertSpaces=e.indent_style==="space",t.useTabStops=e.indent_style==="tab",t}const{i18n:ch}=window.config;function Wu({header:e="",content:t="",confirmButtonColor:i="primary"}={}){return new Promise(n=>{const s=e?`<div class="header">${R(e)}</div>`:"",l=(0,C.SL)(`
./output/git.buildapp.eu.org_run/git.buildapp.eu.org_3_credentials_filled.html:329:_Originally posted by @${u} in ${m}_`,(0,ke.mD)(A).modal("show")})}function q0(){(0,C.jB)(document,".title_wip_desc > a",e=>e.addEventListener("click",t=>{t.preventDefault();const i=JSON.parse(e.closest(".title_wip_desc").getAttribute("data-wip-prefixes")),n=document.querySelector("#issue_title"),s=n.value;for(const l of i)if(s.startsWith(l.toUpperCase()))return;n.value=`${i[0]} ${s}`}))}function P0(){(0,C.jB)(document,".toggle-wip",e=>e.addEventListener("click",async t=>{t.preventDefault();const i=e,n=i.getAttribute("data-title"),s=i.getAttribute("data-wip-prefix"),l=i.getAttribute("data-update-url");try{const u=new URLSearchParams;if(u.append("title",n?.startsWith(s)?n.slice(s.length).trim():`${s.trim()} ${n}`),!(await(0,Ae.LO)(l,{data:u})).ok)throw new Error("Failed to toggle WIP status");window.location.reload()}catch(u){console.error(u)}}))}function F0(){const e=document.querySelector("#issue-title-display"),t=document.querySelector("#issue-title-editor");if(!t)return;const i=t.querySelector("input"),n=i.getAttribute("data-old-title");e.querySelector("#issue-title-edit-show").addEventListener("click",()=>{(0,C.y9)(e),(0,C.y9)("#pull-desc-display"),(0,C.fi)(t),(0,C.fi)("#pull-desc-editor"),i.value.trim()||(i.value=n),i.focus()}),t.querySelector(".ui.cancel.button").addEventListener("click",()=>{(0,C.y9)(t),(0,C.y9)("#pull-desc-editor"),(0,C.fi)(e),(0,C.fi)("#pull-desc-display")});const l=document.querySelector("#pull-desc-editor")?.getAttribute("data-target-update-url"),u=t.querySelector(".ui.primary.button");t.addEventListener("submit",async m=>{m.preventDefault();const y=i.value.trim();try{if(y&&y!==n){const A=await(0,Ae.LO)(u.getAttribute("data-update-url"),{data:new URLSearchParams({title:y})});if(!A.ok)throw new Error(`Failed to update issue title: ${A.statusText}`)}if(l){const A=document.querySelector("#pull-target-branch").getAttribute("data-branch"),L=document.querySelector("#branch_target").textContent;if(A!==L){const z=await(0,Ae.LO)(l,{data:new URLSearchParams({target_branch:A})});if(!z.ok)throw new Error(`Failed to update PR target branch: ${z.statusText}`)}}Ku(t),window.location.reload()}catch(A){console.error(A),gt(A.message)}})}function I0(){document.querySelector("#branch-select")?.addEventListener("click",e=>{const t=e.target.closest(".item[data-branch]");if(!t)return;const i=document.querySelector("#pull-target-branch"),n=i.getAttribute("data-basename"),s=t.getAttribute("data-branch"),l=i.getAttribute("data-branch");i.textContent=i.textContent.replace(`${n}:${l}`,`${n}:${s}`),i.setAttribute("data-branch",s)})}async function N0(e){const t=await ma(e.querySelector(".combo-markdown-editor")),i=document.querySelector("#status-button"),n=document.querySelector("#comment-button"),s=()=>{const l=t.value().trim(),u=t.isUploading();i&&(i.textContent=i.getAttribute(l?"data-status-and-comment":"data-status"),i.disabled=u),n&&(n.disabled=!l||u)};t.container.addEventListener(ha.EventUploadStateChanged,s),t.container.addEventListener(ha.EventEditorContentChanged,s),s()}function H0(e){const t=e.querySelectorAll(".combo-editor-dropzone"),i=async n=>{const s=n.querySelector(".form-field-real"),l=n.querySelector(".form-field-dropzone"),u=n.querySelector(".combo-markdown-editor"),m=await ma(u);m.container.addEventListener(ha.EventEditorContentChanged,()=>s.value=m.value()),s.addEventListener("focus",async()=>{(0,C.fi)(e.querySelectorAll(".combo-editor-dropzone .form-field-real")),(0,C.y9)(e.querySelectorAll(".combo-editor-dropzone .combo-markdown-editor")),(0,C.jB)(e,".combo-editor-dropzone .form-field-dropzone",y=>{const L=y.querySelector(".dropzone").dropzone.files.length!==0;(0,C.oi)(y,L)}),(0,C.y9)(s),(0,C.fi)(u),(0,C.fi)(l),await m.switchToUserPreference(),m.focus()})};for(const n of t)i(n)}function B0(){const e=document.querySelector(".comment.form");e&&(e.querySelector(".field.combo-editor-dropzone")?H0(e):e.querySelector(".combo-markdown-editor")&&N0(e),E0())}function $0(){_c("click","onRepoEllipsisButtonClick",async(e,t)=>{t.preventDefault();const i=e.getAttribute("aria-expanded")==="true";(0,C.oi)(e.parentElement.querySelector(".commit-body")),e.setAttribute("aria-expanded",String(!i))})}function U0(){Ha("initCommitStatuses",e=>{const t=e.nextElementSibling;if(!t.matches(".tippy-target"))throw new Error("Expected next element to be a tippy target");Ie(e,{content:t,placement:"bottom-start",interactive:!0,role:"dialog",theme:"box-with-header"})})}const{appSubUrl:ph}=window.config;function V0(){const e=document.querySelector("#manage_topic");if(!e)return;const t=document.querySelector("#topic_edit"),i=document.querySelector("#repo-topics"),n=t.querySelector(".ui.dropdown");let s;e.addEventListener("click",()=>{(0,C.y9)([i,e]),(0,C.fi)(t),n.querySelector("input.search").focus()}),document.querySelector("#cancel_topic_edit").addEventListener("click",()=>{s?.hideToast(),(0,C.y9)(t),(0,C.fi)([i,e]),e.focus()}),document.querySelector("#save_topic").addEventListener("click",async l=>{s?.hideToast();const u=t.querySelector("input[name=topics]").value,m=new FormData;m.append("topics",u);const y=await(0,Ae.LO)(l.target.getAttribute("data-link"),{data:m});if(y.ok){if((await y.json()).status==="ok"){if((0,C.xP)(i,".repo-topic",L=>L.remove()),u.length){const L=u.split(",");L.sort();for(const z of L){const X=document.createElement("a");X.classList.add("repo-topic","ui","large","label","gt-ellipsis"),X.href=`${ph}/explore/repos?q=${encodeURIComponent(z)}&topic=1`,X.textContent=z,i.append(X)}}(0,C.y9)(t),(0,C.fi)([i,e])}}else if(y.status===422){const A=await y.json();if(s=gt(A.message,{duration:5e3}),A.invalidTopics&&A.invalidTopics.length>0){const{invalidTopics:L}=A,z=(0,C.xP)(n,"a.ui.label");for(const[X,_e]of u.split(",").entries())L.includes(_e)&&(z[X].classList.remove("green"),z[X].classList.add("red"))}}}),(0,ke.mD)(n).dropdown({allowAdditions:!0,forceSelection:!1,fullTextSearch:"exact",fields:{name:"description",value:"data-value"},saveRemoteData:!1,label:{transition:"horizontal flip",duration:200,variation:!1},apiSettings:{url:`${ph}/explore/topics/search?q={query}`,throttle:500,cache:!1,onResponse(l){const u={success:!1,results:[]},m=(0,St.Kq)(this.urlData.query.trim());let y=!1;const A=[];for(const L of(0,C.xP)(n,"a.ui.label.visible"))A.push(L.getAttribute("data-value"));if(l.topics){let L=!1;for(const{topic_name:z}of l.topics)A.includes(z)||(z.toLowerCase()===m.toLowerCase()&&(y=!0),u.results.push({description:z,"data-value":z}),L=!0);u.success=L}return m.length>0&&!y?(u.success=!0,u.results.unshift({description:m,"data-value":m})):m.length>0&&y&&u.results.sort((L,z)=>L.description.toLowerCase()===m.toLowerCase()?-1:z.description.toLowerCase()===m.toLowerCase()?1:L.description>z.description?-1:L.description<z.description?1:0),u}},onLabelCreate(l){return l=l.toLowerCase().trim(),this.attr("data-value",l).contents().first().replaceWith(l),(0,ke.mD)(this)},onAdd(l,u,m){l=l.toLowerCase().trim(),m[0].setAttribute("data-value",l),m[0].setAttribute("data-text",l)}})}const{appSubUrl:W0}=window.config;function Qu(){Number(document.querySelector("#security_protocol")?.value)>0?(0,C.fi)(".has-tls"):(0,C.y9)(".has-tls")}function z0(){document.querySelector(".page-content.admin")&&(hf(),K0(),X0(),G0())}function K0(){document.querySelector(".page-content.admin.edit.user, .page-content.admin.new.user")&&document.querySelector("#login_type")?.addEventListener("change",function(){this.value?.startsWith("0")?(document.querySelector("#user_name")?.removeAttribute("disabled"),document.querySelector("#login_name")?.removeAttribute("required"),(0,C.y9)(".non-local"),(0,C.fi)(".local"),document.querySelector("#user_name")?.focus(),this.getAttribute("data-password")==="required"&&document.querySelector("#password")?.setAttribute("required","required")):(document.querySelector(".admin.edit.user")&&document.querySelector("#user_name")?.setAttribute("disabled","disabled"),document.querySelector("#login_name")?.setAttribute("required","required"),(0,C.fi)(".non-local"),(0,C.y9)(".local"),document.querySelector("#login_name")?.focus(),document.querySelector("#password")?.removeAttribute("required"))})}function X0(){const e=document.querySelector(".page-content.admin.authentication");if(!e)return;const t=e.classList.contains("new"),i=e.classList.contains("edit");if(!t&&!i)return;function n(){const L=document.querySelectorAll(".search-page-size");if(document.querySelector("#use_paged_search").checked){(0,C.fi)(".search-page-size");for(const z of L)z.querySelector("input")?.setAttribute("required","required")}else{(0,C.y9)(".search-page-size");for(const z of L)z.querySelector("input")?.removeAttribute("required")}}function s(L){(0,C.y9)(".open_id_connect_auto_discovery_url, .oauth2_use_custom_url");for(const X of document.querySelectorAll(".open_id_connect_auto_discovery_url input[required]"))X.removeAttribute("required");const z=document.querySelector("#oauth2_provider").value;switch(z){case"openidConnect":document.querySelector(".open_id_connect_auto_discovery_url input").setAttribute("required","required"),(0,C.fi)(".open_id_connect_auto_discovery_url");break;default:{const X=document.querySelector(`#${z}_customURLSettings`);if(!X)break;const _e=X.getAttribute("data-available")==="true",pe=X.getAttribute("data-required")==="true";_e&&(0,C.fi)(".oauth2_use_custom_url"),pe&&(document.querySelector("#oauth2_use_custom_url").checked=!0);break}}l(L)}function l(L){const z=document.querySelector("#oauth2_provider").value;(0,C.y9)(".oauth2_use_custom_url_field");for(const _e of document.querySelectorAll(".oauth2_use_custom_url_field input[required]"))_e.removeAttribute("required");if(document.querySelector(`#${z}_customURLSettings`)&&document.querySelector("#oauth2_use_custom_url").checked)for(const _e of["token_url","auth_url","profile_url","email_url","tenant"]){L&&(document.querySelector(`#oauth2_${_e}`).value=document.querySelector(`#${z}_${_e}`).value);const pe=document.querySelector(`#${z}_${_e}`);if(pe&&pe.getAttribute("data-available")==="true"){for(const de of document.querySelectorAll(`.oauth2_${_e} input`))de.setAttribute("required","required");(0,C.fi)(`.oauth2_${_e}`)}}}function u(){const L=document.querySelector(".js-ldap-group-toggle")?.checked;(0,C.oi)(document.querySelector("#ldap-group-options"),L)}const m=document.querySelector("#auth_type");if(t){const L=function(){(0,C.y9)(".ldap, .dldap, .smtp, .pam, .oauth2, .has-tls, .search-page-size, .sspi");for(const X of document.querySelectorAll(".ldap input[required], .binddnrequired input[required], .dldap input[required], .smtp input[required], .pam input[required], .oauth2 input[required], .has-tls input[required], .sspi input[required]"))X.removeAttribute("required");document.querySelector(".binddnrequired")?.classList.remove("required");const z=m.value;switch(z){case"2":(0,C.fi)(".ldap");for(const X of document.querySelectorAll(".binddnrequired input, .ldap div.required:not(.dldap) input"))X.setAttribute("required","required");document.querySelector(".binddnrequired")?.classList.add("required");break;case"3":(0,C.fi)(".smtp"),(0,C.fi)(".has-tls");for(const X of document.querySelectorAll(".smtp div.required input, .has-tls"))X.setAttribute("required","required");break;case"4":(0,C.fi)(".pam");for(const X of document.querySelectorAll(".pam input"))X.setAttribute("required","required");break;case"5":(0,C.fi)(".dldap");for(const X of document.querySelectorAll(".dldap div.required:not(.ldap) input"))X.setAttribute("required","required");break;case"6":(0,C.fi)(".oauth2");for(const X of document.querySelectorAll(".oauth2 div.required:not(.oauth2_use_custom_url,.oauth2_use_custom_url_field,.open_id_connect_auto_discovery_url) input"))X.setAttribute("required","required");s(!0);break;case"7":(0,C.fi)(".sspi");for(const X of document.querySelectorAll(".sspi div.required input"))X.setAttribute("required","required");break}(z==="2"||z==="5")&&(Qu(),u()),z==="2"&&n()};m.addEventListener("change",L),L(),document.querySelector("#security_protocol")?.addEventListener("change",Qu),document.querySelector("#use_paged_search")?.addEventListener("change",n),document.querySelector("#oauth2_provider")?.addEventListener("change",()=>s(!0)),document.querySelector("#oauth2_use_custom_url")?.addEventListener("change",()=>l(!0)),document.querySelector(".js-ldap-group-toggle").addEventListener("change",u)}if(i){const L=m.value;L==="2"||L==="5"?(document.querySelector("#security_protocol")?.addEventListener("change",Qu),document.querySelector(".js-ldap-group-toggle").addEventListener("change",u),u(),L==="2"&&document.querySelector("#use_paged_search")?.addEventListener("change",n)):L==="6"&&(document.querySelector("#oauth2_provider")?.addEventListener("change",()=>s(!0)),document.querySelector("#oauth2_use_custom_url")?.addEventListener("change",()=>l(!1)),s(!1))}const y=document.querySelector("#auth_name"),A=function(){document.querySelector("#oauth2-callback-url").textContent=`${window.location.origin}${W0}/user/oauth2/${encodeURIComponent(y.value)}/callback`};y.addEventListener("input",A),A()}function G0(){const e=document.querySelector(".page-content.admin.notice");if(!e)return;const t=document.querySelector("#detail-modal");(0,C.jB)(e,".view-detail",n=>n.addEventListener("click",s=>{s.preventDefault();const l=n.closest("tr").querySelector(".notice-description"),u=t.querySelector(".content pre");u.textContent=l.textContent,(0,ke.mD)(t).modal("show")}));const i=document.querySelectorAll(".select.table .ui.checkbox input");(0,C.jB)(e,".select.action",n=>n.addEventListener("click",()=>{switch(n.getAttribute("data-action")){case"select-all":for(const s of i)s.checked=!0;break;case"deselect-all":for(const s of i)s.checked=!1;break;case"inverse":for(const s of i)s.checked=!s.checked;break}})),document.querySelector("#delete-selection")?.addEventListener("click",async function(n){n.preventDefault(),this.classList.add("is-loading","disabled");const s=new FormData;for(const l of i)l.checked&&s.append("ids[]",l.closest(".ui.checkbox").getAttribute("data-id"));await(0,Ae.LO)(this.getAttribute("data-link"),{data:s}),window.location.href=this.getAttribute("data-redirect")})}function Q0(e){window.history.pushState?window.history.pushState(null,null,e):window.location.hash=e}function Yu(e){for(const pe of document.querySelectorAll(".code-view tr.active"))pe.classList.remove("active");const t=document.querySelectorAll(".code-view td.lines-num span[data-line-number]"),i=document.querySelector("a.ref-in-new-issue"),n=document.querySelector("a.copy-line-permalink"),s=document.querySelector("a.view_git_blame"),l=function(pe){if(!i)return;const de=i.getAttribute("data-url-issue-new"),Pe=i.getAttribute("data-url-param-body-link"),Le=`${(0,St.oK)(Pe)}#${pe}`;i.setAttribute("href",`${de}?body=${encodeURIComponent(Le)}`)},u=function(pe){if(!s)return;let de=s.getAttribute("href");de=`${de.replace(/#L\d+$|#L\d+-L\d+$/,"")}`,pe.length!==0&&(de=`${de}#${pe}`),s.setAttribute("href",de)},m=function(pe){if(!n)return;let de=n.getAttribute("data-url");de=`${de.replace(/#L\d+$|#L\d+-L\d+$/,"")}#${pe}`,n.setAttribute("data-clipboard-text",de),n.setAttribute("data-clipboard-text-type","url")},y=e?e.split("-"):[],A=y[0]??"";if(!A)return null;const L=y[1]||A;let z=parseInt(A.substring(1)),X=parseInt(L.substring(1));if(z>X){const pe=z;z=X,X=pe,e=`${L}-${A}`}const _e=t[z-1]??null;for(let pe=z-1;pe<=X-1&&pe<t.length;pe++)t[pe].closest("tr").classList.add("active");return Q0(`#${e}`),l(e),u(e),m(e),_e}function gh(){const e=document.querySelector(".code-line-menu");if(!e)return;for(const s of document.querySelectorAll(".code-line-button"))s.remove();const t=document.querySelector(".code-view tr.active");if(!t)return;const i=t.querySelector("td.lines-num"),n=document.createElement("button");n.classList.add("code-line-button","ui","basic","button"),n.innerHTML=(0,Z.JW)("octicon-kebab-horizontal"),i.prepend(n),n.closest(".code-view").append(e.cloneNode(!0)),Ie(n,{theme:"menu",trigger:"click",hideOnClick:!0,content:e,placement:"right-start",interactive:!0,onShow:s=>{s.popper.addEventListener("click",()=>{s.hide()},{once:!0})}})}function Y0(){if(!document.querySelector(".repo-view-container .file-view"))return;let e;(0,C.ny)(document,"click",".code-view .lines-num span",(i,n)=>{if(!e||!n.shiftKey)e=i.getAttribute("id"),Yu(e);else{const s=i.getAttribute("id");Yu(`${e}-${s}`)}window.getSelection().removeAllRanges(),gh()});const t=()=>{if(!window.location.hash||!document.querySelector(".code-view .lines-num"))return;const i=window.location.hash.substring(1),n=Yu(i);n&&(window.history.scrollRestoration!=="manual"&&(window.history.scrollRestoration="manual"),n.scrollIntoView({block:"start"}),gh())};t(),window.addEventListener("hashchange",t)}function J0(){document.querySelector("#ssh-key-content")?.addEventListener("input",function(){const e=this.value.split(" "),t=document.querySelector("#ssh-key-title");!t.value&&e.length===3&&e[2]!==""&&(t.value=e[2])})}function Z0(){if(!document.querySelector(".user.settings.profile"))return;const e=document.querySelector("#username");e&&e.addEventListener("input",function(){const t=document.querySelector("#name-change-prompt"),i=document.querySelector("#name-change-redirect-prompt");this.value.toLowerCase()!==this.getAttribute("data-name").toLowerCase()?((0,C.fi)(t),(0,C.fi)(i)):((0,C.y9)(t),(0,C.y9)(i))})}function ev(){const e=document.querySelector("#repo_migrating");if(!e)return;document.querySelector("#repo_migrating_retry")?.addEventListener("click",tv);const t=e.getAttribute("data-migrating-repo-link"),i=async()=>{const s=await(0,Ae.fG)(`${t}/-/migrate/status`);if(s.status!==200)return!0;const l=await s.json();return l.message&&(document.querySelector("#repo_migrating_progress_message").textContent=l.message),l.status===4?(window.location.reload(),!1):l.status===3?((0,C.y9)("#repo_migrating_progress"),(0,C.y9)("#repo_migrating"),(0,C.fi)("#repo_migrating_retry"),(0,C.fi)("#repo_migrating_failed"),(0,C.fi)("#repo_migrating_failed_image"),document.querySelector("#repo_migrating_failed_error").textContent=l.message,!1):!0},n=async()=>{let s=!0;try{s=await i()}finally{s&&setTimeout(n,2e3)}};n()}async function tv(e){await(0,Ae.LO)(e.target.getAttribute("data-migrating-task-retry-url")),window.location.reload()}const{pageData:Ju}=window.config;let Zu;function ed(){return Zu||(Zu=nv(Ju.DiffFileTree,Ju.FolderIcon,Ju.FolderOpenIcon)),Zu}function iv(e,t,i){const n=e.fullNameMap[t];if(n){n.IsViewed=i;for(let s=n.ParentEntry;s;s=s.ParentEntry)s.IsViewed=bh(s)}}function vh(e,t){if(e[t.FullName]=t,!!t.Children){t.IsViewed=bh(t);for(const i of t.Children)i.ParentEntry=t,vh(e,i)}}function nv(e,t,i){const n=(0,Re.Kh)({diffFileTree:e,folderIcon:t,folderOpenIcon:i,fileTreeIsVisible:!1,selectedItem:"",fullNameMap:{}});return vh(n.fullNameMap,e.TreeRoot),n}function bh(e){if(e.Children){let t=0;for(const i of e.Children)i.IsViewed&&t++;return t===e.Children.length}return e.IsViewed}const sv=["title"],rv=["innerHTML"],ov={class:"gt-ellipsis"},av={class:"sub-items"},lv=["title","href"],cv=["innerHTML"],uv={class:"gt-ellipsis tw-flex-1"};var dv=(0,c.pM)({__name:"DiffFileTreeItem",props:{item:{}},setup(e){const t=e,i=ed(),n=(0,Re.KR)(t.item.IsViewed);function s(l){const u={"":{name:"octicon-blocked",classes:["text","red"]},added:{name:"octicon-diff-added",classes:["text","green"]},modified:{name:"octicon-diff-modified",classes:["text","yellow"]},deleted:{name:"octicon-diff-removed",classes:["text","red"]},renamed:{name:"octicon-diff-renamed",classes:["text","teal"]},copied:{name:"octicon-diff-renamed",classes:["text","green"]},typechange:{name:"octicon-diff-modified",classes:["text","green"]}};return u[l]??u[""]}return(l,u)=>{const m=(0,c.g2)("DiffFileTreeItem",!0);return l.item.EntryMode==="tree"?((0,c.uX)(),(0,c.CE)(c.FK,{key:0},[(0,c.Lk)("div",{class:(0,W.C4)(["item-directory",{viewed:l.item.IsViewed}]),title:l.item.DisplayName,onClick:u[0]||(u[0]=Di(y=>n.value=!n.value,["stop"]))},[(0,c.Q3)(" directory "),(0,c.bF)((0,Re.R1)(Z.Ah),{name:n.value?"octicon-chevron-right":"octicon-chevron-down"},null,8,["name"]),(0,c.Q3)(" eslint-disable-next-line vue/no-v-html "),(0,c.Lk)("span",{class:"tw-contents",innerHTML:n.value?(0,Re.R1)(i).folderIcon:(0,Re.R1)(i).folderOpenIcon},null,8,rv),(0,c.Lk)("span",ov,(0,W.v_)(l.item.DisplayName),1)],10,sv),(0,c.bo)((0,c.Lk)("div",av,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(l.item.Children,y=>((0,c.uX)(),(0,c.Wv)(m,{key:y.DisplayName,item:y},null,8,["item"]))),128))],512),[[ti,!n.value]])],64)):((0,c.uX)(),(0,c.CE)("a",{key:1,class:(0,W.C4)(["item-file",{selected:(0,Re.R1)(i).selectedItem==="#diff-"+l.item.NameHash,viewed:l.item.IsViewed}]),title:l.item.DisplayName,href:"#diff-"+l.item.NameHash},[(0,c.Q3)(" file "),(0,c.Q3)(" eslint-disable-next-line vue/no-v-html "),(0,c.Lk)("span",{class:"tw-contents",innerHTML:l.item.FileIcon},null,8,cv),(0,c.Lk)("span",uv,(0,W.v_)(l.item.DisplayName),1),(0,c.bF)((0,Re.R1)(Z.Ah),{name:s(l.item.DiffStatus).name,class:(0,W.C4)(s(l.item.DiffStatus).classes)},null,8,["name","class"])],10,lv))}}}),fv=(0,Xi.A)(dv,[["__scopeId","data-v-a138c97c"]]);const hv={key:0,class:"diff-file-tree-items"},_h="diff_file_tree_visible";var mv=(0,c.pM)({__name:"DiffFileTree",setup(e){const t=ed();(0,c.sV)(()=>{t.fileTreeIsVisible=localStorage.getItem(_h)!=="false",document.querySelector(".diff-toggle-file-tree-button").addEventListener("click",s),i(),window.addEventListener("hashchange",i)}),(0,c.hi)(()=>{document.querySelector(".diff-toggle-file-tree-button").removeEventListener("click",s),window.removeEventListener("hashchange",i)});function i(){t.selectedItem=window.location.hash,n()}function n(){if(t.selectedItem){const m=document.querySelector(t.selectedItem);m?.getAttribute("data-folded")==="true"&&Ba(m,m.querySelector(".fold-file"),!1)}}function s(){l(!t.fileTreeIsVisible)}function l(m){t.fileTreeIsVisible=m,localStorage.setItem(_h,t.fileTreeIsVisible.toString()),u(t.fileTreeIsVisible)}function u(m){const y=document.querySelector(".diff-toggle-file-tree-button"),[A,L]=y.querySelectorAll(".icon"),z=document.querySelector("#diff-file-tree"),X=y.getAttribute(m?"data-hide-text":"data-show-text");y.setAttribute("data-tooltip-content",X),(0,C.oi)(z,m),(0,C.oi)(A,!m),(0,C.oi)(L,m)}return(m,y)=>(0,Re.R1)(t).fileTreeIsVisible?((0,c.uX)(),(0,c.CE)("div",hv,[(0,c.Q3)(" only render the tree if we're visible. in many cases this is something that doesn't change very often "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,Re.R1)(t).diffFileTree.TreeRoot.Children,A=>((0,c.uX)(),(0,c.Wv)(fv,{key:A.FullName,item:A},null,8,["item"]))),128))])):(0,c.Q3)("v-if",!0)}}),pv=(0,Xi.A)(mv,[["__scopeId","data-v-12a35ef6"]]);function gv(){const e=document.querySelector("#diff-file-tree");if(!e)return;Ai(pv).mount(e)}const vv={class:"ui scrolling dropdown custom diff-commit-selector"},bv=["data-tooltip-content","aria-label","aria-controls","aria-activedescendant"],_v=["id","aria-expanded"],yv={key:0,class:"loading-indicator is-loading"},wv=["id"],Sv={class:"gt-ellipsis"},xv={class:"gt-ellipsis text light-2 tw-mb-0"},jv={class:"gt-ellipsis"},Ev={class:"gt-ellipsis text light-2"},Av={key:3,class:"info text light-2"},Cv=["data-commit-idx","onKeydown","onMouseover","onClick"],kv={class:"tw-flex-1 tw-flex tw-flex-col tw-gap-1"},Tv={class:"gt-ellipsis commit-list-summary"},Lv={class:"gt-ellipsis text light-2"},Rv={class:"text right"},Mv=["datetime"],Dv={class:"tw-font-mono"};function Ov(e,t,i,n,s,l){const u=(0,c.g2)("svg-icon");return(0,c.uX)(),(0,c.CE)("div",vv,[(0,c.Lk)("button",{ref:"expandBtn",class:"ui tiny basic button",onClick:t[0]||(t[0]=Di(m=>e.toggleMenu(),["stop"])),"data-tooltip-content":e.locale.filter_changes_by_commit,"aria-haspopup":"true","aria-label":e.locale.filter_changes_by_commit,"aria-controls":e.uniqueIdMenu,"aria-activedescendant":e.uniqueIdShowAll},[(0,c.bF)(u,{name:"octicon-git-commit"})],8,bv),(0,c.Q3)(' this dropdown is not managed by Fomantic UI, so it needs some classes like "transition" explicitly '),(0,c.bo)((0,c.Lk)("div",{class:(0,W.C4)(["left menu transition",{visible:e.menuVisible}]),id:e.uniqueIdMenu,"aria-expanded":e.menuVisible?"true":"false"},[e.isLoading?((0,c.uX)(),(0,c.CE)("div",yv)):(0,c.Q3)("v-if",!0),e.isLoading?(0,c.Q3)("v-if",!0):((0,c.uX)(),(0,c.CE)("div",{key:1,class:"item",id:e.uniqueIdShowAll,ref:"showAllChanges",role:"menuitem",onKeydown:t[1]||(t[1]=se(m=>e.showAllChanges(),["enter"])),onClick:t[2]||(t[2]=m=>e.showAllChanges())},[(0,c.Lk)("div",Sv,(0,W.v_)(e.locale.show_all_commits),1),(0,c.Lk)("div",xv,(0,W.v_)(e.locale.stats_num_commits),1)],40,wv)),(0,c.Q3)(" only show the show changes since last review if there is a review AND we are commits ahead of the last review "),e.lastReviewCommitSha!=null?((0,c.uX)(),(0,c.CE)("div",{key:2,class:(0,W.C4)(["item",{disabled:!e.commitsSinceLastReview}]),role:"menuitem",onKeydown:t[3]||(t[3]=se(m=>e.changesSinceLastReviewClick(),["enter"])),onClick:t[4]||(t[4]=m=>e.changesSinceLastReviewClick())},[(0,c.Lk)("div",jv,(0,W.v_)(e.locale.show_changes_since_your_last_review),1),(0,c.Lk)("div",Ev,(0,W.v_)(e.commitsSinceLastReview)+" commits ",1)],34)):(0,c.Q3)("v-if",!0),e.isLoading?(0,c.Q3)("v-if",!0):((0,c.uX)(),(0,c.CE)("span",Av,(0,W.v_)(e.locale.select_commit_hold_shift_for_range),1)),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.commits,(m,y)=>((0,c.uX)(),(0,c.CE)("div",{key:m.id,class:(0,W.C4)(["item",{selected:m.selected,hovered:m.hovered}]),role:"menuitem","data-commit-idx":y,onKeydown:[se(Di(A=>e.commitClicked(m.id),["exact"]),["enter"]),se(Di(A=>e.commitClickedShift(m),["shift","exact"]),["enter"])],onMouseover:Di(A=>e.highlight(m),["shift"]),onClick:[Di(A=>e.commitClicked(m.id),["exact"]),Di(A=>e.commitClicked(m.id,!0),["ctrl","exact"]),Di(A=>e.commitClicked(m.id,!0),["meta","exact"]),Di(A=>e.commitClickedShift(m),["shift","exact","stop","prevent"])]},[(0,c.Lk)("div",kv,[(0,c.Lk)("div",Tv,(0,W.v_)(m.summary),1),(0,c.Lk)("div",Lv,[(0,c.eW)((0,W.v_)(m.committer_or_author_name)+" ",1),(0,c.Lk)("span",Rv,[(0,c.Q3)(" TODO: make this respect the PreferredTimestampTense setting "),(0,c.Lk)("relative-time",{prefix:"",datetime:m.time,"data-tooltip-content":"","data-tooltip-interactive":"true"},(0,W.v_)(m.time),9,Mv)])])]),(0,c.Lk)("div",Dv,(0,W.v_)(m.short_sha),1)],42,Cv))),128))],10,_v),[[ti,e.menuVisible]])])}var qv=(0,c.pM)({components:{SvgIcon:Z.Ah},data:()=>{const e=document.querySelector("#diff-commit-select");return{menuVisible:!1,isLoading:!1,queryParams:e.getAttribute("data-queryparams"),issueLink:e.getAttribute("data-issuelink"),locale:{filter_changes_by_commit:e.getAttribute("data-filter_changes_by_commit")},mergeBase:e.getAttribute("data-merge-base"),commits:[],hoverActivated:!1,lastReviewCommitSha:"",uniqueIdMenu:(0,ke.Ae)(),uniqueIdShowAll:(0,ke.Ae)()}},computed:{commitsSinceLastReview(){return this.lastReviewCommitSha?this.commits.length-this.commits.findIndex(e=>e.id===this.lastReviewCommitSha)-1:0}},mounted(){document.body.addEventListener("click",this.onBodyClick),this.$el.addEventListener("keydown",this.onKeyDown),this.$el.addEventListener("keyup",this.onKeyUp)},unmounted(){document.body.removeEventListener("click",this.onBodyClick),this.$el.removeEventListener("keydown",this.onKeyDown),this.$el.removeEventListener("keyup",this.onKeyUp)},methods:{onBodyClick(e){this.$el.contains(e.target)||this.menuVisible&&this.toggleMenu()},onKeyDown(e){if(!this.menuVisible)return;const t=document.activeElement;if(this.$el.contains(t)){switch(e.key){case"ArrowDown":e.preventDefault(),this.focusElem(t.nextElementSibling,t);break;case"ArrowUp":e.preventDefault(),this.focusElem(t.previousElementSibling,t);break;case"Escape":e.preventDefault(),t.tabIndex=-1,this.toggleMenu();break}if(e.key==="ArrowDown"||e.key==="ArrowUp"){const i=document.activeElement,n=i?.matches(".item")?i.getAttribute("data-commit-idx"):null;n&&this.highlight(this.commits[Number(n)])}}},onKeyUp(e){if(!this.menuVisible)return;const t=document.activeElement;if(this.$el.contains(t)&&e.key==="Shift"&&this.hoverActivated){this.hoverActivated=!1;for(const i of this.commits)i.hovered=!1,i.selected=!1}},highlight(e){if(!this.hoverActivated)return;const t=this.commits.findIndex(n=>n.selected),i=this.commits.findIndex(n=>n.id===e.id);for(const[n,s]of this.commits.entries())s.hovered=Math.min(t,i)<=n&&n<=Math.max(t,i)},focusElem(e,t){e&&(e.tabIndex=0,t&&(t.tabIndex=-1),e.focus())},async toggleMenu(){if(this.menuVisible=!this.menuVisible,!this.commits.length&&this.menuVisible&&!this.isLoading){this.isLoading=!0;try{await this.fetchCommits()}finally{this.isLoading=!1}}this.$nextTick(()=>{this.menuVisible?this.focusElem(this.$refs.showAllChanges,this.$refs.expandBtn):this.focusElem(this.$refs.expandBtn,this.$refs.showAllChanges)})},async fetchCommits(){const t=await(await(0,Ae.fG)(`${this.issueLink}/commits/list`)).json();this.commits.push(...t.commits.map(i=>(i.hovered=!1,i))),this.commits.reverse(),this.lastReviewCommitSha=t.last_review_commit_sha||null,this.lastReviewCommitSha&&!this.commits.some(i=>i.id===this.lastReviewCommitSha)&&(this.lastReviewCommitSha=null),Object.assign(this.locale,t.locale)},showAllChanges(){window.location.assign(`${this.issueLink}/files${this.queryParams}`)},changesSinceLastReviewClick(){window.location.assign(`${this.issueLink}/files/${this.lastReviewCommitSha}..${this.commits.at(-1).id}${this.queryParams}`)},commitClicked(e,t=!1){const i=`${this.issueLink}/commits/${e}${this.queryParams}`;t?window.open(i):window.location.assign(i)},commitClickedShift(e){if(this.hoverActivated=!this.hoverActivated,e.selected=!0,!this.hoverActivated){const t=this.commits.findIndex(l=>l.selected),i=this.commits.findLastIndex(l=>l.selected);let n;t===0?n=this.mergeBase:n=this.commits[t-1].id;const s=this.commits[i].id;t===i?window.location.assign(`${this.issueLink}/commits/${s}${this.queryParams}`):n===this.mergeBase&&s===this.commits.at(-1).id?window.location.assign(`${this.issueLink}/files${this.queryParams}`):window.location.assign(`${this.issueLink}/files/${n}..${s}${this.queryParams}`)}}}}),Pv=(0,Xi.A)(qv,[["render",Ov],["__scopeId","data-v-c589fa0e"]]);function Fv(){const e=document.querySelector("#diff-commit-select");if(!e)return;Ai(Pv).mount(e)}const{pageData:Iv}=window.config,Ua=Iv.prReview||{},yh="viewed-file-checked-form",wh=".viewed-file-form",Nv="#expand-files-btn",Hv="#collapse-files-btn";function Sh(){document.querySelector("#viewed-files-summary")?.setAttribute("value",Ua.numberOfViewedFiles);const t=document.querySelector("#viewed-files-summary-label");t&&(t.innerHTML=t.getAttribute("data-text-changed-template").replace("%[1]d",Ua.numberOfViewedFiles).replace("%[2]d",Ua.numberOfFiles))}function Bv(){Ua.numberOfViewedFiles=document.querySelectorAll(`${wh} > input[type=checkbox][checked]`).length,Sh()}function xh(){for(const e of document.querySelectorAll(`${wh}:not([data-has-viewed-checkbox-listener="true"])`)){e.setAttribute("data-has-viewed-checkbox-listener",String(!0));const t=e.querySelector("input[type=checkbox]");t.addEventListener("input",function(){this.checked?(e.classList.add(yh),t.setAttribute("checked",""),Ua.numberOfViewedFiles++):(e.classList.remove(yh),t.removeAttribute("checked"),Ua.numberOfViewedFiles--),Sh(),e.parentNode.querySelector(".changed-since-last-review")?.remove();const n=t.getAttribute("name");iv(ed(),n,this.checked);const s={};s[n]=this.checked;const l={files:s},u=e.getAttribute("data-headcommit");u&&(l.headCommitSHA=u),(0,Ae.LO)(e.getAttribute("data-link"),{data:l});const m=e.closest(".diff-file-header");Ba(m.closest(".file-content"),m.querySelector(".fold-file"),this.checked)})}}function $v(){document.querySelector(Nv)?.addEventListener("click",()=>{for(const e of document.querySelectorAll('.file-content[data-folded="true"]'))Ba(e,e.querySelector(".fold-file"),!1)}),document.querySelector(Hv)?.addEventListener("click",()=>{for(const e of document.querySelectorAll('.file-content:not([data-folded="true"])'))e.getAttribute("id")!=="diff-incomplete"&&Ba(e,e.querySelector(".fold-file"),!0)})}const{i18n:Uv}=window.config;function Vv(e){(0,C.jB)(e,".file-view-toggle",t=>t.addEventListener("click",()=>{(0,C.D6)(t,".file-view-toggle",n=>n.classList.remove("active")),t.classList.add("active");const i=document.querySelector(t.getAttribute("data-toggle-selector"));if(!i)throw new Error("Target element not found");(0,C.y9)((0,C.D6)(i)),(0,C.fi)(i)}))}function Wv(){(0,C.ny)(document,"submit",".conversation-holder form",async(e,t)=>{t.preventDefault();const i=e.querySelector("textarea");if(hh(i)&&!e.classList.contains("is-loading"))try{e.classList.add("is-loading");const n=new FormData(e),s=(0,C.IU)(t);(s?.nodeName==="BUTTON"||s?.nodeName==="INPUT"&&s.type==="submit")&&s.name&&n.append(s.name,s.value);const u=e.closest("tr")?.getAttribute("data-line-type"),m=await(0,Ae.LO)(e.getAttribute("action"),{data:n}),y=(0,C.SL)(await m.text()),A=y.getAttribute("data-path"),L=y.getAttribute("data-side"),z=y.getAttribute("data-idx");if(e.closest(".conversation-holder").replaceWith(y),e=null,u){let X;u==="same"?X=`[data-path="${A}"] .add-code-comment[data-idx="${z}"]`:X=`[data-path="${A}"] .add-code-comment[data-side="${L}"][data-idx="${z}"]`;for(const _e of document.querySelectorAll(X))_e.classList.add("tw-invisible")}if(!s||s?.matches('button[name="pending_review"]')){const X=document.querySelector("#review-box"),_e=X?.querySelector(".review-comments-counter");if(!_e)return;const pe=parseInt(_e.getAttribute("data-pending-comment-number"))+1||1;_e.setAttribute("data-pending-comment-number",String(pe)),_e.textContent=String(pe),(0,C.b7)(X,"pulse-1p5-200")}}catch(n){console.error("Error:",n),gt(Uv.network_error)}finally{e?.classList.remove("is-loading")}}),(0,C.ny)(document,"click",".resolve-conversation",async(e,t)=>{t.preventDefault();const i=e.getAttribute("data-comment-id"),n=e.getAttribute("data-origin"),s=e.getAttribute("data-action"),l=e.getAttribute("data-update-url");try{const m=await(await(0,Ae.LO)(l,{data:new URLSearchParams({origin:n,action:s,comment_id:i})})).text(),y=e.closest(".conversation-holder");if(y){const A=(0,C.SL)(m);y.replaceWith(A)}else window.location.reload()}catch(u){console.error("Error:",u)}})}function zv(){(0,C.ny)(document,"click",".previous-conversation, .next-conversation",(e,t)=>{t.preventDefault();const i=e.matches(".previous-conversation"),n=e.closest(".comment-code-cloud"),s=document.querySelectorAll(".comment-code-cloud:not(.tw-hidden)"),l=Array.from(s).indexOf(n),u=l>0?l-1:s.length-1,m=l<s.length-1?l+1:0,L=s[i?u:m].querySelector(".comment").id;window.location.href=`#${L}`})}function jh(){for(const e of document.querySelectorAll(".diff-header-popup-btn:not([data-header-popup-initialized])")){e.setAttribute("data-header-popup-initialized","");const t=e.nextElementSibling;if(!t?.matches(".tippy-target"))throw new Error("Popup element not found");Ie(e,{content:t,theme:"menu",placement:"bottom",trigger:"click",interactive:!0,hideOnClick:!0})}}function Eh(){tf(),xh(),Bv(),Ld(),jh()}async function Ah(e){if(e.classList.contains("disabled"))return!1;e.classList.add("disabled");const t=e.getAttribute("data-href");try{const n=await(await(0,Ae.fG)(t)).text(),l=(0,St.a8)(n,"text/html").querySelector("#diff-file-boxes");return document.querySelector("#diff-incomplete").replaceWith(...Array.from(l.children)),Eh(),!0}catch(i){console.error("Error:",i),gt("An error occurred while loading more files.")}finally{e.classList.remove("disabled")}return!1}function Kv(){(0,C.ny)(document,"click","a#diff-show-more-files",(e,t)=>{t.preventDefault(),Ah(e)}),(0,C.ny)(document,"click","a.diff-load-button",async(e,t)=>{if(t.preventDefault(),e.classList.contains("disabled"))return;e.classList.add("disabled");const i=e.getAttribute("data-href");try{const s=await(await(0,Ae.fG)(i)).text(),u=(0,St.a8)(s,"text/html").querySelector("#diff-file-boxes .diff-file-body .file-body"),m=Array.from(u.children);e.parentElement.replaceWith(...m);for(const y of m)window.htmx.process(y);Eh()}catch(n){console.error("Error:",n)}finally{e.classList.remove("disabled")}})}async function Ch(){const e=window.location.hash;if(!(!e.startsWith("#diff-")&&!e.startsWith("#issuecomment-")))for(;;){const t=document.getElementById(e.substring(1));if(t){t.scrollIntoView();return}const i=document.querySelector("#diff-show-more-files");if(!i||!await Ah(i))return}}function Xv(){window.addEventListener("hashchange",Ch),Ch()}function Gv(){Wv(),document.querySelector("#diff-file-boxes")&&(zv(),gv(),Fv(),Kv(),jh(),xh(),$v(),Xv(),yc("#diff-file-boxes .diff-file-box",Vv),(0,C.ny)(document,"click",".fold-file",e=>{ng(e.closest(".file-content"),e)}))}const{appSubUrl:Qv}=window.config;function Yv(){const e=document.querySelector(".page-content.organization.new.team");e&&(0,C.jB)(e,"input[name=permission]",t=>t.addEventListener("change",()=>{const i=e.querySelector("input[name=permission]:checked")?.value;(0,C.oi)(e.querySelectorAll(".team-units"),i!=="admin")}))}function Jv(){const e=(0,ke.mD)("#search-repo-box");e.search({minCharacters:2,apiSettings:{url:`${Qv}/repo/search?q={query}&uid=${e.data("uid")}`,onResponse(t){const i=[];for(const n of t.data)i.push({title:n.repository.full_name.split("/")[1],description:n.repository.full_name});return{results:i}}},searchFields:["full_name"],showNoResults:!1})}function Zv(){document.querySelector(".page-content.organization")&&(Yv(),Jv())}const{appSubUrl:Mo}=window.config;async function eb(){const e=document.querySelector(".user.signin.webauthn-prompt"),t=document.querySelector(".signin-passkey");if(!(!e&&!t)){if(!window.isSecureContext){(0,C.y9)(t);return}Th()&&(t&&t.addEventListener("click",tb),e&&ib())}}async function tb(){const e=await(0,Ae.fG)(`${Mo}/user/webauthn/passkey/assertion`);if(!e.ok){Ds("unknown");return}const t=await e.json();t.publicKey.challenge=(0,St.vd)(t.publicKey.challenge);for(const i of t.publicKey.allowCredentials??[])i.id=(0,St.vd)(i.id);try{const i=await navigator.credentials.get({publicKey:t.publicKey}),n=i.response,s=new Uint8Array(n.authenticatorData),l=new Uint8Array(n.clientDataJSON),u=new Uint8Array(i.rawId),m=new Uint8Array(n.signature),y=new Uint8Array(n.userHandle),A=await(0,Ae.LO)(`${Mo}/user/webauthn/passkey/login`,{data:{id:i.id,rawId:(0,St.vh)(u),type:i.type,clientExtensionResults:i.getClientExtensionResults(),response:{authenticatorData:(0,St.vh)(s),clientDataJSON:(0,St.vh)(l),signature:(0,St.vh)(m),userHandle:(0,St.vh)(y)}}});if(A.status===500){Ds("unknown");return}else if(!A.ok){Ds("unable-to-process");return}const L=await A.json();window.location.href=L?.redirect??`${Mo}/`}catch(i){Ds("general",i.message)}}async function ib(){const e=await(0,Ae.fG)(`${Mo}/user/webauthn/assertion`);if(!e.ok){Ds("unknown");return}const t=await e.json();t.publicKey.challenge=(0,St.vd)(t.publicKey.challenge);for(const i of t.publicKey.allowCredentials??[])i.id=(0,St.vd)(i.id);try{const i=await navigator.credentials.get({publicKey:t.publicKey});await kh(i)}catch(i){if(!t.publicKey.extensions?.appid){Ds("general",i.message);return}delete t.publicKey.extensions.appid;try{const n=await navigator.credentials.get({publicKey:t.publicKey});await kh(n)}catch(n){Ds("general",n.message)}}}async function kh(e){const t=new Uint8Array(e.response.authenticatorData),i=new Uint8Array(e.response.clientDataJSON),n=new Uint8Array(e.rawId),s=new Uint8Array(e.response.signature),l=new Uint8Array(e.response.userHandle),u=await(0,Ae.LO)(`${Mo}/user/webauthn/assertion`,{data:{id:e.id,rawId:(0,St.vh)(n),type:e.type,clientExtensionResults:e.getClientExtensionResults(),response:{authenticatorData:(0,St.vh)(t),clientDataJSON:(0,St.vh)(i),signature:(0,St.vh)(s),userHandle:(0,St.vh)(l)}}});if(u.status===500){Ds("unknown");return}else if(!u.ok){Ds("unable-to-process");return}const m=await u.json();window.location.href=m?.redirect??`${Mo}/`}async function nb(e){const t=new Uint8Array(e.response.attestationObject),i=new Uint8Array(e.response.clientDataJSON),n=new Uint8Array(e.rawId),s=await(0,Ae.LO)(`${Mo}/user/settings/security/webauthn/register`,{data:{id:e.id,rawId:(0,St.vh)(n),type:e.type,response:{attestationObject:(0,St.vh)(t),clientDataJSON:(0,St.vh)(i)}}});if(s.status===409){Ds("duplicated");return}else if(s.status!==201){Ds("unknown");return}window.location.reload()}function Ds(e,t=""){const i=document.querySelector("#webauthn-error-msg");if(e==="general")i.textContent=t||"unknown error";else{const n=document.querySelector(`#webauthn-error [data-webauthn-error-msg=${e}]`);n?i.textContent=`${n.textContent}${t?` ${t}`:""}`:i.textContent=`unknown error type: ${e}${t?` ${t}`:""}`}(0,C.fi)("#webauthn-error")}function Th(){return window.isSecureContext?typeof window.PublicKeyCredential!="function"?(Ds("browser"),!1):!0:(Ds("insecure"),!1)}function sb(){const e=document.querySelector("#register-webauthn");if(e){if(!Th()){e.disabled=!0;return}e.addEventListener("click",async t=>{t.preventDefault(),await rb()})}}async function rb(){const e=document.querySelector("#nickname"),t=new FormData;t.append("name",e.value);const i=await(0,Ae.LO)(`${Mo}/user/settings/security/webauthn/request_register`,{data:t});if(i.status===409){Ds("duplicated");return}else if(!i.ok){Ds("unknown");return}const n=await i.json();if(e.closest("div.field").classList.remove("error"),n.publicKey.challenge=(0,St.vd)(n.publicKey.challenge),n.publicKey.user.id=(0,St.vd)(n.publicKey.user.id),n.publicKey.excludeCredentials)for(const s of n.publicKey.excludeCredentials)s.id=(0,St.vd)(s.id);try{const s=await navigator.credentials.create({publicKey:n.publicKey});await nb(s)}catch(s){Ds("unknown",s)}}function ob(){document.addEventListener("click",e=>{if(e.target.matches(".remove-rel-attach")){const t=e.target.getAttribute("data-uuid"),i=e.target.getAttribute("data-id");document.querySelector(`input[name='attachment-del-${t}']`).value="true",(0,C.y9)(`#attachment-${i}`)}})}function ab(){document.querySelector(".repository.new.release")&&lb()}function lb(){const e=document.querySelector("#tag-name-editor");if(!e)return;const t=JSON.parse(e.getAttribute("data-existing-tags"));if(!Array.isArray(t))return;const i=e.getAttribute("data-tag-helper"),n=e.getAttribute("data-tag-helper-new"),s=e.getAttribute("data-tag-helper-existing"),l=document.querySelector("#tag-name"),u=function(m){const y=m.value,A=document.querySelector("#tag-helper");t.includes(y)?((0,C.y9)("#tag-target-selector"),A.textContent=s):((0,C.fi)("#tag-target-selector"),A.textContent=y?n:i)};u(l),l.addEventListener("input",m=>{u(m.target)})}const{appSubUrl:cb}=window.config,ub=/^\S+@\S+$/;function db(){const e=document.querySelector("#search-user-box");if(!e)return;const t=e.getAttribute("data-allow-email")==="true",i=e.getAttribute("data-allow-email-description")??void 0;(0,ke.mD)(e).search({minCharacters:2,apiSettings:{url:`${cb}/user/search_candidates?q={query}`,onResponse(n){const s=[],l=e.querySelector("input").value,u=l.toUpperCase();for(const m of n.data){const y={title:m.login,image:m.avatar_url,description:R(m.full_name)};u===m.login.toUpperCase()?s.unshift(y):s.push(y)}if(t&&!s.length&&ub.test(l)){const m={title:l,description:i};s.push(m)}return{results:s}}},searchFields:["login","full_name"],showNoResults:!1})}function fb(){const e=document.querySelector(".page-content.install");e&&(e.classList.contains("post-install")?mb():hb())}function hb(){const e="gitea",t="gitea",i={mysql:"127.0.0.1:3306",postgres:"127.0.0.1:5432",mssql:"127.0.0.1:1433"},n=document.querySelector("#db_host"),s=document.querySelector("#db_user"),l=document.querySelector("#db_name");document.querySelector("#db_type").addEventListener("change",function(){const y=this.value;if((0,C.y9)("div[data-db-setting-for]"),(0,C.fi)(`div[data-db-setting-for=${y}]`),y!=="sqlite3"){(0,C.fi)("div[data-db-setting-for=common-host]");const A=n.value;(!A||Object.values(i).includes(A))&&(n.value=i[y]??""),!s.value&&!l.value&&(s.value=e,l.value=t)}}),document.querySelector("#db_type").dispatchEvent(new Event("change"));const u=document.querySelector("#app_url");u.value.includes("://localhost")&&(u.value=window.location.href);const m=document.querySelector("#domain");m.value.trim()==="localhost"&&(m.value=window.location.hostname),document.querySelector("#offline-mode input").addEventListener("change",function(){this.checked&&(document.querySelector("#disable-gravatar input").checked=!0,document.querySelector("#federated-avatar-lookup input").checked=!1)}),document.querySelector("#disable-gravatar input").addEventListener("change",function(){this.checked?document.querySelector("#federated-avatar-lookup input").checked=!1:document.querySelector("#offline-mode input").checked=!1}),document.querySelector("#federated-avatar-lookup input").addEventListener("change",function(){this.checked&&(document.querySelector("#disable-gravatar input").checked=!1,document.querySelector("#offline-mode input").checked=!1)}),document.querySelector("#enable-openid-signin input").addEventListener("change",function(){this.checked?document.querySelector("#disable-registration input").checked||(document.querySelector("#enable-openid-signup input").checked=!0):document.querySelector("#enable-openid-signup input").checked=!1}),document.querySelector("#disable-registration input").addEventListener("change",function(){this.checked?(document.querySelector("#enable-captcha input").checked=!1,document.querySelector("#enable-openid-signup input").checked=!1):document.querySelector("#enable-openid-signup input").checked=!0}),document.querySelector("#enable-captcha input").addEventListener("change",function(){this.checked&&(document.querySelector("#disable-registration input").checked=!1)})}function mb(){const e=document.querySelector("#goto-user-login");if(!e)return;const t=e.getAttribute("href");let i=setInterval(async()=>{try{const n=await(0,Ae.fG)(t);i&&n.status===200&&(clearInterval(i),i=null,window.location.href=t)}catch{}},1e3)}function pb(){if(!document.querySelectorAll(".new.webhook").length)return;for(const t of document.querySelectorAll(".events.checkbox input"))t.addEventListener("change",function(){this.checked&&(0,C.fi)(".events.fields")});for(const t of document.querySelectorAll(".non-events.checkbox input"))t.addEventListener("change",function(){this.checked&&(0,C.y9)(".events.fields")});const e=document.querySelector("#http_method");if(e){const t=function(){const i=e.value==="POST";(0,C.oi)(document.querySelector("#content_type").closest(".field"),i)};t(),e.addEventListener("change",t)}document.querySelector("#test-delivery")?.addEventListener("click",async function(){this.classList.add("is-loading","disabled"),await(0,Ae.LO)(this.getAttribute("data-link")),setTimeout(()=>{window.location.href=this.getAttribute("data-redirect")},5e3)})}function gb(){vb(),bb()}function vb(){for(const e of document.querySelectorAll(".show-create-branch-modal"))e.addEventListener("click",()=>{const t=e.getAttribute("data-modal-form")||"#create-branch-form",i=document.querySelector(t);if(!i)return;i.action=`${i.getAttribute("data-base-action")}${e.getAttribute("data-branch-from-urlcomponent")}`;const n=e.getAttribute("data-modal-from-span")||"#modal-create-branch-from-span";document.querySelector(n).textContent=e.getAttribute("data-branch-from"),(0,ke.mD)(e.getAttribute("data-modal")).modal("show")})}function bb(){for(const e of document.querySelectorAll(".show-rename-branch-modal"))e.addEventListener("click",()=>{const t=e.getAttribute("data-modal"),i=document.querySelector(t),n=e.getAttribute("data-old-branch-name");i.querySelector("input[name=from]").value=n;const s=i.querySelector(".default-branch-warning");(0,C.oi)(s,e.getAttribute("data-is-default-branch")==="true");const l=i.querySelector("[data-rename-branch-to]");l.textContent=l.getAttribute("data-rename-branch-to").replace("%s",n)})}function _b(e){return/.*[^/]\/[^/].*/.test(e)}function Lh(e){const t=document.querySelector(e);if(!t)return;const i=t.querySelector("#issue-label-edit-modal");if(!i)return;const n=i.querySelector('input[name="id"]'),s=i.querySelector(".label-name-input"),l=i.querySelector(".label-exclusive-input-field"),u=i.querySelector(".label-exclusive-input"),m=i.querySelector(".label-exclusive-warning"),y=i.querySelector(".label-exclusive-order-input-field"),A=i.querySelector(".label-exclusive-order-input"),L=i.querySelector(".label-is-archived-input-field"),z=i.querySelector(".label-is-archived-input"),X=i.querySelector(".label-desc-input"),_e=i.querySelector(".js-color-picker-input input"),pe=()=>{const Te=_b(s.value);l.classList.toggle("disabled",!Te);const He=Te&&u.checked&&i.hasAttribute("data-need-warn-exclusive");(0,C.oi)(m,He),Te||(u.checked=!1),(0,C.oi)(y,u.checked),parseInt(A.value)<=0?A.style.color="var(--color-placeholder-text) !important":A.style.color=null},de=Te=>{const He=i.querySelector("form");n.value=Te.getAttribute("data-label-id")||"",s.value=Te.getAttribute("data-label-name")||"",A.value=Te.getAttribute("data-label-exclusive-order")||"0",z.checked=Te.getAttribute("data-label-is-archived")==="true",u.checked=Te.getAttribute("data-label-exclusive")==="true",X.value=Te.getAttribute("data-label-description")||"",_e.value=Te.getAttribute("data-label-color")||"",_e.dispatchEvent(new Event("input",{bubbles:!0}));const U=!!n.value,Se=parseInt(Te.getAttribute("data-label-num-issues")||"0");i.toggleAttribute("data-need-warn-exclusive",!u.checked&&Se>0),i.querySelector(".header").textContent=U?i.getAttribute("data-text-edit-label"):i.getAttribute("data-text-new-label");const ze=i.getAttribute("data-current-page-link");He.action=U?`${ze}/edit`:`${ze}/new`,(0,C.oi)(L,U),pe(),(0,ke.mD)(i).modal({onApprove(){if(!He.checkValidity())return He.reportValidity(),!1;He.submit()}}).modal("show")};i.addEventListener("input",()=>pe());const Pe=t.querySelector(".ui.button.new-label");Pe?.addEventListener("click",()=>de(Pe));const Le=t.querySelectorAll(".edit-label-button");for(const Te of Le)Te.addEventListener("click",He=>{He.preventDefault(),de(Te)})}function yb(){document.querySelectorAll(".organization").length&&(document.querySelector(".organization.settings.options #org_name")?.addEventListener("input",function(){const e=this.value.toLowerCase()!==this.getAttribute("data-org-name").toLowerCase();(0,C.oi)("#org-name-change-prompt",e)}),Lh(".page-content.organization.settings.labels"))}var wb=__webpack_require__("./node_modules/jquery/dist/jquery.js"),Mn=__webpack_require__.n(wb);function Sb(){for(const e of document.querySelectorAll(".ui.checkbox")){if(e.hasAttribute("data-checkbox-patched"))continue;const t=e.querySelector("label"),i=e.querySelector("input");!t||!i||((0,ke.iZ)(t,i),e.setAttribute("data-checkbox-patched","true"))}}function xb(){for(const e of document.querySelectorAll(".ui.form .field")){if(e.hasAttribute("data-field-patched"))continue;const t=e.querySelector(":scope > label"),i=e.querySelector(":scope > input");!t||!i||((0,ke.iZ)(t,i),e.setAttribute("data-field-patched","true"))}}const Ar="_giteaAriaPatchDropdown",td=Mn().fn.dropdown;function jb(){if(Mn().fn.dropdown===id)throw new Error("initAriaDropdownPatch could only be called once");Mn().fn.dropdown.settings.onAfterFiltered=Eb,Mn().fn.dropdown=id,Mn().fn.fomanticExt.onResponseKeepSelectedItem=Rb,id.settings=td.settings}function id(...e){const t=td.apply(this,e);for(let i of this){i=i.closest(".ui.dropdown"),i[Ar]||kb(i);const n=Mn()(i),s=n.data("module-dropdown");s.giteaDelegated||(s.giteaDelegated=!0,Ab(n))}return t}function Rh(e,t){t.id||(t.id=(0,ke.Ae)()),t.setAttribute("role",e[Ar].listItemRole),t.setAttribute("tabindex","-1");for(const i of t.querySelectorAll("a, input, button"))i.setAttribute("tabindex","-1")}function Mh(e){e.id||(e.id=(0,ke.Ae)()),e.tabIndex=-1;const t=e.querySelector(".delete.icon");t&&(t.setAttribute("aria-hidden","false"),t.setAttribute("aria-label",window.config.i18n.remove_label_str.replace("%s",e.getAttribute("data-value"))),t.setAttribute("role","button"))}function Eb(){const e=Mn()(this).closest(".ui.dropdown"),t=e.dropdown("setting","hideDividers")==="empty",i=e[0].querySelector(".scrolling.menu")||e[0].querySelector(".menu");t&&i&&Lb(i)}function Ab(e){const t=td.bind(e),i={...t("setting","templates"),t:performance.now()},n=i.menu;i.menu=function(m,y,A,L){const z=n(m,y,A,L),X=document.createElement("div");X.innerHTML=z;const _e=Mn()(X);return _e.find("> .item").each((de,Pe)=>Rh(e[0],Pe)),e[0][Ar].deferredRefreshAriaActiveItem(),_e.html()},t("setting","templates",i);const s=t("setting","onLabelCreate");t("setting","onLabelCreate",function(m,y){const A=s.call(this,m,y);return Mh(A[0]),A});const l=t("internal","set"),u=l.direction;l.direction=function(m){u.call(this,m);const y=t("setting","className");m=m||e.find("> .menu");const A=m[0];A.classList.add(y.loading),A.getBoundingClientRect().right>document.documentElement.clientWidth&&A.classList.add(y.leftward),A.classList.remove(y.loading)}}function Cb(e,t,i){i.id||(i.id=(0,ke.Ae)()),Mn()(i).find("> .item").each((s,l)=>Rh(e,l)),i.setAttribute("role",e[Ar].listPopupRole);for(const s of e.querySelectorAll(".ui.label"))Mh(s);t.setAttribute("role",t.getAttribute("role")??e[Ar].focusableRole),t.setAttribute("aria-haspopup",e[Ar].listPopupRole),t.setAttribute("aria-controls",i.id),t.setAttribute("aria-expanded","false");const n=e.getAttribute("data-tooltip-content");n&&!e.getAttribute("aria-label")&&e.setAttribute("aria-label",n)}function kb(e){e[Ar]={};const t=e.querySelector("input.search"),i=t||e;if(!i)return;t&&!t.getAttribute("autocomplete")&&t.setAttribute("autocomplete","off");let n=Mn()(e).find("> .menu")[0];n||(n=document.createElement("div"),n.classList.add("menu"),e.append(n));const s=e.querySelectorAll("input").length>0;e[Ar].focusableRole=s?"combobox":"menu",e[Ar].listPopupRole=s?"listbox":"",e[Ar].listItemRole=s?"option":"menuitem",Tb(e,i,n),Cb(e,i,n)}function Tb(e,t,i){const n=()=>i.classList.contains("visible")&&!i.classList.contains("out")||i.classList.contains("in"),s=()=>{const y=n();t.setAttribute("aria-expanded",y?"true":"false");const A=Mn()(i).find("> .item.active, > .item.selected")[0];A&&(y?t.setAttribute("aria-activedescendant",A.id):e[Ar].listPopupRole==="menu"&&(t.removeAttribute("aria-activedescendant"),A.classList.remove("active","selected")))};e.addEventListener("keydown",y=>{if(y.key==="Enter"){const A=i.querySelector(":scope > .item.selected, .menu > .item.selected");A?.matches("a, .js-aria-clickable")&&!A.matches(".tw-hidden, .filtered")&&(y.preventDefault(),A.click())}});const l=(y=0)=>{setTimeout(s,y)};e[Ar].deferredRefreshAriaActiveItem=l,e.addEventListener("keyup",y=>{y.key.startsWith("Arrow")&&l()});let u=0,m=0;e.addEventListener("mousedown",()=>{m+=n()?1:0,u++},!0),e.addEventListener("focus",()=>{m+=n()?1:0,u++,l()},!0),e.addEventListener("blur",()=>{m=u=0,l(100)},!0),e.addEventListener("mouseup",()=>{setTimeout(()=>{m=u=0,l(100)},0)},!0),e.addEventListener("click",y=>{n()&&m!==2&&u===2&&y.stopPropagation(),u=m=0},!0)}function Lb(e){const t=[],i=[];let n="",s="";const l=z=>z.classList.contains("divider"),u=z=>l(z)&&z.hasAttribute("data-scope"),m=z=>z.classList.add("hidden","transition"),y=z=>z.classList.remove("hidden","transition"),A=z=>z.classList.contains("hidden")||z.classList.contains("filtered")||z.classList.contains("tw-hidden"),L=z=>{i.length===1&&u(i[0])?m(i[0]):i.length&&(u(i[0])&&s===n&&(m(i[0]),i.shift()),t.push(...i),s=n),n=z,i.length=0};(0,C.jB)(e,".divider",y);for(const z of e.children){const X=z.getAttribute("data-scope")||"";X!==n&&L(X),A(z)||i.push(z)}for(L("");t.length&&l(t[0]);)m(t[0]),t.shift();for(;t.length&&l(t[t.length-1]);)m(t[t.length-1]),t.pop();for(let z=0;z<t.length-1;z++)t[z].matches(".divider")&&t[z+1].matches(".divider")&&m(t[z])}function Rb(e,t){const i=e instanceof HTMLElement?e:e[0];setTimeout(()=>{(0,C.jB)(i,`.menu .item[data-value="${CSS.escape(t)}"].filtered`,n=>n.classList.remove("filtered")),Mn()(i).dropdown("set selected",t??"")},10)}const Dh=Mn().fn.modal;function Mb(){if(Mn().fn.modal===nd)throw new Error("initAriaModalPatch could only be called once");Mn().fn.modal=nd,nd.settings=Dh.settings}function nd(...e){const t=Dh.apply(this,e);if(e[0]==="show"||e[0]?.autoShow)for(const i of this)for(const n of i.querySelectorAll("form button.cancel:not([type])"))n.setAttribute("type","button");return t}function Db(){const e=new Set(["clear queue","stop","stop all","destroy","force repaint","repaint","reset","looping","remove looping","disable","enable","set duration","save conditions","restore conditions"]);Mn().fn.transition=function(t,i,n){if(t==="is supported")return!0;if(t==="is animating"||t==="is inward"||t==="is outward")return!1;let s;if(typeof t=="string"){if(e.has(t))return this;s={animation:t,...i&&{duration:i},...n&&{onComplete:n}}}else if(typeof t=="object")s=t;else throw new Error(`invalid argument: ${t}`);const l=s.animation?.startsWith("show")||s.animation?.endsWith(" in"),u=s.animation?.startsWith("hide")||s.animation?.endsWith(" out");return this.each((m,y)=>{let A=l;!l&&!u&&(A=this.hasClass("hidden")),s.onStart?.call(y),A?(y.classList.remove("hidden"),y.classList.add("visible","transition"),s.displayType&&y.style.setProperty("display",s.displayType,"important"),s.onShow?.call(y)):(y.classList.add("hidden"),y.classList.remove("visible"),y.style.removeProperty("display"),s.onHidden?.call(y)),s.onComplete?.call(y)}),this}}function Ob(){Mn().fn.dimmer=function(e,t){if(e==="add content"){const i=t,n=document.querySelector("body > .ui.dimmer");n?((0,C.xP)(n,"*",s=>s.classList.add("hidden")),this._dimmer=n):(this._dimmer=document.createElement("div"),this._dimmer.classList.add("ui","dimmer"),document.body.append(this._dimmer)),this._dimmer.append(i[0])}else{if(e==="get dimmer")return Mn()(this._dimmer);if(e==="show")this._dimmer.classList.add("active"),document.body.classList.add("tw-overflow-hidden");else if(e==="hide"){const i=t;this._dimmer.classList.remove("active"),document.body.classList.remove("tw-overflow-hidden"),i()}}return this}}function qb(){Mn().fn.tab=function(){for(const e of this){const t=e.getAttribute("data-tab");t&&e.addEventListener("click",()=>{const i=document.querySelector(`.ui.tab[data-tab="${t}"]`);(0,C.D6)(i,".ui.tab",n=>n.classList.remove("active")),(0,C.D6)(e,"[data-tab]",n=>n.classList.remove("active")),e.classList.add("active"),i.classList.add("active")})}return this}}const Oh=window.matchMedia("only screen and (max-width: 767.98px)");function Pb(){Mn().fn.fomanticExt={},Mn().fn.dropdown.settings.fullTextSearch="exact",Mn().fn.dropdown.settings.className.label+=" tw-cursor-default",Mn().fn.dropdown.settings.templates.label=function(e,t,i,n){const s=Mn().fn.dropdown.settings.templates.escape;return s(t,i)+(0,Z.JW)("octicon-x",16,`${n.delete} icon`)},Db(),Ob(),qb(),Sb(),xb(),jb(),Mb()}async function Fb(){const e=document.querySelector(".repository.wiki .combo-markdown-editor textarea");if(!e)return;const t=document.querySelector(".repository.wiki.new .ui.form"),i=t.querySelector(".combo-markdown-editor");let n,s=!1,l="";const u=async function(){if(s)return;const m=i.querySelector(".EasyMDEContainer .editor-preview-active"),A=i.querySelector(".EasyMDEContainer .editor-preview-active-side")||m,L=e.value;if(n&&A&&l!==L){s=!0;const z=new FormData;z.append("mode",n.previewMode),z.append("context",n.previewContext),z.append("text",L);try{const _e=await(await(0,Ae.LO)(n.previewUrl,{data:z})).text();l=L,A.innerHTML=`<div class="render-content markup ui segment">${_e}</div>`}catch(X){console.error("Error rendering preview:",X)}finally{s=!1,setTimeout(u,1e3)}}else setTimeout(u,1e3)};u(),n=await ma(i,{editorHeights:{minHeight:"300px",height:"calc(100vh - 600px)"},easyMDEOptions:{previewRender:(m,y)=>y.innerHTML,toolbar:["bold","italic","strikethrough","|","heading-1","heading-2","heading-3","heading-bigger","heading-smaller","|","gitea-code-inline","code","quote","|","gitea-checkbox-empty","gitea-checkbox-checked","|","unordered-list","ordered-list","|","link","image","table","horizontal-rule","|","preview","fullscreen","side-by-side","|","gitea-switch-to-textarea"]}}),t.addEventListener("submit",m=>{hh(e)||(m.preventDefault(),m.stopPropagation())})}function qh(e){e&&document.querySelector(".wiki-content-toc details")?.removeAttribute("open")}function Ib(){document.querySelector(".page-content.repository.wiki")&&(Oh.addEventListener("change",e=>qh(e.matches)),qh(Oh.matches),Fb())}function Nb(){(0,C.ny)(document,"click",".escape-button, .unescape-button, .toggle-escape-button",(e,t)=>{t.preventDefault();const i=e.getAttribute("data-unicode-content-selector"),n=i?document.querySelector(i):e.closest(".file-content, .non-diff-file-content"),s=n.querySelector(".file-code, .file-view")??n;if(e.matches(".escape-button"))s.classList.add("unicode-escaped"),(0,C.y9)(e),(0,C.fi)((0,C.D6)(e,".unescape-button"));else if(e.matches(".unescape-button"))s.classList.remove("unicode-escaped"),(0,C.y9)(e),(0,C.fi)((0,C.D6)(e,".escape-button"));else if(e.matches(".toggle-escape-button")){const l=s.classList.contains("unicode-escaped");s.classList.toggle("unicode-escaped",!l),(0,C.oi)(n.querySelectorAll(".unescape-button"),!l),(0,C.oi)(n.querySelectorAll(".escape-button"),l)}})}const{pageData:Ph}=window.config;async function Hb(e,t){const[{Cite:i,plugins:n}]=await Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl").then(__webpack_require__.bind(__webpack_require__,"./node_modules/@citation-js/core/lib-mjs/index.js")),Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl"),__webpack_require__.e("citation-js-formats")]).then(__webpack_require__.t.bind(__webpack_require__,"./node_modules/@citation-js/plugin-software-formats/lib/index.js",23)),Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl"),__webpack_require__.e("citation-js-bibtex")]).then(__webpack_require__.bind(__webpack_require__,"./node_modules/@citation-js/plugin-bibtex/lib-mjs/index.js")),Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl"),__webpack_require__.e("citation-js-csl")]).then(__webpack_require__.bind(__webpack_require__,"./node_modules/@citation-js/plugin-csl/lib-mjs/index.js"))]),{citationFileContent:s}=Ph,l=n.config.get("@bibtex");l.constants.fieldTypes.doi=["field","literal"],l.constants.fieldTypes.version=["field","literal"];const u=new i(s),m=(0,St.kk)()||"en-US",y=u.format("bibliography",{template:"apa",lang:m}),A=u.format("bibtex",{lang:m});t.setAttribute("data-text",A),e.setAttribute("data-text",y)}async function Bb(){const e="apa";if(!Ph.citationFileContent)return;const t=document.querySelector("#citation-copy-apa"),i=document.querySelector("#citation-copy-bibtex"),n=document.querySelector("#citation-copy-content");if(!t&&!i||!n)return;const s=()=>{const l=(localStorage.getItem("citation-copy-format")||e)==="bibtex",u=(l?i:t).getAttribute("data-text");n.value=u,i.classList.toggle("primary",l),t.classList.toggle("primary",!l)};document.querySelector("#cite-repo-button")?.addEventListener("click",async()=>{try{await Hb(t,i)}catch(l){console.error(`initCitationFileCopyContent error: ${l}`,l);return}s(),t.addEventListener("click",()=>{localStorage.setItem("citation-copy-format","apa"),s()}),i.addEventListener("click",()=>{localStorage.setItem("citation-copy-format","bibtex"),s()}),n.addEventListener("click",()=>{n.select()}),(0,ke.mD)("#cite-repo-modal").modal("show")})}function $b(){_c("click","onCommentReactionButtonClick",async(e,t)=>{if(t.preventDefault(),e.classList.contains("disabled"))return;const i=e.closest("[data-action-url]").getAttribute("data-action-url"),n=e.getAttribute("data-reaction-content"),s=e.closest(".comment-container"),l=s.querySelector(".bottom-reactions"),m=l?.querySelector(`a[data-reaction-content="${CSS.escape(n)}"]`)?.getAttribute("data-has-reacted")==="true",A=await(await(0,Ae.LO)(`${i}/${m?"unreact":"react"}`,{data:new URLSearchParams({content:n})})).json();l?.remove(),A.html&&s.insertAdjacentHTML("beforeend",A.html)})}var Ub=__webpack_require__("./node_modules/brace-expansion/index.js");const Vb=1024*64,Tc=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>Vb)throw new TypeError("pattern is too long")},Wb={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Tl=e=>e.replace(/[[\]\\-]/g,"\\$&"),zb=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Fh=e=>e.join(""),Kb=(e,t)=>{const i=t;if(e.charAt(i)!=="[")throw new Error("not in a brace expression");const n=[],s=[];let l=i+1,u=!1,m=!1,y=!1,A=!1,L=i,z="";e:for(;l<e.length;){const de=e.charAt(l);if((de==="!"||de==="^")&&l===i+1){A=!0,l++;continue}if(de==="]"&&u&&!y){L=l+1;break}if(u=!0,de==="\\"&&!y){y=!0,l++;continue}if(de==="["&&!y){for(const[Pe,[Le,Te,He]]of Object.entries(Wb))if(e.startsWith(Pe,l)){if(z)return["$.",!1,e.length-i,!0];l+=Pe.length,He?s.push(Le):n.push(Le),m=m||Te;continue e}}if(y=!1,z){de>z?n.push(Tl(z)+"-"+Tl(de)):de===z&&n.push(Tl(de)),z="",l++;continue}if(e.startsWith("-]",l+1)){n.push(Tl(de+"-")),l+=2;continue}if(e.startsWith("-",l+1)){z=de,l+=2;continue}n.push(Tl(de)),l++}if(L<l)return["",!1,0,!1];if(!n.length&&!s.length)return["$.",!1,e.length-i,!0];if(s.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!A){const de=n[0].length===2?n[0].slice(-1):n[0];return[zb(de),!1,L-i,!1]}const X="["+(A?"^":"")+Fh(n)+"]",_e="["+(A?"":"^")+Fh(s)+"]";return[n.length&&s.length?"("+X+"|"+_e+")":n.length?X:_e,m,L-i,!0]},Ll=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),Xb=new Set(["!","?","+","*","@"]),Ih=e=>Xb.has(e),Gb="(?!(?:^|/)\\.\\.?(?:$|/))",Lc="(?!\\.)",Qb=new Set(["[","."]),Yb=new Set(["..","."]),Jb=new Set("().*{}+?[]^$\\!"),Zb=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),sd="[^/]",Nh=sd+"*?",Hh=sd+"+?",Ks=class Ks{constructor(t,i,n={}){wn(this,ba);rs(this,"type");wn(this,is);wn(this,bs);wn(this,lo,!1);wn(this,Dn,[]);wn(this,Gn);wn(this,Do);wn(this,ga);wn(this,Oo,!1);wn(this,Gr);wn(this,va);wn(this,Pl,!1);this.type=t,t&&tn(this,bs,!0),tn(this,Gn,i),tn(this,is,pt(this,Gn)?pt(pt(this,Gn),is):this),tn(this,Gr,pt(this,is)===this?n:pt(pt(this,is),Gr)),tn(this,ga,pt(this,is)===this?[]:pt(pt(this,is),ga)),t==="!"&&!pt(pt(this,is),Oo)&&pt(this,ga).push(this),tn(this,Do,pt(this,Gn)?pt(pt(this,Gn),Dn).length:0)}get hasMagic(){if(pt(this,bs)!==void 0)return pt(this,bs);for(const t of pt(this,Dn))if(typeof t!="string"&&(t.type||t.hasMagic))return tn(this,bs,!0);return pt(this,bs)}toString(){return pt(this,va)!==void 0?pt(this,va):this.type?tn(this,va,this.type+"("+pt(this,Dn).map(t=>String(t)).join("|")+")"):tn(this,va,pt(this,Dn).map(t=>String(t)).join(""))}push(...t){for(const i of t)if(i!==""){if(typeof i!="string"&&!(i instanceof Ks&&pt(i,Gn)===this))throw new Error("invalid part: "+i);pt(this,Dn).push(i)}}toJSON(){const t=this.type===null?pt(this,Dn).slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...pt(this,Dn).map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===pt(this,is)||pt(pt(this,is),Oo)&&pt(this,Gn)?.type==="!")&&t.push({}),t}isStart(){if(pt(this,is)===this)return!0;if(!pt(this,Gn)?.isStart())return!1;if(pt(this,Do)===0)return!0;const t=pt(this,Gn);for(let i=0;i<pt(this,Do);i++){const n=pt(t,Dn)[i];if(!(n instanceof Ks&&n.type==="!"))return!1}return!0}isEnd(){if(pt(this,is)===this||pt(this,Gn)?.type==="!")return!0;if(!pt(this,Gn)?.isEnd())return!1;if(!this.type)return pt(this,Gn)?.isEnd();const t=pt(this,Gn)?pt(pt(this,Gn),Dn).length:0;return pt(this,Do)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const i=new Ks(this.type,t);for(const n of pt(this,Dn))i.copyIn(n);return i}static fromGlob(t,i={}){var s;const n=new Ks(null,void 0,i);return dn(s=Ks,qo,Gc).call(s,t,n,0,i),n}toMMPattern(){if(this!==pt(this,is))return pt(this,is).toMMPattern();const t=this.toString(),[i,n,s,l]=this.toRegExpSource();if(!(s||pt(this,bs)||pt(this,Gr).nocase&&!pt(this,Gr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const m=(pt(this,Gr).nocase?"i":"")+(l?"u":"");return Object.assign(new RegExp(`^${i}$`,m),{_src:i,_glob:t})}get options(){return pt(this,Gr)}toRegExpSource(t){const i=t??!!pt(this,Gr).dot;if(pt(this,is)===this&&dn(this,ba,sm).call(this),!this.type){const y=this.isStart()&&this.isEnd(),A=pt(this,Dn).map(_e=>{var Te;const[pe,de,Pe,Le]=typeof _e=="string"?dn(Te=Ks,qo,rm).call(Te,_e,pt(this,bs),y):_e.toRegExpSource(t);return tn(this,bs,pt(this,bs)||Pe),tn(this,lo,pt(this,lo)||Le),pe}).join("");let L="";if(this.isStart()&&typeof pt(this,Dn)[0]=="string"&&!(pt(this,Dn).length===1&&Yb.has(pt(this,Dn)[0]))){const pe=Qb,de=i&&pe.has(A.charAt(0))||A.startsWith("\\.")&&pe.has(A.charAt(2))||A.startsWith("\\.\\.")&&pe.has(A.charAt(4)),Pe=!i&&!t&&pe.has(A.charAt(0));L=de?Gb:Pe?Lc:""}let z="";return this.isEnd()&&pt(pt(this,is),Oo)&&pt(this,Gn)?.type==="!"&&(z="(?:$|\\/)"),[L+A+z,Ll(A),tn(this,bs,!!pt(this,bs)),pt(this,lo)]}const n=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:";let l=dn(this,ba,pd).call(this,i);if(this.isStart()&&this.isEnd()&&!l&&this.type!=="!"){const y=this.toString();return tn(this,Dn,[y]),this.type=null,tn(this,bs,void 0),[y,Ll(this.toString()),!1,!1]}let u=!n||t||i||!Lc?"":dn(this,ba,pd).call(this,!0);u===l&&(u=""),u&&(l=`(?:${l})(?:${u})*?`);let m="";if(this.type==="!"&&pt(this,Pl))m=(this.isStart()&&!i?Lc:"")+Hh;else{const y=this.type==="!"?"))"+(this.isStart()&&!i&&!t?Lc:"")+Nh+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&u?")":this.type==="*"&&u?")?":`)${this.type}`;m=s+l+y}return[m,Ll(l),tn(this,bs,!!pt(this,bs)),pt(this,lo)]}};is=new WeakMap,bs=new WeakMap,lo=new WeakMap,Dn=new WeakMap,Gn=new WeakMap,Do=new WeakMap,ga=new WeakMap,Oo=new WeakMap,Gr=new WeakMap,va=new WeakMap,Pl=new WeakMap,ba=new WeakSet,sm=function(){if(this!==pt(this,is))throw new Error("should only call on root");if(pt(this,Oo))return this;this.toString(),tn(this,Oo,!0);let t;for(;t=pt(this,ga).pop();){if(t.type!=="!")continue;let i=t,n=pt(i,Gn);for(;n;){for(let s=pt(i,Do)+1;!n.type&&s<pt(n,Dn).length;s++)for(const l of pt(t,Dn)){if(typeof l=="string")throw new Error("string part in extglob AST??");l.copyIn(pt(n,Dn)[s])}i=n,n=pt(i,Gn)}}return this},qo=new WeakSet,Gc=function(t,i,n,s){var _e,pe;let l=!1,u=!1,m=-1,y=!1;if(i.type===null){let de=n,Pe="";for(;de<t.length;){const Le=t.charAt(de++);if(l||Le==="\\"){l=!l,Pe+=Le;continue}if(u){de===m+1?(Le==="^"||Le==="!")&&(y=!0):Le==="]"&&!(de===m+2&&y)&&(u=!1),Pe+=Le;continue}else if(Le==="["){u=!0,m=de,y=!1,Pe+=Le;continue}if(!s.noext&&Ih(Le)&&t.charAt(de)==="("){i.push(Pe),Pe="";const Te=new Ks(Le,i);de=dn(_e=Ks,qo,Gc).call(_e,t,Te,de,s),i.push(Te);continue}Pe+=Le}return i.push(Pe),de}let A=n+1,L=new Ks(null,i);const z=[];let X="";for(;A<t.length;){const de=t.charAt(A++);if(l||de==="\\"){l=!l,X+=de;continue}if(u){A===m+1?(de==="^"||de==="!")&&(y=!0):de==="]"&&!(A===m+2&&y)&&(u=!1),X+=de;continue}else if(de==="["){u=!0,m=A,y=!1,X+=de;continue}if(Ih(de)&&t.charAt(A)==="("){L.push(X),X="";const Pe=new Ks(de,L);L.push(Pe),A=dn(pe=Ks,qo,Gc).call(pe,t,Pe,A,s);continue}if(de==="|"){L.push(X),X="",z.push(L),L=new Ks(null,i);continue}if(de===")")return X===""&&pt(i,Dn).length===0&&tn(i,Pl,!0),L.push(X),X="",i.push(...z,L),A;X+=de}return i.type=null,tn(i,bs,void 0),tn(i,Dn,[t.substring(n-1)]),A},pd=function(t){return pt(this,Dn).map(i=>{if(typeof i=="string")throw new Error("string type in extglob ast??");const[n,s,l,u]=i.toRegExpSource(t);return tn(this,lo,pt(this,lo)||u),n}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")},rm=function(t,i,n=!1){let s=!1,l="",u=!1;for(let m=0;m<t.length;m++){const y=t.charAt(m);if(s){s=!1,l+=(Jb.has(y)?"\\":"")+y;continue}if(y==="\\"){m===t.length-1?l+="\\\\":s=!0;continue}if(y==="["){const[A,L,z,X]=Kb(t,m);if(z){l+=A,u=u||L,m+=z-1,i=i||X;continue}}if(y==="*"){n&&t==="*"?l+=Hh:l+=Nh,i=!0;continue}if(y==="?"){l+=sd,i=!0;continue}l+=Zb(y)}return[l,Ll(t),!!i,u]},wn(Ks,qo);let Rc=Ks;const e_=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),Os=(e,t,i={})=>(Tc(t),!i.nocomment&&t.charAt(0)==="#"?!1:new Mc(t,i).match(e)),t_=/^\*+([^+@!?\*\[\(]*)$/,i_=e=>t=>!t.startsWith(".")&&t.endsWith(e),n_=e=>t=>t.endsWith(e),s_=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),r_=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),o_=/^\*+\.\*+$/,a_=e=>!e.startsWith(".")&&e.includes("."),l_=e=>e!=="."&&e!==".."&&e.includes("."),c_=/^\.\*+$/,u_=e=>e!=="."&&e!==".."&&e.startsWith("."),d_=/^\*+$/,f_=e=>e.length!==0&&!e.startsWith("."),h_=e=>e.length!==0&&e!=="."&&e!=="..",m_=/^\?+([^+@!?\*\[\(]*)?$/,p_=([e,t=""])=>{const i=Bh([e]);return t?(t=t.toLowerCase(),n=>i(n)&&n.toLowerCase().endsWith(t)):i},g_=([e,t=""])=>{const i=$h([e]);return t?(t=t.toLowerCase(),n=>i(n)&&n.toLowerCase().endsWith(t)):i},v_=([e,t=""])=>{const i=$h([e]);return t?n=>i(n)&&n.endsWith(t):i},b_=([e,t=""])=>{const i=Bh([e]);return t?n=>i(n)&&n.endsWith(t):i},Bh=([e])=>{const t=e.length;return i=>i.length===t&&!i.startsWith(".")},$h=([e])=>{const t=e.length;return i=>i.length===t&&i!=="."&&i!==".."},Uh=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Vh={win32:{sep:"\\"},posix:{sep:"/"}},__=Uh==="win32"?Vh.win32.sep:Vh.posix.sep;Os.sep=__;const Cr=Symbol("globstar **");Os.GLOBSTAR=Cr;const y_="[^/]"+"*?",w_="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",S_="(?:(?!(?:\\/|^)\\.).)*?",x_=(e,t={})=>i=>Os(i,e,t);Os.filter=x_;const kr=(e,t={})=>Object.assign({},e,t),j_=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Os;const t=Os;return Object.assign((n,s,l={})=>t(n,s,kr(e,l)),{Minimatch:class extends t.Minimatch{constructor(s,l={}){super(s,kr(e,l))}static defaults(s){return t.defaults(kr(e,s)).Minimatch}},AST:class extends t.AST{constructor(s,l,u={}){super(s,l,kr(e,u))}static fromGlob(s,l={}){return t.AST.fromGlob(s,kr(e,l))}},unescape:(n,s={})=>t.unescape(n,kr(e,s)),escape:(n,s={})=>t.escape(n,kr(e,s)),filter:(n,s={})=>t.filter(n,kr(e,s)),defaults:n=>t.defaults(kr(e,n)),makeRe:(n,s={})=>t.makeRe(n,kr(e,s)),braceExpand:(n,s={})=>t.braceExpand(n,kr(e,s)),match:(n,s,l={})=>t.match(n,s,kr(e,l)),sep:t.sep,GLOBSTAR:Cr})};Os.defaults=j_;const Wh=(e,t={})=>(Tc(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ub(e));Os.braceExpand=Wh;const E_=(e,t={})=>new Mc(e,t).makeRe();Os.makeRe=E_;const A_=(e,t,i={})=>{const n=new Mc(t,i);return e=e.filter(s=>n.match(s)),n.options.nonull&&!e.length&&e.push(t),e};Os.match=A_;const zh=/[?*]|[+@!]\(.*?\)|\[|\]/,C_=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Mc{constructor(t,i={}){rs(this,"options");rs(this,"set");rs(this,"pattern");rs(this,"windowsPathsNoEscape");rs(this,"nonegate");rs(this,"negate");rs(this,"comment");rs(this,"empty");rs(this,"preserveMultipleSlashes");rs(this,"partial");rs(this,"globSet");rs(this,"globParts");rs(this,"nocase");rs(this,"isWindows");rs(this,"platform");rs(this,"windowsNoMagicRoot");rs(this,"regexp");Tc(t),i=i||{},this.options=i,this.pattern=t,this.platform=i.platform||Uh,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!i.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!i.nonegate,this.comment=!1,this.empty=!1,this.partial=!!i.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=i.windowsNoMagicRoot!==void 0?i.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const i of t)if(typeof i!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,i=this.options;if(!i.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],i.debug&&(this.debug=(...l)=>console.error(...l)),this.debug(this.pattern,this.globSet);const n=this.globSet.map(l=>this.slashSplit(l));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let s=this.globParts.map((l,u,m)=>{if(this.isWindows&&this.windowsNoMagicRoot){const y=l[0]===""&&l[1]===""&&(l[2]==="?"||!zh.test(l[2]))&&!zh.test(l[3]),A=/^[a-z]:/i.test(l[0]);if(y)return[...l.slice(0,4),...l.slice(4).map(L=>this.parse(L))];if(A)return[l[0],...l.slice(1).map(L=>this.parse(L))]}return l.map(y=>this.parse(y))});if(this.debug(this.pattern,s),this.set=s.filter(l=>l.indexOf(!1)===-1),this.isWindows)for(let l=0;l<this.set.length;l++){const u=this.set[l];u[0]===""&&u[1]===""&&this.globParts[l][2]==="?"&&typeof u[3]=="string"&&/^[a-z]:$/i.test(u[3])&&(u[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let s=0;s<t[n].length;s++)t[n][s]==="**"&&(t[n][s]="*");const{optimizationLevel:i=1}=this.options;return i>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):i>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(i=>{let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let s=n;for(;i[s+1]==="**";)s++;s!==n&&i.splice(n,s-n)}return i})}levelOneOptimize(t){return t.map(i=>(i=i.reduce((n,s)=>{const l=n[n.length-1];return s==="**"&&l==="**"?n:s===".."&&l&&l!==".."&&l!=="."&&l!=="**"?(n.pop(),n):(n.push(s),n)},[]),i.length===0?[""]:i))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let i=!1;do{if(i=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const l=t[s];s===1&&l===""&&t[0]===""||(l==="."||l==="")&&(i=!0,t.splice(s,1),s--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(i=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){const s=t[n-1];s&&s!=="."&&s!==".."&&s!=="**"&&(i=!0,t.splice(n-1,2),n-=2)}}while(i);return t.length===0?[""]:t}firstPhasePreProcess(t){let i=!1;do{i=!1;for(let n of t){let s=-1;for(;(s=n.indexOf("**",s+1))!==-1;){let u=s;for(;n[u+1]==="**";)u++;u>s&&n.splice(s+1,u-s);let m=n[s+1];const y=n[s+2],A=n[s+3];if(m!==".."||!y||y==="."||y===".."||!A||A==="."||A==="..")continue;i=!0,n.splice(s,1);const L=n.slice(0);L[s]="**",t.push(L),s--}if(!this.preserveMultipleSlashes){for(let u=1;u<n.length-1;u++){const m=n[u];u===1&&m===""&&n[0]===""||(m==="."||m==="")&&(i=!0,n.splice(u,1),u--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(i=!0,n.pop())}let l=0;for(;(l=n.indexOf("..",l+1))!==-1;){const u=n[l-1];if(u&&u!=="."&&u!==".."&&u!=="**"){i=!0;const y=l===1&&n[l+1]==="**"?["."]:[];n.splice(l-1,2,...y),n.length===0&&n.push(""),l-=2}}}}while(i);return t}secondPhasePreProcess(t){for(let i=0;i<t.length-1;i++)for(let n=i+1;n<t.length;n++){const s=this.partsMatch(t[i],t[n],!this.preserveMultipleSlashes);if(s){t[i]=[],t[n]=s;break}}return t.filter(i=>i.length)}partsMatch(t,i,n=!1){let s=0,l=0,u=[],m="";for(;s<t.length&&l<i.length;)if(t[s]===i[l])u.push(m==="b"?i[l]:t[s]),s++,l++;else if(n&&t[s]==="**"&&i[l]===t[s+1])u.push(t[s]),s++;else if(n&&i[l]==="**"&&t[s]===i[l+1])u.push(i[l]),l++;else if(t[s]==="*"&&i[l]&&(this.options.dot||!i[l].startsWith("."))&&i[l]!=="**"){if(m==="b")return!1;m="a",u.push(t[s]),s++,l++}else if(i[l]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(m==="a")return!1;m="b",u.push(i[l]),s++,l++}else return!1;return t.length===i.length&&u}parseNegate(){if(this.nonegate)return;const t=this.pattern;let i=!1,n=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)i=!i,n++;n&&(this.pattern=t.slice(n)),this.negate=i}matchOne(t,i,n=!1){const s=this.options;if(this.isWindows){const de=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),Pe=!de&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),Le=typeof i[0]=="string"&&/^[a-z]:$/i.test(i[0]),Te=!Le&&i[0]===""&&i[1]===""&&i[2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3]),He=Pe?3:de?0:void 0,U=Te?3:Le?0:void 0;if(typeof He=="number"&&typeof U=="number"){const[Se,ze]=[t[He],i[U]];Se.toLowerCase()===ze.toLowerCase()&&(i[U]=Se,U>He?i=i.slice(U):He>U&&(t=t.slice(He)))}}const{optimizationLevel:l=1}=this.options;l>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:i}),this.debug("matchOne",t.length,i.length);for(var u=0,m=0,y=t.length,A=i.length;u<y&&m<A;u++,m++){this.debug("matchOne loop");var L=i[m],z=t[u];if(this.debug(i,L,z),L===!1)return!1;if(L===Cr){this.debug("GLOBSTAR",[i,L,z]);var X=u,_e=m+1;if(_e===A){for(this.debug("** at the end");u<y;u++)if(t[u]==="."||t[u]===".."||!s.dot&&t[u].charAt(0)===".")return!1;return!0}for(;X<y;){var pe=t[X];if(this.debug(`
./output/git.buildapp.eu.org_run/git.buildapp.eu.org_1_initial_page.html:276:</div>`);t.addEventListener("click",async i=>{i.preventDefault();const n=await Ii(Xf(e));Dt(i.target,n?Kf.copy_success:Kf.copy_error)}),e.previewTemplate.append(t)}async function Qf(e){const t=e.closest("[data-attachment-url]")?.getAttribute("data-attachment-url"),i=e.getAttribute("data-remove-url"),n=e.getAttribute("data-link-url");let s=!1,l={};const u={url:e.getAttribute("data-upload-url"),headers:{"X-Csrf-Token":Ng},acceptedFiles:["*/*",""].includes(e.getAttribute("data-accepts"))?null:e.getAttribute("data-accepts"),addRemoveLinks:!0,dictDefaultMessage:e.getAttribute("data-default-message"),dictInvalidFileType:e.getAttribute("data-invalid-input-type"),dictFileTooBig:e.getAttribute("data-file-too-big"),dictRemoveFile:e.getAttribute("data-remove-file"),timeout:0,thumbnailMethod:"contain",thumbnailWidth:480,thumbnailHeight:480};e.hasAttribute("data-max-file")&&(u.maxFiles=Number(e.getAttribute("data-max-file"))),e.hasAttribute("data-max-size")&&(u.maxFilesize=Number(e.getAttribute("data-max-size")));const m=await Hg(e,u);return m.on("success",(y,A)=>{y.uuid=A.uuid,l[y.uuid]={submitted:!1};const L=(0,C.tw)("input",{name:"files",type:"hidden",id:`dropzone-file-${A.uuid}`,value:A.uuid});e.querySelector(".files").append(L),Gf(y),m.emit(Uu,{file:y})}),m.on("removedfile",async y=>{s||(m.emit($u,{fileUuid:y.uuid}),document.querySelector(`#dropzone-file-${y.uuid}`)?.remove(),i&&l[y.uuid]&&!l[y.uuid].submitted&&await(0,Ae.LO)(i,{data:new URLSearchParams({file:y.uuid})}))}),m.on("submit",()=>{for(const y of Object.keys(l))l[y].submitted=!0}),m.on(Ac,async()=>{try{const A=await(await(0,Ae.fG)(t)).json();s=!0,m.removeAllFiles(!0),s=!1,e.querySelector(".files").innerHTML="";for(const L of e.querySelectorAll(".dz-preview"))L.remove();l={};for(const L of A){const z={name:L.name,uuid:L.uuid,size:L.size};if(m.emit("addedfile",z),m.emit("complete",z),(0,St.u)(z.name)){const _e=`${n}/${z.uuid}`;m.emit("thumbnail",z,_e)}Gf(z),l[z.uuid]={submitted:!0};const X=(0,C.tw)("input",{name:"files",type:"hidden",id:`dropzone-file-${z.uuid}`,value:z.uuid});e.querySelector(".files").append(X)}e.querySelector(".dz-preview")||e.classList.remove("dz-started")}catch(y){gt(`Failed to load attachments: ${y}`),console.error(y)}}),m.on("error",(y,A)=>{gt(`Dropzone upload error: ${A}`),m.removeFile(y)}),t&&m.emit(Ac),m}var Bg=Object.defineProperty,$g=(e,t,i)=>t in e?Bg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Yf=(e,t,i)=>$g(e,typeof t!="symbol"?t+"":t,i);let Ug=0;const Jf="ce-upload-state-changed";function Vu(e){e.dispatchEvent(new CustomEvent(Jf,{bubbles:!0}))}function Vg(e,t){return new Promise(i=>{const n=Ug++;t._giteaUploadId=n;const s=e.dropzone,l=({file:u})=>{u._giteaUploadId===n&&(s.off(Uu,l),i(u))};s.on(Uu,l),s.addFile(t)})}class Zf{constructor(t){Yf(this,"editor"),this.editor=t}insertPlaceholder(t){Wf(this.editor,t)}replacePlaceholder(t,i){const n=this.editor,s=n.selectionStart,l=n.selectionEnd;n.value.substring(s,l)===t?(n.value=n.value.substring(0,s)+i+n.value.substring(l),n.selectionEnd=s+i.length):(n.value=n.value.replace(t,i),n.selectionEnd-=t.length,n.selectionEnd+=i.length),n.selectionStart=n.selectionEnd,n.focus(),Lo(n)}}class Wg{constructor(t){Yf(this,"editor"),this.editor=t}insertPlaceholder(t){const i=this.editor,n=i.getCursor("start"),s=i.getCursor("end");i.replaceSelection(t),s.ch=n.ch+t.length,i.setSelection(n,s),i.focus(),Lo(i.getTextArea())}replacePlaceholder(t,i){const n=this.editor,s=n.getCursor("end");n.getSelection()===t?n.replaceSelection(i):n.setValue(n.getValue().replace(t,i)),s.ch-=t.length,s.ch+=i.length,n.setSelection(s,s),n.focus(),Lo(n.getTextArea())}}async function Cc(e,t,i,n){n.preventDefault();for(const s of i){const l=s.name.slice(0,s.name.lastIndexOf(".")),{width:u,dppx:m}=await Rg(s),y=`[${l}](uploading ...)`;e.insertPlaceholder(y),await Vg(t,s),e.replacePlaceholder(y,Xf(s,{width:u,dppx:m}))}}function eh(e,t){return e=e.replace(new RegExp(`!?\\[([^\\]]+)\\]\\(/?attachments/${t}\\)`,"g"),""),e=e.replace(new RegExp(`<img[^>]+src="/?attachments/${t}"[^>]*>`,"g"),""),e}function zg(e,t){const{value:i,selectionStart:n,selectionEnd:s}=e,l=i.substring(n,s),u=t.trim(),m=i.substring(0,n),y=i.substring(s),A=m.endsWith("](")&&y.startsWith(")");return l&&(0,pr.gU)(u)&&!(0,pr.gU)(l)&&!A?`[${l}](${u})`:null}function Kg(e,t,i,n){if(n)return;const s=zg(e,i);s&&(t.preventDefault(),(0,C.Pj)(e,s))}function th(e){const t=[];for(const n of e.clipboardData?.items??[])n.type?.startsWith("image/")&&t.push(n.getAsFile());return{text:e.clipboardData?.getData?.("text")??"",images:t}}function Xg(e,t){const i=new Wg(e.codemirror);e.codemirror.on("paste",(n,s)=>{const{images:l}=th(s);l.length&&Cc(i,t,l,s)}),e.codemirror.on("drop",(n,s)=>{s.dataTransfer.files.length&&Cc(i,t,s.dataTransfer.files,s)}),t.dropzone.on($u,({fileUuid:n})=>{const s=e.codemirror.getValue(),l=eh(s,n);s!==l&&e.codemirror.setValue(l)})}function Gg(e,t){let i=!1;e.addEventListener("keydown",n=>{n.shiftKey&&(i=!0)}),e.addEventListener("keyup",n=>{n.shiftKey||(i=!1)}),e.addEventListener("paste",n=>{const{images:s,text:l}=th(n);s.length&&t?Cc(new Zf(e),t,s,n):l&&Kg(e,n,l,i)}),e.addEventListener("drop",n=>{n.dataTransfer.files.length&&t&&Cc(new Zf(e),t,n.dataTransfer.files,n)}),t?.dropzone.on($u,({fileUuid:n})=>{const s=eh(e.value,n);e.value!==s&&(e.value=s)})}function kc(e){let t=e.closest("form");return t?(t.checkValidity()?t.dispatchEvent(new SubmitEvent("submit",{bubbles:!0,cancelable:!0})):t.reportValidity(),!0):(t=e.closest(".ui.form"),t?((0,C.gD)(t,".ui.primary.button")?.click(),!0):!1)}var Qg=__webpack_require__("./node_modules/tinycolor2/esm/tinycolor.js");const ih={},nh={},Yg={fontFamily:"var(--fonts-monospace)",fontSize:14,guides:{bracketPairs:!1,indentation:!1},links:!1,minimap:{enabled:!1},occurrencesHighlight:"off",overviewRulerLanes:0,renderLineHighlight:"all",renderLineHighlightOnlyWhenFocus:!0,rulers:[],scrollbar:{horizontalScrollbarSize:6,verticalScrollbarSize:6},scrollBeyondLastLine:!1,automaticLayout:!0};function Jg(e){const t=e.getAttribute("data-editorconfig");if(!t)return null;try{return JSON.parse(t)}catch{return null}}function Zg(e){for(const{filenames:t,extensions:i,id:n}of e.languages.getLanguages()){for(const s of t||[])ih[s]=n;for(const s of i||[])nh[s]=n;n==="typescript"&&e.languages.typescript.typescriptDefaults.setCompilerOptions({jsx:e.languages.typescript.JsxEmit.Preserve})}}function sh(e){return ih[e]||nh[(0,St.LC)(e)]||"plaintext"}function e0(e,t,i,n){t.updateOptions(ah(i,n));const s=t.getModel();if(!s)return;const l=s.getLanguageId(),u=sh(i);l!==u&&e.editor.setModelLanguage(s,u)}function t0(e){window.codeEditors||(window.codeEditors=[]),window.codeEditors.includes(e)||window.codeEditors.push(e)}function rh(e){const t=window.getComputedStyle(document.documentElement),i=n=>(0,Qg.A)(t.getPropertyValue(n).trim()).toString("hex6");e.editor.defineTheme("gitea",{base:(0,St.g4)()?"vs-dark":"vs",inherit:!0,rules:[{background:i("--color-code-bg"),token:""}],colors:{"editor.background":i("--color-code-bg"),"editor.foreground":i("--color-text"),"editor.inactiveSelectionBackground":i("--color-primary-light-4"),"editor.lineHighlightBackground":i("--color-editor-line-highlight"),"editor.selectionBackground":i("--color-primary-light-3"),"editor.selectionForeground":i("--color-primary-light-3"),"editorLineNumber.background":i("--color-code-bg"),"editorLineNumber.foreground":i("--color-secondary-dark-6"),"editorWidget.background":i("--color-body"),"editorWidget.border":i("--color-secondary"),"input.background":i("--color-input-background"),"input.border":i("--color-input-border"),"input.foreground":i("--color-input-text"),"scrollbar.shadow":i("--color-shadow-opaque"),"progressBar.background":i("--color-primary"),focusBorder:"#0000"}})}async function oh(e,t,i){const n=await __webpack_require__.e("monaco").then(__webpack_require__.bind(__webpack_require__,"include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.main.js"));Zg(n);let{language:s,...l}=i;s||(s=sh(t));const u=document.createElement("div");if(u.className="monaco-editor-container",!e.parentNode)throw new Error("Parent node absent");e.parentNode.append(u),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{rh(n)}),rh(n);const m=n.editor.createModel(e.value,s,n.Uri.file(t)),y=n.editor.create(u,{model:m,theme:"gitea",...l});n.editor.addKeybindingRules([{keybinding:n.KeyCode.Enter,command:null}]),m.onDidChangeContent(()=>{e.value=y.getValue({preserveBOM:!0,lineEnding:""}),e.dispatchEvent(new Event("change"))}),t0(y);const A=document.querySelector(".editor-loading");return A&&A.remove(),{monaco:n,editor:y}}function ah(e,t){return{wordWrap:(t||[]).includes((0,St.LC)(e))?"on":"off"}}function lh(e){const t=document.querySelector('a[data-tab="preview"]');t&&(e?t.style.display="":(t.style.display="none",t.classList.contains("active")&&document.querySelector('a[data-tab="write"]')?.click()))}async function i0(e,t){const i=(0,St.P8)(t.value),n=new Set((e.getAttribute("data-previewable-extensions")||"").split(",")),s=(e.getAttribute("data-line-wrap-extensions")||"").split(","),l=n.has((0,St.LC)(i)),u=Jg(t);lh(l);const{monaco:m,editor:y}=await oh(e,i,{...Yg,...ah(t.value,s),...n0(u)});return t.addEventListener("input",(0,C.nm)(()=>{const A=t.value,L=n.has((0,St.LC)(A));lh(L),e0(m,y,A,s)})),y}function n0(e){if(!e||!(0,St.Gv)(e))return{};const t={};return t.detectIndentation=!("indent_style"in e)||!("indent_size"in e),"indent_size"in e&&(t.indentSize=Number(e.indent_size)),"tab_width"in e&&(t.tabSize=Number(e.tab_width)||Number(e.indent_size)),"max_line_length"in e&&(t.rulers=[Number(e.max_line_length)]),t.trimAutoWhitespace=e.trim_trailing_whitespace===!0,t.insertSpaces=e.indent_style==="space",t.useTabStops=e.indent_style==="tab",t}const{i18n:ch}=window.config;function Wu({header:e="",content:t="",confirmButtonColor:i="primary"}={}){return new Promise(n=>{const s=e?`<div class="header">${R(e)}</div>`:"",l=(0,C.SL)(`
./output/git.buildapp.eu.org_run/git.buildapp.eu.org_1_initial_page.html:303:_Originally posted by @${u} in ${m}_`,(0,ke.mD)(A).modal("show")})}function q0(){(0,C.jB)(document,".title_wip_desc > a",e=>e.addEventListener("click",t=>{t.preventDefault();const i=JSON.parse(e.closest(".title_wip_desc").getAttribute("data-wip-prefixes")),n=document.querySelector("#issue_title"),s=n.value;for(const l of i)if(s.startsWith(l.toUpperCase()))return;n.value=`${i[0]} ${s}`}))}function P0(){(0,C.jB)(document,".toggle-wip",e=>e.addEventListener("click",async t=>{t.preventDefault();const i=e,n=i.getAttribute("data-title"),s=i.getAttribute("data-wip-prefix"),l=i.getAttribute("data-update-url");try{const u=new URLSearchParams;if(u.append("title",n?.startsWith(s)?n.slice(s.length).trim():`${s.trim()} ${n}`),!(await(0,Ae.LO)(l,{data:u})).ok)throw new Error("Failed to toggle WIP status");window.location.reload()}catch(u){console.error(u)}}))}function F0(){const e=document.querySelector("#issue-title-display"),t=document.querySelector("#issue-title-editor");if(!t)return;const i=t.querySelector("input"),n=i.getAttribute("data-old-title");e.querySelector("#issue-title-edit-show").addEventListener("click",()=>{(0,C.y9)(e),(0,C.y9)("#pull-desc-display"),(0,C.fi)(t),(0,C.fi)("#pull-desc-editor"),i.value.trim()||(i.value=n),i.focus()}),t.querySelector(".ui.cancel.button").addEventListener("click",()=>{(0,C.y9)(t),(0,C.y9)("#pull-desc-editor"),(0,C.fi)(e),(0,C.fi)("#pull-desc-display")});const l=document.querySelector("#pull-desc-editor")?.getAttribute("data-target-update-url"),u=t.querySelector(".ui.primary.button");t.addEventListener("submit",async m=>{m.preventDefault();const y=i.value.trim();try{if(y&&y!==n){const A=await(0,Ae.LO)(u.getAttribute("data-update-url"),{data:new URLSearchParams({title:y})});if(!A.ok)throw new Error(`Failed to update issue title: ${A.statusText}`)}if(l){const A=document.querySelector("#pull-target-branch").getAttribute("data-branch"),L=document.querySelector("#branch_target").textContent;if(A!==L){const z=await(0,Ae.LO)(l,{data:new URLSearchParams({target_branch:A})});if(!z.ok)throw new Error(`Failed to update PR target branch: ${z.statusText}`)}}Ku(t),window.location.reload()}catch(A){console.error(A),gt(A.message)}})}function I0(){document.querySelector("#branch-select")?.addEventListener("click",e=>{const t=e.target.closest(".item[data-branch]");if(!t)return;const i=document.querySelector("#pull-target-branch"),n=i.getAttribute("data-basename"),s=t.getAttribute("data-branch"),l=i.getAttribute("data-branch");i.textContent=i.textContent.replace(`${n}:${l}`,`${n}:${s}`),i.setAttribute("data-branch",s)})}async function N0(e){const t=await ma(e.querySelector(".combo-markdown-editor")),i=document.querySelector("#status-button"),n=document.querySelector("#comment-button"),s=()=>{const l=t.value().trim(),u=t.isUploading();i&&(i.textContent=i.getAttribute(l?"data-status-and-comment":"data-status"),i.disabled=u),n&&(n.disabled=!l||u)};t.container.addEventListener(ha.EventUploadStateChanged,s),t.container.addEventListener(ha.EventEditorContentChanged,s),s()}function H0(e){const t=e.querySelectorAll(".combo-editor-dropzone"),i=async n=>{const s=n.querySelector(".form-field-real"),l=n.querySelector(".form-field-dropzone"),u=n.querySelector(".combo-markdown-editor"),m=await ma(u);m.container.addEventListener(ha.EventEditorContentChanged,()=>s.value=m.value()),s.addEventListener("focus",async()=>{(0,C.fi)(e.querySelectorAll(".combo-editor-dropzone .form-field-real")),(0,C.y9)(e.querySelectorAll(".combo-editor-dropzone .combo-markdown-editor")),(0,C.jB)(e,".combo-editor-dropzone .form-field-dropzone",y=>{const L=y.querySelector(".dropzone").dropzone.files.length!==0;(0,C.oi)(y,L)}),(0,C.y9)(s),(0,C.fi)(u),(0,C.fi)(l),await m.switchToUserPreference(),m.focus()})};for(const n of t)i(n)}function B0(){const e=document.querySelector(".comment.form");e&&(e.querySelector(".field.combo-editor-dropzone")?H0(e):e.querySelector(".combo-markdown-editor")&&N0(e),E0())}function $0(){_c("click","onRepoEllipsisButtonClick",async(e,t)=>{t.preventDefault();const i=e.getAttribute("aria-expanded")==="true";(0,C.oi)(e.parentElement.querySelector(".commit-body")),e.setAttribute("aria-expanded",String(!i))})}function U0(){Ha("initCommitStatuses",e=>{const t=e.nextElementSibling;if(!t.matches(".tippy-target"))throw new Error("Expected next element to be a tippy target");Ie(e,{content:t,placement:"bottom-start",interactive:!0,role:"dialog",theme:"box-with-header"})})}const{appSubUrl:ph}=window.config;function V0(){const e=document.querySelector("#manage_topic");if(!e)return;const t=document.querySelector("#topic_edit"),i=document.querySelector("#repo-topics"),n=t.querySelector(".ui.dropdown");let s;e.addEventListener("click",()=>{(0,C.y9)([i,e]),(0,C.fi)(t),n.querySelector("input.search").focus()}),document.querySelector("#cancel_topic_edit").addEventListener("click",()=>{s?.hideToast(),(0,C.y9)(t),(0,C.fi)([i,e]),e.focus()}),document.querySelector("#save_topic").addEventListener("click",async l=>{s?.hideToast();const u=t.querySelector("input[name=topics]").value,m=new FormData;m.append("topics",u);const y=await(0,Ae.LO)(l.target.getAttribute("data-link"),{data:m});if(y.ok){if((await y.json()).status==="ok"){if((0,C.xP)(i,".repo-topic",L=>L.remove()),u.length){const L=u.split(",");L.sort();for(const z of L){const X=document.createElement("a");X.classList.add("repo-topic","ui","large","label","gt-ellipsis"),X.href=`${ph}/explore/repos?q=${encodeURIComponent(z)}&topic=1`,X.textContent=z,i.append(X)}}(0,C.y9)(t),(0,C.fi)([i,e])}}else if(y.status===422){const A=await y.json();if(s=gt(A.message,{duration:5e3}),A.invalidTopics&&A.invalidTopics.length>0){const{invalidTopics:L}=A,z=(0,C.xP)(n,"a.ui.label");for(const[X,_e]of u.split(",").entries())L.includes(_e)&&(z[X].classList.remove("green"),z[X].classList.add("red"))}}}),(0,ke.mD)(n).dropdown({allowAdditions:!0,forceSelection:!1,fullTextSearch:"exact",fields:{name:"description",value:"data-value"},saveRemoteData:!1,label:{transition:"horizontal flip",duration:200,variation:!1},apiSettings:{url:`${ph}/explore/topics/search?q={query}`,throttle:500,cache:!1,onResponse(l){const u={success:!1,results:[]},m=(0,St.Kq)(this.urlData.query.trim());let y=!1;const A=[];for(const L of(0,C.xP)(n,"a.ui.label.visible"))A.push(L.getAttribute("data-value"));if(l.topics){let L=!1;for(const{topic_name:z}of l.topics)A.includes(z)||(z.toLowerCase()===m.toLowerCase()&&(y=!0),u.results.push({description:z,"data-value":z}),L=!0);u.success=L}return m.length>0&&!y?(u.success=!0,u.results.unshift({description:m,"data-value":m})):m.length>0&&y&&u.results.sort((L,z)=>L.description.toLowerCase()===m.toLowerCase()?-1:z.description.toLowerCase()===m.toLowerCase()?1:L.description>z.description?-1:L.description<z.description?1:0),u}},onLabelCreate(l){return l=l.toLowerCase().trim(),this.attr("data-value",l).contents().first().replaceWith(l),(0,ke.mD)(this)},onAdd(l,u,m){l=l.toLowerCase().trim(),m[0].setAttribute("data-value",l),m[0].setAttribute("data-text",l)}})}const{appSubUrl:W0}=window.config;function Qu(){Number(document.querySelector("#security_protocol")?.value)>0?(0,C.fi)(".has-tls"):(0,C.y9)(".has-tls")}function z0(){document.querySelector(".page-content.admin")&&(hf(),K0(),X0(),G0())}function K0(){document.querySelector(".page-content.admin.edit.user, .page-content.admin.new.user")&&document.querySelector("#login_type")?.addEventListener("change",function(){this.value?.startsWith("0")?(document.querySelector("#user_name")?.removeAttribute("disabled"),document.querySelector("#login_name")?.removeAttribute("required"),(0,C.y9)(".non-local"),(0,C.fi)(".local"),document.querySelector("#user_name")?.focus(),this.getAttribute("data-password")==="required"&&document.querySelector("#password")?.setAttribute("required","required")):(document.querySelector(".admin.edit.user")&&document.querySelector("#user_name")?.setAttribute("disabled","disabled"),document.querySelector("#login_name")?.setAttribute("required","required"),(0,C.fi)(".non-local"),(0,C.y9)(".local"),document.querySelector("#login_name")?.focus(),document.querySelector("#password")?.removeAttribute("required"))})}function X0(){const e=document.querySelector(".page-content.admin.authentication");if(!e)return;const t=e.classList.contains("new"),i=e.classList.contains("edit");if(!t&&!i)return;function n(){const L=document.querySelectorAll(".search-page-size");if(document.querySelector("#use_paged_search").checked){(0,C.fi)(".search-page-size");for(const z of L)z.querySelector("input")?.setAttribute("required","required")}else{(0,C.y9)(".search-page-size");for(const z of L)z.querySelector("input")?.removeAttribute("required")}}function s(L){(0,C.y9)(".open_id_connect_auto_discovery_url, .oauth2_use_custom_url");for(const X of document.querySelectorAll(".open_id_connect_auto_discovery_url input[required]"))X.removeAttribute("required");const z=document.querySelector("#oauth2_provider").value;switch(z){case"openidConnect":document.querySelector(".open_id_connect_auto_discovery_url input").setAttribute("required","required"),(0,C.fi)(".open_id_connect_auto_discovery_url");break;default:{const X=document.querySelector(`#${z}_customURLSettings`);if(!X)break;const _e=X.getAttribute("data-available")==="true",pe=X.getAttribute("data-required")==="true";_e&&(0,C.fi)(".oauth2_use_custom_url"),pe&&(document.querySelector("#oauth2_use_custom_url").checked=!0);break}}l(L)}function l(L){const z=document.querySelector("#oauth2_provider").value;(0,C.y9)(".oauth2_use_custom_url_field");for(const _e of document.querySelectorAll(".oauth2_use_custom_url_field input[required]"))_e.removeAttribute("required");if(document.querySelector(`#${z}_customURLSettings`)&&document.querySelector("#oauth2_use_custom_url").checked)for(const _e of["token_url","auth_url","profile_url","email_url","tenant"]){L&&(document.querySelector(`#oauth2_${_e}`).value=document.querySelector(`#${z}_${_e}`).value);const pe=document.querySelector(`#${z}_${_e}`);if(pe&&pe.getAttribute("data-available")==="true"){for(const de of document.querySelectorAll(`.oauth2_${_e} input`))de.setAttribute("required","required");(0,C.fi)(`.oauth2_${_e}`)}}}function u(){const L=document.querySelector(".js-ldap-group-toggle")?.checked;(0,C.oi)(document.querySelector("#ldap-group-options"),L)}const m=document.querySelector("#auth_type");if(t){const L=function(){(0,C.y9)(".ldap, .dldap, .smtp, .pam, .oauth2, .has-tls, .search-page-size, .sspi");for(const X of document.querySelectorAll(".ldap input[required], .binddnrequired input[required], .dldap input[required], .smtp input[required], .pam input[required], .oauth2 input[required], .has-tls input[required], .sspi input[required]"))X.removeAttribute("required");document.querySelector(".binddnrequired")?.classList.remove("required");const z=m.value;switch(z){case"2":(0,C.fi)(".ldap");for(const X of document.querySelectorAll(".binddnrequired input, .ldap div.required:not(.dldap) input"))X.setAttribute("required","required");document.querySelector(".binddnrequired")?.classList.add("required");break;case"3":(0,C.fi)(".smtp"),(0,C.fi)(".has-tls");for(const X of document.querySelectorAll(".smtp div.required input, .has-tls"))X.setAttribute("required","required");break;case"4":(0,C.fi)(".pam");for(const X of document.querySelectorAll(".pam input"))X.setAttribute("required","required");break;case"5":(0,C.fi)(".dldap");for(const X of document.querySelectorAll(".dldap div.required:not(.ldap) input"))X.setAttribute("required","required");break;case"6":(0,C.fi)(".oauth2");for(const X of document.querySelectorAll(".oauth2 div.required:not(.oauth2_use_custom_url,.oauth2_use_custom_url_field,.open_id_connect_auto_discovery_url) input"))X.setAttribute("required","required");s(!0);break;case"7":(0,C.fi)(".sspi");for(const X of document.querySelectorAll(".sspi div.required input"))X.setAttribute("required","required");break}(z==="2"||z==="5")&&(Qu(),u()),z==="2"&&n()};m.addEventListener("change",L),L(),document.querySelector("#security_protocol")?.addEventListener("change",Qu),document.querySelector("#use_paged_search")?.addEventListener("change",n),document.querySelector("#oauth2_provider")?.addEventListener("change",()=>s(!0)),document.querySelector("#oauth2_use_custom_url")?.addEventListener("change",()=>l(!0)),document.querySelector(".js-ldap-group-toggle").addEventListener("change",u)}if(i){const L=m.value;L==="2"||L==="5"?(document.querySelector("#security_protocol")?.addEventListener("change",Qu),document.querySelector(".js-ldap-group-toggle").addEventListener("change",u),u(),L==="2"&&document.querySelector("#use_paged_search")?.addEventListener("change",n)):L==="6"&&(document.querySelector("#oauth2_provider")?.addEventListener("change",()=>s(!0)),document.querySelector("#oauth2_use_custom_url")?.addEventListener("change",()=>l(!1)),s(!1))}const y=document.querySelector("#auth_name"),A=function(){document.querySelector("#oauth2-callback-url").textContent=`${window.location.origin}${W0}/user/oauth2/${encodeURIComponent(y.value)}/callback`};y.addEventListener("input",A),A()}function G0(){const e=document.querySelector(".page-content.admin.notice");if(!e)return;const t=document.querySelector("#detail-modal");(0,C.jB)(e,".view-detail",n=>n.addEventListener("click",s=>{s.preventDefault();const l=n.closest("tr").querySelector(".notice-description"),u=t.querySelector(".content pre");u.textContent=l.textContent,(0,ke.mD)(t).modal("show")}));const i=document.querySelectorAll(".select.table .ui.checkbox input");(0,C.jB)(e,".select.action",n=>n.addEventListener("click",()=>{switch(n.getAttribute("data-action")){case"select-all":for(const s of i)s.checked=!0;break;case"deselect-all":for(const s of i)s.checked=!1;break;case"inverse":for(const s of i)s.checked=!s.checked;break}})),document.querySelector("#delete-selection")?.addEventListener("click",async function(n){n.preventDefault(),this.classList.add("is-loading","disabled");const s=new FormData;for(const l of i)l.checked&&s.append("ids[]",l.closest(".ui.checkbox").getAttribute("data-id"));await(0,Ae.LO)(this.getAttribute("data-link"),{data:s}),window.location.href=this.getAttribute("data-redirect")})}function Q0(e){window.history.pushState?window.history.pushState(null,null,e):window.location.hash=e}function Yu(e){for(const pe of document.querySelectorAll(".code-view tr.active"))pe.classList.remove("active");const t=document.querySelectorAll(".code-view td.lines-num span[data-line-number]"),i=document.querySelector("a.ref-in-new-issue"),n=document.querySelector("a.copy-line-permalink"),s=document.querySelector("a.view_git_blame"),l=function(pe){if(!i)return;const de=i.getAttribute("data-url-issue-new"),Pe=i.getAttribute("data-url-param-body-link"),Le=`${(0,St.oK)(Pe)}#${pe}`;i.setAttribute("href",`${de}?body=${encodeURIComponent(Le)}`)},u=function(pe){if(!s)return;let de=s.getAttribute("href");de=`${de.replace(/#L\d+$|#L\d+-L\d+$/,"")}`,pe.length!==0&&(de=`${de}#${pe}`),s.setAttribute("href",de)},m=function(pe){if(!n)return;let de=n.getAttribute("data-url");de=`${de.replace(/#L\d+$|#L\d+-L\d+$/,"")}#${pe}`,n.setAttribute("data-clipboard-text",de),n.setAttribute("data-clipboard-text-type","url")},y=e?e.split("-"):[],A=y[0]??"";if(!A)return null;const L=y[1]||A;let z=parseInt(A.substring(1)),X=parseInt(L.substring(1));if(z>X){const pe=z;z=X,X=pe,e=`${L}-${A}`}const _e=t[z-1]??null;for(let pe=z-1;pe<=X-1&&pe<t.length;pe++)t[pe].closest("tr").classList.add("active");return Q0(`#${e}`),l(e),u(e),m(e),_e}function gh(){const e=document.querySelector(".code-line-menu");if(!e)return;for(const s of document.querySelectorAll(".code-line-button"))s.remove();const t=document.querySelector(".code-view tr.active");if(!t)return;const i=t.querySelector("td.lines-num"),n=document.createElement("button");n.classList.add("code-line-button","ui","basic","button"),n.innerHTML=(0,Z.JW)("octicon-kebab-horizontal"),i.prepend(n),n.closest(".code-view").append(e.cloneNode(!0)),Ie(n,{theme:"menu",trigger:"click",hideOnClick:!0,content:e,placement:"right-start",interactive:!0,onShow:s=>{s.popper.addEventListener("click",()=>{s.hide()},{once:!0})}})}function Y0(){if(!document.querySelector(".repo-view-container .file-view"))return;let e;(0,C.ny)(document,"click",".code-view .lines-num span",(i,n)=>{if(!e||!n.shiftKey)e=i.getAttribute("id"),Yu(e);else{const s=i.getAttribute("id");Yu(`${e}-${s}`)}window.getSelection().removeAllRanges(),gh()});const t=()=>{if(!window.location.hash||!document.querySelector(".code-view .lines-num"))return;const i=window.location.hash.substring(1),n=Yu(i);n&&(window.history.scrollRestoration!=="manual"&&(window.history.scrollRestoration="manual"),n.scrollIntoView({block:"start"}),gh())};t(),window.addEventListener("hashchange",t)}function J0(){document.querySelector("#ssh-key-content")?.addEventListener("input",function(){const e=this.value.split(" "),t=document.querySelector("#ssh-key-title");!t.value&&e.length===3&&e[2]!==""&&(t.value=e[2])})}function Z0(){if(!document.querySelector(".user.settings.profile"))return;const e=document.querySelector("#username");e&&e.addEventListener("input",function(){const t=document.querySelector("#name-change-prompt"),i=document.querySelector("#name-change-redirect-prompt");this.value.toLowerCase()!==this.getAttribute("data-name").toLowerCase()?((0,C.fi)(t),(0,C.fi)(i)):((0,C.y9)(t),(0,C.y9)(i))})}function ev(){const e=document.querySelector("#repo_migrating");if(!e)return;document.querySelector("#repo_migrating_retry")?.addEventListener("click",tv);const t=e.getAttribute("data-migrating-repo-link"),i=async()=>{const s=await(0,Ae.fG)(`${t}/-/migrate/status`);if(s.status!==200)return!0;const l=await s.json();return l.message&&(document.querySelector("#repo_migrating_progress_message").textContent=l.message),l.status===4?(window.location.reload(),!1):l.status===3?((0,C.y9)("#repo_migrating_progress"),(0,C.y9)("#repo_migrating"),(0,C.fi)("#repo_migrating_retry"),(0,C.fi)("#repo_migrating_failed"),(0,C.fi)("#repo_migrating_failed_image"),document.querySelector("#repo_migrating_failed_error").textContent=l.message,!1):!0},n=async()=>{let s=!0;try{s=await i()}finally{s&&setTimeout(n,2e3)}};n()}async function tv(e){await(0,Ae.LO)(e.target.getAttribute("data-migrating-task-retry-url")),window.location.reload()}const{pageData:Ju}=window.config;let Zu;function ed(){return Zu||(Zu=nv(Ju.DiffFileTree,Ju.FolderIcon,Ju.FolderOpenIcon)),Zu}function iv(e,t,i){const n=e.fullNameMap[t];if(n){n.IsViewed=i;for(let s=n.ParentEntry;s;s=s.ParentEntry)s.IsViewed=bh(s)}}function vh(e,t){if(e[t.FullName]=t,!!t.Children){t.IsViewed=bh(t);for(const i of t.Children)i.ParentEntry=t,vh(e,i)}}function nv(e,t,i){const n=(0,Re.Kh)({diffFileTree:e,folderIcon:t,folderOpenIcon:i,fileTreeIsVisible:!1,selectedItem:"",fullNameMap:{}});return vh(n.fullNameMap,e.TreeRoot),n}function bh(e){if(e.Children){let t=0;for(const i of e.Children)i.IsViewed&&t++;return t===e.Children.length}return e.IsViewed}const sv=["title"],rv=["innerHTML"],ov={class:"gt-ellipsis"},av={class:"sub-items"},lv=["title","href"],cv=["innerHTML"],uv={class:"gt-ellipsis tw-flex-1"};var dv=(0,c.pM)({__name:"DiffFileTreeItem",props:{item:{}},setup(e){const t=e,i=ed(),n=(0,Re.KR)(t.item.IsViewed);function s(l){const u={"":{name:"octicon-blocked",classes:["text","red"]},added:{name:"octicon-diff-added",classes:["text","green"]},modified:{name:"octicon-diff-modified",classes:["text","yellow"]},deleted:{name:"octicon-diff-removed",classes:["text","red"]},renamed:{name:"octicon-diff-renamed",classes:["text","teal"]},copied:{name:"octicon-diff-renamed",classes:["text","green"]},typechange:{name:"octicon-diff-modified",classes:["text","green"]}};return u[l]??u[""]}return(l,u)=>{const m=(0,c.g2)("DiffFileTreeItem",!0);return l.item.EntryMode==="tree"?((0,c.uX)(),(0,c.CE)(c.FK,{key:0},[(0,c.Lk)("div",{class:(0,W.C4)(["item-directory",{viewed:l.item.IsViewed}]),title:l.item.DisplayName,onClick:u[0]||(u[0]=Di(y=>n.value=!n.value,["stop"]))},[(0,c.Q3)(" directory "),(0,c.bF)((0,Re.R1)(Z.Ah),{name:n.value?"octicon-chevron-right":"octicon-chevron-down"},null,8,["name"]),(0,c.Q3)(" eslint-disable-next-line vue/no-v-html "),(0,c.Lk)("span",{class:"tw-contents",innerHTML:n.value?(0,Re.R1)(i).folderIcon:(0,Re.R1)(i).folderOpenIcon},null,8,rv),(0,c.Lk)("span",ov,(0,W.v_)(l.item.DisplayName),1)],10,sv),(0,c.bo)((0,c.Lk)("div",av,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(l.item.Children,y=>((0,c.uX)(),(0,c.Wv)(m,{key:y.DisplayName,item:y},null,8,["item"]))),128))],512),[[ti,!n.value]])],64)):((0,c.uX)(),(0,c.CE)("a",{key:1,class:(0,W.C4)(["item-file",{selected:(0,Re.R1)(i).selectedItem==="#diff-"+l.item.NameHash,viewed:l.item.IsViewed}]),title:l.item.DisplayName,href:"#diff-"+l.item.NameHash},[(0,c.Q3)(" file "),(0,c.Q3)(" eslint-disable-next-line vue/no-v-html "),(0,c.Lk)("span",{class:"tw-contents",innerHTML:l.item.FileIcon},null,8,cv),(0,c.Lk)("span",uv,(0,W.v_)(l.item.DisplayName),1),(0,c.bF)((0,Re.R1)(Z.Ah),{name:s(l.item.DiffStatus).name,class:(0,W.C4)(s(l.item.DiffStatus).classes)},null,8,["name","class"])],10,lv))}}}),fv=(0,Xi.A)(dv,[["__scopeId","data-v-a138c97c"]]);const hv={key:0,class:"diff-file-tree-items"},_h="diff_file_tree_visible";var mv=(0,c.pM)({__name:"DiffFileTree",setup(e){const t=ed();(0,c.sV)(()=>{t.fileTreeIsVisible=localStorage.getItem(_h)!=="false",document.querySelector(".diff-toggle-file-tree-button").addEventListener("click",s),i(),window.addEventListener("hashchange",i)}),(0,c.hi)(()=>{document.querySelector(".diff-toggle-file-tree-button").removeEventListener("click",s),window.removeEventListener("hashchange",i)});function i(){t.selectedItem=window.location.hash,n()}function n(){if(t.selectedItem){const m=document.querySelector(t.selectedItem);m?.getAttribute("data-folded")==="true"&&Ba(m,m.querySelector(".fold-file"),!1)}}function s(){l(!t.fileTreeIsVisible)}function l(m){t.fileTreeIsVisible=m,localStorage.setItem(_h,t.fileTreeIsVisible.toString()),u(t.fileTreeIsVisible)}function u(m){const y=document.querySelector(".diff-toggle-file-tree-button"),[A,L]=y.querySelectorAll(".icon"),z=document.querySelector("#diff-file-tree"),X=y.getAttribute(m?"data-hide-text":"data-show-text");y.setAttribute("data-tooltip-content",X),(0,C.oi)(z,m),(0,C.oi)(A,!m),(0,C.oi)(L,m)}return(m,y)=>(0,Re.R1)(t).fileTreeIsVisible?((0,c.uX)(),(0,c.CE)("div",hv,[(0,c.Q3)(" only render the tree if we're visible. in many cases this is something that doesn't change very often "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,Re.R1)(t).diffFileTree.TreeRoot.Children,A=>((0,c.uX)(),(0,c.Wv)(fv,{key:A.FullName,item:A},null,8,["item"]))),128))])):(0,c.Q3)("v-if",!0)}}),pv=(0,Xi.A)(mv,[["__scopeId","data-v-12a35ef6"]]);function gv(){const e=document.querySelector("#diff-file-tree");if(!e)return;Ai(pv).mount(e)}const vv={class:"ui scrolling dropdown custom diff-commit-selector"},bv=["data-tooltip-content","aria-label","aria-controls","aria-activedescendant"],_v=["id","aria-expanded"],yv={key:0,class:"loading-indicator is-loading"},wv=["id"],Sv={class:"gt-ellipsis"},xv={class:"gt-ellipsis text light-2 tw-mb-0"},jv={class:"gt-ellipsis"},Ev={class:"gt-ellipsis text light-2"},Av={key:3,class:"info text light-2"},Cv=["data-commit-idx","onKeydown","onMouseover","onClick"],kv={class:"tw-flex-1 tw-flex tw-flex-col tw-gap-1"},Tv={class:"gt-ellipsis commit-list-summary"},Lv={class:"gt-ellipsis text light-2"},Rv={class:"text right"},Mv=["datetime"],Dv={class:"tw-font-mono"};function Ov(e,t,i,n,s,l){const u=(0,c.g2)("svg-icon");return(0,c.uX)(),(0,c.CE)("div",vv,[(0,c.Lk)("button",{ref:"expandBtn",class:"ui tiny basic button",onClick:t[0]||(t[0]=Di(m=>e.toggleMenu(),["stop"])),"data-tooltip-content":e.locale.filter_changes_by_commit,"aria-haspopup":"true","aria-label":e.locale.filter_changes_by_commit,"aria-controls":e.uniqueIdMenu,"aria-activedescendant":e.uniqueIdShowAll},[(0,c.bF)(u,{name:"octicon-git-commit"})],8,bv),(0,c.Q3)(' this dropdown is not managed by Fomantic UI, so it needs some classes like "transition" explicitly '),(0,c.bo)((0,c.Lk)("div",{class:(0,W.C4)(["left menu transition",{visible:e.menuVisible}]),id:e.uniqueIdMenu,"aria-expanded":e.menuVisible?"true":"false"},[e.isLoading?((0,c.uX)(),(0,c.CE)("div",yv)):(0,c.Q3)("v-if",!0),e.isLoading?(0,c.Q3)("v-if",!0):((0,c.uX)(),(0,c.CE)("div",{key:1,class:"item",id:e.uniqueIdShowAll,ref:"showAllChanges",role:"menuitem",onKeydown:t[1]||(t[1]=se(m=>e.showAllChanges(),["enter"])),onClick:t[2]||(t[2]=m=>e.showAllChanges())},[(0,c.Lk)("div",Sv,(0,W.v_)(e.locale.show_all_commits),1),(0,c.Lk)("div",xv,(0,W.v_)(e.locale.stats_num_commits),1)],40,wv)),(0,c.Q3)(" only show the show changes since last review if there is a review AND we are commits ahead of the last review "),e.lastReviewCommitSha!=null?((0,c.uX)(),(0,c.CE)("div",{key:2,class:(0,W.C4)(["item",{disabled:!e.commitsSinceLastReview}]),role:"menuitem",onKeydown:t[3]||(t[3]=se(m=>e.changesSinceLastReviewClick(),["enter"])),onClick:t[4]||(t[4]=m=>e.changesSinceLastReviewClick())},[(0,c.Lk)("div",jv,(0,W.v_)(e.locale.show_changes_since_your_last_review),1),(0,c.Lk)("div",Ev,(0,W.v_)(e.commitsSinceLastReview)+" commits ",1)],34)):(0,c.Q3)("v-if",!0),e.isLoading?(0,c.Q3)("v-if",!0):((0,c.uX)(),(0,c.CE)("span",Av,(0,W.v_)(e.locale.select_commit_hold_shift_for_range),1)),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.commits,(m,y)=>((0,c.uX)(),(0,c.CE)("div",{key:m.id,class:(0,W.C4)(["item",{selected:m.selected,hovered:m.hovered}]),role:"menuitem","data-commit-idx":y,onKeydown:[se(Di(A=>e.commitClicked(m.id),["exact"]),["enter"]),se(Di(A=>e.commitClickedShift(m),["shift","exact"]),["enter"])],onMouseover:Di(A=>e.highlight(m),["shift"]),onClick:[Di(A=>e.commitClicked(m.id),["exact"]),Di(A=>e.commitClicked(m.id,!0),["ctrl","exact"]),Di(A=>e.commitClicked(m.id,!0),["meta","exact"]),Di(A=>e.commitClickedShift(m),["shift","exact","stop","prevent"])]},[(0,c.Lk)("div",kv,[(0,c.Lk)("div",Tv,(0,W.v_)(m.summary),1),(0,c.Lk)("div",Lv,[(0,c.eW)((0,W.v_)(m.committer_or_author_name)+" ",1),(0,c.Lk)("span",Rv,[(0,c.Q3)(" TODO: make this respect the PreferredTimestampTense setting "),(0,c.Lk)("relative-time",{prefix:"",datetime:m.time,"data-tooltip-content":"","data-tooltip-interactive":"true"},(0,W.v_)(m.time),9,Mv)])])]),(0,c.Lk)("div",Dv,(0,W.v_)(m.short_sha),1)],42,Cv))),128))],10,_v),[[ti,e.menuVisible]])])}var qv=(0,c.pM)({components:{SvgIcon:Z.Ah},data:()=>{const e=document.querySelector("#diff-commit-select");return{menuVisible:!1,isLoading:!1,queryParams:e.getAttribute("data-queryparams"),issueLink:e.getAttribute("data-issuelink"),locale:{filter_changes_by_commit:e.getAttribute("data-filter_changes_by_commit")},mergeBase:e.getAttribute("data-merge-base"),commits:[],hoverActivated:!1,lastReviewCommitSha:"",uniqueIdMenu:(0,ke.Ae)(),uniqueIdShowAll:(0,ke.Ae)()}},computed:{commitsSinceLastReview(){return this.lastReviewCommitSha?this.commits.length-this.commits.findIndex(e=>e.id===this.lastReviewCommitSha)-1:0}},mounted(){document.body.addEventListener("click",this.onBodyClick),this.$el.addEventListener("keydown",this.onKeyDown),this.$el.addEventListener("keyup",this.onKeyUp)},unmounted(){document.body.removeEventListener("click",this.onBodyClick),this.$el.removeEventListener("keydown",this.onKeyDown),this.$el.removeEventListener("keyup",this.onKeyUp)},methods:{onBodyClick(e){this.$el.contains(e.target)||this.menuVisible&&this.toggleMenu()},onKeyDown(e){if(!this.menuVisible)return;const t=document.activeElement;if(this.$el.contains(t)){switch(e.key){case"ArrowDown":e.preventDefault(),this.focusElem(t.nextElementSibling,t);break;case"ArrowUp":e.preventDefault(),this.focusElem(t.previousElementSibling,t);break;case"Escape":e.preventDefault(),t.tabIndex=-1,this.toggleMenu();break}if(e.key==="ArrowDown"||e.key==="ArrowUp"){const i=document.activeElement,n=i?.matches(".item")?i.getAttribute("data-commit-idx"):null;n&&this.highlight(this.commits[Number(n)])}}},onKeyUp(e){if(!this.menuVisible)return;const t=document.activeElement;if(this.$el.contains(t)&&e.key==="Shift"&&this.hoverActivated){this.hoverActivated=!1;for(const i of this.commits)i.hovered=!1,i.selected=!1}},highlight(e){if(!this.hoverActivated)return;const t=this.commits.findIndex(n=>n.selected),i=this.commits.findIndex(n=>n.id===e.id);for(const[n,s]of this.commits.entries())s.hovered=Math.min(t,i)<=n&&n<=Math.max(t,i)},focusElem(e,t){e&&(e.tabIndex=0,t&&(t.tabIndex=-1),e.focus())},async toggleMenu(){if(this.menuVisible=!this.menuVisible,!this.commits.length&&this.menuVisible&&!this.isLoading){this.isLoading=!0;try{await this.fetchCommits()}finally{this.isLoading=!1}}this.$nextTick(()=>{this.menuVisible?this.focusElem(this.$refs.showAllChanges,this.$refs.expandBtn):this.focusElem(this.$refs.expandBtn,this.$refs.showAllChanges)})},async fetchCommits(){const t=await(await(0,Ae.fG)(`${this.issueLink}/commits/list`)).json();this.commits.push(...t.commits.map(i=>(i.hovered=!1,i))),this.commits.reverse(),this.lastReviewCommitSha=t.last_review_commit_sha||null,this.lastReviewCommitSha&&!this.commits.some(i=>i.id===this.lastReviewCommitSha)&&(this.lastReviewCommitSha=null),Object.assign(this.locale,t.locale)},showAllChanges(){window.location.assign(`${this.issueLink}/files${this.queryParams}`)},changesSinceLastReviewClick(){window.location.assign(`${this.issueLink}/files/${this.lastReviewCommitSha}..${this.commits.at(-1).id}${this.queryParams}`)},commitClicked(e,t=!1){const i=`${this.issueLink}/commits/${e}${this.queryParams}`;t?window.open(i):window.location.assign(i)},commitClickedShift(e){if(this.hoverActivated=!this.hoverActivated,e.selected=!0,!this.hoverActivated){const t=this.commits.findIndex(l=>l.selected),i=this.commits.findLastIndex(l=>l.selected);let n;t===0?n=this.mergeBase:n=this.commits[t-1].id;const s=this.commits[i].id;t===i?window.location.assign(`${this.issueLink}/commits/${s}${this.queryParams}`):n===this.mergeBase&&s===this.commits.at(-1).id?window.location.assign(`${this.issueLink}/files${this.queryParams}`):window.location.assign(`${this.issueLink}/files/${n}..${s}${this.queryParams}`)}}}}),Pv=(0,Xi.A)(qv,[["render",Ov],["__scopeId","data-v-c589fa0e"]]);function Fv(){const e=document.querySelector("#diff-commit-select");if(!e)return;Ai(Pv).mount(e)}const{pageData:Iv}=window.config,Ua=Iv.prReview||{},yh="viewed-file-checked-form",wh=".viewed-file-form",Nv="#expand-files-btn",Hv="#collapse-files-btn";function Sh(){document.querySelector("#viewed-files-summary")?.setAttribute("value",Ua.numberOfViewedFiles);const t=document.querySelector("#viewed-files-summary-label");t&&(t.innerHTML=t.getAttribute("data-text-changed-template").replace("%[1]d",Ua.numberOfViewedFiles).replace("%[2]d",Ua.numberOfFiles))}function Bv(){Ua.numberOfViewedFiles=document.querySelectorAll(`${wh} > input[type=checkbox][checked]`).length,Sh()}function xh(){for(const e of document.querySelectorAll(`${wh}:not([data-has-viewed-checkbox-listener="true"])`)){e.setAttribute("data-has-viewed-checkbox-listener",String(!0));const t=e.querySelector("input[type=checkbox]");t.addEventListener("input",function(){this.checked?(e.classList.add(yh),t.setAttribute("checked",""),Ua.numberOfViewedFiles++):(e.classList.remove(yh),t.removeAttribute("checked"),Ua.numberOfViewedFiles--),Sh(),e.parentNode.querySelector(".changed-since-last-review")?.remove();const n=t.getAttribute("name");iv(ed(),n,this.checked);const s={};s[n]=this.checked;const l={files:s},u=e.getAttribute("data-headcommit");u&&(l.headCommitSHA=u),(0,Ae.LO)(e.getAttribute("data-link"),{data:l});const m=e.closest(".diff-file-header");Ba(m.closest(".file-content"),m.querySelector(".fold-file"),this.checked)})}}function $v(){document.querySelector(Nv)?.addEventListener("click",()=>{for(const e of document.querySelectorAll('.file-content[data-folded="true"]'))Ba(e,e.querySelector(".fold-file"),!1)}),document.querySelector(Hv)?.addEventListener("click",()=>{for(const e of document.querySelectorAll('.file-content:not([data-folded="true"])'))e.getAttribute("id")!=="diff-incomplete"&&Ba(e,e.querySelector(".fold-file"),!0)})}const{i18n:Uv}=window.config;function Vv(e){(0,C.jB)(e,".file-view-toggle",t=>t.addEventListener("click",()=>{(0,C.D6)(t,".file-view-toggle",n=>n.classList.remove("active")),t.classList.add("active");const i=document.querySelector(t.getAttribute("data-toggle-selector"));if(!i)throw new Error("Target element not found");(0,C.y9)((0,C.D6)(i)),(0,C.fi)(i)}))}function Wv(){(0,C.ny)(document,"submit",".conversation-holder form",async(e,t)=>{t.preventDefault();const i=e.querySelector("textarea");if(hh(i)&&!e.classList.contains("is-loading"))try{e.classList.add("is-loading");const n=new FormData(e),s=(0,C.IU)(t);(s?.nodeName==="BUTTON"||s?.nodeName==="INPUT"&&s.type==="submit")&&s.name&&n.append(s.name,s.value);const u=e.closest("tr")?.getAttribute("data-line-type"),m=await(0,Ae.LO)(e.getAttribute("action"),{data:n}),y=(0,C.SL)(await m.text()),A=y.getAttribute("data-path"),L=y.getAttribute("data-side"),z=y.getAttribute("data-idx");if(e.closest(".conversation-holder").replaceWith(y),e=null,u){let X;u==="same"?X=`[data-path="${A}"] .add-code-comment[data-idx="${z}"]`:X=`[data-path="${A}"] .add-code-comment[data-side="${L}"][data-idx="${z}"]`;for(const _e of document.querySelectorAll(X))_e.classList.add("tw-invisible")}if(!s||s?.matches('button[name="pending_review"]')){const X=document.querySelector("#review-box"),_e=X?.querySelector(".review-comments-counter");if(!_e)return;const pe=parseInt(_e.getAttribute("data-pending-comment-number"))+1||1;_e.setAttribute("data-pending-comment-number",String(pe)),_e.textContent=String(pe),(0,C.b7)(X,"pulse-1p5-200")}}catch(n){console.error("Error:",n),gt(Uv.network_error)}finally{e?.classList.remove("is-loading")}}),(0,C.ny)(document,"click",".resolve-conversation",async(e,t)=>{t.preventDefault();const i=e.getAttribute("data-comment-id"),n=e.getAttribute("data-origin"),s=e.getAttribute("data-action"),l=e.getAttribute("data-update-url");try{const m=await(await(0,Ae.LO)(l,{data:new URLSearchParams({origin:n,action:s,comment_id:i})})).text(),y=e.closest(".conversation-holder");if(y){const A=(0,C.SL)(m);y.replaceWith(A)}else window.location.reload()}catch(u){console.error("Error:",u)}})}function zv(){(0,C.ny)(document,"click",".previous-conversation, .next-conversation",(e,t)=>{t.preventDefault();const i=e.matches(".previous-conversation"),n=e.closest(".comment-code-cloud"),s=document.querySelectorAll(".comment-code-cloud:not(.tw-hidden)"),l=Array.from(s).indexOf(n),u=l>0?l-1:s.length-1,m=l<s.length-1?l+1:0,L=s[i?u:m].querySelector(".comment").id;window.location.href=`#${L}`})}function jh(){for(const e of document.querySelectorAll(".diff-header-popup-btn:not([data-header-popup-initialized])")){e.setAttribute("data-header-popup-initialized","");const t=e.nextElementSibling;if(!t?.matches(".tippy-target"))throw new Error("Popup element not found");Ie(e,{content:t,theme:"menu",placement:"bottom",trigger:"click",interactive:!0,hideOnClick:!0})}}function Eh(){tf(),xh(),Bv(),Ld(),jh()}async function Ah(e){if(e.classList.contains("disabled"))return!1;e.classList.add("disabled");const t=e.getAttribute("data-href");try{const n=await(await(0,Ae.fG)(t)).text(),l=(0,St.a8)(n,"text/html").querySelector("#diff-file-boxes");return document.querySelector("#diff-incomplete").replaceWith(...Array.from(l.children)),Eh(),!0}catch(i){console.error("Error:",i),gt("An error occurred while loading more files.")}finally{e.classList.remove("disabled")}return!1}function Kv(){(0,C.ny)(document,"click","a#diff-show-more-files",(e,t)=>{t.preventDefault(),Ah(e)}),(0,C.ny)(document,"click","a.diff-load-button",async(e,t)=>{if(t.preventDefault(),e.classList.contains("disabled"))return;e.classList.add("disabled");const i=e.getAttribute("data-href");try{const s=await(await(0,Ae.fG)(i)).text(),u=(0,St.a8)(s,"text/html").querySelector("#diff-file-boxes .diff-file-body .file-body"),m=Array.from(u.children);e.parentElement.replaceWith(...m);for(const y of m)window.htmx.process(y);Eh()}catch(n){console.error("Error:",n)}finally{e.classList.remove("disabled")}})}async function Ch(){const e=window.location.hash;if(!(!e.startsWith("#diff-")&&!e.startsWith("#issuecomment-")))for(;;){const t=document.getElementById(e.substring(1));if(t){t.scrollIntoView();return}const i=document.querySelector("#diff-show-more-files");if(!i||!await Ah(i))return}}function Xv(){window.addEventListener("hashchange",Ch),Ch()}function Gv(){Wv(),document.querySelector("#diff-file-boxes")&&(zv(),gv(),Fv(),Kv(),jh(),xh(),$v(),Xv(),yc("#diff-file-boxes .diff-file-box",Vv),(0,C.ny)(document,"click",".fold-file",e=>{ng(e.closest(".file-content"),e)}))}const{appSubUrl:Qv}=window.config;function Yv(){const e=document.querySelector(".page-content.organization.new.team");e&&(0,C.jB)(e,"input[name=permission]",t=>t.addEventListener("change",()=>{const i=e.querySelector("input[name=permission]:checked")?.value;(0,C.oi)(e.querySelectorAll(".team-units"),i!=="admin")}))}function Jv(){const e=(0,ke.mD)("#search-repo-box");e.search({minCharacters:2,apiSettings:{url:`${Qv}/repo/search?q={query}&uid=${e.data("uid")}`,onResponse(t){const i=[];for(const n of t.data)i.push({title:n.repository.full_name.split("/")[1],description:n.repository.full_name});return{results:i}}},searchFields:["full_name"],showNoResults:!1})}function Zv(){document.querySelector(".page-content.organization")&&(Yv(),Jv())}const{appSubUrl:Mo}=window.config;async function eb(){const e=document.querySelector(".user.signin.webauthn-prompt"),t=document.querySelector(".signin-passkey");if(!(!e&&!t)){if(!window.isSecureContext){(0,C.y9)(t);return}Th()&&(t&&t.addEventListener("click",tb),e&&ib())}}async function tb(){const e=await(0,Ae.fG)(`${Mo}/user/webauthn/passkey/assertion`);if(!e.ok){Ds("unknown");return}const t=await e.json();t.publicKey.challenge=(0,St.vd)(t.publicKey.challenge);for(const i of t.publicKey.allowCredentials??[])i.id=(0,St.vd)(i.id);try{const i=await navigator.credentials.get({publicKey:t.publicKey}),n=i.response,s=new Uint8Array(n.authenticatorData),l=new Uint8Array(n.clientDataJSON),u=new Uint8Array(i.rawId),m=new Uint8Array(n.signature),y=new Uint8Array(n.userHandle),A=await(0,Ae.LO)(`${Mo}/user/webauthn/passkey/login`,{data:{id:i.id,rawId:(0,St.vh)(u),type:i.type,clientExtensionResults:i.getClientExtensionResults(),response:{authenticatorData:(0,St.vh)(s),clientDataJSON:(0,St.vh)(l),signature:(0,St.vh)(m),userHandle:(0,St.vh)(y)}}});if(A.status===500){Ds("unknown");return}else if(!A.ok){Ds("unable-to-process");return}const L=await A.json();window.location.href=L?.redirect??`${Mo}/`}catch(i){Ds("general",i.message)}}async function ib(){const e=await(0,Ae.fG)(`${Mo}/user/webauthn/assertion`);if(!e.ok){Ds("unknown");return}const t=await e.json();t.publicKey.challenge=(0,St.vd)(t.publicKey.challenge);for(const i of t.publicKey.allowCredentials??[])i.id=(0,St.vd)(i.id);try{const i=await navigator.credentials.get({publicKey:t.publicKey});await kh(i)}catch(i){if(!t.publicKey.extensions?.appid){Ds("general",i.message);return}delete t.publicKey.extensions.appid;try{const n=await navigator.credentials.get({publicKey:t.publicKey});await kh(n)}catch(n){Ds("general",n.message)}}}async function kh(e){const t=new Uint8Array(e.response.authenticatorData),i=new Uint8Array(e.response.clientDataJSON),n=new Uint8Array(e.rawId),s=new Uint8Array(e.response.signature),l=new Uint8Array(e.response.userHandle),u=await(0,Ae.LO)(`${Mo}/user/webauthn/assertion`,{data:{id:e.id,rawId:(0,St.vh)(n),type:e.type,clientExtensionResults:e.getClientExtensionResults(),response:{authenticatorData:(0,St.vh)(t),clientDataJSON:(0,St.vh)(i),signature:(0,St.vh)(s),userHandle:(0,St.vh)(l)}}});if(u.status===500){Ds("unknown");return}else if(!u.ok){Ds("unable-to-process");return}const m=await u.json();window.location.href=m?.redirect??`${Mo}/`}async function nb(e){const t=new Uint8Array(e.response.attestationObject),i=new Uint8Array(e.response.clientDataJSON),n=new Uint8Array(e.rawId),s=await(0,Ae.LO)(`${Mo}/user/settings/security/webauthn/register`,{data:{id:e.id,rawId:(0,St.vh)(n),type:e.type,response:{attestationObject:(0,St.vh)(t),clientDataJSON:(0,St.vh)(i)}}});if(s.status===409){Ds("duplicated");return}else if(s.status!==201){Ds("unknown");return}window.location.reload()}function Ds(e,t=""){const i=document.querySelector("#webauthn-error-msg");if(e==="general")i.textContent=t||"unknown error";else{const n=document.querySelector(`#webauthn-error [data-webauthn-error-msg=${e}]`);n?i.textContent=`${n.textContent}${t?` ${t}`:""}`:i.textContent=`unknown error type: ${e}${t?` ${t}`:""}`}(0,C.fi)("#webauthn-error")}function Th(){return window.isSecureContext?typeof window.PublicKeyCredential!="function"?(Ds("browser"),!1):!0:(Ds("insecure"),!1)}function sb(){const e=document.querySelector("#register-webauthn");if(e){if(!Th()){e.disabled=!0;return}e.addEventListener("click",async t=>{t.preventDefault(),await rb()})}}async function rb(){const e=document.querySelector("#nickname"),t=new FormData;t.append("name",e.value);const i=await(0,Ae.LO)(`${Mo}/user/settings/security/webauthn/request_register`,{data:t});if(i.status===409){Ds("duplicated");return}else if(!i.ok){Ds("unknown");return}const n=await i.json();if(e.closest("div.field").classList.remove("error"),n.publicKey.challenge=(0,St.vd)(n.publicKey.challenge),n.publicKey.user.id=(0,St.vd)(n.publicKey.user.id),n.publicKey.excludeCredentials)for(const s of n.publicKey.excludeCredentials)s.id=(0,St.vd)(s.id);try{const s=await navigator.credentials.create({publicKey:n.publicKey});await nb(s)}catch(s){Ds("unknown",s)}}function ob(){document.addEventListener("click",e=>{if(e.target.matches(".remove-rel-attach")){const t=e.target.getAttribute("data-uuid"),i=e.target.getAttribute("data-id");document.querySelector(`input[name='attachment-del-${t}']`).value="true",(0,C.y9)(`#attachment-${i}`)}})}function ab(){document.querySelector(".repository.new.release")&&lb()}function lb(){const e=document.querySelector("#tag-name-editor");if(!e)return;const t=JSON.parse(e.getAttribute("data-existing-tags"));if(!Array.isArray(t))return;const i=e.getAttribute("data-tag-helper"),n=e.getAttribute("data-tag-helper-new"),s=e.getAttribute("data-tag-helper-existing"),l=document.querySelector("#tag-name"),u=function(m){const y=m.value,A=document.querySelector("#tag-helper");t.includes(y)?((0,C.y9)("#tag-target-selector"),A.textContent=s):((0,C.fi)("#tag-target-selector"),A.textContent=y?n:i)};u(l),l.addEventListener("input",m=>{u(m.target)})}const{appSubUrl:cb}=window.config,ub=/^\S+@\S+$/;function db(){const e=document.querySelector("#search-user-box");if(!e)return;const t=e.getAttribute("data-allow-email")==="true",i=e.getAttribute("data-allow-email-description")??void 0;(0,ke.mD)(e).search({minCharacters:2,apiSettings:{url:`${cb}/user/search_candidates?q={query}`,onResponse(n){const s=[],l=e.querySelector("input").value,u=l.toUpperCase();for(const m of n.data){const y={title:m.login,image:m.avatar_url,description:R(m.full_name)};u===m.login.toUpperCase()?s.unshift(y):s.push(y)}if(t&&!s.length&&ub.test(l)){const m={title:l,description:i};s.push(m)}return{results:s}}},searchFields:["login","full_name"],showNoResults:!1})}function fb(){const e=document.querySelector(".page-content.install");e&&(e.classList.contains("post-install")?mb():hb())}function hb(){const e="gitea",t="gitea",i={mysql:"127.0.0.1:3306",postgres:"127.0.0.1:5432",mssql:"127.0.0.1:1433"},n=document.querySelector("#db_host"),s=document.querySelector("#db_user"),l=document.querySelector("#db_name");document.querySelector("#db_type").addEventListener("change",function(){const y=this.value;if((0,C.y9)("div[data-db-setting-for]"),(0,C.fi)(`div[data-db-setting-for=${y}]`),y!=="sqlite3"){(0,C.fi)("div[data-db-setting-for=common-host]");const A=n.value;(!A||Object.values(i).includes(A))&&(n.value=i[y]??""),!s.value&&!l.value&&(s.value=e,l.value=t)}}),document.querySelector("#db_type").dispatchEvent(new Event("change"));const u=document.querySelector("#app_url");u.value.includes("://localhost")&&(u.value=window.location.href);const m=document.querySelector("#domain");m.value.trim()==="localhost"&&(m.value=window.location.hostname),document.querySelector("#offline-mode input").addEventListener("change",function(){this.checked&&(document.querySelector("#disable-gravatar input").checked=!0,document.querySelector("#federated-avatar-lookup input").checked=!1)}),document.querySelector("#disable-gravatar input").addEventListener("change",function(){this.checked?document.querySelector("#federated-avatar-lookup input").checked=!1:document.querySelector("#offline-mode input").checked=!1}),document.querySelector("#federated-avatar-lookup input").addEventListener("change",function(){this.checked&&(document.querySelector("#disable-gravatar input").checked=!1,document.querySelector("#offline-mode input").checked=!1)}),document.querySelector("#enable-openid-signin input").addEventListener("change",function(){this.checked?document.querySelector("#disable-registration input").checked||(document.querySelector("#enable-openid-signup input").checked=!0):document.querySelector("#enable-openid-signup input").checked=!1}),document.querySelector("#disable-registration input").addEventListener("change",function(){this.checked?(document.querySelector("#enable-captcha input").checked=!1,document.querySelector("#enable-openid-signup input").checked=!1):document.querySelector("#enable-openid-signup input").checked=!0}),document.querySelector("#enable-captcha input").addEventListener("change",function(){this.checked&&(document.querySelector("#disable-registration input").checked=!1)})}function mb(){const e=document.querySelector("#goto-user-login");if(!e)return;const t=e.getAttribute("href");let i=setInterval(async()=>{try{const n=await(0,Ae.fG)(t);i&&n.status===200&&(clearInterval(i),i=null,window.location.href=t)}catch{}},1e3)}function pb(){if(!document.querySelectorAll(".new.webhook").length)return;for(const t of document.querySelectorAll(".events.checkbox input"))t.addEventListener("change",function(){this.checked&&(0,C.fi)(".events.fields")});for(const t of document.querySelectorAll(".non-events.checkbox input"))t.addEventListener("change",function(){this.checked&&(0,C.y9)(".events.fields")});const e=document.querySelector("#http_method");if(e){const t=function(){const i=e.value==="POST";(0,C.oi)(document.querySelector("#content_type").closest(".field"),i)};t(),e.addEventListener("change",t)}document.querySelector("#test-delivery")?.addEventListener("click",async function(){this.classList.add("is-loading","disabled"),await(0,Ae.LO)(this.getAttribute("data-link")),setTimeout(()=>{window.location.href=this.getAttribute("data-redirect")},5e3)})}function gb(){vb(),bb()}function vb(){for(const e of document.querySelectorAll(".show-create-branch-modal"))e.addEventListener("click",()=>{const t=e.getAttribute("data-modal-form")||"#create-branch-form",i=document.querySelector(t);if(!i)return;i.action=`${i.getAttribute("data-base-action")}${e.getAttribute("data-branch-from-urlcomponent")}`;const n=e.getAttribute("data-modal-from-span")||"#modal-create-branch-from-span";document.querySelector(n).textContent=e.getAttribute("data-branch-from"),(0,ke.mD)(e.getAttribute("data-modal")).modal("show")})}function bb(){for(const e of document.querySelectorAll(".show-rename-branch-modal"))e.addEventListener("click",()=>{const t=e.getAttribute("data-modal"),i=document.querySelector(t),n=e.getAttribute("data-old-branch-name");i.querySelector("input[name=from]").value=n;const s=i.querySelector(".default-branch-warning");(0,C.oi)(s,e.getAttribute("data-is-default-branch")==="true");const l=i.querySelector("[data-rename-branch-to]");l.textContent=l.getAttribute("data-rename-branch-to").replace("%s",n)})}function _b(e){return/.*[^/]\/[^/].*/.test(e)}function Lh(e){const t=document.querySelector(e);if(!t)return;const i=t.querySelector("#issue-label-edit-modal");if(!i)return;const n=i.querySelector('input[name="id"]'),s=i.querySelector(".label-name-input"),l=i.querySelector(".label-exclusive-input-field"),u=i.querySelector(".label-exclusive-input"),m=i.querySelector(".label-exclusive-warning"),y=i.querySelector(".label-exclusive-order-input-field"),A=i.querySelector(".label-exclusive-order-input"),L=i.querySelector(".label-is-archived-input-field"),z=i.querySelector(".label-is-archived-input"),X=i.querySelector(".label-desc-input"),_e=i.querySelector(".js-color-picker-input input"),pe=()=>{const Te=_b(s.value);l.classList.toggle("disabled",!Te);const He=Te&&u.checked&&i.hasAttribute("data-need-warn-exclusive");(0,C.oi)(m,He),Te||(u.checked=!1),(0,C.oi)(y,u.checked),parseInt(A.value)<=0?A.style.color="var(--color-placeholder-text) !important":A.style.color=null},de=Te=>{const He=i.querySelector("form");n.value=Te.getAttribute("data-label-id")||"",s.value=Te.getAttribute("data-label-name")||"",A.value=Te.getAttribute("data-label-exclusive-order")||"0",z.checked=Te.getAttribute("data-label-is-archived")==="true",u.checked=Te.getAttribute("data-label-exclusive")==="true",X.value=Te.getAttribute("data-label-description")||"",_e.value=Te.getAttribute("data-label-color")||"",_e.dispatchEvent(new Event("input",{bubbles:!0}));const U=!!n.value,Se=parseInt(Te.getAttribute("data-label-num-issues")||"0");i.toggleAttribute("data-need-warn-exclusive",!u.checked&&Se>0),i.querySelector(".header").textContent=U?i.getAttribute("data-text-edit-label"):i.getAttribute("data-text-new-label");const ze=i.getAttribute("data-current-page-link");He.action=U?`${ze}/edit`:`${ze}/new`,(0,C.oi)(L,U),pe(),(0,ke.mD)(i).modal({onApprove(){if(!He.checkValidity())return He.reportValidity(),!1;He.submit()}}).modal("show")};i.addEventListener("input",()=>pe());const Pe=t.querySelector(".ui.button.new-label");Pe?.addEventListener("click",()=>de(Pe));const Le=t.querySelectorAll(".edit-label-button");for(const Te of Le)Te.addEventListener("click",He=>{He.preventDefault(),de(Te)})}function yb(){document.querySelectorAll(".organization").length&&(document.querySelector(".organization.settings.options #org_name")?.addEventListener("input",function(){const e=this.value.toLowerCase()!==this.getAttribute("data-org-name").toLowerCase();(0,C.oi)("#org-name-change-prompt",e)}),Lh(".page-content.organization.settings.labels"))}var wb=__webpack_require__("./node_modules/jquery/dist/jquery.js"),Mn=__webpack_require__.n(wb);function Sb(){for(const e of document.querySelectorAll(".ui.checkbox")){if(e.hasAttribute("data-checkbox-patched"))continue;const t=e.querySelector("label"),i=e.querySelector("input");!t||!i||((0,ke.iZ)(t,i),e.setAttribute("data-checkbox-patched","true"))}}function xb(){for(const e of document.querySelectorAll(".ui.form .field")){if(e.hasAttribute("data-field-patched"))continue;const t=e.querySelector(":scope > label"),i=e.querySelector(":scope > input");!t||!i||((0,ke.iZ)(t,i),e.setAttribute("data-field-patched","true"))}}const Ar="_giteaAriaPatchDropdown",td=Mn().fn.dropdown;function jb(){if(Mn().fn.dropdown===id)throw new Error("initAriaDropdownPatch could only be called once");Mn().fn.dropdown.settings.onAfterFiltered=Eb,Mn().fn.dropdown=id,Mn().fn.fomanticExt.onResponseKeepSelectedItem=Rb,id.settings=td.settings}function id(...e){const t=td.apply(this,e);for(let i of this){i=i.closest(".ui.dropdown"),i[Ar]||kb(i);const n=Mn()(i),s=n.data("module-dropdown");s.giteaDelegated||(s.giteaDelegated=!0,Ab(n))}return t}function Rh(e,t){t.id||(t.id=(0,ke.Ae)()),t.setAttribute("role",e[Ar].listItemRole),t.setAttribute("tabindex","-1");for(const i of t.querySelectorAll("a, input, button"))i.setAttribute("tabindex","-1")}function Mh(e){e.id||(e.id=(0,ke.Ae)()),e.tabIndex=-1;const t=e.querySelector(".delete.icon");t&&(t.setAttribute("aria-hidden","false"),t.setAttribute("aria-label",window.config.i18n.remove_label_str.replace("%s",e.getAttribute("data-value"))),t.setAttribute("role","button"))}function Eb(){const e=Mn()(this).closest(".ui.dropdown"),t=e.dropdown("setting","hideDividers")==="empty",i=e[0].querySelector(".scrolling.menu")||e[0].querySelector(".menu");t&&i&&Lb(i)}function Ab(e){const t=td.bind(e),i={...t("setting","templates"),t:performance.now()},n=i.menu;i.menu=function(m,y,A,L){const z=n(m,y,A,L),X=document.createElement("div");X.innerHTML=z;const _e=Mn()(X);return _e.find("> .item").each((de,Pe)=>Rh(e[0],Pe)),e[0][Ar].deferredRefreshAriaActiveItem(),_e.html()},t("setting","templates",i);const s=t("setting","onLabelCreate");t("setting","onLabelCreate",function(m,y){const A=s.call(this,m,y);return Mh(A[0]),A});const l=t("internal","set"),u=l.direction;l.direction=function(m){u.call(this,m);const y=t("setting","className");m=m||e.find("> .menu");const A=m[0];A.classList.add(y.loading),A.getBoundingClientRect().right>document.documentElement.clientWidth&&A.classList.add(y.leftward),A.classList.remove(y.loading)}}function Cb(e,t,i){i.id||(i.id=(0,ke.Ae)()),Mn()(i).find("> .item").each((s,l)=>Rh(e,l)),i.setAttribute("role",e[Ar].listPopupRole);for(const s of e.querySelectorAll(".ui.label"))Mh(s);t.setAttribute("role",t.getAttribute("role")??e[Ar].focusableRole),t.setAttribute("aria-haspopup",e[Ar].listPopupRole),t.setAttribute("aria-controls",i.id),t.setAttribute("aria-expanded","false");const n=e.getAttribute("data-tooltip-content");n&&!e.getAttribute("aria-label")&&e.setAttribute("aria-label",n)}function kb(e){e[Ar]={};const t=e.querySelector("input.search"),i=t||e;if(!i)return;t&&!t.getAttribute("autocomplete")&&t.setAttribute("autocomplete","off");let n=Mn()(e).find("> .menu")[0];n||(n=document.createElement("div"),n.classList.add("menu"),e.append(n));const s=e.querySelectorAll("input").length>0;e[Ar].focusableRole=s?"combobox":"menu",e[Ar].listPopupRole=s?"listbox":"",e[Ar].listItemRole=s?"option":"menuitem",Tb(e,i,n),Cb(e,i,n)}function Tb(e,t,i){const n=()=>i.classList.contains("visible")&&!i.classList.contains("out")||i.classList.contains("in"),s=()=>{const y=n();t.setAttribute("aria-expanded",y?"true":"false");const A=Mn()(i).find("> .item.active, > .item.selected")[0];A&&(y?t.setAttribute("aria-activedescendant",A.id):e[Ar].listPopupRole==="menu"&&(t.removeAttribute("aria-activedescendant"),A.classList.remove("active","selected")))};e.addEventListener("keydown",y=>{if(y.key==="Enter"){const A=i.querySelector(":scope > .item.selected, .menu > .item.selected");A?.matches("a, .js-aria-clickable")&&!A.matches(".tw-hidden, .filtered")&&(y.preventDefault(),A.click())}});const l=(y=0)=>{setTimeout(s,y)};e[Ar].deferredRefreshAriaActiveItem=l,e.addEventListener("keyup",y=>{y.key.startsWith("Arrow")&&l()});let u=0,m=0;e.addEventListener("mousedown",()=>{m+=n()?1:0,u++},!0),e.addEventListener("focus",()=>{m+=n()?1:0,u++,l()},!0),e.addEventListener("blur",()=>{m=u=0,l(100)},!0),e.addEventListener("mouseup",()=>{setTimeout(()=>{m=u=0,l(100)},0)},!0),e.addEventListener("click",y=>{n()&&m!==2&&u===2&&y.stopPropagation(),u=m=0},!0)}function Lb(e){const t=[],i=[];let n="",s="";const l=z=>z.classList.contains("divider"),u=z=>l(z)&&z.hasAttribute("data-scope"),m=z=>z.classList.add("hidden","transition"),y=z=>z.classList.remove("hidden","transition"),A=z=>z.classList.contains("hidden")||z.classList.contains("filtered")||z.classList.contains("tw-hidden"),L=z=>{i.length===1&&u(i[0])?m(i[0]):i.length&&(u(i[0])&&s===n&&(m(i[0]),i.shift()),t.push(...i),s=n),n=z,i.length=0};(0,C.jB)(e,".divider",y);for(const z of e.children){const X=z.getAttribute("data-scope")||"";X!==n&&L(X),A(z)||i.push(z)}for(L("");t.length&&l(t[0]);)m(t[0]),t.shift();for(;t.length&&l(t[t.length-1]);)m(t[t.length-1]),t.pop();for(let z=0;z<t.length-1;z++)t[z].matches(".divider")&&t[z+1].matches(".divider")&&m(t[z])}function Rb(e,t){const i=e instanceof HTMLElement?e:e[0];setTimeout(()=>{(0,C.jB)(i,`.menu .item[data-value="${CSS.escape(t)}"].filtered`,n=>n.classList.remove("filtered")),Mn()(i).dropdown("set selected",t??"")},10)}const Dh=Mn().fn.modal;function Mb(){if(Mn().fn.modal===nd)throw new Error("initAriaModalPatch could only be called once");Mn().fn.modal=nd,nd.settings=Dh.settings}function nd(...e){const t=Dh.apply(this,e);if(e[0]==="show"||e[0]?.autoShow)for(const i of this)for(const n of i.querySelectorAll("form button.cancel:not([type])"))n.setAttribute("type","button");return t}function Db(){const e=new Set(["clear queue","stop","stop all","destroy","force repaint","repaint","reset","looping","remove looping","disable","enable","set duration","save conditions","restore conditions"]);Mn().fn.transition=function(t,i,n){if(t==="is supported")return!0;if(t==="is animating"||t==="is inward"||t==="is outward")return!1;let s;if(typeof t=="string"){if(e.has(t))return this;s={animation:t,...i&&{duration:i},...n&&{onComplete:n}}}else if(typeof t=="object")s=t;else throw new Error(`invalid argument: ${t}`);const l=s.animation?.startsWith("show")||s.animation?.endsWith(" in"),u=s.animation?.startsWith("hide")||s.animation?.endsWith(" out");return this.each((m,y)=>{let A=l;!l&&!u&&(A=this.hasClass("hidden")),s.onStart?.call(y),A?(y.classList.remove("hidden"),y.classList.add("visible","transition"),s.displayType&&y.style.setProperty("display",s.displayType,"important"),s.onShow?.call(y)):(y.classList.add("hidden"),y.classList.remove("visible"),y.style.removeProperty("display"),s.onHidden?.call(y)),s.onComplete?.call(y)}),this}}function Ob(){Mn().fn.dimmer=function(e,t){if(e==="add content"){const i=t,n=document.querySelector("body > .ui.dimmer");n?((0,C.xP)(n,"*",s=>s.classList.add("hidden")),this._dimmer=n):(this._dimmer=document.createElement("div"),this._dimmer.classList.add("ui","dimmer"),document.body.append(this._dimmer)),this._dimmer.append(i[0])}else{if(e==="get dimmer")return Mn()(this._dimmer);if(e==="show")this._dimmer.classList.add("active"),document.body.classList.add("tw-overflow-hidden");else if(e==="hide"){const i=t;this._dimmer.classList.remove("active"),document.body.classList.remove("tw-overflow-hidden"),i()}}return this}}function qb(){Mn().fn.tab=function(){for(const e of this){const t=e.getAttribute("data-tab");t&&e.addEventListener("click",()=>{const i=document.querySelector(`.ui.tab[data-tab="${t}"]`);(0,C.D6)(i,".ui.tab",n=>n.classList.remove("active")),(0,C.D6)(e,"[data-tab]",n=>n.classList.remove("active")),e.classList.add("active"),i.classList.add("active")})}return this}}const Oh=window.matchMedia("only screen and (max-width: 767.98px)");function Pb(){Mn().fn.fomanticExt={},Mn().fn.dropdown.settings.fullTextSearch="exact",Mn().fn.dropdown.settings.className.label+=" tw-cursor-default",Mn().fn.dropdown.settings.templates.label=function(e,t,i,n){const s=Mn().fn.dropdown.settings.templates.escape;return s(t,i)+(0,Z.JW)("octicon-x",16,`${n.delete} icon`)},Db(),Ob(),qb(),Sb(),xb(),jb(),Mb()}async function Fb(){const e=document.querySelector(".repository.wiki .combo-markdown-editor textarea");if(!e)return;const t=document.querySelector(".repository.wiki.new .ui.form"),i=t.querySelector(".combo-markdown-editor");let n,s=!1,l="";const u=async function(){if(s)return;const m=i.querySelector(".EasyMDEContainer .editor-preview-active"),A=i.querySelector(".EasyMDEContainer .editor-preview-active-side")||m,L=e.value;if(n&&A&&l!==L){s=!0;const z=new FormData;z.append("mode",n.previewMode),z.append("context",n.previewContext),z.append("text",L);try{const _e=await(await(0,Ae.LO)(n.previewUrl,{data:z})).text();l=L,A.innerHTML=`<div class="render-content markup ui segment">${_e}</div>`}catch(X){console.error("Error rendering preview:",X)}finally{s=!1,setTimeout(u,1e3)}}else setTimeout(u,1e3)};u(),n=await ma(i,{editorHeights:{minHeight:"300px",height:"calc(100vh - 600px)"},easyMDEOptions:{previewRender:(m,y)=>y.innerHTML,toolbar:["bold","italic","strikethrough","|","heading-1","heading-2","heading-3","heading-bigger","heading-smaller","|","gitea-code-inline","code","quote","|","gitea-checkbox-empty","gitea-checkbox-checked","|","unordered-list","ordered-list","|","link","image","table","horizontal-rule","|","preview","fullscreen","side-by-side","|","gitea-switch-to-textarea"]}}),t.addEventListener("submit",m=>{hh(e)||(m.preventDefault(),m.stopPropagation())})}function qh(e){e&&document.querySelector(".wiki-content-toc details")?.removeAttribute("open")}function Ib(){document.querySelector(".page-content.repository.wiki")&&(Oh.addEventListener("change",e=>qh(e.matches)),qh(Oh.matches),Fb())}function Nb(){(0,C.ny)(document,"click",".escape-button, .unescape-button, .toggle-escape-button",(e,t)=>{t.preventDefault();const i=e.getAttribute("data-unicode-content-selector"),n=i?document.querySelector(i):e.closest(".file-content, .non-diff-file-content"),s=n.querySelector(".file-code, .file-view")??n;if(e.matches(".escape-button"))s.classList.add("unicode-escaped"),(0,C.y9)(e),(0,C.fi)((0,C.D6)(e,".unescape-button"));else if(e.matches(".unescape-button"))s.classList.remove("unicode-escaped"),(0,C.y9)(e),(0,C.fi)((0,C.D6)(e,".escape-button"));else if(e.matches(".toggle-escape-button")){const l=s.classList.contains("unicode-escaped");s.classList.toggle("unicode-escaped",!l),(0,C.oi)(n.querySelectorAll(".unescape-button"),!l),(0,C.oi)(n.querySelectorAll(".escape-button"),l)}})}const{pageData:Ph}=window.config;async function Hb(e,t){const[{Cite:i,plugins:n}]=await Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl").then(__webpack_require__.bind(__webpack_require__,"./node_modules/@citation-js/core/lib-mjs/index.js")),Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl"),__webpack_require__.e("citation-js-formats")]).then(__webpack_require__.t.bind(__webpack_require__,"./node_modules/@citation-js/plugin-software-formats/lib/index.js",23)),Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl"),__webpack_require__.e("citation-js-bibtex")]).then(__webpack_require__.bind(__webpack_require__,"./node_modules/@citation-js/plugin-bibtex/lib-mjs/index.js")),Promise.all([__webpack_require__.e("citation-js-core-citation-js-formats-citation-js-bibtex-citation-js-csl"),__webpack_require__.e("citation-js-csl")]).then(__webpack_require__.bind(__webpack_require__,"./node_modules/@citation-js/plugin-csl/lib-mjs/index.js"))]),{citationFileContent:s}=Ph,l=n.config.get("@bibtex");l.constants.fieldTypes.doi=["field","literal"],l.constants.fieldTypes.version=["field","literal"];const u=new i(s),m=(0,St.kk)()||"en-US",y=u.format("bibliography",{template:"apa",lang:m}),A=u.format("bibtex",{lang:m});t.setAttribute("data-text",A),e.setAttribute("data-text",y)}async function Bb(){const e="apa";if(!Ph.citationFileContent)return;const t=document.querySelector("#citation-copy-apa"),i=document.querySelector("#citation-copy-bibtex"),n=document.querySelector("#citation-copy-content");if(!t&&!i||!n)return;const s=()=>{const l=(localStorage.getItem("citation-copy-format")||e)==="bibtex",u=(l?i:t).getAttribute("data-text");n.value=u,i.classList.toggle("primary",l),t.classList.toggle("primary",!l)};document.querySelector("#cite-repo-button")?.addEventListener("click",async()=>{try{await Hb(t,i)}catch(l){console.error(`initCitationFileCopyContent error: ${l}`,l);return}s(),t.addEventListener("click",()=>{localStorage.setItem("citation-copy-format","apa"),s()}),i.addEventListener("click",()=>{localStorage.setItem("citation-copy-format","bibtex"),s()}),n.addEventListener("click",()=>{n.select()}),(0,ke.mD)("#cite-repo-modal").modal("show")})}function $b(){_c("click","onCommentReactionButtonClick",async(e,t)=>{if(t.preventDefault(),e.classList.contains("disabled"))return;const i=e.closest("[data-action-url]").getAttribute("data-action-url"),n=e.getAttribute("data-reaction-content"),s=e.closest(".comment-container"),l=s.querySelector(".bottom-reactions"),m=l?.querySelector(`a[data-reaction-content="${CSS.escape(n)}"]`)?.getAttribute("data-has-reacted")==="true",A=await(await(0,Ae.LO)(`${i}/${m?"unreact":"react"}`,{data:new URLSearchParams({content:n})})).json();l?.remove(),A.html&&s.insertAdjacentHTML("beforeend",A.html)})}var Ub=__webpack_require__("./node_modules/brace-expansion/index.js");const Vb=1024*64,Tc=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>Vb)throw new TypeError("pattern is too long")},Wb={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Tl=e=>e.replace(/[[\]\\-]/g,"\\$&"),zb=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Fh=e=>e.join(""),Kb=(e,t)=>{const i=t;if(e.charAt(i)!=="[")throw new Error("not in a brace expression");const n=[],s=[];let l=i+1,u=!1,m=!1,y=!1,A=!1,L=i,z="";e:for(;l<e.length;){const de=e.charAt(l);if((de==="!"||de==="^")&&l===i+1){A=!0,l++;continue}if(de==="]"&&u&&!y){L=l+1;break}if(u=!0,de==="\\"&&!y){y=!0,l++;continue}if(de==="["&&!y){for(const[Pe,[Le,Te,He]]of Object.entries(Wb))if(e.startsWith(Pe,l)){if(z)return["$.",!1,e.length-i,!0];l+=Pe.length,He?s.push(Le):n.push(Le),m=m||Te;continue e}}if(y=!1,z){de>z?n.push(Tl(z)+"-"+Tl(de)):de===z&&n.push(Tl(de)),z="",l++;continue}if(e.startsWith("-]",l+1)){n.push(Tl(de+"-")),l+=2;continue}if(e.startsWith("-",l+1)){z=de,l+=2;continue}n.push(Tl(de)),l++}if(L<l)return["",!1,0,!1];if(!n.length&&!s.length)return["$.",!1,e.length-i,!0];if(s.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!A){const de=n[0].length===2?n[0].slice(-1):n[0];return[zb(de),!1,L-i,!1]}const X="["+(A?"^":"")+Fh(n)+"]",_e="["+(A?"":"^")+Fh(s)+"]";return[n.length&&s.length?"("+X+"|"+_e+")":n.length?X:_e,m,L-i,!0]},Ll=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),Xb=new Set(["!","?","+","*","@"]),Ih=e=>Xb.has(e),Gb="(?!(?:^|/)\\.\\.?(?:$|/))",Lc="(?!\\.)",Qb=new Set(["[","."]),Yb=new Set(["..","."]),Jb=new Set("().*{}+?[]^$\\!"),Zb=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),sd="[^/]",Nh=sd+"*?",Hh=sd+"+?",Ks=class Ks{constructor(t,i,n={}){wn(this,ba);rs(this,"type");wn(this,is);wn(this,bs);wn(this,lo,!1);wn(this,Dn,[]);wn(this,Gn);wn(this,Do);wn(this,ga);wn(this,Oo,!1);wn(this,Gr);wn(this,va);wn(this,Pl,!1);this.type=t,t&&tn(this,bs,!0),tn(this,Gn,i),tn(this,is,pt(this,Gn)?pt(pt(this,Gn),is):this),tn(this,Gr,pt(this,is)===this?n:pt(pt(this,is),Gr)),tn(this,ga,pt(this,is)===this?[]:pt(pt(this,is),ga)),t==="!"&&!pt(pt(this,is),Oo)&&pt(this,ga).push(this),tn(this,Do,pt(this,Gn)?pt(pt(this,Gn),Dn).length:0)}get hasMagic(){if(pt(this,bs)!==void 0)return pt(this,bs);for(const t of pt(this,Dn))if(typeof t!="string"&&(t.type||t.hasMagic))return tn(this,bs,!0);return pt(this,bs)}toString(){return pt(this,va)!==void 0?pt(this,va):this.type?tn(this,va,this.type+"("+pt(this,Dn).map(t=>String(t)).join("|")+")"):tn(this,va,pt(this,Dn).map(t=>String(t)).join(""))}push(...t){for(const i of t)if(i!==""){if(typeof i!="string"&&!(i instanceof Ks&&pt(i,Gn)===this))throw new Error("invalid part: "+i);pt(this,Dn).push(i)}}toJSON(){const t=this.type===null?pt(this,Dn).slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...pt(this,Dn).map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===pt(this,is)||pt(pt(this,is),Oo)&&pt(this,Gn)?.type==="!")&&t.push({}),t}isStart(){if(pt(this,is)===this)return!0;if(!pt(this,Gn)?.isStart())return!1;if(pt(this,Do)===0)return!0;const t=pt(this,Gn);for(let i=0;i<pt(this,Do);i++){const n=pt(t,Dn)[i];if(!(n instanceof Ks&&n.type==="!"))return!1}return!0}isEnd(){if(pt(this,is)===this||pt(this,Gn)?.type==="!")return!0;if(!pt(this,Gn)?.isEnd())return!1;if(!this.type)return pt(this,Gn)?.isEnd();const t=pt(this,Gn)?pt(pt(this,Gn),Dn).length:0;return pt(this,Do)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const i=new Ks(this.type,t);for(const n of pt(this,Dn))i.copyIn(n);return i}static fromGlob(t,i={}){var s;const n=new Ks(null,void 0,i);return dn(s=Ks,qo,Gc).call(s,t,n,0,i),n}toMMPattern(){if(this!==pt(this,is))return pt(this,is).toMMPattern();const t=this.toString(),[i,n,s,l]=this.toRegExpSource();if(!(s||pt(this,bs)||pt(this,Gr).nocase&&!pt(this,Gr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const m=(pt(this,Gr).nocase?"i":"")+(l?"u":"");return Object.assign(new RegExp(`^${i}$`,m),{_src:i,_glob:t})}get options(){return pt(this,Gr)}toRegExpSource(t){const i=t??!!pt(this,Gr).dot;if(pt(this,is)===this&&dn(this,ba,sm).call(this),!this.type){const y=this.isStart()&&this.isEnd(),A=pt(this,Dn).map(_e=>{var Te;const[pe,de,Pe,Le]=typeof _e=="string"?dn(Te=Ks,qo,rm).call(Te,_e,pt(this,bs),y):_e.toRegExpSource(t);return tn(this,bs,pt(this,bs)||Pe),tn(this,lo,pt(this,lo)||Le),pe}).join("");let L="";if(this.isStart()&&typeof pt(this,Dn)[0]=="string"&&!(pt(this,Dn).length===1&&Yb.has(pt(this,Dn)[0]))){const pe=Qb,de=i&&pe.has(A.charAt(0))||A.startsWith("\\.")&&pe.has(A.charAt(2))||A.startsWith("\\.\\.")&&pe.has(A.charAt(4)),Pe=!i&&!t&&pe.has(A.charAt(0));L=de?Gb:Pe?Lc:""}let z="";return this.isEnd()&&pt(pt(this,is),Oo)&&pt(this,Gn)?.type==="!"&&(z="(?:$|\\/)"),[L+A+z,Ll(A),tn(this,bs,!!pt(this,bs)),pt(this,lo)]}const n=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:";let l=dn(this,ba,pd).call(this,i);if(this.isStart()&&this.isEnd()&&!l&&this.type!=="!"){const y=this.toString();return tn(this,Dn,[y]),this.type=null,tn(this,bs,void 0),[y,Ll(this.toString()),!1,!1]}let u=!n||t||i||!Lc?"":dn(this,ba,pd).call(this,!0);u===l&&(u=""),u&&(l=`(?:${l})(?:${u})*?`);let m="";if(this.type==="!"&&pt(this,Pl))m=(this.isStart()&&!i?Lc:"")+Hh;else{const y=this.type==="!"?"))"+(this.isStart()&&!i&&!t?Lc:"")+Nh+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&u?")":this.type==="*"&&u?")?":`)${this.type}`;m=s+l+y}return[m,Ll(l),tn(this,bs,!!pt(this,bs)),pt(this,lo)]}};is=new WeakMap,bs=new WeakMap,lo=new WeakMap,Dn=new WeakMap,Gn=new WeakMap,Do=new WeakMap,ga=new WeakMap,Oo=new WeakMap,Gr=new WeakMap,va=new WeakMap,Pl=new WeakMap,ba=new WeakSet,sm=function(){if(this!==pt(this,is))throw new Error("should only call on root");if(pt(this,Oo))return this;this.toString(),tn(this,Oo,!0);let t;for(;t=pt(this,ga).pop();){if(t.type!=="!")continue;let i=t,n=pt(i,Gn);for(;n;){for(let s=pt(i,Do)+1;!n.type&&s<pt(n,Dn).length;s++)for(const l of pt(t,Dn)){if(typeof l=="string")throw new Error("string part in extglob AST??");l.copyIn(pt(n,Dn)[s])}i=n,n=pt(i,Gn)}}return this},qo=new WeakSet,Gc=function(t,i,n,s){var _e,pe;let l=!1,u=!1,m=-1,y=!1;if(i.type===null){let de=n,Pe="";for(;de<t.length;){const Le=t.charAt(de++);if(l||Le==="\\"){l=!l,Pe+=Le;continue}if(u){de===m+1?(Le==="^"||Le==="!")&&(y=!0):Le==="]"&&!(de===m+2&&y)&&(u=!1),Pe+=Le;continue}else if(Le==="["){u=!0,m=de,y=!1,Pe+=Le;continue}if(!s.noext&&Ih(Le)&&t.charAt(de)==="("){i.push(Pe),Pe="";const Te=new Ks(Le,i);de=dn(_e=Ks,qo,Gc).call(_e,t,Te,de,s),i.push(Te);continue}Pe+=Le}return i.push(Pe),de}let A=n+1,L=new Ks(null,i);const z=[];let X="";for(;A<t.length;){const de=t.charAt(A++);if(l||de==="\\"){l=!l,X+=de;continue}if(u){A===m+1?(de==="^"||de==="!")&&(y=!0):de==="]"&&!(A===m+2&&y)&&(u=!1),X+=de;continue}else if(de==="["){u=!0,m=A,y=!1,X+=de;continue}if(Ih(de)&&t.charAt(A)==="("){L.push(X),X="";const Pe=new Ks(de,L);L.push(Pe),A=dn(pe=Ks,qo,Gc).call(pe,t,Pe,A,s);continue}if(de==="|"){L.push(X),X="",z.push(L),L=new Ks(null,i);continue}if(de===")")return X===""&&pt(i,Dn).length===0&&tn(i,Pl,!0),L.push(X),X="",i.push(...z,L),A;X+=de}return i.type=null,tn(i,bs,void 0),tn(i,Dn,[t.substring(n-1)]),A},pd=function(t){return pt(this,Dn).map(i=>{if(typeof i=="string")throw new Error("string type in extglob ast??");const[n,s,l,u]=i.toRegExpSource(t);return tn(this,lo,pt(this,lo)||u),n}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")},rm=function(t,i,n=!1){let s=!1,l="",u=!1;for(let m=0;m<t.length;m++){const y=t.charAt(m);if(s){s=!1,l+=(Jb.has(y)?"\\":"")+y;continue}if(y==="\\"){m===t.length-1?l+="\\\\":s=!0;continue}if(y==="["){const[A,L,z,X]=Kb(t,m);if(z){l+=A,u=u||L,m+=z-1,i=i||X;continue}}if(y==="*"){n&&t==="*"?l+=Hh:l+=Nh,i=!0;continue}if(y==="?"){l+=sd,i=!0;continue}l+=Zb(y)}return[l,Ll(t),!!i,u]},wn(Ks,qo);let Rc=Ks;const e_=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),Os=(e,t,i={})=>(Tc(t),!i.nocomment&&t.charAt(0)==="#"?!1:new Mc(t,i).match(e)),t_=/^\*+([^+@!?\*\[\(]*)$/,i_=e=>t=>!t.startsWith(".")&&t.endsWith(e),n_=e=>t=>t.endsWith(e),s_=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),r_=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),o_=/^\*+\.\*+$/,a_=e=>!e.startsWith(".")&&e.includes("."),l_=e=>e!=="."&&e!==".."&&e.includes("."),c_=/^\.\*+$/,u_=e=>e!=="."&&e!==".."&&e.startsWith("."),d_=/^\*+$/,f_=e=>e.length!==0&&!e.startsWith("."),h_=e=>e.length!==0&&e!=="."&&e!=="..",m_=/^\?+([^+@!?\*\[\(]*)?$/,p_=([e,t=""])=>{const i=Bh([e]);return t?(t=t.toLowerCase(),n=>i(n)&&n.toLowerCase().endsWith(t)):i},g_=([e,t=""])=>{const i=$h([e]);return t?(t=t.toLowerCase(),n=>i(n)&&n.toLowerCase().endsWith(t)):i},v_=([e,t=""])=>{const i=$h([e]);return t?n=>i(n)&&n.endsWith(t):i},b_=([e,t=""])=>{const i=Bh([e]);return t?n=>i(n)&&n.endsWith(t):i},Bh=([e])=>{const t=e.length;return i=>i.length===t&&!i.startsWith(".")},$h=([e])=>{const t=e.length;return i=>i.length===t&&i!=="."&&i!==".."},Uh=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Vh={win32:{sep:"\\"},posix:{sep:"/"}},__=Uh==="win32"?Vh.win32.sep:Vh.posix.sep;Os.sep=__;const Cr=Symbol("globstar **");Os.GLOBSTAR=Cr;const y_="[^/]"+"*?",w_="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",S_="(?:(?!(?:\\/|^)\\.).)*?",x_=(e,t={})=>i=>Os(i,e,t);Os.filter=x_;const kr=(e,t={})=>Object.assign({},e,t),j_=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Os;const t=Os;return Object.assign((n,s,l={})=>t(n,s,kr(e,l)),{Minimatch:class extends t.Minimatch{constructor(s,l={}){super(s,kr(e,l))}static defaults(s){return t.defaults(kr(e,s)).Minimatch}},AST:class extends t.AST{constructor(s,l,u={}){super(s,l,kr(e,u))}static fromGlob(s,l={}){return t.AST.fromGlob(s,kr(e,l))}},unescape:(n,s={})=>t.unescape(n,kr(e,s)),escape:(n,s={})=>t.escape(n,kr(e,s)),filter:(n,s={})=>t.filter(n,kr(e,s)),defaults:n=>t.defaults(kr(e,n)),makeRe:(n,s={})=>t.makeRe(n,kr(e,s)),braceExpand:(n,s={})=>t.braceExpand(n,kr(e,s)),match:(n,s,l={})=>t.match(n,s,kr(e,l)),sep:t.sep,GLOBSTAR:Cr})};Os.defaults=j_;const Wh=(e,t={})=>(Tc(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ub(e));Os.braceExpand=Wh;const E_=(e,t={})=>new Mc(e,t).makeRe();Os.makeRe=E_;const A_=(e,t,i={})=>{const n=new Mc(t,i);return e=e.filter(s=>n.match(s)),n.options.nonull&&!e.length&&e.push(t),e};Os.match=A_;const zh=/[?*]|[+@!]\(.*?\)|\[|\]/,C_=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Mc{constructor(t,i={}){rs(this,"options");rs(this,"set");rs(this,"pattern");rs(this,"windowsPathsNoEscape");rs(this,"nonegate");rs(this,"negate");rs(this,"comment");rs(this,"empty");rs(this,"preserveMultipleSlashes");rs(this,"partial");rs(this,"globSet");rs(this,"globParts");rs(this,"nocase");rs(this,"isWindows");rs(this,"platform");rs(this,"windowsNoMagicRoot");rs(this,"regexp");Tc(t),i=i||{},this.options=i,this.pattern=t,this.platform=i.platform||Uh,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!i.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!i.nonegate,this.comment=!1,this.empty=!1,this.partial=!!i.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=i.windowsNoMagicRoot!==void 0?i.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const i of t)if(typeof i!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,i=this.options;if(!i.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],i.debug&&(this.debug=(...l)=>console.error(...l)),this.debug(this.pattern,this.globSet);const n=this.globSet.map(l=>this.slashSplit(l));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let s=this.globParts.map((l,u,m)=>{if(this.isWindows&&this.windowsNoMagicRoot){const y=l[0]===""&&l[1]===""&&(l[2]==="?"||!zh.test(l[2]))&&!zh.test(l[3]),A=/^[a-z]:/i.test(l[0]);if(y)return[...l.slice(0,4),...l.slice(4).map(L=>this.parse(L))];if(A)return[l[0],...l.slice(1).map(L=>this.parse(L))]}return l.map(y=>this.parse(y))});if(this.debug(this.pattern,s),this.set=s.filter(l=>l.indexOf(!1)===-1),this.isWindows)for(let l=0;l<this.set.length;l++){const u=this.set[l];u[0]===""&&u[1]===""&&this.globParts[l][2]==="?"&&typeof u[3]=="string"&&/^[a-z]:$/i.test(u[3])&&(u[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let s=0;s<t[n].length;s++)t[n][s]==="**"&&(t[n][s]="*");const{optimizationLevel:i=1}=this.options;return i>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):i>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(i=>{let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let s=n;for(;i[s+1]==="**";)s++;s!==n&&i.splice(n,s-n)}return i})}levelOneOptimize(t){return t.map(i=>(i=i.reduce((n,s)=>{const l=n[n.length-1];return s==="**"&&l==="**"?n:s===".."&&l&&l!==".."&&l!=="."&&l!=="**"?(n.pop(),n):(n.push(s),n)},[]),i.length===0?[""]:i))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let i=!1;do{if(i=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const l=t[s];s===1&&l===""&&t[0]===""||(l==="."||l==="")&&(i=!0,t.splice(s,1),s--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(i=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){const s=t[n-1];s&&s!=="."&&s!==".."&&s!=="**"&&(i=!0,t.splice(n-1,2),n-=2)}}while(i);return t.length===0?[""]:t}firstPhasePreProcess(t){let i=!1;do{i=!1;for(let n of t){let s=-1;for(;(s=n.indexOf("**",s+1))!==-1;){let u=s;for(;n[u+1]==="**";)u++;u>s&&n.splice(s+1,u-s);let m=n[s+1];const y=n[s+2],A=n[s+3];if(m!==".."||!y||y==="."||y===".."||!A||A==="."||A==="..")continue;i=!0,n.splice(s,1);const L=n.slice(0);L[s]="**",t.push(L),s--}if(!this.preserveMultipleSlashes){for(let u=1;u<n.length-1;u++){const m=n[u];u===1&&m===""&&n[0]===""||(m==="."||m==="")&&(i=!0,n.splice(u,1),u--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(i=!0,n.pop())}let l=0;for(;(l=n.indexOf("..",l+1))!==-1;){const u=n[l-1];if(u&&u!=="."&&u!==".."&&u!=="**"){i=!0;const y=l===1&&n[l+1]==="**"?["."]:[];n.splice(l-1,2,...y),n.length===0&&n.push(""),l-=2}}}}while(i);return t}secondPhasePreProcess(t){for(let i=0;i<t.length-1;i++)for(let n=i+1;n<t.length;n++){const s=this.partsMatch(t[i],t[n],!this.preserveMultipleSlashes);if(s){t[i]=[],t[n]=s;break}}return t.filter(i=>i.length)}partsMatch(t,i,n=!1){let s=0,l=0,u=[],m="";for(;s<t.length&&l<i.length;)if(t[s]===i[l])u.push(m==="b"?i[l]:t[s]),s++,l++;else if(n&&t[s]==="**"&&i[l]===t[s+1])u.push(t[s]),s++;else if(n&&i[l]==="**"&&t[s]===i[l+1])u.push(i[l]),l++;else if(t[s]==="*"&&i[l]&&(this.options.dot||!i[l].startsWith("."))&&i[l]!=="**"){if(m==="b")return!1;m="a",u.push(t[s]),s++,l++}else if(i[l]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(m==="a")return!1;m="b",u.push(i[l]),s++,l++}else return!1;return t.length===i.length&&u}parseNegate(){if(this.nonegate)return;const t=this.pattern;let i=!1,n=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)i=!i,n++;n&&(this.pattern=t.slice(n)),this.negate=i}matchOne(t,i,n=!1){const s=this.options;if(this.isWindows){const de=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),Pe=!de&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),Le=typeof i[0]=="string"&&/^[a-z]:$/i.test(i[0]),Te=!Le&&i[0]===""&&i[1]===""&&i[2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3]),He=Pe?3:de?0:void 0,U=Te?3:Le?0:void 0;if(typeof He=="number"&&typeof U=="number"){const[Se,ze]=[t[He],i[U]];Se.toLowerCase()===ze.toLowerCase()&&(i[U]=Se,U>He?i=i.slice(U):He>U&&(t=t.slice(He)))}}const{optimizationLevel:l=1}=this.options;l>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:i}),this.debug("matchOne",t.length,i.length);for(var u=0,m=0,y=t.length,A=i.length;u<y&&m<A;u++,m++){this.debug("matchOne loop");var L=i[m],z=t[u];if(this.debug(i,L,z),L===!1)return!1;if(L===Cr){this.debug("GLOBSTAR",[i,L,z]);var X=u,_e=m+1;if(_e===A){for(this.debug("** at the end");u<y;u++)if(t[u]==="."||t[u]===".."||!s.dot&&t[u].charAt(0)===".")return!1;return!0}for(;X<y;){var pe=t[X];if(this.debug(`
./output/gitee_run/gitee.com_4_after_login.html:41:<link href="//files.gitee.com" rel="dns-prefetch"/>
./output/gitee_run/gitee.com_1_initial_page.html:41:<link href="//files.gitee.com" rel="dns-prefetch"/>
./output/gitee_run/gitee.com_3_credentials_filled.html:41:<link href="//files.gitee.com" rel="dns-prefetch"/>
./src/main/java/com/fxsb/designscreenshot/controller/admin/file/FileController.java:52:    @PostMapping("/upload-url")
./rust-backend/src/main.rs:1088:    let admin_username=env::var("ADMIN_USERNAME").unwrap_or_else(|_|"admin".into()).trim().to_string();
./rust-backend/src/main.rs:1089:    let admin_password=env::var("ADMIN_PASSWORD").context("ADMIN_PASSWORD is required")?;
./rust-backend/src/main.rs:1090:    if admin_username.is_empty() { anyhow::bail!("ADMIN_USERNAME must not be empty"); }
./rust-backend/src/main.rs:1091:    if admin_password.len() < 8 { anyhow::bail!("ADMIN_PASSWORD must contain at least 8 characters"); }
./rust-backend/src/main.rs:1092:    if admin_password.len() < 20 { warn!("ADMIN_PASSWORD is shorter than the recommended 20 characters"); }
./rust-backend/src/main.rs:1096:    let file_public_base_url=env::var("FILE_PUBLIC_BASE_URL").unwrap_or_else(|_|"https://api.beenglish.eu.org/DesignScreenshot/files".into()).trim_end_matches('/').to_string();
./rust-backend/src/main.rs:1135:        .route("/infra/file/upload-url",post(upload_url)).route("/infra/file/delete",delete(delete_file));
./rust-backend/src/main.rs:1145:    let app=Router::new().route("/health",get(health)).route("/doc.html",get(health)).nest_service("/files",ServeDir::new(file_storage_dir)).nest("/admin-api",api).layer(DefaultBodyLimit::max(100*1024*1024)).layer(cors).layer(TraceLayer::new_for_http()).layer(middleware::from_fn_with_state(state.clone(),enforce_ip_allowlist)).with_state(state);
./rust-backend/README.md:14:Copy `.env.example` to `/root/DesignScreenshot/.env.rust` on the server and set `DATABASE_URL` and `ADMIN_PASSWORD`. The deployment script validates these values before stopping the running service.
./rust-backend/README.md:19:- `ADMIN_USERNAME`: the only login account, default `admin`.
./rust-backend/README.md:20:- `ADMIN_PASSWORD`: password for the configured administrator account. Required, minimum 8 characters; 20+ random characters are recommended.
./rust-backend/README.md:30:- `FILE_PUBLIC_BASE_URL`: public URL prefix used in `infra_file.url`, default `https://api.beenglish.eu.org/DesignScreenshot/files`.
./rust-backend/README.md:48:- Login credentials are read only from `ADMIN_USERNAME`/`ADMIN_PASSWORD`; `system_users.password` is no longer consulted for login.
./rust-backend/README.md:54:- File uploads are written directly to `FILE_STORAGE_DIR`; the Rust service exposes the directory at `/files` and continues writing `infra_file` records. MinIO/S3 is not required at runtime.
./rust-backend/README.md:55:- `/infra/file/upload-url` returns `{ url, id }` inside `data` because the current Vue upload component reads `res.url`. This intentionally fixes the legacy Java controller's string-only response mismatch.
./processID.sh:31:if [ -z "${ADMIN_PASSWORD:-}" ] || [ "${#ADMIN_PASSWORD}" -lt 8 ]; then
./processID.sh:32:  echo "ADMIN_PASSWORD with at least 8 characters is required in ${ENV_FILE}."
