!function(e){var t={};function a(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=t,a.d=function(e,t,i){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(a.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(i,n,function(t){return e[t]}.bind(null,n));return i},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=0)}([function(e,t){function a(e){return jQuery("
").text(e).html()}var i,n,o,r,s;function c(e){var t=e.find(".tabular.menu");t.find(".item").tab(),t.find('.item[data-tab="'.concat(t.data("preview"),'"]')).click((function(){var a=$(this);$.post(a.data("url"),{_csrf:i,mode:"gfm",context:a.data("context"),text:e.find('.tab.segment[data-tab="'.concat(t.data("write"),'"] textarea')).val()},(function(a){var i=e.find('.tab.segment[data-tab="'.concat(t.data("preview"),'"]'));i.html(a),emojify.run(i[0]),$("pre code",i[0]).each((function(){hljs.highlightBlock(this)}))}))})),w()}function l(){var e,t;0!==$(".edit.form").length&&(!function(e){var t=e.find(".tabular.menu");t.find(".item").tab();var a=t.find('.item[data-tab="'.concat(t.data("preview"),'"]'));a.length&&(o=a.data("preview-file-modes").split(","),a.click((function(){var a=$(this);$.post(a.data("url"),{_csrf:i,mode:"gfm",context:a.data("context"),text:e.find('.tab.segment[data-tab="'.concat(t.data("write"),'"] textarea')).val()},(function(a){var i=e.find('.tab.segment[data-tab="'.concat(t.data("preview"),'"]'));i.html(a),emojify.run(i[0]),$("pre code",i[0]).each((function(){hljs.highlightBlock(this)}))}))})))}($(".edit.form")),e=$(".edit.form"),(t=e.find(".tabular.menu")).find(".item").tab(),t.find('.item[data-tab="'.concat(t.data("diff"),'"]')).click((function(){var a=$(this);$.post(a.data("url"),{_csrf:i,context:a.data("context"),content:e.find('.tab.segment[data-tab="'.concat(t.data("write"),'"] textarea')).val()},(function(a){var i=e.find('.tab.segment[data-tab="'.concat(t.data("diff"),'"]'));i.html(a),emojify.run(i[0])}))})))}function d(e,t,a,n){return new Promise((function(o){$.ajax({type:"POST",url:e,data:{_csrf:i,action:t,issue_ids:a,id:n},success:o})}))}function u(){window.location.reload()}function h(e){e.each((function(){var e=this;e.addEventListener("paste",(function(t){!function(e,t){if(e.clipboardData){var a=e.clipboardData.items;if(void 0!==a)for(var i=0;i')).val(i.uuid);$(".files").append(o)}))}))}),!1)}))}function f(){var e;0!==$(".comment.form").length&&((e=$(".ui.select-branch")).find(".reference-list-menu").find(".item:not(.no-select)").click((function(){var t=$(this).data("id");$($(this).data("id-selector")).val(t),e.find(".ui .branch-name").text(t)})),e.find(".reference.column").click((function(){return e.find(".scrolling.reference-list-menu").css("display","none"),e.find(".reference .text").removeClass("black"),$($(this).data("target")).css("display","block"),$(this).find(".text").addClass("black"),!1})),c($(".comment.form")),h($(".comment.form textarea")),t("select-label","labels"),t("select-assignees","assignees"),t("select-assignees-modify","assignees"),i(".select-milestone","#milestone_id"),i(".select-assignee","#assignee_id"));function t(e,t){var a=$(".ui.".concat(t,".list")),i=a.find(".no-select"),n=$(".".concat(e," .menu")),o="update"===n.data("action"),r={};$(".".concat(e)).dropdown("setting","onHide",(function(){if(o="update"===n.data("action")){var e=[];Object.keys(r).forEach((function(t){var a=r[t],i=d(a["update-url"],a.action,a["issue-id"],t);e.push(i)})),Promise.all(e).then(u)}})),n.find(".item:not(.no-select)").click((function(){if("select-assignees-modify"===e)return $(this).hasClass("checked")?($(this).removeClass("checked"),$(this).find(".octicon").removeClass("octicon-check")):($(this).addClass("checked"),$(this).find(".octicon").addClass("octicon-check")),d(n.data("update-url"),"",n.data("issue-id"),$(this).data("id")),n.data("action","update"),!1;$(this).hasClass("checked")?($(this).removeClass("checked"),$(this).find(".octicon").removeClass("octicon-check"),o&&($(this).data("id")in r?delete r[$(this).data("id")]:r[$(this).data("id")]={"update-url":n.data("update-url"),action:"detach","issue-id":n.data("issue-id")})):($(this).addClass("checked"),$(this).find(".octicon").addClass("octicon-check"),o&&($(this).data("id")in r?delete r[$(this).data("id")]:r[$(this).data("id")]={"update-url":n.data("update-url"),action:"attach","issue-id":n.data("issue-id")}));var t=[];return $(this).parent().find(".item").each((function(){$(this).hasClass("checked")?(t.push($(this).data("id")),$($(this).data("id-selector")).removeClass("hide")):$($(this).data("id-selector")).addClass("hide")})),0===t.length?i.removeClass("hide"):i.addClass("hide"),$($(this).parent().data("id")).val(t.join(",")),!1})),n.find(".no-select.item").click((function(){(o||"select-assignees-modify"===e)&&d(n.data("update-url"),"clear",n.data("issue-id"),"").then(u),$(this).parent().find(".item").each((function(){$(this).removeClass("checked"),$(this).find(".octicon").removeClass("octicon-check")})),a.find(".item").each((function(){$(this).addClass("hide")})),i.removeClass("hide"),$($(this).parent().data("id")).val("")}))}function i(e,t){var i=$("".concat(e," .menu")),n=$(".ui".concat(e,".list")),o="update"===i.data("action");i.find(".item:not(.no-select)").click((function(){switch($(this).parent().find(".item").each((function(){$(this).removeClass("selected active")})),$(this).addClass("selected active"),o&&d(i.data("update-url"),"",i.data("issue-id"),$(this).data("id")).then(u),t){case"#milestone_id":n.find(".selected").html('')).val(t.uuid);s.append(a)})),this.on("removedfile",(function(e){e.name in l&&($("#".concat(l[e.name].uuid)).remove(),r.data("remove-url")&&r.data("csrf")&&!l[e.name].submitted&&$.post(r.data("remove-url"),{file:l[e.name].uuid,_csrf:r.data("csrf")}))})),this.on("submit",(function(){$.each(l,(function(e){l[e].submitted=!0}))})),this.on("reload",(function(){$.getJSON(a.data("attachment-url"),(function(e){var t=r.get(0).dropzone;t.removeAllFiles(!0),s.empty(),$.each(e,(function(){var e="".concat(r.data("upload-url"),"/").concat(this.uuid);t.emit("addedfile",this),t.emit("thumbnail",this,e),t.emit("complete",this),t.files.push(this),l[this.name]={submitted:!0,uuid:this.uuid},r.find("img[src='".concat(e,"']")).css("max-width","100%");var a=$('')).val(this.uuid);s.append(a)}))}))}))}}),r.get(0).dropzone.emit("reload")}var d=a.find(".ui.comment.form"),u=d.find(".tabular.menu");u.attr("data-write",a.data("write")),u.attr("data-preview",a.data("preview")),u.find(".write.item").attr("data-tab",a.data("write")),u.find(".preview.item").attr("data-tab",a.data("preview")),d.find(".write.segment").attr("data-tab",a.data("write")),d.find(".preview.segment").attr("data-tab",a.data("preview")),c(d),a.find(".cancel.button").click((function(){n.show(),a.hide(),r.get(0).dropzone.emit("reload")})),a.find(".save.button").click((function(){n.show(),a.hide();var o=s.find("[name=files]").map((function(){return $(this).val()})).get();$.post(a.data("update-url"),{_csrf:i,content:e.val(),context:a.data("context"),files:o},(function(e){0===e.length?n.html($("#no-content").html()):(n.html(e.content),emojify.run(n[0]),$("pre code",n[0]).each((function(){hljs.highlightBlock(this)})));var a=t.parent();a.find(".ui.small.images").length?""===e.attachments?a.find(".ui.small.images").parent().remove():a.find(".ui.small.images").html(e.attachments):""!==e.attachments&&(a.append('
'),a.find(".ui.small.images").html(e.attachments)),r.get(0).dropzone.emit("submit"),r.get(0).dropzone.emit("reload")}))}))}else e=t.find("textarea");return a.show(),n.hide(),0===e.val().length&&e.val(o.text()),e.focus(),!1})),$(".delete-comment").click((function(){var e=$(this);return window.confirm(e.data("locale"))&&$.post(e.data("url"),{_csrf:i}).success((function(){$("#".concat(e.data("comment-id"))).remove()})),!1}));var r=$("#status-button");$("#comment-form .edit_area").keyup((function(){0===$(this).val().length?r.text(r.data("status")):r.text(r.data("status-and-comment"))})),r.click((function(){$("#status").val(r.data("status-val")),$("#comment-form").submit()}));var s=$(".merge-button > button");s.on("click",(function(e){e.preventDefault(),$(".".concat($(this).data("do"),"-fields")).show(),$(this).parent().hide()})),$(".merge-button > .dropdown").dropdown({onChange:function(e,t,a){a.data("do")&&(s.find(".button-text").text(a.text()),s.data("do",a.data("do")))}}),$(".merge-cancel").on("click",(function(e){e.preventDefault(),$(this).closest(".form").hide(),s.parent().show()})),function e(t){var a="";t||(t=$(document),a=".reactions > "),t.find("".concat(a,"a.label")).popup({position:"bottom left",metadata:{content:"title",title:"none"}}),t.find(".select-reaction > .menu > .item, ".concat(a,"a.label")).on("click",(function(t){var a=this;if(t.preventDefault(),!$(this).hasClass("disabled")){var n=$(this).hasClass("item")?$(this).closest(".select-reaction").data("action-url"):$(this).data("action-url"),o="".concat(n,"/").concat($(this).hasClass("blue")?"unreact":"react");$.ajax({type:"POST",url:o,data:{_csrf:i,content:$(this).data("content")}}).done((function(t){if(t&&(t.html||t.empty)){var i=$(a).closest(".content"),n=i.find(".segment.reactions");if(!t.empty&&n.length>0&&n.remove(),!t.empty){n=$('
');var o=i.find(".segment.bottom:first");o.length>0?n.insertBefore(o):n.appendTo(i),n.html(t.html);for(var r=n.find(".has-emoji"),s=0;s0&&$(".diff-counter").each((function(){var e=$(this),t=e.find("span[data-line].add").data("line"),a=e.find("span[data-line].del").data("line"),i=parseFloat(t)/(parseFloat(t)+parseFloat(a))*100;e.find(".bar .add").css("width","".concat(i,"%"))})),$("#repo-clone-ssh").click((function(){$(".clone-url").text($(this).data("link")),$("#repo-clone-url").val($(this).data("link")),$(this).addClass("blue"),$("#repo-clone-https").removeClass("blue"),localStorage.setItem("repo-clone-protocol","ssh")})),$("#repo-clone-https").click((function(){$(".clone-url").text($(this).data("link")),$("#repo-clone-url").val($(this).data("link")),$(this).addClass("blue"),$("#repo-clone-ssh").removeClass("blue"),localStorage.setItem("repo-clone-protocol","https")})),$("#repo-clone-url").click((function(){$(this).select()}));var l=$(".repository.compare.pull");l.length>0&&(d(".choose.branch .dropdown"),l.find("button.show-form").on("click",(function(e){e.preventDefault(),l.find(".pullrequest-form").show(),$(this).parent().hide()}))),$(".repository.settings.branches").length>0&&(d(".protected-branches .dropdown"),$(".enable-protection, .enable-whitelist").change((function(){this.checked?$($(this).data("target")).removeClass("disabled"):$($(this).data("target")).addClass("disabled")})))}function d(e){var t=$(e);t.dropdown({fullTextSearch:!0,selectOnKeydown:!1,onChange:function(e,t,a){a.data("url")&&(window.location.href=a.data("url"))},message:{noResults:t.data("no-results")}})}}function m(e){var t=Math.floor(Math.random()*Math.floor(1e6));return e.attr("data-write",e.attr("data-write")+t),e.attr("data-preview",e.attr("data-preview")+t),e.find(".item").each((function(){var e=$(this).attr("data-tab")+t;$(this).attr("data-tab",e)})),e.parent().find("*[data-tab='write']").attr("data-tab","write".concat(t)),e.parent().find("*[data-tab='preview']").attr("data-tab","preview".concat(t)),c(e.parent(".form")),t}function v(){$(".access-mode.menu .item").click((function(){var e=$(this).parent();$.post(e.data("url"),{_csrf:i,uid:e.data("uid"),mode:$(this).data("value")})}))}function g(){$(".js-quick-pull-choice-option").change((function(){"commit-to-new-branch"===$(this).val()?($(".quick-pull-branch-name").show(),$(".quick-pull-branch-name input").prop("required",!0)):($(".quick-pull-branch-name").hide(),$(".quick-pull-branch-name input").prop("required",!1)),$("#commit-button").text($(this).attr("button_text"))}));var e=$("#file-name");e.keyup((function(e){var t,a,i=$(".breadcrumb span.section"),n=$(".breadcrumb div.divider");if(8===e.keyCode&&0===$(this).getCursorPosition()&&i.length>0&&(t=i.last().find("a").text(),$(this).val(t+$(this).val()),$(this)[0].setSelectionRange(t.length,t.length),i.last().remove(),n.last().remove()),191===e.keyCode){a=$(this).val().split("/");for(var o=0;o
'.concat(t,"")).insertBefore($(this)),$('
/
').insertBefore($(this))):$(this).val(t),$(this)[0].setSelectionRange(0,0)}a=[],$(".breadcrumb span.section").each((function(){var e=$(this);e.find("a").length?a.push(e.find("a").text()):a.push(e.text())})),$(this).val()&&a.push($(this).val()),$("#tree_path").val(a.join("/"))})).trigger("keyup");var t=$(".repository.editor textarea#edit_area");if(t.length){var a=t.data("markdown-file-exts").split(","),n=t.data("line-wrap-extensions").split(",");e.on("keyup",(function(){var c,l,d,u,h,f,p=e.val();d=u="";var m=/.+\.([^.]+)$/.exec(p);m&&(d=m[1],u=".".concat(d));var v=CodeMirror.findModeByExtension(d),g=$("a[data-tab=preview]");if(v?(c=v.mode,l=v.mime,f=c):f=d,g.length&&f&&o&&o.length&&o.indexOf(f)>=0?(h=g.data("url"),g.data("url",h.replace(/(.*)\/.*/i,"$1/".concat(c))),g.show()):g.hide(),!(a.indexOf(u)>=0&&function(e){return s&&(s.toTextArea(),s=null),!!r||(r=new SimpleMDE({autoDownloadFontAwesome:!1,element:e[0],forceSync:!0,renderingConfig:{singleLineBreaks:!1},indentWithTabs:!1,tabSize:4,spellChecker:!1,previewRender:function(t,a){return setTimeout((function(){$.post(e.data("url"),{_csrf:i,mode:"gfm",context:e.data("context"),text:t},(function(e){a.innerHTML='
'.concat(e,"
"),emojify.run($(".editor-preview")[0])}))}),0),"Loading..."},toolbar:["bold","italic","strikethrough","|","heading-1","heading-2","heading-3","heading-bigger","heading-smaller","|","code","quote","|","unordered-list","ordered-list","|","link","image","table","horizontal-rule","|","clean-block","preview","fullscreen","side-by-side"]}),!0)}(t))&&(s||function(e){return r&&(r.toTextArea(),r=null),!!s||((s=CodeMirror.fromTextArea(e[0],{lineNumbers:!0})).on("change",(function(t,a){e.val(t.getValue())})),!0)}(t))){c&&(s.setOption("mode",l),CodeMirror.autoLoadMode(s,c)),n.indexOf(u)>=0?s.setOption("lineWrapping",!0):s.setOption("lineWrapping",!1);var b=e.val();0!==b.length&&(b=(b=b.split("/"))[b.length-1],$.getJSON(e.data("ec-url-prefix")+b,(function(e){"tab"===e.indent_style?(s.setOption("indentWithTabs",!0),s.setOption("extraKeys",{})):(s.setOption("indentWithTabs",!1),s.setOption("extraKeys",{Tab:function(e){var t=Array(parseInt(e.getOption("indentUnit"))+1).join(" ");e.replaceSelection(t)}})),s.setOption("indentUnit",e.indent_size||4),s.setOption("tabSize",e.tab_width||4)})))}})).trigger("keyup");var c=$("#commit-button"),l=$(".ui.edit.form");c.prop("disabled",!0),l.areYouSure({silent:!0,dirtyClass:"dirty-file",fieldSelector:":input:not(.commit-form-wrapper :input)",change:function(){var e=$(this).hasClass("dirty-file");c.prop("disabled",!e)}}),c.click((function(e){0===t.val().length&&($("#edit-empty-content-modal").modal({onApprove:function(){$(".edit.form").submit()}}).modal("show"),e.preventDefault())}))}}function b(){$(".user.settings.profile").length>0&&$("#username").keyup((function(){var e=$("#name-change-prompt");$(this).val().toString().toLowerCase()!==$(this).data("name").toString().toLowerCase()?e.show():e.hide()}))}function w(){$(".ui.button").keypress((function(e){13!==e.keyCode&&32!==e.keyCode||$(this).click()}))}function k(){$(".code-view .linenums").length>0&&($(document).on("click",".lines-num span",(function(e){var t=$(this),a=t.parent().siblings(".lines-code").find("ol.linenums > li");q(a,a.filter("[rel=".concat(t.attr("id"),"]")),e.shiftKey?a.filter(".active").eq(0):null),window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()})),$(window).on("hashchange",(function(){var e,t=window.location.hash.match(/^#(L\d+)-(L\d+)$/),a=$(".code-view ol.linenums > li");if(t)return e=a.filter(".".concat(t[1])),q(a,e,a.filter(".".concat(t[2]))),void $("html, body").scrollTop(e.offset().top-200);(t=window.location.hash.match(/^#(L|n)(\d+)$/))&&(e=a.filter(".L".concat(t[2])),q(a,e),$("html, body").scrollTop(e.offset().top-200))})).trigger("hashchange"))}function _(e){$.ajax({url:"".concat(n,"/user/u2f/sign"),type:"POST",headers:{"X-Csrf-Token":i},data:JSON.stringify(e),contentType:"application/json; charset=utf-8"}).done((function(e){window.location.replace(e)})).fail((function(){C(1)}))}function y(e){(function(e){if(!("errorCode"in e))return!1;if(0===e.errorCode)return!1;return C(e.errorCode),!0})(e)||$.ajax({url:"".concat(n,"/user/settings/security/u2f/register"),type:"POST",headers:{"X-Csrf-Token":i},data:JSON.stringify(e),contentType:"application/json; charset=utf-8",success:function(){u()},fail:function(){C(1)}})}function C(e){var t={browser:$("#unsupported-browser"),1:$("#u2f-error-1"),2:$("#u2f-error-2"),3:$("#u2f-error-3"),4:$("#u2f-error-4"),5:$(".u2f-error-5")};t[e].removeClass("hide"),Object.keys(t).forEach((function(a){a!==e&&t[a].addClass("hide")})),$("#u2f-error").modal("show")}function x(){$.post("".concat(n,"/user/settings/security/u2f/request_register"),{_csrf:i,name:$("#nickname").val()}).success((function(e){$("#nickname").closest("div.field").removeClass("error"),$("#register-device").modal("show"),null===e.registeredKeys&&(e.registeredKeys=[]),u2fApi.register(e.appId,e.registerRequests,e.registeredKeys,30).then(y).catch((function(e){C(void 0!==e?e.metaData.code:1)}))})).fail((function(e){409===e.status&&$("#nickname").closest("div.field").addClass("error")}))}function S(e){window.history.pushState?window.history.pushState(null,null,e):window.location.hash=e}function q(e,t,a){if(e.removeClass("active"),a){var i,n=parseInt(t.attr("rel").substr(1)),o=parseInt(a.attr("rel").substr(1));if(n!==o){n>o&&(i=n,n=o,o=i);for(var r=[],s=n;s<=o;s++)r.push(".L".concat(s));return e.filter(r.join(",")).addClass("active"),void S("#L".concat(n,"-L").concat(o))}}t.addClass("active"),S("#".concat(t.attr("rel")))}function T(){var e=$(this),t="";e.attr("id")&&(t+="#".concat(e.attr("id")));var a=$(".delete.modal".concat(t));return a.find(".name").text(e.data("name")),a.modal({closable:!1,onApprove:function(){"form"!==e.data("type")?$.post(e.data("url"),{_csrf:i,id:e.data("id")}).done((function(e){window.location.href=e.redirect})):$(e.data("form")).submit()}}).modal("show"),!1}function L(){var e=$(this),t="";e.attr("id")&&(t+="#".concat(e.attr("id")));var a=$(".addall.modal".concat(t));return a.find(".name").text(e.data("name")),a.modal({closable:!1,onApprove:function(){"form"!==e.data("type")?$.post(e.data("url"),{_csrf:i,id:e.data("id")}).done((function(e){window.location.href=e.redirect})):$(e.data("form")).submit()}}).modal("show"),!1}"undefined"!=typeof Dropzone&&(Dropzone.autoDiscover=!1),$.fn.getCursorPosition=function(){var e=$(this).get(0),t=0;if("selectionStart"in e)t=e.selectionStart;else if("selection"in document){e.focus();var a=document.selection.createRange(),i=document.selection.createRange().text.length;a.moveStart("character",-e.value.length),t=a.text.length-i}return t},$(document).ready((function(){if(i=$("meta[name=_csrf]").attr("content"),n=$("meta[name=_suburl]").attr("content"),$(".time-since").each((function(){$(this).addClass("poping up").attr("data-content",$(this).attr("title")).attr("data-variation","inverted tiny").attr("title","")})),$(".dropdown:not(.custom)").dropdown(),$(".jump.dropdown").dropdown({action:"hide",onShow:function(){$(".poping.up").popup("hide")}}),$(".slide.up.dropdown").dropdown({transition:"slide up"}),$(".upward.dropdown").dropdown({direction:"upward"}),$(".ui.accordion").accordion(),$(".ui.checkbox").checkbox(),$(".ui.progress").progress({showActivity:!1}),$(".poping.up").popup(),$(".top.menu .poping.up").popup({onShow:function(){if($(".top.menu .menu.transition").hasClass("visible"))return!1}}),$(".tabular.menu .item").tab(),$(".tabable.menu .item").tab(),$(".toggle.button").click((function(){$($(this).data("target")).slideToggle(100)})),$("tr[data-href]").click((function(){window.location=$(this).data("href")})),"undefined"!=typeof hljs)for(var e=[].slice.call(document.querySelectorAll("pre code")||[]),t=0;t0){var r={};new Dropzone("#dropzone",{url:o.data("upload-url"),headers:{"X-Csrf-Token":i},maxFiles:o.data("max-file"),maxFilesize:o.data("max-size"),acceptedFiles:"*/*"===o.data("accepts")?null:o.data("accepts"),addRemoveLinks:!0,dictDefaultMessage:o.data("default-message"),dictInvalidFileType:o.data("invalid-input-type"),dictFileTooBig:o.data("file-too-big"),dictRemoveFile:o.data("remove-file"),init:function(){this.on("success",(function(e,t){r[e.name]=t.uuid;var a=$('')).val(t.uuid);$(".files").append(a)})),this.on("removedfile",(function(e){e.name in r&&$("#".concat(r[e.name])).remove(),o.data("remove-url")&&o.data("csrf")&&$.post(o.data("remove-url"),{file:r[e.name],_csrf:o.data("csrf")})}))}})}emojify.setConfig({img_dir:"".concat(n,"/vendor/plugins/emojify/images"),ignore_emoticons:!0});for(var s=document.getElementsByClassName("has-emoji"),c=0;c0&&(i="".concat(a,"-").concat(e[a])),void 0===e[a]?e[a]=1:e[a]+=1,(t=t.wrap('
'))).append(''))}))})),$(".issue-checkbox").click((function(){$(".issue-checkbox").children("input:checked").length>0?($("#issue-filters").addClass("hide"),$("#issue-actions").removeClass("hide")):($("#issue-filters").removeClass("hide"),$("#issue-actions").addClass("hide"))})),$(".issue-action").click((function(){var e=this.dataset.action,t=this.dataset.elementId,a=$(".issue-checkbox").children("input:checked").map((function(){return this.dataset.issueId})).get().join(),i=this.dataset.url;"0"===t&&"/assignee"===i.substr(-9)&&(t="",e="clear"),d(i,e,a,t).then((function(){"close"!==e&&"open"!==e||$('.issue-checkbox input[type="checkbox"]').each((function(e,t){t.checked=!1})),u()}))})),$('.issue-checkbox input[type="checkbox"]:checked').first().each((function(e,t){t.checked=!1,$(t).click()})),w(),$("#search-user-box").search({minCharacters:2,apiSettings:{url:"".concat(n,"/api/v1/users/search?q={query}"),onResponse:function(e){var t=[];return $.each(e.data,(function(e,i){var n=i.login;i.full_name&&i.full_name.length>0&&(n+=" (".concat(a(i.full_name),")")),t.push({title:n,image:i.avatar_url})})),{results:t}}},searchFields:["login","full_name"],showNoResults:!1}),(y=$("#search-team-box")).search({minCharacters:2,apiSettings:{url:"".concat(n,"/api/v1/orgs/").concat(y.data("org"),"/teams/search?q={query}"),headers:{"X-Csrf-Token":i},onResponse:function(e){var t=[];return $.each(e.data,(function(e,a){var i="".concat(a.name," (").concat(a.permission," access)");t.push({title:i})})),{results:t}}},searchFields:["name","description"],showNoResults:!1}),(S=$("#search-repo-box")).search({minCharacters:2,apiSettings:{url:"".concat(n,"/api/v1/repos/search?q={query}&uid=").concat(S.data("uid")),onResponse:function(e){var t=[];return $.each(e.data,(function(e,a){t.push({title:a.full_name.split("/")[1],description:a.full_name})})),{results:t}}},searchFields:["full_name"],showNoResults:!1}),f(),0!==$(".install").length&&(""===$("#db_host").val()&&($("#db_host").val("127.0.0.1:3306"),$("#db_user").val("gitea"),$("#db_name").val("gitea")),$("#db_type").change((function(){var e=$(this).val();if("SQLite3"===e)return $("#sql_settings").hide(),$("#pgsql_settings").hide(),$("#mysql_settings").hide(),$("#sqlite_settings").show(),void("SQLite3"===e&&"data/gitea_tidb"===$("#db_path").val()&&$("#db_path").val("data/gitea.db"));var t={MySQL:"127.0.0.1:3306",PostgreSQL:"127.0.0.1:5432",MSSQL:"127.0.0.1:1433"};$("#sqlite_settings").hide(),$("#sql_settings").show(),$("#pgsql_settings").toggle("PostgreSQL"===e),$("#mysql_settings").toggle("MySQL"===e),$.each(t,(function(a,i){if($("#db_host").val()===i)return $("#db_host").val(t[e]),!1}))})),$("#offline-mode input").change((function(){$(this).is(":checked")&&($("#disable-gravatar").checkbox("check"),$("#federated-avatar-lookup").checkbox("uncheck"))})),$("#disable-gravatar input").change((function(){$(this).is(":checked")?$("#federated-avatar-lookup").checkbox("uncheck"):$("#offline-mode").checkbox("uncheck")})),$("#federated-avatar-lookup input").change((function(){$(this).is(":checked")&&($("#disable-gravatar").checkbox("uncheck"),$("#offline-mode").checkbox("uncheck"))})),$("#enable-openid-signin input").change((function(){$(this).is(":checked")?$("#disable-registration input").is(":checked")||$("#enable-openid-signup").checkbox("check"):$("#enable-openid-signup").checkbox("uncheck")})),$("#disable-registration input").change((function(){$(this).is(":checked")?($("#enable-captcha").checkbox("uncheck"),$("#enable-openid-signup").checkbox("uncheck")):$("#enable-openid-signup").checkbox("check")})),$("#enable-captcha input").change((function(){$(this).is(":checked")&&$("#disable-registration").checkbox("uncheck")}))),p(),(q=function(){var e=$("#auth_username").val(),t=$("#clone_addr").val();!$("#mirror").is(":checked")&&e&&e.length>0&&void 0!==t&&(t.startsWith("https://github.com")||t.startsWith("http://github.com"))?$("#migrate_items").show():$("#migrate_items").hide()})(),$("#clone_addr").on("input",q),$("#auth_username").on("input",q),$("#mirror").on("change",q),function(){var e=$(".repository.wiki textarea#edit_area");if(e.length>0){var t=new SimpleMDE({autoDownloadFontAwesome:!1,element:e[0],forceSync:!0,previewRender:function(t,a){return setTimeout((function(){$.post(e.data("url"),{_csrf:i,mode:"gfm",context:e.data("context"),text:t},(function(e){a.innerHTML='
'.concat(e,"
"),emojify.run($(".editor-preview")[0])}))}),0),"Loading..."},renderingConfig:{singleLineBreaks:!1},indentWithTabs:!1,tabSize:4,spellChecker:!1,toolbar:["bold","italic","strikethrough","|","heading-1","heading-2","heading-3","heading-bigger","heading-smaller","|",{name:"code-inline",action:function(e){var t=e.codemirror,a=t.getSelection();if(t.replaceSelection("`".concat(a,"`")),!a){var i=t.getCursor();t.setCursor(i.line,i.ch-1)}t.focus()},className:"fa fa-angle-right",title:"Add Inline Code"},"code","quote","|",{name:"checkbox-empty",action:function(e){var t=e.codemirror;t.replaceSelection("\n- [ ] ".concat(t.getSelection())),t.focus()},className:"fa fa-square-o",title:"Add Checkbox (empty)"},{name:"checkbox-checked",action:function(e){var t=e.codemirror;t.replaceSelection("\n- [x] ".concat(t.getSelection())),t.focus()},className:"fa fa-check-square-o",title:"Add Checkbox (checked)"},"|","unordered-list","ordered-list","|","link","image","table","horizontal-rule","|","clean-block","preview","fullscreen"]});$(t.codemirror.getInputField()).addClass("js-quick-submit")}}(),l(),g(),0!==$(".organization").length&&$(".organization.settings.options").length>0&&$("#org_name").keyup((function(){var e=$("#org-name-change-prompt");$(this).val().toString().toLowerCase()!==$(this).data("org-name").toString().toLowerCase()?e.show():e.hide()})),function(){if(0!==$(".new.webhook").length){$(".events.checkbox input").change((function(){$(this).is(":checked")&&$(".events.fields").show()})),$(".non-events.checkbox input").change((function(){$(this).is(":checked")&&$(".events.fields").hide()}));var e=function(){var e="POST"===$("#http_method").val();$("#content_type").parent().parent()[e?"show":"hide"]()};e(),$("#http_method").change((function(){e()})),$("#test-delivery").click((function(){var e=$(this);e.addClass("loading disabled"),$.post(e.data("link"),{_csrf:i}).done(setTimeout((function(){window.location.href=e.data("redirect")}),5e3))}))}}(),function(){if(0!==$(".admin").length){if(($(".admin.new.user").length>0||$(".admin.edit.user").length>0)&&$("#login_type").change((function(){"0"===$(this).val().substring(0,1)?($("#login_name").removeAttr("required"),$(".non-local").hide(),$(".local").show(),$("#user_name").focus(),"required"===$(this).data("password")&&$("#password").attr("required","required")):($("#login_name").attr("required","required"),$(".non-local").show(),$(".local").hide(),$("#login_name").focus(),$("#password").removeAttr("required"))})),$(".admin.new.authentication").length>0&&($("#auth_type").change((function(){$(".ldap, .dldap, .smtp, .pam, .oauth2, .has-tls .search-page-size").hide(),$(".ldap input[required], .binddnrequired input[required], .dldap input[required], .smtp input[required], .pam input[required], .oauth2 input[required], .has-tls input[required]").removeAttr("required"),$(".binddnrequired").removeClass("required");var e=$(this).val();switch(e){case"2":$(".ldap").show(),$(".binddnrequired input, .ldap div.required:not(.dldap) input").attr("required","required"),$(".binddnrequired").addClass("required");break;case"3":$(".smtp").show(),$(".has-tls").show(),$(".smtp div.required input, .has-tls").attr("required","required");break;case"4":$(".pam").show(),$(".pam input").attr("required","required");break;case"5":$(".dldap").show(),$(".dldap div.required:not(.ldap) input").attr("required","required");break;case"6":$(".oauth2").show(),$(".oauth2 div.required:not(.oauth2_use_custom_url,.oauth2_use_custom_url_field,.open_id_connect_auto_discovery_url) input").attr("required","required"),r()}"2"!==e&&"5"!==e||n(),"2"===e&&o()})),$("#auth_type").change(),$("#security_protocol").change(n),$("#use_paged_search").change(o),$("#oauth2_provider").change(r),$("#oauth2_use_custom_url").change(s)),$(".admin.edit.authentication").length>0){var e=$("#auth_type").val();"2"===e||"5"===e?($("#security_protocol").change(n),"2"===e&&$("#use_paged_search").change(o)):"6"===e&&($("#oauth2_provider").change(r),$("#oauth2_use_custom_url").change(s),r())}if($(".admin.notice")){var t=$("#detail-modal");$(".view-detail").click((function(){return t.find(".content p").text($(this).data("content")),t.modal("show"),!1}));var a=$(".select.table .ui.checkbox");$(".select.action").click((function(){switch($(this).data("action")){case"select-all":a.checkbox("check");break;case"deselect-all":a.checkbox("uncheck");break;case"inverse":a.checkbox("toggle")}})),$("#delete-selection").click((function(){var e=$(this);e.addClass("loading disabled");var t=[];a.each((function(){$(this).checkbox("is checked")&&t.push($(this).data("id"))})),$.post(e.data("link"),{_csrf:i,ids:t}).done((function(){window.location.href=e.data("redirect")}))}))}}function n(){$("#security_protocol").val()>0?$(".has-tls").show():$(".has-tls").hide()}function o(){$("#use_paged_search").prop("checked")?$(".search-page-size").show().find("input").attr("required","required"):$(".search-page-size").hide().find("input").removeAttr("required")}function r(){switch($(".open_id_connect_auto_discovery_url, .oauth2_use_custom_url").hide(),$(".open_id_connect_auto_discovery_url input[required]").removeAttr("required"),$("#oauth2_provider").val()){case"github":case"gitlab":case"gitea":$(".oauth2_use_custom_url").show();break;case"openidConnect":$(".open_id_connect_auto_discovery_url input").attr("required","required"),$(".open_id_connect_auto_discovery_url").show()}s()}function s(){var e=$("#oauth2_provider").val();if($(".oauth2_use_custom_url_field").hide(),$(".oauth2_use_custom_url_field input[required]").removeAttr("required"),$("#oauth2_use_custom_url").is(":checked"))switch($("#oauth2_token_url").val()||$("#oauth2_token_url").val($("#".concat(e,"_token_url")).val()),$("#oauth2_auth_url").val()||$("#oauth2_auth_url").val($("#".concat(e,"_auth_url")).val()),$("#oauth2_profile_url").val()||$("#oauth2_profile_url").val($("#".concat(e,"_profile_url")).val()),$("#oauth2_email_url").val()||$("#oauth2_email_url").val($("#".concat(e,"_email_url")).val()),e){case"github":$(".oauth2_token_url input, .oauth2_auth_url input, .oauth2_profile_url input, .oauth2_email_url input").attr("required","required"),$(".oauth2_token_url, .oauth2_auth_url, .oauth2_profile_url, .oauth2_email_url").show();break;case"gitea":case"gitlab":$(".oauth2_token_url input, .oauth2_auth_url input, .oauth2_profile_url input").attr("required","required"),$(".oauth2_token_url, .oauth2_auth_url, .oauth2_profile_url").show(),$("#oauth2_email_url").val("")}}}(),k(),function(){var e=document.getElementById("app");if(!e)return;Vue.component("repo-search",{delimiters:["${","}"],props:{searchLimit:{type:Number,default:10},suburl:{type:String,required:!0},uid:{type:Number,required:!0},organizations:{type:Array,default:[]},isOrganization:{type:Boolean,default:!0},canCreateOrganization:{type:Boolean,default:!1},organizationsTotalCount:{type:Number,default:0},moreReposLink:{type:String,default:""}},data:function(){return{tab:"repos",repos:[],reposTotalCount:0,reposFilter:"all",searchQuery:"",isLoading:!1,repoTypes:{all:{count:0,searchMode:""},forks:{count:0,searchMode:"fork"},mirrors:{count:0,searchMode:"mirror"},sources:{count:0,searchMode:"source"},collaborative:{count:0,searchMode:"collaborative"}}}},computed:{showMoreReposLink:function(){return this.repos.length>0&&this.repos.length'.concat(n[r],"
")).insertBefore(o);F.css("display","none"),R.show()}})).fail((function(t){if(422===t.status)if(t.responseJSON.invalidTopics.length>0){M.formatPrompt=t.responseJSON.message;var a=t.responseJSON.invalidTopics,i=z.children("a.ui.label");e.split(",").forEach((function(e,t){for(var n=0;n]*>?/gm,""),i=!1,n=[];if(z.find("div.label.visible.topic,a.label.visible").each((function(e,t){n.push(t.dataset.value)})),e.topics){for(var o=!1,r=0;r0&&!i?(t.success=!0,t.results.unshift({description:a,"data-value":a})):a.length>0&&i&&t.results.sort((function(e,t){return e.description.toLowerCase()===a.toLowerCase()?-1:t.description.toLowerCase()===a.toLowerCase()?1:e.description>t.description?-1:e.description').concat(a(n.repository.full_name),""),value:n.id})})),t},cache:!1},fullTextSearch:!0}),$(".menu a.label-filter-item").each((function(){$(this).click((function(e){if(e.altKey){e.preventDefault();var t=$(this).attr("href"),a=$(this).data("label-id"),i="labels=(-?[0-9]+%2c)*(".concat(a,")(%2c-?[0-9]+)*&");window.location=t.replace(new RegExp(i),"labels=$1-$2$3&")}}))})),$(".menu .ui.dropdown.label-filter").keydown((function(e){if(e.altKey&&13===e.keyCode){var t=$(".menu .ui.dropdown.label-filter .menu .item.selected");if(t.length>0){var a=$(t[0]),i=a.attr("href"),n=a.data("label-id"),o="labels=(-?[0-9]+%2c)*(".concat(n,")(%2c-?[0-9]+)*&");window.location=i.replace(new RegExp(o),"labels=$1-$2$3&")}}}))}(),$(".title_wip_desc > a").click((function(e){e.preventDefault();var t=$("#issue_title");t.focus();var a=t.val().trim().toUpperCase();for(var i in wipPrefixes)if(a.startsWith(wipPrefixes[i].toUpperCase()))return;t.val("".concat(wipPrefixes[0]," ").concat(t.val()))})),$(".show-outdated").on("click",(function(e){e.preventDefault();var t=$(this).data("comment");$(this).addClass("hide"),$("#code-comments-".concat(t)).removeClass("hide"),$("#code-preview-".concat(t)).removeClass("hide"),$("#hide-outdated-".concat(t)).removeClass("hide")})),$(".hide-outdated").on("click",(function(e){e.preventDefault();var t=$(this).data("comment");$(this).addClass("hide"),$("#code-comments-".concat(t)).addClass("hide"),$("#code-preview-".concat(t)).addClass("hide"),$("#show-outdated-".concat(t)).removeClass("hide")})),$("button.comment-form-reply").on("click",(function(e){e.preventDefault(),$(this).hide();var t=$(this).parent().find(".comment-form");t.removeClass("hide"),m(t.find(".menu"))})),0!==$(".repository.pull.diff").length&&($(".diff-detail-box.ui.sticky").sticky(),$(".btn-review").on("click",(function(e){e.preventDefault(),$(this).closest(".dropdown").find(".menu").toggle("visible")})).closest(".dropdown").find(".link.close").on("click",(function(e){e.preventDefault(),$(this).closest(".menu").toggle("visible")})),$(".code-view .lines-code,.code-view .lines-num").on("mouseenter",(function(){var e=$(this).closest("td");$(this).closest("tr").addClass(e.hasClass("lines-num-old")||e.hasClass("lines-code-old")?"focus-lines-old":"focus-lines-new")})).on("mouseleave",(function(){$(this).closest("tr").removeClass("focus-lines-new focus-lines-old")})),$(".add-code-comment").on("click",(function(e){if(!$(e.target).hasClass("btn-add-single")){e.preventDefault();var t=$(this).closest(".code-diff").hasClass("code-diff-split"),a=$(this).data("side"),i=$(this).data("idx"),n=$(this).data("path"),o=$("#pull_review_add_comment").html(),r=$(this).closest("tr"),s=r.next();s.hasClass("add-comment")||(s=$(''.concat(t?'':'',"")),r.after(s));var c=s.find(".add-comment-".concat(a)),l=c.find(".comment-code-cloud");0===l.length&&(c.html(o),m((l=c.find(".comment-code-cloud")).find(".menu")),c.find("input[name='line']").val(i),c.find("input[name='side']").val("left"===a?"previous":"proposed"),c.find("input[name='path']").val(n)),l.find("textarea").focus()}}))),function e(){var t=$("#repo_migrating");if($("#repo_migrating_failed").hide(),t){var a=t.attr("repo");if(void 0===a)return;$.ajax({type:"GET",url:"".concat(n,"/").concat(a,"/status"),data:{_csrf:i},complete:function(t){if(200===t.status&&t.responseJSON)return 0===t.responseJSON.status?void window.location.reload():void setTimeout((function(){e()}),2e3);$("#repo_migrating_progress").hide(),$("#repo_migrating_failed").show()}})}}(),function(){var e=$("#repo_template"),t=function(){var t=$("#template_units"),a=$("#non_template");""!==e.val()?(t.show(),a.hide()):(t.hide(),a.show())};e.change(t),t();var i=function(){$("#repo_template_search").dropdown({apiSettings:{url:"".concat(n,"/api/v1/repos/search?q={query}&template=true&priority_owner_id=").concat($("#uid").val()),onResponse:function(e){var t={success:!0,results:[]};return t.results.push({name:"",value:""}),$.each(e.data,(function(e,i){t.results.push({name:a(i.full_name),value:i.id})})),t},cache:!1},fullTextSearch:!0})};$("#uid").change(i),i()}(),$("#repo-clone-url").length>0)switch(localStorage.getItem("repo-clone-protocol")){case"ssh":0===$("#repo-clone-ssh").click().length&&$("#repo-clone-https").click();break;default:$("#repo-clone-https").click()}var J,V={"div.user.settings":b,"div.repository.settings.collaboration":v};for(J in V)if($(J).length>0){V[J]();break}var H=$("#clone_addr");H.change((function(){var e=$("#repo_name");H.val().length>0&&0===e.val().length&&e.val(H.val().match(/^(.*\/)?((.+?)(\.git)?)$/)[3])}))})),$((function(){0===$(".user.signin").length&&$("form:not(.ignore-dirty)").areYouSure(),$("#ssh-key-content").on("change paste keyup",(function(){var e=$(this).val().split(" "),t=$("#ssh-key-title");""===t.val()&&3===e.length&&""!==e[2]&&t.val(e[2])}))})),window.timeAddManual=function(){$(".mini.modal").modal({duration:200,onApprove:function(){$("#add_time_manual_form").submit()}}).modal("show")},window.toggleStopwatch=function(){$("#toggle_stopwatch_form").submit()},window.cancelStopwatch=function(){$("#cancel_stopwatch_form").submit()},window.initHeatmap=function(e,t,a){var i=document.getElementById(e);if(i){(a=a||{}).contributions=a.contributions||"contributions",a.no_contributions=a.no_contributions||"No contributions";var n=["${","}"];Vue.component("activity-heatmap",{delimiters:n,props:{user:{type:String,required:!0},suburl:{type:String,required:!0},locale:{type:Object,required:!0}},data:function(){return{isLoading:!0,colorRange:[],endDate:null,values:[],totalContributions:0}},mounted:function(){this.colorRange=[this.getColor(0),this.getColor(1),this.getColor(2),this.getColor(3),this.getColor(4),this.getColor(5)],this.endDate=new Date,this.loadHeatmap(this.user)},methods:{loadHeatmap:function(e){var t=this;$.get("".concat(this.suburl,"/api/v1/users/").concat(e,"/heatmap"),(function(e){for(var a=[],i=0;i

total contributions in the last 12 months

'}),new Vue({delimiters:n,el:i,data:{suburl:document.querySelector("meta[name=_suburl]").content,heatmapUser:t,locale:a}})}},$(".commit-button").click((function(e){e.preventDefault(),$(this).parent().find(".commit-body").toggle()})),window.toggleDeadlineForm=function(){$("#deadlineForm").fadeToggle(150)},window.setDeadline=function(){var e=$("#deadlineDate").val();window.updateDeadline(e)},window.updateDeadline=function(e){$("#deadline-err-invalid-date").hide(),$("#deadline-loader").addClass("loading");var t=null;if(""!==e){var a=Date.parse(e);if(Number.isNaN(a))return $("#deadline-loader").removeClass("loading"),$("#deadline-err-invalid-date").show(),!1;t=new Date(a)}$.ajax("".concat($("#update-issue-deadline-form").attr("action"),"/deadline"),{data:JSON.stringify({due_date:t}),headers:{"X-Csrf-Token":i,"X-Remote":!0},contentType:"application/json",type:"POST",success:function(){u()},error:function(){$("#deadline-loader").removeClass("loading"),$("#deadline-err-invalid-date").show()}})},window.deleteDependencyModal=function(e,t){$(".remove-dependency").modal({closable:!1,duration:200,onApprove:function(){$("#removeDependencyID").val(e),$("#dependencyType").val(t),$("#removeDependencyForm").submit()}}).modal("show")},window.cancelCodeComment=function(e){var t=$(e).closest("form");t.length>0&&t.hasClass("comment-form")?(t.addClass("hide"),t.parent().find("button.comment-form-reply").show()):t.closest(".comment-code-cloud").remove()},window.onOAuthLoginClick=function(){var e=$("#oauth2-login-loader"),t=$("#oauth2-login-navigator");t.hide(),e.removeClass("disabled"),setTimeout((function(){e.addClass("disabled"),t.show()}),5e3)}}]); //# sourceMappingURL=index.js.map